changeset 20042:b2e8b26f5040

removed uses of StringBuffer
author Doug Simon <doug.simon@oracle.com>
date Thu, 26 Mar 2015 21:58:45 +0100
parents 01290be48def
children b9041d4e91c5
files graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/MemoryUsageBenchmark.java
diffstat 2 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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");
--- 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];