Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.1:Update
xerces-j2
arrays-doubling.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File arrays-doubling.patch of Package xerces-j2
--- xerces/src/org/apache/xerces/util/XMLStringBuffer.java 2006/09/18 05:12:57 447241 +++ xerces/src/org/apache/xerces/util/XMLStringBuffer.java 2013/07/25 18:13:37 @@ -111,12 +111,13 @@ */ public void append(char c) { if (this.length + 1 > this.ch.length) { - int newLength = this.ch.length*2; - if (newLength < this.ch.length + DEFAULT_SIZE) - newLength = this.ch.length + DEFAULT_SIZE; - char[] newch = new char[newLength]; - System.arraycopy(this.ch, 0, newch, 0, this.length); - this.ch = newch; + int newLength = this.ch.length * 2; + if (newLength < this.ch.length + DEFAULT_SIZE) { + newLength = this.ch.length + DEFAULT_SIZE; + } + char[] newch = new char[newLength]; + System.arraycopy(this.ch, 0, newch, 0, this.length); + this.ch = newch; } this.ch[this.length] = c; this.length++; @@ -130,9 +131,10 @@ public void append(String s) { int length = s.length(); if (this.length + length > this.ch.length) { - int newLength = this.ch.length*2; - if (newLength < this.length + length + DEFAULT_SIZE) + int newLength = this.ch.length * 2; + if (newLength < this.length + length + DEFAULT_SIZE) { newLength = this.ch.length + length + DEFAULT_SIZE; + } char[] newch = new char[newLength]; System.arraycopy(this.ch, 0, newch, 0, this.length); this.ch = newch; @@ -150,7 +152,11 @@ */ public void append(char[] ch, int offset, int length) { if (this.length + length > this.ch.length) { - char[] newch = new char[this.ch.length + length + DEFAULT_SIZE]; + int newLength = this.ch.length * 2; + if (newLength < this.length + length + DEFAULT_SIZE) { + newLength = this.ch.length + length + DEFAULT_SIZE; + } + char[] newch = new char[newLength]; System.arraycopy(this.ch, 0, newch, 0, this.length); this.ch = newch; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor