diff options
author | Jesse Wilson <jessewilson@google.com> | 2009-05-12 14:00:42 -0700 |
---|---|---|
committer | Jesse Wilson <jessewilson@google.com> | 2009-05-12 14:13:00 -0700 |
commit | d9f2a0618c83bbc95814e609e1b8547795f27a46 (patch) | |
tree | a97e532d186b71874e600bf63b53736ed00e74ff /annotation | |
parent | 03fa7b15a093df1795587d88da7dbf5996e63d58 (diff) | |
download | libcore-d9f2a0618c83bbc95814e609e1b8547795f27a46.zip libcore-d9f2a0618c83bbc95814e609e1b8547795f27a46.tar.gz libcore-d9f2a0618c83bbc95814e609e1b8547795f27a46.tar.bz2 |
Bringing annotation up to Harmony r772995.
commit 8f52858127fd95abc694f0080438479be3c71ac6
Merge: 68891f9 df17e4f
Author: Jesse Wilson <jessewilson@google.com>
Date: Tue May 12 13:59:37 2009 -0700
Merge branch 'annotation_772995' into annotation_dalvik
Conflicts:
libcore/annotation/.classpath
libcore/annotation/build.xml
libcore/annotation/src/main/java/java/lang/annotation/Annotation.java
libcore/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java
libcore/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
libcore/annotation/src/main/java/java/lang/annotation/Documented.java
libcore/annotation/src/main/java/java/lang/annotation/ElementType.java
libcore/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java
libcore/annotation/src/main/java/java/lang/annotation/Inherited.java
libcore/annotation/src/main/java/java/lang/annotation/Retention.java
libcore/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java
libcore/annotation/src/main/java/java/lang/annotation/Target.java
commit 68891f94f87bea309f92dbe2f9a8eab95fa93614
Author: Jesse Wilson <jessewilson@google.com>
Date: Tue May 12 13:46:16 2009 -0700
Stripped @since Android 1.0 from annotation/
commit e3acecef0db3b85369aaa6f5db7876cde29d7329
Author: Jesse Wilson <jessewilson@google.com>
Date: Tue May 12 13:23:06 2009 -0700
Dalvik annotation
commit df17e4f396151289e7c6c645191fb27be9950f80
Author: Jesse Wilson <jessewilson@google.com>
Date: Tue May 12 13:21:33 2009 -0700
Annotation 772995
commit b89fac88400f17b6ba8be359eacad29d9faf7baf
Author: Jesse Wilson <jessewilson@google.com>
Date: Tue May 12 13:19:55 2009 -0700
Annotation 527399.
Diffstat (limited to 'annotation')
12 files changed, 38 insertions, 69 deletions
diff --git a/annotation/src/main/java/java/lang/annotation/Annotation.java b/annotation/src/main/java/java/lang/annotation/Annotation.java index 43ad1bb..00707b1 100644 --- a/annotation/src/main/java/java/lang/annotation/Annotation.java +++ b/annotation/src/main/java/java/lang/annotation/Annotation.java @@ -22,17 +22,15 @@ package java.lang.annotation; * itself is <i>not</i> an annotation, and neither is an interface that simply * extends this one. Only the compiler is able to create proper annotation * types. - * - * @since Android 1.0 + * + * @since 1.5 */ public interface Annotation { /** * Returns the type of this annotation. - * + * * @return A {@code Class} instance representing the annotation type. - * - * @since Android 1.0 */ Class<? extends Annotation> annotationType(); @@ -70,14 +68,12 @@ public interface Annotation { * calling their {@code equals()} method. * </li> * </ul> - * + * * @param obj * The object to compare to. - * - * @return {@code true} if {@code obj} is equal to this annotation, - * {@code false} otherwise. - * - * @since Android 1.0 + * + * @return {@code true} if {@code obj} is equal to this annotation, + * {@code false} otherwise. */ boolean equals(Object obj); @@ -111,10 +107,8 @@ public interface Annotation { * calling their {@code hashCode} method. * </li> * </ul> - * + * * @return the hash code. - * - * @since Android 1.0 */ int hashCode(); @@ -123,11 +117,9 @@ public interface Annotation { * strictly defined what the representation has to look like, but it usually * consists of the name of the annotation, preceded by a "@". If the * annotation contains field members, their names and values are also - * included in the result. + * included in the result. * * @return the {@code String} that represents this annotation. - * - * @since Android 1.0 */ String toString(); } diff --git a/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java b/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java index ce5c3a0..67775c7 100644 --- a/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java +++ b/annotation/src/main/java/java/lang/annotation/AnnotationFormatError.java @@ -22,8 +22,8 @@ package java.lang.annotation; * syntactically incorrect and the annotation parser is unable to process it. * This exception is unlikely to ever occur, given that the code has been * compiled by an ordinary Java compiler. - * - * @since Android 1.0 + * + * @since 1.5 */ public class AnnotationFormatError extends Error { @@ -31,11 +31,9 @@ public class AnnotationFormatError extends Error { /** * Constructs an instance with the message provided. - * + * * @param message * the details of the error. - * - * @since Android 1.0 */ public AnnotationFormatError(String message) { super(message); @@ -43,14 +41,11 @@ public class AnnotationFormatError extends Error { /** * Constructs an instance with a message and a cause. - * + * * @param message * the details of the error. - * * @param cause * the cause of the error or {@code null} if none. - * - * @since Android 1.0 */ public AnnotationFormatError(String message, Throwable cause) { super(message, cause); @@ -60,11 +55,9 @@ public class AnnotationFormatError extends Error { * Constructs an instance with a cause. If the cause is not * {@code null}, then {@code cause.toString()} is used as the * error's message. - * + * * @param cause * the cause of the error or {@code null} if none. - * - * @since Android 1.0 */ public AnnotationFormatError(Throwable cause) { super(cause == null ? null : cause.toString(), cause); diff --git a/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java b/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java index 5bb3cbf..0ff79ec 100644 --- a/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java +++ b/annotation/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java @@ -24,8 +24,8 @@ import org.apache.harmony.annotation.internal.nls.Messages; /** * Indicates that an annotation type has changed since it was compiled or * serialized. - * - * @since Android 1.0 + * + * @since 1.5 */ public class AnnotationTypeMismatchException extends RuntimeException { @@ -37,16 +37,13 @@ public class AnnotationTypeMismatchException extends RuntimeException { /** * Constructs an instance for the given type element and the type found. - * + * * @param element * the annotation type element. - * * @param foundType * the invalid type that was found. This is actually the textual * type description found in the binary class representation, * so it may not be human-readable. - * - * @since Android 1.0 */ public AnnotationTypeMismatchException(Method element, String foundType) { super(Messages.getString("annotation.1", element, foundType)); //$NON-NLS-1$ @@ -56,10 +53,8 @@ public class AnnotationTypeMismatchException extends RuntimeException { /** * Returns the method object for the invalid type. - * + * * @return a {@link Method} instance. - * - * @since Android 1.0 */ public Method element() { return element; @@ -67,10 +62,8 @@ public class AnnotationTypeMismatchException extends RuntimeException { /** * Returns the invalid type. - * + * * @return a string describing the invalid data. - * - * @since Android 1.0 */ public String foundType() { return foundType; diff --git a/annotation/src/main/java/java/lang/annotation/Documented.java b/annotation/src/main/java/java/lang/annotation/Documented.java index 2849fd2..7e7f72f 100644 --- a/annotation/src/main/java/java/lang/annotation/Documented.java +++ b/annotation/src/main/java/java/lang/annotation/Documented.java @@ -20,8 +20,8 @@ package java.lang.annotation; /** * Defines a meta-annotation for indicating that an annotation is documented and * considered part of the public API. - * - * @since Android 1.0 + * + * @since 1.5 */ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/annotation/src/main/java/java/lang/annotation/ElementType.java b/annotation/src/main/java/java/lang/annotation/ElementType.java index 92f5109..f0f52aa 100644 --- a/annotation/src/main/java/java/lang/annotation/ElementType.java +++ b/annotation/src/main/java/java/lang/annotation/ElementType.java @@ -21,8 +21,8 @@ package java.lang.annotation; * Defines an enumeration for Java program elements. It is used in conjunction * with the {@link Target} meta-annotation to restrict the use of an annotation * to certain program elements. - * - * @since Android 1.0 + * + * @since 1.5 */ public enum ElementType { /** diff --git a/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java b/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java index 3a31551..a5d2068 100644 --- a/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java +++ b/annotation/src/main/java/java/lang/annotation/IncompleteAnnotationException.java @@ -23,8 +23,8 @@ import org.apache.harmony.annotation.internal.nls.Messages; * Indicates that an element of an annotation type was accessed that was added * after the type was compiled or serialized. This does not apply to new * elements that have default values. - * - * @since Android 1.0 + * + * @since 1.5 */ public class IncompleteAnnotationException extends RuntimeException { @@ -37,13 +37,11 @@ public class IncompleteAnnotationException extends RuntimeException { /** * Constructs an instance with the incomplete annotation type and the name * of the element that's missing. - * + * * @param annotationType * the annotation type. * @param elementName * the name of the incomplete element. - * - * @since Android 1.0 */ public IncompleteAnnotationException( Class<? extends Annotation> annotationType, String elementName) { @@ -54,10 +52,8 @@ public class IncompleteAnnotationException extends RuntimeException { /** * Returns the annotation type. - * + * * @return a Class instance. - * - * @since Android 1.0 */ public Class<? extends Annotation> annotationType() { return annotationType; @@ -65,10 +61,8 @@ public class IncompleteAnnotationException extends RuntimeException { /** * Returns the incomplete element's name. - * + * * @return the name of the element. - * - * @since Android 1.0 */ public String elementName() { return elementName; diff --git a/annotation/src/main/java/java/lang/annotation/Inherited.java b/annotation/src/main/java/java/lang/annotation/Inherited.java index cf16928..730d30a 100644 --- a/annotation/src/main/java/java/lang/annotation/Inherited.java +++ b/annotation/src/main/java/java/lang/annotation/Inherited.java @@ -20,8 +20,8 @@ package java.lang.annotation; /** * Defines a meta-annotation for indicating that an annotation is automatically * inherited. - * - * @since Android 1.0 + * + * @since 1.5 */ @Documented @Retention(RetentionPolicy.RUNTIME) diff --git a/annotation/src/main/java/java/lang/annotation/Retention.java b/annotation/src/main/java/java/lang/annotation/Retention.java index 198fccc..275739e 100644 --- a/annotation/src/main/java/java/lang/annotation/Retention.java +++ b/annotation/src/main/java/java/lang/annotation/Retention.java @@ -21,15 +21,12 @@ package java.lang.annotation; * Defines a meta-annotation for determining the scope of retention for an * annotation. If the retention annotation is not set {@code * RetentionPolicy.CLASS} is used as default retention. - * - * @since Android 1.0 + * + * @since 1.5 */ @Documented @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.ANNOTATION_TYPE) public @interface Retention { - // BEGIN android-changed - // copied from newer version of harmony RetentionPolicy value(); - // END android-changed } diff --git a/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java b/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java index 014b910..70de3b0 100644 --- a/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java +++ b/annotation/src/main/java/java/lang/annotation/RetentionPolicy.java @@ -21,8 +21,8 @@ package java.lang.annotation; * Defines an enumeration for annotation retention policies. Used in conjunction * with the {@link Retention} annotation to specify an annotation's time-to-live * in the overall development life cycle. - * - * @since Android 1.0 + * + * @since 1.5 */ public enum RetentionPolicy { /** diff --git a/annotation/src/main/java/java/lang/annotation/Target.java b/annotation/src/main/java/java/lang/annotation/Target.java index 1f53fa0..4ba0938 100644 --- a/annotation/src/main/java/java/lang/annotation/Target.java +++ b/annotation/src/main/java/java/lang/annotation/Target.java @@ -20,8 +20,8 @@ package java.lang.annotation; /** * Defines a meta-annotation for determining what {@link ElementType}s an * annotation can be applied to. - * - * @since Android 1.0 + * + * @since 1.5 */ @Documented @Retention(RetentionPolicy.RUNTIME) 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 1134887..5430286 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 @@ -65,7 +65,7 @@ public class AnnotationTypeMismatchExceptionTest extends TestCase { Method m = methods[0]; AnnotationTypeMismatchException e = new AnnotationTypeMismatchException( m, "some type"); - assertNotNull("can not instanciate AnnotationTypeMismatchException", e); + assertNotNull("can not instantiate AnnotationTypeMismatchException", e); assertSame("wrong method name", m, e.element()); assertEquals("wrong found type", "some type", e.foundType()); } 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 de56330..5c718ed 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 @@ -80,7 +80,7 @@ public class IncompleteAnnotationExceptionTest extends TestCase { String elementName = "some element"; IncompleteAnnotationException e = new IncompleteAnnotationException( clazz, elementName); - assertNotNull("can not instanciate IncompleteAnnotationException", e); + assertNotNull("can not instantiate IncompleteAnnotationException", e); assertSame("wrong annotation type", clazz, e.annotationType()); assertSame("wrong element name", elementName, e.elementName()); } |