Home
last modified time | relevance | path

Searched refs:sb (Results 1 – 25 of 192) sorted by relevance

12345678

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DStringBuilderTest.java34 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 …]
DStringBufferTest.java139 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 …]
DStringBuffer2Test.java38 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/
DXMLFormatter.java50 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/
DStringBuilderTest.java24 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/util/stream/boottest/java/util/stream/
DSpinedBufferTest.java67 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/luni/src/main/java/libcore/util/
DObjects.java33 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/ojluni/src/main/java/sun/security/provider/certpath/
DVertex.java135 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/benchmarks/src/benchmarks/regression/
DStringBuilderBenchmark.java30 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 …]
DFormatterBenchmark.java35 StringBuilder sb = new StringBuilder(); in timeStringBuilder_NoFormatting() local
36sb.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/support/src/test/java/tests/util/
DSummaryStatistics.java73 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/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
DStreamBuilderTest.java93 Stream.Builder<Integer> sb = Stream.builder(); in testAfterBuilding() local
94 IntStream.range(0, size).boxed().forEach(sb); in testAfterBuilding()
95 sb.build(); in testAfterBuilding()
97 checkISE(() -> sb.accept(1)); in testAfterBuilding()
98 checkISE(() -> sb.add(1)); in testAfterBuilding()
99 checkISE(() -> sb.build()); in testAfterBuilding()
105 Stream.Builder<Integer> sb = Stream.builder(); in testStreamBuilder()
106 IntStream.range(0, s).boxed().forEach(sb); in testStreamBuilder()
107 return sb.build(); in testStreamBuilder()
111 Stream.Builder<Integer> sb = Stream.builder(); in testStreamBuilder()
[all …]
/libcore/ojluni/src/main/java/java/util/regex/
DPatternSyntaxException.java108 StringBuffer sb = new StringBuffer(); in getMessage() local
109 sb.append(desc); in getMessage()
111 sb.append(" near index "); in getMessage()
112 sb.append(index); in getMessage()
114 sb.append(nl); in getMessage()
115 sb.append(pattern); in getMessage()
117 sb.append(nl); in getMessage()
118 for (int i = 0; i < index; i++) sb.append(' '); in getMessage()
119 sb.append('^'); in getMessage()
121 return sb.toString(); in getMessage()
/libcore/luni/src/test/java/libcore/java/nio/
DOldAndroidNIOTest.java53 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/
DParseUtil.java178 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/security/cert/
DPKIXCertPathBuilderResult.java110 StringBuffer sb = new StringBuffer(); 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/
DPropertyChangeEvent.java154 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
/libcore/ojluni/src/main/java/java/lang/reflect/
DExecutable.java73 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 …]
DModifier.java244 StringBuilder sb = new StringBuilder(); in toString() local
247 if ((mod & PUBLIC) != 0) sb.append("public "); in toString()
248 if ((mod & PROTECTED) != 0) sb.append("protected "); in toString()
249 if ((mod & PRIVATE) != 0) sb.append("private "); in toString()
252 if ((mod & ABSTRACT) != 0) sb.append("abstract "); in toString()
253 if ((mod & STATIC) != 0) sb.append("static "); in toString()
254 if ((mod & FINAL) != 0) sb.append("final "); in toString()
255 if ((mod & TRANSIENT) != 0) sb.append("transient "); in toString()
256 if ((mod & VOLATILE) != 0) sb.append("volatile "); in toString()
257 if ((mod & SYNCHRONIZED) != 0) sb.append("synchronized "); in toString()
[all …]
/libcore/ojluni/src/main/java/java/util/
DFormatter.java3014 StringBuilder sb = new StringBuilder(); in justify()
3018 for (int i = 0; i < sp; i++) sb.append(' '); in justify()
3019 sb.append(s); in justify()
3021 for (int i = 0; i < sp; i++) sb.append(' '); in justify()
3022 return sb.toString(); in justify()
3026 StringBuilder sb = new StringBuilder("%"); in toString() local
3029 sb.append(dupf.toString()); in toString()
3031 sb.append(index).append('$'); in toString()
3033 sb.append(width); in toString()
3035 sb.append('.').append(precision); in toString()
[all …]
/libcore/ojluni/src/main/java/java/net/
DURISyntaxException.java124 StringBuffer sb = new StringBuffer(); in getMessage() local
125 sb.append(getReason()); in getMessage()
127 sb.append(" at index "); in getMessage()
128 sb.append(index); in getMessage()
130 sb.append(": "); in getMessage()
131 sb.append(input); in getMessage()
132 return sb.toString(); in getMessage()
/libcore/ojluni/src/main/java/java/nio/file/
DInvalidPathException.java120 StringBuffer sb = new StringBuffer(); in getMessage() local
121 sb.append(getReason()); in getMessage()
123 sb.append(" at index "); in getMessage()
124 sb.append(index); in getMessage()
126 sb.append(": "); in getMessage()
127 sb.append(input); in getMessage()
128 return sb.toString(); in getMessage()
/libcore/ojluni/src/main/java/java/nio/file/attribute/
DPosixFilePermissions.java42 private static void writeBits(StringBuilder sb, boolean r, boolean w, boolean x) { in writeBits() argument
44 sb.append('r'); in writeBits()
46 sb.append('-'); in writeBits()
49 sb.append('w'); in writeBits()
51 sb.append('-'); in writeBits()
54 sb.append('x'); in writeBits()
56 sb.append('-'); in writeBits()
74 StringBuilder sb = new StringBuilder(9); in toString() local
75 writeBits(sb, perms.contains(OWNER_READ), perms.contains(OWNER_WRITE), in toString()
77 writeBits(sb, perms.contains(GROUP_READ), perms.contains(GROUP_WRITE), in toString()
[all …]
/libcore/ojluni/src/main/java/sun/util/calendar/
DEra.java147 StringBuilder sb = new StringBuilder(); in toString() local
148 sb.append('['); in toString()
149 sb.append(getName()).append(" ("); in toString()
150 sb.append(getAbbreviation()).append(')'); in toString()
151 sb.append(" since ").append(getSinceDate()); in toString()
153 sb.setLength(sb.length() - 1); // remove 'Z' in toString()
154 sb.append(" local time"); in toString()
156 sb.append(']'); in toString()
157 return sb.toString(); in toString()
/libcore/ojluni/src/main/java/sun/invoke/util/
DBytecodeDescriptor.java98 StringBuilder sb = new StringBuilder(); in unparse() local
99 unparseSig(type, sb); in unparse()
100 return sb.toString(); in unparse()
116 StringBuilder sb = new StringBuilder(); in unparseMethod() local
117 sb.append('('); in unparseMethod()
119 unparseSig(pt, sb); in unparseMethod()
120 sb.append(')'); in unparseMethod()
121 unparseSig(rtype, sb); in unparseMethod()
122 return sb.toString(); in unparseMethod()
125 static private void unparseSig(Class<?> t, StringBuilder sb) { in unparseSig() argument
[all …]

12345678