/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ |
D | StringBuilderTest.java | 34 StringBuilder sb = new StringBuilder(); in test_Constructor() local 35 assertNotNull(sb); in test_Constructor() 36 assertEquals(16, sb.capacity()); in test_Constructor() 43 StringBuilder sb = new StringBuilder(24); in test_ConstructorI() local 44 assertNotNull(sb); in test_ConstructorI() 45 assertEquals(24, sb.capacity()); in test_ConstructorI() 62 StringBuilder sb = new StringBuilder((CharSequence) "fixture"); in test_ConstructorLjava_lang_CharSequence() local 63 assertEquals("fixture", sb.toString()); in test_ConstructorLjava_lang_CharSequence() 64 assertEquals("fixture".length() + 16, sb.capacity()); in test_ConstructorLjava_lang_CharSequence() 66 sb = new StringBuilder((CharSequence) new StringBuffer("fixture")); in test_ConstructorLjava_lang_CharSequence() [all …]
|
D | StringBufferTest.java | 139 StringBuffer sb = new StringBuffer(); in test_appendLjava_lang_CharSequence() local 140 assertSame(sb, sb.append((CharSequence) "ab")); in test_appendLjava_lang_CharSequence() 141 assertEquals("ab", sb.toString()); in test_appendLjava_lang_CharSequence() 142 sb.setLength(0); in test_appendLjava_lang_CharSequence() 143 assertSame(sb, sb.append((CharSequence) "cd")); in test_appendLjava_lang_CharSequence() 144 assertEquals("cd", sb.toString()); in test_appendLjava_lang_CharSequence() 145 sb.setLength(0); in test_appendLjava_lang_CharSequence() 146 assertSame(sb, sb.append((CharSequence) null)); in test_appendLjava_lang_CharSequence() 147 assertEquals("null", sb.toString()); in test_appendLjava_lang_CharSequence() 155 StringBuffer sb = new StringBuffer(); in test_appendLjava_lang_CharSequenceII() local [all …]
|
D | StringBuffer2Test.java | 38 StringBuffer sb = new StringBuffer(8); in test_ConstructorI() local 39 assertEquals("Newly constructed buffer is of incorrect length", 0, sb in test_ConstructorI() 49 StringBuffer sb = new StringBuffer("HelloWorld"); in test_ConstructorLjava_lang_String() local 51 assertTrue("Invalid buffer created", sb.length() == 10 in test_ConstructorLjava_lang_String() 52 && (sb.toString().equals("HelloWorld"))); in test_ConstructorLjava_lang_String() 82 StringBuffer sb = new StringBuffer(); in test_append$CII() local 85 sb.append(buf1, 0, buf1.length); in test_append$CII() 86 assertEquals("Buffer is invalid length after append", 5, sb.length()); in test_append$CII() 87 sb.append(buf2, 0, buf2.length); in test_append$CII() 88 assertEquals("Buffer is invalid length after append", 10, sb.length()); in test_append$CII() [all …]
|
/libcore/ojluni/src/main/java/java/util/logging/ |
D | XMLFormatter.java | 50 private void a2(StringBuilder sb, int x) { in a2() argument 52 sb.append('0'); in a2() 54 sb.append(x); in a2() 58 private void appendISO8601(StringBuilder sb, long millis) { in appendISO8601() argument 61 sb.append(cal.get(Calendar.YEAR)); in appendISO8601() 62 sb.append('-'); in appendISO8601() 63 a2(sb, cal.get(Calendar.MONTH) + 1); in appendISO8601() 64 sb.append('-'); in appendISO8601() 65 a2(sb, cal.get(Calendar.DAY_OF_MONTH)); in appendISO8601() 66 sb.append('T'); in appendISO8601() [all …]
|
/libcore/luni/src/test/java/libcore/java/lang/ |
D | StringBuilderTest.java | 24 StringBuilder sb = new StringBuilder("oarFish_"); in test_deleteChatAt_lastRange() local 25 sb.append('a'); in test_deleteChatAt_lastRange() 26 String oarFishA = sb.toString(); in test_deleteChatAt_lastRange() 28 sb.deleteCharAt(sb.length() - 1); in test_deleteChatAt_lastRange() 29 sb.append('b'); in test_deleteChatAt_lastRange() 30 String oarFishB = sb.toString(); in test_deleteChatAt_lastRange() 38 StringBuilder sb = new StringBuilder(); in test_deleteCharAt_lastChar() local 39 sb.append('a'); in test_deleteCharAt_lastChar() 40 String a = sb.toString(); in test_deleteCharAt_lastChar() 42 sb.deleteCharAt(0); in test_deleteCharAt_lastChar() [all …]
|
/libcore/ojluni/src/test/java/lang/StringBuilder/ |
D | Supplementary.java | 94 StringBuilder sb = new StringBuilder(input[i]); in test1() local 99 testCodePoint(At, sb, 0, golden1[0][i]); in test1() 100 testCodePoint(At, sb, 9, golden1[1][i]); in test1() 101 testCodePoint(At, sb, sb.length()-1, golden1[2][i]); in test1() 106 testCodePoint(At, sb, -1); in test1() 107 testCodePoint(At, sb, sb.length()); in test1() 131 StringBuilder sb = new StringBuilder(input[i]); in test2() local 136 testCodePoint(Before, sb, 1, golden2[0][i]); in test2() 137 testCodePoint(Before, sb, 13, golden2[1][i]); in test2() 138 testCodePoint(Before, sb, sb.length(), golden2[2][i]); in test2() [all …]
|
D | BuilderForwarding.java | 89 StringBuilder sb = new StringBuilder(); in indexOfString() local 93 sb.indexOf(null); in indexOfString() 103 sb = new StringBuilder("xyz"); in indexOfString() 104 assertEquals( sb.indexOf("y"), 1 ); in indexOfString() 105 assertEquals( sb.indexOf("not found"), -1 ); in indexOfString() 110 StringBuilder sb = new StringBuilder(); in indexOfStringint() local 113 sb.indexOf(null,1); in indexOfStringint() 120 sb = new StringBuilder("xyyz"); in indexOfStringint() 121 assertEquals( sb.indexOf("y",0), 1 ); in indexOfStringint() 122 assertEquals( sb.indexOf("y",1), 1 ); in indexOfStringint() [all …]
|
D | EnsureCapacity.java | 55 StringBuilder sb = new StringBuilder("abc"); in testStringBuilder() local 56 int cap = sb.capacity(); in testStringBuilder() 59 sb.ensureCapacity(Integer.MIN_VALUE); in testStringBuilder() 60 checkCapacity(cap, sb.capacity()); in testStringBuilder() 65 sb.append(str, 0, Integer.MIN_VALUE + 10); in testStringBuilder() 72 StringBuffer sb = new StringBuffer("abc"); in testStringBuffer() local 73 int cap = sb.capacity(); in testStringBuffer() 76 sb.ensureCapacity(Integer.MIN_VALUE); in testStringBuffer() 77 checkCapacity(cap, sb.capacity()); in testStringBuffer() 82 sb.append(str, 0, Integer.MIN_VALUE + 10); in testStringBuffer()
|
/libcore/ojluni/src/test/java/lang/StringBuffer/ |
D | Supplementary.java | 92 StringBuffer sb = new StringBuffer(input[i]); in test1() local 97 testCodePoint(At, sb, 0, golden1[0][i]); in test1() 98 testCodePoint(At, sb, 9, golden1[1][i]); in test1() 99 testCodePoint(At, sb, sb.length()-1, golden1[2][i]); in test1() 104 testCodePoint(At, sb, -1); in test1() 105 testCodePoint(At, sb, sb.length()); in test1() 129 StringBuffer sb = new StringBuffer(input[i]); in test2() local 134 testCodePoint(Before, sb, 1, golden2[0][i]); in test2() 135 testCodePoint(Before, sb, 13, golden2[1][i]); in test2() 136 testCodePoint(Before, sb, sb.length(), golden2[2][i]); in test2() [all …]
|
D | BufferForwarding.java | 88 StringBuffer sb = new StringBuffer("xyz"); in indexOfString() local 89 assertEquals( sb.indexOf("y"), 1 ); in indexOfString() 90 assertEquals( sb.indexOf("not found"), -1 ); in indexOfString() 95 StringBuffer sb = new StringBuffer("xyyz"); in indexOfStringint() local 96 assertEquals( sb.indexOf("y",0), 1 ); in indexOfStringint() 97 assertEquals( sb.indexOf("y",1), 1 ); in indexOfStringint() 98 assertEquals( sb.indexOf("y",2), 2 ); in indexOfStringint() 99 assertEquals( sb.indexOf("not found"), -1 ); in indexOfStringint() 104 StringBuffer sb = new StringBuffer(); in indexOfStringIntNull() local 107 sb.indexOf(null,1); in indexOfStringIntNull() [all …]
|
/libcore/ojluni/src/test/java/util/stream/boottest/java/util/stream/ |
D | SpinedBufferTest.java | 67 SpinedBuffer<Integer> sb = new SpinedBuffer<>(); in createSpinedBuffer() local 68 Arrays.stream(array).boxed().forEach(sb); in createSpinedBuffer() 69 params.add(new Object[]{array, sb}); in createSpinedBuffer() 71 sb = new SpinedBuffer<>(size / 2); in createSpinedBuffer() 72 Arrays.stream(array).boxed().forEach(sb); in createSpinedBuffer() 73 params.add(new Object[]{array, sb}); in createSpinedBuffer() 75 sb = new SpinedBuffer<>(size); in createSpinedBuffer() 76 Arrays.stream(array).boxed().forEach(sb); in createSpinedBuffer() 77 params.add(new Object[]{array, sb}); in createSpinedBuffer() 79 sb = new SpinedBuffer<>(size * 2); in createSpinedBuffer() [all …]
|
/libcore/ojluni/src/main/java/sun/security/provider/certpath/ |
D | Vertex.java | 135 StringBuilder sb = new StringBuilder(); in certToString() local 145 return sb.toString(); in certToString() 148 sb.append("Issuer: ").append in certToString() 150 sb.append("Subject: ").append in certToString() 152 sb.append("SerialNum: ").append in certToString() 154 sb.append("Expires: ").append in certToString() 158 sb.append("IssuerUID: "); in certToString() 160 sb.append(b ? 1 : 0); in certToString() 162 sb.append("\n"); in certToString() 166 sb.append("SubjectUID: "); in certToString() [all …]
|
/libcore/luni/src/main/java/libcore/util/ |
D | Objects.java | 33 StringBuilder sb = new StringBuilder(); in toString() local 34 sb.append(c.getSimpleName()).append('['); in toString() 45 sb.append(','); in toString() 48 sb.append(f.getName()); in toString() 49 sb.append('='); in toString() 53 sb.append(Arrays.toString((boolean[]) value)); in toString() 55 sb.append(Arrays.toString((byte[]) value)); in toString() 57 sb.append(Arrays.toString((char[]) value)); in toString() 59 sb.append(Arrays.toString((double[]) value)); in toString() 61 sb.append(Arrays.toString((float[]) value)); in toString() [all …]
|
/libcore/benchmarks/src/benchmarks/regression/ |
D | StringBuilderBenchmark.java | 30 StringBuilder sb = new StringBuilder(); in timeAppendBoolean() local 32 sb.append(true); in timeAppendBoolean() 39 StringBuilder sb = new StringBuilder(); in timeAppendChar() local 41 sb.append('c'); in timeAppendChar() 49 StringBuilder sb = new StringBuilder(); in timeAppendCharArray() local 51 sb.append(chars); in timeAppendCharArray() 59 StringBuilder sb = new StringBuilder(); in timeAppendCharSequence() local 61 sb.append(cs); in timeAppendCharSequence() 69 StringBuilder sb = new StringBuilder(); in timeAppendSubCharSequence() local 71 sb.append(cs); in timeAppendSubCharSequence() [all …]
|
D | FormatterBenchmark.java | 35 StringBuilder sb = new StringBuilder(); in timeStringBuilder_NoFormatting() local 36 … sb.append("this is a reasonably short string that doesn't actually need any formatting"); in timeStringBuilder_NoFormatting() 59 StringBuilder sb = new StringBuilder(); in timeStringBuilder_OneInt() local 60 sb.append("this is a reasonably short string that has an int "); in timeStringBuilder_OneInt() 61 sb.append(1024); in timeStringBuilder_OneInt() 62 sb.append(" in it"); in timeStringBuilder_OneInt() 76 StringBuilder sb = new StringBuilder(); in timeStringBuilder_OneHexInt() local 77 sb.append("this is a reasonably short string that has an int "); in timeStringBuilder_OneHexInt() 78 sb.append(Integer.toHexString(1024)); in timeStringBuilder_OneHexInt() 79 sb.append(" in it"); in timeStringBuilder_OneHexInt() [all …]
|
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/ |
D | StreamBuilderTest.java | 100 Stream.Builder<Integer> sb = Stream.builder(); in testAfterBuilding() local 101 IntStream.range(0, size).boxed().forEach(sb); in testAfterBuilding() 102 sb.build(); in testAfterBuilding() 104 checkISE(() -> sb.accept(1)); in testAfterBuilding() 105 checkISE(() -> sb.add(1)); in testAfterBuilding() 106 checkISE(() -> sb.build()); in testAfterBuilding() 113 Stream.Builder<Integer> sb = Stream.builder(); in testStreamBuilder() 114 IntStream.range(0, s).boxed().forEach(sb); in testStreamBuilder() 115 return sb.build(); in testStreamBuilder() 119 Stream.Builder<Integer> sb = Stream.builder(); in testStreamBuilder() [all …]
|
/libcore/ojluni/src/test/java/lang/String/concat/ |
D | ImplicitStringConcat.java | 122 static StringBuffer sb = new StringBuffer("a"); field in ImplicitStringConcat 142 StringBuilder sb = new StringBuilder(); in testImplicitStringConcat() local 143 sb.append("foo"); in testImplicitStringConcat() 144 sb.append(myArr.toString()); in testImplicitStringConcat() 145 test(sb.toString(), s + myArr); in testImplicitStringConcat() 149 StringBuilder sb = new StringBuilder(); in testImplicitStringConcat() local 150 sb.append("foo"); in testImplicitStringConcat() 151 sb.append(s_myArr.toString()); in testImplicitStringConcat() 152 test(sb.toString(), s + s_myArr); in testImplicitStringConcat() 156 StringBuilder sb = new StringBuilder(); in testImplicitStringConcat() local [all …]
|
/libcore/support/src/test/java/tests/util/ |
D | SummaryStatistics.java | 73 StringBuilder sb = new StringBuilder("SummaryStatistics{"); in toString() local 74 sb.append("n="); in toString() 75 sb.append(numValues); in toString() 76 sb.append(",mean="); in toString() 77 sb.append(mean()); in toString() 78 sb.append(",var="); in toString() 79 sb.append(var()); in toString() 80 sb.append(",stddev="); in toString() 81 sb.append(stddev()); in toString() 82 sb.append(",coeffVar="); in toString() [all …]
|
/libcore/luni/src/test/java/libcore/java/nio/ |
D | OldAndroidNIOTest.java | 53 ShortBuffer sb = ShortBuffer.wrap(shortArray); in testNIO_short_array() local 54 shortBufferTest(sb); in testNIO_short_array() 349 ShortBuffer sb = bb.asShortBuffer(); in byteBufferTest() local 351 checkBuffer(sb); in byteBufferTest() 352 assertEquals(2, sb.capacity()); in byteBufferTest() 353 assertEquals((short) 0xA2A1, sb.get()); in byteBufferTest() 354 assertEquals((short) 0xA4A3, sb.get()); in byteBufferTest() 357 sb = bb.asShortBuffer(); in byteBufferTest() 359 checkBuffer(sb); in byteBufferTest() 360 assertEquals(2, sb.capacity()); in byteBufferTest() [all …]
|
/libcore/ojluni/src/main/java/sun/net/www/ |
D | ParseUtil.java | 178 StringBuilder sb = new StringBuilder(n); in decode() 189 sb.append(c); in decode() 220 sb.append(cb.flip().toString()); in decode() 223 return sb.toString(); in decode() 333 StringBuffer sb = new StringBuffer(); in toString() local 335 sb.append(scheme); in toString() 336 sb.append(':'); in toString() 338 appendSchemeSpecificPart(sb, opaquePart, in toString() 341 appendFragment(sb, fragment); in toString() 342 return sb.toString(); in toString() [all …]
|
/libcore/ojluni/src/main/java/java/util/regex/ |
D | PatternSyntaxException.java | 100 StringBuilder sb = new StringBuilder(); in getMessage() local 101 sb.append(desc); in getMessage() 103 sb.append(" near index "); in getMessage() 104 sb.append(index); in getMessage() 106 sb.append(System.lineSeparator()); in getMessage() 107 sb.append(pattern); in getMessage() 109 sb.append(System.lineSeparator()); in getMessage() 111 sb.append((pattern.charAt(i) == '\t') ? '\t' : ' '); in getMessage() 113 sb.append('^'); in getMessage() 115 return sb.toString(); in getMessage()
|
/libcore/ojluni/src/main/java/java/util/ |
D | Formatter.java | 3270 StringBuilder sb = new StringBuilder("%"); in toString() local 3273 sb.append(dupf.toString()); in toString() 3275 sb.append(index).append('$'); in toString() 3277 sb.append(width); in toString() 3279 sb.append('.').append(precision); in toString() 3281 sb.append(f.contains(Flags.UPPERCASE) ? 'T' : 't'); in toString() 3282 sb.append(f.contains(Flags.UPPERCASE) in toString() 3284 return sb.toString(); in toString() 3426 StringBuilder sb = new StringBuilder(); in print() local 3433 leadingSign(sb, neg); in print() [all …]
|
/libcore/ojluni/src/main/java/java/lang/reflect/ |
D | Executable.java | 73 void separateWithCommas(Class<?>[] types, StringBuilder sb) { in separateWithCommas() argument 75 sb.append(types[j].getTypeName()); in separateWithCommas() 77 sb.append(","); in separateWithCommas() 82 void printModifiersIfNonzero(StringBuilder sb, int mask, boolean isDefault) { in printModifiersIfNonzero() argument 86 sb.append(Modifier.toString(mod)).append(' '); in printModifiersIfNonzero() 90 sb.append(Modifier.toString(access_mod)).append(' '); in printModifiersIfNonzero() 92 sb.append("default "); in printModifiersIfNonzero() 95 sb.append(Modifier.toString(mod)).append(' '); in printModifiersIfNonzero() 104 StringBuilder sb = new StringBuilder(); in sharedToString() local 106 printModifiersIfNonzero(sb, modifierMask, isDefault); in sharedToString() [all …]
|
/libcore/ojluni/src/main/java/java/security/cert/ |
D | PKIXCertPathBuilderResult.java | 110 StringBuilder sb = new StringBuilder(); in toString() local 111 sb.append("PKIXCertPathBuilderResult: [\n"); in toString() 112 sb.append(" Certification Path: " + certPath + "\n"); in toString() 113 sb.append(" Trust Anchor: " + getTrustAnchor().toString() + "\n"); in toString() 114 sb.append(" Policy Tree: " + String.valueOf(getPolicyTree()) + "\n"); in toString() 115 sb.append(" Subject Public Key: " + getPublicKey() + "\n"); in toString() 116 sb.append("]"); in toString() 117 return sb.toString(); in toString()
|
/libcore/ojluni/src/main/java/java/beans/ |
D | PropertyChangeEvent.java | 154 StringBuilder sb = new StringBuilder(getClass().getName()); in toString() local 155 sb.append("[propertyName=").append(getPropertyName()); in toString() 156 appendTo(sb); in toString() 157 sb.append("; oldValue=").append(getOldValue()); in toString() 158 sb.append("; newValue=").append(getNewValue()); in toString() 159 sb.append("; propagationId=").append(getPropagationId()); in toString() 160 sb.append("; source=").append(getSource()); in toString() 161 return sb.append("]").toString(); in toString() 164 void appendTo(StringBuilder sb) { in appendTo() argument
|