Loading core/java/android/test/AndroidTestCase.java +5 −5 Original line number Diff line number Diff line Loading @@ -20,9 +20,11 @@ import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import junit.framework.TestCase; import java.lang.reflect.Field; import java.lang.reflect.Modifier; /** * Extend this if you need to access Resources or other things that depend on Activity Context. Loading Loading @@ -155,8 +157,8 @@ public class AndroidTestCase extends TestCase { throws IllegalAccessException { final Field[] fields = getClass().getDeclaredFields(); for (Field field : fields) { final Class<?> fieldClass = field.getDeclaringClass(); if (testCaseClass.isAssignableFrom(fieldClass) && !field.getType().isPrimitive()) { if (!field.getType().isPrimitive() && !Modifier.isStatic(field.getModifiers())) { try { field.setAccessible(true); field.set(this, null); Loading @@ -170,6 +172,4 @@ public class AndroidTestCase extends TestCase { } } } } Loading
core/java/android/test/AndroidTestCase.java +5 −5 Original line number Diff line number Diff line Loading @@ -20,9 +20,11 @@ import android.content.ContentValues; import android.content.Context; import android.content.Intent; import android.net.Uri; import junit.framework.TestCase; import java.lang.reflect.Field; import java.lang.reflect.Modifier; /** * Extend this if you need to access Resources or other things that depend on Activity Context. Loading Loading @@ -155,8 +157,8 @@ public class AndroidTestCase extends TestCase { throws IllegalAccessException { final Field[] fields = getClass().getDeclaredFields(); for (Field field : fields) { final Class<?> fieldClass = field.getDeclaringClass(); if (testCaseClass.isAssignableFrom(fieldClass) && !field.getType().isPrimitive()) { if (!field.getType().isPrimitive() && !Modifier.isStatic(field.getModifiers())) { try { field.setAccessible(true); field.set(this, null); Loading @@ -170,6 +172,4 @@ public class AndroidTestCase extends TestCase { } } } }