Home
last modified time | relevance | path

Searched refs:replace (Results 1 – 25 of 136) sorted by relevance

123456

/libcore/benchmarks/src/benchmarks/regression/
DStringReplaceBenchmark.java56 s.value.replace('z', '0'); in timeReplaceCharNonExistent()
62 s.value.replace('a', '0'); in timeReplaceCharRepeated()
68 s.value.replace('q', '0'); in timeReplaceSingleChar()
74 s.value.replace("fish", "0"); in timeReplaceSequenceNonExistent()
80 s.value.replace("jklm", "0"); in timeReplaceSequenceRepeated()
86 s.value.replace("qrst", "0"); in timeReplaceSingleSequence()
/libcore/ojluni/src/test/java/lang/StringBuffer/
DCompactStringBuffer.java86 check(new StringBuffer(ORIGIN).replace(0, 0, "\uFF21"), "\uFF21A"); in testCompactStringBufferForLatinA()
87 check(new StringBuffer(ORIGIN).replace(0, 1, "\uFF21"), "\uFF21"); in testCompactStringBufferForLatinA()
124 check(new StringBuffer(ORIGIN).replace(0, 0, "A"), "A\uFF21"); in testCompactStringBufferForNonLatinA()
125 check(new StringBuffer(ORIGIN).replace(0, 1, "A"), "A"); in testCompactStringBufferForNonLatinA()
152 check(new StringBuffer(ORIGIN).replace(0, 0, "A"), "A\uFF21A"); in testCompactStringBufferForMixedA1()
153 check(new StringBuffer(ORIGIN).replace(0, 1, "A"), "AA"); in testCompactStringBufferForMixedA1()
167 check(new StringBuffer(ORIGIN).replace(1, 2, "A"), "AA"); in testCompactStringBufferForMixedA2()
248 check(new StringBuffer(ORIGIN).replace(0, 2, "A"), "A\uD801\uDC01"); in testCompactStringForSupplementaryCodePoint()
249 check(new StringBuffer(ORIGIN).replace(0, 3, "A"), "A\uDC01"); in testCompactStringForSupplementaryCodePoint()
250 check(new StringBuffer(ORIGIN).replace(0, 2, "\uFF21"), in testCompactStringForSupplementaryCodePoint()
[all …]
DReplace.java40 sb.replace(i, i+1, "a"); in main()
/libcore/ojluni/src/test/java/lang/StringBuilder/
DCompactStringBuilder.java86 check(new StringBuilder(ORIGIN).replace(0, 0, "\uFF21"), "\uFF21A"); in testCompactStringBuilderForLatinA()
87 check(new StringBuilder(ORIGIN).replace(0, 1, "\uFF21"), "\uFF21"); in testCompactStringBuilderForLatinA()
124 check(new StringBuilder(ORIGIN).replace(0, 0, "A"), "A\uFF21"); in testCompactStringBuilderForNonLatinA()
125 check(new StringBuilder(ORIGIN).replace(0, 1, "A"), "A"); in testCompactStringBuilderForNonLatinA()
153 check(new StringBuilder(ORIGIN).replace(0, 0, "A"), "A\uFF21A"); in testCompactStringBuilderForMixedA1()
154 check(new StringBuilder(ORIGIN).replace(0, 1, "A"), "AA"); in testCompactStringBuilderForMixedA1()
168 check(new StringBuilder(ORIGIN).replace(1, 2, "A"), "AA"); in testCompactStringBuilderForMixedA2()
249 check(new StringBuilder(ORIGIN).replace(0, 2, "A"), "A\uD801\uDC01"); in testCompactStringForSupplementaryCodePoint()
250 check(new StringBuilder(ORIGIN).replace(0, 3, "A"), "A\uDC01"); in testCompactStringForSupplementaryCodePoint()
251 check(new StringBuilder(ORIGIN).replace(0, 2, "\uFF21"), in testCompactStringForSupplementaryCodePoint()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/
DConcurrentMap.java220 boolean replace(K key, V oldValue, V newValue); in replace() method
252 V replace(K key, V value); in replace() method
288 while (!replace(k, v, function.apply(k, v))) { in replaceAll()
374 : replace(key, oldValue, newValue)) in computeIfPresent()
424 if (replace(key, oldValue, newValue)) in compute()
486 if (replace(key, oldValue, newValue)) in merge()
/libcore/ojluni/src/test/java/lang/Double/
DParseHexFloatingPointTest.java67 s1 = s1.replace('x', 'X'); in testCase()
72 s2 = s2.replace('p', 'P'); in testCase()
99 return s.replace('a', 'A').replace('b', 'B').replace('c', 'C'). in upperCaseHex()
100 replace('d', 'D').replace('e','E').replace('f', 'F'); in upperCaseHex()
/libcore/luni/src/test/java/libcore/java/util/
DMapDefaultMethodTester.java228 assertFalse(m.replace(1, 1.0, 2.0)); in test_replace$K$V$V()
233 assertFalse(m.replace(1, 2.0, 2.0)); in test_replace$K$V$V()
238 assertTrue(m.replace(1, 1.0, 2.0)); in test_replace$K$V$V()
243 assertTrue(m.replace(null, 1.0, 2.0)); in test_replace$K$V$V()
247 m.replace(null, 1.0, 2.0); in test_replace$K$V$V()
254 assertTrue(m.replace(1, null, 1.0)); in test_replace$K$V$V()
259 m.replace(1, 1.0, null); in test_replace$K$V$V()
268 assertNull(m.replace(1, 1.0)); in test_replace$K$V()
273 assertEquals(1.0, m.replace(1, 2.0)); in test_replace$K$V()
278 assertEquals(1.0, m.replace(1, null)); in test_replace$K$V()
[all …]
DCollectionsTest.java507 Collections.unmodifiableMap(new HashMap<>()).replace(1, 5.0, 1.0); in test_unmodifiableMap_replace$K$V$V()
516 Collections.unmodifiableMap(m).replace(1, 5.0, 1.0); in test_unmodifiableMap_replace$K$V$V()
524 Collections.unmodifiableMap(new HashMap<>()).replace(1, 5.0); in test_unmodifiableMap_replace$K$V()
533 Collections.unmodifiableMap(m).replace(1, 5.0); in test_unmodifiableMap_replace$K$V()
922 assertThrowsUoe(() -> { map.replace(absentKey, absentValue, absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
923 assertThrowsUoe(() -> { map.replace(absentKey, absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
934 assertThrowsUoe(() -> { map.replace(sampleKey, sampleValue, absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
935 assertThrowsUoe(() -> { map.replace(sampleKey, absentValue); }); in check_unmodifiableOrderedMap_defaultMethods()
1025 assertThrowsCce(() -> { map.replace(new Object(), presentValue); }); in check_map_isChecked()
1026 assertThrowsCce(() -> { map.replace(presentKey, new Object()); }); in check_map_isChecked()
[all …]
/libcore/ojluni/src/main/java/sun/security/util/
DAlgorithmDecomposer.java156 private static void hasLoop(Set<String> elements, String find, String replace) { in hasLoop() argument
158 if (!elements.contains(replace)) { in hasLoop()
159 elements.add(replace); in hasLoop()
190 return algorithm.replace("-", ""); in hashName()
/libcore/luni/src/test/java/libcore/java/lang/
DOldStringBufferTest.java208 testBuffer.replace(-1, 0, "text"); in test_replaceIILjava_lang_String()
215 testBuffer.replace(0, -1, "text"); in test_replaceIILjava_lang_String()
222 testBuffer.replace(2, 1, "text"); in test_replaceIILjava_lang_String()
229 testBuffer.replace(testBuffer.length() + 1, testBuffer.length() + 1, in test_replaceIILjava_lang_String()
DOldStringTest.java166 assertEquals("Returned incorrect string.", hw1, hw1.replace("!", ".")); in test_replaceCC()
266 assertEquals("Failed replace", "aaccdd", "aabbdd".replace( in test_replaceLjava_langCharSequenceLjava_langCharSequence()
268 assertEquals("Failed replace by bigger seq", "cccbccc", "aba".replace( in test_replaceLjava_langCharSequenceLjava_langCharSequence()
271 "$aaaaa^".replace(new StringBuilder("aa"), "b")); in test_replaceLjava_langCharSequenceLjava_langCharSequence()
274 "".replace((CharSequence) null, "123".subSequence(0, 1)); in test_replaceLjava_langCharSequenceLjava_langCharSequence()
281 "".replace("123".subSequence(0, 1), (CharSequence) null); in test_replaceLjava_langCharSequenceLjava_langCharSequence()
DStringTest.java498 assertEquals("-h-e-l-l-o- -w-o-r-l-d-", "hello world".replace("", "-")); in test_55129()
499 assertEquals("-w-o-r-l-d-", "hello world".substring(6).replace("", "-")); in test_55129()
500 assertEquals("-*-w-*-o-*-r-*-l-*-d-*-", "hello world".substring(6).replace("", "-*-")); in test_55129()
504 assertEquals("", "".replace("", "")); in test_55129()
505 assertEquals("food", "".replace("", "food")); in test_55129()
510 assertEquals("", "".replace("foo", "bar")); in test_replace()
512 assertEquals("baz", "baz".replace("foo", "bar")); in test_replace()
514 assertEquals("mmmba", "bababa".replace("baba", "mmm")); in test_replace()
516 assertEquals("foodie", "foolish".replace("lish", "die")); in test_replace()
518 assertEquals("hahahaha", "kkkk".replace("k", "ha")); in test_replace()
/libcore/tools/expected_upstream/
Dcommon_util.py199 return path[base_len:-5].replace('/', '.')
211 relative_path = class_or_path.replace('.', '/')
251 partial_relative_path = input_class_name.replace('.', '/')
302 relative_path = class_or_path.replace('.', '/')
398 path = base_path + input_class_name.replace('.', '/')
404 result_list.append(relative_path.replace('/', '.'))
418 result = result.replace('/', '.')
/libcore/luni/src/main/java/libcore/reflect/
DInternalNames.java51 String name = internalName.substring(1, internalName.length() - 1).replace('/', '.'); in getClass()
84 return 'L' + c.getName().replace('.', '/') + ';'; in getInternalName()
/libcore/ojluni/src/test/java/lang/String/
DTranslateEscapes.java106 string.replace("\n", "\\n").replace("\r", "\\r"))); in verifyLineTerminator()
DLines.java89 String replace = string.replaceAll("\n", "\\n").replaceAll("\r", "\\r"); in testString() local
90 fail(String.format("Mismatch at line %d of \"%s\"%n", count, replace)); in testString()
/libcore/ojluni/src/test/java/util/Map/
DDefaults.java203 assertSame(map.replace(null, EXTRA_VALUE), null); in testReplaceKVNulls()
211 assertThrowsNPE(() -> map.replace(FIRST_KEY, null)); in testReplaceKVNoNulls()
212 …assertSame(map.replace(FIRST_KEY, EXTRA_VALUE), FIRST_VALUE, description + ": replaced wrong value… in testReplaceKVNoNulls()
221 assertSame(map.replace(KEYS[1], EXTRA_VALUE), expected); in testReplaceKV()
225 assertNull(map.replace(EXTRA_KEY, EXTRA_VALUE)); in testReplaceKV()
230 assertSame(map.replace(EXTRA_KEY, (String)expected), EXTRA_VALUE); in testReplaceKV()
238 assertFalse(map.replace(null, EXTRA_VALUE, EXTRA_VALUE)); in testReplaceKVVNulls()
240 assertTrue(map.replace(null, null, EXTRA_VALUE)); in testReplaceKVVNulls()
242 assertTrue(map.replace(null, EXTRA_VALUE, EXTRA_VALUE)); in testReplaceKVVNulls()
250 assertThrowsNPE(() -> map.replace(FIRST_KEY, FIRST_VALUE, null)); in testReplaceKVVNoNulls()
[all …]
/libcore/jsr166-tests/src/test/java/jsr166/
DConcurrentHashMapTest.java451 assertNull(map.replace(six, "Z")); in testReplace()
460 assertNotNull(map.replace(one, "Z")); in testReplace2()
470 assertFalse(map.replace(one, "Z", "Z")); in testReplaceValue()
480 assertTrue(map.replace(one, "A", "Z")); in testReplaceValue2()
683 c.replace(null, "whatever"); in testReplace_NullPointerException()
694 c.replace(null, one, "whatever"); in testReplaceValue_NullPointerException()
716 c.replace("whatever", null); in testReplace2_NullPointerException()
727 c.replace("whatever", null, "A"); in testReplaceValue2_NullPointerException()
738 c.replace("whatever", one, null); in testReplaceValue3_NullPointerException()
/libcore/ojluni/src/test/java/lang/String/CompactString/
DReplace.java71 data.replace(oldChar, newChar), in testReplace()
109 data.replace(target, replacement), in testReplace()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DString2Test.java678 assertEquals("Failed replace", "HezzoWorzd", hw1.replace('l', 'z')); in test_replaceCC()
685 assertEquals("Failed replace", "aaccdd", "aabbdd".replace( in test_replaceLjava_langCharSequenceLjava_langCharSequence()
687 assertEquals("Failed replace by bigger seq", "cccbccc", "aba".replace( in test_replaceLjava_langCharSequenceLjava_langCharSequence()
690 .replace(new StringBuilder("aa"), "b")); in test_replaceLjava_langCharSequenceLjava_langCharSequence()
692 "abc".replace("", "%%")); in test_replaceLjava_langCharSequenceLjava_langCharSequence()
694 "aabbcc".replace("b", "")); in test_replaceLjava_langCharSequenceLjava_langCharSequence()
696 "".replace("", "abc")); in test_replaceLjava_langCharSequenceLjava_langCharSequence()
DStringBuffer2Test.java476 testBuffer.replace(5, 9, "is a replaced"); in test_replaceIILjava_lang_String()
481 assertEquals("insert1", "text", new StringBuffer().replace(0, 0, "text") in test_replaceIILjava_lang_String()
483 assertEquals("insert2", "123text", new StringBuffer("123").replace(3, 3, "text") in test_replaceIILjava_lang_String()
485 assertEquals("insert2", "1text23", new StringBuffer("123").replace(1, 1, "text") in test_replaceIILjava_lang_String()
/libcore/ojluni/src/test/java/util/concurrent/tck/
DConcurrentHashMapTest.java491 assertNull(map.replace(six, "Z")); in testReplace()
500 assertNotNull(map.replace(one, "Z")); in testReplace2()
510 assertFalse(map.replace(one, "Z", "Z")); in testReplaceValue()
520 assertTrue(map.replace(one, "A", "Z")); in testReplaceValue2()
723 c.replace(null, "whatever"); in testReplace_NullPointerException()
734 c.replace(null, one, "whatever"); in testReplaceValue_NullPointerException()
756 c.replace("whatever", null); in testReplace2_NullPointerException()
767 c.replace("whatever", null, "A"); in testReplaceValue2_NullPointerException()
778 c.replace("whatever", one, null); in testReplaceValue3_NullPointerException()
/libcore/support/src/test/java/org/apache/harmony/testframework/serialization/
DSerializationTest.java114 String path = name.substring(0, dot).replace('.', File.separatorChar); in getDataFile()
132 + getClass().getName().replace('.', File.separatorChar) in produceGoldenFiles()
426 path.append(test.getClass().getName().replace('.', File.separatorChar)); in getObject()
449 String goldenPath = (test.getClass().getName().replace('.', File.separatorChar) in createGoldenFile()
/libcore/ojluni/src/main/java/sun/misc/
DRegexpPool.java74 public void replace(String re, Object ret) { in replace() method in RegexpPool
165 private void add(String re, Object ret, boolean replace) throws REException { in add() argument
184 if (p.result != null && !replace) in add()
/libcore/ojluni/src/main/java/sun/invoke/util/
DBytecodeDescriptor.java81 String name = str.substring(begc, endc).replace('/', '.'); in parseSig()
132 sb.append(t.getName().replace('.', '/')); in unparseSig()

123456