# HG changeset patch # User Doug Simon # Date 1427403525 -3600 # Node ID b2e8b26f504052e86a58635b71a8ba900edf7c29 # Parent 01290be48def5da7c6b4614eea9399aa2dc1925b removed uses of StringBuffer diff -r 01290be48def -r b2e8b26f5040 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java Thu Mar 26 17:06:40 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java Thu Mar 26 21:58:45 2015 +0100 @@ -299,7 +299,7 @@ @Test public void test14() throws Exception { - HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBufferTest", Object.class, Object.class); + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderTest", Object.class, Object.class); StringBuilder buffer = new StringBuilder("TestTestTestTestTestTestTest"); Assert.assertTrue(buffer.length() == 28); String a = new String("TestTestTestTestTestTestTest"); @@ -308,8 +308,8 @@ Assert.assertTrue(buffer.toString().equals("TestTestTestTestTestTestTestTestTestTestTestTestTestTest")); } - public static void stringBufferTest(Object c1, Object c2) { - StringBuffer source = (StringBuffer) c1; + public static void stringBuilderTest(Object c1, Object c2) { + StringBuilder source = (StringBuilder) c1; char[] add = (char[]) c2; for (int i = 0; i < add.length; i++) { source.append(add[i]); @@ -318,11 +318,11 @@ @Test public void test15() throws Exception { - HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBufferTestIn"); + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderTestIn"); installedBenchmarkCode.executeVarargs(); } - public static void stringBufferTestIn() { + public static void stringBuilderTestIn() { StringBuilder buffer = new StringBuilder("TestTestTestTestTestTestTest"); Assert.assertTrue(buffer.length() == 28); String a = new String("TestTestTestTestTestTestTest"); @@ -336,11 +336,11 @@ @Test public void test16() throws Exception { - HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBufferArrayCopy"); + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringBuilderArrayCopy"); installedBenchmarkCode.executeVarargs(); } - public static void stringBufferArrayCopy() { + public static void stringBuilderArrayCopy() { StringBuilder buffer = new StringBuilder("TestTestTestTestTestTestTest"); Assert.assertTrue(buffer.length() == 28); String a = new String("TestTestTestTestTestTestTest"); diff -r 01290be48def -r b2e8b26f5040 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java Thu Mar 26 17:06:40 2015 +0100 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java Thu Mar 26 21:58:45 2015 +0100 @@ -63,7 +63,7 @@ return cs.hashCode(); } - if (cs instanceof StringBuffer) { + if (cs instanceof StringBuilder) { int[] hash = {0}; cs.chars().forEach(c -> hash[0] += c); return hash[0];