src/java.base/share/classes/java/lang/StringBuilder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 8076112 Cdiff src/java.base/share/classes/java/lang/StringBuilder.java

src/java.base/share/classes/java/lang/StringBuilder.java

Print this page

        

*** 23,32 **** --- 23,33 ---- * questions. */ package java.lang; + import jdk.internal.HotSpotIntrinsicCandidate; /** * A mutable sequence of characters. This class provides an API compatible * with {@code StringBuffer}, but with no guarantee of synchronization. * This class is designed for use as a drop-in replacement for
*** 83,92 **** --- 84,94 ---- /** * Constructs a string builder with no characters in it and an * initial capacity of 16 characters. */ + @HotSpotIntrinsicCandidate public StringBuilder() { super(16); } /**
*** 95,104 **** --- 97,107 ---- * * @param capacity the initial capacity. * @throws NegativeArraySizeException if the {@code capacity} * argument is less than {@code 0}. */ + @HotSpotIntrinsicCandidate public StringBuilder(int capacity) { super(capacity); } /**
*** 106,115 **** --- 109,119 ---- * specified string. The initial capacity of the string builder is * {@code 16} plus the length of the string argument. * * @param str the initial contents of the buffer. */ + @HotSpotIntrinsicCandidate public StringBuilder(String str) { super(str.length() + 16); append(str); }
*** 130,139 **** --- 134,144 ---- public StringBuilder append(Object obj) { return append(String.valueOf(obj)); } @Override + @HotSpotIntrinsicCandidate public StringBuilder append(String str) { super.append(str); return this; }
*** 196,211 **** --- 201,218 ---- super.append(b); return this; } @Override + @HotSpotIntrinsicCandidate public StringBuilder append(char c) { super.append(c); return this; } @Override + @HotSpotIntrinsicCandidate public StringBuilder append(int i) { super.append(i); return this; }
*** 400,409 **** --- 407,417 ---- super.reverse(); return this; } @Override + @HotSpotIntrinsicCandidate public String toString() { // Create a copy, don't share the array return new String(value, 0, count); }
src/java.base/share/classes/java/lang/StringBuilder.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File