diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-12-17 18:03:55 -0800 |
commit | dd828f42a5c83b4270d4fbf6fce2da1878f1e84a (patch) | |
tree | fdd4b68fa1020f2b6426034c94823419a7236200 /annotation | |
parent | fdb2704414a9ed92394ada0d1395e4db86889465 (diff) | |
download | libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.zip libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.gz libcore-dd828f42a5c83b4270d4fbf6fce2da1878f1e84a.tar.bz2 |
Code drop from //branches/cupcake/...@124589
Diffstat (limited to 'annotation')
8 files changed, 151 insertions, 14 deletions
diff --git a/annotation/src/main/java/java/lang/annotation/Inherited.java b/annotation/src/main/java/java/lang/annotation/Inherited.java index b0b2695..cf16928 100644 --- a/annotation/src/main/java/java/lang/annotation/Inherited.java +++ b/annotation/src/main/java/java/lang/annotation/Inherited.java @@ -18,8 +18,8 @@ package java.lang.annotation; /** - * Defines a meta-annotation for indicating indicating that an annotation is - * automatically inherited. + * Defines a meta-annotation for indicating that an annotation is automatically + * inherited. * * @since Android 1.0 */ diff --git a/annotation/src/main/java/java/lang/annotation/Retention.java b/annotation/src/main/java/java/lang/annotation/Retention.java index 257877a..1c440ae 100644 --- a/annotation/src/main/java/java/lang/annotation/Retention.java +++ b/annotation/src/main/java/java/lang/annotation/Retention.java @@ -18,7 +18,7 @@ package java.lang.annotation; // BEGIN android-note -// Un-linked RetentionPolicy#RUNTIME due to droiddoc problem (it doesn't +// Un-linked RetentionPolicy#RUNTIME due to clearjavadoc problem (it doesn't // yet deal with links to enums). // END android-note diff --git a/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java b/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java index 2182ae0..91f3548 100644 --- a/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java +++ b/annotation/src/main/java/org/apache/harmony/annotation/internal/nls/Messages.java @@ -20,12 +20,22 @@ * if this tool runs again. Better make changes in the template file. */ +// BEGIN android-note +// Redundant code has been removed and is now called from MsgHelp. +// END android-note + package org.apache.harmony.annotation.internal.nls; + +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; +// BEGIN android-changed import org.apache.harmony.luni.util.MsgHelp; +// END android-changed /** * This class retrieves strings from a resource bundle and returns them, @@ -43,8 +53,10 @@ import org.apache.harmony.luni.util.MsgHelp; */ public class Messages { + // BEGIN android-changed private static final String sResource = "org.apache.harmony.annotation.internal.nls.messages"; + // END android-changed /** * Retrieves a message which has no arguments. @@ -54,7 +66,9 @@ public class Messages { * @return String the message for that key in the system message bundle. */ static public String getString(String msg) { + // BEGIN android-changed return MsgHelp.getString(sResource, msg); + // END android-changed } /** @@ -121,6 +135,12 @@ public class Messages { * @return String the message for that key in the system message bundle. */ static public String getString(String msg, Object[] args) { + // BEGIN android-changed return MsgHelp.getString(sResource, msg, args); + // END android-changed } + + // BEGIN android-note + // Duplicate code was dropped in favor of using MsgHelp. + // END android-note } diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java index b80f3a9..6bd4526 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java @@ -17,17 +17,32 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.AnnotationFormatError; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.AnnotationFormatError; + /** * Test case of java.lang.annotation.AnnotationFormatError */ +@TestTargetClass(AnnotationFormatError.class) public class AnnotationFormatErrorTest extends TestCase { /** * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationFormatError", + methodArgs = {java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_String() { AnnotationFormatError e = new AnnotationFormatError("some message"); @@ -37,6 +52,15 @@ public class AnnotationFormatErrorTest extends TestCase { /** * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(Throwable) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationFormatError", + methodArgs = {java.lang.Throwable.class} + ) + }) public void test_constructorLjava_lang_Throwable() { IllegalArgumentException iae = new IllegalArgumentException(); AnnotationFormatError e = new AnnotationFormatError(iae); @@ -46,6 +70,15 @@ public class AnnotationFormatErrorTest extends TestCase { /** * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String,Throwable) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationFormatError", + methodArgs = {java.lang.String.class, java.lang.Throwable.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_StringLjava_lang_Throwable() { IllegalArgumentException iae = new IllegalArgumentException(); diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java index 9948e29..2675e06 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java @@ -17,14 +17,20 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.AnnotationTypeMismatchException; -import java.lang.reflect.Method; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.AnnotationTypeMismatchException; +import java.lang.reflect.Method; + /** * Test case of java.lang.annotation.AnnotationTypeMismatchException */ +@TestTargetClass(AnnotationTypeMismatchException.class) public class AnnotationTypeMismatchExceptionTest extends TestCase { /** @@ -33,6 +39,15 @@ public class AnnotationTypeMismatchExceptionTest extends TestCase { * @tests java.lang.annotation.AnnotationTypeMismatchException#AnnotationTypeMismatchException(Method, * String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "AnnotationTypeMismatchException", + methodArgs = {java.lang.reflect.Method.class, java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_reflect_MethodLjava_lang_String() throws SecurityException, ClassNotFoundException { Method[] methods = Class.forName("java.lang.String").getMethods(); diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java index d81cabd..6447a9f 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java @@ -17,20 +17,35 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.ElementType; -import java.util.Arrays; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.ElementType; +import java.util.Arrays; + /** * Test case of java.lang.annotation.ElementType */ +@TestTargetClass(ElementType.class) public class ElementTypeTest extends TestCase { /** * @throws Exception * @tests java.lang.annotation.ElementType#valueOf(String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_valueOfLjava_lang_String() throws Exception { assertSame(ElementType.ANNOTATION_TYPE, ElementType @@ -55,6 +70,15 @@ public class ElementTypeTest extends TestCase { * @throws Exception * @tests java.lang.annotation.ElementType#values() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "values", + methodArgs = {} + ) + }) @SuppressWarnings("nls") public void test_values() throws Exception { ElementType[] values = ElementType.values(); diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java index 0acd4fa..d6c8339 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java @@ -17,19 +17,31 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.IncompleteAnnotationException; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; -/** - * - */ +import java.lang.annotation.IncompleteAnnotationException; + +@TestTargetClass(IncompleteAnnotationException.class) public class IncompleteAnnotationExceptionTest extends TestCase { /* * Class under test for void IncompleteAnnotationException(String) * Regression for HARMONY-2477 */ + @TestInfo( + level = TestLevel.PARTIAL, + purpose = "Verifies NullPointerException.", + targets = { + @TestTarget( + methodName = "IncompleteAnnotationException", + methodArgs = {java.lang.Class.class, java.lang.String.class} + ) + }) public void testNullType() { try { new IncompleteAnnotationException(null, "str"); @@ -44,6 +56,15 @@ public class IncompleteAnnotationExceptionTest extends TestCase { * @tests java.lang.annotation.IncompleteAnnotationException#IncompleteAnnotationException(Class, * String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "IncompleteAnnotationException", + methodArgs = {java.lang.Class.class, java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_constructorLjava_lang_Class_Ljava_lang_String() throws Exception { diff --git a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java index c4f7c03..adeb039 100644 --- a/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java +++ b/annotation/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java @@ -17,19 +17,34 @@ package org.apache.harmony.annotation.tests.java.lang.annotation; -import java.lang.annotation.RetentionPolicy; -import java.util.Arrays; +import dalvik.annotation.TestInfo; +import dalvik.annotation.TestLevel; +import dalvik.annotation.TestTarget; +import dalvik.annotation.TestTargetClass; import junit.framework.TestCase; +import java.lang.annotation.RetentionPolicy; +import java.util.Arrays; + /** * Test case of java.lang.annotation.RetentionPolicy */ +@TestTargetClass(RetentionPolicy.class) public class RetentionPolicyTest extends TestCase { /** * @throws Exception * @tests java.lang.annotation.RetentionPolicy#valueOf(String) */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "valueOf", + methodArgs = {java.lang.String.class} + ) + }) @SuppressWarnings("nls") public void test_valueOfLjava_lang_String() throws Exception { assertSame(RetentionPolicy.CLASS, RetentionPolicy @@ -50,6 +65,15 @@ public class RetentionPolicyTest extends TestCase { * @throws Exception * @tests java.lang.annotation.RetentionPolicy#values() */ + @TestInfo( + level = TestLevel.COMPLETE, + purpose = "", + targets = { + @TestTarget( + methodName = "values", + methodArgs = {} + ) + }) @SuppressWarnings("nls") public void test_values() throws Exception { RetentionPolicy[] values = RetentionPolicy.values(); |