# HG changeset patch # User Christos Kotselidis # Date 1370855218 -7200 # Node ID 390df0b3eefec06f0239166c6c2e85f5ceaf14fd # Parent 5f2ab1ec1a8777f629e386ba97385379440d2b1b Refactor CompressedOopTest diff -r 5f2ab1ec1a87 -r 390df0b3eefe 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 Mon Jun 10 10:14:17 2013 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/CompressedOopTest.java Mon Jun 10 11:06:58 2013 +0200 @@ -29,7 +29,6 @@ import org.junit.*; -import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.api.runtime.*; import com.oracle.graal.compiler.test.*; @@ -42,137 +41,169 @@ public class CompressedOopTest extends GraalCompilerTest { private final MetaAccessProvider metaAccessProvider; - Object[] argsToBind; public CompressedOopTest() { this.metaAccessProvider = Graal.getRequiredCapability(MetaAccessProvider.class); } + private HotSpotInstalledCode getInstalledCode(String name) throws Exception { + final Method method = CompressedOopTest.class.getMethod(name, Object.class, Object.class, Object.class); + final HotSpotResolvedJavaMethod javaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(method); + final HotSpotInstalledCode installedBenchmarkCode = (HotSpotInstalledCode) getCode(javaMethod, parse(method)); + return installedBenchmarkCode; + } + @Test - public void test() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("fieldTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; - final Method benchmarkMethod = CompressedOopTest.class.getMethod("benchmark", HotSpotInstalledCode.class, Object.class, Object.class, Object.class); - final ResolvedJavaMethod benchmarkJavaMethod = metaAccessProvider.lookupJavaMethod(benchmarkMethod); - final HotSpotInstalledCode installedBenchmarkCode = (HotSpotInstalledCode) getCode(benchmarkJavaMethod, parse(benchmarkMethod)); + public void test() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("fieldTest"); Container c1 = new Container(); - Assert.assertEquals(c1.b, installedBenchmarkCode.executeVarargs(argsToBind[0], c1, c1, c1)); + Assert.assertEquals(c1.b, installedBenchmarkCode.executeVarargs(c1, c1, c1)); + } + + public static Object fieldTest(Object c1, @SuppressWarnings("unused") Object c2, @SuppressWarnings("unused") Object c3) { + ((Container) c1).a = ((Container) c1).b; + return ((Container) c1).a; } @Test - public void test1() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("arrayTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; - final Method benchmarkMethod = CompressedOopTest.class.getMethod("benchmark", HotSpotInstalledCode.class, Object.class, Object.class, Object.class); - final ResolvedJavaMethod benchmarkJavaMethod = metaAccessProvider.lookupJavaMethod(benchmarkMethod); - final HotSpotInstalledCode installedBenchmarkCode = (HotSpotInstalledCode) getCode(benchmarkJavaMethod, parse(benchmarkMethod)); + public void test1() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("arrayTest"); ArrayContainer ac = new ArrayContainer(); - Assert.assertEquals(ac.a[9], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 0, 9)); - Assert.assertEquals(ac.a[8], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 1, 8)); - Assert.assertEquals(ac.a[7], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 2, 7)); - Assert.assertEquals(ac.a[6], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 3, 6)); - Assert.assertEquals(ac.a[5], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 4, 5)); - Assert.assertEquals(ac.a[4], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 5, 4)); - Assert.assertEquals(ac.a[3], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 6, 3)); - Assert.assertEquals(ac.a[2], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 7, 2)); - Assert.assertEquals(ac.a[1], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 8, 1)); - Assert.assertEquals(ac.a[0], installedBenchmarkCode.executeVarargs(argsToBind[0], ac.a, 9, 0)); + Assert.assertEquals(ac.a[9], installedBenchmarkCode.executeVarargs(ac.a, 0, 9)); + Assert.assertEquals(ac.a[8], installedBenchmarkCode.executeVarargs(ac.a, 1, 8)); + Assert.assertEquals(ac.a[7], installedBenchmarkCode.executeVarargs(ac.a, 2, 7)); + Assert.assertEquals(ac.a[6], installedBenchmarkCode.executeVarargs(ac.a, 3, 6)); + Assert.assertEquals(ac.a[5], installedBenchmarkCode.executeVarargs(ac.a, 4, 5)); + Assert.assertEquals(ac.a[4], installedBenchmarkCode.executeVarargs(ac.a, 5, 4)); + Assert.assertEquals(ac.a[3], installedBenchmarkCode.executeVarargs(ac.a, 6, 3)); + Assert.assertEquals(ac.a[2], installedBenchmarkCode.executeVarargs(ac.a, 7, 2)); + Assert.assertEquals(ac.a[1], installedBenchmarkCode.executeVarargs(ac.a, 8, 1)); + Assert.assertEquals(ac.a[0], installedBenchmarkCode.executeVarargs(ac.a, 9, 0)); + } + + public static Object arrayTest(Object c1, Object c2, Object c3) { + Object[] array = (Object[]) c1; + int initialIndex = ((Integer) c2).intValue(); + int replacingIndex = ((Integer) c3).intValue(); + array[initialIndex] = array[replacingIndex]; + return array[initialIndex]; } @Test - public void test2() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("arrayCopyTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; + public void test2() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("arrayCopyTest"); ArrayContainer source = new ArrayContainer(); ArrayContainer destination = new ArrayContainer(); Assert.assertEquals(source.a.length, destination.a.length); Assert.assertFalse(Arrays.equals(source.a, destination.a)); - fooCode.execute(source.a, destination.a, source.a); + installedBenchmarkCode.execute(source.a, destination.a, source.a); Assert.assertArrayEquals(source.a, destination.a); } + public static void arrayCopyTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { + Object[] source = (Object[]) c1; + Object[] destination = (Object[]) c2; + System.arraycopy(source, 0, destination, 0, source.length); + } + @Test - public void test3() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("compareAndSwapTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; + public void test3() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("compareAndSwapTest"); Object initial = new Object(); Object replacement = new Object(); AtomicReference cas = new AtomicReference<>(); Assert.assertEquals(cas.get(), null); - fooCode.execute(cas, null, initial); + installedBenchmarkCode.execute(cas, null, initial); Assert.assertEquals(cas.get(), initial); - fooCode.execute(cas, initial, replacement); + installedBenchmarkCode.execute(cas, initial, replacement); Assert.assertEquals(cas.get(), replacement); } + @SuppressWarnings("unchecked") + public static void compareAndSwapTest(Object c1, Object c2, Object c3) throws ClassCastException { + AtomicReference cas = (AtomicReference) c1; + cas.compareAndSet(c2, c3); + } + @Test - public void test4() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("charArrayCopyTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; + public void test4() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("charArrayCopyTest"); StringContainer1 source1 = new StringContainer1(); StringContainer2 source2 = new StringContainer2(); char[] result = new char[source1.value.length + source2.value.length]; - fooCode.execute(source1.value, source2.value, result); + installedBenchmarkCode.execute(source1.value, source2.value, result); Assert.assertArrayEquals(new char[]{'T', 'e', 's', 't', ' ', 'S', 't', 'r', 'i', 'n', 'g'}, result); } + public static char[] charArrayCopyTest(Object c1, Object c2, Object c3) { + char[] source1 = (char[]) c1; + char[] source2 = (char[]) c2; + char[] result = (char[]) c3; + for (int i = 0; i < source1.length; i++) { + result[i] = source1[i]; + } + + for (int i = 0; i < source2.length; i++) { + result[source1.length + i] = source2[i]; + } + return result; + } + @Test - public void test5() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("charContainerArrayCopyTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; + public void test5() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("charContainerArrayCopyTest"); StringContainer1 source1 = new StringContainer1(); StringContainer2 source2 = new StringContainer2(); char[] result = new char[source1.value.length + source2.value.length]; - fooCode.execute(source1, source2, result); + installedBenchmarkCode.execute(source1, source2, result); Assert.assertArrayEquals(new char[]{'T', 'e', 's', 't', ' ', 'S', 't', 'r', 'i', 'n', 'g'}, result); } + public static char[] charContainerArrayCopyTest(Object c1, Object c2, Object c3) { + char[] source1 = ((StringContainer1) c1).value; + char[] source2 = ((StringContainer2) c2).value; + char[] result = (char[]) c3; + for (int i = 0; i < source1.length; i++) { + result[i] = source1[i]; + } + for (int i = 0; i < source2.length; i++) { + result[source1.length + i] = source2[i]; + } + return result; + } + @Test - public void test6() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("stringCopyTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; + public void test6() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringCopyTest"); String a = new String("Test "); String b = new String("String"); - String c = (String) fooCode.execute(a, b, null); + String c = (String) installedBenchmarkCode.execute(a, b, null); Assert.assertTrue(c.equals("Test String")); } + public static String stringCopyTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { + String source = (String) c1; + String destination = (String) c2; + return source + destination; + } + @Test - public void test7() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("queueTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; + public void test7() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("queueTest"); ArrayDeque q = new ArrayDeque<>(); Object[] objects = new Object[512]; for (int i = 0; i < objects.length; i++) { objects[i] = new Object(); } - int j = 0; while (j < objects.length) { - fooCode.execute(q, objects[j], null); + installedBenchmarkCode.execute(q, objects[j], null); j++; } System.gc(); Assert.assertTrue(q.size() == objects.length); Assert.assertTrue(!q.isEmpty()); - j = 0; while (j < objects.length) { Assert.assertTrue(objects[j] == q.remove()); @@ -183,18 +214,20 @@ Assert.assertTrue(q.isEmpty()); } + @SuppressWarnings("unchecked") + public static void queueTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { + ArrayDeque queue = (ArrayDeque) c1; + queue.add(c2); + } + @Test - public void test8() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("unmodListTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; + public void test8() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("unmodListTest"); List list = new ArrayList<>(); for (int i = 0; i < 512; i++) { list.add(new Object()); } - - Object[] array = (Object[]) fooCode.execute(list, null, null); + Object[] array = (Object[]) installedBenchmarkCode.execute(list, null, null); Assert.assertTrue(list.size() == array.length); int i = 0; for (Object obj : list) { @@ -203,134 +236,6 @@ } } - @Test - public void test9() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("unmodListTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; - List list = new ArrayList<>(); - Object[] array = (Object[]) fooCode.execute(list, null, null); - Assert.assertTrue(list.size() == array.length); - } - - public void test10() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("constantTest", Object.class, Object.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; - Container c = new Container(); - Assert.assertFalse((boolean) fooCode.execute(c, null, null)); - } - - @Test - public void test11() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("stringEqualsTest", String.class, String.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; - String s1 = new String("Test"); - String s2 = new String("Test"); - boolean result = ((Boolean) (fooCode.execute(s1, s2, null))).booleanValue(); - Assert.assertTrue(result); - } - - @Test - public void test12() throws NoSuchMethodException, SecurityException, InvalidInstalledCodeException { - final Method fooMethod = CompressedOopTest.class.getMethod("stringConstantEqualsTest", String.class, String.class, Object.class); - final HotSpotResolvedJavaMethod fooJavaMethod = (HotSpotResolvedJavaMethod) metaAccessProvider.lookupJavaMethod(fooMethod); - final HotSpotInstalledCode fooCode = (HotSpotInstalledCode) getCode(fooJavaMethod, parse(fooMethod)); - argsToBind = new Object[]{fooCode}; - String s1 = new String("Test"); - boolean result = ((Boolean) (fooCode.execute(s1, null, null))).booleanValue(); - Assert.assertTrue(result); - } - - public static Object benchmark(HotSpotInstalledCode code, Object o1, Object o2, Object o3) throws InvalidInstalledCodeException { - return code.execute(o1, o2, o3); - } - - public static Object fieldTest(Object c1, @SuppressWarnings("unused") Object c2, @SuppressWarnings("unused") Object c3) { - ((Container) c1).a = ((Container) c1).b; - return ((Container) c1).a; - } - - public static Object arrayTest(Object c1, Object c2, Object c3) { - Object[] array = (Object[]) c1; - int initialIndex = ((Integer) c2).intValue(); - int replacingIndex = ((Integer) c3).intValue(); - array[initialIndex] = array[replacingIndex]; - return array[initialIndex]; - } - - public static void arrayCopyTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { - Object[] source = (Object[]) c1; - Object[] destination = (Object[]) c2; - System.arraycopy(source, 0, destination, 0, source.length); - } - - public static String stringCopyTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { - String source = (String) c1; - String destination = (String) c2; - return source + destination; - } - - public static char[] charArrayCopyTest(Object c1, Object c2, Object c3) { - char[] source1 = (char[]) c1; - char[] source2 = (char[]) c2; - char[] result = (char[]) c3; - - for (int i = 0; i < source1.length; i++) { - result[i] = source1[i]; - } - - for (int i = 0; i < source2.length; i++) { - result[source1.length + i] = source2[i]; - } - return result; - } - - public static char[] charContainerArrayCopyTest(Object c1, Object c2, Object c3) { - char[] source1 = ((StringContainer1) c1).value; - char[] source2 = ((StringContainer2) c2).value; - char[] result = (char[]) c3; - - for (int i = 0; i < source1.length; i++) { - result[i] = source1[i]; - } - - for (int i = 0; i < source2.length; i++) { - result[source1.length + i] = source2[i]; - } - return result; - } - - @SuppressWarnings("unchecked") - public static void compareAndSwapTest(Object c1, Object c2, Object c3) throws ClassCastException { - AtomicReference cas = (AtomicReference) c1; - cas.compareAndSet(c2, c3); - } - - @SuppressWarnings("unchecked") - public static HashMap hashMapCloneTest(Object c1, @SuppressWarnings("unused") Object c2, @SuppressWarnings("unused") Object c3) { - HashMap map = (HashMap) c1; - return (HashMap) map.clone(); - } - - @SuppressWarnings("unchecked") - public static void hashMapCopyTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { - HashMap map = (HashMap) c1; - HashMap map1 = (HashMap) c2; - map.clear(); - map.putAll(map1); - } - - @SuppressWarnings("unchecked") - public static void queueTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { - ArrayDeque queue = (ArrayDeque) c1; - queue.add(c2); - } - @SuppressWarnings("unchecked") public static Object[] unmodListTest(Object c1, @SuppressWarnings("unused") Object c2, @SuppressWarnings("unused") Object c3) { List queue = (ArrayList) c1; @@ -338,83 +243,114 @@ return result; } + @Test + public void test9() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("unmodListTest"); + List list = new ArrayList<>(); + Object[] array = (Object[]) installedBenchmarkCode.execute(list, null, null); + Assert.assertTrue(list.size() == array.length); + } + + public void test10() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("constantTest"); + Container c = new Container(); + Assert.assertFalse((boolean) installedBenchmarkCode.execute(c, null, null)); + } + public static Boolean constantTest(Object c1, @SuppressWarnings("unused") Object c2, @SuppressWarnings("unused") Object c3) { ConstantContainer container = (ConstantContainer) c1; return container.a.equals(container.b); } - public static Boolean stringEqualsTest(String c1, String c2, @SuppressWarnings("unused") Object c3) { - return c1.equals(c2); + @Test + public void test11() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringEqualsTest"); + String s1 = new String("Test"); + String s2 = new String("Test"); + boolean result = ((Boolean) (installedBenchmarkCode.execute(s1, s2, null))).booleanValue(); + Assert.assertTrue(result); + } + + public static Boolean stringEqualsTest(Object c1, Object c2, @SuppressWarnings("unused") Object c3) { + return ((String) c1).equals(c2); + } + + @Test + public void test12() throws Exception { + HotSpotInstalledCode installedBenchmarkCode = getInstalledCode("stringConstantEqualsTest"); + String s1 = new String("Test"); + boolean result = ((Boolean) (installedBenchmarkCode.execute(s1, null, null))).booleanValue(); + Assert.assertTrue(result); + } + + public static Boolean stringConstantEqualsTest(Object c1, @SuppressWarnings("unused") Object c2, @SuppressWarnings("unused") Object c3) { + return "Test".equals(c1); + } + + static class Container { + + public Object a = new Object(); + public Object b = new Object(); + } + + static class ArrayContainer { + + public Object[] a = new Object[10]; + + public ArrayContainer() { + for (int i = 0; i < 10; i++) { + a[i] = new Object(); + } + } } - public static Boolean stringConstantEqualsTest(String c1, @SuppressWarnings("unused") String c2, @SuppressWarnings("unused") Object c3) { - return "Test".equals(c1); + static class HashMapContainer { + + public HashMap a = new HashMap<>(); + + public HashMapContainer() { + for (int i = 0; i < 10; i++) { + a.put(new Object(), new Object()); + } + } + } + + static class StringContainer1 { + + public char[] value = new char[5]; + + public StringContainer1() { + value[0] = 'T'; + value[1] = 'e'; + value[2] = 's'; + value[3] = 't'; + value[4] = ' '; + + } + } + + static class StringContainer2 { + + public char[] value = new char[6]; + + public StringContainer2() { + value[0] = 'S'; + value[1] = 't'; + value[2] = 'r'; + value[3] = 'i'; + value[4] = 'n'; + value[5] = 'g'; + } + } + + static class ConstantContainer { + + public final Object a = new Object(); + public final Object b = new Object(); + + public ConstantContainer() { + + } } } - -class Container { - - public Object a = new Object(); - public Object b = new Object(); -} - -class ArrayContainer { - - public Object[] a = new Object[10]; - - public ArrayContainer() { - for (int i = 0; i < 10; i++) { - a[i] = new Object(); - } - } -} - -class HashMapContainer { - - public HashMap a = new HashMap<>(); - - public HashMapContainer() { - for (int i = 0; i < 10; i++) { - a.put(new Object(), new Object()); - } - } -} - -class StringContainer1 { - - public char[] value = new char[5]; - - public StringContainer1() { - value[0] = 'T'; - value[1] = 'e'; - value[2] = 's'; - value[3] = 't'; - value[4] = ' '; - - } -} - -class StringContainer2 { - - public char[] value = new char[6]; - - public StringContainer2() { - value[0] = 'S'; - value[1] = 't'; - value[2] = 'r'; - value[3] = 'i'; - value[4] = 'n'; - value[5] = 'g'; - } -} - -class ConstantContainer { - - public final Object a = new Object(); - public final Object b = new Object(); - - public ConstantContainer() { - - } -}