Loading core/java/android/net/Uri.java +12 −9 Original line number Diff line number Diff line Loading @@ -104,6 +104,18 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { /** Log tag. */ private static final String LOG = Uri.class.getSimpleName(); /** * NOTE: EMPTY accesses this field during its own initialization, so this * field *must* be initialized first, or else EMPTY will see a null value! * * Placeholder for strings which haven't been cached. This enables us * to cache null. We intentionally create a new String instance so we can * compare its identity and there is no chance we will confuse it with * user data. */ @SuppressWarnings("RedundantStringConstructorCall") private static final String NOT_CACHED = new String("NOT CACHED"); /** * The empty URI, equivalent to "". */ Loading Loading @@ -349,15 +361,6 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { /** Placeholder value for an index which hasn't been calculated yet. */ private final static int NOT_CALCULATED = -2; /** * Placeholder for strings which haven't been cached. This enables us * to cache null. We intentionally create a new String instance so we can * compare its identity and there is no chance we will confuse it with * user data. */ @SuppressWarnings("RedundantStringConstructorCall") private static final String NOT_CACHED = new String("NOT CACHED"); /** * Error message presented when a user tries to treat an opaque URI as * hierarchical. Loading tests/AndroidTests/run_test.sh +1 −1 Original line number Diff line number Diff line framework=/system/framework bpath=$framework/core.jar:$framework/ext.jar:$framework/framework.jar:$framework/android.test.runner.jar adb shell exec dalvikvm -Xbootclasspath:$bpath -cp system/app/AndroidTests.apk:data/app/AndroidTests.apk \ adb shell exec dalvikvm -Xbootclasspath:$bpath -cp /system/app/AndroidTests.apk:/data/app/com.android.unit_tests.apk:/data/app/AndroidTests.apk \ com.android.internal.util.WithFramework junit.textui.TestRunner $* tests/AndroidTests/src/com/android/unit_tests/UriTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -499,4 +499,8 @@ public class UriTest extends TestCase { assertEquals(uriString, uri.toString()); } public void testEmptyToStringNotNull() { assertNotNull(Uri.EMPTY.toString()); } } Loading
core/java/android/net/Uri.java +12 −9 Original line number Diff line number Diff line Loading @@ -104,6 +104,18 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { /** Log tag. */ private static final String LOG = Uri.class.getSimpleName(); /** * NOTE: EMPTY accesses this field during its own initialization, so this * field *must* be initialized first, or else EMPTY will see a null value! * * Placeholder for strings which haven't been cached. This enables us * to cache null. We intentionally create a new String instance so we can * compare its identity and there is no chance we will confuse it with * user data. */ @SuppressWarnings("RedundantStringConstructorCall") private static final String NOT_CACHED = new String("NOT CACHED"); /** * The empty URI, equivalent to "". */ Loading Loading @@ -349,15 +361,6 @@ public abstract class Uri implements Parcelable, Comparable<Uri> { /** Placeholder value for an index which hasn't been calculated yet. */ private final static int NOT_CALCULATED = -2; /** * Placeholder for strings which haven't been cached. This enables us * to cache null. We intentionally create a new String instance so we can * compare its identity and there is no chance we will confuse it with * user data. */ @SuppressWarnings("RedundantStringConstructorCall") private static final String NOT_CACHED = new String("NOT CACHED"); /** * Error message presented when a user tries to treat an opaque URI as * hierarchical. Loading
tests/AndroidTests/run_test.sh +1 −1 Original line number Diff line number Diff line framework=/system/framework bpath=$framework/core.jar:$framework/ext.jar:$framework/framework.jar:$framework/android.test.runner.jar adb shell exec dalvikvm -Xbootclasspath:$bpath -cp system/app/AndroidTests.apk:data/app/AndroidTests.apk \ adb shell exec dalvikvm -Xbootclasspath:$bpath -cp /system/app/AndroidTests.apk:/data/app/com.android.unit_tests.apk:/data/app/AndroidTests.apk \ com.android.internal.util.WithFramework junit.textui.TestRunner $*
tests/AndroidTests/src/com/android/unit_tests/UriTest.java +4 −0 Original line number Diff line number Diff line Loading @@ -499,4 +499,8 @@ public class UriTest extends TestCase { assertEquals(uriString, uri.toString()); } public void testEmptyToStringNotNull() { assertNotNull(Uri.EMPTY.toString()); } }