Index: content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
diff --git a/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java b/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
index a887ffb051ffae7eabd0c9bb5376b584a8a9072d..476986e3c0823add87fac128c33295abdc60ec7b 100644 |
--- a/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
+++ b/content/public/android/javatests/src/org/chromium/content/common/CleanupReferenceTest.java |
@@ -36,6 +36,9 @@ public class CleanupReferenceTest extends InstrumentationTestCase { |
} |
} |
+ volatile ReferredObject[] instances = null; |
+ volatile ReferredObject instance = null; |
+ |
@Override |
public void setUp() throws Exception { |
super.setUp(); |
@@ -54,7 +57,7 @@ public class CleanupReferenceTest extends InstrumentationTestCase { |
public void testCreateSingle() throws Throwable { |
assertEquals(0, sObjectCount.get()); |
- ReferredObject instance = new ReferredObject(); |
joth
2013/08/20 18:34:22
Use AtomicReference here, and then you won't need
|
+ instance = new ReferredObject(); |
assertEquals(1, sObjectCount.get()); |
instance = null; |
joth
2013/08/20 18:34:22
instance.set(null);
instance = null;
|
@@ -73,7 +76,7 @@ public class CleanupReferenceTest extends InstrumentationTestCase { |
assertEquals(0, sObjectCount.get()); |
final int INSTANCE_COUNT = 20; |
- ReferredObject[] instances = new ReferredObject[INSTANCE_COUNT]; |
+ instances = new ReferredObject[INSTANCE_COUNT]; |
for (int i = 0; i < INSTANCE_COUNT; ++i) { |
instances[i] = new ReferredObject(); |