diff options
author | Elliott Hughes <enh@google.com> | 2010-03-09 17:01:16 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2010-03-10 10:43:14 -0800 |
commit | b43c9fb9c581d94304e9a54ec96cf4d752e8d917 (patch) | |
tree | 04e6d51d8f0c20d555d31522f65041930dd29058 /luni-kernel/src | |
parent | 29a82c34c20ca22c0356ea818b72c1ca4013fd08 (diff) | |
download | libcore-b43c9fb9c581d94304e9a54ec96cf4d752e8d917.zip libcore-b43c9fb9c581d94304e9a54ec96cf4d752e8d917.tar.gz libcore-b43c9fb9c581d94304e9a54ec96cf4d752e8d917.tar.bz2 |
Add Java 6 additions to Double, Enum, Float, and String.
I rewrote the documentation for Double, Enum, and Float, but the "code" is the
same as harmony's. I rewrote the String code and wrote some tests to ensure
that a malicious Charset can't subvert String immutability.
I've also extracted the Android-specific bits of StringTest (which weren't
testing String at all) and brought back the latest harmony StringTest.java.
(The Class and Package changes are just to placate our API comparison tools.)
Bug: 2497395
Change-Id: Id57bda806891c3c85adfcb3b85eea8a8fad2c7b4
Diffstat (limited to 'luni-kernel/src')
-rw-r--r-- | luni-kernel/src/main/java/java/lang/Class.java | 3 | ||||
-rw-r--r-- | luni-kernel/src/main/java/java/lang/Package.java | 4 |
2 files changed, 3 insertions, 4 deletions
diff --git a/luni-kernel/src/main/java/java/lang/Class.java b/luni-kernel/src/main/java/java/lang/Class.java index 571f5b1..e999c92 100644 --- a/luni-kernel/src/main/java/java/lang/Class.java +++ b/luni-kernel/src/main/java/java/lang/Class.java @@ -1425,8 +1425,7 @@ public final class Class<T> implements Serializable, AnnotatedElement, GenericDe * if a security manager exists and it does not allow creating * new instances. */ - public T newInstance() throws IllegalAccessException, - InstantiationException { + public T newInstance() throws InstantiationException, IllegalAccessException { checkPublicMemberAccess(); return newInstanceImpl(); } diff --git a/luni-kernel/src/main/java/java/lang/Package.java b/luni-kernel/src/main/java/java/lang/Package.java index 4d98959..58cee36 100644 --- a/luni-kernel/src/main/java/java/lang/Package.java +++ b/luni-kernel/src/main/java/java/lang/Package.java @@ -79,11 +79,11 @@ public class Package implements AnnotatedElement { * @since Android 1.0 */ @SuppressWarnings("unchecked") - public <T extends Annotation> T getAnnotation(Class<T> annotationType) { + public <A extends Annotation> A getAnnotation(Class<A> annotationType) { Annotation[] list = getAnnotations(); for (int i = 0; i < list.length; i++) { if (annotationType.isInstance(list[i])) { - return (T)list[i]; + return (A) list[i]; } } |