src/java.base/share/classes/java/lang/StringBuffer.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
*** old/src/java.base/share/classes/java/lang/StringBuffer.java Mon Jun 29 11:11:55 2015
--- new/src/java.base/share/classes/java/lang/StringBuffer.java Mon Jun 29 11:11:54 2015
*** 24,33 ****
--- 24,34 ----
*/
package java.lang;
import java.util.Arrays;
+ import jdk.internal.HotSpotIntrinsicCandidate;
/**
* A thread-safe, mutable sequence of characters.
* A string buffer is like a {@link String}, but can be modified. At any
* point in time it contains some particular sequence of characters, but
*** 110,119 ****
--- 111,121 ----
/**
* Constructs a string buffer with no characters in it and an
* initial capacity of 16 characters.
*/
+ @HotSpotIntrinsicCandidate
public StringBuffer() {
super(16);
}
/**
*** 122,131 ****
--- 124,134 ----
*
* @param capacity the initial capacity.
* @exception NegativeArraySizeException if the {@code capacity}
* argument is less than {@code 0}.
*/
+ @HotSpotIntrinsicCandidate
public StringBuffer(int capacity) {
super(capacity);
}
/**
*** 133,142 ****
--- 136,146 ----
* specified string. The initial capacity of the string buffer is
* {@code 16} plus the length of the string argument.
*
* @param str the initial contents of the buffer.
*/
+ @HotSpotIntrinsicCandidate
public StringBuffer(String str) {
super(str.length() + 16);
append(str);
}
*** 269,278 ****
--- 273,283 ----
super.append(String.valueOf(obj));
return this;
}
@Override
+ @HotSpotIntrinsicCandidate
public synchronized StringBuffer append(String str) {
toStringCache = null;
super.append(str);
return this;
}
*** 380,396 ****
--- 385,403 ----
super.append(b);
return this;
}
@Override
+ @HotSpotIntrinsicCandidate
public synchronized StringBuffer append(char c) {
toStringCache = null;
super.append(c);
return this;
}
@Override
+ @HotSpotIntrinsicCandidate
public synchronized StringBuffer append(int i) {
toStringCache = null;
super.append(i);
return this;
}
*** 668,677 ****
--- 675,685 ----
super.reverse();
return this;
}
@Override
+ @HotSpotIntrinsicCandidate
public synchronized String toString() {
if (toStringCache == null) {
toStringCache = Arrays.copyOfRange(value, 0, count);
}
return new String(toStringCache, true);
src/java.base/share/classes/java/lang/StringBuffer.java
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File