Merge remote branch 'goog/dalvik-dev' into dalvik-dev-to-master
diff --git a/Android.mk b/Android.mk
index 61823e8..a51a7a1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,4 @@
+# -*- mode: makefile -*-
 # Copyright (C) 2009 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -40,3 +41,13 @@
 ALL_MODULE_TAGS := $(filter-out tests,$(ALL_MODULE_TAGS))
 ALL_MODULES := $(filter-out $(ALL_MODULE_NAME_TAGS.tests),$(ALL_MODULES))
 endif
+
+
+#
+# "m dalvik-host" for quick minimal host build
+#
+
+ifeq ($(WITH_HOST_DALVIK),true)
+    .PHONY: dalvik-host
+    dalvik-host: dalvik $(HOST_OUT)/bin/dalvikvm $(HOST_OUT)/bin/dexopt $(HOST_OUT)/lib/libsqlite.so $(HOST_OUT)/etc/security/cacerts.bks $(HOST_OUT)/usr/share/zoneinfo/zoneinfo.dat $(HOST_OUT)/usr/share/zoneinfo/zoneinfo.idx $(HOST_OUT)/usr/share/zoneinfo/zoneinfo.version core-hostdex bouncycastle-hostdex apache-xml-hostdex $(call intermediates-dir-for,JAVA_LIBRARIES,core-tests,,COMMON)/classes.jar
+endif
diff --git a/CleanSpec.mk b/CleanSpec.mk
index 2207d3e..1618f1b 100644
--- a/CleanSpec.mk
+++ b/CleanSpec.mk
@@ -1,3 +1,4 @@
+# -*- mode: makefile -*-
 # Copyright (C) 2007 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/Docs.mk b/Docs.mk
index 9450139..42eee45 100644
--- a/Docs.mk
+++ b/Docs.mk
@@ -1,3 +1,4 @@
+# -*- mode: makefile -*-
 # List of libcore directories to include in documentation.
 # Shared between libcore and frameworks/base.
 
diff --git a/JavaLibrary.mk b/JavaLibrary.mk
index 60e5b63..08459fa 100644
--- a/JavaLibrary.mk
+++ b/JavaLibrary.mk
@@ -42,7 +42,7 @@
 endef
 
 define all-test-java-files-under
-$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(1)/src/test/java -name "*.java" 2> /dev/null))
+$(foreach dir,$(1),$(patsubst ./%,%,$(shell cd $(LOCAL_PATH) && find $(dir)/src/test/java -name "*.java" 2> /dev/null)))
 endef
 
 define all-core-resource-dirs
@@ -93,116 +93,24 @@
 LOCAL_SRC_FILES := $(call all-main-java-files-under,junit)
 LOCAL_NO_STANDARD_LIBRARIES := true
 LOCAL_JAVA_LIBRARIES := core
+LOCAL_JAVACFLAGS := $(local_javac_flags)
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := core-junit
 include $(BUILD_JAVA_LIBRARY)
 
-# Make core-junitrunner
+# Make the core-tests library.
 include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,junit)
+LOCAL_SRC_FILES := $(call all-test-java-files-under,dalvik dom json luni support xml)
 LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
 LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core core-junit
+LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit
+LOCAL_STATIC_JAVA_LIBRARIES := sqlite-jdbc
 LOCAL_DX_FLAGS := --core-library
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-junitrunner
-include $(BUILD_JAVA_LIBRARY)
-
-# Definitions to make the core-tests libraries.
-#
-# We make a library per module, because otherwise the .jar files get too
-# large, to the point that dx(1) can't cope (and the build is
-# ridiculously slow).
-#
-# TODO: vogar will make this nonsense obsolete.
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,dalvik)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support
-LOCAL_DX_FLAGS := --core-library
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-tests-dalvik
-include $(BUILD_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,dom)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support
-LOCAL_DX_FLAGS := --core-library
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-tests-dom
-include $(BUILD_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,json)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support
-LOCAL_DX_FLAGS := --core-library
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-tests-json
-include $(BUILD_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,luni)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-LOCAL_NO_STANDARD_LIBRARIES := true
-# This module contains the top-level "tests.AllTests" that ties everything
-# together, so it has compile-time dependencies on all the other test
-# libraries.
-# TODO: we should have a bogus module that just contains tests.AllTests for speed.
-LOCAL_JAVA_LIBRARIES := \
-        bouncycastle \
-        core \
-        core-junit \
-        core-junitrunner \
-        core-tests-support \
-        core-tests-dalvik \
-        core-tests-dom \
-        core-tests-json \
-        core-tests-xml \
-        sqlite-jdbc
-LOCAL_DX_FLAGS := --core-library
+LOCAL_JAVACFLAGS := $(local_javac_flags)
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE := core-tests
-
 LOCAL_NO_EMMA_INSTRUMENT := true
 LOCAL_NO_EMMA_COMPILE := true
-
-include $(BUILD_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit core-junitrunner
-LOCAL_DX_FLAGS := --core-library
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-tests-support
-include $(BUILD_JAVA_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,xml)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core core-junit core-junitrunner core-tests-support
-LOCAL_DX_FLAGS := --core-library
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-tests-xml
-include $(BUILD_JAVA_LIBRARY)
-
-# also build support as a static library for use by frameworks/base HTTPS tests
-include $(CLEAR_VARS)
-LOCAL_SRC_FILES := $(call all-test-java-files-under,support)
-LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
-LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit core-junitrunner
-LOCAL_DX_FLAGS := --core-library
-LOCAL_MODULE_TAGS := tests
-LOCAL_MODULE := core-tests-supportlib
 include $(BUILD_STATIC_JAVA_LIBRARY)
 
 # This one's tricky. One of our tests needs to have a
@@ -219,28 +127,6 @@
 $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args) -C $(TMP_RESOURCE_DIR) $(TMP_RESOURCE_FILE)
 $(LOCAL_INTERMEDIATE_TARGETS): $(TMP_RESOURCE_DIR)$(TMP_RESOURCE_FILE)
 
-# Definitions for building a version of the core-tests.jar
-# that is suitable for execution on the RI. This JAR would
-# be better located in $HOST_OUT_JAVA_LIBRARIES, but it is
-# not possible to refer to that from a shell script (the
-# variable is not exported from envsetup.sh). There is also
-# some trickery involved: we need to include some classes
-# that reside in core.jar, but since we cannot incldue the
-# whole core.jar in the RI classpath, we copy those classses
-# over to our new file.
-HOST_CORE_JAR := $(HOST_COMMON_OUT_ROOT)/core-tests.jar
-
-$(HOST_CORE_JAR): PRIVATE_LOCAL_BUILT_MODULE := $(LOCAL_BUILT_MODULE)
-$(HOST_CORE_JAR): PRIVATE_CORE_INTERMEDIATES := $(core-intermediates)
-$(HOST_CORE_JAR): $(LOCAL_BUILT_MODULE)
-	@rm -rf $(dir $<)/hostctsclasses
-	$(call unzip-jar-files,$(dir $<)classes.jar,$(dir $<)hostctsclasses)
-	@unzip -qx -o $(PRIVATE_CORE_INTERMEDIATES)/classes.jar dalvik/annotation/* -d $(dir $<)hostctsclasses
-	@cp $< $@
-	@jar uf $@ -C $(dir $<)hostctsclasses .
-
-$(LOCAL_INSTALLED_MODULE): $(HOST_CORE_JAR)
-
 
 #
 # Build for the host.
@@ -268,6 +154,32 @@
 
     include $(BUILD_HOST_JAVA_LIBRARY)
 
+    # Make core-junit
+    include $(CLEAR_VARS)
+    LOCAL_SRC_FILES := $(call all-main-java-files-under,junit)
+    LOCAL_NO_STANDARD_LIBRARIES := true
+    LOCAL_JAVA_LIBRARIES := core-hostdex
+    LOCAL_JAVACFLAGS := $(local_javac_flags)
+    LOCAL_MODULE_TAGS := optional
+    LOCAL_MODULE := core-junit-hostdex
+    LOCAL_BUILD_HOST_DEX := true
+    include $(BUILD_HOST_JAVA_LIBRARY)
+
+    # Make the core-tests library.
+    include $(CLEAR_VARS)
+    LOCAL_SRC_FILES := $(call all-test-java-files-under,dalvik dom json luni support xml)
+    LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs)
+    LOCAL_NO_STANDARD_LIBRARIES := true
+    LOCAL_JAVA_LIBRARIES := bouncycastle-hostdex core-hostdex core-junit-hostdex
+    LOCAL_STATIC_JAVA_LIBRARIES := sqlite-jdbc-host
+    LOCAL_DX_FLAGS := --core-library
+    LOCAL_JAVACFLAGS := $(local_javac_flags)
+    LOCAL_MODULE_TAGS := tests
+    LOCAL_MODULE := core-tests-hostdex
+    LOCAL_NO_EMMA_INSTRUMENT := true
+    LOCAL_NO_EMMA_COMPILE := true
+    LOCAL_BUILD_HOST_DEX := true
+    include $(BUILD_HOST_JAVA_LIBRARY)
 endif
 
 #
@@ -297,6 +209,7 @@
 LOCAL_SRC_FILES:=$(call libcore_to_document,$(LOCAL_PATH))
 # rerun doc generation without recompiling the java
 LOCAL_JAVA_LIBRARIES:=
+LOCAL_JAVACFLAGS := $(local_javac_flags)
 LOCAL_MODULE_CLASS:=JAVA_LIBRARIES
 
 LOCAL_MODULE := libcore
diff --git a/NativeCode.mk b/NativeCode.mk
index b5cc769..648cd33 100644
--- a/NativeCode.mk
+++ b/NativeCode.mk
@@ -1,3 +1,4 @@
+# -*- mode: makefile -*-
 # Copyright (C) 2007 The Android Open Source Project
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -77,6 +78,8 @@
 core_c_includes := $(sort libcore/include $(LOCAL_C_INCLUDES) $(JNI_H_INCLUDE))
 core_shared_libraries := $(sort $(LOCAL_SHARED_LIBRARIES))
 core_static_libraries := $(sort $(LOCAL_STATIC_LIBRARIES))
+core_cflags := -fvisibility=hidden -fvisibility-inlines-hidden
+core_cflags += '-DGCC_HIDDEN=__attribute__((visibility("hidden")))'
 
 
 #
@@ -86,7 +89,7 @@
 include $(CLEAR_VARS)
 
 LOCAL_CFLAGS += -Wall -Wextra -Werror
-
+LOCAL_CFLAGS += $(core_cflags)
 ifeq ($(TARGET_ARCH),arm)
 # Ignore "note: the mangling of 'va_list' has changed in GCC 4.4"
 LOCAL_CFLAGS += -Wno-psabi
@@ -101,7 +104,7 @@
 LOCAL_MODULE := libjavacore
 
 ifneq ($(TARGET_SIMULATOR),true)
-LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include 
+LOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
 LOCAL_SHARED_LIBRARIES += libstlport
 endif
 
@@ -124,6 +127,7 @@
 
     # Define the rules.
     LOCAL_SRC_FILES := $(core_src_files)
+    LOCAL_CFLAGS += $(core_cflags)
     LOCAL_C_INCLUDES := $(core_c_includes)
     LOCAL_SHARED_LIBRARIES := $(core_shared_libraries)
     LOCAL_STATIC_LIBRARIES := $(core_static_libraries)
diff --git a/dalvik/src/main/java/dalvik/annotation/HostController.java b/dalvik/src/main/java/dalvik/annotation/HostController.java
deleted file mode 100644
index 749dc62..0000000
--- a/dalvik/src/main/java/dalvik/annotation/HostController.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dalvik.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Record the host side controller information for a test method,
- * so that the CTS host can locate correspond host side unit while running it.
- * {@hide pending API Council approval}
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.METHOD })
-public @interface HostController {
-
-    /**
-     * The host controller method name.
-     */
-    String name() default "";
-}
diff --git a/dalvik/src/main/java/dalvik/annotation/TestInfo.java b/dalvik/src/main/java/dalvik/annotation/TestInfo.java
deleted file mode 100644
index 4126fcc..0000000
--- a/dalvik/src/main/java/dalvik/annotation/TestInfo.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dalvik.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines an annotation for test methods that allow, among other things, to
- * link the test to the method that is being tested.
- *
- * {@hide}
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.METHOD })
-public @interface TestInfo {
-
-    /**
-     * Specifies the current status of the test, as determined by a reviewer.
-     */
-    TestStatus status() default TestStatus.TBR;
-
-    /**
-     * Specifies noteworthy plain-text information about the test, like whether
-     * it is testing a specific parameter combination or something.
-     */
-    String notes() default "";
-
-    /**
-     * Specifies the current level of coverage the test has.
-     */
-    TestLevel level() default TestLevel.PARTIAL;
-
-    /**
-     * Specifies the purpose (either if it is noteworth to mention such as if
-     * it is testing a specific parameter combination) or the covered test
-     * aspects (exceptions, normal cases, border edge cases, etc.) in
-     * case the level is Level.PARTIAL
-     */
-    String purpose() default "";
-
-    /**
-     * Specifies an array of target methods.
-     */
-    TestTarget[] targets();
-
-}
diff --git a/dalvik/src/main/java/dalvik/annotation/TestStatus.java b/dalvik/src/main/java/dalvik/annotation/TestStatus.java
deleted file mode 100644
index fc7a920..0000000
--- a/dalvik/src/main/java/dalvik/annotation/TestStatus.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dalvik.annotation;
-
-/**
- * Defines an enumeration of possible states a test case can be in.
- *
- * {@hide}
- *
- */
-public enum TestStatus {
-
-    /**
-     * Status is "to be reviewed", which is the initial state when a test method
-     * has been annotated.
-     */
-    TBR,
-
-    /**
-     * Status is "to do", meaning a reviewer has determined that additional work
-     * is needed.
-     */
-    TODO,
-
-    /**
-     * Status is "looks good to me", meaning the test is okay.
-     */
-    LGTM
-
-}
diff --git a/dalvik/src/main/java/dalvik/annotation/TestTarget.java b/dalvik/src/main/java/dalvik/annotation/TestTarget.java
index 158698d..dcfd20ca 100644
--- a/dalvik/src/main/java/dalvik/annotation/TestTarget.java
+++ b/dalvik/src/main/java/dalvik/annotation/TestTarget.java
@@ -25,9 +25,12 @@
  * Defines an annotation used be used within the TestInfo annotation. It
  * specifies a single method target for the test (but can be used multiple
  * times).
+ *
+ * @deprecated Obsolete
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.ANNOTATION_TYPE })
+@Deprecated
 public @interface TestTarget {
 
     /**
diff --git a/dalvik/src/main/java/dalvik/annotation/TestTargetClass.java b/dalvik/src/main/java/dalvik/annotation/TestTargetClass.java
index 9144a41..e88040e 100644
--- a/dalvik/src/main/java/dalvik/annotation/TestTargetClass.java
+++ b/dalvik/src/main/java/dalvik/annotation/TestTargetClass.java
@@ -26,9 +26,12 @@
  * that is being tested. The current assumption is that the test are somewhat
  * organized according to the API classes they test. Might be too strict for
  * some cases.
+ *
+ * @deprecated Obsolete
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target({ ElementType.TYPE })
+@Deprecated
 public @interface TestTargetClass {
 
     /**
diff --git a/dalvik/src/main/java/dalvik/annotation/Timeout.java b/dalvik/src/main/java/dalvik/annotation/Timeout.java
deleted file mode 100644
index 1a779ac..0000000
--- a/dalvik/src/main/java/dalvik/annotation/Timeout.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dalvik.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines an annotation to be used for specifying a test timeout. A test
- * harness that supports timeouts should allow a test to be run for at least
- * this time before killing it. Time is measured in seconds.
- *
- * @hide
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.ANNOTATION_TYPE, ElementType.METHOD })
-public @interface Timeout {
-
-    /**
-     * Specifies the test timeout in seconds.
-     */
-    int value();
-
-}
diff --git a/dalvik/src/main/java/dalvik/annotation/VirtualTestTarget.java b/dalvik/src/main/java/dalvik/annotation/VirtualTestTarget.java
deleted file mode 100644
index 5e57f1c..0000000
--- a/dalvik/src/main/java/dalvik/annotation/VirtualTestTarget.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dalvik.annotation;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Annotation for "virtual" implementation classes. These are classes that have
- * the following attributes:
- * <ul>
- * <li>they implement a public interface or are a concrete implementation of a
- * public abstract class,</li>
- * <li>they are not public,</li>
- * <li>instances can only be retrieved through some kind of factory method.</li>
- * </ul>
- * <p>
- * Example: {@code MessageDigest} is an abstract class. Concrete implementations
- * of message digest algorithms such as MD5 and SHA-1 can only be retrieved
- * through one of the static {@code getInstance} methods of
- * {@code MessageDigest}, which accept the desired algorithm as a string
- * parameter and return an implementation accordingly.
- * </p>
- * <p>
- * Even though the concrete implementation class for a message digest algorithm
- * is not known, we need to be able to indicate that such a class exists and
- * that it must be tested. This is done by defining corresponding classes and
- * annotating them with {@code @VirtualTestTarget}. This class can then be
- * used in the {@code @TestTargetClass} annotation with which we annotate
- * {@code TestCase} subclasses.
- * @hide
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ ElementType.TYPE })
-public @interface VirtualTestTarget {
-
-    /**
-     * Field for comments.
-     */
-    String value() default "";
-}
diff --git a/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java b/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java
index 1209b2e..f253ee7 100644
--- a/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java
+++ b/dalvik/src/main/java/dalvik/bytecode/OpcodeInfo.java
@@ -55,7 +55,7 @@
          */
         // BEGIN(libcore-maximum-values); GENERATED AUTOMATICALLY BY opcode-gen
         MAXIMUM_VALUE = 65535;
-        MAXIMUM_PACKED_VALUE = 255;
+        MAXIMUM_PACKED_VALUE = 511;
         // END(libcore-maximum-values)
     }
 
diff --git a/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
new file mode 100644
index 0000000..ab24f0b
--- /dev/null
+++ b/dalvik/src/main/java/dalvik/system/BaseDexClassLoader.java
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dalvik.system;
+
+import java.io.File;
+import java.net.URL;
+import java.util.Enumeration;
+
+/**
+ * Base class for common functionality between various dex-based
+ * {@link ClassLoader} implementations.
+ */
+public class BaseDexClassLoader extends ClassLoader {
+    /** originally specified path (just used for {@code toString()}) */
+    private final String originalPath;
+
+    /** structured lists of path elements */
+    private final DexPathList pathList;
+
+    /**
+     * Constructs an instance.
+     *
+     * @param dexPath the list of jar/apk files containing classes and
+     * resources, delimited by {@code File.pathSeparator}, which
+     * defaults to {@code ":"} on Android
+     * @param optimizedDirectory directory where optimized dex files
+     * should be written; may be {@code null}
+     * @param libraryPath the list of directories containing native
+     * libraries, delimited by {@code File.pathSeparator}; may be
+     * {@code null}
+     * @param parent the parent class loader
+     */
+    public BaseDexClassLoader(String dexPath, File optimizedDirectory,
+            String libraryPath, ClassLoader parent) {
+        super(parent);
+
+        this.originalPath = dexPath;
+        this.pathList =
+            new DexPathList(this, dexPath, libraryPath, optimizedDirectory);
+    }
+
+    @Override
+    protected Class<?> findClass(String name) throws ClassNotFoundException {
+        Class clazz = pathList.findClass(name);
+
+        if (clazz == null) {
+            throw new ClassNotFoundException(name);
+        }
+
+        return clazz;
+    }
+
+    @Override
+    protected URL findResource(String name) {
+        return pathList.findResource(name);
+    }
+
+    @Override
+    protected Enumeration<URL> findResources(String name) {
+        return pathList.findResources(name);
+    }
+
+    @Override
+    public String findLibrary(String name) {
+        return pathList.findLibrary(name);
+    }
+
+    /**
+     * Returns package information for the given package.
+     * Unfortunately, instances of this class don't really have this
+     * information, and as a non-secure {@code ClassLoader}, it isn't
+     * even required to, according to the spec. Yet, we want to
+     * provide it, in order to make all those hopeful callers of
+     * {@code myClass.getPackage().getName()} happy. Thus we construct
+     * a {@code Package} object the first time it is being requested
+     * and fill most of the fields with dummy values. The {@code
+     * Package} object is then put into the {@code ClassLoader}'s
+     * package cache, so we see the same one next time. We don't
+     * create {@code Package} objects for {@code null} arguments or
+     * for the default package.
+     *
+     * <p>There is a limited chance that we end up with multiple
+     * {@code Package} objects representing the same package: It can
+     * happen when when a package is scattered across different JAR
+     * files which were loaded by different {@code ClassLoader}
+     * instances. This is rather unlikely, and given that this whole
+     * thing is more or less a workaround, probably not worth the
+     * effort to address.
+     *
+     * @param name the name of the class
+     * @return the package information for the class, or {@code null}
+     * if there is no package information available for it
+     */
+    @Override
+    protected synchronized Package getPackage(String name) {
+        if (name != null && !name.isEmpty()) {
+            Package pack = super.getPackage(name);
+
+            if (pack == null) {
+                pack = definePackage(name, "Unknown", "0.0", "Unknown",
+                        "Unknown", "0.0", "Unknown", null);
+            }
+
+            return pack;
+        }
+
+        return null;
+    }
+
+    @Override
+    public String toString() {
+        return getClass().getName() + "[" + originalPath + "]";
+    }
+}
diff --git a/dalvik/src/main/java/dalvik/system/BlockGuard.java b/dalvik/src/main/java/dalvik/system/BlockGuard.java
index 6d67fe5..d3c5088 100644
--- a/dalvik/src/main/java/dalvik/system/BlockGuard.java
+++ b/dalvik/src/main/java/dalvik/system/BlockGuard.java
@@ -24,8 +24,10 @@
 import java.net.SocketException;
 import java.net.SocketImpl;
 import java.net.SocketOptions;
-import org.apache.harmony.luni.platform.IFileSystem;
+import libcore.io.Libcore;
+import libcore.io.StructLinger;
 import org.apache.harmony.luni.platform.INetworkSystem;
+import static libcore.io.OsConstants.*;
 
 /**
  * Mechanism to let threads set restrictions on what code is allowed
@@ -115,7 +117,7 @@
     /**
      * The default, permissive policy that doesn't prevent any operations.
      */
-    public static Policy LAX_POLICY = new Policy() {
+    public static final Policy LAX_POLICY = new Policy() {
             public void onWriteToDisk() {}
             public void onReadFromDisk() {}
             public void onNetwork() {}
@@ -156,104 +158,6 @@
     private BlockGuard() {}
 
     /**
-     * A filesystem wrapper that calls the policy check functions
-     * on reads and writes.
-     */
-    public static class WrappedFileSystem implements IFileSystem {
-        private final IFileSystem mFileSystem;
-
-        public WrappedFileSystem(IFileSystem fileSystem) {
-            mFileSystem = fileSystem;
-        }
-
-        public long read(int fileDescriptor, byte[] bytes, int offset, int length)
-                throws IOException {
-            BlockGuard.getThreadPolicy().onReadFromDisk();
-            return mFileSystem.read(fileDescriptor, bytes, offset, length);
-        }
-
-        public long write(int fileDescriptor, byte[] bytes, int offset, int length)
-                throws IOException {
-            BlockGuard.getThreadPolicy().onWriteToDisk();
-            return mFileSystem.write(fileDescriptor, bytes, offset, length);
-        }
-
-        public long readv(int fileDescriptor, int[] addresses, int[] offsets,
-                          int[] lengths, int size) throws IOException {
-            BlockGuard.getThreadPolicy().onReadFromDisk();
-            return mFileSystem.readv(fileDescriptor, addresses, offsets, lengths, size);
-        }
-
-        public long writev(int fileDescriptor, int[] addresses, int[] offsets,
-                           int[] lengths, int size) throws IOException {
-            BlockGuard.getThreadPolicy().onWriteToDisk();
-            return mFileSystem.writev(fileDescriptor, addresses, offsets, lengths, size);
-        }
-
-        public long readDirect(int fileDescriptor, int address, int offset,
-                               int length) throws IOException {
-            BlockGuard.getThreadPolicy().onReadFromDisk();
-            return mFileSystem.readDirect(fileDescriptor, address, offset, length);
-        }
-
-        public long writeDirect(int fileDescriptor, int address, int offset,
-                                int length) throws IOException {
-            BlockGuard.getThreadPolicy().onWriteToDisk();
-            return mFileSystem.writeDirect(fileDescriptor, address, offset, length);
-        }
-
-        public boolean lock(int fileDescriptor, long start, long length, int type,
-                            boolean waitFlag) throws IOException {
-            return mFileSystem.lock(fileDescriptor, start, length, type, waitFlag);
-        }
-
-        public void unlock(int fileDescriptor, long start, long length)
-                throws IOException {
-            mFileSystem.unlock(fileDescriptor, start, length);
-        }
-
-        public long seek(int fileDescriptor, long offset, int whence)
-                throws IOException {
-            return mFileSystem.seek(fileDescriptor, offset, whence);
-        }
-
-        public void fsync(int fileDescriptor, boolean metadata) throws IOException {
-            BlockGuard.getThreadPolicy().onWriteToDisk();
-            mFileSystem.fsync(fileDescriptor, metadata);
-        }
-
-        public void truncate(int fileDescriptor, long size) throws IOException {
-            BlockGuard.getThreadPolicy().onWriteToDisk();
-            mFileSystem.truncate(fileDescriptor, size);
-        }
-
-        public int getAllocGranularity() {
-            return mFileSystem.getAllocGranularity();
-        }
-
-        public int open(String path, int mode) throws FileNotFoundException {
-            BlockGuard.getThreadPolicy().onReadFromDisk();
-            if (mode != 0) {  // 0 is read-only
-                BlockGuard.getThreadPolicy().onWriteToDisk();
-            }
-            return mFileSystem.open(path, mode);
-        }
-
-        public long transfer(int fileHandler, FileDescriptor socketDescriptor,
-                             long offset, long count) throws IOException {
-            return mFileSystem.transfer(fileHandler, socketDescriptor, offset, count);
-        }
-
-        public int ioctlAvailable(FileDescriptor fileDescriptor) throws IOException {
-            return mFileSystem.ioctlAvailable(fileDescriptor);
-        }
-
-        public long length(int fd) {
-            return mFileSystem.length(fd);
-        }
-    }
-
-    /**
      * A network wrapper that calls the policy check functions.
      */
     public static class WrappedNetworkSystem implements INetworkSystem {
@@ -343,36 +247,16 @@
             mNetwork.disconnectDatagram(aFD);
         }
 
-        public void socket(FileDescriptor aFD, boolean stream) throws SocketException {
-            mNetwork.socket(aFD, stream);
-        }
-
-        public void shutdownInput(FileDescriptor descriptor) throws IOException {
-            mNetwork.shutdownInput(descriptor);
-        }
-
-        public void shutdownOutput(FileDescriptor descriptor) throws IOException {
-            mNetwork.shutdownOutput(descriptor);
-        }
-
         public void sendUrgentData(FileDescriptor fd, byte value) {
             mNetwork.sendUrgentData(fd, value);
         }
 
-        public void listen(FileDescriptor aFD, int backlog) throws SocketException {
-            mNetwork.listen(aFD, backlog);
-        }
-
         public void connect(FileDescriptor aFD, InetAddress inetAddress, int port,
                 int timeout) throws SocketException {
             BlockGuard.getThreadPolicy().onNetwork();
             mNetwork.connect(aFD, inetAddress, port, timeout);
         }
 
-        public InetAddress getSocketLocalAddress(FileDescriptor aFD) {
-            return mNetwork.getSocketLocalAddress(aFD);
-        }
-
         public boolean select(FileDescriptor[] readFDs, FileDescriptor[] writeFDs,
                 int numReadable, int numWritable, long timeout, int[] flags)
                 throws SocketException {
@@ -380,15 +264,6 @@
             return mNetwork.select(readFDs, writeFDs, numReadable, numWritable, timeout, flags);
         }
 
-        public int getSocketLocalPort(FileDescriptor aFD) {
-            return mNetwork.getSocketLocalPort(aFD);
-        }
-
-        public Object getSocketOption(FileDescriptor aFD, int opt)
-                throws SocketException {
-            return mNetwork.getSocketOption(aFD, opt);
-        }
-
         public void setSocketOption(FileDescriptor aFD, int opt, Object optVal)
                 throws SocketException {
             mNetwork.setSocketOption(aFD, opt, optVal);
@@ -404,19 +279,10 @@
             mNetwork.close(aFD);
         }
 
-        public void setInetAddress(InetAddress sender, byte[] address) {
-            mNetwork.setInetAddress(sender, address);
-        }
-
         private boolean isLingerSocket(FileDescriptor fd) throws SocketException {
             try {
-                Object lingerValue = mNetwork.getSocketOption(fd, SocketOptions.SO_LINGER);
-                if (lingerValue instanceof Boolean) {
-                    return (Boolean) lingerValue;
-                } else if (lingerValue instanceof Integer) {
-                    return ((Integer) lingerValue) != 0;
-                }
-                throw new AssertionError(lingerValue.getClass().getName());
+                StructLinger linger = Libcore.os.getsockoptLinger(fd, SOL_SOCKET, SO_LINGER);
+                return linger.isOn() && linger.l_linger > 0;
             } catch (Exception ignored) {
                 // We're called via Socket.close (which doesn't ask for us to be called), so we
                 // must not throw here, because Socket.close must not throw if asked to close an
diff --git a/dalvik/src/main/java/dalvik/system/CloseGuard.java b/dalvik/src/main/java/dalvik/system/CloseGuard.java
index b631852..136be2f 100644
--- a/dalvik/src/main/java/dalvik/system/CloseGuard.java
+++ b/dalvik/src/main/java/dalvik/system/CloseGuard.java
@@ -16,9 +16,6 @@
 
 package dalvik.system;
 
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
 /**
  * CloseGuard is a mechanism for flagging implicit finalizer cleanup of
  * resources that should have been cleaned up by explicit close
@@ -223,13 +220,11 @@
     }
 
     /**
-     * Default Reporter which uses a Logger to report CloseGuard
-     * violations.
+     * Default Reporter which reports CloseGuard violations to the log.
      */
     private static final class DefaultReporter implements Reporter {
         public void report (String message, Throwable allocationSite) {
-            Logger.getLogger(CloseGuard.class.getName())
-                    .log(Level.WARNING, message, allocationSite);
+            System.logW(message, allocationSite);
         }
     }
 }
diff --git a/dalvik/src/main/java/dalvik/system/DexClassLoader.java b/dalvik/src/main/java/dalvik/system/DexClassLoader.java
index fea65dd..e059b7d 100644
--- a/dalvik/src/main/java/dalvik/system/DexClassLoader.java
+++ b/dalvik/src/main/java/dalvik/system/DexClassLoader.java
@@ -17,10 +17,6 @@
 package dalvik.system;
 
 import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.zip.ZipFile;
 
 /**
  * Provides a simple {@link ClassLoader} implementation that operates on a
@@ -28,323 +24,29 @@
  * holds the optimized form of the files is specified explicitly.  This
  * can be used to execute code not installed as part of an application.
  *
- * The best place to put the optimized DEX files is in app-specific
+ * The best place to put the optimized dex files is in app-specific
  * storage, so that removal of the app will automatically remove the
- * optimized DEX files.  If other storage is used (e.g. /sdcard), the
+ * optimized dex files.  If other storage is used (e.g. /sdcard), the
  * app may not have an opportunity to remove them.
  */
-public class DexClassLoader extends ClassLoader {
-    // TODO: Factor out commonality between this class and PathClassLoader.
-
-    private static final boolean VERBOSE_DEBUG = false;
-
-    /* constructor args, held for init */
-    private final String mRawDexPath;
-    private final String mRawLibPath;
-    private final String mDexOutputPath;
-
-    /*
-     * Parallel arrays for jar/apk files.
-     *
-     * (could stuff these into an object and have a single array;
-     * improves clarity but adds overhead)
-     */
-    private final File[] mFiles;         // source file Files, for rsrc URLs
-    private final ZipFile[] mZips;       // source zip files, with resources
-    private final DexFile[] mDexs;       // opened, prepped DEX files
-
-    /**
-     * Native library path.
-     */
-    private final String[] mLibPaths;
-
+public class DexClassLoader extends BaseDexClassLoader {
     /**
      * Creates a {@code DexClassLoader} that finds interpreted and native
-     * code.  Interpreted classes are found in a set of DEX files contained
-     * in Jar or APK files.
+     * code.  Interpreted classes are found in a set of dex files contained
+     * in jar or apk files.
      *
-     * The path lists are separated using the character specified by
-     * the "path.separator" system property, which defaults to ":".
-     *
-     * @param dexPath
-     *  the list of jar/apk files containing classes and resources
-     * @param dexOutputDir
-     *  directory where optimized DEX files should be written
-     * @param libPath
-     *  the list of directories containing native libraries; may be null
-     * @param parent
-     *  the parent class loader
+     * @param dexPath the list of jar/apk files containing classes and
+     * resources, delimited by {@code File.pathSeparator}, which
+     * defaults to {@code ":"} on Android
+     * @param optimizedDirectory directory where optimized dex files
+     * should be written; must not be {@code null}
+     * @param libraryPath the list of directories containing native
+     * libraries, delimited by {@code File.pathSeparator}; may be
+     * {@code null}
+     * @param parent the parent class loader
      */
-    public DexClassLoader(String dexPath, String dexOutputDir, String libPath,
-            ClassLoader parent) {
-        super(parent);
-
-        if (dexPath == null || dexOutputDir == null) {
-            throw new NullPointerException();
-        }
-
-        mRawDexPath = dexPath;
-        mDexOutputPath = dexOutputDir;
-        mRawLibPath = libPath;
-
-        String[] dexPathList = mRawDexPath.split(":");
-        int length = dexPathList.length;
-
-        mFiles = new File[length];
-        mZips = new ZipFile[length];
-        mDexs = new DexFile[length];
-
-        /* open all Zip and DEX files up front */
-        for (int i = 0; i < length; i++) {
-            File pathFile = new File(dexPathList[i]);
-            mFiles[i] = pathFile;
-
-            if (pathFile.isFile()) {
-                if (!dexPathList[i].endsWith(".dex")) {
-                    /*
-                     * If the name doesn't end with ".dex" assume it's a zip
-                     * file of some sort.
-                     */
-                    try {
-                        mZips[i] = new ZipFile(pathFile);
-                    }
-                    catch (IOException ioex) {
-                        // expecting IOException and ZipException
-                        //System.out.println("Failed opening '" + pathFile
-                        //    + "': " + ioex);
-                        //ioex.printStackTrace();
-                    }
-                }
-
-                /*
-                 * If we got a zip file, we still need to extract out
-                 * the dex file from it.
-                 */
-                try {
-                    String outputName =
-                        generateOutputName(dexPathList[i], mDexOutputPath);
-                    mDexs[i] = DexFile.loadDex(dexPathList[i], outputName, 0);
-                } catch (IOException ioex) {
-                    // It might be a resource-only zip.
-                    //System.out.println("Failed to construct DexFile '"
-                    //    + pathFile + "': " + ioex);
-                }
-            }
-        }
-
-        /*
-         * Prep for native library loading.
-         */
-        String pathList = System.getProperty("java.library.path", ".");
-        String pathSep = System.getProperty("path.separator", ":");
-        String fileSep = System.getProperty("file.separator", "/");
-
-        if (mRawLibPath != null) {
-            if (pathList.length() > 0) {
-                pathList += pathSep + mRawLibPath;
-            }
-            else {
-                pathList = mRawLibPath;
-            }
-        }
-
-        mLibPaths = pathList.split(pathSep);
-        length = mLibPaths.length;
-
-        // Add a '/' to the end so we don't have to do the property lookup
-        // and concatenation later.
-        for (int i = 0; i < length; i++) {
-            if (!mLibPaths[i].endsWith(fileSep))
-                mLibPaths[i] += fileSep;
-            if (VERBOSE_DEBUG)
-                System.out.println("Native lib path " +i+ ":  "
-                        + mLibPaths[i]);
-        }
-    }
-
-    /**
-     * Convert a source path name and an output directory to an output
-     * file name.
-     */
-    private static String generateOutputName(String sourcePathName,
-            String outputDir) {
-        StringBuilder newStr = new StringBuilder(80);
-
-        /* start with the output directory */
-        newStr.append(outputDir);
-        if (!outputDir.endsWith("/"))
-            newStr.append("/");
-
-        /* get the filename component of the path */
-        String sourceFileName;
-        int lastSlash = sourcePathName.lastIndexOf("/");
-        if (lastSlash < 0)
-            sourceFileName = sourcePathName;
-        else
-            sourceFileName = sourcePathName.substring(lastSlash+1);
-
-        /*
-         * Replace ".jar", ".zip", whatever with ".dex".  We don't want to
-         * use ".odex", because the build system uses that for files that
-         * are paired with resource-only jar files.  If the VM can assume
-         * that there's no classes.dex in the matching jar, it doesn't need
-         * to open the jar to check for updated dependencies, providing a
-         * slight performance boost at startup.  The use of ".dex" here
-         * matches the use on files in /data/dalvik-cache.
-         */
-        int lastDot = sourceFileName.lastIndexOf(".");
-        if (lastDot < 0)
-            newStr.append(sourceFileName);
-        else
-            newStr.append(sourceFileName, 0, lastDot);
-        newStr.append(".dex");
-
-        if (VERBOSE_DEBUG)
-            System.out.println("Output file will be " + newStr.toString());
-        return newStr.toString();
-    }
-
-    /**
-     * Finds a class. This method is called by {@code loadClass()} after the
-     * parent ClassLoader has failed to find a loaded class of the same name.
-     *
-     * @param name
-     *            The name of the class to search for, in a human-readable form
-     *            like "java.lang.String" or "java.net.URLClassLoader$3$1".
-     * @return the {@link Class} object representing the class
-     * @throws ClassNotFoundException
-     *             if the class cannot be found
-     */
-    @Override
-    protected Class<?> findClass(String name) throws ClassNotFoundException {
-        if (VERBOSE_DEBUG)
-            System.out.println("DexClassLoader " + this
-                + ": findClass '" + name + "'");
-
-        int length = mFiles.length;
-
-        for (int i = 0; i < length; i++) {
-            if (VERBOSE_DEBUG)
-                System.out.println("  Now searching: " + mFiles[i].getPath());
-
-            if (mDexs[i] != null) {
-                String slashName = name.replace('.', '/');
-                Class clazz = mDexs[i].loadClass(slashName, this);
-                if (clazz != null) {
-                    if (VERBOSE_DEBUG)
-                        System.out.println("    found");
-                    return clazz;
-                }
-            }
-        }
-
-        throw new ClassNotFoundException(name + " in loader " + this);
-    }
-
-    /**
-     * Finds a resource. This method is called by {@code getResource()} after
-     * the parent ClassLoader has failed to find a loaded resource of the same
-     * name.
-     *
-     * @param name
-     *            The name of the resource to find
-     * @return the location of the resource as a URL, or {@code null} if the
-     *         resource is not found.
-     */
-    @Override
-    protected URL findResource(String name) {
-        int length = mFiles.length;
-
-        for (int i = 0; i < length; i++) {
-            File pathFile = mFiles[i];
-            ZipFile zip = mZips[i];
-
-            if (zip.getEntry(name) != null) {
-                if (VERBOSE_DEBUG)
-                    System.out.println("  found " + name + " in " + pathFile);
-                try {
-                    // File.toURL() is compliant with RFC 1738 in always
-                    // creating absolute path names. If we construct the
-                    // URL by concatenating strings, we might end up with
-                    // illegal URLs for relative names.
-                    return new URL("jar:" + pathFile.toURL() + "!/" + name);
-                } catch (MalformedURLException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        }
-
-        if (VERBOSE_DEBUG)
-            System.out.println("  resource " + name + " not found");
-
-        return null;
-    }
-
-    /**
-     * Finds a native library. This method is called after the parent
-     * ClassLoader has failed to find a native library of the same name.
-     *
-     * @param libname
-     *            The name of the library to find
-     * @return the complete path of the library, or {@code null} if the library
-     *         is not found.
-     */
-    @Override
-    protected String findLibrary(String libname) {
-        String fileName = System.mapLibraryName(libname);
-        for (int i = 0; i < mLibPaths.length; i++) {
-            String pathName = mLibPaths[i] + fileName;
-            File test = new File(pathName);
-
-            if (test.exists()) {
-                if (VERBOSE_DEBUG)
-                    System.out.println("  found " + libname);
-                return pathName;
-            }
-        }
-
-        if (VERBOSE_DEBUG)
-            System.out.println("  library " + libname + " not found");
-        return null;
-    }
-
-    /**
-     * Returns package information for the given package. Unfortunately, the
-     * DexClassLoader doesn't really have this information, and as a non-secure
-     * ClassLoader, it isn't even required to, according to the spec. Yet, we
-     * want to provide it, in order to make all those hopeful callers of
-     * <code>myClass.getPackage().getName()</code> happy. Thus we construct a
-     * Package object the first time it is being requested and fill most of the
-     * fields with dummy values. The Package object is then put into the
-     * ClassLoader's Package cache, so we see the same one next time. We don't
-     * create Package objects for null arguments or for the default package.
-     * <p>
-     * There a limited chance that we end up with multiple Package objects
-     * representing the same package: It can happen when when a package is
-     * scattered across different JAR files being loaded by different
-     * ClassLoaders. Rather unlikely, and given that this whole thing is more or
-     * less a workaround, probably not worth the effort.
-     *
-     * @param name
-     *            the name of the class
-     * @return the package information for the class, or {@code null} if there
-     *         is not package information available for it
-     */
-    @Override
-    protected Package getPackage(String name) {
-        if (name != null && !name.isEmpty()) {
-            synchronized(this) {
-                Package pack = super.getPackage(name);
-
-                if (pack == null) {
-                    pack = definePackage(name, "Unknown", "0.0", "Unknown",
-                            "Unknown", "0.0", "Unknown", null);
-                }
-
-                return pack;
-            }
-        }
-
-        return null;
+    public DexClassLoader(String dexPath, String optimizedDirectory,
+            String libraryPath, ClassLoader parent) {
+        super(dexPath, new File(optimizedDirectory), libraryPath, parent);
     }
 }
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java
index 4156f12..dc3e063 100644
--- a/dalvik/src/main/java/dalvik/system/DexFile.java
+++ b/dalvik/src/main/java/dalvik/system/DexFile.java
@@ -19,10 +19,8 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.security.ProtectionDomain;
 import java.util.Enumeration;
 
-
 /**
  * Manipulates DEX files. The class is similar in principle to
  * {@link java.util.zip.ZipFile}. It is used primarily by class loaders.
@@ -74,10 +72,6 @@
      *             access rights missing for opening it
      */
     public DexFile(String fileName) throws IOException {
-        String wantDex = System.getProperty("android.vm.dexfile", "false");
-        if (!wantDex.equals("true"))
-            throw new UnsupportedOperationException("No dex in this VM");
-
         mCookie = openDexFile(fileName, null, 0);
         mFileName = fileName;
         guard.open("close");
@@ -95,13 +89,7 @@
      * @param flags
      *  Enable optional features.
      */
-    private DexFile(String sourceName, String outputName, int flags)
-        throws IOException {
-
-        String wantDex = System.getProperty("android.vm.dexfile", "false");
-        if (!wantDex.equals("true"))
-            throw new UnsupportedOperationException("No dex in this VM");
-
+    private DexFile(String sourceName, String outputName, int flags) throws IOException {
         mCookie = openDexFile(sourceName, outputName, flags);
         mFileName = sourceName;
         guard.open("close");
@@ -204,13 +192,10 @@
      * @hide
      */
     public Class loadClassBinaryName(String name, ClassLoader loader) {
-        return defineClass(name, loader, mCookie,
-            null);
-            //new ProtectionDomain(name) /*DEBUG ONLY*/);
+        return defineClass(name, loader, mCookie);
     }
 
-    native private static Class defineClass(String name, ClassLoader loader,
-        int cookie, ProtectionDomain pd);
+    private native static Class defineClass(String name, ClassLoader loader, int cookie);
 
     /**
      * Enumerate the names of the classes in this DEX file.
diff --git a/dalvik/src/main/java/dalvik/system/DexPathList.java b/dalvik/src/main/java/dalvik/system/DexPathList.java
new file mode 100644
index 0000000..1253223
--- /dev/null
+++ b/dalvik/src/main/java/dalvik/system/DexPathList.java
@@ -0,0 +1,422 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package dalvik.system;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.regex.Pattern;
+import java.util.zip.ZipFile;
+
+/**
+ * A pair of lists of entries, associated with a {@code ClassLoader}.
+ * One of the lists is a dex/resource path &mdash; typically referred
+ * to as a "class path" &mdash; list, and the other names directories
+ * containing native code libraries. Class path entries may be any of:
+ * a {@code .jar} or {@code .zip} file containing an optional
+ * top-level {@code classes.dex} file as well as arbitrary resources,
+ * or a plain {@code .dex} file (with no possibility of associated
+ * resources).
+ *
+ * <p>This class also contains methods to use these lists to look up
+ * classes and resources.</p>
+ */
+/*package*/ final class DexPathList {
+    private static final String DEX_SUFFIX = ".dex";
+    private static final String JAR_SUFFIX = ".jar";
+    private static final String ZIP_SUFFIX = ".zip";
+    private static final String APK_SUFFIX = ".apk";
+
+    /** class definition context */
+    private final ClassLoader definingContext;
+
+    /** list of dex/resource (class path) elements */
+    private final Element[] dexElements;
+
+    /** list of native library directory elements */
+    private final File[] nativeLibraryDirectories;
+
+    /**
+     * Constructs an instance.
+     *
+     * @param definingContext the context in which any as-yet unresolved
+     * classes should be defined
+     * @param dexPath list of dex/resource path elements, separated by
+     * {@code File.pathSeparator}
+     * @param libraryPath list of native library directory path elements,
+     * separated by {@code File.pathSeparator}
+     * @param optimizedDirectory directory where optimized {@code .dex} files
+     * should be found and written to, or {@code null} to use the default
+     * system directory for same
+     */
+    public DexPathList(ClassLoader definingContext, String dexPath,
+            String libraryPath, File optimizedDirectory) {
+        if (definingContext == null) {
+            throw new NullPointerException("definingContext == null");
+        }
+
+        if (dexPath == null) {
+            throw new NullPointerException("dexPath == null");
+        }
+
+        if (optimizedDirectory != null) {
+            if (!optimizedDirectory.exists())  {
+                throw new IllegalArgumentException(
+                        "optimizedDirectory doesn't exist: "
+                        + optimizedDirectory);
+            }
+
+            if (!(optimizedDirectory.canRead()
+                            && optimizedDirectory.canWrite())) {
+                throw new IllegalArgumentException(
+                        "optimizedDirectory not readable/writable: "
+                        + optimizedDirectory);
+            }
+        }
+
+        this.definingContext = definingContext;
+        this.dexElements =
+            makeDexElements(splitDexPath(dexPath), optimizedDirectory);
+        this.nativeLibraryDirectories = splitLibraryPath(libraryPath);
+    }
+
+    /**
+     * Splits the given dex path string into elements using the path
+     * separator, pruning out any elements that do not refer to existing
+     * and readable files. (That is, directories are not included in the
+     * result.)
+     */
+    private static ArrayList<File> splitDexPath(String path) {
+        return splitPaths(path, null, false);
+    }
+
+    /**
+     * Splits the given library directory path string into elements
+     * using the path separator ({@code File.pathSeparator}, which
+     * defaults to {@code ":"} on Android, appending on the elements
+     * from the system library path, and pruning out any elements that
+     * do not refer to existing and readable directories.
+     */
+    private static File[] splitLibraryPath(String path) {
+        /*
+         * Native libraries may exist in both the system and
+         * application library paths, and we use this search order:
+         *
+         *   1. this class loader's library path for application
+         *      libraries
+         *   2. the VM's library path from the system
+         *      property for system libraries
+         *
+         * This order was reversed prior to Gingerbread; see http://b/2933456.
+         */
+        ArrayList<File> result = splitPaths(
+                path, System.getProperty("java.library.path", "."), true);
+        return result.toArray(new File[result.size()]);
+    }
+
+    /**
+     * Splits the given path strings into file elements using the path
+     * separator, combining the results and filtering out elements
+     * that don't exist, aren't readable, or aren't either a regular
+     * file or a directory (as specified). Either string may be empty
+     * or {@code null}, in which case it is ignored. If both strings
+     * are empty or {@code null}, or all elements get pruned out, then
+     * this returns a zero-element list.
+     */
+    private static ArrayList<File> splitPaths(String path1, String path2,
+            boolean wantDirectories) {
+        ArrayList<File> result = new ArrayList<File>();
+
+        splitAndAdd(path1, wantDirectories, result);
+        splitAndAdd(path2, wantDirectories, result);
+        return result;
+    }
+
+    /**
+     * Helper for {@link #splitPaths}, which does the actual splitting
+     * and filtering and adding to a result.
+     */
+    private static void splitAndAdd(String path, boolean wantDirectories,
+            ArrayList<File> resultList) {
+        if (path == null) {
+            return;
+        }
+
+        String[] strings = path.split(Pattern.quote(File.pathSeparator));
+
+        for (String s : strings) {
+            File file = new File(s);
+
+            if (! (file.exists() && file.canRead())) {
+                continue;
+            }
+
+            /*
+             * Note: There are other entities in filesystems than
+             * regular files and directories.
+             */
+            if (wantDirectories) {
+                if (!file.isDirectory()) {
+                    continue;
+                }
+            } else {
+                if (!file.isFile()) {
+                    continue;
+                }
+            }
+
+            resultList.add(file);
+        }
+    }
+
+    /**
+     * Makes an array of dex/resource path elements, one per element of
+     * the given array.
+     */
+    private static Element[] makeDexElements(ArrayList<File> files,
+            File optimizedDirectory) {
+        ArrayList<Element> elements = new ArrayList<Element>();
+
+        /*
+         * Open all files and load the (direct or contained) dex files
+         * up front.
+         */
+        for (File file : files) {
+            ZipFile zip = null;
+            DexFile dex = null;
+            String name = file.getName();
+
+            if (name.endsWith(DEX_SUFFIX)) {
+                // Raw dex file (not inside a zip/jar).
+                try {
+                    dex = loadDexFile(file, optimizedDirectory);
+                } catch (IOException ex) {
+                    System.logE("Unable to load dex file: " + file, ex);
+                }
+            } else if (name.endsWith(APK_SUFFIX) || name.endsWith(JAR_SUFFIX)
+                    || name.endsWith(ZIP_SUFFIX)) {
+                try {
+                    zip = new ZipFile(file);
+                } catch (IOException ex) {
+                    /*
+                     * Note: ZipException (a subclass of IOException)
+                     * might get thrown by the ZipFile constructor
+                     * (e.g. if the file isn't actually a zip/jar
+                     * file).
+                     */
+                    System.logE("Unable to open zip file: " + file, ex);
+                }
+
+                try {
+                    dex = loadDexFile(file, optimizedDirectory);
+                } catch (IOException ignored) {
+                    /*
+                     * IOException might get thrown "legitimately" by
+                     * the DexFile constructor if the zip file turns
+                     * out to be resource-only (that is, no
+                     * classes.dex file in it). Safe to just ignore
+                     * the exception here, and let dex == null.
+                     */
+                }
+            } else {
+                System.logW("Unknown file type for: " + file);
+            }
+
+            if ((zip != null) || (dex != null)) {
+                elements.add(new Element(file, zip, dex));
+            }
+        }
+
+        return elements.toArray(new Element[elements.size()]);
+    }
+
+    /**
+     * Constructs a {@code DexFile} instance, as appropriate depending
+     * on whether {@code optimizedDirectory} is {@code null}.
+     */
+    private static DexFile loadDexFile(File file, File optimizedDirectory)
+            throws IOException {
+        if (optimizedDirectory == null) {
+            return new DexFile(file);
+        } else {
+            String optimizedPath = optimizedPathFor(file, optimizedDirectory);
+            return DexFile.loadDex(file.getPath(), optimizedPath, 0);
+        }
+    }
+
+    /**
+     * Converts a dex/jar file path and an output directory to an
+     * output file path for an associated optimized dex file.
+     */
+    private static String optimizedPathFor(File path,
+            File optimizedDirectory) {
+        /*
+         * Get the filename component of the path, and replace the
+         * suffix with ".dex" if that's not already the suffix.
+         *
+         * We don't want to use ".odex", because the build system uses
+         * that for files that are paired with resource-only jar
+         * files. If the VM can assume that there's no classes.dex in
+         * the matching jar, it doesn't need to open the jar to check
+         * for updated dependencies, providing a slight performance
+         * boost at startup. The use of ".dex" here matches the use on
+         * files in /data/dalvik-cache.
+         */
+        String fileName = path.getName();
+        if (!fileName.endsWith(DEX_SUFFIX)) {
+            int lastDot = fileName.lastIndexOf(".");
+            if (lastDot < 0) {
+                fileName += DEX_SUFFIX;
+            } else {
+                StringBuilder sb = new StringBuilder(lastDot + 4);
+                sb.append(fileName, 0, lastDot);
+                sb.append(DEX_SUFFIX);
+                fileName = sb.toString();
+            }
+        }
+
+        File result = new File(optimizedDirectory, fileName);
+        return result.getPath();
+    }
+
+    /**
+     * Finds the named class in one of the dex files pointed at by
+     * this instance. This will find the one in the earliest listed
+     * path element. If the class is found but has not yet been
+     * defined, then this method will define it in the defining
+     * context that this instance was constructed with.
+     *
+     * @return the named class or {@code null} if the class is not
+     * found in any of the dex files
+     */
+    public Class findClass(String name) {
+        for (Element element : dexElements) {
+            DexFile dex = element.dexFile;
+
+            if (dex != null) {
+                Class clazz = dex.loadClassBinaryName(name, definingContext);
+                if (clazz != null) {
+                    return clazz;
+                }
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Finds the named resource in one of the zip/jar files pointed at
+     * by this instance. This will find the one in the earliest listed
+     * path element.
+     *
+     * @return a URL to the named resource or {@code null} if the
+     * resource is not found in any of the zip/jar files
+     */
+    public URL findResource(String name) {
+        for (Element element : dexElements) {
+            URL url = element.findResource(name);
+            if (url != null) {
+                return url;
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Finds all the resources with the given name, returning an
+     * enumeration of them. If there are no resources with the given
+     * name, then this method returns an empty enumeration.
+     */
+    public Enumeration<URL> findResources(String name) {
+        ArrayList<URL> result = new ArrayList<URL>();
+
+        for (Element element : dexElements) {
+            URL url = element.findResource(name);
+            if (url != null) {
+                result.add(url);
+            }
+        }
+
+        return Collections.enumeration(result);
+    }
+
+    /**
+     * Finds the named native code library on any of the library
+     * directories pointed at by this instance. This will find the
+     * one in the earliest listed directory, ignoring any that are not
+     * readable regular files.
+     *
+     * @return the complete path to the library or {@code null} if no
+     * library was found
+     */
+    public String findLibrary(String libraryName) {
+        String fileName = System.mapLibraryName(libraryName);
+
+        for (File directory : nativeLibraryDirectories) {
+            File file = new File(directory, fileName);
+            if (file.exists() && file.isFile() && file.canRead()) {
+                return file.getPath();
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Element of the dex/resource file path
+     */
+    /*package*/ static class Element {
+        public final File file;
+        public final ZipFile zipFile;
+        public final DexFile dexFile;
+
+        public Element(File file, ZipFile zipFile, DexFile dexFile) {
+            this.file = file;
+            this.zipFile = zipFile;
+            this.dexFile = dexFile;
+        }
+
+        public URL findResource(String name) {
+            if ((zipFile == null) || (zipFile.getEntry(name) == null)) {
+                /*
+                 * Either this element has no zip/jar file (first
+                 * clause), or the zip/jar file doesn't have an entry
+                 * for the given name (second clause).
+                 */
+                return null;
+            }
+
+            try {
+                /*
+                 * File.toURL() is compliant with RFC 1738 in
+                 * always creating absolute path names. If we
+                 * construct the URL by concatenating strings, we
+                 * might end up with illegal URLs for relative
+                 * names.
+                 */
+                return new URL("jar:" + file.toURL() + "!/" + name);
+            } catch (MalformedURLException ex) {
+                throw new RuntimeException(ex);
+            }
+        }
+    }
+}
diff --git a/dalvik/src/main/java/dalvik/system/NativeStart.java b/dalvik/src/main/java/dalvik/system/NativeStart.java
index ee360ff..1382823 100644
--- a/dalvik/src/main/java/dalvik/system/NativeStart.java
+++ b/dalvik/src/main/java/dalvik/system/NativeStart.java
@@ -30,11 +30,10 @@
  * JNI AttachCurrentThread call.  If they attach the thread and start
  * creating objects, we need a fake frame to store stuff in.
  */
-class NativeStart implements Runnable {
+class NativeStart {
     private NativeStart() {}
 
     private static native void main(String[] dummy);
 
-    public native void run();
+    private static native void run();
 }
-
diff --git a/dalvik/src/main/java/dalvik/system/PathClassLoader.java b/dalvik/src/main/java/dalvik/system/PathClassLoader.java
index 08178a5..32c5586 100644
--- a/dalvik/src/main/java/dalvik/system/PathClassLoader.java
+++ b/dalvik/src/main/java/dalvik/system/PathClassLoader.java
@@ -16,65 +16,26 @@
 
 package dalvik.system;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.RandomAccessFile;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.NoSuchElementException;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import libcore.io.IoUtils;
-
 /**
  * Provides a simple {@link ClassLoader} implementation that operates on a list
  * of files and directories in the local file system, but does not attempt to
  * load classes from the network. Android uses this class for its system class
  * loader and for its application class loader(s).
  */
-public class PathClassLoader extends ClassLoader {
-    // TODO: Factor out commonality between this class and DexClassLoader.
-
-    private final String path;
-    private final String libPath;
-
-    /*
-     * Parallel arrays for jar/apk files.
-     *
-     * (could stuff these into an object and have a single array;
-     * improves clarity but adds overhead)
-     */
-    private final String[] mPaths;
-    private final File[] mFiles;
-    private final ZipFile[] mZips;
-    private final DexFile[] mDexs;
-
-    /**
-     * Native library path.
-     */
-    private final List<String> libraryPathElements;
-
+public class PathClassLoader extends BaseDexClassLoader {
     /**
      * Creates a {@code PathClassLoader} that operates on a given list of files
      * and directories. This method is equivalent to calling
      * {@link #PathClassLoader(String, String, ClassLoader)} with a
      * {@code null} value for the second argument (see description there).
      *
-     * @param path
-     *            the list of files and directories
-     *
-     * @param parent
-     *            the parent class loader
+     * @param dexPath the list of jar/apk files containing classes and
+     * resources, delimited by {@code File.pathSeparator}, which
+     * defaults to {@code ":"} on Android
+     * @param parent the parent class loader
      */
-    public PathClassLoader(String path, ClassLoader parent) {
-        this(path, null, parent);
+    public PathClassLoader(String dexPath, ClassLoader parent) {
+        super(dexPath, null, null, parent);
     }
 
     /**
@@ -83,382 +44,24 @@
      * should be one of the following:
      *
      * <ul>
-     * <li>Directories containing classes or resources.
-     * <li>JAR/ZIP/APK files, possibly containing a "classes.dex" file.
-     * <li>"classes.dex" files.
+     * <li>JAR/ZIP/APK files, possibly containing a "classes.dex" file as
+     * well as arbitrary resources.
+     * <li>Raw ".dex" files (not inside a zip file).
      * </ul>
      *
      * The entries of the second list should be directories containing
-     * native library files. Both lists are separated using the
-     * character specified by the "path.separator" system property,
-     * which, on Android, defaults to ":".
+     * native library files.
      *
-     * @param path
-     *            the list of files and directories containing classes and
-     *            resources
-     *
-     * @param libPath
-     *            the list of directories containing native libraries
-     *
-     * @param parent
-     *            the parent class loader
+     * @param dexPath the list of jar/apk files containing classes and
+     * resources, delimited by {@code File.pathSeparator}, which
+     * defaults to {@code ":"} on Android
+     * @param libraryPath the list of directories containing native
+     * libraries, delimited by {@code File.pathSeparator}; may be
+     * {@code null}
+     * @param parent the parent class loader
      */
-    public PathClassLoader(String path, String libPath, ClassLoader parent) {
-        super(parent);
-
-        if (path == null) {
-            throw new NullPointerException();
-        }
-
-        this.path = path;
-        this.libPath = libPath;
-
-        mPaths = path.split(":");
-        int length = mPaths.length;
-
-        mFiles = new File[length];
-        mZips = new ZipFile[length];
-        mDexs = new DexFile[length];
-
-        /* open all Zip and DEX files up front */
-        for (int i = 0; i < length; i++) {
-            File pathFile = new File(mPaths[i]);
-            mFiles[i] = pathFile;
-
-            if (pathFile.isFile()) {
-                if (!mPaths[i].endsWith(".dex")) {
-                    /*
-                     * If the name doesn't end with ".dex" assume it's a zip
-                     * file of some sort.
-                     */
-                    try {
-                        mZips[i] = new ZipFile(pathFile);
-                    }
-                    catch (IOException ioex) {
-                        // expecting IOException and ZipException
-                        //System.out.println("Failed opening '" + pathFile
-                        //    + "': " + ioex);
-                        //ioex.printStackTrace();
-                    }
-                }
-
-                /*
-                 * If we got a zip file, we still need to extract out
-                 * the dex file from it.
-                 */
-                try {
-                    mDexs[i] = new DexFile(pathFile);
-                }
-                catch (IOException ioex) {
-                    // It might be a resource-only zip.
-                    //System.out.println("Failed to construct DexFile '"
-                    //    + pathFile + "': " + ioex);
-                }
-            }
-        }
-
-        /*
-         * Native libraries may exist in both the system and application library
-         * paths, so we use this search order for these paths:
-         *   1. This class loader's library path for application libraries
-         *   2. The VM's library path from the system property for system libraries
-         * This order was reversed prior to Gingerbread; see http://b/2933456
-         */
-        libraryPathElements = new ArrayList<String>();
-        if (libPath != null) {
-            for (String pathElement : libPath.split(File.pathSeparator)) {
-                libraryPathElements.add(cleanupPathElement(pathElement));
-            }
-        }
-        String systemLibraryPath = System.getProperty("java.library.path", ".");
-        if (!systemLibraryPath.isEmpty()) {
-            for (String pathElement : systemLibraryPath.split(File.pathSeparator)) {
-                libraryPathElements.add(cleanupPathElement(pathElement));
-            }
-        }
-    }
-
-    /**
-     * Returns a path element that includes a trailing file separator.
-     */
-    private String cleanupPathElement(String path) {
-        return path.endsWith(File.separator) ? path : (path + File.separator);
-    }
-
-    /**
-     * Finds a class. This method is called by {@code loadClass()} after the
-     * parent ClassLoader has failed to find a loaded class of the same name.
-     *
-     * @param name
-     *            The "binary name" of the class to search for, in a
-     *            human-readable form like "java.lang.String" or
-     *            "java.net.URLClassLoader$3$1".
-     * @return the {@link Class} object representing the class
-     * @throws ClassNotFoundException
-     *             if the class cannot be found
-     */
-    @Override
-    protected Class<?> findClass(String name) throws ClassNotFoundException {
-        //System.out.println("PathClassLoader " + this + ": findClass '" + name + "'");
-
-        byte[] data = null;
-        int length = mPaths.length;
-
-        for (int i = 0; i < length; i++) {
-            //System.out.println("My path is: " + mPaths[i]);
-
-            if (mDexs[i] != null) {
-                Class clazz = mDexs[i].loadClassBinaryName(name, this);
-                if (clazz != null)
-                    return clazz;
-            } else if (mZips[i] != null) {
-                String fileName = name.replace('.', '/') + ".class";
-                data = loadFromArchive(mZips[i], fileName);
-            } else {
-                File pathFile = mFiles[i];
-                if (pathFile.isDirectory()) {
-                    String fileName =
-                        mPaths[i] + "/" + name.replace('.', '/') + ".class";
-                    data = loadFromDirectory(fileName);
-                } else {
-                    //System.out.println("PathClassLoader: can't find '"
-                    //    + mPaths[i] + "'");
-                }
-
-            }
-
-            /* --this doesn't work in current version of Dalvik--
-            if (data != null) {
-                System.out.println("--- Found class " + name
-                    + " in zip[" + i + "] '" + mZips[i].getName() + "'");
-                int dotIndex = name.lastIndexOf('.');
-                if (dotIndex != -1) {
-                    String packageName = name.substring(0, dotIndex);
-                    synchronized (this) {
-                        Package packageObj = getPackage(packageName);
-                        if (packageObj == null) {
-                            definePackage(packageName, null, null,
-                                    null, null, null, null, null);
-                        }
-                    }
-                }
-
-                return defineClass(name, data, 0, data.length);
-            }
-            */
-        }
-
-        throw new ClassNotFoundException(name + " in loader " + this);
-    }
-
-    /**
-     * Finds a resource. This method is called by {@code getResource()} after
-     * the parent ClassLoader has failed to find a loaded resource of the same
-     * name.
-     *
-     * @param name
-     *            The name of the resource to find
-     * @return the location of the resource as a URL, or {@code null} if the
-     *         resource is not found.
-     */
-    @Override
-    protected URL findResource(String name) {
-        //java.util.logging.Logger.global.severe("findResource: " + name);
-
-        int length = mPaths.length;
-
-        for (int i = 0; i < length; i++) {
-            URL result = findResource(name, i);
-            if (result != null) {
-                return result;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Finds an enumeration of URLs for the resource with the specified name.
-     *
-     * @param resName
-     *            the name of the resource to find.
-     * @return an enumeration of {@code URL} objects for the requested resource.
-     */
-    @Override
-    protected Enumeration<URL> findResources(String resName) {
-        int length = mPaths.length;
-        ArrayList<URL> results = new ArrayList<URL>();
-        for (int i = 0; i < length; i++) {
-            URL result = findResource(resName, i);
-            if (result != null) {
-                results.add(result);
-            }
-        }
-        return Collections.enumeration(results);
-    }
-
-    private URL findResource(String name, int i) {
-        File pathFile = mFiles[i];
-        ZipFile zip = mZips[i];
-        if (zip != null) {
-            if (isInArchive(zip, name)) {
-                //System.out.println("  found " + name + " in " + pathFile);
-                try {
-                    // File.toURL() is compliant with RFC 1738 in always
-                    // creating absolute path names. If we construct the
-                    // URL by concatenating strings, we might end up with
-                    // illegal URLs for relative names.
-                    return new URL("jar:" + pathFile.toURL() + "!/" + name);
-                }
-                catch (MalformedURLException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        } else if (pathFile.isDirectory()) {
-            File dataFile = new File(mPaths[i] + "/" + name);
-            if (dataFile.exists()) {
-                //System.out.println("  found resource " + name);
-                try {
-                    // Same as archive case regarding URL construction.
-                    return dataFile.toURL();
-                }
-                catch (MalformedURLException e) {
-                    throw new RuntimeException(e);
-                }
-            }
-        } else if (pathFile.isFile()) {
-        } else {
-            System.err.println("PathClassLoader: can't find '"
-                + mPaths[i] + "'");
-        }
-        return null;
-    }
-
-    /*
-     * Load the contents of a file from a file in a directory.
-     *
-     * Returns null if the class wasn't found.
-     */
-    private byte[] loadFromDirectory(String path) {
-        try {
-            return IoUtils.readFileAsByteArray(path);
-        } catch (IOException ex) {
-            System.err.println("Error reading from " + path);
-            // swallow it, return null instead
-            return null;
-        }
-    }
-
-    /*
-     * Load a class from a file in an archive.  We currently assume that
-     * the file is a Zip archive.
-     *
-     * Returns null if the class wasn't found.
-     */
-    private byte[] loadFromArchive(ZipFile zip, String name) {
-        ZipEntry entry;
-
-        entry = zip.getEntry(name);
-        if (entry == null)
-            return null;
-
-        ByteArrayOutputStream byteStream;
-        InputStream stream;
-        int count;
-
-        /*
-         * Copy the data out of the stream.  Because we got the ZipEntry
-         * from a ZipFile, the uncompressed size is known, and we can set
-         * the initial size of the ByteArrayOutputStream appropriately.
-         */
-        try {
-            stream = zip.getInputStream(entry);
-            byteStream = new ByteArrayOutputStream((int) entry.getSize());
-            byte[] buf = new byte[4096];
-            while ((count = stream.read(buf)) > 0)
-                byteStream.write(buf, 0, count);
-
-            stream.close();
-        }
-        catch (IOException ioex) {
-            //System.out.println("Failed extracting '" + archive + "': " +ioex);
-            return null;
-        }
-
-        //System.out.println("  loaded from Zip");
-        return byteStream.toByteArray();
-    }
-
-    /*
-     * Figure out if "name" is a member of "archive".
-     */
-    private boolean isInArchive(ZipFile zip, String name) {
-        return zip.getEntry(name) != null;
-    }
-
-    /**
-     * Finds a native library. This class loader first searches its own library
-     * path (as specified in the constructor) and then the system library path.
-     * In Android 2.2 and earlier, the search order was reversed.
-     *
-     * @param libname
-     *            The name of the library to find
-     * @return the complete path of the library, or {@code null} if the library
-     *         is not found.
-     */
-    public String findLibrary(String libname) {
-        String fileName = System.mapLibraryName(libname);
-        for (String pathElement : libraryPathElements) {
-            String pathName = pathElement + fileName;
-            File test = new File(pathName);
-
-            if (test.exists()) {
-                return pathName;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Returns package information for the given package. Unfortunately, the
-     * PathClassLoader doesn't really have this information, and as a non-secure
-     * ClassLoader, it isn't even required to, according to the spec. Yet, we
-     * want to provide it, in order to make all those hopeful callers of
-     * <code>myClass.getPackage().getName()</code> happy. Thus we construct a
-     * Package object the first time it is being requested and fill most of the
-     * fields with dummy values. The Package object is then put into the
-     * ClassLoader's Package cache, so we see the same one next time. We don't
-     * create Package objects for null arguments or for the default package.
-     * <p>
-     * There a limited chance that we end up with multiple Package objects
-     * representing the same package: It can happen when when a package is
-     * scattered across different JAR files being loaded by different
-     * ClassLoaders. Rather unlikely, and given that this whole thing is more or
-     * less a workaround, probably not worth the effort.
-     *
-     * @param name
-     *            the name of the class
-     * @return the package information for the class, or {@code null} if there
-     *         is not package information available for it
-     */
-    @Override
-    protected Package getPackage(String name) {
-        if (name != null && !name.isEmpty()) {
-            synchronized(this) {
-                Package pack = super.getPackage(name);
-
-                if (pack == null) {
-                    pack = definePackage(name, "Unknown", "0.0", "Unknown", "Unknown", "0.0", "Unknown", null);
-                }
-
-                return pack;
-            }
-        }
-        return null;
-    }
-
-    public String toString () {
-        return getClass().getName() + "[" + path + "]";
+    public PathClassLoader(String dexPath, String libraryPath,
+            ClassLoader parent) {
+        super(dexPath, null, libraryPath, parent);
     }
 }
diff --git a/dalvik/src/main/java/dalvik/system/TemporaryDirectory.java b/dalvik/src/main/java/dalvik/system/TemporaryDirectory.java
index 1f2defd..ff0f759 100644
--- a/dalvik/src/main/java/dalvik/system/TemporaryDirectory.java
+++ b/dalvik/src/main/java/dalvik/system/TemporaryDirectory.java
@@ -17,7 +17,6 @@
 package dalvik.system;
 
 import java.io.File;
-import java.util.logging.Logger;
 
 /**
  * Utility class to handle the setup of the core library's concept of
@@ -68,8 +67,7 @@
      */
     public static synchronized void setUpDirectory(File baseDir) {
         if (configured) {
-            Logger.global.info("Already set to: " +
-                    System.getProperty(PROPERTY));
+            System.logE("Already set to: " + System.getProperty(PROPERTY));
             return;
         }
 
diff --git a/dalvik/src/main/java/dalvik/system/TouchDex.java b/dalvik/src/main/java/dalvik/system/TouchDex.java
deleted file mode 100644
index 53cd00c..0000000
--- a/dalvik/src/main/java/dalvik/system/TouchDex.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dalvik.system;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStreamReader;
-
-/**
- * Induces optimization/verification of a set of DEX files.
- *
- * @hide
- */
-public class TouchDex {
-
-    /**
-     * Forks a process, makes sure the DEX files are prepared, and returns
-     * when everything is finished.
-     * <p>
-     * The filenames must be the same as will be used when the files are
-     * actually opened, because the dalvik-cache filename is based upon
-     * this filename.  (The absolute path to the JAR/ZIP/APK should work.)
-     *
-     * @param dexFiles a colon-separated list of DEX files.
-     * @return zero on success
-     */
-    public static int start(String dexFiles) {
-        return trampoline(dexFiles, System.getProperty("java.boot.class.path"));
-    }
-
-    /**
-     * This calls fork() and then, in the child, calls cont(dexFiles).
-     *
-     * @param dexFiles Colon-separated list of DEX files.
-     * @return zero on success
-     */
-    native private static int trampoline(String dexFiles, String bcp);
-
-    /**
-     * The entry point for the child process. args[0] can be a colon-separated
-     * path list, or "-" to read from stdin.
-     * <p>
-     * Alternatively, if we're invoked directly from the command line we
-     * just start here (skipping the fork/exec stuff).
-     *
-     * @param args command line args
-     */
-    public static void main(String[] args) {
-
-        if ("-".equals(args[0])) {
-            BufferedReader in = new BufferedReader(
-                    new InputStreamReader(System.in), 256);
-
-            String line;
-            try {
-                while ((line = in.readLine()) != null) {
-                    prepFiles(line);
-                }
-            } catch (IOException ex) {
-                throw new RuntimeException ("Error processing stdin");
-            }
-        } else {
-            prepFiles(args[0]);
-        }
-
-        System.out.println(" Prep complete");
-    }
-
-
-    private static String expandDirectories(String dexPath) {
-        String[] parts = dexPath.split(":");
-        StringBuilder outPath = new StringBuilder(dexPath.length());
-
-        // A filename filter accepting *.jar and *.apk
-        FilenameFilter filter = new FilenameFilter() {
-            public boolean accept(File dir, String name) {
-                return name.endsWith(".jar") || name.endsWith(".apk");
-            }
-        };
-
-        for (String part: parts) {
-            File f = new File(part);
-
-            if (f.isFile()) {
-                outPath.append(part);
-                outPath.append(':');
-            } else if (f.isDirectory()) {
-                String[] filenames = f.list(filter);
-
-                if (filenames == null) {
-                    System.err.println("I/O error with directory: " + part);
-                    continue;
-                }
-
-                for (String filename: filenames) {
-                    outPath.append(part);
-                    outPath.append(File.separatorChar);
-                    outPath.append(filename);
-                    outPath.append(':');
-                }
-            } else {
-                System.err.println("File not found: " + part);
-            }
-        }
-
-
-        return outPath.toString();
-    }
-
-    private static void prepFiles(String dexPath) {
-
-        System.out.println(" Prepping: " + dexPath);
-
-        TouchDexLoader loader
-                = new TouchDexLoader(expandDirectories(dexPath), null);
-
-        try {
-            /* By looking for a nonexistent class, we'll trick TouchDexLoader
-             * into trying to load something from every file on dexPath,
-             * optimizing all of them as a side-effect.
-             *
-             * The optimization happens implicitly in the VM the first time
-             * someone tries to load a class from an unoptimized dex file.
-             */
-            loader.loadClass("com.google.NonexistentClassNeverFound");
-            throw new RuntimeException("nonexistent class loaded?!");
-        } catch (ClassNotFoundException cnfe) {
-            //System.out.println("got expected dnfe");
-        }
-    }
-}
diff --git a/dalvik/src/main/java/dalvik/system/TouchDexLoader.java b/dalvik/src/main/java/dalvik/system/TouchDexLoader.java
deleted file mode 100644
index e5f9743..0000000
--- a/dalvik/src/main/java/dalvik/system/TouchDexLoader.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package dalvik.system;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.RandomAccessFile;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import libcore.io.IoUtils;
-
-/**
- * Cloned out of PathClassLoader for TouchDex.  This could be made
- * substantially smaller, since we don't need most of this.
- */
-class TouchDexLoader extends ClassLoader {
-
-    private String path;
-
-    /*
-     * Parallel arrays for jar/apk files.
-     *
-     * (could stuff these into an object and have a single array;
-     * improves clarity but adds overhead)
-     */
-    private final String[] mPaths;
-    private final File[] mFiles;
-    private final ZipFile[] mZips;
-    private final DexFile[] mDexs;
-
-    /**
-     * Native library path.
-     */
-    private final String[] mLibPaths;
-
-    /**
-     * Create a ClassLoader that finds files in the specified path.
-     */
-    public TouchDexLoader(String path, ClassLoader parent) {
-        super(parent);
-
-        if (path == null)
-            throw new NullPointerException();
-
-        this.path = path;
-
-        mPaths = path.split(":");
-        //System.out.println("TouchDexLoader: " + mPaths);
-        mFiles = new File[mPaths.length];
-        mZips = new ZipFile[mPaths.length];
-        mDexs = new DexFile[mPaths.length];
-
-        boolean wantDex =
-            System.getProperty("android.vm.dexfile", "").equals("true");
-
-        /* open all Zip and DEX files up front */
-        for (int i = 0; i < mPaths.length; i++) {
-            //System.out.println("My path is: " + mPaths[i]);
-            File pathFile = new File(mPaths[i]);
-            mFiles[i] = pathFile;
-
-            if (pathFile.isFile()) {
-                if (false) {    //--------------------
-                try {
-                    mZips[i] = new ZipFile(pathFile);
-                }
-                catch (IOException ioex) {
-                    // expecting IOException and ZipException
-                    //System.out.println("Failed opening '" + archive + "': " + ioex);
-                    //ioex.printStackTrace();
-                }
-                }               //--------------------
-                if (wantDex) {
-                    /* we need both DEX and Zip, because dex has no resources */
-                    try {
-                        mDexs[i] = new DexFile(pathFile);
-                    }
-                    catch (IOException ioex) {
-                        System.err.println("Couldn't open " + mPaths[i]
-                            + " as DEX");
-                    }
-                }
-            } else {
-                System.err.println("File not found: " + mPaths[i]);
-            }
-        }
-
-        /*
-         * Prep for native library loading.
-         */
-        String pathList = System.getProperty("java.library.path", ".");
-        String pathSep = System.getProperty("path.separator", ":");
-        String fileSep = System.getProperty("file.separator", "/");
-
-        mLibPaths = pathList.split(pathSep);
-
-        // Add a '/' to the end so we don't have to do the property lookup
-        // and concatenation later.
-        for (int i = 0; i < mLibPaths.length; i++) {
-            if (!mLibPaths[i].endsWith(fileSep))
-                mLibPaths[i] += fileSep;
-            if (false)
-                System.out.println("Native lib path:  " + mLibPaths[i]);
-        }
-    }
-
-    /**
-     * Find the class with the specified name.  None of our ancestors were
-     * able to find it, so it's up to us now.
-     *
-     * "name" is a "binary name", e.g. "java.lang.String" or
-     * "java.net.URLClassLoader$3$1".
-     *
-     * This method will either return a valid Class object or throw an
-     * exception.  Does not return null.
-     */
-    protected Class<?> findClass(String name) throws ClassNotFoundException
-    {
-        byte[] data = null;
-        int i;
-
-        //System.out.println("TouchDexLoader " + this + ": findClass '" + name + "'");
-
-        for (i = 0; i < mPaths.length; i++) {
-            //System.out.println("My path is: " + mPaths[i]);
-
-            if (mDexs[i] != null) {
-                String slashName = name.replace('.', '/');
-                Class clazz = mDexs[i].loadClass(slashName, this);
-                if (clazz != null)
-                    return clazz;
-            } else if (mZips[i] != null) {
-                String fileName = name.replace('.', '/') + ".class";
-                data = loadFromArchive(mZips[i], fileName);
-            } else {
-                File pathFile = mFiles[i];
-                if (pathFile.isDirectory()) {
-                    String fileName =
-                        mPaths[i] + "/" + name.replace('.', '/') + ".class";
-                    data = loadFromDirectory(fileName);
-                } else {
-                    //System.out.println("TouchDexLoader: can't find '"
-                    //    + mPaths[i] + "'");
-                }
-
-            }
-
-            if (data != null) {
-                //System.out.println("  found class " + name);
-                int dotIndex = name.lastIndexOf('.');
-                if (dotIndex != -1) {
-                    String packageName = name.substring(0, dotIndex);
-                    synchronized (this) {
-                        Package packageObj = getPackage(packageName);
-                        if (packageObj == null) {
-                            definePackage(packageName, null, null,
-                                    null, null, null, null, null);
-                        }
-                    }
-                }
-
-                return defineClass(name, data, 0, data.length);
-            }
-        }
-
-        throw new ClassNotFoundException(name + " in loader " + this);
-    }
-
-    /*
-     * Find a resource by name.  This could be in a directory or in an
-     * archive.
-     */
-    protected URL findResource(String name) {
-        byte[] data = null;
-        int i;
-
-        //System.out.println("TouchDexLoader: findResource '" + name + "'");
-
-        for (i = 0; i < mPaths.length; i++) {
-            File pathFile = mFiles[i];
-            ZipFile zip = mZips[i];
-            if (zip != null) {
-                if (isInArchive(zip, name)) {
-                    //System.out.println("  found " + name + " in " + pathFile);
-                    // Create URL correctly - was XXX, new code should be ok.
-                    try {
-                        return new URL("jar:file://" + pathFile + "!/" + name);
-                    }
-                    catch (MalformedURLException e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            } else if (pathFile.isDirectory()) {
-                File dataFile = new File(mPaths[i] + "/" + name);
-                if (dataFile.exists()) {
-                    //System.out.println("  found resource " + name);
-                    // Create URL correctly - was XXX, new code should be ok.
-                    try {
-                        return new URL("file:" + name);
-                    }
-                    catch (MalformedURLException e) {
-                        throw new RuntimeException(e);
-                    }
-                }
-            } else if (pathFile.isFile()) {
-            } else {
-                System.err.println("TouchDexLoader: can't find '"
-                    + mPaths[i] + "'");
-            }
-        }
-
-        return null;
-    }
-
-
-    /*
-     * Load the contents of a file from a file in a directory.
-     *
-     * Returns null if the class wasn't found.
-     */
-    private byte[] loadFromDirectory(String path) {
-        try {
-            return IoUtils.readFileAsByteArray(path);
-        } catch (IOException ex) {
-            System.err.println("Error reading from " + path);
-            // swallow it, return null instead
-            return null;
-        }
-    }
-
-    /*
-     * Load a class from a file in an archive.  We currently assume that
-     * the file is a Zip archive.
-     *
-     * Returns null if the class wasn't found.
-     */
-    private byte[] loadFromArchive(ZipFile zip, String name) {
-        ZipEntry entry;
-
-        entry = zip.getEntry(name);
-        if (entry == null)
-            return null;
-
-        ByteArrayOutputStream byteStream;
-        InputStream stream;
-        int count;
-
-        /*
-         * Copy the data out of the stream.  Because we got the ZipEntry
-         * from a ZipFile, the uncompressed size is known, and we can set
-         * the initial size of the ByteArrayOutputStream appropriately.
-         */
-        try {
-            stream = zip.getInputStream(entry);
-            byteStream = new ByteArrayOutputStream((int) entry.getSize());
-            byte[] buf = new byte[4096];
-            while ((count = stream.read(buf)) > 0)
-                byteStream.write(buf, 0, count);
-
-            stream.close();
-        }
-        catch (IOException ioex) {
-            //System.out.println("Failed extracting '" + archive + "': " +ioex);
-            return null;
-        }
-
-        //System.out.println("  loaded from Zip");
-        return byteStream.toByteArray();
-    }
-
-    /*
-     * Figure out if "name" is a member of "archive".
-     */
-    private boolean isInArchive(ZipFile zip, String name) {
-        return zip.getEntry(name) != null;
-    }
-
-    /**
-     * Find a native library.
-     *
-     * Return the full pathname of the first appropriate-looking file
-     * we find.
-     */
-    protected String findLibrary(String libname) {
-        String fileName = System.mapLibraryName(libname);
-        for (int i = 0; i < mLibPaths.length; i++) {
-            String pathName = mLibPaths[i] + fileName;
-            File test = new File(pathName);
-
-            if (test.exists())
-                return pathName;
-        }
-
-        return null;
-    }
-}
diff --git a/dalvik/src/main/java/dalvik/system/VMRuntime.java b/dalvik/src/main/java/dalvik/system/VMRuntime.java
index 373dd03..3e35ecf 100644
--- a/dalvik/src/main/java/dalvik/system/VMRuntime.java
+++ b/dalvik/src/main/java/dalvik/system/VMRuntime.java
@@ -47,6 +47,27 @@
     }
 
     /**
+     * Returns a copy of the VM's command-line property settings.
+     * These are in the form "name=value" rather than "-Dname=value".
+     */
+    public native String[] properties();
+
+    /**
+     * Returns the VM's boot class path.
+     */
+    public native String bootClassPath();
+
+    /**
+     * Returns the VM's class path.
+     */
+    public native String classPath();
+
+    /**
+     * Returns the VM's version.
+     */
+    public native String vmVersion();
+
+    /**
      * Gets the current ideal heap utilization, represented as a number
      * between zero and one.  After a GC happens, the Dalvik heap may
      * be resized so that (size of live objects) / (size of heap) is
@@ -104,17 +125,20 @@
     }
 
     /**
-     * Requests that the virtual machine collect available memory,
-     * and collects any SoftReferences that are not strongly-reachable.
+     * This method exists for binary compatibility.  It used to
+     * perform a garbage collection that cleared SoftReferences.
      */
-    public native void gcSoftReferences();
+    @Deprecated
+    public void gcSoftReferences() {}
 
     /**
-     * Does not return until any pending finalizers have been called.
-     * This may or may not happen in the context of the calling thread.
-     * No exceptions will escape.
+     * This method exists for binary compatibility.  It is equivalent
+     * to {@link System#runFinalization}.
      */
-    public native void runFinalizationSync();
+    @Deprecated
+    public void runFinalizationSync() {
+        System.runFinalization();
+    }
 
     /**
      * Implements setTargetHeapUtilization().
diff --git a/dalvik/src/main/java/dalvik/system/VMStack.java b/dalvik/src/main/java/dalvik/system/VMStack.java
index 16a04e6..a8430d8 100644
--- a/dalvik/src/main/java/dalvik/system/VMStack.java
+++ b/dalvik/src/main/java/dalvik/system/VMStack.java
@@ -49,9 +49,7 @@
     /**
      * Creates an array of classes from the methods at the top of the stack.
      * We continue until we reach the bottom of the stack or exceed the
-     * specified maximum depth.  If stopAtPrivileged is set, the last
-     * element of the array will be the caller of the most-recent privileged
-     * method.
+     * specified maximum depth.
      * <p>
      * The topmost stack frame (this method) and the one above that (the
      * caller) are excluded from the array.  Frames with java.lang.reflect
@@ -59,16 +57,14 @@
      * <p>
      * The classes in the array are the defining classes of the methods.
      * <p>
-     * This is expected to be identical to Harmony's VMStack.getClasses.
+     * This is similar to Harmony's VMStack.getClasses, except that this
+     * implementation doesn't have a concept of "privileged" frames.
      *
      * @param maxDepth
      *      maximum number of classes to return, or -1 for all
-     * @param stopAtPrivileged
-     *      stop when a privileged frame is reached
      * @return an array with classes for the most-recent methods on the stack
      */
-    native public static Class<?>[] getClasses(int maxDepth,
-        boolean stopAtPrivileged);
+    native public static Class<?>[] getClasses(int maxDepth);
 
     /**
      * Retrieves the stack trace from the specified thread.
diff --git a/dalvik/src/main/java/dalvik/system/Zygote.java b/dalvik/src/main/java/dalvik/system/Zygote.java
index 96928c8..1cdc52c 100644
--- a/dalvik/src/main/java/dalvik/system/Zygote.java
+++ b/dalvik/src/main/java/dalvik/system/Zygote.java
@@ -16,6 +16,9 @@
 
 package dalvik.system;
 
+import java.lang.FinalizerThread;
+import java.lang.ref.ReferenceQueueThread;
+
 /**
  * Provides access to the Dalvik "zygote" feature, which allows a VM instance to
  * be partially initialized and then fork()'d from the partially initialized
@@ -45,6 +48,16 @@
 
     private Zygote() {}
 
+    private static void preFork() {
+        ReferenceQueueThread.stopReferenceQueue();
+        FinalizerThread.stopFinalizer();
+    }
+
+    private static void postFork() {
+        ReferenceQueueThread.startReferenceQueue();
+        FinalizerThread.startFinalizer();
+    }
+
     /**
      * Forks a new Zygote instance, but does not leave the zygote mode.
      * The current VM must have been started with the -Xzygote flag. The
@@ -53,7 +66,14 @@
      * @return 0 if this is the child, pid of the child
      * if this is the parent, or -1 on error
      */
-    native public static int fork();
+    public static int fork() {
+        preFork();
+        int pid = nativeFork();
+        postFork();
+        return pid;
+    }
+
+    native public static int nativeFork();
 
     /**
      * Forks a new VM instance.  The current VM must have been started
@@ -75,8 +95,16 @@
      * @return 0 if this is the child, pid of the child
      * if this is the parent, or -1 on error.
      */
-    native public static int forkAndSpecialize(int uid, int gid, int[] gids,
-            int debugFlags, int[][] rlimits);
+    public static int forkAndSpecialize(int uid, int gid, int[] gids,
+            int debugFlags, int[][] rlimits) {
+        preFork();
+        int pid = nativeForkAndSpecialize(uid, gid, gids, debugFlags, rlimits);
+        postFork();
+        return pid;
+    }
+
+    native public static int nativeForkAndSpecialize(int uid, int gid,
+            int[] gids, int debugFlags, int[][] rlimits);
 
     /**
      * Forks a new VM instance.
@@ -112,9 +140,16 @@
      * @return 0 if this is the child, pid of the child
      * if this is the parent, or -1 on error.
      */
-    native public static int forkSystemServer(int uid, int gid,
-            int[] gids, int debugFlags, int[][] rlimits,
-            long permittedCapabilities, long effectiveCapabilities);
+    public static int forkSystemServer(int uid, int gid, int[] gids,
+            int debugFlags, int[][] rlimits,
+            long permittedCapabilities, long effectiveCapabilities) {
+        preFork();
+        int pid = nativeForkSystemServer(uid, gid, gids, debugFlags, rlimits,
+                                         permittedCapabilities,
+                                         effectiveCapabilities);
+        postFork();
+        return pid;
+    }
 
     /**
      * Special method to start the system server process.
@@ -126,4 +161,8 @@
         int debugFlags = enableDebugger ? DEBUG_ENABLE_DEBUGGER : 0;
         return forkAndSpecialize(uid, gid, gids, debugFlags, rlimits);
     }
+
+    native public static int nativeForkSystemServer(int uid, int gid,
+            int[] gids, int debugFlags, int[][] rlimits,
+            long permittedCapabilities, long effectiveCapabilities);
 }
diff --git a/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/ChunkHandler.java b/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/ChunkHandler.java
index 5ca3b2a..5d0073b 100644
--- a/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/ChunkHandler.java
+++ b/dalvik/src/main/java/org/apache/harmony/dalvik/ddmc/ChunkHandler.java
@@ -108,19 +108,15 @@
     /**
      * Convert a 4-character string to a 32-bit type.
      */
-    public static int type(String typeName)
-    {
-        int val = 0;
-
-        if (typeName.length() != 4)
-            throw new RuntimeException();
-
-        for (int i = 0; i < 4; i++) {
-            val <<= 8;
-            val |= (byte) typeName.charAt(i);
+    public static int type(String typeName) {
+        if (typeName.length() != 4) {
+            throw new IllegalArgumentException("Bad type name: " + typeName);
         }
-
-        return val;
+        int result = 0;
+        for (int i = 0; i < 4; ++i) {
+            result = ((result << 8) | (typeName.charAt(i) & 0xff));
+        }
+        return result;
     }
 
     /**
@@ -139,4 +135,3 @@
     }
 
 }
-
diff --git a/dalvik/src/main/native/dalvik_system_TouchDex.cpp b/dalvik/src/main/native/dalvik_system_TouchDex.cpp
deleted file mode 100644
index 719ac3c..0000000
--- a/dalvik/src/main/native/dalvik_system_TouchDex.cpp
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * Bit of code to wrap DEX force-updating with a fork() call.
- */
-
-#define LOG_TAG "TouchDex"
-#include "JNIHelp.h"
-
-#include "cutils/properties.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <sys/time.h>
-#include <assert.h>
-#include <errno.h>
-
-#define JAVA_PACKAGE "dalvik/system"
-
-#ifndef HAVE_ANDROID_OS
-# define BASE_DIR "/work/device/out/linux-x86-debug-sim"
-#else
-# define BASE_DIR ""
-#endif
-
-namespace android {
-
-// fwd
-static void logProcStatus(pid_t pid);
-
-
-/*
- * private static int trampoline(String dexFiles, String bcp)
- */
-static jint dalvik_system_TouchDex_trampoline(JNIEnv* env,
-    jclass, jstring dexFilesStr, jstring bcpStr)
-{
-#ifndef HAVE_ANDROID_OS
-    /* don't do this on simulator -- gdb goes "funny" in goobuntu */
-    return 0;
-#endif
-
-    const int kMinTimeout = 900;        // 90 seconds
-    const char* bcp;
-    const char* dexFiles;
-    static const char* kExecFile = BASE_DIR "/system/bin/dalvikvm";
-    //static const char* kDebugArg =
-    //        "-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n";
-    static const char* kBcpArgName = "-Xbootclasspath:";
-    static const char* kClassName = "dalvik.system.TouchDex";
-    static const char* kExecMode = "-Xint";
-    static const int argc = 7;
-    const char* argv[argc+1];
-    const char* kVerifyArg;
-    const char* kDexOptArg;
-    int timeoutMult;
-    pid_t pid;
-    struct timeval startWhen, endWhen;
-    char propBuf[PROPERTY_VALUE_MAX];
-    char execModeBuf[PROPERTY_VALUE_MAX + sizeof("-X")];
-    bool verifyJava = true;
-
-    property_get("dalvik.vm.verify-bytecode", propBuf, "");
-    if (strcmp(propBuf, "true") == 0) {
-        verifyJava = true;
-    } else if (strcmp(propBuf, "false") == 0) {
-        verifyJava = false;
-    } else {
-        /* bad value or not defined; use default */
-    }
-
-    if (verifyJava) {
-        kVerifyArg = "-Xverify:all";
-        kDexOptArg = "-Xdexopt:verified";
-        timeoutMult = 11;
-    } else {
-        kVerifyArg = "-Xverify:none";
-        //kDexOptArg = "-Xdexopt:all";
-        kDexOptArg = "-Xdexopt:verified";
-        timeoutMult = 7;
-    }
-
-    property_get("dalvik.vm.execution-mode", propBuf, "");
-    if (strncmp(propBuf, "int:", 4) == 0) {
-        strcpy(execModeBuf, "-X");
-        strcat(execModeBuf, propBuf);
-        kExecMode = execModeBuf;
-    }
-
-    LOGV("TouchDex trampoline forking\n");
-    gettimeofday(&startWhen, NULL);
-
-    /*
-     * Retrieve strings.  Note we want to do this *before* the fork() -- bad
-     * idea to perform Java operations in the child process (not all threads
-     * get carried over to the new process).
-     */
-    bcp = env->GetStringUTFChars(bcpStr, NULL);
-    dexFiles = env->GetStringUTFChars(dexFilesStr, NULL);
-    if (bcp == NULL || dexFiles == NULL) {
-        LOGE("Bad values for bcp=%p dexFiles=%p\n", bcp, dexFiles);
-        abort();
-    }
-
-    pid = fork();
-    if (pid < 0) {
-        LOGE("fork failed: %s", strerror(errno));
-        return -1;
-    }
-
-    if (pid == 0) {
-        /* child */
-        char* bcpArg;
-
-        LOGV("TouchDex trampoline in child\n");
-
-        bcpArg = (char*) malloc(strlen(bcp) + strlen(kBcpArgName) +1);
-        strcpy(bcpArg, kBcpArgName);
-        strcat(bcpArg, bcp);
-
-        argv[0] = kExecFile;
-        argv[1] = bcpArg;
-        argv[2] = kVerifyArg;
-        argv[3] = kDexOptArg;
-        argv[4] = kExecMode;
-        argv[5] = kClassName;
-        argv[6] = dexFiles;
-        argv[7] = NULL;
-
-        //LOGI("Calling execv with args:\n");
-        //for (int i = 0; i < argc; i++)
-        //    LOGI(" %d: '%s'\n", i, argv[i]);
-
-        execv(kExecFile, (char* const*) argv);
-        free(bcpArg);
-
-        LOGE("execv '%s' failed: %s\n", kExecFile, strerror(errno));
-        exit(1);
-    } else {
-        int cc, count, dexCount, timeout;
-        int result = -1;
-        const char* cp;
-
-        /*
-         * Adjust the timeout based on how many DEX files we have to
-         * process.  Larger DEX files take longer, so this is a crude
-         * approximation at best.
-         *
-         * We need this for http://b/issue?id=836771, which can leave us
-         * stuck waiting for a long time even if there is no work to be done.
-         *
-         * This is currently being (ab)used to convert single files, which
-         * sort of spoils the timeout calculation.  We establish a minimum
-         * timeout for single apps.
-         *
-         * The timeout calculation doesn't work at all right when a
-         * directory is specified.  So the minimum is now a minute.  At
-         * this point it's probably safe to just remove the timeout.
-         *
-         * The timeout is in 1/10ths of a second.
-         */
-        dexCount = 1;
-        cp = dexFiles;
-        while (*++cp != '\0') {
-            if (*cp == ':')
-                dexCount++;
-        }
-        timeout = timeoutMult * dexCount;
-        if (timeout < kMinTimeout)
-            timeout = kMinTimeout;
-
-        env->ReleaseStringUTFChars(bcpStr, bcp);
-        env->ReleaseStringUTFChars(dexFilesStr, dexFiles);
-
-
-        LOGD("TouchDex parent waiting for pid=%d (timeout=%.1fs)\n",
-            (int) pid, timeout / 10.0);
-        for (count = 0; count < timeout; count++) {
-            /* waitpid doesn't take a timeout, so poll and sleep */
-            cc = waitpid(pid, &result, WNOHANG);
-            if (cc < 0) {
-                LOGE("waitpid(%d) failed: %s", (int) pid, strerror(errno));
-                return -1;
-            } else if (cc == 0) {
-                usleep(100000);     /* 0.1 sec */
-            } else {
-                /* success! */
-                break;
-            }
-        }
-
-        if (count == timeout) {
-            /* note kill(0) returns 0 if the pid is a zombie */
-            LOGE("timed out waiting for %d; kill(0) returns %d\n",
-                (int) pid, kill(pid, 0));
-            logProcStatus(pid);
-        } else {
-            LOGV("TouchDex done after %d iterations (kill(0) returns %d)\n",
-                count, kill(pid, 0));
-        }
-
-        gettimeofday(&endWhen, NULL);
-        long long start = startWhen.tv_sec * 1000000 + startWhen.tv_usec;
-        long long end = endWhen.tv_sec * 1000000 + endWhen.tv_usec;
-
-        LOGI("Dalvik-cache prep: status=0x%04x, finished in %dms\n",
-            result, (int) ((end - start) / 1000));
-
-        if (WIFEXITED(result))
-            return WEXITSTATUS(result);
-        else
-            return result;
-    }
-}
-
-/*
- * Dump the contents of /proc/<pid>/status to the log file.
- */
-static void logProcStatus(pid_t pid)
-{
-    char localBuf[256];
-    FILE* fp;
-
-    sprintf(localBuf, "/proc/%d/status", (int) pid);
-    fp = fopen(localBuf, "r");
-    if (fp == NULL) {
-        LOGI("Unable to open '%s'\n", localBuf);
-        return;
-    }
-
-    LOGI("Contents of %s:\n", localBuf);
-    while (true) {
-        fgets(localBuf, sizeof(localBuf), fp);
-        if (ferror(fp) || feof(fp))
-            break;
-        LOGI("  %s", localBuf);
-    }
-
-    fclose(fp);
-}
-
-static JNINativeMethod gMethods[] = {
-    { "trampoline", "(Ljava/lang/String;Ljava/lang/String;)I",
-        (void*) dalvik_system_TouchDex_trampoline },
-};
-int register_dalvik_system_TouchDex(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, JAVA_PACKAGE "/TouchDex", gMethods, NELEM(gMethods));
-}
-
-}; // namespace android
diff --git a/dalvik/src/main/native/sub.mk b/dalvik/src/main/native/sub.mk
index 27d4c9c..4adc8a1 100644
--- a/dalvik/src/main/native/sub.mk
+++ b/dalvik/src/main/native/sub.mk
@@ -1,9 +1,9 @@
+# -*- mode: makefile -*-
 # This file is included by the top-level libcore Android.mk.
 # It's not a normal makefile, so we don't include CLEAR_VARS
 # or BUILD_*_LIBRARY.
 
 LOCAL_SRC_FILES := \
-	dalvik_system_TouchDex.cpp \
 	org_apache_harmony_dalvik_NativeTestTarget.cpp
 
 #LOCAL_C_INCLUDES +=
@@ -15,4 +15,3 @@
 #LOCAL_SHARED_LIBRARIES +=
 
 #LOCAL_STATIC_LIBRARIES +=
-
diff --git a/dom/src/test/java/tests/api/org/w3c/dom/AllTests.java b/dom/src/test/java/tests/api/org/w3c/dom/AllTests.java
deleted file mode 100644
index 7214d4f..0000000
--- a/dom/src/test/java/tests/api/org/w3c/dom/AllTests.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.org.w3c.dom;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- *
- */
-public class AllTests {
-    /*public static void run() {
-        TestRunner.main(new String[] {AllTests.class.getName()});
-    }*/
-
-    public static final Test suite() {
-        TestSuite suite = new TestSuite();
-        suite.addTest(AllTests_Level1.suite());
-        suite.addTest(AllTests_Level2.suite());
-        return suite;
-    }
-}
diff --git a/dom/src/test/java/tests/dom/AllTests.java b/dom/src/test/java/tests/dom/AllTests.java
deleted file mode 100644
index 48b362b..0000000
--- a/dom/src/test/java/tests/dom/AllTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.dom;
-
-import org.w3c.domts.JunitTestCases;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
-    public static Test suite() {
-        TestSuite suite = new TestSuite();
-        // BEGIN android-changed: this was only referenced from the xml module!
-        suite.addTest(tests.api.org.w3c.dom.AllTests.suite());
-        // END android-changed
-        suite.addTestSuite(JunitTestCases.class);
-        return suite;
-    }
-
-}
diff --git a/expectations/brokentests.txt b/expectations/brokentests.txt
index 213b519..8a9952c 100644
--- a/expectations/brokentests.txt
+++ b/expectations/brokentests.txt
@@ -3,6 +3,30 @@
  */
 [
 {
+  description: "Without no security manager, we don't care if checkPermission's argument is null",
+  name: "org.apache.harmony.security.tests.java.security.AccessController2Test#test_checkPermission_NullParameter",
+  result: EXEC_FAILED
+},
+{
+  description: "This test and testGetKeepAlive have been failing in our continuous build recently.",
+  names: [
+    "libcore.java.net.URLConnectionTest#testConnectTimeouts",
+    "libcore.java.net.URLConnectionTest#testGetKeepAlive"
+  ],
+  bug: 3441111
+},
+{
+  description: "on the RI, writing the two halves of the surrogate pair in separate writes
+          is an error because the CharsetEncoder doesn't remember it's half-way through a
+          surrogate pair across the two calls!",
+  result: EXEC_FAILED,
+  names: [
+    "libcore.java.nio.charset.CharsetEncoderTest#testCharsetEncoderSurrogatesBrokenByDesign_IGNORE_RI",
+    "libcore.java.nio.charset.CharsetEncoderTest#testCharsetEncoderSurrogatesBrokenByDesign_REPLACE_RI",
+    "libcore.java.nio.charset.CharsetEncoderTest#testCharsetEncoderSurrogatesBrokenByDesign_REPORT_RI"
+  ]
+},
+{
   description: "We're retiring the security manager. Unfortunately, tests all over the place
                 need to check that they're secure, so they all fail when we refuse to install
                 a security manager. This suppresses all of these failures.",
diff --git a/expectations/icebox.txt b/expectations/icebox.txt
index 4619725..4d664a6 100644
--- a/expectations/icebox.txt
+++ b/expectations/icebox.txt
@@ -5,61 +5,61 @@
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DomTest#testEntityDeclarations",
+  name: "libcore.xml.DomTest#testEntityDeclarations",
   substring: "This implementation does not parse entity declarations"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DomTest#testGetWholeTextWithEntityReference",
+  name: "libcore.xml.DomTest#testGetWholeTextWithEntityReference",
   substring: "This implementation doesn't resolve entity references in getWholeText"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
-  name: "tests.xml.DomTest#testExpandingEntityReferencesOff",
+  name: "libcore.xml.DomTest#testExpandingEntityReferencesOff",
   bug: 3268630,
   substring: "This implementation doesn't include children in entity references"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
-  name: "tests.xml.DomTest#testExpandingEntityReferencesOn",
+  name: "libcore.xml.DomTest#testExpandingEntityReferencesOn",
   bug: 3268630,
   substring: "This implementation doesn't expand entity references"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DomTest#testIsElementContentWhitespaceWithDeclaration",
+  name: "libcore.xml.DomTest#testIsElementContentWhitespaceWithDeclaration",
   substring: "This implementation does not recognize element content whitespace"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DomTest#testNotations",
+  name: "libcore.xml.DomTest#testNotations",
   substring: "This implementation does not parse notations"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DeclarationTest#testGetXmlEncoding",
+  name: "libcore.xml.DeclarationTest#testGetXmlEncoding",
   substring: "This implementation doesn't parse the encoding from the XML declaration expected:<ISO-8859-1> but was:<null>"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DeclarationTest#testGetXmlStandalone",
+  name: "libcore.xml.DeclarationTest#testGetXmlStandalone",
   substring: "This implementation doesn't parse standalone from the XML declaration expected:<true> but was:<false>"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DeclarationTest#testGetXmlVersion",
+  name: "libcore.xml.DeclarationTest#testGetXmlVersion",
   substring: "This implementation doesn't parse the version from the XML declaration"
 },
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.NormalizeTest#testSchemaTypeDtd",
+  name: "libcore.xml.NormalizeTest#testSchemaTypeDtd",
   substring: "This implementation's setParameter() supports an unexpected value: schema-type=http://www.w3.org/TR/REC-xml"
 },
 {
@@ -71,7 +71,7 @@
 {
   description: "Dalvik doesn't support XML Schemas, DTDs or validation",
   bug: 3268630,
-  name: "tests.xml.DeclarationTest.testGetXmlVersion",
+  name: "libcore.xml.DeclarationTest.testGetXmlVersion",
   substring: "This implementation doesn't parse the version from the XML declaration"
 },
 {
@@ -108,31 +108,31 @@
 {
   description: "low-impact XML bugs:",
   result: EXEC_FAILED,
-  name: "tests.xml.DomTest#testAttributeNamedIdIsNotAnIdByDefault",
+  name: "libcore.xml.DomTest#testAttributeNamedIdIsNotAnIdByDefault",
   substring: "This implementation incorrectly interprets the \"id\" attribute as an identifier by default"
 },
 {
   description: "low-impact XML bugs:",
   result: EXEC_FAILED,
-  name: "tests.xml.DomTest#testDocumentAddChild",
+  name: "libcore.xml.DomTest#testDocumentAddChild",
   substring: "Document nodes shouldn't accept child nodes"
 },
 {
   description: "low-impact XML bugs:",
   result: EXEC_FAILED,
-  name: "tests.xml.DomTest#testElementTraversalFeature",
+  name: "libcore.xml.DomTest#testElementTraversalFeature",
   substring: "This implementation is expected to support ElementTraversal v. 1.0 but does not."
 },
 {
   description: "low-impact XML bugs:",
   result: EXEC_FAILED,
-  name: "tests.xml.DomTest#testLoadSaveFeature",
+  name: "libcore.xml.DomTest#testLoadSaveFeature",
   substring: "This implementation is expected to support LS v. 3.0 but does not."
 },
 {
   description: "low-impact XML bugs:",
   result: EXEC_FAILED,
-  name: "tests.xml.SaxTest#testYesPrefixesYesNamespaces",
+  name: "libcore.xml.SaxTest#testYesPrefixesYesNamespaces",
   substring: "The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled."
 },
 {
diff --git a/expectations/knownfailures.txt b/expectations/knownfailures.txt
index 625a19f..3d2eb5f 100644
--- a/expectations/knownfailures.txt
+++ b/expectations/knownfailures.txt
@@ -3,6 +3,55 @@
  */
 [
 {
+  description: "Encoded bytes don't match for EC elliptic curve keys created through KeyFactory.generatePrivate()",
+  names: [
+    "org.apache.harmony.security.tests.java.security.KeyFactory2Test#test_generatePrivateLjava_security_spec_KeySpec",
+    "org.apache.harmony.security.tests.java.security.KeyFactory2Test#test_getKeySpecLjava_security_KeyLjava_lang_Class"
+  ],
+  bug: 3483365
+},
+{
+  description: "Test fails, Intermediate certificate lacks BasicConstraints",
+  name: "com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpiTest#testTrustAndRemoteCertificatesWithDifferentEncodings",
+  bug: 3474648
+},
+{
+  description: "DHParametersHelper.generateSafePrimes sometimes takes long time, other times takes a very long time",
+  name: "org.apache.harmony.crypto.tests.javax.crypto.interfaces.DHPrivateKeyTest#test_getParams",
+  bug: 3474446
+},
+{
+  description: "KeyAgreementFunctionalTest times out even with an absurdly long timeout",
+  name: "org.apache.harmony.crypto.tests.javax.crypto.func.KeyAgreementFunctionalTest#test_KeyAgreement",
+  bug: 3473300
+},
+{
+  description: "CipherTest.test_doFinal() is flaky",
+  name: "org.apache.harmony.crypto.tests.javax.crypto.CipherTest#test_doFinal",
+  bug: 3469872
+},
+{
+  name: "libcore.java.lang.StringTest#testCaseMapping_en_US",
+  bug: 3387655
+},
+{
+  name: "org.apache.harmony.crypto.tests.javax.crypto.CipherTest#testGetMaxAllowedKeyLength",
+  bug: 3387688
+},
+{
+  name: "libcore.java.io.FileTest#test_emptyFilename",
+  bug: 3387758
+},
+{
+  description: "Turkish dotless i behaves differently on dalvik vs. RI",
+  names: [
+    "libcore.java.lang.StringTest#testChangeCase_en_US",
+    "libcore.java.lang.StringTest#testEqualsIgnoreCase_en_US",
+    "libcore.java.lang.StringTest#testEqualsIgnoreCase_tr_TR"
+  ],
+  bug: 3325799
+},
+{
   description: "KxmlPullParser doesn't enforce top-level document element",
   names: [
     "libcore.xml.KxmlPullParserDtdTest#testDoctypeInDocumentElement",
@@ -125,7 +174,7 @@
 {
   description: "finalize() called on objects whose constructor didn't complete normally",
   name: "libcore.java.lang.SystemTest#testBackFromTheDead",
-  bug: 2645458
+  bug: 3342343
 },
 {
   description: "DecimalFormat is limited to 127 digits",
@@ -174,7 +223,10 @@
 },
 {
   description: "Double.parseDouble().toString does wrong rounding",
-  name: "libcore.java.lang.OldDoubleTest#test_parseDoubleLjava_lang_String",
+  names: [
+    "libcore.java.lang.OldDoubleTest#test_parseDoubleLjava_lang_String",
+    "libcore.java.lang.DoubleTest#testParseLargestSubnormalDoublePrecision"
+  ],
   bug: 1607938
 },
 {
@@ -232,10 +284,6 @@
   modes: [ "host" ]
 },
 {
-  name: "libcore.java.net.URLConnectionTest#testConnectTimeouts",
-  bug: 3032900
-},
-{
   description: "Fails in CTS but passes under run-core-tests",
   result: EXEC_FAILED,
   name: "libcore.java.io.OldFileTest#test_deleteOnExit"
@@ -259,12 +307,16 @@
   description: "Fails in CTS but passes under run-core-tests",
   result: EXEC_FAILED,
   names: [
-    "libcore.java.lang.OldRuntimeTest#test_traceMethodCalls",
     "tests.api.java.net.MulticastSocketTest#test_joinGroupLjava_net_SocketAddressLjava_net_NetworkInterface",
     "tests.api.java.util.FormatterTest#test_formatLjava_lang_String$Ljava_lang_Object_DateTimeConversion"
   ]
 },
 {
+  description: "Runtime.getRuntime().traceMethodCalls(true) doesn't return on the host, fails in CTS",
+  bug: 3447964,
+  name: "libcore.java.lang.OldRuntimeTest#test_traceMethodCalls"
+},
+{
   description: "It's not allowed to pass null as parent class loader to a new ClassLoader anymore. Maybe we need
                 to change URLClassLoader to allow this? It's not specified.",
   result: EXEC_FAILED,
@@ -512,7 +564,7 @@
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
     "tests.java.sql.DatabaseMetaDataNotSupportedTest#test_locatorsUpdateCopy",
     "tests.java.sql.DatabaseMetaDataNotSupportedTest#test_supportsANSI92EntryLevelSQL",
@@ -523,445 +575,445 @@
     "tests.java.sql.DatabaseMetaDataNotSupportedTest#test_supportsSubqueriesInIns",
     "tests.java.sql.DatabaseMetaDataNotSupportedTest#test_supportsTransactions",
     "tests.java.sql.DatabaseMetaDataNotSupportedTest#test_usesLocalFiles",
-    "tests.sql.ConnectionTest#testClearWarnings",
-    "tests.sql.ConnectionTest#testCreateStatementIntIntIntNotSupported"
+    "libcore.java.sql.OldConnectionTest#testClearWarnings",
+    "libcore.java.sql.OldConnectionTest#testCreateStatementIntIntIntNotSupported"
   ]
 },
 {
   description: "Scrolling on a forward only RS not allowed. conn.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ConnectionTest#testCreateStatement_int_int"
+  bug: 3403706,
+  name: "libcore.java.sql.OldConnectionTest#testCreateStatement_int_int"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ConnectionTest#testGetCatalog",
-    "tests.sql.ConnectionTest#testGetHoldability"
+    "libcore.java.sql.OldConnectionTest#testGetCatalog",
+    "libcore.java.sql.OldConnectionTest#testGetHoldability"
   ]
 },
 {
   description: "conn.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ConnectionTest#testGetMetaData"
+  bug: 3403706,
+  name: "libcore.java.sql.OldConnectionTest#testGetMetaData"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ConnectionTest#testGetTransactionIsolation",
-    "tests.sql.ConnectionTest#testGetWarnings"
+    "libcore.java.sql.OldConnectionTest#testGetTransactionIsolation",
+    "libcore.java.sql.OldConnectionTest#testGetWarnings"
   ]
 },
 {
   description: "conn.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ConnectionTest#testIsReadOnly"
+  bug: 3403706,
+  name: "libcore.java.sql.OldConnectionTest#testIsReadOnly"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ConnectionTest#testPrepareStatementNotSupported",
-    "tests.sql.ConnectionTest#testPrepareStatement_String_int"
+    "libcore.java.sql.OldConnectionTest#testPrepareStatementNotSupported",
+    "libcore.java.sql.OldConnectionTest#testPrepareStatement_String_int"
   ]
 },
 {
   description: "conn.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ConnectionTest#testSetAutoCommit"
+  bug: 3403706,
+  name: "libcore.java.sql.OldConnectionTest#testSetAutoCommit"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ConnectionTest#testSetHoldability",
-    "tests.sql.ConnectionTest#testSetReadOnly"
+    "libcore.java.sql.OldConnectionTest#testSetHoldability",
+    "libcore.java.sql.OldConnectionTest#testSetReadOnly"
   ]
 },
 {
   description: "First Exception test fails: parameters not cleared.",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testClearParameters"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testClearParameters"
 },
 {
   description: "preparedStatement.execute() does not return false on update.",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testExecute"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testExecute"
 },
 {
   description: "it is not possible to invoke the method getMetaData on a PreparedStatement object before it is
                 executed: got NullPointerException.Test passes on RI.",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testGetMetaData"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testGetMetaData"
 },
 {
   description: "preparedStatement.execute() does not return false on update.",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testSetBigDecimal"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testSetBigDecimal"
 },
 {
   description: "exception test fails",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.PreparedStatementTest#testSetBoolean",
-    "tests.sql.PreparedStatementTest#testSetByte"
+    "libcore.java.sql.OldPreparedStatementTest#testSetBoolean",
+    "libcore.java.sql.OldPreparedStatementTest#testSetByte"
   ]
 },
 {
   description: "preparedStatement.execute() does not return false on update.",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testSetBytes"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testSetBytes"
 },
 {
   description: "preparedStatement.execute() does not return false on update. Setting a data for a declared
                 INTEGER should throw Exception",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testSetDate_int_Date"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testSetDate_int_Date"
 },
 {
   description: "preparedStatement.execute() does not return false on update.",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testSetDate_int_Date_Calendar"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testSetDate_int_Date_Calendar"
 },
 {
   description: "exception test fails",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.PreparedStatementTest#testSetDouble",
-    "tests.sql.PreparedStatementTest#testSetFloat",
-    "tests.sql.PreparedStatementTest#testSetInt",
-    "tests.sql.PreparedStatementTest#testSetLong",
-    "tests.sql.PreparedStatementTest#testSetObject_int_Object"
+    "libcore.java.sql.OldPreparedStatementTest#testSetDouble",
+    "libcore.java.sql.OldPreparedStatementTest#testSetFloat",
+    "libcore.java.sql.OldPreparedStatementTest#testSetInt",
+    "libcore.java.sql.OldPreparedStatementTest#testSetLong",
+    "libcore.java.sql.OldPreparedStatementTest#testSetObject_int_Object"
   ]
 },
 {
   description: "Fails for Types.DATE",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.PreparedStatementTest#testSetObject_int_Object_int",
-    "tests.sql.PreparedStatementTest#testSetObject_int_Object_int_int"
+    "libcore.java.sql.OldPreparedStatementTest#testSetObject_int_Object_int",
+    "libcore.java.sql.OldPreparedStatementTest#testSetObject_int_Object_int_int"
   ]
 },
 {
   description: "exception test fails",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.PreparedStatementTest#testSetShort",
-    "tests.sql.PreparedStatementTest#testSetString_charField",
-    "tests.sql.PreparedStatementTest#testSetString_longTextField"
+    "libcore.java.sql.OldPreparedStatementTest#testSetShort",
+    "libcore.java.sql.OldPreparedStatementTest#testSetString_charField",
+    "libcore.java.sql.OldPreparedStatementTest#testSetString_longTextField"
   ]
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testSetString_tinyTextField"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testSetString_tinyTextField"
 },
 {
   description: "preparedStatement.execute() does not return False on update.",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testSetTime_int_Time_Calendar"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testSetTime_int_Time_Calendar"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.PreparedStatementTest#testSetTimeint_Time"
+  bug: 3403706,
+  name: "libcore.java.sql.OldPreparedStatementTest#testSetTimeint_Time"
 },
 {
   description: "preparedStatement.execute() does not return false on update.",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.PreparedStatementTest#testSetTimestampIntTimestampCalendar",
-    "tests.sql.PreparedStatementTest#testSetTimestamp_int_Timestamp"
+    "libcore.java.sql.OldPreparedStatementTest#testSetTimestampIntTimestampCalendar",
+    "libcore.java.sql.OldPreparedStatementTest#testSetTimestamp_int_Timestamp"
   ]
 },
 {
   description: "last assertion fails: invalid conversion. Test passes on RI",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ResultSetGetterTests#testGetBytesStringBinary",
-    "tests.sql.ResultSetGetterTests#testGetBytesStringVarbinary"
+    "libcore.java.sql.OldResultSetGetterTests#testGetBytesStringBinary",
+    "libcore.java.sql.OldResultSetGetterTests#testGetBytesStringVarbinary"
   ]
 },
 {
   description: "Wrong value returned for Long: java.lang.String (VARCHAR)",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetMetaData"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetMetaData"
 },
 {
   description: "Wrong value returned for Long: java.lang.String",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ResultSetGetterTests#testGetObjectInt",
-    "tests.sql.ResultSetGetterTests#testGetObjectString"
+    "libcore.java.sql.OldResultSetGetterTests#testGetObjectInt",
+    "libcore.java.sql.OldResultSetGetterTests#testGetObjectString"
   ]
 },
 {
   description: "If there is no current row 0 must be returned. res.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetRow"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetRow"
 },
 {
   description: "According to spec info.getStatement should return null but an exception is thrown: stale result
                 set.",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetStatement"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetStatement"
 },
 {
   description: "getTime should return Time value for a TIMESTAMP type but returns null",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetTimeInt"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetTimeInt"
 },
 {
   description: "getTime on TIMESTAMP value fails: returns null",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetTimeIntCalendar"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetTimeIntCalendar"
 },
 {
   description: "getTime should return a Time value for a TIMESTAMP type but returns null",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetTimeString"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetTimeString"
 },
 {
   description: "getTime on TIMESTAMP value fails: returns null",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetTimeStringCalendar"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetTimeStringCalendar"
 },
 {
   description: "res.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetGetterTests#testGetType"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetGetterTests#testGetType"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetMetaDataTest#testGetCatalogName"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetMetaDataTest#testGetCatalogName"
 },
 {
   description: "SQLException checking test fails",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetMetaDataTest#testGetColumnCount"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetMetaDataTest#testGetColumnCount"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetMetaDataTest#testGetColumnDisplaySize"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetMetaDataTest#testGetColumnDisplaySize"
 },
 {
   description: "Column label has format TABLE.COLUMN expected: COLUMN",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ResultSetMetaDataTest#testGetColumnLabel",
-    "tests.sql.ResultSetMetaDataTest#testGetColumnName"
+    "libcore.java.sql.OldResultSetMetaDataTest#testGetColumnLabel",
+    "libcore.java.sql.OldResultSetMetaDataTest#testGetColumnName"
   ]
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetMetaDataTest#testGetPrecision"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetMetaDataTest#testGetPrecision"
 },
 {
   description: "Not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetMetaDataTest#testGetScale"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetMetaDataTest#testGetScale"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetMetaDataTest#testGetSchema"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetMetaDataTest#testGetSchema"
 },
 {
   description: "For int = 0, exception expected",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetMetaDataTest#testGetTableName"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetMetaDataTest#testGetTableName"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ResultSetMetaDataTest#testIsCaseSensitive",
-    "tests.sql.ResultSetMetaDataTest#testIsCurrency",
-    "tests.sql.ResultSetMetaDataTest#testIsDefinitlyWritable",
-    "tests.sql.ResultSetMetaDataTest#testIsNullable",
-    "tests.sql.ResultSetMetaDataTest#testIsReadOnly",
-    "tests.sql.ResultSetMetaDataTest#testIsSearchable",
-    "tests.sql.ResultSetMetaDataTest#testIsSigned",
-    "tests.sql.ResultSetMetaDataTest#testIsWritable",
-    "tests.sql.ResultSetMetaDataTest#testisAutoIncrement"
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsCaseSensitive",
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsCurrency",
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsDefinitlyWritable",
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsNullable",
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsReadOnly",
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsSearchable",
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsSigned",
+    "libcore.java.sql.OldResultSetMetaDataTest#testIsWritable",
+    "libcore.java.sql.OldResultSetMetaDataTest#testisAutoIncrement"
   ]
 },
 {
   description: "res.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testAfterLast"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testAfterLast"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testBeforeFirst"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testBeforeFirst"
 },
 {
   description: "Not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testClearWarnings"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testClearWarnings"
 },
 {
   description: "Resultset.close() does not wrap up",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ResultSetTest#testClose1",
-    "tests.sql.ResultSetTest#testNext"
+    "libcore.java.sql.OldResultSetTest#testClose1",
+    "libcore.java.sql.OldResultSetTest#testNext"
   ]
 },
 {
   description: "no exception is thrown when moving cursor backwards on forward only statement",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testRelative"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testRelative"
 },
 {
   description: "Scrollable resultSet. Not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testRelativeScrollableResultSet"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testRelativeScrollableResultSet"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testUpdateObjectStringObject"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testUpdateObjectStringObject"
 },
 {
   description: "Feature not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testUpdateStringStringString"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testUpdateStringStringString"
 },
 {
   description: "the default tests, and exception tests fail.",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testWasNull"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testWasNull"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.ResultSetTest#testtestFirst",
-    "tests.sql.ResultSetTest#testtestIsAfterLast"
+    "libcore.java.sql.OldResultSetTest#testtestFirst",
+    "libcore.java.sql.OldResultSetTest#testtestIsAfterLast"
   ]
 },
 {
   description: "In Second code block assertion fails. statement. close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testtestIsBeforeFirst"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testtestIsBeforeFirst"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testtestIsFirst"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testtestIsFirst"
 },
 {
   description: "Second block first assertion fails. Is Last should evaluate true if the row on which the cursor
                 is actually provides a result.statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testtestIsLast"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testtestIsLast"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.ResultSetTest#testtestLast"
+  bug: 3403706,
+  name: "libcore.java.sql.OldResultSetTest#testtestLast"
 },
 {
   description: "Bug in implementation of cancel: Does not fulfill spec.",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testCancel"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testCancel"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testClose"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testClose"
 },
 {
   description: "Return value wrong for queries below.",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testExecute"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testExecute"
 },
 {
   description: "always returns 1 for no. of updates",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testExecuteBatch"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testExecuteBatch"
 },
 {
   description: "Does throw an exception on non select statement.",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testExecuteQuery_String"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testExecuteQuery_String"
 },
 {
   description: "Spec is not precise enough: should be: number of rows affected. eg. to be consistent for deletes:
                 'delete from s1;' should be different from 'delete from s1 where c1 = 1;'",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testExecuteUpdate_String"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testExecuteUpdate_String"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
-    "tests.sql.StatementTest#testGetConnection",
-    "tests.sql.StatementTest#testGetFetchDirection",
-    "tests.sql.StatementTest#testGetFetchSize"
+    "libcore.java.sql.OldStatementTest#testGetConnection",
+    "libcore.java.sql.OldStatementTest#testGetFetchDirection",
+    "libcore.java.sql.OldStatementTest#testGetFetchSize"
   ]
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testGetMoreResults"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testGetMoreResults"
 },
 {
   description: "An other value is returned than was set (X * 1000)",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testGetQueryTimeout"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testGetQueryTimeout"
 },
 {
   description: "Does not return null on update count > 0 (not a select statement)",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testGetResultSet"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testGetResultSet"
 },
 {
   description: "Not supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testGetResultSetConcurrency"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testGetResultSetConcurrency"
 },
 {
   description: "Test for default value fails",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testGetResultSetHoldability"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testGetResultSetHoldability"
 },
 {
   description: "not fully supported",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testGetResultSetType"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testGetResultSetType"
 },
 {
   description: "statement.close() does not wrap up",
-  result: EXEC_FAILED,
-  name: "tests.sql.StatementTest#testGetUpdateCount"
+  bug: 3403706,
+  name: "libcore.java.sql.OldStatementTest#testGetUpdateCount"
 },
 {
   description: "Handshake Status is never finished. NPE in ClientSessionContext$HostAndPort.hashCode() when host
                 is null",
-  result: EXEC_FAILED,
+  bug: 3403706,
   name: "tests.api.javax.net.ssl.SSLEngineTest#testHandshake"
 },
 {
   description: "org.apache.harmony.xnet.provider.jsse.SSLEngineImpl#getDelegatedTask() throws NPE instead of
                 returning null",
-  result: EXEC_FAILED,
+  bug: 3403706,
   name: "tests.api.javax.net.ssl.SSLEngineTest#test_getDelegatedTask"
 },
 {
   description: "Fixed in DonutBurger, boundary checks missing",
-  result: EXEC_FAILED,
+  bug: 3403706,
   name: "tests.api.javax.net.ssl.SSLEngineTest#test_unwrap_02"
 },
 {
   description: "Fixed on DonutBurger, Wrong Exception thrown",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
     "tests.api.javax.net.ssl.SSLEngineTest#test_unwrap_03",
     "tests.api.javax.net.ssl.SSLEngineTest#test_unwrap_04",
@@ -973,12 +1025,12 @@
 },
 {
   description: "Fixed in DonutBurger, boundary checks missing",
-  result: EXEC_FAILED,
+  bug: 3403706,
   name: "tests.api.javax.net.ssl.SSLEngineTest#test_wrap_02"
 },
 {
   description: "Fixed on DonutBurger, Wrong Exception thrown",
-  result: EXEC_FAILED,
+  bug: 3403706,
   names: [
     "tests.api.javax.net.ssl.SSLEngineTest#test_wrap_04",
     "tests.api.javax.net.ssl.SSLEngineTest#test_wrap_ByteBuffer$ByteBuffer_03",
@@ -988,7 +1040,7 @@
 {
   description: "ManagerFactoryParameters object is not supported and InvalidAlgorithmParameterException was
                 thrown.",
-  result: EXEC_FAILED,
+  bug: 3403706,
   name: "tests.api.javax.net.ssl.TrustManagerFactory1Test#test_initLjavax_net_ssl_ManagerFactoryParameters"
 },
 {
@@ -1018,58 +1070,67 @@
 },
 {
   description: "method test fails once in a while. Cannot be sure that exception is thrown in every test execution.",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testBusy_handler"
+  bug: 3403706,
+  name: "libcore.sqlite.OldDatabaseTest#testBusy_handler"
 },
 {
   description: "Database does not lock values",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testBusy_timeout"
+  bug: 3403706,
+  name: "libcore.sqlite.OldDatabaseTest#testBusy_timeout"
 },
 {
   description: "Returns wrong number for updates: returns value > 1 for select.",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testChanges"
+  bug: 3403706,
+  name: "libcore.sqlite.OldDatabaseTest#testChanges"
 },
 {
   description: "Aggregation function not called",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testCreate_aggregate"
+  bug: 3403706,
+  name: "libcore.sqlite.OldDatabaseTest#testCreate_aggregate"
 },
 {
   description: "Reason for failure unknown: Database should be locked. Specification of interrupt is scarce.",
   result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testInterrupt"
+  name: "libcore.sqlite.OldDatabaseTest#testInterrupt"
 },
 {
   description: "not supported",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testOpen_blob"
+  bug: 3403706,
+  name: "libcore.sqlite.OldDatabaseTest#testOpen_blob"
 },
 {
   description: "Callback never made for authorization. Results of private table are returned without further checks.",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testSet_authorizer"
+  bug: 3403706,
+  name: "libcore.sqlite.OldDatabaseTest#testSet_authorizer"
 },
 {
   description: "ASCII encoding does not work: a UTF encoded val is returned. Spec is not sufficient. Might be that test impl is wrong or String constructor for the ASCII encoding.",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.DatabaseTest#testSet_encoding"
+  bug: 3403706,
+  name: "libcore.sqlite.OldDatabaseTest#testSet_encoding"
 },
 {
   description: "db.open_blob is not supported.",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.BlobTest#testBlob"
+  bug: 3403706,
+  name: "libcore.sqlite.OldBlobTest#testBlob"
 },
 {
   description: "Wrong value is returned in case of a prepared statement to which a '*' bound",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.StmtTest#testColumn_count"
+  bug: 3403706,
+  name: "libcore.sqlite.OldStmtTest#testColumn_count"
 },
 {
   description: "ZeroBlob not supported",
-  result: EXEC_FAILED,
-  name: "tests.SQLite.FunctionContextTest#testSet_result_zeroblob"
+  bug: 3403706,
+  name: "libcore.sqlite.OldFunctionContextTest#testSet_result_zeroblob"
+},
+{
+  description: "SQLite test fail",
+  bug: 3403706,
+  names: [
+    "libcore.sqlite.OldDatabaseTest#testGet_tableString",
+    "libcore.sqlite.OldDatabaseTest#testGet_tableStringStringArrayTableResult",
+    "libcore.sqlite.OldStmtTest#testColumn_type"
+  ]
 },
 {
   modes: [ "jvm" ],
@@ -1079,5 +1140,568 @@
     "libcore.java.util.FormatterTest#test_uppercaseConversions"
   ],
   result: EXEC_FAILED
+},
+{
+  description: "Android's XSLT implementation fails 524 of 3173 OASIS tests",
+  bug: 4193599,
+  names: [
+    "libcore.xml.XsltXPathConformanceTestSuite$MisspecifiedTest#test",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt005",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt017",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt018",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt019",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt020",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt022",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt024",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt029",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt033",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt034",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt038",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt039",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt044",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt045",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt047",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt052",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt054",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt055",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt056",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt058",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt061",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt062",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt063",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt064",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt067",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt069",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt070",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt074",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt075",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt077",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt079",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt083",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt085",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt086",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt089",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt090",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt091",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt094",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt095",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.BVTs_bvt098",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Completeness__84361",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err003",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err004",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err005",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err006",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err010",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err011",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err012",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err013",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err026",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err029",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err031",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err038",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err044",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err048",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err049",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err050",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err051",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err059",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err062",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err065",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err073",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err075",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err076",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err078",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err093",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err103",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err106",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_err108",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Errors_xsl_template_complicated_match_pattern_with_variable_ref",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Miscellaneous__84423",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Miscellaneous__84424",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Miscellaneous__84426",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Miscellaneous__84427",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Miscellaneous__84435",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.Miscellaneous__91183",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_BooleanFunction",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_Bug76054",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_DocumentFunctionWithAbsoluteArgument",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_DocumentFunctionWithEntityRef",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_ElementAvailFunctionFalseTest",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_GenereateIdAppliedToNamespaceNodesOnDifferentElements",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_TestIdFuncInComplexStruct",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions_TestOfIdFunction",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10002",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10003",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10004",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10005",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10006",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10007",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10008",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10009",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10010",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10011",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10012",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10013",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10014",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10015",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10016",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10017",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10018",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10019",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10020",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10021",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10022",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10023",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10024",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10025",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10026",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__10049",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__84048",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__84049",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__84050",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__84170",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__84172",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__EuropeanPattern",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__Non_DigitPattern",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__Pattern-separator",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__currency",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__defaultPattern",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__minimalValue",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__minimumValue",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__percentPattern",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__specialCharInPattern",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#Mixed.XSLTFunctions__testOn-0.00",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables_UseDocumentFnToReturnRootNode",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables_VariableWithinVariable",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__78117",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__78120",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__78125",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__78161",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__78356",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__78360",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84633",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84634",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84636",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84637",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84697",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84709",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84710",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XPath-Data-Model.Variables__84712",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Keys_PerfRepro2",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Keys_PerfRepro3",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Keys__91832",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Keys__91833",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Keys__91836",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Keys__91859",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting_SortExprWithCurrentInsideForEach1",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting_Sort_SortTextWithNonTextCharacters",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting_Sort_TextNodesSpanMultipleLines",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting_TurkishISortingTest",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__77516",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__77525",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__77977",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__78191",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__78286",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__78291",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__84006",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91689",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91691",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91693",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91694",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91695",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91696",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91697",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91698",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91699",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91700",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91701",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91704",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91705",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91752",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Manipulation.Sorting__91753",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Model.Whitespaces__91422",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Model.Whitespaces__91423",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Model.Whitespaces__91425",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Model.Whitespaces__91428",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Model.Whitespaces__91443",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Data-Model.Whitespaces__91444",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Extendability.Fallback__91825",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Extendability.ForwardComp__91841",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Extendability.ForwardComp__91844",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Extendability.ForwardComp__91848",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Extendability.ForwardComp__91849",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Extendability.ForwardComp__91853",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Extendability.ForwardComp__91856",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_AmpersandWithinHtmlAttribute",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_DoctypePublicAndSystemAttribute",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_DoctypePublicAttribute",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_DoctypeSystemAttribute",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_EmptyElement1",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_EntityRefInAttribHtml",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_HtmlOutputWithAmpersandCurlyBracket",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_HtmlOutputWithLessThanInAttribute",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_Html_Op_Href_Attr_non_ascii_value",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_MediaTypeTest",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_MethodEqualsHtmlWithoutIndentSet",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_Modified84433",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_Output_UseStandAloneAttributeWithMultipleRoots",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_SignInHrefAttribute",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output_UseLiteralResultElementHead",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__77929",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__77930",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__77936",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__77939",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__77940",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__77966",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78175",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78176",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78177",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78180",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78221",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78222",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78223",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78224",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78225",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78226",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78227",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__78229",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84010",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84011",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84012",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84015",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84016",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84017",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84018",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84019",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84020",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84021",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84022",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84025",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84165",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84260",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84264",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84271",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84273",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84277",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84280",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84282",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84285",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84306",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84309",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84374",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84428",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84429",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84432",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84433",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84434",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84452",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84453",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84454",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84455",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84456",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84457",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84458",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84459",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84460",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84461",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Output.Output__84462",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AVTs__77536",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AVTs__77562",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AVTs__77564",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AVTs__77574",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AVTs__77591",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AVTs__77596",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AVTs__77599",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets_RefToUndefinedAttributeSet",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91035",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91038",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91080",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91081",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91083",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91098",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91100",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.AttributeSets__91119",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes_Attribute_AttributeWithEmptyName",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes_Attribute_EmptyNameAttributeWithNS",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes_Attribute_InvalidNamespacePrefix",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes_Attribute_UseXmlnsNsAsNamespaceForAttribute",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__78365",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__78369",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__78373",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__78374",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__78376",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__78378",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__78386",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__81487",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__81551",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__89463",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__89464",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Attributes__89465",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Copying_ResultTreeFragmentWithEscapedText",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements_Element_ElementWithNSFromNameFn",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements_Element_ElementWithNoNameSpecified",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements_Element_ElementWithNoNameSpecifiedButValidNS",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements_Element_UseXslElementWIthNamespaceEqualToXmlnsUri",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements_Element_UseXslElementWithNameSpaceAttrEqualToXmlnsUri",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__78347",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__78358",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__78362",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__78363",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__83968",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__89171",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__89716",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__89717",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Elements__89718",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.FormatNumber_DecimalFormatSameCharForDecimalAndGrpSep",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.FormatNumber_DecimalFormatZeroDigit",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.FormatNumber_DecimalFormatZeroDigit1",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.FormatNumber_DecimalFormatZeroDigit2",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.FormatNumber_FormatNumber_SemiColonDelimitsToWhitespace",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.FormatNumber_TestGrpSepr",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.FormatNumber_ValueOf_FormatNumberWithoutPositiveNumberFormatPattern",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Namespace_XPath_Conflict_XPath_XSLT",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Namespace_XPath_DefaultNamespace",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Namespace_XPath_NavigatorMethods",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Namespace_XPath_PredefinedPrefix_XML",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Namespace_XPath_PredefinedPrefix_XMLNS",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Namespace_XPath_SameQuery_DiffNamespace",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Namespace_XPath_ScopingRules",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number_NaNOrInvalidValue",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number_ValueAsEmptyNodeset",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number_ValueAsNodesetTest1",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84683",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84687",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84692",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84694",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84699",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84700",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84705",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84715",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84716",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84717",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84722",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84723",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84724",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__84725",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__91026",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__91027",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__91028",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Number__91029",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ProcessingInstruction_InvalidPIName1",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ProcessingInstruction__78196",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ProcessingInstruction__78202",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ProcessingInstruction__78204",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ProcessingInstruction__78217",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ProcessingInstruction__78218",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ProcessingInstruction__78219",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text_DoeWithCdataInText",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text_Modified78311",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78245",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78272",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78273",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78274",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78275",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78276",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78281",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78308",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78309",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text__78311",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text_modified78308",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.Text_modified78309",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset10",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset17",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset27",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset29",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset31",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset32",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset40",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset41",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribset_attribset42",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.attribvaltemplate_attribvaltemplate08",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy16",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy19",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy20",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy21",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy22",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy38",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy56",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy58",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.copy_copy60",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.extend_extend02",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.extend_extend04",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey04",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey22",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey24",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey26",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey31",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey37",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey38",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey39",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey40",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey41",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey42",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey43",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey55",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey56",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey57",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey58",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey60",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey61",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.idkey_idkey62",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.match_match11",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.message_message15",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.namespace_namespace32",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.namespace_namespace34",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.numberformat_numberformat07",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.numberformat_numberformat35",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.numbering_numbering14",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.numbering_numbering17",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.numbering_numbering79",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.numbering_numbering91",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output01",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output02",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output03",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output04",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output05",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output06",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output08",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output09",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output10",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output110",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output111",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output113",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output17",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output22",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output25",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output26",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output28",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output32",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output33",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output34",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output35",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output36",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output37",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output38",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output39",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output40",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output48",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output49",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output50",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output52",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output59",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output60",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output61",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output62",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output70",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output72",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output73",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output74",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output75",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.output_output86",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.processorinfo_processorinfo03",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.select_select73",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.select_select74",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.sort_sort08",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.sort_sort27",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ver_ver05",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Result-Tree.ver_ver06",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__84614",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__84615",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91032",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91148",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91150",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91151",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91156",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91157",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91158",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Import__91165",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_Include_IncludeStylesheetWithoutXslNamespace",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_Include_IncludedStylesheetShouldHaveDifferentBaseUri",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_NestedIncludes",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_RelUriTest1",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_RelUriTest2",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_RelUriTest3",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_RelUriTest4",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_RelUriTest5",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include_RelUriTest6",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__77489",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__77504",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__77515",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__77736",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__77745",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__77750",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__77751",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__78295",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__78296",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__78398",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__84463",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Include__84464",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias_NSAlias_In_Import",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias_Namespace-Alias_NSAliasForDefaultWithExcludeResPref",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias_Namespace-Alias_Test1",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias_Namespace-Alias_Test2",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias_Namespace-Alias_WithinRTF",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias__91781",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias__91782",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias__91785",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace-alias__91786",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace_CheckXmlnsResetOnResultTree",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace__77655",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace__77665",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace__77670",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace__77675",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Namespace__78027",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91802",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91803",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91804",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91806",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91807",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91808",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91810",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91811",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Structure.Stylesheet__91816",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Template.ConflictResolution__77619",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Template.ConflictResolution__77622",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Template.ConflictResolution__77870",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Template.ConflictResolution__77879",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Template.ConflictResolution__77897",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Template.ConflictResolution__77898",
+    "libcore.xml.XsltXPathConformanceTestSuite$XsltTest#XSLT-Template.ConflictResolution__77902"
+  ]
+},
+{
+  description: "Android's XPath fails 29 of 250 Jaxen XPath tests",
+  bug: 3270761,
+  names: [
+    "libcore.xml.JaxenXPathTestSuite$3#xml/defaultNamespace.xml / /dummy:a/dummy:b/dummy:c",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/evaluate.xml / //metatest[ evaluate(@select) = . ]",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/evaluate.xml / evaluate('//jumps/*')",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/evaluate.xml / evaluate('//jumps/*')/dog",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/evaluate.xml / evaluate('//jumps/object')/dog",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/evaluate.xml / evaluate('//jumps/object')/evaluate",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/evaluate.xml / evaluate('//jumps/object/dog')",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/namespaces.xml / /foo:a",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/namespaces.xml / /foo:a/b",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/namespaces.xml / /voo:a/b/c",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/namespaces.xml / /voo:a/bar:f",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/testNamespaces.xml / //namespace::*",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/testNamespaces.xml /Template/Application1 //namespace::*",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/testNamespaces.xml /Template/Application1 //namespace::xplt",
+    "libcore.xml.JaxenXPathTestSuite$3#xml/text.xml / document('xml/web.xml')",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/message.xml / document('xml/message.xml')/message/body/data/items/item[name/text()='parentinfo']/value",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/namespaces.xml / /foo:a/alias:x/alias:y",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/namespaces.xml / /foo:a/b/c",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/namespaces.xml / /foo:a/foo:d/foo:e",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/namespaces.xml / /foo:a/foo:x/foo:y",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/text.xml / document('xml/web.xml')/web-app/servlet[1]/servlet-name",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/text.xml /foo/bar/cheese[1] concat(./@id,document('xml/web.xml')/web-app/servlet[1]/servlet-name,./@id)",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/web.xml /web-app/servlet[1] ends-with( servlet-class, 'S' )",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/web.xml /web-app/servlet[1] ends-with( servlet-class, 'Servlet' )",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/web.xml /web-app/servlet[1] lower-case( servlet-class )",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/web.xml /web-app/servlet[1] upper-case( servlet-class )",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/web.xml /web-app/servlet[1] upper-case( servlet-class, 'es-ES-Traditional_WIN' )",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/web.xml /web-app/servlet[1] upper-case( servlet-class, 'fr' )",
+    "libcore.xml.JaxenXPathTestSuite$4#xml/web.xml /web-app/servlet[1] upper-case( servlet-class, 'fr-CA' )"
+  ]
 }
 ]
diff --git a/include/ScopedStringChars.h b/include/ScopedStringChars.h
new file mode 100644
index 0000000..9f543b7
--- /dev/null
+++ b/include/ScopedStringChars.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef SCOPED_STRING_CHARS_H_included
+#define SCOPED_STRING_CHARS_H_included
+
+#include "JNIHelp.h"
+
+// A smart pointer that provides access to a jchar* given a JNI jstring.
+class ScopedStringChars {
+public:
+    ScopedStringChars(JNIEnv* env, jstring s) : mEnv(env), mString(s), mSize(0) {
+        mChars = env->GetStringChars(mString, NULL);
+        if (mChars != NULL) {
+            mSize = env->GetStringLength(mString);
+        }
+    }
+
+    ~ScopedStringChars() {
+        mEnv->ReleaseStringChars(mString, mChars);
+    }
+
+    const jchar* get() const { return mChars; }
+    const jchar& operator[](size_t n) const { return mChars[n]; }
+    size_t size() const { return mSize; }
+
+private:
+    JNIEnv* mEnv;
+    jstring mString;
+    const UChar* mChars;
+    size_t mSize;
+
+    // Disallow copy and assignment.
+    ScopedStringChars(const ScopedStringChars&);
+    void operator=(const ScopedStringChars&);
+};
+
+#endif  // SCOPED_STRING_CHARS_H_included
diff --git a/junit/src/test/java/junit/runner/BaseTestRunner.java b/junit/src/test/java/junit/runner/BaseTestRunner.java
deleted file mode 100644
index 7e69b11..0000000
--- a/junit/src/test/java/junit/runner/BaseTestRunner.java
+++ /dev/null
@@ -1,326 +0,0 @@
-package junit.runner;
-
-import junit.framework.*;
-import java.lang.reflect.*;
-import java.text.NumberFormat;
-import java.io.*;
-import java.util.*;
-
-/**
- * Base class for all test runners.
- * This class was born live on stage in Sardinia during XP2000.
- */
-public abstract class BaseTestRunner implements TestListener {
-    public static final String SUITE_METHODNAME= "suite";
-
-    private static Properties fPreferences;
-    static int fgMaxMessageLength= 500;
-    static boolean fgFilterStack= true;
-    boolean fLoading= true;
-
-    /*
-    * Implementation of TestListener
-    */
-    public synchronized void startTest(Test test) {
-        testStarted(test.toString());
-    }
-
-    protected static void setPreferences(Properties preferences) {
-        fPreferences= preferences;
-    }
-
-    protected static Properties getPreferences() {
-        if (fPreferences == null) {
-            fPreferences= new Properties();
-             fPreferences.put("loading", "true");
-             fPreferences.put("filterstack", "true");
-              readPreferences();
-        }
-        return fPreferences;
-    }
-
-    public static void savePreferences() throws IOException {
-        FileOutputStream fos= new FileOutputStream(getPreferencesFile());
-        try {
-            getPreferences().store(fos, "");
-        } finally {
-            fos.close();
-        }
-    }
-
-    public void setPreference(String key, String value) {
-        getPreferences().setProperty(key, value);
-    }
-
-    public synchronized void endTest(Test test) {
-        testEnded(test.toString());
-    }
-
-    public synchronized void addError(final Test test, final Throwable t) {
-        testFailed(TestRunListener.STATUS_ERROR, test, t);
-    }
-
-    public synchronized void addFailure(final Test test, final AssertionFailedError t) {
-        testFailed(TestRunListener.STATUS_FAILURE, test, t);
-    }
-
-    // TestRunListener implementation
-
-    public abstract void testStarted(String testName);
-
-    public abstract void testEnded(String testName);
-
-    public abstract void testFailed(int status, Test test, Throwable t);
-
-    /**
-     * Returns the Test corresponding to the given suite. This is
-     * a template method, subclasses override runFailed(), clearStatus().
-     */
-    public Test getTest(String suiteClassName) {
-        if (suiteClassName.length() <= 0) {
-            clearStatus();
-            return null;
-        }
-        Class testClass= null;
-        try {
-            testClass= loadSuiteClass(suiteClassName);
-        } catch (ClassNotFoundException e) {
-            String clazz= e.getMessage();
-            if (clazz == null)
-                clazz= suiteClassName;
-            runFailed("Class not found \""+clazz+"\"");
-            return null;
-        } catch(Exception e) {
-            runFailed("Error: "+e.toString());
-            return null;
-        }
-        Method suiteMethod= null;
-        try {
-            suiteMethod= testClass.getMethod(SUITE_METHODNAME, new Class[0]);
-         } catch(Exception e) {
-             // try to extract a test suite automatically
-            clearStatus();
-            return new TestSuite(testClass);
-        }
-        if (! Modifier.isStatic(suiteMethod.getModifiers())) {
-            runFailed("Suite() method must be static");
-            return null;
-        }
-        Test test= null;
-        try {
-            test= (Test)suiteMethod.invoke(null); // static method
-            if (test == null)
-                return test;
-        }
-        catch (InvocationTargetException e) {
-            runFailed("Failed to invoke suite():" + e.getTargetException().toString());
-            return null;
-        }
-        catch (IllegalAccessException e) {
-            runFailed("Failed to invoke suite():" + e.toString());
-            return null;
-        }
-
-        clearStatus();
-        return test;
-    }
-
-    /**
-     * Returns the formatted string of the elapsed time.
-     */
-    public String elapsedTimeAsString(long runTime) {
-        return NumberFormat.getInstance().format((double)runTime/1000);
-    }
-
-    /**
-     * Processes the command line arguments and
-     * returns the name of the suite class to run or null
-     */
-    protected String processArguments(String[] args) {
-        String suiteName= null;
-        for (int i= 0; i < args.length; i++) {
-            if (args[i].equals("-noloading")) {
-                setLoading(false);
-            } else if (args[i].equals("-nofilterstack")) {
-                fgFilterStack= false;
-            } else if (args[i].equals("-c")) {
-                if (args.length > i+1)
-                    suiteName= extractClassName(args[i+1]);
-                else
-                    System.out.println("Missing Test class name");
-                i++;
-            } else {
-                suiteName= args[i];
-            }
-        }
-        return suiteName;
-    }
-
-    /**
-     * Sets the loading behaviour of the test runner
-     */
-    public void setLoading(boolean enable) {
-        fLoading= enable;
-    }
-    /**
-     * Extract the class name from a String in VA/Java style
-     */
-    public String extractClassName(String className) {
-        if(className.startsWith("Default package for"))
-            return className.substring(className.lastIndexOf(".")+1);
-        return className;
-    }
-
-    /**
-     * Truncates a String to the maximum length.
-     */
-    public static String truncate(String s) {
-        if (fgMaxMessageLength != -1 && s.length() > fgMaxMessageLength)
-            s= s.substring(0, fgMaxMessageLength)+"...";
-        return s;
-    }
-
-    /**
-     * Override to define how to handle a failed loading of
-     * a test suite.
-     */
-    protected abstract void runFailed(String message);
-
-    /**
-     * Returns the loaded Class for a suite name.
-     */
-    protected Class loadSuiteClass(String suiteClassName) throws ClassNotFoundException {
-        return getLoader().load(suiteClassName);
-    }
-
-    /**
-     * Clears the status message.
-     */
-    protected void clearStatus() { // Belongs in the GUI TestRunner class
-    }
-
-    /**
-     * Returns the loader to be used.
-     */
-    public TestSuiteLoader getLoader() {
-        if (useReloadingTestSuiteLoader())
-            return new ReloadingTestSuiteLoader();
-        return new StandardTestSuiteLoader();
-    }
-
-    protected boolean useReloadingTestSuiteLoader() {
-        return getPreference("loading").equals("true") && !inVAJava() && fLoading;
-    }
-
-    private static File getPreferencesFile() {
-         String home= System.getProperty("user.home");
-         return new File(home, "junit.properties");
-     }
-
-     private static void readPreferences() {
-         InputStream is= null;
-         try {
-             is= new FileInputStream(getPreferencesFile());
-             setPreferences(new Properties(getPreferences()));
-            getPreferences().load(is);
-        } catch (IOException e) {
-            try {
-                if (is != null)
-                    is.close();
-            } catch (IOException e1) {
-            }
-        }
-     }
-
-     public static String getPreference(String key) {
-         return getPreferences().getProperty(key);
-     }
-
-     public static int getPreference(String key, int dflt) {
-         String value= getPreference(key);
-         int intValue= dflt;
-         if (value == null)
-             return intValue;
-         try {
-             intValue= Integer.parseInt(value);
-          } catch (NumberFormatException ne) {
-         }
-         return intValue;
-     }
-
-     public static boolean inVAJava() {
-        try {
-            Class.forName("com.ibm.uvm.tools.DebugSupport");
-        }
-        catch (Exception e) {
-            return false;
-        }
-        return true;
-    }
-
-    /**
-     * Returns a filtered stack trace
-     */
-    public static String getFilteredTrace(Throwable t) {
-        StringWriter stringWriter= new StringWriter();
-        PrintWriter writer= new PrintWriter(stringWriter);
-        t.printStackTrace(writer);
-        StringBuffer buffer= stringWriter.getBuffer();
-        String trace= buffer.toString();
-        return BaseTestRunner.getFilteredTrace(trace);
-    }
-
-    /**
-     * Filters stack frames from internal JUnit classes
-     */
-    public static String getFilteredTrace(String stack) {
-        if (showStackRaw())
-            return stack;
-
-        StringWriter sw= new StringWriter();
-        PrintWriter pw= new PrintWriter(sw);
-        StringReader sr= new StringReader(stack);
-        // BEGIN android-changed
-        // Use a sensible default buffer size
-        BufferedReader br= new BufferedReader(sr, 1000);
-        // END android-changed
-
-        String line;
-        try {
-            while ((line= br.readLine()) != null) {
-                if (!filterLine(line))
-                    pw.println(line);
-            }
-        } catch (Exception IOException) {
-            return stack; // return the stack unfiltered
-        }
-        return sw.toString();
-    }
-
-    protected static boolean showStackRaw() {
-        return !getPreference("filterstack").equals("true") || fgFilterStack == false;
-    }
-
-    static boolean filterLine(String line) {
-        String[] patterns= new String[] {
-            "junit.framework.TestCase",
-            "junit.framework.TestResult",
-            "junit.framework.TestSuite",
-            "junit.framework.Assert.", // don't filter AssertionFailure
-            "junit.swingui.TestRunner",
-            "junit.awtui.TestRunner",
-            "junit.textui.TestRunner",
-            "java.lang.reflect.Method.invoke("
-        };
-        for (int i= 0; i < patterns.length; i++) {
-            if (line.indexOf(patterns[i]) > 0)
-                return true;
-        }
-        return false;
-    }
-
-     static {
-         fgMaxMessageLength= getPreference("maxmessage", fgMaxMessageLength);
-     }
-
-}
diff --git a/junit/src/test/java/junit/runner/ClassPathTestCollector.java b/junit/src/test/java/junit/runner/ClassPathTestCollector.java
deleted file mode 100644
index 4745832..0000000
--- a/junit/src/test/java/junit/runner/ClassPathTestCollector.java
+++ /dev/null
@@ -1,80 +0,0 @@
-package junit.runner;
-
-import java.util.*;
-import java.io.*;
-
-/**
- * An implementation of a TestCollector that consults the
- * class path. It considers all classes on the class path
- * excluding classes in JARs. It leaves it up to subclasses
- * to decide whether a class is a runnable Test.
- *
- * @see TestCollector
- */
-public abstract class ClassPathTestCollector implements TestCollector {
-
-    static final int SUFFIX_LENGTH= ".class".length();
-
-    public ClassPathTestCollector() {
-    }
-
-    public Enumeration collectTests() {
-        String classPath= System.getProperty("java.class.path");
-        Hashtable result = collectFilesInPath(classPath);
-        return result.elements();
-    }
-
-    public Hashtable collectFilesInPath(String classPath) {
-        Hashtable result= collectFilesInRoots(splitClassPath(classPath));
-        return result;
-    }
-
-    Hashtable collectFilesInRoots(Vector roots) {
-        Hashtable result= new Hashtable(100);
-        Enumeration e= roots.elements();
-        while (e.hasMoreElements())
-            gatherFiles(new File((String)e.nextElement()), "", result);
-        return result;
-    }
-
-    void gatherFiles(File classRoot, String classFileName, Hashtable result) {
-        File thisRoot= new File(classRoot, classFileName);
-        if (thisRoot.isFile()) {
-            if (isTestClass(classFileName)) {
-                String className= classNameFromFile(classFileName);
-                result.put(className, className);
-            }
-            return;
-        }
-        String[] contents= thisRoot.list();
-        if (contents != null) {
-            for (int i= 0; i < contents.length; i++)
-                gatherFiles(classRoot, classFileName+File.separatorChar+contents[i], result);
-        }
-    }
-
-    Vector splitClassPath(String classPath) {
-        Vector result= new Vector();
-        String separator= System.getProperty("path.separator");
-        StringTokenizer tokenizer= new StringTokenizer(classPath, separator);
-        while (tokenizer.hasMoreTokens())
-            result.addElement(tokenizer.nextToken());
-        return result;
-    }
-
-    protected boolean isTestClass(String classFileName) {
-        return
-            classFileName.endsWith(".class") &&
-            classFileName.indexOf('$') < 0 &&
-            classFileName.indexOf("Test") > 0;
-    }
-
-    protected String classNameFromFile(String classFileName) {
-        // convert /a/b.class to a.b
-        String s= classFileName.substring(0, classFileName.length()-SUFFIX_LENGTH);
-        String s2= s.replace(File.separatorChar, '.');
-        if (s2.startsWith("."))
-            return s2.substring(1);
-        return s2;
-    }
-}
diff --git a/junit/src/test/java/junit/runner/FailureDetailView.java b/junit/src/test/java/junit/runner/FailureDetailView.java
deleted file mode 100644
index b188cf5..0000000
--- a/junit/src/test/java/junit/runner/FailureDetailView.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package junit.runner;
-
-// The following line was removed for compatibility with Android libraries.
-//import java.awt.Component;
-
-import junit.framework.*;
-
-/**
- * A view to show a details about a failure
- */
-public interface FailureDetailView {
-    // The following definition was removed for compatibility with Android
-    // libraries.
-    //     /**
-    //   * Returns the component used to present the TraceView
-    //   */
-    //  public Component getComponent();
-
-    /**
-     * Shows details of a TestFailure
-     */
-    public void showFailure(TestFailure failure);
-    /**
-     * Clears the view
-     */
-    public void clear();
-}
diff --git a/junit/src/test/java/junit/runner/LoadingTestCollector.java b/junit/src/test/java/junit/runner/LoadingTestCollector.java
deleted file mode 100644
index 9ca6f5f..0000000
--- a/junit/src/test/java/junit/runner/LoadingTestCollector.java
+++ /dev/null
@@ -1,69 +0,0 @@
-package junit.runner;
-
-import java.lang.reflect.*;
-import junit.runner.*;
-import junit.framework.*;
-
-/**
- * An implementation of a TestCollector that loads
- * all classes on the class path and tests whether
- * it is assignable from Test or provides a static suite method.
- * @see TestCollector
- */
-public class LoadingTestCollector extends ClassPathTestCollector {
-
-    TestCaseClassLoader fLoader;
-
-    public LoadingTestCollector() {
-        fLoader= new TestCaseClassLoader();
-    }
-
-    protected boolean isTestClass(String classFileName) {
-        try {
-            if (classFileName.endsWith(".class")) {
-                Class testClass= classFromFile(classFileName);
-                return (testClass != null) && isTestClass(testClass);
-            }
-        }
-        catch (ClassNotFoundException expected) {
-        }
-        catch (NoClassDefFoundError notFatal) {
-        }
-        return false;
-    }
-
-    Class classFromFile(String classFileName) throws ClassNotFoundException {
-        String className= classNameFromFile(classFileName);
-        if (!fLoader.isExcluded(className))
-            return fLoader.loadClass(className, false);
-        return null;
-    }
-
-    boolean isTestClass(Class testClass) {
-        if (hasSuiteMethod(testClass))
-            return true;
-        if (Test.class.isAssignableFrom(testClass) &&
-            Modifier.isPublic(testClass.getModifiers()) &&
-            hasPublicConstructor(testClass))
-            return true;
-        return false;
-    }
-
-    boolean hasSuiteMethod(Class testClass) {
-        try {
-            testClass.getMethod(BaseTestRunner.SUITE_METHODNAME, new Class[0]);
-         } catch(Exception e) {
-             return false;
-        }
-        return true;
-    }
-
-    boolean hasPublicConstructor(Class testClass) {
-        try {
-            TestSuite.getTestConstructor(testClass);
-        } catch(NoSuchMethodException e) {
-            return false;
-        }
-        return true;
-    }
-}
diff --git a/junit/src/test/java/junit/runner/ReloadingTestSuiteLoader.java b/junit/src/test/java/junit/runner/ReloadingTestSuiteLoader.java
deleted file mode 100644
index 570d3b0..0000000
--- a/junit/src/test/java/junit/runner/ReloadingTestSuiteLoader.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package junit.runner;
-
-/**
- * A TestSuite loader that can reload classes.
- */
-public class ReloadingTestSuiteLoader implements TestSuiteLoader {
-
-    public Class load(String suiteClassName) throws ClassNotFoundException {
-        return createLoader().loadClass(suiteClassName, true);
-    }
-
-    public Class reload(Class aClass) throws ClassNotFoundException {
-        return createLoader().loadClass(aClass.getName(), true);
-    }
-
-    protected TestCaseClassLoader createLoader() {
-        return new TestCaseClassLoader();
-    }
-}
diff --git a/junit/src/test/java/junit/runner/SimpleTestCollector.java b/junit/src/test/java/junit/runner/SimpleTestCollector.java
deleted file mode 100644
index 26f8a11..0000000
--- a/junit/src/test/java/junit/runner/SimpleTestCollector.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package junit.runner;
-
-/**
- * An implementation of a TestCollector that considers
- * a class to be a test class when it contains the
- * pattern "Test" in its name
- * @see TestCollector
- */
-public class SimpleTestCollector extends ClassPathTestCollector {
-
-    public SimpleTestCollector() {
-    }
-
-    protected boolean isTestClass(String classFileName) {
-        return
-            classFileName.endsWith(".class") &&
-            classFileName.indexOf('$') < 0 &&
-            classFileName.indexOf("Test") > 0;
-    }
-}
diff --git a/junit/src/test/java/junit/runner/Sorter.java b/junit/src/test/java/junit/runner/Sorter.java
deleted file mode 100644
index cb14e62..0000000
--- a/junit/src/test/java/junit/runner/Sorter.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package junit.runner;
-
-import java.util.*;
-
-import junit.runner.*;
-
-/**
- * A custom quick sort with support to customize the swap behaviour.
- * NOTICE: We can't use the the sorting support from the JDK 1.2 collection
- * classes because of the JDK 1.1.7 compatibility.
- */
-public class Sorter {
-    public static interface Swapper {
-        public void swap(Vector values, int left, int right);
-    }
-
-    public static void sortStrings(Vector values , int left, int right, Swapper swapper) {
-        int oleft= left;
-        int oright= right;
-        String mid= (String)values.elementAt((left + right) / 2);
-        do {
-            while (((String)(values.elementAt(left))).compareTo(mid) < 0)
-                left++;
-            while (mid.compareTo((String)(values.elementAt(right))) < 0)
-                right--;
-            if (left <= right) {
-                swapper.swap(values, left, right);
-                left++;
-                right--;
-            }
-        } while (left <= right);
-
-        if (oleft < right)
-            sortStrings(values, oleft, right, swapper);
-        if (left < oright)
-             sortStrings(values, left, oright, swapper);
-    }
-}
diff --git a/junit/src/test/java/junit/runner/StandardTestSuiteLoader.java b/junit/src/test/java/junit/runner/StandardTestSuiteLoader.java
deleted file mode 100644
index 1137675..0000000
--- a/junit/src/test/java/junit/runner/StandardTestSuiteLoader.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package junit.runner;
-
-/**
- * The standard test suite loader. It can only load the same class once.
- */
-public class StandardTestSuiteLoader implements TestSuiteLoader {
-    /**
-     * Uses the system class loader to load the test class
-     */
-    public Class load(String suiteClassName) throws ClassNotFoundException {
-        return Class.forName(suiteClassName);
-    }
-    /**
-     * Uses the system class loader to load the test class
-     */
-    public Class reload(Class aClass) throws ClassNotFoundException {
-        return aClass;
-    }
-}
diff --git a/junit/src/test/java/junit/runner/TestCaseClassLoader.java b/junit/src/test/java/junit/runner/TestCaseClassLoader.java
deleted file mode 100644
index 3e39ef1..0000000
--- a/junit/src/test/java/junit/runner/TestCaseClassLoader.java
+++ /dev/null
@@ -1,226 +0,0 @@
-package junit.runner;
-
-import java.util.*;
-import java.io.*;
-import java.net.URL;
-import java.util.zip.*;
-
-/**
- * A custom class loader which enables the reloading
- * of classes for each test run. The class loader
- * can be configured with a list of package paths that
- * should be excluded from loading. The loading
- * of these packages is delegated to the system class
- * loader. They will be shared across test runs.
- * <p>
- * The list of excluded package paths is specified in
- * a properties file "excluded.properties" that is located in
- * the same place as the TestCaseClassLoader class.
- * <p>
- * <b>Known limitation:</b> the TestCaseClassLoader cannot load classes
- * from jar files.
- */
-
-
-public class TestCaseClassLoader extends ClassLoader {
-    /** scanned class path */
-    private Vector fPathItems;
-    /** default excluded paths */
-    private String[] defaultExclusions= {
-        "junit.framework.",
-        "junit.extensions.",
-        "junit.runner."
-    };
-    /** name of excluded properties file */
-    static final String EXCLUDED_FILE= "excluded.properties";
-    /** excluded paths */
-    private Vector fExcluded;
-
-    /**
-     * Constructs a TestCaseLoader. It scans the class path
-     * and the excluded package paths
-     */
-    public TestCaseClassLoader() {
-        this(System.getProperty("java.class.path"));
-    }
-
-    /**
-     * Constructs a TestCaseLoader. It scans the class path
-     * and the excluded package paths
-     */
-    public TestCaseClassLoader(String classPath) {
-        scanPath(classPath);
-        readExcludedPackages();
-    }
-
-    private void scanPath(String classPath) {
-        String separator= System.getProperty("path.separator");
-        fPathItems= new Vector(10);
-        StringTokenizer st= new StringTokenizer(classPath, separator);
-        while (st.hasMoreTokens()) {
-            fPathItems.addElement(st.nextToken());
-        }
-    }
-
-    public URL getResource(String name) {
-        return ClassLoader.getSystemResource(name);
-    }
-
-    public InputStream getResourceAsStream(String name) {
-        return ClassLoader.getSystemResourceAsStream(name);
-    }
-
-    public boolean isExcluded(String name) {
-        for (int i= 0; i < fExcluded.size(); i++) {
-            if (name.startsWith((String) fExcluded.elementAt(i))) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public synchronized Class loadClass(String name, boolean resolve)
-        throws ClassNotFoundException {
-
-        Class c= findLoadedClass(name);
-        if (c != null)
-            return c;
-        //
-        // Delegate the loading of excluded classes to the
-        // standard class loader.
-        //
-        if (isExcluded(name)) {
-            try {
-                c= findSystemClass(name);
-                return c;
-            } catch (ClassNotFoundException e) {
-                // keep searching
-            }
-        }
-        if (c == null) {
-            byte[] data= lookupClassData(name);
-            if (data == null)
-                throw new ClassNotFoundException();
-            c= defineClass(name, data, 0, data.length);
-        }
-        if (resolve)
-            resolveClass(c);
-        return c;
-    }
-
-    private byte[] lookupClassData(String className) throws ClassNotFoundException {
-        byte[] data= null;
-        for (int i= 0; i < fPathItems.size(); i++) {
-            String path= (String) fPathItems.elementAt(i);
-            String fileName= className.replace('.', '/')+".class";
-            if (isJar(path)) {
-                data= loadJarData(path, fileName);
-            } else {
-                data= loadFileData(path, fileName);
-            }
-            if (data != null)
-                return data;
-        }
-        throw new ClassNotFoundException(className);
-    }
-
-    boolean isJar(String pathEntry) {
-        return pathEntry.endsWith(".jar") ||
-               pathEntry.endsWith(".apk") ||
-                       pathEntry.endsWith(".zip");
-    }
-
-    private byte[] loadFileData(String path, String fileName) {
-        File file= new File(path, fileName);
-        if (file.exists()) {
-            return getClassData(file);
-        }
-        return null;
-    }
-
-    private byte[] getClassData(File f) {
-        try {
-            FileInputStream stream= new FileInputStream(f);
-            ByteArrayOutputStream out= new ByteArrayOutputStream(1000);
-            byte[] b= new byte[1000];
-            int n;
-            while ((n= stream.read(b)) != -1)
-                out.write(b, 0, n);
-            stream.close();
-            out.close();
-            return out.toByteArray();
-
-        } catch (IOException e) {
-        }
-        return null;
-    }
-
-    private byte[] loadJarData(String path, String fileName) {
-        ZipFile zipFile= null;
-        InputStream stream= null;
-        File archive= new File(path);
-        if (!archive.exists())
-            return null;
-        try {
-            zipFile= new ZipFile(archive);
-        } catch(IOException io) {
-            return null;
-        }
-        ZipEntry entry= zipFile.getEntry(fileName);
-        if (entry == null)
-            return null;
-        int size= (int) entry.getSize();
-        try {
-            stream= zipFile.getInputStream(entry);
-            byte[] data= new byte[size];
-            int pos= 0;
-            while (pos < size) {
-                int n= stream.read(data, pos, data.length - pos);
-                pos += n;
-            }
-            zipFile.close();
-            return data;
-        } catch (IOException e) {
-        } finally {
-            try {
-                if (stream != null)
-                    stream.close();
-            } catch (IOException e) {
-            }
-        }
-        return null;
-    }
-
-    private void readExcludedPackages() {
-        fExcluded= new Vector(10);
-        for (int i= 0; i < defaultExclusions.length; i++)
-            fExcluded.addElement(defaultExclusions[i]);
-
-        InputStream is= getClass().getResourceAsStream(EXCLUDED_FILE);
-        if (is == null)
-            return;
-        Properties p= new Properties();
-        try {
-            p.load(is);
-        }
-        catch (IOException e) {
-            return;
-        } finally {
-            try {
-                is.close();
-            } catch (IOException e) {
-            }
-        }
-        for (Enumeration e= p.propertyNames(); e.hasMoreElements(); ) {
-            String key= (String)e.nextElement();
-            if (key.startsWith("excluded.")) {
-                String path= p.getProperty(key);
-                path= path.trim();
-                if (path.endsWith("*"))
-                    path= path.substring(0, path.length()-1);
-                if (path.length() > 0)
-                    fExcluded.addElement(path);
-            }
-        }
-    }
-}
diff --git a/junit/src/test/java/junit/runner/TestCollector.java b/junit/src/test/java/junit/runner/TestCollector.java
deleted file mode 100644
index bdf7af7..0000000
--- a/junit/src/test/java/junit/runner/TestCollector.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package junit.runner;
-
-import java.util.*;
-
-
-/**
- * Collects Test class names to be presented
- * by the TestSelector.
- * @see TestSelector
- */
-public interface TestCollector {
-    /**
-     * Returns an enumeration of Strings with qualified class names
-     */
-    public Enumeration collectTests();
-}
diff --git a/junit/src/test/java/junit/runner/TestRunListener.java b/junit/src/test/java/junit/runner/TestRunListener.java
deleted file mode 100644
index b11ef07..0000000
--- a/junit/src/test/java/junit/runner/TestRunListener.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package junit.runner;
-/**
- * A listener interface for observing the
- * execution of a test run. Unlike TestListener,
- * this interface using only primitive objects,
- * making it suitable for remote test execution.
- */
- public interface TestRunListener {
-     /* test status constants*/
-     public static final int STATUS_ERROR= 1;
-     public static final int STATUS_FAILURE= 2;
-
-     public void testRunStarted(String testSuiteName, int testCount);
-     public void testRunEnded(long elapsedTime);
-     public void testRunStopped(long elapsedTime);
-     public void testStarted(String testName);
-     public void testEnded(String testName);
-     public void testFailed(int status, String testName, String trace);
-}
diff --git a/junit/src/test/java/junit/runner/TestSuiteLoader.java b/junit/src/test/java/junit/runner/TestSuiteLoader.java
deleted file mode 100644
index 581ea23..0000000
--- a/junit/src/test/java/junit/runner/TestSuiteLoader.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package junit.runner;
-
-/**
- * An interface to define how a test suite should be loaded.
- */
-public interface TestSuiteLoader {
-    abstract public Class load(String suiteClassName) throws ClassNotFoundException;
-    abstract public Class reload(Class aClass) throws ClassNotFoundException;
-}
diff --git a/junit/src/test/java/junit/runner/Version.java b/junit/src/test/java/junit/runner/Version.java
deleted file mode 100644
index e231750..0000000
--- a/junit/src/test/java/junit/runner/Version.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package junit.runner;
-
-/**
- * This class defines the current version of JUnit
- */
-public class Version {
-    private Version() {
-        // don't instantiate
-    }
-
-    public static String id() {
-        return "3.8.1";
-    }
-}
diff --git a/junit/src/test/java/junit/runner/excluded.properties b/junit/src/test/java/junit/runner/excluded.properties
deleted file mode 100644
index 3284628..0000000
--- a/junit/src/test/java/junit/runner/excluded.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# The list of excluded package paths for the TestCaseClassLoader
-#
-excluded.0=sun.*
-excluded.1=com.sun.*
-excluded.2=org.omg.*
-excluded.3=javax.*
-excluded.4=sunw.*
-excluded.5=java.*
-excluded.6=org.w3c.dom.*
-excluded.7=org.xml.sax.*
-excluded.8=net.jini.*
diff --git a/junit/src/test/java/junit/runner/logo.gif b/junit/src/test/java/junit/runner/logo.gif
deleted file mode 100644
index d0e1547..0000000
--- a/junit/src/test/java/junit/runner/logo.gif
+++ /dev/null
Binary files differ
diff --git a/junit/src/test/java/junit/runner/smalllogo.gif b/junit/src/test/java/junit/runner/smalllogo.gif
deleted file mode 100644
index 7b25eaf..0000000
--- a/junit/src/test/java/junit/runner/smalllogo.gif
+++ /dev/null
Binary files differ
diff --git a/junit/src/test/java/junit/textui/ResultPrinter.java b/junit/src/test/java/junit/textui/ResultPrinter.java
deleted file mode 100644
index 6d64cfd..0000000
--- a/junit/src/test/java/junit/textui/ResultPrinter.java
+++ /dev/null
@@ -1,142 +0,0 @@
-
-package junit.textui;
-
-import java.io.PrintStream;
-// The following line was removed for compatibility with Android libraries.
-//import java.text.NumberFormat;
-import java.util.Enumeration;
-
-import junit.framework.AssertionFailedError;
-import junit.framework.Test;
-import junit.framework.TestFailure;
-import junit.framework.TestListener;
-import junit.framework.TestResult;
-import junit.runner.BaseTestRunner;
-
-public class ResultPrinter implements TestListener {
-    PrintStream fWriter;
-    int fColumn= 0;
-
-    public ResultPrinter(PrintStream writer) {
-        fWriter= writer;
-    }
-
-    /* API for use by textui.TestRunner
-     */
-
-    synchronized void print(TestResult result, long runTime) {
-        printHeader(runTime);
-        printErrors(result);
-        printFailures(result);
-        printFooter(result);
-    }
-
-    void printWaitPrompt() {
-        getWriter().println();
-        getWriter().println("<RETURN> to continue");
-    }
-
-    /* Internal methods
-     */
-
-    protected void printHeader(long runTime) {
-        getWriter().println();
-        getWriter().println("Time: "+elapsedTimeAsString(runTime));
-    }
-
-    protected void printErrors(TestResult result) {
-        printDefects(result.errors(), result.errorCount(), "error");
-    }
-
-    protected void printFailures(TestResult result) {
-        printDefects(result.failures(), result.failureCount(), "failure");
-    }
-
-    protected void printDefects(Enumeration booBoos, int count, String type) {
-        if (count == 0) return;
-        if (count == 1)
-            getWriter().println("There was " + count + " " + type + ":");
-        else
-            getWriter().println("There were " + count + " " + type + "s:");
-        for (int i= 1; booBoos.hasMoreElements(); i++) {
-            printDefect((TestFailure) booBoos.nextElement(), i);
-        }
-    }
-
-    public void printDefect(TestFailure booBoo, int count) { // only public for testing purposes
-        printDefectHeader(booBoo, count);
-        printDefectTrace(booBoo);
-    }
-
-    protected void printDefectHeader(TestFailure booBoo, int count) {
-        // I feel like making this a println, then adding a line giving the throwable a chance to print something
-        // before we get to the stack trace.
-        getWriter().print(count + ") " + booBoo.failedTest());
-    }
-
-    protected void printDefectTrace(TestFailure booBoo) {
-        getWriter().print(BaseTestRunner.getFilteredTrace(booBoo.trace()));
-    }
-
-    protected void printFooter(TestResult result) {
-        if (result.wasSuccessful()) {
-            getWriter().println();
-            getWriter().print("OK");
-            getWriter().println (" (" + result.runCount() + " test" + (result.runCount() == 1 ? "": "s") + ")");
-
-        } else {
-            getWriter().println();
-            getWriter().println("FAILURES!!!");
-            getWriter().println("Tests run: "+result.runCount()+
-                         ",  Failures: "+result.failureCount()+
-                         ",  Errors: "+result.errorCount());
-        }
-        getWriter().println();
-    }
-
-
-    /**
-     * Returns the formatted string of the elapsed time.
-     * Duplicated from BaseTestRunner. Fix it.
-     */
-    protected String elapsedTimeAsString(long runTime) {
-            // The following line was altered for compatibility with
-            // Android libraries.
-        return Double.toString((double)runTime/1000);
-    }
-
-    public PrintStream getWriter() {
-        return fWriter;
-    }
-    /**
-     * @see junit.framework.TestListener#addError(Test, Throwable)
-     */
-    public void addError(Test test, Throwable t) {
-        getWriter().print("E");
-    }
-
-    /**
-     * @see junit.framework.TestListener#addFailure(Test, AssertionFailedError)
-     */
-    public void addFailure(Test test, AssertionFailedError t) {
-        getWriter().print("F");
-    }
-
-    /**
-     * @see junit.framework.TestListener#endTest(Test)
-     */
-    public void endTest(Test test) {
-    }
-
-    /**
-     * @see junit.framework.TestListener#startTest(Test)
-     */
-    public void startTest(Test test) {
-        getWriter().print(".");
-        if (fColumn++ >= 40) {
-            getWriter().println();
-            fColumn= 0;
-        }
-    }
-
-}
diff --git a/junit/src/test/java/junit/textui/TestRunner.java b/junit/src/test/java/junit/textui/TestRunner.java
deleted file mode 100644
index 7d5aebd..0000000
--- a/junit/src/test/java/junit/textui/TestRunner.java
+++ /dev/null
@@ -1,189 +0,0 @@
-package junit.textui;
-
-
-import java.io.PrintStream;
-
-import junit.framework.*;
-import junit.runner.*;
-
-/**
- * A command line based tool to run tests.
- * <pre>
- * java junit.textui.TestRunner [-wait] TestCaseClass
- * </pre>
- * TestRunner expects the name of a TestCase class as argument.
- * If this class defines a static <code>suite</code> method it
- * will be invoked and the returned test is run. Otherwise all
- * the methods starting with "test" having no arguments are run.
- * <p>
- * When the wait command line argument is given TestRunner
- * waits until the users types RETURN.
- * <p>
- * TestRunner prints a trace as the tests are executed followed by a
- * summary at the end.
- */
-public class TestRunner extends BaseTestRunner {
-    private ResultPrinter fPrinter;
-
-    public static final int SUCCESS_EXIT= 0;
-    public static final int FAILURE_EXIT= 1;
-    public static final int EXCEPTION_EXIT= 2;
-
-    /**
-     * Constructs a TestRunner.
-     */
-    public TestRunner() {
-        this(System.out);
-    }
-
-    /**
-     * Constructs a TestRunner using the given stream for all the output
-     */
-    public TestRunner(PrintStream writer) {
-        this(new ResultPrinter(writer));
-    }
-
-    /**
-     * Constructs a TestRunner using the given ResultPrinter all the output
-     */
-    public TestRunner(ResultPrinter printer) {
-        fPrinter= printer;
-    }
-
-    /**
-     * Runs a suite extracted from a TestCase subclass.
-     */
-    static public void run(Class testClass) {
-        run(new TestSuite(testClass));
-    }
-
-    /**
-     * Runs a single test and collects its results.
-     * This method can be used to start a test run
-     * from your program.
-     * <pre>
-     * public static void main (String[] args) {
-     *     test.textui.TestRunner.run(suite());
-     * }
-     * </pre>
-     */
-    static public TestResult run(Test test) {
-        TestRunner runner= new TestRunner();
-        return runner.doRun(test);
-    }
-
-    /**
-     * Runs a single test and waits until the user
-     * types RETURN.
-     */
-    static public void runAndWait(Test suite) {
-        TestRunner aTestRunner= new TestRunner();
-        aTestRunner.doRun(suite, true);
-    }
-
-    /**
-     * Always use the StandardTestSuiteLoader. Overridden from
-     * BaseTestRunner.
-     */
-    public TestSuiteLoader getLoader() {
-        return new StandardTestSuiteLoader();
-    }
-
-    public void testFailed(int status, Test test, Throwable t) {
-    }
-
-    public void testStarted(String testName) {
-    }
-
-    public void testEnded(String testName) {
-    }
-
-    /**
-     * Creates the TestResult to be used for the test run.
-     */
-    protected TestResult createTestResult() {
-        return new TestResult();
-    }
-
-    public TestResult doRun(Test test) {
-        return doRun(test, false);
-    }
-
-    public TestResult doRun(Test suite, boolean wait) {
-        TestResult result= createTestResult();
-        result.addListener(fPrinter);
-        long startTime= System.currentTimeMillis();
-        suite.run(result);
-        long endTime= System.currentTimeMillis();
-        long runTime= endTime-startTime;
-        fPrinter.print(result, runTime);
-
-        pause(wait);
-        return result;
-    }
-
-    protected void pause(boolean wait) {
-        if (!wait) return;
-        fPrinter.printWaitPrompt();
-        try {
-            System.in.read();
-        }
-        catch(Exception e) {
-        }
-    }
-
-    public static void main(String args[]) {
-        TestRunner aTestRunner= new TestRunner();
-        try {
-            TestResult r= aTestRunner.start(args);
-            if (!r.wasSuccessful())
-                System.exit(FAILURE_EXIT);
-            System.exit(SUCCESS_EXIT);
-        } catch(Exception e) {
-            System.err.println(e.getMessage());
-            System.exit(EXCEPTION_EXIT);
-        }
-    }
-
-    /**
-     * Starts a test run. Analyzes the command line arguments
-     * and runs the given test suite.
-     */
-    protected TestResult start(String args[]) throws Exception {
-        String testCase= "";
-        boolean wait= false;
-
-        for (int i= 0; i < args.length; i++) {
-            if (args[i].equals("-wait"))
-                wait= true;
-            else if (args[i].equals("-c"))
-                testCase= extractClassName(args[++i]);
-            else if (args[i].equals("-v"))
-                System.err.println("JUnit "+Version.id()+" by Kent Beck and Erich Gamma");
-            else
-                testCase= args[i];
-        }
-
-        if (testCase.equals(""))
-            throw new Exception("Usage: TestRunner [-wait] testCaseName, where name is the name of the TestCase class");
-
-        try {
-            Test suite= getTest(testCase);
-            return doRun(suite, wait);
-        }
-        catch(Exception e) {
-            throw new Exception("Could not create and run test suite: "+e);
-        }
-    }
-
-    protected void runFailed(String message) {
-        System.err.println(message);
-        System.exit(FAILURE_EXIT);
-    }
-
-    public void setPrinter(ResultPrinter printer) {
-        fPrinter= printer;
-    }
-
-
-}
diff --git a/luni/src/main/java/java/beans/PropertyChangeSupport.java b/luni/src/main/java/java/beans/PropertyChangeSupport.java
index 6df04c5..04f8155 100644
--- a/luni/src/main/java/java/beans/PropertyChangeSupport.java
+++ b/luni/src/main/java/java/beans/PropertyChangeSupport.java
@@ -43,9 +43,9 @@
 
     private static final long serialVersionUID = 6401253773779951803l;
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("source", Object.class),
-            new ObjectStreamField("children", Object.class),
-            new ObjectStreamField("propertyChangeSupportSerializedDataVersion", int.class)
+        new ObjectStreamField("source", Object.class),
+        new ObjectStreamField("children", Object.class),
+        new ObjectStreamField("propertyChangeSupportSerializedDataVersion", int.class),
     };
 
     private transient Object sourceBean;
diff --git a/luni/src/main/java/java/io/BufferedInputStream.java b/luni/src/main/java/java/io/BufferedInputStream.java
index bfd18cf..d45595b 100644
--- a/luni/src/main/java/java/io/BufferedInputStream.java
+++ b/luni/src/main/java/java/io/BufferedInputStream.java
@@ -343,19 +343,12 @@
      */
     @Override
     public synchronized void reset() throws IOException {
-        // BEGIN android-changed
-        /*
-         * These exceptions get thrown in some "normalish" circumstances,
-         * so it is preferable to avoid loading up the whole big set of
-         * messages just for these cases.
-         */
         if (buf == null) {
             throw new IOException("Stream is closed");
         }
         if (-1 == markpos) {
             throw new IOException("Mark has been invalidated.");
         }
-        // END android-changed
         pos = markpos;
     }
 
diff --git a/luni/src/main/java/java/io/BufferedReader.java b/luni/src/main/java/java/io/BufferedReader.java
index 0d77735..03ecf9f 100644
--- a/luni/src/main/java/java/io/BufferedReader.java
+++ b/luni/src/main/java/java/io/BufferedReader.java
@@ -306,15 +306,12 @@
                  * don't read into smaller buffers because that could result in
                  * a many reads.
                  */
-                if ((mark == -1 || (pos - mark >= markLimit))
-                        && outstanding >= buf.length) {
+                if ((mark == -1 || (pos - mark >= markLimit)) && outstanding >= buf.length) {
                     int count = in.read(buffer, offset, outstanding);
                     if (count > 0) {
-                        offset += count;
                         outstanding -= count;
                         mark = -1;
                     }
-
                     break; // assume the source stream gave us all that it could
                 }
 
@@ -359,9 +356,6 @@
             }
             for (int charPos = pos; charPos < end; charPos++) {
                 char ch = buf[charPos];
-                // BEGIN android-note
-                // a switch statement may be more efficient
-                // END android-note
                 if (ch > '\r') {
                     continue;
                 }
diff --git a/luni/src/main/java/java/io/BufferedWriter.java b/luni/src/main/java/java/io/BufferedWriter.java
index 3017065..e4cbe7c 100644
--- a/luni/src/main/java/java/io/BufferedWriter.java
+++ b/luni/src/main/java/java/io/BufferedWriter.java
@@ -17,10 +17,8 @@
 
 package java.io;
 
-import java.security.AccessController;
 import java.util.Arrays;
-import org.apache.harmony.luni.util.PriviAction;
-import org.apache.harmony.luni.util.SneakyThrow;
+import libcore.util.SneakyThrow;
 
 /**
  * Wraps an existing {@link Writer} and <em>buffers</em> the output. Expensive
@@ -46,9 +44,6 @@
 
     private int pos;
 
-    private final String lineSeparator = AccessController
-            .doPrivileged(new PriviAction<String>("line.separator"));
-
     /**
      * Constructs a new {@code BufferedWriter}, providing {@code out} with a buffer
      * of 8192 bytes.
@@ -156,15 +151,14 @@
     }
 
     /**
-     * Writes a newline to this writer. A newline is determined by the System
-     * property "line.separator". The target writer may or may not be flushed
-     * when a newline is written.
+     * Writes a newline to this writer. On Android, this is {@code "\n"}.
+     * The target writer may or may not be flushed when a newline is written.
      *
      * @throws IOException
      *             if an error occurs attempting to write to this writer.
      */
     public void newLine() throws IOException {
-        write(lineSeparator, 0, lineSeparator.length());
+        write(System.lineSeparator());
     }
 
     /**
diff --git a/luni/src/main/java/java/io/ByteArrayInputStream.java b/luni/src/main/java/java/io/ByteArrayInputStream.java
index 642ba01..0a8c453 100644
--- a/luni/src/main/java/java/io/ByteArrayInputStream.java
+++ b/luni/src/main/java/java/io/ByteArrayInputStream.java
@@ -73,9 +73,6 @@
      *            the number of bytes available for streaming.
      */
     public ByteArrayInputStream(byte[] buf, int offset, int length) {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         this.buf = buf;
         pos = offset;
         mark = offset;
diff --git a/luni/src/main/java/java/io/ByteArrayOutputStream.java b/luni/src/main/java/java/io/ByteArrayOutputStream.java
index 6c6c8f5..3ab2c20 100644
--- a/luni/src/main/java/java/io/ByteArrayOutputStream.java
+++ b/luni/src/main/java/java/io/ByteArrayOutputStream.java
@@ -44,7 +44,6 @@
      * array will expand.
      */
     public ByteArrayOutputStream() {
-        super();
         buf = new byte[32];
     }
 
@@ -60,7 +59,6 @@
      *             if {@code size} < 0.
      */
     public ByteArrayOutputStream(int size) {
-        super();
         if (size >= 0) {
             buf = new byte[size];
         } else {
diff --git a/luni/src/main/java/java/io/CharArrayWriter.java b/luni/src/main/java/java/io/CharArrayWriter.java
index ea5e10e..0c98a7c 100644
--- a/luni/src/main/java/java/io/CharArrayWriter.java
+++ b/luni/src/main/java/java/io/CharArrayWriter.java
@@ -45,7 +45,6 @@
      * {@code lock} to synchronize access to this writer.
      */
     public CharArrayWriter() {
-        super();
         buf = new char[32];
         lock = buf;
     }
@@ -61,7 +60,6 @@
      *             if {@code initialSize < 0}.
      */
     public CharArrayWriter(int initialSize) {
-        super();
         if (initialSize < 0) {
             throw new IllegalArgumentException("size < 0");
         }
@@ -206,16 +204,9 @@
         if (str == null) {
             throw new NullPointerException("str == null");
         }
-        // avoid int overflow
-        // BEGIN android-changed
-        // Exception priorities (in case of multiple errors) differ from
-        // RI, but are spec-compliant.
-        // removed redundant check, used (offset | count) < 0
-        // instead of (offset < 0) || (count < 0) to safe one operation
         if ((offset | count) < 0 || offset > str.length() - count) {
             throw new StringIndexOutOfBoundsException(str, offset, count);
         }
-        // END android-changed
         synchronized (lock) {
             expand(count);
             str.getChars(offset, offset + count, buf, this.count);
diff --git a/luni/src/main/java/java/io/CharConversionException.java b/luni/src/main/java/java/io/CharConversionException.java
index 97dc186..f3822c4 100644
--- a/luni/src/main/java/java/io/CharConversionException.java
+++ b/luni/src/main/java/java/io/CharConversionException.java
@@ -29,7 +29,6 @@
      * filled in.
      */
     public CharConversionException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/Console.java b/luni/src/main/java/java/io/Console.java
index d2f73e6..1fd666b 100644
--- a/luni/src/main/java/java/io/Console.java
+++ b/luni/src/main/java/java/io/Console.java
@@ -16,6 +16,9 @@
 package java.io;
 
 import java.util.Formatter;
+import libcore.io.ErrnoException;
+import libcore.io.Libcore;
+import static libcore.io.OsConstants.*;
 
 /**
  * Provides access to the console, if available. The system-wide instance can
@@ -26,7 +29,6 @@
     private static final Object CONSOLE_LOCK = new Object();
 
     private static final Console console = makeConsole();
-    private static native boolean isatty(int fd);
 
     private final ConsoleReader reader;
     private final PrintWriter writer;
@@ -40,7 +42,8 @@
     }
 
     private static Console makeConsole() {
-        if (!isatty(0) || !isatty(1)) {
+        // We don't care about stderr, because this class only uses stdin and stdout.
+        if (!Libcore.os.isatty(FileDescriptor.in) || !Libcore.os.isatty(FileDescriptor.out)) {
             return null;
         }
         try {
diff --git a/luni/src/main/java/java/io/DataInputStream.java b/luni/src/main/java/java/io/DataInputStream.java
index adf226f..f04fdca 100644
--- a/luni/src/main/java/java/io/DataInputStream.java
+++ b/luni/src/main/java/java/io/DataInputStream.java
@@ -19,9 +19,9 @@
 
 import java.nio.ByteOrder;
 import java.nio.charset.ModifiedUtf8;
+import libcore.io.Memory;
 import libcore.io.Streams;
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
 
 /**
  * Wraps an existing {@link InputStream} and reads big-endian typed data from it.
@@ -55,24 +55,6 @@
     }
 
     /**
-     * Reads bytes from this stream into the byte array {@code buffer}. Returns
-     * the number of bytes that have been read.
-     *
-     * @param buffer
-     *            the buffer to read bytes into.
-     * @return the number of bytes that have been read or -1 if the end of the
-     *         stream has been reached.
-     * @throws IOException
-     *             if a problem occurs while reading from this stream.
-     * @see DataOutput#write(byte[])
-     * @see DataOutput#write(byte[], int, int)
-     */
-    @Override
-    public final int read(byte[] buffer) throws IOException {
-        return in.read(buffer, 0, buffer.length);
-    }
-
-    /**
      * Reads at most {@code length} bytes from this stream and stores them in
      * the byte array {@code buffer} starting at {@code offset}. Returns the
      * number of bytes that have been read or -1 if no bytes have been read and
@@ -135,7 +117,7 @@
 
     public final int readInt() throws IOException {
         Streams.readFully(in, scratch, 0, SizeOf.INT);
-        return OSMemory.peekInt(scratch, 0, ByteOrder.BIG_ENDIAN);
+        return Memory.peekInt(scratch, 0, ByteOrder.BIG_ENDIAN);
     }
 
     @Deprecated
@@ -175,12 +157,12 @@
 
     public final long readLong() throws IOException {
         Streams.readFully(in, scratch, 0, SizeOf.LONG);
-        return OSMemory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN);
+        return Memory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN);
     }
 
     public final short readShort() throws IOException {
         Streams.readFully(in, scratch, 0, SizeOf.SHORT);
-        return OSMemory.peekShort(scratch, 0, ByteOrder.BIG_ENDIAN);
+        return Memory.peekShort(scratch, 0, ByteOrder.BIG_ENDIAN);
     }
 
     public final int readUnsignedByte() throws IOException {
diff --git a/luni/src/main/java/java/io/DataOutputStream.java b/luni/src/main/java/java/io/DataOutputStream.java
index cc34278..671f174 100644
--- a/luni/src/main/java/java/io/DataOutputStream.java
+++ b/luni/src/main/java/java/io/DataOutputStream.java
@@ -19,8 +19,8 @@
 
 import java.nio.ByteOrder;
 import java.nio.charset.ModifiedUtf8;
+import libcore.io.Memory;
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
 
 /**
  * Wraps an existing {@link OutputStream} and writes big-endian typed data to it.
@@ -176,19 +176,19 @@
     }
 
     public final void writeInt(int val) throws IOException {
-        OSMemory.pokeInt(scratch, 0, val, ByteOrder.BIG_ENDIAN);
+        Memory.pokeInt(scratch, 0, val, ByteOrder.BIG_ENDIAN);
         out.write(scratch, 0, SizeOf.INT);
         written += SizeOf.INT;
     }
 
     public final void writeLong(long val) throws IOException {
-        OSMemory.pokeLong(scratch, 0, val, ByteOrder.BIG_ENDIAN);
+        Memory.pokeLong(scratch, 0, val, ByteOrder.BIG_ENDIAN);
         out.write(scratch, 0, SizeOf.LONG);
         written += SizeOf.LONG;
     }
 
     public final void writeShort(int val) throws IOException {
-        OSMemory.pokeShort(scratch, 0, (short) val, ByteOrder.BIG_ENDIAN);
+        Memory.pokeShort(scratch, 0, (short) val, ByteOrder.BIG_ENDIAN);
         out.write(scratch, 0, SizeOf.SHORT);
         written += SizeOf.SHORT;
     }
diff --git a/luni/src/main/java/java/io/EOFException.java b/luni/src/main/java/java/io/EOFException.java
index 0103469..3496d14 100644
--- a/luni/src/main/java/java/io/EOFException.java
+++ b/luni/src/main/java/java/io/EOFException.java
@@ -29,7 +29,6 @@
      * Constructs a new {@code EOFException} with its stack trace filled in.
      */
     public EOFException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/EmulatedFields.java b/luni/src/main/java/java/io/EmulatedFields.java
index 580cfe3..23efaef1 100644
--- a/luni/src/main/java/java/io/EmulatedFields.java
+++ b/luni/src/main/java/java/io/EmulatedFields.java
@@ -76,9 +76,7 @@
      *            an array of ObjectStreamFields, which describe the declared
      *            fields.
      */
-    public EmulatedFields(ObjectStreamField[] fields,
-            ObjectStreamField[] declared) {
-        super();
+    public EmulatedFields(ObjectStreamField[] fields, ObjectStreamField[] declared) {
         // We assume the slots are already sorted in the right shape for dumping
         buildSlots(fields);
         declaredFields = declared;
@@ -145,7 +143,6 @@
      */
     private ObjectSlot findSlot(String fieldName, Class<?> fieldType) {
         boolean isPrimitive = fieldType != null && fieldType.isPrimitive();
-
         for (int i = 0; i < slotsToSerialize.length; i++) {
             ObjectSlot slot = slotsToSerialize[i];
             if (slot.field.getName().equals(fieldName)) {
@@ -172,10 +169,8 @@
             for (int i = 0; i < declaredFields.length; i++) {
                 ObjectStreamField field = declaredFields[i];
                 if (field.getName().equals(fieldName)) {
-                    if (isPrimitive ? field.getType() == fieldType
-                            : fieldType == null
-                                    || field.getType().isAssignableFrom(
-                                            fieldType)) {
+                    if (isPrimitive ? fieldType == field.getType() : fieldType == null ||
+                            field.getType().isAssignableFrom(fieldType)) {
                         ObjectSlot slot = new ObjectSlot();
                         slot.field = field;
                         slot.defaulted = true;
@@ -187,6 +182,14 @@
         return null;
     }
 
+    private ObjectSlot findMandatorySlot(String name, Class<?> type) {
+        ObjectSlot slot = findSlot(name, type);
+        if (slot == null || (type == null && slot.field.getType().isPrimitive())) {
+            throw new IllegalArgumentException("no field '" + name + "' of type " + type);
+        }
+        return slot;
+    }
+
     /**
      * Finds and returns the byte value of a given field named {@code name}
      * in the receiver. If the field has not been assigned any value yet, the
@@ -202,15 +205,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public byte get(String name, byte defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Byte.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no byte field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Byte) slot.fieldValue)
-                .byteValue();
+    public byte get(String name, byte defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, byte.class);
+        return slot.defaulted ? defaultValue : ((Byte) slot.fieldValue).byteValue();
     }
 
     /**
@@ -228,15 +225,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public char get(String name, char defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Character.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no char field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Character) slot.fieldValue)
-                .charValue();
+    public char get(String name, char defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, char.class);
+        return slot.defaulted ? defaultValue : ((Character) slot.fieldValue).charValue();
     }
 
     /**
@@ -254,15 +245,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public double get(String name, double defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Double.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no double field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Double) slot.fieldValue)
-                .doubleValue();
+    public double get(String name, double defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, double.class);
+        return slot.defaulted ? defaultValue : ((Double) slot.fieldValue).doubleValue();
     }
 
     /**
@@ -280,15 +265,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public float get(String name, float defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Float.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no float field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Float) slot.fieldValue)
-                .floatValue();
+    public float get(String name, float defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, float.class);
+        return slot.defaulted ? defaultValue : ((Float) slot.fieldValue).floatValue();
     }
 
     /**
@@ -306,15 +285,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public int get(String name, int defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Integer.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no int field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Integer) slot.fieldValue)
-                .intValue();
+    public int get(String name, int defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, int.class);
+        return slot.defaulted ? defaultValue : ((Integer) slot.fieldValue).intValue();
     }
 
     /**
@@ -332,15 +305,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public long get(String name, long defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Long.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no long field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Long) slot.fieldValue)
-                .longValue();
+    public long get(String name, long defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, long.class);
+        return slot.defaulted ? defaultValue : ((Long) slot.fieldValue).longValue();
     }
 
     /**
@@ -358,13 +325,8 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public Object get(String name, Object defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, null);
-        // if not initialized yet, we give the default value
-        if (slot == null || slot.field.getType().isPrimitive()) {
-            throw new IllegalArgumentException("no Object field '" + name + "'");
-        }
+    public Object get(String name, Object defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, null);
         return slot.defaulted ? defaultValue : slot.fieldValue;
     }
 
@@ -383,15 +345,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public short get(String name, short defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Short.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no short field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Short) slot.fieldValue)
-                .shortValue();
+    public short get(String name, short defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, short.class);
+        return slot.defaulted ? defaultValue : ((Short) slot.fieldValue).shortValue();
     }
 
     /**
@@ -409,15 +365,9 @@
      * @throws IllegalArgumentException
      *             if the corresponding field can not be found.
      */
-    public boolean get(String name, boolean defaultValue)
-            throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Boolean.TYPE);
-        // if not initialized yet, we give the default value
-        if (slot == null) {
-            throw new IllegalArgumentException("no boolean field '" + name + "'");
-        }
-        return slot.defaulted ? defaultValue : ((Boolean) slot.fieldValue)
-                .booleanValue();
+    public boolean get(String name, boolean defaultValue) throws IllegalArgumentException {
+        ObjectSlot slot = findMandatorySlot(name, boolean.class);
+        return slot.defaulted ? defaultValue : ((Boolean) slot.fieldValue).booleanValue();
     }
 
     /**
@@ -433,10 +383,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, byte value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Byte.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no byte field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, byte.class);
         slot.fieldValue = Byte.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
@@ -454,10 +401,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, char value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Character.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no char field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, char.class);
         slot.fieldValue = Character.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
@@ -475,10 +419,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, double value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Double.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no double field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, double.class);
         slot.fieldValue = Double.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
@@ -496,10 +437,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, float value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Float.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no float field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, float.class);
         slot.fieldValue = Float.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
@@ -517,10 +455,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, int value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Integer.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no integer field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, int.class);
         slot.fieldValue = Integer.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
@@ -538,10 +473,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, long value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Long.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no long field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, long.class);
         slot.fieldValue = Long.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
@@ -563,10 +495,7 @@
         if (value != null) {
             valueClass = value.getClass();
         }
-        ObjectSlot slot = findSlot(name, valueClass);
-        if (slot == null) {
-            throw new IllegalArgumentException("no Object field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, valueClass);
         slot.fieldValue = value;
         slot.defaulted = false; // No longer default value
     }
@@ -584,10 +513,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, short value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Short.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no short field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, short.class);
         slot.fieldValue = Short.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
@@ -605,10 +531,7 @@
      *             if the corresponding field can not be found.
      */
     public void put(String name, boolean value) throws IllegalArgumentException {
-        ObjectSlot slot = findSlot(name, Boolean.TYPE);
-        if (slot == null) {
-            throw new IllegalArgumentException("no boolean field '" + name + "'");
-        }
+        ObjectSlot slot = findMandatorySlot(name, boolean.class);
         slot.fieldValue = Boolean.valueOf(value);
         slot.defaulted = false; // No longer default value
     }
diff --git a/luni/src/main/java/java/io/EmulatedFieldsForDumping.java b/luni/src/main/java/java/io/EmulatedFieldsForDumping.java
index 9b51dc1..9cf6eae 100644
--- a/luni/src/main/java/java/io/EmulatedFieldsForDumping.java
+++ b/luni/src/main/java/java/io/EmulatedFieldsForDumping.java
@@ -200,21 +200,21 @@
         for (EmulatedFields.ObjectSlot slot : emulatedFields.slots()) {
             Object fieldValue = slot.getFieldValue();
             Class<?> type = slot.getField().getType();
-            if (type == Integer.TYPE) {
+            if (type == int.class) {
                 output.writeInt(fieldValue != null ? ((Integer) fieldValue).intValue() : 0);
-            } else if (type == Byte.TYPE) {
+            } else if (type == byte.class) {
                 output.writeByte(fieldValue != null ? ((Byte) fieldValue).byteValue() : 0);
-            } else if (type == Character.TYPE) {
+            } else if (type == char.class) {
                 output.writeChar(fieldValue != null ? ((Character) fieldValue).charValue() : 0);
-            } else if (type == Short.TYPE) {
+            } else if (type == short.class) {
                 output.writeShort(fieldValue != null ? ((Short) fieldValue).shortValue() : 0);
-            } else if (type == Boolean.TYPE) {
+            } else if (type == boolean.class) {
                 output.writeBoolean(fieldValue != null ? ((Boolean) fieldValue).booleanValue() : false);
-            } else if (type == Long.TYPE) {
+            } else if (type == long.class) {
                 output.writeLong(fieldValue != null ? ((Long) fieldValue).longValue() : 0);
-            } else if (type == Float.TYPE) {
+            } else if (type == float.class) {
                 output.writeFloat(fieldValue != null ? ((Float) fieldValue).floatValue() : 0);
-            } else if (type == Double.TYPE) {
+            } else if (type == double.class) {
                 output.writeDouble(fieldValue != null ? ((Double) fieldValue).doubleValue() : 0);
             } else {
                 // Either array or Object
diff --git a/luni/src/main/java/java/io/EmulatedFieldsForLoading.java b/luni/src/main/java/java/io/EmulatedFieldsForLoading.java
index d92f650..9044c60 100644
--- a/luni/src/main/java/java/io/EmulatedFieldsForLoading.java
+++ b/luni/src/main/java/java/io/EmulatedFieldsForLoading.java
@@ -41,10 +41,8 @@
      *            fields.
      */
     EmulatedFieldsForLoading(ObjectStreamClass streamClass) {
-        super();
         this.streamClass = streamClass;
-        emulatedFields = new EmulatedFields(streamClass.getLoadFields(),
-                streamClass.fields());
+        emulatedFields = new EmulatedFields(streamClass.getLoadFields(), streamClass.fields());
     }
 
     /**
diff --git a/luni/src/main/java/java/io/File.java b/luni/src/main/java/java/io/File.java
index 1e1d625..968f021 100644
--- a/luni/src/main/java/java/io/File.java
+++ b/luni/src/main/java/java/io/File.java
@@ -15,46 +15,39 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// We've dropped Windows support, except where it's exposed: we still support
-// non-Unix separators in serialized File objects, for example, but we don't
-// have any code for UNC paths or case-insensitivity.
-// We've also changed the JNI interface to better match what the Java actually wants.
-// (The JNI implementation is also much simpler.)
-// Some methods have been rewritten to reduce unnecessary allocation.
-// Some duplication has been factored out.
-// END android-note
-
 package java.io;
 
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.security.AccessController;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Random;
+import libcore.io.ErrnoException;
+import libcore.io.IoUtils;
+import libcore.io.Libcore;
+import libcore.io.StructStat;
+import libcore.io.StructStatFs;
 import org.apache.harmony.luni.util.DeleteOnExit;
-import org.apache.harmony.luni.util.PriviAction;
+import static libcore.io.OsConstants.*;
 
 /**
  * An "abstract" representation of a file system entity identified by a
  * pathname. The pathname may be absolute (relative to the root directory
  * of the file system) or relative to the current directory in which the program
  * is running.
- * <p>
- * The actual file referenced by a {@code File} may or may not exist. It may
+ *
+ * <p>The actual file referenced by a {@code File} may or may not exist. It may
  * also, despite the name {@code File}, be a directory or other non-regular
  * file.
- * <p>
- * This class provides limited functionality for getting/setting file
+ *
+ * <p>This class provides limited functionality for getting/setting file
  * permissions, file type, and last modified time.
- * <p>
- * Although Java doesn't specify a character encoding for filenames, on Android
- * Java strings are converted to UTF-8 byte sequences when sending filenames to
- * the operating system, and byte sequences returned by the operating system
- * (from the various {@code list} methods) are converted to Java strings by
- * decoding them as UTF-8 byte sequences.
+ *
+ * <p>On Android strings are converted to UTF-8 byte sequences when sending filenames to
+ * the operating system, and byte sequences returned by the operating system (from the
+ * various {@code list} methods) are converted to strings by decoding them as UTF-8
+ * byte sequences.
  *
  * @see java.io.Serializable
  * @see java.lang.Comparable
@@ -64,6 +57,12 @@
     private static final long serialVersionUID = 301077366599181567L;
 
     /**
+     * Reusing a Random makes temporary filenames slightly harder to predict.
+     * (Random is thread-safe.)
+     */
+    private static final Random tempFileRandom = new Random();
+
+    /**
      * The system-dependent character used to separate components in filenames ('/').
      * Use of this (rather than hard-coding '/') helps portability to other operating systems.
      *
@@ -99,16 +98,12 @@
      * given, but without duplicate adjacent slashes and without trailing
      * slashes (except for the special case of the root directory). This
      * path may be the empty string.
+     *
+     * This can't be final because we override readObject.
      */
     private String path;
 
-    /**
-     * The path we return from getAbsolutePath, and pass down to native code.
-     */
-    private transient String absolutePath;
-
     static {
-        // The default protection domain grants access to these properties.
         separatorChar = System.getProperty("file.separator", "/").charAt(0);
         pathSeparatorChar = System.getProperty("path.separator", ":").charAt(0);
         separator = String.valueOf(separatorChar);
@@ -136,7 +131,7 @@
      *            the path to be used for the file.
      */
     public File(String path) {
-        init(path);
+        this.path = fixSlashes(path);
     }
 
     /**
@@ -148,18 +143,18 @@
      * @param name
      *            the file's name.
      * @throws NullPointerException
-     *             if {@code name} is {@code null}.
+     *             if {@code name == null}.
      */
     public File(String dirPath, String name) {
         if (name == null) {
             throw new NullPointerException();
         }
         if (dirPath == null || dirPath.isEmpty()) {
-            init(name);
+            this.path = fixSlashes(name);
         } else if (name.isEmpty()) {
-            init(dirPath);
+            this.path = fixSlashes(dirPath);
         } else {
-            init(join(dirPath, name));
+            this.path = fixSlashes(join(dirPath, name));
         }
     }
 
@@ -180,26 +175,11 @@
     public File(URI uri) {
         // check pre-conditions
         checkURI(uri);
-        init(uri.getPath());
-    }
-
-    private void init(String dirtyPath) {
-        // Cache the path and the absolute path.
-        // We can't call isAbsolute() here (http://b/2486943).
-        String cleanPath = fixSlashes(dirtyPath);
-        boolean isAbsolute = cleanPath.length() > 0 && cleanPath.charAt(0) == separatorChar;
-        if (isAbsolute) {
-            this.path = this.absolutePath = cleanPath;
-        } else {
-            String userDir = AccessController.doPrivileged(new PriviAction<String>("user.dir"));
-            this.absolutePath = cleanPath.isEmpty() ? userDir : join(userDir, cleanPath);
-            // We want path to be equal to cleanPath, but we'd like to reuse absolutePath's char[].
-            this.path = absolutePath.substring(absolutePath.length() - cleanPath.length());
-        }
+        this.path = fixSlashes(uri.getPath());
     }
 
     // Removes duplicate adjacent slashes and any trailing slash.
-    private String fixSlashes(String origPath) {
+    private static String fixSlashes(String origPath) {
         // Remove duplicate adjacent slashes.
         boolean lastWasSlash = false;
         char[] newPath = origPath.toCharArray();
@@ -226,7 +206,7 @@
     }
 
     // Joins two path components, adding a separator only if necessary.
-    private String join(String prefix, String suffix) {
+    private static String join(String prefix, String suffix) {
         int prefixLength = prefix.length();
         boolean haveSlash = (prefixLength > 0 && prefix.charAt(prefixLength - 1) == separatorChar);
         if (!haveSlash) {
@@ -235,7 +215,7 @@
         return haveSlash ? (prefix + suffix) : (prefix + separatorChar + suffix);
     }
 
-    private void checkURI(URI uri) {
+    private static void checkURI(URI uri) {
         if (!uri.isAbsolute()) {
             throw new IllegalArgumentException("URI is not absolute: " + uri);
         } else if (!uri.getRawSchemeSpecificPart().startsWith("/")) {
@@ -260,12 +240,8 @@
     }
 
     /**
-     * Lists the file system roots. The Java platform may support zero or more
-     * file systems, each with its own platform-dependent root. Further, the
-     * {@link #getCanonicalPath canonical} path of any file on the system will
-     * always begin with one of the returned file system roots.
-     *
-     * @return the array of file system roots.
+     * Returns the file system roots. On Android and other Unix systems, there is
+     * a single root, {@code /}.
      */
     public static File[] listRoots() {
         return new File[] { new File("/") };
@@ -277,66 +253,38 @@
      * to actually attempt the operation.
      *
      * @return {@code true} if this file can be executed, {@code false} otherwise.
-     * @throws SecurityException
-     *             If a security manager exists and
-     *             SecurityManager.checkExec(java.lang.String) disallows read
-     *             permission to this file object
-     * @see java.lang.SecurityManager#checkExec(String)
-     *
      * @since 1.6
      */
     public boolean canExecute() {
-        if (path.isEmpty()) {
-            return false;
-        }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkExec(path); // Seems bogus, but this is what the RI does.
-        }
-        return canExecuteImpl(absolutePath);
+        return doAccess(X_OK);
     }
-    private static native boolean canExecuteImpl(String path);
 
     /**
      * Indicates whether the current context is allowed to read from this file.
      *
      * @return {@code true} if this file can be read, {@code false} otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies the
-     *             read request.
      */
     public boolean canRead() {
-        if (path.isEmpty()) {
-            return false;
-        }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
-        }
-        return canReadImpl(absolutePath);
+        return doAccess(R_OK);
     }
-    private static native boolean canReadImpl(String path);
 
     /**
      * Indicates whether the current context is allowed to write to this file.
      *
      * @return {@code true} if this file can be written, {@code false}
      *         otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies the
-     *             write request.
      */
     public boolean canWrite() {
-        if (path.isEmpty()) {
+        return doAccess(W_OK);
+    }
+
+    private boolean doAccess(int mode) {
+        try {
+            return Libcore.os.access(path, mode);
+        } catch (ErrnoException errnoException) {
             return false;
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
-        }
-        return canWriteImpl(absolutePath);
     }
-    private static native boolean canWriteImpl(String path);
 
     /**
      * Returns the relative sort ordering of the paths for this file and the
@@ -359,39 +307,33 @@
      * Callers must check the return value.
      *
      * @return {@code true} if this file was deleted, {@code false} otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies the
-     *             request.
-     * @see java.lang.SecurityManager#checkDelete
      */
     public boolean delete() {
-        if (path.isEmpty()) {
+        try {
+            Libcore.os.remove(path);
+            return true;
+        } catch (ErrnoException errnoException) {
             return false;
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkDelete(path);
-        }
-        return deleteImpl(absolutePath);
     }
 
-    private static native boolean deleteImpl(String path);
-
     /**
-     * Schedules this file to be automatically deleted once the virtual machine
-     * terminates. This will only happen when the virtual machine terminates
-     * normally as described by the Java Language Specification section 12.9.
+     * Schedules this file to be automatically deleted when the VM terminates normally.
      *
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies the
-     *             request.
+     * <p><i>Note that on Android, the application lifecycle does not include VM termination,
+     * so calling this method will not ensure that files are deleted</i>. Instead, you should
+     * use the most appropriate out of:
+     * <ul>
+     * <li>Use a {@code finally} clause to manually invoke {@link #delete}.
+     * <li>Maintain your own set of files to delete, and process it at an appropriate point
+     * in your application's lifecycle.
+     * <li>Use the Unix trick of deleting the file as soon as all readers and writers have
+     * opened it. No new readers/writers will be able to access the file, but all existing
+     * ones will still have access until the last one closes the file.
+     * </ul>
      */
     public void deleteOnExit() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkDelete(path);
-        }
-        DeleteOnExit.getInstance().addFile(getAbsoluteName());
+        DeleteOnExit.getInstance().addFile(getAbsolutePath());
     }
 
     /**
@@ -416,25 +358,11 @@
      * underlying file system.
      *
      * @return {@code true} if this file exists, {@code false} otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
-     * @see #getPath
-     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
      */
     public boolean exists() {
-        if (path.isEmpty()) {
-            return false;
-        }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
-        }
-        return existsImpl(absolutePath);
+        return doAccess(F_OK);
     }
 
-    private static native boolean existsImpl(String path);
-
     /**
      * Returns the absolute path of this file. An absolute path is a path that starts at a root
      * of the file system. On Android, there is only one root: {@code /}.
@@ -444,7 +372,11 @@
      * child must have the same working directory as its parent.
      */
     public String getAbsolutePath() {
-        return absolutePath;
+        if (isAbsolute()) {
+            return path;
+        }
+        String userDir = System.getProperty("user.dir");
+        return path.isEmpty() ? userDir : join(userDir, path);
     }
 
     /**
@@ -452,7 +384,7 @@
      * Equivalent to {@code new File(this.getAbsolutePath())}.
      */
     public File getAbsoluteFile() {
-        return new File(this.getAbsolutePath());
+        return new File(getAbsolutePath());
     }
 
     /**
@@ -479,14 +411,13 @@
      *             if an I/O error occurs.
      */
     public String getCanonicalPath() throws IOException {
-        return realpath(absolutePath);
+        return realpath(getAbsolutePath());
     }
 
     /**
      * TODO: move this stuff to libcore.os.
      * @hide
      */
-    public static native void symlink(String oldPath, String newPath);
     private static native String realpath(String path);
     private static native String readlink(String path);
 
@@ -497,7 +428,6 @@
      * @return the new file constructed from this file's canonical path.
      * @throws IOException
      *             if an I/O error occurs.
-     * @see java.lang.SecurityManager#checkPropertyAccess
      */
     public File getCanonicalFile() throws IOException {
         return new File(getCanonicalPath());
@@ -595,45 +525,31 @@
      *
      * @return {@code true} if this file is a directory, {@code false}
      *         otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
      */
     public boolean isDirectory() {
-        if (path.isEmpty()) {
+        try {
+            return S_ISDIR(Libcore.os.stat(path).st_mode);
+        } catch (ErrnoException errnoException) {
+            // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
             return false;
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
-        }
-        return isDirectoryImpl(absolutePath);
     }
 
-    private static native boolean isDirectoryImpl(String path);
-
     /**
      * Indicates if this file represents a <em>file</em> on the underlying
      * file system.
      *
      * @return {@code true} if this file is a file, {@code false} otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
      */
     public boolean isFile() {
-        if (path.isEmpty()) {
+        try {
+            return S_ISREG(Libcore.os.stat(path).st_mode);
+        } catch (ErrnoException errnoException) {
+            // The RI returns false on error. (Even for errors like EACCES or ELOOP.)
             return false;
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
-        }
-        return isFileImpl(absolutePath);
     }
 
-    private static native boolean isFileImpl(String path);
-
     /**
      * Returns whether or not this file is a hidden file as defined by the
      * operating system. The notion of "hidden" is system-dependent. For Unix
@@ -642,18 +558,11 @@
      * purpose.
      *
      * @return {@code true} if the file is hidden, {@code false} otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
      */
     public boolean isHidden() {
         if (path.isEmpty()) {
             return false;
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
-        }
         return getName().startsWith(".");
     }
 
@@ -663,23 +572,16 @@
      * Returns 0 if the file does not exist.
      *
      * @return the time when this file was last modified.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
      */
     public long lastModified() {
-        if (path.isEmpty()) {
+        try {
+            return Libcore.os.stat(path).st_mtime * 1000L;
+        } catch (ErrnoException errnoException) {
+            // The RI returns 0 on error. (Even for errors like EACCES or ELOOP.)
             return 0;
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
-        }
-        return lastModifiedImpl(absolutePath);
     }
 
-    private static native long lastModifiedImpl(String path);
-
     /**
      * Sets the time this file was last modified, measured in milliseconds since
      * January 1st, 1970, midnight.
@@ -693,22 +595,12 @@
      *         otherwise.
      * @throws IllegalArgumentException
      *             if {@code time < 0}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies write
-     *             access to this file.
      */
     public boolean setLastModified(long time) {
-        if (path.isEmpty()) {
-            return false;
-        }
         if (time < 0) {
             throw new IllegalArgumentException("time < 0");
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
-        }
-        return setLastModifiedImpl(absolutePath, time);
+        return setLastModifiedImpl(path, time);
     }
 
     private static native boolean setLastModifiedImpl(String path, long time);
@@ -741,21 +633,10 @@
      *         pathname the operation will fail. If the underlying file system
      *         does not support execute permission and the value of executable
      *         is false, this operation will fail.
-     * @throws SecurityException -
-     *             If a security manager exists and
-     *             SecurityManager.checkWrite(java.lang.String) disallows write
-     *             permission to this file object
      * @since 1.6
      */
     public boolean setExecutable(boolean executable, boolean ownerOnly) {
-        if (path.isEmpty()) {
-            return false;
-        }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
-        }
-        return setExecutableImpl(absolutePath, executable, ownerOnly);
+        return doChmod(ownerOnly ? S_IXUSR : (S_IXUSR | S_IXGRP | S_IXOTH), executable);
     }
 
     /**
@@ -767,8 +648,6 @@
         return setExecutable(executable, true);
     }
 
-    private static native boolean setExecutableImpl(String path, boolean executable, boolean ownerOnly);
-
     /**
      * Manipulates the read permissions for the abstract path designated by this
      * file.
@@ -785,21 +664,10 @@
      *         pathname the operation will fail. If the underlying file system
      *         does not support read permission and the value of readable is
      *         false, this operation will fail.
-     * @throws SecurityException -
-     *             If a security manager exists and
-     *             SecurityManager.checkWrite(java.lang.String) disallows write
-     *             permission to this file object
      * @since 1.6
      */
     public boolean setReadable(boolean readable, boolean ownerOnly) {
-        if (path.isEmpty()) {
-            return false;
-        }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
-        }
-        return setReadableImpl(absolutePath, readable, ownerOnly);
+        return doChmod(ownerOnly ? S_IRUSR : (S_IRUSR | S_IRGRP | S_IROTH), readable);
     }
 
     /**
@@ -811,8 +679,6 @@
         return setReadable(readable, true);
     }
 
-    private static native boolean setReadableImpl(String path, boolean readable, boolean ownerOnly);
-
     /**
      * Manipulates the write permissions for the abstract path designated by this
      * file.
@@ -827,21 +693,10 @@
      * @return true if and only if the operation succeeded. If the user does not
      *         have permission to change the access permissions of this abstract
      *         pathname the operation will fail.
-     * @throws SecurityException -
-     *             If a security manager exists and
-     *             SecurityManager.checkWrite(java.lang.String) disallows write
-     *             permission to this file object
      * @since 1.6
      */
     public boolean setWritable(boolean writable, boolean ownerOnly) {
-        if (path.isEmpty()) {
-            return false;
-        }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
-        }
-        return setWritableImpl(absolutePath, writable, ownerOnly);
+        return doChmod(ownerOnly ? S_IWUSR : (S_IWUSR | S_IWGRP | S_IWOTH), writable);
     }
 
     /**
@@ -853,7 +708,16 @@
         return setWritable(writable, true);
     }
 
-    private static native boolean setWritableImpl(String path, boolean writable, boolean ownerOnly);
+    private boolean doChmod(int mask, boolean set) {
+        try {
+            StructStat sb = Libcore.os.stat(path);
+            int newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
+            Libcore.os.chmod(path, newMode);
+            return true;
+        } catch (ErrnoException errnoException) {
+            return false;
+        }
+    }
 
     /**
      * Returns the length of this file in bytes.
@@ -861,20 +725,16 @@
      * The result for a directory is not defined.
      *
      * @return the number of bytes in this file.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
      */
     public long length() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
+        try {
+            return Libcore.os.stat(path).st_size;
+        } catch (ErrnoException errnoException) {
+            // The RI returns 0 on error. (Even for errors like EACCES or ELOOP.)
+            return 0;
         }
-        return lengthImpl(absolutePath);
     }
 
-    private static native long lengthImpl(String path);
-
     /**
      * Returns an array of strings with the file names in the directory
      * represented by this file. The result is {@code null} if this file is not
@@ -884,21 +744,9 @@
      * directory are not returned as part of the list.
      *
      * @return an array of strings with file names or {@code null}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
-     * @see #isDirectory
-     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
      */
     public String[] list() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(path);
-        }
-        if (path.isEmpty()) {
-            return null;
-        }
-        return listImpl(absolutePath);
+        return listImpl(path);
     }
 
     private static native String[] listImpl(String path);
@@ -916,12 +764,6 @@
      * @param filter
      *            the filter to match names against, may be {@code null}.
      * @return an array of files or {@code null}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
-     * @see #getPath
-     * @see #isDirectory
-     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
      */
     public String[] list(FilenameFilter filter) {
         String[] filenames = list();
@@ -944,11 +786,6 @@
      * absolute, they are relative otherwise.
      *
      * @return an array of files or {@code null}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
-     * @see #list
-     * @see #isDirectory
      */
     public File[] listFiles() {
         return filenamesToFiles(list());
@@ -967,13 +804,6 @@
      * @param filter
      *            the filter to match names against, may be {@code null}.
      * @return an array of files or {@code null}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
-     * @see #list(FilenameFilter filter)
-     * @see #getPath
-     * @see #isDirectory
-     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
      */
     public File[] listFiles(FilenameFilter filter) {
         return filenamesToFiles(list(filter));
@@ -991,12 +821,6 @@
      * @param filter
      *            the filter to match names against, may be {@code null}.
      * @return an array of files or {@code null}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies read
-     *             access to this file.
-     * @see #getPath
-     * @see #isDirectory
-     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
      */
     public File[] listFiles(FileFilter filter) {
         File[] files = listFiles();
@@ -1039,21 +863,18 @@
      *
      * @return {@code true} if the directory has been created, {@code false}
      *         otherwise.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies write
-     *             access for this file.
      * @see #mkdirs
      */
     public boolean mkdir() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
+        try {
+            // On Android, we don't want default permissions to allow global access.
+            Libcore.os.mkdir(path, S_IRWXU);
+            return true;
+        } catch (ErrnoException errnoException) {
+            return false;
         }
-        return mkdirImpl(absolutePath);
     }
 
-    private static native boolean mkdirImpl(String path);
-
     /**
      * Creates the directory named by the trailing filename of this file,
      * including the complete directory path required to create this directory.
@@ -1064,9 +885,6 @@
      * @return {@code true} if the necessary directories have been created,
      *         {@code false} if the target directory already exists or one of
      *         the directories can not be created.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies write
-     *             access for this file.
      * @see #mkdir
      */
     public boolean mkdirs() {
@@ -1092,31 +910,39 @@
 
     /**
      * Creates a new, empty file on the file system according to the path
-     * information stored in this file.
+     * information stored in this file. This method returns true if it creates
+     * a file, false if the file already existed. Note that it returns false
+     * even if the file is not a file (because it's a directory, say).
      *
-     * <p>Note that this method does <i>not</i> throw {@code IOException} on failure.
-     * Callers must check the return value.
+     * <p>This method is not generally useful. For creating temporary files,
+     * use {@link #createTempFile} instead. For reading/writing files, use {@link FileInputStream},
+     * {@link FileOutputStream}, or {@link RandomAccessFile}, all of which can create files.
      *
-     * @return {@code true} if the file has been created, {@code false} if it
+     * <p>Note that this method does <i>not</i> throw {@code IOException} if the file
+     * already exists, even if it's not a regular file. Callers should always check the
+     * return value, and may additionally want to call {@link #isFile}.
+     *
+     * @return true if the file has been created, false if it
      *         already exists.
      * @throws IOException if it's not possible to create the file.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies write
-     *             access for this file.
      */
     public boolean createNewFile() throws IOException {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
+        FileDescriptor fd = null;
+        try {
+            // On Android, we don't want default permissions to allow global access.
+            fd = Libcore.os.open(path, O_RDWR | O_CREAT | O_EXCL, 0600);
+            return true;
+        } catch (ErrnoException errnoException) {
+            if (errnoException.errno == EEXIST) {
+                // The file already exists.
+                return false;
+            }
+            throw errnoException.rethrowAsIOException();
+        } finally {
+            IoUtils.close(fd); // TODO: should we suppress IOExceptions thrown here?
         }
-        if (path.isEmpty()) {
-            throw new IOException("No such file or directory");
-        }
-        return createNewFileImpl(absolutePath);
     }
 
-    private static native boolean createNewFileImpl(String path);
-
     /**
      * Creates an empty temporary file using the given prefix and suffix as part
      * of the file name. If {@code suffix} is null, {@code .tmp} is used. This
@@ -1140,7 +966,8 @@
      * Creates an empty temporary file in the given directory using the given
      * prefix and suffix as part of the file name. If {@code suffix} is null, {@code .tmp} is used.
      *
-     * <p>Note that this method does <i>not</i> call {@link #deleteOnExit}.
+     * <p>Note that this method does <i>not</i> call {@link #deleteOnExit}, but see the
+     * documentation for that method before you call it manually.
      *
      * @param prefix
      *            the prefix to the temp file name.
@@ -1158,9 +985,8 @@
      * @throws IOException
      *             if an error occurs when writing the file.
      */
-    @SuppressWarnings("nls")
-    public static File createTempFile(String prefix, String suffix,
-            File directory) throws IOException {
+    public static File createTempFile(String prefix, String suffix, File directory)
+            throws IOException {
         // Force a prefix null check first
         if (prefix.length() < 3) {
             throw new IllegalArgumentException("prefix must be at least 3 characters");
@@ -1170,13 +996,12 @@
         }
         File tmpDirFile = directory;
         if (tmpDirFile == null) {
-            String tmpDir = AccessController.doPrivileged(
-                new PriviAction<String>("java.io.tmpdir", "."));
+            String tmpDir = System.getProperty("java.io.tmpdir", ".");
             tmpDirFile = new File(tmpDir);
         }
         File result;
         do {
-            result = new File(tmpDirFile, prefix + new Random().nextInt() + suffix);
+            result = new File(tmpDirFile, prefix + tempFileRandom.nextInt() + suffix);
         } while (!result.createNewFile());
         return result;
     }
@@ -1199,24 +1024,16 @@
      *
      * @param newPath the new path.
      * @return true on success.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies write
-     *             access for this file or {@code newPath}.
      */
     public boolean renameTo(File newPath) {
-        if (path.isEmpty() || newPath.path.isEmpty()) {
+        try {
+            Libcore.os.rename(path, newPath.path);
+            return true;
+        } catch (ErrnoException errnoException) {
             return false;
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkWrite(path);
-            security.checkWrite(newPath.path);
-        }
-        return renameToImpl(absolutePath, newPath.absolutePath);
     }
 
-    private static native boolean renameToImpl(String oldPath, String newPath);
-
     /**
      * Returns a string containing a concise, human-readable description of this
      * file.
@@ -1235,15 +1052,12 @@
      *
      * @return an URI for this file.
      */
-    @SuppressWarnings("nls")
     public URI toURI() {
         String name = getAbsoluteName();
         try {
             if (!name.startsWith("/")) {
                 // start with sep.
-                return new URI("file", null, new StringBuilder(
-                        name.length() + 1).append('/').append(name).toString(),
-                        null, null);
+                return new URI("file", null, "/" + name, null, null);
             } else if (name.startsWith("//")) {
                 return new URI("file", "", name, null); // UNC path
             }
@@ -1266,27 +1080,24 @@
      * correct escaping of illegal characters.
      */
     @Deprecated
-    @SuppressWarnings("nls")
     public URL toURL() throws java.net.MalformedURLException {
         String name = getAbsoluteName();
         if (!name.startsWith("/")) {
             // start with sep.
-            return new URL("file", "", -1,
-                    new StringBuilder(name.length() + 1).append('/').append(name).toString(), null);
+            return new URL("file", "", -1, "/" + name, null);
         } else if (name.startsWith("//")) {
             return new URL("file:" + name); // UNC path
         }
         return new URL("file", "", -1, name, null);
     }
 
+    // TODO: is this really necessary, or can it be replaced with getAbsolutePath?
     private String getAbsoluteName() {
         File f = getAbsoluteFile();
         String name = f.getPath();
-
         if (f.isDirectory() && name.charAt(name.length() - 1) != separatorChar) {
             // Directories must end with a slash
-            name = new StringBuilder(name.length() + 1).append(name)
-                    .append('/').toString();
+            name = name + "/";
         }
         if (separatorChar != '/') { // Must convert slashes.
             name = name.replace(separatorChar, '/');
@@ -1302,7 +1113,7 @@
     private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
         stream.defaultReadObject();
         char inSeparator = stream.readChar();
-        init(path.replace(inSeparator, separatorChar));
+        this.path = fixSlashes(path.replace(inSeparator, separatorChar));
     }
 
     /**
@@ -1312,13 +1123,13 @@
      * @since 1.6
      */
     public long getTotalSpace() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkPermission(new RuntimePermission("getFileSystemAttributes"));
+        try {
+            StructStatFs sb = Libcore.os.statfs(path);
+            return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes.
+        } catch (ErrnoException errnoException) {
+            return 0;
         }
-        return getTotalSpaceImpl(absolutePath);
     }
-    private static native long getTotalSpaceImpl(String path);
 
     /**
      * Returns the number of usable free bytes on the partition containing this path.
@@ -1334,13 +1145,13 @@
      * @since 1.6
      */
     public long getUsableSpace() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkPermission(new RuntimePermission("getFileSystemAttributes"));
+        try {
+            StructStatFs sb = Libcore.os.statfs(path);
+            return sb.f_bavail * sb.f_bsize; // non-root free block count * block size in bytes.
+        } catch (ErrnoException errnoException) {
+            return 0;
         }
-        return getUsableSpaceImpl(absolutePath);
     }
-    private static native long getUsableSpaceImpl(String path);
 
     /**
      * Returns the number of free bytes on the partition containing this path.
@@ -1352,11 +1163,11 @@
      * @since 1.6
      */
     public long getFreeSpace() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkPermission(new RuntimePermission("getFileSystemAttributes"));
+        try {
+            StructStatFs sb = Libcore.os.statfs(path);
+            return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes.
+        } catch (ErrnoException errnoException) {
+            return 0;
         }
-        return getFreeSpaceImpl(absolutePath);
     }
-    private static native long getFreeSpaceImpl(String path);
 }
diff --git a/luni/src/main/java/java/io/FileDescriptor.java b/luni/src/main/java/java/io/FileDescriptor.java
index cfda96f..96a8c14 100644
--- a/luni/src/main/java/java/io/FileDescriptor.java
+++ b/luni/src/main/java/java/io/FileDescriptor.java
@@ -17,87 +17,67 @@
 
 package java.io;
 
+import libcore.io.ErrnoException;
+import libcore.io.Libcore;
+import static libcore.io.OsConstants.*;
+
 /**
- * The lowest-level representation of a file, device, or
- * socket. If is often used for wrapping an operating system "handle". Some
- * I/O classes can be queried for the FileDescriptor they are operating on, and
- * this descriptor can subsequently be used during the instantiation of another
- * I/O class, so that the new object will reuse it.
- * <p>
- * The FileDescriptor class also contains static fields representing the
- * system's standard input, output and error streams. These can be used directly
- * if desired, but it is recommended to go through System.in, System.out, and
- * System.err streams respectively.
- * <p>
- * Applications should not create new FileDescriptors.
- *
- * @see FileInputStream#getFD()
- * @see FileOutputStream#getFD()
- * @see RandomAccessFile#getFD()
+ * Wraps a Unix file descriptor. It's possible to get the file descriptor used by some
+ * classes (such as {@link FileInputStream}, {@link FileOutputStream},
+ * and {@link RandomAccessFile}), and then create new streams that point to the same
+ * file descriptor.
  */
 public final class FileDescriptor {
 
     /**
-     * The FileDescriptor representing standard input.
+     * Corresponds to {@code stdin}.
      */
     public static final FileDescriptor in = new FileDescriptor();
 
     /**
-     * FileDescriptor representing standard out.
+     * Corresponds to {@code stdout}.
      */
     public static final FileDescriptor out = new FileDescriptor();
 
     /**
-     * FileDescriptor representing standard error.
+     * Corresponds to {@code stderr}.
      */
     public static final FileDescriptor err = new FileDescriptor();
 
-    // BEGIN android-changed
-    // file descriptors are only int on android
     /**
-     * Represents a link to any underlying OS resources for this FileDescriptor.
+     * The Unix file descriptor backing this FileDescriptor.
      * A value of -1 indicates that this FileDescriptor is invalid.
      */
-    int descriptor = -1;
-    // END android-changed
-
-    boolean readOnly = false;
+    private int descriptor = -1;
 
     static {
-        in.descriptor = 0;
-        out.descriptor = 1;
-        err.descriptor = 2;
+        in.descriptor = STDIN_FILENO;
+        out.descriptor = STDOUT_FILENO;
+        err.descriptor = STDERR_FILENO;
     }
 
     /**
-     * Constructs a new FileDescriptor containing an invalid handle. The
-     * contained handle is usually modified by native code at a later point.
+     * Constructs a new invalid FileDescriptor.
      */
     public FileDescriptor() {
-        super();
     }
 
     /**
      * Ensures that data which is buffered within the underlying implementation
      * is written out to the appropriate device before returning.
-     *
-     * @throws SyncFailedException
-     *             when the operation fails.
      */
     public void sync() throws SyncFailedException {
-        // if the descriptor is a read-only one, do nothing
-        if (!readOnly) {
-            syncImpl();
+        try {
+            Libcore.os.fsync(this);
+        } catch (ErrnoException errnoException) {
+            SyncFailedException sfe = new SyncFailedException(errnoException.getMessage());
+            sfe.initCause(errnoException);
+            throw sfe;
         }
     }
 
-    private native void syncImpl() throws SyncFailedException;
-
     /**
-     * Indicates whether this FileDescriptor is valid.
-     *
-     * @return {@code true} if this FileDescriptor is valid, {@code false}
-     *         otherwise.
+     * Tests whether this {@code FileDescriptor} is valid.
      */
     public boolean valid() {
         return descriptor != -1;
diff --git a/luni/src/main/java/java/io/FileFilter.java b/luni/src/main/java/java/io/FileFilter.java
index 5638dd9..da36fa8 100644
--- a/luni/src/main/java/java/io/FileFilter.java
+++ b/luni/src/main/java/java/io/FileFilter.java
@@ -15,10 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// the abstract modifier of the interface was removed.
-// END android-note
-
 package java.io;
 
 /**
diff --git a/luni/src/main/java/java/io/FileInputStream.java b/luni/src/main/java/java/io/FileInputStream.java
index 7cdc235..5b26792 100644
--- a/luni/src/main/java/java/io/FileInputStream.java
+++ b/luni/src/main/java/java/io/FileInputStream.java
@@ -22,10 +22,11 @@
 import java.nio.NioUtils;
 import java.nio.channels.FileChannel;
 import java.util.Arrays;
-
+import libcore.io.ErrnoException;
 import libcore.io.IoUtils;
-import org.apache.harmony.luni.platform.IFileSystem;
-import org.apache.harmony.luni.platform.Platform;
+import libcore.io.Libcore;
+import libcore.io.Streams;
+import static libcore.io.OsConstants.*;
 
 /**
  * An input stream that reads bytes from a file.
@@ -55,13 +56,12 @@
 
     private final FileDescriptor fd;
 
+    /** The same as 'fd' if we own the file descriptor, null otherwise. */
+    private final FileDescriptor ownedFd;
+
     /** The unique file channel. Lazily initialized because it's rarely needed. */
     private FileChannel channel;
 
-    private final boolean shouldCloseFd;
-
-    private final Object repositioningLock = new Object();
-
     private final CloseGuard guard = CloseGuard.get();
 
     /**
@@ -71,22 +71,13 @@
      *            the file from which this stream reads.
      * @throws FileNotFoundException
      *             if {@code file} does not exist.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies the
-     *             read request.
      */
     public FileInputStream(File file) throws FileNotFoundException {
         if (file == null) {
             throw new NullPointerException("file == null");
         }
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkRead(file.getPath());
-        }
-        fd = new FileDescriptor();
-        fd.readOnly = true;
-        fd.descriptor = Platform.FILE_SYSTEM.open(file.getAbsolutePath(), IFileSystem.O_RDONLY);
-        shouldCloseFd = true;
+        this.fd = IoUtils.open(file.getAbsolutePath(), O_RDONLY);
+        this.ownedFd = fd;
         guard.open("close");
     }
 
@@ -97,20 +88,13 @@
      *            the FileDescriptor from which this stream reads.
      * @throws NullPointerException
      *             if {@code fd} is {@code null}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies the
-     *             read request.
      */
     public FileInputStream(FileDescriptor fd) {
         if (fd == null) {
             throw new NullPointerException("fd == null");
         }
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkRead(fd);
-        }
         this.fd = fd;
-        this.shouldCloseFd = false;
+        this.ownedFd = null;
         // Note that we do not call guard.open here because the
         // FileDescriptor is not owned by the stream.
     }
@@ -124,8 +108,7 @@
 
     @Override
     public int available() throws IOException {
-        checkOpen();
-        return Platform.FILE_SYSTEM.ioctlAvailable(fd);
+        return IoUtils.available(fd);
     }
 
     @Override
@@ -135,9 +118,7 @@
             if (channel != null) {
                 channel.close();
             }
-            if (shouldCloseFd && fd.valid()) {
-                IoUtils.close(fd);
-            }
+            IoUtils.close(ownedFd);
         }
     }
 
@@ -172,7 +153,7 @@
     public FileChannel getChannel() {
         synchronized (this) {
             if (channel == null) {
-                channel = NioUtils.newFileChannel(this, fd.descriptor, IFileSystem.O_RDONLY);
+                channel = NioUtils.newFileChannel(this, fd, O_RDONLY);
             }
             return channel;
         }
@@ -185,56 +166,33 @@
         return fd;
     }
 
-    @Override
-    public int read() throws IOException {
-        byte[] buffer = new byte[1];
-        int result = read(buffer, 0, 1);
-        return result == -1 ? -1 : buffer[0] & 0xff;
+    @Override public int read() throws IOException {
+        return Streams.readSingleByte(this);
     }
 
-    @Override
-    public int read(byte[] buffer) throws IOException {
-        return read(buffer, 0, buffer.length);
-    }
-
-    @Override
-    public int read(byte[] buffer, int offset, int byteCount) throws IOException {
-        Arrays.checkOffsetAndCount(buffer.length, offset, byteCount);
-        if (byteCount == 0) {
-            return 0;
-        }
-        checkOpen();
-        synchronized (repositioningLock) {
-            return (int) Platform.FILE_SYSTEM.read(fd.descriptor, buffer, offset, byteCount);
-        }
+    @Override public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {
+        return IoUtils.read(fd, buffer, byteOffset, byteCount);
     }
 
     @Override
     public long skip(long byteCount) throws IOException {
-        checkOpen();
-
         if (byteCount == 0) {
             return 0;
         }
         if (byteCount < 0) {
             throw new IOException("byteCount < 0: " + byteCount);
         }
-
         try {
-            synchronized (repositioningLock) {
-                // Our seek returns the new offset, but we know it will throw an
-                // exception if it couldn't perform exactly the seek we asked for.
-                Platform.FILE_SYSTEM.seek(fd.descriptor, byteCount, IFileSystem.SEEK_CUR);
-                return byteCount;
+            // Try lseek(2). That returns the new offset, but we'll throw an
+            // exception if it couldn't perform exactly the seek we asked for.
+            Libcore.os.lseek(fd, byteCount, SEEK_CUR);
+            return byteCount;
+        } catch (ErrnoException errnoException) {
+            if (errnoException.errno == ESPIPE) {
+                // You can't seek on a pipe, so fall back to the superclass' implementation.
+                return super.skip(byteCount);
             }
-        } catch (IFileSystem.SeekPipeException e) {
-            return super.skip(byteCount);
-        }
-    }
-
-    private synchronized void checkOpen() throws IOException {
-        if (!fd.valid()) {
-            throw new IOException("stream is closed");
+            throw errnoException.rethrowAsIOException();
         }
     }
 }
diff --git a/luni/src/main/java/java/io/FileNotFoundException.java b/luni/src/main/java/java/io/FileNotFoundException.java
index 970e972..a71af6e 100644
--- a/luni/src/main/java/java/io/FileNotFoundException.java
+++ b/luni/src/main/java/java/io/FileNotFoundException.java
@@ -29,7 +29,6 @@
      * filled in.
      */
     public FileNotFoundException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/FileOutputStream.java b/luni/src/main/java/java/io/FileOutputStream.java
index 0c73d0b..0fd3c21 100644
--- a/luni/src/main/java/java/io/FileOutputStream.java
+++ b/luni/src/main/java/java/io/FileOutputStream.java
@@ -22,8 +22,7 @@
 import java.nio.channels.FileChannel;
 import java.util.Arrays;
 import libcore.io.IoUtils;
-import org.apache.harmony.luni.platform.IFileSystem;
-import org.apache.harmony.luni.platform.Platform;
+import static libcore.io.OsConstants.*;
 
 /**
  * An output stream that writes bytes to a file. If the output file exists, it
@@ -54,7 +53,8 @@
 
     private final FileDescriptor fd;
 
-    private final boolean shouldCloseFd;
+    /** The same as 'fd' if we own the file descriptor, null otherwise. */
+    private final FileDescriptor ownedFd;
 
     /** The unique file channel. Lazily initialized because it's rarely needed. */
     private FileChannel channel;
@@ -69,9 +69,6 @@
      *
      * @param file the file to which this stream writes.
      * @throws FileNotFoundException if file cannot be opened for writing.
-     * @throws SecurityException if a {@code SecurityManager} is installed and
-     *     it denies the write request.
-     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
      */
     public FileOutputStream(File file) throws FileNotFoundException {
         this(file, false);
@@ -85,21 +82,14 @@
      * @param file the file to which this stream writes.
      * @param append true to append to an existing file.
      * @throws FileNotFoundException if the file cannot be opened for writing.
-     * @throws SecurityException if a {@code SecurityManager} is installed and
-     *     it denies the write request.
-     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
-     * @see java.lang.SecurityManager#checkWrite(String)
      */
-    public FileOutputStream(File file, boolean append)
-            throws FileNotFoundException {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkWrite(file.getPath());
+    public FileOutputStream(File file, boolean append) throws FileNotFoundException {
+        if (file == null) {
+            throw new NullPointerException("file == null");
         }
-        this.fd = new FileDescriptor();
-        this.mode = append ? IFileSystem.O_APPEND : IFileSystem.O_WRONLY;
-        this.fd.descriptor = Platform.FILE_SYSTEM.open(file.getAbsolutePath(), mode);
-        this.shouldCloseFd = true;
+        this.mode = O_WRONLY | O_CREAT | (append ? O_APPEND : O_TRUNC);
+        this.fd = IoUtils.open(file.getAbsolutePath(), mode);
+        this.ownedFd = fd;
         this.guard.open("close");
     }
 
@@ -108,22 +98,15 @@
      *
      * @param fd the FileDescriptor to which this stream writes.
      * @throws NullPointerException if {@code fd} is null.
-     * @throws SecurityException if a {@code SecurityManager} is installed and
-     *     it denies the write request.
-     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
      */
     public FileOutputStream(FileDescriptor fd) {
         if (fd == null) {
-            throw new NullPointerException();
-        }
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkWrite(fd);
+            throw new NullPointerException("fd == null");
         }
         this.fd = fd;
-        this.shouldCloseFd = false;
-        this.channel = NioUtils.newFileChannel(this, fd.descriptor, IFileSystem.O_WRONLY);
-        this.mode = IFileSystem.O_WRONLY;
+        this.ownedFd = null;
+        this.mode = O_WRONLY;
+        this.channel = NioUtils.newFileChannel(this, fd, mode);
         // Note that we do not call guard.open here because the
         // FileDescriptor is not owned by the stream.
     }
@@ -149,19 +132,10 @@
             if (channel != null) {
                 channel.close();
             }
-            if (shouldCloseFd && fd.valid()) {
-                IoUtils.close(fd);
-            }
+            IoUtils.close(fd);
         }
     }
 
-    /**
-     * Frees any resources allocated for this stream before it is garbage
-     * collected. This method is called from the Java Virtual Machine.
-     *
-     * @throws IOException
-     *             if an error occurs attempting to finalize this stream.
-     */
     @Override protected void finalize() throws IOException {
         try {
             if (guard != null) {
@@ -186,7 +160,7 @@
     public FileChannel getChannel() {
         synchronized (this) {
             if (channel == null) {
-                channel = NioUtils.newFileChannel(this, fd.descriptor, mode);
+                channel = NioUtils.newFileChannel(this, fd, mode);
             }
             return channel;
         }
@@ -200,30 +174,12 @@
     }
 
     @Override
-    public void write(byte[] buffer) throws IOException {
-        write(buffer, 0, buffer.length);
-    }
-
-    @Override
-    public void write(byte[] buffer, int offset, int byteCount) throws IOException {
-        Arrays.checkOffsetAndCount(buffer.length, offset, byteCount);
-        if (byteCount == 0) {
-            return;
-        }
-        checkOpen();
-        Platform.FILE_SYSTEM.write(fd.descriptor, buffer, offset, byteCount);
+    public void write(byte[] buffer, int byteOffset, int byteCount) throws IOException {
+        IoUtils.write(fd, buffer, byteOffset, byteCount);
     }
 
     @Override
     public void write(int oneByte) throws IOException {
-        checkOpen();
-        byte[] buffer = { (byte) oneByte };
-        Platform.FILE_SYSTEM.write(fd.descriptor, buffer, 0, 1);
-    }
-
-    private synchronized void checkOpen() throws IOException {
-        if (!fd.valid()) {
-            throw new IOException("stream is closed");
-        }
+        write(new byte[] { (byte) oneByte }, 0, 1);
     }
 }
diff --git a/luni/src/main/java/java/io/FilePermission.java b/luni/src/main/java/java/io/FilePermission.java
index 7eb4300..94263f1 100644
--- a/luni/src/main/java/java/io/FilePermission.java
+++ b/luni/src/main/java/java/io/FilePermission.java
@@ -17,10 +17,10 @@
 
 package java.io;
 
-import java.security.AccessController;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.PrivilegedAction;
+import java.util.Locale;
 import libcore.util.Objects;
 
 /**
@@ -102,16 +102,11 @@
         if (path.equals("<<ALL FILES>>")) {
             includeAll = true;
         } else {
-            canonPath = AccessController
-                    .doPrivileged(new PrivilegedAction<String>() {
-                        public String run() {
-                            try {
-                                return new File(path).getCanonicalPath();
-                            } catch (IOException e) {
-                                return path;
-                            }
-                        }
-                    });
+            canonPath = path;
+            try {
+                canonPath = new File(path).getCanonicalPath();
+            } catch (IOException e) {
+            }
             if (path.equals("*") || path.endsWith(File.separator + "*")) {
                 allDir = true;
             }
@@ -131,7 +126,7 @@
      * @return the string representing this permission's actions
      */
     private String toCanonicalActionString(String action) {
-        actions = action.trim().toLowerCase();
+        actions = action.trim().toLowerCase(Locale.US);
 
         // get the numerical representation of the action list
         mask = getMask(actions);
diff --git a/luni/src/main/java/java/io/FilePermissionCollection.java b/luni/src/main/java/java/io/FilePermissionCollection.java
index fb36855..9db656b 100644
--- a/luni/src/main/java/java/io/FilePermissionCollection.java
+++ b/luni/src/main/java/java/io/FilePermissionCollection.java
@@ -37,7 +37,6 @@
      * Construct a new FilePermissionCollection
      */
     public FilePermissionCollection() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/FilterInputStream.java b/luni/src/main/java/java/io/FilterInputStream.java
index a6f6852..2bf13e2 100644
--- a/luni/src/main/java/java/io/FilterInputStream.java
+++ b/luni/src/main/java/java/io/FilterInputStream.java
@@ -45,7 +45,6 @@
      * @param in the input stream to filter reads on.
      */
     protected FilterInputStream(InputStream in) {
-        super();
         this.in = in;
     }
 
@@ -116,24 +115,6 @@
     }
 
     /**
-     * Reads bytes from this stream and stores them in the byte array
-     * {@code buffer}. Returns the number of bytes actually read or -1 if no
-     * bytes were read and the end of this stream was encountered. This
-     * implementation reads bytes from the filtered stream.
-     *
-     * @param buffer
-     *            the byte array in which to store the read bytes.
-     * @return the number of bytes actually read or -1 if the end of the
-     *         filtered stream has been reached while reading.
-     * @throws IOException
-     *             if this stream is closed or another IOException occurs.
-     */
-    @Override
-    public int read(byte[] buffer) throws IOException {
-        return read(buffer, 0, buffer.length);
-    }
-
-    /**
      * Reads at most {@code count} bytes from this stream and stores them in the
      * byte array {@code buffer} starting at {@code offset}. Returns the number
      * of bytes actually read or -1 if no bytes have been read and the end of
diff --git a/luni/src/main/java/java/io/FilterOutputStream.java b/luni/src/main/java/java/io/FilterOutputStream.java
index 24adf87f..d5e5e76 100644
--- a/luni/src/main/java/java/io/FilterOutputStream.java
+++ b/luni/src/main/java/java/io/FilterOutputStream.java
@@ -18,7 +18,7 @@
 package java.io;
 
 import java.util.Arrays;
-import org.apache.harmony.luni.util.SneakyThrow;
+import libcore.util.SneakyThrow;
 
 /**
  * Wraps an existing {@link OutputStream} and performs some transformation on
@@ -89,24 +89,6 @@
     }
 
     /**
-     * Writes the entire contents of the byte array {@code buffer} to this
-     * stream. This implementation writes the {@code buffer} to the target
-     * stream.
-     *
-     * @param buffer
-     *            the buffer to be written.
-     * @throws IOException
-     *             if an I/O error occurs while writing to this stream.
-     */
-    @Override
-    public void write(byte[] buffer) throws IOException {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
-        write(buffer, 0, buffer.length);
-    }
-
-    /**
      * Writes {@code count} bytes from the byte array {@code buffer} starting at
      * {@code offset} to the target stream.
      *
diff --git a/luni/src/main/java/java/io/FilterWriter.java b/luni/src/main/java/java/io/FilterWriter.java
index cd48f64..820fe4f 100644
--- a/luni/src/main/java/java/io/FilterWriter.java
+++ b/luni/src/main/java/java/io/FilterWriter.java
@@ -88,9 +88,6 @@
      */
     @Override
     public void write(char[] buffer, int offset, int count) throws IOException {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         synchronized (lock) {
             out.write(buffer, offset, count);
         }
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/HistoricalNamesUtil.java b/luni/src/main/java/java/io/HistoricalCharsetNames.java
similarity index 92%
rename from luni/src/main/java/org/apache/harmony/luni/util/HistoricalNamesUtil.java
rename to luni/src/main/java/java/io/HistoricalCharsetNames.java
index 4da1f8e..b0d5498 100644
--- a/luni/src/main/java/org/apache/harmony/luni/util/HistoricalNamesUtil.java
+++ b/luni/src/main/java/java/io/HistoricalCharsetNames.java
@@ -14,13 +14,17 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.harmony.luni.util;
+package java.io;
 
+import java.nio.charset.Charset;
 import java.util.HashMap;
 
-public class HistoricalNamesUtil {
-    private static HashMap<String, String> historicalNames = new HashMap<String, String>();
-
+/**
+ * This could have been in Charset or Charsets, but all code uses those classes whereas no code
+ * should need to use this, so let's not make good code pay to initialize this map.
+ */
+class HistoricalCharsetNames {
+    private static final HashMap<String, String> historicalNames = new HashMap<String, String>();
     static {
         historicalNames.put("Big5-HKSCS", "Big5_HKSCS");
         historicalNames.put("EUC-JP", "EUC_JP");
@@ -163,8 +167,9 @@
         historicalNames.put("x-windows-950", "MS950");
     }
 
-    public static String getHistoricalName(String name) {
-        String result = historicalNames.get(name);
-        return (result != null) ? result : name;
+    public static String get(Charset charset) {
+        String modernName = charset.name();
+        String result = historicalNames.get(modernName);
+        return (result != null) ? result : modernName;
     }
 }
diff --git a/luni/src/main/java/java/io/IOException.java b/luni/src/main/java/java/io/IOException.java
index f8ea130..ceb4d49 100644
--- a/luni/src/main/java/java/io/IOException.java
+++ b/luni/src/main/java/java/io/IOException.java
@@ -31,7 +31,6 @@
      * Constructs a new {@code IOException} with its stack trace filled in.
      */
     public IOException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/InputStream.java b/luni/src/main/java/java/io/InputStream.java
index c01ede7..a363146 100644
--- a/luni/src/main/java/java/io/InputStream.java
+++ b/luni/src/main/java/java/io/InputStream.java
@@ -142,20 +142,10 @@
     public abstract int read() throws IOException;
 
     /**
-     * Reads bytes from this stream and stores them in the byte array {@code b}.
-     *
-     * @param b
-     *            the byte array in which to store the bytes read.
-     * @return the number of bytes actually read or -1 if the end of the stream
-     *         has been reached.
-     * @throws IOException
-     *             if this stream is closed or another IOException occurs.
+     * Equivalent to {@code read(buffer, 0, buffer.length)}.
      */
-    public int read(byte[] b) throws IOException {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
-        return read(b, 0, b.length);
+    public int read(byte[] buffer) throws IOException {
+        return read(buffer, 0, buffer.length);
     }
 
     /**
diff --git a/luni/src/main/java/java/io/InputStreamReader.java b/luni/src/main/java/java/io/InputStreamReader.java
index 28091e3..59be9ed 100644
--- a/luni/src/main/java/java/io/InputStreamReader.java
+++ b/luni/src/main/java/java/io/InputStreamReader.java
@@ -26,7 +26,6 @@
 import java.nio.charset.MalformedInputException;
 import java.nio.charset.UnmappableCharacterException;
 import java.util.Arrays;
-import org.apache.harmony.luni.util.HistoricalNamesUtil;
 
 /**
  * A class for turning a byte stream into a character stream. Data read from the
@@ -138,11 +137,9 @@
     @Override
     public void close() throws IOException {
         synchronized (lock) {
-            // BEGIN android-added
             if (decoder != null) {
                 decoder.reset();
             }
-            // END android-added
             decoder = null;
             if (in != null) {
                 in.close();
@@ -152,17 +149,16 @@
     }
 
     /**
-     * Returns the name of the encoding used to convert bytes into characters.
-     * The value {@code null} is returned if this reader has been closed.
-     *
-     * @return the name of the character converter or {@code null} if this
-     *         reader is closed.
+     * Returns the historical name of the encoding used by this writer to convert characters to
+     * bytes, or null if this writer has been closed. Most callers should probably keep
+     * track of the String or Charset they passed in; this method may not return the same
+     * name.
      */
     public String getEncoding() {
         if (!isOpen()) {
             return null;
         }
-        return HistoricalNamesUtil.getHistoricalName(decoder.charset().name());
+        return HistoricalCharsetNames.get(decoder.charset());
     }
 
     /**
@@ -243,17 +239,17 @@
                         // available didn't work so just try the read
                     }
 
-                    int to_read = bytes.capacity() - bytes.limit();
+                    int desiredByteCount = bytes.capacity() - bytes.limit();
                     int off = bytes.arrayOffset() + bytes.limit();
-                    int was_red = in.read(bytes.array(), off, to_read);
+                    int actualByteCount = in.read(bytes.array(), off, desiredByteCount);
 
-                    if (was_red == -1) {
+                    if (actualByteCount == -1) {
                         endOfInput = true;
                         break;
-                    } else if (was_red == 0) {
+                    } else if (actualByteCount == 0) {
                         break;
                     }
-                    bytes.limit(bytes.limit() + was_red);
+                    bytes.limit(bytes.limit() + actualByteCount);
                     needInput = false;
                 }
 
@@ -278,10 +274,8 @@
                 decoder.flush(out);
                 decoder.reset();
             }
-            if (result.isMalformed()) {
-                throw new MalformedInputException(result.length());
-            } else if (result.isUnmappable()) {
-                throw new UnmappableCharacterException(result.length());
+            if (result.isMalformed() || result.isUnmappable()) {
+                result.throwException();
             }
 
             return out.position() - offset == 0 ? -1 : out.position() - offset;
diff --git a/luni/src/main/java/java/io/InterruptedIOException.java b/luni/src/main/java/java/io/InterruptedIOException.java
index c5dabb1..8d79ba5 100644
--- a/luni/src/main/java/java/io/InterruptedIOException.java
+++ b/luni/src/main/java/java/io/InterruptedIOException.java
@@ -36,7 +36,6 @@
      * filled in.
      */
     public InterruptedIOException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/NotActiveException.java b/luni/src/main/java/java/io/NotActiveException.java
index 63f286c..8e6600d 100644
--- a/luni/src/main/java/java/io/NotActiveException.java
+++ b/luni/src/main/java/java/io/NotActiveException.java
@@ -39,7 +39,6 @@
      * in.
      */
     public NotActiveException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/NotSerializableException.java b/luni/src/main/java/java/io/NotSerializableException.java
index 3bbe736..442d988 100644
--- a/luni/src/main/java/java/io/NotSerializableException.java
+++ b/luni/src/main/java/java/io/NotSerializableException.java
@@ -36,7 +36,6 @@
      * filled in.
      */
     public NotSerializableException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/ObjectInputStream.java b/luni/src/main/java/java/io/ObjectInputStream.java
index 789a286..d3af278 100644
--- a/luni/src/main/java/java/io/ObjectInputStream.java
+++ b/luni/src/main/java/java/io/ObjectInputStream.java
@@ -17,11 +17,6 @@
 
 package java.io;
 
-// BEGIN android-note
-// Harmony uses ObjectAccessors to access fields through JNI. Android has not
-// yet migrated that API. As a consequence, there's a lot of changes here...
-// END android-note
-
 import dalvik.system.VMStack;
 import java.io.EmulatedFields.ObjectSlot;
 import java.lang.reflect.Array;
@@ -29,14 +24,12 @@
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
 import libcore.util.EmptyArray;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * A specialized {@link InputStream} that is able to read (deserialize) Java
@@ -50,9 +43,7 @@
  */
 public class ObjectInputStream extends InputStream implements ObjectInput, ObjectStreamConstants {
 
-    // BEGIN android-note
-    // this is non-static to avoid sync contention. Would static be faster?
-    // END android-note
+    // TODO: this is non-static to avoid sync contention. Would static be faster?
     private InputStream emptyStream = new ByteArrayInputStream(EmptyArray.BYTE);
 
     // To put into objectsRead when reading unsharedObject
@@ -123,10 +114,6 @@
         PRIMITIVE_CLASSES.put("void", void.class);
     }
 
-    // BEGIN android-removed
-    // private ObjectAccessor accessor = AccessorFactory.getObjectAccessor();
-    // END android-removed
-
     // Internal type used to keep track of validators & corresponding priority
     static class InputValidationDesc {
         ObjectInputValidation validator;
@@ -351,17 +338,8 @@
      *
      * @throws IOException
      *             if an error occurs when creating this stream.
-     * @throws SecurityException
-     *             if a security manager is installed and it denies subclassing
-     *             this class.
-     * @see SecurityManager#checkPermission(java.security.Permission)
      */
-    protected ObjectInputStream() throws IOException, SecurityException {
-        super();
-        SecurityManager currentManager = System.getSecurityManager();
-        if (currentManager != null) {
-            currentManager.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
-        }
+    protected ObjectInputStream() throws IOException {
         // WARNING - we should throw IOException if not called from a subclass
         // according to the JavaDoc. Add the test.
         this.subclassOverridingImplementation = true;
@@ -378,45 +356,10 @@
      * @throws StreamCorruptedException
      *             if the source stream does not contain serialized objects that
      *             can be read.
-     * @throws SecurityException
-     *             if a security manager is installed and it denies subclassing
-     *             this class.
      */
-    public ObjectInputStream(InputStream input)
-            throws StreamCorruptedException, IOException {
-        final Class<?> implementationClass = getClass();
-        final Class<?> thisClass = ObjectInputStream.class;
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null && implementationClass != thisClass) {
-            boolean mustCheck = AccessController
-                    .doPrivileged(new PrivilegedAction<Boolean>() {
-                        public Boolean run() {
-                            try {
-                                Method method = implementationClass.getMethod("readFields",
-                                        EmptyArray.CLASS);
-                                if (method.getDeclaringClass() != thisClass) {
-                                    return Boolean.TRUE;
-                                }
-                            } catch (NoSuchMethodException ignored) {
-                            }
-                            try {
-                                Method method = implementationClass.getMethod("readUnshared",
-                                        EmptyArray.CLASS);
-                                if (method.getDeclaringClass() != thisClass) {
-                                    return Boolean.TRUE;
-                                }
-                            } catch (NoSuchMethodException ignored) {
-                            }
-                            return Boolean.FALSE;
-                        }
-                    });
-            if (mustCheck) {
-                sm
-                        .checkPermission(ObjectStreamConstants.SUBCLASS_IMPLEMENTATION_PERMISSION);
-            }
-        }
-        this.input = (input instanceof DataInputStream) ? (DataInputStream) input
-                : new DataInputStream(input);
+    public ObjectInputStream(InputStream input) throws StreamCorruptedException, IOException {
+        this.input = (input instanceof DataInputStream)
+                ? (DataInputStream) input : new DataInputStream(input);
         primitiveTypes = new DataInputStream(this);
         enableResolve = false;
         this.subclassOverridingImplementation = false;
@@ -524,22 +467,10 @@
      *            {@code true} to enable object replacement; {@code false} to
      *            disable it.
      * @return the previous setting.
-     * @throws SecurityException
-     *             if a security manager is installed and it denies enabling
-     *             object replacement for this stream.
      * @see #resolveObject
      * @see ObjectOutputStream#enableReplaceObject
      */
-    protected boolean enableResolveObject(boolean enable)
-            throws SecurityException {
-        if (enable) {
-            // The Stream has to be trusted for this feature to be enabled.
-            // trusted means the stream's class loader has to be null
-            SecurityManager currentManager = System.getSecurityManager();
-            if (currentManager != null) {
-                currentManager.checkPermission(SUBSTITUTION_PERMISSION);
-            }
-        }
+    protected boolean enableResolveObject(boolean enable) {
         boolean originalValue = enableResolve;
         enableResolve = enable;
         return originalValue;
@@ -1090,21 +1021,21 @@
         for (ObjectSlot element : slots) {
             element.defaulted = false;
             Class<?> type = element.field.getType();
-            if (type == Integer.TYPE) {
+            if (type == int.class) {
                 element.fieldValue = input.readInt();
-            } else if (type == Byte.TYPE) {
+            } else if (type == byte.class) {
                 element.fieldValue = input.readByte();
-            } else if (type == Character.TYPE) {
+            } else if (type == char.class) {
                 element.fieldValue = input.readChar();
-            } else if (type == Short.TYPE) {
+            } else if (type == short.class) {
                 element.fieldValue = input.readShort();
-            } else if (type == Boolean.TYPE) {
+            } else if (type == boolean.class) {
                 element.fieldValue = input.readBoolean();
-            } else if (type == Long.TYPE) {
+            } else if (type == long.class) {
                 element.fieldValue = input.readLong();
-            } else if (type == Float.TYPE) {
+            } else if (type == float.class) {
                 element.fieldValue = input.readFloat();
-            } else if (type == Double.TYPE) {
+            } else if (type == double.class) {
                 element.fieldValue = input.readDouble();
             } else {
                 // Either array or Object
@@ -1162,75 +1093,62 @@
             // and do the other checking, so there's no null check on 'field' here.
             try {
                 Class<?> type = fieldDesc.getTypeInternal();
-                if (type == Byte.TYPE) {
+                if (type == byte.class) {
                     byte b = input.readByte();
                     if (field != null) {
                         field.setByte(obj, b);
                     }
-                } else if (type == Character.TYPE) {
+                } else if (type == char.class) {
                     char c = input.readChar();
                     if (field != null) {
                         field.setChar(obj, c);
                     }
-                } else if (type == Double.TYPE) {
+                } else if (type == double.class) {
                     double d = input.readDouble();
                     if (field != null) {
                         field.setDouble(obj, d);
                     }
-                } else if (type == Float.TYPE) {
+                } else if (type == float.class) {
                     float f = input.readFloat();
                     if (field != null) {
                         field.setFloat(obj, f);
                     }
-                } else if (type == Integer.TYPE) {
+                } else if (type == int.class) {
                     int i = input.readInt();
                     if (field != null) {
                         field.setInt(obj, i);
                     }
-                } else if (type == Long.TYPE) {
+                } else if (type == long.class) {
                     long j = input.readLong();
                     if (field != null) {
                         field.setLong(obj, j);
                     }
-                } else if (type == Short.TYPE) {
+                } else if (type == short.class) {
                     short s = input.readShort();
                     if (field != null) {
                         field.setShort(obj, s);
                     }
-                } else if (type == Boolean.TYPE) {
+                } else if (type == boolean.class) {
                     boolean z = input.readBoolean();
                     if (field != null) {
                         field.setBoolean(obj, z);
                     }
                 } else {
-                    String fieldName = fieldDesc.getName();
-                    boolean setBack = false;
-                    ObjectStreamField localFieldDesc = classDesc.getField(fieldName);
-                    if (mustResolve && fieldDesc == null) {
-                        setBack = true;
-                        mustResolve = false;
-                    }
-                    boolean unshared = fieldDesc != null && fieldDesc.isUnshared();
-                    Object toSet = unshared ? readUnshared() : readObject();
-                    if (setBack) {
-                        mustResolve = true;
-                    }
-                    if (fieldDesc != null) {
-                        if (toSet != null) {
-                            // BEGIN android-changed
-                            // Get the field type from the local field rather than
-                            // from the stream's supplied data. That's the field
-                            // we'll be setting, so that's the one that needs to be
-                            // validated.
-                            Class<?> fieldType = localFieldDesc.getTypeInternal();
-                            // END android-added
-                            Class<?> valueType = toSet.getClass();
-                            if (!fieldType.isAssignableFrom(valueType)) {
-                                throw new ClassCastException(classDesc.getName() + "." + fieldName + " - " + fieldType + " not compatible with " + valueType);
-                            }
-                            if (field != null) {
-                                field.set(obj, toSet);
-                            }
+                    Object toSet = fieldDesc.isUnshared() ? readUnshared() : readObject();
+                    if (toSet != null) {
+                        // Get the field type from the local field rather than
+                        // from the stream's supplied data. That's the field
+                        // we'll be setting, so that's the one that needs to be
+                        // validated.
+                        String fieldName = fieldDesc.getName();
+                        ObjectStreamField localFieldDesc = classDesc.getField(fieldName);
+                        Class<?> fieldType = localFieldDesc.getTypeInternal();
+                        Class<?> valueType = toSet.getClass();
+                        if (!fieldType.isAssignableFrom(valueType)) {
+                            throw new ClassCastException(classDesc.getName() + "." + fieldName + " - " + fieldType + " not compatible with " + valueType);
+                        }
+                        if (field != null) {
+                            field.set(obj, toSet);
                         }
                     }
                 }
@@ -1431,8 +1349,7 @@
         try {
             if (readMethod != null) {
                 // We have to be able to fetch its value, even if it is private
-                AccessController.doPrivileged(new PriviAction<Object>(
-                        readMethod));
+                readMethod.setAccessible(true);
                 try {
                     readMethod.invoke(object, this);
                 } catch (InvocationTargetException e) {
@@ -1543,40 +1460,40 @@
         // the array first, and also call different methods depending on the
         // elements.
         if (componentType.isPrimitive()) {
-            if (componentType == Integer.TYPE) {
+            if (componentType == int.class) {
                 int[] intArray = (int[]) result;
                 for (int i = 0; i < size; i++) {
                     intArray[i] = input.readInt();
                 }
-            } else if (componentType == Byte.TYPE) {
+            } else if (componentType == byte.class) {
                 byte[] byteArray = (byte[]) result;
                 input.readFully(byteArray, 0, size);
-            } else if (componentType == Character.TYPE) {
+            } else if (componentType == char.class) {
                 char[] charArray = (char[]) result;
                 for (int i = 0; i < size; i++) {
                     charArray[i] = input.readChar();
                 }
-            } else if (componentType == Short.TYPE) {
+            } else if (componentType == short.class) {
                 short[] shortArray = (short[]) result;
                 for (int i = 0; i < size; i++) {
                     shortArray[i] = input.readShort();
                 }
-            } else if (componentType == Boolean.TYPE) {
+            } else if (componentType == boolean.class) {
                 boolean[] booleanArray = (boolean[]) result;
                 for (int i = 0; i < size; i++) {
                     booleanArray[i] = input.readBoolean();
                 }
-            } else if (componentType == Long.TYPE) {
+            } else if (componentType == long.class) {
                 long[] longArray = (long[]) result;
                 for (int i = 0; i < size; i++) {
                     longArray[i] = input.readLong();
                 }
-            } else if (componentType == Float.TYPE) {
+            } else if (componentType == float.class) {
                 float[] floatArray = (float[]) result;
                 for (int i = 0; i < size; i++) {
                     floatArray[i] = input.readFloat();
                 }
-            } else if (componentType == Double.TYPE) {
+            } else if (componentType == double.class) {
                 double[] doubleArray = (double[]) result;
                 for (int i = 0; i < size; i++) {
                     doubleArray[i] = input.readDouble();
@@ -1839,10 +1756,7 @@
             throws IOException, ClassNotFoundException {
         // TODO: This method is opportunity for performance enhancement
         //       We can cache the classloader and recently used interfaces.
-        // BEGIN android-changed
-        // ClassLoader loader = VM.getNonBootstrapClassLoader();
         ClassLoader loader = ClassLoader.getSystemClassLoader();
-        // END android-changed
         Class<?>[] interfaces = new Class<?>[interfaceNames.length];
         for (int i = 0; i < interfaceNames.length; i++) {
             interfaces[i] = Class.forName(interfaceNames[i], false, loader);
@@ -2079,9 +1993,7 @@
             // original/outside caller
             if (++nestedLevels == 1) {
                 // Remember the caller's class loader
-                // BEGIN android-changed
                 callerClassLoader = getClosestUserClassLoader();
-                // END android-changed
             }
 
             result = readNonPrimitiveContent(unshared);
@@ -2118,11 +2030,8 @@
         return result;
     }
 
-    // BEGIN android-added
-    private static final ClassLoader bootstrapLoader
-            = Object.class.getClassLoader();
-    private static final ClassLoader systemLoader
-            = ClassLoader.getSystemClassLoader();
+    private static final ClassLoader bootstrapLoader = Object.class.getClassLoader();
+    private static final ClassLoader systemLoader = ClassLoader.getSystemClassLoader();
 
     /**
      * Searches up the call stack to find the closest user-defined class loader.
@@ -2130,7 +2039,7 @@
      * @return a user-defined class loader or null if one isn't found
      */
     private static ClassLoader getClosestUserClassLoader() {
-        Class<?>[] stackClasses = VMStack.getClasses(-1, false);
+        Class<?>[] stackClasses = VMStack.getClasses(-1);
         for (Class<?> stackClass : stackClasses) {
             ClassLoader loader = stackClass.getClassLoader();
             if (loader != null && loader != bootstrapLoader
@@ -2140,7 +2049,6 @@
         }
         return null;
     }
-    // END android-added
 
     /**
      * Method to be overridden by subclasses to read the next object from the
diff --git a/luni/src/main/java/java/io/ObjectOutputStream.java b/luni/src/main/java/java/io/ObjectOutputStream.java
index 29bfdac..5ab3547 100644
--- a/luni/src/main/java/java/io/ObjectOutputStream.java
+++ b/luni/src/main/java/java/io/ObjectOutputStream.java
@@ -24,9 +24,8 @@
 import java.nio.ByteOrder;
 import java.nio.charset.ModifiedUtf8;
 import java.util.List;
-import libcore.util.EmptyArray;
+import libcore.io.Memory;
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
 
 /**
  * A specialized {@link OutputStream} that is able to write (serialize) Java
@@ -114,11 +113,6 @@
      */
     private boolean subclassOverridingImplementation;
 
-
-    // BEGIN android-removed
-    // private ObjectAccessor accessor = AccessorFactory.getObjectAccessor();
-    // END android-removed
-
     /*
      * Descriptor for java.lang.reflect.Proxy
      */
@@ -249,17 +243,8 @@
      *
      * @throws IOException
      *             if an error occurs when creating this stream.
-     * @throws SecurityException
-     *             if a security manager is installed and it denies subclassing
-     *             this class.
-     * @see SecurityManager#checkPermission(java.security.Permission)
      */
-    protected ObjectOutputStream() throws IOException, SecurityException {
-        super();
-        SecurityManager currentManager = System.getSecurityManager();
-        if (currentManager != null) {
-            currentManager.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
-        }
+    protected ObjectOutputStream() throws IOException {
         /*
          * WARNING - we should throw IOException if not called from a subclass
          * according to the JavaDoc. Add the test.
@@ -277,36 +262,8 @@
      * @throws IOException
      *             if an error occurs while writing the object stream
      *             header
-     * @throws SecurityException
-     *             if a security manager is installed and it denies subclassing
-     *             this class.
      */
     public ObjectOutputStream(OutputStream output) throws IOException {
-        Class<?> implementationClass = getClass();
-        Class<?> thisClass = ObjectOutputStream.class;
-        if (implementationClass != thisClass) {
-            boolean mustCheck = false;
-            try {
-                Method method = implementationClass.getMethod("putFields", EmptyArray.CLASS);
-                mustCheck = method.getDeclaringClass() != thisClass;
-            } catch (NoSuchMethodException e) {
-            }
-            if (!mustCheck) {
-                try {
-                    Method method = implementationClass.getMethod("writeUnshared",
-                            WRITE_UNSHARED_PARAM_TYPES);
-                    mustCheck = method.getDeclaringClass() != thisClass;
-                } catch (NoSuchMethodException e) {
-                }
-            }
-            if (mustCheck) {
-                SecurityManager sm = System.getSecurityManager();
-                if (sm != null) {
-                    sm
-                            .checkPermission(ObjectStreamConstants.SUBCLASS_IMPLEMENTATION_PERMISSION);
-                }
-            }
-        }
         this.output = (output instanceof DataOutputStream) ? (DataOutputStream) output
                 : new DataOutputStream(output);
         this.enableReplace = false;
@@ -482,22 +439,10 @@
      *            {@code true} to enable object replacement; {@code false} to
      *            disable it.
      * @return the previous setting.
-     * @throws SecurityException
-     *             if a security manager is installed and it denies enabling
-     *             object replacement for this stream.
      * @see #replaceObject
      * @see ObjectInputStream#enableResolveObject
      */
-    protected boolean enableReplaceObject(boolean enable)
-            throws SecurityException {
-        if (enable) {
-            // The Stream has to be trusted for this feature to be enabled.
-            // trusted means the stream's classloader has to be null
-            SecurityManager currentManager = System.getSecurityManager();
-            if (currentManager != null) {
-                currentManager.checkPermission(SUBSTITUTION_PERMISSION);
-            }
-        }
+    protected boolean enableReplaceObject(boolean enable) {
         boolean originalValue = enableReplace;
         enableReplace = enable;
         return originalValue;
@@ -680,21 +625,6 @@
     }
 
     /**
-     * Writes the entire contents of the byte array {@code buffer} to the output
-     * stream. Blocks until all bytes are written.
-     *
-     * @param buffer
-     *            the buffer to write.
-     * @throws IOException
-     *             if an error occurs while writing to the target stream.
-     */
-    @Override
-    public void write(byte[] buffer) throws IOException {
-        checkWritePrimitiveTypes();
-        primitiveTypes.write(buffer);
-    }
-
-    /**
      * Writes {@code count} bytes from the byte array {@code buffer} starting at
      * offset {@code index} to the target stream. Blocks until all bytes are
      * written.
@@ -972,25 +902,24 @@
     private void writeFieldValues(EmulatedFieldsForDumping emulatedFields) throws IOException {
         // Access internal fields which we can set/get. Users can't do this.
         EmulatedFields accessibleSimulatedFields = emulatedFields.emulatedFields();
-        EmulatedFields.ObjectSlot[] slots = accessibleSimulatedFields.slots();
         for (EmulatedFields.ObjectSlot slot : accessibleSimulatedFields.slots()) {
             Object fieldValue = slot.getFieldValue();
             Class<?> type = slot.getField().getType();
-            if (type == Integer.TYPE) {
+            if (type == int.class) {
                 output.writeInt(fieldValue != null ? ((Integer) fieldValue).intValue() : 0);
-            } else if (type == Byte.TYPE) {
+            } else if (type == byte.class) {
                 output.writeByte(fieldValue != null ? ((Byte) fieldValue).byteValue() : 0);
-            } else if (type == Character.TYPE) {
+            } else if (type == char.class) {
                 output.writeChar(fieldValue != null ? ((Character) fieldValue).charValue() : 0);
-            } else if (type == Short.TYPE) {
+            } else if (type == short.class) {
                 output.writeShort(fieldValue != null ? ((Short) fieldValue).shortValue() : 0);
-            } else if (type == Boolean.TYPE) {
+            } else if (type == boolean.class) {
                 output.writeBoolean(fieldValue != null ? ((Boolean) fieldValue).booleanValue() : false);
-            } else if (type == Long.TYPE) {
+            } else if (type == long.class) {
                 output.writeLong(fieldValue != null ? ((Long) fieldValue).longValue() : 0);
-            } else if (type == Float.TYPE) {
+            } else if (type == float.class) {
                 output.writeFloat(fieldValue != null ? ((Float) fieldValue).floatValue() : 0);
-            } else if (type == Double.TYPE) {
+            } else if (type == double.class) {
                 output.writeDouble(fieldValue != null ? ((Double) fieldValue).doubleValue() : 0);
             } else {
                 // Either array or Object
@@ -1025,21 +954,21 @@
                 if (field == null) {
                     throw new InvalidClassException(classDesc.getName() + " doesn't have a field " + fieldDesc.getName() + " of type " + type);
                 }
-                if (type == Byte.TYPE) {
+                if (type == byte.class) {
                     output.writeByte(field.getByte(obj));
-                } else if (type == Character.TYPE) {
+                } else if (type == char.class) {
                     output.writeChar(field.getChar(obj));
-                } else if (type == Double.TYPE) {
+                } else if (type == double.class) {
                     output.writeDouble(field.getDouble(obj));
-                } else if (type == Float.TYPE) {
+                } else if (type == float.class) {
                     output.writeFloat(field.getFloat(obj));
-                } else if (type == Integer.TYPE) {
+                } else if (type == int.class) {
                     output.writeInt(field.getInt(obj));
-                } else if (type == Long.TYPE) {
+                } else if (type == long.class) {
                     output.writeLong(field.getLong(obj));
-                } else if (type == Short.TYPE) {
+                } else if (type == short.class) {
                     output.writeShort(field.getShort(obj));
-                } else if (type == Boolean.TYPE) {
+                } else if (type == boolean.class) {
                     output.writeBoolean(field.getBoolean(obj));
                 } else {
                     // Reference types (including arrays).
@@ -1215,47 +1144,47 @@
         // elements.
 
         if (componentType.isPrimitive()) {
-            if (componentType == Integer.TYPE) {
+            if (componentType == int.class) {
                 int[] intArray = (int[]) array;
                 output.writeInt(intArray.length);
                 for (int i = 0; i < intArray.length; i++) {
                     output.writeInt(intArray[i]);
                 }
-            } else if (componentType == Byte.TYPE) {
+            } else if (componentType == byte.class) {
                 byte[] byteArray = (byte[]) array;
                 output.writeInt(byteArray.length);
                 output.write(byteArray, 0, byteArray.length);
-            } else if (componentType == Character.TYPE) {
+            } else if (componentType == char.class) {
                 char[] charArray = (char[]) array;
                 output.writeInt(charArray.length);
                 for (int i = 0; i < charArray.length; i++) {
                     output.writeChar(charArray[i]);
                 }
-            } else if (componentType == Short.TYPE) {
+            } else if (componentType == short.class) {
                 short[] shortArray = (short[]) array;
                 output.writeInt(shortArray.length);
                 for (int i = 0; i < shortArray.length; i++) {
                     output.writeShort(shortArray[i]);
                 }
-            } else if (componentType == Boolean.TYPE) {
+            } else if (componentType == boolean.class) {
                 boolean[] booleanArray = (boolean[]) array;
                 output.writeInt(booleanArray.length);
                 for (int i = 0; i < booleanArray.length; i++) {
                     output.writeBoolean(booleanArray[i]);
                 }
-            } else if (componentType == Long.TYPE) {
+            } else if (componentType == long.class) {
                 long[] longArray = (long[]) array;
                 output.writeInt(longArray.length);
                 for (int i = 0; i < longArray.length; i++) {
                     output.writeLong(longArray[i]);
                 }
-            } else if (componentType == Float.TYPE) {
+            } else if (componentType == float.class) {
                 float[] floatArray = (float[]) array;
                 output.writeInt(floatArray.length);
                 for (int i = 0; i < floatArray.length; i++) {
                     output.writeFloat(floatArray[i]);
                 }
-            } else if (componentType == Double.TYPE) {
+            } else if (componentType == double.class) {
                 double[] doubleArray = (double[]) array;
                 output.writeInt(doubleArray.length);
                 for (int i = 0; i < doubleArray.length; i++) {
@@ -1508,12 +1437,12 @@
         if (count <= 0xffff) {
             buffer = new byte[1 + SizeOf.SHORT + (int) count];
             buffer[offset++] = TC_STRING;
-            OSMemory.pokeShort(buffer, offset, (short) count, ByteOrder.BIG_ENDIAN);
+            Memory.pokeShort(buffer, offset, (short) count, ByteOrder.BIG_ENDIAN);
             offset += SizeOf.SHORT;
         } else {
             buffer = new byte[1 + SizeOf.LONG + (int) count];
             buffer[offset++] = TC_LONGSTRING;
-            OSMemory.pokeLong(buffer, offset, count, ByteOrder.BIG_ENDIAN);
+            Memory.pokeLong(buffer, offset, count, ByteOrder.BIG_ENDIAN);
             offset += SizeOf.LONG;
         }
         ModifiedUtf8.encode(buffer, offset, object);
diff --git a/luni/src/main/java/java/io/ObjectStreamClass.java b/luni/src/main/java/java/io/ObjectStreamClass.java
index 2fe31f0..386cfb0 100644
--- a/luni/src/main/java/java/io/ObjectStreamClass.java
+++ b/luni/src/main/java/java/io/ObjectStreamClass.java
@@ -24,7 +24,6 @@
 import java.lang.reflect.Modifier;
 import java.lang.reflect.Proxy;
 import java.nio.ByteOrder;
-import java.security.AccessController;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.util.ArrayList;
@@ -33,9 +32,8 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.WeakHashMap;
+import libcore.io.Memory;
 import libcore.util.EmptyArray;
-import org.apache.harmony.luni.platform.OSMemory;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * Represents a descriptor for identifying a class during serialization and
@@ -221,7 +219,6 @@
      * Constructs a new instance of this class.
      */
     ObjectStreamClass() {
-        super();
     }
 
     /**
@@ -333,7 +330,7 @@
         if (!useReflectFields) {
             // The user declared a collection of emulated fields. Use them.
             // We have to be able to fetch its value, even if it is private
-            AccessController.doPrivileged(new PriviAction<Object>(f));
+            f.setAccessible(true);
             try {
                 // static field, pass null
                 _fields = (ObjectStreamField[]) f.get(null);
@@ -395,7 +392,7 @@
          */
         for (int i = 0; i < fields.length; i++) {
             final Field field = fields[i];
-            if (Long.TYPE == field.getType()) {
+            if (field.getType() == long.class) {
                 int modifiers = field.getModifiers();
                 if (Modifier.isStatic(modifiers) && Modifier.isFinal(modifiers)) {
                     if (UID_FIELD_NAME.equals(field.getName())) {
@@ -404,8 +401,7 @@
                          * visibility. That is why we set accessible first (new
                          * API in reflect 1.2)
                          */
-                        AccessController.doPrivileged(new PriviAction<Object>(
-                                field));
+                        field.setAccessible(true);
                         try {
                             // Static field, parameter is ignored
                             return field.getLong(null);
@@ -586,7 +582,7 @@
 
         // now compute the UID based on the SHA
         byte[] hash = digest.digest(sha.toByteArray());
-        return OSMemory.peekLong(hash, 0, ByteOrder.LITTLE_ENDIAN);
+        return Memory.peekLong(hash, 0, ByteOrder.LITTLE_ENDIAN);
     }
 
     /**
@@ -1139,7 +1135,7 @@
             Class<?>[] param) {
         try {
             Method method = cl.getDeclaredMethod(methodName, param);
-            if (Modifier.isPrivate(method.getModifiers()) && method.getReturnType() == Void.TYPE) {
+            if (Modifier.isPrivate(method.getModifiers()) && method.getReturnType() == void.class) {
                 method.setAccessible(true);
                 return method;
             }
@@ -1279,19 +1275,19 @@
     }
 
     private int primitiveSize(Class<?> type) {
-        if (type == Byte.TYPE || type == Boolean.TYPE) {
+        if (type == byte.class || type == boolean.class) {
             return 1;
         }
-        if (type == Short.TYPE || type == Character.TYPE) {
+        if (type == short.class || type == char.class) {
             return 2;
         }
-        if (type == Integer.TYPE || type == Float.TYPE) {
+        if (type == int.class || type == float.class) {
             return 4;
         }
-        if (type == Long.TYPE || type == Double.TYPE) {
+        if (type == long.class || type == double.class) {
             return 8;
         }
-        return 0;
+        throw new AssertionError();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/ObjectStreamException.java b/luni/src/main/java/java/io/ObjectStreamException.java
index 996ee5e..f54d304 100644
--- a/luni/src/main/java/java/io/ObjectStreamException.java
+++ b/luni/src/main/java/java/io/ObjectStreamException.java
@@ -38,7 +38,6 @@
      * filled in.
      */
     protected ObjectStreamException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/ObjectStreamField.java b/luni/src/main/java/java/io/ObjectStreamField.java
index 3ae34e6..db450e0 100644
--- a/luni/src/main/java/java/io/ObjectStreamField.java
+++ b/luni/src/main/java/java/io/ObjectStreamField.java
@@ -159,9 +159,7 @@
      *
      * @return A Class object representing the type of the field
      */
-    // BEGIN android-note
     // Changed from private to default visibility for usage in ObjectStreamClass
-    // END android-note
     /* package */ Class<?> getTypeInternal() {
         if (type instanceof WeakReference) {
             return (Class<?>) ((WeakReference<?>) type).get();
@@ -206,21 +204,21 @@
     }
 
     private char typeCodeOf(Class<?> type) {
-        if (type == Integer.TYPE) {
+        if (type == int.class) {
             return 'I';
-        } else if (type == Byte.TYPE) {
+        } else if (type == byte.class) {
             return 'B';
-        } else if (type == Character.TYPE) {
+        } else if (type == char.class) {
             return 'C';
-        } else if (type == Short.TYPE) {
+        } else if (type == short.class) {
             return 'S';
-        } else if (type == Boolean.TYPE) {
+        } else if (type == boolean.class) {
             return 'Z';
-        } else if (type == Long.TYPE) {
+        } else if (type == long.class) {
             return 'J';
-        } else if (type == Float.TYPE) {
+        } else if (type == float.class) {
             return 'F';
-        } else if (type == Double.TYPE) {
+        } else if (type == double.class) {
             return 'D';
         } else if (type.isArray()) {
             return '[';
@@ -333,28 +331,28 @@
     private boolean defaultResolve() {
         switch (typeString.charAt(0)) {
         case 'I':
-            type = Integer.TYPE;
+            type = int.class;
             return true;
         case 'B':
-            type = Byte.TYPE;
+            type = byte.class;
             return true;
         case 'C':
-            type = Character.TYPE;
+            type = char.class;
             return true;
         case 'S':
-            type = Short.TYPE;
+            type = short.class;
             return true;
         case 'Z':
-            type = Boolean.TYPE;
+            type = boolean.class;
             return true;
         case 'J':
-            type = Long.TYPE;
+            type = long.class;
             return true;
         case 'F':
-            type = Float.TYPE;
+            type = float.class;
             return true;
         case 'D':
-            type = Double.TYPE;
+            type = double.class;
             return true;
         default:
             type = Object.class;
diff --git a/luni/src/main/java/java/io/OptionalDataException.java b/luni/src/main/java/java/io/OptionalDataException.java
index c99c5cc..292d0bd 100644
--- a/luni/src/main/java/java/io/OptionalDataException.java
+++ b/luni/src/main/java/java/io/OptionalDataException.java
@@ -46,7 +46,6 @@
      * filled in.
      */
     OptionalDataException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/OutputStream.java b/luni/src/main/java/java/io/OutputStream.java
index 95f6102..67c2b7b 100644
--- a/luni/src/main/java/java/io/OutputStream.java
+++ b/luni/src/main/java/java/io/OutputStream.java
@@ -41,7 +41,6 @@
      * Default constructor.
      */
     public OutputStream() {
-        super();
     }
 
     /**
@@ -67,18 +66,9 @@
     }
 
     /**
-     * Writes the entire contents of the byte array {@code buffer} to this
-     * stream.
-     *
-     * @param buffer
-     *            the buffer to be written.
-     * @throws IOException
-     *             if an error occurs while writing to this stream.
+     * Equivalent to {@code write(buffer, 0, buffer.length)}.
      */
     public void write(byte[] buffer) throws IOException {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         write(buffer, 0, buffer.length);
     }
 
diff --git a/luni/src/main/java/java/io/OutputStreamWriter.java b/luni/src/main/java/java/io/OutputStreamWriter.java
index 699263d..86b62fc 100644
--- a/luni/src/main/java/java/io/OutputStreamWriter.java
+++ b/luni/src/main/java/java/io/OutputStreamWriter.java
@@ -24,7 +24,6 @@
 import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
 import java.util.Arrays;
-import org.apache.harmony.luni.util.HistoricalNamesUtil;
 
 /**
  * A class for turning a character stream into a byte stream. Data written to
@@ -126,8 +125,8 @@
      * Closes this writer. This implementation flushes the buffer as well as the
      * target stream. The target stream is then closed and the resources for the
      * buffer and converter are released.
-     * <p>
-     * Only the first invocation of this method has any effect. Subsequent calls
+     *
+     * <p>Only the first invocation of this method has any effect. Subsequent calls
      * do nothing.
      *
      * @throws IOException
@@ -137,9 +136,8 @@
     public void close() throws IOException {
         synchronized (lock) {
             if (encoder != null) {
-                encoder.flush(bytes);
-                flush();
-                out.flush();
+                drainEncoder();
+                flushBytes(false);
                 out.close();
                 encoder = null;
                 bytes = null;
@@ -157,15 +155,66 @@
      */
     @Override
     public void flush() throws IOException {
+        flushBytes(true);
+    }
+
+    private void flushBytes(boolean flushUnderlyingStream) throws IOException {
         synchronized (lock) {
             checkStatus();
-            int position;
-            if ((position = bytes.position()) > 0) {
+            int position = bytes.position();
+            if (position > 0) {
                 bytes.flip();
-                out.write(bytes.array(), 0, position);
+                out.write(bytes.array(), bytes.arrayOffset(), position);
                 bytes.clear();
             }
-            out.flush();
+            if (flushUnderlyingStream) {
+                out.flush();
+            }
+        }
+    }
+
+    private void convert(CharBuffer chars) throws IOException {
+        while (true) {
+            CoderResult result = encoder.encode(chars, bytes, false);
+            if (result.isOverflow()) {
+                // Make room and try again.
+                flushBytes(false);
+                continue;
+            } else if (result.isError()) {
+                result.throwException();
+            }
+            break;
+        }
+    }
+
+    private void drainEncoder() throws IOException {
+        // Strictly speaking, I think it's part of the CharsetEncoder contract that you call
+        // encode with endOfInput true before flushing. Our ICU-based implementations don't
+        // actually need this, and you'd hope that any reasonable implementation wouldn't either.
+        // CharsetEncoder.encode doesn't actually pass the boolean through to encodeLoop anyway!
+        CharBuffer chars = CharBuffer.allocate(0);
+        while (true) {
+            CoderResult result = encoder.encode(chars, bytes, true);
+            if (result.isError()) {
+                result.throwException();
+            } else if (result.isOverflow()) {
+                flushBytes(false);
+                continue;
+            }
+            break;
+        }
+
+        // Some encoders (such as ISO-2022-JP) have stuff to write out after all the
+        // characters (such as shifting back into a default state). In our implementation,
+        // this is actually the first time ICU is told that we've run out of input.
+        CoderResult result = encoder.flush(bytes);
+        while (!result.isUnderflow()) {
+            if (result.isOverflow()) {
+                flushBytes(false);
+                result = encoder.flush(bytes);
+            } else {
+                result.throwException();
+            }
         }
     }
 
@@ -176,17 +225,16 @@
     }
 
     /**
-     * Gets the name of the encoding that is used to convert characters to
-     * bytes.
-     *
-     * @return the string describing the converter or {@code null} if this
-     *         writer is closed.
+     * Returns the historical name of the encoding used by this writer to convert characters to
+     * bytes, or null if this writer has been closed. Most callers should probably keep
+     * track of the String or Charset they passed in; this method may not return the same
+     * name.
      */
     public String getEncoding() {
         if (encoder == null) {
             return null;
         }
-        return HistoricalNamesUtil.getHistoricalName(encoder.charset().name());
+        return HistoricalCharsetNames.get(encoder.charset());
     }
 
     /**
@@ -219,21 +267,6 @@
         }
     }
 
-    private void convert(CharBuffer chars) throws IOException {
-        CoderResult result = encoder.encode(chars, bytes, true);
-        while (true) {
-            if (result.isError()) {
-                throw new IOException(result.toString());
-            } else if (result.isOverflow()) {
-                // flush the output buffer
-                flush();
-                result = encoder.encode(chars, bytes, true);
-                continue;
-            }
-            break;
-        }
-    }
-
     /**
      * Writes the character {@code oneChar} to this writer. The lowest two bytes
      * of the integer {@code oneChar} are immediately converted to bytes by the
diff --git a/luni/src/main/java/java/io/PipedOutputStream.java b/luni/src/main/java/java/io/PipedOutputStream.java
index 6df3fa2..a674bb3 100644
--- a/luni/src/main/java/java/io/PipedOutputStream.java
+++ b/luni/src/main/java/java/io/PipedOutputStream.java
@@ -15,12 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// We've made several changes including:
-//  - avoid shallow concurrency problems
-//  - improved consistency with PipedWriter
-// END android-note
-
 package java.io;
 
 /**
@@ -43,7 +37,6 @@
      * written to it.
      */
     public PipedOutputStream() {
-        super();
     }
 
     /**
@@ -57,7 +50,6 @@
      *             if this stream or {@code target} are already connected.
      */
     public PipedOutputStream(PipedInputStream target) throws IOException {
-        super();
         connect(target);
     }
 
diff --git a/luni/src/main/java/java/io/PipedWriter.java b/luni/src/main/java/java/io/PipedWriter.java
index adb1733..ece899a 100644
--- a/luni/src/main/java/java/io/PipedWriter.java
+++ b/luni/src/main/java/java/io/PipedWriter.java
@@ -39,7 +39,6 @@
      * @see PipedReader
      */
     public PipedWriter() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/PrintStream.java b/luni/src/main/java/java/io/PrintStream.java
index 42e6750..ba48b04 100644
--- a/luni/src/main/java/java/io/PrintStream.java
+++ b/luni/src/main/java/java/io/PrintStream.java
@@ -19,12 +19,10 @@
 
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
-import java.security.AccessController;
 import java.util.Arrays;
 import java.util.Formatter;
 import java.util.IllegalFormatException;
 import java.util.Locale;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * Wraps an existing {@link OutputStream} and provides convenience methods for
@@ -44,15 +42,10 @@
      * indicates whether or not this PrintStream should flush its contents after
      * printing a new line.
      */
-    private boolean autoflush;
+    private boolean autoFlush;
 
     private String encoding;
 
-    private final String lineSeparator = AccessController
-            .doPrivileged(new PriviAction<String>("line.separator"));
-
-    // private Formatter formatter;
-
     /**
      * Constructs a new {@code PrintStream} with {@code out} as its target
      * stream. By default, the new print stream does not automatically flush its
@@ -72,35 +65,35 @@
 
     /**
      * Constructs a new {@code PrintStream} with {@code out} as its target
-     * stream. The parameter {@code autoflush} determines if the print stream
+     * stream. The parameter {@code autoFlush} determines if the print stream
      * automatically flushes its contents to the target stream when a newline is
      * encountered.
      *
      * @param out
      *            the target output stream.
-     * @param autoflush
+     * @param autoFlush
      *            indicates whether to flush contents upon encountering a
      *            newline sequence.
      * @throws NullPointerException
      *             if {@code out} is {@code null}.
      */
-    public PrintStream(OutputStream out, boolean autoflush) {
+    public PrintStream(OutputStream out, boolean autoFlush) {
         super(out);
         if (out == null) {
             throw new NullPointerException();
         }
-        this.autoflush = autoflush;
+        this.autoFlush = autoFlush;
     }
 
     /**
      * Constructs a new {@code PrintStream} with {@code out} as its target
      * stream and using the character encoding {@code enc} while writing. The
-     * parameter {@code autoflush} determines if the print stream automatically
+     * parameter {@code autoFlush} determines if the print stream automatically
      * flushes its contents to the target stream when a newline is encountered.
      *
      * @param out
      *            the target output stream.
-     * @param autoflush
+     * @param autoFlush
      *            indicates whether or not to flush contents upon encountering a
      *            newline sequence.
      * @param enc
@@ -110,13 +103,13 @@
      * @throws UnsupportedEncodingException
      *             if the encoding specified by {@code enc} is not supported.
      */
-    public PrintStream(OutputStream out, boolean autoflush, String enc)
+    public PrintStream(OutputStream out, boolean autoFlush, String enc)
             throws UnsupportedEncodingException {
         super(out);
         if (out == null || enc == null) {
             throw new NullPointerException();
         }
-        this.autoflush = autoflush;
+        this.autoFlush = autoFlush;
         try {
             if (!Charset.isSupported(enc)) {
                 throw new UnsupportedEncodingException(enc);
@@ -129,16 +122,13 @@
 
     /**
      * Constructs a new {@code PrintStream} with {@code file} as its target. The
-     * virtual machine's default character set is used for character encoding.
+     * VM's default character set is used for character encoding.
      *
      * @param file
      *            the target file. If the file already exists, its contents are
      *            removed, otherwise a new file is created.
      * @throws FileNotFoundException
      *             if an error occurs while opening or creating the target file.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      */
     public PrintStream(File file) throws FileNotFoundException {
         super(new FileOutputStream(file));
@@ -157,9 +147,6 @@
      *             if an error occurs while opening or creating the target file.
      * @throws NullPointerException
      *             if {@code csn} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      * @throws UnsupportedEncodingException
      *             if the encoding specified by {@code csn} is not supported.
      */
@@ -177,7 +164,7 @@
 
     /**
      * Constructs a new {@code PrintStream} with the file identified by
-     * {@code fileName} as its target. The virtual machine's default character
+     * {@code fileName} as its target. The VM's default character
      * set is used for character encoding.
      *
      * @param fileName
@@ -185,9 +172,6 @@
      *            contents are removed, otherwise a new file is created.
      * @throws FileNotFoundException
      *             if an error occurs while opening or creating the target file.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      */
     public PrintStream(String fileName) throws FileNotFoundException {
         this(new File(fileName));
@@ -207,9 +191,6 @@
      *             if an error occurs while opening or creating the target file.
      * @throws NullPointerException
      *             if {@code csn} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      * @throws UnsupportedEncodingException
      *             if the encoding specified by {@code csn} is not supported.
      */
@@ -330,8 +311,10 @@
 
     /**
      * Prints a formatted string. The behavior of this method is the same as
-     * this stream's {@code #format(String, Object...)} method. For the locale,
-     * the default value of the current virtual machine instance is used.
+     * this stream's {@code #format(String, Object...)} method.
+     *
+     * <p>The {@code Locale} used is the user's default locale.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param format the format string (see {@link java.util.Formatter#format})
      * @param args
@@ -376,91 +359,56 @@
      * Put the line separator String onto the print stream.
      */
     private void newline() {
-        print(lineSeparator);
+        print(System.lineSeparator());
     }
 
     /**
-     * Prints the string representation of the specified character array
-     * to the target stream.
-     *
-     * @param charArray
-     *            the character array to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the character array {@code chars}.
      */
-    public void print(char[] charArray) {
-        print(new String(charArray, 0, charArray.length));
+    public void print(char[] chars) {
+        print(new String(chars, 0, chars.length));
     }
 
     /**
-     * Prints the string representation of the specified character to the target
-     * stream.
-     *
-     * @param ch
-     *            the character to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the char {@code c}.
      */
-    public void print(char ch) {
-        print(String.valueOf(ch));
+    public void print(char c) {
+        print(String.valueOf(c));
     }
 
     /**
-     * Prints the string representation of the specified double to the target
-     * stream.
-     *
-     * @param dnum
-     *            the double value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the double {@code d}.
      */
-    public void print(double dnum) {
-        print(String.valueOf(dnum));
+    public void print(double d) {
+        print(String.valueOf(d));
     }
 
     /**
-     * Prints the string representation of the specified float to the target
-     * stream.
-     *
-     * @param fnum
-     *            the float value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the float {@code f}.
      */
-    public void print(float fnum) {
-        print(String.valueOf(fnum));
+    public void print(float f) {
+        print(String.valueOf(f));
     }
 
     /**
-     * Prints the string representation of the specified integer to the target
-     * stream.
-     *
-     * @param inum
-     *            the integer value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the int {@code i}.
      */
-    public void print(int inum) {
-        print(String.valueOf(inum));
+    public void print(int i) {
+        print(String.valueOf(i));
     }
 
     /**
-     * Prints the string representation of the specified long to the target
-     * stream.
-     *
-     * @param lnum
-     *            the long value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the long {@code l}.
      */
-    public void print(long lnum) {
-        print(String.valueOf(lnum));
+    public void print(long l) {
+        print(String.valueOf(l));
     }
 
     /**
-     * Prints the string representation of the specified object to the target
-     * stream.
-     *
-     * @param obj
-     *            the object to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the Object {@code o}, or {@code "null"}.
      */
-    public void print(Object obj) {
-        print(String.valueOf(obj));
+    public void print(Object o) {
+        print(String.valueOf(o));
     }
 
     /**
@@ -468,8 +416,8 @@
      * of bytes using the encoding chosen during the construction of this
      * stream. The bytes are then written to the target stream with
      * {@code write(int)}.
-     * <p>
-     * If an I/O error occurs, this stream's error state is set to {@code true}.
+     *
+     * <p>If an I/O error occurs, this stream's error state is set to {@code true}.
      *
      * @param str
      *            the string to print to the target stream.
@@ -497,118 +445,75 @@
     }
 
     /**
-     * Prints the string representation of the specified boolean to the target
-     * stream.
-     *
-     * @param bool
-     *            the boolean value to print the target stream.
-     * @see #print(String)
+     * Prints the string representation of the boolean {@code b}.
      */
-    public void print(boolean bool) {
-        print(String.valueOf(bool));
+    public void print(boolean b) {
+        print(String.valueOf(b));
     }
 
     /**
-     * Prints the string representation of the system property
-     * {@code "line.separator"} to the target stream.
+     * Prints a newline.
      */
     public void println() {
         newline();
     }
 
     /**
-     * Prints the string representation of the specified character array
-     * followed by the system property {@code "line.separator"} to the target
-     * stream.
-     *
-     * @param charArray
-     *            the character array to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the character array {@code chars} followed by a newline.
      */
-    public void println(char[] charArray) {
-        println(new String(charArray, 0, charArray.length));
+    public void println(char[] chars) {
+        println(new String(chars, 0, chars.length));
     }
 
     /**
-     * Prints the string representation of the specified character followed by
-     * the system property {@code "line.separator"} to the target stream.
-     *
-     * @param ch
-     *            the character to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the char {@code c} followed by a newline.
      */
-    public void println(char ch) {
-        println(String.valueOf(ch));
+    public void println(char c) {
+        println(String.valueOf(c));
     }
 
     /**
-     * Prints the string representation of the specified double followed by the
-     * system property {@code "line.separator"} to the target stream.
-     *
-     * @param dnum
-     *            the double value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the double {@code d} followed by a newline.
      */
-    public void println(double dnum) {
-        println(String.valueOf(dnum));
+    public void println(double d) {
+        println(String.valueOf(d));
     }
 
     /**
-     * Prints the string representation of the specified float followed by the
-     * system property {@code "line.separator"} to the target stream.
-     *
-     * @param fnum
-     *            the float value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the float {@code f} followed by a newline.
      */
-   public void println(float fnum) {
-        println(String.valueOf(fnum));
+   public void println(float f) {
+        println(String.valueOf(f));
     }
 
    /**
-     * Prints the string representation of the specified integer followed by the
-     * system property {@code "line.separator"} to the target stream.
-     *
-     * @param inum
-     *            the integer value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the int {@code i} followed by a newline.
      */
-    public void println(int inum) {
-        println(String.valueOf(inum));
+    public void println(int i) {
+        println(String.valueOf(i));
     }
 
     /**
-     * Prints the string representation of the specified long followed by the
-     * system property {@code "line.separator"} to the target stream.
-     *
-     * @param lnum
-     *            the long value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the long {@code l} followed by a newline.
      */
-    public void println(long lnum) {
-        println(String.valueOf(lnum));
+    public void println(long l) {
+        println(String.valueOf(l));
     }
 
     /**
-     * Prints the string representation of the specified object followed by the
-     * system property {@code "line.separator"} to the target stream.
-     *
-     * @param obj
-     *            the object to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the Object {@code o}, or {@code "null"},
+     * followed by a newline.
      */
-    public void println(Object obj) {
-        println(String.valueOf(obj));
+    public void println(Object o) {
+        println(String.valueOf(o));
     }
 
     /**
-     * Prints a string followed by the system property {@code "line.separator"}
-     * to the target stream. The string is converted to an array of bytes using
+     * Prints a string followed by a newline. The string is converted to an array of bytes using
      * the encoding chosen during the construction of this stream. The bytes are
      * then written to the target stream with {@code write(int)}.
-     * <p>
-     * If an I/O error occurs, this stream's error state is set to {@code true}.
-     * </p>
+     *
+     * <p>If an I/O error occurs, this stream's error state is set to {@code true}.
      *
      * @param str
      *            the string to print to the target stream.
@@ -620,15 +525,10 @@
     }
 
     /**
-     * Prints the string representation of the specified boolean followed by the
-     * system property {@code "line.separator"} to the target stream.
-     *
-     * @param bool
-     *            the boolean value to print to the target stream.
-     * @see #print(String)
+     * Prints the string representation of the boolean {@code b} followed by a newline.
      */
-    public void println(boolean bool) {
-        println(String.valueOf(bool));
+    public void println(boolean b) {
+        println(String.valueOf(b));
     }
 
     /**
@@ -640,10 +540,10 @@
 
     /**
      * Writes {@code count} bytes from {@code buffer} starting at {@code offset}
-     * to the target stream. If autoflush is set, this stream gets flushed after
+     * to the target stream. If autoFlush is set, this stream gets flushed after
      * writing the buffer.
-     * <p>
-     * This stream's error flag is set to {@code true} if this stream is closed
+     *
+     * <p>This stream's error flag is set to {@code true} if this stream is closed
      * or an I/O error occurs.
      *
      * @param buffer
@@ -667,7 +567,7 @@
             }
             try {
                 out.write(buffer, offset, length);
-                if (autoflush) {
+                if (autoFlush) {
                     flush();
                 }
             } catch (IOException e) {
@@ -680,7 +580,7 @@
      * Writes one byte to the target stream. Only the least significant byte of
      * the integer {@code oneByte} is written. This stream is flushed if
      * {@code oneByte} is equal to the character {@code '\n'} and this stream is
-     * set to autoflush.
+     * set to autoFlush.
      * <p>
      * This stream's error flag is set to {@code true} if it is closed or an I/O
      * error occurs.
@@ -699,7 +599,7 @@
             int b = oneByte & 0xFF;
             // 0x0A is ASCII newline, 0x15 is EBCDIC newline.
             boolean isNewline = b == 0x0A || b == 0x15;
-            if (autoflush && isNewline) {
+            if (autoFlush && isNewline) {
                 flush();
             }
         } catch (IOException e) {
@@ -708,11 +608,7 @@
     }
 
     /**
-     * Appends the character {@code c} to the target stream. This method works
-     * the same way as {@link #print(char)}.
-     *
-     * @param c
-     *            the character to append to the target stream.
+     * Appends the char {@code c}.
      * @return this stream.
      */
     public PrintStream append(char c) {
@@ -721,32 +617,22 @@
     }
 
     /**
-     * Appends the character sequence {@code csq} to the target stream. This
-     * method works the same way as {@code PrintStream.print(csq.toString())}.
-     * If {@code csq} is {@code null}, then the string "null" is written to the
-     * target stream.
-     *
-     * @param csq
-     *            the character sequence appended to the target stream.
+     * Appends the CharSequence {@code charSequence}, or {@code "null"}.
      * @return this stream.
      */
-    public PrintStream append(CharSequence csq) {
-        if (csq == null) {
+    public PrintStream append(CharSequence charSequence) {
+        if (charSequence == null) {
             print("null");
         } else {
-            print(csq.toString());
+            print(charSequence.toString());
         }
         return this;
     }
 
     /**
-     * Appends a subsequence of the character sequence {@code csq} to the target
-     * stream. This method works the same way as {@code
-     * PrintStream.print(csq.subsequence(start, end).toString())}. If {@code
-     * csq} is {@code null}, then the specified subsequence of the string "null"
-     * will be written to the target stream.
+     * Appends a subsequence of CharSequence {@code charSequence}, or {@code "null"}.
      *
-     * @param csq
+     * @param charSequence
      *            the character sequence appended to the target stream.
      * @param start
      *            the index of the first char in the character sequence appended
@@ -758,13 +644,13 @@
      * @throws IndexOutOfBoundsException
      *             if {@code start > end}, {@code start < 0}, {@code end < 0} or
      *             either {@code start} or {@code end} are greater or equal than
-     *             the length of {@code csq}.
+     *             the length of {@code charSequence}.
      */
-    public PrintStream append(CharSequence csq, int start, int end) {
-        if (csq == null) {
-            csq = "null";
+    public PrintStream append(CharSequence charSequence, int start, int end) {
+        if (charSequence == null) {
+            charSequence = "null";
         }
-        print(csq.subSequence(start, end).toString());
+        print(charSequence.subSequence(start, end).toString());
         return this;
     }
 }
diff --git a/luni/src/main/java/java/io/PrintWriter.java b/luni/src/main/java/java/io/PrintWriter.java
index 3bc14b8..fa890c9 100644
--- a/luni/src/main/java/java/io/PrintWriter.java
+++ b/luni/src/main/java/java/io/PrintWriter.java
@@ -17,11 +17,9 @@
 
 package java.io;
 
-import java.security.AccessController;
 import java.util.Formatter;
 import java.util.IllegalFormatException;
 import java.util.Locale;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * Wraps either an existing {@link OutputStream} or an existing {@link Writer}
@@ -45,10 +43,7 @@
      * Indicates whether or not this PrintWriter should flush its contents after
      * printing a new line.
      */
-    private boolean autoflush;
-
-    private final String lineSeparator = AccessController
-            .doPrivileged(new PriviAction<String>("line.separator"));
+    private boolean autoFlush;
 
     /**
      * Constructs a new {@code PrintWriter} with {@code out} as its target
@@ -66,20 +61,20 @@
 
     /**
      * Constructs a new {@code PrintWriter} with {@code out} as its target
-     * stream. The parameter {@code autoflush} determines if the print writer
+     * stream. The parameter {@code autoFlush} determines if the print writer
      * automatically flushes its contents to the target stream when a newline is
      * encountered.
      *
      * @param out
      *            the target output stream.
-     * @param autoflush
+     * @param autoFlush
      *            indicates whether contents are flushed upon encountering a
      *            newline sequence.
      * @throws NullPointerException
      *             if {@code out} is {@code null}.
      */
-    public PrintWriter(OutputStream out, boolean autoflush) {
-        this(new OutputStreamWriter(out), autoflush);
+    public PrintWriter(OutputStream out, boolean autoFlush) {
+        this(new OutputStreamWriter(out), autoFlush);
     }
 
     /**
@@ -98,27 +93,27 @@
 
     /**
      * Constructs a new {@code PrintWriter} with {@code out} as its target
-     * writer. The parameter {@code autoflush} determines if the print writer
+     * writer. The parameter {@code autoFlush} determines if the print writer
      * automatically flushes its contents to the target writer when a newline is
      * encountered.
      *
      * @param wr
      *            the target writer.
-     * @param autoflush
+     * @param autoFlush
      *            indicates whether to flush contents upon encountering a
      *            newline sequence.
      * @throws NullPointerException
      *             if {@code out} is {@code null}.
      */
-    public PrintWriter(Writer wr, boolean autoflush) {
+    public PrintWriter(Writer wr, boolean autoFlush) {
         super(wr);
-        this.autoflush = autoflush;
+        this.autoFlush = autoFlush;
         out = wr;
     }
 
     /**
      * Constructs a new {@code PrintWriter} with {@code file} as its target. The
-     * virtual machine's default character set is used for character encoding.
+     * VM's default character set is used for character encoding.
      * The print writer does not automatically flush its contents to the target
      * file when a newline is encountered. The output to the file is buffered.
      *
@@ -127,9 +122,6 @@
      *            removed, otherwise a new file is created.
      * @throws FileNotFoundException
      *             if an error occurs while opening or creating the target file.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      */
     public PrintWriter(File file) throws FileNotFoundException {
         this(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(file))), false);
@@ -150,9 +142,6 @@
      *             if an error occurs while opening or creating the target file.
      * @throws NullPointerException
      *             if {@code csn} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      * @throws UnsupportedEncodingException
      *             if the encoding specified by {@code csn} is not supported.
      */
@@ -164,7 +153,7 @@
 
     /**
      * Constructs a new {@code PrintWriter} with the file identified by {@code
-     * fileName} as its target. The virtual machine's default character set is
+     * fileName} as its target. The VM's default character set is
      * used for character encoding. The print writer does not automatically
      * flush its contents to the target file when a newline is encountered. The
      * output to the file is buffered.
@@ -174,9 +163,6 @@
      *            contents are removed, otherwise a new file is created.
      * @throws FileNotFoundException
      *             if an error occurs while opening or creating the target file.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      */
     public PrintWriter(String fileName) throws FileNotFoundException {
         this(new OutputStreamWriter(new BufferedOutputStream(new FileOutputStream(fileName))),
@@ -199,9 +185,6 @@
      *             if an error occurs while opening or creating the target file.
      * @throws NullPointerException
      *             if {@code csn} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager exists and it denies writing to the
-     *             target file.
      * @throws UnsupportedEncodingException
      *             if the encoding specified by {@code csn} is not supported.
      */
@@ -324,7 +307,7 @@
             throw new NullPointerException("format == null");
         }
         new Formatter(this, l).format(format, args);
-        if (autoflush) {
+        if (autoFlush) {
             flush();
         }
         return this;
@@ -332,8 +315,10 @@
 
     /**
      * Prints a formatted string. The behavior of this method is the same as
-     * this writer's {@code #format(String, Object...)} method. For the locale,
-     * the default value of the current virtual machine instance is used.
+     * this writer's {@code #format(String, Object...)} method.
+     *
+     * <p>The {@code Locale} used is the user's default locale.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param format the format string (see {@link java.util.Formatter#format})
      * @param args
@@ -480,122 +465,84 @@
     }
 
     /**
-     * Prints the string representation of the system property {@code
-     * "line.separator"} to the target. Flushes this writer if the autoflush
-     * flag is set to {@code true}.
+     * Prints a newline. Flushes this writer if the autoFlush flag is set to {@code true}.
      */
     public void println() {
         synchronized (lock) {
-            print(lineSeparator);
-            if (autoflush) {
+            print(System.lineSeparator());
+            if (autoFlush) {
                 flush();
             }
         }
     }
 
     /**
-     * Prints the string representation of the specified character array
-     * followed by the system property {@code "line.separator"} to the target.
-     * Flushes this writer if the autoflush flag is set to {@code true}.
-     *
-     * @param charArray
-     *            the character array to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the character array {@code chars} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
-    public void println(char[] charArray) {
-        println(new String(charArray, 0, charArray.length));
+    public void println(char[] chars) {
+        println(new String(chars, 0, chars.length));
     }
 
     /**
-     * Prints the string representation of the specified character followed by
-     * the system property {@code "line.separator"} to the target. Flushes this
-     * writer if the autoflush flag is set to {@code true}.
-     *
-     * @param ch
-     *            the character to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the char {@code c} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
-    public void println(char ch) {
-        println(String.valueOf(ch));
+    public void println(char c) {
+        println(String.valueOf(c));
     }
 
     /**
-     * Prints the string representation of the specified double followed by the
-     * system property {@code "line.separator"} to the target. Flushes this
-     * writer if the autoflush flag is set to {@code true}.
-     *
-     * @param dnum
-     *            the double value to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the double {@code d} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
-    public void println(double dnum) {
-        println(String.valueOf(dnum));
+    public void println(double d) {
+        println(String.valueOf(d));
     }
 
     /**
-     * Prints the string representation of the specified float followed by the
-     * system property {@code "line.separator"} to the target. Flushes this
-     * writer if the autoflush flag is set to {@code true}.
-     *
-     * @param fnum
-     *            the float value to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the float {@code f} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
-    public void println(float fnum) {
-        println(String.valueOf(fnum));
+    public void println(float f) {
+        println(String.valueOf(f));
     }
 
     /**
-     * Prints the string representation of the specified integer followed by the
-     * system property {@code "line.separator"} to the target. Flushes this
-     * writer if the autoflush flag is set to {@code true}.
-     *
-     * @param inum
-     *            the integer value to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the int {@code i} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
-    public void println(int inum) {
-        println(String.valueOf(inum));
+    public void println(int i) {
+        println(String.valueOf(i));
     }
 
     /**
-     * Prints the string representation of the specified long followed by the
-     * system property {@code "line.separator"} to the target. Flushes this
-     * writer if the autoflush flag is set to {@code true}.
-     *
-     * @param lnum
-     *            the long value to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the long {@code l} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
-    public void println(long lnum) {
-        println(String.valueOf(lnum));
+    public void println(long l) {
+        println(String.valueOf(l));
     }
 
     /**
-     * Prints the string representation of the specified object followed by the
-     * system property {@code "line.separator"} to the target. Flushes this
-     * writer if the autoflush flag is set to {@code true}.
-     *
-     * @param obj
-     *            the object to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the object {@code o}, or {@code "null},
+     * followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
     public void println(Object obj) {
         println(String.valueOf(obj));
     }
 
     /**
-     * Prints a string followed by the system property {@code "line.separator"}
-     * to the target. The string is converted to an array of bytes using the
+     * Prints the string representation of the string {@code s} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
+     *
+     * <p>The string is converted to an array of bytes using the
      * encoding chosen during the construction of this writer. The bytes are
      * then written to the target with {@code write(int)}. Finally, this writer
-     * is flushed if the autoflush flag is set to {@code true}.
-     * <p>
-     * If an I/O error occurs, this writer's error flag is set to {@code true}.
+     * is flushed if the autoFlush flag is set to {@code true}.
      *
-     * @param str
-     *            the string to print to the target.
-     * @see #write(int)
+     * <p>If an I/O error occurs, this writer's error flag is set to {@code true}.
      */
     public void println(String str) {
         synchronized (lock) {
@@ -605,16 +552,11 @@
     }
 
     /**
-     * Prints the string representation of the specified boolean followed by the
-     * system property {@code "line.separator"} to the target. Flushes this
-     * writer if the autoflush flag is set to {@code true}.
-     *
-     * @param bool
-     *            the boolean value to print to the target.
-     * @see #print(String)
+     * Prints the string representation of the boolean {@code b} followed by a newline.
+     * Flushes this writer if the autoFlush flag is set to {@code true}.
      */
-    public void println(boolean bool) {
-        println(String.valueOf(bool));
+    public void println(boolean b) {
+        println(String.valueOf(b));
     }
 
     /**
@@ -634,9 +576,6 @@
      */
     @Override
     public void write(char[] buf) {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         write(buf, 0, buf.length);
     }
 
@@ -659,9 +598,6 @@
      */
     @Override
     public void write(char[] buf, int offset, int count) {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         doWrite(buf, offset, count);
     }
 
@@ -681,9 +617,6 @@
     }
 
     private final void doWrite(char[] buf, int offset, int count) {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         synchronized (lock) {
             if (out != null) {
                 try {
diff --git a/luni/src/main/java/java/io/PushbackInputStream.java b/luni/src/main/java/java/io/PushbackInputStream.java
index 61ca2a7..fa0df85 100644
--- a/luni/src/main/java/java/io/PushbackInputStream.java
+++ b/luni/src/main/java/java/io/PushbackInputStream.java
@@ -326,9 +326,7 @@
      *            the number of bytes that can be read from this stream before
      *            the mark is invalidated; this parameter is ignored.
      */
-    @Override
-    public void mark(int readlimit) {
-        return;
+    @Override public void mark(int readlimit) {
     }
 
     /**
diff --git a/luni/src/main/java/java/io/RandomAccessFile.java b/luni/src/main/java/java/io/RandomAccessFile.java
index b5ac0b7..8517604 100644
--- a/luni/src/main/java/java/io/RandomAccessFile.java
+++ b/luni/src/main/java/java/io/RandomAccessFile.java
@@ -23,11 +23,12 @@
 import java.nio.channels.FileChannel;
 import java.nio.charset.ModifiedUtf8;
 import java.util.Arrays;
+import libcore.io.ErrnoException;
 import libcore.io.IoUtils;
+import libcore.io.Libcore;
+import libcore.io.Memory;
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.IFileSystem;
-import org.apache.harmony.luni.platform.OSMemory;
-import org.apache.harmony.luni.platform.Platform;
+import static libcore.io.OsConstants.*;
 
 /**
  * Allows reading from and writing to a file in a random-access manner. This is
@@ -95,43 +96,25 @@
      * @throws IllegalArgumentException
      *             if {@code mode} is not {@code "r"}, {@code "rw"}, {@code
      *             "rws"} or {@code "rwd"}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies
-     *             access request according to {@code mode}.
-     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
      */
     public RandomAccessFile(File file, String mode) throws FileNotFoundException {
-        int options;
-        fd = new FileDescriptor();
-
+        int flags;
         if (mode.equals("r")) {
-            fd.readOnly = true;
-            options = IFileSystem.O_RDONLY;
+            flags = O_RDONLY;
         } else if (mode.equals("rw") || mode.equals("rws") || mode.equals("rwd")) {
-            options = IFileSystem.O_RDWR;
-
+            flags = O_RDWR | O_CREAT;
             if (mode.equals("rws")) {
                 // Sync file and metadata with every write
                 syncMetadata = true;
             } else if (mode.equals("rwd")) {
                 // Sync file, but not necessarily metadata
-                options = IFileSystem.O_RDWRSYNC;
+                flags |= O_SYNC;
             }
         } else {
             throw new IllegalArgumentException("Invalid mode: " + mode);
         }
-        this.mode = options;
-
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(file.getPath());
-            if (!mode.equals("r")) {
-                security.checkWrite(file.getPath());
-            }
-        }
-
-        fd.descriptor = Platform.FILE_SYSTEM.open(file.getAbsolutePath(), this.mode);
+        this.mode = flags;
+        this.fd = IoUtils.open(file.getAbsolutePath(), flags);
 
         // if we are in "rws" mode, attempt to sync file+metadata
         if (syncMetadata) {
@@ -161,11 +144,6 @@
      * @throws IllegalArgumentException
      *             if {@code mode} is not {@code "r"}, {@code "rw"}, {@code
      *             "rws"} or {@code "rwd"}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and it denies
-     *             access request according to {@code mode}.
-     * @see java.lang.SecurityManager#checkRead(FileDescriptor)
-     * @see java.lang.SecurityManager#checkWrite(FileDescriptor)
      */
     public RandomAccessFile(String fileName, String mode) throws FileNotFoundException {
         this(new File(fileName), mode);
@@ -184,9 +162,7 @@
                 channel.close();
                 channel = null;
             }
-            if (fd != null && fd.valid()) {
-                IoUtils.close(fd);
-            }
+            IoUtils.close(fd);
         }
     }
 
@@ -213,7 +189,7 @@
      */
     public final synchronized FileChannel getChannel() {
         if(channel == null) {
-            channel = NioUtils.newFileChannel(this, fd.descriptor, mode);
+            channel = NioUtils.newFileChannel(this, fd, mode);
         }
         return channel;
     }
@@ -242,20 +218,10 @@
      *             file.
      */
     public long getFilePointer() throws IOException {
-        openCheck();
-        return Platform.FILE_SYSTEM.seek(fd.descriptor, 0L, IFileSystem.SEEK_CUR);
-    }
-
-    /**
-     * Checks to see if the file is currently open. Returns silently if it is,
-     * and throws an exception if it is not.
-     *
-     * @throws IOException
-     *             the receiver is closed.
-     */
-    private synchronized void openCheck() throws IOException {
-        if (fd.descriptor < 0) {
-            throw new IOException();
+        try {
+            return Libcore.os.lseek(fd, 0L, SEEK_CUR);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
         }
     }
 
@@ -267,31 +233,32 @@
      *             if this file is closed or some other I/O error occurs.
      */
     public long length() throws IOException {
-        openCheck();
-        return Platform.FILE_SYSTEM.length(fd.descriptor);
+        try {
+            return Libcore.os.fstat(fd).st_size;
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
     }
 
     /**
      * Reads a single byte from the current position in this file and returns it
      * as an integer in the range from 0 to 255. Returns -1 if the end of the
      * file has been reached. Blocks until one byte has been read, the end of
-     * the file is detected or an exception is thrown.
+     * the file is detected, or an exception is thrown.
      *
      * @return the byte read or -1 if the end of the file has been reached.
      * @throws IOException
      *             if this file is closed or another I/O error occurs.
      */
     public int read() throws IOException {
-        openCheck();
-        long byteCount = Platform.FILE_SYSTEM.read(fd.descriptor, scratch, 0, 1);
-        return byteCount == -1 ? -1 : scratch[0] & 0xff;
+        return (read(scratch, 0, 1) != -1) ? scratch[0] & 0xff : -1;
     }
 
     /**
      * Reads bytes from the current position in this file and stores them in the
      * byte array {@code buffer}. The maximum number of bytes read corresponds
      * to the size of {@code buffer}. Blocks until at least one byte has been
-     * read.
+     * read, the end of the file is detected, or an exception is thrown.
      *
      * @param buffer
      *            the byte array in which to store the bytes read.
@@ -305,33 +272,21 @@
     }
 
     /**
-     * Reads at most {@code count} bytes from the current position in this file
+     * Reads at most {@code byteCount} bytes from the current position in this file
      * and stores them in the byte array {@code buffer} starting at {@code
-     * offset}. Blocks until {@code count} bytes have been read, the end of the
-     * file is reached or an exception is thrown.
+     * byteOffset}. Blocks until at least one byte has been
+     * read, the end of the file is detected, or an exception is thrown.
      *
-     * @param buffer
-     *            the array in which to store the bytes read from this file.
-     * @param offset
-     *            the initial position in {@code buffer} to store the bytes read
-     *            from this file.
-     * @param count
-     *            the maximum number of bytes to store in {@code buffer}.
      * @return the number of bytes actually read or -1 if the end of the stream
      *         has been reached.
      * @throws IndexOutOfBoundsException
-     *             if {@code offset < 0} or {@code count < 0}, or if {@code
-     *             offset + count} is greater than the size of {@code buffer}.
+     *             if {@code byteOffset < 0} or {@code byteCount < 0}, or if {@code
+     *             byteOffset + byteCount} is greater than the size of {@code buffer}.
      * @throws IOException
      *             if this file is closed or another I/O error occurs.
      */
-    public int read(byte[] buffer, int offset, int count) throws IOException {
-        Arrays.checkOffsetAndCount(buffer.length, offset, count);
-        if (count == 0) {
-            return 0;
-        }
-        openCheck();
-        return (int) Platform.FILE_SYSTEM.read(fd.descriptor, buffer, offset, count);
+    public int read(byte[] buffer, int byteOffset, int byteCount) throws IOException {
+        return IoUtils.read(fd, buffer, byteOffset, byteCount);
     }
 
     /**
@@ -481,7 +436,7 @@
      */
     public final int readInt() throws IOException {
         readFully(scratch, 0, SizeOf.INT);
-        return OSMemory.peekInt(scratch, 0, ByteOrder.BIG_ENDIAN);
+        return Memory.peekInt(scratch, 0, ByteOrder.BIG_ENDIAN);
     }
 
     /**
@@ -542,7 +497,7 @@
      */
     public final long readLong() throws IOException {
         readFully(scratch, 0, SizeOf.LONG);
-        return OSMemory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN);
+        return Memory.peekLong(scratch, 0, ByteOrder.BIG_ENDIAN);
     }
 
     /**
@@ -559,7 +514,7 @@
      */
     public final short readShort() throws IOException {
         readFully(scratch, 0, SizeOf.SHORT);
-        return OSMemory.peekShort(scratch, 0, ByteOrder.BIG_ENDIAN);
+        return Memory.peekShort(scratch, 0, ByteOrder.BIG_ENDIAN);
     }
 
     /**
@@ -642,11 +597,13 @@
      */
     public void seek(long offset) throws IOException {
         if (offset < 0) {
-            // seek position is negative
             throw new IOException("offset < 0: " + offset);
         }
-        openCheck();
-        Platform.FILE_SYSTEM.seek(fd.descriptor, offset, IFileSystem.SEEK_SET);
+        try {
+            Libcore.os.lseek(fd, offset, SEEK_SET);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
     }
 
     /**
@@ -664,11 +621,14 @@
      *             if this file is closed or another I/O error occurs.
      */
     public void setLength(long newLength) throws IOException {
-        openCheck();
         if (newLength < 0) {
             throw new IllegalArgumentException("newLength < 0");
         }
-        Platform.FILE_SYSTEM.truncate(fd.descriptor, newLength);
+        try {
+            Libcore.os.ftruncate(fd, newLength);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
 
         long filePointer = getFilePointer();
         if (filePointer > newLength) {
@@ -717,30 +677,18 @@
     }
 
     /**
-     * Writes {@code count} bytes from the byte array {@code buffer} to this
-     * file, starting at the current file pointer and using {@code offset} as
+     * Writes {@code byteCount} bytes from the byte array {@code buffer} to this
+     * file, starting at the current file pointer and using {@code byteOffset} as
      * the first position within {@code buffer} to get bytes.
      *
-     * @param buffer
-     *            the buffer to write to this file.
-     * @param offset
-     *            the index of the first byte in {@code buffer} to write.
-     * @param count
-     *            the number of bytes from {@code buffer} to write.
      * @throws IndexOutOfBoundsException
-     *             if {@code count < 0}, {@code offset < 0} or {@code count +
-     *             offset} is greater than the size of {@code buffer}.
+     *             if {@code byteCount < 0}, {@code byteOffset < 0} or {@code byteCount +
+     *             byteOffset} is greater than the size of {@code buffer}.
      * @throws IOException
      *             if an I/O error occurs while writing to this file.
      */
-    public void write(byte[] buffer, int offset, int count) throws IOException {
-        Arrays.checkOffsetAndCount(buffer.length, offset, count);
-        if (count == 0) {
-            return;
-        }
-        openCheck();
-        Platform.FILE_SYSTEM.write(fd.descriptor, buffer, offset, count);
-
+    public void write(byte[] buffer, int byteOffset, int byteCount) throws IOException {
+        IoUtils.write(fd, buffer, byteOffset, byteCount);
         // if we are in "rws" mode, attempt to sync file+metadata
         if (syncMetadata) {
             fd.sync();
@@ -758,14 +706,8 @@
      * @see #read()
      */
     public void write(int oneByte) throws IOException {
-        openCheck();
         scratch[0] = (byte) (oneByte & 0xff);
-        Platform.FILE_SYSTEM.write(fd.descriptor, scratch, 0, 1);
-
-        // if we are in "rws" mode, attempt to sync file+metadata
-        if (syncMetadata) {
-            fd.sync();
-        }
+        write(scratch, 0, 1);
     }
 
     /**
@@ -884,7 +826,7 @@
      * @see #readInt()
      */
     public final void writeInt(int val) throws IOException {
-        OSMemory.pokeInt(scratch, 0, val, ByteOrder.BIG_ENDIAN);
+        Memory.pokeInt(scratch, 0, val, ByteOrder.BIG_ENDIAN);
         write(scratch, 0, SizeOf.INT);
     }
 
@@ -899,7 +841,7 @@
      * @see #readLong()
      */
     public final void writeLong(long val) throws IOException {
-        OSMemory.pokeLong(scratch, 0, val, ByteOrder.BIG_ENDIAN);
+        Memory.pokeLong(scratch, 0, val, ByteOrder.BIG_ENDIAN);
         write(scratch, 0, SizeOf.LONG);
     }
 
@@ -916,7 +858,7 @@
      * @see DataInput#readUnsignedShort()
      */
     public final void writeShort(int val) throws IOException {
-        OSMemory.pokeShort(scratch, 0, (short) val, ByteOrder.BIG_ENDIAN);
+        Memory.pokeShort(scratch, 0, (short) val, ByteOrder.BIG_ENDIAN);
         write(scratch, 0, SizeOf.SHORT);
     }
 
diff --git a/luni/src/main/java/java/io/Reader.java b/luni/src/main/java/java/io/Reader.java
index 82f3ac5..310a57c 100644
--- a/luni/src/main/java/java/io/Reader.java
+++ b/luni/src/main/java/java/io/Reader.java
@@ -47,7 +47,6 @@
      * synchronize critical sections.
      */
     protected Reader() {
-        super();
         lock = this;
     }
 
@@ -143,9 +142,6 @@
      *             if this reader is closed or some other I/O error occurs.
      */
     public int read(char[] buf) throws IOException {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         return read(buf, 0, buf.length);
     }
 
@@ -167,11 +163,7 @@
      * @throws IOException
      *             if this reader is closed or some other I/O error occurs.
      */
-    public abstract int read(char[] buf, int offset, int count)
-            throws IOException;
-    // BEGIN android-note
-    // changed array notation to be consistent with the rest of harmony
-    // END android-note
+    public abstract int read(char[] buf, int offset, int count) throws IOException;
 
     /**
      * Indicates whether this reader is ready to be read without blocking.
diff --git a/luni/src/main/java/java/io/StreamCorruptedException.java b/luni/src/main/java/java/io/StreamCorruptedException.java
index a92b1bb..5768a89 100644
--- a/luni/src/main/java/java/io/StreamCorruptedException.java
+++ b/luni/src/main/java/java/io/StreamCorruptedException.java
@@ -35,7 +35,6 @@
      * filled in.
      */
     public StreamCorruptedException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/StreamTokenizer.java b/luni/src/main/java/java/io/StreamTokenizer.java
index 36c42bf..0522be6 100644
--- a/luni/src/main/java/java/io/StreamTokenizer.java
+++ b/luni/src/main/java/java/io/StreamTokenizer.java
@@ -17,6 +17,8 @@
 
 package java.io;
 
+import java.util.Locale;
+
 /**
  * Parses a stream into a set of defined tokens, one at a time. The different
  * types of tokens that can be found are numbers, identifiers, quoted strings,
@@ -346,8 +348,10 @@
                 }
             }
             peekChar = currentChar;
-            sval = forceLowercase ? word.toString().toLowerCase() : word
-                    .toString();
+            sval = word.toString();
+            if (forceLowercase) {
+                sval = sval.toLowerCase(Locale.getDefault());
+            }
             return (ttype = TT_WORD);
         }
         // Check for quoted character
diff --git a/luni/src/main/java/java/io/StringReader.java b/luni/src/main/java/java/io/StringReader.java
index 635686e..9f8ff13 100644
--- a/luni/src/main/java/java/io/StringReader.java
+++ b/luni/src/main/java/java/io/StringReader.java
@@ -43,7 +43,6 @@
      *            the source string for this reader.
      */
     public StringReader(String str) {
-        super();
         this.str = str;
         this.count = str.length();
     }
diff --git a/luni/src/main/java/java/io/StringWriter.java b/luni/src/main/java/java/io/StringWriter.java
index 7a74eea..f0b1d18 100644
--- a/luni/src/main/java/java/io/StringWriter.java
+++ b/luni/src/main/java/java/io/StringWriter.java
@@ -38,7 +38,6 @@
      * writer.
      */
     public StringWriter() {
-        super();
         buf = new StringBuffer(16);
         lock = buf;
     }
diff --git a/luni/src/main/java/java/io/UTFDataFormatException.java b/luni/src/main/java/java/io/UTFDataFormatException.java
index 9fb7518..df56acd 100644
--- a/luni/src/main/java/java/io/UTFDataFormatException.java
+++ b/luni/src/main/java/java/io/UTFDataFormatException.java
@@ -32,7 +32,6 @@
      * filled in.
      */
     public UTFDataFormatException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/UnsupportedEncodingException.java b/luni/src/main/java/java/io/UnsupportedEncodingException.java
index dea0947..f24826b 100644
--- a/luni/src/main/java/java/io/UnsupportedEncodingException.java
+++ b/luni/src/main/java/java/io/UnsupportedEncodingException.java
@@ -30,7 +30,6 @@
      * trace filled in.
      */
     public UnsupportedEncodingException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/io/Writer.java b/luni/src/main/java/java/io/Writer.java
index d1ff429..2e28b80 100644
--- a/luni/src/main/java/java/io/Writer.java
+++ b/luni/src/main/java/java/io/Writer.java
@@ -45,7 +45,6 @@
      * synchronize critical sections.
      */
     protected Writer() {
-        super();
         lock = this;
     }
 
@@ -92,9 +91,6 @@
      *             if this writer is closed or another I/O error occurs.
      */
     public void write(char[] buf) throws IOException {
-        // BEGIN android-note
-        // changed array notation to be consistent with the rest of harmony
-        // END android-note
         write(buf, 0, buf.length);
     }
 
@@ -114,11 +110,7 @@
      * @throws IOException
      *             if this writer is closed or another I/O error occurs.
      */
-    public abstract void write(char[] buf, int offset, int count)
-            throws IOException;
-    // BEGIN android-note
-    // changed array notation to be consistent with the rest of harmony
-    // END android-note
+    public abstract void write(char[] buf, int offset, int count) throws IOException;
 
     /**
      * Writes one character to the target. Only the two least significant bytes
diff --git a/luni/src/main/java/java/lang/AbstractMethodError.java b/luni/src/main/java/java/lang/AbstractMethodError.java
index 4d5238a..a212508 100644
--- a/luni/src/main/java/java/lang/AbstractMethodError.java
+++ b/luni/src/main/java/java/lang/AbstractMethodError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown by the virtual machine when an abstract method is called.
+ * Thrown by the VM when an abstract method is called.
  * <p>
  * Note that this can only occur when inconsistent class files have been loaded,
  * since invoking an abstract method is a compile time error.
@@ -32,7 +32,6 @@
      * stack trace.
      */
     public AbstractMethodError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/AbstractStringBuilder.java b/luni/src/main/java/java/lang/AbstractStringBuilder.java
index 4a7410d..baab47d 100644
--- a/luni/src/main/java/java/lang/AbstractStringBuilder.java
+++ b/luni/src/main/java/java/lang/AbstractStringBuilder.java
@@ -86,9 +86,7 @@
         count = string.length();
         shared = false;
         value = new char[count + INITIAL_CAPACITY];
-        // BEGIN android-changed
         string._getChars(0, count, value, 0);
-        // END android-changed
     }
 
     private void enlargeBuffer(int min) {
@@ -211,11 +209,11 @@
     }
 
     private StringIndexOutOfBoundsException indexAndLength(int index) {
-        throw new StringIndexOutOfBoundsException("index=" + index + " length=" + count);
+        throw new StringIndexOutOfBoundsException(count, index);
     }
 
     private StringIndexOutOfBoundsException startEndAndLength(int start, int end) {
-        throw new StringIndexOutOfBoundsException("start=" + start + " end=" + end + " length=" + count);
+        throw new StringIndexOutOfBoundsException(count, start, end - start);
     }
 
     final void delete0(int start, int end) {
@@ -333,14 +331,15 @@
                 return;
             }
         }
-        throw new StringIndexOutOfBoundsException("index=" + index + " chars.length=" + chars.length
-                + " start=" + start + " length=" + length + " this.length=" + count);
+        throw new StringIndexOutOfBoundsException("this.length=" + count
+                + "; index=" + index + "; chars.length=" + chars.length
+                + "; start=" + start + "; length=" + length);
     }
 
     final void insert0(int index, char ch) {
         if (index < 0 || index > count) {
             // RI compatible exception type
-            throw new ArrayIndexOutOfBoundsException("index=" + index + ", length=" + count);
+            throw new ArrayIndexOutOfBoundsException(count, index);
         }
         move(1, index);
         value[index] = ch;
@@ -355,9 +354,7 @@
             int min = string.length();
             if (min != 0) {
                 move(min, index);
-                // BEGIN android-changed
                 string._getChars(0, min, value, index);
-                // END android-changed
                 count += min;
             }
         } else {
@@ -434,9 +431,7 @@
                     value = value.clone();
                     shared = false;
                 }
-                // BEGIN android-changed
                 string._getChars(0, stringLength, value, start);
-                // END android-changed
                 count -= diff;
                 return;
             }
@@ -602,7 +597,7 @@
             // Remove String sharing for more performance
             return new String(value, start, count - start);
         }
-        throw new StringIndexOutOfBoundsException("start=" + start + " length=" + count);
+        throw indexAndLength(start);
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ArithmeticException.java b/luni/src/main/java/java/lang/ArithmeticException.java
index a6ab2a0..b9c748a 100644
--- a/luni/src/main/java/java/lang/ArithmeticException.java
+++ b/luni/src/main/java/java/lang/ArithmeticException.java
@@ -29,7 +29,6 @@
      * stack trace.
      */
     public ArithmeticException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java b/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
index ea9f748..87a15e5 100644
--- a/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
+++ b/luni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
@@ -30,7 +30,6 @@
      * current stack trace.
      */
     public ArrayIndexOutOfBoundsException() {
-        super();
     }
 
     /**
@@ -42,7 +41,7 @@
      *            the invalid index.
      */
     public ArrayIndexOutOfBoundsException(int index) {
-        super("Array index out of range: " + index);
+        super("index=" + index);
     }
 
     /**
@@ -55,4 +54,22 @@
     public ArrayIndexOutOfBoundsException(String detailMessage) {
         super(detailMessage);
     }
+
+    /**
+     * Used internally for consistent high-quality error reporting.
+     * @hide
+     */
+    public ArrayIndexOutOfBoundsException(int sourceLength, int index) {
+        super("length=" + sourceLength + "; index=" + index);
+    }
+
+    /**
+     * Used internally for consistent high-quality error reporting.
+     * @hide
+     */
+    public ArrayIndexOutOfBoundsException(int sourceLength, int offset,
+            int count) {
+        super("length=" + sourceLength + "; regionStart=" + offset
+                + "; regionLength=" + count);
+    }
 }
diff --git a/luni/src/main/java/java/lang/ArrayStoreException.java b/luni/src/main/java/java/lang/ArrayStoreException.java
index 6cb9c8f..b597a10 100644
--- a/luni/src/main/java/java/lang/ArrayStoreException.java
+++ b/luni/src/main/java/java/lang/ArrayStoreException.java
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public ArrayStoreException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/AssertionError.java b/luni/src/main/java/java/lang/AssertionError.java
index 3e36d9f..3d0d2a4 100644
--- a/luni/src/main/java/java/lang/AssertionError.java
+++ b/luni/src/main/java/java/lang/AssertionError.java
@@ -30,7 +30,15 @@
      * Constructs a new {@code AssertionError} with no message.
      */
     public AssertionError() {
-        super();
+    }
+
+    /**
+     * Constructs a new {@code AssertionError} with the given detail message and cause.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public AssertionError(String detailMessage, Throwable cause) {
+        super(detailMessage, cause);
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Boolean.java b/luni/src/main/java/java/lang/Boolean.java
index 8b1cc7a..f95a38b 100644
--- a/luni/src/main/java/java/lang/Boolean.java
+++ b/luni/src/main/java/java/lang/Boolean.java
@@ -40,7 +40,7 @@
     @SuppressWarnings("unchecked")
     public static final Class<Boolean> TYPE
              = (Class<Boolean>) boolean[].class.getComponentType();
-    // Note: This can't be set to "boolean.class", since *that* is
+    // Note: Boolean.TYPE can't be set to "boolean.class", since *that* is
     // defined to be "java.lang.Boolean.TYPE";
 
     /**
@@ -121,7 +121,18 @@
      * @since 1.5
      */
     public int compareTo(Boolean that) {
-        return value == that.value ? 0 : value ? 1 : -1;
+        return compare(value, that.value);
+    }
+
+    /**
+     * Compares two {@code boolean} values.
+     * @return 0 if lhs = rhs, less than 0 if lhs &lt; rhs, and greater than 0 if lhs &gt; rhs.
+     *         (Where true &gt; false.)
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int compare(boolean lhs, boolean rhs) {
+        return lhs == rhs ? 0 : lhs ? 1 : -1;
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Byte.java b/luni/src/main/java/java/lang/Byte.java
index ff36aac..7e0b293 100644
--- a/luni/src/main/java/java/lang/Byte.java
+++ b/luni/src/main/java/java/lang/Byte.java
@@ -55,7 +55,7 @@
     @SuppressWarnings("unchecked")
     public static final Class<Byte> TYPE
             = (Class<Byte>) byte[].class.getComponentType();
-    // Note: This can't be set to "byte.class", since *that* is
+    // Note: Byte.TYPE can't be set to "byte.class", since *that* is
     // defined to be "java.lang.Byte.TYPE";
 
     /**
@@ -105,7 +105,17 @@
      * @since 1.2
      */
     public int compareTo(Byte object) {
-        return value > object.value ? 1 : (value < object.value ? -1 : 0);
+        return compare(value, object.value);
+    }
+
+    /**
+     * Compares two {@code byte} values.
+     * @return 0 if lhs = rhs, less than 0 if lhs &lt; rhs, and greater than 0 if lhs &gt; rhs.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int compare(byte lhs, byte rhs) {
+        return lhs > rhs ? 1 : (lhs < rhs ? -1 : 0);
     }
 
     /**
@@ -219,6 +229,14 @@
     }
 
     /**
+     * Returns a two-digit hex string. That is, -1 becomes "ff" or "FF" and 2 becomes "02".
+     * @hide internal use only
+     */
+    public static String toHexString(byte b, boolean upperCase) {
+        return IntegralToString.byteToHexString(b, upperCase);
+    }
+
+    /**
      * Returns a string containing a concise, human-readable description of the
      * specified byte value.
      *
diff --git a/luni/src/main/java/java/lang/Character.java b/luni/src/main/java/java/lang/Character.java
index 0caabba..e503420 100644
--- a/luni/src/main/java/java/lang/Character.java
+++ b/luni/src/main/java/java/lang/Character.java
@@ -127,8 +127,7 @@
     @SuppressWarnings("unchecked")
     public static final Class<Character> TYPE
             = (Class<Character>) char[].class.getComponentType();
-
-    // Note: This can't be set to "char.class", since *that* is
+    // Note: Character.TYPE can't be set to "char.class", since *that* is
     // defined to be "java.lang.Character.TYPE";
 
     /**
@@ -1515,7 +1514,7 @@
                         blockName.equals("CombiningMarksforSymbols")) {
                     return COMBINING_MARKS_FOR_SYMBOLS;
                 }
-                throw new IllegalArgumentException();
+                throw new IllegalArgumentException("Bad block name: " + blockName);
             }
             return BLOCKS[block];
         }
@@ -1545,14 +1544,11 @@
          * @return the {@code UnicodeBlock} constant for the block that contains
          *         {@code codePoint}, or {@code null} if {@code codePoint} does
          *         not belong to any defined block.
-         * @throws IllegalArgumentException
-         *             if {@code codePoint} is not a valid Unicode code point.
+         * @throws IllegalArgumentException if {@code codePoint} is not a valid code point.
          * @since 1.5
          */
         public static UnicodeBlock of(int codePoint) {
-            if (!isValidCodePoint(codePoint)) {
-                throw new IllegalArgumentException();
-            }
+            checkValidCodePoint(codePoint);
             int block = ofImpl(codePoint);
             if (block == -1 || block >= BLOCKS.length) {
                 return null;
@@ -1589,6 +1585,12 @@
         return value;
     }
 
+    private static void checkValidCodePoint(int codePoint) {
+        if (!isValidCodePoint(codePoint)) {
+            throw new IllegalArgumentException("Invalid code point: " + codePoint);
+        }
+    }
+
     /**
      * Compares this object to the specified character object to determine their
      * relative order.
@@ -1604,7 +1606,17 @@
      * @since 1.2
      */
     public int compareTo(Character c) {
-        return value - c.value;
+        return compare(value, c.value);
+    }
+
+    /**
+     * Compares two {@code char} values.
+     * @return 0 if lhs = rhs, less than 0 if lhs &lt; rhs, and greater than 0 if lhs &gt; rhs.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int compare(char lhs, char rhs) {
+        return lhs - rhs;
     }
 
     /**
@@ -1693,6 +1705,15 @@
     }
 
     /**
+     * Tests whether the given character is a high or low surrogate.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static boolean isSurrogate(char ch) {
+        return ch >= MIN_SURROGATE && ch <= MAX_SURROGATE;
+    }
+
+    /**
      * Indicates whether the specified character pair is a valid surrogate pair.
      *
      * @param high
@@ -2020,8 +2041,7 @@
      * @param dstIndex
      *            the index in {@code dst} from where to start copying.
      * @return the number of {@code char} value units copied into {@code dst}.
-     * @throws IllegalArgumentException
-     *             if {@code codePoint} is not a valid Unicode code point.
+     * @throws IllegalArgumentException if {@code codePoint} is not a valid code point.
      * @throws NullPointerException
      *             if {@code dst} is {@code null}.
      * @throws IndexOutOfBoundsException
@@ -2032,9 +2052,7 @@
      * @since 1.5
      */
     public static int toChars(int codePoint, char[] dst, int dstIndex) {
-        if (!isValidCodePoint(codePoint)) {
-            throw new IllegalArgumentException();
-        }
+        checkValidCodePoint(codePoint);
         if (dst == null) {
             throw new NullPointerException();
         }
@@ -2070,15 +2088,11 @@
      *         {@link #isSupplementaryCodePoint(int) supplementary code point},
      *         then the returned array contains two characters, otherwise it
      *         contains just one character.
-     * @throws IllegalArgumentException
-     *             if {@code codePoint} is not a valid Unicode code point.
+     * @throws IllegalArgumentException if {@code codePoint} is not a valid code point.
      * @since 1.5
      */
     public static char[] toChars(int codePoint) {
-        if (!isValidCodePoint(codePoint)) {
-            throw new IllegalArgumentException();
-        }
-
+        checkValidCodePoint(codePoint);
         if (isSupplementaryCodePoint(codePoint)) {
             int cpPrime = codePoint - 0x10000;
             int high = 0xD800 | ((cpPrime >> 10) & 0x3FF);
@@ -2418,6 +2432,40 @@
     }
 
     /**
+     * Returns the name of the given code point, or null if the code point is unassigned.
+     *
+     * <p>As a fallback mechanism this method returns strings consisting of the Unicode
+     * block name (with underscores replaced by spaces), a single space, and the uppercase
+     * hex value of the code point, using as few digits as necessary.
+     *
+     * <p>Examples:
+     * <ul>
+     * <li>{@code Character.getName(0)} returns "NULL".
+     * <li>{@code Character.getName('e')} returns "LATIN SMALL LETTER E".
+     * <li>{@code Character.getName('\u0666')} returns "ARABIC-INDIC DIGIT SIX".
+     * <li>{@code Character.getName(0xe000)} returns "PRIVATE USE AREA E000".
+     * </ul>
+     *
+     * @throws IllegalArgumentException if {@code codePoint} is not a valid code point.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static String getName(int codePoint) {
+        checkValidCodePoint(codePoint);
+        if (getType(codePoint) == Character.UNASSIGNED) {
+            return null;
+        }
+        String result = getNameImpl(codePoint);
+        if (result == null) {
+            String blockName = Character.UnicodeBlock.of(codePoint).toString().replace('_', ' ');
+            result = blockName + " " + IntegralToString.intToHexString(codePoint, true);
+        }
+        return result;
+    }
+
+    private static native String getNameImpl(int codePoint);
+
+    /**
      * Returns the numeric value of the specified Unicode character.
      * See {@link #getNumericValue(int)}.
      *
@@ -2568,6 +2616,36 @@
     }
 
     /**
+     * Returns the high surrogate for the given code point. The result is meaningless if
+     * the given code point is not a supplementary character.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static char highSurrogate(int codePoint) {
+        return (char) ((codePoint >> 10) + 0xd7c0);
+    }
+
+    /**
+     * Returns the low surrogate for the given code point. The result is meaningless if
+     * the given code point is not a supplementary character.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static char lowSurrogate(int codePoint) {
+        return (char) ((codePoint & 0x3ff) | 0xdc00);
+    }
+
+    /**
+     * Tests whether the given code point is in the Basic Multilingual Plane (BMP).
+     * Such code points can be represented by a single {@code char}.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static boolean isBmpCodePoint(int codePoint) {
+        return codePoint >= 0 && codePoint <= 0xffff;
+    }
+
+    /**
      * Indicates whether the specified character is defined in the Unicode
      * specification.
      *
@@ -2694,9 +2772,7 @@
      *         {@code false} otherwise.
      */
     public static boolean isJavaIdentifierPart(char c) {
-        // BEGIN android-changed
         return isJavaIdentifierPart((int) c);
-        // END android-changed
     }
 
     /**
@@ -2709,8 +2785,7 @@
      *         {@code false} otherwise.
      */
     public static boolean isJavaIdentifierPart(int codePoint) {
-        // BEGIN android-changed: use precomputed bitmasks for the ASCII range.
-        // Optimized case for ASCII
+        // Use precomputed bitmasks to optimize the ASCII range.
         if (codePoint < 64) {
             return (0x3ff00100fffc1ffL & (1L << codePoint)) != 0;
         } else if (codePoint < 128) {
@@ -2723,7 +2798,6 @@
                 || type == COMBINING_SPACING_MARK || type == NON_SPACING_MARK
                 || (codePoint >= 0 && codePoint <= 8) || (codePoint >= 0xe && codePoint <= 0x1b)
                 || (codePoint >= 0x7f && codePoint <= 0x9f) || type == FORMAT;
-        // END android-changed
     }
 
     /**
@@ -2736,9 +2810,7 @@
      *         identifier; {@code false} otherwise.
      */
     public static boolean isJavaIdentifierStart(char c) {
-        // BEGIN android-changed
         return isJavaIdentifierStart((int) c);
-        // END android-changed
     }
 
     /**
@@ -2751,8 +2823,7 @@
      *         identifier; {@code false} otherwise.
      */
     public static boolean isJavaIdentifierStart(int codePoint) {
-        // BEGIN android-changed: use precomputed bitmasks for the ASCII range.
-        // Optimized case for ASCII
+        // Use precomputed bitmasks to optimize the ASCII range.
         if (codePoint < 64) {
             return (codePoint == '$'); // There's only one character in this range.
         } else if (codePoint < 128) {
@@ -2761,7 +2832,6 @@
         int type = getType(codePoint);
         return (type >= UPPERCASE_LETTER && type <= OTHER_LETTER) || type == CURRENCY_SYMBOL
                 || type == CONNECTOR_PUNCTUATION || type == LETTER_NUMBER;
-        // END android-changed
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Class.java b/luni/src/main/java/java/lang/Class.java
index 3058305..b6183a5 100644
--- a/luni/src/main/java/java/lang/Class.java
+++ b/luni/src/main/java/java/lang/Class.java
@@ -35,10 +35,8 @@
 import dalvik.system.VMStack;
 import java.io.InputStream;
 import java.io.Serializable;
-import static java.lang.ClassMembers.REFLECT;
 import java.lang.annotation.Annotation;
 import java.lang.annotation.Inherited;
-import java.lang.reflect.AccessibleObject;
 import java.lang.reflect.AnnotatedElement;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
@@ -50,8 +48,13 @@
 import java.lang.reflect.TypeVariable;
 import java.net.URL;
 import java.security.ProtectionDomain;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.List;
+import libcore.util.CollectionUtils;
+import libcore.util.EmptyArray;
 import org.apache.harmony.kernel.vm.StringUtils;
 import org.apache.harmony.luni.lang.reflect.GenericSignatureParser;
 import org.apache.harmony.luni.lang.reflect.Types;
@@ -116,11 +119,6 @@
     private static final long serialVersionUID = 3206093459760846163L;
 
     /**
-     * This field is initialized by dalvikvm when the class is loaded.
-     */
-    private transient ProtectionDomain pd;
-
-    /**
      * Lazily computed name of this class; always prefer calling getName().
      */
     private transient String name;
@@ -206,14 +204,6 @@
             ClassLoader classLoader) throws ClassNotFoundException {
 
         if (classLoader == null) {
-            SecurityManager smgr = System.getSecurityManager();
-            if (smgr != null) {
-                ClassLoader calling = VMStack.getCallingClassLoader();
-                if (calling != null) {
-                    smgr.checkPermission(new RuntimePermission("getClassLoader"));
-                }
-            }
-
             classLoader = ClassLoader.getSystemClassLoader();
         }
         // Catch an Exception thrown by the underlying native code. It wraps
@@ -257,30 +247,30 @@
      * of length 0 is returned.
      *
      * @return the public class members of the class represented by this object.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      */
     public Class<?>[] getClasses() {
         return getFullListOfClasses(true);
     }
 
-    /**
-     * Returns the annotation of the given type. If there is no such annotation
-     * then the method returns {@code null}.
-     *
-     * @param annotationClass
-     *            the annotation type.
-     * @return the annotation of the given type, or {@code null} if there is no
-     *         such annotation.
-     */
-    @SuppressWarnings("unchecked")
-    public <A extends Annotation> A getAnnotation(Class<A> annotationClass) {
-        for (Annotation annotation : getAnnotations()) {
-            if (annotationClass.isInstance(annotation)) {
-                return (A) annotation;
+    @Override public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+
+        A annotation = getDeclaredAnnotation(annotationType);
+        if (annotation != null) {
+            return annotation;
+        }
+
+        if (annotationType.isAnnotationPresent(Inherited.class)) {
+            for (Class<?> sup = getSuperclass(); sup != null; sup = sup.getSuperclass()) {
+                annotation = sup.getDeclaredAnnotation(annotationType);
+                if (annotation != null) {
+                    return annotation;
+                }
             }
         }
+
         return null;
     }
 
@@ -376,44 +366,30 @@
      * representation of the bootstrap class loader.
      *
      * @return the class loader for the represented class.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow accessing
-     *             the class loader.
      * @see ClassLoader
      */
     public ClassLoader getClassLoader() {
-        SecurityManager smgr = System.getSecurityManager();
-        ClassLoader loader = getClassLoaderImpl();
-        if (smgr != null && loader != null) {
-            ClassLoader calling = VMStack.getCallingClassLoader();
-
-            if (calling != null && !calling.isAncestorOf(loader)) {
-                smgr.checkPermission(new RuntimePermission("getClassLoader"));
-            }
-        }
-
         if (this.isPrimitive()) {
             return null;
         }
 
+        ClassLoader loader = getClassLoaderImpl();
         if (loader == null) {
             loader = BootClassLoader.getInstance();
         }
-
         return loader;
     }
 
     /**
      * This must be provided by the VM vendor, as it is used by other provided
      * class implementations in this package. Outside of this class, it is used
-     * by SecurityManager.checkMemberAccess(), classLoaderDepth(),
+     * by SecurityManager.classLoaderDepth(),
      * currentClassLoader() and currentLoadedClass(). Return the ClassLoader for
      * this Class without doing any security checks. The bootstrap ClassLoader
      * is returned, unlike getClassLoader() which returns null in place of the
      * bootstrap ClassLoader.
      *
      * @return the ClassLoader
-     * @see ClassLoader#isSystemClassLoader()
      */
     ClassLoader getClassLoaderImpl() {
         ClassLoader loader = getClassLoader(this);
@@ -448,16 +424,64 @@
      * @return the constructor described by {@code parameterTypes}.
      * @throws NoSuchMethodException
      *             if the constructor can not be found.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getDeclaredConstructor(Class[])
      */
     @SuppressWarnings("unchecked")
-    public Constructor<T> getConstructor(Class<?>... parameterTypes) throws NoSuchMethodException,
-            SecurityException {
-        return (Constructor) ClassMembers.getConstructorOrMethod(
-                this, "<init>", false, true, parameterTypes);
+    public Constructor<T> getConstructor(Class<?>... parameterTypes) throws NoSuchMethodException {
+        return (Constructor) getConstructorOrMethod("<init>", false, true, parameterTypes);
+    }
+
+    /**
+     * Returns a constructor or method with the specified name.
+     *
+     * @param name the method name, or "<init>" to return a constructor.
+     * @param recursive true to search supertypes.
+     */
+    private Member getConstructorOrMethod(String name, boolean recursive,
+            boolean publicOnly, Class<?>[] parameterTypes) throws NoSuchMethodException {
+        if (recursive && !publicOnly) {
+            throw new AssertionError(); // can't lookup non-public members recursively
+        }
+        if (name == null) {
+            throw new NullPointerException("name == null");
+        }
+        if (parameterTypes == null) {
+            parameterTypes = EmptyArray.CLASS;
+        }
+        for (Class<?> c : parameterTypes) {
+            if (c == null) {
+                throw new NoSuchMethodException("parameter type is null");
+            }
+        }
+        Member result = recursive
+                ? getPublicConstructorOrMethodRecursive(name, parameterTypes)
+                : Class.getDeclaredConstructorOrMethod(this, name, parameterTypes);
+        if (result == null || publicOnly && (result.getModifiers() & Modifier.PUBLIC) == 0) {
+            throw new NoSuchMethodException(name + " " + Arrays.toString(parameterTypes));
+        }
+        return result;
+    }
+
+    private Member getPublicConstructorOrMethodRecursive(String name, Class<?>[] parameterTypes) {
+        // search superclasses
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            Member result = Class.getDeclaredConstructorOrMethod(c, name, parameterTypes);
+            if (result != null && (result.getModifiers() & Modifier.PUBLIC) != 0) {
+                return result;
+            }
+        }
+
+        // search implemented interfaces
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            for (Class<?> ifc : c.getInterfaces()) {
+                Member result = ifc.getPublicConstructorOrMethodRecursive(name, parameterTypes);
+                if (result != null && (result.getModifiers() & Modifier.PUBLIC) != 0) {
+                    return result;
+                }
+            }
+        }
+
+        return null;
     }
 
     /**
@@ -468,12 +492,9 @@
      *
      * @return an array with the public constructors of the class represented by
      *         this {@code Class}.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getDeclaredConstructors()
      */
-    public Constructor<?>[] getConstructors() throws SecurityException {
+    public Constructor<?>[] getConstructors() {
         return getDeclaredConstructors(this, true);
     }
 
@@ -490,6 +511,16 @@
     native public Annotation[] getDeclaredAnnotations();
 
     /**
+     * Returns the annotation if it exists.
+     */
+    native private <A extends Annotation> A getDeclaredAnnotation(Class<A> annotationClass);
+
+    /**
+     * Returns true if the annotation exists.
+     */
+    native private boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationClass);
+
+    /**
      * Returns an array containing {@code Class} objects for all classes and
      * interfaces that are declared as members of the class which this {@code
      * Class} represents. If there are no classes or interfaces declared or if
@@ -498,11 +529,8 @@
      *
      * @return an array with {@code Class} objects for all the classes and
      *         interfaces that are used in member declarations.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      */
-    public Class<?>[] getDeclaredClasses() throws SecurityException {
+    public Class<?>[] getDeclaredClasses() {
         return getDeclaredClasses(this, false);
     }
 
@@ -539,8 +567,7 @@
      * @param publicOnly reflects whether we want only public member or all of them
      * @return the class' class members
      */
-    native private static Class<?>[] getDeclaredClasses(Class<?> clazz,
-        boolean publicOnly);
+    private static native Class<?>[] getDeclaredClasses(Class<?> clazz, boolean publicOnly);
 
     /**
      * Returns a {@code Constructor} object which represents the constructor
@@ -553,16 +580,12 @@
      * @return the constructor described by {@code parameterTypes}.
      * @throws NoSuchMethodException
      *             if the requested constructor can not be found.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getConstructor(Class[])
      */
     @SuppressWarnings("unchecked")
     public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes)
-            throws NoSuchMethodException, SecurityException {
-        return (Constructor) ClassMembers.getConstructorOrMethod(
-                this, "<init>", false, false, parameterTypes);
+            throws NoSuchMethodException {
+        return (Constructor) getConstructorOrMethod("<init>", false, false, parameterTypes);
     }
 
     /**
@@ -573,13 +596,9 @@
      *
      * @return an array with the constructors declared in the class represented
      *         by this {@code Class}.
-     *
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getConstructors()
      */
-    public Constructor<?>[] getDeclaredConstructors() throws SecurityException {
+    public Constructor<?>[] getDeclaredConstructors() {
         return getDeclaredConstructors(this, false);
     }
 
@@ -591,31 +610,27 @@
      * @param publicOnly reflects whether we want only public constructors or all of them
      * @return the list of constructors
      */
-    private static native <T> Constructor<T>[] getDeclaredConstructors(Class<T> clazz, boolean publicOnly);
+    private static native <T> Constructor<T>[] getDeclaredConstructors(
+            Class<T> clazz, boolean publicOnly);
 
     /**
      * Returns a {@code Field} object for the field with the specified name
      * which is declared in the class represented by this {@code Class}.
      *
-     * @param name
-     *            the name of the requested field.
+     * @param name the name of the requested field.
      * @return the requested field in the class represented by this class.
-     * @throws NoSuchFieldException
-     *             if the requested field can not be found.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
+     * @throws NoSuchFieldException if the requested field can not be found.
      * @see #getField(String)
      */
-    public Field getDeclaredField(String name) throws NoSuchFieldException, SecurityException {
-        Field[] fields = getClassMembers().getDeclaredFields();
-        Field field = findFieldByName(fields, name);
-
-        /*
-         * Make a copy of the private (to the package) object, so that
-         * setAccessible() won't alter the private instance.
-         */
-        return REFLECT.clone(field);
+    public Field getDeclaredField(String name) throws NoSuchFieldException {
+        if (name == null) {
+            throw new NullPointerException("name == null");
+        }
+        Field result = getDeclaredField(this, name);
+        if (result == null) {
+            throw new NoSuchFieldException(name);
+        }
+        return result;
     }
 
     /**
@@ -626,15 +641,10 @@
      *
      * @return an array with the fields declared in the class represented by
      *         this class.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getFields()
      */
-    public Field[] getDeclaredFields() throws SecurityException {
-        // Return a copy of the private (to the package) array.
-        Field[] fields = getClassMembers().getDeclaredFields();
-        return ClassMembers.deepCopy(fields);
+    public Field[] getDeclaredFields() {
+        return getDeclaredFields(this, false);
     }
 
     /*
@@ -648,6 +658,12 @@
     static native Field[] getDeclaredFields(Class<?> clazz, boolean publicOnly);
 
     /**
+     * Returns the field if it is defined by {@code clazz}; null otherwise. This
+     * may return a non-public member.
+     */
+    static native Field getDeclaredField(Class<?> clazz, String name);
+
+    /**
      * Returns a {@code Method} object which represents the method matching the
      * specified name and parameter types that is declared by the class
      * represented by this {@code Class}.
@@ -662,15 +678,11 @@
      *             if the requested constructor can not be found.
      * @throws NullPointerException
      *             if {@code name} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getMethod(String, Class[])
      */
     public Method getDeclaredMethod(String name, Class<?>... parameterTypes)
-            throws NoSuchMethodException, SecurityException {
-        Member member = ClassMembers.getConstructorOrMethod(
-                this, name, false, false, parameterTypes);
+            throws NoSuchMethodException {
+        Member member = getConstructorOrMethod(name, false, false, parameterTypes);
         if (member instanceof Constructor) {
             throw new NoSuchMethodException(name);
         }
@@ -685,15 +697,10 @@
      *
      * @return an array with the methods declared in the class represented by
      *         this {@code Class}.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getMethods()
      */
-    public Method[] getDeclaredMethods() throws SecurityException {
-        // Return a copy of the private (to the package) array.
-        Method[] methods = getClassMembers().getDeclaredMethods();
-        return ClassMembers.deepCopy(methods);
+    public Method[] getDeclaredMethods() {
+        return getDeclaredMethods(this, false);
     }
 
     /**
@@ -708,16 +715,7 @@
      *
      * @param name the method name, or "<init>" to get a constructor.
      */
-    static native Member getDeclaredConstructorOrMethod(
-            Class clazz, String name, Class[] args);
-
-    /**
-     * Returns the {@link ClassMembers} for this instance.
-     */
-    @SuppressWarnings("unchecked") // cache key and value types always agree
-    ClassMembers<T> getClassMembers() {
-        return (ClassMembers<T>) ClassMembers.cache.get(this);
-    }
+    static native Member getDeclaredConstructorOrMethod(Class clazz, String name, Class[] args);
 
     /**
      * Returns the declaring {@code Class} of this {@code Class}. Returns
@@ -759,16 +757,12 @@
      *
      * @return an array with the {@code enum} constants or {@code null}.
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("unchecked") // we only cast after confirming that this class is an enum
     public T[] getEnumConstants() {
-        if (isEnum()) {
-            T[] values = getClassMembers().getEnumValuesInOrder();
-
-            // Copy the private (to the package) array.
-            return values.clone();
+        if (!isEnum()) {
+            return null;
         }
-
-        return null;
+        return (T[]) Enum.getSharedConstants((Class) this).clone();
     }
 
     /**
@@ -782,40 +776,39 @@
      * @return the public field specified by {@code name}.
      * @throws NoSuchFieldException
      *             if the field can not be found.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getDeclaredField(String)
      */
-    public Field getField(String name) throws NoSuchFieldException, SecurityException {
-        Field[] fields = getClassMembers().getAllPublicFields();
-        Field field = findFieldByName(fields, name);
-
-        /*
-         * Make a copy of the private (to the package) object, so that
-         * setAccessible() won't alter the private instance.
-         */
-        return REFLECT.clone(field);
-    }
-
-    /**
-     * Finds and returns a field with a given name and signature. Use
-     * this with one of the field lists returned by instances of ClassMembers.
-     *
-     * @param list non-null; the list of fields to search through
-     * @return non-null; the matching field
-     * @throws NoSuchFieldException thrown if the field does not exist
-     */
-    private Field findFieldByName(Field[] list, String name) throws NoSuchFieldException {
+    public Field getField(String name) throws NoSuchFieldException {
         if (name == null) {
             throw new NullPointerException("name == null");
         }
-        for (Field field : list) {
-            if (field.getName().equals(name)) {
-                return field;
+        Field result = getPublicFieldRecursive(name);
+        if (result == null) {
+            throw new NoSuchFieldException(name);
+        }
+        return result;
+    }
+
+    private Field getPublicFieldRecursive(String name) {
+        // search superclasses
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            Field result = Class.getDeclaredField(c, name);
+            if (result != null && (result.getModifiers() & Modifier.PUBLIC) != 0) {
+                return result;
             }
         }
-        throw new NoSuchFieldException("No field '" + name + "' in " + this);
+
+        // search implemented interfaces
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            for (Class<?> ifc : c.getInterfaces()) {
+                Field result = ifc.getPublicFieldRecursive(name);
+                if (result != null && (result.getModifiers() & Modifier.PUBLIC) != 0) {
+                    return result;
+                }
+            }
+        }
+
+        return null;
     }
 
     /**
@@ -823,22 +816,44 @@
      * for the class C represented by this {@code Class}. Fields may be declared
      * in C, the interfaces it implements or in the superclasses of C. The
      * elements in the returned array are in no particular order.
-     * <p>
-     * If there are no public fields or if this class represents an array class,
+     *
+     * <p>If there are no public fields or if this class represents an array class,
      * a primitive type or {@code void} then an empty array is returned.
-     * </p>
      *
      * @return an array with the public fields of the class represented by this
      *         {@code Class}.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getDeclaredFields()
      */
-    public Field[] getFields() throws SecurityException {
-        // Return a copy of the private (to the package) array.
-        Field[] fields = getClassMembers().getAllPublicFields();
-        return ClassMembers.deepCopy(fields);
+    public Field[] getFields() {
+        List<Field> fields = new ArrayList<Field>();
+        getPublicFieldsRecursive(fields);
+
+        /*
+         * The result may include duplicates when clazz implements an interface
+         * through multiple paths. Remove those duplicates.
+         */
+        CollectionUtils.removeDuplicates(fields, Field.ORDER_BY_NAME_AND_DECLARING_CLASS);
+        return fields.toArray(new Field[fields.size()]);
+    }
+
+    /**
+     * Populates {@code result} with public fields defined by this class, its
+     * superclasses, and all implemented interfaces.
+     */
+    private void getPublicFieldsRecursive(List<Field> result) {
+        // search superclasses
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            for (Field field : Class.getDeclaredFields(c, true)) {
+                result.add(field);
+            }
+        }
+
+        // search implemented interfaces
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            for (Class<?> ifc : c.getInterfaces()) {
+                ifc.getPublicFieldsRecursive(result);
+            }
+        }
     }
 
     /**
@@ -894,14 +909,10 @@
      * @return the public field specified by {@code name}.
      * @throws NoSuchMethodException
      *             if the method can not be found.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getDeclaredMethod(String, Class[])
      */
-    public Method getMethod(String name, Class<?>... parameterTypes) throws NoSuchMethodException,
-            SecurityException {
-        Member member = ClassMembers.getConstructorOrMethod(this, name, true, true, parameterTypes);
+    public Method getMethod(String name, Class<?>... parameterTypes) throws NoSuchMethodException {
+        Member member = getConstructorOrMethod(name, true, true, parameterTypes);
         if (member instanceof Constructor) {
             throw new NoSuchMethodException(name);
         }
@@ -920,15 +931,38 @@
      *
      * @return an array with the methods of the class represented by this
      *         {@code Class}.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
      * @see #getDeclaredMethods()
      */
-    public Method[] getMethods() throws SecurityException {
-        // Return a copy of the private (to the package) array.
-        Method[] methods = getClassMembers().getMethods();
-        return ClassMembers.deepCopy(methods);
+    public Method[] getMethods() {
+        List<Method> methods = new ArrayList<Method>();
+        getPublicMethodsRecursive(methods);
+
+        /*
+         * Remove methods defined by multiple types, preferring to keep methods
+         * declared by derived types.
+         */
+        CollectionUtils.removeDuplicates(methods, Method.ORDER_BY_SIGNATURE);
+        return methods.toArray(new Method[methods.size()]);
+    }
+
+    /**
+     * Populates {@code result} with public methods defined by {@code clazz}, its
+     * superclasses, and all implemented interfaces, including overridden methods.
+     */
+    private void getPublicMethodsRecursive(List<Method> result) {
+        // search superclasses
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            for (Method method : Class.getDeclaredMethods(c, true)) {
+                result.add(method);
+            }
+        }
+
+        // search implemented interfaces
+        for (Class<?> c = this; c != null; c = c.getSuperclass()) {
+            for (Class<?> ifc : c.getInterfaces()) {
+                ifc.getPublicMethodsRecursive(result);
+            }
+        }
     }
 
     /**
@@ -1005,30 +1039,10 @@
     private native String getInnerClassName();
 
     /**
-     * Returns the {@code ProtectionDomain} of the class represented by this
-     * class.
-     * <p>
-     * Note: In order to conserve space in an embedded target like Android, we
-     * allow this method to return {@code null} for classes in the system
-     * protection domain (that is, for system classes). System classes are
-     * always given full permissions (that is, AllPermission). This can not be
-     * changed through the {@link java.security.Policy} class.
-     * </p>
-     *
-     * @return the {@code ProtectionDomain} of the class represented by this
-     *         class.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow member
-     *             access.
+     * Returns null.
      */
     public ProtectionDomain getProtectionDomain() {
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            // Security check is independent of calling class loader.
-            smgr.checkPermission(new RuntimePermission("getProtectionDomain"));
-        }
-
-        return pd;
+        return null;
     }
 
     /**
@@ -1154,17 +1168,24 @@
         return (mod & ACC_ANNOTATION) != 0;
     }
 
-    /**
-     * Indicates whether the specified annotation is present for the class
-     * represented by this {@code Class}.
-     *
-     * @param annotationClass
-     *            the annotation to look for.
-     * @return {@code true} if the class represented by this {@code Class} is
-     *         annotated with {@code annotationClass}; {@code false} otherwise.
-     */
-    public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
-        return getAnnotation(annotationClass) != null;
+    @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+
+        if (isDeclaredAnnotationPresent(annotationType)) {
+            return true;
+        }
+
+        if (annotationType.isDeclaredAnnotationPresent(Inherited.class)) {
+            for (Class<?> sup = getSuperclass(); sup != null; sup = sup.getSuperclass()) {
+                if (sup.isDeclaredAnnotationPresent(annotationType)) {
+                    return true;
+                }
+            }
+        }
+
+        return false;
     }
 
     /**
@@ -1293,21 +1314,17 @@
      *             if the default constructor is not visible.
      * @throws InstantiationException
      *             if the instance can not be created.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow creating
-     *             new instances.
      */
     public T newInstance() throws InstantiationException, IllegalAccessException {
         return newInstanceImpl();
     }
 
-    private native T newInstanceImpl() throws IllegalAccessException,
-            InstantiationException;
+    private native T newInstanceImpl() throws IllegalAccessException, InstantiationException;
 
     @Override
     public String toString() {
         if (isPrimitive()) {
-            return getSimpleName().toLowerCase();
+            return getSimpleName();
         } else {
             return (isInterface() ? "interface " : "class ") + getName();
         }
@@ -1327,9 +1344,8 @@
         if (loader != null) {
             String name = getName();
             int dot = name.lastIndexOf('.');
-            return (dot != -1 ? ClassLoader.getPackage(loader, name.substring(0, dot)) : null);
+            return (dot != -1 ? loader.getPackage(name.substring(0, dot)) : null);
         }
-
         return null;
     }
 
@@ -1387,21 +1403,6 @@
     }
 
     /**
-     * Set the "accessible" flag of the given object, without doing any
-     * access checks.
-     *
-     * <p><b>Note:</b> This method is implemented in native code, and,
-     * as such, is less efficient than using {@link ClassMembers#REFLECT}
-     * to achieve the same goal. This method exists solely to help
-     * bootstrap the reflection bridge.</p>
-     *
-     * @param ao non-null; the object to modify
-     * @param flag the new value for the accessible flag
-     */
-    /*package*/ static native void setAccessibleNoCheck(AccessibleObject ao,
-            boolean flag);
-
-    /**
      * Copies two arrays into one. Assumes that the destination array is large
      * enough.
      *
@@ -1415,42 +1416,4 @@
         System.arraycopy(tail, 0, result, head.length, tail.length);
         return result;
     }
-
-    /**
-     * This must be provided by the vm vendor, as it is used by other provided
-     * class implementations in this package. This method is used by
-     * SecurityManager.classDepth(), and getClassContext() which use the
-     * parameters (-1, false) and SecurityManager.classLoaderDepth(),
-     * currentClassLoader(), and currentLoadedClass() which use the parameters
-     * (-1, true). Walk the stack and answer an array containing the maxDepth
-     * most recent classes on the stack of the calling thread. Starting with the
-     * caller of the caller of getStackClasses(), return an array of not more
-     * than maxDepth Classes representing the classes of running methods on the
-     * stack (including native methods). Frames representing the VM
-     * implementation of java.lang.reflect are not included in the list. If
-     * stopAtPrivileged is true, the walk will terminate at any frame running
-     * one of the following methods: <code><ul>
-     * <li>java/security/AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object;</li>
-     * <li>java/security/AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;</li>
-     * <li>java/security/AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;</li>
-     * <li>java/security/AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;</li>
-     * </ul></code> If one of the doPrivileged methods is found, the walk terminate
-     * and that frame is NOT included in the returned array. Notes:
-     * <ul>
-     * <li>This method operates on the defining classes of methods on stack.
-     * NOT the classes of receivers.</li>
-     * <li>The item at index zero in the result array describes the caller of
-     * the caller of this method.</li>
-     * </ul>
-     *
-     * @param maxDepth
-     *            maximum depth to walk the stack, -1 for the entire stack
-     * @param stopAtPrivileged
-     *            stop at privileged classes
-     * @return the array of the most recent classes on the stack
-     */
-    static Class<?>[] getStackClasses(int maxDepth, boolean stopAtPrivileged) {
-        return VMStack.getClasses(maxDepth, stopAtPrivileged);
-    }
-
 }
diff --git a/luni/src/main/java/java/lang/ClassCastException.java b/luni/src/main/java/java/lang/ClassCastException.java
index 676f1b2..e016d70 100644
--- a/luni/src/main/java/java/lang/ClassCastException.java
+++ b/luni/src/main/java/java/lang/ClassCastException.java
@@ -29,7 +29,6 @@
      * stack trace.
      */
     public ClassCastException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ClassCircularityError.java b/luni/src/main/java/java/lang/ClassCircularityError.java
index 07bf339..5b9a345 100644
--- a/luni/src/main/java/java/lang/ClassCircularityError.java
+++ b/luni/src/main/java/java/lang/ClassCircularityError.java
@@ -19,7 +19,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that an attempt is made to load a
+ * Thrown when the VM notices that an attempt is made to load a
  * class which would directly or indirectly inherit from one of its subclasses.
  * <p>
  * Note that this error can only occur when inconsistent class files are loaded,
@@ -34,7 +34,6 @@
      * stack trace.
      */
     public ClassCircularityError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ClassFormatError.java b/luni/src/main/java/java/lang/ClassFormatError.java
index 009f44a..8d537a8 100644
--- a/luni/src/main/java/java/lang/ClassFormatError.java
+++ b/luni/src/main/java/java/lang/ClassFormatError.java
@@ -30,7 +30,6 @@
      * trace.
      */
     public ClassFormatError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ClassLoader.java b/luni/src/main/java/java/lang/ClassLoader.java
index 44a24f9..2ec066f 100644
--- a/luni/src/main/java/java/lang/ClassLoader.java
+++ b/luni/src/main/java/java/lang/ClassLoader.java
@@ -64,19 +64,16 @@
  */
 public abstract class ClassLoader {
 
-    // BEGIN android-note
-    /*
+    /**
+     * The 'System' ClassLoader - the one that is responsible for loading
+     * classes from the classpath. It is not equal to the bootstrap class loader -
+     * that one handles the built-in classes.
+     *
      * Because of a potential class initialization race between ClassLoader and
      * java.lang.System, reproducible when using JDWP with "suspend=y", we defer
      * creation of the system class loader until first use. We use a static
      * inner class to get synchronization at init time without having to sync on
      * every access.
-     */
-    // END android-note
-    /**
-     * The 'System' ClassLoader - the one that is responsible for loading
-     * classes from the classpath. It is not equal to the bootstrap class loader -
-     * that one handles the built-in classes.
      *
      * @see #getSystemClassLoader()
      */
@@ -122,17 +119,7 @@
     /**
      * Returns the system class loader. This is the parent for new
      * {@code ClassLoader} instances and is typically the class loader used to
-     * start the application. If a security manager is present and the caller's
-     * class loader is neither {@code null} nor the same as or an ancestor of
-     * the system class loader, then this method calls the security manager's
-     * checkPermission method with a RuntimePermission("getClassLoader")
-     * permission to ensure that it is ok to access the system class loader. If
-     * not, a {@code SecurityException} is thrown.
-     *
-     * @return the system class loader.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow access to
-     *             the system class loader.
+     * start the application.
      */
     public static ClassLoader getSystemClassLoader() {
         return SystemClassLoader.loader;
@@ -186,10 +173,6 @@
     /**
      * Constructs a new instance of this class with the system class loader as
      * its parent.
-     *
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow the
-     *             creation of a new {@code ClassLoader}.
      */
     protected ClassLoader() {
         this(getSystemClassLoader(), false);
@@ -202,9 +185,6 @@
      * @param parentLoader
      *            The {@code ClassLoader} to use as the new class loader's
      *            parent.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow the
-     *             creation of new a new {@code ClassLoader}.
      */
     protected ClassLoader(ClassLoader parentLoader) {
         this(parentLoader, false);
@@ -214,16 +194,9 @@
      * constructor for the BootClassLoader which needs parent to be null.
      */
     ClassLoader(ClassLoader parentLoader, boolean nullAllowed) {
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkCreateClassLoader();
-        }
-
         if (parentLoader == null && !nullAllowed) {
-            throw new NullPointerException(
-                    "Parent ClassLoader may not be null");
+            throw new NullPointerException("Parent ClassLoader may not be null");
         }
-
         parent = parentLoader;
     }
 
@@ -251,7 +224,7 @@
     protected final Class<?> defineClass(byte[] classRep, int offset, int length)
             throws ClassFormatError {
 
-        return VMClassLoader.defineClass(this, classRep, offset, length, null);
+        return VMClassLoader.defineClass(this, classRep, offset, length);
     }
 
     /**
@@ -316,8 +289,7 @@
     protected final Class<?> defineClass(String className, byte[] classRep, int offset, int length,
             ProtectionDomain protectionDomain) throws java.lang.ClassFormatError {
 
-        return VMClassLoader.defineClass(this, className, classRep, offset, length,
-                protectionDomain);
+        return VMClassLoader.defineClass(this, className, classRep, offset, length);
     }
 
     /**
@@ -366,7 +338,7 @@
 
     /**
      * Returns the class with the specified name if it has already been loaded
-     * by the virtual machine or {@code null} if it has not yet been loaded.
+     * by the VM or {@code null} if it has not yet been loaded.
      *
      * @param className
      *            the name of the class to look for.
@@ -400,16 +372,8 @@
      * Returns this class loader's parent.
      *
      * @return this class loader's parent or {@code null}.
-     * @throws SecurityException
-     *             if a security manager exists and it does not allow to
-     *             retrieve the parent class loader.
      */
     public final ClassLoader getParent() {
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkPermission(new RuntimePermission("getClassLoader"));
-        }
-
         return parent;
     }
 
@@ -422,8 +386,7 @@
      * @param resName
      *            the name of the resource to find.
      * @return the {@code URL} object for the requested resource or {@code null}
-     *         if either the resource can not be found or a security manager
-     *         does not allow to access the resource.
+     *         if the resource can not be found
      * @see Class#getResource
      */
     public URL getResource(String resName) {
@@ -461,9 +424,7 @@
      * {@link #getResource(String)} for a description of the lookup algorithm
      * used to find the resource.
      *
-     * @return a stream for the resource or {@code null} if either the resource
-     *         can not be found or a security manager does not allow to access
-     *         the resource.
+     * @return a stream for the resource or {@code null} if the resource can not be found
      * @param resName
      *            the name of the resource to find.
      * @see Class#getResourceAsStream
@@ -560,55 +521,6 @@
     }
 
     /**
-     * Indicates whether this class loader is the system class loader. This
-     * method must be provided by the virtual machine vendor, as it is used by
-     * other provided class implementations in this package. A sample
-     * implementation of this method is provided by the reference
-     * implementation. This method is used by
-     * SecurityManager.classLoaderDepth(), currentClassLoader() and
-     * currentLoadedClass(). Returns true if the receiver is a system class
-     * loader.
-     * <p>
-     * Note that this method has package visibility only. It is defined here to
-     * avoid the security manager check in getSystemClassLoader, which would be
-     * required to implement this method anywhere else.
-     * </p>
-     *
-     * @return {@code true} if the receiver is a system class loader
-     * @see Class#getClassLoaderImpl()
-     */
-    final boolean isSystemClassLoader() {
-        return false;
-    }
-
-    /**
-     * <p>
-     * Returns true if the receiver is ancestor of another class loader. It also
-     * returns true if the two class loader are equal.
-     * </p>
-     * <p>
-     * Note that this method has package visibility only. It is defined here to
-     * avoid the security manager check in getParent, which would be required to
-     * implement this method anywhere else. The method is also required in other
-     * places where class loaders are accesses.
-     * </p>
-     *
-     * @param child
-     *            A child candidate
-     * @return {@code true} if the receiver is ancestor of, or equal to,
-     *         the parameter
-     */
-    final boolean isAncestorOf(ClassLoader child) {
-        for (ClassLoader current = child; current != null;
-                current = current.parent) {
-            if (current == this) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
      * Finds the URL of the resource with the specified name. This
      * implementation just returns {@code null}; it should be overridden in
      * subclasses.
@@ -636,7 +548,7 @@
             "unchecked", "unused"
     })
     protected Enumeration<URL> findResources(String resName) throws IOException {
-        return Collections.enumeration(Collections.<URL>emptyList());
+        return Collections.emptyEnumeration();
     }
 
     /**
@@ -672,21 +584,6 @@
     }
 
     /**
-     * Gets the package with the specified name, searching it in the specified
-     * class loader.
-     *
-     * @param loader
-     *            the class loader to search the package in.
-     * @param name
-     *            the name of the package to find.
-     * @return the package with the requested name; {@code null} if the package
-     *         can not be found.
-     */
-    static Package getPackage(ClassLoader loader, String name) {
-        return loader.getPackage(name);
-    }
-
-    /**
      * Returns all the packages known to this class loader.
      *
      * @return an array with all packages known to this class loader.
@@ -745,18 +642,6 @@
     }
 
     /**
-     * Gets the signers of the specified class. This implementation returns
-     * {@code null}.
-     *
-     * @param c
-     *            the {@code Class} object for which to get the signers.
-     * @return signers the signers of {@code c}.
-     */
-    final Object[] getSigners(Class<?> c) {
-        return null;
-    }
-
-    /**
      * Sets the signers of the specified class. This implementation does
      * nothing.
      *
@@ -766,93 +651,6 @@
      *            the signers for {@code c}.
      */
     protected final void setSigners(Class<?> c, Object[] signers) {
-        return;
-    }
-
-    /**
-     * <p>
-     * This must be provided by the VM vendor. It is used by
-     * SecurityManager.checkMemberAccess() with depth = 3. Note that
-     * checkMemberAccess() assumes the following stack when called:<br>
-     * </p>
-     *
-     * <pre>
-     *          &lt; user code &amp;gt; &lt;- want this class
-     *          Class.getDeclared*();
-     *          Class.checkMemberAccess();
-     *          SecurityManager.checkMemberAccess(); &lt;- current frame
-     * </pre>
-     *
-     * <p>
-     * Returns the ClassLoader of the method (including natives) at the
-     * specified depth on the stack of the calling thread. Frames representing
-     * the VM implementation of java.lang.reflect are not included in the list.
-     * </p>
-     * Notes:
-     * <ul>
-     * <li>This method operates on the defining classes of methods on stack.
-     * NOT the classes of receivers.</li>
-     * <li>The item at depth zero is the caller of this method</li>
-     * </ul>
-     *
-     * @param depth
-     *            the stack depth of the requested ClassLoader
-     * @return the ClassLoader at the specified depth
-     */
-    static final ClassLoader getStackClassLoader(int depth) {
-        Class<?>[] stack = VMStack.getClasses(depth + 1, false);
-        if(stack.length < depth + 1) {
-            return null;
-        }
-        return stack[depth].getClassLoader();
-    }
-
-    /**
-     * This method must be provided by the VM vendor, as it is called by
-     * java.lang.System.loadLibrary(). System.loadLibrary() cannot call
-     * Runtime.loadLibrary() because this method loads the library using the
-     * ClassLoader of the calling method. Loads and links the library specified
-     * by the argument.
-     *
-     * @param libName
-     *            the name of the library to load
-     * @param loader
-     *            the classloader in which to load the library
-     * @throws UnsatisfiedLinkError
-     *             if the library could not be loaded
-     * @throws SecurityException
-     *             if the library was not allowed to be loaded
-     * <p>
-     * <strong>Note: </strong>This method does nothing in the Android reference
-     * implementation.
-     * </p>
-     */
-    static void loadLibraryWithClassLoader(String libName, ClassLoader loader) {
-        return;
-    }
-
-    /**
-     * This method must be provided by the VM vendor, as it is called by
-     * java.lang.System.load(). System.load() cannot call Runtime.load() because
-     * the library is loaded using the ClassLoader of the calling method. Loads
-     * and links the library specified by the argument. No security check is
-     * done.
-     * <p>
-     * <strong>Note: </strong>This method does nothing in the Android reference
-     * implementation.
-     * </p>
-     *
-     * @param libName
-     *            the name of the library to load
-     * @param loader
-     *            the classloader in which to load the library
-     * @param libraryPath
-     *            the library path to search, or null
-     * @throws UnsatisfiedLinkError
-     *             if the library could not be loaded
-     */
-    static void loadLibraryWithPath(String libName, ClassLoader loader, String libraryPath) {
-        return;
     }
 
     /**
@@ -868,7 +666,6 @@
      *            the new assertion status.
      */
     public void setClassAssertionStatus(String cname, boolean enable) {
-        return;
     }
 
     /**
@@ -884,7 +681,6 @@
      *            the new assertion status.
      */
     public void setPackageAssertionStatus(String pname, boolean enable) {
-        return;
     }
 
     /**
@@ -898,7 +694,6 @@
      *            the new assertion status.
      */
     public void setDefaultAssertionStatus(boolean enable) {
-        return;
     }
 
     /**
@@ -910,45 +705,6 @@
      * </p>
      */
     public void clearAssertionStatus() {
-        return;
-    }
-
-    /**
-     * Returns the assertion status of the named class Returns the assertion
-     * status of the class or nested class if it has been set. Otherwise returns
-     * the assertion status of its package or superpackage if that has been set.
-     * Otherwise returns the default assertion status. Returns 1 for enabled and
-     * 0 for disabled.
-     *
-     * @return the assertion status.
-     * @param cname
-     *            the name of class.
-     */
-    boolean getClassAssertionStatus(String cname) {
-        return false;
-    }
-
-    /**
-     * Returns the assertion status of the named package Returns the assertion
-     * status of the named package or superpackage if that has been set.
-     * Otherwise returns the default assertion status. Returns 1 for enabled and
-     * 0 for disabled.
-     *
-     * @return the assertion status.
-     * @param pname
-     *            the name of package.
-     */
-    boolean getPackageAssertionStatus(String pname) {
-        return false;
-    }
-
-    /**
-     * Returns the default assertion status
-     *
-     * @return the default assertion status.
-     */
-    boolean getDefaultAssertionStatus() {
-        return false;
     }
 }
 
@@ -989,7 +745,7 @@
  */
 class BootClassLoader extends ClassLoader {
 
-    static BootClassLoader instance;
+    private static BootClassLoader instance;
 
     public static synchronized BootClassLoader getInstance() {
         if (instance == null) {
diff --git a/luni/src/main/java/java/lang/ClassMembers.java b/luni/src/main/java/java/lang/ClassMembers.java
deleted file mode 100644
index 79eb1c3..0000000
--- a/luni/src/main/java/java/lang/ClassMembers.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.EnumSet;
-import java.util.HashSet;
-import java.util.List;
-import libcore.util.BasicLruCache;
-import libcore.util.EmptyArray;
-import org.apache.harmony.kernel.vm.LangAccess;
-import org.apache.harmony.kernel.vm.ReflectionAccess;
-
-/**
- * Reflection data for a single Class.
- *
- * <p><b>Note:</b> None of the returned array values are protected. It is up to
- * the (again, package internal) clients of this code to protect the arrays if
- * they should ever escape the package.
- */
-/*package*/ class ClassMembers<T> {
-    static final BasicLruCache<Class<?>, ClassMembers<?>> cache
-            = new BasicLruCache<Class<?>, ClassMembers<?>>(16) {
-        @SuppressWarnings("unchecked") // use raw types since javac forbids "new ClassCache<?>(key)"
-        @Override protected ClassMembers<?> create(Class<?> key) {
-            return new ClassMembers(key);
-        }
-    };
-
-    /** non-null; comparator used for enumerated values */
-    private static final EnumComparator ENUM_COMPARATOR =
-        new EnumComparator();
-
-    /** non-null; reflection access bridge */
-    /*package*/ static final ReflectionAccess REFLECT = getReflectionAccess();
-
-    /** non-null; class that this instance represents */
-    private final Class<T> clazz;
-
-    /** null-ok; list of all public methods, both direct and inherited */
-    private volatile Method[] methods;
-
-    /** null-ok; list of all declared methods */
-    private volatile Method[] declaredMethods;
-
-    /** null-ok; list of all public declared methods */
-    private volatile Method[] declaredPublicMethods;
-
-    /** null-ok; list of all declared fields */
-    private volatile Field[] declaredFields;
-
-    /** null-ok; list of all public declared fields */
-    private volatile Field[] declaredPublicFields;
-
-    /** null-ok; list of all fields, both direct and inherited */
-    private volatile Field[] allFields;
-
-    /** null-ok; list of all public fields, both direct and inherited */
-    private volatile Field[] allPublicFields;
-
-    /**
-     * null-ok; array of enumerated values in their original order, if this
-     * instance's class is an enumeration
-     */
-    private volatile T[] enumValuesInOrder;
-
-    /**
-     * null-ok; array of enumerated values sorted by name, if this
-     * instance's class is an enumeration
-     */
-    private volatile T[] enumValuesByName;
-
-    static {
-        /*
-         * Provide access to this package from java.util as part of
-         * bootstrap. TODO: See if this can be removed in favor of the
-         * simpler mechanism below. (That is, see if EnumSet will be
-         * happy calling LangAccess.getInstance().)
-         */
-        Field field;
-
-        try {
-            field = EnumSet.class.getDeclaredField("LANG_BOOTSTRAP");
-            REFLECT.setAccessibleNoCheck(field, true);
-        } catch (NoSuchFieldException ex) {
-            // This shouldn't happen because the field is in fact defined.
-            throw new AssertionError(ex);
-        }
-
-        try {
-            field.set(null, LangAccessImpl.THE_ONE);
-        } catch (IllegalAccessException ex) {
-            // This shouldn't happen because we made the field accessible.
-            throw new AssertionError(ex);
-        }
-
-        // Also set up the bootstrap-classpath-wide access mechanism.
-        LangAccess.setInstance(LangAccessImpl.THE_ONE);
-    }
-
-    /**
-     * Constructs an instance.
-     *
-     * @param clazz non-null; class that this instance represents
-     */
-    /*package*/ ClassMembers(Class<T> clazz) {
-        if (clazz == null) {
-            throw new NullPointerException("clazz == null");
-        }
-
-        this.clazz = clazz;
-    }
-
-    /**
-     * Gets the list of all declared methods.
-     *
-     * @return non-null; the list of all declared methods
-     */
-    public Method[] getDeclaredMethods() {
-        if (declaredMethods == null) {
-            declaredMethods = Class.getDeclaredMethods(clazz, false);
-        }
-
-        return declaredMethods;
-    }
-
-    /**
-     * Gets the list of all declared public methods.
-     *
-     * @return non-null; the list of all declared public methods
-     */
-    private Method[] getDeclaredPublicMethods() {
-        if (declaredPublicMethods == null) {
-            declaredPublicMethods = Class.getDeclaredMethods(clazz, true);
-        }
-
-        return declaredPublicMethods;
-    }
-
-    /**
-     * Returns public methods defined by {@code clazz}, its superclasses and all
-     * implemented interfaces, not including overridden methods. This method
-     * performs no security checks.
-     */
-    public Method[] getMethods() {
-        Method[] cachedResult = methods;
-        if (cachedResult == null) {
-            methods = findMethods();
-        }
-
-        return methods;
-    }
-
-    private Method[] findMethods() {
-        List<Method> allMethods = new ArrayList<Method>();
-        getMethodsRecursive(clazz, allMethods);
-
-        /*
-         * Remove methods defined by multiple types, preferring to keep methods
-         * declared by derived types.
-         */
-        Collections.sort(allMethods, Method.ORDER_BY_SIGNATURE);
-        List<Method> result = new ArrayList<Method>(allMethods.size());
-        Method previous = null;
-        for (Method method : allMethods) {
-            if (previous != null
-                    && Method.ORDER_BY_SIGNATURE.compare(method, previous) == 0
-                    && method.getDeclaringClass() != previous.getDeclaringClass()) {
-                continue;
-            }
-            result.add(method);
-            previous = method;
-        }
-        return result.toArray(new Method[result.size()]);
-    }
-
-    /**
-     * Populates {@code sink} with public methods defined by {@code clazz}, its
-     * superclasses, and all implemented interfaces, including overridden methods.
-     * This method performs no security checks.
-     */
-    private static void getMethodsRecursive(Class<?> clazz, List<Method> result) {
-        for (Class<?> c = clazz; c != null; c = c.getSuperclass()) {
-            result.addAll(Arrays.asList(c.getClassMembers().getDeclaredPublicMethods()));
-        }
-
-        for (Class<?> ifc : clazz.getInterfaces()) {
-            getMethodsRecursive(ifc, result);
-        }
-    }
-
-    public static Member getConstructorOrMethod(Class<?> clazz, String name, boolean recursive,
-            boolean publicOnly, Class<?>[] parameterTypes) throws NoSuchMethodException {
-        if (recursive && !publicOnly) {
-            throw new AssertionError(); // can't lookup non-public members recursively
-        }
-        if (name == null) {
-            throw new NullPointerException("name == null");
-        }
-        if (parameterTypes == null) {
-            parameterTypes = EmptyArray.CLASS;
-        }
-        for (Class<?> c : parameterTypes) {
-            if (c == null) {
-                throw new NoSuchMethodException("parameter type is null");
-            }
-        }
-        Member result = recursive
-                ? getPublicConstructorOrMethodRecursive(clazz, name, parameterTypes)
-                : Class.getDeclaredConstructorOrMethod(clazz, name, parameterTypes);
-        if (result == null || publicOnly && (result.getModifiers() & Modifier.PUBLIC) == 0) {
-            throw new NoSuchMethodException(name + " " + Arrays.toString(parameterTypes));
-        }
-        return result;
-    }
-
-    private static Member getPublicConstructorOrMethodRecursive(
-            Class<?> clazz, String name, Class<?>[] parameterTypes) {
-        // search superclasses
-        for (Class<?> c = clazz; c != null; c = c.getSuperclass()) {
-            Member result = Class.getDeclaredConstructorOrMethod(c, name, parameterTypes);
-            if (result != null && (result.getModifiers() & Modifier.PUBLIC) != 0) {
-                return result;
-            }
-        }
-
-        // search implemented interfaces
-        for (Class<?> c = clazz; c != null; c = c.getSuperclass()) {
-            for (Class<?> ifc : c.getInterfaces()) {
-                Member result = getPublicConstructorOrMethodRecursive(ifc, name, parameterTypes);
-                if (result != null && (result.getModifiers() & Modifier.PUBLIC) != 0) {
-                    return result;
-                }
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Makes a deep copy of the given array of methods. This is useful
-     * when handing out arrays from the public API.
-     *
-     * <p><b>Note:</b> In such cases, it is insufficient to just make
-     * a shallow copy of the array, since method objects aren't
-     * immutable due to the existence of {@link
-     * AccessibleObject#setAccessible}.</p>
-     *
-     * @param orig non-null; array to copy
-     * @return non-null; a deep copy of the given array
-     */
-    public static Method[] deepCopy(Method[] orig) {
-        int length = orig.length;
-        Method[] result = new Method[length];
-
-        for (int i = length - 1; i >= 0; i--) {
-            result[i] = REFLECT.clone(orig[i]);
-        }
-
-        return result;
-    }
-
-    /**
-     * Gets the list of all declared fields.
-     *
-     * @return non-null; the list of all declared fields
-     */
-    public Field[] getDeclaredFields() {
-        if (declaredFields == null) {
-            declaredFields = Class.getDeclaredFields(clazz, false);
-        }
-
-        return declaredFields;
-    }
-
-    /**
-     * Gets the list of all declared public fields.
-     *
-     * @return non-null; the list of all declared public fields
-     */
-    public Field[] getDeclaredPublicFields() {
-        if (declaredPublicFields == null) {
-            declaredPublicFields = Class.getDeclaredFields(clazz, true);
-        }
-
-        return declaredPublicFields;
-    }
-
-    /**
-     * Gets either the list of declared fields or the list of declared
-     * public fields.
-     *
-     * @param publicOnly whether to only return public fields
-     */
-    public Field[] getDeclaredFields(boolean publicOnly) {
-        return publicOnly ? getDeclaredPublicFields() : getDeclaredFields();
-    }
-
-    /**
-     * Gets the list of all fields, both directly
-     * declared and inherited.
-     *
-     * @return non-null; the list of all fields
-     */
-    public Field[] getAllFields() {
-        if (allFields == null) {
-            allFields = getFullListOfFields(false);
-        }
-
-        return allFields;
-    }
-
-    /**
-     * Gets the list of all public fields, both directly
-     * declared and inherited.
-     *
-     * @return non-null; the list of all public fields
-     */
-    public Field[] getAllPublicFields() {
-        if (allPublicFields == null) {
-            allPublicFields = getFullListOfFields(true);
-        }
-
-        return allPublicFields;
-    }
-
-    /*
-     * Returns the list of fields without performing any security checks
-     * first. This includes the fields inherited from superclasses. If no
-     * fields exist at all, an empty array is returned.
-     *
-     * @param publicOnly reflects whether we want only public fields
-     * or all of them
-     * @return the list of fields
-     */
-    private Field[] getFullListOfFields(boolean publicOnly) {
-        ArrayList<Field> fields = new ArrayList<Field>();
-        HashSet<String> seen = new HashSet<String>();
-
-        findAllFields(clazz, fields, seen, publicOnly);
-
-        return fields.toArray(new Field[fields.size()]);
-    }
-
-    /**
-     * Collects the list of fields without performing any security checks
-     * first. This includes the fields inherited from superclasses and from
-     * all implemented interfaces. The latter may also implement multiple
-     * interfaces, so we (potentially) recursively walk through a whole tree of
-     * classes. If no fields exist at all, an empty array is returned.
-     *
-     * @param clazz non-null; class to inspect
-     * @param fields non-null; the target list to add the results to
-     * @param seen non-null; a set of signatures we've already seen
-     * @param publicOnly reflects whether we want only public fields
-     * or all of them
-     */
-    private static void findAllFields(Class<?> clazz,
-            ArrayList<Field> fields, HashSet<String> seen,
-            boolean publicOnly) {
-
-        // Traverse class and superclasses, get rid of dupes by signature
-        while (clazz != null) {
-            for (Field field : clazz.getClassMembers().getDeclaredFields(publicOnly)) {
-                String signature = field.toString();
-                if (!seen.contains(signature)) {
-                    fields.add(field);
-                    seen.add(signature);
-                }
-            }
-
-            // Traverse all interfaces, and do the same recursively.
-            for (Class<?> interfaceClass : clazz.getInterfaces()) {
-                findAllFields(interfaceClass, fields, seen, publicOnly);
-            }
-
-            clazz = clazz.getSuperclass();
-        }
-    }
-
-    /**
-     * Makes a deep copy of the given array of fields. This is useful
-     * when handing out arrays from the public API.
-     *
-     * <p><b>Note:</b> In such cases, it is insufficient to just make
-     * a shallow copy of the array, since field objects aren't
-     * immutable due to the existence of {@link
-     * AccessibleObject#setAccessible}.</p>
-     *
-     * @param orig non-null; array to copy
-     * @return non-null; a deep copy of the given array
-     */
-    public static Field[] deepCopy(Field[] orig) {
-        int length = orig.length;
-        Field[] result = new Field[length];
-
-        for (int i = length - 1; i >= 0; i--) {
-            result[i] = REFLECT.clone(orig[i]);
-        }
-
-        return result;
-    }
-
-    /**
-     * Gets the enumerated value with a given name.
-     *
-     * @param name non-null; name of the value
-     * @return null-ok; the named enumerated value or <code>null</code>
-     * if this instance's class doesn't have such a value (including
-     * if this instance isn't in fact an enumeration)
-     */
-    @SuppressWarnings("unchecked")
-    public T getEnumValue(String name) {
-        Enum[] values = (Enum[]) getEnumValuesByName();
-
-        if (values == null) {
-            return null;
-        }
-
-        // Binary search.
-
-        int min = 0;
-        int max = values.length - 1;
-
-        while (min <= max) {
-            /*
-             * The guessIdx calculation is equivalent to ((min + max)
-             * / 2) but won't go wonky when min and max are close to
-             * Integer.MAX_VALUE.
-             */
-            int guessIdx = min + ((max - min) >> 1);
-            Enum guess = values[guessIdx];
-            int cmp = name.compareTo(guess.name());
-
-            if (cmp < 0) {
-                max = guessIdx - 1;
-            } else if (cmp > 0) {
-                min = guessIdx + 1;
-            } else {
-                return (T) guess;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Gets the array of enumerated values, sorted by name.
-     *
-     * @return null-ok; the value array, or <code>null</code> if this
-     * instance's class isn't in fact an enumeration
-     */
-    public T[] getEnumValuesByName() {
-        if (enumValuesByName == null) {
-            T[] values = getEnumValuesInOrder();
-
-            if (values != null) {
-                values = values.clone();
-                Arrays.sort((Enum<?>[]) values, ENUM_COMPARATOR);
-
-                /*
-                 * Note: It's only safe (concurrency-wise) to set the
-                 * instance variable after the array is properly sorted.
-                 */
-                enumValuesByName = values;
-            }
-        }
-
-        return enumValuesByName;
-    }
-
-    /**
-     * Gets the array of enumerated values, in their original declared
-     * order.
-     *
-     * @return null-ok; the value array, or <code>null</code> if this
-     * instance's class isn't in fact an enumeration
-     */
-    public T[] getEnumValuesInOrder() {
-        if ((enumValuesInOrder == null) && clazz.isEnum()) {
-            enumValuesInOrder = callEnumValues();
-        }
-
-        return enumValuesInOrder;
-    }
-
-    /**
-     * Calls the static method <code>values()</code> on this
-     * instance's class, which is presumed to be a properly-formed
-     * enumeration class, using proper privilege hygiene.
-     *
-     * @return non-null; the array of values as reported by
-     * <code>value()</code>
-     */
-    @SuppressWarnings("unchecked")
-    private T[] callEnumValues() {
-        Method method = (Method) Class.getDeclaredConstructorOrMethod(
-                clazz, "values", EmptyArray.CLASS);
-        try {
-            return (T[]) method.invoke((Object[]) null);
-        } catch (IllegalAccessException ex) {
-            // This shouldn't happen because the method is "accessible."
-            throw new Error(ex);
-        } catch (InvocationTargetException ex) {
-            Throwable te = ex.getTargetException();
-            if (te instanceof RuntimeException) {
-                throw (RuntimeException) te;
-            } else if (te instanceof Error) {
-                throw (Error) te;
-            } else {
-                throw new Error(te);
-            }
-        }
-    }
-
-    /**
-     * Gets the reflection access object. This uses reflection to do
-     * so. My head is spinning.
-     *
-     * @return non-null; the reflection access object
-     */
-    private static ReflectionAccess getReflectionAccess() {
-        /*
-         * Note: We can't do AccessibleObject.class.getCache() to
-         * get the cache, since that would cause a circularity in
-         * initialization. So instead, we do a direct call into the
-         * native side.
-         */
-        try {
-            Method method = (Method) Class.getDeclaredConstructorOrMethod(
-                    AccessibleObject.class, "getReflectionAccess", EmptyArray.CLASS);
-            Class.setAccessibleNoCheck(method, true);
-            return (ReflectionAccess) method.invoke((Object[]) null);
-        } catch (IllegalAccessException ex) {
-            // This shouldn't happen because the method is "accessible."
-            throw new Error(ex);
-        } catch (InvocationTargetException ex) {
-            throw new Error(ex);
-        }
-    }
-
-    /**
-     * Comparator class for enumerated values. It compares strictly
-     * by name.
-     */
-    private static class EnumComparator implements Comparator<Enum<?>> {
-        public int compare(Enum<?> e1, Enum<?> e2) {
-            return e1.name().compareTo(e2.name());
-        }
-    }
-}
diff --git a/luni/src/main/java/java/lang/CloneNotSupportedException.java b/luni/src/main/java/java/lang/CloneNotSupportedException.java
index 2f4f11c..da78b7c 100644
--- a/luni/src/main/java/java/lang/CloneNotSupportedException.java
+++ b/luni/src/main/java/java/lang/CloneNotSupportedException.java
@@ -32,7 +32,6 @@
      * current stack trace.
      */
     public CloneNotSupportedException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Compiler.java b/luni/src/main/java/java/lang/Compiler.java
index be42394..e9b3dec 100644
--- a/luni/src/main/java/java/lang/Compiler.java
+++ b/luni/src/main/java/java/lang/Compiler.java
@@ -18,16 +18,13 @@
 package java.lang;
 
 /**
- * Placeholder class for environments which explicitly manage the action of a
- * <em>Just In Time (JIT)</em> compiler. This class is usually implemented by
- * the virtual machine vendor.
+ * Does nothing on Android.
  */
 public final class Compiler {
-
     /**
      * Prevent this class from being instantiated.
      */
-    private Compiler(){
+    private Compiler() {
         //do nothing
     }
 
diff --git a/luni/src/main/java/java/lang/Double.java b/luni/src/main/java/java/lang/Double.java
index 0edc4d7..1748128 100644
--- a/luni/src/main/java/java/lang/Double.java
+++ b/luni/src/main/java/java/lang/Double.java
@@ -77,7 +77,7 @@
     public static final double MIN_NORMAL = 2.2250738585072014E-308;
 
     /**
-     * Maximum exponent that a finite value of the {@code double} type may have.
+     * Maximum base-2 exponent that a finite value of the {@code double} type may have.
      * Equal to {@code Math.getExponent(Double.MAX_VALUE)}.
      *
      * @since 1.6
@@ -85,7 +85,7 @@
     public static final int MAX_EXPONENT = 1023;
 
     /**
-     * Minimum exponent that a normal value of the {@code double} type may have.
+     * Minimum base-2 exponent that a normal value of the {@code double} type may have.
      * Equal to {@code Math.getExponent(Double.MIN_NORMAL)}.
      *
      * @since 1.6
@@ -101,8 +101,7 @@
     @SuppressWarnings("unchecked")
     public static final Class<Double> TYPE
             = (Class<Double>) double[].class.getComponentType();
-
-    // Note: This can't be set to "double.class", since *that* is
+    // Note: Double.TYPE can't be set to "double.class", since *that* is
     // defined to be "java.lang.Double.TYPE";
 
     /**
diff --git a/luni/src/main/java/java/lang/Enum.java b/luni/src/main/java/java/lang/Enum.java
index 838ab85..391670c 100644
--- a/luni/src/main/java/java/lang/Enum.java
+++ b/luni/src/main/java/java/lang/Enum.java
@@ -17,6 +17,10 @@
 package java.lang;
 
 import java.io.Serializable;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import libcore.util.BasicLruCache;
+import libcore.util.EmptyArray;
 
 /**
  * The superclass of all enumerated types. Actual enumeration types inherit from
@@ -27,6 +31,21 @@
 
     private static final long serialVersionUID = -4300926546619394005L;
 
+    private static final BasicLruCache<Class<? extends Enum>, Object[]> sharedConstantsCache
+            = new BasicLruCache<Class<? extends Enum>, Object[]>(64) {
+        @Override protected Object[] create(Class<? extends Enum> enumType) {
+            Method method = (Method) Class.getDeclaredConstructorOrMethod(
+                    enumType, "values", EmptyArray.CLASS);
+            try {
+                return (Object[]) method.invoke((Object[]) null);
+            } catch (IllegalAccessException impossible) {
+                throw new AssertionError();
+            } catch (InvocationTargetException impossible) {
+                throw new AssertionError();
+            }
+        }
+    };
+
     private final String name;
 
     private final int ordinal;
@@ -162,16 +181,26 @@
         if (enumType == null || name == null) {
             throw new NullPointerException("enumType == null || name == null");
         }
-
-        T result = enumType.getClassMembers().getEnumValue(name);
-        if (result == null) {
-            if (!enumType.isEnum()) {
-                throw new IllegalArgumentException(enumType + " is not an enum type");
-            } else {
-                throw new IllegalArgumentException(name + " is not a constant in " + enumType);
+        if (!enumType.isEnum()) {
+            throw new IllegalArgumentException(enumType + " is not an enum type");
+        }
+        for (T value : getSharedConstants(enumType)) {
+            if (name.equals(value.name())) {
+                return value;
             }
         }
-        return result;
+        throw new IllegalArgumentException(name + " is not a constant in " + enumType.getName());
+    }
+
+    /**
+     * Returns a shared, mutable array containing the constants of this enum. It
+     * is an error to modify the returned array.
+     *
+     * @hide
+     */
+    @SuppressWarnings("unchecked") // the cache always returns the type matching enumType
+    public static <T extends Enum<T>> T[] getSharedConstants(Class<T> enumType) {
+        return (T[]) sharedConstantsCache.get(enumType);
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Error.java b/luni/src/main/java/java/lang/Error.java
index 790c563..00017fd 100644
--- a/luni/src/main/java/java/lang/Error.java
+++ b/luni/src/main/java/java/lang/Error.java
@@ -35,7 +35,6 @@
      * Constructs a new {@code Error} that includes the current stack trace.
      */
     public Error() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Exception.java b/luni/src/main/java/java/lang/Exception.java
index a3cd1c3..1901895 100644
--- a/luni/src/main/java/java/lang/Exception.java
+++ b/luni/src/main/java/java/lang/Exception.java
@@ -34,7 +34,6 @@
      * Constructs a new {@code Exception} that includes the current stack trace.
      */
     public Exception() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ExceptionInInitializerError.java b/luni/src/main/java/java/lang/ExceptionInInitializerError.java
index 61f651d..e2eb757 100644
--- a/luni/src/main/java/java/lang/ExceptionInInitializerError.java
+++ b/luni/src/main/java/java/lang/ExceptionInInitializerError.java
@@ -31,7 +31,6 @@
      * current stack trace.
      */
     public ExceptionInInitializerError() {
-        super();
         initCause(null);
     }
 
@@ -56,7 +55,6 @@
      *            the exception that caused this error.
      */
     public ExceptionInInitializerError(Throwable exception) {
-        super();
         this.exception = exception;
         initCause(exception);
     }
diff --git a/luni/src/main/java/java/lang/FinalizerThread.java b/luni/src/main/java/java/lang/FinalizerThread.java
new file mode 100644
index 0000000..8b6f337
--- /dev/null
+++ b/luni/src/main/java/java/lang/FinalizerThread.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang;
+
+import java.lang.ref.FinalizerReference;
+import java.lang.ref.ReferenceQueue;
+
+/**
+ * @hide
+ */
+public final class FinalizerThread extends Thread {
+    public static ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
+    private static FinalizerThread finalizerThread;
+    private static boolean idle;
+
+    private FinalizerThread() {
+        super("Finalizer");
+        setDaemon(true);
+    }
+
+    public void run() {
+        FinalizerReference<Object> reference = null;
+        while (true) {
+            /*
+             * Finalize references until the queue is empty.
+             */
+            if (reference == null) {
+                reference = (FinalizerReference<Object>) queue.poll();
+            }
+            while (reference != null) {
+                doFinalize(reference);
+                reference = (FinalizerReference<Object>) queue.poll();
+            }
+
+            /*
+             * Mark this thread as idle and wait on ReferenceQueue.remove()
+             * until awaken by either an enqueued reference or an interruption.
+             */
+            synchronized (FinalizerThread.class) {
+                idle = true;
+                FinalizerThread.class.notifyAll();
+                if (finalizerThread != this) {
+                    return;
+                }
+            }
+            try {
+                reference = (FinalizerReference<Object>) queue.remove();
+            } catch (InterruptedException ignored) {
+            }
+            synchronized (FinalizerThread.class) {
+                idle = false;
+            }
+        }
+    }
+
+    private void doFinalize(FinalizerReference<Object> reference) {
+        FinalizerReference.remove(reference);
+        Object obj = reference.get();
+        reference.clear();
+        try {
+            obj.finalize();
+        } catch (Throwable ex) {
+            // TODO: print a warning
+        }
+    }
+
+    /**
+     * Awakens the finalizer thread if necessary and then wait for it to
+     * become idle again. When that happens, all finalizable references enqueued
+     * at the time of this method call will have been finalized.
+     *
+     * TODO: return as soon as the currently-enqueued references are finalized;
+     *     this currently waits until the queue is empty. http://b/4193517
+     */
+    public static synchronized void waitUntilFinalizerIsIdle() throws InterruptedException {
+        idle = false;
+        finalizerThread.interrupt();
+        while (!idle) {
+            FinalizerThread.class.wait();
+        }
+    }
+
+    public static synchronized void startFinalizer() {
+        if (finalizerThread != null) {
+            throw new IllegalStateException();
+        }
+
+        idle = false;
+        finalizerThread = new FinalizerThread();
+        finalizerThread.start();
+    }
+
+    public static synchronized void stopFinalizer() {
+        if (finalizerThread == null) {
+            throw new IllegalStateException();
+        }
+
+        idle = false;
+        finalizerThread.interrupt();
+        finalizerThread = null;
+        try {
+            while (!idle) {
+                FinalizerThread.class.wait();
+            }
+        } catch (InterruptedException e) {
+            throw new AssertionError();
+        }
+    }
+}
diff --git a/luni/src/main/java/java/lang/Float.java b/luni/src/main/java/java/lang/Float.java
index e641eb6..bbbb7f7 100644
--- a/luni/src/main/java/java/lang/Float.java
+++ b/luni/src/main/java/java/lang/Float.java
@@ -74,7 +74,7 @@
     public static final float MIN_NORMAL = 1.1754943508222875E-38f;
 
     /**
-     * Maximum exponent that a finite value of the {@code float} type may have.
+     * Maximum base-2 exponent that a finite value of the {@code float} type may have.
      * Equal to {@code Math.getExponent(Float.MAX_VALUE)}.
      *
      * @since 1.6
@@ -82,7 +82,7 @@
     public static final int MAX_EXPONENT = 127;
 
     /**
-     * Minimum exponent that a normal value of the {@code float} type may have.
+     * Minimum base-2 exponent that a normal value of the {@code float} type may have.
      * Equal to {@code Math.getExponent(Float.MIN_NORMAL)}.
      *
      * @since 1.6
@@ -98,8 +98,7 @@
     @SuppressWarnings("unchecked")
     public static final Class<Float> TYPE
             = (Class<Float>) float[].class.getComponentType();
-
-    // Note: This can't be set to "float.class", since *that* is
+    // Note: Float.TYPE can't be set to "float.class", since *that* is
     // defined to be "java.lang.Float.TYPE";
 
     /**
diff --git a/luni/src/main/java/java/lang/IllegalAccessError.java b/luni/src/main/java/java/lang/IllegalAccessError.java
index 0013b1c..3f7cf86 100644
--- a/luni/src/main/java/java/lang/IllegalAccessError.java
+++ b/luni/src/main/java/java/lang/IllegalAccessError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that a program tries access a field
+ * Thrown when the VM notices that a program tries access a field
  * which is not accessible from where it is referenced.
  * <p>
  * Note that this can only occur when inconsistent class files have been loaded.
@@ -32,7 +32,6 @@
      * stack trace.
      */
     public IllegalAccessError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IllegalAccessException.java b/luni/src/main/java/java/lang/IllegalAccessException.java
index 0a25fda..4625395 100644
--- a/luni/src/main/java/java/lang/IllegalAccessException.java
+++ b/luni/src/main/java/java/lang/IllegalAccessException.java
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public IllegalAccessException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IllegalArgumentException.java b/luni/src/main/java/java/lang/IllegalArgumentException.java
index c447791..f6548fc 100644
--- a/luni/src/main/java/java/lang/IllegalArgumentException.java
+++ b/luni/src/main/java/java/lang/IllegalArgumentException.java
@@ -30,7 +30,6 @@
      * current stack trace.
      */
     public IllegalArgumentException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IllegalMonitorStateException.java b/luni/src/main/java/java/lang/IllegalMonitorStateException.java
index 413b224..eb8cd3d 100644
--- a/luni/src/main/java/java/lang/IllegalMonitorStateException.java
+++ b/luni/src/main/java/java/lang/IllegalMonitorStateException.java
@@ -31,7 +31,6 @@
      * current stack trace.
      */
     public IllegalMonitorStateException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IllegalStateException.java b/luni/src/main/java/java/lang/IllegalStateException.java
index 147cc9e..1493843 100644
--- a/luni/src/main/java/java/lang/IllegalStateException.java
+++ b/luni/src/main/java/java/lang/IllegalStateException.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when an action is attempted at a time when the virtual machine is not
+ * Thrown when an action is attempted at a time when the VM is not
  * in the correct state.
  */
 public class IllegalStateException extends RuntimeException {
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public IllegalStateException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IllegalThreadStateException.java b/luni/src/main/java/java/lang/IllegalThreadStateException.java
index a8229f5..3e6807f 100644
--- a/luni/src/main/java/java/lang/IllegalThreadStateException.java
+++ b/luni/src/main/java/java/lang/IllegalThreadStateException.java
@@ -30,7 +30,6 @@
      * current stack trace.
      */
     public IllegalThreadStateException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IncompatibleClassChangeError.java b/luni/src/main/java/java/lang/IncompatibleClassChangeError.java
index 50ce387..4e439cd 100644
--- a/luni/src/main/java/java/lang/IncompatibleClassChangeError.java
+++ b/luni/src/main/java/java/lang/IncompatibleClassChangeError.java
@@ -34,7 +34,6 @@
      * current stack trace.
      */
     public IncompatibleClassChangeError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IndexOutOfBoundsException.java b/luni/src/main/java/java/lang/IndexOutOfBoundsException.java
index 1a61222..1f400ae 100644
--- a/luni/src/main/java/java/lang/IndexOutOfBoundsException.java
+++ b/luni/src/main/java/java/lang/IndexOutOfBoundsException.java
@@ -30,7 +30,6 @@
      * current stack trace.
      */
     public IndexOutOfBoundsException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/InheritableThreadLocal.java b/luni/src/main/java/java/lang/InheritableThreadLocal.java
index 7e12ac2..ab6b589 100644
--- a/luni/src/main/java/java/lang/InheritableThreadLocal.java
+++ b/luni/src/main/java/java/lang/InheritableThreadLocal.java
@@ -35,7 +35,6 @@
      * Creates a new inheritable thread-local variable.
      */
     public InheritableThreadLocal() {
-        super();
     }
 
     /**
@@ -51,7 +50,6 @@
         return parentValue;
     }
 
-    // BEGIN android-added
     @Override
     Values values(Thread current) {
         return current.inheritableValues;
@@ -61,5 +59,4 @@
     Values initializeValues(Thread current) {
         return current.inheritableValues = new Values();
     }
-    // END android-added
 }
diff --git a/luni/src/main/java/java/lang/InstantiationError.java b/luni/src/main/java/java/lang/InstantiationError.java
index e80f7be..3bc9065 100644
--- a/luni/src/main/java/java/lang/InstantiationError.java
+++ b/luni/src/main/java/java/lang/InstantiationError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that a program tries to create a new
+ * Thrown when the VM notices that a program tries to create a new
  * instance of a class which has no visible constructors from the location where
  * {@code new} is invoked.
  * <p>
@@ -32,7 +32,6 @@
      * stack trace.
      */
     public InstantiationError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/InstantiationException.java b/luni/src/main/java/java/lang/InstantiationException.java
index ac0733b..a5f288b 100644
--- a/luni/src/main/java/java/lang/InstantiationException.java
+++ b/luni/src/main/java/java/lang/InstantiationException.java
@@ -29,7 +29,6 @@
      * stack trace.
      */
     public InstantiationException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Integer.java b/luni/src/main/java/java/lang/Integer.java
index bec53c9..73f3fdc 100644
--- a/luni/src/main/java/java/lang/Integer.java
+++ b/luni/src/main/java/java/lang/Integer.java
@@ -120,9 +120,17 @@
      * @since 1.2
      */
     public int compareTo(Integer object) {
-        int thisValue = value;
-        int thatValue = object.value;
-        return thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1);
+        return compare(value, object.value);
+    }
+
+    /**
+     * Compares two {@code int} values.
+     * @return 0 if lhs = rhs, less than 0 if lhs &lt; rhs, and greater than 0 if lhs &gt; rhs.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int compare(int lhs, int rhs) {
+        return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1);
     }
 
     private static NumberFormatException invalidInt(String s) {
@@ -410,7 +418,7 @@
      * @return the hexadecimal string representation of {@code i}.
      */
     public static String toHexString(int i) {
-        return IntegralToString.intToHexString(i);
+        return IntegralToString.intToHexString(i, false);
     }
 
     /**
@@ -581,14 +589,7 @@
      * @since 1.5
      */
     public static int numberOfTrailingZeros(int i) {
-        // Seal's algorithm - Hacker's Delight 5-18
-        // BEGIN android-changed - Harmony version should be one-liner in comment below
-        i &= -i;
-        i = (i <<  4) + i;    // x *= 17
-        i = (i <<  6) + i;    // x *= 65
-        i = (i << 16) - i;    // x *= 65535
-        return NTZ_TABLE[i >>> 26]; // NTZ_TABLE[((i & -i) * 0x0450FBAF) >>> 26]
-        // END android-changed
+        return NTZ_TABLE[((i & -i) * 0x0450FBAF) >>> 26];
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/IntegralToString.java b/luni/src/main/java/java/lang/IntegralToString.java
index 8329a25..40275f4 100644
--- a/luni/src/main/java/java/lang/IntegralToString.java
+++ b/luni/src/main/java/java/lang/IntegralToString.java
@@ -108,6 +108,13 @@
         'u', 'v', 'w', 'x', 'y', 'z'
     };
 
+    private static final char[] UPPER_CASE_DIGITS = {
+        '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+        'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
+        'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
+        'U', 'V', 'W', 'X', 'Y', 'Z'
+    };
+
     private IntegralToString() {
     }
 
@@ -447,13 +454,22 @@
         return new String(cursor, bufLen - cursor, buf);
     }
 
-    public static String intToHexString(int i) {
+    public static String byteToHexString(byte b, boolean upperCase) {
+        char[] digits = upperCase ? UPPER_CASE_DIGITS : DIGITS;
+        char[] buf = new char[2]; // We always want two digits.
+        buf[0] = digits[(b >> 4) & 0xf];
+        buf[1] = digits[b & 0xf];
+        return new String(0, 2, buf);
+    }
+
+    public static String intToHexString(int i, boolean upperCase) {
         int bufLen = 8;  // Max number of hex digits in an int
         char[] buf = new char[bufLen];
         int cursor = bufLen;
 
+        char[] digits = upperCase ? UPPER_CASE_DIGITS : DIGITS;
         do {
-            buf[--cursor] = DIGITS[i & 0xf];
+            buf[--cursor] = digits[i & 0xf];
         } while ((i >>>= 4) != 0);
 
         return new String(cursor, bufLen - cursor, buf);
@@ -462,7 +478,7 @@
     public static String longToHexString(long v) {
         int i = (int) v;
         if (v >= 0 && i == v) {
-            return intToHexString(i);
+            return intToHexString(i, false);
         }
 
         int bufLen = 16;  // Max number of hex digits in a long
diff --git a/luni/src/main/java/java/lang/InternalError.java b/luni/src/main/java/java/lang/InternalError.java
index b934274..fd1e058 100644
--- a/luni/src/main/java/java/lang/InternalError.java
+++ b/luni/src/main/java/java/lang/InternalError.java
@@ -18,8 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that it has gotten into an undefined
- * state.
+ * Thrown when the VM notices that it has gotten into an undefined state.
  */
 public class InternalError extends VirtualMachineError {
 
@@ -30,7 +29,6 @@
      * trace.
      */
     public InternalError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/InterruptedException.java b/luni/src/main/java/java/lang/InterruptedException.java
index 63ed4f3..b878938 100644
--- a/luni/src/main/java/java/lang/InterruptedException.java
+++ b/luni/src/main/java/java/lang/InterruptedException.java
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public InterruptedException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/LangAccessImpl.java b/luni/src/main/java/java/lang/LangAccessImpl.java
deleted file mode 100644
index 2fe99ce..0000000
--- a/luni/src/main/java/java/lang/LangAccessImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang;
-
-import org.apache.harmony.kernel.vm.LangAccess;
-
-/**
- * Implementation of bridge into <code>java.lang</code>.
- */
-/*package*/ final class LangAccessImpl extends LangAccess {
-    /** non-null; unique instance of this class */
-    /*package*/ static final LangAccessImpl THE_ONE = new LangAccessImpl();
-
-    /**
-     * This class is not publicly instantiable. Use {@link #THE_ONE}.
-     */
-    private LangAccessImpl() {
-        // This space intentionally left blank.
-    }
-
-    /** {@inheritDoc} */
-    public <T> T[] getEnumValuesInOrder(Class<T> clazz) {
-        ClassMembers<T> members = clazz.getClassMembers();
-        return members.getEnumValuesInOrder();
-    }
-
-    /** {@inheritDoc} */
-    public void unpark(Thread thread) {
-        thread.unpark();
-    }
-
-    /** {@inheritDoc} */
-    public void parkFor(long nanos) {
-        Thread.currentThread().parkFor(nanos);
-    }
-
-    /** {@inheritDoc} */
-    public void parkUntil(long time) {
-        Thread.currentThread().parkUntil(time);
-    }
-}
diff --git a/luni/src/main/java/java/lang/LinkageError.java b/luni/src/main/java/java/lang/LinkageError.java
index c88d0c4..0bd0a53 100644
--- a/luni/src/main/java/java/lang/LinkageError.java
+++ b/luni/src/main/java/java/lang/LinkageError.java
@@ -33,7 +33,6 @@
      * trace.
      */
     public LinkageError() {
-        super();
     }
 
     /**
@@ -46,4 +45,13 @@
     public LinkageError(String detailMessage) {
         super(detailMessage);
     }
+
+    /**
+     * Constructs a new {@code LinkageError} with the given detail message and cause.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public LinkageError(String detailMessage, Throwable cause) {
+        super(detailMessage, cause);
+    }
 }
diff --git a/luni/src/main/java/java/lang/Long.java b/luni/src/main/java/java/lang/Long.java
index fa1ae6c..d6605e6 100644
--- a/luni/src/main/java/java/lang/Long.java
+++ b/luni/src/main/java/java/lang/Long.java
@@ -107,9 +107,17 @@
      * @since 1.2
      */
     public int compareTo(Long object) {
-        long thisValue = this.value;
-        long thatValue = object.value;
-        return thisValue < thatValue ? -1 : (thisValue == thatValue ? 0 : 1);
+        return compare(value, object.value);
+    }
+
+    /**
+     * Compares two {@code long} values.
+     * @return 0 if lhs = rhs, less than 0 if lhs &lt; rhs, and greater than 0 if lhs &gt; rhs.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int compare(long lhs, long rhs) {
+        return lhs < rhs ? -1 : (lhs == rhs ? 0 : 1);
     }
 
     private static NumberFormatException invalidLong(String s) {
@@ -700,11 +708,7 @@
      * @since 1.5
      */
     public static int signum(long v) {
-        // BEGIN android-changed
         return v < 0 ? -1 : (v == 0 ? 0 : 1);
-        // END android-changed
-//      The following branch-free version is faster on modern desktops/servers
-//      return ((int)(v >> 63)) | (int) (-v >>> 63); // Hacker's delight 2-7
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Math.java b/luni/src/main/java/java/lang/Math.java
index b1179a3..68db4fa 100644
--- a/luni/src/main/java/java/lang/Math.java
+++ b/luni/src/main/java/java/lang/Math.java
@@ -58,11 +58,7 @@
      *            the value whose absolute value has to be computed.
      * @return the absolute value of the argument.
      */
-    public static double abs(double d) {
-        long bits = Double.doubleToLongBits(d);
-        bits &= 0x7fffffffffffffffL;
-        return Double.longBitsToDouble(bits);
-    }
+    public static native double abs(double d);
 
     /**
      * Returns the absolute value of the argument.
@@ -80,11 +76,7 @@
      * @return the argument if it is positive, otherwise the negation of the
      *         argument.
      */
-    public static float abs(float f) {
-        int bits = Float.floatToIntBits(f);
-        bits &= 0x7fffffff;
-        return Float.intBitsToFloat(bits);
-    }
+    public static native float abs(float f);
 
     /**
      * Returns the absolute value of the argument.
@@ -97,9 +89,7 @@
      * @return the argument if it is positive, otherwise the negation of the
      *         argument.
      */
-    public static int abs(int i) {
-        return i >= 0 ? i : -i;
-    }
+    public static native int abs(int i);
 
     /**
      * Returns the absolute value of the argument. If the argument is {@code
@@ -110,9 +100,7 @@
      * @return the argument if it is positive, otherwise the negation of the
      *         argument.
      */
-    public static long abs(long l) {
-        return l >= 0 ? l : -l;
-    }
+    public static native long abs(long l);
 
     /**
      * Returns the closest double approximation of the arc cosine of the
@@ -552,9 +540,7 @@
      *            the second argument.
      * @return the larger of {@code i1} and {@code i2}.
      */
-    public static int max(int i1, int i2) {
-        return i1 > i2 ? i1 : i2;
-    }
+    public static native int max(int i1, int i2);
 
     /**
      * Returns the most positive (closest to positive infinity) of the two
@@ -654,9 +640,7 @@
      *            the second argument.
      * @return the smaller of {@code i1} and {@code i2}.
      */
-    public static int min(int i1, int i2) {
-        return i1 < i2 ? i1 : i2;
-    }
+    public static native int min(int i1, int i2);
 
     /**
      * Returns the most negative (closest to negative infinity) of the two
@@ -1037,6 +1021,8 @@
         return nextafter(d, Double.MAX_VALUE) - d;
     }
 
+    private static native double nextafter(double x, double y);
+
     /**
      * Returns the argument's ulp (unit in the last place). The size of a ulp of
      * a float value is the positive distance between this value and the float
@@ -1065,14 +1051,21 @@
         } else if (f == Float.MAX_VALUE || f == -Float.MAX_VALUE) {
             return (float) pow(2, 104);
         }
-        f = abs(f);
-        return nextafterf(f, Float.MAX_VALUE) - f;
+
+        f = Math.abs(f);
+        int hx = Float.floatToRawIntBits(f);
+        int hy = Float.floatToRawIntBits(Float.MAX_VALUE);
+        if ((hx & 0x7fffffff) == 0) { /* f == 0 */
+            return Float.intBitsToFloat((hy & 0x80000000) | 0x1);
+        }
+        if ((hx > 0) ^ (hx > hy)) { /* |f| < |Float.MAX_VALUE| */
+            hx += 1;
+        } else {
+            hx -= 1;
+        }
+        return Float.intBitsToFloat(hx) - f;
     }
 
-    private native static double nextafter(double x, double y);
-
-    private native static float nextafterf(float x, float y);
-
     /**
      * Returns a double with the given magnitude and the sign of {@code sign}.
      * If {@code sign} is NaN, the sign of the result is arbitrary.
@@ -1100,7 +1093,7 @@
     }
 
     /**
-     * Returns the exponent of float {@code f}.
+     * Returns the unbiased base-2 exponent of float {@code f}.
      * @since 1.6
      */
     public static int getExponent(float f) {
@@ -1110,7 +1103,7 @@
     }
 
     /**
-     * Returns the exponent of double {@code d}.
+     * Returns the unbiased base-2 exponent of double {@code d}.
      * @since 1.6
      */
     public static int getExponent(double d) {
diff --git a/luni/src/main/java/java/lang/NegativeArraySizeException.java b/luni/src/main/java/java/lang/NegativeArraySizeException.java
index aa3eb2f..9f5ec03 100644
--- a/luni/src/main/java/java/lang/NegativeArraySizeException.java
+++ b/luni/src/main/java/java/lang/NegativeArraySizeException.java
@@ -30,7 +30,6 @@
      * current stack trace.
      */
     public NegativeArraySizeException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/NoClassDefFoundError.java b/luni/src/main/java/java/lang/NoClassDefFoundError.java
index ca5342b..b796711 100644
--- a/luni/src/main/java/java/lang/NoClassDefFoundError.java
+++ b/luni/src/main/java/java/lang/NoClassDefFoundError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine is unable to locate a class which it has been
+ * Thrown when the VM is unable to locate a class which it has been
  * asked to load.
  */
 public class NoClassDefFoundError extends LinkageError {
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public NoClassDefFoundError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/NoSuchFieldError.java b/luni/src/main/java/java/lang/NoSuchFieldError.java
index 0eacbb6..bc2c4ab 100644
--- a/luni/src/main/java/java/lang/NoSuchFieldError.java
+++ b/luni/src/main/java/java/lang/NoSuchFieldError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that a program tries to reference,
+ * Thrown when the VM notices that a program tries to reference,
  * on a class or object, a field that does not exist.
  * <p>
  * Note that this can only occur when inconsistent class files are being loaded.
@@ -32,7 +32,6 @@
      * trace.
      */
     public NoSuchFieldError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/NoSuchFieldException.java b/luni/src/main/java/java/lang/NoSuchFieldException.java
index d7722db..bea6ecb 100644
--- a/luni/src/main/java/java/lang/NoSuchFieldException.java
+++ b/luni/src/main/java/java/lang/NoSuchFieldException.java
@@ -18,10 +18,10 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that a program tries to reference,
+ * Thrown when the VM notices that a program tries to reference,
  * on a class or object, a field that does not exist.
  */
-public class NoSuchFieldException extends java.lang.Exception {
+public class NoSuchFieldException extends Exception {
 
     private static final long serialVersionUID = -6143714805279938260L;
 
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public NoSuchFieldException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/NoSuchMethodError.java b/luni/src/main/java/java/lang/NoSuchMethodError.java
index e2450f3..67d5598 100644
--- a/luni/src/main/java/java/lang/NoSuchMethodError.java
+++ b/luni/src/main/java/java/lang/NoSuchMethodError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that a program tries to reference,
+ * Thrown when the VM notices that a program tries to reference,
  * on a class or object, a method that does not exist.
  */
 public class NoSuchMethodError extends IncompatibleClassChangeError {
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public NoSuchMethodError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/NoSuchMethodException.java b/luni/src/main/java/java/lang/NoSuchMethodException.java
index 91758ac..7cae49b 100644
--- a/luni/src/main/java/java/lang/NoSuchMethodException.java
+++ b/luni/src/main/java/java/lang/NoSuchMethodException.java
@@ -18,10 +18,10 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that a program tries to reference,
+ * Thrown when the VM notices that a program tries to reference,
  * on a class or object, a method that does not exist.
  */
-public class NoSuchMethodException extends java.lang.Exception {
+public class NoSuchMethodException extends Exception {
 
     private static final long serialVersionUID = 5034388446362600923L;
 
@@ -29,11 +29,10 @@
      * Constructs a new {@code NoSuchMethodException} that includes the current
      * stack trace.
      */
-   public NoSuchMethodException() {
-        super();
+    public NoSuchMethodException() {
     }
 
-   /**
+    /**
      * Constructs a new {@code NoSuchMethodException} with the current stack
      * trace and the specified detail message.
      *
diff --git a/luni/src/main/java/java/lang/NullPointerException.java b/luni/src/main/java/java/lang/NullPointerException.java
index 77bba3e..f9f1030 100644
--- a/luni/src/main/java/java/lang/NullPointerException.java
+++ b/luni/src/main/java/java/lang/NullPointerException.java
@@ -33,7 +33,6 @@
      * stack trace.
      */
     public NullPointerException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/NumberFormatException.java b/luni/src/main/java/java/lang/NumberFormatException.java
index ca7262b..8608180 100644
--- a/luni/src/main/java/java/lang/NumberFormatException.java
+++ b/luni/src/main/java/java/lang/NumberFormatException.java
@@ -21,7 +21,7 @@
  * Thrown when an invalid value is passed to a string-to-number conversion
  * method.
  */
-public class NumberFormatException extends java.lang.IllegalArgumentException {
+public class NumberFormatException extends IllegalArgumentException {
 
     private static final long serialVersionUID = -2848938806368998894L;
 
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public NumberFormatException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Object.java b/luni/src/main/java/java/lang/Object.java
index 5625b77..f6c01fe 100644
--- a/luni/src/main/java/java/lang/Object.java
+++ b/luni/src/main/java/java/lang/Object.java
@@ -192,30 +192,32 @@
     }
 
     /**
-     * Called before the object's memory is reclaimed by the VM. This
-     * can only happen once the garbage collector has detected that the
-     * object is no longer reachable by any thread of the
-     * running application.
-     * <p>
-     * The method can be used to free system resources or perform other cleanup
-     * before the object is garbage collected. The default implementation of the
-     * method is empty, which is also expected by the VM, but subclasses can
-     * override {@code finalize()} as required. Uncaught exceptions which are
-     * thrown during the execution of this method cause it to terminate
-     * immediately but are otherwise ignored.
-     * <p>
-     * Note that the VM does guarantee that {@code finalize()} is called at most
-     * once for any object, but it doesn't guarantee when (if at all) {@code
-     * finalize()} will be called. For example, object B's {@code finalize()}
-     * can delay the execution of object A's {@code finalize()} method and
-     * therefore it can delay the reclamation of A's memory. To be safe, use a
-     * {@link java.lang.ref.ReferenceQueue}, because it provides more control
-     * over the way the VM deals with references during garbage collection.
-     * </p>
+     * Invoked when the garbage collector has detected that this instance is no longer reachable.
+     * The default implementation does nothing, but this method can be overridden to free resources.
      *
-     * @throws Throwable
-     *             any exception which is raised during finalization; these are
-     *             ignored by the virtual machine.
+     * <p>Note that objects that override {@code finalize} are significantly more expensive than
+     * objects that don't. Finalizers may be run a long time after the object is no longer
+     * reachable, depending on memory pressure, so it's a bad idea to rely on them for cleanup.
+     * Note also that finalizers are run on a single VM-wide finalizer thread,
+     * so doing blocking work in a finalizer is a bad idea. A finalizer is usually only necessary
+     * for a class that has a native peer and needs to call a native method to destroy that peer.
+     * Even then, it's better to provide an explicit {@code close} method (and implement
+     * {@link java.io.Closeable}), and insist that callers manually dispose of instances. This
+     * works well for something like files, but less well for something like a {@code BigInteger}
+     * where typical calling code would have to deal with lots of temporaries. Unfortunately,
+     * code that creates lots of temporaries is the worst kind of code from the point of view of
+     * the single finalizer thread.
+     *
+     * <p>If you <i>must</i> use finalizers, consider at least providing your own
+     * {@link java.lang.ref.ReferenceQueue} and having your own thread process that queue.
+     *
+     * <p>Unlike constructors, finalizers are not automatically chained. You are responsible for
+     * calling {@code super.finalize()} yourself.
+     *
+     * <p>Uncaught exceptions thrown by finalizers are ignored and do not terminate the finalizer
+     * thread.
+     *
+     * See <i>Effective Java</i> Item 7, "Avoid finalizers" for more.
      */
     protected void finalize() throws Throwable {
     }
@@ -259,7 +261,7 @@
      * Causes a thread which is waiting on this object's monitor (by means of
      * calling one of the {@code wait()} methods) to be woken up. If more than
      * one thread is waiting, one of them is chosen at the discretion of the
-     * virtual machine. The chosen thread will not run immediately. The thread
+     * VM. The chosen thread will not run immediately. The thread
      * that called {@code notify()} has to release the object's monitor first.
      * Also, the chosen thread still has to compete against other threads that
      * try to synchronize on the same object.
diff --git a/luni/src/main/java/java/lang/OutOfMemoryError.java b/luni/src/main/java/java/lang/OutOfMemoryError.java
index 5b8e61a..feb88c3 100644
--- a/luni/src/main/java/java/lang/OutOfMemoryError.java
+++ b/luni/src/main/java/java/lang/OutOfMemoryError.java
@@ -20,9 +20,9 @@
 /**
  * Thrown when a request for memory is made that can not be satisfied using the
  * available platform resources. Such a request may be made by both the running
- * application or by an internal function of the virtual machine.
+ * application or by an internal function of the VM.
  */
-public class OutOfMemoryError extends java.lang.VirtualMachineError {
+public class OutOfMemoryError extends VirtualMachineError {
 
     private static final long serialVersionUID = 8228564086184010517L;
 
@@ -31,7 +31,6 @@
      * trace.
      */
     public OutOfMemoryError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ProcessBuilder.java b/luni/src/main/java/java/lang/ProcessBuilder.java
index d63af8b..5b7efdc 100644
--- a/luni/src/main/java/java/lang/ProcessBuilder.java
+++ b/luni/src/main/java/java/lang/ProcessBuilder.java
@@ -58,7 +58,6 @@
      *             if {@code command} is {@code null}.
      */
     public ProcessBuilder(List<String> command) {
-        super();
         if (command == null) {
             throw new NullPointerException();
         }
@@ -182,14 +181,11 @@
      *             if any of the elements of {@link #command()} is {@code null}.
      * @throws IndexOutOfBoundsException
      *             if {@link #command()} is empty.
-     * @throws SecurityException
-     *             if {@link SecurityManager#checkExec(String)} doesn't allow
-     *             process creation.
      * @throws IOException
      *             if an I/O error happens.
      */
     public Process start() throws IOException {
-        // BEGIN android-changed: push responsibility for argument checking into ProcessManager
+        // We push responsibility for argument checking into ProcessManager.
         String[] cmdArray = command.toArray(new String[command.size()]);
         String[] envArray = new String[environment.size()];
         int i = 0;
@@ -197,7 +193,5 @@
             envArray[i++] = entry.getKey() + "=" + entry.getValue();
         }
         return ProcessManager.getInstance().exec(cmdArray, envArray, directory, redirectErrorStream);
-        // END android-changed
     }
-
 }
diff --git a/luni/src/main/java/java/lang/ProcessManager.java b/luni/src/main/java/java/lang/ProcessManager.java
index 5d8c059..ce3474d 100644
--- a/luni/src/main/java/java/lang/ProcessManager.java
+++ b/luni/src/main/java/java/lang/ProcessManager.java
@@ -28,8 +28,6 @@
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import libcore.io.IoUtils;
 
 /**
@@ -186,10 +184,7 @@
         // Handle security and safety by copying mutable inputs and checking them.
         String[] command = taintedCommand.clone();
         String[] environment = taintedEnvironment != null ? taintedEnvironment.clone() : null;
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkExec(command[0]);
-        }
+
         // Check we're not passing null Strings to the native exec.
         for (String arg : command) {
             if (arg == null) {
@@ -272,8 +267,7 @@
             try {
                 kill(this.id);
             } catch (IOException e) {
-                Logger.getLogger(Process.class.getName()).log(Level.FINE,
-                        "Failed to destroy process " + id + ".", e);
+                System.logI("Failed to destroy process " + id, e);
             }
             IoUtils.closeQuietly(inputStream);
             IoUtils.closeQuietly(errorStream);
@@ -369,12 +363,10 @@
                 super.close();
             } finally {
                 synchronized (this) {
-                    if (fd != null && fd.valid()) {
-                        try {
-                            IoUtils.close(fd);
-                        } finally {
-                            fd = null;
-                        }
+                    try {
+                        IoUtils.close(fd);
+                    } finally {
+                        fd = null;
                     }
                 }
             }
@@ -397,12 +389,10 @@
                 super.close();
             } finally {
                 synchronized (this) {
-                    if (fd != null && fd.valid()) {
-                        try {
-                            IoUtils.close(fd);
-                        } finally {
-                            fd = null;
-                        }
+                    try {
+                        IoUtils.close(fd);
+                    } finally {
+                        fd = null;
                     }
                 }
             }
diff --git a/luni/src/main/java/java/lang/Runtime.java b/luni/src/main/java/java/lang/Runtime.java
index 7a98c45..0097615 100644
--- a/luni/src/main/java/java/lang/Runtime.java
+++ b/luni/src/main/java/java/lang/Runtime.java
@@ -34,23 +34,17 @@
 
 import dalvik.system.VMDebug;
 import dalvik.system.VMStack;
-import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
-import java.io.PipedInputStream;
-import java.io.PipedOutputStream;
-import java.io.Reader;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.nio.charset.Charsets;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.List;
 import java.util.StringTokenizer;
+import libcore.io.Libcore;
+import static libcore.io.OsConstants._SC_NPROCESSORS_ONLN;
 
 /**
  * Allows Java applications to interface with the environment in which they are
@@ -123,10 +117,6 @@
      *         process.
      * @throws IOException
      *             if the requested program can not be executed.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} disallows program
-     *             execution.
-     * @see SecurityManager#checkExec
      */
     public Process exec(String[] progArray) throws java.io.IOException {
         return exec(progArray, null, null);
@@ -148,10 +138,6 @@
      *         process.
      * @throws IOException
      *             if the requested program can not be executed.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} disallows program
-     *             execution.
-     * @see SecurityManager#checkExec
      */
     public Process exec(String[] progArray, String[] envp) throws java.io.IOException {
         return exec(progArray, envp, null);
@@ -175,15 +161,10 @@
      *         process.
      * @throws IOException
      *             if the requested program can not be executed.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} disallows program
-     *             execution.
-     * @see SecurityManager#checkExec
      */
     public Process exec(String[] progArray, String[] envp, File directory) throws IOException {
-        // BEGIN android-changed: push responsibility for argument checking into ProcessManager
+        // ProcessManager is responsible for all argument checking.
         return ProcessManager.getInstance().exec(progArray, envp, directory, false);
-        // END android-changed
     }
 
     /**
@@ -197,10 +178,6 @@
      *         process.
      * @throws IOException
      *             if the requested program can not be executed.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} disallows program
-     *             execution.
-     * @see SecurityManager#checkExec
      */
     public Process exec(String prog) throws java.io.IOException {
         return exec(prog, null, null);
@@ -220,10 +197,6 @@
      *         process.
      * @throws IOException
      *             if the requested program can not be executed.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} disallows program
-     *             execution.
-     * @see SecurityManager#checkExec
      */
     public Process exec(String prog, String[] envp) throws java.io.IOException {
         return exec(prog, envp, null);
@@ -246,10 +219,6 @@
      *         process.
      * @throws IOException
      *             if the requested program can not be executed.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} disallows program
-     *             execution.
-     * @see SecurityManager#checkExec
      */
     public Process exec(String prog, String[] envp, File directory) throws java.io.IOException {
         // Sanity checks
@@ -272,7 +241,7 @@
     }
 
     /**
-     * Causes the virtual machine to stop running and the program to exit. If
+     * Causes the VM to stop running and the program to exit. If
      * {@link #runFinalizersOnExit(boolean)} has been previously invoked with a
      * {@code true} argument, then all objects will be properly
      * garbage-collected and finalized first.
@@ -280,18 +249,8 @@
      * @param code
      *            the return code. By convention, non-zero return codes indicate
      *            abnormal terminations.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} does not allow the
-     *             running thread to terminate the virtual machine.
-     * @see SecurityManager#checkExit
      */
     public void exit(int code) {
-        // Security checks
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkExit(code);
-        }
-
         // Make sure we don't try this several times
         synchronized(this) {
             if (!shuttingDown) {
@@ -320,7 +279,7 @@
 
                 // Ensure finalization on exit, if requested
                 if (finalizeOnExit) {
-                    runFinalization(true);
+                    runFinalization();
                 }
 
                 // Get out of here finally...
@@ -338,7 +297,7 @@
     public native long freeMemory();
 
     /**
-     * Indicates to the virtual machine that it would be a good time to run the
+     * Indicates to the VM that it would be a good time to run the
      * garbage collector. Note that this is a hint only. There is no guarantee
      * that the garbage collector will actually be run.
      */
@@ -363,18 +322,8 @@
      *            the absolute (platform dependent) path to the library to load.
      * @throws UnsatisfiedLinkError
      *             if the library can not be loaded.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} does not allow to load
-     *             the library.
-     * @see SecurityManager#checkLink
      */
     public void load(String pathName) {
-        // Security checks
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkLink(pathName);
-        }
-
         load(pathName, VMStack.getCallingClassLoader());
     }
 
@@ -400,18 +349,8 @@
      *            the name of the library to load.
      * @throws UnsatisfiedLinkError
      *             if the library can not be loaded.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} does not allow to load
-     *             the library.
-     * @see SecurityManager#checkLink
      */
     public void loadLibrary(String libName) {
-        // Security checks
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkLink(libName);
-        }
-
         loadLibrary(libName, VMStack.getCallingClassLoader());
     }
 
@@ -458,26 +397,20 @@
     private static native String nativeLoad(String filename, ClassLoader loader);
 
     /**
-     * Requests proper finalization for all Objects on the heap.
-     *
-     * @param forced Decides whether the VM really needs to do this (true)
-     *               or if this is just a suggestion that can safely be ignored
-     *               (false).
-     */
-    private native void runFinalization(boolean forced);
-
-    /**
-     * Provides a hint to the virtual machine that it would be useful to attempt
+     * Provides a hint to the VM that it would be useful to attempt
      * to perform any outstanding object finalization.
-     *
      */
     public void runFinalization() {
-        runFinalization(false);
+        try {
+            FinalizerThread.waitUntilFinalizerIsIdle();
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+        }
     }
 
     /**
      * Sets the flag that indicates whether all objects are finalized when the
-     * virtual machine is about to exit. Note that all finalization which occurs
+     * VM is about to exit. Note that all finalization which occurs
      * when the system is exiting is performed after all running threads have
      * been terminated.
      *
@@ -488,10 +421,6 @@
      */
     @Deprecated
     public static void runFinalizersOnExit(boolean run) {
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkExit(0);
-        }
         finalizeOnExit = run;
     }
 
@@ -512,7 +441,6 @@
      *            off.
      */
     public void traceInstructions(boolean enable) {
-        return;
     }
 
     /**
@@ -574,28 +502,26 @@
     }
 
     /**
-     * Registers a virtual-machine shutdown hook. A shutdown hook is a
+     * Registers a VM shutdown hook. A shutdown hook is a
      * {@code Thread} that is ready to run, but has not yet been started. All
-     * registered shutdown hooks will be executed once the virtual machine shuts
-     * down properly. A proper shutdown happens when either the
-     * {@link #exit(int)} method is called or the surrounding system decides to
-     * terminate the application, for example in response to a {@code CTRL-C} or
-     * a system-wide shutdown. A termination of the virtual machine due to the
-     * {@link #halt(int)} method, an {@link Error} or a {@code SIGKILL}, in
-     * contrast, is not considered a proper shutdown. In these cases the
-     * shutdown hooks will not be run.
-     * <p>
-     * Shutdown hooks are run concurrently and in an unspecified order. Hooks
+     * registered shutdown hooks will be executed when the VM
+     * terminates normally (typically when the {@link #exit(int)} method is called).
+     *
+     * <p><i>Note that on Android, the application lifecycle does not include VM termination,
+     * so calling this method will not ensure that your code is run</i>. Instead, you should
+     * use the most appropriate lifecycle notification ({@code Activity.onPause}, say).
+     *
+     * <p>Shutdown hooks are run concurrently and in an unspecified order. Hooks
      * failing due to an unhandled exception are not a problem, but the stack
      * trace might be printed to the console. Once initiated, the whole shutdown
      * process can only be terminated by calling {@code halt()}.
-     * <p>
-     * If {@link #runFinalizersOnExit(boolean)} has been called with a {@code
+     *
+     * <p>If {@link #runFinalizersOnExit(boolean)} has been called with a {@code
      * true} argument, garbage collection and finalization will take place after
-     * all hooks are either finished or have failed. Then the virtual machine
+     * all hooks are either finished or have failed. Then the VM
      * terminates.
-     * <p>
-     * It is recommended that shutdown hooks do not do any time-consuming
+     *
+     * <p>It is recommended that shutdown hooks do not do any time-consuming
      * activities, in order to not hold up the shutdown process longer than
      * necessary.
      *
@@ -605,10 +531,7 @@
      *             if the hook has already been started or if it has already
      *             been registered.
      * @throws IllegalStateException
-     *             if the virtual machine is already shutting down.
-     * @throws SecurityException
-     *             if a SecurityManager is registered and the calling code
-     *             doesn't have the RuntimePermission("shutdownHooks").
+     *             if the VM is already shutting down.
      */
     public void addShutdownHook(Thread hook) {
         // Sanity checks
@@ -624,11 +547,6 @@
             throw new IllegalArgumentException("Hook has already been started");
         }
 
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new RuntimePermission("shutdownHooks"));
-        }
-
         synchronized (shutdownHooks) {
             if (shutdownHooks.contains(hook)) {
                 throw new IllegalArgumentException("Hook already registered.");
@@ -639,17 +557,14 @@
     }
 
     /**
-     * Unregisters a previously registered virtual machine shutdown hook.
+     * Unregisters a previously registered VM shutdown hook.
      *
      * @param hook
      *            the shutdown hook to remove.
      * @return {@code true} if the hook has been removed successfully; {@code
      *         false} otherwise.
      * @throws IllegalStateException
-     *             if the virtual machine is already shutting down.
-     * @throws SecurityException
-     *             if a SecurityManager is registered and the calling code
-     *             doesn't have the RuntimePermission("shutdownHooks").
+     *             if the VM is already shutting down.
      */
     public boolean removeShutdownHook(Thread hook) {
         // Sanity checks
@@ -661,57 +576,40 @@
             throw new IllegalStateException("VM already shutting down");
         }
 
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new RuntimePermission("shutdownHooks"));
-        }
-
         synchronized (shutdownHooks) {
             return shutdownHooks.remove(hook);
         }
     }
 
     /**
-     * Causes the virtual machine to stop running, and the program to exit.
+     * Causes the VM to stop running, and the program to exit.
      * Neither shutdown hooks nor finalizers are run before.
      *
      * @param code
      *            the return code. By convention, non-zero return codes indicate
      *            abnormal terminations.
-     * @throws SecurityException
-     *             if the current {@code SecurityManager} does not allow the
-     *             running thread to terminate the virtual machine.
-     * @see SecurityManager#checkExit
      * @see #addShutdownHook(Thread)
      * @see #removeShutdownHook(Thread)
      * @see #runFinalizersOnExit(boolean)
      */
     public void halt(int code) {
-        // Security checks
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkExit(code);
-        }
-
         // Get out of here...
         nativeExit(code, false);
     }
 
-
     /**
-     * Returns the number of processors available to the virtual machine.
-     *
-     * @return the number of available processors, at least 1.
+     * Returns the number of processors available to the VM, at least 1.
      */
-    public native int availableProcessors();
+    public int availableProcessors() {
+        return (int) Libcore.os.sysconf(_SC_NPROCESSORS_ONLN);
+    }
 
     /**
      * Returns the maximum amount of memory that may be used by the virtual
      * machine, or {@code Long.MAX_VALUE} if there is no such limit.
      *
-     * @return the maximum amount of memory that the virtual machine will try to
+     * @return the maximum amount of memory that the VM will try to
      *         allocate, measured in bytes.
      */
     public native long maxMemory();
-
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/lang/RuntimeException.java b/luni/src/main/java/java/lang/RuntimeException.java
index 976e2af..b25905d 100644
--- a/luni/src/main/java/java/lang/RuntimeException.java
+++ b/luni/src/main/java/java/lang/RuntimeException.java
@@ -20,7 +20,7 @@
 /**
  * {@code RuntimeException} is the superclass of all classes that represent
  * exceptional conditions which occur as a result of executing an application in
- * the virtual machine. Unlike checked exceptions (exceptions where the type
+ * the VM. Unlike checked exceptions (exceptions where the type
  * doesn't extend {@code RuntimeException} or {@link Error}), the compiler does
  * not require code to handle runtime exceptions.
  */
@@ -33,7 +33,6 @@
      * trace.
      */
     public RuntimeException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/RuntimePermission.java b/luni/src/main/java/java/lang/RuntimePermission.java
index a6714e8..752c74a 100644
--- a/luni/src/main/java/java/lang/RuntimePermission.java
+++ b/luni/src/main/java/java/lang/RuntimePermission.java
@@ -20,63 +20,13 @@
 import java.security.BasicPermission;
 
 /**
- * Represents the permission to execute a runtime-related function. There is no
- * action list associated with a {@code RuntimePermission}; the user either has
- * the permission or he doesn't.
+ * Legacy security code; this class exists for compatibility only.
  */
 public final class RuntimePermission extends BasicPermission {
 
     private static final long serialVersionUID = 7399184964622342223L;
 
     /**
-     * Constants for runtime permissions used in this package.
-     */
-    static final RuntimePermission permissionToSetSecurityManager = new RuntimePermission(
-            "setSecurityManager");
-
-    static final RuntimePermission permissionToCreateSecurityManager = new RuntimePermission(
-            "createSecurityManager");
-
-    static final RuntimePermission permissionToGetProtectionDomain = new RuntimePermission(
-            "getProtectionDomain");
-
-    static final RuntimePermission permissionToGetClassLoader = new RuntimePermission(
-            "getClassLoader");
-
-    static final RuntimePermission permissionToCreateClassLoader = new RuntimePermission(
-            "createClassLoader");
-
-    static final RuntimePermission permissionToModifyThread = new RuntimePermission(
-            "modifyThread");
-
-    static final RuntimePermission permissionToModifyThreadGroup = new RuntimePermission(
-            "modifyThreadGroup");
-
-    static final RuntimePermission permissionToExitVM = new RuntimePermission(
-            "exitVM");
-
-    static final RuntimePermission permissionToReadFileDescriptor = new RuntimePermission(
-            "readFileDescriptor");
-
-    static final RuntimePermission permissionToWriteFileDescriptor = new RuntimePermission(
-            "writeFileDescriptor");
-
-    static final RuntimePermission permissionToQueuePrintJob = new RuntimePermission(
-            "queuePrintJob");
-
-    static final RuntimePermission permissionToSetFactory = new RuntimePermission(
-            "setFactory");
-
-    static final RuntimePermission permissionToSetIO = new RuntimePermission(
-            "setIO");
-
-    static final RuntimePermission permissionToStopThread = new RuntimePermission(
-            "stopThread");
-
-    static final RuntimePermission permissionToSetContextClassLoader = new RuntimePermission(
-            "setContextClassLoader");
-
-    /**
      * Creates an instance of {@code RuntimePermission} with the specified name.
      *
      * @param permissionName
diff --git a/luni/src/main/java/java/lang/SecurityException.java b/luni/src/main/java/java/lang/SecurityException.java
index fdcf19d..42d64a8 100644
--- a/luni/src/main/java/java/lang/SecurityException.java
+++ b/luni/src/main/java/java/lang/SecurityException.java
@@ -20,7 +20,7 @@
 /**
  * Thrown when a security manager check fails.
  */
-public class SecurityException extends java.lang.RuntimeException {
+public class SecurityException extends RuntimeException {
 
     private static final long serialVersionUID = 6878364983674394167L;
 
@@ -29,7 +29,6 @@
      * stack trace.
      */
     public SecurityException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/SecurityManager.java b/luni/src/main/java/java/lang/SecurityManager.java
index 1daf1ac..b1208ed 100644
--- a/luni/src/main/java/java/lang/SecurityManager.java
+++ b/luni/src/main/java/java/lang/SecurityManager.java
@@ -17,8 +17,6 @@
 
 package java.lang;
 
-// BEGIN android-added
-
 import dalvik.system.VMStack;
 import java.io.File;
 import java.io.FileDescriptor;
@@ -28,38 +26,20 @@
 import java.lang.reflect.Member;
 import java.net.InetAddress;
 import java.net.SocketPermission;
-import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.security.AllPermission;
 import java.security.Permission;
 import java.security.Security;
 import java.security.SecurityPermission;
-import java.util.PropertyPermission;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
- * <strong>Warning:</strong> security managers do <strong>not</strong> provide a
+ * Legacy security code; this class exists for compatibility only.
+ *
+ * <p>Security managers do <strong>not</strong> provide a
  * secure environment for executing untrusted code. Untrusted code cannot be
  * safely isolated within the Dalvik VM.
- *
- * <p>Provides security verification facilities for applications. {@code
- * SecurityManager} contains a set of {@code checkXXX} methods which determine
- * if it is safe to perform a specific operation such as establishing network
- * connections, modifying files, and many more. In general, these methods simply
- * return if they allow the application to perform the operation; if an
- * operation is not allowed, then they throw a {@link SecurityException}. The
- * only exception is {@link #checkTopLevelWindow(Object)}, which returns a
- * boolean to indicate permission.
  */
 public class SecurityManager {
-
-    private static final PropertyPermission READ_WRITE_ALL_PROPERTIES_PERMISSION = new PropertyPermission(
-            "*", "read,write");
-
-    private static final String PKG_ACC_KEY = "package.access";
-
-    private static final String PKG_DEF_KEY = "package.definition";
-
     /**
      * Flag to indicate whether a security check is in progress.
      *
@@ -70,589 +50,185 @@
 
     /**
      * Constructs a new {@code SecurityManager} instance.
-     * <p>
-     * The {@code RuntimePermission("createSecurityManager")} is checked if a
-     * security manager is installed.
      */
     public SecurityManager() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security
-                    .checkPermission(RuntimePermission.permissionToCreateSecurityManager);
-        }
-        Class<?> type = Security.class; // initialize Security properties
-        if (type == null) {
-            throw new AssertionError();
-        }
     }
 
     /**
-     * Checks whether the calling thread is allowed to accept socket
-     * connections.
-     *
-     * @param host
-     *            the address of the host that attempts to connect.
-     * @param port
-     *            the port number to check.
-     * @throws NullPointerException
-     *             if {@code host} is {@code null}.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to accept socket
-     *             connections from {@code host} through {@code port}.
+     * Does nothing.
      */
     public void checkAccept(String host, int port) {
-        if (host == null) {
-            throw new NullPointerException();
-        }
-        checkPermission(new SocketPermission(host + ':' + port, "accept"));
     }
 
     /**
-     * Checks whether the calling thread is allowed to modify the specified
-     * thread.
-     *
-     * @param thread
-     *            the thread to access.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access {@code thread}.
+     * Does nothing.
      */
     public void checkAccess(Thread thread) {
-        // Only worry about system threads. Dead threads have a null group.
-        ThreadGroup group = thread.getThreadGroup();
-        if ((group != null) && (group.parent == null)) {
-            checkPermission(RuntimePermission.permissionToModifyThread);
-        }
     }
 
     /**
-     * Checks whether the calling thread is allowed to modify the specified
-     * thread group.
-     *
-     * @param group
-     *            the thread group to access.
-     * @throws NullPointerException
-     *             if {@code group} is {@code null}.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access {@code group}.
+     * Does nothing.
      */
     public void checkAccess(ThreadGroup group) {
-        // Only worry about system threads.
-        if (group == null) {
-            throw new NullPointerException();
-        }
-        if (group.parent == null) {
-            checkPermission(RuntimePermission.permissionToModifyThreadGroup);
-        }
     }
 
     /**
-     * Checks whether the calling thread is allowed to establish socket
-     * connections. A -1 port indicates the caller is trying to resolve the
-     * hostname.
-     *
-     * @param host
-     *            the address of the host to connect to.
-     * @param port
-     *            the port number to check, or -1 for resolve.
-     * @throws NullPointerException
-     *             if {@code host} is {@code null}.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to connect to {@code
-     *             host} through {@code port}.
+     * Does nothing.
      */
     public void checkConnect(String host, int port) {
-        if (host == null) {
-            throw new NullPointerException();
-        }
-        if (port > 0) {
-            checkPermission(new SocketPermission(host + ':' + port, "connect"));
-        } else {
-            checkPermission(new SocketPermission(host, "resolve"));
-        }
     }
 
     /**
-     * Checks whether the specified security context is allowed to establish
-     * socket connections. A -1 port indicates the caller is trying to resolve
-     * the hostname.
-     *
-     * @param host
-     *            the address of the host to connect to.
-     * @param port
-     *            the port number to check, or -1 for resolve.
-     * @param context
-     *            the security context to use for the check.
-     * @throws NullPointerException
-     *             if {@code host} is {@code null}.
-     * @throws SecurityException
-     *             if {@code context} is not allowed to connect to {@code host}
-     *             through {@code port}.
+     * Does nothing.
      */
     public void checkConnect(String host, int port, Object context) {
-        // BEGIN android-added
-        if (host == null) {
-            throw new NullPointerException();
-        }
-        // END android-added
-        if (port > 0) {
-            checkPermission(new SocketPermission(host + ':' + port, "connect"),
-                    context);
-        } else {
-            checkPermission(new SocketPermission(host, "resolve"), context);
-        }
     }
 
     /**
-     * Checks whether the calling thread is allowed to create a class loader.
-     *
-     * @throws SecurityException
-     *             if the calling thread is not allowed to create a class
-     *             loader.
+     * Does nothing.
      */
     public void checkCreateClassLoader() {
-        checkPermission(RuntimePermission.permissionToCreateClassLoader);
     }
 
     /**
-     * Checks whether the calling thread is allowed to delete the file with the
-     * specified name, which should be passed in canonical form.
-     *
-     * @param file
-     *            the name of the file to delete.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to delete {@code file}.
+     * Does nothing.
      */
     public void checkDelete(String file) {
-        checkPermission(new FilePermission(file, "delete"));
     }
 
     /**
-     * Checks whether the calling thread is allowed to execute the specified
-     * platform specific command.
-     *
-     * @param cmd
-     *            the command line to execute.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to execute {@code cmd}.
+     * Does nothing.
      */
     public void checkExec(String cmd) {
-        checkPermission(new FilePermission(new File(cmd).isAbsolute() ? cmd
-                : "<<ALL FILES>>", "execute"));
     }
 
     /**
-     * Checks whether the calling thread is allowed to terminate the virtual
-     * machine.
-     *
-     * @param status
-     *            the status that the virtual machine returns when it is
-     *            terminated.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to terminate the virtual
-     *             machine with {@code status}.
+     * Does nothing.
      */
     public void checkExit(int status) {
-        checkPermission(RuntimePermission.permissionToExitVM);
     }
 
     /**
-     * Checks whether the calling thread is allowed to load the specified native
-     * library.
-     *
-     * @param libName
-     *            the name of the library to load.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to load {@code libName}.
+     * Does nothing.
      */
     public void checkLink(String libName) {
-        if (libName == null) {
-            throw new NullPointerException();
-        }
-        checkPermission(new RuntimePermission("loadLibrary." + libName));
     }
 
     /**
-     * Checks whether the calling thread is allowed to listen on the specified
-     * port.
-     *
-     * @param port
-     *            the port number to check.
-     * @throws SecurityException
-     *             if the calling thread is not allowed listen on {@code port}.
+     * Does nothing.
      */
     public void checkListen(int port) {
-        if (port == 0) {
-            checkPermission(new SocketPermission("localhost:1024-", "listen"));
-        } else {
-            checkPermission(new SocketPermission("localhost:" + port, "listen"));
-        }
     }
 
     /**
-     * Checks whether the calling thread is allowed to access members. The
-     * default is to allow access to public members (that is, {@code
-     * java.lang.reflect.Member.PUBLIC}) and to classes loaded by the same
-     * loader as the original caller (that is, the method that called the
-     * reflect API). Due to the nature of the check, overriding implementations
-     * cannot call {@code super.checkMemberAccess()} since the stack would no
-     * longer be of the expected shape.
-     *
-     * @param cls
-     *            the class of which members are accessed.
-     * @param type
-     *            the access type, either {@code
-     *            java.lang.reflect.Member.PUBLIC} or {@code
-     *            java.lang.reflect.Member.DECLARED}.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access members of
-     *             {@code cls}.
+     * Does nothing.
      */
     public void checkMemberAccess(Class<?> cls, int type) {
-        if (cls == null) {
-            throw new NullPointerException();
-        }
-        if (type == Member.PUBLIC) {
-            return;
-        }
-        //
-        // Need to compare the classloaders.
-        // Stack shape is
-        // <user code> <- want this class
-        // Class.getDeclared*();
-        // Class.checkMemberAccess();
-        // SecurityManager.checkMemberAccess(); <- current frame
-        //
-        // Use getClassLoaderImpl() since getClassLoader()
-        // returns null for the bootstrap class loader.
-        if (ClassLoader.getStackClassLoader(3) == cls.getClassLoaderImpl()) {
-            return;
-        }
-
-        // Forward off to the permission mechanism.
-        checkPermission(new RuntimePermission("accessDeclaredMembers"));
     }
 
     /**
-     * Checks whether the calling thread is allowed to use the specified IP
-     * multicast group address.
-     *
-     * @param maddr
-     *            the internet group address to use.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to use {@code maddr}.
+     * Does nothing.
      */
     public void checkMulticast(InetAddress maddr) {
-        checkPermission(new SocketPermission(maddr.getHostAddress(),
-                "accept,connect"));
     }
 
     /**
-     * Checks whether the calling thread is allowed to use the specified IP
-     * multicast group address.
-     *
-     * @param maddr
-     *            the internet group address to use.
-     * @param ttl
-     *            the value in use for multicast send. This parameter is
-     *            ignored.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to use {@code maddr}.
+     * Does nothing.
      * @deprecated use {@link #checkMulticast(java.net.InetAddress)}
      */
     @Deprecated
     public void checkMulticast(InetAddress maddr, byte ttl) {
-        checkPermission(new SocketPermission(maddr.getHostAddress(),
-                "accept,connect"));
     }
 
     /**
-     * Checks whether the calling thread is allowed to access the specified
-     * package.
-     *
-     * @param packageName
-     *            the name of the package to access.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access {@code
-     *             packageName}.
+     * Does nothing.
      */
     public void checkPackageAccess(String packageName) {
-        if (packageName == null) {
-            throw new NullPointerException();
-        }
-        if (checkPackageProperty(PKG_ACC_KEY, packageName)) {
-            checkPermission(new RuntimePermission("accessClassInPackage."
-                    + packageName));
-        }
     }
 
     /**
-     * Checks whether the calling thread is allowed to define new classes in the
-     * specified package.
-     *
-     * @param packageName
-     *            the name of the package to add a class to.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to add classes to
-     *             {@code packageName}.
+     * Does nothing.
      */
     public void checkPackageDefinition(String packageName) {
-        if (packageName == null) {
-            throw new NullPointerException();
-        }
-        if (checkPackageProperty(PKG_DEF_KEY, packageName)) {
-            checkPermission(new RuntimePermission("defineClassInPackage."
-                    + packageName));
-        }
     }
 
     /**
-     * Returns true if the package name is restricted by the specified security
-     * property.
-     */
-    private static boolean checkPackageProperty(final String property,
-            final String pkg) {
-        String list = AccessController.doPrivileged(PriviAction
-                .getSecurityProperty(property));
-        if (list != null) {
-            int plen = pkg.length();
-            String[] tokens = list.split(", *");
-            for (String token : tokens) {
-                int tlen = token.length();
-                if (plen > tlen
-                        && pkg.startsWith(token)
-                        && (token.charAt(tlen - 1) == '.' || pkg.charAt(tlen) == '.')) {
-                    return true;
-                } else if (plen == tlen && token.startsWith(pkg)) {
-                    return true;
-                } else if (plen + 1 == tlen && token.startsWith(pkg)
-                        && token.charAt(tlen - 1) == '.') {
-                    return true;
-                }
-            }
-        }
-
-        return false;
-    }
-
-    /**
-     * Checks whether the calling thread is allowed to access the system
-     * properties.
-     *
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access system
-     *             properties.
+     * Does nothing.
      */
     public void checkPropertiesAccess() {
-        checkPermission(READ_WRITE_ALL_PROPERTIES_PERMISSION);
     }
 
     /**
-     * Checks whether the calling thread is allowed to access a particular
-     * system property.
-     *
-     * @param key
-     *            the name of the property to access.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access the {@code
-     *             key} system property.
+     * Does nothing.
      */
     public void checkPropertyAccess(String key) {
-        checkPermission(new PropertyPermission(key, "read"));
     }
 
     /**
-     * Checks whether the calling thread is allowed to read from the file with
-     * the specified file descriptor.
-     *
-     * @param fd
-     *            the file descriptor of the file to read from.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to read from {@code fd}.
+     * Does nothing.
      */
     public void checkRead(FileDescriptor fd) {
-        if (fd == null) {
-            throw new NullPointerException();
-        }
-        checkPermission(RuntimePermission.permissionToReadFileDescriptor);
     }
 
     /**
-     * Checks whether the calling thread is allowed to read from the file with
-     * the specified name, which should be passed in canonical form.
-     *
-     * @param file
-     *            the name of the file or directory to read from.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to read from {@code
-     *             file}.
+     * Does nothing.
      */
     public void checkRead(String file) {
-        checkPermission(new FilePermission(file, "read"));
     }
 
     /**
-     * Checks whether the given security context is allowed to read from the
-     * file named by the argument, which should be passed in canonical form.
-     *
-     * @param file
-     *            the name of the file or directory to check.
-     * @param context
-     *            the security context to use for the check.
-     * @throws SecurityException
-     *             if {@code context} is not allowed to read from {@code file}.
+     * Does nothing.
      */
     public void checkRead(String file, Object context) {
-        checkPermission(new FilePermission(file, "read"), context);
     }
 
     /**
-     * Checks whether the calling thread is allowed to perform the security
-     * operation named by the target.
-     *
-     * @param target
-     *            the name of the operation to perform.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to perform
-     *             {@code target}.
+     * Does nothing.
      */
     public void checkSecurityAccess(String target) {
-        checkPermission(new SecurityPermission(target));
     }
 
     /**
-     * Checks whether the calling thread is allowed to set the net object
-     * factories.
-     *
-     * @throws SecurityException
-     *             if the calling thread is not allowed to set the net object
-     *             factories.
+     * Does nothing.
      */
     public void checkSetFactory() {
-        checkPermission(RuntimePermission.permissionToSetFactory);
     }
 
     /**
-     * Checks whether the calling thread is trusted to show the specified top
-     * level window.
-     *
-     * @param window
-     *            the window to show.
-     * @return {@code true} if the calling thread is allowed to show {@code
-     *         window}; {@code false} otherwise.
-     * @throws NullPointerException
-     *             if {@code window} is {@code null}.
+     * Returns true.
      */
     public boolean checkTopLevelWindow(Object window) {
-        if (window == null) {
-            throw new NullPointerException();
-        }
-        try {
-            Class<?> awtPermission = Class.forName("java.awt.AWTPermission");
-            Constructor<?> constructor = awtPermission
-                    .getConstructor(String.class);
-            Object perm = constructor
-                    .newInstance("showWindowWithoutWarningBanner");
-            checkPermission((Permission) perm);
-        } catch (ClassNotFoundException e) {
-        } catch (NoSuchMethodException e) {
-        } catch (InstantiationException e) {
-        } catch (IllegalAccessException e) {
-        } catch (InvocationTargetException e) {
-        } catch (SecurityException e) {
-            return false;
-        }
         return true;
     }
 
     /**
-     * Checks whether the calling thread is allowed to access the system
-     * clipboard.
-     *
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access the system
-     *             clipboard.
+     * Does nothing.
      */
     public void checkSystemClipboardAccess() {
-        try {
-            Class<?> awtPermission = Class.forName("java.awt.AWTPermission");
-            Constructor<?> constructor = awtPermission
-                    .getConstructor(String.class);
-            Object perm = constructor.newInstance("accessClipboard");
-            checkPermission((Permission) perm);
-            return;
-        } catch (ClassNotFoundException e) {
-        } catch (NoSuchMethodException e) {
-        } catch (InstantiationException e) {
-        } catch (IllegalAccessException e) {
-        } catch (InvocationTargetException e) {
-        }
-        throw new SecurityException();
     }
 
     /**
-     * Checks whether the calling thread is allowed to access the AWT event
-     * queue.
-     *
-     * @throws SecurityException
-     *             if the calling thread is not allowed to access the AWT event
-     *             queue.
+     * Does nothing.
      */
     public void checkAwtEventQueueAccess() {
-        try {
-            Class<?> awtPermission = Class.forName("java.awt.AWTPermission");
-            Constructor<?> constructor = awtPermission
-                    .getConstructor(String.class);
-            Object perm = constructor.newInstance("accessEventQueue");
-            checkPermission((Permission) perm);
-            return;
-        } catch (ClassNotFoundException e) {
-        } catch (NoSuchMethodException e) {
-        } catch (InstantiationException e) {
-        } catch (IllegalAccessException e) {
-        } catch (InvocationTargetException e) {
-        }
-        throw new SecurityException();
     }
 
     /**
-     * Checks whether the calling thread is allowed to start a new print job.
-     *
-     * @throws SecurityException
-     *             if the calling thread is not allowed to start a new print
-     *             job.
+     * Does nothing.
      */
     public void checkPrintJobAccess() {
-        checkPermission(RuntimePermission.permissionToQueuePrintJob);
     }
 
     /**
-     * Checks whether the calling thread is allowed to write to the file with
-     * the specified file descriptor.
-     *
-     * @param fd
-     *            the file descriptor of the file to write to.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to write to {@code fd}.
+     * Does nothing.
      */
     public void checkWrite(FileDescriptor fd) {
-        if (fd == null) {
-            throw new NullPointerException();
-        }
-        checkPermission(RuntimePermission.permissionToWriteFileDescriptor);
     }
 
     /**
-     * Checks whether the calling thread is allowed to write to the file with
-     * the specified name, which should be passed in canonical form.
-     *
-     * @param file
-     *            the name of the file or directory to write to.
-     * @throws SecurityException
-     *             if the calling thread is not allowed to write to
-     *             {@code file}.
+     * Does nothing.
      */
     public void checkWrite(String file) {
-        checkPermission(new FilePermission(file, "write"));
     }
 
     /**
@@ -676,7 +252,7 @@
      */
     @SuppressWarnings("unchecked")
     protected Class[] getClassContext() {
-        return VMStack.getClasses(-1, false);
+        return VMStack.getClasses(-1);
     }
 
     /**
@@ -688,7 +264,6 @@
      */
     @Deprecated
     protected ClassLoader currentClassLoader() {
-
         /*
          * First, check if AllPermission is allowed. If so, then we are
          * effectively running in an unsafe environment, so just answer null
@@ -704,14 +279,8 @@
          * Now, check if there are any non-system class loaders in the stack up
          * to the first privileged method (or the end of the stack.
          */
-        Class<?>[] classes = Class.getStackClasses(-1, true);
-        for (int i = 0; i < classes.length; i++) {
-            ClassLoader cl = classes[i].getClassLoaderImpl();
-            if (!cl.isSystemClassLoader()) {
-                return cl;
-            }
-        }
-        return null;
+        Class<?>[] classes = VMStack.getClasses(-1);
+        return classes.length > 0 ? classes[0].getClassLoaderImpl() : null;
     }
 
     /**
@@ -739,47 +308,16 @@
          * Now, check if there are any non-system class loaders in the stack up
          * to the first privileged method (or the end of the stack.
          */
-        Class<?>[] classes = Class.getStackClasses(-1, true);
-        for (int i = 0; i < classes.length; i++) {
-            ClassLoader cl = classes[i].getClassLoaderImpl();
-            if (!cl.isSystemClassLoader()) {
-                return i;
-            }
-        }
-        return -1;
+        Class<?>[] classes = VMStack.getClasses(-1);
+        return classes.length > 0 ? 0 : -1;
     }
 
     /**
-     * Returns the first class in the call stack that was loaded by a class
-     * loader which is not a system class loader.
-     *
-     * @return the most recent class loaded by a non-system class loader.
+     * Returns null.
      * @deprecated Use {@link #checkPermission}.
      */
     @Deprecated
     protected Class<?> currentLoadedClass() {
-        /*
-         * First, check if AllPermission is allowed. If so, then we are
-         * effectively running in an unsafe environment, so just answer null
-         * (==> everything is a system class).
-         */
-        try {
-            checkPermission(new AllPermission());
-            return null;
-        } catch (SecurityException ex) {
-        }
-
-        /*
-         * Now, check if there are any non-system class loaders in the stack up
-         * to the first privileged method (or the end of the stack.
-         */
-        Class<?>[] classes = Class.getStackClasses(-1, true);
-        for (int i = 0; i < classes.length; i++) {
-            ClassLoader cl = classes[i].getClassLoaderImpl();
-            if (!cl.isSystemClassLoader()) {
-                return classes[i];
-            }
-        }
         return null;
     }
 
@@ -796,7 +334,7 @@
      */
     @Deprecated
     protected int classDepth(String name) {
-        Class<?>[] classes = Class.getStackClasses(-1, false);
+        Class<?>[] classes = VMStack.getClasses(-1);
         for (int i = 0; i < classes.length; i++) {
             if (classes[i].getName().equals(name)) {
                 return i;
@@ -846,8 +384,7 @@
 
     /**
      * Returns an object which encapsulates the security state of the current
-     * point in the execution. In our case, this is an {@link
-     * java.security.AccessControlContext}.
+     * point in the execution.
      *
      * @return an object that encapsulates information about the current
      *         execution environment.
@@ -857,51 +394,14 @@
     }
 
     /**
-     * Checks whether the calling thread is allowed to access the resource being
-     * guarded by the specified permission object.
-     *
-     * @param permission
-     *            the permission to check.
-     * @throws SecurityException
-     *             if the requested {@code permission} is denied according to
-     *             the current security policy.
+     * Does nothing.
      */
     public void checkPermission(Permission permission) {
-        try {
-            inCheck = true;
-            AccessController.checkPermission(permission);
-        } finally {
-            inCheck = false;
-        }
     }
 
     /**
-     * Checks whether the specified security context is allowed to access the
-     * resource being guarded by the specified permission object.
-     *
-     * @param permission
-     *            the permission to check.
-     * @param context
-     *            the security context for which to check permission.
-     * @throws SecurityException
-     *             if {@code context} is not an instance of {@code
-     *             AccessControlContext} or if the requested {@code permission}
-     *             is denied for {@code context} according to the current
-     *             security policy.
+     * Does nothing.
      */
     public void checkPermission(Permission permission, Object context) {
-        try {
-            inCheck = true;
-            // Must be an AccessControlContext. If we don't check
-            // this, then applications could pass in an arbitrary
-            // object which circumvents the security check.
-            if (context instanceof AccessControlContext) {
-                ((AccessControlContext) context).checkPermission(permission);
-            } else {
-                throw new SecurityException();
-            }
-        } finally {
-            inCheck = false;
-        }
     }
 }
diff --git a/luni/src/main/java/java/lang/Short.java b/luni/src/main/java/java/lang/Short.java
index 2900d6f..02f7e65 100644
--- a/luni/src/main/java/java/lang/Short.java
+++ b/luni/src/main/java/java/lang/Short.java
@@ -104,7 +104,17 @@
      * @since 1.2
      */
     public int compareTo(Short object) {
-        return value > object.value ? 1 : (value < object.value ? -1 : 0);
+        return compare(value, object.value);
+    }
+
+    /**
+     * Compares two {@code short} values.
+     * @return 0 if lhs = rhs, less than 0 if lhs &lt; rhs, and greater than 0 if lhs &gt; rhs.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int compare(long lhs, long rhs) {
+        return lhs > rhs ? 1 : (lhs < rhs ? -1 : 0);
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/StackOverflowError.java b/luni/src/main/java/java/lang/StackOverflowError.java
index 5ac4fdc..8af7dee 100644
--- a/luni/src/main/java/java/lang/StackOverflowError.java
+++ b/luni/src/main/java/java/lang/StackOverflowError.java
@@ -19,7 +19,7 @@
 
 /**
  * Thrown when the depth of the stack of the running program exceeds some
- * platform or virtual machine specific limit. Typically, this will occur only
+ * platform or VM specific limit. Typically, this will occur only
  * when a program becomes infinitely recursive, but it can also occur in
  * correctly written (but deeply recursive) programs.
  */
@@ -32,7 +32,6 @@
      * stack trace.
      */
     public StackOverflowError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/StackTraceElement.java b/luni/src/main/java/java/lang/StackTraceElement.java
index a899a92..b83120c 100644
--- a/luni/src/main/java/java/lang/StackTraceElement.java
+++ b/luni/src/main/java/java/lang/StackTraceElement.java
@@ -30,9 +30,7 @@
 
     private static final long serialVersionUID = 6992337162326171013L;
 
-    // BEGIN android-added
     private static final int NATIVE_LINE_NUMBER = -2;
-    // END android-added
 
     String declaringClass;
 
@@ -60,7 +58,6 @@
      *             if {@code cls} or {@code method} is {@code null}.
      */
     public StackTraceElement(String cls, String method, String file, int line) {
-        super();
         if (cls == null || method == null) {
             throw new NullPointerException();
         }
@@ -76,7 +73,6 @@
      * </p>
      */
     private StackTraceElement() {
-        super();
     }
 
     /**
@@ -200,9 +196,7 @@
      *         executing is a native method; {@code false} otherwise.
      */
     public boolean isNativeMethod() {
-        // BEGIN android-changed
         return lineNumber == NATIVE_LINE_NUMBER;
-        // END android-changed
     }
 
     @Override
diff --git a/luni/src/main/java/java/lang/StrictMath.java b/luni/src/main/java/java/lang/StrictMath.java
index 426fc2d..d21027b 100644
--- a/luni/src/main/java/java/lang/StrictMath.java
+++ b/luni/src/main/java/java/lang/StrictMath.java
@@ -38,13 +38,13 @@
     /**
      * The double value closest to e, the base of the natural logarithm.
      */
-    public final static double E = Math.E;
+    public static final double E = Math.E;
 
     /**
      * The double value closest to pi, the ratio of a circle's circumference to
      * its diameter.
      */
-    public final static double PI = Math.PI;
+    public static final double PI = Math.PI;
 
     /**
      * Prevents this class from being instantiated.
@@ -992,21 +992,10 @@
      * @return the size of a ulp of the argument.
      */
     public static float ulp(float f) {
-        // special cases
-        if (Float.isNaN(f)) {
-            return Float.NaN;
-        } else if (Float.isInfinite(f)) {
-            return Float.POSITIVE_INFINITY;
-        } else if (f == Float.MAX_VALUE || f == -Float.MAX_VALUE) {
-            return (float) pow(2, 104);
-        }
-        f = Math.abs(f);
-        return nextafterf(f, Float.MAX_VALUE) - f;
+        return Math.ulp(f);
     }
 
-    private native static double nextafter(double x, double y);
-
-    private native static float nextafterf(float x, float y);
+    private static native double nextafter(double x, double y);
 
     /**
      * Returns a double with the given magnitude and the sign of {@code sign}.
diff --git a/luni/src/main/java/java/lang/String.java b/luni/src/main/java/java/lang/String.java
index 4bf0af7..56b99f4 100644
--- a/luni/src/main/java/java/lang/String.java
+++ b/luni/src/main/java/java/lang/String.java
@@ -522,7 +522,6 @@
      * @since 1.5
      */
     public String(int[] codePoints, int offset, int count) {
-        super();
         if (codePoints == null) {
             throw new NullPointerException();
         }
@@ -583,27 +582,25 @@
      * @throws IndexOutOfBoundsException
      *             if {@code index < 0} or {@code index >= length()}.
      */
-    public char charAt(int index) {
-        if (index >= 0 && index < count) {
-            return value[offset + index];
-        }
-        throw indexAndLength(index);
-    }
+    public native char charAt(int index);
 
     private StringIndexOutOfBoundsException indexAndLength(int index) {
-        throw new StringIndexOutOfBoundsException("index=" + index + " length=" + count);
+        throw new StringIndexOutOfBoundsException(this, index);
     }
 
     private StringIndexOutOfBoundsException startEndAndLength(int start, int end) {
-        throw new StringIndexOutOfBoundsException("start=" + start + " end=" + end + " length=" + count);
+        throw new StringIndexOutOfBoundsException(this, start, end - start);
     }
 
     private StringIndexOutOfBoundsException failedBoundsCheck(int arrayLength, int offset, int count) {
-        throw new StringIndexOutOfBoundsException("array length=" + arrayLength + " offset=" + offset + " count=" + count);
+        throw new StringIndexOutOfBoundsException(arrayLength, offset, count);
     }
 
-    // Optimized for ASCII
-    private char compareValue(char ch) {
+    /**
+     * This isn't equivalent to either of ICU's u_foldCase case folds, and thus any of the Unicode
+     * case folds, but it's what the RI uses.
+     */
+    private char foldCase(char ch) {
         if (ch < 128) {
             if ('A' <= ch && ch <= 'Z') {
                 return (char) (ch + ('a' - 'A'));
@@ -633,18 +630,7 @@
      * @throws NullPointerException
      *             if {@code string} is {@code null}.
      */
-    public int compareTo(String string) {
-        // Code adapted from K&R, pg 101
-        int o1 = offset, o2 = string.offset, result;
-        int end = offset + (count < string.count ? count : string.count);
-        char[] target = string.value;
-        while (o1 < end) {
-            if ((result = value[o1++] - target[o2++]) != 0) {
-                return result;
-            }
-        }
-        return count - string.count;
-    }
+    public native int compareTo(String string);
 
     /**
      * Compares the specified string to this string using the Unicode values of
@@ -675,8 +661,8 @@
             if ((c1 = value[o1++]) == (c2 = target[o2++])) {
                 continue;
             }
-            c1 = compareValue(c1);
-            c2 = compareValue(c2);
+            c1 = foldCase(c1);
+            c2 = foldCase(c2);
             if ((result = c1 - c2) != 0) {
                 return result;
             }
@@ -765,35 +751,7 @@
      *         {@code false} otherwise.
      * @see #hashCode
      */
-    @Override
-    public boolean equals(Object object) {
-        if (object == this) {
-            return true;
-        }
-        if (object instanceof String) {
-            String s = (String) object;
-            // BEGIN android-changed
-            int hashCode1 = hashCode;
-            int hashCode2 = s.hashCode;
-            if (count != s.count
-                || (hashCode1 != hashCode2 && hashCode1 != 0 && hashCode2 != 0)) {
-                return false;
-            }
-            // inline 'return regionMatches(0, s, 0, count)'
-            // omitting unnecessary bounds checks
-            int o1 = offset, o2 = s.offset;
-            char[] value1 = value;
-            char[] value2 = s.value;
-            for (int i = 0; i < count; ++i) {
-                if (value1[o1 + i] != value2[o2 + i]) {
-                    return false;
-                }
-            }
-            return true;
-            // END android-changed
-        }
-        return false;
-    }
+    @Override public native boolean equals(Object object);
 
     /**
      * Compares the specified string to this string ignoring the case of the
@@ -811,16 +769,13 @@
         if (string == null || count != string.count) {
             return false;
         }
-
         int o1 = offset, o2 = string.offset;
         int end = offset + count;
-        char c1, c2;
         char[] target = string.value;
         while (o1 < end) {
-            if ((c1 = value[o1++]) != (c2 = target[o2++])
-                    && Character.toUpperCase(c1) != Character.toUpperCase(c2)
-                    // Required for unicode that we test both cases
-                    && Character.toLowerCase(c1) != Character.toLowerCase(c2)) {
+            char c1 = value[o1++];
+            char c2 = target[o2++];
+            if (c1 != c2 && foldCase(c1) != foldCase(c2)) {
                 return false;
             }
         }
@@ -855,10 +810,10 @@
                     data[index++] = (byte) value[i];
                 }
             } catch (ArrayIndexOutOfBoundsException ignored) {
+                throw failedBoundsCheck(data.length, index, end - start);
             }
         }
-        throw new StringIndexOutOfBoundsException("start=" + start + " end=" + end
-                + " data.length=" + data.length + " index=" + index + " length=" + count);
+        throw startEndAndLength(start, end);
     }
 
     /**
@@ -940,8 +895,7 @@
             System.arraycopy(value, start + offset, buffer, index, end - start);
         } else {
             // We throw StringIndexOutOfBoundsException rather than System.arraycopy's AIOOBE.
-            throw new StringIndexOutOfBoundsException("start=" + start + " end=" + end +
-                    " buffer.length=" + buffer.length + " index=" + index + " length=" + count);
+            throw startEndAndLength(start, end);
         }
     }
 
@@ -1008,25 +962,7 @@
         return fastIndexOf(c, start);
     }
 
-    private int fastIndexOf(int c, int start) {
-        // BEGIN android-changed
-        int _count = count;
-        if (start < _count) {
-            if (start < 0) {
-                start = 0;
-            }
-            int _offset = offset;
-            int last = _offset + count;
-            char[] _value = value;
-            for (int i = _offset + start; i < last; i++) {
-                if (_value[i] == c) {
-                    return i - _offset;
-                }
-            }
-        }
-        return -1;
-        // END android-changed
-    }
+    private native int fastIndexOf(int c, int start);
 
     private int indexOfSupplementary(int c, int start) {
         if (!Character.isSupplementaryCodePoint(c)) {
@@ -1050,7 +986,6 @@
      *             if {@code string} is {@code null}.
      */
     public int indexOf(String string) {
-        // BEGIN android-changed
         int start = 0;
         int subCount = string.count;
         int _count = count;
@@ -1079,7 +1014,6 @@
             }
         }
         return start < _count ? start : _count;
-        // END android-changed
     }
 
     /**
@@ -1097,7 +1031,6 @@
      *             if {@code subString} is {@code null}.
      */
     public int indexOf(String subString, int start) {
-        // BEGIN android-changed
         if (start < 0) {
             start = 0;
         }
@@ -1128,43 +1061,39 @@
             }
         }
         return start < _count ? start : _count;
-        // END android-changed
     }
 
     /**
-     * Searches an internal table of strings for a string equal to this string.
-     * If the string is not in the table, it is added. Returns the string
-     * contained in the table which is equal to this string. The same string
-     * object is always returned for strings which are equal.
+     * Returns an interned string equal to this string. The VM maintains an internal set of
+     * unique strings. All string literals found in loaded classes'
+     * constant pools are automatically interned. Manually-interned strings are only weakly
+     * referenced, so calling {@code intern} won't lead to unwanted retention.
      *
-     * @return the interned string equal to this string.
+     * <p>Interning is typically used because it guarantees that for interned strings
+     * {@code a} and {@code b}, {@code a.equals(b)} can be simplified to
+     * {@code a == b}. (This is not true of non-interned strings.)
+     *
+     * <p>Many applications find it simpler and more convenient to use an explicit
+     * {@link java.util.HashMap} to implement their own pools.
      */
-    native public String intern();
+    public native String intern();
 
     /**
      * Returns true if the length of this string is 0.
      *
      * @since 1.6
      */
-    public boolean isEmpty() {
-        return count == 0;
-    }
+    public native boolean isEmpty();
 
     /**
-     * Searches in this string for the last index of the specified character.
+     * Returns the last index of the code point {@code c}, or -1.
      * The search for the character starts at the end and moves towards the
      * beginning of this string.
-     *
-     * @param c
-     *            the character to find.
-     * @return the index in this string of the specified character, -1 if the
-     *         character isn't found.
      */
     public int lastIndexOf(int c) {
         if (c > 0xffff) {
             return lastIndexOfSupplementary(c, Integer.MAX_VALUE);
         }
-        // BEGIN android-changed
         int _count = count;
         int _offset = offset;
         char[] _value = value;
@@ -1174,26 +1103,17 @@
             }
         }
         return -1;
-        // END android-changed
     }
 
     /**
-     * Searches in this string for the index of the specified character. The
-     * search for the character starts at the specified offset and moves towards
+     * Returns the last index of the code point {@code c}, or -1.
+     * The search for the character starts at offset {@code start} and moves towards
      * the beginning of this string.
-     *
-     * @param c
-     *            the character to find.
-     * @param start
-     *            the starting offset.
-     * @return the index in this string of the specified character, -1 if the
-     *         character isn't found.
      */
     public int lastIndexOf(int c, int start) {
         if (c > 0xffff) {
             return lastIndexOfSupplementary(c, start);
         }
-        // BEGIN android-changed
         int _count = count;
         int _offset = offset;
         char[] _value = value;
@@ -1208,7 +1128,6 @@
             }
         }
         return -1;
-        // END android-changed
     }
 
     private int lastIndexOfSupplementary(int c, int start) {
@@ -1288,9 +1207,7 @@
      *
      * @return the number of characters in this string.
      */
-    public int length() {
-        return count;
-    }
+    public native int length();
 
     /**
      * Compares the specified string to this string and compares the specified
@@ -1309,8 +1226,7 @@
      * @throws NullPointerException
      *             if {@code string} is {@code null}.
      */
-    public boolean regionMatches(int thisStart, String string, int start,
-            int length) {
+    public boolean regionMatches(int thisStart, String string, int start, int length) {
         if (string == null) {
             throw new NullPointerException();
         }
@@ -1324,7 +1240,6 @@
             return true;
         }
         int o1 = offset + thisStart, o2 = string.offset + start;
-        // BEGIN android-changed
         char[] value1 = value;
         char[] value2 = string.value;
         for (int i = 0; i < length; ++i) {
@@ -1332,7 +1247,6 @@
                 return false;
             }
         }
-        // END android-changed
         return true;
     }
 
@@ -1356,36 +1270,31 @@
      * @throws NullPointerException
      *             if {@code string} is {@code null}.
      */
-    public boolean regionMatches(boolean ignoreCase, int thisStart,
-            String string, int start, int length) {
+    public boolean regionMatches(boolean ignoreCase, int thisStart, String string, int start, int length) {
         if (!ignoreCase) {
             return regionMatches(thisStart, string, start, length);
         }
-
-        if (string != null) {
-            if (thisStart < 0 || length > count - thisStart) {
-                return false;
-            }
-            if (start < 0 || length > string.count - start) {
-                return false;
-            }
-
-            thisStart += offset;
-            start += string.offset;
-            int end = thisStart + length;
-            char c1, c2;
-            char[] target = string.value;
-            while (thisStart < end) {
-                if ((c1 = value[thisStart++]) != (c2 = target[start++])
-                        && Character.toUpperCase(c1) != Character.toUpperCase(c2)
-                        // Required for unicode that we test both cases
-                        && Character.toLowerCase(c1) != Character.toLowerCase(c2)) {
-                    return false;
-                }
-            }
-            return true;
+        if (string == null) {
+            throw new NullPointerException("string == null");
         }
-        throw new NullPointerException();
+        if (thisStart < 0 || length > count - thisStart) {
+            return false;
+        }
+        if (start < 0 || length > string.count - start) {
+            return false;
+        }
+        thisStart += offset;
+        start += string.offset;
+        int end = thisStart + length;
+        char[] target = string.value;
+        while (thisStart < end) {
+            char c1 = value[thisStart++];
+            char c2 = target[start++];
+            if (c1 != c2 && foldCase(c1) != foldCase(c2)) {
+                return false;
+            }
+        }
+        return true;
     }
 
     /**
@@ -1532,7 +1441,7 @@
         if (start >= 0 && start <= count) {
             return new String(offset + start, count - start, value);
         }
-        throw new StringIndexOutOfBoundsException("start=" + start + " length=" + count);
+        throw indexAndLength(start);
     }
 
     /**
@@ -1573,17 +1482,17 @@
     }
 
     /**
-     * Converts this string to lowercase, using the rules of the user's default locale.
+     * Converts this string to lower case, using the rules of the user's default locale.
      * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
-     * @return a new lowercase string, or {@code this} if it's already all-lowercase.
+     * @return a new lower case string, or {@code this} if it's already all lower case.
      */
     public String toLowerCase() {
         return CaseMapper.toLowerCase(Locale.getDefault(), this, value, offset, count);
     }
 
     /**
-     * Converts this string to lowercase, using the rules of {@code locale}.
+     * Converts this string to lower case, using the rules of {@code locale}.
      *
      * <p>Most case mappings are unaffected by the language of a {@code Locale}. Exceptions include
      * dotted and dotless I in Azeri and Turkish locales, and dotted and dotless I and J in
@@ -1593,7 +1502,7 @@
      * <p>See <a href="http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt">http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt</a>
      * for full details of context- and language-specific special cases.
      *
-     * @return a new lowercase string, or {@code this} if it's already all-lowercase.
+     * @return a new lower case string, or {@code this} if it's already all lower case.
      */
     public String toLowerCase(Locale locale) {
         return CaseMapper.toLowerCase(locale, this, value, offset, count);
@@ -1601,8 +1510,6 @@
 
     /**
      * Returns this string.
-     *
-     * @return this string.
      */
     @Override
     public String toString() {
@@ -1610,17 +1517,17 @@
     }
 
     /**
-     * Converts this this string to uppercase, using the rules of the user's default locale.
+     * Converts this this string to upper case, using the rules of the user's default locale.
      * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
-     * @return a new uppercase string, or {@code this} if it's already all-uppercase.
+     * @return a new upper case string, or {@code this} if it's already all upper case.
      */
     public String toUpperCase() {
         return CaseMapper.toUpperCase(Locale.getDefault(), this, value, offset, count);
     }
 
     /**
-     * Converts this this string to uppercase, using the rules of {@code locale}.
+     * Converts this this string to upper case, using the rules of {@code locale}.
      *
      * <p>Most case mappings are unaffected by the language of a {@code Locale}. Exceptions include
      * dotted and dotless I in Azeri and Turkish locales, and dotted and dotless I and J in
@@ -1630,7 +1537,7 @@
      * <p>See <a href="http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt">http://www.unicode.org/Public/UNIDATA/SpecialCasing.txt</a>
      * for full details of context- and language-specific special cases.
      *
-     * @return a new uppercase string, or {@code this} if it's already all-uppercase.
+     * @return a new upper case string, or {@code this} if it's already all upper case.
      */
     public String toUpperCase(Locale locale) {
         return CaseMapper.toUpperCase(locale, this, value, offset, count);
diff --git a/luni/src/main/java/java/lang/StringBuffer.java b/luni/src/main/java/java/lang/StringBuffer.java
index 471c008..c50b722 100644
--- a/luni/src/main/java/java/lang/StringBuffer.java
+++ b/luni/src/main/java/java/lang/StringBuffer.java
@@ -47,16 +47,16 @@
 
     private static final long serialVersionUID = 3388685877147921107L;
 
-    private static final ObjectStreamField serialPersistentFields[] = {
-            new ObjectStreamField("count", int.class),
-            new ObjectStreamField("shared", boolean.class),
-            new ObjectStreamField("value", char[].class), };
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField("count", int.class),
+        new ObjectStreamField("shared", boolean.class),
+        new ObjectStreamField("value", char[].class),
+    };
 
     /**
      * Constructs a new StringBuffer using the default capacity which is 16.
      */
     public StringBuffer() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/StringBuilder.java b/luni/src/main/java/java/lang/StringBuilder.java
index 8aea930..d886100 100644
--- a/luni/src/main/java/java/lang/StringBuilder.java
+++ b/luni/src/main/java/java/lang/StringBuilder.java
@@ -52,7 +52,6 @@
      * @see #capacity()
      */
     public StringBuilder() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java b/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
index 6b7c929..3930cd0 100644
--- a/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
+++ b/luni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
@@ -30,7 +30,6 @@
      * the current stack trace.
      */
     public StringIndexOutOfBoundsException() {
-        super();
     }
 
     /**
@@ -60,7 +59,33 @@
      * Used internally for consistent high-quality error reporting.
      * @hide
      */
+    public StringIndexOutOfBoundsException(String s, int index) {
+        this(s.length(), index);
+    }
+
+    /**
+     * Used internally for consistent high-quality error reporting.
+     * @hide
+     */
+    public StringIndexOutOfBoundsException(int sourceLength, int index) {
+        super("length=" + sourceLength + "; index=" + index);
+    }
+
+    /**
+     * Used internally for consistent high-quality error reporting.
+     * @hide
+     */
     public StringIndexOutOfBoundsException(String s, int offset, int count) {
-        super("s.length()=" + s.length() + ", offset=" + offset + ", count=" + count);
+        this(s.length(), offset, count);
+    }
+
+    /**
+     * Used internally for consistent high-quality error reporting.
+     * @hide
+     */
+    public StringIndexOutOfBoundsException(int sourceLength, int offset,
+            int count) {
+        super("length=" + sourceLength + "; regionStart=" + offset
+                + "; regionLength=" + count);
     }
 }
diff --git a/luni/src/main/java/java/lang/System.java b/luni/src/main/java/java/lang/System.java
index 8ba0472..14b5918 100644
--- a/luni/src/main/java/java/lang/System.java
+++ b/luni/src/main/java/java/lang/System.java
@@ -32,6 +32,7 @@
 
 package java.lang;
 
+import dalvik.system.VMRuntime;
 import dalvik.system.VMStack;
 import java.io.Console;
 import java.io.FileDescriptor;
@@ -47,8 +48,11 @@
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
-import java.util.PropertyPermission;
 import java.util.Set;
+import libcore.icu.ICU;
+import libcore.io.Libcore;
+import libcore.io.StructUtsname;
+import libcore.util.ZoneInfoDB;
 
 /**
  * Provides access to system-related information and resources including
@@ -75,23 +79,15 @@
      */
     public static final PrintStream err;
 
-    /**
-     * The System Properties table.
-     */
+    private static final String lineSeparator;
     private static Properties systemProperties;
 
-    /**
-     * Initialize all the slots in System on first use.
-     */
     static {
-        /*
-         * Set up standard in, out, and err. TODO err and out are
-         * String.ConsolePrintStream. All three are buffered in Harmony. Check
-         * and possibly change this later.
-         */
+        // TODO: all three streams are buffered in Harmony.
         err = new PrintStream(new FileOutputStream(FileDescriptor.err));
         out = new PrintStream(new FileOutputStream(FileDescriptor.out));
         in = new FileInputStream(FileDescriptor.in);
+        lineSeparator = System.getProperty("line.separator");
     }
 
     /**
@@ -100,16 +96,8 @@
      * @param newIn
      *            the user defined input stream to set as the standard input
      *            stream.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPermission()} method does not allow the change of the
-     *             stream.
      */
     public static void setIn(InputStream newIn) {
-        SecurityManager secMgr = System.getSecurityManager();
-        if(secMgr != null) {
-            secMgr.checkPermission(RuntimePermission.permissionToSetIO);
-        }
         setFieldImpl("in", "Ljava/io/InputStream;", newIn);
     }
 
@@ -119,16 +107,8 @@
      * @param newOut
      *            the user defined output stream to set as the standard output
      *            stream.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPermission()} method does not allow the change of the
-     *             stream.
      */
     public static void setOut(java.io.PrintStream newOut) {
-        SecurityManager secMgr = System.getSecurityManager();
-        if(secMgr != null) {
-            secMgr.checkPermission(RuntimePermission.permissionToSetIO);
-        }
         setFieldImpl("out", "Ljava/io/PrintStream;", newOut);
     }
 
@@ -139,16 +119,8 @@
      * @param newErr
      *            the user defined output stream to set as the standard error
      *            output stream.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPermission()} method does not allow the change of the
-     *             stream.
      */
     public static void setErr(java.io.PrintStream newErr) {
-        SecurityManager secMgr = System.getSecurityManager();
-        if(secMgr != null) {
-            secMgr.checkPermission(RuntimePermission.permissionToSetIO);
-        }
         setFieldImpl("err", "Ljava/io/PrintStream;", newErr);
     }
 
@@ -197,24 +169,20 @@
     public static native long nanoTime();
 
     /**
-     * Causes the virtual machine to stop running and the program to exit. If
+     * Causes the VM to stop running and the program to exit. If
      * {@link #runFinalizersOnExit(boolean)} has been previously invoked with a
      * {@code true} argument, then all objects will be properly
      * garbage-collected and finalized first.
      *
      * @param code
      *            the return code.
-     * @throws SecurityException
-     *             if the running thread has not enough permission to exit the
-     *             virtual machine.
-     * @see SecurityManager#checkExit
      */
     public static void exit(int code) {
         Runtime.getRuntime().exit(code);
     }
 
     /**
-     * Indicates to the virtual machine that it would be a good time to run the
+     * Indicates to the VM that it would be a good time to run the
      * garbage collector. Note that this is a hint only. There is no guarantee
      * that the garbage collector will actually be run.
      */
@@ -230,21 +198,17 @@
      *            the name of the environment variable.
      * @return the value of the specified environment variable or {@code null}
      *         if no variable exists with the given name.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPermission()} method does not allow the querying of
-     *             single environment variables.
      */
     public static String getenv(String name) {
-        if (name == null) {
-            throw new NullPointerException();
-        }
-        SecurityManager secMgr = System.getSecurityManager();
-        if (secMgr != null) {
-            secMgr.checkPermission(new RuntimePermission("getenv." + name));
-        }
+        return getenv(name, null);
+    }
 
-        return getEnvByName(name);
+    private static String getenv(String name, String defaultValue) {
+        if (name == null) {
+            throw new NullPointerException("name == null");
+        }
+        String value = Libcore.os.getenv(name);
+        return (value != null) ? value : defaultValue;
     }
 
     /*
@@ -258,43 +222,18 @@
      * Returns an unmodifiable map of all available environment variables.
      *
      * @return the map representing all environment variables.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPermission()} method does not allow the querying of
-     *             all environment variables.
      */
     public static Map<String, String> getenv() {
-        SecurityManager secMgr = System.getSecurityManager();
-        if (secMgr != null) {
-            secMgr.checkPermission(new RuntimePermission("getenv.*"));
-        }
-
         Map<String, String> map = new HashMap<String, String>();
-
-        int index = 0;
-        String entry = getEnvByIndex(index++);
-        while (entry != null) {
-            int pos = entry.indexOf('=');
-            if (pos != -1) {
-                map.put(entry.substring(0, pos), entry.substring(pos + 1));
+        for (String entry : Libcore.os.environ()) {
+            int index = entry.indexOf('=');
+            if (index != -1) {
+                map.put(entry.substring(0, index), entry.substring(index + 1));
             }
-
-            entry = getEnvByIndex(index++);
         }
-
         return new SystemEnvironment(map);
     }
 
-    /*
-     * Returns an environment variable. No security checks are performed. The
-     * safe way of traversing the environment is to start at index zero and
-     * count upwards until a null pointer is encountered. This marks the end of
-     * the Unix environment.
-     * @param index the index of the environment variable
-     * @return the value of the specified environment variable
-     */
-    private static native String getEnvByIndex(int index);
-
     /**
      * Returns the inherited channel from the creator of the current virtual
      * machine.
@@ -315,41 +254,106 @@
      * subsequent calls to getProperty and getProperties.
      *
      * @return the system properties.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPropertiesAccess()} method does not allow the operation.
      */
     public static Properties getProperties() {
-        SecurityManager secMgr = System.getSecurityManager();
-        if (secMgr != null) {
-            secMgr.checkPropertiesAccess();
+        if (systemProperties == null) {
+            initSystemProperties();
         }
+        return systemProperties;
+    }
 
-        return internalGetProperties();
+    private static void initSystemProperties() {
+        VMRuntime runtime = VMRuntime.getRuntime();
+        Properties p = new Properties();
+
+        String projectUrl = "http://www.android.com/";
+        String projectName = "The Android Project";
+
+        p.put("java.boot.class.path", runtime.bootClassPath());
+        p.put("java.class.path", runtime.classPath());
+
+        p.put("java.class.version", "46.0");
+        p.put("java.compiler", "");
+        p.put("java.ext.dirs", "");
+
+        p.put("java.home", getenv("JAVA_HOME", "/system"));
+
+        p.put("java.io.tmpdir", "/tmp");
+        p.put("java.library.path", getenv("LD_LIBRARY_PATH"));
+
+        p.put("java.net.preferIPv6Addresses", "true");
+
+        p.put("java.specification.name", "Dalvik Core Library");
+        p.put("java.specification.vendor", projectName);
+        p.put("java.specification.version", "0.9");
+
+        p.put("java.vendor", projectName);
+        p.put("java.vendor.url", projectUrl);
+        p.put("java.version", "0");
+        p.put("java.vm.name", "Dalvik");
+        p.put("java.vm.specification.name", "Dalvik Virtual Machine Specification");
+        p.put("java.vm.specification.vendor", projectName);
+        p.put("java.vm.specification.version", "0.9");
+        p.put("java.vm.vendor", projectName);
+        p.put("java.vm.version", runtime.vmVersion());
+
+        p.put("file.separator", "/");
+        p.put("line.separator", "\n");
+        p.put("path.separator", ":");
+
+        p.put("java.runtime.name", "Android Runtime");
+        p.put("java.runtime.version", "0.9");
+        p.put("java.vm.vendor.url", projectUrl);
+
+        p.put("file.encoding", "UTF-8");
+        p.put("user.language", "en");
+        p.put("user.region", "US");
+
+        p.put("user.home", getenv("HOME", ""));
+        p.put("user.name", getenv("USER", ""));
+
+        StructUtsname info = Libcore.os.uname();
+        p.put("os.arch", info.machine);
+        p.put("os.name", info.sysname);
+        p.put("os.version", info.release);
+
+        // Undocumented Android-only properties.
+        p.put("android.icu.library.version", ICU.getIcuVersion());
+        p.put("android.icu.unicode.version", ICU.getUnicodeVersion());
+        // TODO: it would be nice to have this but currently it causes circularity.
+        // p.put("android.tzdata.version", ZoneInfoDB.getVersion());
+        parsePropertyAssignments(p, specialProperties());
+
+        // Override built-in properties with settings from the command line.
+        parsePropertyAssignments(p, runtime.properties());
+
+        systemProperties = p;
     }
 
     /**
-     * Returns the system properties without any security checks. This is used
-     * for access from within java.lang.
-     *
-     * @return the system properties
+     * Returns an array of "key=value" strings containing information not otherwise
+     * easily available, such as #defined library versions.
      */
-    static Properties internalGetProperties() {
-        if (System.systemProperties == null) {
-            SystemProperties props = new SystemProperties();
-            props.preInit();
-            props.postInit();
-            System.systemProperties = props;
-        }
+    private static native String[] specialProperties();
 
-        return systemProperties;
+    /**
+     * Adds each element of 'assignments' to 'p', treating each element as an
+     * assignment in the form "key=value".
+     */
+    private static void parsePropertyAssignments(Properties p, String[] assignments) {
+        for (String assignment : assignments) {
+            int split = assignment.indexOf('=');
+            String key = assignment.substring(0, split);
+            String value = assignment.substring(split + 1);
+            p.put(key, value);
+        }
     }
 
     /**
      * Returns the value of a particular system property or {@code null} if no
      * such property exists.
      *
-     * <p>The following properties are always provided by the virtual machine:
+     * <p>The following properties are always provided by the Dalvik VM:
      * <p><table BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
      * <tr BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
      *     <td><b>Name</b></td>        <td><b>Meaning</b></td>                    <td><b>Example</b></td></tr>
@@ -376,13 +380,13 @@
      * <tr><td>java.vm.specification.vendor</td>  <td>VM specification vendor</td>     <td>{@code The Android Project}</td></tr>
      * <tr><td>java.vm.specification.name</td>    <td>VM specification name</td>       <td>{@code Dalvik Virtual Machine Specification}</td></tr>
      *
-     * <tr><td>line.separator</td>     <td>Default line separator</td>            <td>{@code \n}</td></tr>
+     * <tr><td>line.separator</td>     <td>The system line separator</td>         <td>{@code \n}</td></tr>
      *
      * <tr><td>os.arch</td>            <td>OS architecture</td>                   <td>{@code armv7l}</td></tr>
      * <tr><td>os.name</td>            <td>OS (kernel) name</td>                  <td>{@code Linux}</td></tr>
      * <tr><td>os.version</td>         <td>OS (kernel) version</td>               <td>{@code 2.6.32.9-g103d848}</td></tr>
      *
-     * <tr><td>path.separator</td>     <td>{@link java.io.File#pathSeparator}</td> <td>{@code :}</td></tr>
+     * <tr><td>path.separator</td>     <td>See {@link java.io.File#pathSeparator}</td> <td>{@code :}</td></tr>
      *
      * <tr><td>user.dir</td>           <td>Base of non-absolute paths</td>        <td>{@code /}</td></tr>
      * <tr><td>user.home</td>          <td>(Not useful on Android)</td>           <td>Empty</td></tr>
@@ -390,13 +394,12 @@
      *
      * </table>
      *
+     * <p>It is a mistake to try to override any of these. Doing so will have unpredictable results.
+     *
      * @param propertyName
      *            the name of the system property to look up.
      * @return the value of the specified system property or {@code null} if the
      *         property doesn't exist.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPropertyAccess()} method does not allow the operation.
      */
     public static String getProperty(String propertyName) {
         return getProperty(propertyName, null);
@@ -413,20 +416,12 @@
      *            does not exist.
      * @return the value of the specified system property or the {@code
      *         defaultValue} if the property does not exist.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPropertyAccess()} method does not allow the operation.
      */
     public static String getProperty(String prop, String defaultValue) {
-        if (prop.length() == 0) {
+        if (prop.isEmpty()) {
             throw new IllegalArgumentException();
         }
-        SecurityManager secMgr = System.getSecurityManager();
-        if (secMgr != null) {
-            secMgr.checkPropertyAccess(prop);
-        }
-
-        return internalGetProperties().getProperty(prop, defaultValue);
+        return getProperties().getProperty(prop, defaultValue);
     }
 
     /**
@@ -438,19 +433,12 @@
      *            the value to associate with the given property {@code prop}.
      * @return the old value of the property or {@code null} if the property
      *         didn't exist.
-     * @throws SecurityException
-     *             if a security manager exists and write access to the
-     *             specified property is not allowed.
      */
     public static String setProperty(String prop, String value) {
-        if (prop.length() == 0) {
+        if (prop.isEmpty()) {
             throw new IllegalArgumentException();
         }
-        SecurityManager secMgr = System.getSecurityManager();
-        if (secMgr != null) {
-            secMgr.checkPermission(new PropertyPermission(prop, "write"));
-        }
-        return (String)internalGetProperties().setProperty(prop, value);
+        return (String) getProperties().setProperty(prop, value);
     }
 
     /**
@@ -463,23 +451,15 @@
      *             if the argument {@code key} is {@code null}.
      * @throws IllegalArgumentException
      *             if the argument {@code key} is empty.
-     * @throws SecurityException
-     *             if a security manager exists and write access to the
-     *             specified property is not allowed.
      */
     public static String clearProperty(String key) {
         if (key == null) {
             throw new NullPointerException();
         }
-        if (key.length() == 0) {
+        if (key.isEmpty()) {
             throw new IllegalArgumentException();
         }
-
-        SecurityManager secMgr = System.getSecurityManager();
-        if (secMgr != null) {
-            secMgr.checkPermission(new PropertyPermission(key, "write"));
-        }
-        return (String)internalGetProperties().remove(key);
+        return (String) getProperties().remove(key);
     }
 
     /**
@@ -516,6 +496,18 @@
     public static native int identityHashCode(Object anObject);
 
     /**
+     * Returns the system's line separator. On Android, this is {@code "\n"}. The value
+     * comes from the value of the {@code line.separator} system property when the VM
+     * starts. Later changes to the property will not affect the value returned by this
+     * method.
+     * @since 1.7
+     * @hide 1.7 - fix documentation references to "line.separator" in Formatter.
+     */
+    public static String lineSeparator() {
+        return lineSeparator;
+    }
+
+    /**
      * Loads and links the dynamic library that is identified through the
      * specified path. This method is similar to {@link #loadLibrary(String)},
      * but it accepts a full path specification whereas {@code loadLibrary} just
@@ -523,14 +515,8 @@
      *
      * @param pathName
      *            the path of the file to be loaded.
-     * @throws SecurityException
-     *             if the library was not allowed to be loaded.
      */
     public static void load(String pathName) {
-        SecurityManager smngr = System.getSecurityManager();
-        if (smngr != null) {
-            smngr.checkLink(pathName);
-        }
         Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader());
     }
 
@@ -543,19 +529,57 @@
      *            the name of the library to load.
      * @throws UnsatisfiedLinkError
      *             if the library could not be loaded.
-     * @throws SecurityException
-     *             if the library was not allowed to be loaded.
      */
     public static void loadLibrary(String libName) {
-        SecurityManager smngr = System.getSecurityManager();
-        if (smngr != null) {
-            smngr.checkLink(libName);
-        }
         Runtime.getRuntime().loadLibrary(libName, VMStack.getCallingClassLoader());
     }
 
     /**
-     * Provides a hint to the virtual machine that it would be useful to attempt
+     * @hide internal use only
+     */
+    public static void logE(String message) {
+        log('E', message, null);
+    }
+
+    /**
+     * @hide internal use only
+     */
+    public static void logE(String message, Throwable th) {
+        log('E', message, th);
+    }
+
+    /**
+     * @hide internal use only
+     */
+    public static void logI(String message) {
+        log('I', message, null);
+    }
+
+    /**
+     * @hide internal use only
+     */
+    public static void logI(String message, Throwable th) {
+        log('I', message, th);
+    }
+
+    /**
+     * @hide internal use only
+     */
+    public static void logW(String message) {
+        log('W', message, null);
+    }
+
+    /**
+     * @hide internal use only
+     */
+    public static void logW(String message, Throwable th) {
+        log('W', message, th);
+    }
+
+    private static native void log(char type, String message, Throwable th);
+
+    /**
+     * Provides a hint to the VM that it would be useful to attempt
      * to perform any outstanding object finalization.
      */
     public static void runFinalization() {
@@ -563,7 +587,7 @@
     }
 
     /**
-     * Ensures that, when the virtual machine is about to exit, all objects are
+     * Ensures that, when the VM is about to exit, all objects are
      * finalized. Note that all finalization which occurs when the system is
      * exiting is performed after all running threads have been terminated.
      *
@@ -578,20 +602,11 @@
     }
 
     /**
-     * Sets all system properties.
-     *
-     * @param p
-     *            the new system property.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkPropertiesAccess()} method does not allow the operation.
+     * Sets all system properties. This does not take a copy; the passed-in object is used
+     * directly. Passing null causes the VM to reinitialize the properties to how they were
+     * when the VM was started.
      */
     public static void setProperties(Properties p) {
-        SecurityManager secMgr = System.getSecurityManager();
-        if (secMgr != null) {
-            secMgr.checkPropertiesAccess();
-        }
-
         systemProperties = p;
     }
 
@@ -635,7 +650,7 @@
 
     /**
      * The unmodifiable environment variables map. System.getenv() specifies
-     * that this map must throw when queried with non-String keys values.
+     * that this map must throw when passed non-String keys.
      */
     static class SystemEnvironment extends AbstractMap<String, String> {
         private final Map<String, String> map;
@@ -668,16 +683,3 @@
         }
     }
 }
-
-/**
- * Internal class holding the System properties. Needed by the Dalvik VM for the
- * two native methods. Must not be a local class, since we don't have a System
- * instance.
- */
-class SystemProperties extends Properties {
-    // Dummy, just to make the compiler happy.
-
-    native void preInit();
-
-    native void postInit();
-}
diff --git a/luni/src/main/java/java/lang/Thread.java b/luni/src/main/java/java/lang/Thread.java
index e26ecf0..67c914a 100644
--- a/luni/src/main/java/java/lang/Thread.java
+++ b/luni/src/main/java/java/lang/Thread.java
@@ -33,10 +33,10 @@
 package java.lang;
 
 import dalvik.system.VMStack;
-import java.security.AccessController;
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
-import org.apache.harmony.security.fortress.SecurityUtils;
 
 /**
  * A {@code Thread} is a concurrent unit of execution. It has its own call stack
@@ -119,17 +119,17 @@
     /**
      * The maximum priority value allowed for a thread.
      */
-    public final static int MAX_PRIORITY = 10;
+    public static final int MAX_PRIORITY = 10;
 
     /**
      * The minimum priority value allowed for a thread.
      */
-    public final static int MIN_PRIORITY = 1;
+    public static final int MIN_PRIORITY = 1;
 
     /**
      * The normal (default) priority value assigned to threads.
      */
-    public final static int NORM_PRIORITY = 5;
+    public static final int NORM_PRIORITY = 5;
 
     /* some of these are accessed directly by the VM; do not rename them */
     volatile VMThread vmThread;
@@ -157,13 +157,8 @@
      */
     ThreadLocal.Values inheritableValues;
 
-    /**
-     * Holds the interrupt action for this Thread, if any.
-     * <p>
-     * This is required internally by NIO, so even if it looks like it's
-     * useless, don't delete it!
-     */
-    private Runnable interruptAction;
+    /** Callbacks to run on interruption. */
+    private final List<Runnable> interruptActions = new ArrayList<Runnable>();
 
     /**
      * Holds the class loader for this Thread, in case there is one.
@@ -275,15 +270,10 @@
      * @param runnable
      *            a {@code Runnable} whose method <code>run</code> will be
      *            executed by the new {@code Thread}
-     * @throws SecurityException
-     *             if <code>group.checkAccess()</code> fails with a
-     *             SecurityException
      * @throws IllegalThreadStateException
      *             if <code>group.destroy()</code> has already been done
      * @see java.lang.ThreadGroup
      * @see java.lang.Runnable
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
      */
     public Thread(ThreadGroup group, Runnable runnable) {
         create(group, runnable, null, 0);
@@ -300,15 +290,10 @@
      *            executed by the new {@code Thread}
      * @param threadName
      *            the name for the {@code Thread} being created
-     * @throws SecurityException
-     *             if <code>group.checkAccess()</code> fails with a
-     *             SecurityException
      * @throws IllegalThreadStateException
      *             if <code>group.destroy()</code> has already been done
      * @see java.lang.ThreadGroup
      * @see java.lang.Runnable
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
      */
     public Thread(ThreadGroup group, Runnable runnable, String threadName) {
         if (threadName == null) {
@@ -326,15 +311,10 @@
      *            {@code ThreadGroup} to which the new {@code Thread} will belong
      * @param threadName
      *            the name for the {@code Thread} being created
-     * @throws SecurityException
-     *             if <code>group.checkAccess()</code> fails with a
-     *             SecurityException
      * @throws IllegalThreadStateException
      *             if <code>group.destroy()</code> has already been done
      * @see java.lang.ThreadGroup
      * @see java.lang.Runnable
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
      */
     public Thread(ThreadGroup group, String threadName) {
         if (threadName == null) {
@@ -360,15 +340,10 @@
      *            a stack size for the new {@code Thread}. This has a highly
      *            platform-dependent interpretation. It may even be ignored
      *            completely.
-     * @throws SecurityException
-     *             if <code>group.checkAccess()</code> fails with a
-     *             SecurityException
      * @throws IllegalThreadStateException
      *             if <code>group.destroy()</code> has already been done
      * @see java.lang.ThreadGroup
      * @see java.lang.Runnable
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
      */
     public Thread(ThreadGroup group, Runnable runnable, String threadName, long stackSize) {
         if (threadName == null) {
@@ -391,8 +366,9 @@
 
         if (name == null) {
             this.name = "Thread-" + id;
-        } else
+        } else {
             this.name = name;
+        }
 
         if (group == null) {
             throw new InternalError("group not specified");
@@ -420,53 +396,17 @@
      *        be executed by the new Thread
      * @param threadName Name for the Thread being created
      * @param stackSize Platform dependent stack size
-     * @throws SecurityException if <code>group.checkAccess()</code> fails
-     *         with a SecurityException
      * @throws IllegalThreadStateException if <code>group.destroy()</code> has
      *         already been done
      * @see java.lang.ThreadGroup
      * @see java.lang.Runnable
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
      */
     private void create(ThreadGroup group, Runnable runnable, String threadName, long stackSize) {
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            if (group == null) {
-                group = smgr.getThreadGroup();
-            }
-
-            /*
-             * Freaky security requirement: If the Thread's class is actually
-             * a subclass of Thread and it tries to override either
-             * getContextClassLoader() or setContextClassLoader(), the
-             * SecurityManager has to allow this.
-             */
-            if (getClass() != Thread.class) {
-                Class[] signature = new Class[] { ClassLoader.class };
-
-                try {
-                    getClass().getDeclaredMethod("getContextClassLoader", signature);
-                    smgr.checkPermission(new RuntimePermission("enableContextClassLoaderOverride"));
-                } catch (NoSuchMethodException ex) {
-                    // Ignore. Just interested in the method's existence.
-                }
-
-                try {
-                    getClass().getDeclaredMethod("setContextClassLoader", signature);
-                    smgr.checkPermission(new RuntimePermission("enableContextClassLoaderOverride"));
-                } catch (NoSuchMethodException ex) {
-                    // Ignore. Just interested in the method's existence.
-                }
-            }
-        }
-
         Thread currentThread = Thread.currentThread();
         if (group == null) {
             group = currentThread.getThreadGroup();
         }
 
-        group.checkAccess();
         if (group.isDestroyed()) {
             throw new IllegalThreadStateException("Group already destroyed");
         }
@@ -492,13 +432,9 @@
 
         // Transfer over InheritableThreadLocals.
         if (currentThread.inheritableValues != null) {
-            inheritableValues
-                    = new ThreadLocal.Values(currentThread.inheritableValues);
+            inheritableValues = new ThreadLocal.Values(currentThread.inheritableValues);
         }
 
-        // store current AccessControlContext as inherited context for this thread
-        SecurityUtils.putContext(this, AccessController.getContext());
-
         // add ourselves to our ThreadGroup of choice
         this.group.addThread(this);
     }
@@ -514,26 +450,9 @@
     }
 
     /**
-     * Is used for operations that require approval from a SecurityManager. If
-     * there's none installed, this method is a no-op. If there's a
-     * SecurityManager installed, {@link SecurityManager#checkAccess(Thread)} is
-     * called for that SecurityManager.
-     *
-     * @throws SecurityException
-     *             if a SecurityManager is installed and it does not allow
-     *             access to the Thread.
-     *
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
+     * Does nothing.
      */
     public final void checkAccess() {
-        // Forwards the message to the SecurityManager (if there's one) passing
-        // the receiver as parameter
-
-        SecurityManager currentManager = System.getSecurityManager();
-        if (currentManager != null) {
-            currentManager.checkAccess(this);
-        }
     }
 
     /**
@@ -587,37 +506,16 @@
      * @param threads
      *            array into which the Threads will be copied
      * @return How many Threads were copied over
-     * @throws SecurityException
-     *             if the installed SecurityManager fails
-     *             {@link SecurityManager#checkAccess(Thread)}
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
      */
     public static int enumerate(Thread[] threads) {
         Thread thread = Thread.currentThread();
-        thread.checkAccess();
         return thread.getThreadGroup().enumerate(threads);
     }
 
     /**
-     * <p>
-     * Returns the stack traces of all the currently live threads and puts them
-     * into the given map.
-     * </p>
-     *
-     * @return A Map of current Threads to StackTraceElement arrays.
-     * @throws SecurityException
-     *             if the current SecurityManager fails the
-     *             {@link SecurityManager#checkPermission(java.security.Permission)}
-     *             call.
+     * Returns a map of all the currently live threads to their stack traces.
      */
     public static Map<Thread, StackTraceElement[]> getAllStackTraces() {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkPermission(new RuntimePermission("getStackTrace"));
-            securityManager.checkPermission(new RuntimePermission("modifyThreadGroup"));
-        }
-
         Map<Thread, StackTraceElement[]> map = new HashMap<Thread, StackTraceElement[]>();
 
         // Find out how many live threads we have. Allocate a bit more
@@ -636,40 +534,12 @@
 
     /**
      * Returns the context ClassLoader for this Thread.
-     * <p>
-     * If the conditions
-     * <ol>
-     * <li>there is a security manager
-     * <li>the caller's class loader is not null
-     * <li>the caller's class loader is not the same as the requested
-     * context class loader and not an ancestor thereof
-     * </ol>
-     * are satisfied, a security check for
-     * <code>RuntimePermission("getClassLoader")</code> is performed first.
      *
      * @return ClassLoader The context ClassLoader
      * @see java.lang.ClassLoader
      * @see #getContextClassLoader()
-     *
-     * @throws SecurityException
-     *             if the aforementioned security check fails.
      */
     public ClassLoader getContextClassLoader() {
-        // First, if the conditions
-        //    1) there is a security manager
-        //    2) the caller's class loader is not null
-        //    3) the caller's class loader is not the same as the context
-        //    class loader and not an ancestor thereof
-        // are satisfied we should perform a security check.
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            ClassLoader calling = VMStack.getCallingClassLoader();
-
-            if (calling != null && !calling.isAncestorOf(contextClassLoader)) {
-                sm.checkPermission(new RuntimePermission("getClassLoader"));
-            }
-        }
-
         return contextClassLoader;
     }
 
@@ -716,25 +586,9 @@
     }
 
     /**
-     * Returns the a stack trace representing the current execution state of
-     * this Thread.
-     * <p>
-     * The <code>RuntimePermission("getStackTrace")</code> is checked before
-     * returning a result.
-     * </p>
-     *
-     * @return an array of StackTraceElements.
-     * @throws SecurityException
-     *             if the current SecurityManager fails the
-     *             {@link SecurityManager#checkPermission(java.security.Permission)}
-     *             call.
+     * Returns an array of {@link StackTraceElement} representing the current thread's stack.
      */
     public StackTraceElement[] getStackTrace() {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkPermission(new RuntimePermission("getStackTrace"));
-        }
-
         StackTraceElement ste[] = VMStack.getThreadStackTrace(this);
         return ste != null ? ste : EMPTY_STACK_TRACE;
     }
@@ -792,10 +646,7 @@
     }
 
     /**
-     * Posts an interrupt request to this {@code Thread}. Unless the caller is
-     * the {@link #currentThread()}, the method {@code checkAccess()} is called
-     * for the installed {@code SecurityManager}, if any. This may result in a
-     * {@code SecurityException} being thrown. The further behavior depends on
+     * Posts an interrupt request to this {@code Thread}. The behavior depends on
      * the state of this {@code Thread}:
      * <ul>
      * <li>
@@ -815,18 +666,14 @@
      * exception in this case.
      * <ul>
      *
-     * @throws SecurityException
-     *             if <code>checkAccess()</code> fails with a SecurityException
-     * @see java.lang.SecurityException
-     * @see java.lang.SecurityManager
      * @see Thread#interrupted
      * @see Thread#isInterrupted
      */
     public void interrupt() {
-        checkAccess();
-
-        if (interruptAction != null) {
-            interruptAction.run();
+        synchronized (interruptActions) {
+            for (int i = interruptActions.size() - 1; i >= 0; i--) {
+                interruptActions.get(i).run();
+            }
         }
 
         VMThread vmt = this.vmThread;
@@ -989,24 +836,14 @@
     }
 
     /**
-     * Resumes a suspended Thread. This is a no-op if the receiver was never
-     * suspended, or suspended and already resumed. If the receiver is
-     * suspended, however, makes it resume to the point where it was when it was
-     * suspended.
+     * Throws {@code UnsupportedOperationException}.
      *
-     * @throws SecurityException
-     *             if <code>checkAccess()</code> fails with a SecurityException
      * @see Thread#suspend()
      * @deprecated Used with deprecated method {@link Thread#suspend}
      */
     @Deprecated
     public final void resume() {
-        checkAccess();
-
-        VMThread vmt = this.vmThread;
-        if (vmt != null) {
-            vmt.resume();
-        }
+        throw new UnsupportedOperationException();
     }
 
     /**
@@ -1023,23 +860,11 @@
 
     /**
      * Set the context ClassLoader for the receiver.
-     * <p>
-     * The <code>RuntimePermission("setContextClassLoader")</code>
-     * is checked prior to setting the handler.
-     * </p>
      *
      * @param cl The context ClassLoader
-     * @throws SecurityException if the current SecurityManager fails the
-     *         checkPermission call.
-     * @see java.lang.ClassLoader
      * @see #getContextClassLoader()
      */
     public void setContextClassLoader(ClassLoader cl) {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkPermission(new RuntimePermission("setContextClassLoader"));
-        }
-
         contextClassLoader = cl;
     }
 
@@ -1049,13 +874,9 @@
      *
      * @param isDaemon
      *            indicates whether the Thread should be daemon or not
-     * @throws SecurityException
-     *             if <code>checkAccess()</code> fails with a SecurityException
      * @see Thread#isDaemon
      */
     public final void setDaemon(boolean isDaemon) {
-        checkAccess();
-
         if (hasBeenStarted) {
             throw new IllegalThreadStateException("Thread already started."); // TODO Externalize?
         }
@@ -1066,52 +887,59 @@
     }
 
     /**
-     * <p>
      * Sets the default uncaught exception handler. This handler is invoked in
      * case any Thread dies due to an unhandled exception.
-     * </p>
-     * <p>
-     * The <code>RuntimePermission("setDefaultUncaughtExceptionHandler")</code>
-     * is checked prior to setting the handler.
-     * </p>
      *
      * @param handler
-     *            The handler to set or <code>null</code>.
-     * @throws SecurityException
-     *             if the current SecurityManager fails the checkPermission
-     *             call.
+     *            The handler to set or null.
      */
     public static void setDefaultUncaughtExceptionHandler(UncaughtExceptionHandler handler) {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkPermission(new RuntimePermission ("setDefaultUncaughtExceptionHandler"));
-        }
-
         Thread.defaultUncaughtHandler = handler;
     }
 
     /**
-     * Set the action to be executed when interruption, which is probably be
-     * used to implement the interruptible channel. The action is null by
-     * default. And if this method is invoked by passing in a non-null value,
-     * this action's run() method will be invoked in <code>interrupt()</code>.
-     * <p>
-     * This is required internally by NIO, so even if it looks like it's
-     * useless, don't delete it!
+     * Adds a runnable to be invoked upon interruption. If this thread has
+     * already been interrupted, the runnable will be invoked immediately. The
+     * action should be idempotent as it may be invoked multiple times for a
+     * single interruption.
      *
-     * @param action the action to be executed when interruption
+     * <p>Each call to this method must be matched with a corresponding call to
+     * {@link #popInterruptAction$}.
+     *
+     * @hide used by NIO
      */
-    @SuppressWarnings("unused")
-    private void setInterruptAction(Runnable action) {
-        this.interruptAction = action;
+    public final void pushInterruptAction$(Runnable interruptAction) {
+        synchronized (interruptActions) {
+            interruptActions.add(interruptAction);
+        }
+
+        if (interruptAction != null && isInterrupted()) {
+            interruptAction.run();
+        }
+    }
+
+    /**
+     * Removes {@code interruptAction} so it is not invoked upon interruption.
+     *
+     * @param interruptAction the pushed action, used to check that the call
+     *     stack is correctly nested.
+     *
+     * @hide used by NIO
+     */
+    public final void popInterruptAction$(Runnable interruptAction) {
+        synchronized (interruptActions) {
+            Runnable removed = interruptActions.remove(interruptActions.size() - 1);
+            if (interruptAction != removed) {
+                throw new IllegalArgumentException(
+                        "Expected " + interruptAction + " but was " + removed);
+            }
+        }
     }
 
     /**
      * Sets the name of the Thread.
      *
      * @param threadName the new name for the Thread
-     * @throws SecurityException if <code>checkAccess()</code> fails with a
-     *         SecurityException
      * @see Thread#getName
      */
     public final void setName(String threadName) {
@@ -1119,8 +947,6 @@
             throw new NullPointerException();
         }
 
-        checkAccess();
-
         name = threadName;
         VMThread vmt = this.vmThread;
         if (vmt != null) {
@@ -1137,16 +963,12 @@
      *
      * @param priority
      *            new priority for the Thread
-     * @throws SecurityException
-     *             if <code>checkAccess()</code> fails with a SecurityException
      * @throws IllegalArgumentException
      *             if the new priority is greater than Thread.MAX_PRIORITY or
      *             less than Thread.MIN_PRIORITY
      * @see Thread#getPriority
      */
     public final void setPriority(int priority) {
-        checkAccess();
-
         if (priority < Thread.MIN_PRIORITY || priority > Thread.MAX_PRIORITY) {
             throw new IllegalArgumentException("Priority out of range"); // TODO Externalize?
         }
@@ -1171,12 +993,8 @@
      *
      * @param handler
      *            The handler to set or <code>null</code>.
-     * @throws SecurityException
-     *             if the current SecurityManager fails the checkAccess call.
      */
     public void setUncaughtExceptionHandler(UncaughtExceptionHandler handler) {
-        checkAccess();
-
         uncaughtHandler = handler;
     }
 
@@ -1238,8 +1056,6 @@
      * resumed if it was suspended and awakened if it was sleeping, so that it
      * can proceed to throw ThreadDeath.
      *
-     * @throws SecurityException if <code>checkAccess()</code> fails with a
-     *         SecurityException
      * @deprecated because stopping a thread in this manner is unsafe and can
      * leave your application and the VM in an unpredictable state.
      */
@@ -1249,14 +1065,8 @@
     }
 
     /**
-     * Requests the receiver Thread to stop and throw the
-     * <code>throwable()</code>. The Thread is resumed if it was suspended
-     * and awakened if it was sleeping, so that it can proceed to throw the
-     * <code>throwable()</code>.
+     * Throws {@code UnsupportedOperationException}.
      *
-     * @param throwable Throwable object to be thrown by the Thread
-     * @throws SecurityException if <code>checkAccess()</code> fails with a
-     *         SecurityException
      * @throws NullPointerException if <code>throwable()</code> is
      *         <code>null</code>
      * @deprecated because stopping a thread in this manner is unsafe and can
@@ -1264,44 +1074,18 @@
      */
     @Deprecated
     public final synchronized void stop(Throwable throwable) {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            securityManager.checkAccess(this);
-            if (Thread.currentThread() != this) {
-                securityManager.checkPermission(new RuntimePermission("stopThread"));
-            }
-        }
-
-        if (throwable == null) {
-            throw new NullPointerException();
-        }
-
-        VMThread vmt = this.vmThread;
-        if (vmt != null) {
-            vmt.stop(throwable);
-        }
+        throw new UnsupportedOperationException();
     }
 
     /**
-     * Suspends this Thread. This is a no-op if the receiver is suspended. If
-     * the receiver <code>isAlive()</code> however, suspended it until <code>
-     * resume()</code> is sent to it. Suspend requests are not queued, which
-     * means that N requests are equivalent to just one - only one resume
-     * request is needed in this case.
+     * Throws {@code UnsupportedOperationException}.
      *
-     * @throws SecurityException
-     *             if <code>checkAccess()</code> fails with a SecurityException
      * @see Thread#resume()
      * @deprecated May cause deadlocks.
      */
     @Deprecated
     public final void suspend() {
-        checkAccess();
-
-        VMThread vmt = this.vmThread;
-        if (vmt != null) {
-            vmt.suspend();
-        }
+        throw new UnsupportedOperationException();
     }
 
     /**
@@ -1354,9 +1138,18 @@
     }
 
     /**
-     * Implementation of <code>unpark()</code>. See {@link LangAccessImpl}.
+     * Unparks this thread. This unblocks the thread it if it was
+     * previously parked, or indicates that the thread is "preemptively
+     * unparked" if it wasn't already parked. The latter means that the
+     * next time the thread is told to park, it will merely clear its
+     * latent park bit and carry on without blocking.
+     *
+     * <p>See {@link java.util.concurrent.locks.LockSupport} for more
+     * in-depth information of the behavior of this method.</p>
+     *
+     * @hide for Unsafe
      */
-    /*package*/ void unpark() {
+    public void unpark() {
         VMThread vmt = vmThread;
 
         if (vmt == null) {
@@ -1396,13 +1189,27 @@
     }
 
     /**
-     * Implementation of <code>parkFor()</code>. See {@link LangAccessImpl}.
-     * This method must only be called when <code>this</code> is the current
+     * Parks the current thread for a particular number of nanoseconds, or
+     * indefinitely. If not indefinitely, this method unparks the thread
+     * after the given number of nanoseconds if no other thread unparks it
+     * first. If the thread has been "preemptively unparked," this method
+     * cancels that unparking and returns immediately. This method may
+     * also return spuriously (that is, without the thread being told to
+     * unpark and without the indicated amount of time elapsing).
+     *
+     * <p>See {@link java.util.concurrent.locks.LockSupport} for more
+     * in-depth information of the behavior of this method.</p>
+     *
+     * <p>This method must only be called when <code>this</code> is the current
      * thread.
      *
-     * @param nanos number of nanoseconds to park for
+     * @param nanos number of nanoseconds to park for or <code>0</code>
+     * to park indefinitely
+     * @throws IllegalArgumentException thrown if <code>nanos &lt; 0</code>
+     *
+     * @hide for Unsafe
      */
-    /*package*/ void parkFor(long nanos) {
+    public void parkFor(long nanos) {
         VMThread vmt = vmThread;
 
         if (vmt == null) {
@@ -1446,13 +1253,27 @@
     }
 
     /**
-     * Implementation of <code>parkUntil()</code>. See {@link LangAccessImpl}.
-     * This method must only be called when <code>this</code> is the current
-     * thread.
+     * Parks the current thread until the specified system time. This
+     * method attempts to unpark the current thread immediately after
+     * <code>System.currentTimeMillis()</code> reaches the specified
+     * value, if no other thread unparks it first. If the thread has
+     * been "preemptively unparked," this method cancels that
+     * unparking and returns immediately. This method may also return
+     * spuriously (that is, without the thread being told to unpark
+     * and without the indicated amount of time elapsing).
      *
-     * @param time absolute milliseconds since the epoch to park until
+     * <p>See {@link java.util.concurrent.locks.LockSupport} for more
+     * in-depth information of the behavior of this method.</p>
+     *
+     * <p>This method must only be called when <code>this</code> is the
+     * current thread.
+     *
+     * @param time the time after which the thread should be unparked,
+     * in absolute milliseconds-since-the-epoch
+     *
+     * @hide for Unsafe
      */
-    /*package*/ void parkUntil(long time) {
+    public void parkUntil(long time) {
         VMThread vmt = vmThread;
 
         if (vmt == null) {
diff --git a/luni/src/main/java/java/lang/ThreadGroup.java b/luni/src/main/java/java/lang/ThreadGroup.java
index 599b0c4..d0e593f 100644
--- a/luni/src/main/java/java/lang/ThreadGroup.java
+++ b/luni/src/main/java/java/lang/ThreadGroup.java
@@ -27,7 +27,6 @@
  * {@code ThreadGroup} is a means of organizing threads into a hierarchical structure.
  * This class is obsolete. See <i>Effective Java</i> Item 73, "Avoid thread groups" for details.
  * @see Thread
- * @see SecurityManager
  */
 public class ThreadGroup implements Thread.UncaughtExceptionHandler {
 
@@ -74,8 +73,6 @@
      * will be child of the {@code ThreadGroup} to which the calling thread belongs.
      *
      * @param name the name
-     * @throws SecurityException if {@code checkAccess()} for the parent
-     *         group fails with a SecurityException
      * @see Thread#currentThread
      */
 
@@ -90,18 +87,13 @@
      * @param parent the parent
      * @param name the name
      * @throws NullPointerException if {@code parent == null}
-     * @throws SecurityException if {@code checkAccess()} for the parent
-     *         group fails with a SecurityException
      * @throws IllegalThreadStateException if {@code parent} has been
      *         destroyed already
      */
     public ThreadGroup(ThreadGroup parent, String name) {
-        if (Thread.currentThread() != null) {
-            // If parent is null we must throw NullPointerException, but that
-            // will be done "for free" with the message send below
-            parent.checkAccess();
+        if (parent == null) {
+            throw new NullPointerException("parent == null");
         }
-
         this.name = name;
         this.parent = parent;
         if (parent != null) {
@@ -163,24 +155,6 @@
     }
 
     /**
-     * Adds a {@code Thread} to this thread group. This should only be visible
-     * to class Thread, and should only be called when a new Thread is created
-     * and initialized by the constructor.
-     *
-     * @param thread Thread to add
-     * @throws IllegalThreadStateException if this group has been destroyed already
-     * @see #remove(Thread)
-     */
-    final void add(Thread thread) throws IllegalThreadStateException {
-        synchronized (threadRefs) {
-            if (isDestroyed) {
-                throw new IllegalThreadStateException();
-            }
-            threadRefs.add(new WeakReference<Thread>(thread));
-        }
-    }
-
-    /**
      * Adds a {@code ThreadGroup} to this thread group.
      *
      * @param g ThreadGroup to add
@@ -212,16 +186,9 @@
     }
 
     /**
-     * Checks the accessibility of this {@code ThreadGroup} from the perspective of the
-     * caller. If there is a {@code SecurityManager} installed, calls
-     * {@code checkAccess} with this thread group as a parameter, otherwise does
-     * nothing.
+     * Does nothing.
      */
     public final void checkAccess() {
-        SecurityManager currentManager = System.getSecurityManager();
-        if (currentManager != null) {
-            currentManager.checkAccess(this);
-        }
     }
 
     /**
@@ -233,12 +200,8 @@
      * @throws IllegalThreadStateException if this thread group or any of its
      *         subgroups has been destroyed already or if it still contains
      *         threads.
-     * @throws SecurityException if {@code this.checkAccess()} fails with
-     *         a SecurityException
      */
     public final void destroy() {
-        checkAccess();
-
         synchronized (threadRefs) {
             synchronized (groups) {
                 if (isDestroyed) {
@@ -373,8 +336,6 @@
      */
     private int enumerateGeneric(Object[] enumeration, boolean recurse, int enumerationIndex,
             boolean enumeratingThreads) {
-        checkAccess();
-
         if (enumeratingThreads) {
             synchronized (threadRefs) {
                 // walk the references directly so we can iterate in reverse order
@@ -440,9 +401,6 @@
      * @return the parent
      */
     public final ThreadGroup getParent() {
-        if (parent != null) {
-            parent.checkAccess();
-        }
         return parent;
     }
 
@@ -450,13 +408,9 @@
      * Interrupts every {@code Thread} in this group and recursively in all its
      * subgroups.
      *
-     * @throws SecurityException if {@code this.checkAccess()} fails with
-     *         a SecurityException
-     *
      * @see Thread#interrupt
      */
     public final void interrupt() {
-        checkAccess();
         synchronized (threadRefs) {
             for (Thread thread : threads) {
                 thread.interrupt();
@@ -553,26 +507,6 @@
     }
 
     /**
-     * Removes a {@code Thread} from this group. This should only be visible to class
-     * Thread, and should only be called when a Thread dies.
-     *
-     * @param thread Thread to remove
-     *
-     * @see #add(Thread)
-     */
-    final void remove(Thread thread) {
-        synchronized (threadRefs) {
-            for (Iterator<Thread> i = threads.iterator(); i.hasNext(); ) {
-                if (i.next().equals(thread)) {
-                    i.remove();
-                    break;
-                }
-            }
-        }
-        destroyIfEmptyDaemon();
-    }
-
-    /**
      * Removes an immediate subgroup.
      *
      * @param g ThreadGroup to remove
@@ -597,9 +531,6 @@
      * Resumes every thread in this group and recursively in all its
      * subgroups.
      *
-     * @throws SecurityException if {@code this.checkAccess()} fails with
-     *         a SecurityException
-     *
      * @see Thread#resume
      * @see #suspend
      *
@@ -608,7 +539,6 @@
     @SuppressWarnings("deprecation")
     @Deprecated
     public final void resume() {
-        checkAccess();
         synchronized (threadRefs) {
             for (Thread thread : threads) {
                 thread.resume();
@@ -626,14 +556,10 @@
      * thread groups are automatically destroyed when they become empty.
      *
      * @param isDaemon the new value
-     * @throws SecurityException if {@code checkAccess()} for the parent
-     *         group fails with a SecurityException
-     *
      * @see #isDaemon
      * @see #destroy
      */
     public final void setDaemon(boolean isDaemon) {
-        checkAccess();
         this.isDaemon = isDaemon;
     }
 
@@ -647,16 +573,12 @@
      *
      * @param newMax the new maximum priority to be set
      *
-     * @throws SecurityException if {@code checkAccess()} fails with a
-     *         SecurityException
      * @throws IllegalArgumentException if the new priority is greater than
      *         Thread.MAX_PRIORITY or less than Thread.MIN_PRIORITY
      *
      * @see #getMaxPriority
      */
     public final void setMaxPriority(int newMax) {
-        checkAccess();
-
         if (newMax <= this.maxPriority) {
             if (newMax < Thread.MIN_PRIORITY) {
                 newMax = Thread.MIN_PRIORITY;
@@ -675,9 +597,6 @@
     /**
      * Stops every thread in this group and recursively in all its subgroups.
      *
-     * @throws SecurityException if {@code this.checkAccess()} fails with
-     *         a SecurityException
-     *
      * @see Thread#stop()
      * @see Thread#stop(Throwable)
      * @see ThreadDeath
@@ -694,8 +613,6 @@
 
     @SuppressWarnings("deprecation")
     private boolean stopHelper() {
-        checkAccess();
-
         boolean stopCurrent = false;
         synchronized (threadRefs) {
             Thread current = Thread.currentThread();
@@ -719,9 +636,6 @@
      * Suspends every thread in this group and recursively in all its
      * subgroups.
      *
-     * @throws SecurityException if {@code this.checkAccess()} fails with
-     *         a SecurityException
-     *
      * @see Thread#suspend
      * @see #resume
      *
@@ -737,8 +651,6 @@
 
     @SuppressWarnings("deprecation")
     private boolean suspendHelper() {
-        checkAccess();
-
         boolean suspendCurrent = false;
         synchronized (threadRefs) {
             Thread current = Thread.currentThread();
@@ -787,32 +699,29 @@
     }
 
     /**
-     * Non-standard method for adding a thread to a group, required by Dalvik.
-     *
-     * @param thread Thread to add
-     *
-     * @throws IllegalThreadStateException if the thread has been destroyed
-     *         already
-     *
-     * @see #add(Thread)
-     * @see #removeThread(Thread)
+     * Called by the Thread constructor.
      */
-    void addThread(Thread thread) throws IllegalThreadStateException {
-        add(thread);
+    final void addThread(Thread thread) throws IllegalThreadStateException {
+        synchronized (threadRefs) {
+            if (isDestroyed) {
+                throw new IllegalThreadStateException();
+            }
+            threadRefs.add(new WeakReference<Thread>(thread));
+        }
     }
 
     /**
-     * Non-standard method for adding a thread to a group, required by Dalvik.
-     *
-     * @param thread Thread to add
-     *
-     * @throws IllegalThreadStateException if the thread has been destroyed
-     *         already
-     *
-     * @see #remove(Thread)
-     * @see #addThread(Thread)
+     * Called by the VM when a Thread dies.
      */
-    void removeThread(Thread thread) throws IllegalThreadStateException {
-        remove(thread);
+    final void removeThread(Thread thread) throws IllegalThreadStateException {
+        synchronized (threadRefs) {
+            for (Iterator<Thread> i = threads.iterator(); i.hasNext(); ) {
+                if (i.next().equals(thread)) {
+                    i.remove();
+                    break;
+                }
+            }
+        }
+        destroyIfEmptyDaemon();
     }
 }
diff --git a/luni/src/main/java/java/lang/Throwable.java b/luni/src/main/java/java/lang/Throwable.java
index ad3705f..05cb1d1 100644
--- a/luni/src/main/java/java/lang/Throwable.java
+++ b/luni/src/main/java/java/lang/Throwable.java
@@ -23,7 +23,7 @@
 import java.io.PrintWriter;
 
 /**
- * The superclass of all classes which can be thrown by the virtual machine. The
+ * The superclass of all classes which can be thrown by the VM. The
  * two direct subclasses are recoverable exceptions ({@code Exception}) and
  * unrecoverable errors ({@code Error}). This class provides common methods for
  * accessing a string message which provides extra information about the
@@ -70,7 +70,6 @@
      * Constructs a new {@code Throwable} that includes the current stack trace.
      */
     public Throwable() {
-        super();
         fillInStackTrace();
     }
 
diff --git a/luni/src/main/java/java/lang/UnknownError.java b/luni/src/main/java/java/lang/UnknownError.java
index f005837..91bfe50 100644
--- a/luni/src/main/java/java/lang/UnknownError.java
+++ b/luni/src/main/java/java/lang/UnknownError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine must throw an error which does not match any
+ * Thrown when the VM must throw an error which does not match any
  * known exceptional condition.
  */
 public class UnknownError extends VirtualMachineError {
@@ -30,7 +30,6 @@
      * trace.
      */
     public UnknownError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/UnsatisfiedLinkError.java b/luni/src/main/java/java/lang/UnsatisfiedLinkError.java
index 1ff0ba6..b05c26d 100644
--- a/luni/src/main/java/java/lang/UnsatisfiedLinkError.java
+++ b/luni/src/main/java/java/lang/UnsatisfiedLinkError.java
@@ -30,7 +30,6 @@
      * stack trace.
      */
     public UnsatisfiedLinkError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/UnsupportedClassVersionError.java b/luni/src/main/java/java/lang/UnsupportedClassVersionError.java
index 08f98c7..5c6a6cf 100644
--- a/luni/src/main/java/java/lang/UnsupportedClassVersionError.java
+++ b/luni/src/main/java/java/lang/UnsupportedClassVersionError.java
@@ -19,7 +19,7 @@
 
 /**
  * Thrown when an attempt is made to load a class with a format version that is
- * not supported by the virtual machine.
+ * not supported by the VM.
  */
 public class UnsupportedClassVersionError extends ClassFormatError {
 
@@ -30,7 +30,6 @@
      * current stack trace.
      */
     public UnsupportedClassVersionError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/VMClassLoader.java b/luni/src/main/java/java/lang/VMClassLoader.java
index afcec20..8604360 100644
--- a/luni/src/main/java/java/lang/VMClassLoader.java
+++ b/luni/src/main/java/java/lang/VMClassLoader.java
@@ -18,7 +18,6 @@
 
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.security.ProtectionDomain;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -76,12 +75,10 @@
 
     native static Class getPrimitiveClass(char type);
 
-    native static Class defineClass(ClassLoader cl, String name,
-        byte[] data, int offset, int len, ProtectionDomain pd)
-        throws ClassFormatError;
+    native static Class defineClass(ClassLoader cl, String name, byte[] data, int offset, int len)
+            throws ClassFormatError;
 
-    native static Class defineClass(ClassLoader cl,
-            byte[] data, int offset, int len, ProtectionDomain pd)
+    native static Class defineClass(ClassLoader cl, byte[] data, int offset, int len)
             throws ClassFormatError;
 
     native static Class findLoadedClass(ClassLoader cl, String name);
@@ -92,4 +89,3 @@
     native private static int getBootClassPathSize();
     native private static String getBootClassPathResource(String name, int index);
 }
-
diff --git a/luni/src/main/java/java/lang/VMThread.java b/luni/src/main/java/java/lang/VMThread.java
index 7beb301..01f6ee3 100644
--- a/luni/src/main/java/java/lang/VMThread.java
+++ b/luni/src/main/java/java/lang/VMThread.java
@@ -16,9 +16,6 @@
 
 package java.lang;
 
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
 class VMThread {
     Thread thread;
     int vmData;
@@ -46,42 +43,12 @@
         VMThread.create(thread, stackSize);
     }
 
-    private static final String UNSUPPORTED_THREAD_METHOD
-            = "Deprecated Thread methods are not supported.";
-
-    /**
-     * Suspends the Thread.
-     */
-    @SuppressWarnings("ThrowableInstanceNeverThrown")
-    void suspend() {
-        Logger.global.log(Level.SEVERE, UNSUPPORTED_THREAD_METHOD,
-                new UnsupportedOperationException());
-    }
-
-    /**
-     * Resumes the Thread, assuming it is suspended.
-     */
-    @SuppressWarnings("ThrowableInstanceNeverThrown")
-    void resume() {
-        Logger.global.log(Level.SEVERE, UNSUPPORTED_THREAD_METHOD,
-                new UnsupportedOperationException());
-    }
-
     /**
      * Queries whether this Thread holds a monitor lock on the
      * given object.
      */
     native boolean holdsLock(Object object);
 
-    /**
-     * Stops the Thread, passing it a Throwable (which might be ThreadDeath).
-     */
-    @SuppressWarnings("ThrowableInstanceNeverThrown")
-    void stop(Throwable throwable) {
-        Logger.global.log(Level.SEVERE, UNSUPPORTED_THREAD_METHOD,
-                new UnsupportedOperationException());
-    }
-
     native void setPriority(int newPriority);
     native int getStatus();
 
@@ -108,4 +75,3 @@
      */
     native void nameChanged(String newName);
 }
-
diff --git a/luni/src/main/java/java/lang/VerifyError.java b/luni/src/main/java/java/lang/VerifyError.java
index 706f7aa..05bbaf6 100644
--- a/luni/src/main/java/java/lang/VerifyError.java
+++ b/luni/src/main/java/java/lang/VerifyError.java
@@ -18,7 +18,7 @@
 package java.lang;
 
 /**
- * Thrown when the virtual machine notices that an attempt is made to load a
+ * Thrown when the VM notices that an attempt is made to load a
  * class which does not pass the class verification phase.
  */
 public class VerifyError extends LinkageError {
@@ -30,7 +30,6 @@
      * trace.
      */
     public VerifyError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/VirtualMachineError.java b/luni/src/main/java/java/lang/VirtualMachineError.java
index 174e4f6..7ef1eea 100644
--- a/luni/src/main/java/java/lang/VirtualMachineError.java
+++ b/luni/src/main/java/java/lang/VirtualMachineError.java
@@ -20,7 +20,7 @@
 
 /**
  * {@code VirtualMachineError} is the superclass of all error classes that occur
- * during the operation of the virtual machine.
+ * during the operation of the VM.
  *
  * @see Error
  */
@@ -33,7 +33,6 @@
      * stack trace.
      */
     public VirtualMachineError() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/Void.java b/luni/src/main/java/java/lang/Void.java
index 1773d43..19f267a 100644
--- a/luni/src/main/java/java/lang/Void.java
+++ b/luni/src/main/java/java/lang/Void.java
@@ -31,8 +31,7 @@
      * The {@link Class} object that represents the primitive type {@code void}.
      */
     public static final Class<Void> TYPE = lookupType();
-
-    // Note: This can't be set to "void.class", since *that* is
+    // Note: Void.TYPE can't be set to "void.class", since *that* is
     // defined to be "java.lang.Void.TYPE";
 
     @SuppressWarnings("unchecked")
diff --git a/luni/src/main/java/java/lang/ref/FinalizerReference.java b/luni/src/main/java/java/lang/ref/FinalizerReference.java
new file mode 100644
index 0000000..a3f9024
--- /dev/null
+++ b/luni/src/main/java/java/lang/ref/FinalizerReference.java
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang.ref;
+
+import java.lang.FinalizerThread;
+
+/**
+ * @hide
+ */
+public final class FinalizerReference<T> extends Reference<T> {
+    private static FinalizerReference head = null;
+
+    private T zombie;
+
+    private FinalizerReference prev;
+
+    private FinalizerReference next;
+
+    public FinalizerReference(T r, ReferenceQueue<? super T> q) {
+        super(r, q);
+    }
+
+    @Override
+    public T get() {
+        return zombie;
+    }
+
+    @Override
+    public void clear() {
+        zombie = null;
+    }
+
+    static void add(Object referent) {
+        ReferenceQueue<Object> queue = FinalizerThread.queue;
+        FinalizerReference<?> reference = new FinalizerReference<Object>(referent, queue);
+        synchronized (FinalizerReference.class) {
+            reference.prev = null;
+            reference.next = head;
+            if (head != null) {
+                head.prev = reference;
+            }
+            head = reference;
+        }
+    }
+
+    public static void remove(FinalizerReference reference) {
+        synchronized (FinalizerReference.class) {
+            FinalizerReference next = reference.next;
+            FinalizerReference prev = reference.prev;
+            reference.next = null;
+            reference.prev = null;
+            if (prev != null) {
+                prev.next = next;
+            } else {
+                head = reference;
+            }
+            if (next != null) {
+                next.prev = prev;
+            }
+        }
+    }
+}
diff --git a/luni/src/main/java/java/lang/ref/PhantomReference.java b/luni/src/main/java/java/lang/ref/PhantomReference.java
index 379584c..2726d90 100644
--- a/luni/src/main/java/java/lang/ref/PhantomReference.java
+++ b/luni/src/main/java/java/lang/ref/PhantomReference.java
@@ -57,9 +57,7 @@
      * @param q the queue to register the phantom reference object with
      */
     public PhantomReference(T r, ReferenceQueue<? super T> q) {
-        super();
-        referent = r;
-        queue = q;
+        super(r, q);
     }
 
     /**
diff --git a/luni/src/main/java/java/lang/ref/Reference.java b/luni/src/main/java/java/lang/ref/Reference.java
index 3a03fc8..db33813 100644
--- a/luni/src/main/java/java/lang/ref/Reference.java
+++ b/luni/src/main/java/java/lang/ref/Reference.java
@@ -67,18 +67,22 @@
     volatile Reference queueNext;
 
     /**
-     * Used internally by the VM.  This field forms a singly-linked
-     * list of reference objects awaiting processing by the garbage
-     * collector.
+     * Used internally by the VM.  This field forms a circular and
+     * singly linked list of reference objects discovered by the
+     * garbage collector and awaiting processing by the reference
+     * queue thread.
      */
-    @SuppressWarnings("unchecked")
-    volatile Reference pendingNext;
+    volatile Reference<?> pendingNext;
 
     /**
      * Constructs a new instance of this class.
      */
     Reference() {
-        super();
+    }
+
+    Reference(T r, ReferenceQueue q) {
+        referent = r;
+        queue = q;
     }
 
     /**
@@ -90,24 +94,12 @@
     }
 
     /**
-     * An implementation of .enqueue() that is safe for the VM to call.
-     * If a Reference object is a subclass of any of the
-     * java.lang.ref.*Reference classes and that subclass overrides enqueue(),
-     * the VM may not call the overridden method.
-     * VM requirement: this method <em>must</em> be called "enqueueInternal",
-     * have the signature "()Z", and be private.
+     * Adds an object to its reference queue.
      *
      * @return {@code true} if this call has caused the {@code Reference} to
      * become enqueued, or {@code false} otherwise
      */
-    @SuppressWarnings("unchecked")
-    private synchronized boolean enqueueInternal() {
-        /* VM requirement:
-         * The VM assumes that this function only does work
-         * if "(queue != null && queueNext == null)".
-         * If that changes, Dalvik needs to change, too.
-         * (see MarkSweep.c:enqueueReference())
-         */
+    final synchronized boolean enqueueInternal() {
         if (queue != null && queueNext == null) {
             queue.enqueue(this);
             queue = null;
diff --git a/luni/src/main/java/java/lang/ref/ReferenceQueue.java b/luni/src/main/java/java/lang/ref/ReferenceQueue.java
index ac6d695..0c04467 100644
--- a/luni/src/main/java/java/lang/ref/ReferenceQueue.java
+++ b/luni/src/main/java/java/lang/ref/ReferenceQueue.java
@@ -15,10 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// This implementation is quite different from Harmony. Changes are not marked.
-// END android-note
-
 package java.lang.ref;
 
 /**
@@ -36,7 +32,6 @@
      * Constructs a new instance of this class.
      */
     public ReferenceQueue() {
-        super();
     }
 
     /**
@@ -135,4 +130,19 @@
         head = reference;
         notify();
     }
+
+    static Reference unenqueued = null;
+
+    static void add(Reference<?> list) {
+        synchronized (ReferenceQueue.class) {
+            if (unenqueued == null) {
+                unenqueued = list;
+            } else {
+                Reference<?> next = unenqueued.pendingNext;
+                unenqueued.pendingNext = list.pendingNext;
+                list.pendingNext = next;
+            }
+            ReferenceQueue.class.notifyAll();
+        }
+    }
 }
diff --git a/luni/src/main/java/java/lang/ref/ReferenceQueueThread.java b/luni/src/main/java/java/lang/ref/ReferenceQueueThread.java
new file mode 100644
index 0000000..201c240
--- /dev/null
+++ b/luni/src/main/java/java/lang/ref/ReferenceQueueThread.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.lang.ref;
+
+/**
+ * @hide
+ */
+public final class ReferenceQueueThread extends Thread {
+    private static ReferenceQueueThread thread = null;
+
+    public ReferenceQueueThread() {
+        super("ReferenceQueue");
+        setDaemon(true);
+    }
+
+    /**
+     * Moves each element from the pending list to the reference queue
+     * list.  The pendingNext field is owned by the garbage collector
+     * so no synchronization is required to perform the unlinking.
+     */
+    private static void doEnqueue(Reference list) {
+        while (list != null) {
+            Reference reference;
+            if (list == list.pendingNext) {
+                reference = list;
+                reference.pendingNext = null;
+                list = null;
+            } else {
+                reference = list.pendingNext;
+                list.pendingNext = reference.pendingNext;
+                reference.pendingNext = null;
+            }
+            reference.enqueueInternal();
+        }
+    }
+
+    public void run() {
+        for (;;) {
+            Reference list;
+            try {
+                synchronized (ReferenceQueue.class) {
+                    while (ReferenceQueue.unenqueued == null) {
+                        ReferenceQueue.class.wait();
+                    }
+                    list = ReferenceQueue.unenqueued;
+                    ReferenceQueue.unenqueued = null;
+                }
+            } catch (InterruptedException ex) {
+                break;
+            }
+            doEnqueue(list);
+        }
+    }
+
+    public static synchronized void startReferenceQueue() {
+        if (thread != null) {
+            throw new IllegalStateException("already started");
+        }
+        thread = new ReferenceQueueThread();
+        thread.start();
+    }
+
+    public static synchronized void stopReferenceQueue() {
+        if (thread == null) {
+            throw new IllegalStateException("not started");
+        }
+        thread.interrupt();
+        for (;;) {
+            try {
+                thread.join();
+            } catch (InterruptedException ex) {
+                continue;
+            }
+            break;
+        }
+        thread = null;
+    }
+}
diff --git a/luni/src/main/java/java/lang/ref/SoftReference.java b/luni/src/main/java/java/lang/ref/SoftReference.java
index 5db8b8f..8880171 100644
--- a/luni/src/main/java/java/lang/ref/SoftReference.java
+++ b/luni/src/main/java/java/lang/ref/SoftReference.java
@@ -93,8 +93,7 @@
      * @param r the referent to track
      */
     public SoftReference(T r) {
-        super();
-        referent = r;
+        super(r, null);
     }
 
     /**
@@ -107,8 +106,6 @@
      *          queue.
      */
     public SoftReference(T r, ReferenceQueue<? super T> q) {
-        super();
-        referent = r;
-        queue = q;
+        super(r, q);
     }
 }
diff --git a/luni/src/main/java/java/lang/ref/WeakReference.java b/luni/src/main/java/java/lang/ref/WeakReference.java
index 47aa0e9..ace450c 100644
--- a/luni/src/main/java/java/lang/ref/WeakReference.java
+++ b/luni/src/main/java/java/lang/ref/WeakReference.java
@@ -92,8 +92,7 @@
      * @param r the referent to track
      */
     public WeakReference(T r) {
-        super();
-        referent = r;
+        super(r, null);
     }
 
     /**
@@ -106,8 +105,6 @@
      *          queue.
      */
     public WeakReference(T r, ReferenceQueue<? super T> q) {
-        super();
-        referent = r;
-        queue = q;
+        super(r, q);
     }
 }
diff --git a/luni/src/main/java/java/lang/reflect/AccessibleObject.java b/luni/src/main/java/java/lang/reflect/AccessibleObject.java
index 33abc08..6dde0c2 100644
--- a/luni/src/main/java/java/lang/reflect/AccessibleObject.java
+++ b/luni/src/main/java/java/lang/reflect/AccessibleObject.java
@@ -34,7 +34,6 @@
 
 import java.lang.annotation.Annotation;
 import java.util.Hashtable;
-import org.apache.harmony.kernel.vm.ReflectionAccess;
 import org.apache.harmony.kernel.vm.StringUtils;
 
 /**
@@ -52,11 +51,10 @@
  * @see Field
  * @see Constructor
  * @see Method
- * @see ReflectPermission
  */
 public class AccessibleObject implements AnnotatedElement {
 
-    // If true, object is accessible, bypassing normal security checks
+    // If true, object is accessible, bypassing normal access checks
     boolean flag = false;
 
     // Holds a mapping from Java type names to native type codes.
@@ -77,32 +75,21 @@
 
     /**
      * Attempts to set the value of the accessible flag for all the objects in
-     * the array provided. Only one security check is performed. Setting this
+     * the array provided. Setting this
      * flag to {@code false} will enable access checks, setting to {@code true}
-     * will disable them. If there is a security manager, checkPermission is
-     * called with a {@code ReflectPermission("suppressAccessChecks")}.
+     * will disable them.
      *
      * @param objects
      *            the accessible objects
      * @param flag
      *            the new value for the accessible flag
      *
-     * @throws SecurityException
-     *             if the request is denied
-     *
      * @see #setAccessible(boolean)
-     * @see ReflectPermission
      */
-    public static void setAccessible(AccessibleObject[] objects, boolean flag)
-            throws SecurityException {
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkPermission(new ReflectPermission("suppressAccessChecks"));
-        }
-
+    public static void setAccessible(AccessibleObject[] objects, boolean flag) {
         synchronized(AccessibleObject.class) {
-            for (int i = 0; i < objects.length; i++) {
-                objects[i].flag = flag;
+            for (AccessibleObject object : objects) {
+                object.flag = flag;
             }
         }
     }
@@ -113,14 +100,13 @@
      * machine.
      */
     protected AccessibleObject() {
-        super();
     }
 
     /**
-     * Indicates whether this object is accessible without security checks being
+     * Indicates whether this object is accessible without access checks being
      * performed. Returns the accessible flag.
      *
-     * @return {@code true} if this object is accessible without security
+     * @return {@code true} if this object is accessible without access
      *         checks, {@code false} otherwise
      */
     public boolean isAccessible() {
@@ -130,42 +116,21 @@
     /**
      * Attempts to set the value of the accessible flag. Setting this flag to
      * {@code false} will enable access checks, setting to {@code true} will
-     * disable them. If there is a security manager, checkPermission is called
-     * with a {@code ReflectPermission("suppressAccessChecks")}.
-     *
-     * @param flag
-     *            the new value for the accessible flag
-     *
-     * @throws SecurityException
-     *             if the request is denied
-     *
-     * @see ReflectPermission
-     */
-    public void setAccessible(boolean flag) throws SecurityException {
-        SecurityManager smgr = System.getSecurityManager();
-        if (smgr != null) {
-            smgr.checkPermission(new ReflectPermission("suppressAccessChecks"));
-        }
-
-        this.flag = flag;
-    }
-
-    /**
-     * Sets the accessible flag on this instance without doing any checks.
+     * disable them.
      *
      * @param flag
      *            the new value for the accessible flag
      */
-    /*package*/ void setAccessibleNoCheck(boolean flag) {
+    public void setAccessible(boolean flag) {
         this.flag = flag;
     }
 
     public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
-        return getAnnotation(annotationType) != null;
+        throw new UnsupportedOperationException();
     }
 
     public Annotation[] getDeclaredAnnotations() {
-        throw new RuntimeException("subclass must override this method");
+        throw new UnsupportedOperationException();
     }
 
     public Annotation[] getAnnotations() {
@@ -173,20 +138,8 @@
         return getDeclaredAnnotations();
     }
 
-    /* slow, but works for all sub-classes */
     public <T extends Annotation> T getAnnotation(Class<T> annotationType) {
-        if (annotationType == null) {
-            throw new NullPointerException();
-        }
-        Annotation[] annotations = getAnnotations();
-        for (int i = annotations.length-1; i >= 0; --i) {
-            if (annotations[i].annotationType() == annotationType) {
-                @SuppressWarnings("unchecked")
-                T result = (T) annotations[i];
-                return result;
-            }
-        }
-        return null;
+        throw new UnsupportedOperationException();
     }
 
     /**
@@ -275,16 +228,6 @@
     private static native Object[] getClassSignatureAnnotation(Class clazz);
 
     /**
-     * Gets the unique instance of {@link ReflectionAccessImpl}.
-     *
-     * @return non-null; the unique instance
-     */
-    static /*package*/ ReflectionAccess getReflectionAccess() {
-        return ReflectionAccessImpl.THE_ONE;
-    }
-
-
-    /**
      * Appends the specified class name to the buffer. The class may represent
      * a simple type, a reference type or an array type.
      *
@@ -310,17 +253,15 @@
      * elements may represent a simple type, a reference type or an array type.
      * Output format: java.lang.Object[], java.io.File, void
      *
-     * @param sb buffer
-     * @param objs array of classes to print the names
-     *
+     * @param types array of classes to print the names
      * @throws NullPointerException if any of the arguments is null
      */
-    void appendArrayGenericType(StringBuilder sb, Type[] objs) {
-        if (objs.length > 0) {
-            appendGenericType(sb, objs[0]);
-            for (int i = 1; i < objs.length; i++) {
+    void appendArrayGenericType(StringBuilder sb, Type[] types) {
+        if (types.length > 0) {
+            appendGenericType(sb, types[0]);
+            for (int i = 1; i < types.length; i++) {
                 sb.append(',');
-                appendGenericType(sb, objs[i]);
+                appendGenericType(sb, types[i]);
             }
         }
     }
@@ -378,26 +319,4 @@
             }
         }
     }
-
-    /**
-     * Appends names of the specified array classes to the buffer. The array
-     * elements may represent a simple type, a reference type or an array type.
-     * In case if the specified array element represents an array type its
-     * internal will be appended to the buffer.
-     * Output format: [Ljava.lang.Object;, java.io.File, void
-     *
-     * @param sb buffer
-     * @param objs array of classes to print the names
-     *
-     * @throws NullPointerException if any of the arguments is null
-     */
-    void appendSimpleType(StringBuilder sb, Class<?>[] objs) {
-        if (objs.length > 0) {
-            sb.append(objs[0].getName());
-            for (int i = 1; i < objs.length; i++) {
-                sb.append(',');
-                sb.append(objs[i].getName());
-            }
-        }
-    }
 }
diff --git a/luni/src/main/java/java/lang/reflect/Array.java b/luni/src/main/java/java/lang/reflect/Array.java
index db0d426..3ecfae0 100644
--- a/luni/src/main/java/java/lang/reflect/Array.java
+++ b/luni/src/main/java/java/lang/reflect/Array.java
@@ -411,7 +411,7 @@
         if (dimensions.length <= 0 || dimensions.length > 255)
             throw new IllegalArgumentException("Bad number of dimensions");
 
-        if (componentType == Void.TYPE)
+        if (componentType == void.class)
             throw new IllegalArgumentException();
 
         if (componentType == null)
@@ -444,37 +444,37 @@
      */
     public static Object newInstance(Class<?> componentType, int size)
             throws NegativeArraySizeException {
-        if (!componentType.isPrimitive())
+        if (!componentType.isPrimitive()) {
             return createObjectArray(componentType, size);
-
-        if (componentType == Boolean.TYPE)
+        }
+        if (componentType == boolean.class) {
             return new boolean[size];
-
-        if (componentType == Byte.TYPE)
+        }
+        if (componentType == byte.class) {
             return new byte[size];
-
-        if (componentType == Character.TYPE)
+        }
+        if (componentType == char.class) {
             return new char[size];
-
-        if (componentType == Short.TYPE)
+        }
+        if (componentType == short.class) {
             return new short[size];
-
-        if (componentType == Integer.TYPE)
+        }
+        if (componentType == int.class) {
             return new int[size];
-
-        if (componentType == Long.TYPE)
+        }
+        if (componentType == long.class) {
             return new long[size];
-
-        if (componentType == Float.TYPE)
+        }
+        if (componentType == float.class) {
             return new float[size];
-
-        if (componentType == Double.TYPE)
+        }
+        if (componentType == double.class) {
             return new double[size];
-
-        if (componentType == Void.TYPE)
+        }
+        if (componentType == void.class) {
             throw new IllegalArgumentException();
-
-        throw new RuntimeException(); // should be impossible
+        }
+        throw new AssertionError();
     }
 
     /*
diff --git a/luni/src/main/java/java/lang/reflect/Constructor.java b/luni/src/main/java/java/lang/reflect/Constructor.java
index 0b587c9..ceb54c4 100644
--- a/luni/src/main/java/java/lang/reflect/Constructor.java
+++ b/luni/src/main/java/java/lang/reflect/Constructor.java
@@ -102,7 +102,7 @@
     }
 
     @Override /*package*/ String getSignatureAttribute() {
-        Object[] annotation = getSignatureAnnotation(declaringClass, slot);
+        Object[] annotation = Method.getSignatureAnnotation(declaringClass, slot);
 
         if (annotation == null) {
             return null;
@@ -111,13 +111,6 @@
         return StringUtils.combineStrings(annotation);
     }
 
-    /**
-     * Get the Signature annotation for this constructor.  Returns null if not
-     * found.
-     */
-    native private Object[] getSignatureAnnotation(Class declaringClass,
-            int slot);
-
     public TypeVariable<Constructor<T>>[] getTypeParameters() {
         initGenericTypes();
         return formalTypeParameters.clone();
@@ -207,10 +200,22 @@
 
     @Override
     public Annotation[] getDeclaredAnnotations() {
-        return getDeclaredAnnotations(declaringClass, slot);
+        return Method.getDeclaredAnnotations(declaringClass, slot);
     }
-    native private Annotation[] getDeclaredAnnotations(Class declaringClass,
-        int slot);
+
+    @Override public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+        return Method.getAnnotation(declaringClass, slot, annotationType);
+    }
+
+    @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+        return Method.isAnnotationPresent(declaringClass, slot, annotationType);
+    }
 
     /**
      * Returns an array of arrays that represent the annotations of the formal
@@ -222,14 +227,12 @@
      */
     public Annotation[][] getParameterAnnotations() {
         Annotation[][] parameterAnnotations
-                = getParameterAnnotations(declaringClass, slot);
+                = Method.getParameterAnnotations(declaringClass, slot);
         if (parameterAnnotations.length == 0) {
             return Method.noAnnotations(parameterTypes.length);
         }
         return parameterAnnotations;
     }
-    native private Annotation[][] getParameterAnnotations(Class declaringClass,
-        int slot);
 
     /**
      * Indicates whether or not this constructor takes a variable number of
@@ -239,7 +242,7 @@
      *         {@code false}
      */
     public boolean isVarArgs() {
-        int mods = getConstructorModifiers(declaringClass, slot);
+        int mods = Method.getMethodModifiers(declaringClass, slot);
         return (mods & Modifier.VARARGS) != 0;
     }
 
@@ -251,7 +254,7 @@
      *         otherwise
      */
     public boolean isSynthetic() {
-        int mods = getConstructorModifiers(declaringClass, slot);
+        int mods = Method.getMethodModifiers(declaringClass, slot);
         return (mods & Modifier.SYNTHETIC) != 0;
     }
 
@@ -306,11 +309,9 @@
      * @see Modifier
      */
     public int getModifiers() {
-        return getConstructorModifiers(declaringClass, slot);
+        return Method.getMethodModifiers(declaringClass, slot);
     }
 
-    private native int getConstructorModifiers(Class<T> declaringClass, int slot);
-
     /**
      * Returns the name of this constructor.
      *
diff --git a/luni/src/main/java/java/lang/reflect/Field.java b/luni/src/main/java/java/lang/reflect/Field.java
index 1d2726c..87c955a 100644
--- a/luni/src/main/java/java/lang/reflect/Field.java
+++ b/luni/src/main/java/java/lang/reflect/Field.java
@@ -33,6 +33,7 @@
 package java.lang.reflect;
 
 import java.lang.annotation.Annotation;
+import java.util.Comparator;
 import org.apache.harmony.kernel.vm.StringUtils;
 import org.apache.harmony.luni.lang.reflect.GenericSignatureParser;
 import org.apache.harmony.luni.lang.reflect.Types;
@@ -43,6 +44,23 @@
  */
 public final class Field extends AccessibleObject implements Member {
 
+    /**
+     * Orders fields by their name and declaring class.
+     *
+     * @hide
+     */
+    public static final Comparator<Field> ORDER_BY_NAME_AND_DECLARING_CLASS
+            = new Comparator<Field>() {
+        @Override public int compare(Field a, Field b) {
+            int comparison = a.name.compareTo(b.name);
+            if (comparison != 0) {
+                return comparison;
+            }
+
+            return a.getDeclaringClass().getName().compareTo(b.getDeclaringClass().getName());
+        }
+    };
+
     private Class<?> declaringClass;
 
     private Class<?> type;
@@ -55,21 +73,21 @@
 
     private int slot;
 
-    private static final int TYPE_BOOLEAN = 1;
+    private static final char TYPE_BOOLEAN = 'Z';
 
-    private static final int TYPE_BYTE = 2;
+    private static final char TYPE_BYTE = 'B';
 
-    private static final int TYPE_CHAR = 3;
+    private static final char TYPE_CHAR = 'C';
 
-    private static final int TYPE_SHORT = 4;
+    private static final char TYPE_SHORT = 'S';
 
-    private static final int TYPE_INTEGER = 5;
+    private static final char TYPE_INTEGER = 'I';
 
-    private static final int TYPE_FLOAT = 6;
+    private static final char TYPE_FLOAT = 'F';
 
-    private static final int TYPE_LONG = 7;
+    private static final char TYPE_LONG = 'J';
 
-    private static final int TYPE_DOUBLE = 8;
+    private static final char TYPE_DOUBLE = 'D';
 
     /**
      * Construct a clone of the given instance.
@@ -182,12 +200,28 @@
         return Types.getType(genericType);
     }
 
-    @Override
-    public Annotation[] getDeclaredAnnotations() {
+    @Override public Annotation[] getDeclaredAnnotations() {
         return getDeclaredAnnotations(declaringClass, slot);
     }
+    private static native Annotation[] getDeclaredAnnotations(Class declaringClass, int slot);
 
-    native private Annotation[] getDeclaredAnnotations(Class declaringClass, int slot);
+    @Override public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+        return getAnnotation(declaringClass, slot, annotationType);
+    }
+    private static native <A extends Annotation> A getAnnotation(
+            Class<?> declaringClass, int slot, Class<A> annotationType);
+
+    @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+        return isAnnotationPresent(declaringClass, slot, annotationType);
+    }
+    private static native boolean isAnnotationPresent(
+            Class<?> declaringClass, int slot, Class<? extends Annotation> annotationType);
 
     /**
      * Indicates whether or not the specified {@code object} is equal to this
@@ -517,9 +551,7 @@
      */
     @Override
     public int hashCode() {
-        // BEGIN android-changed
         return name.hashCode() ^ getDeclaringClass().getName().hashCode();
-        // END android-changed
     }
 
     /**
@@ -849,54 +881,54 @@
             boolean noAccessCheck) throws IllegalAccessException;
 
     private native double getDField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native int getIField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native long getJField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native boolean getZField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native float getFField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native char getCField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native short getSField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native byte getBField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor) throws IllegalAccessException;
 
     private native void setField(Object o, Class<?> declaringClass, Class<?> type, int slot,
             boolean noAccessCheck, Object value) throws IllegalAccessException;
 
     private native void setDField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, double v) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, double v) throws IllegalAccessException;
 
     private native void setIField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, int i) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, int i) throws IllegalAccessException;
 
     private native void setJField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, long j) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, long j) throws IllegalAccessException;
 
     private native void setZField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, boolean z) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, boolean z) throws IllegalAccessException;
 
     private native void setFField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, float f) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, float f) throws IllegalAccessException;
 
     private native void setCField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, char c) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, char c) throws IllegalAccessException;
 
     private native void setSField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, short s) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, short s) throws IllegalAccessException;
 
     private native void setBField(Object o, Class<?> declaringClass, Class<?> type, int slot,
-            boolean noAccessCheck, int type_no, byte b) throws IllegalAccessException;
+            boolean noAccessCheck, char descriptor, byte b) throws IllegalAccessException;
 
 }
diff --git a/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java b/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
index d9363c0..cf44af4 100644
--- a/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
+++ b/luni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
@@ -31,6 +31,5 @@
      * Constructs a new {@code GenericSignatureFormatError} instance.
      */
     public GenericSignatureFormatError() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java b/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
index 952db94..cedf150 100644
--- a/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
+++ b/luni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
@@ -31,6 +31,5 @@
      * Constructs a new {@code MalformedParameterizedTypeException} instance.
      */
     public MalformedParameterizedTypeException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/lang/reflect/Member.java b/luni/src/main/java/java/lang/reflect/Member.java
index 0600588..a43ac6e 100644
--- a/luni/src/main/java/java/lang/reflect/Member.java
+++ b/luni/src/main/java/java/lang/reflect/Member.java
@@ -29,16 +29,12 @@
     /**
      * Designates all public members of a class or interface (including
      * inherited members).
-     *
-     * @see java.lang.SecurityManager#checkMemberAccess
      */
     public static final int PUBLIC = 0;
 
     /**
      * Designates all declared members of a class or interface (without
      * inherited members).
-     *
-     * @see java.lang.SecurityManager#checkMemberAccess
      */
     public static final int DECLARED = 1;
 
diff --git a/luni/src/main/java/java/lang/reflect/Method.java b/luni/src/main/java/java/lang/reflect/Method.java
index d54ed1a..de1dcbd 100644
--- a/luni/src/main/java/java/lang/reflect/Method.java
+++ b/luni/src/main/java/java/lang/reflect/Method.java
@@ -47,7 +47,7 @@
 public final class Method extends AccessibleObject implements GenericDeclaration, Member {
 
     /**
-     * Orders methods by their name and parameters.
+     * Orders methods by their name, parameters and return type.
      *
      * @hide
      */
@@ -68,7 +68,12 @@
                 }
             }
 
-            return aParameters.length - bParameters.length;
+            if (aParameters.length != bParameters.length) {
+                return aParameters.length - bParameters.length;
+            }
+
+            // this is necessary for methods that have covariant return types.
+            return a.getReturnType().getName().compareTo(b.getReturnType().getName());
         }
     };
 
@@ -149,8 +154,7 @@
      * Returns the Signature annotation for this method. Returns {@code null} if
      * not found.
      */
-    native private Object[] getSignatureAnnotation(Class declaringClass,
-            int slot);
+    static native Object[] getSignatureAnnotation(Class declaringClass, int slot);
 
     /**
      * Returns the string representation of the method's declaration, including
@@ -262,8 +266,25 @@
     public Annotation[] getDeclaredAnnotations() {
         return getDeclaredAnnotations(declaringClass, slot);
     }
-    native private Annotation[] getDeclaredAnnotations(Class declaringClass,
-        int slot);
+    static native Annotation[] getDeclaredAnnotations(Class<?> declaringClass, int slot);
+
+    @Override public <A extends Annotation> A getAnnotation(Class<A> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+        return getAnnotation(declaringClass, slot, annotationType);
+    }
+    static native <A extends Annotation> A getAnnotation(
+            Class<?> declaringClass, int slot, Class<A> annotationType);
+
+    @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
+        if (annotationType == null) {
+            throw new NullPointerException("annotationType == null");
+        }
+        return isAnnotationPresent(declaringClass, slot, annotationType);
+    }
+    static native boolean isAnnotationPresent(
+            Class<?> declaringClass, int slot, Class<? extends Annotation> annotationType);
 
     private static final Annotation[] NO_ANNOTATIONS = new Annotation[0];
 
@@ -295,8 +316,7 @@
         return parameterAnnotations;
     }
 
-    native private Annotation[][] getParameterAnnotations(Class declaringClass,
-        int slot);
+    static native Annotation[][] getParameterAnnotations(Class declaringClass, int slot);
 
     /**
      * Indicates whether or not this method takes a variable number argument.
@@ -396,7 +416,7 @@
         return getMethodModifiers(declaringClass, slot);
     }
 
-    private native int getMethodModifiers(Class<?> decl_class, int slot);
+    static native int getMethodModifiers(Class<?> declaringClass, int slot);
 
     /**
      * Returns the name of the method represented by this {@code Method}
diff --git a/luni/src/main/java/java/lang/reflect/Modifier.java b/luni/src/main/java/java/lang/reflect/Modifier.java
index 4ae460b..225ded1 100644
--- a/luni/src/main/java/java/lang/reflect/Modifier.java
+++ b/luni/src/main/java/java/lang/reflect/Modifier.java
@@ -111,6 +111,51 @@
     }
 
     /**
+     * Returns a mask of all the modifiers that may be applied to classes.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int classModifiers() {
+        return PUBLIC | PROTECTED | PRIVATE | ABSTRACT | STATIC | FINAL | STRICT;
+    }
+
+    /**
+     * Returns a mask of all the modifiers that may be applied to constructors.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int constructorModifiers() {
+        return PUBLIC | PROTECTED | PRIVATE;
+    }
+
+    /**
+     * Returns a mask of all the modifiers that may be applied to fields.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int fieldModifiers() {
+        return PUBLIC | PROTECTED | PRIVATE | STATIC | FINAL | TRANSIENT | VOLATILE;
+    }
+
+    /**
+     * Returns a mask of all the modifiers that may be applied to interfaces.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int interfaceModifiers() {
+        return PUBLIC | PROTECTED | PRIVATE | ABSTRACT | STATIC | STRICT;
+    }
+
+    /**
+     * Returns a mask of all the modifiers that may be applied to methods.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static int methodModifiers() {
+        return PUBLIC | PROTECTED | PRIVATE | ABSTRACT | STATIC | FINAL | SYNCHRONIZED | NATIVE | STRICT;
+    }
+
+    /**
      * Indicates whether or not the specified modifiers contain the {@code
      * abstract} modifier.
      *
@@ -277,7 +322,6 @@
      *            the modifiers to print
      * @return a printable representation of the modifiers
      */
-    @SuppressWarnings("nls")
     public static java.lang.String toString(int modifiers) {
         StringBuilder buf = new StringBuilder();
 
diff --git a/luni/src/main/java/java/lang/reflect/Proxy.java b/luni/src/main/java/java/lang/reflect/Proxy.java
index 92b04f6..a24514d 100644
--- a/luni/src/main/java/java/lang/reflect/Proxy.java
+++ b/luni/src/main/java/java/lang/reflect/Proxy.java
@@ -23,10 +23,6 @@
 import java.util.Map;
 import java.util.WeakHashMap;
 
-// BEGIN android-removed
-// import org.apache.harmony.luni.internal.reflect.ProxyClassFile;
-// END android-removed
-
 /**
  * {@code Proxy} defines methods for creating dynamic proxy classes and instances.
  * A proxy class implements a declared set of interfaces and delegates method
@@ -91,9 +87,6 @@
      */
     public static Class<?> getProxyClass(ClassLoader loader,
             Class<?>... interfaces) throws IllegalArgumentException {
-        // BEGIN android-note
-        // Changed parameter to be closer to the RI
-        // END android-note
         // check that interfaces are a valid array of visible interfaces
         if (interfaces == null) {
             throw new NullPointerException();
@@ -165,21 +158,13 @@
                 if (commonPackageName != null && commonPackageName.length() > 0) {
                     nextClassName = commonPackageName + "." + nextClassName;
                 }
-                // BEGIN android-changed
-                // byte[] classFileBytes = ProxyClassFile.generateBytes(
-                //         nextClassName, interfaces);
-                // newClass = defineClassImpl(loader, nextClassName.replace('.',
-                //         '/'), classFileBytes);
                 if (loader == null) {
                     loader = ClassLoader.getSystemClassLoader();
                 }
-                newClass = generateProxy(nextClassName.replace('.', '/'),
-                        interfaces, loader);
-                // END android-changed
+                newClass = generateProxy(nextClassName.replace('.', '/'), interfaces, loader);
                 // Need a weak reference to the class so it can
                 // be unloaded if the class loader is discarded
-                interfaceCache.put(interfaceKey, new WeakReference<Class<?>>(
-                        newClass));
+                interfaceCache.put(interfaceKey, new WeakReference<Class<?>>(newClass));
                 synchronized (proxyCache) {
                     // the value is unused
                     proxyCache.put(newClass, "");
@@ -282,9 +267,6 @@
         throw new IllegalArgumentException("not a proxy instance");
     }
 
-    // BEGIN android-changed
-    //private static native Class<?> defineClassImpl(ClassLoader classLoader,
-    //        String className, byte[] classFileBytes);
     native private static Class generateProxy(String name, Class[] interfaces,
         ClassLoader loader);
 
@@ -293,6 +275,4 @@
      * There is no implementation.
      */
     native private static void constructorPrototype(InvocationHandler h);
-    // END android-changed
-
 }
diff --git a/luni/src/main/java/java/lang/reflect/ReflectionAccessImpl.java b/luni/src/main/java/java/lang/reflect/ReflectionAccessImpl.java
deleted file mode 100644
index 15cd798..0000000
--- a/luni/src/main/java/java/lang/reflect/ReflectionAccessImpl.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.lang.reflect;
-
-import org.apache.harmony.kernel.vm.ReflectionAccess;
-
-/**
- * Implementation of bridge from {@code java.lang} to
- * {@code java.lang.reflect}.
- */
-/*package*/ final class ReflectionAccessImpl implements ReflectionAccess {
-    /** non-null; unique instance of this class */
-    /*package*/ static final ReflectionAccessImpl THE_ONE =
-        new ReflectionAccessImpl();
-
-    /**
-     * This class is not publicly instantiable. Use {@link #THE_ONE}.
-     */
-    private ReflectionAccessImpl() {
-        // This space intentionally left blank.
-    }
-
-    public Method clone(Method method) {
-        return new Method(method);
-    }
-
-    public Field clone(Field field) {
-        return new Field(field);
-    }
-
-    public Method accessibleClone(Method method) {
-        Method result = new Method(method);
-        result.setAccessibleNoCheck(true);
-        return result;
-    }
-
-    public void setAccessibleNoCheck(AccessibleObject ao, boolean accessible) {
-        ao.setAccessibleNoCheck(accessible);
-    }
-}
diff --git a/luni/src/main/java/java/lang/reflect/UndeclaredThrowableException.java b/luni/src/main/java/java/lang/reflect/UndeclaredThrowableException.java
index 4b545bb..25eed16 100644
--- a/luni/src/main/java/java/lang/reflect/UndeclaredThrowableException.java
+++ b/luni/src/main/java/java/lang/reflect/UndeclaredThrowableException.java
@@ -37,7 +37,6 @@
      *            the undeclared, checked exception that occurred
      */
     public UndeclaredThrowableException(Throwable exception) {
-        super();
         this.undeclaredThrowable = exception;
         initCause(exception);
     }
diff --git a/luni/src/main/java/java/math/BigDecimal.java b/luni/src/main/java/java/math/BigDecimal.java
index dd3fb84..3a5f3cd 100644
--- a/luni/src/main/java/java/math/BigDecimal.java
+++ b/luni/src/main/java/java/math/BigDecimal.java
@@ -41,21 +41,6 @@
 public class BigDecimal extends Number implements Comparable<BigDecimal>, Serializable {
 
     /**
-     * The constant zero as a {@code BigDecimal}.
-     */
-    public static final BigDecimal ZERO = new BigDecimal(0, 0);
-
-    /**
-     * The constant one as a {@code BigDecimal}.
-     */
-    public static final BigDecimal ONE = new BigDecimal(1, 0);
-
-    /**
-     * The constant ten as a {@code BigDecimal}.
-     */
-    public static final BigDecimal TEN = new BigDecimal(10, 0);
-
-    /**
      * Rounding mode where positive values are rounded towards positive infinity
      * and negative values towards negative infinity.
      *
@@ -137,13 +122,13 @@
      * An array with powers of five that fit in the type <code>long</code>
      * (<code>5^0,5^1,...,5^27</code>).
      */
-    private static final BigInteger FIVE_POW[];
+    private static final BigInteger[] FIVE_POW;
 
     /**
      * An array with powers of ten that fit in the type <code>long</code>
      * (<code>10^0,10^1,...,10^18</code>).
      */
-    private static final BigInteger TEN_POW[];
+    private static final BigInteger[] TEN_POW;
 
     private static final long[] LONG_FIVE_POW = new long[]
     {   1L,
@@ -184,35 +169,29 @@
      * An array with the first <code>BigInteger</code> scaled by zero.
      * (<code>[0,0],[1,0],...,[10,0]</code>).
      */
-    private static final BigDecimal BI_SCALED_BY_ZERO[] = new BigDecimal[BI_SCALED_BY_ZERO_LENGTH];
+    private static final BigDecimal[] BI_SCALED_BY_ZERO = new BigDecimal[BI_SCALED_BY_ZERO_LENGTH];
 
     /**
      * An array with the zero number scaled by the first positive scales.
      * (<code>0*10^0, 0*10^1, ..., 0*10^10</code>).
      */
-    private static final BigDecimal ZERO_SCALED_BY[] = new BigDecimal[11];
+    private static final BigDecimal[] ZERO_SCALED_BY = new BigDecimal[11];
 
     /** An array filled with characters <code>'0'</code>. */
     private static final char[] CH_ZEROS = new char[100];
 
     static {
-        // To fill all static arrays.
-        int i = 0;
+        Arrays.fill(CH_ZEROS, '0');
 
-        for (; i < ZERO_SCALED_BY.length; i++) {
+        for (int i = 0; i < ZERO_SCALED_BY.length; ++i) {
             BI_SCALED_BY_ZERO[i] = new BigDecimal(i, 0);
             ZERO_SCALED_BY[i] = new BigDecimal(0, i);
-            CH_ZEROS[i] = '0';
         }
-
-        for (; i < CH_ZEROS.length; i++) {
-            CH_ZEROS[i] = '0';
+        for (int i = 0; i < LONG_FIVE_POW_BIT_LENGTH.length; ++i) {
+            LONG_FIVE_POW_BIT_LENGTH[i] = bitLength(LONG_FIVE_POW[i]);
         }
-        for(int j=0; j<LONG_FIVE_POW_BIT_LENGTH.length; j++) {
-            LONG_FIVE_POW_BIT_LENGTH[j] = bitLength(LONG_FIVE_POW[j]);
-        }
-        for(int j=0; j<LONG_POWERS_OF_TEN_BIT_LENGTH.length; j++) {
-            LONG_POWERS_OF_TEN_BIT_LENGTH[j] = bitLength(MathUtils.LONG_POWERS_OF_TEN[j]);
+        for (int i = 0; i < LONG_POWERS_OF_TEN_BIT_LENGTH.length; ++i) {
+            LONG_POWERS_OF_TEN_BIT_LENGTH[i] = bitLength(MathUtils.LONG_POWERS_OF_TEN[i]);
         }
 
         // Taking the references of useful powers.
@@ -221,6 +200,21 @@
     }
 
     /**
+     * The constant zero as a {@code BigDecimal}.
+     */
+    public static final BigDecimal ZERO = new BigDecimal(0, 0);
+
+    /**
+     * The constant one as a {@code BigDecimal}.
+     */
+    public static final BigDecimal ONE = new BigDecimal(1, 0);
+
+    /**
+     * The constant ten as a {@code BigDecimal}.
+     */
+    public static final BigDecimal TEN = new BigDecimal(10, 0);
+
+    /**
      * The arbitrary precision integer (unscaled value) in the internal
      * representation of {@code BigDecimal}.
      */
@@ -514,12 +508,10 @@
             if(bitLength < 64) {
                 smallValue = mantissa << (-scale);
             } else {
-                // BEGIN android-changed
                 BigInt bi = new BigInt();
                 bi.putLongInt(mantissa);
                 bi.shift(-scale);
                 intVal = new BigInteger(bi);
-                // END android-changed
             }
             scale = 0;
         } else if (scale > 0) {
@@ -809,7 +801,6 @@
     }
 
     private static BigDecimal addAndMult10(BigDecimal thisValue,BigDecimal augend, int diffScale) {
-        // BEGIN android-changed
         if(diffScale < MathUtils.LONG_POWERS_OF_TEN.length &&
                 Math.max(thisValue.bitLength,augend.bitLength+LONG_POWERS_OF_TEN_BIT_LENGTH[diffScale])+1<64) {
             return valueOf(thisValue.smallValue+augend.smallValue*MathUtils.LONG_POWERS_OF_TEN[diffScale],thisValue.scale);
@@ -818,7 +809,6 @@
             bi.add(thisValue.getUnscaledValue().getBigInt());
             return new BigDecimal(new BigInteger(bi), thisValue.scale);
         }
-        // END android-changed
     }
 
     /**
@@ -1742,11 +1732,9 @@
      * @return {@code abs(this)}
      */
     public BigDecimal abs(MathContext mc) {
-        // BEGIN android-changed
         BigDecimal result = abs();
         result.inplaceRound(mc);
         return result;
-        // END android-changed
     }
 
     /**
@@ -1771,11 +1759,9 @@
      * @return {@code -this}
      */
     public BigDecimal negate(MathContext mc) {
-        // BEGIN android-changed
         BigDecimal result = negate();
         result.inplaceRound(mc);
         return result;
-        // END android-changed
     }
 
     /**
@@ -2100,10 +2086,9 @@
         long newScale = scale;
 
         if (isZero()) {
-            // BEGIN android-changed: preserve RI compatibility, so BigDecimal.equals (which checks
+            // Preserve RI compatibility, so BigDecimal.equals (which checks
             // value *and* scale) continues to work.
             return this;
-            // END android-changed
         }
         BigInteger strippedBI = getUnscaledValue();
         BigInteger[] quotAndRem;
@@ -2751,11 +2736,9 @@
      */
     private void inplaceRound(MathContext mc) {
         int mcPrecision = mc.getPrecision();
-        // BEGIN android-changed
         if (approxPrecision() < mcPrecision || mcPrecision == 0) {
             return;
         }
-        // END android-changed
         int discardedPrecision = precision() - mcPrecision;
         // If no rounding is necessary it returns immediately
         if ((discardedPrecision <= 0)) {
@@ -2925,11 +2908,9 @@
      * @return an approximation of {@code precision()} value
      */
     private int approxPrecision() {
-        // BEGIN android-changed
         return precision > 0
                 ? precision
                 : (int) ((this.bitLength - 1) * LOG10_2) + 1;
-        // END android-changed
     }
 
     private static int safeLongToInt(long longValue) {
diff --git a/luni/src/main/java/java/math/BigInteger.java b/luni/src/main/java/java/math/BigInteger.java
index e75c8f2..cd56afa 100644
--- a/luni/src/main/java/java/math/BigInteger.java
+++ b/luni/src/main/java/java/math/BigInteger.java
@@ -15,12 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// Since the original Harmony Code of the BigInteger class was strongly modified,
-// in order to use the more efficient OpenSSL BIGNUM implementation,
-// no android-modification-tags were placed, at all.
-// END android-note
-
 package java.math;
 
 import java.io.IOException;
diff --git a/luni/src/main/java/java/math/MathContext.java b/luni/src/main/java/java/math/MathContext.java
index 1231bc6..24ccb29 100644
--- a/luni/src/main/java/java/math/MathContext.java
+++ b/luni/src/main/java/java/math/MathContext.java
@@ -27,74 +27,46 @@
  * precision for the numerical operations provided by class {@link BigDecimal}.
  */
 public final class MathContext implements Serializable {
+    private static final long serialVersionUID = 5579720004786848255L;
 
     /**
      * A {@code MathContext} which corresponds to the IEEE 754r quadruple
      * decimal precision format: 34 digit precision and
      * {@link RoundingMode#HALF_EVEN} rounding.
      */
-    public static final MathContext DECIMAL128 = new MathContext(34,
-            RoundingMode.HALF_EVEN);
+    public static final MathContext DECIMAL128 = new MathContext(34, RoundingMode.HALF_EVEN);
 
     /**
      * A {@code MathContext} which corresponds to the IEEE 754r single decimal
      * precision format: 7 digit precision and {@link RoundingMode#HALF_EVEN}
      * rounding.
      */
-    public static final MathContext DECIMAL32 = new MathContext(7,
-            RoundingMode.HALF_EVEN);
+    public static final MathContext DECIMAL32 = new MathContext(7, RoundingMode.HALF_EVEN);
 
     /**
      * A {@code MathContext} which corresponds to the IEEE 754r double decimal
      * precision format: 16 digit precision and {@link RoundingMode#HALF_EVEN}
      * rounding.
      */
-    public static final MathContext DECIMAL64 = new MathContext(16,
-            RoundingMode.HALF_EVEN);
+    public static final MathContext DECIMAL64 = new MathContext(16, RoundingMode.HALF_EVEN);
 
     /**
      * A {@code MathContext} for unlimited precision with
      * {@link RoundingMode#HALF_UP} rounding.
      */
-    public static final MathContext UNLIMITED = new MathContext(0,
-            RoundingMode.HALF_UP);
-
-    /** This is the serialVersionUID used by the sun implementation */
-    private static final long serialVersionUID = 5579720004786848255L;
+    public static final MathContext UNLIMITED = new MathContext(0, RoundingMode.HALF_UP);
 
     /**
      * The number of digits to be used for an operation; results are rounded to
      * this precision.
      */
-    private int precision;
+    private final int precision;
 
     /**
      * A {@code RoundingMode} object which specifies the algorithm to be used
      * for rounding.
      */
-    private RoundingMode roundingMode;
-
-    /**
-     * An array of {@code char} containing: {@code
-     * 'p','r','e','c','i','s','i','o','n','='}. It's used to improve the
-     * methods related to {@code String} conversion.
-     *
-     * @see #MathContext(String)
-     * @see #toString()
-     */
-    private final static char[] chPrecision = { 'p', 'r', 'e', 'c', 'i', 's',
-            'i', 'o', 'n', '=' };
-
-    /**
-     * An array of {@code char} containing: {@code
-     * 'r','o','u','n','d','i','n','g','M','o','d','e','='}. It's used to
-     * improve the methods related to {@code String} conversion.
-     *
-     * @see #MathContext(String)
-     * @see #toString()
-     */
-    private final static char[] chRoundingMode = { 'r', 'o', 'u', 'n', 'd',
-            'i', 'n', 'g', 'M', 'o', 'd', 'e', '=' };
+    private final RoundingMode roundingMode;
 
     /**
      * Constructs a new {@code MathContext} with the specified precision and
@@ -127,14 +99,9 @@
      *             if {@code roundingMode} is {@code null}.
      */
     public MathContext(int precision, RoundingMode roundingMode) {
-        if (precision < 0) {
-            throw new IllegalArgumentException("precision < 0");
-        }
-        if (roundingMode == null) {
-            throw new NullPointerException("roundingMode == null");
-        }
         this.precision = precision;
         this.roundingMode = roundingMode;
+        checkValid();
     }
 
     /**
@@ -144,73 +111,47 @@
      * This is the same form as the one returned by the {@link #toString}
      * method.
      *
-     * @param val
-     *            a string describing the precision and rounding mode for the
-     *            new {@code MathContext}.
      * @throws IllegalArgumentException
      *             if the string is not in the correct format or if the
      *             precision specified is < 0.
      */
-    public MathContext(String val) {
-        char[] charVal = val.toCharArray();
-        int i; // Index of charVal
-        int j; // Index of chRoundingMode
-        int digit; // It will contain the digit parsed
+    public MathContext(String s) {
+        int precisionLength = "precision=".length();
+        int roundingModeLength = "roundingMode=".length();
 
-        if ((charVal.length < 27) || (charVal.length > 45)) {
-            throw new IllegalArgumentException("Bad string format");
+        int spaceIndex;
+        if (!s.startsWith("precision=") || (spaceIndex = s.indexOf(' ', precisionLength)) == -1) {
+            throw invalidMathContext("Missing precision", s);
         }
-        // Parsing "precision=" String
-        for (i = 0; (i < chPrecision.length) && (charVal[i] == chPrecision[i]); i++) {
-            ;
+        String precisionString = s.substring(precisionLength, spaceIndex);
+        try {
+            this.precision = Integer.parseInt(precisionString);
+        } catch (NumberFormatException nfe) {
+            throw invalidMathContext("Bad precision", s);
         }
 
-        if (i < chPrecision.length) {
-            throw new IllegalArgumentException("Bad string format");
+        int roundingModeStart = spaceIndex + 1;
+        if (!s.regionMatches(roundingModeStart, "roundingMode=", 0, roundingModeLength)) {
+            throw invalidMathContext("Missing rounding mode", s);
         }
-        // Parsing the value for "precision="...
-        digit = Character.digit(charVal[i], 10);
-        if (digit == -1) {
-            throw new IllegalArgumentException("Bad string format");
-        }
-        // BEGIN android-changed
-        this.precision = digit;
-        // END android-changed
-        i++;
+        roundingModeStart += roundingModeLength;
+        this.roundingMode = RoundingMode.valueOf(s.substring(roundingModeStart));
 
-        do {
-            digit = Character.digit(charVal[i], 10);
-            if (digit == -1) {
-                if (charVal[i] == ' ') {
-                    // It parsed all the digits
-                    i++;
-                    break;
-                }
-                // It isn't  a valid digit, and isn't a white space
-                throw new IllegalArgumentException("Bad string format");
-            }
-            // Accumulating the value parsed
-            this.precision = this.precision * 10 + digit;
-            if (this.precision < 0) {
-                throw new IllegalArgumentException("Bad string format");
-            }
-            i++;
-        } while (true);
-        // Parsing "roundingMode="
-        for (j = 0; (j < chRoundingMode.length)
-                && (charVal[i] == chRoundingMode[j]); i++, j++) {
-            ;
-        }
-
-        if (j < chRoundingMode.length) {
-            throw new IllegalArgumentException("Bad string format");
-        }
-        // Parsing the value for "roundingMode"...
-        this.roundingMode = RoundingMode.valueOf(String.valueOf(charVal, i,
-                charVal.length - i));
+        checkValid();
     }
 
-    /* Public Methods */
+    private IllegalArgumentException invalidMathContext(String reason, String s) {
+        throw new IllegalArgumentException(reason + ": " + s);
+    }
+
+    private void checkValid() {
+        if (precision < 0) {
+            throw new IllegalArgumentException("Negative precision: " + precision);
+        }
+        if (roundingMode == null) {
+            throw new NullPointerException("roundingMode == null");
+        }
+    }
 
     /**
      * Returns the precision. The precision is the number of digits used for an
@@ -299,12 +240,10 @@
      */
     private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException {
         s.defaultReadObject();
-        if (precision < 0) {
-            throw new StreamCorruptedException("precision < 0");
-        }
-        if (roundingMode == null) {
-            throw new StreamCorruptedException("roundingMode == null");
+        try {
+            checkValid();
+        } catch (Exception ex) {
+            throw new StreamCorruptedException(ex.getMessage());
         }
     }
-
 }
diff --git a/luni/src/main/java/java/math/Multiplication.java b/luni/src/main/java/java/math/Multiplication.java
index babca06..98cabee 100644
--- a/luni/src/main/java/java/math/Multiplication.java
+++ b/luni/src/main/java/java/math/Multiplication.java
@@ -79,8 +79,7 @@
         }
     }
 
-    // BEGIN android-note
-    // The method multiply has been removed in favor of using OpenSSL BIGNUM
+    // BEGIN android-note: multiply has been removed in favor of using OpenSSL BIGNUM
     // END android-note
 
     /**
diff --git a/luni/src/main/java/java/math/NativeBN.java b/luni/src/main/java/java/math/NativeBN.java
index 1fc228b..95bb2a2 100644
--- a/luni/src/main/java/java/math/NativeBN.java
+++ b/luni/src/main/java/java/math/NativeBN.java
@@ -162,10 +162,4 @@
     public static native boolean BN_is_prime_ex(int p, int nchecks, int cb);
     // int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb);
 
-    // OPTIONAL:
-    // int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx,
-    //         int do_trial_division, BN_GENCB *cb);
-
-// RAND_add(rnd);
-
 }
diff --git a/luni/src/main/java/java/math/Primality.java b/luni/src/main/java/java/math/Primality.java
index fa7e67a..eacc893 100644
--- a/luni/src/main/java/java/math/Primality.java
+++ b/luni/src/main/java/java/math/Primality.java
@@ -15,12 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// Since the original Harmony Code of the BigInteger class was strongly modified,
-// in order to use the more efficient OpenSSL BIGNUM implementation,
-// no android-modification-tags were placed, at all.
-// END android-note
-
 package java.math;
 
 import java.util.Arrays;
diff --git a/luni/src/main/java/java/net/AddressCache.java b/luni/src/main/java/java/net/AddressCache.java
index 7117aba..08f5d81 100644
--- a/luni/src/main/java/java/net/AddressCache.java
+++ b/luni/src/main/java/java/net/AddressCache.java
@@ -16,9 +16,7 @@
 
 package java.net;
 
-import java.security.AccessController;
 import libcore.util.BasicLruCache;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * Implements caching for {@code InetAddress}. We use a unified cache for both positive and negative
@@ -106,15 +104,7 @@
         // Calculate the expiry time.
         String propertyName = isPositive ? "networkaddress.cache.ttl" : "networkaddress.cache.negative.ttl";
         long defaultTtlNanos = isPositive ? DEFAULT_POSITIVE_TTL_NANOS : DEFAULT_NEGATIVE_TTL_NANOS;
-        // Fast-path the default case...
         long expiryNanos = System.nanoTime() + defaultTtlNanos;
-        if (System.getSecurityManager() != null || System.getProperty(propertyName, null) != null) {
-            // ...and let those using a SecurityManager or custom properties pay full price.
-            expiryNanos = customTtl(propertyName, defaultTtlNanos);
-            if (expiryNanos == Long.MIN_VALUE) {
-                return;
-            }
-        }
         // Update the cache.
         cache.put(hostname, new AddressCacheEntry(value, expiryNanos));
     }
@@ -128,7 +118,7 @@
     }
 
     private long customTtl(String propertyName, long defaultTtlNanos) {
-        String ttlString = AccessController.doPrivileged(new PriviAction<String>(propertyName, null));
+        String ttlString = System.getProperty(propertyName, null);
         if (ttlString == null) {
             return System.nanoTime() + defaultTtlNanos;
         }
diff --git a/luni/src/main/java/java/net/Authenticator.java b/luni/src/main/java/java/net/Authenticator.java
index 3b5fd8c..fc66c89 100644
--- a/luni/src/main/java/java/net/Authenticator.java
+++ b/luni/src/main/java/java/net/Authenticator.java
@@ -118,8 +118,7 @@
     }
 
     /**
-     * If the permission check of the security manager does not result in a
-     * security exception, this method invokes the methods of the registered
+     * Invokes the methods of the registered
      * authenticator to get the authentication info.
      *
      * @return password authentication info or {@code null} if no authenticator
@@ -134,17 +133,10 @@
      *            realm of the connection that requests authentication.
      * @param rScheme
      *            scheme of the connection that requests authentication.
-     * @throws SecurityException
-     *             if a security manager denies the password authentication
-     *             permission.
      */
     public static synchronized PasswordAuthentication requestPasswordAuthentication(
             InetAddress rAddr, int rPort, String rProtocol, String rPrompt,
             String rScheme) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(requestPasswordAuthenticationPermission);
-        }
         if (thisAuthenticator == null) {
             return null;
         }
@@ -164,27 +156,17 @@
 
     /**
      * Sets {@code a} as the default authenticator. It will be called whenever
-     * the realm that the URL is pointing to requires authorization. If there is
-     * a security manager set then the caller must have the appropriate {@code
-     * NetPermission}.
+     * the realm that the URL is pointing to requires authorization.
      *
      * @param a
      *            authenticator which has to be set as default.
-     * @throws SecurityException
-     *             if a security manager denies the password authentication
-     *             permission.
      */
     public static void setDefault(Authenticator a) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(setDefaultAuthenticatorPermission);
-        }
         thisAuthenticator = a;
     }
 
     /**
-     * If the permission check of the security manager does not result in a
-     * security exception, this method invokes the methods of the registered
+     * Invokes the methods of the registered
      * authenticator to get the authentication info.
      *
      * @return password authentication info or {@code null} if no authenticator
@@ -201,17 +183,10 @@
      *            realm of the connection that requests authentication.
      * @param rScheme
      *            scheme of the connection that requests authentication.
-     * @throws SecurityException
-     *             if a security manager denies the password authentication
-     *             permission.
      */
     public static synchronized PasswordAuthentication requestPasswordAuthentication(
             String rHost, InetAddress rAddr, int rPort, String rProtocol,
             String rPrompt, String rScheme) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(requestPasswordAuthenticationPermission);
-        }
         if (thisAuthenticator == null) {
             return null;
         }
@@ -241,8 +216,7 @@
     }
 
     /**
-     * If the permission check of the security manager does not result in a
-     * security exception, this method invokes the methods of the registered
+     * Invokes the methods of the registered
      * authenticator to get the authentication info.
      *
      * @return password authentication info or {@code null} if no authenticator
@@ -263,18 +237,11 @@
      *            url of the connection that requests authentication.
      * @param reqType
      *            requestor type of the connection that requests authentication.
-     * @throws SecurityException
-     *             if a security manager denies the password authentication
-     *             permission.
      */
     public static PasswordAuthentication requestPasswordAuthentication(
             String rHost, InetAddress rAddr, int rPort, String rProtocol,
             String rPrompt, String rScheme, URL rURL,
             Authenticator.RequestorType reqType) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(requestPasswordAuthenticationPermission);
-        }
         if (thisAuthenticator == null) {
             return null;
         }
diff --git a/luni/src/main/java/java/net/BindException.java b/luni/src/main/java/java/net/BindException.java
index 8a84914..3c5151a 100644
--- a/luni/src/main/java/java/net/BindException.java
+++ b/luni/src/main/java/java/net/BindException.java
@@ -29,7 +29,6 @@
      * Constructs a new instance with its walkback filled in.
      */
     public BindException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/CacheRequest.java b/luni/src/main/java/java/net/CacheRequest.java
index e7a7815..9a663dd 100644
--- a/luni/src/main/java/java/net/CacheRequest.java
+++ b/luni/src/main/java/java/net/CacheRequest.java
@@ -36,7 +36,6 @@
      * This implementation does nothing.
      */
     public CacheRequest() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/ConnectException.java b/luni/src/main/java/java/net/ConnectException.java
index 84cd2bb..554316f 100644
--- a/luni/src/main/java/java/net/ConnectException.java
+++ b/luni/src/main/java/java/net/ConnectException.java
@@ -29,7 +29,6 @@
      * This implementation does nothing.
      */
     public ConnectException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/CookieHandler.java b/luni/src/main/java/java/net/CookieHandler.java
index 918c34a..8063ace 100644
--- a/luni/src/main/java/java/net/CookieHandler.java
+++ b/luni/src/main/java/java/net/CookieHandler.java
@@ -27,36 +27,17 @@
 
     private static CookieHandler systemWideCookieHandler;
 
-    private final static NetPermission getCookieHandlerPermission = new NetPermission(
-            "getCookieHandler");
-
-    private final static NetPermission setCookieHandlerPermission = new NetPermission(
-            "setCookieHandler");
-
     /**
      * Returns the system-wide cookie handler or {@code null} if not set.
-     *
-     * @return the system-wide cookie handler.
      */
     public static CookieHandler getDefault() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(getCookieHandlerPermission);
-        }
         return systemWideCookieHandler;
     }
 
     /**
      * Sets the system-wide cookie handler.
-     *
-     * @param cHandler
-     *            a cookie handler to set as the system-wide default handler.
      */
     public static void setDefault(CookieHandler cHandler) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(setCookieHandlerPermission);
-        }
         systemWideCookieHandler = cHandler;
     }
 
diff --git a/luni/src/main/java/java/net/DatagramPacket.java b/luni/src/main/java/java/net/DatagramPacket.java
index 8e7d6fa..663585c 100644
--- a/luni/src/main/java/java/net/DatagramPacket.java
+++ b/luni/src/main/java/java/net/DatagramPacket.java
@@ -72,7 +72,6 @@
      *            the length of the data.
      */
     public DatagramPacket(byte[] data, int offset, int length) {
-        super();
         setData(data, offset, length);
     }
 
diff --git a/luni/src/main/java/java/net/DatagramSocket.java b/luni/src/main/java/java/net/DatagramSocket.java
index 5237e49..9c38cf8 100644
--- a/luni/src/main/java/java/net/DatagramSocket.java
+++ b/luni/src/main/java/java/net/DatagramSocket.java
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 import java.nio.channels.DatagramChannel;
-import org.apache.harmony.luni.net.PlainDatagramSocketImpl;
 
 /**
  * This class implements a UDP socket for sending and receiving {@code
@@ -69,8 +68,7 @@
      *             if an error occurs while creating or binding the socket.
      */
     public DatagramSocket(int aPort) throws SocketException {
-        super();
-        checkListen(aPort);
+        checkPort(aPort);
         createSocket(aPort, Inet4Address.ANY);
     }
 
@@ -87,27 +85,14 @@
      *             if an error occurs while creating or binding the socket.
      */
     public DatagramSocket(int aPort, InetAddress addr) throws SocketException {
-        super();
-        checkListen(aPort);
+        checkPort(aPort);
         createSocket(aPort, (addr == null) ? Inet4Address.ANY : addr);
     }
 
-    /**
-     * Sends prior to attempting to bind the socket, checks whether the port is
-     * within the valid port range and verifies with the security manager that
-     * the port may be bound by the current context.
-     *
-     * @param aPort
-     *            the port on the localhost that is to be bound.
-     */
-    void checkListen(int aPort) {
+    private void checkPort(int aPort) {
         if (aPort < 0 || aPort > 65535) {
             throw new IllegalArgumentException("Port out of range: " + aPort);
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkListen(aPort);
-        }
     }
 
     /**
@@ -147,15 +132,6 @@
                 // Ignored
             }
 
-            SecurityManager security = System.getSecurityManager();
-            if (security != null) {
-                if (anAddress.isMulticastAddress()) {
-                    security.checkMulticast(anAddress);
-                } else {
-                    security.checkConnect(anAddress.getHostName(), aPort);
-                }
-            }
-
             try {
                 impl.connect(anAddress, aPort);
             } catch (SocketException e) {
@@ -220,16 +196,7 @@
         if (!isBound()) {
             return Inet4Address.ANY;
         }
-        InetAddress anAddr = impl.getLocalAddress();
-        try {
-            SecurityManager security = System.getSecurityManager();
-            if (security != null) {
-                security.checkConnect(anAddr.getHostName(), -1);
-            }
-        } catch (SecurityException e) {
-            return Inet4Address.ANY;
-        }
-        return anAddr;
+        return impl.getLocalAddress();
     }
 
     /**
@@ -299,9 +266,7 @@
      * pack}. All fields of {@code pack} must be set according to the data
      * received. If the received data is longer than the packet buffer size it
      * is truncated. This method blocks until a packet is received or a timeout
-     * has expired. If a security manager exists, its {@code checkAccept} method
-     * determines whether or not a packet is discarded. Any packets from
-     * unacceptable origins are silently discarded.
+     * has expired.
      *
      * @param pack
      *            the {@code DatagramPacket} to store the received data.
@@ -318,11 +283,8 @@
         // means that we have received the packet into the temporary buffer
         boolean copy = false;
 
-        SecurityManager security = System.getSecurityManager();
-
-        if (address != null || security != null) {
-            // The socket is connected or we need to check security permissions
-
+        if (address != null) {
+            // The socket is connected.
             // Check pack before peeking
             if (pack == null) {
                 throw new NullPointerException();
@@ -353,21 +315,7 @@
                     }
                 }
 
-                if (address == null) {
-                    // if we are not connected let's check if we are allowed to
-                    // receive packets from sender's address and port
-                    try {
-                        security.checkAccept(senderAddr.getHostName(),
-                                senderPort);
-                        // address & port are valid
-                        break;
-                    } catch (SecurityException e) {
-                        if (!copy) {
-                            // drop this packet and continue
-                            impl.receive(tempPack);
-                        }
-                    }
-                } else if (port == senderPort && address.equals(senderAddr)) {
+                if (port == senderPort && address.equals(senderAddr)) {
                     // we are connected and the packet came
                     // from the address & port we are connected to
                     break;
@@ -379,8 +327,8 @@
         }
 
         if (copy) {
-            System.arraycopy(tempPack.getData(), 0, pack.getData(), pack
-                    .getOffset(), tempPack.getLength());
+            System.arraycopy(tempPack.getData(), 0, pack.getData(), pack.getOffset(),
+                    tempPack.getLength());
             // we shouldn't update the pack's capacity field in order to be
             // compatible with RI
             pack.setLengthOnly(tempPack.getLength());
@@ -395,10 +343,7 @@
     }
 
     /**
-     * Sends a packet over this socket. The packet must satisfy the security
-     * policy before it may be sent. If a security manager is installed, this
-     * method checks whether it is allowed to send this packet to the specified
-     * address.
+     * Sends a packet over this socket.
      *
      * @param pack
      *            the {@code DatagramPacket} which has to be sent.
@@ -423,14 +368,6 @@
             if (packAddr == null) {
                 throw new NullPointerException("Destination address is null");
             }
-            SecurityManager security = System.getSecurityManager();
-            if (security != null) {
-                if (packAddr.isMulticastAddress()) {
-                    security.checkMulticast(packAddr);
-                } else {
-                    security.checkConnect(packAddr.getHostName(), pack.getPort());
-                }
-            }
         }
         impl.send(pack);
     }
@@ -497,10 +434,7 @@
     /**
      * Sets the socket implementation factory. This may only be invoked once
      * over the lifetime of the application. This factory is used to create
-     * a new datagram socket implementation. If a security manager is set its
-     * method {@code checkSetFactory()} is called to check if the operation is
-     * allowed. A {@code SecurityException} is thrown if the operation is not
-     * allowed.
+     * a new datagram socket implementation.
      *
      * @param fac
      *            the socket factory to use.
@@ -508,12 +442,8 @@
      *                if the factory has already been set.
      * @see DatagramSocketImplFactory
      */
-    public static synchronized void setDatagramSocketImplFactory(
-            DatagramSocketImplFactory fac) throws IOException {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkSetFactory();
-        }
+    public static synchronized void setDatagramSocketImplFactory(DatagramSocketImplFactory fac)
+            throws IOException {
         if (factory != null) {
             throw new SocketException("Factory already set");
         }
@@ -553,7 +483,7 @@
                 throw new IllegalArgumentException("Local address not an InetSocketAddress: " +
                         localAddr.getClass());
             }
-            checkListen(((InetSocketAddress) localAddr).getPort());
+            checkPort(((InetSocketAddress) localAddr).getPort());
         }
         impl = factory != null ? factory.createDatagramSocketImpl()
                 : new PlainDatagramSocketImpl();
@@ -575,7 +505,6 @@
             throw new SocketException("Socket is closed");
         }
         if (bind && !isBound()) {
-            checkListen(0);
             impl.bind(0, Inet4Address.ANY);
             isBound = true;
         }
@@ -609,7 +538,7 @@
                 throw new SocketException("Host is unresolved: " + inetAddr.getHostName());
             }
             localPort = inetAddr.getPort();
-            checkListen(localPort);
+            checkPort(localPort);
         }
         impl.bind(localPort, addr);
         isBound = true;
@@ -645,16 +574,6 @@
             // make sure the socket is open
             checkClosedAndBind(true);
 
-            SecurityManager security = System.getSecurityManager();
-            if (security != null) {
-                if (inetAddr.getAddress().isMulticastAddress()) {
-                    security.checkMulticast(inetAddr.getAddress());
-                } else {
-                    security.checkConnect(inetAddr.getAddress().getHostName(),
-                            inetAddr.getPort());
-                }
-            }
-
             // now try to do the connection at the native level. To be
             // compatible for the case when the address is inaddr_any we just
             // eat the exception an act as if we are connected at the java level
diff --git a/luni/src/main/java/java/net/DatagramSocketImpl.java b/luni/src/main/java/java/net/DatagramSocketImpl.java
index e92cb72..4485b18 100644
--- a/luni/src/main/java/java/net/DatagramSocketImpl.java
+++ b/luni/src/main/java/java/net/DatagramSocketImpl.java
@@ -19,7 +19,7 @@
 
 import java.io.FileDescriptor;
 import java.io.IOException;
-import org.apache.harmony.luni.platform.Platform;
+import libcore.io.IoUtils;
 
 /**
  * The abstract superclass for datagram and multicast socket implementations.
@@ -82,18 +82,14 @@
     }
 
     /**
-     * Gets the local address to which the socket is bound.
-     *
-     * @return the local address to which the socket is bound.
+     * Returns the local address to which the socket is bound.
      */
     InetAddress getLocalAddress() {
-        return Platform.NETWORK.getSocketLocalAddress(fd);
+        return IoUtils.getSocketLocalAddress(fd);
     }
 
     /**
-     * Gets the local port of this socket.
-     *
-     * @return the local port to which this socket is bound.
+     * Returns the local port to which this socket is bound.
      */
     protected int getLocalPort() {
         return localPort;
diff --git a/luni/src/main/java/java/net/DefaultFileNameMap.java b/luni/src/main/java/java/net/DefaultFileNameMap.java
index a502a88..2f254d9 100644
--- a/luni/src/main/java/java/net/DefaultFileNameMap.java
+++ b/luni/src/main/java/java/net/DefaultFileNameMap.java
@@ -16,6 +16,7 @@
 
 package java.net;
 
+import java.util.Locale;
 import libcore.net.MimeUtils;
 
 /**
@@ -36,6 +37,6 @@
         if (firstCharInExtension > filename.lastIndexOf('/')) {
             ext = filename.substring(firstCharInExtension, lastCharInExtension);
         }
-        return MimeUtils.guessMimeTypeFromExtension(ext.toLowerCase());
+        return MimeUtils.guessMimeTypeFromExtension(ext.toLowerCase(Locale.US));
     }
 }
diff --git a/luni/src/main/java/java/net/HttpURLConnection.java b/luni/src/main/java/java/net/HttpURLConnection.java
index 8e33d51..a717ae2 100644
--- a/luni/src/main/java/java/net/HttpURLConnection.java
+++ b/luni/src/main/java/java/net/HttpURLConnection.java
@@ -19,7 +19,8 @@
 
 import java.io.IOException;
 import java.io.InputStream;
-import org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl;
+import java.util.Arrays;
+import libcore.net.http.HttpURLConnectionImpl;
 
 /**
  * An {@link URLConnection} for HTTP (<a
@@ -47,7 +48,8 @@
  *       empty stream.
  *   <li>Disconnect. Once the response body has been read, the {@code
  *       HttpURLConnection} should be closed by calling {@link #disconnect()}.
- *       Disconnecting frees all resources held by a connection.
+ *       Disconnecting releases the resources held by a connection so they may
+ *       be closed or reused.
  * </ol>
  *
  * <p>For example, to retrieve the webpage at {@code http://www.android.com/}:
@@ -121,8 +123,8 @@
  *
  * <p>To reduce latency, this class may reuse the same underlying {@code Socket}
  * for multiple request/response pairs. As a result, HTTP connections may be
- * held open longer than necessary. Calls to {@link #disconnect()} return the
- * socket to a pool of connected sockets. This behavior can be disabled by
+ * held open longer than necessary. Calls to {@link #disconnect()} may return
+ * the socket to a pool of connected sockets. This behavior can be disabled by
  * setting the "http.keepAlive" system property to "false" before issuing any
  * HTTP requests. The "http.maxConnections" property may be used to control how
  * many idle connections to each server will be held.
@@ -293,152 +295,152 @@
     /**
      * Numeric status code, 202: Accepted
      */
-    public final static int HTTP_ACCEPTED = 202;
+    public static final int HTTP_ACCEPTED = 202;
 
     /**
      * Numeric status code, 502: Bad Gateway
      */
-    public final static int HTTP_BAD_GATEWAY = 502;
+    public static final int HTTP_BAD_GATEWAY = 502;
 
     /**
      * Numeric status code, 405: Bad Method
      */
-    public final static int HTTP_BAD_METHOD = 405;
+    public static final int HTTP_BAD_METHOD = 405;
 
     /**
      * Numeric status code, 400: Bad Request
      */
-    public final static int HTTP_BAD_REQUEST = 400;
+    public static final int HTTP_BAD_REQUEST = 400;
 
     /**
      * Numeric status code, 408: Client Timeout
      */
-    public final static int HTTP_CLIENT_TIMEOUT = 408;
+    public static final int HTTP_CLIENT_TIMEOUT = 408;
 
     /**
      * Numeric status code, 409: Conflict
      */
-    public final static int HTTP_CONFLICT = 409;
+    public static final int HTTP_CONFLICT = 409;
 
     /**
      * Numeric status code, 201: Created
      */
-    public final static int HTTP_CREATED = 201;
+    public static final int HTTP_CREATED = 201;
 
     /**
      * Numeric status code, 413: Entity too large
      */
-    public final static int HTTP_ENTITY_TOO_LARGE = 413;
+    public static final int HTTP_ENTITY_TOO_LARGE = 413;
 
     /**
      * Numeric status code, 403: Forbidden
      */
-    public final static int HTTP_FORBIDDEN = 403;
+    public static final int HTTP_FORBIDDEN = 403;
 
     /**
      * Numeric status code, 504: Gateway timeout
      */
-    public final static int HTTP_GATEWAY_TIMEOUT = 504;
+    public static final int HTTP_GATEWAY_TIMEOUT = 504;
 
     /**
      * Numeric status code, 410: Gone
      */
-    public final static int HTTP_GONE = 410;
+    public static final int HTTP_GONE = 410;
 
     /**
      * Numeric status code, 500: Internal error
      */
-    public final static int HTTP_INTERNAL_ERROR = 500;
+    public static final int HTTP_INTERNAL_ERROR = 500;
 
     /**
      * Numeric status code, 411: Length required
      */
-    public final static int HTTP_LENGTH_REQUIRED = 411;
+    public static final int HTTP_LENGTH_REQUIRED = 411;
 
     /**
      * Numeric status code, 301 Moved permanently
      */
-    public final static int HTTP_MOVED_PERM = 301;
+    public static final int HTTP_MOVED_PERM = 301;
 
     /**
      * Numeric status code, 302: Moved temporarily
      */
-    public final static int HTTP_MOVED_TEMP = 302;
+    public static final int HTTP_MOVED_TEMP = 302;
 
     /**
      * Numeric status code, 300: Multiple choices
      */
-    public final static int HTTP_MULT_CHOICE = 300;
+    public static final int HTTP_MULT_CHOICE = 300;
 
     /**
      * Numeric status code, 204: No content
      */
-    public final static int HTTP_NO_CONTENT = 204;
+    public static final int HTTP_NO_CONTENT = 204;
 
     /**
      * Numeric status code, 406: Not acceptable
      */
-    public final static int HTTP_NOT_ACCEPTABLE = 406;
+    public static final int HTTP_NOT_ACCEPTABLE = 406;
 
     /**
      * Numeric status code, 203: Not authoritative
      */
-    public final static int HTTP_NOT_AUTHORITATIVE = 203;
+    public static final int HTTP_NOT_AUTHORITATIVE = 203;
 
     /**
      * Numeric status code, 404: Not found
      */
-    public final static int HTTP_NOT_FOUND = 404;
+    public static final int HTTP_NOT_FOUND = 404;
 
     /**
      * Numeric status code, 501: Not implemented
      */
-    public final static int HTTP_NOT_IMPLEMENTED = 501;
+    public static final int HTTP_NOT_IMPLEMENTED = 501;
 
     /**
      * Numeric status code, 304: Not modified
      */
-    public final static int HTTP_NOT_MODIFIED = 304;
+    public static final int HTTP_NOT_MODIFIED = 304;
 
     /**
      * Numeric status code, 200: OK
      */
-    public final static int HTTP_OK = 200;
+    public static final int HTTP_OK = 200;
 
     /**
      * Numeric status code, 206: Partial
      */
-    public final static int HTTP_PARTIAL = 206;
+    public static final int HTTP_PARTIAL = 206;
 
     /**
      * Numeric status code, 402: Payment required
      */
-    public final static int HTTP_PAYMENT_REQUIRED = 402;
+    public static final int HTTP_PAYMENT_REQUIRED = 402;
 
     /**
      * Numeric status code, 412: Precondition failed
      */
-    public final static int HTTP_PRECON_FAILED = 412;
+    public static final int HTTP_PRECON_FAILED = 412;
 
     /**
      * Numeric status code, 407: Proxy authentication required
      */
-    public final static int HTTP_PROXY_AUTH = 407;
+    public static final int HTTP_PROXY_AUTH = 407;
 
     /**
      * Numeric status code, 414: Request too long
      */
-    public final static int HTTP_REQ_TOO_LONG = 414;
+    public static final int HTTP_REQ_TOO_LONG = 414;
 
     /**
      * Numeric status code, 205: Reset
      */
-    public final static int HTTP_RESET = 205;
+    public static final int HTTP_RESET = 205;
 
     /**
      * Numeric status code, 303: See other
      */
-    public final static int HTTP_SEE_OTHER = 303;
+    public static final int HTTP_SEE_OTHER = 303;
 
     /**
      * Numeric status code, 500: Internal error
@@ -446,32 +448,32 @@
      * @deprecated Use {@link #HTTP_INTERNAL_ERROR}
      */
     @Deprecated
-    public final static int HTTP_SERVER_ERROR = 500;
+    public static final int HTTP_SERVER_ERROR = 500;
 
     /**
      * Numeric status code, 305: Use proxy
      */
-    public final static int HTTP_USE_PROXY = 305;
+    public static final int HTTP_USE_PROXY = 305;
 
     /**
      * Numeric status code, 401: Unauthorized
      */
-    public final static int HTTP_UNAUTHORIZED = 401;
+    public static final int HTTP_UNAUTHORIZED = 401;
 
     /**
      * Numeric status code, 415: Unsupported type
      */
-    public final static int HTTP_UNSUPPORTED_TYPE = 415;
+    public static final int HTTP_UNSUPPORTED_TYPE = 415;
 
     /**
      * Numeric status code, 503: Unavailable
      */
-    public final static int HTTP_UNAVAILABLE = 503;
+    public static final int HTTP_UNAVAILABLE = 503;
 
     /**
      * Numeric status code, 505: Version not supported
      */
-    public final static int HTTP_VERSION = 505;
+    public static final int HTTP_VERSION = 505;
 
     /**
      * Constructs a new {@code HttpURLConnection} instance pointing to the
@@ -601,18 +603,12 @@
 
     /**
      * Sets the flag of whether this connection will follow redirects returned
-     * by the remote server. This method can only be called with the permission
-     * from the security manager.
+     * by the remote server.
      *
      * @param auto
      *            the value to enable or disable this option.
-     * @see SecurityManager#checkSetFactory()
      */
     public static void setFollowRedirects(boolean auto) {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkSetFactory();
-        }
         followRedirects = auto;
     }
 
@@ -641,7 +637,8 @@
             }
         }
         // if none matches, then throw ProtocolException
-        throw new ProtocolException();
+        throw new ProtocolException("Unknown method '" + method + "'; must be one of " +
+                Arrays.toString(HttpURLConnectionImpl.PERMITTED_USER_METHODS));
     }
 
     /**
diff --git a/luni/src/main/java/java/net/Inet4Address.java b/luni/src/main/java/java/net/Inet4Address.java
index efe232a..727328e 100644
--- a/luni/src/main/java/java/net/Inet4Address.java
+++ b/luni/src/main/java/java/net/Inet4Address.java
@@ -19,7 +19,7 @@
 
 import java.io.ObjectStreamException;
 import java.nio.ByteOrder;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 /**
  * An IPv4 address. See {@link InetAddress}.
@@ -148,7 +148,7 @@
             return false;
         }
 
-        int address = OSMemory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
+        int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
         /*
          * Now check the boundaries of the global space if we have an address
          * that is prefixed by something less than 111000000000000000000001
@@ -193,7 +193,7 @@
      */
     @Override
     public boolean isMCLinkLocal() {
-        int address = OSMemory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
+        int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
         return (address >>> 8) == 0xE00000;
     }
 
@@ -207,7 +207,7 @@
      */
     @Override
     public boolean isMCSiteLocal() {
-        int address = OSMemory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
+        int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
         return (address >>> 16) == 0xEFFF;
     }
 
@@ -222,7 +222,7 @@
      */
     @Override
     public boolean isMCOrgLocal() {
-        int address = OSMemory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
+        int address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
         int prefix = address >>> 16;
         return prefix >= 0xEFC0 && prefix <= 0xEFC3;
     }
diff --git a/luni/src/main/java/java/net/Inet6Address.java b/luni/src/main/java/java/net/Inet6Address.java
index 7cd5cee..0880f3f 100644
--- a/luni/src/main/java/java/net/Inet6Address.java
+++ b/luni/src/main/java/java/net/Inet6Address.java
@@ -23,7 +23,6 @@
 import java.io.ObjectStreamField;
 import java.util.Arrays;
 import java.util.Enumeration;
-import libcore.util.EmptyArray;
 
 /**
  * An IPv6 address. See {@link InetAddress}.
@@ -376,11 +375,12 @@
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("ipaddress", EmptyArray.BYTE.getClass()),
-            new ObjectStreamField("scope_id", Integer.TYPE),
-            new ObjectStreamField("scope_id_set", Boolean.TYPE),
-            new ObjectStreamField("scope_ifname_set", Boolean.TYPE),
-            new ObjectStreamField("ifname", String.class), };
+        new ObjectStreamField("ipaddress", byte[].class),
+        new ObjectStreamField("scope_id", int.class),
+        new ObjectStreamField("scope_id_set", boolean.class),
+        new ObjectStreamField("scope_ifname_set", boolean.class),
+        new ObjectStreamField("ifname", String.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
diff --git a/luni/src/main/java/java/net/InetAddress.java b/luni/src/main/java/java/net/InetAddress.java
index e595465..f77a901 100644
--- a/luni/src/main/java/java/net/InetAddress.java
+++ b/luni/src/main/java/java/net/InetAddress.java
@@ -26,15 +26,15 @@
 import java.io.ObjectStreamField;
 import java.io.Serializable;
 import java.nio.ByteOrder;
-import java.security.AccessController;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.List;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Libcore;
+import libcore.io.IoUtils;
+import libcore.io.Memory;
 import org.apache.harmony.luni.platform.Platform;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and
@@ -269,19 +269,14 @@
             return new InetAddress[] { makeInetAddress(bytes, null) };
         }
 
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkConnect(host, -1);
-        }
-
         return lookupHostByName(host);
     }
 
-    private static InetAddress makeInetAddress(byte[] bytes, String hostname) throws UnknownHostException {
+    private static InetAddress makeInetAddress(byte[] bytes, String hostName) throws UnknownHostException {
         if (bytes.length == 4) {
-            return new Inet4Address(bytes, hostname);
+            return new Inet4Address(bytes, hostName);
         } else if (bytes.length == 16) {
-            return new Inet6Address(bytes, hostname, 0);
+            return new Inet6Address(bytes, hostName, 0);
         } else {
             throw badAddressLength(bytes);
         }
@@ -292,8 +287,7 @@
     static native byte[] ipStringToByteArray(String address);
 
     static boolean preferIPv6Addresses() {
-        String propertyName = "java.net.preferIPv6Addresses";
-        String propertyValue = AccessController.doPrivileged(new PriviAction<String>(propertyName));
+        String propertyValue = System.getProperty("java.net.preferIPv6Addresses");
         return Boolean.parseBoolean(propertyValue);
     }
 
@@ -335,7 +329,7 @@
             if (hostName == null) {
                 int address = 0;
                 if (ipaddress.length == 4) {
-                    address = OSMemory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
+                    address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
                     if (address == 0) {
                         return hostName = byteArrayToIpString(ipaddress);
                     }
@@ -349,32 +343,19 @@
         } catch (UnknownHostException e) {
             return hostName = byteArrayToIpString(ipaddress);
         }
-        SecurityManager security = System.getSecurityManager();
-        try {
-            // Only check host names, not addresses
-            if (security != null && !isNumeric(hostName)) {
-                security.checkConnect(hostName, -1);
-            }
-        } catch (SecurityException e) {
-            return byteArrayToIpString(ipaddress);
-        }
         return hostName;
     }
 
     /**
-     * Gets the fully qualified domain name for the host associated with this IP
-     * address. If a security manager is set, it is checked if the method caller
-     * is allowed to get the hostname. Otherwise, the textual representation in
-     * a dotted-quad-notation is returned.
-     *
-     * @return the fully qualified domain name of this IP address.
+     * Returns the fully qualified domain name for the host associated with this IP
+     * address.
      */
     public String getCanonicalHostName() {
         String canonicalName;
         try {
             int address = 0;
             if (ipaddress.length == 4) {
-                address = OSMemory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
+                address = Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN);
                 if (address == 0) {
                     return byteArrayToIpString(ipaddress);
                 }
@@ -383,15 +364,6 @@
         } catch (UnknownHostException e) {
             return byteArrayToIpString(ipaddress);
         }
-        SecurityManager security = System.getSecurityManager();
-        try {
-            // Only check host names, not addresses
-            if (security != null && !isNumeric(canonicalName)) {
-                security.checkConnect(canonicalName, -1);
-            }
-        } catch (SecurityException e) {
-            return byteArrayToIpString(ipaddress);
-        }
         return canonicalName;
     }
 
@@ -433,18 +405,9 @@
      *             if the address lookup fails.
      */
     public static InetAddress getLocalHost() throws UnknownHostException {
-        String host = gethostname();
-        SecurityManager security = System.getSecurityManager();
-        try {
-            if (security != null) {
-                security.checkConnect(host, -1);
-            }
-        } catch (SecurityException e) {
-            return Inet4Address.LOOPBACK;
-        }
+        String host = Libcore.os.uname().nodename; // Can only throw EFAULT (which can't happen).
         return lookupHostByName(host)[0];
     }
-    private static native String gethostname();
 
     /**
      * Gets the hashcode of the represented IP address.
@@ -525,17 +488,11 @@
      */
     private static native String getnameinfo(byte[] addr);
 
-    static String getHostNameInternal(String host, boolean isCheck) throws UnknownHostException {
+    static String getHostNameInternal(String host) throws UnknownHostException {
         if (host == null || host.isEmpty()) {
             return Inet4Address.LOOPBACK.getHostAddress();
         }
         if (!isNumeric(host)) {
-            if (isCheck) {
-                SecurityManager sm = System.getSecurityManager();
-                if (sm != null) {
-                    sm.checkConnect(host, -1);
-                }
-            }
             return lookupHostByName(host)[0].getHostAddress();
         }
         return host;
@@ -596,6 +553,15 @@
     }
 
     /**
+     * Returns the IPv6 loopback address {@code ::1} or the IPv4 loopback address {@code 127.0.0.1}.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static InetAddress getLoopbackAddress() {
+        return loopbackAddresses()[0];
+    }
+
+    /**
      * Returns whether this address is a loopback address or not. This
      * implementation returns always {@code false}. Valid IPv4 loopback
      * addresses are 127.d.d.d The only valid IPv6 loopback address is ::1.
@@ -882,11 +848,9 @@
         return false;
     }
 
-    private boolean isReachableByTCP(InetAddress destination, InetAddress source, int timeout)
-            throws IOException {
-        FileDescriptor fd = new FileDescriptor();
+    private boolean isReachableByTCP(InetAddress destination, InetAddress source, int timeout) throws IOException {
+        FileDescriptor fd = IoUtils.socket(true);
         boolean reached = false;
-        Platform.NETWORK.socket(fd, true);
         try {
             if (source != null) {
                 Platform.NETWORK.bind(fd, source, 0);
@@ -906,46 +870,77 @@
     }
 
     /**
-     * Returns the {@code InetAddress} corresponding to the array of bytes. In
-     * the case of an IPv4 address there must be exactly 4 bytes and for IPv6
-     * exactly 16 bytes. If not, an {@code UnknownHostException} is thrown.
-     * <p>
-     * The IP address is not validated by a name service.
-     * <p>
-     * The high order byte is {@code ipAddress[0]}.
+     * Equivalent to {@code getByAddress(null, ipAddress, 0)}. Handy for IPv4 addresses with
+     * no associated hostname.
      *
-     * @param ipAddress
-     *            is either a 4 (IPv4) or 16 (IPv6) byte long array.
-     * @return an {@code InetAddress} instance representing the given IP address
-     *         {@code ipAddress}.
-     * @throws UnknownHostException
-     *             if the given byte array has no valid length.
+     * <p>(Note that numeric addresses such as {@code "127.0.0.1"} are names for the
+     * purposes of this API. Most callers probably want {@link #getAllByName} instead.)
      */
-    public static InetAddress getByAddress(byte[] ipAddress)
-            throws UnknownHostException {
-        // simply call the method by the same name specifying the default scope
-        // id of 0
+    public static InetAddress getByAddress(byte[] ipAddress) throws UnknownHostException {
         return getByAddressInternal(null, ipAddress, 0);
     }
 
     /**
-     * Returns the {@code InetAddress} corresponding to the array of bytes. In
-     * the case of an IPv4 address there must be exactly 4 bytes and for IPv6
-     * exactly 16 bytes. If not, an {@code UnknownHostException} is thrown. The
-     * IP address is not validated by a name service. The high order byte is
-     * {@code ipAddress[0]}.
+     * Equivalent to {@code getByAddress(null, ipAddress, scopeId)}. Handy for IPv6 addresses
+     * with no associated hostname.
      *
-     * @param ipAddress
-     *            either a 4 (IPv4) or 16 (IPv6) byte array.
-     * @param scope_id
-     *            the scope id for an IPv6 scoped address. If not a scoped
-     *            address just pass in 0.
-     * @return the InetAddress
-     * @throws UnknownHostException
+     * <p>(Note that numeric addresses such as {@code "127.0.0.1"} are names for the
+     * purposes of this API. Most callers probably want {@link #getAllByName} instead.)
      */
-    static InetAddress getByAddress(byte[] ipAddress, int scope_id)
+    static InetAddress getByAddress(byte[] ipAddress, int scopeId) throws UnknownHostException {
+        return getByAddressInternal(null, ipAddress, scopeId);
+    }
+
+    /**
+     * Equivalent to {@code getByAddress(hostName, ipAddress, 0)}. Handy for IPv4 addresses
+     * with an associated hostname.
+     *
+     * <p>(Note that numeric addresses such as {@code "127.0.0.1"} are names for the
+     * purposes of this API. Most callers probably want {@link #getAllByName} instead.)
+     */
+    public static InetAddress getByAddress(String hostName, byte[] ipAddress) throws UnknownHostException {
+        return getByAddressInternal(hostName, ipAddress, 0);
+    }
+
+    /**
+     * Returns an {@code InetAddress} corresponding to the given network-order
+     * bytes {@code ipAddress} and {@code scopeId}.
+     *
+     * <p>For an IPv4 address, the byte array must be of length 4, and the scopeId is ignored.
+     * For IPv6, the byte array must be of length 16. Any other length will cause an {@code
+     * UnknownHostException}.
+     *
+     * <p>No reverse lookup is performed. The given {@code hostName} (which may be null) is
+     * associated with the new {@code InetAddress} with no validation done.
+     *
+     * <p>(Note that numeric addresses such as {@code "127.0.0.1"} are names for the
+     * purposes of this API. Most callers probably want {@link #getAllByName} instead.)
+     *
+     * @throws UnknownHostException if {@code ipAddress} is null or the wrong length.
+     */
+    static InetAddress getByAddressInternal(String hostName, byte[] ipAddress, int scopeId)
             throws UnknownHostException {
-        return getByAddressInternal(null, ipAddress, scope_id);
+        if (ipAddress == null) {
+            throw new UnknownHostException("ipAddress == null");
+        }
+        if (ipAddress.length == 4) {
+            return new Inet4Address(ipAddress.clone(), hostName);
+        } else if (ipAddress.length == 16) {
+            // First check to see if the address is an IPv6-mapped
+            // IPv4 address. If it is, then we can make it a IPv4
+            // address, otherwise, we'll create an IPv6 address.
+            if (isIPv4MappedAddress(ipAddress)) {
+                return new Inet4Address(ipv4MappedToIPv4(ipAddress), hostName);
+            } else {
+                return new Inet6Address(ipAddress.clone(), hostName, scopeId);
+            }
+        } else {
+            throw badAddressLength(ipAddress);
+        }
+    }
+
+    private static UnknownHostException badAddressLength(byte[] bytes) throws UnknownHostException {
+        throw new UnknownHostException("Address is neither 4 or 16 bytes: " + Arrays.toString(bytes));
     }
 
     private static boolean isIPv4MappedAddress(byte[] ipAddress) {
@@ -974,89 +969,18 @@
         return ipv4Address;
     }
 
-    /**
-     * Returns the {@code InetAddress} corresponding to the array of bytes, and
-     * the given hostname. In the case of an IPv4 address there must be exactly
-     * 4 bytes and for IPv6 exactly 16 bytes. If not, an {@code
-     * UnknownHostException} will be thrown.
-     * <p>
-     * The host name and IP address are not validated.
-     * <p>
-     * The hostname either be a machine alias or a valid IPv6 or IPv4 address
-     * format.
-     * <p>
-     * The high order byte is {@code ipAddress[0]}.
-     *
-     * @param hostName
-     *            the string representation of hostname or IP address.
-     * @param ipAddress
-     *            either a 4 (IPv4) or 16 (IPv6) byte long array.
-     * @return an {@code InetAddress} instance representing the given IP address
-     *         and hostname.
-     * @throws UnknownHostException
-     *             if the given byte array has no valid length.
-     */
-    public static InetAddress getByAddress(String hostName, byte[] ipAddress)
-            throws UnknownHostException {
-        // just call the method by the same name passing in a default scope id
-        // of 0
-        return getByAddressInternal(hostName, ipAddress, 0);
-    }
-
-    /**
-     * Returns the {@code InetAddress} corresponding to the array of bytes, and
-     * the given hostname. In the case of an IPv4 address there must be exactly
-     * 4 bytes and for IPv6 exactly 16 bytes. If not, an {@code
-     * UnknownHostException} is thrown. The host name and IP address are not
-     * validated. The hostname either be a machine alias or a valid IPv6 or IPv4
-     * address format. The high order byte is {@code ipAddress[0]}.
-     *
-     * @param hostName
-     *            string representation of hostname or IP address.
-     * @param ipAddress
-     *            either a 4 (IPv4) or 16 (IPv6) byte array.
-     * @param scope_id
-     *            the scope id for a scoped address. If not a scoped address
-     *            just pass in 0.
-     * @return the InetAddress
-     * @throws UnknownHostException
-     */
-    static InetAddress getByAddressInternal(String hostName, byte[] ipAddress, int scope_id)
-            throws UnknownHostException {
-        if (ipAddress == null) {
-            throw new UnknownHostException("ipAddress == null");
-        }
-        if (ipAddress.length == 4) {
-            return new Inet4Address(ipAddress.clone(), hostName);
-        } else if (ipAddress.length == 16) {
-            // First check to see if the address is an IPv6-mapped
-            // IPv4 address. If it is, then we can make it a IPv4
-            // address, otherwise, we'll create an IPv6 address.
-            if (isIPv4MappedAddress(ipAddress)) {
-                return new Inet4Address(ipv4MappedToIPv4(ipAddress), hostName);
-            } else {
-                return new Inet6Address(ipAddress.clone(), hostName, scope_id);
-            }
-        } else {
-            throw badAddressLength(ipAddress);
-        }
-    }
-
-    private static UnknownHostException badAddressLength(byte[] bytes) throws UnknownHostException {
-        throw new UnknownHostException("Address is neither 4 or 16 bytes: " + Arrays.toString(bytes));
-    }
-
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("address", Integer.TYPE),
-            new ObjectStreamField("family", Integer.TYPE),
-            new ObjectStreamField("hostName", String.class) };
+        new ObjectStreamField("address", int.class),
+        new ObjectStreamField("family", int.class),
+        new ObjectStreamField("hostName", String.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
         if (ipaddress == null) {
             fields.put("address", 0);
         } else {
-            fields.put("address", OSMemory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN));
+            fields.put("address", Memory.peekInt(ipaddress, 0, ByteOrder.BIG_ENDIAN));
         }
         fields.put("family", family);
         fields.put("hostName", hostName);
@@ -1068,7 +992,7 @@
         ObjectInputStream.GetField fields = stream.readFields();
         int addr = fields.get("address", 0);
         ipaddress = new byte[4];
-        OSMemory.pokeInt(ipaddress, 0, addr, ByteOrder.BIG_ENDIAN);
+        Memory.pokeInt(ipaddress, 0, addr, ByteOrder.BIG_ENDIAN);
         hostName = (String) fields.get("hostName", null);
         family = fields.get("family", 2);
     }
diff --git a/luni/src/main/java/java/net/InetSocketAddress.java b/luni/src/main/java/java/net/InetSocketAddress.java
index f9f973b..7b33a44 100644
--- a/luni/src/main/java/java/net/InetSocketAddress.java
+++ b/luni/src/main/java/java/net/InetSocketAddress.java
@@ -75,10 +75,6 @@
      *            the specified port number to which this socket is bound.
      * @param host
      *            the specified hostname to which this socket is bound.
-     * @throws SecurityException
-     *             if a {@link SecurityManager} is installed and its {@code
-     *             checkConnect()} method does not allow the resolving of the
-     *             host name.
      */
     public InetSocketAddress(String host, int port) {
         this(host, port, true);
@@ -95,10 +91,6 @@
 
         InetAddress addr = null;
         if (needResolved) {
-            SecurityManager smgr = System.getSecurityManager();
-            if (smgr != null) {
-                smgr.checkConnect(hostname, port);
-            }
             try {
                 addr = InetAddress.getByName(hostname);
                 hostname = null;
@@ -147,15 +139,24 @@
     }
 
     /**
-     * Gets the hostname of this socket.
-     *
-     * @return the socket endpoint hostname.
+     * Returns the hostname, doing a reverse lookup on the {@code InetAddress} if no
+     * hostname string was provided at construction time.
      */
     public final String getHostName() {
         return (addr != null) ? addr.getHostName() : hostname;
     }
 
     /**
+     * Returns the hostname if known, or the result of {@code InetAddress.getHostAddress}.
+     * Unlike {@link #getHostName}, this method will never cause a DNS lookup.
+     * @since 1.7
+     * @hide 1.7 - remember to add a link in the getHostName documentation!
+     */
+    public final String getHostString() {
+        return (hostname != null) ? hostname : addr.getHostAddress();
+    }
+
+    /**
      * Returns whether this socket address is unresolved or not.
      *
      * @return {@code true} if this socket address is unresolved, {@code false}
diff --git a/luni/src/main/java/java/net/MalformedURLException.java b/luni/src/main/java/java/net/MalformedURLException.java
index 2c6dbd9..66bbb54 100644
--- a/luni/src/main/java/java/net/MalformedURLException.java
+++ b/luni/src/main/java/java/net/MalformedURLException.java
@@ -33,7 +33,6 @@
      * Constructs a new instance of this class with its walkback filled in.
      */
     public MalformedURLException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/MulticastSocket.java b/luni/src/main/java/java/net/MulticastSocket.java
index c853dc4..a04960f 100644
--- a/luni/src/main/java/java/net/MulticastSocket.java
+++ b/luni/src/main/java/java/net/MulticastSocket.java
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 import java.util.Enumeration;
-import org.apache.harmony.luni.net.PlainDatagramSocketImpl;
 
 /**
  * This class implements a multicast socket for sending and receiving IP
@@ -41,7 +40,6 @@
      *             if an error occurs creating or binding the socket.
      */
     public MulticastSocket() throws IOException {
-        super();
         setReuseAddress(true);
     }
 
@@ -204,8 +202,6 @@
      *            received.
      * @throws IOException
      *                if the specified address is not a multicast address.
-     * @throws SecurityException
-     *                if the caller is not authorized to join the group.
      * @throws IllegalArgumentException
      *                if no multicast group is specified.
      * @since 1.4
@@ -224,8 +220,6 @@
      *                if {@code groupAddr} is {@code null}.
      * @throws IOException
      *                if the specified group address is not a multicast address.
-     * @throws SecurityException
-     *                if the caller is not authorized to leave the group.
      */
     public void leaveGroup(InetAddress groupAddr) throws IOException {
         checkJoinOrLeave(groupAddr);
@@ -242,8 +236,6 @@
      *            dropped.
      * @throws IOException
      *                if the specified group address is not a multicast address.
-     * @throws SecurityException
-     *                if the caller is not authorized to leave the group.
      * @throws IllegalArgumentException
      *                if {@code groupAddress} is {@code null}.
      * @since 1.4
@@ -276,10 +268,6 @@
         if (!groupAddr.isMulticastAddress()) {
             throw new IOException("Not a multicast group: " + groupAddr);
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkMulticast(groupAddr);
-        }
     }
 
     private void checkJoinOrLeave(InetAddress groupAddr) throws IOException {
@@ -287,10 +275,6 @@
         if (!groupAddr.isMulticastAddress()) {
             throw new IOException("Not a multicast group: " + groupAddr);
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkMulticast(groupAddr);
-        }
     }
 
     /**
@@ -310,14 +294,6 @@
     public void send(DatagramPacket pack, byte ttl) throws IOException {
         checkClosedAndBind(false);
         InetAddress packAddr = pack.getAddress();
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            if (packAddr.isMulticastAddress()) {
-                security.checkMulticast(packAddr, ttl);
-            } else {
-                security.checkConnect(packAddr.getHostName(), pack.getPort());
-            }
-        }
         int currTTL = getTimeToLive();
         if (packAddr.isMulticastAddress() && (byte) currTTL != ttl) {
             try {
diff --git a/luni/src/main/java/java/net/NetPermission.java b/luni/src/main/java/java/net/NetPermission.java
index cb8bcdd..e12a3bf 100644
--- a/luni/src/main/java/java/net/NetPermission.java
+++ b/luni/src/main/java/java/net/NetPermission.java
@@ -33,7 +33,6 @@
  * </dl>
  *
  * @see java.security.BasicPermission
- * @see SecurityManager
  */
 public final class NetPermission extends java.security.BasicPermission {
 
diff --git a/luni/src/main/java/java/net/NetworkInterface.java b/luni/src/main/java/java/net/NetworkInterface.java
index 70987ea..6ef248f 100644
--- a/luni/src/main/java/java/net/NetworkInterface.java
+++ b/luni/src/main/java/java/net/NetworkInterface.java
@@ -132,21 +132,7 @@
      * @return the address list of the represented network interface.
      */
     public Enumeration<InetAddress> getInetAddresses() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm == null || addresses.isEmpty()) {
-            return Collections.enumeration(addresses);
-        }
-        // TODO: Android should ditch SecurityManager and the associated pollution.
-        List<InetAddress> result = new ArrayList<InetAddress>(addresses.size());
-        for (InetAddress address : addresses) {
-            try {
-                sm.checkConnect(address.getHostName(), CHECK_CONNECT_NO_PORT);
-            } catch (SecurityException e) {
-                continue;
-            }
-            result.add(address);
-        }
-        return Collections.enumeration(result);
+        return Collections.enumeration(addresses);
     }
 
     /**
@@ -343,31 +329,11 @@
     }
 
     /**
-     * Returns a List the InterfaceAddresses for this network interface.
-     * <p>
-     * If there is a security manager, its checkConnect method is called with
-     * the InetAddress for each InterfaceAddress. Only InterfaceAddresses where
-     * the checkConnect doesn't throw a SecurityException will be returned.
-     *
-     * @return a List of the InterfaceAddresses for this network interface.
+     * Returns a List of the InterfaceAddresses for this network interface.
      * @since 1.6
      */
     public List<InterfaceAddress> getInterfaceAddresses() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm == null) {
-            return Collections.unmodifiableList(interfaceAddresses);
-        }
-        // TODO: Android should ditch SecurityManager and the associated pollution.
-        List<InterfaceAddress> result = new ArrayList<InterfaceAddress>(interfaceAddresses.size());
-        for (InterfaceAddress ia : interfaceAddresses) {
-            try {
-                sm.checkConnect(ia.getAddress().getHostName(), CHECK_CONNECT_NO_PORT);
-            } catch (SecurityException e) {
-                continue;
-            }
-            result.add(ia);
-        }
-        return result;
+        return Collections.unmodifiableList(interfaceAddresses);
     }
 
     /**
diff --git a/luni/src/main/java/java/net/NoRouteToHostException.java b/luni/src/main/java/java/net/NoRouteToHostException.java
index 3a9309c..64b20b1 100644
--- a/luni/src/main/java/java/net/NoRouteToHostException.java
+++ b/luni/src/main/java/java/net/NoRouteToHostException.java
@@ -30,7 +30,6 @@
      * Constructs a new instance of this exception with its walkback filled in.
      */
     public NoRouteToHostException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java b/luni/src/main/java/java/net/PlainDatagramSocketImpl.java
similarity index 83%
rename from luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java
rename to luni/src/main/java/java/net/PlainDatagramSocketImpl.java
index e22740e..e3ef565 100644
--- a/luni/src/main/java/org/apache/harmony/luni/net/PlainDatagramSocketImpl.java
+++ b/luni/src/main/java/java/net/PlainDatagramSocketImpl.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.net;
+package java.net;
 
 import dalvik.system.CloseGuard;
 import java.io.FileDescriptor;
@@ -29,23 +29,15 @@
 import java.net.SocketAddress;
 import java.net.SocketException;
 import java.net.UnknownHostException;
+import libcore.io.IoUtils;
 import libcore.util.EmptyArray;
 import org.apache.harmony.luni.platform.Platform;
 
 /**
- * The default, concrete instance of datagram sockets. This class does not
- * support security checks. Alternative types of DatagramSocketImpl's may be
- * used by setting the <code>impl.prefix</code> system property.
+ * @hide used in java.nio.
  */
 public class PlainDatagramSocketImpl extends DatagramSocketImpl {
 
-    private static final int MCAST_JOIN_GROUP = 19;
-    private static final int MCAST_LEAVE_GROUP = 20;
-
-    private static final int SO_BROADCAST = 32;
-
-    final static int IP_MULTICAST_TTL = 17;
-
     private volatile boolean isNativeConnected;
 
     private final CloseGuard guard = CloseGuard.get();
@@ -59,7 +51,6 @@
     private int connectedPort = -1;
 
     public PlainDatagramSocketImpl(FileDescriptor fd, int localPort) {
-        super();
         this.fd = fd;
         this.localPort = localPort;
         if (fd.valid()) {
@@ -68,7 +59,6 @@
     }
 
     public PlainDatagramSocketImpl() {
-        super();
         fd = new FileDescriptor();
     }
 
@@ -78,11 +68,11 @@
         if (port != 0) {
             localPort = port;
         } else {
-            localPort = Platform.NETWORK.getSocketLocalPort(fd);
+            localPort = IoUtils.getSocketLocalPort(fd);
         }
 
         try {
-            setOption(SO_BROADCAST, Boolean.TRUE);
+            setOption(SocketOptions.SO_BROADCAST, Boolean.TRUE);
         } catch (IOException ignored) {
         }
     }
@@ -98,7 +88,7 @@
 
     @Override
     public void create() throws SocketException {
-        Platform.NETWORK.socket(fd, false);
+        this.fd = IoUtils.socket(false);
     }
 
     @Override protected void finalize() throws Throwable {
@@ -112,13 +102,13 @@
         }
     }
 
-    public Object getOption(int optID) throws SocketException {
-        return Platform.NETWORK.getSocketOption(fd, optID);
+    @Override public Object getOption(int option) throws SocketException {
+        return IoUtils.getSocketOption(fd, option);
     }
 
     @Override
     public int getTimeToLive() throws IOException {
-        return (Integer) getOption(IP_MULTICAST_TTL);
+        return (Integer) getOption(IoUtils.IP_MULTICAST_TTL);
     }
 
     @Override
@@ -128,27 +118,27 @@
 
     @Override
     public void join(InetAddress addr) throws IOException {
-        setOption(MCAST_JOIN_GROUP, new MulticastGroupRequest(addr, null));
+        setOption(IoUtils.MCAST_JOIN_GROUP, new MulticastGroupRequest(addr, null));
     }
 
     @Override
     public void joinGroup(SocketAddress addr, NetworkInterface netInterface) throws IOException {
         if (addr instanceof InetSocketAddress) {
             InetAddress groupAddr = ((InetSocketAddress) addr).getAddress();
-            setOption(MCAST_JOIN_GROUP, new MulticastGroupRequest(groupAddr, netInterface));
+            setOption(IoUtils.MCAST_JOIN_GROUP, new MulticastGroupRequest(groupAddr, netInterface));
         }
     }
 
     @Override
     public void leave(InetAddress addr) throws IOException {
-        setOption(MCAST_LEAVE_GROUP, new MulticastGroupRequest(addr, null));
+        setOption(IoUtils.MCAST_LEAVE_GROUP, new MulticastGroupRequest(addr, null));
     }
 
     @Override
     public void leaveGroup(SocketAddress addr, NetworkInterface netInterface) throws IOException {
         if (addr instanceof InetSocketAddress) {
             InetAddress groupAddr = ((InetSocketAddress) addr).getAddress();
-            setOption(MCAST_LEAVE_GROUP, new MulticastGroupRequest(groupAddr, netInterface));
+            setOption(IoUtils.MCAST_LEAVE_GROUP, new MulticastGroupRequest(groupAddr, netInterface));
         }
     }
 
@@ -157,7 +147,8 @@
         // We don't actually want the data: we just want the DatagramPacket's filled-in address.
         DatagramPacket packet = new DatagramPacket(EmptyArray.BYTE, 0);
         int result = peekData(packet);
-        Platform.NETWORK.setInetAddress(sender, packet.getAddress().getAddress());
+        // TODO: maybe recv should do this?
+        sender.ipaddress = packet.getAddress().getAddress();
         return result;
     }
 
@@ -194,7 +185,7 @@
 
     @Override
     public void setTimeToLive(int ttl) throws IOException {
-        setOption(IP_MULTICAST_TTL, Integer.valueOf(ttl));
+        setOption(IoUtils.IP_MULTICAST_TTL, Integer.valueOf(ttl));
     }
 
     @Override
diff --git a/luni/src/main/java/org/apache/harmony/luni/net/PlainServerSocketImpl.java b/luni/src/main/java/java/net/PlainServerSocketImpl.java
similarity index 87%
rename from luni/src/main/java/org/apache/harmony/luni/net/PlainServerSocketImpl.java
rename to luni/src/main/java/java/net/PlainServerSocketImpl.java
index 42dd490..cb45010 100644
--- a/luni/src/main/java/org/apache/harmony/luni/net/PlainServerSocketImpl.java
+++ b/luni/src/main/java/java/net/PlainServerSocketImpl.java
@@ -15,17 +15,15 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.net;
+package java.net;
 
 import java.io.FileDescriptor;
 import java.io.IOException;
 import java.net.SocketException;
 import java.net.SocketOptions;
-import org.apache.harmony.luni.net.PlainSocketImpl;
 
 /**
- * This class overrides create to call natives that set the options required
- * for server sockets.
+ * @hide used in java.nio.
  */
 public class PlainServerSocketImpl extends PlainSocketImpl {
 
diff --git a/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java b/luni/src/main/java/java/net/PlainSocketImpl.java
similarity index 74%
rename from luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
rename to luni/src/main/java/java/net/PlainSocketImpl.java
index 4952cf6..937193e 100644
--- a/luni/src/main/java/org/apache/harmony/luni/net/PlainSocketImpl.java
+++ b/luni/src/main/java/java/net/PlainSocketImpl.java
@@ -15,14 +15,13 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.net;
+package java.net;
 
 import dalvik.system.CloseGuard;
 import java.io.FileDescriptor;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.lang.reflect.Field;
 import java.net.ConnectException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
@@ -33,23 +32,25 @@
 import java.net.SocketTimeoutException;
 import java.net.UnknownHostException;
 import java.nio.ByteOrder;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import org.apache.harmony.luni.platform.OSMemory;
+import java.util.Arrays;
+import libcore.io.ErrnoException;
+import libcore.io.IoUtils;
+import libcore.io.Libcore;
+import libcore.io.Memory;
+import libcore.io.Streams;
 import org.apache.harmony.luni.platform.Platform;
+import static libcore.io.OsConstants.*;
 
 /**
- * A concrete connected-socket implementation.
+ * @hide used in java.nio.
  */
 public class PlainSocketImpl extends SocketImpl {
 
     // For SOCKS support. A SOCKS bind() uses the last
     // host connected to in its request.
-    static private InetAddress lastConnectedAddress;
+    private static InetAddress lastConnectedAddress;
 
-    static private int lastConnectedPort;
-
-    private static Field fdField;
+    private static int lastConnectedPort;
 
     private boolean streaming = true;
 
@@ -76,7 +77,6 @@
     }
 
     public PlainSocketImpl(FileDescriptor fd, int localport, InetAddress addr, int port) {
-        super();
         this.fd = fd;
         this.localport = localport;
         this.address = addr;
@@ -93,47 +93,13 @@
             ((PlainSocketImpl) newImpl).socksAccept();
             return;
         }
-
-        try {
-            if (newImpl instanceof PlainSocketImpl) {
-                PlainSocketImpl newPlainSocketImpl = (PlainSocketImpl) newImpl;
-                Platform.NETWORK.accept(fd, newImpl, newPlainSocketImpl.getFileDescriptor());
-            } else {
-                // if newImpl is not an instance of PlainSocketImpl, use
-                // reflection to get/set protected fields.
-                if (fdField == null) {
-                    fdField = getSocketImplField("fd");
-                }
-                FileDescriptor newFd = (FileDescriptor) fdField.get(newImpl);
-                Platform.NETWORK.accept(fd, newImpl, newFd);
-            }
-        } catch (IllegalAccessException e) {
-            // empty
-        }
+        Platform.NETWORK.accept(fd, newImpl, newImpl.getFileDescriptor());
     }
 
     private boolean usingSocks() {
         return proxy != null && proxy.type() == Proxy.Type.SOCKS;
     }
 
-    /**
-     * gets SocketImpl field by reflection.
-     */
-    private Field getSocketImplField(final String fieldName) {
-        return AccessController.doPrivileged(new PrivilegedAction<Field>() {
-            public Field run() {
-                Field field = null;
-                try {
-                    field = SocketImpl.class.getDeclaredField(fieldName);
-                    field.setAccessible(true);
-                } catch (NoSuchFieldException e) {
-                    throw new Error(e);
-                }
-                return field;
-            }
-        });
-    }
-
     public void initLocalPort(int localPort) {
         this.localport = localPort;
     }
@@ -157,7 +123,7 @@
         if (shutdownInput) {
             return 0;
         }
-        return Platform.FILE_SYSTEM.ioctlAvailable(fd);
+        return IoUtils.available(fd);
     }
 
     @Override
@@ -167,7 +133,7 @@
         if (port != 0) {
             this.localport = port;
         } else {
-            this.localport = Platform.NETWORK.getSocketLocalPort(fd);
+            this.localport = IoUtils.getSocketLocalPort(fd);
         }
     }
 
@@ -217,7 +183,7 @@
     @Override
     protected void create(boolean streaming) throws IOException {
         this.streaming = streaming;
-        Platform.NETWORK.socket(fd, streaming);
+        this.fd = IoUtils.socket(streaming);
     }
 
     @Override protected void finalize() throws Throwable {
@@ -231,21 +197,62 @@
         }
     }
 
-    @Override
-    protected synchronized InputStream getInputStream() throws IOException {
+    @Override protected synchronized InputStream getInputStream() throws IOException {
         checkNotClosed();
-        return new SocketInputStream(this);
+        return new PlainSocketInputStream(this);
     }
 
-    @Override
-    public Object getOption(int optID) throws SocketException {
-        return Platform.NETWORK.getSocketOption(fd, optID);
+    private static class PlainSocketInputStream extends InputStream {
+        private final PlainSocketImpl socketImpl;
+
+        public PlainSocketInputStream(PlainSocketImpl socketImpl) {
+            this.socketImpl = socketImpl;
+        }
+
+        @Override public int available() throws IOException {
+            return socketImpl.available();
+        }
+
+        @Override public void close() throws IOException {
+            socketImpl.close();
+        }
+
+        @Override public int read() throws IOException {
+            return Streams.readSingleByte(this);
+        }
+
+        @Override public int read(byte[] buffer, int offset, int byteCount) throws IOException {
+            return socketImpl.read(buffer, offset, byteCount);
+        }
     }
 
-    @Override
-    protected synchronized OutputStream getOutputStream() throws IOException {
+    @Override public Object getOption(int option) throws SocketException {
+        return IoUtils.getSocketOption(fd, option);
+    }
+
+    @Override protected synchronized OutputStream getOutputStream() throws IOException {
         checkNotClosed();
-        return new SocketOutputStream(this);
+        return new PlainSocketOutputStream(this);
+    }
+
+    private static class PlainSocketOutputStream extends OutputStream {
+        private final PlainSocketImpl socketImpl;
+
+        public PlainSocketOutputStream(PlainSocketImpl socketImpl) {
+            this.socketImpl = socketImpl;
+        }
+
+        @Override public void close() throws IOException {
+            socketImpl.close();
+        }
+
+        @Override public void write(int oneByte) throws IOException {
+            Streams.writeSingleByte(this, oneByte);
+        }
+
+        @Override public void write(byte[] buffer, int offset, int byteCount) throws IOException {
+            socketImpl.write(buffer, offset, byteCount);
+        }
     }
 
     @Override
@@ -255,7 +262,11 @@
             // server during the bind.
             return;
         }
-        Platform.NETWORK.listen(fd, backlog);
+        try {
+            Libcore.os.listen(fd, backlog);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsSocketException();
+        }
     }
 
     @Override
@@ -272,7 +283,6 @@
         // determined by ProxySelector.
         InetSocketAddress addr = (InetSocketAddress) proxy.address();
         return addr.getPort();
-
     }
 
     /**
@@ -318,8 +328,7 @@
                 applicationServerAddress, applicationServerPort);
         Socks4Message reply = socksReadReply();
         if (reply.getCommandOrResult() != Socks4Message.RETURN_SUCCESS) {
-            throw new IOException(reply.getErrorString(reply
-                    .getCommandOrResult()));
+            throw new IOException(reply.getErrorString(reply.getCommandOrResult()));
         }
     }
 
@@ -329,8 +338,7 @@
     public void socksAccept() throws IOException {
         Socks4Message reply = socksReadReply();
         if (reply.getCommandOrResult() != Socks4Message.RETURN_SUCCESS) {
-            throw new IOException(reply.getErrorString(reply
-                    .getCommandOrResult()));
+            throw new IOException(reply.getErrorString(reply.getCommandOrResult()));
         }
     }
 
@@ -340,7 +348,11 @@
     @Override
     protected void shutdownInput() throws IOException {
         shutdownInput = true;
-        Platform.NETWORK.shutdownInput(fd);
+        try {
+            Libcore.os.shutdown(fd, SHUT_RD);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsSocketException();
+        }
     }
 
     /**
@@ -348,7 +360,11 @@
      */
     @Override
     protected void shutdownOutput() throws IOException {
-        Platform.NETWORK.shutdownOutput(fd);
+        try {
+            Libcore.os.shutdown(fd, SHUT_WR);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsSocketException();
+        }
     }
 
     /**
@@ -385,7 +401,7 @@
             // currently the Socks4Message.getIP() only returns int,
             // so only works with IPv4 4byte addresses
             byte[] replyBytes = new byte[4];
-            OSMemory.pokeInt(replyBytes, 0, reply.getIP(), ByteOrder.BIG_ENDIAN);
+            Memory.pokeInt(replyBytes, 0, reply.getIP(), ByteOrder.BIG_ENDIAN);
             address = InetAddress.getByAddress(replyBytes);
         }
         localport = reply.getPort();
@@ -413,7 +429,7 @@
         while (bytesRead < Socks4Message.REPLY_LENGTH) {
             int count = getInputStream().read(reply.getBytes(), bytesRead,
                     Socks4Message.REPLY_LENGTH - bytesRead);
-            if (-1 == count) {
+            if (count == -1) {
                 break;
             }
             bytesRead += count;
@@ -425,8 +441,7 @@
     }
 
     @Override
-    protected void connect(SocketAddress remoteAddr, int timeout)
-            throws IOException {
+    protected void connect(SocketAddress remoteAddr, int timeout) throws IOException {
         InetSocketAddress inetAddr = (InetSocketAddress) remoteAddr;
         connect(inetAddr.getAddress(), inetAddr.getPort(), timeout);
     }
@@ -441,11 +456,18 @@
         Platform.NETWORK.sendUrgentData(fd, (byte) value);
     }
 
-    int read(byte[] buffer, int offset, int count) throws IOException {
+    /**
+     * For PlainSocketInputStream.
+     */
+    private int read(byte[] buffer, int offset, int byteCount) throws IOException {
+        if (byteCount == 0) {
+            return 0;
+        }
+        Arrays.checkOffsetAndCount(buffer.length, offset, byteCount);
         if (shutdownInput) {
             return -1;
         }
-        int read = Platform.NETWORK.read(fd, buffer, offset, count);
+        int read = Platform.NETWORK.read(fd, buffer, offset, byteCount);
         // Return of zero bytes for a blocking socket means a timeout occurred
         if (read == 0) {
             throw new SocketTimeoutException();
@@ -457,11 +479,22 @@
         return read;
     }
 
-    int write(byte[] buffer, int offset, int count) throws IOException {
+    /**
+     * For PlainSocketOutputStream.
+     */
+    private void write(byte[] buffer, int offset, int byteCount) throws IOException {
+        Arrays.checkOffsetAndCount(buffer.length, offset, byteCount);
         if (streaming) {
-            return Platform.NETWORK.write(fd, buffer, offset, count);
+            while (byteCount > 0) {
+                int bytesWritten = Platform.NETWORK.write(fd, buffer, offset, byteCount);
+                byteCount -= bytesWritten;
+                offset += bytesWritten;
+            }
         } else {
-            return Platform.NETWORK.send(fd, buffer, offset, count, port, address);
+            // Unlike writes to a streaming socket, writes to a datagram
+            // socket are all-or-nothing, so we don't need a loop here.
+            // http://code.google.com/p/android/issues/detail?id=15304
+            Platform.NETWORK.send(fd, buffer, offset, byteCount, port, address);
         }
     }
 }
diff --git a/luni/src/main/java/java/net/ProtocolException.java b/luni/src/main/java/java/net/ProtocolException.java
index 1be76ec..4d7dd35 100644
--- a/luni/src/main/java/java/net/ProtocolException.java
+++ b/luni/src/main/java/java/net/ProtocolException.java
@@ -30,7 +30,6 @@
      * Constructs a new instance of this class with its walkback filled in.
      */
     public ProtocolException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/ProxySelector.java b/luni/src/main/java/java/net/ProxySelector.java
index 8455274..1166db7 100644
--- a/luni/src/main/java/java/net/ProxySelector.java
+++ b/luni/src/main/java/java/net/ProxySelector.java
@@ -93,37 +93,18 @@
 
     private static ProxySelector defaultSelector = new ProxySelectorImpl();
 
-    private final static NetPermission getProxySelectorPermission
-            = new NetPermission("getProxySelector");
-    private final static NetPermission setProxySelectorPermission
-            = new NetPermission("setProxySelector");
-
     /**
      * Returns the default proxy selector, or null if none exists.
-     *
-     * @throws SecurityException if a security manager is installed but it
-     *     doesn't have the NetPermission("getProxySelector").
      */
     public static ProxySelector getDefault() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(getProxySelectorPermission);
-        }
         return defaultSelector;
     }
 
     /**
      * Sets the default proxy selector. If {@code selector} is null, the current
      * proxy selector will be removed.
-     *
-     * @throws SecurityException if a security manager is installed but it
-     *     doesn't have the NetPermission("setProxySelector").
      */
     public static void setDefault(ProxySelector selector) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(setProxySelectorPermission);
-        }
         defaultSelector = selector;
     }
 
diff --git a/luni/src/main/java/java/net/ResponseCache.java b/luni/src/main/java/java/net/ResponseCache.java
index 5eeb551..cbb4f0f 100644
--- a/luni/src/main/java/java/net/ResponseCache.java
+++ b/luni/src/main/java/java/net/ResponseCache.java
@@ -35,10 +35,6 @@
      * Returns the system's default response cache, or null.
      */
     public static ResponseCache getDefault() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new NetPermission("getResponseCache"));
-        }
         return defaultResponseCache;
     }
 
@@ -46,10 +42,6 @@
      * Sets the system's default response cache. Use null to remove the response cache.
      */
     public static void setDefault(ResponseCache responseCache) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new NetPermission("setResponseCache"));
-        }
         defaultResponseCache = responseCache;
     }
 
diff --git a/luni/src/main/java/java/net/SecureCacheResponse.java b/luni/src/main/java/java/net/SecureCacheResponse.java
index ece02ac..60e44b2 100644
--- a/luni/src/main/java/java/net/SecureCacheResponse.java
+++ b/luni/src/main/java/java/net/SecureCacheResponse.java
@@ -33,7 +33,6 @@
      * Creates a new instance of this class.
      */
     public SecureCacheResponse() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/ServerSocket.java b/luni/src/main/java/java/net/ServerSocket.java
index edce448..663cddf 100644
--- a/luni/src/main/java/java/net/ServerSocket.java
+++ b/luni/src/main/java/java/net/ServerSocket.java
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 import java.nio.channels.ServerSocketChannel;
-import org.apache.harmony.luni.net.PlainServerSocketImpl;
 
 /**
  * This class represents a server-side socket that waits for incoming client
@@ -108,9 +107,7 @@
      * @throws IOException
      *             if an error occurs while creating the server socket.
      */
-    public ServerSocket(int aport, int backlog, InetAddress localAddr)
-            throws IOException {
-        super();
+    public ServerSocket(int aport, int backlog, InetAddress localAddr) throws IOException {
         checkListen(aport);
         impl = factory != null ? factory.createSocketImpl()
                 : new PlainServerSocketImpl();
@@ -148,9 +145,6 @@
         Socket aSocket = new Socket();
         try {
             implAccept(aSocket);
-        } catch (SecurityException e) {
-            aSocket.close();
-            throw e;
         } catch (IOException e) {
             aSocket.close();
             throw e;
@@ -158,22 +152,10 @@
         return aSocket;
     }
 
-    /**
-     * Checks whether the server may listen for connection requests on {@code
-     * aport}. Throws an exception if the port is outside the valid range
-     * {@code 0 <= aport <= 65535 }or does not satisfy the security policy.
-     *
-     * @param aPort
-     *            the candidate port to listen on.
-     */
-    void checkListen(int aPort) {
+    private void checkListen(int aPort) {
         if (aPort < 0 || aPort > 65535) {
             throw new IllegalArgumentException("Port out of range: " + aPort);
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkListen(aPort);
-        }
     }
 
     /**
@@ -264,11 +246,6 @@
             impl.accept(aSocket.impl);
             aSocket.accepted();
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkAccept(aSocket.getInetAddress().getHostAddress(),
-                    aSocket.getPort());
-        }
     }
 
     /**
@@ -284,10 +261,6 @@
      */
     public static synchronized void setSocketFactory(SocketImplFactory aFactory)
             throws IOException {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkSetFactory();
-        }
         if (factory != null) {
             throw new SocketException("Factory already set");
         }
@@ -384,10 +357,6 @@
             }
             port = inetAddr.getPort();
         }
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkListen(port);
-        }
 
         synchronized (this) {
             try {
diff --git a/luni/src/main/java/java/net/Socket.java b/luni/src/main/java/java/net/Socket.java
index 39abdbe..337f414 100644
--- a/luni/src/main/java/java/net/Socket.java
+++ b/luni/src/main/java/java/net/Socket.java
@@ -21,8 +21,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.nio.channels.SocketChannel;
-import org.apache.harmony.luni.net.PlainSocketImpl;
-import org.apache.harmony.luni.platform.Platform;
+import libcore.io.IoUtils;
 
 /**
  * Provides a client-side TCP socket.
@@ -73,29 +72,14 @@
      * @throws IllegalArgumentException
      *             if the argument {@code proxy} is {@code null} or of an
      *             invalid type.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given proxy.
      * @see SocketImplFactory
      * @see SocketImpl
      */
     public Socket(Proxy proxy) {
-        this.proxy = proxy;
         if (proxy == null || proxy.type() == Proxy.Type.HTTP) {
-            throw new IllegalArgumentException("Proxy is null or invalid type");
+            throw new IllegalArgumentException("Invalid proxy: " + proxy);
         }
-        InetSocketAddress address = (InetSocketAddress) proxy.address();
-        if (address != null) {
-            InetAddress addr = address.getAddress();
-            String host;
-            if (addr != null) {
-                host = addr.getHostAddress();
-            } else {
-                host = address.getHostName();
-            }
-            int port = address.getPort();
-            checkConnectPermission(host, port);
-        }
+        this.proxy = proxy;
         this.impl = factory != null ? factory.createSocketImpl() : new PlainSocketImpl(proxy);
     }
 
@@ -117,9 +101,6 @@
      *             if the host name could not be resolved into an IP address.
      * @throws IOException
      *             if an error occurs while creating the socket.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given address and port.
      */
     private void tryAllAddresses(String dstName, int dstPort, InetAddress
             localAddress, int localPort, boolean streaming) throws IOException {
@@ -134,8 +115,7 @@
                 checkDestination(dstAddress, dstPort);
                 startupSocket(dstAddress, dstPort, localAddress, localPort, streaming);
                 return;
-            } catch (SecurityException e1) {
-            } catch (IOException e2) {
+            } catch (IOException ex) {
             }
         }
 
@@ -163,9 +143,6 @@
      *             if the host name could not be resolved into an IP address.
      * @throws IOException
      *             if an error occurs while creating the socket.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given address and port.
      */
     public Socket(String dstName, int dstPort) throws UnknownHostException, IOException {
         this(dstName, dstPort, null, 0);
@@ -195,9 +172,6 @@
      *             if the host name could not be resolved into an IP address.
      * @throws IOException
      *             if an error occurs while creating the socket.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given address and port.
      */
     public Socket(String dstName, int dstPort, InetAddress localAddress, int localPort) throws IOException {
         this();
@@ -224,9 +198,6 @@
      *             if the host name could not be resolved into an IP address.
      * @throws IOException
      *             if an error occurs while creating the socket.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given address and port.
      * @deprecated Use {@code Socket(String, int)} instead of this for streaming
      *             sockets or an appropriate constructor of {@code
      *             DatagramSocket} for UDP transport.
@@ -248,9 +219,6 @@
      *            the port on the target host to connect to.
      * @throws IOException
      *             if an error occurs while creating the socket.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given address and port.
      */
     public Socket(InetAddress dstAddress, int dstPort) throws IOException {
         this();
@@ -274,9 +242,6 @@
      *            the port on the local host to bind to.
      * @throws IOException
      *             if an error occurs while creating the socket.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given address and port.
      */
     public Socket(InetAddress dstAddress, int dstPort,
             InetAddress localAddress, int localPort) throws IOException {
@@ -299,9 +264,6 @@
      *            socket otherwise.
      * @throws IOException
      *             if an error occurs while creating the socket.
-     * @throws SecurityException
-     *             if a security manager exists and it denies the permission to
-     *             connect to the given address and port.
      * @deprecated Use {@code Socket(InetAddress, int)} instead of this for
      *             streaming sockets or an appropriate constructor of {@code
      *             DatagramSocket} for UDP transport.
@@ -339,22 +301,6 @@
         if (dstPort < 0 || dstPort > 65535) {
             throw new IllegalArgumentException("Port out of range: " + dstPort);
         }
-        checkConnectPermission(destAddr.getHostAddress(), dstPort);
-    }
-
-    /**
-     * Checks whether the connection destination satisfies the security policy.
-     *
-     * @param hostname
-     *            the destination hostname.
-     * @param dstPort
-     *            the port on the destination host.
-     */
-    private void checkConnectPermission(String hostname, int dstPort) {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkConnect(hostname, dstPort);
-        }
     }
 
     /**
@@ -519,10 +465,6 @@
      */
     public static synchronized void setSocketImplFactory(SocketImplFactory fac)
             throws IOException {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkSetFactory();
-        }
         if (factory != null) {
             throw new SocketException("Factory already set");
         }
@@ -1006,7 +948,7 @@
     }
 
     private void cacheLocalAddress() {
-        this.localAddress = Platform.NETWORK.getSocketLocalAddress(impl.fd);
+        this.localAddress = IoUtils.getSocketLocalAddress(impl.fd);
     }
 
     /**
diff --git a/luni/src/main/java/java/net/SocketAddress.java b/luni/src/main/java/java/net/SocketAddress.java
index e84ebfd..70d26da 100644
--- a/luni/src/main/java/java/net/SocketAddress.java
+++ b/luni/src/main/java/java/net/SocketAddress.java
@@ -32,6 +32,5 @@
      * Creates a new {@code SocketAddress} instance.
      */
     public SocketAddress() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/net/SocketException.java b/luni/src/main/java/java/net/SocketException.java
index 4a24692..0f930e0 100644
--- a/luni/src/main/java/java/net/SocketException.java
+++ b/luni/src/main/java/java/net/SocketException.java
@@ -32,7 +32,6 @@
      * filled in.
      */
     public SocketException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/SocketImpl.java b/luni/src/main/java/java/net/SocketImpl.java
index e3d9c04..3d0507c 100644
--- a/luni/src/main/java/java/net/SocketImpl.java
+++ b/luni/src/main/java/java/net/SocketImpl.java
@@ -21,7 +21,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import org.apache.harmony.luni.platform.Platform;
 
 /**
  * This class is the base of all streaming socket implementation classes.
@@ -54,8 +53,6 @@
      */
     protected int localport;
 
-    boolean streaming = true;
-
     /**
      * Waits for an incoming request and blocks until the connection is opened
      * on the given socket.
@@ -87,8 +84,7 @@
      * @throws IOException
      *             if an error occurs while binding this socket.
      */
-    protected abstract void bind(InetAddress address, int port)
-            throws IOException;
+    protected abstract void bind(InetAddress address, int port) throws IOException;
 
     /**
      * Closes this socket. This makes later access invalid.
@@ -196,8 +192,8 @@
     /**
      * Listens for connection requests on this streaming socket. Incoming
      * connection requests are queued up to the limit specified by {@code
-     * backlog}. Additional requests are rejected. The method {@code listen()}
-     * may only be invoked on streaming sockets.
+     * backlog}. Additional requests are rejected. This method
+     * may only be invoked on stream sockets.
      *
      * @param backlog
      *            the maximum number of outstanding connection requests.
@@ -212,40 +208,16 @@
      *
      * @return the textual representation of this socket.
      */
-    @SuppressWarnings("nls")
     @Override
     public String toString() {
-        return new StringBuilder(100).append("Socket[addr=").append(
-                getInetAddress()).append(",port=").append(port).append(
-                ",localport=").append(getLocalPort()).append("]").toString();
-    }
-
-    /**
-     * In the IP stack, write at most {@code count} bytes on the socket
-     * from the {@code buffer}, from the {@code offset}.
-     *
-     * @param buffer
-     *            the buffer to read into
-     * @param offset
-     *            the offset into the buffer
-     * @param count
-     *            the number of bytes to write
-     * @return int the actual number of bytes written
-     * @throws IOException
-     *                thrown if an error occurs while writing
-     */
-    int write(byte[] buffer, int offset, int count) throws IOException {
-        if (streaming) {
-            return Platform.NETWORK.write(fd, buffer, offset, count);
-        } else {
-            return Platform.NETWORK.send(fd, buffer, offset, count, port, address);
-        }
+        return "Socket[address=" + getInetAddress() +
+                ",port=" + port + ",localPort=" + getLocalPort() + "]";
     }
 
     /**
      * Closes the input channel of this socket.
-     * <p>
-     * This default implementation always throws an {@link IOException} to
+     *
+     * <p>This default implementation always throws an {@link IOException} to
      * indicate that the subclass should have overridden this method.
      *
      * @throws IOException
@@ -257,8 +229,8 @@
 
     /**
      * Closes the output channel of this socket.
-     * <p>
-     * This default implementation always throws an {@link IOException} to
+     *
+     * <p>This default implementation always throws an {@link IOException} to
      * indicate that the subclass should have overridden this method.
      *
      * @throws IOException
@@ -280,8 +252,7 @@
      * @throws IOException
      *             if an error occurs while connecting.
      */
-    protected abstract void connect(SocketAddress remoteAddr, int timeout)
-            throws IOException;
+    protected abstract void connect(SocketAddress remoteAddr, int timeout) throws IOException;
 
     /**
      * Returns whether the socket supports urgent data or not. Subclasses should
@@ -314,9 +285,6 @@
      * @param bandwidth
      *            the importance of bandwidth.
      */
-    protected void setPerformancePreferences(int connectionTime, int latency,
-            int bandwidth) {
-        // Our socket implementation only provide one protocol: TCP/IP, so
-        // we do nothing for this method
+    protected void setPerformancePreferences(int connectionTime, int latency, int bandwidth) {
     }
 }
diff --git a/luni/src/main/java/java/net/SocketPermission.java b/luni/src/main/java/java/net/SocketPermission.java
index a4dd942..c63872e 100644
--- a/luni/src/main/java/java/net/SocketPermission.java
+++ b/luni/src/main/java/java/net/SocketPermission.java
@@ -23,6 +23,7 @@
 import java.io.Serializable;
 import java.security.Permission;
 import java.security.PermissionCollection;
+import java.util.Locale;
 
 /**
  * Regulates the access to network operations available through sockets through
@@ -74,7 +75,6 @@
 
     // list of actions permitted for socket permission in order, indexed by mask
     // value
-    @SuppressWarnings("nls")
     private static final String[] actionNames = { "", "connect", "listen", "",
             "accept", "", "", "", "resolve" };
 
@@ -219,7 +219,7 @@
             if (pos == length) {
                 parsing = false;
             }
-            action = sb.toString().trim().toLowerCase();
+            action = sb.toString().trim().toLowerCase(Locale.US);
             if (action.equals(actionNames[SP_CONNECT])) {
                 actionsMask |= SP_CONNECT;
             } else if (action.equals(actionNames[SP_LISTEN])) {
@@ -376,7 +376,7 @@
     private String getIPString(boolean isCheck) {
         if (!resolved) {
             try {
-                ipString = InetAddress.getHostNameInternal(hostName, isCheck);
+                ipString = InetAddress.getHostNameInternal(hostName);
             } catch (UnknownHostException e) {
                 // ignore
             }
@@ -415,7 +415,7 @@
             if (idx > -1) {
                 host = host.substring(0, idx);
             }
-            return host.toLowerCase();
+            return host.toLowerCase(Locale.US);
         }
 
         int lastIdx = host.lastIndexOf(':');
@@ -425,7 +425,7 @@
                 // only one colon, should be port
                 host = host.substring(0, idx);
             }
-            return host.toLowerCase();
+            return host.toLowerCase(Locale.US);
         }
         // maybe IPv6
         boolean isFirstBracket = (host.charAt(0) == '[');
@@ -442,7 +442,7 @@
                 host = host.substring(0, lastIdx);
             }
             if (isIP6AddressInFullForm(host)) {
-                return host.toLowerCase();
+                return host.toLowerCase(Locale.US);
             }
             throw new IllegalArgumentException("Invalid port number: " + host);
         }
@@ -454,7 +454,7 @@
         }
         host = host.substring(0, bbracketIdx + 1);
         if (isValidIP6Address(host)) {
-            return host.toLowerCase();
+            return host.toLowerCase(Locale.US);
         }
         throw new IllegalArgumentException("Invalid port number: " + host);
     }
diff --git a/luni/src/main/java/java/net/SocketPermissionCollection.java b/luni/src/main/java/java/net/SocketPermissionCollection.java
index 60bb831..545782b 100644
--- a/luni/src/main/java/java/net/SocketPermissionCollection.java
+++ b/luni/src/main/java/java/net/SocketPermissionCollection.java
@@ -35,7 +35,6 @@
 
     // Constructs a new instance of this class.
     public SocketPermissionCollection() {
-        super();
     }
 
     // Adds the argument to the collection.
diff --git a/luni/src/main/java/java/net/SocketTimeoutException.java b/luni/src/main/java/java/net/SocketTimeoutException.java
index 9d5943f..8ce324a 100644
--- a/luni/src/main/java/java/net/SocketTimeoutException.java
+++ b/luni/src/main/java/java/net/SocketTimeoutException.java
@@ -32,7 +32,6 @@
      * filled in.
      */
     public SocketTimeoutException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java b/luni/src/main/java/java/net/Socks4Message.java
similarity index 94%
rename from luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java
rename to luni/src/main/java/java/net/Socks4Message.java
index 065e205..c193520 100644
--- a/luni/src/main/java/org/apache/harmony/luni/net/Socks4Message.java
+++ b/luni/src/main/java/java/net/Socks4Message.java
@@ -15,11 +15,11 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.net;
+package java.net;
 
 import java.nio.ByteOrder;
 import java.nio.charset.Charsets;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 class Socks4Message {
     static final int COMMAND_CONNECT = 1;
@@ -55,7 +55,6 @@
     protected byte[] buffer;
 
     public Socks4Message() {
-        super();
         buffer = new byte[BUFFER_LENGTH];
         setVersionNumber(SOCKS_VERSION);
     }
@@ -78,21 +77,21 @@
      * Returns the request's port number.
      */
     public int getPort() {
-        return OSMemory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN);
+        return Memory.peekShort(buffer, INDEX_PORT, ByteOrder.BIG_ENDIAN);
     }
 
     /**
      * Set the request's port number.
      */
     public void setPort(int port) {
-        OSMemory.pokeShort(buffer, INDEX_PORT, (short) port, ByteOrder.BIG_ENDIAN);
+        Memory.pokeShort(buffer, INDEX_PORT, (short) port, ByteOrder.BIG_ENDIAN);
     }
 
     /**
      * Returns the IP address of the request as an integer.
      */
     public int getIP() {
-        return OSMemory.peekInt(buffer, INDEX_IP, ByteOrder.BIG_ENDIAN);
+        return Memory.peekInt(buffer, INDEX_IP, ByteOrder.BIG_ENDIAN);
     }
 
     /**
diff --git a/luni/src/main/java/java/net/URI.java b/luni/src/main/java/java/net/URI.java
index da68970..0001236 100644
--- a/luni/src/main/java/java/net/URI.java
+++ b/luni/src/main/java/java/net/URI.java
@@ -21,10 +21,8 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.util.StringTokenizer;
-import org.apache.harmony.luni.platform.INetworkSystem;
-import org.apache.harmony.luni.platform.Platform;
+import java.util.Locale;
+import libcore.net.UriCodec;
 
 /**
  * This class represents an instance of a URI as defined by RFC 2396.
@@ -35,9 +33,47 @@
 
     static final String UNRESERVED = "_-!.~\'()*";
     static final String PUNCTUATION = ",;:$&+=";
-    static final String RESERVED = PUNCTUATION + "?/[]@";
-    static final String SOME_LEGAL = UNRESERVED + PUNCTUATION;
-    static final String ALL_LEGAL = UNRESERVED + RESERVED;
+
+    static final UriCodec USER_INFO_ENCODER = new PartEncoder("");
+    static final UriCodec PATH_ENCODER = new PartEncoder("/@");
+    static final UriCodec AUTHORITY_ENCODER = new PartEncoder("@[]");
+
+    /** for java.net.URL, which foolishly combines these two parts */
+    static final UriCodec FILE_AND_QUERY_ENCODER = new PartEncoder("/@?");
+
+    /** for query, fragment, and scheme-specific part */
+    static final UriCodec ALL_LEGAL_ENCODER = new PartEncoder("?/[]@");
+
+    /** Retains all ASCII chars including delimiters. */
+    private static final UriCodec ASCII_ONLY = new UriCodec() {
+        @Override protected boolean isRetained(char c) {
+            return c <= 127;
+        }
+    };
+
+    /**
+     * Encodes the unescaped characters of {@code s} that are not permitted.
+     * Permitted characters are:
+     * <ul>
+     *   <li>Unreserved characters in RFC 2396.
+     *   <li>{@code extraOkayChars},
+     *   <li>non-ASCII, non-control, non-whitespace characters
+     * </ul>
+     */
+    private static class PartEncoder extends UriCodec {
+        private final String extraLegalCharacters;
+
+        PartEncoder(String extraLegalCharacters) {
+            this.extraLegalCharacters = extraLegalCharacters;
+        }
+
+        @Override protected boolean isRetained(char c) {
+            return UNRESERVED.indexOf(c) != -1
+                    || PUNCTUATION.indexOf(c) != -1
+                    || extraLegalCharacters.indexOf(c) != -1
+                    || (c > 127 && !Character.isSpaceChar(c) && !Character.isISOControl(c));
+        }
+    }
 
     private String string;
     private transient String scheme;
@@ -95,13 +131,11 @@
             uri.append(':');
         }
         if (ssp != null) {
-            // QUOTE ILLEGAL CHARACTERS
-            uri.append(quoteComponent(ssp, ALL_LEGAL));
+            ALL_LEGAL_ENCODER.appendEncoded(uri, ssp);
         }
         if (frag != null) {
             uri.append('#');
-            // QUOTE ILLEGAL CHARACTERS
-            uri.append(quoteComponent(frag, ALL_LEGAL));
+            ALL_LEGAL_ENCODER.appendEncoded(uri, frag);
         }
 
         parseURI(uri.toString(), false);
@@ -160,8 +194,7 @@
         }
 
         if (userInfo != null) {
-            // QUOTE ILLEGAL CHARACTERS in userInfo
-            uri.append(quoteComponent(userInfo, SOME_LEGAL));
+            USER_INFO_ENCODER.appendEncoded(uri, userInfo);
             uri.append('@');
         }
 
@@ -181,20 +214,17 @@
         }
 
         if (path != null) {
-            // QUOTE ILLEGAL CHARS
-            uri.append(quoteComponent(path, "/@" + SOME_LEGAL));
+            PATH_ENCODER.appendEncoded(uri, path);
         }
 
         if (query != null) {
             uri.append('?');
-            // QUOTE ILLEGAL CHARS
-            uri.append(quoteComponent(query, ALL_LEGAL));
+            ALL_LEGAL_ENCODER.appendEncoded(uri, query);
         }
 
         if (fragment != null) {
-            // QUOTE ILLEGAL CHARS
             uri.append('#');
-            uri.append(quoteComponent(fragment, ALL_LEGAL));
+            ALL_LEGAL_ENCODER.appendEncoded(uri, fragment);
         }
 
         parseURI(uri.toString(), true);
@@ -260,23 +290,19 @@
         }
         if (authority != null) {
             uri.append("//");
-            // QUOTE ILLEGAL CHARS
-            uri.append(quoteComponent(authority, "@[]" + SOME_LEGAL));
+            AUTHORITY_ENCODER.appendEncoded(uri, authority);
         }
 
         if (path != null) {
-            // QUOTE ILLEGAL CHARS
-            uri.append(quoteComponent(path, "/@" + SOME_LEGAL));
+            PATH_ENCODER.appendEncoded(uri, path);
         }
         if (query != null) {
-            // QUOTE ILLEGAL CHARS
             uri.append('?');
-            uri.append(quoteComponent(query, ALL_LEGAL));
+            ALL_LEGAL_ENCODER.appendEncoded(uri, query);
         }
         if (fragment != null) {
-            // QUOTE ILLEGAL CHARS
             uri.append('#');
-            uri.append(quoteComponent(fragment, ALL_LEGAL));
+            ALL_LEGAL_ENCODER.appendEncoded(uri, fragment);
         }
 
         parseURI(uri.toString(), false);
@@ -390,7 +416,7 @@
         }
 
         try {
-            URIEncoderDecoder.validateSimple(scheme, "+-.");
+            UriCodec.validateSimple(scheme, "+-.");
         } catch (URISyntaxException e) {
             throw new URISyntaxException(uri, "Illegal character in scheme", index + e.getIndex());
         }
@@ -399,7 +425,7 @@
     private void validateSsp(String uri, String ssp, int index)
             throws URISyntaxException {
         try {
-            URIEncoderDecoder.validate(ssp, ALL_LEGAL);
+            ALL_LEGAL_ENCODER.validate(ssp);
         } catch (URISyntaxException e) {
             throw new URISyntaxException(uri,
                     e.getReason() + " in schemeSpecificPart", index + e.getIndex());
@@ -409,7 +435,7 @@
     private void validateAuthority(String uri, String authority, int index)
             throws URISyntaxException {
         try {
-            URIEncoderDecoder.validate(authority, "@[]" + SOME_LEGAL);
+            AUTHORITY_ENCODER.validate(authority);
         } catch (URISyntaxException e) {
             throw new URISyntaxException(uri, e.getReason() + " in authority", index + e.getIndex());
         }
@@ -418,7 +444,7 @@
     private void validatePath(String uri, String path, int index)
             throws URISyntaxException {
         try {
-            URIEncoderDecoder.validate(path, "/@" + SOME_LEGAL);
+            PATH_ENCODER.validate(path);
         } catch (URISyntaxException e) {
             throw new URISyntaxException(uri, e.getReason() + " in path", index + e.getIndex());
         }
@@ -427,7 +453,7 @@
     private void validateQuery(String uri, String query, int index)
             throws URISyntaxException {
         try {
-            URIEncoderDecoder.validate(query, ALL_LEGAL);
+            ALL_LEGAL_ENCODER.validate(query);
         } catch (URISyntaxException e) {
             throw new URISyntaxException(uri, e.getReason() + " in query", index + e.getIndex());
 
@@ -437,7 +463,7 @@
     private void validateFragment(String uri, String fragment, int index)
             throws URISyntaxException {
         try {
-            URIEncoderDecoder.validate(fragment, ALL_LEGAL);
+            ALL_LEGAL_ENCODER.validate(fragment);
         } catch (URISyntaxException e) {
             throw new URISyntaxException(uri, e.getReason() + " in fragment", index + e.getIndex());
         }
@@ -588,15 +614,14 @@
 
     private boolean isValidDomainName(String host) {
         try {
-            URIEncoderDecoder.validateSimple(host, "-.");
+            UriCodec.validateSimple(host, "-.");
         } catch (URISyntaxException e) {
             return false;
         }
 
         String lastLabel = null;
-        StringTokenizer st = new StringTokenizer(host, ".");
-        while (st.hasMoreTokens()) {
-            lastLabel = st.nextToken();
+        for (String token : host.split("\\.")) {
+            lastLabel = token;
             if (lastLabel.startsWith("-") || lastLabel.endsWith("-")) {
                 return false;
             }
@@ -616,27 +641,6 @@
     }
 
     /**
-     * Quote illegal chars for each component, but not the others
-     *
-     * @param component java.lang.String the component to be converted
-     * @param legalSet the legal character set allowed in the component
-     * @return java.lang.String the converted string
-     */
-    private String quoteComponent(String component, String legalSet) {
-        try {
-            /*
-             * Use a different encoder than URLEncoder since: 1. chars like "/",
-             * "#", "@" etc needs to be preserved instead of being encoded, 2.
-             * UTF-8 char set needs to be used for encoding instead of default
-             * platform one
-             */
-            return URIEncoderDecoder.quoteIllegal(component, legalSet);
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e.toString());
-        }
-    }
-
-    /**
      * Compares this URI with the given argument {@code uri}. This method will
      * return a negative value if this URI instance is less than the given
      * argument and a positive value if this URI instance is greater than the
@@ -800,7 +804,7 @@
         int index, prevIndex = 0;
         while ((index = s.indexOf('%', prevIndex)) != -1) {
             result.append(s.substring(prevIndex, index + 1));
-            result.append(s.substring(index + 1, index + 3).toLowerCase());
+            result.append(s.substring(index + 1, index + 3).toLowerCase(Locale.US));
             index += 3;
             prevIndex = index;
         }
@@ -1399,36 +1403,8 @@
         return resolve(create(relative));
     }
 
-    /**
-     * Encode unicode chars that are not part of US-ASCII char set into the
-     * escaped form
-     *
-     * i.e. The Euro currency symbol is encoded as "%E2%82%AC".
-     */
-    private String encodeNonAscii(String s) {
-        try {
-            /*
-             * Use a different encoder than URLEncoder since: 1. chars like "/",
-             * "#", "@" etc needs to be preserved instead of being encoded, 2.
-             * UTF-8 char set needs to be used for encoding instead of default
-             * platform one 3. Only other chars need to be converted
-             */
-            return URIEncoderDecoder.encodeOthers(s);
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e.toString());
-        }
-    }
-
     private String decode(String s) {
-        if (s == null) {
-            return s;
-        }
-
-        try {
-            return URIEncoderDecoder.decode(s);
-        } catch (UnsupportedEncodingException e) {
-            throw new RuntimeException(e.toString());
-        }
+        return s != null ? UriCodec.decode(s) : null;
     }
 
     /**
@@ -1438,7 +1414,9 @@
      * @return the US-ASCII string representation of this URI.
      */
     public String toASCIIString() {
-        return encodeNonAscii(toString());
+        StringBuilder result = new StringBuilder();
+        ASCII_ONLY.appendEncoded(result, toString());
+        return result.toString();
     }
 
     /**
@@ -1490,7 +1468,7 @@
     private String getHashString() {
         StringBuilder result = new StringBuilder();
         if (scheme != null) {
-            result.append(scheme.toLowerCase());
+            result.append(scheme.toLowerCase(Locale.US));
             result.append(':');
         }
         if (opaque) {
@@ -1504,7 +1482,7 @@
                     if (userInfo != null) {
                         result.append(userInfo + "@");
                     }
-                    result.append(host.toLowerCase());
+                    result.append(host.toLowerCase(Locale.US));
                     if (port != -1) {
                         result.append(":" + port);
                     }
diff --git a/luni/src/main/java/java/net/URIEncoderDecoder.java b/luni/src/main/java/java/net/URIEncoderDecoder.java
deleted file mode 100644
index bccef8c..0000000
--- a/luni/src/main/java/java/net/URIEncoderDecoder.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package java.net;
-
-import java.io.ByteArrayOutputStream;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charsets;
-
-/**
- * This class is used to encode a string using the format required by {@code
- * application/x-www-form-urlencoded} MIME content type. It contains helper
- * methods used by the URI class, and performs encoding and decoding in a
- * slightly different way than {@code URLEncoder} and {@code URLDecoder}.
- */
-class URIEncoderDecoder {
-
-    static final String digits = "0123456789ABCDEF";
-
-    /**
-     * Validate a string by checking if it contains any characters other than:
-     * 1. letters ('a'..'z', 'A'..'Z') 2. numbers ('0'..'9') 3. characters in
-     * the legalset parameter 4. others (unicode characters that are not in
-     * US-ASCII set, and are not ISO Control or are not ISO Space characters)
-     * <p>
-     * called from {@code URI.Helper.parseURI()} to validate each component
-     *
-     * @param s
-     *            {@code java.lang.String} the string to be validated
-     * @param legal
-     *            {@code java.lang.String} the characters allowed in the String
-     *            s
-     */
-    static void validate(String s, String legal) throws URISyntaxException {
-        for (int i = 0; i < s.length();) {
-            char ch = s.charAt(i);
-            if (ch == '%') {
-                do {
-                    if (i + 2 >= s.length()) {
-                        throw new URISyntaxException(s, "Incomplete % sequence", i);
-                    }
-                    int d1 = Character.digit(s.charAt(i + 1), 16);
-                    int d2 = Character.digit(s.charAt(i + 2), 16);
-                    if (d1 == -1 || d2 == -1) {
-                        throw new URISyntaxException(s, "Invalid % sequence: " +
-                                s.substring(i, i + 3), i);
-                    }
-
-                    i += 3;
-                } while (i < s.length() && s.charAt(i) == '%');
-
-                continue;
-            }
-            if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
-                    || (ch >= '0' && ch <= '9') || legal.indexOf(ch) > -1 || (ch > 127
-                    && !Character.isSpaceChar(ch) && !Character
-                    .isISOControl(ch)))) {
-                throw new URISyntaxException(s, "Illegal character", i);
-            }
-            i++;
-        }
-    }
-
-    static void validateSimple(String s, String legal)
-            throws URISyntaxException {
-        for (int i = 0; i < s.length();) {
-            char ch = s.charAt(i);
-            if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
-                    || (ch >= '0' && ch <= '9') || legal.indexOf(ch) > -1)) {
-                throw new URISyntaxException(s, "Illegal character", i);
-            }
-            i++;
-        }
-    }
-
-    /**
-     * All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9')
-     * and legal characters are converted into their hexidecimal value prepended
-     * by '%'.
-     * <p>
-     * For example: '#' -> %23
-     * Other characters, which are unicode chars that are not US-ASCII, and are
-     * not ISO Control or are not ISO Space chars, are preserved.
-     * <p>
-     * Called from {@code URI.quoteComponent()} (for multiple argument
-     * constructors)
-     *
-     * @param s
-     *            java.lang.String the string to be converted
-     * @param legal
-     *            java.lang.String the characters allowed to be preserved in the
-     *            string s
-     * @return java.lang.String the converted string
-     */
-    static String quoteIllegal(String s, String legal)
-            throws UnsupportedEncodingException {
-        StringBuilder buf = new StringBuilder();
-        for (int i = 0; i < s.length(); i++) {
-            char ch = s.charAt(i);
-            if ((ch >= 'a' && ch <= 'z')
-                    || (ch >= 'A' && ch <= 'Z')
-                    || (ch >= '0' && ch <= '9')
-                    || legal.indexOf(ch) > -1
-                    || (ch > 127 && !Character.isSpaceChar(ch) && !Character
-                            .isISOControl(ch))) {
-                buf.append(ch);
-            } else {
-                byte[] bytes = new String(new char[] { ch }).getBytes(Charsets.UTF_8);
-                for (int j = 0; j < bytes.length; j++) {
-                    buf.append('%');
-                    buf.append(digits.charAt((bytes[j] & 0xf0) >> 4));
-                    buf.append(digits.charAt(bytes[j] & 0xf));
-                }
-            }
-        }
-        return buf.toString();
-    }
-
-    /**
-     * Other characters, which are Unicode chars that are not US-ASCII, and are
-     * not ISO Control or are not ISO Space chars are not preserved. They are
-     * converted into their hexidecimal value prepended by '%'.
-     * <p>
-     * For example: Euro currency symbol -> "%E2%82%AC".
-     * <p>
-     * Called from URI.toASCIIString()
-     *
-     * @param s
-     *            java.lang.String the string to be converted
-     * @return java.lang.String the converted string
-     */
-    static String encodeOthers(String s) throws UnsupportedEncodingException {
-        StringBuilder buf = new StringBuilder();
-        for (int i = 0; i < s.length(); i++) {
-            char ch = s.charAt(i);
-            if (ch <= 127) {
-                buf.append(ch);
-            } else {
-                byte[] bytes = new String(new char[] { ch }).getBytes(Charsets.UTF_8);
-                for (int j = 0; j < bytes.length; j++) {
-                    buf.append('%');
-                    buf.append(digits.charAt((bytes[j] & 0xf0) >> 4));
-                    buf.append(digits.charAt(bytes[j] & 0xf));
-                }
-            }
-        }
-        return buf.toString();
-    }
-
-    /**
-     * Decodes the string argument which is assumed to be encoded in the {@code
-     * x-www-form-urlencoded} MIME content type using the UTF-8 encoding scheme.
-     * <p>
-     *'%' and two following hex digit characters are converted to the
-     * equivalent byte value. All other characters are passed through
-     * unmodified.
-     * <p>
-     * e.g. "A%20B%20C %24%25" -> "A B C $%"
-     * <p>
-     * Called from URI.getXYZ() methods
-     *
-     * @param s
-     *            java.lang.String The encoded string.
-     * @return java.lang.String The decoded version.
-     */
-    static String decode(String s) throws UnsupportedEncodingException {
-
-        StringBuilder result = new StringBuilder();
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        for (int i = 0; i < s.length();) {
-            char c = s.charAt(i);
-            if (c == '%') {
-                out.reset();
-                do {
-                    if (i + 2 >= s.length()) {
-                        throw new IllegalArgumentException("Incomplete % sequence at: " + i);
-                    }
-                    int d1 = Character.digit(s.charAt(i + 1), 16);
-                    int d2 = Character.digit(s.charAt(i + 2), 16);
-                    if (d1 == -1 || d2 == -1) {
-                        throw new IllegalArgumentException("Invalid % sequence " +
-                                s.substring(i, i + 3) + " at " + i);
-                    }
-                    out.write((byte) ((d1 << 4) + d2));
-                    i += 3;
-                } while (i < s.length() && s.charAt(i) == '%');
-                result.append(out.toString("UTF-8"));
-                continue;
-            }
-            result.append(c);
-            i++;
-        }
-        return result.toString();
-    }
-
-}
diff --git a/luni/src/main/java/java/net/URL.java b/luni/src/main/java/java/net/URL.java
index 947762b..8db1bdd 100644
--- a/luni/src/main/java/java/net/URL.java
+++ b/luni/src/main/java/java/net/URL.java
@@ -20,11 +20,13 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectOutputStream;
-import java.security.AccessController;
 import java.util.Hashtable;
-import java.util.StringTokenizer;
-import org.apache.harmony.luni.util.PriviAction;
-import org.apache.harmony.luni.util.Util;
+import java.util.Locale;
+import libcore.net.http.HttpHandler;
+import libcore.net.http.HttpsHandler;
+import libcore.net.url.FileHandler;
+import libcore.net.url.FtpHandler;
+import libcore.net.url.JarHandler;
 
 /**
  * A URL instance specifies the location of a resource on the internet as
@@ -107,7 +109,8 @@
     /**
      * Cache for storing protocol handler
      */
-    private static Hashtable<String, URLStreamHandler> streamHandlers = new Hashtable<String, URLStreamHandler>();
+    private static final Hashtable<String, URLStreamHandler> streamHandlers
+            = new Hashtable<String, URLStreamHandler>();
 
     /**
      * The URL Stream (protocol) Handler
@@ -136,10 +139,6 @@
         if (streamHandlerFactory != null) {
             throw new Error("Factory already set");
         }
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSetFactory();
-        }
         streamHandlers.clear();
         streamHandlerFactory = streamFactory;
     }
@@ -195,13 +194,8 @@
      *             if the given string {@code spec} could not be parsed as a URL
      *             or an invalid protocol has been found.
      */
-    public URL(URL context, String spec, URLStreamHandler handler)
-            throws MalformedURLException {
+    public URL(URL context, String spec, URLStreamHandler handler) throws MalformedURLException {
         if (handler != null) {
-            SecurityManager sm = System.getSecurityManager();
-            if (sm != null) {
-                sm.checkPermission(specifyStreamHandlerPermission);
-            }
             strmHandler = handler;
         }
 
@@ -241,9 +235,8 @@
                     protocol = null;
                     index = -1;
                 } else {
-                    // Ignore case in protocol names.
-                    // Scheme is defined by ASCII characters.
-                    protocol = Util.toASCIILowerCase(protocol);
+                    // Ignore case in protocol names. Scheme is defined by ASCII characters.
+                    protocol = protocol.toLowerCase(Locale.US);
                 }
             }
         }
@@ -367,10 +360,6 @@
      * @throws MalformedURLException
      *             if the combination of all arguments do not represent a valid
      *             URL or the protocol is invalid.
-     * @throws SecurityException
-     *             if {@code handler} is non-{@code null}, and a security
-     *             manager is installed that disallows user-defined protocol
-     *             handlers.
      */
     public URL(String protocol, String host, int port, String file,
             URLStreamHandler handler) throws MalformedURLException {
@@ -411,10 +400,6 @@
                 throw new MalformedURLException("Unknown protocol: " + protocol);
             }
         } else {
-            SecurityManager sm = System.getSecurityManager();
-            if (sm != null) {
-                sm.checkPermission(specifyStreamHandlerPermission);
-            }
             strmHandler = handler;
         }
     }
@@ -474,21 +459,34 @@
     }
 
     /**
-     * Compares this URL instance with the given argument {@code o} and
-     * determines if both are equal. Two URL instances are equal if all single
-     * parts are identical in their meaning. Compares the argument to the
-     * receiver, and returns true if they represent the same URL. Two URLs are
-     * equal if they have the same file, host, port, protocol, and reference
-     * components.
+     * Returns true if this URL equals {@code o}. URLs are equal if they have
+     * the same protocol, host, port, file, and reference.
      *
-     * @param o
-     *            the URL this instance has to be compared with.
-     * @return {@code true} if both instances represents the same URL, {@code
-     *         false} otherwise.
-     * @see #hashCode()
+     * <h3>Network I/O Warning</h3>
+     * <p>Some implementations of URL.equals() resolve host names over the
+     * network. This is problematic:
+     * <ul>
+     * <li><strong>The network may be slow.</strong> Many classes, including
+     * core collections like {@link java.util.Map Map} and {@link java.util.Set
+     * Set} expect that {@code equals} and {@code hashCode} will return quickly.
+     * By violating this assumption, this method posed potential performance
+     * problems.
+     * <li><strong>Equal IP addresses do not imply equal content.</strong>
+     * Virtual hosting permits unrelated sites to share an IP address. This
+     * method could report two otherwise unrelated URLs to be equal because
+     * they're hosted on the same server.</li>
+     * <li><strong>The network many not be available.</strong> Two URLs could be
+     * equal when a network is available and unequal otherwise.</li>
+     * <li><strong>The network may change.</strong> The IP address for a given
+     * host name varies by network and over time. This is problematic for mobile
+     * devices. Two URLs could be equal on some networks and unequal on
+     * others.</li>
+     * </ul>
+     * <p>This problem is fixed in Android in the Ice Cream Sandwich release. In
+     * that release, URLs are only equal if their host names are equal (ignoring
+     * case).
      */
-    @Override
-    public boolean equals(Object o) {
+    @Override public boolean equals(Object o) {
         if (o == null) {
             return false;
         }
@@ -557,44 +555,39 @@
 
         // Check if there is a list of packages which can provide handlers.
         // If so, then walk this list looking for an applicable one.
-        String packageList = AccessController
-                .doPrivileged(new PriviAction<String>(
-                        "java.protocol.handler.pkgs"));
+        String packageList = System.getProperty("java.protocol.handler.pkgs");
         if (packageList != null) {
-            StringTokenizer st = new StringTokenizer(packageList, "|");
-            while (st.hasMoreTokens()) {
-                String className = st.nextToken() + "." + protocol + ".Handler";
-
+            for (String packageName : packageList.split("\\|")) {
+                String className = packageName + "." + protocol + ".Handler";
                 try {
-                    strmHandler = (URLStreamHandler) Class.forName(className,
-                            true, ClassLoader.getSystemClassLoader())
-                            .newInstance();
+                    Class<?> klass = Class.forName(className, true, ClassLoader.getSystemClassLoader());
+                    strmHandler = (URLStreamHandler) klass.newInstance();
                     if (strmHandler != null) {
                         streamHandlers.put(protocol, strmHandler);
                     }
                     return;
-                } catch (IllegalAccessException e) {
-                } catch (InstantiationException e) {
-                } catch (ClassNotFoundException e) {
+                } catch (IllegalAccessException ignored) {
+                } catch (InstantiationException ignored) {
+                } catch (ClassNotFoundException ignored) {
                 }
             }
         }
 
-        // No one else has provided a handler, so try our internal one.
-
-        String className = "org.apache.harmony.luni.internal.net.www.protocol." + protocol
-                + ".Handler";
-        try {
-            strmHandler = (URLStreamHandler) Class.forName(className)
-                    .newInstance();
-        } catch (IllegalAccessException e) {
-        } catch (InstantiationException e) {
-        } catch (ClassNotFoundException e) {
+        // Fall back to a built-in stream handler if the user didn't supply one
+        if (protocol.equals("file")) {
+            strmHandler = new FileHandler();
+        } else if (protocol.equals("ftp")) {
+            strmHandler = new FtpHandler();
+        } else if (protocol.equals("http")) {
+            strmHandler = new HttpHandler();
+        } else if (protocol.equals("https")) {
+            strmHandler = new HttpsHandler();
+        } else if (protocol.equals("jar")) {
+            strmHandler = new JarHandler();
         }
         if (strmHandler != null) {
             streamHandlers.put(protocol, strmHandler);
         }
-
     }
 
     /**
@@ -692,9 +685,6 @@
      *         connection to this URL.
      * @throws IOException
      *             if an I/O error occurs while opening the connection.
-     * @throws SecurityException
-     *             if a security manager is installed and it denies to connect
-     *             to the proxy.
      * @throws IllegalArgumentException
      *             if the argument proxy is {@code null} or is an invalid type.
      * @throws UnsupportedOperationException
@@ -705,15 +695,6 @@
         if (proxy == null) {
             throw new IllegalArgumentException("proxy == null");
         }
-
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null && proxy.type() != Proxy.Type.DIRECT) {
-            InetSocketAddress pAddress = (InetSocketAddress) proxy.address();
-            String pHostName = pAddress.isUnresolved() ? pAddress.getHostName()
-                    : pAddress.getAddress().getHostAddress();
-            sm.checkConnect(pHostName, pAddress.getPort());
-        }
-
         return strmHandler.openConnection(this, proxy);
     }
 
diff --git a/luni/src/main/java/java/net/URLClassLoader.java b/luni/src/main/java/java/net/URLClassLoader.java
index 6929834..735793c 100644
--- a/luni/src/main/java/java/net/URLClassLoader.java
+++ b/luni/src/main/java/java/net/URLClassLoader.java
@@ -18,7 +18,6 @@
 package java.net;
 
 import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -27,11 +26,9 @@
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.UnsupportedEncodingException;
-import java.security.AccessControlContext;
-import java.security.AccessController;
+import java.nio.charset.Charsets;
 import java.security.CodeSource;
 import java.security.PermissionCollection;
-import java.security.PrivilegedAction;
 import java.security.SecureClassLoader;
 import java.security.cert.Certificate;
 import java.util.ArrayList;
@@ -46,6 +43,7 @@
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
 import libcore.io.IoUtils;
+import libcore.io.Streams;
 
 /**
  * This class loader is responsible for loading classes and resources from a
@@ -63,53 +61,6 @@
 
     private URLStreamHandlerFactory factory;
 
-    private AccessControlContext currentContext;
-
-    static class SubURLClassLoader extends URLClassLoader {
-        // The subclass that overwrites the loadClass() method
-        private boolean checkingPackageAccess = false;
-
-        SubURLClassLoader(URL[] urls) {
-            super(urls, ClassLoader.getSystemClassLoader());
-        }
-
-        SubURLClassLoader(URL[] urls, ClassLoader parent) {
-            super(urls, parent);
-        }
-
-        /**
-         * Overrides the {@code loadClass()} of {@code ClassLoader}. It calls
-         * the security manager's {@code checkPackageAccess()} before
-         * attempting to load the class.
-         *
-         * @return the Class object.
-         * @param className
-         *            String the name of the class to search for.
-         * @param resolveClass
-         *            boolean indicates if class should be resolved after
-         *            loading.
-         * @throws ClassNotFoundException
-         *             If the class could not be found.
-         */
-        @Override
-        protected synchronized Class<?> loadClass(String className,
-                                                  boolean resolveClass) throws ClassNotFoundException {
-            SecurityManager sm = System.getSecurityManager();
-            if (sm != null && !checkingPackageAccess) {
-                int index = className.lastIndexOf('.');
-                if (index > 0) { // skip if class is from a default package
-                    try {
-                        checkingPackageAccess = true;
-                        sm.checkPackageAccess(className.substring(0, index));
-                    } finally {
-                        checkingPackageAccess = false;
-                    }
-                }
-            }
-            return super.loadClass(className, resolveClass);
-        }
-    }
-
     static class IndexFile {
 
         private HashMap<String, ArrayList<URL>> map;
@@ -122,10 +73,9 @@
             try {
                 // Add mappings from resource to jar file
                 String parentURLString = getParentURL(url).toExternalForm();
-                String prefix = "jar:"
-                        + parentURLString + "/";
+                String prefix = "jar:" + parentURLString + "/";
                 is = jf.getInputStream(indexEntry);
-                in = new BufferedReader(new InputStreamReader(is, "UTF8"));
+                in = new BufferedReader(new InputStreamReader(is, Charsets.UTF_8));
                 HashMap<String, ArrayList<URL>> pre_map = new HashMap<String, ArrayList<URL>>();
                 // Ignore the 2 first lines (index version)
                 if (in.readLine() == null) return null;
@@ -274,13 +224,12 @@
 
         URL targetURL(URL base, String name) {
             try {
-                String file = base.getFile() + URIEncoderDecoder.quoteIllegal(name,
-                        "/@" + URI.SOME_LEGAL);
+                StringBuilder fileBuilder = new StringBuilder();
+                fileBuilder.append(base.getFile());
+                URI.PATH_ENCODER.appendEncoded(fileBuilder, name);
+                String file = fileBuilder.toString();
 
-                return new URL(base.getProtocol(), base.getHost(), base.getPort(),
-                        file, null);
-            } catch (UnsupportedEncodingException e) {
-                return null;
+                return new URL(base.getProtocol(), base.getHost(), base.getPort(), file, null);
             } catch (MalformedURLException e) {
                 return null;
             }
@@ -590,10 +539,6 @@
      * @param urls
      *            the list of URLs where a specific class or file could be
      *            found.
-     * @throws SecurityException
-     *             if a security manager exists and its {@code
-     *             checkCreateClassLoader()} method doesn't allow creation of
-     *             new ClassLoaders.
      */
     public URLClassLoader(URL[] urls) {
         this(urls, ClassLoader.getSystemClassLoader(), null);
@@ -609,10 +554,6 @@
      *            found.
      * @param parent
      *            the class loader to assign as this loader's parent.
-     * @throws SecurityException
-     *             if a security manager exists and its {@code
-     *             checkCreateClassLoader()} method doesn't allow creation of
-     *             new class loaders.
      */
     public URLClassLoader(URL[] urls, ClassLoader parent) {
         this(urls, parent, null);
@@ -646,33 +587,7 @@
         if (name == null) {
             return null;
         }
-        ArrayList<URL> result = AccessController.doPrivileged(
-                new PrivilegedAction<ArrayList<URL>>() {
-                    public ArrayList<URL> run() {
-                        ArrayList<URL> results = new ArrayList<URL>();
-                        findResourcesImpl(name, results);
-                        return results;
-                    }
-                }, currentContext);
-        SecurityManager sm;
-        int length = result.size();
-        if (length > 0 && (sm = System.getSecurityManager()) != null) {
-            ArrayList<URL> reduced = new ArrayList<URL>(length);
-            for (int i = 0; i < length; i++) {
-                URL url = result.get(i);
-                try {
-                    sm.checkPermission(url.openConnection().getPermission());
-                    reduced.add(url);
-                } catch (IOException e) {
-                } catch (SecurityException e) {
-                }
-            }
-            result = reduced;
-        }
-        return Collections.enumeration(result);
-    }
-
-    void findResourcesImpl(String name, ArrayList<URL> result) {
+        ArrayList<URL> result = new ArrayList<URL>();
         int n = 0;
         while (true) {
             URLHandler handler = getHandler(n++);
@@ -681,9 +596,9 @@
             }
             handler.findResources(name, result);
         }
+        return Collections.enumeration(result);
     }
 
-
     /**
      * Converts an input stream into a byte array.
      *
@@ -691,15 +606,8 @@
      *            the input stream
      * @return byte[] the byte array
      */
-    private static byte[] getBytes(InputStream is)
-            throws IOException {
-        byte[] buf = new byte[4096];
-        ByteArrayOutputStream bos = new ByteArrayOutputStream(4096);
-        int count;
-        while ((count = is.read(buf)) > 0) {
-            bos.write(buf, 0, count);
-        }
-        return bos.toByteArray();
+    private static byte[] getBytes(InputStream is) throws IOException {
+        return Streams.readFully(is);
     }
 
     /**
@@ -771,49 +679,30 @@
 
     /**
      * Returns a new {@code URLClassLoader} instance for the given URLs and the
-     * system {@code ClassLoader} as its parent. The method {@code loadClass()}
-     * of the new instance will call {@code
-     * SecurityManager.checkPackageAccess()} before loading a class.
+     * system {@code ClassLoader} as its parent.
      *
      * @param urls
      *            the list of URLs that is passed to the new {@code
-     *            URLClassloader}.
+     *            URLClassLoader}.
      * @return the created {@code URLClassLoader} instance.
      */
     public static URLClassLoader newInstance(final URL[] urls) {
-        URLClassLoader sub = AccessController
-                .doPrivileged(new PrivilegedAction<URLClassLoader>() {
-                    public URLClassLoader run() {
-                        return new SubURLClassLoader(urls);
-                    }
-                });
-        sub.currentContext = AccessController.getContext();
-        return sub;
+        return new URLClassLoader(urls, ClassLoader.getSystemClassLoader());
     }
 
     /**
      * Returns a new {@code URLClassLoader} instance for the given URLs and the
-     * specified {@code ClassLoader} as its parent. The method {@code
-     * loadClass()} of the new instance will call the SecurityManager's {@code
-     * checkPackageAccess()} before loading a class.
+     * specified {@code ClassLoader} as its parent.
      *
      * @param urls
-     *            the list of URLs that is passed to the new URLClassloader.
+     *            the list of URLs that is passed to the new URLClassLoader.
      * @param parentCl
      *            the parent class loader that is passed to the new
-     *            URLClassloader.
+     *            URLClassLoader.
      * @return the created {@code URLClassLoader} instance.
      */
-    public static URLClassLoader newInstance(final URL[] urls,
-                                             final ClassLoader parentCl) {
-        URLClassLoader sub = AccessController
-                .doPrivileged(new PrivilegedAction<URLClassLoader>() {
-                    public URLClassLoader run() {
-                        return new SubURLClassLoader(urls, parentCl);
-                    }
-                });
-        sub.currentContext = AccessController.getContext();
-        return sub;
+    public static URLClassLoader newInstance(final URL[] urls, final ClassLoader parentCl) {
+        return new URLClassLoader(urls, parentCl);
     }
 
     /**
@@ -831,22 +720,10 @@
      * @param factory
      *            the factory that will be used to create protocol-specific
      *            stream handlers.
-     * @throws SecurityException
-     *             if a security manager exists and its {@code
-     *             checkCreateClassLoader()} method doesn't allow creation of
-     *             new {@code ClassLoader}s.
      */
-    public URLClassLoader(URL[] searchUrls, ClassLoader parent,
-                          URLStreamHandlerFactory factory) {
+    public URLClassLoader(URL[] searchUrls, ClassLoader parent, URLStreamHandlerFactory factory) {
         super(parent);
-        // Required for pre-v1.2 security managers to work
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkCreateClassLoader();
-        }
         this.factory = factory;
-        // capture the context of the thread that creates this URLClassLoader
-        currentContext = AccessController.getContext();
         int nbUrls = searchUrls.length;
         originalUrls = new ArrayList<URL>(nbUrls);
         handlerList = new ArrayList<URLHandler>(nbUrls);
@@ -865,25 +742,30 @@
      * class could be found, a class object representing the loaded class will
      * be returned.
      *
-     * @param clsName
-     *            the name of the class which has to be found.
-     * @return the class that has been loaded.
      * @throws ClassNotFoundException
      *             if the specified class cannot be loaded.
      */
     @Override
-    protected Class<?> findClass(final String clsName)
-            throws ClassNotFoundException {
-        Class<?> cls = AccessController.doPrivileged(
-                new PrivilegedAction<Class<?>>() {
-                    public Class<?> run() {
-                        return findClassImpl(clsName);
-                    }
-                }, currentContext);
-        if (cls != null) {
-            return cls;
+    protected Class<?> findClass(final String className) throws ClassNotFoundException {
+        String partialName = className.replace('.', '/');
+        final String classFileName = new StringBuilder(partialName).append(".class").toString();
+        String packageName = null;
+        int position = partialName.lastIndexOf('/');
+        if ((position = partialName.lastIndexOf('/')) != -1) {
+            packageName = partialName.substring(0, position);
         }
-        throw new ClassNotFoundException(clsName);
+        int n = 0;
+        while (true) {
+            URLHandler handler = getHandler(n++);
+            if (handler == null) {
+                break;
+            }
+            Class<?> res = handler.findClass(packageName, classFileName, className);
+            if (res != null) {
+                return res;
+            }
+        }
+        throw new ClassNotFoundException(className);
     }
 
     /**
@@ -926,40 +808,13 @@
         if (name == null) {
             return null;
         }
-        URL result = AccessController.doPrivileged(new PrivilegedAction<URL>() {
-            public URL run() {
-                return findResourceImpl(name);
-            }
-        }, currentContext);
-        SecurityManager sm;
-        if (result != null && (sm = System.getSecurityManager()) != null) {
-            try {
-                sm.checkPermission(result.openConnection().getPermission());
-            } catch (IOException e) {
-                return null;
-            } catch (SecurityException e) {
-                return null;
-            }
-        }
-        return result;
-    }
-
-    /**
-     * Returns a URL among the given ones referencing the specified resource or
-     * null if no resource could be found.
-     *
-     * @param resName java.lang.String the name of the requested resource
-     * @return URL URL for the resource.
-     */
-    URL findResourceImpl(String resName) {
         int n = 0;
-
         while (true) {
             URLHandler handler = getHandler(n++);
             if (handler == null) {
                 break;
             }
-            URL res = handler.findResource(resName);
+            URL res = handler.findResource(name);
             if (res != null) {
                 return res;
             }
@@ -967,7 +822,7 @@
         return null;
     }
 
-    URLHandler getHandler(int num) {
+    private URLHandler getHandler(int num) {
         if (num < handlerList.size()) {
             return handlerList.get(num);
         }
@@ -1122,17 +977,16 @@
     }
 
     private boolean isSealed(Manifest manifest, String dirName) {
-        Attributes mainAttributes = manifest.getMainAttributes();
-        String value = mainAttributes.getValue(Attributes.Name.SEALED);
-        boolean sealed = value != null && value.toLowerCase().equals("true");
         Attributes attributes = manifest.getAttributes(dirName);
         if (attributes != null) {
-            value = attributes.getValue(Attributes.Name.SEALED);
+            String value = attributes.getValue(Attributes.Name.SEALED);
             if (value != null) {
-                sealed = value.toLowerCase().equals("true");
+                return value.equalsIgnoreCase("true");
             }
         }
-        return sealed;
+        Attributes mainAttributes = manifest.getMainAttributes();
+        String value = mainAttributes.getValue(Attributes.Name.SEALED);
+        return (value != null && value.equalsIgnoreCase("true"));
     }
 
     /**
@@ -1170,28 +1024,4 @@
         }
         return addedURLs;
     }
-
-    Class<?> findClassImpl(String className) {
-        String partialName = className.replace('.', '/');
-        final String classFileName = new StringBuilder(partialName).append(".class").toString();
-        String packageName = null;
-        int position = partialName.lastIndexOf('/');
-        if ((position = partialName.lastIndexOf('/')) != -1) {
-            packageName = partialName.substring(0, position);
-        }
-        int n = 0;
-        while (true) {
-            URLHandler handler = getHandler(n++);
-            if (handler == null) {
-                break;
-            }
-            Class<?> res = handler.findClass(packageName, classFileName, className);
-            if (res != null) {
-                return res;
-            }
-        }
-        return null;
-
-    }
-
 }
diff --git a/luni/src/main/java/java/net/URLConnection.java b/luni/src/main/java/java/net/URLConnection.java
index e467932..61253f3 100644
--- a/luni/src/main/java/java/net/URLConnection.java
+++ b/luni/src/main/java/java/net/URLConnection.java
@@ -20,15 +20,12 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Hashtable;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
-import java.util.StringTokenizer;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * A connection to a URL for reading or writing. For HTTP connections, see
@@ -276,19 +273,14 @@
             return (ContentHandler) cHandler;
         }
 
-        // search through the package list for the right class for the Content
-        // Type
-        String packageList = AccessController
-                .doPrivileged(new PriviAction<String>(
-                        "java.content.handler.pkgs"));
+        // search through the package list for the right class for the Content Type
+        String packageList = System.getProperty("java.content.handler.pkgs");
         if (packageList != null) {
-            final StringTokenizer st = new StringTokenizer(packageList, "|");
-            while (st.countTokens() > 0) {
+            for (String packageName : packageList.split("\\|")) {
+                String className = packageName + "." + typeString;
                 try {
-                    Class<?> cl = Class.forName(st.nextToken() + "."
-                            + typeString, true, ClassLoader
-                            .getSystemClassLoader());
-                    cHandler = cl.newInstance();
+                    Class<?> klass = Class.forName(className, true, ClassLoader.getSystemClassLoader());
+                    cHandler = klass.newInstance();
                 } catch (ClassNotFoundException e) {
                 } catch (IllegalAccessException e) {
                 } catch (InstantiationException e) {
@@ -297,21 +289,14 @@
         }
 
         if (cHandler == null) {
-            cHandler = AccessController
-                    .doPrivileged(new PrivilegedAction<Object>() {
-                        public Object run() {
-                            try {
-                                // Try looking up AWT image content handlers
-                                String className = "org.apache.harmony.awt.www.content."
-                                        + typeString;
-                                return Class.forName(className).newInstance();
-                            } catch (ClassNotFoundException e) {
-                            } catch (IllegalAccessException e) {
-                            } catch (InstantiationException e) {
-                            }
-                            return null;
-                        }
-                    });
+            try {
+                // Try looking up AWT image content handlers
+                String className = "org.apache.harmony.awt.www.content." + typeString;
+                cHandler = Class.forName(className).newInstance();
+            } catch (ClassNotFoundException e) {
+            } catch (IllegalAccessException e) {
+            } catch (InstantiationException e) {
+            }
         }
         if (cHandler != null) {
             if (!(cHandler instanceof ContentHandler)) {
@@ -721,10 +706,7 @@
      * @throws IOException
      *             if an I/O error occurs while reading from the input stream.
      */
-    @SuppressWarnings("nls")
-    public static String guessContentTypeFromStream(InputStream is)
-            throws IOException {
-
+    public static String guessContentTypeFromStream(InputStream is) throws IOException {
         if (!is.markSupported()) {
             return null;
         }
@@ -789,7 +771,7 @@
         }
 
         // Check text types
-        String textHeader = header.trim().toUpperCase();
+        String textHeader = header.trim().toUpperCase(Locale.US);
         if (textHeader.startsWith("<!DOCTYPE HTML") ||
                 textHeader.startsWith("<HTML") ||
                 textHeader.startsWith("<HEAD") ||
@@ -815,15 +797,15 @@
      * @return the string to be parsed
      */
     private String parseTypeString(String typeString) {
-        StringBuilder typeStringBuffer = new StringBuilder(typeString);
-        for (int i = 0; i < typeStringBuffer.length(); i++) {
+        StringBuilder result = new StringBuilder(typeString);
+        for (int i = 0; i < result.length(); i++) {
             // if non-alphanumeric, replace it with '_'
-            char c = typeStringBuffer.charAt(i);
+            char c = result.charAt(i);
             if (!(Character.isLetter(c) || Character.isDigit(c) || c == '.')) {
-                typeStringBuffer.setCharAt(i, '_');
+                result.setCharAt(i, '_');
             }
         }
-        return typeStringBuffer.toString();
+        return result.toString();
     }
 
     /**
@@ -845,24 +827,17 @@
 
     /**
      * Sets the internally used content handler factory. The content factory can
-     * only be set if it is allowed by the security manager and only once during
-     * the lifetime of the application.
+     * only be set once during the lifetime of the application.
      *
      * @param contentFactory
      *            the content factory to be set.
      * @throws Error
-     *             if the security manager does not allow to set the content
-     *             factory or it has been already set earlier ago.
+     *             if the factory has been already set.
      */
-    public static synchronized void setContentHandlerFactory(
-            ContentHandlerFactory contentFactory) {
+    public static synchronized void setContentHandlerFactory(ContentHandlerFactory contentFactory) {
         if (contentHandlerFactory != null) {
             throw new Error("Factory already set");
         }
-        SecurityManager sManager = System.getSecurityManager();
-        if (sManager != null) {
-            sManager.checkSetFactory();
-        }
         contentHandlerFactory = contentFactory;
     }
 
@@ -902,7 +877,6 @@
      *
      * @param newValue
      *            the default value of the flag to be used for new connections.
-     * @see #defaultUseCaches
      * @see #useCaches
      */
     public void setDefaultUseCaches(boolean newValue) {
@@ -949,10 +923,6 @@
      *            the MIME table to be set.
      */
     public static void setFileNameMap(FileNameMap map) {
-        SecurityManager manager = System.getSecurityManager();
-        if (manager != null) {
-            manager.checkSetFactory();
-        }
         synchronized (URLConnection.class) {
             fileNameMap = map;
         }
diff --git a/luni/src/main/java/java/net/URLDecoder.java b/luni/src/main/java/java/net/URLDecoder.java
index debd111..e34fe4a 100644
--- a/luni/src/main/java/java/net/URLDecoder.java
+++ b/luni/src/main/java/java/net/URLDecoder.java
@@ -18,11 +18,8 @@
 package java.net;
 
 import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
 import java.nio.charset.Charset;
-import java.nio.charset.IllegalCharsetNameException;
-import java.nio.charset.UnsupportedCharsetException;
+import libcore.net.UriCodec;
 
 /**
  * This class is used to decode a string which is encoded in the {@code
@@ -45,7 +42,7 @@
      */
     @Deprecated
     public static String decode(String s) {
-        return decode(s, Charset.defaultCharset());
+        return UriCodec.decode(s, true, Charset.defaultCharset());
     }
 
     /**
@@ -67,76 +64,6 @@
      *             if the specified encoding scheme is invalid.
      */
     public static String decode(String s, String encoding) throws UnsupportedEncodingException {
-        if (encoding == null) {
-            throw new NullPointerException();
-        }
-        if (encoding.isEmpty()) {
-            throw new UnsupportedEncodingException(encoding);
-        }
-
-        if (s.indexOf('%') == -1) {
-            if (s.indexOf('+') == -1)
-                return s;
-            char[] str = s.toCharArray();
-            for (int i = 0; i < str.length; i++) {
-                if (str[i] == '+')
-                    str[i] = ' ';
-            }
-            return new String(str);
-        }
-
-        Charset charset = null;
-        try {
-            charset = Charset.forName(encoding);
-        } catch (IllegalCharsetNameException e) {
-            throw (UnsupportedEncodingException) (new UnsupportedEncodingException(
-                    encoding).initCause(e));
-        } catch (UnsupportedCharsetException e) {
-            throw (UnsupportedEncodingException) (new UnsupportedEncodingException(
-                    encoding).initCause(e));
-        }
-
-        return decode(s, charset);
-    }
-
-    private static String decode(String s, Charset charset) {
-
-        char[] str_buf = new char[s.length()];
-        byte[] buf = new byte[s.length() / 3];
-        int buf_len = 0;
-
-        for (int i = 0; i < s.length();) {
-            char c = s.charAt(i);
-            if (c == '+') {
-                str_buf[buf_len] = ' ';
-            } else if (c == '%') {
-
-                int len = 0;
-                do {
-                    if (i + 2 >= s.length()) {
-                        throw new IllegalArgumentException("Incomplete % sequence at: " + i);
-                    }
-                    int d1 = Character.digit(s.charAt(i + 1), 16);
-                    int d2 = Character.digit(s.charAt(i + 2), 16);
-                    if (d1 == -1 || d2 == -1) {
-                        throw new IllegalArgumentException("Invalid % sequence " +
-                                s.substring(i, i + 3) + " at " + i);
-                    }
-                    buf[len++] = (byte) ((d1 << 4) + d2);
-                    i += 3;
-                } while (i < s.length() && s.charAt(i) == '%');
-
-                CharBuffer cb = charset.decode(ByteBuffer.wrap(buf, 0, len));
-                len = cb.length();
-                System.arraycopy(cb.array(), 0, str_buf, buf_len, len);
-                buf_len += len;
-                continue;
-            } else {
-                str_buf[buf_len] = c;
-            }
-            i++;
-            buf_len++;
-        }
-        return new String(str_buf, 0, buf_len);
+        return UriCodec.decode(s, true, Charset.forName(encoding));
     }
 }
diff --git a/luni/src/main/java/java/net/URLEncoder.java b/luni/src/main/java/java/net/URLEncoder.java
index f53f05d..5dd85b0 100644
--- a/luni/src/main/java/java/net/URLEncoder.java
+++ b/luni/src/main/java/java/net/URLEncoder.java
@@ -18,117 +18,42 @@
 package java.net;
 
 import java.io.UnsupportedEncodingException;
+import java.nio.charset.Charset;
+import java.nio.charset.Charsets;
+import libcore.net.UriCodec;
 
 /**
  * This class is used to encode a string using the format required by
  * {@code application/x-www-form-urlencoded} MIME content type.
+ *
+ * <p>All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9')
+ * and characters '.', '-', '*', '_' are converted into their hexadecimal value
+ * prepended by '%'. For example: '#' -> %23. In addition, spaces are
+ * substituted by '+'.
  */
 public class URLEncoder {
+    private URLEncoder() {}
 
-    static final String digits = "0123456789ABCDEF";
+    static UriCodec ENCODER = new UriCodec() {
+        @Override protected boolean isRetained(char c) {
+            return " .-*_".indexOf(c) != -1;
+        }
+    };
 
     /**
-     * Prevents this class from being instantiated.
-     */
-    private URLEncoder() {
-    }
-
-    /**
-     * Encodes a given string {@code s} in a x-www-form-urlencoded string using
-     * the specified encoding scheme {@code enc}.
-     * <p>
-     * All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9')
-     * and characters '.', '-', '*', '_' are converted into their hexadecimal
-     * value prepended by '%'. For example: '#' -> %23. In addition, spaces are
-     * substituted by '+'
+     * Equivalent to {@code encode(s, "UTF-8")}.
      *
-     * @param s
-     *            the string to be encoded.
-     * @return the encoded string.
      * @deprecated use {@link #encode(String, String)} instead.
      */
     @Deprecated
     public static String encode(String s) {
-        // Guess a bit bigger for encoded form
-        StringBuilder buf = new StringBuilder(s.length() + 16);
-        for (int i = 0; i < s.length(); i++) {
-            char ch = s.charAt(i);
-            if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
-                    || (ch >= '0' && ch <= '9') || ".-*_".indexOf(ch) > -1) {
-                buf.append(ch);
-            } else if (ch == ' ') {
-                buf.append('+');
-            } else {
-                byte[] bytes = new String(new char[] { ch }).getBytes();
-                for (int j = 0; j < bytes.length; j++) {
-                    buf.append('%');
-                    buf.append(digits.charAt((bytes[j] & 0xf0) >> 4));
-                    buf.append(digits.charAt(bytes[j] & 0xf));
-                }
-            }
-        }
-        return buf.toString();
+        return ENCODER.encode(s, Charsets.UTF_8);
     }
 
     /**
-     * Encodes the given string {@code s} in a x-www-form-urlencoded string
-     * using the specified encoding scheme {@code enc}.
-     * <p>
-     * All characters except letters ('a'..'z', 'A'..'Z') and numbers ('0'..'9')
-     * and characters '.', '-', '*', '_' are converted into their hexadecimal
-     * value prepended by '%'. For example: '#' -> %23. In addition, spaces are
-     * substituted by '+'
-     *
-     * @param s
-     *            the string to be encoded.
-     * @param enc
-     *            the encoding scheme to be used.
-     * @return the encoded string.
-     * @throws UnsupportedEncodingException
-     *             if the specified encoding scheme is invalid.
+     * Encodes {@code s} using the {@link Charset} named by {@code charsetName}.
      */
-    public static String encode(String s, String enc) throws UnsupportedEncodingException {
-        if (s == null || enc == null) {
-            throw new NullPointerException();
-        }
-        // check for UnsupportedEncodingException
-        "".getBytes(enc);
-
-        // Guess a bit bigger for encoded form
-        StringBuilder buf = new StringBuilder(s.length() + 16);
-        int start = -1;
-        for (int i = 0; i < s.length(); i++) {
-            char ch = s.charAt(i);
-            if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
-                    || (ch >= '0' && ch <= '9') || " .-*_".indexOf(ch) > -1) {
-                if (start >= 0) {
-                    convert(s.substring(start, i), buf, enc);
-                    start = -1;
-                }
-                if (ch != ' ') {
-                    buf.append(ch);
-                } else {
-                    buf.append('+');
-                }
-            } else {
-                if (start < 0) {
-                    start = i;
-                }
-            }
-        }
-        if (start >= 0) {
-            convert(s.substring(start, s.length()), buf, enc);
-        }
-        return buf.toString();
-    }
-
-    private static void convert(String s, StringBuilder buf, String enc)
-            throws UnsupportedEncodingException {
-        byte[] bytes = s.getBytes(enc);
-        for (int j = 0; j < bytes.length; j++) {
-            buf.append('%');
-            buf.append(digits.charAt((bytes[j] & 0xf0) >> 4));
-            buf.append(digits.charAt(bytes[j] & 0xf));
-        }
+    public static String encode(String s, String charsetName) throws UnsupportedEncodingException {
+        return ENCODER.encode(s, Charset.forName(charsetName));
     }
 }
diff --git a/luni/src/main/java/java/net/URLStreamHandler.java b/luni/src/main/java/java/net/URLStreamHandler.java
index b29c35f..7a86644 100644
--- a/luni/src/main/java/java/net/URLStreamHandler.java
+++ b/luni/src/main/java/java/net/URLStreamHandler.java
@@ -18,8 +18,6 @@
 package java.net;
 
 import java.io.IOException;
-import java.nio.charset.Charsets;
-import java.util.Locale;
 import libcore.util.Objects;
 import org.apache.harmony.luni.util.URLUtil;
 
@@ -313,144 +311,54 @@
         if (authority != null && !authority.isEmpty()) {
             result.append("//");
             if (escapeIllegalCharacters) {
-                authority = fixEncoding(authority, "$,;@&=+:[]");
+                URI.AUTHORITY_ENCODER.appendPartiallyEncoded(result, authority);
+            } else {
+                result.append(authority);
             }
-            result.append(authority);
         }
 
         String fileAndQuery = url.getFile();
         if (fileAndQuery != null) {
             if (escapeIllegalCharacters) {
-                fileAndQuery = fixEncoding(fileAndQuery, "$,;@&=+:/?");
+                URI.FILE_AND_QUERY_ENCODER.appendPartiallyEncoded(result, fileAndQuery);
+            } else {
+                result.append(fileAndQuery);
             }
-            result.append(fileAndQuery);
         }
 
         String ref = url.getRef();
         if (ref != null) {
             result.append('#');
             if (escapeIllegalCharacters) {
-                ref = fixEncoding(ref, "$,;@&=+:/?[]");
+                URI.ALL_LEGAL_ENCODER.appendPartiallyEncoded(result, ref);
+            } else {
+                result.append(ref);
             }
-            result.append(ref);
         }
 
         return result.toString();
     }
 
     /**
-     * Escapes the unescaped characters of {@code s} that are not permitted.
-     * Permitted characters are:
-     * <ul>
-     *   <li>Unreserved characters in RFC 2396.
-     *   <li>{@code extraOkayChars},
-     *   <li>non-ASCII, non-control, non-whitespace characters
-     * </ul>
-     *
-     * <p>Unlike the methods in {@code URI}, this method ignores input that has
-     * already been escaped. For example, input of "hello%20world" is unchanged
-     * by this method but would be double-escaped to "hello%2520world" by URI.
-     *
-     * <p>UTF-8 is used to encode escaped characters. A single input character
-     * like "\u0080" may be encoded to multiple octets like %C2%80.
+     * Returns true if {@code a} and {@code b} have the same protocol, host,
+     * port, file, and reference.
      */
-    private String fixEncoding(String s, String extraPermittedChars) {
-        StringBuilder result = null;
-        int copiedCount = 0;
-
-        for (int i = 0; i < s.length(); i++) {
-            char c = s.charAt(i);
-
-            if (c == '%') {
-                i += 2; // this is a 3-character sequence like "%20"
-                continue;
-            }
-
-            // unreserved characters: alphanum | mark
-            if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9'
-                    || c == '-' || c == '_' || c == '.' || c == '!' || c == '~'
-                    || c == '*' || c == '\'' || c == '(' || c == ')') {
-                continue;
-            }
-
-            // characters permitted in this context
-            if (extraPermittedChars.indexOf(c) != -1) {
-                continue;
-            }
-
-            // other characters
-            if (c > 0x7f && !Character.isISOControl(c) && !Character.isSpaceChar(c)) {
-                continue;
-            }
-
-            /*
-             * We've encountered a character that must be escaped.
-             */
-            if (result == null) {
-                result = new StringBuilder();
-            }
-            result.append(s, copiedCount, i);
-
-            if (c < 0x7f) {
-                appendHex(result, c);
-            } else {
-                for (byte b : s.substring(i, i + 1).getBytes(Charsets.UTF_8)) {
-                    appendHex(result, b & 0xff);
-                }
-            }
-
-            copiedCount = i + 1;
-        }
-
-        if (result == null) {
-            return s;
-        } else {
-            result.append(s, copiedCount, s.length());
-            return result.toString();
-        }
-    }
-
-    private void appendHex(StringBuilder stringBuilder, int b) {
-        String hex = Integer.toHexString(b).toUpperCase(Locale.US);
-        stringBuilder.append(hex.length() == 1 ? "%0" : "%").append(hex); // always 2 hex digits
-    }
-
-    /**
-     * Compares two URL objects whether they represent the same URL. Two URLs
-     * are equal if they have the same file, host, port, protocol, query, and
-     * reference components.
-     *
-     * @param url1
-     *            the first URL to compare.
-     * @param url2
-     *            the second URL to compare.
-     * @return {@code true} if the URLs are the same, {@code false} otherwise.
-     * @see #hashCode
-     */
-    protected boolean equals(URL url1, URL url2) {
-        if (!sameFile(url1, url2)) {
-            return false;
-        }
-        return Objects.equal(url1.getRef(), url2.getRef())
-                && Objects.equal(url1.getQuery(), url2.getQuery());
+    protected boolean equals(URL a, URL b) {
+        return sameFile(a, b)
+                && Objects.equal(a.getRef(), b.getRef())
+                && Objects.equal(a.getQuery(), b.getQuery());
     }
 
     /**
      * Returns the default port of the protocol used by the handled URL. The
-     * current implementation returns always {@code -1}.
-     *
-     * @return the appropriate default port number of the protocol.
+     * default implementation always returns {@code -1}.
      */
     protected int getDefaultPort() {
         return -1;
     }
 
     /**
-     * Returns the host address of the given URL.
-     *
-     * @param url
-     *            the URL object where to read the host address from.
-     * @return the host address of the specified URL.
+     * Returns the host address of {@code url}.
      */
     protected InetAddress getHostAddress(URL url) {
         try {
@@ -465,70 +373,33 @@
     }
 
     /**
-     * Returns the hashcode value for the given URL object.
-     *
-     * @param url
-     *            the URL to determine the hashcode.
-     * @return the hashcode of the given URL.
+     * Returns the hash code of {@code url}.
      */
     protected int hashCode(URL url) {
         return toExternalForm(url).hashCode();
     }
 
     /**
-     * Compares two URL objects whether they refer to the same host.
-     *
-     * @param a the first URL to be compared.
-     * @param b the second URL to be compared.
-     * @return {@code true} if both URLs refer to the same host, {@code false}
-     *         otherwise.
+     * Returns true if the hosts of {@code a} and {@code b} are equal.
      */
     protected boolean hostsEqual(URL a, URL b) {
-        /*
-         * URLs with the same case-insensitive host name have equal hosts
-         */
+        // URLs with the same case-insensitive host name have equal hosts
         String aHost = getHost(a);
         String bHost = getHost(b);
-        if (aHost != null && aHost.equalsIgnoreCase(bHost)) {
-            return true;
-        }
-
-        /*
-         * Call out to DNS to resolve the host addresses. If this succeeds for
-         * both addresses and both addresses yield the same InetAddress, report
-         * equality.
-         *
-         * Although it's consistent with historical behavior of the RI, this
-         * approach is fundamentally broken. In particular, acting upon this
-         * result is bogus because a single server may serve content for many
-         * unrelated host names.
-         */
-        InetAddress aResolved = getHostAddress(a);
-        return aResolved != null && aResolved.equals(getHostAddress(b));
+        return aHost != null && aHost.equalsIgnoreCase(bHost);
     }
 
     /**
-     * Compares two URL objects whether they refer to the same file. In the
-     * comparison included are the URL components protocol, host, port and file.
-     *
-     * @param url1
-     *            the first URL to be compared.
-     * @param url2
-     *            the second URL to be compared.
-     * @return {@code true} if both URLs refer to the same file, {@code false}
-     *         otherwise.
+     * Returns true if {@code a} and {@code b} have the same protocol, host,
+     * port and file.
      */
-    protected boolean sameFile(URL url1, URL url2) {
-        return Objects.equal(url1.getProtocol(), url2.getProtocol())
-                && Objects.equal(url1.getFile(), url2.getFile())
-                && hostsEqual(url1, url2)
-                && url1.getEffectivePort() == url2.getEffectivePort();
+    protected boolean sameFile(URL a, URL b) {
+        return Objects.equal(a.getProtocol(), b.getProtocol())
+                && hostsEqual(a, b)
+                && a.getEffectivePort() == b.getEffectivePort()
+                && Objects.equal(a.getFile(), b.getFile());
     }
 
-    /*
-     * If the URL host is empty while protocal is file, the host is regarded as
-     * localhost.
-     */
     private static String getHost(URL url) {
         String host = url.getHost();
         if ("file".equals(url.getProtocol()) && host != null && host.isEmpty()) {
diff --git a/luni/src/main/java/java/net/UnknownHostException.java b/luni/src/main/java/java/net/UnknownHostException.java
index 876593b..6c4873e 100644
--- a/luni/src/main/java/java/net/UnknownHostException.java
+++ b/luni/src/main/java/java/net/UnknownHostException.java
@@ -31,7 +31,6 @@
      * Callers should usually supply a detail message.
      */
     public UnknownHostException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/net/UnknownServiceException.java b/luni/src/main/java/java/net/UnknownServiceException.java
index c67c178..5daec4b 100644
--- a/luni/src/main/java/java/net/UnknownServiceException.java
+++ b/luni/src/main/java/java/net/UnknownServiceException.java
@@ -34,7 +34,6 @@
      * walkback filled in.
      */
     public UnknownServiceException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/nio/BufferOverflowException.java b/luni/src/main/java/java/nio/BufferOverflowException.java
index 0a0bf23..628fced 100644
--- a/luni/src/main/java/java/nio/BufferOverflowException.java
+++ b/luni/src/main/java/java/nio/BufferOverflowException.java
@@ -28,6 +28,5 @@
      * Constructs a <code>BufferOverflowException</code>.
      */
     public BufferOverflowException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/BufferUnderflowException.java b/luni/src/main/java/java/nio/BufferUnderflowException.java
index 4665461..0818ae1 100644
--- a/luni/src/main/java/java/nio/BufferUnderflowException.java
+++ b/luni/src/main/java/java/nio/BufferUnderflowException.java
@@ -28,6 +28,5 @@
      * Constructs a <code>BufferUnderflowException</code>.
      */
     public BufferUnderflowException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/DatagramChannelImpl.java b/luni/src/main/java/java/nio/DatagramChannelImpl.java
index 2c85a67..9887394 100644
--- a/luni/src/main/java/java/nio/DatagramChannelImpl.java
+++ b/luni/src/main/java/java/nio/DatagramChannelImpl.java
@@ -26,6 +26,7 @@
 import java.net.DatagramSocketImpl;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.net.PlainDatagramSocketImpl;
 import java.net.SocketAddress;
 import java.net.SocketException;
 import java.nio.channels.AlreadyConnectedException;
@@ -35,15 +36,14 @@
 import java.nio.channels.NotYetConnectedException;
 import java.nio.channels.spi.SelectorProvider;
 import java.util.Arrays;
+import libcore.io.IoUtils;
 import libcore.util.EmptyArray;
-import org.apache.harmony.luni.net.PlainDatagramSocketImpl;
-import org.apache.harmony.luni.platform.FileDescriptorHandler;
 import org.apache.harmony.luni.platform.Platform;
 
 /*
  * The default implementation class of java.nio.channels.DatagramChannel.
  */
-class DatagramChannelImpl extends DatagramChannel implements FileDescriptorHandler {
+class DatagramChannelImpl extends DatagramChannel implements FileDescriptorChannel {
     // The fd to interact with native code
     private final FileDescriptor fd;
 
@@ -70,8 +70,7 @@
      */
     protected DatagramChannelImpl(SelectorProvider selectorProvider) throws IOException {
         super(selectorProvider);
-        fd = new FileDescriptor();
-        Platform.NETWORK.socket(fd, false);
+        fd = IoUtils.socket(false);
     }
 
     /*
@@ -97,14 +96,10 @@
     }
 
     /**
-     * Returns the local address from the IP stack. This method should not be
-     * called directly as it does not check the security policy.
-     *
-     * @return InetAddress the local address to which the socket is bound.
-     * @see DatagramSocket
+     * Returns the local address to which the socket is bound.
      */
     InetAddress getLocalAddress() {
-        return Platform.NETWORK.getSocketLocalAddress(fd);
+        return IoUtils.getSocketLocalAddress(fd);
     }
 
     /**
@@ -130,17 +125,6 @@
         // check the address
         InetSocketAddress inetSocketAddress = SocketChannelImpl.validateAddress(address);
 
-        // security check
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            if (inetSocketAddress.getAddress().isMulticastAddress()) {
-                sm.checkMulticast(inetSocketAddress.getAddress());
-            } else {
-                sm.checkConnect(inetSocketAddress.getAddress().getHostName(),
-                        inetSocketAddress.getPort());
-            }
-        }
-
         try {
             begin();
             Platform.NETWORK.connect(fd,
@@ -224,17 +208,6 @@
                     receivePacket.getData(), receivePacket.getOffset(), receivePacket.getLength(),
                     false, isConnected());
 
-            // security check
-            SecurityManager sm = System.getSecurityManager();
-            if (!isConnected() && sm != null) {
-                try {
-                    sm.checkAccept(receivePacket.getAddress().getHostAddress(),
-                            receivePacket.getPort());
-                } catch (SecurityException e) {
-                    // do discard the datagram packet
-                    receivePacket = null;
-                }
-            }
             if (receivePacket != null && receivePacket.getAddress() != null) {
 
                 if (received > 0) {
@@ -262,17 +235,6 @@
             received = Platform.NETWORK.recvDirect(fd, receivePacket, address,
                     target.position(), target.remaining(), false, isConnected());
 
-            // security check
-            SecurityManager sm = System.getSecurityManager();
-            if (!isConnected() && sm != null) {
-                try {
-                    sm.checkAccept(receivePacket.getAddress().getHostAddress(),
-                            receivePacket.getPort());
-                } catch (SecurityException e) {
-                    // do discard the datagram packet
-                    receivePacket = null;
-                }
-            }
             if (receivePacket != null && receivePacket.getAddress() != null) {
                 // copy the data of received packet
                 if (received > 0) {
@@ -302,20 +264,8 @@
             throw new IOException();
         }
 
-        if (isConnected()) {
-            if (!connectAddress.equals(isa)) {
-                throw new IllegalArgumentException();
-            }
-        } else {
-            // not connected, check security
-            SecurityManager sm = System.getSecurityManager();
-            if (sm != null) {
-                if (isa.getAddress().isMulticastAddress()) {
-                    sm.checkMulticast(isa.getAddress());
-                } else {
-                    sm.checkConnect(isa.getAddress().getHostAddress(), isa.getPort());
-                }
-            }
+        if (isConnected() && !connectAddress.equals(isa)) {
+            throw new IllegalArgumentException();
         }
 
         // the return value.
@@ -328,8 +278,8 @@
             int start = oldposition;
             if (source.isDirect()) {
                 synchronized (writeLock) {
-                    int data_address = NioUtils.getDirectBufferAddress(source);
-                    sendCount = Platform.NETWORK.sendDirect(fd, data_address, start, length,
+                    int address = NioUtils.getDirectBufferAddress(source);
+                    sendCount = Platform.NETWORK.sendDirect(fd, address, start, length,
                             isa.getPort(), isa.getAddress());
                 }
             } else {
diff --git a/luni/src/main/java/java/nio/DirectByteBuffer.java b/luni/src/main/java/java/nio/DirectByteBuffer.java
index d9e8afd..ccc5c6b 100644
--- a/luni/src/main/java/java/nio/DirectByteBuffer.java
+++ b/luni/src/main/java/java/nio/DirectByteBuffer.java
@@ -205,18 +205,20 @@
         block.free();
     }
 
-    @Override
-    final protected byte[] protectedArray() {
-        throw new UnsupportedOperationException();
+    @Override protected byte[] protectedArray() {
+        byte[] array = this.block.array();
+        if (array == null) {
+            throw new UnsupportedOperationException();
+        }
+        return array;
     }
 
-    @Override
-    final protected int protectedArrayOffset() {
-        throw new UnsupportedOperationException();
+    @Override protected int protectedArrayOffset() {
+        protectedArray(); // Check we have an array.
+        return offset;
     }
 
-    @Override
-    final protected boolean protectedHasArray() {
-        return false;
+    @Override protected boolean protectedHasArray() {
+        return protectedArray() != null;
     }
 }
diff --git a/luni/src/main/java/java/nio/FileChannelImpl.java b/luni/src/main/java/java/nio/FileChannelImpl.java
index c8efc97..acc3725 100644
--- a/luni/src/main/java/java/nio/FileChannelImpl.java
+++ b/luni/src/main/java/java/nio/FileChannelImpl.java
@@ -23,6 +23,7 @@
 import java.nio.channels.ClosedChannelException;
 import java.nio.channels.FileChannel;
 import java.nio.channels.FileLock;
+import java.nio.channels.NonReadableChannelException;
 import java.nio.channels.NonWritableChannelException;
 import java.nio.channels.OverlappingFileLockException;
 import java.nio.channels.ReadableByteChannel;
@@ -31,19 +32,17 @@
 import java.util.Comparator;
 import java.util.SortedSet;
 import java.util.TreeSet;
-import org.apache.harmony.luni.platform.IFileSystem;
-import org.apache.harmony.luni.platform.Platform;
+import libcore.io.ErrnoException;
+import libcore.io.IoUtils;
+import libcore.io.Libcore;
+import libcore.io.StructFlock;
+import libcore.util.MutableLong;
+import static libcore.io.OsConstants.*;
 
-/*
- * The file channel impl class is the bridge between the logical channels
- * described by the NIO channel framework, and the file system implementation
- * provided by the port layer.
- *
- * This class is non-API, but implements the API of the FileChannel interface.
+/**
+ * Our concrete implementation of the abstract FileChannel class.
  */
-abstract class FileChannelImpl extends FileChannel {
-    private static final int ALLOC_GRANULARITY = Platform.FILE_SYSTEM.getAllocGranularity();
-
+final class FileChannelImpl extends FileChannel {
     private static final Comparator<FileLock> LOCK_COMPARATOR = new Comparator<FileLock>() {
         public int compare(FileLock lock1, FileLock lock2) {
             long position1 = lock1.position();
@@ -52,58 +51,85 @@
         }
     };
 
-    // Handle to the open file
-    private final int handle;
+    private final Object stream;
+    private final FileDescriptor fd;
+    private final int mode;
 
     // The set of acquired and pending locks.
     private final SortedSet<FileLock> locks = new TreeSet<FileLock>(LOCK_COMPARATOR);
 
     private final Object repositioningLock = new Object();
 
-    private final Object stream;
-
     /**
-     * Create a new file channel implementation class that wraps the given file
-     * handle and operates in the specified mode.
+     * Create a new file channel implementation class that wraps the given
+     * fd and operates in the specified mode.
      */
-    public FileChannelImpl(Object stream, int handle) {
-        this.handle = handle;
+    public FileChannelImpl(Object stream, FileDescriptor fd, int mode) {
+        this.fd = fd;
         this.stream = stream;
+        this.mode = mode;
     }
 
-    /**
-     * Helper method to throw an exception if the channel is already closed.
-     * Note that we don't bother to synchronize on this test since the file may
-     * be closed by operations beyond our control anyways.
-     */
-    protected final void openCheck() throws ClosedChannelException {
+    private void checkOpen() throws ClosedChannelException {
         if (!isOpen()) {
             throw new ClosedChannelException();
         }
     }
 
+    private void checkReadable() {
+        if ((mode & O_ACCMODE) == O_WRONLY) {
+            throw new NonReadableChannelException();
+        }
+    }
+
+    private void checkWritable() {
+        if ((mode & O_ACCMODE) == O_RDONLY) {
+            throw new NonWritableChannelException();
+        }
+    }
+
     protected void implCloseChannel() throws IOException {
         if (stream instanceof Closeable) {
             ((Closeable) stream).close();
         }
     }
 
-    protected FileLock basicLock(long position, long size, boolean shared,
-            boolean wait) throws IOException {
-        if (position < 0 || size < 0) {
-            throw new IllegalArgumentException("Lock position and size must be non-negative");
+    private FileLock basicLock(long position, long size, boolean shared, boolean wait) throws IOException {
+        int accessMode = (mode & O_ACCMODE);
+        if (accessMode == O_RDONLY) {
+            if (!shared) {
+                throw new NonWritableChannelException();
+            }
+        } else if (accessMode == O_WRONLY) {
+            if (shared) {
+                throw new NonReadableChannelException();
+            }
         }
-        int lockType = shared ? IFileSystem.SHARED_LOCK_TYPE : IFileSystem.EXCLUSIVE_LOCK_TYPE;
+
+        if (position < 0 || size < 0) {
+            throw new IllegalArgumentException("position=" + position + " size=" + size);
+        }
+
         FileLock pendingLock = new FileLockImpl(this, position, size, shared);
         addLock(pendingLock);
 
-        if (Platform.FILE_SYSTEM.lock(handle, position, size, lockType, wait)) {
-            return pendingLock;
+        StructFlock flock = new StructFlock();
+        flock.l_type = (short) (shared ? F_RDLCK : F_WRLCK);
+        flock.l_whence = (short) SEEK_SET;
+        flock.l_start = position;
+        flock.l_len = translateLockLength(size);
+        if (Libcore.os.fcntlFlock(fd, wait ? F_SETLKW64 : F_SETLK64, flock) == -1) {
+            // Lock acquisition failed.
+            removeLock(pendingLock);
+            return null;
         }
 
-        // Lock acquisition failed
-        removeLock(pendingLock);
-        return null;
+        return pendingLock;
+    }
+
+    private static long translateLockLength(long byteCount) {
+        // FileChannel uses Long.MAX_VALUE to mean "lock the whole file" where POSIX uses 0.
+        return (byteCount == Long.MAX_VALUE) ? 0 : byteCount;
     }
 
     private static final class FileLockImpl extends FileLock {
@@ -113,11 +139,11 @@
             super(channel, position, size, shared);
         }
 
-        @Override public boolean isValid() {
+        public boolean isValid() {
             return !isReleased && channel().isOpen();
         }
 
-        @Override public void release() throws IOException {
+        public void release() throws IOException {
             if (!channel().isOpen()) {
                 throw new ClosedChannelException();
             }
@@ -129,7 +155,7 @@
     }
 
     public final FileLock lock(long position, long size, boolean shared) throws IOException {
-        openCheck();
+        checkOpen();
         FileLock resultLock = null;
         {
             boolean completed = false;
@@ -145,7 +171,7 @@
     }
 
     public final FileLock tryLock(long position, long size, boolean shared) throws IOException {
-        openCheck();
+        checkOpen();
         return basicLock(position, size, shared, false);
     }
 
@@ -153,48 +179,86 @@
      * Non-API method to release a given lock on a file channel. Assumes that
      * the lock will mark itself invalid after successful unlocking.
      */
-    void release(FileLock lock) throws IOException {
-        openCheck();
-        Platform.FILE_SYSTEM.unlock(handle, lock.position(), lock.size());
+    public void release(FileLock lock) throws IOException {
+        checkOpen();
+
+        StructFlock flock = new StructFlock();
+        flock.l_type = (short) F_UNLCK;
+        flock.l_whence = (short) SEEK_SET;
+        flock.l_start = lock.position();
+        flock.l_len = translateLockLength(lock.size());
+        try {
+            Libcore.os.fcntlFlock(fd, F_SETLKW64, flock);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
+
         removeLock(lock);
     }
 
-    @Override public void force(boolean metadata) throws IOException {
-        openCheck();
-        Platform.FILE_SYSTEM.fsync(handle, metadata);
+    public void force(boolean metadata) throws IOException {
+        checkOpen();
+        if ((mode & O_ACCMODE) != O_RDONLY) {
+            try {
+                if (metadata) {
+                    Libcore.os.fsync(fd);
+                } else {
+                    Libcore.os.fdatasync(fd);
+                }
+            } catch (ErrnoException errnoException) {
+                throw errnoException.rethrowAsIOException();
+            }
+        }
     }
 
-    public abstract MappedByteBuffer map(MapMode mode, long position, long size) throws IOException;
-
-    protected final MappedByteBuffer mapImpl(MapMode mapMode, long position, long size) throws IOException {
-        if (position + size > size()) {
-            Platform.FILE_SYSTEM.truncate(handle, position + size);
+    public final MappedByteBuffer map(MapMode mapMode, long position, long size) throws IOException {
+        checkOpen();
+        if (mapMode == null) {
+            throw new NullPointerException("mapMode == null");
         }
-        long alignment = position - position % ALLOC_GRANULARITY;
+        if (position < 0 || size < 0 || size > Integer.MAX_VALUE) {
+            throw new IllegalArgumentException("position=" + position + " size=" + size);
+        }
+        int accessMode = (mode & O_ACCMODE);
+        if (accessMode == O_RDONLY) {
+            if (mapMode != MapMode.READ_ONLY) {
+                throw new NonWritableChannelException();
+            }
+        } else if (accessMode == O_WRONLY) {
+            throw new NonReadableChannelException();
+        }
+        if (position + size > size()) {
+            truncate(position + size);
+        }
+        long alignment = position - position % Libcore.os.sysconf(_SC_PAGE_SIZE);
         int offset = (int) (position - alignment);
-        MemoryBlock block = MemoryBlock.mmap(handle, alignment, size + offset, mapMode);
+        MemoryBlock block = MemoryBlock.mmap(fd, alignment, size + offset, mapMode);
         return new MappedByteBufferAdapter(block, (int) size, offset, mapMode);
     }
 
-    /**
-     * Returns the current file position.
-     */
     public long position() throws IOException {
-        openCheck();
-        return Platform.FILE_SYSTEM.seek(handle, 0L, IFileSystem.SEEK_CUR);
+        checkOpen();
+        if ((mode & O_APPEND) != 0) {
+            return size();
+        }
+        try {
+            return Libcore.os.lseek(fd, 0L, SEEK_CUR);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
     }
 
-    /**
-     * Sets the file pointer.
-     */
     public FileChannel position(long newPosition) throws IOException {
-        openCheck();
+        checkOpen();
         if (newPosition < 0) {
-            throw new IllegalArgumentException("New position must be non-negative");
+            throw new IllegalArgumentException("position: " + newPosition);
         }
-
         synchronized (repositioningLock) {
-            Platform.FILE_SYSTEM.seek(handle, newPosition, IFileSystem.SEEK_SET);
+            try {
+                Libcore.os.lseek(fd, newPosition, SEEK_SET);
+            } catch (ErrnoException errnoException) {
+                throw errnoException.rethrowAsIOException();
+            }
         }
         return this;
     }
@@ -202,9 +266,10 @@
     public int read(ByteBuffer buffer, long position) throws IOException {
         FileChannelImpl.checkWritable(buffer);
         if (position < 0) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("position: " + position);
         }
-        openCheck();
+        checkOpen();
+        checkReadable();
         if (!buffer.hasRemaining()) {
             return 0;
         }
@@ -223,134 +288,80 @@
 
     public int read(ByteBuffer buffer) throws IOException {
         FileChannelImpl.checkWritable(buffer);
-        openCheck();
+        checkOpen();
+        checkReadable();
         if (!buffer.hasRemaining()) {
             return 0;
         }
-        boolean completed = false;
-        int bytesRead = 0;
         synchronized (repositioningLock) {
-            if (buffer.isDirect()) {
+            int bytesRead = 0;
+            boolean completed = false;
+            try {
+                begin();
                 try {
-                    begin();
-                    /*
-                     * if (bytesRead <= EOF) dealt by read completed = false;
-                     */
-                    int address = NioUtils.getDirectBufferAddress(buffer);
-                    bytesRead = (int) Platform.FILE_SYSTEM.readDirect(handle, address,
-                            buffer.position(), buffer.remaining());
-                    completed = true;
-                } finally {
-                    end(completed && bytesRead >= 0);
+                    bytesRead = Libcore.os.read(fd, buffer);
+                } catch (ErrnoException errnoException) {
+                    if (errnoException.errno == EAGAIN) {
+                        // We don't throw if we try to read from an empty non-blocking pipe.
+                        bytesRead = 0;
+                    } else {
+                        throw errnoException.rethrowAsIOException();
+                    }
                 }
-            } else {
-                try {
-                    begin();
-                    /*
-                     * if (bytesRead <= EOF) dealt by read completed = false;
-                     */
-                    bytesRead = (int) Platform.FILE_SYSTEM.read(handle, buffer.array(),
-                            buffer.arrayOffset() + buffer.position(), buffer
-                                    .remaining());
-                    completed = true;
-                } finally {
-                    end(completed && bytesRead >= 0);
-                }
+                completed = true;
+            } finally {
+                end(completed && bytesRead >= 0);
             }
             if (bytesRead > 0) {
                 buffer.position(buffer.position() + bytesRead);
             }
+            return bytesRead;
         }
-        return bytesRead;
+    }
+
+    private int transferIoVec(IoVec ioVec) throws IOException {
+        if (ioVec.init() == 0) {
+            return 0;
+        }
+        int bytesTransferred = 0;
+        boolean completed = false;
+        try {
+            begin();
+            synchronized (repositioningLock) {
+                bytesTransferred = ioVec.doTransfer(fd);
+            }
+            completed = true;
+        } finally {
+            end(completed);
+        }
+        ioVec.didTransfer(bytesTransferred);
+        return bytesTransferred;
     }
 
     public long read(ByteBuffer[] buffers, int offset, int length) throws IOException {
         Arrays.checkOffsetAndCount(buffers.length, offset, length);
-        openCheck();
-        int count = FileChannelImpl.calculateTotalRemaining(buffers, offset, length, true);
-        if (count == 0) {
-            return 0;
-        }
-        ByteBuffer[] directBuffers = new ByteBuffer[length];
-        int[] handles = new int[length];
-        int[] offsets = new int[length];
-        int[] lengths = new int[length];
-        for (int i = 0; i < length; i++) {
-            ByteBuffer buffer = buffers[i + offset];
-            if (!buffer.isDirect()) {
-                buffer = ByteBuffer.allocateDirect(buffer.remaining());
-                directBuffers[i] = buffer;
-                offsets[i] = 0;
-            } else {
-                offsets[i] = buffer.position();
-            }
-            handles[i] = NioUtils.getDirectBufferAddress(buffer);
-            lengths[i] = buffer.remaining();
-        }
-        long bytesRead = 0;
-        {
-            boolean completed = false;
-            try {
-                begin();
-                synchronized (repositioningLock) {
-                    bytesRead = Platform.FILE_SYSTEM.readv(handle, handles, offsets,
-                            lengths, length);
-
-                }
-                completed = true;
-                /*
-                 * if (bytesRead < EOF) //dealt by readv? completed = false;
-                 */
-            } finally {
-                end(completed);
-            }
-        }
-        int end = offset + length;
-        long bytesRemaining = bytesRead;
-        for (int i = offset; i < end && bytesRemaining > 0; i++) {
-            if (buffers[i].isDirect()) {
-                if (lengths[i] < bytesRemaining) {
-                    int pos = buffers[i].limit();
-                    buffers[i].position(pos);
-                    bytesRemaining -= lengths[i];
-                } else {
-                    int pos = (int) bytesRemaining;
-                    buffers[i].position(pos);
-                    break;
-                }
-            } else {
-                ByteBuffer buf = directBuffers[i - offset];
-                if (bytesRemaining < buf.remaining()) {
-                    // this is the last step.
-                    int pos = buf.position();
-                    buffers[i].put(buf);
-                    buffers[i].position(pos + (int) bytesRemaining);
-                    bytesRemaining = 0;
-                } else {
-                    bytesRemaining -= buf.remaining();
-                    buffers[i].put(buf);
-                }
-            }
-        }
-        return bytesRead;
+        checkOpen();
+        checkReadable();
+        return transferIoVec(new IoVec(buffers, offset, length, IoVec.Direction.READV));
     }
 
-    /**
-     * Returns the current file size, as an integer number of bytes.
-     */
     public long size() throws IOException {
-        openCheck();
-        return Platform.FILE_SYSTEM.length(handle);
+        checkOpen();
+        try {
+            return Libcore.os.fstat(fd).st_size;
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
     }
 
-    public long transferFrom(ReadableByteChannel src, long position, long count)
-            throws IOException {
-        openCheck();
+    public long transferFrom(ReadableByteChannel src, long position, long count) throws IOException {
+        checkOpen();
         if (!src.isOpen()) {
             throw new ClosedChannelException();
         }
+        checkWritable();
         if (position < 0 || count < 0 || count > Integer.MAX_VALUE) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("position=" + position + " count=" + count);
         }
         if (position > size()) {
             return 0;
@@ -379,28 +390,46 @@
 
     public long transferTo(long position, long count, WritableByteChannel target)
             throws IOException {
-        openCheck();
+        checkOpen();
         if (!target.isOpen()) {
             throw new ClosedChannelException();
         }
-        if (target instanceof ReadOnlyFileChannel) {
-            throw new NonWritableChannelException();
+        if (target instanceof FileChannelImpl) {
+            ((FileChannelImpl) target).checkWritable();
         }
         if (position < 0 || count < 0) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("position=" + position + " count=" + count);
         }
 
         if (count == 0 || position >= size()) {
             return 0;
         }
-        ByteBuffer buffer = null;
         count = Math.min(count, size() - position);
-        if (target instanceof SocketChannelImpl) {
-            // only socket can be transfered by system call
-            return kernelTransfer(handle, ((SocketChannelImpl) target).getFD(),
-                    position, count);
-        }
 
+        // Try sendfile(2) first...
+        boolean completed = false;
+        if (target instanceof SocketChannelImpl) {
+            FileDescriptor outFd = ((SocketChannelImpl) target).getFD();
+            try {
+                begin();
+                try {
+                    MutableLong offset = new MutableLong(position);
+                    long rc = Libcore.os.sendfile(outFd, fd, offset, count);
+                    completed = true;
+                    return rc;
+                } catch (ErrnoException errnoException) {
+                    // If the OS doesn't support what we asked for, we want to fall through and
+                    // try a different approach. If it does support it, but it failed, we're done.
+                    if (errnoException.errno != ENOSYS && errnoException.errno != EINVAL) {
+                        throw errnoException.rethrowAsIOException();
+                    }
+                }
+            } finally {
+                end(completed);
+            }
+        }
+        // ...fall back to write(2).
+        ByteBuffer buffer = null;
         try {
             buffer = map(MapMode.READ_ONLY, position, count);
             return target.write(buffer);
@@ -409,35 +438,17 @@
         }
     }
 
-    private long kernelTransfer(int l, FileDescriptor fd, long position,
-            long count) throws IOException {
-        boolean completed = false;
-        try {
-            begin();
-            long ret = Platform.FILE_SYSTEM.transfer(l, fd, position, count);
-            completed = true;
-            return ret;
-        } finally {
-            end(completed);
-        }
-    }
-
     public FileChannel truncate(long size) throws IOException {
-        openCheck();
+        checkOpen();
         if (size < 0) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("size: " + size);
         }
+        checkWritable();
         if (size < size()) {
-            synchronized (repositioningLock) {
-                long position = position();
-                Platform.FILE_SYSTEM.truncate(handle, size);
-                /*
-                 * FIXME: currently the port library always modifies the
-                 * position to given size. not sure it is a bug or intended
-                 * behavior, so I always reset the position to proper value as
-                 * Java Spec.
-                 */
-                position(position > size ? size : position);
+            try {
+                Libcore.os.ftruncate(fd, size);
+            } catch (ErrnoException errnoException) {
+                throw errnoException.rethrowAsIOException();
             }
         }
         return this;
@@ -445,12 +456,13 @@
 
     public int write(ByteBuffer buffer, long position) throws IOException {
         if (buffer == null) {
-            throw new NullPointerException();
+            throw new NullPointerException("buffer == null");
         }
         if (position < 0) {
-            throw new IllegalArgumentException();
+            throw new IllegalArgumentException("position: " + position);
         }
-        openCheck();
+        checkOpen();
+        checkWritable();
         if (!buffer.hasRemaining()) {
             return 0;
         }
@@ -468,103 +480,41 @@
     }
 
     public int write(ByteBuffer buffer) throws IOException {
-        openCheck();
+        checkOpen();
+        checkWritable();
+        if ((mode & O_APPEND) != 0) {
+            position(size());
+        }
         return writeImpl(buffer);
     }
 
     private int writeImpl(ByteBuffer buffer) throws IOException {
-        int bytesWritten;
-        boolean completed = false;
         synchronized (repositioningLock) {
-            if (buffer.isDirect()) {
+            int bytesWritten = 0;
+            boolean completed = false;
+            try {
+                begin();
                 try {
-                    begin();
-                    int address = NioUtils.getDirectBufferAddress(buffer);
-                    bytesWritten = (int) Platform.FILE_SYSTEM.writeDirect(handle,
-                            address, buffer.position(), buffer.remaining());
-                    completed = true;
-                } finally {
-                    end(completed);
+                    bytesWritten = Libcore.os.write(fd, buffer);
+                } catch (ErrnoException errnoException) {
+                    throw errnoException.rethrowAsIOException();
                 }
-            } else {
-                try {
-                    begin();
-                    bytesWritten = (int) Platform.FILE_SYSTEM.write(handle, buffer
-                            .array(), buffer.arrayOffset() + buffer.position(),
-                            buffer.remaining());
-                    completed = true;
-                } finally {
-                    end(completed);
-                }
+                completed = true;
+            } finally {
+                end(completed);
             }
             if (bytesWritten > 0) {
                 buffer.position(buffer.position() + bytesWritten);
             }
+            return bytesWritten;
         }
-        return bytesWritten;
     }
 
     public long write(ByteBuffer[] buffers, int offset, int length) throws IOException {
         Arrays.checkOffsetAndCount(buffers.length, offset, length);
-        openCheck();
-        int count = FileChannelImpl.calculateTotalRemaining(buffers, offset, length, false);
-        if (count == 0) {
-            return 0;
-        }
-        int[] handles = new int[length];
-        int[] offsets = new int[length];
-        int[] lengths = new int[length];
-        // BEGIN android-changed
-        // list of allocated direct ByteBuffers to prevent them from being GC-ed
-        ByteBuffer[] allocatedBufs = new ByteBuffer[length];
-
-        for (int i = 0; i < length; i++) {
-            ByteBuffer buffer = buffers[i + offset];
-            if (!buffer.isDirect()) {
-                ByteBuffer directBuffer = ByteBuffer.allocateDirect(buffer.remaining());
-                directBuffer.put(buffer);
-                directBuffer.flip();
-                buffer = directBuffer;
-                allocatedBufs[i] = directBuffer;
-                offsets[i] = 0;
-            } else {
-                offsets[i] = buffer.position();
-                allocatedBufs[i] = null;
-            }
-            handles[i] = NioUtils.getDirectBufferAddress(buffer);
-            lengths[i] = buffer.remaining();
-        }
-        // END android-changed
-
-        long bytesWritten = 0;
-        boolean completed = false;
-        synchronized (repositioningLock) {
-            try {
-                begin();
-                bytesWritten = Platform.FILE_SYSTEM.writev(handle, handles, offsets,
-                        lengths, length);
-                completed = true;
-            } finally {
-                end(completed);
-                for (ByteBuffer buffer : allocatedBufs) {
-                    NioUtils.freeDirectBuffer(buffer);
-                }
-            }
-        }
-
-        long bytesRemaining = bytesWritten;
-        for (int i = offset; i < length + offset; i++) {
-            if (bytesRemaining > buffers[i].remaining()) {
-                int pos = buffers[i].limit();
-                buffers[i].position(pos);
-                bytesRemaining -= buffers[i].remaining();
-            } else {
-                int pos = buffers[i].position() + (int) bytesRemaining;
-                buffers[i].position(pos);
-                break;
-            }
-        }
-        return bytesWritten;
+        checkOpen();
+        checkWritable();
+        return transferIoVec(new IoVec(buffers, offset, length, IoVec.Direction.WRITEV));
     }
 
     static void checkWritable(ByteBuffer buffer) {
@@ -589,8 +539,8 @@
         return count;
     }
 
-    public int getHandle() {
-        return handle;
+    public FileDescriptor getFD() {
+        return fd;
     }
 
     /**
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/java/nio/FileDescriptorChannel.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/java/nio/FileDescriptorChannel.java
index 5d1725d..4f8993e 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/java/nio/FileDescriptorChannel.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,13 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package java.nio;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+import java.io.FileDescriptor;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
-    }
+/**
+ * Allows access to the FileDescriptor underlying a Channel.
+ */
+interface FileDescriptorChannel {
+    public FileDescriptor getFD();
 }
diff --git a/luni/src/main/java/java/nio/HeapByteBuffer.java b/luni/src/main/java/java/nio/HeapByteBuffer.java
index d0e63d9..8ba9980 100644
--- a/luni/src/main/java/java/nio/HeapByteBuffer.java
+++ b/luni/src/main/java/java/nio/HeapByteBuffer.java
@@ -18,7 +18,7 @@
 package java.nio;
 
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 /**
  * HeapByteBuffer, ReadWriteHeapByteBuffer and ReadOnlyHeapByteBuffer compose
@@ -34,9 +34,11 @@
  */
 abstract class HeapByteBuffer extends BaseByteBuffer {
 
-    protected final byte[] backingArray;
-
-    protected final int offset;
+    /**
+     * These fields are non-private for NioUtils.unsafeByteArray.
+     */
+    final byte[] backingArray;
+    final int offset;
 
     HeapByteBuffer(byte[] backingArray) {
         this(backingArray, backingArray.length, 0);
@@ -66,37 +68,37 @@
 
     final void get(char[] dst, int dstOffset, int charCount) {
         int byteCount = checkGetBounds(SizeOf.CHAR, dst.length, dstOffset, charCount);
-        OSMemory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.CHAR, order.needsSwap);
+        Memory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.CHAR, order.needsSwap);
         position += byteCount;
     }
 
     final void get(double[] dst, int dstOffset, int doubleCount) {
         int byteCount = checkGetBounds(SizeOf.DOUBLE, dst.length, dstOffset, doubleCount);
-        OSMemory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.DOUBLE, order.needsSwap);
+        Memory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.DOUBLE, order.needsSwap);
         position += byteCount;
     }
 
     final void get(float[] dst, int dstOffset, int floatCount) {
         int byteCount = checkGetBounds(SizeOf.FLOAT, dst.length, dstOffset, floatCount);
-        OSMemory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.FLOAT, order.needsSwap);
+        Memory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.FLOAT, order.needsSwap);
         position += byteCount;
     }
 
     final void get(int[] dst, int dstOffset, int intCount) {
         int byteCount = checkGetBounds(SizeOf.INT, dst.length, dstOffset, intCount);
-        OSMemory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.INT, order.needsSwap);
+        Memory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.INT, order.needsSwap);
         position += byteCount;
     }
 
     final void get(long[] dst, int dstOffset, int longCount) {
         int byteCount = checkGetBounds(SizeOf.LONG, dst.length, dstOffset, longCount);
-        OSMemory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.LONG, order.needsSwap);
+        Memory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.LONG, order.needsSwap);
         position += byteCount;
     }
 
     final void get(short[] dst, int dstOffset, int shortCount) {
         int byteCount = checkGetBounds(SizeOf.SHORT, dst.length, dstOffset, shortCount);
-        OSMemory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.SHORT, order.needsSwap);
+        Memory.unsafeBulkGet(dst, dstOffset, byteCount, backingArray, offset + position, SizeOf.SHORT, order.needsSwap);
         position += byteCount;
     }
 
@@ -120,7 +122,7 @@
         if (newPosition > limit) {
             throw new BufferUnderflowException();
         }
-        char result = (char) OSMemory.peekShort(backingArray, offset + position, order);
+        char result = (char) Memory.peekShort(backingArray, offset + position, order);
         position = newPosition;
         return result;
     }
@@ -128,7 +130,7 @@
     @Override
     public final char getChar(int index) {
         checkIndex(index, SizeOf.CHAR);
-        return (char) OSMemory.peekShort(backingArray, offset + index, order);
+        return (char) Memory.peekShort(backingArray, offset + index, order);
     }
 
     @Override
@@ -157,7 +159,7 @@
         if (newPosition > limit) {
             throw new BufferUnderflowException();
         }
-        int result = OSMemory.peekInt(backingArray, offset + position, order);
+        int result = Memory.peekInt(backingArray, offset + position, order);
         position = newPosition;
         return result;
     }
@@ -165,7 +167,7 @@
     @Override
     public final int getInt(int index) {
         checkIndex(index, SizeOf.INT);
-        return OSMemory.peekInt(backingArray, offset + index, order);
+        return Memory.peekInt(backingArray, offset + index, order);
     }
 
     @Override
@@ -174,7 +176,7 @@
         if (newPosition > limit) {
             throw new BufferUnderflowException();
         }
-        long result = OSMemory.peekLong(backingArray, offset + position, order);
+        long result = Memory.peekLong(backingArray, offset + position, order);
         position = newPosition;
         return result;
     }
@@ -182,7 +184,7 @@
     @Override
     public final long getLong(int index) {
         checkIndex(index, SizeOf.LONG);
-        return OSMemory.peekLong(backingArray, offset + index, order);
+        return Memory.peekLong(backingArray, offset + index, order);
     }
 
     @Override
@@ -191,7 +193,7 @@
         if (newPosition > limit) {
             throw new BufferUnderflowException();
         }
-        short result = OSMemory.peekShort(backingArray, offset + position, order);
+        short result = Memory.peekShort(backingArray, offset + position, order);
         position = newPosition;
         return result;
     }
@@ -199,7 +201,7 @@
     @Override
     public final short getShort(int index) {
         checkIndex(index, SizeOf.SHORT);
-        return OSMemory.peekShort(backingArray, offset + index, order);
+        return Memory.peekShort(backingArray, offset + index, order);
     }
 
     @Override
diff --git a/luni/src/main/java/java/nio/IntBuffer.java b/luni/src/main/java/java/nio/IntBuffer.java
index 3e1d9a3..9cc05ff 100644
--- a/luni/src/main/java/java/nio/IntBuffer.java
+++ b/luni/src/main/java/java/nio/IntBuffer.java
@@ -146,7 +146,6 @@
                 : otherBuffer.remaining();
         int thisPos = position;
         int otherPos = otherBuffer.position;
-        // BEGIN android-changed
         int thisInt, otherInt;
         while (compareRemaining > 0) {
             thisInt = get(thisPos);
@@ -158,7 +157,6 @@
             otherPos++;
             compareRemaining--;
         }
-        // END android-changed
         return remaining() - otherBuffer.remaining();
     }
 
diff --git a/luni/src/main/java/java/nio/InvalidMarkException.java b/luni/src/main/java/java/nio/InvalidMarkException.java
index f19f503..cb1050e 100644
--- a/luni/src/main/java/java/nio/InvalidMarkException.java
+++ b/luni/src/main/java/java/nio/InvalidMarkException.java
@@ -28,6 +28,5 @@
      * Constructs an {@code InvalidMarkException}.
      */
     public InvalidMarkException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/IoVec.java b/luni/src/main/java/java/nio/IoVec.java
new file mode 100644
index 0000000..77bddb6
--- /dev/null
+++ b/luni/src/main/java/java/nio/IoVec.java
@@ -0,0 +1,100 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package java.nio;
+
+import java.io.FileDescriptor;
+import java.io.IOException;
+import libcore.io.Libcore;
+import libcore.io.ErrnoException;
+
+/**
+ * Used to implement java.nio read(ByteBuffer[])/write(ByteBuffer[]) operations to POSIX readv(2)
+ * and writev(2) calls.
+ */
+final class IoVec {
+    enum Direction { READV, WRITEV };
+
+    private final ByteBuffer[] byteBuffers;
+    private final int offset;
+    private final int bufferCount;
+
+    private final Object[] ioBuffers;
+    private final int[] offsets;
+    private final int[] byteCounts;
+
+    private final Direction direction;
+
+    IoVec(ByteBuffer[] byteBuffers, int offset, int bufferCount, Direction direction) {
+        this.byteBuffers = byteBuffers;
+        this.offset = offset;
+        this.bufferCount = bufferCount;
+        this.direction = direction;
+        this.ioBuffers = new Object[bufferCount];
+        this.offsets = new int[bufferCount];
+        this.byteCounts = new int[bufferCount];
+    }
+
+    int init() {
+        int totalRemaining = 0;
+        for (int i = 0; i < bufferCount; ++i) {
+            ByteBuffer b = byteBuffers[i + offset];
+            if (direction == Direction.READV) {
+                FileChannelImpl.checkWritable(b);
+            }
+            int remaining = b.remaining();
+            if (b.isDirect()) {
+                ioBuffers[i] = b;
+                offsets[i] = b.position();
+            } else {
+                ioBuffers[i] = NioUtils.unsafeArray(b);
+                offsets[i] = NioUtils.unsafeArrayOffset(b) + b.position();
+            }
+            byteCounts[i] = remaining;
+            totalRemaining += remaining;
+        }
+        return totalRemaining;
+    }
+
+    int doTransfer(FileDescriptor fd) throws IOException {
+        try {
+            if (direction == Direction.READV) {
+                int result = Libcore.os.readv(fd, ioBuffers, offsets, byteCounts);
+                if (result == 0) {
+                    result = -1;
+                }
+                return result;
+            } else {
+                return Libcore.os.writev(fd, ioBuffers, offsets, byteCounts);
+            }
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
+    }
+
+    void didTransfer(int byteCount) {
+        for (int i = 0; byteCount > 0 && i < bufferCount; ++i) {
+            ByteBuffer b = byteBuffers[i + offset];
+            if (byteCounts[i] < byteCount) {
+                b.position(b.limit());
+                byteCount -= byteCounts[i];
+            } else {
+                b.position((direction == Direction.WRITEV ? b.position() : 0) + byteCounts[i]);
+                byteCount = 0;
+            }
+        }
+    }
+}
diff --git a/luni/src/main/java/java/nio/LongBuffer.java b/luni/src/main/java/java/nio/LongBuffer.java
index 3b4be66..27edd2e 100644
--- a/luni/src/main/java/java/nio/LongBuffer.java
+++ b/luni/src/main/java/java/nio/LongBuffer.java
@@ -148,7 +148,6 @@
                 : otherBuffer.remaining();
         int thisPos = position;
         int otherPos = otherBuffer.position;
-        // BEGIN android-changed
         long thisLong, otherLong;
         while (compareRemaining > 0) {
             thisLong = get(thisPos);
@@ -160,7 +159,6 @@
             otherPos++;
             compareRemaining--;
         }
-        // END android-changed
         return remaining() - otherBuffer.remaining();
     }
 
diff --git a/luni/src/main/java/java/nio/MappedByteBuffer.java b/luni/src/main/java/java/nio/MappedByteBuffer.java
index 9a99781..39c4986 100644
--- a/luni/src/main/java/java/nio/MappedByteBuffer.java
+++ b/luni/src/main/java/java/nio/MappedByteBuffer.java
@@ -17,7 +17,10 @@
 package java.nio;
 
 import java.nio.channels.FileChannel.MapMode;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.ErrnoException;
+import libcore.io.Libcore;
+import libcore.io.Memory;
+import static libcore.io.OsConstants.*;
 
 /**
  * {@code MappedByteBuffer} is a special kind of direct byte buffer which maps a
@@ -59,25 +62,46 @@
     }
 
     /**
-     * Indicates whether this buffer's content is loaded. If the result is true
-     * there is a high probability that the whole buffer memory is currently
-     * loaded in RAM. If it is false it is unsure if it is loaded or not.
-     *
-     * @return {@code true} if this buffer's content is loaded, {@code false}
-     *         otherwise.
+     * Returns true if there is a high probability that every page of this buffer is currently
+     * loaded in RAM, meaning that accesses will not cause a page fault. It is impossible to give
+     * a strong guarantee since this is only a snapshot of a dynamic situation.
      */
     public final boolean isLoaded() {
-        return OSMemory.isLoaded(block.toInt(), block.getSize());
+        long address = block.toInt();
+        long size = block.getSize();
+        if (size == 0) {
+            return true;
+        }
+
+        try {
+            int pageSize = (int) Libcore.os.sysconf(_SC_PAGE_SIZE);
+            int pageOffset = (int) (address % pageSize);
+            address -= pageOffset;
+            size += pageOffset;
+            int pageCount = (int) ((size + pageSize - 1) / pageSize);
+            byte[] vector = new byte[pageCount];
+            Libcore.os.mincore(address, size, vector);
+            for (int i = 0; i < vector.length; ++i) {
+                if ((vector[i] & 1) != 1) {
+                    return false;
+                }
+            }
+            return true;
+        } catch (ErrnoException errnoException) {
+            return false;
+        }
     }
 
     /**
-     * Loads this buffer's content into memory but it is not guaranteed to
-     * succeed.
-     *
+     * Attempts to load every page of this buffer into RAM. See {@link #isLoaded}.
      * @return this buffer.
      */
     public final MappedByteBuffer load() {
-        OSMemory.load(block.toInt(), block.getSize());
+        try {
+            Libcore.os.mlock(block.toInt(), block.getSize());
+            Libcore.os.munlock(block.toInt(), block.getSize());
+        } catch (ErrnoException ignored) {
+        }
         return this;
     }
 
@@ -91,7 +115,13 @@
      */
     public final MappedByteBuffer force() {
         if (mapMode == MapMode.READ_WRITE) {
-            OSMemory.msync(block.toInt(), block.getSize());
+            try {
+                Libcore.os.msync(block.toInt(), block.getSize(), MS_SYNC);
+            } catch (ErrnoException errnoException) {
+                // The RI doesn't throw, presumably on the assumption that you can't get into
+                // a state where msync(2) could return an error.
+                throw new AssertionError(errnoException);
+            }
         }
         return this;
     }
diff --git a/luni/src/main/java/java/nio/MemoryBlock.java b/luni/src/main/java/java/nio/MemoryBlock.java
index 76a7b36..add69c5 100644
--- a/luni/src/main/java/java/nio/MemoryBlock.java
+++ b/luni/src/main/java/java/nio/MemoryBlock.java
@@ -18,9 +18,13 @@
 package java.nio;
 
 import dalvik.system.VMRuntime;
+import java.io.FileDescriptor;
 import java.io.IOException;
 import java.nio.channels.FileChannel.MapMode;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.ErrnoException;
+import libcore.io.Libcore;
+import libcore.io.Memory;
+import static libcore.io.OsConstants.*;
 
 class MemoryBlock {
     /**
@@ -33,7 +37,13 @@
 
         @Override public void free() {
             if (address != 0) {
-                OSMemory.munmap(address, size);
+                try {
+                    Libcore.os.munmap(address, size);
+                } catch (ErrnoException errnoException) {
+                    // The RI doesn't throw, presumably on the assumption that you can't get into
+                    // a state where munmap(2) could return an error.
+                    throw new AssertionError(errnoException);
+                }
                 address = 0;
             }
         }
@@ -58,6 +68,10 @@
             this.array = array;
         }
 
+        @Override public byte[] array() {
+            return array;
+        }
+
         @Override public void free() {
             array = null;
             address = 0;
@@ -78,13 +92,33 @@
     protected int address;
     protected final long size;
 
-    public static MemoryBlock mmap(int fd, long start, long size, MapMode mode) throws IOException {
+    public static MemoryBlock mmap(FileDescriptor fd, long offset, long size, MapMode mapMode) throws IOException {
         if (size == 0) {
-            // You can't mmap(2) a zero-length region.
+            // You can't mmap(2) a zero-length region, but Java allows it.
             return new MemoryBlock(0, 0);
         }
-        int address = OSMemory.mmap(fd, start, size, mode);
-        return new MemoryMappedBlock(address, size);
+        // Check just those errors mmap(2) won't detect.
+        if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
+            throw new IllegalArgumentException("offset=" + offset + " size=" + size);
+        }
+        int prot;
+        int flags;
+        if (mapMode == MapMode.PRIVATE) {
+            prot = PROT_READ|PROT_WRITE;
+            flags = MAP_PRIVATE;
+        } else if (mapMode == MapMode.READ_ONLY) {
+            prot = PROT_READ;
+            flags = MAP_SHARED;
+        } else { // mapMode == MapMode.READ_WRITE
+            prot = PROT_READ|PROT_WRITE;
+            flags = MAP_SHARED;
+        }
+        try {
+            int address = (int) Libcore.os.mmap(0L, size, prot, flags, fd, offset);
+            return new MemoryMappedBlock(address, size);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
     }
 
     public static MemoryBlock allocate(int byteCount) {
@@ -103,95 +137,100 @@
         this.size = size;
     }
 
+    // Used to support array/arrayOffset/hasArray for direct buffers.
+    public byte[] array() {
+        return null;
+    }
+
     public void free() {
     }
 
     public final void pokeByte(int offset, byte value) {
-        OSMemory.pokeByte(address + offset, value);
+        Memory.pokeByte(address + offset, value);
     }
 
     public final void pokeByteArray(int offset, byte[] src, int srcOffset, int byteCount) {
-        OSMemory.pokeByteArray(address + offset, src, srcOffset, byteCount);
+        Memory.pokeByteArray(address + offset, src, srcOffset, byteCount);
     }
 
     public final void pokeCharArray(int offset, char[] src, int srcOffset, int charCount, boolean swap) {
-        OSMemory.pokeCharArray(address + offset, src, srcOffset, charCount, swap);
+        Memory.pokeCharArray(address + offset, src, srcOffset, charCount, swap);
     }
 
     public final void pokeDoubleArray(int offset, double[] src, int srcOffset, int doubleCount, boolean swap) {
-        OSMemory.pokeDoubleArray(address + offset, src, srcOffset, doubleCount, swap);
+        Memory.pokeDoubleArray(address + offset, src, srcOffset, doubleCount, swap);
     }
 
     public final void pokeFloatArray(int offset, float[] src, int srcOffset, int floatCount, boolean swap) {
-        OSMemory.pokeFloatArray(address + offset, src, srcOffset, floatCount, swap);
+        Memory.pokeFloatArray(address + offset, src, srcOffset, floatCount, swap);
     }
 
     public final void pokeIntArray(int offset, int[] src, int srcOffset, int intCount, boolean swap) {
-        OSMemory.pokeIntArray(address + offset, src, srcOffset, intCount, swap);
+        Memory.pokeIntArray(address + offset, src, srcOffset, intCount, swap);
     }
 
     public final void pokeLongArray(int offset, long[] src, int srcOffset, int longCount, boolean swap) {
-        OSMemory.pokeLongArray(address + offset, src, srcOffset, longCount, swap);
+        Memory.pokeLongArray(address + offset, src, srcOffset, longCount, swap);
     }
 
     public final void pokeShortArray(int offset, short[] src, int srcOffset, int shortCount, boolean swap) {
-        OSMemory.pokeShortArray(address + offset, src, srcOffset, shortCount, swap);
+        Memory.pokeShortArray(address + offset, src, srcOffset, shortCount, swap);
     }
 
     public final byte peekByte(int offset) {
-        return OSMemory.peekByte(address + offset);
+        return Memory.peekByte(address + offset);
     }
 
     public final void peekByteArray(int offset, byte[] dst, int dstOffset, int byteCount) {
-        OSMemory.peekByteArray(address + offset, dst, dstOffset, byteCount);
+        Memory.peekByteArray(address + offset, dst, dstOffset, byteCount);
     }
 
     public final void peekCharArray(int offset, char[] dst, int dstOffset, int charCount, boolean swap) {
-        OSMemory.peekCharArray(address + offset, dst, dstOffset, charCount, swap);
+        Memory.peekCharArray(address + offset, dst, dstOffset, charCount, swap);
     }
 
     public final void peekDoubleArray(int offset, double[] dst, int dstOffset, int doubleCount, boolean swap) {
-        OSMemory.peekDoubleArray(address + offset, dst, dstOffset, doubleCount, swap);
+        Memory.peekDoubleArray(address + offset, dst, dstOffset, doubleCount, swap);
     }
 
     public final void peekFloatArray(int offset, float[] dst, int dstOffset, int floatCount, boolean swap) {
-        OSMemory.peekFloatArray(address + offset, dst, dstOffset, floatCount, swap);
+        Memory.peekFloatArray(address + offset, dst, dstOffset, floatCount, swap);
     }
 
     public final void peekIntArray(int offset, int[] dst, int dstOffset, int intCount, boolean swap) {
-        OSMemory.peekIntArray(address + offset, dst, dstOffset, intCount, swap);
+        Memory.peekIntArray(address + offset, dst, dstOffset, intCount, swap);
     }
 
     public final void peekLongArray(int offset, long[] dst, int dstOffset, int longCount, boolean swap) {
-        OSMemory.peekLongArray(address + offset, dst, dstOffset, longCount, swap);
+        Memory.peekLongArray(address + offset, dst, dstOffset, longCount, swap);
     }
 
     public final void peekShortArray(int offset, short[] dst, int dstOffset, int shortCount, boolean swap) {
-        OSMemory.peekShortArray(address + offset, dst, dstOffset, shortCount, swap);
+        Memory.peekShortArray(address + offset, dst, dstOffset, shortCount, swap);
     }
 
     public final void pokeShort(int offset, short value, ByteOrder order) {
-        OSMemory.pokeShort(address + offset, value, order.needsSwap);
+        Memory.pokeShort(address + offset, value, order.needsSwap);
     }
 
     public final short peekShort(int offset, ByteOrder order) {
-        return OSMemory.peekShort(address + offset, order.needsSwap);
+        return Memory.peekShort(address + offset, order.needsSwap);
     }
 
     public final void pokeInt(int offset, int value, ByteOrder order) {
-        OSMemory.pokeInt(address + offset, value, order.needsSwap);
+        Memory.pokeInt(address + offset, value, order.needsSwap);
     }
 
     public final int peekInt(int offset, ByteOrder order) {
-        return OSMemory.peekInt(address + offset, order.needsSwap);
+        return Memory.peekInt(address + offset, order.needsSwap);
     }
 
     public final void pokeLong(int offset, long value, ByteOrder order) {
-        OSMemory.pokeLong(address + offset, value, order.needsSwap);
+        Memory.pokeLong(address + offset, value, order.needsSwap);
     }
 
     public final long peekLong(int offset, ByteOrder order) {
-        return OSMemory.peekLong(address + offset, order.needsSwap);
+        return Memory.peekLong(address + offset, order.needsSwap);
     }
 
     public final int toInt() {
diff --git a/luni/src/main/java/java/nio/NioUtils.java b/luni/src/main/java/java/nio/NioUtils.java
index 5d7e7e2..56b8b8b 100644
--- a/luni/src/main/java/java/nio/NioUtils.java
+++ b/luni/src/main/java/java/nio/NioUtils.java
@@ -16,8 +16,8 @@
 
 package java.nio;
 
+import java.io.FileDescriptor;
 import java.nio.channels.FileChannel;
-import org.apache.harmony.luni.platform.IFileSystem;
 
 /**
  * @hide internal use only
@@ -61,27 +61,30 @@
     /**
      * Returns the int file descriptor from within the given FileChannel 'fc'.
      */
-    public static int getFd(FileChannel fc) {
-        return ((FileChannelImpl) fc).getHandle();
+    public static FileDescriptor getFD(FileChannel fc) {
+        return ((FileChannelImpl) fc).getFD();
     }
 
     /**
      * Helps bridge between io and nio.
      */
-    public static FileChannel newFileChannel(Object stream, int fd, int mode) {
-        switch (mode) {
-        case IFileSystem.O_RDONLY:
-            return new ReadOnlyFileChannel(stream, fd);
-        case IFileSystem.O_WRONLY:
-            return new WriteOnlyFileChannel(stream, fd);
-        case IFileSystem.O_RDWR:
-            return new ReadWriteFileChannel(stream, fd);
-        case IFileSystem.O_RDWRSYNC:
-            return new ReadWriteFileChannel(stream, fd);
-        case IFileSystem.O_APPEND:
-            return new WriteOnlyFileChannel(stream, fd, true);
-        default:
-            throw new RuntimeException("Unknown mode: " + mode);
-        }
+    public static FileChannel newFileChannel(Object stream, FileDescriptor fd, int mode) {
+        return new FileChannelImpl(stream, fd, mode);
+    }
+
+    /**
+     * Exposes the array backing a non-direct ByteBuffer, even if the ByteBuffer is read-only.
+     * Normally, attempting to access the array backing a read-only buffer throws.
+     */
+    public static byte[] unsafeArray(ByteBuffer b) {
+        return ((HeapByteBuffer) b).backingArray;
+    }
+
+    /**
+     * Exposes the array offset for the array backing a non-direct ByteBuffer,
+     * even if the ByteBuffer is read-only.
+     */
+    public static int unsafeArrayOffset(ByteBuffer b) {
+        return ((HeapByteBuffer) b).offset;
     }
 }
diff --git a/luni/src/main/java/java/nio/PipeImpl.java b/luni/src/main/java/java/nio/PipeImpl.java
index 2e6418e..50028f4 100644
--- a/luni/src/main/java/java/nio/PipeImpl.java
+++ b/luni/src/main/java/java/nio/PipeImpl.java
@@ -19,10 +19,13 @@
 import java.io.Closeable;
 import java.io.FileDescriptor;
 import java.io.IOException;
+import java.nio.channels.FileChannel;
 import java.nio.channels.Pipe;
 import java.nio.channels.spi.SelectorProvider;
+import libcore.io.ErrnoException;
 import libcore.io.IoUtils;
-import org.apache.harmony.luni.platform.FileDescriptorHandler;
+import libcore.io.Libcore;
+import static libcore.io.OsConstants.*;
 
 /*
  * Implements {@link java.nio.channels.Pipe}.
@@ -32,12 +35,15 @@
     private final PipeSourceChannel source;
 
     public PipeImpl() throws IOException {
-        int[] fds = new int[2];
-        IoUtils.pipe(fds);
-        // Which fd is used for which channel is important. Unix pipes are only guaranteed to be
-        // unidirectional, and indeed are only unidirectional on Linux. See IoUtils.pipe.
-        this.sink = new PipeSinkChannel(fds[1]);
-        this.source = new PipeSourceChannel(fds[0]);
+        try {
+            FileDescriptor[] fds = Libcore.os.pipe();
+            // Which fd is used for which channel is important. Unix pipes are only guaranteed to be
+            // unidirectional, and indeed are only unidirectional on Linux.
+            this.sink = new PipeSinkChannel(fds[1]);
+            this.source = new PipeSourceChannel(fds[0]);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
     }
 
     @Override public SinkChannel sink() {
@@ -61,14 +67,14 @@
         }
     }
 
-    private class PipeSourceChannel extends Pipe.SourceChannel implements FileDescriptorHandler {
+    private class PipeSourceChannel extends Pipe.SourceChannel implements FileDescriptorChannel {
         private final FileDescriptor fd;
-        private final FileChannelImpl channel;
+        private final FileChannel channel;
 
-        private PipeSourceChannel(int fd) throws IOException {
+        private PipeSourceChannel(FileDescriptor fd) throws IOException {
             super(SelectorProvider.provider());
-            this.fd = IoUtils.newFileDescriptor(fd);
-            this.channel = new ReadOnlyFileChannel(new FdCloser(this.fd), fd);
+            this.fd = fd;
+            this.channel = NioUtils.newFileChannel(new FdCloser(fd), fd, O_RDONLY);
         }
 
         @Override protected void implCloseSelectableChannel() throws IOException {
@@ -96,14 +102,14 @@
         }
     }
 
-    private class PipeSinkChannel extends Pipe.SinkChannel implements FileDescriptorHandler {
+    private class PipeSinkChannel extends Pipe.SinkChannel implements FileDescriptorChannel {
         private final FileDescriptor fd;
-        private final FileChannelImpl channel;
+        private final FileChannel channel;
 
-        private PipeSinkChannel(int fd) throws IOException {
+        private PipeSinkChannel(FileDescriptor fd) throws IOException {
             super(SelectorProvider.provider());
-            this.fd = IoUtils.newFileDescriptor(fd);
-            this.channel = new WriteOnlyFileChannel(new FdCloser(this.fd), fd);
+            this.fd = fd;
+            this.channel = NioUtils.newFileChannel(new FdCloser(fd), fd, O_WRONLY);
         }
 
         @Override protected void implCloseSelectableChannel() throws IOException {
diff --git a/luni/src/main/java/java/nio/ReadOnlyBufferException.java b/luni/src/main/java/java/nio/ReadOnlyBufferException.java
index 7c2a5a0..ae310f9 100644
--- a/luni/src/main/java/java/nio/ReadOnlyBufferException.java
+++ b/luni/src/main/java/java/nio/ReadOnlyBufferException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code ReadOnlyBufferException}.
      */
     public ReadOnlyBufferException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/ReadOnlyDirectByteBuffer.java b/luni/src/main/java/java/nio/ReadOnlyDirectByteBuffer.java
index d061e9c..0d61797 100644
--- a/luni/src/main/java/java/nio/ReadOnlyDirectByteBuffer.java
+++ b/luni/src/main/java/java/nio/ReadOnlyDirectByteBuffer.java
@@ -135,4 +135,16 @@
     public ByteBuffer slice() {
         return new ReadOnlyDirectByteBuffer(block, remaining(), offset + position);
     }
+
+    @Override protected byte[] protectedArray() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override protected int protectedArrayOffset() {
+        throw new ReadOnlyBufferException();
+    }
+
+    @Override protected boolean protectedHasArray() {
+        return false;
+    }
 }
diff --git a/luni/src/main/java/java/nio/ReadOnlyFileChannel.java b/luni/src/main/java/java/nio/ReadOnlyFileChannel.java
deleted file mode 100644
index 8d3a907..0000000
--- a/luni/src/main/java/java/nio/ReadOnlyFileChannel.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package java.nio;
-
-import java.io.IOException;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.nio.channels.NonWritableChannelException;
-import java.nio.channels.ReadableByteChannel;
-import java.util.Arrays;
-
-final class ReadOnlyFileChannel extends FileChannelImpl {
-    public ReadOnlyFileChannel(Object stream, int handle) {
-        super(stream, handle);
-    }
-
-    public final int write(ByteBuffer buffer, long position) throws IOException {
-        if (buffer == null) {
-            throw new NullPointerException();
-        }
-        if (position < 0) {
-            throw new IllegalArgumentException();
-        }
-        throw new NonWritableChannelException();
-    }
-
-    public final int write(ByteBuffer buffer) throws IOException {
-        openCheck();
-        throw new NonWritableChannelException();
-    }
-
-    public final long write(ByteBuffer[] buffers, int offset, int length) throws IOException {
-        Arrays.checkOffsetAndCount(buffers.length, offset, length);
-        openCheck();
-        throw new NonWritableChannelException();
-    }
-
-    public final FileChannel truncate(long size) throws IOException {
-        openCheck();
-        if (size < 0) {
-            throw new IllegalArgumentException();
-        }
-        throw new NonWritableChannelException();
-    }
-
-    public final long transferFrom(ReadableByteChannel src, long position,
-            long count) throws IOException {
-        openCheck();
-        if (!src.isOpen()) {
-            throw new ClosedChannelException();
-        }
-        throw new NonWritableChannelException();
-    }
-
-    public final MappedByteBuffer map(MapMode mode, long position, long size) throws IOException {
-        openCheck();
-        if (mode == null) {
-            throw new NullPointerException();
-        }
-        if (position < 0 || size < 0 || size > Integer.MAX_VALUE) {
-            throw new IllegalArgumentException();
-        }
-        if (mode != MapMode.READ_ONLY) {
-            throw new NonWritableChannelException();
-        }
-        return super.mapImpl(mode, position, size);
-    }
-
-    @Override public final void force(boolean metadata) throws IOException {
-        openCheck();
-    }
-
-    protected final FileLock basicLock(long position, long size,
-            boolean shared, boolean wait) throws IOException {
-        if (!shared) {
-            throw new NonWritableChannelException();
-        }
-        return super.basicLock(position, size, shared, true);
-    }
-}
diff --git a/luni/src/main/java/java/nio/ReadWriteDirectByteBuffer.java b/luni/src/main/java/java/nio/ReadWriteDirectByteBuffer.java
index 091d06d..a746bd1 100644
--- a/luni/src/main/java/java/nio/ReadWriteDirectByteBuffer.java
+++ b/luni/src/main/java/java/nio/ReadWriteDirectByteBuffer.java
@@ -18,7 +18,7 @@
 package java.nio;
 
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 /**
  * DirectByteBuffer, ReadWriteDirectByteBuffer and ReadOnlyDirectByteBuffer
@@ -63,7 +63,7 @@
     @Override
     public ByteBuffer compact() {
         int addr = effectiveDirectAddress;
-        OSMemory.memmove(addr, addr + position, remaining());
+        Memory.memmove(addr, addr + position, remaining());
         position = limit - position;
         limit = capacity;
         mark = UNSET_MARK;
diff --git a/luni/src/main/java/java/nio/ReadWriteFileChannel.java b/luni/src/main/java/java/nio/ReadWriteFileChannel.java
deleted file mode 100644
index a458a6c..0000000
--- a/luni/src/main/java/java/nio/ReadWriteFileChannel.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package java.nio;
-
-import java.io.IOException;
-
-final class ReadWriteFileChannel extends FileChannelImpl {
-    public ReadWriteFileChannel(Object stream, int handle) {
-        super(stream, handle);
-    }
-
-    public final MappedByteBuffer map(MapMode mode, long position, long size) throws IOException {
-        openCheck();
-        if (mode == null) {
-            throw new NullPointerException();
-        }
-        if (position < 0 || size < 0 || size > Integer.MAX_VALUE) {
-            throw new IllegalArgumentException();
-        }
-        return mapImpl(mode, position, size);
-    }
-}
diff --git a/luni/src/main/java/java/nio/ReadWriteHeapByteBuffer.java b/luni/src/main/java/java/nio/ReadWriteHeapByteBuffer.java
index 81cac26..5358a13 100644
--- a/luni/src/main/java/java/nio/ReadWriteHeapByteBuffer.java
+++ b/luni/src/main/java/java/nio/ReadWriteHeapByteBuffer.java
@@ -16,8 +16,8 @@
 
 package java.nio;
 
+import libcore.io.Memory;
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
 
 /**
  * HeapByteBuffer, ReadWriteHeapByteBuffer and ReadOnlyHeapByteBuffer compose
@@ -118,44 +118,44 @@
 
     final void put(char[] src, int srcOffset, int charCount) {
         int byteCount = checkPutBounds(SizeOf.CHAR, src.length, srcOffset, charCount);
-        OSMemory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.CHAR, order.needsSwap);
+        Memory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.CHAR, order.needsSwap);
         position += byteCount;
     }
 
     final void put(double[] src, int srcOffset, int doubleCount) {
         int byteCount = checkPutBounds(SizeOf.DOUBLE, src.length, srcOffset, doubleCount);
-        OSMemory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.DOUBLE, order.needsSwap);
+        Memory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.DOUBLE, order.needsSwap);
         position += byteCount;
     }
 
     final void put(float[] src, int srcOffset, int floatCount) {
         int byteCount = checkPutBounds(SizeOf.FLOAT, src.length, srcOffset, floatCount);
-        OSMemory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.FLOAT, order.needsSwap);
+        Memory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.FLOAT, order.needsSwap);
         position += byteCount;
     }
 
     final void put(int[] src, int srcOffset, int intCount) {
         int byteCount = checkPutBounds(SizeOf.INT, src.length, srcOffset, intCount);
-        OSMemory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.INT, order.needsSwap);
+        Memory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.INT, order.needsSwap);
         position += byteCount;
     }
 
     final void put(long[] src, int srcOffset, int longCount) {
         int byteCount = checkPutBounds(SizeOf.LONG, src.length, srcOffset, longCount);
-        OSMemory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.LONG, order.needsSwap);
+        Memory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.LONG, order.needsSwap);
         position += byteCount;
     }
 
     final void put(short[] src, int srcOffset, int shortCount) {
         int byteCount = checkPutBounds(SizeOf.SHORT, src.length, srcOffset, shortCount);
-        OSMemory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.SHORT, order.needsSwap);
+        Memory.unsafeBulkPut(backingArray, offset + position, byteCount, src, srcOffset, SizeOf.SHORT, order.needsSwap);
         position += byteCount;
     }
 
     @Override
     public ByteBuffer putChar(int index, char value) {
         checkIndex(index, SizeOf.CHAR);
-        OSMemory.pokeShort(backingArray, offset + index, (short) value, order);
+        Memory.pokeShort(backingArray, offset + index, (short) value, order);
         return this;
     }
 
@@ -165,7 +165,7 @@
         if (newPosition > limit) {
             throw new BufferOverflowException();
         }
-        OSMemory.pokeShort(backingArray, offset + position, (short) value, order);
+        Memory.pokeShort(backingArray, offset + position, (short) value, order);
         position = newPosition;
         return this;
     }
@@ -196,7 +196,7 @@
         if (newPosition > limit) {
             throw new BufferOverflowException();
         }
-        OSMemory.pokeInt(backingArray, offset + position, value, order);
+        Memory.pokeInt(backingArray, offset + position, value, order);
         position = newPosition;
         return this;
     }
@@ -204,14 +204,14 @@
     @Override
     public ByteBuffer putInt(int index, int value) {
         checkIndex(index, SizeOf.INT);
-        OSMemory.pokeInt(backingArray, offset + index, value, order);
+        Memory.pokeInt(backingArray, offset + index, value, order);
         return this;
     }
 
     @Override
     public ByteBuffer putLong(int index, long value) {
         checkIndex(index, SizeOf.LONG);
-        OSMemory.pokeLong(backingArray, offset + index, value, order);
+        Memory.pokeLong(backingArray, offset + index, value, order);
         return this;
     }
 
@@ -221,7 +221,7 @@
         if (newPosition > limit) {
             throw new BufferOverflowException();
         }
-        OSMemory.pokeLong(backingArray, offset + position, value, order);
+        Memory.pokeLong(backingArray, offset + position, value, order);
         position = newPosition;
         return this;
     }
@@ -229,7 +229,7 @@
     @Override
     public ByteBuffer putShort(int index, short value) {
         checkIndex(index, SizeOf.SHORT);
-        OSMemory.pokeShort(backingArray, offset + index, value, order);
+        Memory.pokeShort(backingArray, offset + index, value, order);
         return this;
     }
 
@@ -239,7 +239,7 @@
         if (newPosition > limit) {
             throw new BufferOverflowException();
         }
-        OSMemory.pokeShort(backingArray, offset + position, value, order);
+        Memory.pokeShort(backingArray, offset + position, value, order);
         position = newPosition;
         return this;
     }
diff --git a/luni/src/main/java/java/nio/SelectorImpl.java b/luni/src/main/java/java/nio/SelectorImpl.java
index 67429b9..925c1e2 100644
--- a/luni/src/main/java/java/nio/SelectorImpl.java
+++ b/luni/src/main/java/java/nio/SelectorImpl.java
@@ -19,7 +19,6 @@
 import java.io.IOException;
 import java.nio.channels.ClosedSelectorException;
 import java.nio.channels.IllegalSelectorException;
-import java.nio.channels.Pipe;
 import java.nio.channels.SelectableChannel;
 import java.nio.channels.SelectionKey;
 import static java.nio.channels.SelectionKey.*;
@@ -35,8 +34,10 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import libcore.io.ErrnoException;
+import libcore.io.IoUtils;
+import libcore.io.Libcore;
 import libcore.util.EmptyArray;
-import org.apache.harmony.luni.platform.FileDescriptorHandler;
 import org.apache.harmony.luni.platform.Platform;
 
 /*
@@ -53,10 +54,6 @@
 
     private static final int ACCEPT_OR_READ = OP_ACCEPT | OP_READ;
 
-    private static final int WAKEUP_WRITE_SIZE = 1;
-
-    private static final int WAKEUP_READ_SIZE = 8;
-
     private static final int NA = 0;
 
     private static final int READABLE = 1;
@@ -91,9 +88,11 @@
             = new UnaddableSet<SelectionKey>(mutableSelectedKeys);
 
     /**
-     * The pipe used to implement wakeup.
+     * The wakeup pipe. To trigger a wakeup, write a byte to wakeupOut. Each
+     * time select returns, wakeupIn is drained.
      */
-    private final Pipe wakeupPipe;
+    private final FileDescriptor wakeupIn;
+    private final FileDescriptor wakeupOut;
 
     /**
      * File descriptors we're interested in reading from. When actively
@@ -125,8 +124,20 @@
 
     public SelectorImpl(SelectorProvider selectorProvider) throws IOException {
         super(selectorProvider);
-        wakeupPipe = selectorProvider.openPipe();
-        wakeupPipe.source().configureBlocking(false);
+
+        /*
+         * Create a pipes to trigger wakeup. We can't use a NIO pipe because it
+         * would be closed if the selecting thread is interrupted. Also
+         * configure the pipe so we can fully drain it without blocking.
+         */
+        try {
+            FileDescriptor[] pipeFds = Libcore.os.pipe();
+            wakeupIn = pipeFds[0];
+            wakeupOut = pipeFds[1];
+            IoUtils.setBlocking(wakeupIn, false);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
     }
 
     @Override protected void implCloseSelector() throws IOException {
@@ -134,8 +145,8 @@
         synchronized (this) {
             synchronized (unmodifiableKeys) {
                 synchronized (selectedKeys) {
-                    wakeupPipe.sink().close();
-                    wakeupPipe.source().close();
+                    IoUtils.close(wakeupIn);
+                    IoUtils.close(wakeupOut);
                     doCancel();
                     for (SelectionKey sk : mutableKeys) {
                         deregister((AbstractSelectionKey) sk);
@@ -161,14 +172,11 @@
     }
 
     @Override public synchronized Set<SelectionKey> keys() {
-        closeCheck();
+        checkClosed();
         return unmodifiableKeys;
     }
 
-    /*
-     * Checks that the receiver is not closed. If it is throws an exception.
-     */
-    private void closeCheck() {
+    private void checkClosed() {
         if (!isOpen()) {
             throw new ClosedSelectorException();
         }
@@ -190,7 +198,7 @@
     }
 
     private int selectInternal(long timeout) throws IOException {
-        closeCheck();
+        checkClosed();
         synchronized (this) {
             synchronized (unmodifiableKeys) {
                 synchronized (selectedKeys) {
@@ -268,18 +276,18 @@
         }
 
         // populate the FDs, including the wakeup channel
-        readableFDs[0] = ((FileDescriptorHandler) wakeupPipe.source()).getFD();
+        readableFDs[0] = wakeupIn;
         int r = 1;
         int w = 0;
         for (SelectionKeyImpl key : mutableKeys) {
             int interestOps = key.interestOpsNoCheck();
             if ((ACCEPT_OR_READ & interestOps) != 0) {
-                readableFDs[r] = ((FileDescriptorHandler) key.channel()).getFD();
+                readableFDs[r] = ((FileDescriptorChannel) key.channel()).getFD();
                 readyKeys[r] = key;
                 r++;
             }
             if ((getReadyOps(key) & interestOps) != 0) {
-                writableFDs[w] = ((FileDescriptorHandler) key.channel()).getFD();
+                writableFDs[w] = ((FileDescriptorChannel) key.channel()).getFD();
                 readyKeys[w + numReadable] = key;
                 w++;
             }
@@ -291,13 +299,10 @@
      * array.
      */
     private int processSelectResult() throws IOException {
-        // If there's something in the wakeup pipe, read it all --- the definition of the various
-        // select methods says that one select swallows all outstanding wakeups. We made this
-        // channel non-blocking in our constructor so that we can just loop until read returns 0.
         if (flags[0] == READABLE) {
-            ByteBuffer buf = ByteBuffer.allocate(WAKEUP_READ_SIZE);
-            while (wakeupPipe.source().read(buf) > 0) {
-                buf.flip();
+            // Read bytes from the wakeup pipe until the pipe is empty.
+            byte[] buffer = new byte[8];
+            while (IoUtils.read(wakeupIn, buffer, 0, 1) > 0) {
             }
         }
 
@@ -341,7 +346,7 @@
     }
 
     @Override public synchronized Set<SelectionKey> selectedKeys() {
-        closeCheck();
+        checkClosed();
         return selectedKeys;
     }
 
@@ -372,8 +377,8 @@
 
     @Override public Selector wakeup() {
         try {
-            wakeupPipe.sink().write(ByteBuffer.allocate(WAKEUP_WRITE_SIZE));
-        } catch (IOException ignored) {
+            Libcore.os.write(wakeupOut, new byte[] { 1 }, 0, 1);
+        } catch (ErrnoException ignored) {
         }
         return this;
     }
diff --git a/luni/src/main/java/java/nio/ServerSocketChannelImpl.java b/luni/src/main/java/java/nio/ServerSocketChannelImpl.java
index 9cefe5f..e3103b3 100644
--- a/luni/src/main/java/java/nio/ServerSocketChannelImpl.java
+++ b/luni/src/main/java/java/nio/ServerSocketChannelImpl.java
@@ -19,6 +19,7 @@
 
 import java.io.FileDescriptor;
 import java.io.IOException;
+import java.net.PlainServerSocketImpl;
 import java.net.ServerSocket;
 import java.net.Socket;
 import java.net.SocketAddress;
@@ -30,14 +31,12 @@
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
 import java.nio.channels.spi.SelectorProvider;
-import org.apache.harmony.luni.net.PlainServerSocketImpl;
-import org.apache.harmony.luni.platform.FileDescriptorHandler;
 import org.apache.harmony.luni.platform.Platform;
 
 /**
  * The default ServerSocketChannel.
  */
-final class ServerSocketChannelImpl extends ServerSocketChannel implements FileDescriptorHandler {
+final class ServerSocketChannelImpl extends ServerSocketChannel implements FileDescriptorChannel {
 
     private final FileDescriptor fd = new FileDescriptor();
     private final SocketImpl impl = new PlainServerSocketImpl(fd);
@@ -155,10 +154,6 @@
                     sockChannel.setBound(true);
                     sockChannel.finishAccept();
                 }
-                SecurityManager sm = System.getSecurityManager();
-                if (sm != null) {
-                    sm.checkAccept(socket.getInetAddress().getHostAddress(), socket.getPort());
-                }
                 connectOK = true;
             } finally {
                 if (!connectOK) {
diff --git a/luni/src/main/java/java/nio/ShortBuffer.java b/luni/src/main/java/java/nio/ShortBuffer.java
index 1f70ff9..052cf6b 100644
--- a/luni/src/main/java/java/nio/ShortBuffer.java
+++ b/luni/src/main/java/java/nio/ShortBuffer.java
@@ -257,7 +257,6 @@
      *                if {@code shortCount} is greater than {@code remaining()}.
      */
     public ShortBuffer get(short[] dst, int dstOffset, int shortCount) {
-        int length = dst.length;
         Arrays.checkOffsetAndCount(dst.length, dstOffset, shortCount);
         if (shortCount > remaining()) {
             throw new BufferUnderflowException();
@@ -399,7 +398,6 @@
      *                if no changes may be made to the contents of this buffer.
      */
     public ShortBuffer put(short[] src, int srcOffset, int shortCount) {
-        int length = src.length;
         Arrays.checkOffsetAndCount(src.length, srcOffset, shortCount);
         if (shortCount > remaining()) {
             throw new BufferOverflowException();
diff --git a/luni/src/main/java/java/nio/SocketChannelImpl.java b/luni/src/main/java/java/nio/SocketChannelImpl.java
index dbef3c0..35f5490 100644
--- a/luni/src/main/java/java/nio/SocketChannelImpl.java
+++ b/luni/src/main/java/java/nio/SocketChannelImpl.java
@@ -22,8 +22,10 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.ConnectException;
+import java.net.Inet4Address;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.net.PlainSocketImpl;
 import java.net.Socket;
 import java.net.SocketAddress;
 import java.net.SocketException;
@@ -40,15 +42,16 @@
 import java.nio.channels.UnsupportedAddressTypeException;
 import java.nio.channels.spi.SelectorProvider;
 import java.util.Arrays;
+import libcore.io.ErrnoException;
+import libcore.io.Libcore;
 import libcore.io.IoUtils;
-import org.apache.harmony.luni.net.PlainSocketImpl;
-import org.apache.harmony.luni.platform.FileDescriptorHandler;
 import org.apache.harmony.luni.platform.Platform;
+import static libcore.io.OsConstants.*;
 
 /*
  * The default implementation class of java.nio.channels.SocketChannel.
  */
-class SocketChannelImpl extends SocketChannel implements FileDescriptorHandler {
+class SocketChannelImpl extends SocketChannel implements FileDescriptorChannel {
 
     private static final int EOF = -1;
 
@@ -104,11 +107,8 @@
      */
     public SocketChannelImpl(SelectorProvider selectorProvider, boolean connect) throws IOException {
         super(selectorProvider);
-        fd = new FileDescriptor();
         status = SOCKET_STATUS_UNCONNECTED;
-        if (connect) {
-            Platform.NETWORK.socket(fd, true);
-        }
+        fd = (connect ? IoUtils.socket(true) : new FileDescriptor());
     }
 
     /*
@@ -162,20 +162,13 @@
         // check the address
         InetSocketAddress inetSocketAddress = validateAddress(socketAddress);
         InetAddress normalAddr = inetSocketAddress.getAddress();
+        int port = inetSocketAddress.getPort();
 
         // When connecting, map ANY address to Localhost
         if (normalAddr.isAnyLocalAddress()) {
             normalAddr = InetAddress.getLocalHost();
         }
 
-        int port = inetSocketAddress.getPort();
-        String hostName = normalAddr.getHostName();
-        // security check
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkConnect(hostName, port);
-        }
-
         // connect result
         int result = EOF;
         boolean finished = false;
@@ -227,8 +220,10 @@
     }
 
     private void initLocalAddressAndPort() {
-        localAddress = Platform.NETWORK.getSocketLocalAddress(fd);
-        localPort = Platform.NETWORK.getSocketLocalPort(fd);
+        SocketAddress sa = Libcore.os.getsockname(fd);
+        InetSocketAddress isa = (InetSocketAddress) sa;
+        localAddress = isa.getAddress();
+        localPort = isa.getPort();
         if (socket != null) {
             socket.socketImpl().initLocalPort(localPort);
         }
@@ -351,11 +346,8 @@
                 int offset = target.position();
                 int length = target.remaining();
                 if (target.isDirect()) {
-                    // BEGIN android-changed
-                    // changed address from long to int
                     int address = NioUtils.getDirectBufferAddress(target);
                     readCount = Platform.NETWORK.readDirect(fd, address + offset, length);
-                    // END android-changed
                 } else {
                     // target is assured to have array.
                     byte[] array = target.array();
@@ -497,11 +489,7 @@
      * Get local address.
      */
     public InetAddress getLocalAddress() throws UnknownHostException {
-        if (!isBound) {
-            byte[] any_bytes = { 0, 0, 0, 0 };
-            return InetAddress.getByAddress(any_bytes);
-        }
-        return localAddress;
+        return isBound ? localAddress : Inet4Address.ANY;
     }
 
     /*
@@ -716,9 +704,7 @@
             }
             ByteBuffer buf = ByteBuffer.allocate(1);
             int result = channel.read(buf);
-            // BEGIN android-changed: input was already consumed
-            return (-1 == result) ? result : buf.get(0) & 0xFF;
-            // END android-changed
+            return (result == -1) ? result : (buf.get(0) & 0xff);
         }
 
         @Override
diff --git a/luni/src/main/java/java/nio/WriteOnlyFileChannel.java b/luni/src/main/java/java/nio/WriteOnlyFileChannel.java
deleted file mode 100644
index c0c19e9..0000000
--- a/luni/src/main/java/java/nio/WriteOnlyFileChannel.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package java.nio;
-
-import java.io.IOException;
-import java.nio.channels.ClosedChannelException;
-import java.nio.channels.FileLock;
-import java.nio.channels.NonReadableChannelException;
-import java.nio.channels.WritableByteChannel;
-import java.util.Arrays;
-
-final class WriteOnlyFileChannel extends FileChannelImpl {
-
-    private boolean append = false;
-
-    public WriteOnlyFileChannel(Object stream, int handle) {
-        super(stream, handle);
-    }
-
-    public WriteOnlyFileChannel(Object stream, int handle, boolean isAppend) {
-        super(stream, handle);
-        append = isAppend;
-    }
-
-    public long position() throws IOException {
-        return append ? size() : super.position();
-    }
-
-    public long transferTo(long position, long count, WritableByteChannel target)
-            throws IOException {
-        openCheck();
-        if (!target.isOpen()) {
-            throw new ClosedChannelException();
-        }
-        throw new NonReadableChannelException();
-    }
-
-    public long read(ByteBuffer[] buffers, int offset, int length) throws IOException {
-        Arrays.checkOffsetAndCount(buffers.length, offset, length);
-        openCheck();
-        throw new NonReadableChannelException();
-    }
-
-    public int read(ByteBuffer buffer) throws IOException {
-        openCheck();
-        throw new NonReadableChannelException();
-    }
-
-    public int read(ByteBuffer buffer, long position) throws IOException {
-        if (buffer == null) {
-            throw new NullPointerException();
-        }
-        if (position < 0) {
-            throw new IllegalArgumentException();
-        }
-        throw new NonReadableChannelException();
-    }
-
-    public MappedByteBuffer map(MapMode mode, long position, long size)
-            throws IOException {
-        openCheck();
-        if (mode == null) {
-            throw new NullPointerException();
-        }
-        if (position < 0 || size < 0 || size > Integer.MAX_VALUE) {
-            throw new IllegalArgumentException();
-        }
-        throw new NonReadableChannelException();
-    }
-
-    public int write(ByteBuffer buffer) throws IOException {
-        if (append) {
-            position(size());
-        }
-        return super.write(buffer);
-    }
-
-    protected final FileLock basicLock(long position, long size,
-            boolean shared, boolean wait) throws IOException {
-        if (shared) {
-            throw new NonReadableChannelException();
-        }
-        return super.basicLock(position, size, shared, wait);
-    }
-}
diff --git a/luni/src/main/java/java/nio/channels/AlreadyConnectedException.java b/luni/src/main/java/java/nio/channels/AlreadyConnectedException.java
index 95b776a..4fa5af8 100644
--- a/luni/src/main/java/java/nio/channels/AlreadyConnectedException.java
+++ b/luni/src/main/java/java/nio/channels/AlreadyConnectedException.java
@@ -28,6 +28,5 @@
      * Constructs an {@code AlreadyConnectedException}.
      */
     public AlreadyConnectedException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/AsynchronousCloseException.java b/luni/src/main/java/java/nio/channels/AsynchronousCloseException.java
index 59938ce..66aae0b 100644
--- a/luni/src/main/java/java/nio/channels/AsynchronousCloseException.java
+++ b/luni/src/main/java/java/nio/channels/AsynchronousCloseException.java
@@ -28,6 +28,5 @@
      * Constructs an {@code AsynchronousCloseException}.
      */
     public AsynchronousCloseException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/CancelledKeyException.java b/luni/src/main/java/java/nio/channels/CancelledKeyException.java
index 7938e48..0ca2d94 100644
--- a/luni/src/main/java/java/nio/channels/CancelledKeyException.java
+++ b/luni/src/main/java/java/nio/channels/CancelledKeyException.java
@@ -31,6 +31,5 @@
      * Constructs a {@code CancelledKeyException}.
      */
     public CancelledKeyException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/Channel.java b/luni/src/main/java/java/nio/channels/Channel.java
index cf1a15a..a2c13b5 100644
--- a/luni/src/main/java/java/nio/channels/Channel.java
+++ b/luni/src/main/java/java/nio/channels/Channel.java
@@ -33,9 +33,7 @@
 public interface Channel extends Closeable {
 
     /**
-     * Returns whether this channel is open or not.
-     *
-     * @return true if the channel is open, otherwise returns false.
+     * Returns true if this channel is open.
      */
     public boolean isOpen();
 
diff --git a/luni/src/main/java/java/nio/channels/Channels.java b/luni/src/main/java/java/nio/channels/Channels.java
index be498c4..3af1465 100644
--- a/luni/src/main/java/java/nio/channels/Channels.java
+++ b/luni/src/main/java/java/nio/channels/Channels.java
@@ -29,6 +29,7 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CharsetEncoder;
+import libcore.io.Streams;
 
 /**
  * This class provides several utilities to get I/O streams from channels.
@@ -211,19 +212,11 @@
             this.channel = channel;
         }
 
-        @Override
-        public synchronized int read() throws IOException {
-            byte[] oneByte = new byte[1];
-            int n = read(oneByte);
-            if (n == 1) {
-                // reads a single byte 0-255
-                return oneByte[0] & 0xff;
-            }
-            return -1;
+        @Override public synchronized int read() throws IOException {
+            return Streams.readSingleByte(this);
         }
 
-        @Override
-        public synchronized int read(byte[] target, int offset, int length) throws IOException {
+        @Override public synchronized int read(byte[] target, int offset, int length) throws IOException {
             ByteBuffer buffer = ByteBuffer.wrap(target, offset, length);
             checkBlocking(channel);
             return channel.read(buffer);
diff --git a/luni/src/main/java/java/nio/channels/ClosedByInterruptException.java b/luni/src/main/java/java/nio/channels/ClosedByInterruptException.java
index ee4875f..bd6596b 100644
--- a/luni/src/main/java/java/nio/channels/ClosedByInterruptException.java
+++ b/luni/src/main/java/java/nio/channels/ClosedByInterruptException.java
@@ -32,6 +32,5 @@
      * Constructs a {@code ClosedByInterruptException}.
      */
     public ClosedByInterruptException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/ClosedChannelException.java b/luni/src/main/java/java/nio/channels/ClosedChannelException.java
index 897bc6a..2d7cd19 100644
--- a/luni/src/main/java/java/nio/channels/ClosedChannelException.java
+++ b/luni/src/main/java/java/nio/channels/ClosedChannelException.java
@@ -30,6 +30,5 @@
      * Constructs a {@code ClosedChannelException}.
      */
     public ClosedChannelException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/ClosedSelectorException.java b/luni/src/main/java/java/nio/channels/ClosedSelectorException.java
index 82e03e8..a92e3af 100644
--- a/luni/src/main/java/java/nio/channels/ClosedSelectorException.java
+++ b/luni/src/main/java/java/nio/channels/ClosedSelectorException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code ClosedSelectorException}.
      */
     public ClosedSelectorException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/ConnectionPendingException.java b/luni/src/main/java/java/nio/channels/ConnectionPendingException.java
index bc509d0..1f68585 100644
--- a/luni/src/main/java/java/nio/channels/ConnectionPendingException.java
+++ b/luni/src/main/java/java/nio/channels/ConnectionPendingException.java
@@ -29,6 +29,5 @@
      * Constructs a {@code ConnectionPendingException}.
      */
     public ConnectionPendingException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/DatagramChannel.java b/luni/src/main/java/java/nio/channels/DatagramChannel.java
index dd09e16..486b168 100644
--- a/luni/src/main/java/java/nio/channels/DatagramChannel.java
+++ b/luni/src/main/java/java/nio/channels/DatagramChannel.java
@@ -121,11 +121,8 @@
      *             if another thread interrupts the calling thread while the
      *             operation is in progress. The calling thread will have the
      *             interrupt state set and the channel will be closed.
-     * @throws SecurityException
-     *             if there is a security manager, and the address is not
-     *             permitted to be accessed.
      * @throws IOException
-     *             if some other I/O error occurrs.
+     *             if some other I/O error occurs.
      */
     public abstract DatagramChannel connect(SocketAddress address)
             throws IOException;
@@ -175,9 +172,6 @@
      *             if another thread interrupts the calling thread while the
      *             operation is in progress. The calling thread will have the
      *             interrupt state set and the channel will be closed.
-     * @throws SecurityException
-     *             if there is a security manager, and the address is not
-     *             permitted to be accessed.
      * @throws IOException
      *             some other I/O error occurs.
      */
@@ -216,14 +210,10 @@
      *             if another thread interrupts the calling thread while the
      *             operation is in progress. The calling thread will have the
      *             interrupt state set and the channel will be closed.
-     * @throws SecurityException
-     *             if there is a security manager, and the address is not
-     *             permitted to access.
      * @throws IOException
      *             some other I/O error occurs.
      */
-    public abstract int send(ByteBuffer source, SocketAddress address)
-            throws IOException;
+    public abstract int send(ByteBuffer source, SocketAddress address) throws IOException;
 
     /**
      * Reads a datagram from this channel into the byte buffer.
diff --git a/luni/src/main/java/java/nio/channels/FileChannel.java b/luni/src/main/java/java/nio/channels/FileChannel.java
index 1275348..298ea8b 100644
--- a/luni/src/main/java/java/nio/channels/FileChannel.java
+++ b/luni/src/main/java/java/nio/channels/FileChannel.java
@@ -71,7 +71,7 @@
  * will also block when there are any other operations in-flight.
  * <p>
  * The logical view of the underlying file is consistent across all FileChannels
- * and I/O streams opened on the same file by the same virtual machine process.
+ * and I/O streams opened on the same file by the same VM.
  * Therefore, modifications performed via a channel will be visible to the
  * stream and vice versa; this includes modifications to the file position,
  * content, size, etc.
@@ -105,7 +105,6 @@
          * Private constructor prevents others creating new modes.
          */
         private MapMode(String displayName) {
-            super();
             this.displayName = displayName;
         }
 
@@ -124,7 +123,6 @@
      * Protected default constructor.
      */
     protected FileChannel() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/nio/channels/FileLock.java b/luni/src/main/java/java/nio/channels/FileLock.java
index 2c8025e..0916be0 100644
--- a/luni/src/main/java/java/nio/channels/FileLock.java
+++ b/luni/src/main/java/java/nio/channels/FileLock.java
@@ -41,11 +41,11 @@
  * Once a lock is acquired, it is immutable in all its state except {@code
  * isValid()}. The lock will initially be valid, but may be rendered invalid by
  * explicit removal of the lock, using {@code release()}, or implicitly by
- * closing the channel or exiting the process (terminating the virtual machine).
+ * closing the channel or exiting the process (terminating the VM).
  * <h3>Platform dependencies</h3>
  * <p>
  * Locks are intended to be true platform operating system file locks, and
- * therefore locks held by the virtual machine process will be visible to other
+ * therefore locks held by the VM will be visible to other
  * operating system processes.
  * <p>
  * The characteristics of the underlying operating system locks will show
@@ -96,9 +96,7 @@
      *            the lock's sharing mode of lock; {@code true} is shared,
      *            {@code false} is exclusive.
      */
-    protected FileLock(FileChannel channel, long position, long size,
-            boolean shared) {
-        super();
+    protected FileLock(FileChannel channel, long position, long size, boolean shared) {
         if (position < 0 || size < 0 || position + size < 0) {
             throw new IllegalArgumentException();
         }
@@ -193,16 +191,7 @@
      * @return the display string.
      */
     @Override
-    @SuppressWarnings("nls")
     public final String toString() {
-        StringBuilder buffer = new StringBuilder(64); // Guess length of string
-        buffer.append("FileLock: [position=");
-        buffer.append(position);
-        buffer.append(", size=");
-        buffer.append(size);
-        buffer.append(", shared=");
-        buffer.append(Boolean.toString(shared));
-        buffer.append("]");
-        return buffer.toString();
+        return "FileLock[position=" + position + ", size=" + size + ", shared=" + shared + "]";
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/FileLockInterruptionException.java b/luni/src/main/java/java/nio/channels/FileLockInterruptionException.java
index 7203fe1..aa40977 100644
--- a/luni/src/main/java/java/nio/channels/FileLockInterruptionException.java
+++ b/luni/src/main/java/java/nio/channels/FileLockInterruptionException.java
@@ -32,6 +32,5 @@
      * Constructs a {@code FileLockInterruptionException}.
      */
     public FileLockInterruptionException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/IllegalBlockingModeException.java b/luni/src/main/java/java/nio/channels/IllegalBlockingModeException.java
index 8a73ca7..554df53 100644
--- a/luni/src/main/java/java/nio/channels/IllegalBlockingModeException.java
+++ b/luni/src/main/java/java/nio/channels/IllegalBlockingModeException.java
@@ -29,6 +29,5 @@
      * Constructs a {@code IllegalBlockingModeException}.
      */
     public IllegalBlockingModeException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/IllegalSelectorException.java b/luni/src/main/java/java/nio/channels/IllegalSelectorException.java
index 0fece43..2fb690d 100644
--- a/luni/src/main/java/java/nio/channels/IllegalSelectorException.java
+++ b/luni/src/main/java/java/nio/channels/IllegalSelectorException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code IllegalSelectorException}.
      */
     public IllegalSelectorException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/NoConnectionPendingException.java b/luni/src/main/java/java/nio/channels/NoConnectionPendingException.java
index d12137d..8ab18a5 100644
--- a/luni/src/main/java/java/nio/channels/NoConnectionPendingException.java
+++ b/luni/src/main/java/java/nio/channels/NoConnectionPendingException.java
@@ -31,6 +31,5 @@
      * Constructs a {@code NoConnectionPendingException}.
      */
     public NoConnectionPendingException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/NonReadableChannelException.java b/luni/src/main/java/java/nio/channels/NonReadableChannelException.java
index 9cda997..4d63486 100644
--- a/luni/src/main/java/java/nio/channels/NonReadableChannelException.java
+++ b/luni/src/main/java/java/nio/channels/NonReadableChannelException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code NonReadableChannelException}.
      */
     public NonReadableChannelException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/NonWritableChannelException.java b/luni/src/main/java/java/nio/channels/NonWritableChannelException.java
index ce8da06..8d543dc 100644
--- a/luni/src/main/java/java/nio/channels/NonWritableChannelException.java
+++ b/luni/src/main/java/java/nio/channels/NonWritableChannelException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code NonWritableChannelException}.
      */
     public NonWritableChannelException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/NotYetBoundException.java b/luni/src/main/java/java/nio/channels/NotYetBoundException.java
index 93052d2..57254c4 100644
--- a/luni/src/main/java/java/nio/channels/NotYetBoundException.java
+++ b/luni/src/main/java/java/nio/channels/NotYetBoundException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code NotYetBoundException}.
      */
     public NotYetBoundException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/NotYetConnectedException.java b/luni/src/main/java/java/nio/channels/NotYetConnectedException.java
index 008fae8..ca76ef1 100644
--- a/luni/src/main/java/java/nio/channels/NotYetConnectedException.java
+++ b/luni/src/main/java/java/nio/channels/NotYetConnectedException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code NotYetConnectedException}.
      */
     public NotYetConnectedException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/OverlappingFileLockException.java b/luni/src/main/java/java/nio/channels/OverlappingFileLockException.java
index 7c1fac6..3419461 100644
--- a/luni/src/main/java/java/nio/channels/OverlappingFileLockException.java
+++ b/luni/src/main/java/java/nio/channels/OverlappingFileLockException.java
@@ -28,6 +28,5 @@
      * Constructs a {@code OverlappingFileLockException}.
      */
     public OverlappingFileLockException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/Pipe.java b/luni/src/main/java/java/nio/channels/Pipe.java
index c28c138..8d56a0b 100644
--- a/luni/src/main/java/java/nio/channels/Pipe.java
+++ b/luni/src/main/java/java/nio/channels/Pipe.java
@@ -93,7 +93,6 @@
      * The protected default constructor.
      */
     protected Pipe() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/nio/channels/SelectableChannel.java b/luni/src/main/java/java/nio/channels/SelectableChannel.java
index 5a72147..aef46f5 100644
--- a/luni/src/main/java/java/nio/channels/SelectableChannel.java
+++ b/luni/src/main/java/java/nio/channels/SelectableChannel.java
@@ -38,7 +38,6 @@
      * Constructs a new {@code SelectableChannel}.
      */
     protected SelectableChannel() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/nio/channels/SelectionKey.java b/luni/src/main/java/java/nio/channels/SelectionKey.java
index 90e396a..6d3926d 100644
--- a/luni/src/main/java/java/nio/channels/SelectionKey.java
+++ b/luni/src/main/java/java/nio/channels/SelectionKey.java
@@ -59,7 +59,6 @@
      * Constructs a new {@code SelectionKey}.
      */
     protected SelectionKey() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/nio/channels/Selector.java b/luni/src/main/java/java/nio/channels/Selector.java
index caa01bb..1aac14b 100644
--- a/luni/src/main/java/java/nio/channels/Selector.java
+++ b/luni/src/main/java/java/nio/channels/Selector.java
@@ -50,7 +50,6 @@
      * Constructs a new {@code Selector}.
      */
     protected Selector() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/nio/channels/ServerSocketChannel.java b/luni/src/main/java/java/nio/channels/ServerSocketChannel.java
index 67d3b8e..f3c3390 100644
--- a/luni/src/main/java/java/nio/channels/ServerSocketChannel.java
+++ b/luni/src/main/java/java/nio/channels/ServerSocketChannel.java
@@ -107,9 +107,6 @@
      *             if another I/O error occurs.
      * @throws NotYetBoundException
      *             if the socket has not yet been bound.
-     * @throws SecurityException
-     *             if there is a security manager and it does not permit to
-     *             access the new connection.
      */
     public abstract SocketChannel accept() throws IOException;
 }
diff --git a/luni/src/main/java/java/nio/channels/SocketChannel.java b/luni/src/main/java/java/nio/channels/SocketChannel.java
index 9ca75ef..753c88f 100644
--- a/luni/src/main/java/java/nio/channels/SocketChannel.java
+++ b/luni/src/main/java/java/nio/channels/SocketChannel.java
@@ -85,7 +85,7 @@
      * Creates a socket channel and connects it to a socket address.
      * <p>
      * This method performs a call to {@code open()} followed by a call to
-     * {@code connect(SocketAdress)}.
+     * {@code connect(SocketAddress)}.
      *
      * @param address
      *            the socket address to be connected to.
@@ -97,9 +97,6 @@
      *             if another thread interrupts the calling thread while this
      *             operation is executing. The calling thread will have the
      *             interrupt state set and the channel will be closed.
-     * @throws SecurityException
-     *             if there is a security manager and it denies the access of
-     *             {@code address}.
      * @throws UnresolvedAddressException
      *             if the address is not resolved.
      * @throws UnsupportedAddressTypeException
@@ -156,7 +153,7 @@
      * Connects this channel's socket with a remote address.
      * <p>
      * If this channel is blocking, this method will suspend until connecting is
-     * finished or an I/O exception occurrs. If the channel is non-blocking,
+     * finished or an I/O exception occurs. If the channel is non-blocking,
      * this method will return {@code true} if the connection is finished at
      * once or return {@code false} when the connection must be finished later
      * by calling {@code finishConnect()}.
@@ -187,9 +184,6 @@
      *             if the address is not resolved.
      * @throws UnsupportedAddressTypeException
      *             if the address type is not supported.
-     * @throws SecurityException
-     *             if there is a security manager and it denies the access of
-     *             {@code address}.
      * @throws IOException
      *             if an I/O error occurs.
      */
@@ -296,8 +290,7 @@
      * @see java.nio.channels.ScatteringByteChannel#read(java.nio.ByteBuffer[],
      *      int, int)
      */
-    public abstract long read(ByteBuffer[] targets, int offset, int length)
-            throws IOException;
+    public abstract long read(ByteBuffer[] targets, int offset, int length) throws IOException;
 
     /**
      * Reads bytes from this socket channel and stores them in the specified
@@ -328,8 +321,7 @@
      * @throws NotYetConnectedException
      *             if this channel is not yet connected.
      */
-    public synchronized final long read(ByteBuffer[] targets)
-            throws IOException {
+    public synchronized final long read(ByteBuffer[] targets) throws IOException {
         return read(targets, 0, targets.length);
     }
 
@@ -401,8 +393,7 @@
      * @see java.nio.channels.GatheringByteChannel#write(java.nio.ByteBuffer[],
      *      int, int)
      */
-    public abstract long write(ByteBuffer[] sources, int offset, int length)
-            throws IOException;
+    public abstract long write(ByteBuffer[] sources, int offset, int length) throws IOException;
 
     /**
      * Writes bytes from all the given byte buffers to this socket channel.
@@ -428,8 +419,7 @@
      *             if this channel is not yet connected.
      * @see java.nio.channels.GatheringByteChannel#write(java.nio.ByteBuffer[])
      */
-    public synchronized final long write(ByteBuffer[] sources)
-            throws IOException {
+    public synchronized final long write(ByteBuffer[] sources) throws IOException {
         return write(sources, 0, sources.length);
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/UnresolvedAddressException.java b/luni/src/main/java/java/nio/channels/UnresolvedAddressException.java
index b740447..3356faf 100644
--- a/luni/src/main/java/java/nio/channels/UnresolvedAddressException.java
+++ b/luni/src/main/java/java/nio/channels/UnresolvedAddressException.java
@@ -28,6 +28,5 @@
      * Constructs an {@code UnresolvedAddressException}.
      */
     public UnresolvedAddressException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/UnsupportedAddressTypeException.java b/luni/src/main/java/java/nio/channels/UnsupportedAddressTypeException.java
index f494f4a..7bca401 100644
--- a/luni/src/main/java/java/nio/channels/UnsupportedAddressTypeException.java
+++ b/luni/src/main/java/java/nio/channels/UnsupportedAddressTypeException.java
@@ -28,6 +28,5 @@
      * Constructs an {@code UnsupportedAddressTypeException}.
      */
     public UnsupportedAddressTypeException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/channels/spi/AbstractInterruptibleChannel.java b/luni/src/main/java/java/nio/channels/spi/AbstractInterruptibleChannel.java
index 47f2512..e948742 100644
--- a/luni/src/main/java/java/nio/channels/spi/AbstractInterruptibleChannel.java
+++ b/luni/src/main/java/java/nio/channels/spi/AbstractInterruptibleChannel.java
@@ -18,14 +18,10 @@
 package java.nio.channels.spi;
 
 import java.io.IOException;
-import java.lang.reflect.Method;
 import java.nio.channels.AsynchronousCloseException;
 import java.nio.channels.Channel;
 import java.nio.channels.ClosedByInterruptException;
 import java.nio.channels.InterruptibleChannel;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 
 /**
  * {@code AbstractInterruptibleChannel} is the root class for interruptible
@@ -37,49 +33,26 @@
  * argument to the {@code end} method should indicate if the I/O operation has
  * actually completed so that any change may be visible to the invoker.
 */
-public abstract class AbstractInterruptibleChannel implements Channel,
-        InterruptibleChannel {
-
-    static Method setInterruptAction = null;
-
-    static {
-        try {
-            setInterruptAction = AccessController
-                    .doPrivileged(new PrivilegedExceptionAction<Method>() {
-                        public Method run() throws Exception {
-                            return Thread.class.getDeclaredMethod(
-                                    "setInterruptAction",
-                                    new Class[] { Runnable.class });
-
-                        }
-                    });
-            setInterruptAction.setAccessible(true);
-        } catch (PrivilegedActionException e) {
-            // FIXME: be accommodate before VM actually provides
-            // setInterruptAction method
-            // throw new Error(e);
-        }
-    }
+public abstract class AbstractInterruptibleChannel implements Channel, InterruptibleChannel {
 
     private volatile boolean closed = false;
 
     volatile boolean interrupted = false;
 
-    /**
-     * Default constructor.
-     */
+    private final Runnable interruptAndCloseRunnable = new Runnable() {
+        @Override public void run() {
+            try {
+                interrupted = true;
+                AbstractInterruptibleChannel.this.close();
+            } catch (IOException ignored) {
+            }
+        }
+    };
+
     protected AbstractInterruptibleChannel() {
-        super();
     }
 
-    /**
-     * Indicates whether this channel is open.
-     *
-     * @return {@code true} if this channel is open, {@code false} if it is
-     *         closed.
-     * @see java.nio.channels.Channel#isOpen()
-     */
-    public synchronized final boolean isOpen() {
+    @Override public synchronized final boolean isOpen() {
         return !closed;
     }
 
@@ -99,7 +72,7 @@
      *             if a problem occurs while closing this channel.
      * @see java.nio.channels.Channel#close()
      */
-    public final void close() throws IOException {
+    @Override public final void close() throws IOException {
         if (!closed) {
             synchronized (this) {
                 if (!closed) {
@@ -116,25 +89,7 @@
      * should invoke the corresponding {@code end(boolean)} method.
      */
     protected final void begin() {
-        // FIXME: be accommodate before VM actually provides
-        // setInterruptAction method
-        if (setInterruptAction != null) {
-            try {
-                setInterruptAction.invoke(Thread.currentThread(),
-                        new Object[] { new Runnable() {
-                            public void run() {
-                                try {
-                                    interrupted = true;
-                                    AbstractInterruptibleChannel.this.close();
-                                } catch (IOException e) {
-                                    // ignore
-                                }
-                            }
-                        } });
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
+        Thread.currentThread().pushInterruptAction$(interruptAndCloseRunnable);
     }
 
     /**
@@ -152,19 +107,10 @@
      *             method is executing.
      */
     protected final void end(boolean success) throws AsynchronousCloseException {
-        // FIXME: be accommodate before VM actually provides
-        // setInterruptAction method
-        if (setInterruptAction != null) {
-            try {
-                setInterruptAction.invoke(Thread.currentThread(),
-                        new Object[] { null });
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-            if (interrupted) {
-                interrupted = false;
-                throw new ClosedByInterruptException();
-            }
+        Thread.currentThread().popInterruptAction$(interruptAndCloseRunnable);
+        if (interrupted) {
+            interrupted = false;
+            throw new ClosedByInterruptException();
         }
         if (!success && closed) {
             throw new AsynchronousCloseException();
diff --git a/luni/src/main/java/java/nio/channels/spi/AbstractSelectableChannel.java b/luni/src/main/java/java/nio/channels/spi/AbstractSelectableChannel.java
index ff44c11..8104f22 100644
--- a/luni/src/main/java/java/nio/channels/spi/AbstractSelectableChannel.java
+++ b/luni/src/main/java/java/nio/channels/spi/AbstractSelectableChannel.java
@@ -53,7 +53,6 @@
      *            the selector provider that creates this channel.
      */
     protected AbstractSelectableChannel(SelectorProvider selectorProvider) {
-        super();
         provider = selectorProvider;
     }
 
diff --git a/luni/src/main/java/java/nio/channels/spi/AbstractSelectionKey.java b/luni/src/main/java/java/nio/channels/spi/AbstractSelectionKey.java
index 3e27cab..2e76412 100644
--- a/luni/src/main/java/java/nio/channels/spi/AbstractSelectionKey.java
+++ b/luni/src/main/java/java/nio/channels/spi/AbstractSelectionKey.java
@@ -33,7 +33,6 @@
      * Constructs a new {@code AbstractSelectionKey}.
      */
     protected AbstractSelectionKey() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/nio/channels/spi/AbstractSelector.java b/luni/src/main/java/java/nio/channels/spi/AbstractSelector.java
index d3a8a59..bfd1ec0 100644
--- a/luni/src/main/java/java/nio/channels/spi/AbstractSelector.java
+++ b/luni/src/main/java/java/nio/channels/spi/AbstractSelector.java
@@ -35,17 +35,14 @@
 
     private SelectorProvider provider = null;
 
-    /*
-     * Set of cancelled keys.
-     */
-    private Set<SelectionKey> cancelledKeysSet = new HashSet<SelectionKey>();
+    private final Set<SelectionKey> cancelledKeysSet = new HashSet<SelectionKey>();
 
-    /**
-     * Constructs a new {@code AbstractSelector}.
-     *
-     * @param selectorProvider
-     *            the selector provider that creates this selector.
-     */
+    private final Runnable wakeupRunnable = new Runnable() {
+        @Override public void run() {
+            wakeup();
+        }
+    };
+
     protected AbstractSelector(SelectorProvider selectorProvider) {
         provider = selectorProvider;
     }
@@ -54,9 +51,6 @@
      * Closes this selector. This method does nothing if this selector is
      * already closed. The actual closing must be implemented by subclasses in
      * {@code implCloseSelector()}.
-     *
-     * @throws IOException
-     *             if an I/O error occurs.
      */
     @Override
     public final void close() throws IOException {
@@ -67,17 +61,11 @@
 
     /**
      * Implements the closing of this channel.
-     *
-     * @throws IOException
-     *             if an I/O error occurs.
      */
     protected abstract void implCloseSelector() throws IOException;
 
     /**
-     * Indicates whether this selector is open.
-     *
-     * @return {@code true} if this selector is not closed, {@code false}
-     *         otherwise.
+     * Returns true if this selector is open.
      */
     @Override
     public final boolean isOpen() {
@@ -85,9 +73,7 @@
     }
 
     /**
-     * Gets this selector's provider.
-     *
-     * @return the provider of this selector.
+     * Returns this selector's provider.
      */
     @Override
     public final SelectorProvider provider() {
@@ -96,22 +82,17 @@
 
     /**
      * Returns this channel's set of canceled selection keys.
-     *
-     * @return the set of canceled selection keys.
      */
     protected final Set<SelectionKey> cancelledKeys() {
         return cancelledKeysSet;
     }
 
     /**
-     * Registers a channel with this selector.
+     * Registers {@code channel} with this selector.
      *
-     * @param channel
-     *            the channel to be registered.
-     * @param operations
-     *            the {@link SelectionKey interest set} of {@code channel}.
-     * @param attachment
-     *            the attachment for the selection key.
+     * @param operations the {@link SelectionKey interest set} of {@code
+     *     channel}.
+     * @param attachment the attachment for the selection key.
      * @return the key related to the channel and this selector.
      */
     protected abstract SelectionKey register(AbstractSelectableChannel channel,
@@ -119,9 +100,6 @@
 
     /**
      * Deletes the key from the channel's key set.
-     *
-     * @param key
-     *            the key.
      */
     protected final void deregister(AbstractSelectionKey key) {
         ((AbstractSelectableChannel) key.channel()).deregister(key);
@@ -134,20 +112,7 @@
      * should invoke the corresponding {@code end(boolean)} method.
      */
     protected final void begin() {
-        // FIXME: be accommodate before VM actually provides
-        // setInterruptAction method
-        if (AbstractInterruptibleChannel.setInterruptAction != null) {
-            try {
-                AbstractInterruptibleChannel.setInterruptAction.invoke(Thread
-                        .currentThread(), new Object[] { new Runnable() {
-                    public void run() {
-                        AbstractSelector.this.wakeup();
-                    }
-                } });
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
+        Thread.currentThread().pushInterruptAction$(wakeupRunnable);
     }
 
     /**
@@ -155,21 +120,9 @@
      * {@code begin()} and that includes a potentially blocking I/O operation.
      */
     protected final void end() {
-        // FIXME: be accommodate before VM actually provides
-        // setInterruptAction method
-        if (AbstractInterruptibleChannel.setInterruptAction != null) {
-            try {
-                AbstractInterruptibleChannel.setInterruptAction.invoke(Thread
-                        .currentThread(), new Object[] { null });
-            } catch (Exception e) {
-                throw new RuntimeException(e);
-            }
-        }
+        Thread.currentThread().popInterruptAction$(wakeupRunnable);
     }
 
-    /*
-     * package private method for AbstractSelectionKey.cancel()
-     */
     void cancel(SelectionKey key) {
         synchronized (cancelledKeysSet) {
             cancelledKeysSet.add(key);
diff --git a/luni/src/main/java/java/nio/channels/spi/SelectorProvider.java b/luni/src/main/java/java/nio/channels/spi/SelectorProvider.java
index 201ea9f..b62a911 100644
--- a/luni/src/main/java/java/nio/channels/spi/SelectorProvider.java
+++ b/luni/src/main/java/java/nio/channels/spi/SelectorProvider.java
@@ -24,8 +24,6 @@
 import java.nio.channels.Pipe;
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ServiceLoader;
 
 /**
@@ -44,17 +42,8 @@
 
     /**
      * Constructs a new {@code SelectorProvider}.
-     *
-     * @throws SecurityException
-     *             if there is a security manager installed that does not permit
-     *             the runtime permission labeled "selectorProvider".
      */
     protected SelectorProvider() {
-        super();
-        if (System.getSecurityManager() != null) {
-            System.getSecurityManager().checkPermission(
-                    new RuntimePermission("selectorProvider"));
-        }
     }
 
     /**
@@ -80,11 +69,7 @@
                 provider = loadProviderByJar();
             }
             if (provider == null) {
-                provider = AccessController.doPrivileged(new PrivilegedAction<SelectorProvider>() {
-                    public SelectorProvider run() {
-                        return new SelectorProviderImpl();
-                    }
-                });
+                provider = new SelectorProviderImpl();
             }
         }
         return provider;
@@ -144,21 +129,15 @@
     public abstract SocketChannel openSocketChannel() throws IOException;
 
     /**
-     * Returns the channel inherited from the instance that created this
-     * virtual machine.
+     * Returns the channel inherited from the process that created this VM.
+     * On Android, this method always returns null because stdin and stdout are
+     * never connected to a socket.
      *
      * @return the channel.
      * @throws IOException
      *             if an I/O error occurs.
-     * @throws SecurityException
-     *             if there is a security manager installed that does not permit
-     *             the runtime permission labeled "selectorProvider".
      */
     public Channel inheritedChannel() throws IOException {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new RuntimePermission("inheritedChannel"));
-        }
         // Android never has stdin/stdout connected to a socket.
         return null;
     }
diff --git a/luni/src/main/java/java/nio/charset/CharacterCodingException.java b/luni/src/main/java/java/nio/charset/CharacterCodingException.java
index eee01f7..0d4a138 100644
--- a/luni/src/main/java/java/nio/charset/CharacterCodingException.java
+++ b/luni/src/main/java/java/nio/charset/CharacterCodingException.java
@@ -35,6 +35,5 @@
      * Constructs a new {@code CharacterCodingException}.
      */
     public CharacterCodingException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/nio/charset/Charset.java b/luni/src/main/java/java/nio/charset/Charset.java
index 800d810..81b079a 100644
--- a/luni/src/main/java/java/nio/charset/Charset.java
+++ b/luni/src/main/java/java/nio/charset/Charset.java
@@ -21,8 +21,6 @@
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.spi.CharsetProvider;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -283,10 +281,11 @@
             }
         }
 
-        // Is this a built-in charset supported by ICU?
         if (charsetName == null) {
-            throw new IllegalCharsetNameException(charsetName);
+            throw new IllegalCharsetNameException(null);
         }
+
+        // Is this a built-in charset supported by ICU?
         checkCharsetName(charsetName);
         cs = NativeConverter.charsetForName(charsetName);
         if (cs != null) {
@@ -331,7 +330,7 @@
      */
     public static boolean isSupported(String charsetName) {
         try {
-            Charset cs = forName(charsetName);
+            forName(charsetName);
             return true;
         } catch (UnsupportedCharsetException ex) {
             return false;
@@ -565,11 +564,7 @@
     }
 
     private static Charset getDefaultCharset() {
-        String encoding = AccessController.doPrivileged(new PrivilegedAction<String>() {
-            public String run() {
-                return System.getProperty("file.encoding", "UTF-8");
-            }
-        });
+        String encoding = System.getProperty("file.encoding", "UTF-8");
         try {
             return Charset.forName(encoding);
         } catch (UnsupportedCharsetException e) {
diff --git a/luni/src/main/java/java/nio/charset/CharsetDecoder.java b/luni/src/main/java/java/nio/charset/CharsetDecoder.java
index df2bb6a..f67dbbc 100644
--- a/luni/src/main/java/java/nio/charset/CharsetDecoder.java
+++ b/luni/src/main/java/java/nio/charset/CharsetDecoder.java
@@ -82,37 +82,21 @@
  * @see java.nio.charset.CharsetEncoder
  */
 public abstract class CharsetDecoder {
-
-    /*
-     * internal status consts
-     */
     private static final int INIT = 0;
-
     private static final int ONGOING = 1;
-
     private static final int END = 2;
-
     private static final int FLUSH = 3;
 
-    // average number of chars for one byte
-    private float averChars;
+    private final float averageCharsPerByte;
+    private final float maxCharsPerByte;
 
-    // maximum number of chars for one byte
-    private float maxChars;
+    private final Charset cs;
 
-    // charset for this decoder
-    private Charset cs;
+    private CodingErrorAction malformedInputAction;
+    private CodingErrorAction unmappableCharacterAction;
 
-    // specify the action if malformed input error encountered
-    private CodingErrorAction malformAction;
+    private String replacementChars;
 
-    // specify the action if unmappable character error encountered
-    private CodingErrorAction unmapAction;
-
-    // the replacement string
-    private String replace;
-
-    // the current status
     private int status;
 
     /**
@@ -133,38 +117,32 @@
      *             if <code>averageCharsPerByte</code> or
      *             <code>maxCharsPerByte</code> is negative.
      */
-    protected CharsetDecoder(Charset charset, float averageCharsPerByte,
-            float maxCharsPerByte) {
+    protected CharsetDecoder(Charset charset, float averageCharsPerByte, float maxCharsPerByte) {
         if (averageCharsPerByte <= 0 || maxCharsPerByte <= 0) {
             throw new IllegalArgumentException("averageCharsPerByte and maxCharsPerByte must be positive");
         }
         if (averageCharsPerByte > maxCharsPerByte) {
             throw new IllegalArgumentException("averageCharsPerByte is greater than maxCharsPerByte");
         }
-        averChars = averageCharsPerByte;
-        maxChars = maxCharsPerByte;
+        this.averageCharsPerByte = averageCharsPerByte;
+        this.maxCharsPerByte = maxCharsPerByte;
         cs = charset;
         status = INIT;
-        malformAction = CodingErrorAction.REPORT;
-        unmapAction = CodingErrorAction.REPORT;
-        replace = "\ufffd";
+        malformedInputAction = CodingErrorAction.REPORT;
+        unmappableCharacterAction = CodingErrorAction.REPORT;
+        replacementChars = "\ufffd";
     }
 
     /**
-     * Gets the average number of characters created by this decoder for a
+     * Returns the average number of characters created by this decoder for a
      * single input byte.
-     *
-     * @return the average number of characters created by this decoder for a
-     *         single input byte.
      */
     public final float averageCharsPerByte() {
-        return averChars;
+        return averageCharsPerByte;
     }
 
     /**
-     * Gets the <code>Charset</code> which this decoder uses.
-     *
-     * @return the <code>Charset</code> which this decoder uses.
+     * Returns the {@link Charset} which this decoder uses.
      */
     public final Charset charset() {
         return cs;
@@ -203,10 +181,9 @@
      * @throws CharacterCodingException
      *             if another exception happened during the decode operation.
      */
-    public final CharBuffer decode(ByteBuffer in)
-            throws CharacterCodingException {
+    public final CharBuffer decode(ByteBuffer in) throws CharacterCodingException {
         reset();
-        int length = (int) (in.remaining() * averChars);
+        int length = (int) (in.remaining() * averageCharsPerByte);
         CharBuffer output = CharBuffer.allocate(length);
         CoderResult result = null;
         while (true) {
@@ -239,12 +216,10 @@
     /*
      * checks the result whether it needs to throw CharacterCodingException.
      */
-    private void checkCoderResult(CoderResult result)
-            throws CharacterCodingException {
-        if (result.isMalformed() && malformAction == CodingErrorAction.REPORT) {
+    private void checkCoderResult(CoderResult result) throws CharacterCodingException {
+        if (result.isMalformed() && malformedInputAction == CodingErrorAction.REPORT) {
             throw new MalformedInputException(result.length());
-        } else if (result.isUnmappable()
-                && unmapAction == CodingErrorAction.REPORT) {
+        } else if (result.isUnmappable() && unmappableCharacterAction == CodingErrorAction.REPORT) {
             throw new UnmappableCharacterException(result.length());
         }
     }
@@ -368,16 +343,16 @@
                 return result;
             }
             // set coding error handle action
-            action = malformAction;
+            action = malformedInputAction;
             if (result.isUnmappable()) {
-                action = unmapAction;
+                action = unmappableCharacterAction;
             }
             // If the action is IGNORE or REPLACE, we should continue decoding.
             if (action == CodingErrorAction.REPLACE) {
-                if (out.remaining() < replace.length()) {
+                if (out.remaining() < replacementChars.length()) {
                     return CoderResult.OVERFLOW;
                 }
-                out.put(replace);
+                out.put(replacementChars);
             } else {
                 if (action != CodingErrorAction.IGNORE)
                     return result;
@@ -585,25 +560,19 @@
     }
 
     /**
-     * Gets this decoder's <code>CodingErrorAction</code> when malformed input
+     * Returns this decoder's <code>CodingErrorAction</code> when malformed input
      * occurred during the decoding process.
-     *
-     * @return this decoder's <code>CodingErrorAction</code> when malformed
-     *         input occurred during the decoding process.
      */
     public CodingErrorAction malformedInputAction() {
-        return malformAction;
+        return malformedInputAction;
     }
 
     /**
-     * Gets the maximum number of characters which can be created by this
+     * Returns the maximum number of characters which can be created by this
      * decoder for one input byte, must be positive.
-     *
-     * @return the maximum number of characters which can be created by this
-     *         decoder for one input byte, must be positive.
      */
     public final float maxCharsPerByte() {
-        return maxChars;
+        return maxCharsPerByte;
     }
 
     /**
@@ -623,7 +592,7 @@
         if (newAction == null) {
             throw new IllegalArgumentException();
         }
-        malformAction = newAction;
+        malformedInputAction = newAction;
         implOnMalformedInput(newAction);
         return this;
     }
@@ -645,18 +614,16 @@
         if (newAction == null) {
             throw new IllegalArgumentException();
         }
-        unmapAction = newAction;
+        unmappableCharacterAction = newAction;
         implOnUnmappableCharacter(newAction);
         return this;
     }
 
     /**
-     * Gets the replacement string, which is never null or empty.
-     *
-     * @return the replacement string, cannot be null or empty.
+     * Returns the replacement string, which is never null or empty.
      */
     public final String replacement() {
-        return replace;
+        return replacementChars;
     }
 
     /**
@@ -667,7 +634,7 @@
      * {@link #implReplaceWith(String) implReplaceWith} method with the given
      * new replacement as argument.
      *
-     * @param newReplacement
+     * @param replacement
      *            the replacement string, cannot be null or empty. Its length
      *            cannot be larger than {@link #maxCharsPerByte()}.
      * @return this decoder.
@@ -675,15 +642,19 @@
      *             if the given replacement cannot satisfy the requirement
      *             mentioned above.
      */
-    public final CharsetDecoder replaceWith(String newReplacement) {
-        if (newReplacement == null || newReplacement.isEmpty()) {
-            throw new IllegalArgumentException("Replacement string cannot be null or empty");
+    public final CharsetDecoder replaceWith(String replacement) {
+        if (replacement == null) {
+            throw new IllegalArgumentException("replacement == null");
         }
-        if (newReplacement.length() > maxChars) {
-            throw new IllegalArgumentException("Replacement string cannot be longer than max characters per byte");
+        if (replacement.isEmpty()) {
+            throw new IllegalArgumentException("replacement.isEmpty()");
         }
-        replace = newReplacement;
-        implReplaceWith(newReplacement);
+        if (replacement.length() > maxCharsPerByte()) {
+            throw new IllegalArgumentException("replacement length > maxCharsPerByte: " +
+                    replacement.length() + " > " + maxCharsPerByte());
+        }
+        replacementChars = replacement;
+        implReplaceWith(replacement);
         return this;
     }
 
@@ -701,13 +672,10 @@
     }
 
     /**
-     * Gets this decoder's <code>CodingErrorAction</code> when an unmappable
+     * Returns this decoder's <code>CodingErrorAction</code> when an unmappable
      * character error occurred during the decoding process.
-     *
-     * @return this decoder's <code>CodingErrorAction</code> when an
-     *         unmappable character error occurred during the decoding process.
      */
     public CodingErrorAction unmappableCharacterAction() {
-        return unmapAction;
+        return unmappableCharacterAction;
     }
 }
diff --git a/luni/src/main/java/java/nio/charset/CharsetDecoderICU.java b/luni/src/main/java/java/nio/charset/CharsetDecoderICU.java
new file mode 100644
index 0000000..3ad46d7
--- /dev/null
+++ b/luni/src/main/java/java/nio/charset/CharsetDecoderICU.java
@@ -0,0 +1,221 @@
+/**
+*******************************************************************************
+* Copyright (C) 1996-2006, International Business Machines Corporation and    *
+* others. All Rights Reserved.                                                *
+*******************************************************************************
+*
+*******************************************************************************
+*/
+ /**
+  * A JNI interface for ICU converters.
+  *
+  *
+  * @author Ram Viswanadha, IBM
+  */
+package java.nio.charset;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import libcore.icu.ErrorCode;
+import libcore.icu.NativeConverter;
+import libcore.util.EmptyArray;
+
+final class CharsetDecoderICU extends CharsetDecoder {
+    private static final int MAX_CHARS_PER_BYTE = 2;
+
+    private static final int INPUT_OFFSET = 0;
+    private static final int OUTPUT_OFFSET = 1;
+    private static final int INVALID_BYTES = 2;
+    /*
+     * data[INPUT_OFFSET]   = on input contains the start of input and on output the number of input bytes consumed
+     * data[OUTPUT_OFFSET]  = on input contains the start of output and on output the number of output chars written
+     * data[INVALID_BYTES]  = number of invalid bytes
+     */
+    private int[] data = new int[3];
+
+    /* handle to the ICU converter that is opened */
+    private long converterHandle = 0;
+
+    private byte[] input = null;
+    private char[] output= null;
+
+    private byte[] allocatedInput = null;
+    private char[] allocatedOutput = null;
+
+    // These instance variables are always assigned in the methods before being used. This class
+    // is inherently thread-unsafe so we don't have to worry about synchronization.
+    private int inEnd;
+    private int outEnd;
+    private int ec;
+
+    public static CharsetDecoderICU newInstance(Charset cs, String icuCanonicalName) {
+        // This complexity is necessary to ensure that even if the constructor, superclass
+        // constructor, or call to updateCallback throw, we still free the native peer.
+        long address = 0;
+        try {
+            address = NativeConverter.openConverter(icuCanonicalName);
+            float averageCharsPerByte = NativeConverter.getAveCharsPerByte(address);
+            CharsetDecoderICU result = new CharsetDecoderICU(cs, averageCharsPerByte, address);
+            address = 0; // CharsetDecoderICU has taken ownership; its finalizer will do the free.
+            result.updateCallback();
+            return result;
+        } finally {
+            if (address != 0) {
+                NativeConverter.closeConverter(address);
+            }
+        }
+    }
+
+    private CharsetDecoderICU(Charset cs, float averageCharsPerByte, long address) {
+        super(cs, averageCharsPerByte, MAX_CHARS_PER_BYTE);
+        this.converterHandle = address;
+    }
+
+    @Override protected void implReplaceWith(String newReplacement) {
+        updateCallback();
+     }
+
+    @Override protected final void implOnMalformedInput(CodingErrorAction newAction) {
+        updateCallback();
+    }
+
+    @Override protected final void implOnUnmappableCharacter(CodingErrorAction newAction) {
+        updateCallback();
+    }
+
+    private void updateCallback() {
+        ec = NativeConverter.setCallbackDecode(converterHandle, this);
+        if (ErrorCode.isFailure(ec)) {
+            throw ErrorCode.throwException(ec);
+        }
+    }
+
+    @Override protected void implReset() {
+        NativeConverter.resetByteToChar(converterHandle);
+        data[INPUT_OFFSET] = 0;
+        data[OUTPUT_OFFSET] = 0;
+        data[INVALID_BYTES] = 0;
+        output = null;
+        input = null;
+        allocatedInput = null;
+        allocatedOutput = null;
+        ec = 0;
+        inEnd = 0;
+        outEnd = 0;
+    }
+
+    @Override protected final CoderResult implFlush(CharBuffer out) {
+        try {
+            // ICU needs to see an empty input.
+            input = EmptyArray.BYTE;
+            inEnd = 0;
+            data[INPUT_OFFSET] = 0;
+
+            data[OUTPUT_OFFSET] = getArray(out);
+            data[INVALID_BYTES] = 0; // Make sure we don't see earlier errors.
+
+            ec = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, true);
+            if (ErrorCode.isFailure(ec)) {
+                if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
+                    return CoderResult.OVERFLOW;
+                } else if (ec == ErrorCode.U_TRUNCATED_CHAR_FOUND) {
+                    if (data[INPUT_OFFSET] > 0) {
+                        return CoderResult.malformedForLength(data[INPUT_OFFSET]);
+                    }
+                } else {
+                    throw ErrorCode.throwException(ec);
+                }
+            }
+            return CoderResult.UNDERFLOW;
+       } finally {
+            setPosition(out);
+            implReset();
+       }
+    }
+
+    @Override protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out) {
+        if (!in.hasRemaining()) {
+            return CoderResult.UNDERFLOW;
+        }
+
+        data[INPUT_OFFSET] = getArray(in);
+        data[OUTPUT_OFFSET]= getArray(out);
+
+        try {
+            ec = NativeConverter.decode(converterHandle, input, inEnd, output, outEnd, data, false);
+            if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
+                return CoderResult.OVERFLOW;
+            } else if (ec == ErrorCode.U_INVALID_CHAR_FOUND) {
+                return CoderResult.unmappableForLength(data[INVALID_BYTES]);
+            } else if (ec == ErrorCode.U_ILLEGAL_CHAR_FOUND) {
+                return CoderResult.malformedForLength(data[INVALID_BYTES]);
+            }
+            // Decoding succeeded: give us more data.
+            return CoderResult.UNDERFLOW;
+        } finally {
+            setPosition(in);
+            setPosition(out);
+        }
+    }
+
+    @Override protected void finalize() throws Throwable {
+        try {
+            NativeConverter.closeConverter(converterHandle);
+            converterHandle = 0;
+        } finally {
+            super.finalize();
+        }
+    }
+
+    private int getArray(CharBuffer out) {
+        if (out.hasArray()) {
+            output = out.array();
+            outEnd = out.arrayOffset() + out.limit();
+            return out.arrayOffset() + out.position();
+        } else {
+            outEnd = out.remaining();
+            if (allocatedOutput == null || outEnd > allocatedOutput.length) {
+                allocatedOutput = new char[outEnd];
+            }
+            // The array's start position is 0.
+            output = allocatedOutput;
+            return 0;
+        }
+    }
+
+    private  int getArray(ByteBuffer in) {
+        if (in.hasArray()) {
+            input = in.array();
+            inEnd = in.arrayOffset() + in.limit();
+            return in.arrayOffset() + in.position();
+        } else {
+            inEnd = in.remaining();
+            if (allocatedInput == null || inEnd > allocatedInput.length) {
+                allocatedInput = new byte[inEnd];
+            }
+            // Copy the input buffer into the allocated array.
+            int pos = in.position();
+            in.get(allocatedInput, 0, inEnd);
+            in.position(pos);
+            // The array's start position is 0.
+            input = allocatedInput;
+            return 0;
+        }
+    }
+
+    private void setPosition(CharBuffer out) {
+        if (out.hasArray()) {
+            out.position(out.position() + data[OUTPUT_OFFSET] - out.arrayOffset());
+        } else {
+            out.put(output, 0, data[OUTPUT_OFFSET]);
+        }
+        // release reference to output array, which may not be ours
+        output = null;
+    }
+
+    private void setPosition(ByteBuffer in) {
+        in.position(in.position() + data[INPUT_OFFSET]);
+        // release reference to input array, which may not be ours
+        input = null;
+    }
+}
diff --git a/luni/src/main/java/java/nio/charset/CharsetEncoder.java b/luni/src/main/java/java/nio/charset/CharsetEncoder.java
index 739b152..28b2cb8 100644
--- a/luni/src/main/java/java/nio/charset/CharsetEncoder.java
+++ b/luni/src/main/java/java/nio/charset/CharsetEncoder.java
@@ -21,7 +21,6 @@
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.util.Arrays;
-import libcore.icu.CharsetEncoderICU;
 
 /**
  * Transforms a sequence of 16-bit Java characters to a byte sequence in some encoding.
@@ -77,41 +76,27 @@
  * @see java.nio.charset.CharsetDecoder
  */
 public abstract class CharsetEncoder {
-
-    /*
-     * internal status consts
-     */
-    private static final int INIT = 0;
-
+    private static final int READY = 0;
     private static final int ONGOING = 1;
-
     private static final int END = 2;
-
     private static final int FLUSH = 3;
+    private static final int INIT = 4;
 
-    // the Charset which creates this encoder
-    private Charset cs;
+    private final Charset cs;
 
-    // average bytes per character created by this encoder
-    private float averBytes;
+    private final float averageBytesPerChar;
+    private final float maxBytesPerChar;
 
-    // maximum bytes per character can be created by this encoder
-    private float maxBytes;
+    private byte[] replacementBytes;
 
-    // replacement byte array
-    private byte[] replace;
-
-    // internal status
     private int status;
+    // internal status indicates encode(CharBuffer) operation is finished
+    private boolean finished;
 
-    // action for malformed input
-    private CodingErrorAction malformAction;
+    private CodingErrorAction malformedInputAction;
+    private CodingErrorAction unmappableCharacterAction;
 
-    // action for unmapped char input
-    private CodingErrorAction unmapAction;
-
-    // decoder instance for this encoder's charset, used for replacement value
-    // checking
+    // decoder instance for this encoder's charset, used for replacement value checking
     private CharsetDecoder decoder;
 
     /**
@@ -143,8 +128,11 @@
      * @throws IllegalArgumentException
      *             if any parameters are invalid.
      */
-    protected CharsetEncoder(Charset cs, float averageBytesPerChar,
-            float maxBytesPerChar, byte[] replacement) {
+    protected CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement) {
+        this(cs, averageBytesPerChar, maxBytesPerChar, replacement, false);
+    }
+
+    CharsetEncoder(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement, boolean trusted) {
         if (averageBytesPerChar <= 0 || maxBytesPerChar <= 0) {
             throw new IllegalArgumentException("averageBytesPerChar and maxBytesPerChar must both be positive");
         }
@@ -152,29 +140,26 @@
             throw new IllegalArgumentException("averageBytesPerChar is greater than maxBytesPerChar");
         }
         this.cs = cs;
-        averBytes = averageBytesPerChar;
-        maxBytes = maxBytesPerChar;
+        this.averageBytesPerChar = averageBytesPerChar;
+        this.maxBytesPerChar = maxBytesPerChar;
         status = INIT;
-        malformAction = CodingErrorAction.REPORT;
-        unmapAction = CodingErrorAction.REPORT;
-        if (this instanceof CharsetEncoderICU) {
+        malformedInputAction = CodingErrorAction.REPORT;
+        unmappableCharacterAction = CodingErrorAction.REPORT;
+        if (trusted) {
             // The RI enforces unnecessary restrictions on the replacement bytes. We trust ICU to
-            // know what it's doing. This lets us support EUC-JP, SCSU, and Shift_JIS.
-            uncheckedReplaceWith(replacement);
+            // know what it's doing. Doing so lets us support ICU's EUC-JP, SCSU, and Shift_JIS.
+            this.replacementBytes = replacement;
         } else {
             replaceWith(replacement);
         }
     }
 
     /**
-     * Gets the average number of bytes created by this encoder for a single
+     * Returns the average number of bytes created by this encoder for a single
      * input character.
-     *
-     * @return the average number of bytes created by this encoder for a single
-     *         input character.
      */
     public final float averageBytesPerChar() {
-        return averBytes;
+        return averageBytesPerChar;
     }
 
     /**
@@ -199,14 +184,14 @@
 
     // implementation of canEncode
     private boolean implCanEncode(CharBuffer cb) {
-        if (status == FLUSH) {
-            status = INIT;
+        if (status == FLUSH || status == INIT) {
+            status = READY;
         }
-        if (status != INIT) {
+        if (status != READY) {
             throw new IllegalStateException("encoding already in progress");
         }
-        CodingErrorAction malformBak = malformAction;
-        CodingErrorAction unmapBak = unmapAction;
+        CodingErrorAction malformBak = malformedInputAction;
+        CodingErrorAction unmapBak = unmappableCharacterAction;
         onMalformedInput(CodingErrorAction.REPORT);
         onUnmappableCharacter(CodingErrorAction.REPORT);
         boolean result = true;
@@ -249,9 +234,7 @@
     }
 
     /**
-     * Gets the <code>Charset</code> which this encoder uses.
-     *
-     * @return the <code>Charset</code> which this encoder uses.
+     * Returns the {@link Charset} which this encoder uses.
      */
     public final Charset charset() {
         return cs;
@@ -293,7 +276,7 @@
             return ByteBuffer.allocate(0);
         }
         reset();
-        int length = (int) (in.remaining() * averBytes);
+        int length = (int) (in.remaining() * averageBytesPerChar);
         ByteBuffer output = ByteBuffer.allocate(length);
         CoderResult result = null;
         while (true) {
@@ -327,7 +310,8 @@
             }
             break;
         }
-        status = FLUSH;
+        status = READY;
+        finished = true;
         return output;
     }
 
@@ -335,9 +319,9 @@
      * checks the result whether it needs to throw CharacterCodingException.
      */
     private void checkCoderResult(CoderResult result) throws CharacterCodingException {
-        if (malformAction == CodingErrorAction.REPORT && result.isMalformed() ) {
+        if (malformedInputAction == CodingErrorAction.REPORT && result.isMalformed() ) {
             throw new MalformedInputException(result.length());
-        } else if (unmapAction == CodingErrorAction.REPORT && result.isUnmappable()) {
+        } else if (unmappableCharacterAction == CodingErrorAction.REPORT && result.isUnmappable()) {
             throw new UnmappableCharacterException(result.length());
         }
     }
@@ -416,6 +400,11 @@
      *             <code>BufferUnderflowException</code>.
      */
     public final CoderResult encode(CharBuffer in, ByteBuffer out, boolean endOfInput) {
+        // If the previous step is encode(CharBuffer), then no more input is needed
+        // thus endOfInput should not be false
+        if (status == READY && finished && !endOfInput) {
+            throw new IllegalStateException();
+        }
         if ((status == FLUSH) || (!endOfInput && status == END)) {
             throw new IllegalStateException();
         }
@@ -445,17 +434,17 @@
                 status = endOfInput ? END : ONGOING;
                 return result;
             }
-            CodingErrorAction action = malformAction;
+            CodingErrorAction action = malformedInputAction;
             if (result.isUnmappable()) {
-                action = unmapAction;
+                action = unmappableCharacterAction;
             }
             // If the action is IGNORE or REPLACE, we should continue
             // encoding.
             if (action == CodingErrorAction.REPLACE) {
-                if (out.remaining() < replace.length) {
+                if (out.remaining() < replacementBytes.length) {
                     return CoderResult.OVERFLOW;
                 }
-                out.put(replace);
+                out.put(replacementBytes);
             } else {
                 if (action != CodingErrorAction.IGNORE) {
                     return result;
@@ -531,7 +520,7 @@
      *             for the last boolean parameter.
      */
     public final CoderResult flush(ByteBuffer out) {
-        if (status != END && status != INIT) {
+        if (status != END && status != READY) {
             throw new IllegalStateException();
         }
         CoderResult result = implFlush(out);
@@ -625,25 +614,19 @@
     }
 
     /**
-     * Gets this encoder's <code>CodingErrorAction</code> when a malformed
+     * Returns this encoder's <code>CodingErrorAction</code> when a malformed
      * input error occurred during the encoding process.
-     *
-     * @return this encoder's <code>CodingErrorAction</code> when a malformed
-     *         input error occurred during the encoding process.
      */
     public CodingErrorAction malformedInputAction() {
-        return malformAction;
+        return malformedInputAction;
     }
 
     /**
-     * Gets the maximum number of bytes which can be created by this encoder for
+     * Returns the maximum number of bytes which can be created by this encoder for
      * one input character, must be positive.
-     *
-     * @return the maximum number of bytes which can be created by this encoder
-     *         for one input character, must be positive.
      */
     public final float maxBytesPerChar() {
-        return maxBytes;
+        return maxBytesPerChar;
     }
 
     /**
@@ -663,7 +646,7 @@
         if (newAction == null) {
             throw new IllegalArgumentException("newAction == null");
         }
-        malformAction = newAction;
+        malformedInputAction = newAction;
         implOnMalformedInput(newAction);
         return this;
     }
@@ -685,18 +668,16 @@
         if (newAction == null) {
             throw new IllegalArgumentException("newAction == null");
         }
-        unmapAction = newAction;
+        unmappableCharacterAction = newAction;
         implOnUnmappableCharacter(newAction);
         return this;
     }
 
     /**
-     * Gets the replacement byte array, which is never null or empty.
-     *
-     * @return the replacement byte array, cannot be null or empty.
+     * Returns the replacement byte array, which is never null or empty.
      */
     public final byte[] replacement() {
-        return replace;
+        return replacementBytes;
     }
 
     /**
@@ -721,25 +702,25 @@
         if (replacement == null) {
             throw new IllegalArgumentException("replacement == null");
         }
-        if (replacement.length == 0 || maxBytes < replacement.length) {
-            throw new IllegalArgumentException("bad replacement length: " + replacement.length);
+        if (replacement.length == 0) {
+            throw new IllegalArgumentException("replacement.length == 0");
+        }
+        if (replacement.length > maxBytesPerChar()) {
+            throw new IllegalArgumentException("replacement length > maxBytesPerChar: " +
+                    replacement.length + " > " + maxBytesPerChar());
         }
         if (!isLegalReplacement(replacement)) {
             throw new IllegalArgumentException("bad replacement: " + Arrays.toString(replacement));
         }
-        uncheckedReplaceWith(replacement);
-        return this;
-    }
-
-    private final void uncheckedReplaceWith(byte[] replacement) {
         // It seems like a bug, but the RI doesn't clone, and we have tests that check we don't.
-        replace = replacement;
-        implReplaceWith(replace);
+        this.replacementBytes = replacement;
+        implReplaceWith(replacementBytes);
+        return this;
     }
 
     /**
      * Resets this encoder. This method will reset the internal status and then
-     * calla <code>implReset()</code> to reset any status related to the
+     * calls <code>implReset()</code> to reset any status related to the
      * specific charset.
      *
      * @return this encoder.
@@ -751,13 +732,10 @@
     }
 
     /**
-     * Gets this encoder's <code>CodingErrorAction</code> when unmappable
+     * Returns this encoder's <code>CodingErrorAction</code> when unmappable
      * character occurred during encoding process.
-     *
-     * @return this encoder's <code>CodingErrorAction</code> when unmappable
-     *         character occurred during encoding process.
      */
     public CodingErrorAction unmappableCharacterAction() {
-        return unmapAction;
+        return unmappableCharacterAction;
     }
 }
diff --git a/luni/src/main/java/java/nio/charset/CharsetEncoderICU.java b/luni/src/main/java/java/nio/charset/CharsetEncoderICU.java
new file mode 100644
index 0000000..cf071ca
--- /dev/null
+++ b/luni/src/main/java/java/nio/charset/CharsetEncoderICU.java
@@ -0,0 +1,262 @@
+/**
+*******************************************************************************
+* Copyright (C) 1996-2006, International Business Machines Corporation and    *
+* others. All Rights Reserved.                                                  *
+*******************************************************************************
+*
+*******************************************************************************
+*/
+/**
+ * A JNI interface for ICU converters.
+ *
+ *
+ * @author Ram Viswanadha, IBM
+ */
+package java.nio.charset;
+
+import java.nio.ByteBuffer;
+import java.nio.CharBuffer;
+import java.util.HashMap;
+import java.util.Map;
+import libcore.icu.ErrorCode;
+import libcore.icu.NativeConverter;
+import libcore.util.EmptyArray;
+
+final class CharsetEncoderICU extends CharsetEncoder {
+    private static final Map<String, byte[]> DEFAULT_REPLACEMENTS = new HashMap<String, byte[]>();
+    static {
+        // ICU has different default replacements to the RI in some cases. There are many
+        // additional cases, but this covers all the charsets that Java guarantees will be
+        // available, which is where compatibility seems most important. (The RI even uses
+        // the byte corresponding to '?' in ASCII as the replacement byte for charsets where that
+        // byte corresponds to an entirely different character.)
+        // It's odd that UTF-8 doesn't use U+FFFD, given that (unlike ISO-8859-1 and US-ASCII) it
+        // can represent it, but this is what the RI does...
+        byte[] questionMark = new byte[] { (byte) '?' };
+        DEFAULT_REPLACEMENTS.put("UTF-8",      questionMark);
+        DEFAULT_REPLACEMENTS.put("ISO-8859-1", questionMark);
+        DEFAULT_REPLACEMENTS.put("US-ASCII",   questionMark);
+    }
+
+    private static final int INPUT_OFFSET = 0;
+    private static final int OUTPUT_OFFSET = 1;
+    private static final int INVALID_CHARS = 2;
+    /*
+     * data[INPUT_OFFSET]   = on input contains the start of input and on output the number of input chars consumed
+     * data[OUTPUT_OFFSET]  = on input contains the start of output and on output the number of output bytes written
+     * data[INVALID_CHARS]  = number of invalid chars
+     */
+    private int[] data = new int[3];
+
+    /* handle to the ICU converter that is opened */
+    private long converterHandle=0;
+
+    private char[] input = null;
+    private byte[] output = null;
+
+    private char[] allocatedInput = null;
+    private byte[] allocatedOutput = null;
+
+    // These instance variables are always assigned in the methods before being used. This class
+    // is inherently thread-unsafe so we don't have to worry about synchronization.
+    private int inEnd;
+    private int outEnd;
+    private int ec;
+
+    public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) {
+        // This complexity is necessary to ensure that even if the constructor, superclass
+        // constructor, or call to updateCallback throw, we still free the native peer.
+        long address = 0;
+        try {
+            address = NativeConverter.openConverter(icuCanonicalName);
+            float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address);
+            float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address);
+            byte[] replacement = makeReplacement(icuCanonicalName, address);
+            CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address);
+            address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free.
+            return result;
+        } finally {
+            if (address != 0) {
+                NativeConverter.closeConverter(address);
+            }
+        }
+    }
+
+    private static byte[] makeReplacement(String icuCanonicalName, long address) {
+        // We have our own map of RI-compatible default replacements (where ICU disagrees)...
+        byte[] replacement = DEFAULT_REPLACEMENTS.get(icuCanonicalName);
+        if (replacement != null) {
+            return replacement.clone();
+        }
+        // ...but fall back to asking ICU.
+        return NativeConverter.getSubstitutionBytes(address);
+    }
+
+    private CharsetEncoderICU(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement, long address) {
+        super(cs, averageBytesPerChar, maxBytesPerChar, replacement, true);
+        // Our native peer needs to know what just happened...
+        this.converterHandle = address;
+        updateCallback();
+    }
+
+    @Override protected void implReplaceWith(byte[] newReplacement) {
+        updateCallback();
+    }
+
+    @Override protected void implOnMalformedInput(CodingErrorAction newAction) {
+        updateCallback();
+    }
+
+    @Override protected void implOnUnmappableCharacter(CodingErrorAction newAction) {
+        updateCallback();
+    }
+
+    private void updateCallback() {
+        ec = NativeConverter.setCallbackEncode(converterHandle, this);
+        if (ErrorCode.isFailure(ec)) {
+            throw ErrorCode.throwException(ec);
+        }
+    }
+
+    @Override protected void implReset() {
+        NativeConverter.resetCharToByte(converterHandle);
+        data[INPUT_OFFSET] = 0;
+        data[OUTPUT_OFFSET] = 0;
+        data[INVALID_CHARS] = 0;
+        output = null;
+        input = null;
+        allocatedInput = null;
+        allocatedOutput = null;
+        ec = 0;
+        inEnd = 0;
+        outEnd = 0;
+    }
+
+    @Override protected CoderResult implFlush(ByteBuffer out) {
+        try {
+            // ICU needs to see an empty input.
+            input = EmptyArray.CHAR;
+            inEnd = 0;
+            data[INPUT_OFFSET] = 0;
+
+            data[OUTPUT_OFFSET] = getArray(out);
+            data[INVALID_CHARS] = 0; // Make sure we don't see earlier errors.
+
+            ec = NativeConverter.encode(converterHandle, input, inEnd, output, outEnd, data, true);
+            if (ErrorCode.isFailure(ec)) {
+                if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
+                    return CoderResult.OVERFLOW;
+                } else if (ec == ErrorCode.U_TRUNCATED_CHAR_FOUND) {
+                    if (data[INPUT_OFFSET] > 0) {
+                        return CoderResult.malformedForLength(data[INPUT_OFFSET]);
+                    }
+                } else {
+                    throw ErrorCode.throwException(ec);
+                }
+            }
+            return CoderResult.UNDERFLOW;
+        } finally {
+            setPosition(out);
+            implReset();
+        }
+    }
+
+    @Override protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
+        if (!in.hasRemaining()) {
+            return CoderResult.UNDERFLOW;
+        }
+
+        data[INPUT_OFFSET] = getArray(in);
+        data[OUTPUT_OFFSET]= getArray(out);
+        data[INVALID_CHARS] = 0; // Make sure we don't see earlier errors.
+
+        try {
+            ec = NativeConverter.encode(converterHandle, input, inEnd, output, outEnd, data, false);
+            if (ErrorCode.isFailure(ec)) {
+                if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
+                    return CoderResult.OVERFLOW;
+                } else if (ec == ErrorCode.U_INVALID_CHAR_FOUND) {
+                    return CoderResult.unmappableForLength(data[INVALID_CHARS]);
+                } else if (ec == ErrorCode.U_ILLEGAL_CHAR_FOUND) {
+                    return CoderResult.malformedForLength(data[INVALID_CHARS]);
+                } else {
+                    throw new AssertionError("unexpected failure: " + ec);
+                }
+            }
+            // Decoding succeeded: give us more data.
+            return CoderResult.UNDERFLOW;
+        } finally {
+            setPosition(in);
+            setPosition(out);
+        }
+    }
+
+    public boolean canEncode(char c) {
+        return canEncode((int) c);
+    }
+
+    public boolean canEncode(int codePoint) {
+        return NativeConverter.canEncode(converterHandle, codePoint);
+    }
+
+    @Override protected void finalize() throws Throwable {
+        try {
+            NativeConverter.closeConverter(converterHandle);
+            converterHandle=0;
+        } finally {
+            super.finalize();
+        }
+    }
+
+    private int getArray(ByteBuffer out) {
+        if (out.hasArray()) {
+            output = out.array();
+            outEnd = out.arrayOffset() + out.limit();
+            return out.arrayOffset() + out.position();
+        } else {
+            outEnd = out.remaining();
+            if (allocatedOutput == null || outEnd > allocatedOutput.length) {
+                allocatedOutput = new byte[outEnd];
+            }
+            // The array's start position is 0
+            output = allocatedOutput;
+            return 0;
+        }
+    }
+
+    private int getArray(CharBuffer in) {
+        if (in.hasArray()) {
+            input = in.array();
+            inEnd = in.arrayOffset() + in.limit();
+            return in.arrayOffset() + in.position();
+        } else {
+            inEnd = in.remaining();
+            if (allocatedInput == null || inEnd > allocatedInput.length) {
+                allocatedInput = new char[inEnd];
+            }
+            // Copy the input buffer into the allocated array.
+            int pos = in.position();
+            in.get(allocatedInput, 0, inEnd);
+            in.position(pos);
+            // The array's start position is 0
+            input = allocatedInput;
+            return 0;
+        }
+    }
+
+    private void setPosition(ByteBuffer out) {
+        if (out.hasArray()) {
+            out.position(out.position() + data[OUTPUT_OFFSET] - out.arrayOffset());
+        } else {
+            out.put(output, 0, data[OUTPUT_OFFSET]);
+        }
+        // release reference to output array, which may not be ours
+        output = null;
+    }
+
+    private void setPosition(CharBuffer in) {
+        in.position(in.position() + data[INPUT_OFFSET] - data[INVALID_CHARS]);
+        // release reference to input array, which may not be ours
+        input = null;
+    }
+}
diff --git a/luni/src/main/java/libcore/icu/CharsetICU.java b/luni/src/main/java/java/nio/charset/CharsetICU.java
similarity index 85%
rename from luni/src/main/java/libcore/icu/CharsetICU.java
rename to luni/src/main/java/java/nio/charset/CharsetICU.java
index ac84e6c..63e3fe1 100644
--- a/luni/src/main/java/libcore/icu/CharsetICU.java
+++ b/luni/src/main/java/java/nio/charset/CharsetICU.java
@@ -7,13 +7,11 @@
 *******************************************************************************
 */
 
-package libcore.icu;
+package java.nio.charset;
 
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CharsetEncoder;
+import libcore.icu.NativeConverter;
 
-public final class CharsetICU extends Charset {
+final class CharsetICU extends Charset {
     private final String icuCanonicalName;
 
     protected CharsetICU(String canonicalName, String icuCanonName, String[] aliases) {
diff --git a/luni/src/main/java/java/nio/charset/CoderResult.java b/luni/src/main/java/java/nio/charset/CoderResult.java
index b2595f0..221cb32 100644
--- a/luni/src/main/java/java/nio/charset/CoderResult.java
+++ b/luni/src/main/java/java/nio/charset/CoderResult.java
@@ -93,7 +93,6 @@
      *            the length of the erroneous input
      */
     private CoderResult(int type, int length) {
-        super();
         this.type = type;
         this.length = length;
     }
diff --git a/luni/src/main/java/java/nio/charset/ModifiedUtf8.java b/luni/src/main/java/java/nio/charset/ModifiedUtf8.java
index f4233ef..019992d 100644
--- a/luni/src/main/java/java/nio/charset/ModifiedUtf8.java
+++ b/luni/src/main/java/java/nio/charset/ModifiedUtf8.java
@@ -19,8 +19,8 @@
 
 import java.io.UTFDataFormatException;
 import java.nio.ByteOrder;
+import libcore.io.Memory;
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
 
 /**
  * @hide internal use only
@@ -64,7 +64,7 @@
     }
 
     /**
-     * Returns the number of bytes the modified UTF8 representation of 's' would take. Note
+     * Returns the number of bytes the modified UTF-8 representation of 's' would take. Note
      * that this is just the space for the bytes representing the characters, not the length
      * which precedes those bytes, because different callers represent the length differently,
      * as two, four, or even eight bytes. If {@code shortLength} is true, we'll throw an
@@ -118,7 +118,7 @@
     public static byte[] encode(String s) throws UTFDataFormatException {
         int utfCount = (int) ModifiedUtf8.countBytes(s, true);
         byte[] result = new byte[SizeOf.SHORT + utfCount];
-        OSMemory.pokeShort(result, 0, (short) utfCount, ByteOrder.BIG_ENDIAN);
+        Memory.pokeShort(result, 0, (short) utfCount, ByteOrder.BIG_ENDIAN);
         ModifiedUtf8.encode(result, SizeOf.SHORT, s);
         return result;
     }
diff --git a/luni/src/main/java/java/nio/charset/spi/CharsetProvider.java b/luni/src/main/java/java/nio/charset/spi/CharsetProvider.java
index d24bebd..c3ed3c8 100644
--- a/luni/src/main/java/java/nio/charset/spi/CharsetProvider.java
+++ b/luni/src/main/java/java/nio/charset/spi/CharsetProvider.java
@@ -23,22 +23,10 @@
  * The service provider class for character sets.
  */
 public abstract class CharsetProvider {
-
-    // The permission required to construct a new provider.
-    private static final RuntimePermission CONSTRUCT_PERM = new RuntimePermission(
-            "charsetProvider");
-
     /**
      * Constructor for subclassing with concrete types.
-     *
-     * @throws SecurityException
-     *             if there is a security manager installed that does not permit
-     *             the runtime permission labeled "charsetProvider".
      */
     protected CharsetProvider() {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null)
-            securityManager.checkPermission(CONSTRUCT_PERM);
     }
 
     /**
diff --git a/luni/src/main/java/java/security/AccessControlContext.java b/luni/src/main/java/java/security/AccessControlContext.java
index b161b7f..470870d 100644
--- a/luni/src/main/java/java/security/AccessControlContext.java
+++ b/luni/src/main/java/java/security/AccessControlContext.java
@@ -50,16 +50,9 @@
 
     DomainCombiner combiner;
 
-    // An AccessControlContext inherited by the current thread from its parent
-    private AccessControlContext inherited;
-
     /**
      * Constructs a new instance of {@code AccessControlContext} with the
      * specified {@code AccessControlContext} and {@code DomainCombiner}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this constructor
-     * need the {@code SecurityPermission} {@code createAccessControlContext} to
-     * be granted, otherwise a {@code SecurityException} will be thrown.
      *
      * @param acc
      *            the {@code AccessControlContext} related to the given {@code
@@ -67,19 +60,10 @@
      * @param combiner
      *            the {@code DomainCombiner} related to the given {@code
      *            AccessControlContext}
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this constructor
      * @throws NullPointerException
      *             if {@code acc} is {@code null}
      */
-    public AccessControlContext(AccessControlContext acc,
-            DomainCombiner combiner) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new SecurityPermission(
-                    "createAccessControlContext"));
-        }
+    public AccessControlContext(AccessControlContext acc, DomainCombiner combiner) {
         // no need to clone() here as ACC is immutable
         this.context = acc.context;
         this.combiner = combiner;
@@ -119,44 +103,6 @@
     }
 
     /**
-     * Package-level ctor which is used in AccessController.<br>
-     * ProtectionDomains passed as <code>stack</code> is then passed into
-     * {@link #AccessControlContext(ProtectionDomain[])}, therefore:<br>
-     * <il>
-     * <li>it must not be null
-     * <li>duplicates will be removed
-     * <li>null-s will be removed
-     * </li>
-     *
-     * @param stack - array of ProtectionDomains
-     * @param inherited - inherited context, which may be null
-     */
-    AccessControlContext(ProtectionDomain[] stack,
-            AccessControlContext inherited) {
-        this(stack); // removes dups, removes nulls, checks for stack==null
-        this.inherited = inherited;
-    }
-
-    /**
-     * Package-level ctor which is used in AccessController.<br>
-     * ProtectionDomains passed as <code>stack</code> is then passed into
-     * {@link #AccessControlContext(ProtectionDomain[])}, therefore:<br>
-     * <il>
-     * <li>it must not be null
-     * <li>duplicates will be removed
-     * <li>null-s will be removed
-     * </li>
-     *
-     * @param stack - array of ProtectionDomains
-     * @param combiner - combiner
-     */
-    AccessControlContext(ProtectionDomain[] stack,
-            DomainCombiner combiner) {
-        this(stack); // removes dups, removes nulls, checks for stack==null
-        this.combiner = combiner;
-    }
-
-    /**
      * Checks the specified permission against the vm's current security policy.
      * The check is based on this {@code AccessControlContext} as opposed to the
      * {@link AccessController#checkPermission(Permission)} method which
@@ -189,13 +135,9 @@
         }
         for (int i = 0; i < context.length; i++) {
             if (!context[i].implies(perm)) {
-                throw new AccessControlException("Permission check failed "
-                        + perm, perm);
+                throw new AccessControlException("Permission check failed " + perm, perm);
             }
         }
-        if (inherited != null) {
-            inherited.checkPermission(perm);
-        }
     }
 
 
@@ -223,12 +165,10 @@
                     .matchSubset(that.context, context))) {
                 return false;
             }
-            // BEGIN android-changed
             if (combiner != null) {
                 return combiner.equals(that.combiner);
             }
             return that.combiner == null;
-            // END android-changed
         }
         return false;
     }
@@ -236,22 +176,11 @@
     /**
      * Returns the {@code DomainCombiner} associated with this {@code
      * AccessControlContext}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code getDomainCombiner} to be granted,
-     * otherwise a {@code SecurityException} will be thrown.
      *
      * @return the {@code DomainCombiner} associated with this {@code
      *         AccessControlContext}
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method
      */
     public DomainCombiner getDomainCombiner() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new SecurityPermission("getDomainCombiner"));
-        }
         return combiner;
     }
 
diff --git a/luni/src/main/java/java/security/AccessController.java b/luni/src/main/java/java/security/AccessController.java
index d395592..d49927c 100644
--- a/luni/src/main/java/java/security/AccessController.java
+++ b/luni/src/main/java/java/security/AccessController.java
@@ -32,287 +32,80 @@
 
 package java.security;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.WeakHashMap;
-import org.apache.harmony.security.fortress.SecurityUtils;
-
 /**
- * {@code AccessController} provides static methods to perform access control
- * checks and privileged operations.
+ * Legacy security code; this class exists for compatibility only.
  */
 public final class AccessController {
 
     private AccessController() {
-        throw new Error("statics only.");
     }
 
     /**
-     * A map used to store a mapping between a given Thread and
-     * AccessControllerContext-s used in successive calls of doPrivileged(). A
-     * WeakHashMap is used to allow automatic wiping of the dead threads from
-     * the map. The thread (normally Thread.currentThread()) is used as a key
-     * for the map, and a value is ArrayList where all AccessControlContext-s
-     * are stored.
-     * ((ArrayList)contexts.get(Thread.currentThread())).lastElement() - is
-     * reference to the latest context passed to the doPrivileged() call.
-     *
-     * TODO: ThreadLocal?
-     */
-    private static final WeakHashMap<Thread, ArrayList<AccessControlContext>> contexts = new WeakHashMap<Thread, ArrayList<AccessControlContext>>();
-
-    /**
-     * Returns the result of executing the specified privileged action. Only the
-     * {@code ProtectionDomain} of the direct caller of this method and the
-     * {@code ProtectionDomain}s of all subsequent classes in the call chain are
-     * checked to be granted the necessary permission if access checks are
-     * performed.
-     * <p>
-     * If an instance of {@code RuntimeException} is thrown during the execution
-     * of the {@code PrivilegedAction#run()} method of the given action, it will
-     * be propagated through this method.
-     *
-     * @param action
-     *            the action to be executed with privileges
-     * @return the result of executing the privileged action
-     * @throws NullPointerException
-     *             if the specified action is {@code null}
+     * Calls {@code action.run()}.
      */
     public static <T> T doPrivileged(PrivilegedAction<T> action) {
-        if (action == null) {
-            throw new NullPointerException("action == null");
-        }
-        return doPrivileged(action, null);
+        return action.run();
     }
 
     /**
-     * Returns the result of executing the specified privileged action. The
-     * {@code ProtectionDomain} of the direct caller of this method, the {@code
-     * ProtectionDomain}s of all subsequent classes in the call chain and all
-     * {@code ProtectionDomain}s of the given context are checked to be granted
-     * the necessary permission if access checks are performed.
-     * <p>
-     * If an instance of {@code RuntimeException} is thrown during the execution
-     * of the {@code PrivilegedAction#run()} method of the given action, it will
-     * be propagated through this method.
-     *
-     * @param action
-     *            the action to be executed with privileges
-     * @param context
-     *            the {@code AccessControlContext} whose protection domains are
-     *            checked additionally
-     * @return the result of executing the privileged action
-     * @throws NullPointerException
-     *             if the specified action is {@code null}
+     * Calls {@code action.run()}.
      */
-    public static <T> T doPrivileged(PrivilegedAction<T> action,
-            AccessControlContext context) {
-        if (action == null) {
-            throw new NullPointerException("action == null");
-        }
-        List<AccessControlContext> contextsStack = contextsForThread();
-        contextsStack.add(context);
-        try {
-            return action.run();
-        } finally {
-            contextsStack.remove(contextsStack.size() - 1);
-        }
+    public static <T> T doPrivileged(PrivilegedAction<T> action, AccessControlContext context) {
+        return action.run();
     }
 
     /**
-     * Returns the result of executing the specified privileged action. Only the
-     * {@code ProtectionDomain} of the direct caller of this method and the
-     * {@code ProtectionDomain}s of all subsequent classes in the call chain are
-     * checked to be granted the necessary permission if access checks are
-     * performed.
-     * <p>
-     * If a checked exception is thrown by the action's run method, it will be
-     * wrapped and propagated through this method.
-     * <p>
-     * If an instance of {@code RuntimeException} is thrown during the execution
-     * of the {@code PrivilegedAction#run()} method of the given action, it will
-     * be propagated through this method.
-     *
-     * @param action
-     *            the action to be executed with privileges
-     * @return the result of executing the privileged action
-     * @throws PrivilegedActionException
-     *             if the action's run method throws any checked exception
-     * @throws NullPointerException
-     *             if the specified action is {@code null}
+     * Calls {@code action.run()}.
      */
-    public static <T> T doPrivileged(PrivilegedExceptionAction<T> action)
-            throws PrivilegedActionException {
-        return doPrivileged(action, null);
-    }
-
-    /**
-     * Returns the result of executing the specified privileged action. The
-     * {@code ProtectionDomain} of the direct caller of this method, the {@code
-     * ProtectionDomain}s of all subsequent classes in the call chain and all
-     * {@code ProtectionDomain}s of the given context are checked to be granted
-     * the necessary permission if access checks are performed.
-     * <p>
-     * If a checked exception is thrown by the action's run method, it will be
-     * wrapped and propagated through this method.
-     * <p>
-     * If an instance of {@code RuntimeException} is thrown during the execution
-     * of the {@code PrivilegedAction#run()} method of the given action, it will
-     * be propagated through this method.
-     *
-     * @param action
-     *            the action to be executed with privileges
-     * @param context
-     *            the {@code AccessControlContext} whose protection domains are
-     *            checked additionally
-     * @return the result of executing the privileged action
-     * @throws PrivilegedActionException
-     *             if the action's run method throws any checked exception
-     * @throws NullPointerException
-     *             if the specified action is {@code null}
-     */
-    public static <T> T doPrivileged(PrivilegedExceptionAction<T> action,
-            AccessControlContext context) throws PrivilegedActionException {
-        if (action == null) {
-            throw new NullPointerException("action == null");
-        }
-        List<AccessControlContext> contextsStack = contextsForThread();
-        contextsStack.add(context);
+    public static <T> T doPrivileged(PrivilegedExceptionAction<T> action) throws PrivilegedActionException {
         try {
             return action.run();
         } catch (RuntimeException e) {
             throw e; // so we don't wrap RuntimeExceptions with PrivilegedActionException
         } catch (Exception e) {
             throw new PrivilegedActionException(e);
-        } finally {
-            contextsStack.remove(contextsStack.size() - 1);
         }
     }
 
+    /**
+     * Calls {@code action.run()}.
+     */
+    public static <T> T doPrivileged(PrivilegedExceptionAction<T> action, AccessControlContext context) throws PrivilegedActionException {
+        return doPrivileged(action);
+    }
+
+    /**
+     * Calls {@code action.run()}.
+     */
     public static <T> T doPrivilegedWithCombiner(PrivilegedAction<T> action) {
-        return doPrivileged(action, newContextSameDomainCombiner());
-    }
-
-    public static <T> T doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action)
-            throws PrivilegedActionException {
-        return doPrivileged(action, newContextSameDomainCombiner());
-    }
-
-    private static AccessControlContext newContextSameDomainCombiner() {
-        List<AccessControlContext> contextsStack = contextsForThread();
-        DomainCombiner domainCombiner = contextsStack.isEmpty()
-                ? null
-                : contextsStack.get(contextsStack.size() - 1).getDomainCombiner();
-        return new AccessControlContext(new ProtectionDomain[0], domainCombiner);
-    }
-
-    private static List<AccessControlContext> contextsForThread() {
-        Thread currThread = Thread.currentThread();
-
-        /*
-         * Thread.currentThread() is null when Thread.class is being initialized, and contexts is
-         * null when AccessController.class is still being initialized. In either case, return an
-         * empty list so callers need not worry.
-         */
-        if (currThread == null || contexts == null) {
-            return new ArrayList<AccessControlContext>();
-        }
-
-        synchronized (contexts) {
-            ArrayList<AccessControlContext> result = contexts.get(currThread);
-            if (result == null) {
-                result = new ArrayList<AccessControlContext>();
-                contexts.put(currThread, result);
-            }
-            return result;
-        }
+        return action.run();
     }
 
     /**
-     * Checks the specified permission against the VM's current security policy.
-     * The check is performed in the context of the current thread. This method
-     * returns silently if the permission is granted, otherwise an {@code
-     * AccessControlException} is thrown.
-     * <p>
-     * A permission is considered granted if every {@link ProtectionDomain} in
-     * the current execution context has been granted the specified permission.
-     * If privileged operations are on the execution context, only the {@code
-     * ProtectionDomain}s from the last privileged operation are taken into
-     * account.
-     * <p>
-     * This method delegates the permission check to
-     * {@link AccessControlContext#checkPermission(Permission)} on the current
-     * callers' context obtained by {@link #getContext()}.
-     *
-     * @param permission
-     *            the permission to check against the policy
-     * @throws AccessControlException
-     *             if the specified permission is not granted
-     * @throws NullPointerException
-     *             if the specified permission is {@code null}
-     * @see AccessControlContext#checkPermission(Permission)
-     *
+     * Calls {@code action.run()}.
      */
-    public static void checkPermission(Permission permission)
-            throws AccessControlException {
-        if (permission == null) {
-            throw new NullPointerException("permission == null");
-        }
-
-        getContext().checkPermission(permission);
+    public static <T> T doPrivilegedWithCombiner(PrivilegedExceptionAction<T> action) throws PrivilegedActionException {
+        return doPrivileged(action);
     }
 
     /**
-     * Returns array of ProtectionDomains from the classes residing on the stack
-     * of the current thread, up to and including the caller of the nearest
-     * privileged frame. Reflection frames are skipped. The returned array is
-     * never null and never contains null elements, meaning that bootstrap
-     * classes are effectively ignored.
+     * Does nothing.
      */
-    private static native ProtectionDomain[] getStackDomains();
+    public static void checkPermission(Permission permission) throws AccessControlException {
+    }
 
     /**
      * Returns the {@code AccessControlContext} for the current {@code Thread}
      * including the inherited access control context of the thread that spawned
      * the current thread (recursively).
-     * <p>
-     * The returned context may be used to perform access checks at a later
+     *
+     * <p>The returned context may be used to perform access checks at a later
      * point in time, possibly by another thread.
      *
      * @return the {@code AccessControlContext} for the current {@code Thread}
      * @see Thread#currentThread
      */
     public static AccessControlContext getContext() {
-
-        // duplicates (if any) will be removed in ACC constructor
-        ProtectionDomain[] stack = getStackDomains();
-
-        Thread currentThread = Thread.currentThread();
-        if (currentThread == null || AccessController.contexts == null) {
-            // Big boo time. No need to check anything ?
-            return new AccessControlContext(stack);
-        }
-
-        List<AccessControlContext> threadContexts = contextsForThread();
-
-        // if we're in a doPrivileged method, use its context.
-        AccessControlContext that = threadContexts.isEmpty()
-                ? SecurityUtils.getContext(currentThread)
-                : threadContexts.get(threadContexts.size() - 1);
-
-        if (that != null && that.combiner != null) {
-            ProtectionDomain[] assigned = null;
-            if (that.context != null && that.context.length != 0) {
-                assigned = new ProtectionDomain[that.context.length];
-                System.arraycopy(that.context, 0, assigned, 0, assigned.length);
-            }
-            ProtectionDomain[] protectionDomains = that.combiner.combine(stack, assigned);
-            if (protectionDomains == null) {
-                protectionDomains = new ProtectionDomain[0];
-            }
-            return new AccessControlContext(protectionDomains, that.combiner);
-        }
-
-        return new AccessControlContext(stack, that);
+        return new AccessControlContext(new ProtectionDomain[0]);
     }
 }
diff --git a/luni/src/main/java/java/security/AllPermissionCollection.java b/luni/src/main/java/java/security/AllPermissionCollection.java
index 121e891..ee1c22c 100644
--- a/luni/src/main/java/java/security/AllPermissionCollection.java
+++ b/luni/src/main/java/java/security/AllPermissionCollection.java
@@ -35,8 +35,9 @@
 
     private static final long serialVersionUID = -4023755556366636806L;
 
-    private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField(
-        "all_allowed", Boolean.TYPE), };
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField("all_allowed", boolean.class),
+    };
 
     // Single element of collection.
     private transient Permission all;
@@ -67,7 +68,7 @@
      * An auxiliary implementation for enumerating a single object.
      *
      */
-    final static class SingletonEnumeration<E> implements Enumeration<E> {
+    static final class SingletonEnumeration<E> implements Enumeration<E> {
 
         private E element;
 
diff --git a/luni/src/main/java/java/security/AuthProvider.java b/luni/src/main/java/java/security/AuthProvider.java
index 70dd842..47b262c 100644
--- a/luni/src/main/java/java/security/AuthProvider.java
+++ b/luni/src/main/java/java/security/AuthProvider.java
@@ -50,11 +50,6 @@
     /**
      * Performs a login into this {@code AuthProvider}. The specified {@code
      * CallbackHandler} is used to obtain information from the caller.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code authProvider.NAME} (where NAME is
-     * the provider name) to be granted, otherwise a {@code SecurityException}
-     * will be thrown.
      *
      * @param subject
      *            the subject that is used to login.
@@ -63,25 +58,14 @@
      *            caller.
      * @throws LoginException
      *             if the login fails.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public abstract void login(Subject subject, CallbackHandler handler) throws LoginException;
 
     /**
      * Performs a logout from this {@code AuthProvider}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code authProvider.NAME} (where NAME is
-     * the provider name) to be granted, otherwise a {@code SecurityException}
-     * will be thrown.
      *
      * @throws LoginException
      *             if the logout fails.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public abstract void logout() throws LoginException;
 
@@ -93,18 +77,10 @@
      * If no handler is set, this {@code AuthProvider} uses the {@code
      * CallbackHandler} specified by the {@code
      * auth.login.defaultCallbackHandler} security property.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code authProvider.NAME} (where NAME is
-     * the provider name) to be granted, otherwise a {@code SecurityException}
-     * will be thrown.
      *
      * @param handler
      *            the handler to obtain authentication information from the
      *            caller.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public abstract void setCallbackHandler(CallbackHandler handler);
 }
diff --git a/luni/src/main/java/java/security/BasicPermission.java b/luni/src/main/java/java/security/BasicPermission.java
index 50e3d30..9bc59ac 100644
--- a/luni/src/main/java/java/security/BasicPermission.java
+++ b/luni/src/main/java/java/security/BasicPermission.java
@@ -21,23 +21,7 @@
 import java.io.Serializable;
 
 /**
- * {@code BasicPermission} is the common base class of all permissions which
- * have a name but no action lists. A {@code BasicPermission} is granted or it
- * is not.
- * <p>
- * Names of a BasicPermission follow the dot separated, hierarchical property
- * naming convention. Asterisk '*' can be used as wildcards. Either by itself,
- * matching anything, or at the end of the name, immediately preceded by a '.'.
- * For example:
- *
- * <pre>
- * java.io.*  grants all permissions under the java.io permission hierarchy
- * *          grants all permissions
- * </pre>
- * <p>
- * While this class ignores the action list in the
- * {@link #BasicPermission(String, String)} constructor, subclasses may
- * implement actions on top of this class.
+ * Legacy security code; this class exists for compatibility only.
  */
 public abstract class BasicPermission extends Permission implements
     Serializable {
diff --git a/luni/src/main/java/java/security/BasicPermissionCollection.java b/luni/src/main/java/java/security/BasicPermissionCollection.java
index 2df0095..fae3854 100644
--- a/luni/src/main/java/java/security/BasicPermissionCollection.java
+++ b/luni/src/main/java/java/security/BasicPermissionCollection.java
@@ -41,9 +41,10 @@
     private static final long serialVersionUID = 739301742472979399L;
 
     private static final ObjectStreamField[] serialPersistentFields = {
-        new ObjectStreamField("all_allowed", Boolean.TYPE),
+        new ObjectStreamField("all_allowed", boolean.class),
         new ObjectStreamField("permissions", Hashtable.class),
-        new ObjectStreamField("permClass", Class.class), };
+        new ObjectStreamField("permClass", Class.class),
+    };
 
     //should be final, but because of writeObject() cannot be
     private transient Map<String, Permission> items = new HashMap<String, Permission>();
diff --git a/luni/src/main/java/java/security/DomainCombiner.java b/luni/src/main/java/java/security/DomainCombiner.java
index 520ad93..374f0eb 100644
--- a/luni/src/main/java/java/security/DomainCombiner.java
+++ b/luni/src/main/java/java/security/DomainCombiner.java
@@ -18,12 +18,7 @@
 package java.security;
 
 /**
- * {@code DomainCombiner} is used to update and optimize {@code
- * ProtectionDomain}s from an {@code AccessControlContext}.
- *
- * @see AccessControlContext
- * @see AccessControlContext#AccessControlContext(AccessControlContext,
- *      DomainCombiner)
+ * Legacy security code; this class exists for compatibility only.
  */
 public interface DomainCombiner {
 
@@ -33,15 +28,11 @@
      * duplicates and perform other optimizations.
      *
      * @param current
-     *            the protection domains of the current execution thread (since
-     *            the most recent call to {@link AccessController#doPrivileged}
-     *            ).
+     *            the protection domains of the current execution thread
      * @param assigned
-     *            the protection domains of the parent thread, maybe {@code
-     *            null}.
+     *            the protection domains of the parent thread, may be {@code null}.
      * @return a single {@code ProtectionDomain} array computed from the two
      *         provided arrays.
      */
-    ProtectionDomain[] combine(ProtectionDomain[] current,
-            ProtectionDomain[] assigned);
+    ProtectionDomain[] combine(ProtectionDomain[] current, ProtectionDomain[] assigned);
 }
diff --git a/luni/src/main/java/java/security/Identity.java b/luni/src/main/java/java/security/Identity.java
index 536d77b..6e5b8a3 100644
--- a/luni/src/main/java/java/security/Identity.java
+++ b/luni/src/main/java/java/security/Identity.java
@@ -82,25 +82,13 @@
 
     /**
      * Adds a {@code Certificate} to this {@code Identity}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code addIdentityCertificate} to be
-     * granted, otherwise a {@code SecurityException} will be thrown.
      *
      * @param certificate
      *            the {@code Certificate} to be added to this {@code Identity}.
      * @throws KeyManagementException
      *             if the certificate is not valid.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
-    public void addCertificate(Certificate certificate)
-            throws KeyManagementException {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("addIdentityCertificate");
-        }
+    public void addCertificate(Certificate certificate) throws KeyManagementException {
         PublicKey certPK = certificate.getPublicKey();
         if (publicKey != null) {
             if (!checkKeysEqual(publicKey, certPK)) {
@@ -141,32 +129,17 @@
 
     /**
      * Removes the specified {@code Certificate} from this {@code Identity}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code "removeIdentityCertificate"} to be
-     * granted, otherwise a {@code SecurityException} will be thrown.
-     * <p>
      *
      * @param certificate
      *            the {@code Certificate} to be removed.
      * @throws KeyManagementException
      *             if the certificate is not found.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
-    public void removeCertificate(Certificate certificate)
-            throws KeyManagementException {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("removeIdentityCertificate");
-        }
+    public void removeCertificate(Certificate certificate) throws KeyManagementException {
         if (certificates != null) {
-            // BEGIN android-added
             if (!certificates.contains(certificate)) {
                 throw new KeyManagementException("Certificate not found");
             }
-            // END android-added
             certificates.removeElement(certificate);
         }
     }
@@ -254,25 +227,14 @@
 
     /**
      * Sets the specified {@code PublicKey} to this {@code Identity}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code setIdentityPublicKey} to be
-     * granted, otherwise a {@code SecurityException} will be thrown.
      *
      * @param key
      *            the {@code PublicKey} to be set.
      * @throws KeyManagementException
      *             if another {@code Identity} in the same scope as this {@code
      *             Identity} already has the same {@code PublicKey}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public void setPublicKey(PublicKey key) throws KeyManagementException {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("setIdentityPublicKey");
-        }
         // this check does not always work
         if ((scope != null) && (key != null)) {
             Identity i = scope.getIdentity(key);
@@ -302,28 +264,13 @@
 
     /**
      * Sets an information string for this {@code Identity}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code setIdentityInfo} to be granted,
-     * otherwise a {@code SecurityException} will be thrown.
-     *
      * @param info
      *            the information to be set.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public void setInfo(String info) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("setIdentityInfo");
-        }
         this.info = info;
     }
 
-
-
-
     /**
      * Returns the information string of this {@code Identity}.
      *
@@ -333,9 +280,6 @@
         return info;
     }
 
-
-
-
     /**
      * Compares the specified object with this {@code Identity} for equality and
      * returns {@code true} if the specified object is equal, {@code false}
@@ -363,9 +307,6 @@
         return identityEquals(i);
     }
 
-
-
-
     /**
      * Returns the name of this {@code Identity}.
      *
@@ -375,9 +316,6 @@
         return name;
     }
 
-
-
-
     /**
      * Returns the hash code value for this {@code Identity}. Returns the same
      * hash code for {@code Identity}s that are equal to each other as required
@@ -399,29 +337,14 @@
         return hash;
     }
 
-
-
-
     /**
      * Returns a string containing a concise, human-readable description of the
      * this {@code Identity} including its name and its scope.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method
-     * needs the {@code SecurityPermission} {@code printIdentity} to be granted,
-     * otherwise a {@code SecurityException} will be thrown.
      *
      * @return a printable representation for this {@code Identity}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     @Override
-    @SuppressWarnings("nls")
     public String toString() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("printIdentity");
-        }
         String s = (this.name == null ? "" : this.name);
         if (scope != null) {
             s += " [" + scope.getName() + "]";
diff --git a/luni/src/main/java/java/security/IdentityScope.java b/luni/src/main/java/java/security/IdentityScope.java
index e5acc96..1e344fd 100644
--- a/luni/src/main/java/java/security/IdentityScope.java
+++ b/luni/src/main/java/java/security/IdentityScope.java
@@ -39,7 +39,6 @@
      * Constructs a new instance of {@code IdentityScope}.
      */
     protected IdentityScope() {
-        super();
     }
 
     /**
@@ -81,11 +80,7 @@
          * implementation as fallback, i.e., return null if fails to init an instance.
          */
         if (systemScope == null) {
-            String className = AccessController.doPrivileged(new PrivilegedAction<String>(){
-                public String run() {
-                    return Security.getProperty("system.scope");
-                }
-            });
+            String className = Security.getProperty("system.scope");
             if(className != null){
                 try {
                     systemScope = (IdentityScope) Class.forName(className).newInstance();
@@ -104,10 +99,6 @@
      *            the scope to set.
      */
     protected static void setSystemScope(IdentityScope scope) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("setSystemScope");
-        }
         systemScope = scope;
     }
 
diff --git a/luni/src/main/java/java/security/KeyFactory.java b/luni/src/main/java/java/security/KeyFactory.java
index 916b697..554885a 100644
--- a/luni/src/main/java/java/security/KeyFactory.java
+++ b/luni/src/main/java/java/security/KeyFactory.java
@@ -98,9 +98,8 @@
      *             if the requested provider is not available.
      * @throws IllegalArgumentException if {@code provider == null || provider.isEmpty()}
      */
-    @SuppressWarnings("nls")
     public static KeyFactory getInstance(String algorithm, String provider)
-                                throws NoSuchAlgorithmException, NoSuchProviderException {
+            throws NoSuchAlgorithmException, NoSuchProviderException {
         if (provider == null || provider.isEmpty()) {
             throw new IllegalArgumentException();
         }
diff --git a/luni/src/main/java/java/security/KeyStore.java b/luni/src/main/java/java/security/KeyStore.java
index ab4b924..4619879 100644
--- a/luni/src/main/java/java/security/KeyStore.java
+++ b/luni/src/main/java/java/security/KeyStore.java
@@ -176,8 +176,7 @@
      *             NoSuchAlgorithmException) as in 1.4 release
      * @see #getDefaultType
      */
-    public static KeyStore getInstance(String type, Provider provider)
-            throws KeyStoreException {
+    public static KeyStore getInstance(String type, Provider provider) throws KeyStoreException {
         // check parameters
         if (provider == null) {
             throw new IllegalArgumentException();
@@ -197,21 +196,15 @@
 
     /**
      * Returns the default type for {@code KeyStore} instances.
-     * <p>
-     * The default is specified in the {@code 'keystore.type'} property in the
-     * file named {@code JAVA_HOME/lib/security/java.security}. If this property
+     *
+     * <p>The default is specified in the {@code 'keystore.type'} property in the
+     * file named {@code java.security} properties file. If this property
      * is not set, {@code "jks"} will be used.
      *
      * @return the default type for {@code KeyStore} instances
      */
     public static final String getDefaultType() {
-        String dt = AccessController.doPrivileged(
-                new PrivilegedAction<String>() {
-                    public String run() {
-                        return Security.getProperty(PROPERTYNAME);
-                    }
-                }
-            );
+        String dt = Security.getProperty(PROPERTYNAME);
         return (dt == null ? DEFAULT_KEYSTORE_TYPE : dt);
     }
 
@@ -254,9 +247,7 @@
             throws KeyStoreException, NoSuchAlgorithmException,
             UnrecoverableKeyException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineGetKey(alias, password);
     }
@@ -271,12 +262,9 @@
      * @throws KeyStoreException
      *             if this {@code KeyStore} is not initialized.
      */
-    public final Certificate[] getCertificateChain(String alias)
-            throws KeyStoreException {
+    public final Certificate[] getCertificateChain(String alias) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineGetCertificateChain(alias);
     }
@@ -291,12 +279,9 @@
      * @throws KeyStoreException
      *             if this {@code KeyStore} is not initialized.
      */
-    public final Certificate getCertificate(String alias)
-            throws KeyStoreException {
+    public final Certificate getCertificate(String alias) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineGetCertificate(alias);
     }
@@ -313,9 +298,7 @@
      */
     public final Date getCreationDate(String alias) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineGetCreationDate(alias);
     }
@@ -344,9 +327,7 @@
     public final void setKeyEntry(String alias, Key key, char[] password,
             Certificate[] chain) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
 
         // Certificate chain is required for PrivateKey
@@ -383,9 +364,7 @@
     public final void setKeyEntry(String alias, byte[] key, Certificate[] chain)
             throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         implSpi.engineSetKeyEntry(alias, key, chain);
     }
@@ -406,12 +385,9 @@
      * @throws NullPointerException
      *             if {@code alias} is {@code null}.
      */
-    public final void setCertificateEntry(String alias, Certificate cert)
-            throws KeyStoreException {
+    public final void setCertificateEntry(String alias, Certificate cert) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         implSpi.engineSetCertificateEntry(alias, cert);
     }
@@ -428,9 +404,7 @@
      */
     public final void deleteEntry(String alias) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         implSpi.engineDeleteEntry(alias);
     }
@@ -446,9 +420,7 @@
      */
     public final Enumeration<String> aliases() throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineAliases();
     }
@@ -464,9 +436,7 @@
      */
     public final boolean containsAlias(String alias) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineContainsAlias(alias);
     }
@@ -480,9 +450,7 @@
      */
     public final int size() throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineSize();
     }
@@ -499,9 +467,7 @@
      */
     public final boolean isKeyEntry(String alias) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineIsKeyEntry(alias);
     }
@@ -517,12 +483,9 @@
      * @throws KeyStoreException
      *             if this {@code KeyStore} is not initialized.
      */
-    public final boolean isCertificateEntry(String alias)
-            throws KeyStoreException {
+    public final boolean isCertificateEntry(String alias) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineIsCertificateEntry(alias);
     }
@@ -538,12 +501,9 @@
      * @throws KeyStoreException
      *             if this {@code KeyStore} is not initialized.
      */
-    public final String getCertificateAlias(Certificate cert)
-            throws KeyStoreException {
+    public final String getCertificateAlias(Certificate cert) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineGetCertificateAlias(cert);
     }
@@ -568,12 +528,9 @@
      *             this {@code KeyStore}.
      */
     public final void store(OutputStream stream, char[] password)
-            throws KeyStoreException, IOException, NoSuchAlgorithmException,
-            CertificateException {
+            throws KeyStoreException, IOException, NoSuchAlgorithmException, CertificateException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
 
         //Just delegate stream and password to implSpi
@@ -602,9 +559,7 @@
     public final void store(LoadStoreParameter param) throws KeyStoreException,
             IOException, NoSuchAlgorithmException, CertificateException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         implSpi.engineStore(param);
     }
@@ -679,15 +634,12 @@
      *             if {@code alias} is {@code null}.
      */
     public final Entry getEntry(String alias, ProtectionParameter param)
-            throws NoSuchAlgorithmException, UnrecoverableEntryException,
-            KeyStoreException {
+            throws NoSuchAlgorithmException, UnrecoverableEntryException, KeyStoreException {
         if (alias == null) {
             throw new NullPointerException("alias == null");
         }
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineGetEntry(alias, param);
     }
@@ -714,9 +666,7 @@
     public final void setEntry(String alias, Entry entry,
             ProtectionParameter param) throws KeyStoreException {
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         if (alias == null) {
             throw new NullPointerException("alias == null");
@@ -751,9 +701,7 @@
         }
 
         if (!isInit) {
-            // BEGIN android-changed
             throwNotInitialized();
-            // END android-changed
         }
         return implSpi.engineEntryInstanceOf(alias, entryClass);
     }
@@ -826,8 +774,7 @@
             if (!keyStore.isInit) {
                 throw new IllegalArgumentException("KeyStore was not initialized");
             }
-            return new BuilderImpl(keyStore, protectionParameter,
-                    null, null, null, null);
+            return new BuilderImpl(keyStore, protectionParameter, null, null, null);
         }
 
         /**
@@ -887,8 +834,7 @@
                 throw new IllegalArgumentException("Not a regular file: " + file.getName());
             }
             // create new instance
-            return new BuilderImpl(null, protectionParameter, file,
-                    type, provider, AccessController.getContext());
+            return new BuilderImpl(null, protectionParameter, file, type, provider);
         }
 
         /**
@@ -926,8 +872,7 @@
             if (protectionParameter == null) {
                 throw new NullPointerException("protectionParameter == null");
             }
-            return new BuilderImpl(null, protectionParameter, null,
-                    type, provider, AccessController.getContext());
+            return new BuilderImpl(null, protectionParameter, null, type, provider);
         }
 
         /*
@@ -958,17 +903,13 @@
             // Store last Exception in getKeyStore()
             private KeyStoreException lastException;
 
-            // Store AccessControlContext which is used in getKeyStore() method
-            private final AccessControlContext accControlContext;
-
             /**
              * Constructor BuilderImpl initializes private fields: keyStore,
              * protParameter, typeForKeyStore providerForKeyStore fileForLoad,
              * isGetKeyStore
              */
             BuilderImpl(KeyStore ks, ProtectionParameter pp, File file,
-                        String type, Provider provider, AccessControlContext context) {
-                super();
+                        String type, Provider provider) {
                 keyStore = ks;
                 protParameter = pp;
                 fileForLoad = file;
@@ -976,7 +917,6 @@
                 providerForKeyStore = provider;
                 isGetKeyStore = false;
                 lastException = null;
-                accControlContext = context;
             }
 
             /**
@@ -1009,15 +949,13 @@
                 }
 
                 try {
-                    final KeyStore ks;
-                    final char[] passwd;
-
                     // get KeyStore instance using type or type and provider
-                    ks = (providerForKeyStore == null ? KeyStore
+                    final KeyStore ks = (providerForKeyStore == null ? KeyStore
                             .getInstance(typeForKeyStore) : KeyStore
                             .getInstance(typeForKeyStore, providerForKeyStore));
                     // protection parameter should be PasswordProtection
                     // or CallbackHandlerProtection
+                    final char[] passwd;
                     if (protParameter instanceof PasswordProtection) {
                         passwd = ((PasswordProtection) protParameter)
                                 .getPassword();
@@ -1030,25 +968,17 @@
                     }
 
                     // load KeyStore from file
-                    AccessController.doPrivileged(
-                            new PrivilegedExceptionAction<Object>() {
-                                public Object run() throws Exception {
-                                    if (fileForLoad != null) {
-                                        FileInputStream fis = null;
-                                        try {
-                                            fis = new FileInputStream(fileForLoad);
-                                            ks.load(fis, passwd);
-                                        } finally {
-                                            IoUtils.closeQuietly(fis);
-                                        }
-                                    } else {
-                                        ks.load(new TmpLSParameter(
-                                                protParameter));
-                                    }
-                                    return null;
-                                }
-                            }, accControlContext);
-
+                    if (fileForLoad != null) {
+                        FileInputStream fis = null;
+                        try {
+                            fis = new FileInputStream(fileForLoad);
+                            ks.load(fis, passwd);
+                        } finally {
+                            IoUtils.closeQuietly(fis);
+                        }
+                    } else {
+                        ks.load(new TmpLSParameter(protParameter));
+                    }
 
                     isGetKeyStore = true;
                     return ks;
diff --git a/luni/src/main/java/java/security/Permission.java b/luni/src/main/java/java/security/Permission.java
index 60a5c7e..044c01f 100644
--- a/luni/src/main/java/java/security/Permission.java
+++ b/luni/src/main/java/java/security/Permission.java
@@ -20,10 +20,7 @@
 import java.io.Serializable;
 
 /**
- * {@code Permission} is the common base class of all permissions that
- * participate in the access control security framework around
- * {@link AccessController} and {@link AccessControlContext}. A permission
- * constitutes of a name and associated actions.
+ * Legacy security code; this class exists for compatibility only.
  */
 public abstract class Permission implements Guard, Serializable {
 
@@ -81,8 +78,6 @@
 
     /**
      * Indicates whether the specified permission is implied by this permission.
-     * The {@link AccessController} uses this method to check whether permission
-     * protected access is allowed with the present policy.
      *
      * @param permission
      *            the permission to check against this permission.
@@ -111,23 +106,9 @@
     }
 
     /**
-     * Invokes {@link SecurityManager#checkPermission(Permission)} with this
-     * permission as its argument. This method implements the {@link Guard}
-     * interface.
-     *
-     * @param obj
-     *            as specified in {@link Guard#checkGuard(Object)} but ignored
-     *            in this implementation.
-     * @throws SecurityException
-     *             if this permission is not granted.
-     * @see Guard
-     * @see SecurityManager#checkPermission(Permission)
+     * Does nothing.
      */
     public void checkGuard(Object obj) throws SecurityException {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(this);
-        }
     }
 
     /**
diff --git a/luni/src/main/java/java/security/Permissions.java b/luni/src/main/java/java/security/Permissions.java
index 356a072..88a3414 100644
--- a/luni/src/main/java/java/security/Permissions.java
+++ b/luni/src/main/java/java/security/Permissions.java
@@ -45,7 +45,8 @@
 
     private static final ObjectStreamField[] serialPersistentFields = {
         new ObjectStreamField("perms", Hashtable.class),
-        new ObjectStreamField("allPermission", PermissionCollection.class), };
+        new ObjectStreamField("allPermission", PermissionCollection.class),
+    };
 
     // Hash to store PermissionCollection's
     private transient Map klasses = new HashMap();
@@ -107,7 +108,7 @@
      * collection of PermissionCollections.
      *
      */
-    final static class MetaEnumeration implements Enumeration {
+    static final class MetaEnumeration implements Enumeration {
 
         private Iterator pcIter;
 
diff --git a/luni/src/main/java/java/security/Policy.java b/luni/src/main/java/java/security/Policy.java
index 8a5934d..b2887a3 100644
--- a/luni/src/main/java/java/security/Policy.java
+++ b/luni/src/main/java/java/security/Policy.java
@@ -108,9 +108,6 @@
      * @throws NoSuchAlgorithmException
      *             if no Provider supports a PolicySpi implementation for the
      *             specified type.
-     * @throws SecurityException
-     *             if the caller does not have permission to get a Policy
-     *             instance for the specified type.
      * @throws NullPointerException
      *             if the specified type is null.
      * @throws IllegalArgumentException
@@ -119,8 +116,6 @@
      */
     public static Policy getInstance(String type, Policy.Parameters params)
             throws NoSuchAlgorithmException {
-        checkSecurityPermission(new SecurityPermission(CREATE_POLICY + type));
-
         if (type == null) {
             throw new NullPointerException();
         }
@@ -159,9 +154,6 @@
      * @throws NoSuchAlgorithmException
      *             if the specified provider does not support a PolicySpi
      *             implementation for the specified type.
-     * @throws SecurityException
-     *             if the caller does not have permission to get a Policy
-     *             instance for the specified type.
      * @throws NullPointerException
      *             if the specified type is null.
      * @throws IllegalArgumentException
@@ -175,7 +167,6 @@
         if ((provider == null) || provider.isEmpty()) {
             throw new IllegalArgumentException("Provider is null or empty string");
         }
-        checkSecurityPermission(new SecurityPermission(CREATE_POLICY + type));
 
         Provider impProvider = Security.getProvider(provider);
         if (impProvider == null) {
@@ -210,27 +201,15 @@
      *             implementation from the specified Provider.
      * @throws NullPointerException
      *             if the specified type is null.
-     * @throws SecurityException
-     *             if the caller does not have permission to get a Policy
-     *             instance for the specified type.
      */
     public static Policy getInstance(String type, Policy.Parameters params,
             Provider provider) throws NoSuchAlgorithmException {
         if (provider == null) {
             throw new IllegalArgumentException("provider == null");
         }
-        checkSecurityPermission(new SecurityPermission(CREATE_POLICY + type));
-
         return getInstanceImpl(type, params, provider);
     }
 
-    private static void checkSecurityPermission(SecurityPermission permission) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(permission);
-        }
-    }
-
     private static Policy getInstanceImpl(String type, Policy.Parameters params, Provider provider)
             throws NoSuchAlgorithmException {
         if (type == null) {
@@ -442,18 +421,10 @@
      * Returns the current system security policy. If no policy has been
      * instantiated then this is done using the security property {@code
      * "policy.provider"}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code getPolicy} to be granted, otherwise
-     * a {@code SecurityException} will be thrown.
      *
      * @return the current system security policy.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public static Policy getPolicy() {
-        checkSecurityPermission(GET_POLICY);
         return getAccessiblePolicy();
     }
 
@@ -462,34 +433,18 @@
     // In case of any error, including undefined provider name,
     // returns new instance of org.apache.harmony.security.FilePolicy provider.
     private static Policy getDefaultProvider() {
-        final String defaultClass = AccessController
-                .doPrivileged(new PolicyUtils.SecurityPropertyAccessor(
-                        POLICY_PROVIDER));
+        final String defaultClass = Security.getProperty(POLICY_PROVIDER);
         if (defaultClass == null) {
-            // TODO log warning
-            // System.err.println("No policy provider specified. Loading the "
-            // + DefaultPolicy.class.getName());
             return new DefaultPolicy();
         }
 
         // TODO accurate classloading
-        return AccessController.doPrivileged(new PrivilegedAction<Policy>() {
-
-            public Policy run() {
-                try {
-                    return (Policy) Class.forName(defaultClass, true,
-                            ClassLoader.getSystemClassLoader()).newInstance();
-                } catch (Exception e) {
-                    //TODO log error
-                    //System.err.println("Error loading policy provider <"
-                    //                 + defaultClass + "> : " + e
-                    //                 + "\nSwitching to the default "
-                    //                 + DefaultPolicy.class.getName());
-                    return new DefaultPolicy();
-                }
-            }
-        });
-
+        try {
+            return (Policy) Class.forName(defaultClass, true,
+            ClassLoader.getSystemClassLoader()).newInstance();
+        } catch (Exception e) {
+            return new DefaultPolicy();
+        }
     }
 
     /**
@@ -518,19 +473,10 @@
 
     /**
      * Sets the system wide policy.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code setPolicy} to be granted, otherwise
-     * a {@code SecurityException} will be thrown.
-     *
      * @param policy
      *            the {@code Policy} to set.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public static void setPolicy(Policy policy) {
-        checkSecurityPermission(SET_POLICY);
         synchronized (Policy.class) {
             activePolicy = policy;
         }
diff --git a/luni/src/main/java/java/security/PrivilegedAction.java b/luni/src/main/java/java/security/PrivilegedAction.java
index 1dbbe65..d635f58 100644
--- a/luni/src/main/java/java/security/PrivilegedAction.java
+++ b/luni/src/main/java/java/security/PrivilegedAction.java
@@ -18,20 +18,11 @@
 package java.security;
 
 /**
- * {@code PrivilegedAction} represents an action that can be executed privileged
- * regarding access control. Instances of {@code PrivilegedAction} can be
- * executed on {@code AccessController.doPrivileged()}.
- *
- * @see AccessController
- * @see AccessController#doPrivileged(PrivilegedAction)
- * @see AccessController#doPrivileged(PrivilegedAction, AccessControlContext)
- * @see PrivilegedExceptionAction
+ * Legacy security code; this class exists for compatibility only.
  */
 public interface PrivilegedAction<T> {
     /**
      * Returns the result of running the action.
-     *
-     * @return the result of running the action.
      */
     public T run();
 }
diff --git a/luni/src/main/java/java/security/PrivilegedActionException.java b/luni/src/main/java/java/security/PrivilegedActionException.java
index 7965469..e470ebf 100644
--- a/luni/src/main/java/java/security/PrivilegedActionException.java
+++ b/luni/src/main/java/java/security/PrivilegedActionException.java
@@ -18,21 +18,7 @@
 package java.security;
 
 /**
- * {@code PrivilegedActionException} wraps exceptions which are thrown from
- * within privileged operations.
- * <p>
- * Privileged actions which can throw exceptions are of type {@code
- * PrivilegedExceptionAction} and are thrown by
- * <ul>
- * {@code AccessController#doPrivileged(PrivilegedExceptionAction)}<br>
- * {@code AccessController#doPrivileged(PrivilegedExceptionAction,
- * AccessControlContext)} </br>
- * </ul>
- *
- * @see PrivilegedExceptionAction
- * @see AccessController#doPrivileged(PrivilegedExceptionAction)
- * @see AccessController#doPrivileged(PrivilegedExceptionAction,
- *      AccessControlContext)
+ * Legacy security code; this class exists for compatibility only.
  */
 public class PrivilegedActionException extends Exception {
 
diff --git a/luni/src/main/java/java/security/PrivilegedExceptionAction.java b/luni/src/main/java/java/security/PrivilegedExceptionAction.java
index bc072d5..a9496ad 100644
--- a/luni/src/main/java/java/security/PrivilegedExceptionAction.java
+++ b/luni/src/main/java/java/security/PrivilegedExceptionAction.java
@@ -18,23 +18,11 @@
 package java.security;
 
 /**
- * {@code PrivilegedAction} represents an action, that can be executed
- * privileged regarding access control. Instances of {@code PrivilegedAction}
- * can be executed invoking {@code AccessController.doPrivileged()}.
- *
- * @see AccessController
- * @see AccessController#doPrivileged(PrivilegedExceptionAction)
- * @see AccessController#doPrivileged(PrivilegedExceptionAction,
- *      AccessControlContext)
- * @see PrivilegedAction
+ * Legacy security code; this class exists for compatibility only.
  */
 public interface PrivilegedExceptionAction<T> {
     /**
      * Returns the result of running the action.
-     *
-     * @return the result of running the action
-     * @throws Exception
-     *             if an exception occurred.
      */
     T run() throws Exception;
 }
diff --git a/luni/src/main/java/java/security/Provider.java b/luni/src/main/java/java/security/Provider.java
index 346d199..2de3751 100644
--- a/luni/src/main/java/java/security/Provider.java
+++ b/luni/src/main/java/java/security/Provider.java
@@ -28,11 +28,11 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Properties;
 import java.util.Set;
 import org.apache.harmony.luni.util.TwoKeyHashMap;
-import org.apache.harmony.security.Util;
 import org.apache.harmony.security.fortress.Services;
 
 /**
@@ -149,22 +149,9 @@
     /**
      * Clears all properties used to look up services implemented by this
      * {@code Provider}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code clearProviderProperties.NAME}
-     * (where NAME is the provider name) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
-     *
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     @Override
     public synchronized void clear() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("clearProviderProperties." + name);
-        }
         super.clear();
         if (serviceTable != null) {
             serviceTable.clear();
@@ -178,9 +165,7 @@
         if (propertyAliasTable != null) {
             propertyAliasTable.clear();
         }
-        // BEGIN android-changed
         changedProperties = null;
-        // END android-changed
         putProviderInfo();
         if (providerNumber != -1) {
             // if registered then refresh Services
@@ -198,29 +183,11 @@
 
     /**
      * Copies all from the provided map to this {@code Provider}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code putProviderProperty.NAME} (where
-     * NAME is the provider name) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
-     *
      * @param t
      *            the mappings to copy to this provider.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     @Override
     public synchronized void putAll(Map<?,?> t) {
-
-        // Implementation note:
-        // checkSecurityAccess method call is NOT specified
-        // Do it as in put(Object key, Object value).
-
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("putProviderProperty." + name);
-        }
         myPutAll(t);
     }
 
@@ -269,11 +236,6 @@
     /**
      * Maps the specified {@code key} property name to the specified {@code
      * value}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code putProviderProperty.NAME} (where
-     * NAME is the provider name) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
      *
      * @param key
      *            the name of the property.
@@ -281,16 +243,9 @@
      *            the value of the property.
      * @return the value that was previously mapped to the specified {@code key}
      *         ,or {@code null} if it did not have one.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     @Override
     public synchronized Object put(Object key, Object value) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("putProviderProperty." + name);
-        }
         if (key instanceof String && ((String) key).startsWith("Provider.")) {
             // Provider service type is reserved
             return null;
@@ -312,26 +267,14 @@
     /**
      * Removes the specified {@code key} and its associated value from this
      * {@code Provider}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code removeProviderProperty.NAME} (where
-     * NAME is the provider name) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
      *
      * @param key
      *            the name of the property
      * @return the value that was mapped to the specified {@code key} ,or
      *         {@code null} if no mapping was present
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have the permission to invoke this method.
      */
     @Override
     public synchronized Object remove(Object key) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("removeProviderProperty." + name);
-        }
         if (key instanceof String && ((String) key).startsWith("Provider.")) {
             // Provider service type is reserved
             return null;
@@ -342,11 +285,9 @@
         }
         if (changedProperties != null && changedProperties.remove(key) == null) {
             removeFromPropertyServiceTable(key);
-            // BEGIN android-added
             if (changedProperties.size() == 0) {
                 changedProperties = null;
             }
-            // END android-added
         }
         return super.remove(key);
     }
@@ -385,20 +326,20 @@
         return false;
     }
 
-    // Returns true if this provider has the same value as is given for the
-    // given attribute
+    /**
+     * Returns true if this provider has the same value as is given for the
+     * given attribute
+     */
     private boolean checkAttribute(String servAlg, String attribute, String val) {
 
         String attributeValue = getPropertyIgnoreCase(servAlg + ' ' + attribute);
         if (attributeValue != null) {
-            if (Util.equalsIgnoreCase(attribute,"KeySize")) {
-                // BEGIN android-changed
+            if (attribute.equalsIgnoreCase("KeySize")) {
                 if (Integer.parseInt(attributeValue) >= Integer.parseInt(val)) {
                     return true;
                 }
-                // END android-changed
             } else { // other attributes
-                if (Util.equalsIgnoreCase(attributeValue, val)) {
+                if (attributeValue.equalsIgnoreCase(val)) {
                     return true;
                 }
             }
@@ -469,12 +410,11 @@
             throw new NullPointerException();
         }
 
-        if (type.equals(lastServiceName)
-                && Util.equalsIgnoreCase(algorithm, lastAlgorithm)) {
+        if (type.equals(lastServiceName) && algorithm.equalsIgnoreCase(lastAlgorithm)) {
             return returnedService;
         }
 
-        String alg = Util.toUpperCase(algorithm);
+        String alg = algorithm.toUpperCase(Locale.US);
         Object o = null;
         if (serviceTable != null) {
             o = serviceTable.get(type, alg);
@@ -528,26 +468,14 @@
     /**
      * Adds a {@code Service} to this {@code Provider}. If a service with the
      * same name was registered via this method, it is replace.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code putProviderProperty.NAME} (where
-     * NAME is the provider name) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
      *
      * @param s
      *            the {@code Service} to register
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method
      */
     protected synchronized void putService(Provider.Service s) {
         if (s == null) {
             throw new NullPointerException();
         }
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("putProviderProperty." + name);
-        }
         if ("Provider".equals(s.getType())) { // Provider service type cannot be added
             return;
         }
@@ -555,13 +483,13 @@
         if (serviceTable == null) {
             serviceTable = new TwoKeyHashMap<String, String, Service>(128);
         }
-        serviceTable.put(s.type, Util.toUpperCase(s.algorithm), s);
+        serviceTable.put(s.type, s.algorithm.toUpperCase(Locale.US), s);
         if (s.aliases != null) {
             if (aliasTable == null) {
                 aliasTable = new TwoKeyHashMap<String, String, Service>(256);
             }
             for (String alias : s.getAliases()) {
-                aliasTable.put(s.type, Util.toUpperCase(alias), s);
+                aliasTable.put(s.type, alias.toUpperCase(Locale.US), s);
             }
         }
         serviceInfoToProperties(s);
@@ -570,17 +498,9 @@
     /**
      * Removes a previously registered {@code Service} from this {@code
      * Provider}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code removeProviderProperty.NAME} (where
-     * NAME is the provider name) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
      *
      * @param s
      *            the {@code Service} to remove
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method
      * @throws NullPointerException
      *             if {@code s} is {@code null}
      */
@@ -588,17 +508,13 @@
         if (s == null) {
             throw new NullPointerException();
         }
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("removeProviderProperty." + name);
-        }
         servicesChanged();
         if (serviceTable != null) {
-            serviceTable.remove(s.type, Util.toUpperCase(s.algorithm));
+            serviceTable.remove(s.type, s.algorithm.toUpperCase(Locale.US));
         }
         if (aliasTable != null && s.aliases != null) {
             for (String alias: s.getAliases()) {
-                aliasTable.remove(s.type, Util.toUpperCase(alias));
+                aliasTable.remove(s.type, alias.toUpperCase(Locale.US));
             }
         }
         serviceInfoFromProperties(s);
@@ -668,7 +584,7 @@
             serviceName = service_alias.substring(0, i);
             aliasName = service_alias.substring(i + 1);
             if (propertyAliasTable != null) {
-                propertyAliasTable.remove(serviceName, Util.toUpperCase(aliasName));
+                propertyAliasTable.remove(serviceName, aliasName.toUpperCase(Locale.US));
             }
             if (propertyServiceTable != null) {
                 for (Iterator<Service> it = propertyServiceTable.values().iterator(); it
@@ -693,12 +609,11 @@
             algorithm = k.substring(j + 1);
             if (propertyServiceTable != null) {
                 Provider.Service ser = propertyServiceTable.remove(serviceName,
-                                                                   Util.toUpperCase(algorithm));
+                        algorithm.toUpperCase(Locale.US));
                 if (ser != null && propertyAliasTable != null
                         && ser.aliases != null) {
-                    for (Iterator<String> it = ser.aliases.iterator(); it.hasNext();) {
-                        propertyAliasTable.remove(serviceName, Util.toUpperCase(it
-                                .next()));
+                    for (String alias : ser.aliases) {
+                        propertyAliasTable.remove(serviceName, alias.toUpperCase(Locale.US));
                     }
                 }
             }
@@ -709,7 +624,7 @@
             serviceName = k.substring(0, j);
             algorithm = k.substring(j + 1, i);
             if (propertyServiceTable != null) {
-                Object o = propertyServiceTable.get(serviceName, Util.toUpperCase(algorithm));
+                Object o = propertyServiceTable.get(serviceName, algorithm.toUpperCase(Locale.US));
                 if (o != null) {
                     s = (Provider.Service) o;
                     s.attributes.remove(attribute);
@@ -752,7 +667,7 @@
                 serviceName = service_alias.substring(0, i);
                 aliasName = service_alias.substring(i + 1);
                 algorithm = value;
-                String algUp = Util.toUpperCase(algorithm);
+                String algUp = algorithm.toUpperCase(Locale.US);
                 Object o = null;
                 if (propertyServiceTable == null) {
                     propertyServiceTable = new TwoKeyHashMap<String, String, Service>(128);
@@ -761,14 +676,11 @@
                 }
                 if (o != null) {
                     s = (Provider.Service) o;
-                    // BEGIN android-changed
                     s.addAlias(aliasName);
-                    // END android-changed
                     if (propertyAliasTable == null) {
                         propertyAliasTable = new TwoKeyHashMap<String, String, Service>(256);
                     }
-                    propertyAliasTable.put(serviceName,
-                            Util.toUpperCase(aliasName), s);
+                    propertyAliasTable.put(serviceName, aliasName.toUpperCase(Locale.US), s);
                 } else {
                     String className = (String) changedProperties
                             .get(serviceName + "." + algorithm);
@@ -781,8 +693,7 @@
                         if (propertyAliasTable == null) {
                             propertyAliasTable = new TwoKeyHashMap<String, String, Service>(256);
                         }
-                        propertyAliasTable.put(serviceName, Util.toUpperCase(aliasName
-                                ), s);
+                        propertyAliasTable.put(serviceName, aliasName.toUpperCase(Locale.US), s);
                     }
                 }
                 continue;
@@ -795,7 +706,7 @@
             if (i == -1) { // <crypto_service>.<algorithm_or_type>=<className>
                 serviceName = key.substring(0, j);
                 algorithm = key.substring(j + 1);
-                String alg = Util.toUpperCase(algorithm);
+                String alg = algorithm.toUpperCase(Locale.US);
                 Object o = null;
                 if (propertyServiceTable != null) {
                     o = propertyServiceTable.get(serviceName, alg);
@@ -804,11 +715,9 @@
                     s = (Provider.Service) o;
                     s.className = value;
                 } else {
-                    // BEGIN android-changed
                     s = new Provider.Service(this, serviceName, algorithm,
                             value, Collections.<String>emptyList(),
                             Collections.<String,String>emptyMap());
-                    // END android-changed
                     if (propertyServiceTable == null) {
                         propertyServiceTable = new TwoKeyHashMap<String, String, Service>(128);
                     }
@@ -821,16 +730,14 @@
                 serviceName = key.substring(0, j);
                 algorithm = key.substring(j + 1, i);
                 String attribute = key.substring(i + 1);
-                String alg = Util.toUpperCase(algorithm);
+                String alg = algorithm.toUpperCase(Locale.US);
                 Object o = null;
                 if (propertyServiceTable != null) {
                     o = propertyServiceTable.get(serviceName, alg);
                 }
                 if (o != null) {
                     s = (Provider.Service) o;
-                    // BEGIN android-changed
                     s.putAttribute(attribute, value);
-                    // END android-changed
                 } else {
                     String className = (String) changedProperties
                             .get(serviceName + "." + algorithm);
@@ -848,9 +755,7 @@
             }
         }
         servicesChanged();
-        // BEGIN android-changed
         changedProperties = null;
-        // END android-changed
     }
 
     private void servicesChanged() {
@@ -864,7 +769,6 @@
      * Provider.id name, Provider.id version, Provider.id info,
      * Provider.id className
      */
-    @SuppressWarnings("nls")
     private void putProviderInfo() {
         super.put("Provider.id name", (name != null) ? name : "null");
         super.put("Provider.id version", versionString);
@@ -873,21 +777,18 @@
     }
 
     /**
-     * Searches for the property with the specified key in the
-     * provider properties. Key is not case-sensitive.
-     *
-     * @param prop
-     * @return the property value with the specified key value.
+     * Returns the property with the specified key in the provider properties.
+     * The name is not case-sensitive.
      */
     private String getPropertyIgnoreCase(String key) {
         String res = getProperty(key);
         if (res != null) {
             return res;
         }
-        for (Enumeration<?> e = propertyNames(); e.hasMoreElements();) {
-            String pname = (String) e.nextElement();
-            if (Util.equalsIgnoreCase(key, pname)) {
-                return getProperty(pname);
+        for (Enumeration<?> e = propertyNames(); e.hasMoreElements(); ) {
+            String propertyName = (String) e.nextElement();
+            if (key.equalsIgnoreCase(propertyName)) {
+                return getProperty(propertyName);
             }
         }
         return null;
@@ -956,16 +857,13 @@
             this.type = type;
             this.algorithm = algorithm;
             this.className = className;
-            // BEGIN android-changed
             this.aliases = ((aliases != null) && (aliases.size() == 0))
                     ? Collections.<String>emptyList() : aliases;
             this.attributes =
                     ((attributes != null) && (attributes.size() == 0))
                     ? Collections.<String,String>emptyMap() : attributes;
-            // END android-changed
         }
 
-        // BEGIN android-added
         /**
          * Adds an alias.
          *
@@ -990,7 +888,6 @@
             }
             attributes.put(name, value);
         }
-        // END android-added
 
         /**
          * Returns the type of this {@code Service}. For example {@code
@@ -1074,31 +971,17 @@
          *             if the implementation does not support the specified
          *             {@code constructorParameter}.
          */
-        public Object newInstance(Object constructorParameter)
-                throws NoSuchAlgorithmException {
+        public Object newInstance(Object constructorParameter) throws NoSuchAlgorithmException {
             if (implementation == null || !className.equals(lastClassName)) {
-                NoSuchAlgorithmException result = AccessController
-                        .doPrivileged(new PrivilegedAction<NoSuchAlgorithmException>() {
-                            public NoSuchAlgorithmException run() {
-                                ClassLoader cl = provider.getClass()
-                                        .getClassLoader();
-                                if (cl == null) {
-                                    cl = ClassLoader.getSystemClassLoader();
-                                }
-                                try {
-                                    implementation = Class.forName(className,
-                                            true, cl);
-                                } catch (Exception e) {
-                                    return new NoSuchAlgorithmException(
-                                            type + " " + algorithm
-                                            + " implementation not found: " + e);
-                                }
-                                lastClassName = className;
-                                return null;
-                            }
-                        });
-                if (result != null) {
-                    throw result;
+                ClassLoader cl = provider.getClass().getClassLoader();
+                if (cl == null) {
+                    cl = ClassLoader.getSystemClassLoader();
+                }
+                try {
+                    implementation = Class.forName(className, true, cl);
+                    lastClassName = className;
+                } catch (Exception e) {
+                    throw new NoSuchAlgorithmException(type + " " + algorithm + " implementation not found: " + e);
                 }
             }
             if (constructorParameter == null) {
@@ -1116,9 +999,8 @@
             Class[] parameterTypes = new Class[1];
             Object[] initargs = { constructorParameter };
             try {
-                if (Util.equalsIgnoreCase(type,"CertStore")) {
-                    parameterTypes[0] = Class
-                            .forName("java.security.cert.CertStoreParameters");
+                if (type.equalsIgnoreCase("CertStore")) {
+                    parameterTypes[0] = Class.forName("java.security.cert.CertStoreParameters");
                 } else {
                     parameterTypes[0] = constructorParameter.getClass();
                 }
diff --git a/luni/src/main/java/java/security/SecureClassLoader.java b/luni/src/main/java/java/security/SecureClassLoader.java
index bca7207..c39a430 100644
--- a/luni/src/main/java/java/security/SecureClassLoader.java
+++ b/luni/src/main/java/java/security/SecureClassLoader.java
@@ -33,32 +33,16 @@
     /**
      * Constructs a new instance of {@code SecureClassLoader}. The default
      * parent {@code ClassLoader} is used.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this constructor
-     * needs the {@code SecurityPermission} {@code checkCreateClassLoader} to be
-     * granted, otherwise a {@code SecurityException} will be thrown.
-     *
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this constructor.
      */
     protected SecureClassLoader() {
-        super();
     }
 
     /**
      * Constructs a new instance of {@code SecureClassLoader} with the specified
      * parent {@code ClassLoader}.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this constructor
-     * needs the {@code SecurityPermission} {@code checkCreateClassLoader} to be
-     * granted, otherwise a {@code SecurityException} will be thrown.
      *
      * @param parent
      *            the parent {@code ClassLoader}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this constructor.
      */
     protected SecureClassLoader(ClassLoader parent) {
         super(parent);
diff --git a/luni/src/main/java/java/security/SecureRandom.java b/luni/src/main/java/java/security/SecureRandom.java
index a541422..eb320ac 100644
--- a/luni/src/main/java/java/security/SecureRandom.java
+++ b/luni/src/main/java/java/security/SecureRandom.java
@@ -19,8 +19,8 @@
 
 import java.nio.ByteOrder;
 import java.util.Random;
+import libcore.io.Memory;
 import libcore.io.SizeOf;
-import org.apache.harmony.luni.platform.OSMemory;
 import org.apache.harmony.security.fortress.Engine;
 import org.apache.harmony.security.fortress.Services;
 import org.apache.harmony.security.provider.crypto.SHA1PRNG_SecureRandomImpl;
@@ -56,9 +56,8 @@
  * seed will cause the instance to return a predictable sequence of numbers.
  * This may be useful for testing but it is not appropriate for secure use.
  *
- * <p>Although it is common practice to seed {@link Random} with the current
- * time, that is dangerous with {@code SecureRandom} since that value is
- * predictable to an attacker and not appropriate for secure use.
+ * <p>It is dangerous to seed {@code SecureRandom} with the current time because
+ * that value is more predictable to an attacker than the default seed.
  *
  * <p>Calling {@link #setSeed} on a {@code SecureRandom} <i>after</i> it has
  * been used to generate random numbers (ie. calling {@link #nextBytes}) will
@@ -259,7 +258,7 @@
             return;
         }
         byte[] byteSeed = new byte[SizeOf.LONG];
-        OSMemory.pokeLong(byteSeed, 0, seed, ByteOrder.BIG_ENDIAN);
+        Memory.pokeLong(byteSeed, 0, seed, ByteOrder.BIG_ENDIAN);
         setSeed(byteSeed);
     }
 
diff --git a/luni/src/main/java/java/security/Security.java b/luni/src/main/java/java/security/Security.java
index 65b5a3e..a4cc6e1 100644
--- a/luni/src/main/java/java/security/Security.java
+++ b/luni/src/main/java/java/security/Security.java
@@ -29,9 +29,6 @@
 import java.util.Map.Entry;
 import java.util.Properties;
 import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-import org.apache.harmony.security.Util;
 import org.apache.harmony.security.fortress.Engine;
 import org.apache.harmony.security.fortress.SecurityAccess;
 import org.apache.harmony.security.fortress.Services;
@@ -51,70 +48,20 @@
     // - load statically registered providers
     // - if no provider description file found then load default providers
     static {
-        AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
-            public Void run() {
-                boolean loaded = false;
-
-                // BEGIN android-added
-                /*
-                 * Android only uses a local "security.properties" resource
-                 * for configuration. TODO: Reevaluate this decision.
-                 */
-                try {
-                    InputStream configStream =
-                        getClass().getResourceAsStream("security.properties");
-                    InputStream input = new BufferedInputStream(configStream);
-                    secprops.load(input);
-                    loaded = true;
-                    configStream.close();
-                } catch (Exception ex) {
-                    Logger.global.log(Level.SEVERE,
-                            "Could not load Security properties.", ex);
-                }
-                // END android-added
-
-                // BEGIN android-removed
-//                if (Util.equalsIgnoreCase("true", secprops.getProperty("security.allowCustomPropertiesFile", "true"))) {
-//                    String securityFile = System.getProperty("java.security.properties");
-//                    if (securityFile != null) {
-//                        if (securityFile.startsWith("=")) { // overwrite
-//                            secprops = new Properties();
-//                            loaded = false;
-//                            securityFile = securityFile.substring(1);
-//                        }
-//                        try {
-//                            securityFile = PolicyUtils.expand(securityFile, System.getProperties());
-//                        } catch (PolicyUtils.ExpansionFailedException e) {
-////                            System.err.println("Could not load custom Security properties file "
-////                                    + securityFile +": " + e);
-//                        }
-//                        f = new File(securityFile);
-//                        InputStream is;
-//                        try {
-//                            if (f.exists()) {
-//                                FileInputStream fis = new FileInputStream(f);
-//                                is = new BufferedInputStream(fis);
-//                            } else {
-//                                URL url = new URL(securityFile);
-//                                is = new BufferedInputStream(url.openStream());
-//                            }
-//                            secprops.load(is);
-//                            loaded = true;
-//                            is.close();
-//                        } catch (IOException e) {
-// //                           System.err.println("Could not load custom Security properties file "
-// //                                   + securityFile +": " + e);
-//                        }
-//                    }
-//                }
-                // END android-removed
-                if (!loaded) {
-                    registerDefaultProviders();
-                }
-                Engine.door = new SecurityDoor();
-                return null;
-            }
-        });
+        boolean loaded = false;
+        try {
+            InputStream configStream = Security.class.getResourceAsStream("security.properties");
+            InputStream input = new BufferedInputStream(configStream);
+            secprops.load(input);
+            loaded = true;
+            configStream.close();
+        } catch (Exception ex) {
+            System.logE("Could not load 'security.properties'", ex);
+        }
+        if (!loaded) {
+            registerDefaultProviders();
+        }
+        Engine.door = new SecurityDoor();
     }
 
     /**
@@ -148,16 +95,13 @@
         if (algName == null || propName == null) {
             return null;
         }
-        // BEGIN android-changed
         String prop = "Alg." + propName + "." + algName;
-        // END android-changed
         Provider[] providers = getProviders();
-        for (int i = 0; i < providers.length; i++) {
-            for (Enumeration e = providers[i].propertyNames(); e
-                    .hasMoreElements();) {
-                String pname = (String) e.nextElement();
-                if (Util.equalsIgnoreCase(prop, pname)) {
-                    return providers[i].getProperty(pname);
+        for (Provider provider : providers) {
+            for (Enumeration e = provider.propertyNames(); e.hasMoreElements(); ) {
+                String propertyName = (String) e.nextElement();
+                if (propertyName.equalsIgnoreCase(prop)) {
+                    return provider.getProperty(propertyName);
                 }
             }
         }
@@ -168,11 +112,6 @@
      * Insert the given {@code Provider} at the specified {@code position}. The
      * positions define the preference order in which providers are searched for
      * requested algorithms.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code insertProvider.NAME} (where NAME is
-     * the provider name) to be granted, otherwise a {@code SecurityException}
-     * will be thrown.
      *
      * @param provider
      *            the provider to insert.
@@ -181,20 +120,12 @@
      * @return the actual position or {@code -1} if the given {@code provider}
      *         was already in the list. The actual position may be different
      *         from the desired position.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
-    public static synchronized int insertProviderAt(Provider provider,
-            int position) {
-        // check security access; check that provider is not already
+    public static synchronized int insertProviderAt(Provider provider, int position) {
+        // check that provider is not already
         // installed, else return -1; if (position <1) or (position > max
         // position) position = max position + 1; insert provider, shift up
         // one position for next providers; Note: The position is 1-based
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("insertProvider." + provider.getName());
-        }
         if (getProvider(provider.getName()) != null) {
             return -1;
         }
@@ -206,19 +137,11 @@
     /**
      * Adds the given {@code provider} to the collection of providers at the
      * next available position.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code insertProvider.NAME} (where NAME is
-     * the provider name) to be granted, otherwise a {@code SecurityException}
-     * will be thrown.
      *
      * @param provider
      *            the provider to be added.
      * @return the actual position or {@code -1} if the given {@code provider}
      *         was already in the list.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public static int addProvider(Provider provider) {
         return insertProviderAt(provider, 0);
@@ -229,20 +152,12 @@
      * of providers. If the the {@code Provider} with the specified name is
      * removed, all provider at a greater position are shifted down one
      * position.
-     * <p>
-     * Returns silently if {@code name} is {@code null} or no provider with the
+     *
+     * <p>Returns silently if {@code name} is {@code null} or no provider with the
      * specified name is installed.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code removeProvider.NAME} (where NAME is
-     * the provider name) to be granted, otherwise a {@code SecurityException}
-     * will be thrown.
      *
      * @param name
      *            the name of the provider to remove.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public static synchronized void removeProvider(String name) {
         // It is not clear from spec.:
@@ -259,10 +174,6 @@
         if (p == null) {
             return;
         }
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("removeProvider." + name);
-        }
         Services.removeProvider(p.getProviderNumber());
         renumProviders();
         p.setProviderNumber(-1);
@@ -418,27 +329,15 @@
 
     /**
      * Returns the value of the security property named by the argument.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code getProperty.KEY} (where KEY is the
-     * specified {@code key}) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
      *
      * @param key
      *            the name of the requested security property.
      * @return the value of the security property.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
     public static String getProperty(String key) {
         if (key == null) {
             throw new NullPointerException("key == null");
         }
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("getProperty." + key);
-        }
         String property = secprops.getProperty(key);
         if (property != null) {
             property = property.trim();
@@ -448,26 +347,9 @@
 
     /**
      * Sets the value of the specified security property.
-     * <p>
-     * If a {@code SecurityManager} is installed, code calling this method needs
-     * the {@code SecurityPermission} {@code setProperty.KEY} (where KEY is the
-     * specified {@code key}) to be granted, otherwise a {@code
-     * SecurityException} will be thrown.
-     *
-     * @param key
-     *            the name of the security property.
-     * @param datnum
-     *            the value of the security property.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
-    public static void setProperty(String key, String datnum) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("setProperty." + key);
-        }
-        secprops.put(key, datnum);
+    public static void setProperty(String key, String value) {
+        secprops.put(key, value);
     }
 
     /**
@@ -484,18 +366,14 @@
      */
     public static Set<String> getAlgorithms(String serviceName) {
         Set<String> result = new HashSet<String>();
-        // BEGIN android-added
         // compatibility with RI
         if (serviceName == null) {
             return result;
         }
-        // END android-added
-        Provider[] p = getProviders();
-        for (int i = 0; i < p.length; i++) {
-            for (Iterator it = p[i].getServices().iterator(); it.hasNext();) {
-                Provider.Service s = (Provider.Service) it.next();
-                if (Util.equalsIgnoreCase(s.getType(),serviceName)) {
-                    result.add(s.getAlgorithm());
+        for (Provider provider : getProviders()) {
+            for (Provider.Service service: provider.getServices()) {
+                if (service.getType().equalsIgnoreCase(serviceName)) {
+                    result.add(service.getAlgorithm());
                 }
             }
         }
diff --git a/luni/src/main/java/java/security/Signer.java b/luni/src/main/java/java/security/Signer.java
index 58f8c04..1e4412a 100644
--- a/luni/src/main/java/java/security/Signer.java
+++ b/luni/src/main/java/java/security/Signer.java
@@ -36,7 +36,6 @@
      * Constructs a new instance of {@code Signer}.
      */
     protected Signer() {
-        super();
     }
 
     /**
@@ -61,36 +60,19 @@
      *             if a signer with the specified name already exists in the
      *             provided scope.
      */
-    public Signer(String name, IdentityScope scope)
-            throws KeyManagementException {
+    public Signer(String name, IdentityScope scope) throws KeyManagementException {
         super(name, scope);
     }
 
     /**
-     * Returns the private key of this {@code Signer}. If a {@code
-     * SecurityManager} is installed, code calling this method needs the {@code
-     * SecurityPermission} {@code "getSignerPrivateKey"} to be granted, otherwise
-     * a {@code SecurityException} will be thrown.
-     *
-     * @return the private key of this {@code Signer}.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
+     * Returns the private key of this {@code Signer}.
      */
     public PrivateKey getPrivateKey() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("getSignerPrivateKey");
-        }
-
         return privateKey;
     }
 
     /**
-     * Associates the specified key pair with this {@code Signer}. If a {@code
-     * SecurityManager} is installed, code calling this method needs the {@code
-     * SecurityPermission} {@code getSignerPrivateKey} to be granted, otherwise
-     * a {@code SecurityException} will be thrown.
+     * Associates the specified key pair with this {@code Signer}.
      *
      * @param pair
      *            the key pair to associate with this {@code Signer}.
@@ -98,35 +80,16 @@
      *             if the key pair is invalid.
      * @throws KeyException
      *             if any other key related problem occurs.
-     * @throws SecurityException
-     *             if a {@code SecurityManager} is installed and the caller does
-     *             not have permission to invoke this method.
      */
-    public final void setKeyPair(KeyPair pair)
-            throws InvalidParameterException, KeyException {
-
+    public final void setKeyPair(KeyPair pair) throws InvalidParameterException, KeyException {
         if (pair == null) {
             throw new NullPointerException();
         }
 
-        if ((pair.getPrivate() == null) || (pair.getPublic() == null)) {
+        if (pair.getPrivate() == null || pair.getPublic() == null) {
             throw new InvalidParameterException();
         }
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkSecurityAccess("setSignerKeyPair");
-        }
-        final PublicKey pk = pair.getPublic();
-        try {
-            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
-                public Void run() throws KeyManagementException {
-                    setPublicKey(pk);
-                    return null;
-                }
-            });
-        } catch (PrivilegedActionException e) {
-            throw new KeyException(e.getException());
-        }
+        setPublicKey(pair.getPublic());
         this.privateKey = pair.getPrivate();
     }
 
diff --git a/luni/src/main/java/java/security/UnresolvedPermissionCollection.java b/luni/src/main/java/java/security/UnresolvedPermissionCollection.java
index de7175c..4a9dc19 100644
--- a/luni/src/main/java/java/security/UnresolvedPermissionCollection.java
+++ b/luni/src/main/java/java/security/UnresolvedPermissionCollection.java
@@ -43,7 +43,8 @@
     private static final long serialVersionUID = -7176153071733132400L;
 
     private static final ObjectStreamField[] serialPersistentFields = {
-        new ObjectStreamField("permissions", Hashtable.class), };
+        new ObjectStreamField("permissions", Hashtable.class),
+    };
 
     // elements of the collection.
     private transient Map klasses = new HashMap();
diff --git a/luni/src/main/java/java/security/cert/CertPath.java b/luni/src/main/java/java/security/cert/CertPath.java
index dda778f..d247d30 100644
--- a/luni/src/main/java/java/security/cert/CertPath.java
+++ b/luni/src/main/java/java/security/cert/CertPath.java
@@ -116,15 +116,12 @@
         sb.append(getCertificates().size());
         sb.append(": [\n");
         int n=1;
-        // BEGIN android-changed
-        for (Iterator<? extends Certificate> i=getCertificates().iterator();
-                      i.hasNext(); n++) {
+        for (Iterator<? extends Certificate> i=getCertificates().iterator(); i.hasNext(); n++) {
             sb.append("---------------certificate ");
             sb.append(n);
             sb.append("---------------\n");
             sb.append(((Certificate)i.next()).toString());
         }
-        // END android-changed
         sb.append("\n]");
         return sb.toString();
     }
@@ -197,8 +194,8 @@
         // Force default serialization to use writeUnshared/readUnshared
         // for cert path data
         private static final ObjectStreamField[] serialPersistentFields = {
-             new ObjectStreamField("type", String.class),
-             new ObjectStreamField("data", byte[].class, true)
+            new ObjectStreamField("type", String.class),
+            new ObjectStreamField("data", byte[].class, true),
         };
 
         /**
diff --git a/luni/src/main/java/java/security/cert/CertPathBuilder.java b/luni/src/main/java/java/security/cert/CertPathBuilder.java
index c2164db..aa65fe7 100644
--- a/luni/src/main/java/java/security/cert/CertPathBuilder.java
+++ b/luni/src/main/java/java/security/cert/CertPathBuilder.java
@@ -17,7 +17,6 @@
 
 package java.security.cert;
 
-import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
@@ -193,12 +192,7 @@
      *         determined.
      */
     public static final String getDefaultType() {
-        String defaultType = AccessController
-                .doPrivileged(new java.security.PrivilegedAction<String>() {
-                    public String run() {
-                        return Security.getProperty(PROPERTYNAME);
-                    }
-                });
+        String defaultType = Security.getProperty(PROPERTYNAME);
         return (defaultType != null ? defaultType : DEFAULTPROPERTY);
     }
 }
diff --git a/luni/src/main/java/java/security/cert/CertPathValidator.java b/luni/src/main/java/java/security/cert/CertPathValidator.java
index 49d2408..69b9f99 100644
--- a/luni/src/main/java/java/security/cert/CertPathValidator.java
+++ b/luni/src/main/java/java/security/cert/CertPathValidator.java
@@ -17,7 +17,6 @@
 
 package java.security.cert;
 
-import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
@@ -200,12 +199,7 @@
      *         determined.
      */
     public static final String getDefaultType() {
-        String defaultType = AccessController
-                .doPrivileged(new java.security.PrivilegedAction<String>() {
-                    public String run() {
-                        return Security.getProperty(PROPERTYNAME);
-                    }
-                });
+        String defaultType = Security.getProperty(PROPERTYNAME);
         return (defaultType != null ? defaultType : DEFAULTPROPERTY);
     }
 }
diff --git a/luni/src/main/java/java/security/cert/CertStore.java b/luni/src/main/java/java/security/cert/CertStore.java
index a8cbfee..6cdaea7 100644
--- a/luni/src/main/java/java/security/cert/CertStore.java
+++ b/luni/src/main/java/java/security/cert/CertStore.java
@@ -17,7 +17,6 @@
 
 package java.security.cert;
 
-import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
@@ -267,12 +266,7 @@
      *         determined.
      */
     public static final String getDefaultType() {
-        String defaultType = AccessController
-                .doPrivileged(new java.security.PrivilegedAction<String>() {
-                    public String run() {
-                        return Security.getProperty(PROPERTYNAME);
-                    }
-                });
+        String defaultType = Security.getProperty(PROPERTYNAME);
         return (defaultType == null ? DEFAULTPROPERTY : defaultType);
     }
 }
diff --git a/luni/src/main/java/java/security/cert/PKIXCertPathChecker.java b/luni/src/main/java/java/security/cert/PKIXCertPathChecker.java
index 0991cd5..869efb5 100644
--- a/luni/src/main/java/java/security/cert/PKIXCertPathChecker.java
+++ b/luni/src/main/java/java/security/cert/PKIXCertPathChecker.java
@@ -55,7 +55,7 @@
         try {
             return super.clone();
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java b/luni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java
index e3bdca6..99f26a2 100644
--- a/luni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java
+++ b/luni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java
@@ -96,7 +96,7 @@
         try {
             return super.clone();
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/security/cert/PKIXParameters.java b/luni/src/main/java/java/security/cert/PKIXParameters.java
index 2e9d4a2..7ca9443 100644
--- a/luni/src/main/java/java/security/cert/PKIXParameters.java
+++ b/luni/src/main/java/java/security/cert/PKIXParameters.java
@@ -534,7 +534,7 @@
             }
             return ret;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/security/cert/X509CertSelector.java b/luni/src/main/java/java/security/cert/X509CertSelector.java
index 5b36cb4..2981f63 100644
--- a/luni/src/main/java/java/security/cert/X509CertSelector.java
+++ b/luni/src/main/java/java/security/cert/X509CertSelector.java
@@ -26,12 +26,12 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import javax.security.auth.x500.X500Principal;
 import libcore.util.EmptyArray;
 import org.apache.harmony.security.asn1.ASN1OctetString;
+import org.apache.harmony.security.utils.Array;
 import org.apache.harmony.security.x509.AlgorithmIdentifier;
 import org.apache.harmony.security.x509.CertificatePolicies;
 import org.apache.harmony.security.x509.GeneralName;
@@ -61,13 +61,13 @@
     private Date privateKeyValid;
     private byte[] subjectPublicKey;
     private boolean[] keyUsage;
-    private Set extendedKeyUsage;
+    private Set<String> extendedKeyUsage;
     private boolean matchAllNames = true;
     private int pathLen = -1;
-    private List[] subjectAltNames;
+    private List<GeneralName>[] subjectAltNames;
     private NameConstraints nameConstraints;
     private Set<String> policies;
-    private ArrayList pathToNames;
+    private ArrayList<GeneralName> pathToNames;
 
     // needed to avoid needless encoding/decoding work
     private PublicKey subjectPublicKeyImpl;
@@ -593,10 +593,8 @@
         if ((keyUsage == null) || (keyUsage.size() == 0)) {
             return;
         }
-        HashSet key_u = new HashSet();
-        Iterator it = keyUsage.iterator();
-        while (it.hasNext()) {
-            String usage = (String) it.next();
+        HashSet<String> key_u = new HashSet<String>();
+        for (String usage : keyUsage) {
             checkOID(usage);
             key_u.add(usage);
         }
@@ -660,16 +658,13 @@
      * @throws IOException
      *             if the decoding of a name fails.
      */
-    public void setSubjectAlternativeNames(Collection<List<?>> names)
-                                    throws IOException {
+    public void setSubjectAlternativeNames(Collection<List<?>> names) throws IOException {
         subjectAltNames = null;
         if ((names == null) || (names.size() == 0)) {
             return;
         }
-        Iterator it = names.iterator();
-        while (it.hasNext()) {
-            List name = (List) it.next();
-            int tag = ((Integer) name.get(0)).intValue();
+        for (List<?> name : names) {
+            int tag = (Integer) name.get(0);
             Object value = name.get(1);
             if (value instanceof String) {
                 addSubjectAlternativeName(tag, (String) value);
@@ -699,7 +694,7 @@
             subjectAltNames = new ArrayList[9];
         }
         if (subjectAltNames[tag] == null) {
-            subjectAltNames[tag] = new ArrayList();
+            subjectAltNames[tag] = new ArrayList<GeneralName>();
         }
         subjectAltNames[tag].add(alt_name);
     }
@@ -722,7 +717,7 @@
             subjectAltNames = new ArrayList[9];
         }
         if (subjectAltNames[tag] == null) {
-            subjectAltNames[tag] = new ArrayList();
+            subjectAltNames[tag] = new ArrayList<GeneralName>();
         }
         subjectAltNames[tag].add(alt_name);
     }
@@ -745,19 +740,13 @@
         if (subjectAltNames == null) {
             return null;
         }
-        ArrayList result = new ArrayList();
+        ArrayList<List<?>> result = new ArrayList<List<?>>();
         for (int tag=0; tag<9; tag++) {
             if (subjectAltNames[tag] != null) {
                 for (int name=0; name<subjectAltNames[tag].size(); name++) {
-                    Object neim = subjectAltNames[tag].get(name);
-                    if (neim instanceof byte[]) {
-                        byte[] arr_neim = (byte[]) neim;
-                        neim = new byte[arr_neim.length];
-                        System.arraycopy(arr_neim, 0, neim, 0, arr_neim.length);
-                    }
-                    List list = new ArrayList(2);
-                    list.add(Integer.valueOf(tag)); // android-changed
-                    list.add(neim);
+                    List<Object> list = new ArrayList<Object>(2);
+                    list.add(tag);
+                    list.add(subjectAltNames[tag].get(name));
                     result.add(list);
                 }
             }
@@ -877,9 +866,7 @@
             return;
         }
         HashSet<String> pols = new HashSet<String>(policies.size());
-        Iterator<String> it = policies.iterator();
-        while (it.hasNext()) {
-            String certPolicyId = it.next();
+        for (String certPolicyId : policies) {
             checkOID(certPolicyId);
             pols.add(certPolicyId);
         }
@@ -901,6 +888,26 @@
     }
 
     /**
+     * Adds a {@literal "pathToName"} to the respective criterion.
+     *
+     * @param type
+     *            the type of the name.
+     * @param name
+     *            the name in string format.
+     * @throws IOException
+     *             if parsing fails.
+     * @see #setPathToNames
+     */
+    public void addPathToName(int type, String name) throws IOException {
+        GeneralName path_name = new GeneralName(type, name);
+        // create only if there was not any errors
+        if (pathToNames == null) {
+            pathToNames = new ArrayList<GeneralName>();
+        }
+        pathToNames.add(path_name);
+    }
+
+    /**
      * Sets the criterion for the pathToNames constraint.
      * <p>
      * This allows to specify the complete set of names, a certificate's name
@@ -923,10 +930,8 @@
         if ((names == null) || (names.size() == 0)) {
             return;
         }
-        Iterator it = names.iterator();
-        while (it.hasNext()) {
-            List name = (List) it.next();
-            int tag = ((Integer) name.get(0)).intValue();
+        for (List<?> name : names) {
+            int tag = (Integer) name.get(0);
             Object value = name.get(1);
             if (value instanceof String) {
                 addPathToName(tag, (String) value);
@@ -942,26 +947,6 @@
      * Adds a {@literal "pathToName"} to the respective criterion.
      *
      * @param type
-     *            the type of the name.
-     * @param name
-     *            the name in string format.
-     * @throws IOException
-     *             if parsing fails.
-     * @see #setPathToNames
-     */
-    public void addPathToName(int type, String name) throws IOException {
-        GeneralName path_name = new GeneralName(type, name);
-        // create only if there was not any errors
-        if (pathToNames == null) {
-            pathToNames = new ArrayList();
-        }
-        pathToNames.add(path_name);
-    }
-
-    /**
-     * Adds a {@literal "pathToName"} to the respective criterion.
-     *
-     * @param type
      *            the type of the name
      * @param name
      *            the name in ASN.1 DER encoded form.
@@ -973,7 +958,7 @@
         GeneralName path_name= new GeneralName(type, name);
         // create only if there was not any errors
         if (pathToNames == null) {
-            pathToNames = new ArrayList();
+            pathToNames = new ArrayList<GeneralName>();
         }
         pathToNames.add(path_name);
     }
@@ -992,10 +977,8 @@
         if (pathToNames == null) {
             return null;
         }
-        ArrayList result = new ArrayList();
-        Iterator it = pathToNames.iterator();
-        while (it.hasNext()) {
-            GeneralName name = (GeneralName) it.next();
+        Collection<List<?>> result = new ArrayList<List<?>>();
+        for (GeneralName name : pathToNames) {
             result.add(name.getAsList());
         }
         return result;
@@ -1016,39 +999,37 @@
         StringBuilder result = new StringBuilder();
         result.append("X509CertSelector: \n[");
         if (this.certificateEquals != null) {
-            result.append("\n  certificateEquals: " + certificateEquals);
+            result.append("\n  certificateEquals: ").append(certificateEquals);
         }
         if (this.serialNumber != null) {
-            //FIXME: needs DRL's BigInteger.toString implementation
-            //result.append("\n  serialNumber: " + serialNumber);
+            result.append("\n  serialNumber: ").append(serialNumber);
         }
         if (this.issuer != null) {
-            result.append("\n  issuer: " + issuer);
+            result.append("\n  issuer: ").append(issuer);
         }
         if (this.subject != null) {
-            result.append("\n  subject: " + subject);
+            result.append("\n  subject: ").append(subject);
         }
         if (this.subjectKeyIdentifier != null) {
-            result.append("\n  subjectKeyIdentifier: "
-                    + getBytesAsString(subjectKeyIdentifier));
+            result.append("\n  subjectKeyIdentifier: ")
+                    .append(Array.getBytesAsString(subjectKeyIdentifier));
         }
         if (this.authorityKeyIdentifier != null) {
-            result.append("\n  authorityKeyIdentifier: "
-                    + getBytesAsString(authorityKeyIdentifier));
+            result.append("\n  authorityKeyIdentifier: ")
+                    .append(Array.getBytesAsString(authorityKeyIdentifier));
         }
         if (this.certificateValid != null) {
-            result.append("\n  certificateValid: " + certificateValid);
+            result.append("\n  certificateValid: ").append(certificateValid);
         }
         if (this.subjectPublicKeyAlgID != null) {
-            result.append("\n  subjectPublicKeyAlgID: "
-                    + subjectPublicKeyAlgID);
+            result.append("\n  subjectPublicKeyAlgID: ").append(subjectPublicKeyAlgID);
         }
         if (this.privateKeyValid != null) {
-            result.append("\n  privateKeyValid: " + privateKeyValid);
+            result.append("\n  privateKeyValid: ").append(privateKeyValid);
         }
         if (this.subjectPublicKey != null) {
-            result.append("\n  subjectPublicKey: "
-                    + getBytesAsString(subjectPublicKey));
+            result.append("\n  subjectPublicKey: ")
+                    .append(Array.getBytesAsString(subjectPublicKey));
         }
         if (this.keyUsage != null) {
             result.append("\n  keyUsage: \n  [");
@@ -1059,26 +1040,24 @@
             };
             for (int i=0; i<9; i++) {
                 if (keyUsage[i]) {
-                    result.append("\n    " + kuNames[i]);
+                    result.append("\n    ").append(kuNames[i]);
                 }
             }
             result.append("\n  ]");
         }
         if (this.extendedKeyUsage != null) {
-            result.append("\n  extendedKeyUsage: "
-                    + extendedKeyUsage.toString());
+            result.append("\n  extendedKeyUsage: ").append(extendedKeyUsage.toString());
         }
-        result.append("\n  matchAllNames: " + matchAllNames);
-        result.append("\n  pathLen: " + pathLen);
+        result.append("\n  matchAllNames: ").append(matchAllNames);
+        result.append("\n  pathLen: ").append(pathLen);
         if (this.subjectAltNames != null) {
             result.append("\n  subjectAltNames:  \n  [");
             for (int i=0; i<9; i++) {
-                List names = this.subjectAltNames[i];
+                List<GeneralName> names = subjectAltNames[i];
                 if (names != null) {
                     int size = names.size();
-                    for (int j=0; j<size; j++) {
-                        result.append("\n    "
-                            + ((GeneralName)names.get(j)).toString());
+                    for (GeneralName generalName : names) {
+                        result.append("\n    ").append(generalName.toString());
                     }
                 }
             }
@@ -1087,32 +1066,18 @@
         if (this.nameConstraints != null) {
         }
         if (this.policies != null) {
-            result.append("\n  policies: " + policies.toString());
+            result.append("\n  policies: ").append(policies.toString());
         }
         if (this.pathToNames != null) {
             result.append("\n  pathToNames:  \n  [");
-            int size = pathToNames.size();
-            for (int i = 0; i < size; i++) {
-                result.append("\n    "
-                    + ((GeneralName)pathToNames.get(i)).toString());
+            for (GeneralName generalName : pathToNames) {
+                result.append("\n    ").append(generalName.toString());
             }
         }
         result.append("\n]");
         return result.toString();
     }
 
-    private String getBytesAsString(byte[] data) {
-        String result = "";
-        for (int i=0; i<data.length; i++) {
-            String tail = Integer.toHexString(0x00ff & data[i]);
-            if (tail.length() == 1) {
-                tail = "0" + tail;
-            }
-            result += tail + " ";
-        }
-        return result;
-    }
-
     private byte[] getExtensionValue(X509Certificate cert, String oid) {
         try {
             byte[] bytes = cert.getExtensionValue(oid);
@@ -1272,7 +1237,7 @@
                 if (bytes == null) {
                     return false;
                 }
-                List sans = ((GeneralNames) GeneralNames.ASN1.decode(bytes))
+                List<GeneralName> sans = ((GeneralNames) GeneralNames.ASN1.decode(bytes))
                             .getNames();
                 if ((sans == null) || (sans.size() == 0)) {
                     return false;
@@ -1283,13 +1248,10 @@
                     map[i] = (subjectAltNames[i] == null)
                             ? EmptyArray.BOOLEAN : new boolean[subjectAltNames[i].size()];
                 }
-                Iterator it = sans.iterator();
-                while (it.hasNext()) {
-                    GeneralName name = (GeneralName) it.next();
+                for (GeneralName name : sans) {
                     int tag = name.getTag();
-                    for (int i=0; i<map[tag].length; i++) {
-                        if (((GeneralName) subjectAltNames[tag].get(i))
-                                                            .equals(name)) {
+                    for (int i = 0; i < map[tag].length; i++) {
+                        if (subjectAltNames[tag].get(i).equals(name)) {
                             if (!matchAllNames) {
                                 break PASSED;
                             }
@@ -1331,13 +1293,11 @@
             }
             PASSED:
             try {
-                List policyInformations = ((CertificatePolicies)
-                        CertificatePolicies.ASN1.decode(bytes))
+                List<PolicyInformation> policyInformations
+                        = ((CertificatePolicies) CertificatePolicies.ASN1.decode(bytes))
                         .getPolicyInformations();
-                Iterator it = policyInformations.iterator();
-                while (it.hasNext()) {
-                    if (policies.contains(((PolicyInformation) it.next())
-                                          .getPolicyIdentifier())) {
+                for (PolicyInformation policyInformation : policyInformations) {
+                    if (policies.contains(policyInformation.getPolicyIdentifier())) {
                         break PASSED;
                     }
                 }
@@ -1406,20 +1366,20 @@
         }
         result.extendedKeyUsage = (this.extendedKeyUsage == null)
             ? null
-            : new HashSet(this.extendedKeyUsage);
+            : new HashSet<String>(this.extendedKeyUsage);
         if (this.subjectAltNames != null) {
             result.subjectAltNames = new ArrayList[9];
             for (int i=0; i<9; i++) {
                 if (this.subjectAltNames[i] != null) {
                     result.subjectAltNames[i] =
-                        new ArrayList(this.subjectAltNames[i]);
+                        new ArrayList<GeneralName>(this.subjectAltNames[i]);
                 }
             }
         }
         result.policies = (this.policies == null) ? null : new HashSet<String>(this.policies);
         result.pathToNames = (this.pathToNames == null)
             ? null
-            : new ArrayList(this.pathToNames);
+            : new ArrayList<GeneralName>(this.pathToNames);
         return result;
     }
 }
diff --git a/luni/src/main/java/java/security/package.html b/luni/src/main/java/java/security/package.html
index 4c5e2b4..b2e7e08 100644
--- a/luni/src/main/java/java/security/package.html
+++ b/luni/src/main/java/java/security/package.html
@@ -4,32 +4,9 @@
 </head>
 <html>
 <body>
-<p>This package provides all the classes and interfaces that
-constitute the Java security framework. The content of this package can
-be divided into two parts:
-
-<ul>
-	<li>Classes implementing the access control infrastructure.
-	<p>The central class is <i>java.security.AccessController</i>
-	which checks if code, invoking sensitive resources, was granted the required
-	permissions.
-	<p>The class loader (<i>java.security.SecureClassLoader</i>) associates classes
-	with a protection domain (<i>java.security.ProtectionDomain</i>) which consists of a
-	code source (<i>java.security.CodeSource</i>) and the granted permissions 
-	(<i>java.security.Permission</i>). The policy, defined through <i>java.security.Policy</i>, defines
-	which permissions are granted to classes loaded from a code source ( class
-	<i>java.security.CodeSource</i>).
-	<li>Classes and interfaces for the extensible cryptographic
-	<i>service provider infrastructure</i> (<b>SPI</b>) such as abstractions for certificates,
-	signatures, private and public keys. Also abstractions for the algorithms
-	they utilize are provided in this package.
-	<p>Security providers, as defined in <i>java.security.Providers</i>, can be 
-	registered to provide
-	different implementations for a variety of security infrastructure,
-	such as key stores. Therefore the corresponding
-	service provider interface (i.e. <i>java.security.KeyStoreSpi</i>) must be
-	implemented.
-</ul>
+<p>This package is for compatibility
+with legacy code only, and should not be used or expected to do
+anything useful.
 </p>
 </body>
 </html>
diff --git a/luni/src/main/java/java/sql/BatchUpdateException.java b/luni/src/main/java/java/sql/BatchUpdateException.java
index a068b66..352ab6a 100644
--- a/luni/src/main/java/java/sql/BatchUpdateException.java
+++ b/luni/src/main/java/java/sql/BatchUpdateException.java
@@ -50,7 +50,6 @@
      * null} and the <i>vendor code</i> set to 0.
      */
     public BatchUpdateException() {
-        super();
     }
 
     /**
@@ -139,7 +138,6 @@
      *            in the batch that was attempted.
      */
     public BatchUpdateException(int[] updateCounts) {
-        super();
         this.updateCounts = updateCounts;
     }
 
diff --git a/luni/src/main/java/java/sql/CallableStatement.java b/luni/src/main/java/java/sql/CallableStatement.java
index 665b75e..5bd9c52 100644
--- a/luni/src/main/java/java/sql/CallableStatement.java
+++ b/luni/src/main/java/java/sql/CallableStatement.java
@@ -289,10 +289,10 @@
     /**
      * Gets the value of the specified JDBC {@code DATE} parameter as a {@code
      * java.sql.Date}, using the specified {@code Calendar} to construct the date.
-     * <p>
-     * The JDBC driver uses the calendar to create the Date using a particular
-     * timezone and locale. The default behavior of the driver is to use the Java
-     * virtual machine default settings.
+     *
+     * <p>The JDBC driver uses the calendar to create the Date using a particular
+     * timezone and locale. The default behavior of the driver is to use the VM defaults.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param parameterIndex
      *            the parameter number index, where the first parameter has
@@ -324,10 +324,10 @@
     /**
      * Gets the value of the specified JDBC {@code DATE} parameter as a {@code
      * java.sql.Date}, using the specified {@code Calendar} to construct the date.
-     * <p>
-     * The JDBC driver uses the calendar to create the date using a particular
-     * timezone and locale. The default behavior of the driver is to use the Java
-     * virtual machine default settings.
+     *
+     * <p>The JDBC driver uses the calendar to create the date using a particular
+     * timezone and locale. The default behavior of the driver is to use the VM defaults.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param parameterName
      *            the name of the desired parameter.
@@ -1301,11 +1301,11 @@
     /**
      * Sets the value of the parameter named {@code parameterName} to the value
      * of the supplied {@code java.sql.Time} using the supplied calendar.
-     * <p>
-     * The driver uses the supplied {@code Calendar} to create the SQL
+     *
+     * <p>The driver uses the supplied {@code Calendar} to create the SQL
      * {@code TIME} value, which allows it to use a custom timezone -
-     * otherwise the driver uses the default timezone of the Java
-     * virtual machine.
+     * otherwise the driver uses the VM defaults.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param parameterName
      *            the parameter name.
@@ -1338,10 +1338,11 @@
     /**
      * Sets the value of a specified parameter to a supplied {@code
      * java.sql.Timestamp} value, using the supplied calendar.
-     * <p>
-     * The driver uses the supplied calendar to create the SQL {@code TIMESTAMP}
+     *
+     * <p>The driver uses the supplied calendar to create the SQL {@code TIMESTAMP}
      * value, which allows it to use a custom timezone - otherwise the driver
-     * uses the default timezone of the Java virtual machine.
+     * uses the VM defaults.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param parameterName
      *            the parameter name.
diff --git a/luni/src/main/java/java/sql/DriverManager.java b/luni/src/main/java/java/sql/DriverManager.java
index 77fe43f..4cee1fe 100644
--- a/luni/src/main/java/java/sql/DriverManager.java
+++ b/luni/src/main/java/java/sql/DriverManager.java
@@ -20,14 +20,12 @@
 import dalvik.system.VMStack;
 import java.io.PrintStream;
 import java.io.PrintWriter;
-import java.security.AccessController;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
-import java.util.Vector;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * Provides facilities for managing JDBC drivers.
@@ -70,9 +68,7 @@
      * it is defined.
      */
     private static void loadInitialDrivers() {
-        String theDriverList = AccessController
-                .doPrivileged(new PriviAction<String>("jdbc.drivers", null));
-
+        String theDriverList = System.getProperty("jdbc.drivers", null);
         if (theDriverList == null) {
             return;
         }
@@ -99,7 +95,6 @@
      * A private constructor to prevent allocation
      */
     private DriverManager() {
-        super();
     }
 
     /**
@@ -225,23 +220,17 @@
      *             if there is any kind of problem accessing the database.
      */
     public static Driver getDriver(String url) throws SQLException {
-        // BEGIN android-changed
         ClassLoader callerClassLoader = VMStack.getCallingClassLoader();
-        // END android-changed
-
         synchronized (theDrivers) {
             /*
              * Loop over the drivers in the DriverSet checking to see if one
              * does understand the supplied URL - return the first driver which
              * does understand the URL
              */
-            Iterator<Driver> theIterator = theDrivers.iterator();
-            while (theIterator.hasNext()) {
-                Driver theDriver = theIterator.next();
-                if (theDriver.acceptsURL(url)
-                        && DriverManager.isClassFromClassLoader(theDriver,
-                                callerClassLoader)) {
-                    return theDriver;
+            for (Driver driver : theDrivers) {
+                if (driver.acceptsURL(url) &&
+                        DriverManager.isClassFromClassLoader(driver, callerClassLoader)) {
+                    return driver;
                 }
             }
         }
@@ -259,28 +248,19 @@
      *         {@code Drivers}.
      */
     public static Enumeration<Driver> getDrivers() {
-        // BEGIN android-changed
-        ClassLoader callerClassLoader = VMStack.getCallingClassLoader();
-        // END android-changed
         /*
          * Synchronize to avoid clashes with additions and removals of drivers
          * in the DriverSet
          */
+        ClassLoader callerClassLoader = VMStack.getCallingClassLoader();
         synchronized (theDrivers) {
-            /*
-             * Create the Enumeration by building a Vector from the elements of
-             * the DriverSet
-             */
-            Vector<Driver> theVector = new Vector<Driver>();
-            Iterator<Driver> theIterator = theDrivers.iterator();
-            while (theIterator.hasNext()) {
-                Driver theDriver = theIterator.next();
-                if (DriverManager.isClassFromClassLoader(theDriver,
-                        callerClassLoader)) {
-                    theVector.add(theDriver);
+            ArrayList<Driver> result = new ArrayList<Driver>();
+            for (Driver driver : theDrivers) {
+                if (DriverManager.isClassFromClassLoader(driver, callerClassLoader)) {
+                    result.add(driver);
                 }
             }
-            return theVector.elements();
+            return Collections.enumeration(result);
         }
     }
 
@@ -334,7 +314,6 @@
          * If neither the PrintWriter not the PrintStream are set, then silently
          * do nothing the message is not recorded and no exception is generated.
          */
-        return;
     }
 
     /**
@@ -365,7 +344,6 @@
      */
     public static void setLoginTimeout(int seconds) {
         loginTimeout = seconds;
-        return;
     }
 
     /**
@@ -378,7 +356,6 @@
      */
     @Deprecated
     public static void setLogStream(PrintStream out) {
-        checkLogSecurity();
         thePrintStream = out;
     }
 
@@ -390,22 +367,9 @@
      *            the {@code PrintWriter} to be used.
      */
     public static void setLogWriter(PrintWriter out) {
-        checkLogSecurity();
         thePrintWriter = out;
     }
 
-    /*
-     * Method which checks to see if setting a logging stream is allowed by the
-     * Security manager
-     */
-    private static void checkLogSecurity() {
-        SecurityManager securityManager = System.getSecurityManager();
-        if (securityManager != null) {
-            // Throws a SecurityException if setting the log is not permitted
-            securityManager.checkPermission(logPermission);
-        }
-    }
-
     /**
      * Determines whether the supplied object was loaded by the given {@code ClassLoader}.
      *
diff --git a/luni/src/main/java/java/sql/PreparedStatement.java b/luni/src/main/java/java/sql/PreparedStatement.java
index aabbd0c..01f375d 100644
--- a/luni/src/main/java/java/sql/PreparedStatement.java
+++ b/luni/src/main/java/java/sql/PreparedStatement.java
@@ -322,8 +322,8 @@
      * java.sql.Date} value, using a supplied {@code Calendar} to map the Date.
      * The {@code Calendar} allows the application to control the timezone used
      * to compute the SQL {@code DATE} in the database - without the supplied
-     * {@code Calendar}, the driver uses the default timezone of the Java
-     * virtual machine.
+     * {@code Calendar}, the driver uses the VM defaults.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param parameterIndex
      *            the parameter number index, where the first parameter has
@@ -592,7 +592,8 @@
      * <p>
      * The driver uses the supplied {@code Calendar} to create the SQL {@code
      * TIME} value, which allows it to use a custom timezone - otherwise the
-     * driver uses the default timezone of the Java virtual machine.
+     * driver uses the VM defaults.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param parameterIndex
      *            the parameter number index, where the first parameter has
@@ -633,7 +634,8 @@
      * <p>
      * The driver uses the supplied {@code Calendar} to create the SQL {@code
      * TIMESTAMP} value, which allows it to use a custom timezone - otherwise
-     * the driver uses the default timezone of the Java virtual machine.
+     * the driver uses the VM defaults.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      *
      * @param parameterIndex
      *            the parameter number index, where the first parameter has
diff --git a/luni/src/main/java/java/sql/SQLDataException.java b/luni/src/main/java/java/sql/SQLDataException.java
index fe329b8..eafab25 100644
--- a/luni/src/main/java/java/sql/SQLDataException.java
+++ b/luni/src/main/java/java/sql/SQLDataException.java
@@ -31,7 +31,6 @@
      * SQLState string is set to null and the Error Code is set to 0.
      */
     public SQLDataException() {
-        super();
     }
 
     /**
@@ -142,4 +141,4 @@
             Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLException.java b/luni/src/main/java/java/sql/SQLException.java
index cc96cc5..2b650da 100644
--- a/luni/src/main/java/java/sql/SQLException.java
+++ b/luni/src/main/java/java/sql/SQLException.java
@@ -53,7 +53,6 @@
      * error code is set to 0.
      */
     public SQLException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/sql/SQLFeatureNotSupportedException.java b/luni/src/main/java/java/sql/SQLFeatureNotSupportedException.java
index 2f8145e..e5f4fe4 100644
--- a/luni/src/main/java/java/sql/SQLFeatureNotSupportedException.java
+++ b/luni/src/main/java/java/sql/SQLFeatureNotSupportedException.java
@@ -31,7 +31,6 @@
      * to 0.
      */
     public SQLFeatureNotSupportedException() {
-        super();
     }
 
     /**
@@ -145,4 +144,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLIntegrityConstraintViolationException.java b/luni/src/main/java/java/sql/SQLIntegrityConstraintViolationException.java
index 7fd3e0f..3ebdcb5 100644
--- a/luni/src/main/java/java/sql/SQLIntegrityConstraintViolationException.java
+++ b/luni/src/main/java/java/sql/SQLIntegrityConstraintViolationException.java
@@ -33,7 +33,6 @@
      * Code is set to 0.
      */
     public SQLIntegrityConstraintViolationException() {
-        super();
     }
 
     /**
@@ -151,4 +150,4 @@
             String sqlState, int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLInvalidAuthorizationSpecException.java b/luni/src/main/java/java/sql/SQLInvalidAuthorizationSpecException.java
index 43899b1..4de4a9d 100644
--- a/luni/src/main/java/java/sql/SQLInvalidAuthorizationSpecException.java
+++ b/luni/src/main/java/java/sql/SQLInvalidAuthorizationSpecException.java
@@ -33,7 +33,6 @@
      * set to 0.
      */
     public SQLInvalidAuthorizationSpecException() {
-        super();
     }
 
     /**
@@ -149,4 +148,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLNonTransientConnectionException.java b/luni/src/main/java/java/sql/SQLNonTransientConnectionException.java
index efdbd4a..0797065 100644
--- a/luni/src/main/java/java/sql/SQLNonTransientConnectionException.java
+++ b/luni/src/main/java/java/sql/SQLNonTransientConnectionException.java
@@ -33,7 +33,6 @@
      * set to 0.
      */
     public SQLNonTransientConnectionException() {
-        super();
     }
 
     /**
@@ -149,4 +148,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLNonTransientException.java b/luni/src/main/java/java/sql/SQLNonTransientException.java
index dc25ff7..79dfbcb 100644
--- a/luni/src/main/java/java/sql/SQLNonTransientException.java
+++ b/luni/src/main/java/java/sql/SQLNonTransientException.java
@@ -26,7 +26,6 @@
      * null, the SQLState string is set to null and the Error Code is set to 0.
      */
     public SQLNonTransientException() {
-        super();
     }
 
     /**
@@ -139,4 +138,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLRecoverableException.java b/luni/src/main/java/java/sql/SQLRecoverableException.java
index 1d0fc45..485e3a6 100644
--- a/luni/src/main/java/java/sql/SQLRecoverableException.java
+++ b/luni/src/main/java/java/sql/SQLRecoverableException.java
@@ -26,7 +26,6 @@
      * null, the SQLState string is set to null and the Error Code is set to 0.
      */
     public SQLRecoverableException() {
-        super();
     }
 
     /**
@@ -139,4 +138,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLSyntaxErrorException.java b/luni/src/main/java/java/sql/SQLSyntaxErrorException.java
index be1d951..125e521 100644
--- a/luni/src/main/java/java/sql/SQLSyntaxErrorException.java
+++ b/luni/src/main/java/java/sql/SQLSyntaxErrorException.java
@@ -26,7 +26,6 @@
      * null, the SQLState string is set to null and the Error Code is set to 0.
      */
     public SQLSyntaxErrorException() {
-        super();
     }
 
     /**
@@ -139,4 +138,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLTimeoutException.java b/luni/src/main/java/java/sql/SQLTimeoutException.java
index 8915bb2..a31c70e 100644
--- a/luni/src/main/java/java/sql/SQLTimeoutException.java
+++ b/luni/src/main/java/java/sql/SQLTimeoutException.java
@@ -26,7 +26,6 @@
      * the SQLState string is set to null and the Error Code is set to 0.
      */
     public SQLTimeoutException() {
-        super();
     }
 
     /**
@@ -137,4 +136,4 @@
             Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLTransactionRollbackException.java b/luni/src/main/java/java/sql/SQLTransactionRollbackException.java
index 4dfbf6d..c525cf9 100644
--- a/luni/src/main/java/java/sql/SQLTransactionRollbackException.java
+++ b/luni/src/main/java/java/sql/SQLTransactionRollbackException.java
@@ -27,7 +27,6 @@
      * to 0.
      */
     public SQLTransactionRollbackException() {
-        super();
     }
 
     /**
@@ -141,4 +140,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLTransientConnectionException.java b/luni/src/main/java/java/sql/SQLTransientConnectionException.java
index 9331aa4..d818f95 100644
--- a/luni/src/main/java/java/sql/SQLTransientConnectionException.java
+++ b/luni/src/main/java/java/sql/SQLTransientConnectionException.java
@@ -27,7 +27,6 @@
      * to 0.
      */
     public SQLTransientConnectionException() {
-        super();
     }
 
     /**
@@ -126,7 +125,7 @@
      * SQLState string , the Error Code is set to the given error code value,
      * and the cause Throwable object is set to the given cause Throwable
      * object.
-     * 
+     *
      * @param reason
      *            the string to use as the Reason string
      * @param sqlState
@@ -141,4 +140,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLTransientException.java b/luni/src/main/java/java/sql/SQLTransientException.java
index a3b6d46..e0aec17 100644
--- a/luni/src/main/java/java/sql/SQLTransientException.java
+++ b/luni/src/main/java/java/sql/SQLTransientException.java
@@ -26,7 +26,6 @@
      * null, the SQLState string is set to null and the Error Code is set to 0.
      */
     public SQLTransientException() {
-        super();
     }
 
     /**
@@ -137,4 +136,4 @@
             int vendorCode, Throwable cause) {
         super(reason, sqlState, vendorCode, cause);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/sql/SQLWarning.java b/luni/src/main/java/java/sql/SQLWarning.java
index 0fa8503..cad5d1f 100644
--- a/luni/src/main/java/java/sql/SQLWarning.java
+++ b/luni/src/main/java/java/sql/SQLWarning.java
@@ -32,7 +32,6 @@
      * code is set to 0.
      */
     public SQLWarning() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/sql/Types.java b/luni/src/main/java/java/sql/Types.java
index 768feb3..353fe67 100644
--- a/luni/src/main/java/java/sql/Types.java
+++ b/luni/src/main/java/java/sql/Types.java
@@ -28,7 +28,6 @@
      * Private constructor to prevent instantiation.
      */
     private Types() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/text/AttributedString.java b/luni/src/main/java/java/text/AttributedString.java
index 1495dc56..1335067 100644
--- a/luni/src/main/java/java/text/AttributedString.java
+++ b/luni/src/main/java/java/text/AttributedString.java
@@ -105,7 +105,7 @@
                 }
                 return clone;
             } catch (CloneNotSupportedException e) {
-                throw new AssertionError(e); // android-changed
+                throw new AssertionError(e);
             }
         }
 
@@ -506,15 +506,9 @@
      */
     public AttributedString(AttributedCharacterIterator iterator, int start,
             int end, AttributedCharacterIterator.Attribute[] attributes) {
-        // BEGIN android-removed
-        // this(iterator, start, end, new HashSet<Attribute>(Arrays
-        //         .asList(attributes)));
-        // END android-removed
-        // BEGIN android-added
         this(iterator, start, end, (attributes == null
                 ? new HashSet<Attribute>()
                 : new HashSet<Attribute>(Arrays.asList(attributes))));
-        // END android-added
     }
 
     /**
diff --git a/luni/src/main/java/java/text/Bidi.java b/luni/src/main/java/java/text/Bidi.java
index 9279c57..e4b30e6 100644
--- a/luni/src/main/java/java/text/Bidi.java
+++ b/luni/src/main/java/java/text/Bidi.java
@@ -21,20 +21,16 @@
 import java.awt.font.TextAttribute;
 import java.util.ArrayList;
 import java.util.Arrays;
-import org.apache.harmony.text.BidiRun;
-import org.apache.harmony.text.NativeBidi;
 
 /**
- * Provides the Unicode Bidirectional Algorithm. The algorithm is
- * defined in the Unicode Standard Annex #9, version 13, also described in The
- * Unicode Standard, Version 4.0 .
+ * Implements the <a href="http://unicode.org/reports/tr9/">Unicode Bidirectional Algorithm</a>.
  *
- * Use a {@code Bidi} object to get the information on the position reordering of a
+ * <p>Use a {@code Bidi} object to get the information on the position reordering of a
  * bidirectional text, such as Arabic or Hebrew. The natural display ordering of
  * horizontal text in these languages is from right to left, while they order
  * numbers from left to right.
  *
- * If the text contains multiple runs, the information of each run can be
+ * <p>If the text contains multiple runs, the information of each run can be
  * obtained from the run index. The level of any particular run indicates the
  * direction of the text as well as the nesting level. Left-to-right runs have
  * even levels while right-to-left runs have odd levels.
@@ -63,6 +59,33 @@
     public static final int DIRECTION_RIGHT_TO_LEFT = 1;
 
     /**
+     * TODO: if we care about performance, we might just want to use an int[] instead of a Run[].
+     */
+    static class Run {
+        private final int start;
+        private final int limit;
+        private final int level;
+
+        public Run(int start, int limit, int level) {
+            this.start = start;
+            this.limit = limit;
+            this.level = level;
+        }
+
+        public int getLevel() {
+            return level;
+        }
+
+        public int getLimit() {
+            return limit;
+        }
+
+        public int getStart() {
+            return start;
+        }
+    }
+
+    /**
      * Creates a {@code Bidi} object from the {@code
      * AttributedCharacterIterator} of a paragraph text. The RUN_DIRECTION
      * attribute determines the base direction of the bidirectional text. If it
@@ -148,7 +171,7 @@
             bidi = createUBiDi(text, 0, embeddings, 0, length, flags);
             readBidiInfo(bidi);
         } finally {
-            NativeBidi.ubidi_close(bidi);
+            ubidi_close(bidi);
         }
     }
 
@@ -213,7 +236,7 @@
             bidi = createUBiDi(text, textStart, embeddings, embStart, paragraphLength, flags);
             readBidiInfo(bidi);
         } finally {
-            NativeBidi.ubidi_close(bidi);
+            ubidi_close(bidi);
         }
     }
 
@@ -262,11 +285,11 @@
                 for (int i = 0; i < paragraphLength; i++) {
                     byte e = embeddings[i];
                     if (e < 0) {
-                        realEmbeddings[i] = (byte) (NativeBidi.UBIDI_LEVEL_OVERRIDE - e);
+                        realEmbeddings[i] = (byte) (UBIDI_LEVEL_OVERRIDE - e);
                     } else if (e > 0) {
                         realEmbeddings[i] = e;
                     } else {
-                        realEmbeddings[i] |= (byte) NativeBidi.UBIDI_LEVEL_OVERRIDE;
+                        realEmbeddings[i] |= (byte) UBIDI_LEVEL_OVERRIDE;
                     }
                 }
             }
@@ -279,12 +302,12 @@
         long bidi = 0;
         boolean needsDeletion = true;
         try {
-            bidi = NativeBidi.ubidi_open();
-            NativeBidi.ubidi_setPara(bidi, realText, paragraphLength, flags, realEmbeddings);
+            bidi = ubidi_open();
+            ubidi_setPara(bidi, realText, paragraphLength, flags, realEmbeddings);
             needsDeletion = false;
         } finally {
             if (needsDeletion) {
-                NativeBidi.ubidi_close(bidi);
+                ubidi_close(bidi);
             }
         }
         return bidi;
@@ -297,20 +320,20 @@
 
     // read info from the native UBiDi struct
     private void readBidiInfo(long pBidi) {
-        length = NativeBidi.ubidi_getLength(pBidi);
+        length = ubidi_getLength(pBidi);
 
-        offsetLevel = (length == 0) ? null : NativeBidi.ubidi_getLevels(pBidi);
+        offsetLevel = (length == 0) ? null : ubidi_getLevels(pBidi);
 
-        baseLevel = NativeBidi.ubidi_getParaLevel(pBidi);
+        baseLevel = ubidi_getParaLevel(pBidi);
 
-        int runCount = NativeBidi.ubidi_countRuns(pBidi);
+        int runCount = ubidi_countRuns(pBidi);
         if (runCount == 0) {
             unidirectional = true;
             runs = null;
         } else if (runCount < 0) {
             runs = null;
         } else {
-            runs = NativeBidi.ubidi_getRuns(pBidi);
+            runs = ubidi_getRuns(pBidi);
 
             // Simplified case for one run which has the base level
             if (runCount == 1 && runs[0].getLevel() == baseLevel) {
@@ -319,7 +342,7 @@
             }
         }
 
-        direction = NativeBidi.ubidi_getDirection(pBidi);
+        direction = ubidi_getDirection(pBidi);
     }
 
     private int baseLevel;
@@ -328,7 +351,7 @@
 
     private byte[] offsetLevel;
 
-    private BidiRun[] runs;
+    private Run[] runs;
 
     private int direction;
 
@@ -380,9 +403,9 @@
             if (lineStart == lineLimit) {
                 return createEmptyLineBidi(parent);
             }
-            return new Bidi(NativeBidi.ubidi_setLine(parent, lineStart, lineLimit));
+            return new Bidi(ubidi_setLine(parent, lineStart, lineLimit));
         } finally {
-            NativeBidi.ubidi_close(parent);
+            ubidi_close(parent);
         }
     }
 
@@ -423,7 +446,7 @@
      */
     public int getLevelAt(int offset) {
         try {
-            return offsetLevel[offset] & ~NativeBidi.UBIDI_LEVEL_OVERRIDE;
+            return offsetLevel[offset] & ~UBIDI_LEVEL_OVERRIDE;
         } catch (RuntimeException e) {
             return baseLevel;
         }
@@ -479,7 +502,7 @@
      *         otherwise.
      */
     public boolean isLeftToRight() {
-        return direction == NativeBidi.UBiDiDirection_UBIDI_LTR;
+        return direction == UBiDiDirection_UBIDI_LTR;
     }
 
     /**
@@ -489,7 +512,7 @@
      *         otherwise.
      */
     public boolean isMixed() {
-        return direction == NativeBidi.UBiDiDirection_UBIDI_MIXED;
+        return direction == UBiDiDirection_UBIDI_MIXED;
     }
 
     /**
@@ -500,7 +523,7 @@
      *         otherwise.
      */
     public boolean isRightToLeft() {
-        return direction == NativeBidi.UBiDiDirection_UBIDI_RTL;
+        return direction == UBiDiDirection_UBIDI_RTL;
     }
 
     /**
@@ -538,7 +561,7 @@
         byte[] realLevels = new byte[count];
         System.arraycopy(levels, levelStart, realLevels, 0, count);
 
-        int[] indices = NativeBidi.ubidi_reorderVisual(realLevels, count);
+        int[] indices = ubidi_reorderVisual(realLevels, count);
 
         ArrayList<Object> result = new ArrayList<Object>(count);
         for (int i = 0; i < count; i++) {
@@ -574,16 +597,29 @@
         return !bidi.isLeftToRight();
     }
 
-    /**
-     * Returns the internal message of the {@code Bidi} object, used in
-     * debugging.
-     *
-     * @return a string containing the internal message.
-     */
     @Override
     public String toString() {
         return getClass().getName()
                 + "[direction: " + direction + " baseLevel: " + baseLevel
                 + " length: " + length + " runs: " + Arrays.toString(runs) + "]";
     }
+
+    // ICU4C constants.
+    private static final int UBIDI_LEVEL_OVERRIDE = 0x80;
+    private static final int UBiDiDirection_UBIDI_LTR = 0;
+    private static final int UBiDiDirection_UBIDI_RTL = 1;
+    private static final int UBiDiDirection_UBIDI_MIXED = 2;
+
+    // ICU4C functions.
+    private static native long ubidi_open();
+    private static native void ubidi_close(long pBiDi);
+    private static native void ubidi_setPara(long pBiDi, char[] text, int length, int paraLevel, byte[] embeddingLevels);
+    private static native long ubidi_setLine(final long pParaBiDi, int start, int limit);
+    private static native int ubidi_getDirection(final long pBiDi);
+    private static native int ubidi_getLength(final long pBiDi);
+    private static native byte ubidi_getParaLevel(final long pBiDi);
+    private static native byte[] ubidi_getLevels(long pBiDi);
+    private static native int ubidi_countRuns(long pBiDi);
+    private static native Bidi.Run[] ubidi_getRuns(long pBidi);
+    private static native int[] ubidi_reorderVisual(byte[] levels, int length);
 }
diff --git a/luni/src/main/java/java/text/BreakIterator.java b/luni/src/main/java/java/text/BreakIterator.java
index ccc484c..13f7443 100644
--- a/luni/src/main/java/java/text/BreakIterator.java
+++ b/luni/src/main/java/java/text/BreakIterator.java
@@ -237,7 +237,6 @@
      * Default constructor, for use by subclasses.
      */
     protected BreakIterator() {
-        super();
     }
 
     /*
@@ -490,7 +489,7 @@
             cloned.wrapped = (NativeBreakIterator) wrapped.clone();
             return cloned;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 }
diff --git a/luni/src/main/java/java/text/Collator.java b/luni/src/main/java/java/text/Collator.java
index 689fcb7..0fa8c71 100644
--- a/luni/src/main/java/java/text/Collator.java
+++ b/luni/src/main/java/java/text/Collator.java
@@ -172,7 +172,7 @@
             clone.icuColl = (RuleBasedCollatorICU) icuColl.clone();
             return clone;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/text/DateFormat.java b/luni/src/main/java/java/text/DateFormat.java
index 53480e6..4055d20 100644
--- a/luni/src/main/java/java/text/DateFormat.java
+++ b/luni/src/main/java/java/text/DateFormat.java
@@ -143,51 +143,51 @@
      * The format style constant defining the default format style. The default
      * is MEDIUM.
      */
-    public final static int DEFAULT = 2;
+    public static final int DEFAULT = 2;
 
     /**
      * The format style constant defining the full style.
      */
-    public final static int FULL = 0;
+    public static final int FULL = 0;
 
     /**
      * The format style constant defining the long style.
      */
-    public final static int LONG = 1;
+    public static final int LONG = 1;
 
     /**
      * The format style constant defining the medium style.
      */
-    public final static int MEDIUM = 2;
+    public static final int MEDIUM = 2;
 
     /**
      * The format style constant defining the short style.
      */
-    public final static int SHORT = 3;
+    public static final int SHORT = 3;
 
     /**
      * The {@code FieldPosition} selector for 'G' field alignment, corresponds
      * to the {@link Calendar#ERA} field.
      */
-    public final static int ERA_FIELD = 0;
+    public static final int ERA_FIELD = 0;
 
     /**
      * The {@code FieldPosition} selector for 'y' field alignment, corresponds
      * to the {@link Calendar#YEAR} field.
      */
-    public final static int YEAR_FIELD = 1;
+    public static final int YEAR_FIELD = 1;
 
     /**
      * The {@code FieldPosition} selector for 'M' field alignment, corresponds
      * to the {@link Calendar#MONTH} field.
      */
-    public final static int MONTH_FIELD = 2;
+    public static final int MONTH_FIELD = 2;
 
     /**
      * The {@code FieldPosition} selector for 'd' field alignment, corresponds
      * to the {@link Calendar#DATE} field.
      */
-    public final static int DATE_FIELD = 3;
+    public static final int DATE_FIELD = 3;
 
     /**
      * The {@code FieldPosition} selector for 'k' field alignment, corresponds
@@ -195,7 +195,7 @@
      * used for the one-based 24-hour clock. For example, 23:59 + 01:00 results
      * in 24:59.
      */
-    public final static int HOUR_OF_DAY1_FIELD = 4;
+    public static final int HOUR_OF_DAY1_FIELD = 4;
 
     /**
      * The {@code FieldPosition} selector for 'H' field alignment, corresponds
@@ -203,80 +203,80 @@
      * used for the zero-based 24-hour clock. For example, 23:59 + 01:00 results
      * in 00:59.
      */
-    public final static int HOUR_OF_DAY0_FIELD = 5;
+    public static final int HOUR_OF_DAY0_FIELD = 5;
 
     /**
      * FieldPosition selector for 'm' field alignment, corresponds to the
      * {@link Calendar#MINUTE} field.
      */
-    public final static int MINUTE_FIELD = 6;
+    public static final int MINUTE_FIELD = 6;
 
     /**
      * FieldPosition selector for 's' field alignment, corresponds to the
      * {@link Calendar#SECOND} field.
      */
-    public final static int SECOND_FIELD = 7;
+    public static final int SECOND_FIELD = 7;
 
     /**
      * FieldPosition selector for 'S' field alignment, corresponds to the
      * {@link Calendar#MILLISECOND} field.
      */
-    public final static int MILLISECOND_FIELD = 8;
+    public static final int MILLISECOND_FIELD = 8;
 
     /**
      * FieldPosition selector for 'E' field alignment, corresponds to the
      * {@link Calendar#DAY_OF_WEEK} field.
      */
-    public final static int DAY_OF_WEEK_FIELD = 9;
+    public static final int DAY_OF_WEEK_FIELD = 9;
 
     /**
      * FieldPosition selector for 'D' field alignment, corresponds to the
      * {@link Calendar#DAY_OF_YEAR} field.
      */
-    public final static int DAY_OF_YEAR_FIELD = 10;
+    public static final int DAY_OF_YEAR_FIELD = 10;
 
     /**
      * FieldPosition selector for 'F' field alignment, corresponds to the
      * {@link Calendar#DAY_OF_WEEK_IN_MONTH} field.
      */
-    public final static int DAY_OF_WEEK_IN_MONTH_FIELD = 11;
+    public static final int DAY_OF_WEEK_IN_MONTH_FIELD = 11;
 
     /**
      * FieldPosition selector for 'w' field alignment, corresponds to the
      * {@link Calendar#WEEK_OF_YEAR} field.
      */
-    public final static int WEEK_OF_YEAR_FIELD = 12;
+    public static final int WEEK_OF_YEAR_FIELD = 12;
 
     /**
      * FieldPosition selector for 'W' field alignment, corresponds to the
      * {@link Calendar#WEEK_OF_MONTH} field.
      */
-    public final static int WEEK_OF_MONTH_FIELD = 13;
+    public static final int WEEK_OF_MONTH_FIELD = 13;
 
     /**
      * FieldPosition selector for 'a' field alignment, corresponds to the
      * {@link Calendar#AM_PM} field.
      */
-    public final static int AM_PM_FIELD = 14;
+    public static final int AM_PM_FIELD = 14;
 
     /**
      * FieldPosition selector for 'h' field alignment, corresponding to the
      * {@link Calendar#HOUR} field.
      */
-    public final static int HOUR1_FIELD = 15;
+    public static final int HOUR1_FIELD = 15;
 
     /**
      * The {@code FieldPosition} selector for 'K' field alignment, corresponding to the
      * {@link Calendar#HOUR} field.
      */
-    public final static int HOUR0_FIELD = 16;
+    public static final int HOUR0_FIELD = 16;
 
     /**
      * The {@code FieldPosition} selector for 'z' field alignment, corresponds
      * to the {@link Calendar#ZONE_OFFSET} and {@link Calendar#DST_OFFSET}
      * fields.
      */
-    public final static int TIMEZONE_FIELD = 17;
+    public static final int TIMEZONE_FIELD = 17;
 
     /**
      * Constructs a new instance of {@code DateFormat}.
@@ -422,7 +422,7 @@
      *
      * @return the {@code DateFormat} instance for the default style and locale.
      */
-    public final static DateFormat getDateInstance() {
+    public static final DateFormat getDateInstance() {
         return getDateInstance(DEFAULT);
     }
 
@@ -438,7 +438,7 @@
      *             if {@code style} is not one of SHORT, MEDIUM, LONG, FULL, or
      *             DEFAULT.
      */
-    public final static DateFormat getDateInstance(int style) {
+    public static final DateFormat getDateInstance(int style) {
         checkDateStyle(style);
         return getDateInstance(style, Locale.getDefault());
     }
@@ -457,7 +457,7 @@
      * @return the {@code DateFormat} instance for {@code style} and
      *         {@code locale}.
      */
-    public final static DateFormat getDateInstance(int style, Locale locale) {
+    public static final DateFormat getDateInstance(int style, Locale locale) {
         checkDateStyle(style);
         return new SimpleDateFormat(LocaleData.get(locale).getDateFormat(style), locale);
     }
@@ -468,7 +468,7 @@
      *
      * @return the {@code DateFormat} instance for the default style and locale.
      */
-    public final static DateFormat getDateTimeInstance() {
+    public static final DateFormat getDateTimeInstance() {
         return getDateTimeInstance(DEFAULT, DEFAULT);
     }
 
@@ -486,7 +486,7 @@
      *             if {@code dateStyle} or {@code timeStyle} is not one of
      *             SHORT, MEDIUM, LONG, FULL, or DEFAULT.
      */
-    public final static DateFormat getDateTimeInstance(int dateStyle, int timeStyle) {
+    public static final DateFormat getDateTimeInstance(int dateStyle, int timeStyle) {
         checkTimeStyle(timeStyle);
         checkDateStyle(dateStyle);
         return getDateTimeInstance(dateStyle, timeStyle, Locale.getDefault());
@@ -508,7 +508,7 @@
      *             if {@code dateStyle} or {@code timeStyle} is not one of
      *             SHORT, MEDIUM, LONG, FULL, or DEFAULT.
      */
-    public final static DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) {
+    public static final DateFormat getDateTimeInstance(int dateStyle, int timeStyle, Locale locale) {
         checkTimeStyle(timeStyle);
         checkDateStyle(dateStyle);
         LocaleData localeData = LocaleData.get(locale);
@@ -523,7 +523,7 @@
      * @return the {@code DateFormat} instance for the SHORT style and default
      *         locale.
      */
-    public final static DateFormat getInstance() {
+    public static final DateFormat getInstance() {
         return getDateTimeInstance(SHORT, SHORT);
     }
 
@@ -542,7 +542,7 @@
      *
      * @return the {@code DateFormat} instance for the default style and locale.
      */
-    public final static DateFormat getTimeInstance() {
+    public static final DateFormat getTimeInstance() {
         return getTimeInstance(DEFAULT);
     }
 
@@ -558,7 +558,7 @@
      *             if {@code style} is not one of SHORT, MEDIUM, LONG, FULL, or
      *             DEFAULT.
      */
-    public final static DateFormat getTimeInstance(int style) {
+    public static final DateFormat getTimeInstance(int style) {
         checkTimeStyle(style);
         return getTimeInstance(style, Locale.getDefault());
     }
@@ -577,7 +577,7 @@
      * @return the {@code DateFormat} instance for {@code style} and
      *         {@code locale}.
      */
-    public final static DateFormat getTimeInstance(int style, Locale locale) {
+    public static final DateFormat getTimeInstance(int style, Locale locale) {
         checkTimeStyle(style);
         return new SimpleDateFormat(LocaleData.get(locale).getTimeFormat(style), locale);
     }
@@ -743,95 +743,95 @@
         /**
          * Marks the era part of a date.
          */
-        public final static Field ERA = new Field("era", Calendar.ERA);
+        public static final Field ERA = new Field("era", Calendar.ERA);
 
         /**
          * Marks the year part of a date.
          */
-        public final static Field YEAR = new Field("year", Calendar.YEAR);
+        public static final Field YEAR = new Field("year", Calendar.YEAR);
 
         /**
          * Marks the month part of a date.
          */
-        public final static Field MONTH = new Field("month", Calendar.MONTH);
+        public static final Field MONTH = new Field("month", Calendar.MONTH);
 
         /**
          * Marks the hour of the day part of a date (0-11).
          */
-        public final static Field HOUR_OF_DAY0 = new Field("hour of day", Calendar.HOUR_OF_DAY);
+        public static final Field HOUR_OF_DAY0 = new Field("hour of day", Calendar.HOUR_OF_DAY);
 
         /**
          * Marks the hour of the day part of a date (1-12).
          */
-        public final static Field HOUR_OF_DAY1 = new Field("hour of day 1", -1);
+        public static final Field HOUR_OF_DAY1 = new Field("hour of day 1", -1);
 
         /**
          * Marks the minute part of a time.
          */
-        public final static Field MINUTE = new Field("minute", Calendar.MINUTE);
+        public static final Field MINUTE = new Field("minute", Calendar.MINUTE);
 
         /**
          * Marks the second part of a time.
          */
-        public final static Field SECOND = new Field("second", Calendar.SECOND);
+        public static final Field SECOND = new Field("second", Calendar.SECOND);
 
         /**
          * Marks the millisecond part of a time.
          */
-        public final static Field MILLISECOND = new Field("millisecond", Calendar.MILLISECOND);
+        public static final Field MILLISECOND = new Field("millisecond", Calendar.MILLISECOND);
 
         /**
          * Marks the day of the week part of a date.
          */
-        public final static Field DAY_OF_WEEK = new Field("day of week", Calendar.DAY_OF_WEEK);
+        public static final Field DAY_OF_WEEK = new Field("day of week", Calendar.DAY_OF_WEEK);
 
         /**
          * Marks the day of the month part of a date.
          */
-        public final static Field DAY_OF_MONTH = new Field("day of month", Calendar.DAY_OF_MONTH);
+        public static final Field DAY_OF_MONTH = new Field("day of month", Calendar.DAY_OF_MONTH);
 
         /**
          * Marks the day of the year part of a date.
          */
-        public final static Field DAY_OF_YEAR = new Field("day of year", Calendar.DAY_OF_YEAR);
+        public static final Field DAY_OF_YEAR = new Field("day of year", Calendar.DAY_OF_YEAR);
 
         /**
          * Marks the day of the week in the month part of a date.
          */
-        public final static Field DAY_OF_WEEK_IN_MONTH = new Field("day of week in month",
+        public static final Field DAY_OF_WEEK_IN_MONTH = new Field("day of week in month",
                 Calendar.DAY_OF_WEEK_IN_MONTH);
 
         /**
          * Marks the week of the year part of a date.
          */
-        public final static Field WEEK_OF_YEAR = new Field("week of year",
+        public static final Field WEEK_OF_YEAR = new Field("week of year",
                 Calendar.WEEK_OF_YEAR);
 
         /**
          * Marks the week of the month part of a date.
          */
-        public final static Field WEEK_OF_MONTH = new Field("week of month",
+        public static final Field WEEK_OF_MONTH = new Field("week of month",
                 Calendar.WEEK_OF_MONTH);
 
         /**
          * Marks the time indicator part of a date.
          */
-        public final static Field AM_PM = new Field("am pm", Calendar.AM_PM);
+        public static final Field AM_PM = new Field("am pm", Calendar.AM_PM);
 
         /**
          * Marks the hour part of a date (0-11).
          */
-        public final static Field HOUR0 = new Field("hour", Calendar.HOUR);
+        public static final Field HOUR0 = new Field("hour", Calendar.HOUR);
 
         /**
          * Marks the hour part of a date (1-12).
          */
-        public final static Field HOUR1 = new Field("hour 1", -1);
+        public static final Field HOUR1 = new Field("hour 1", -1);
 
         /**
          * Marks the time zone part of a date.
          */
-        public final static Field TIME_ZONE = new Field("time zone", -1);
+        public static final Field TIME_ZONE = new Field("time zone", -1);
 
         /**
          * The calendar field that this field represents.
diff --git a/luni/src/main/java/java/text/DateFormatSymbols.java b/luni/src/main/java/java/text/DateFormatSymbols.java
index 73c818e..a088fdb 100644
--- a/luni/src/main/java/java/text/DateFormatSymbols.java
+++ b/luni/src/main/java/java/text/DateFormatSymbols.java
@@ -229,7 +229,7 @@
                 "[amPmStrings=" + Arrays.toString(ampms) +
                 ",customZoneStrings=" + customZoneStrings +
                 ",eras=" + Arrays.toString(eras) +
-                ",localPatternChars=" + new String(localPatternChars) +
+                ",localPatternChars=" + localPatternChars +
                 ",months=" + Arrays.toString(months) +
                 ",shortMonths=" + Arrays.toString(shortMonths) +
                 ",shortWeekdays=" + Arrays.toString(shortWeekdays) +
@@ -327,7 +327,15 @@
      * </ul>
      */
     public String[][] getZoneStrings() {
-        return TimeZones.clone2dStringArray(internalZoneStrings());
+        return clone2dStringArray(internalZoneStrings());
+    }
+
+    private static String[][] clone2dStringArray(String[][] array) {
+        String[][] result = new String[array.length][];
+        for (int i = 0; i < array.length; ++i) {
+            result[i] = array[i].clone();
+        }
+        return result;
     }
 
     @Override
@@ -466,7 +474,7 @@
                 throw new IllegalArgumentException(Arrays.toString(row) + ".length < 5");
             }
         }
-        this.zoneStrings = TimeZones.clone2dStringArray(zoneStrings);
+        this.zoneStrings = clone2dStringArray(zoneStrings);
         this.customZoneStrings = true;
     }
 }
diff --git a/luni/src/main/java/java/text/DecimalFormat.java b/luni/src/main/java/java/text/DecimalFormat.java
index b2b5d6a..c1a48db 100644
--- a/luni/src/main/java/java/text/DecimalFormat.java
+++ b/luni/src/main/java/java/text/DecimalFormat.java
@@ -884,30 +884,6 @@
         if (number == null) {
             return null;
         }
-        // BEGIN android-removed
-        // if (this.isParseBigDecimal()) {
-        //     if (number instanceof Long) {
-        //         return new BigDecimal(number.longValue());
-        //     }
-        //     if ((number instanceof Double) && !((Double) number).isInfinite()
-        //             && !((Double) number).isNaN()) {
-        //
-        //         return new BigDecimal(number.doubleValue());
-        //     }
-        //     if (number instanceof BigInteger) {
-        //         return new BigDecimal(number.doubleValue());
-        //     }
-        //     if (number instanceof com.ibm.icu.math.BigDecimal) {
-        //         return new BigDecimal(number.toString());
-        //     }
-        //     return number;
-        // }
-        // if ((number instanceof com.ibm.icu.math.BigDecimal)
-        //         || (number instanceof BigInteger)) {
-        //     return new Double(number.doubleValue());
-        // }
-        // END android-removed
-        // BEGIN android-added
         if (this.isParseBigDecimal()) {
             if (number instanceof Long) {
                 return new BigDecimal(number.longValue());
@@ -925,10 +901,8 @@
         if ((number instanceof BigDecimal) || (number instanceof BigInteger)) {
             return new Double(number.doubleValue());
         }
-        // END android-added
-
         if (this.isParseIntegerOnly() && number.equals(NEGATIVE_ZERO_DOUBLE)) {
-            return Long.valueOf(0); // android-changed
+            return Long.valueOf(0);
         }
         return number;
 
@@ -942,10 +916,9 @@
      */
     public void setDecimalFormatSymbols(DecimalFormatSymbols value) {
         if (value != null) {
-            // BEGIN android-changed: the Java object is canonical, and we copy down to native code.
+            // The Java object is canonical, and we copy down to native code.
             this.symbols = (DecimalFormatSymbols) value.clone();
             dform.setDecimalFormatSymbols(this.symbols);
-            // END android-changed
         }
     }
 
@@ -959,9 +932,7 @@
      */
     @Override
     public void setCurrency(Currency currency) {
-        // BEGIN android-changed
         dform.setCurrency(Currency.getInstance(currency.getCurrencyCode()));
-        // END android-changed
         symbols.setCurrency(currency);
     }
 
@@ -1150,28 +1121,29 @@
 
     // the fields list to be serialized
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("positivePrefix", String.class),
-            new ObjectStreamField("positiveSuffix", String.class),
-            new ObjectStreamField("negativePrefix", String.class),
-            new ObjectStreamField("negativeSuffix", String.class),
-            new ObjectStreamField("posPrefixPattern", String.class),
-            new ObjectStreamField("posSuffixPattern", String.class),
-            new ObjectStreamField("negPrefixPattern", String.class),
-            new ObjectStreamField("negSuffixPattern", String.class),
-            new ObjectStreamField("multiplier", int.class),
-            new ObjectStreamField("groupingSize", byte.class),
-            new ObjectStreamField("groupingUsed", boolean.class),
-            new ObjectStreamField("decimalSeparatorAlwaysShown", boolean.class),
-            new ObjectStreamField("parseBigDecimal", boolean.class),
-            new ObjectStreamField("roundingMode", RoundingMode.class),
-            new ObjectStreamField("symbols", DecimalFormatSymbols.class),
-            new ObjectStreamField("useExponentialNotation", boolean.class),
-            new ObjectStreamField("minExponentDigits", byte.class),
-            new ObjectStreamField("maximumIntegerDigits", int.class),
-            new ObjectStreamField("minimumIntegerDigits", int.class),
-            new ObjectStreamField("maximumFractionDigits", int.class),
-            new ObjectStreamField("minimumFractionDigits", int.class),
-            new ObjectStreamField("serialVersionOnStream", int.class), };
+        new ObjectStreamField("positivePrefix", String.class),
+        new ObjectStreamField("positiveSuffix", String.class),
+        new ObjectStreamField("negativePrefix", String.class),
+        new ObjectStreamField("negativeSuffix", String.class),
+        new ObjectStreamField("posPrefixPattern", String.class),
+        new ObjectStreamField("posSuffixPattern", String.class),
+        new ObjectStreamField("negPrefixPattern", String.class),
+        new ObjectStreamField("negSuffixPattern", String.class),
+        new ObjectStreamField("multiplier", int.class),
+        new ObjectStreamField("groupingSize", byte.class),
+        new ObjectStreamField("groupingUsed", boolean.class),
+        new ObjectStreamField("decimalSeparatorAlwaysShown", boolean.class),
+        new ObjectStreamField("parseBigDecimal", boolean.class),
+        new ObjectStreamField("roundingMode", RoundingMode.class),
+        new ObjectStreamField("symbols", DecimalFormatSymbols.class),
+        new ObjectStreamField("useExponentialNotation", boolean.class),
+        new ObjectStreamField("minExponentDigits", byte.class),
+        new ObjectStreamField("maximumIntegerDigits", int.class),
+        new ObjectStreamField("minimumIntegerDigits", int.class),
+        new ObjectStreamField("maximumFractionDigits", int.class),
+        new ObjectStreamField("minimumFractionDigits", int.class),
+        new ObjectStreamField("serialVersionOnStream", int.class),
+    };
 
     /**
      * Writes serialized fields following serialized forms specified by Java
@@ -1183,9 +1155,7 @@
      *             if some I/O error occurs
      * @throws ClassNotFoundException
      */
-    @SuppressWarnings("nls")
-    private void writeObject(ObjectOutputStream stream) throws IOException,
-            ClassNotFoundException {
+    private void writeObject(ObjectOutputStream stream) throws IOException, ClassNotFoundException {
         ObjectOutputStream.PutField fields = stream.putFields();
         fields.put("positivePrefix", dform.getPositivePrefix());
         fields.put("positiveSuffix", dform.getPositiveSuffix());
@@ -1197,11 +1167,8 @@
         fields.put("negSuffixPattern", (String) null);
         fields.put("multiplier", dform.getMultiplier());
         fields.put("groupingSize", (byte) dform.getGroupingSize());
-        // BEGIN android-added
         fields.put("groupingUsed", dform.isGroupingUsed());
-        // END android-added
-        fields.put("decimalSeparatorAlwaysShown", dform
-                .isDecimalSeparatorAlwaysShown());
+        fields.put("decimalSeparatorAlwaysShown", dform.isDecimalSeparatorAlwaysShown());
         fields.put("parseBigDecimal", dform.isParseBigDecimal());
         fields.put("roundingMode", roundingMode);
         fields.put("symbols", symbols);
@@ -1226,9 +1193,7 @@
      * @throws ClassNotFoundException
      *             if some class of serialized objects or fields cannot be found
      */
-    @SuppressWarnings("nls")
     private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
-        // BEGIN android-changed
         ObjectInputStream.GetField fields = stream.readFields();
         this.symbols = (DecimalFormatSymbols) fields.get("symbols", null);
 
@@ -1248,7 +1213,7 @@
         final int minimumIntegerDigits = fields.get("minimumIntegerDigits", 309);
         final int maximumFractionDigits = fields.get("maximumFractionDigits", 340);
         final int minimumFractionDigits = fields.get("minimumFractionDigits", 340);
-        // BEGIN android-changed: tell ICU what we want, then ask it what we can have, and then
+        // Tell ICU what we want, then ask it what we can have, and then
         // set that in our Java object. This isn't RI-compatible, but then very little of our
         // behavior in this area is, and it's not obvious how we can second-guess ICU (or tell
         // it to just do exactly what we ask). We only need to do this with maximumIntegerDigits
@@ -1267,7 +1232,6 @@
             setMaximumFractionDigits(super.getMaximumFractionDigits());
             setMinimumFractionDigits(super.getMinimumFractionDigits());
         }
-        // END android-changed
     }
 
     /**
diff --git a/luni/src/main/java/java/text/DecimalFormatSymbols.java b/luni/src/main/java/java/text/DecimalFormatSymbols.java
index 13e9128..889adcd 100644
--- a/luni/src/main/java/java/text/DecimalFormatSymbols.java
+++ b/luni/src/main/java/java/text/DecimalFormatSymbols.java
@@ -565,21 +565,21 @@
 
     private static final ObjectStreamField[] serialPersistentFields = {
         new ObjectStreamField("currencySymbol", String.class),
-        new ObjectStreamField("decimalSeparator", Character.TYPE),
-        new ObjectStreamField("digit", Character.TYPE),
-        new ObjectStreamField("exponential", Character.TYPE),
+        new ObjectStreamField("decimalSeparator", char.class),
+        new ObjectStreamField("digit", char.class),
+        new ObjectStreamField("exponential", char.class),
         new ObjectStreamField("exponentialSeparator", String.class),
-        new ObjectStreamField("groupingSeparator", Character.TYPE),
+        new ObjectStreamField("groupingSeparator", char.class),
         new ObjectStreamField("infinity", String.class),
         new ObjectStreamField("intlCurrencySymbol", String.class),
-        new ObjectStreamField("minusSign", Character.TYPE),
-        new ObjectStreamField("monetarySeparator", Character.TYPE),
+        new ObjectStreamField("minusSign", char.class),
+        new ObjectStreamField("monetarySeparator", char.class),
         new ObjectStreamField("NaN", String.class),
-        new ObjectStreamField("patternSeparator", Character.TYPE),
-        new ObjectStreamField("percent", Character.TYPE),
-        new ObjectStreamField("perMill", Character.TYPE),
-        new ObjectStreamField("serialVersionOnStream", Integer.TYPE),
-        new ObjectStreamField("zeroDigit", Character.TYPE),
+        new ObjectStreamField("patternSeparator", char.class),
+        new ObjectStreamField("percent", char.class),
+        new ObjectStreamField("perMill", char.class),
+        new ObjectStreamField("serialVersionOnStream", int.class),
+        new ObjectStreamField("zeroDigit", char.class),
         new ObjectStreamField("locale", Locale.class),
     };
 
diff --git a/luni/src/main/java/java/text/Format.java b/luni/src/main/java/java/text/Format.java
index 200ab0f..58671fa 100644
--- a/luni/src/main/java/java/text/Format.java
+++ b/luni/src/main/java/java/text/Format.java
@@ -76,7 +76,7 @@
         try {
             return super.clone();
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/text/MessageFormat.java b/luni/src/main/java/java/text/MessageFormat.java
index 8d8d12c..a98e4fd 100644
--- a/luni/src/main/java/java/text/MessageFormat.java
+++ b/luni/src/main/java/java/text/MessageFormat.java
@@ -21,9 +21,11 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Date;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Locale;
 import java.util.Vector;
 import libcore.util.EmptyArray;
@@ -384,11 +386,11 @@
         int length = template.length();
         StringBuffer buffer = new StringBuffer();
         ParsePosition position = new ParsePosition(0);
-        Vector<String> localStrings = new Vector<String>();
+        ArrayList<String> localStrings = new ArrayList<String>();
         int argCount = 0;
         int[] args = new int[10];
         int maxArg = -1;
-        Vector<Format> localFormats = new Vector<Format>();
+        ArrayList<Format> localFormats = new ArrayList<Format>();
         while (position.getIndex() < length) {
             if (Format.upTo(template, position, buffer, '{')) {
                 int arg = 0;
@@ -411,7 +413,7 @@
                 }
                 offset--;
                 position.setIndex(offset);
-                localFormats.addElement(parseVariable(template, position));
+                localFormats.add(parseVariable(template, position));
                 if (argCount >= args.length) {
                     int[] newArgs = new int[args.length * 2];
                     System.arraycopy(args, 0, newArgs, 0, args.length);
@@ -422,18 +424,12 @@
                     maxArg = arg;
                 }
             }
-            localStrings.addElement(buffer.toString());
+            localStrings.add(buffer.toString());
             buffer.setLength(0);
         }
-        this.strings = new String[localStrings.size()];
-        for (int i = 0; i < localStrings.size(); i++) {
-            this.strings[i] = localStrings.elementAt(i);
-        }
+        this.strings = localStrings.toArray(new String[localStrings.size()]);
         argumentNumbers = args;
-        this.formats = new Format[argCount];
-        for (int i = 0; i < argCount; i++) {
-            this.formats[i] = localFormats.elementAt(i);
-        }
+        this.formats = localFormats.toArray(new Format[argCount]);
         maxOffset = argCount - 1;
         maxArgumentIndex = maxArg;
     }
@@ -514,7 +510,7 @@
         }
 
         StringBuffer buffer = new StringBuffer();
-        Vector<FieldContainer> fields = new Vector<FieldContainer>();
+        ArrayList<FieldContainer> fields = new ArrayList<FieldContainer>();
 
         // format the message, and find fields
         formatImpl((Object[]) object, buffer, new FieldPosition(0), fields);
@@ -523,8 +519,7 @@
         AttributedString as = new AttributedString(buffer.toString());
 
         // add MessageFormat field attributes and values to the AttributedString
-        for (int i = 0; i < fields.size(); i++) {
-            FieldContainer fc = fields.elementAt(i);
+        for (FieldContainer fc : fields) {
             as.addAttribute(fc.attribute, fc.value, fc.start, fc.end);
         }
 
@@ -556,7 +551,7 @@
     }
 
     private StringBuffer formatImpl(Object[] objects, StringBuffer buffer,
-            FieldPosition position, Vector<FieldContainer> fields) {
+            FieldPosition position, List<FieldContainer> fields) {
         FieldPosition passedField = new FieldPosition(0);
         for (int i = 0; i <= maxOffset; i++) {
             buffer.append(strings[i]);
@@ -568,8 +563,7 @@
                 buffer.append('{');
                 buffer.append(argumentNumbers[i]);
                 buffer.append('}');
-                handleArgumentField(begin, buffer.length(), argumentNumbers[i],
-                        position, fields);
+                handleArgumentField(begin, buffer.length(), argumentNumbers[i], position, fields);
                 continue;
             }
             Format format = formats[i];
@@ -580,8 +574,7 @@
                     format = DateFormat.getInstance();
                 } else {
                     buffer.append(arg);
-                    handleArgumentField(begin, buffer.length(),
-                            argumentNumbers[i], position, fields);
+                    handleArgumentField(begin, buffer.length(), argumentNumbers[i], position, fields);
                     continue;
                 }
             }
@@ -590,14 +583,12 @@
                 MessageFormat mf = new MessageFormat(result);
                 mf.setLocale(locale);
                 mf.format(objects, buffer, passedField);
-                handleArgumentField(begin, buffer.length(), argumentNumbers[i],
-                        position, fields);
-                handleformat(format, arg, begin, fields);
+                handleArgumentField(begin, buffer.length(), argumentNumbers[i], position, fields);
+                handleFormat(format, arg, begin, fields);
             } else {
                 format.format(arg, buffer, passedField);
-                handleArgumentField(begin, buffer.length(), argumentNumbers[i],
-                        position, fields);
-                handleformat(format, arg, begin, fields);
+                handleArgumentField(begin, buffer.length(), argumentNumbers[i], position, fields);
+                handleFormat(format, arg, begin, fields);
             }
         }
         if (maxOffset + 1 < strings.length) {
@@ -608,12 +599,12 @@
 
     /**
      * Adds a new FieldContainer with MessageFormat.Field.ARGUMENT field,
-     * argIndex, begin and end index to the fields vector, or sets the
+     * argIndex, begin and end index to the fields list, or sets the
      * position's begin and end index if it has MessageFormat.Field.ARGUMENT as
      * its field attribute.
      */
     private void handleArgumentField(int begin, int end, int argIndex,
-            FieldPosition position, Vector<FieldContainer> fields) {
+            FieldPosition position, List<FieldContainer> fields) {
         if (fields != null) {
             fields.add(new FieldContainer(begin, end, Field.ARGUMENT, Integer.valueOf(argIndex)));
         } else {
@@ -628,7 +619,7 @@
 
     /**
      * An inner class to store attributes, values, start and end indices.
-     * Instances of this inner class are used as elements for the fields vector
+     * Instances of this inner class are used as elements for the fields list.
      */
     private static class FieldContainer {
         int start, end;
@@ -647,8 +638,8 @@
     }
 
     /**
-     * If fields vector is not null, find and add the fields of this format to
-     * the fields vector by iterating through its AttributedCharacterIterator
+     * If fields list is not null, find and add the fields of this format to
+     * the fields list by iterating through its AttributedCharacterIterator
      *
      * @param format
      *            the format to find fields for
@@ -656,29 +647,23 @@
      *            object to format
      * @param begin
      *            the index where the string this format has formatted begins
-     * @param fields
-     *            fields vector, each entry in this vector are of type
-     *            FieldContainer.
      */
-    private void handleformat(Format format, Object arg, int begin,
-            Vector<FieldContainer> fields) {
-        if (fields != null) {
-            AttributedCharacterIterator iterator = format
-                    .formatToCharacterIterator(arg);
-            while (iterator.getIndex() != iterator.getEndIndex()) {
-                int start = iterator.getRunStart();
-                int end = iterator.getRunLimit();
-
-                Iterator<?> it = iterator.getAttributes().keySet().iterator();
-                while (it.hasNext()) {
-                    AttributedCharacterIterator.Attribute attribute = (AttributedCharacterIterator.Attribute) it
-                            .next();
-                    Object value = iterator.getAttribute(attribute);
-                    fields.add(new FieldContainer(begin + start, begin + end,
-                            attribute, value));
-                }
-                iterator.setIndex(end);
+    private void handleFormat(Format format, Object arg, int begin, List<FieldContainer> fields) {
+        if (fields == null) {
+            return;
+        }
+        AttributedCharacterIterator iterator = format.formatToCharacterIterator(arg);
+        while (iterator.getIndex() != iterator.getEndIndex()) {
+            int start = iterator.getRunStart();
+            int end = iterator.getRunLimit();
+            Iterator<?> it = iterator.getAttributes().keySet().iterator();
+            while (it.hasNext()) {
+                AttributedCharacterIterator.Attribute attribute =
+                        (AttributedCharacterIterator.Attribute) it.next();
+                Object value = iterator.getAttribute(attribute);
+                fields.add(new FieldContainer(begin + start, begin + end, attribute, value));
             }
+            iterator.setIndex(end);
         }
     }
 
@@ -1018,9 +1003,7 @@
                         .getTimeInstance(dateStyle, locale);
             case 2: // number
                 if (ch == '}') {
-                    // BEGIN android-changed
                     return NumberFormat.getInstance(locale);
-                    // END android-changed
                 }
                 int numberStyle = match(string, position, true,
                         new String[] { "currency", "percent", "integer" });
@@ -1086,16 +1069,6 @@
         this.locale = locale;
         for (int i = 0; i <= maxOffset; i++) {
             Format format = formats[i];
-            // BEGIN android-removed
-            //if (format instanceof DecimalFormat) {
-            //     formats[i] = new DecimalFormat(((DecimalFormat) format)
-            //             .toPattern(), new DecimalFormatSymbols(locale));
-            //} else if (format instanceof SimpleDateFormat) {
-            //     formats[i] = new SimpleDateFormat(((SimpleDateFormat) format)
-            //             .toPattern(), locale);
-            //}
-            // END android-removed
-            // BEGIN android-added
             // java specification undefined for null argument, change into
             // a more tolerant implementation
             if (format instanceof DecimalFormat) {
@@ -1113,7 +1086,6 @@
                     formats[i] = null;
                 }
             }
-            // END android-added
         }
     }
 
@@ -1235,12 +1207,13 @@
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("argumentNumbers", int[].class),
-            new ObjectStreamField("formats", Format[].class),
-            new ObjectStreamField("locale", Locale.class),
-            new ObjectStreamField("maxOffset", Integer.TYPE),
-            new ObjectStreamField("offsets", int[].class),
-            new ObjectStreamField("pattern", String.class), };
+        new ObjectStreamField("argumentNumbers", int[].class),
+        new ObjectStreamField("formats", Format[].class),
+        new ObjectStreamField("locale", Locale.class),
+        new ObjectStreamField("maxOffset", int.class),
+        new ObjectStreamField("offsets", int[].class),
+        new ObjectStreamField("pattern", String.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
diff --git a/luni/src/main/java/java/text/NumberFormat.java b/luni/src/main/java/java/text/NumberFormat.java
index a5b1cb2..3bff6ad 100644
--- a/luni/src/main/java/java/text/NumberFormat.java
+++ b/luni/src/main/java/java/text/NumberFormat.java
@@ -340,7 +340,7 @@
      *
      * @return a {@code NumberFormat} for handling currency values.
      */
-    public final static NumberFormat getCurrencyInstance() {
+    public static final NumberFormat getCurrencyInstance() {
         return getCurrencyInstance(Locale.getDefault());
     }
 
@@ -363,7 +363,7 @@
      *
      * @return a {@code NumberFormat} for handling integers.
      */
-    public final static NumberFormat getIntegerInstance() {
+    public static final NumberFormat getIntegerInstance() {
         return getIntegerInstance(Locale.getDefault());
     }
 
@@ -387,7 +387,7 @@
      *
      * @return a {@code NumberFormat} for handling {@code Number} objects.
      */
-    public final static NumberFormat getInstance() {
+    public static final NumberFormat getInstance() {
         return getNumberInstance();
     }
 
@@ -403,11 +403,9 @@
         return getNumberInstance(locale);
     }
 
-    // BEGIN android-added
     private static NumberFormat getInstance(String pattern, Locale locale) {
         return new DecimalFormat(pattern, locale);
     }
-    // END android-added
 
     /**
      * Returns the maximum number of fraction digits that are printed when
@@ -458,7 +456,7 @@
      *
      * @return a {@code NumberFormat} for handling {@code Number} objects.
      */
-    public final static NumberFormat getNumberInstance() {
+    public static final NumberFormat getNumberInstance() {
         return getNumberInstance(Locale.getDefault());
     }
 
@@ -484,7 +482,7 @@
      * A value such as 0.53 will be treated as 53%, but 53.0 (or the integer 53) will be
      * treated as 5,300%, which is rarely what you intended.
      */
-    public final static NumberFormat getPercentInstance() {
+    public static final NumberFormat getPercentInstance() {
         return getPercentInstance(Locale.getDefault());
     }
 
@@ -682,17 +680,18 @@
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("groupingUsed", Boolean.TYPE),
-            new ObjectStreamField("maxFractionDigits", Byte.TYPE),
-            new ObjectStreamField("maximumFractionDigits", Integer.TYPE),
-            new ObjectStreamField("maximumIntegerDigits", Integer.TYPE),
-            new ObjectStreamField("maxIntegerDigits", Byte.TYPE),
-            new ObjectStreamField("minFractionDigits", Byte.TYPE),
-            new ObjectStreamField("minimumFractionDigits", Integer.TYPE),
-            new ObjectStreamField("minimumIntegerDigits", Integer.TYPE),
-            new ObjectStreamField("minIntegerDigits", Byte.TYPE),
-            new ObjectStreamField("parseIntegerOnly", Boolean.TYPE),
-            new ObjectStreamField("serialVersionOnStream", Integer.TYPE), };
+        new ObjectStreamField("groupingUsed", boolean.class),
+        new ObjectStreamField("maxFractionDigits", byte.class),
+        new ObjectStreamField("maximumFractionDigits", int.class),
+        new ObjectStreamField("maximumIntegerDigits", int.class),
+        new ObjectStreamField("maxIntegerDigits", byte.class),
+        new ObjectStreamField("minFractionDigits", byte.class),
+        new ObjectStreamField("minimumFractionDigits", int.class),
+        new ObjectStreamField("minimumIntegerDigits", int.class),
+        new ObjectStreamField("minIntegerDigits", byte.class),
+        new ObjectStreamField("parseIntegerOnly", boolean.class),
+        new ObjectStreamField("serialVersionOnStream", int.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
diff --git a/luni/src/main/java/java/text/SimpleDateFormat.java b/luni/src/main/java/java/text/SimpleDateFormat.java
index 869678b..19855b5 100644
--- a/luni/src/main/java/java/text/SimpleDateFormat.java
+++ b/luni/src/main/java/java/text/SimpleDateFormat.java
@@ -21,13 +21,14 @@
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
+import java.util.List;
 import java.util.Locale;
 import java.util.SimpleTimeZone;
 import java.util.TimeZone;
-import java.util.Vector;
 import libcore.icu.LocaleData;
 import libcore.icu.TimeZones;
 
@@ -484,7 +485,7 @@
 
     private AttributedCharacterIterator formatToCharacterIteratorImpl(Date date) {
         StringBuffer buffer = new StringBuffer();
-        Vector<FieldPosition> fields = new Vector<FieldPosition>();
+        ArrayList<FieldPosition> fields = new ArrayList<FieldPosition>();
 
         // format the date, and find fields
         formatImpl(date, buffer, null, fields);
@@ -493,8 +494,7 @@
         AttributedString as = new AttributedString(buffer.toString());
 
         // add DateFormat field attributes to the AttributedString
-        for (int i = 0; i < fields.size(); i++) {
-            FieldPosition pos = fields.elementAt(i);
+        for (FieldPosition pos : fields) {
             Format.Field attribute = pos.getFieldAttribute();
             as.addAttribute(attribute, attribute, pos.getBeginIndex(), pos.getEndIndex());
         }
@@ -510,7 +510,7 @@
      * specified by this FieldPosition is formatted, set the begin and end index
      * of the formatted field in the FieldPosition.
      * <p>
-     * If the Vector {@code fields} is not null, find fields of this
+     * If the list {@code fields} is not null, find fields of this
      * date, set FieldPositions with these fields, and add them to the fields
      * vector.
      *
@@ -522,14 +522,14 @@
      *            FieldPosition to set begin and end index of the field
      *            specified, if it is part of the format for this date
      * @param fields
-     *            Vector used to store the FieldPositions for each field in this
+     *            list used to store the FieldPositions for each field in this
      *            date
      * @return the formatted Date
      * @throws IllegalArgumentException
      *            if the object cannot be formatted by this Format.
      */
     private StringBuffer formatImpl(Date date, StringBuffer buffer,
-            FieldPosition field, Vector<FieldPosition> fields) {
+            FieldPosition field, List<FieldPosition> fields) {
 
         boolean quote = false;
         int next, last = -1, count = 0;
@@ -582,7 +582,7 @@
     }
 
     private void append(StringBuffer buffer, FieldPosition position,
-            Vector<FieldPosition> fields, char format, int count) {
+            List<FieldPosition> fields, char format, int count) {
         int field = -1;
         int index = PATTERN_CHARS.indexOf(format);
         if (index == -1) {
@@ -605,7 +605,7 @@
                  *     http://unicode.org/reports/tr35/
                  */
                 if (count == 2) {
-                    appendNumber(buffer, 2, year %= 100);
+                    appendNumber(buffer, 2, year % 100);
                 } else {
                     appendNumber(buffer, count, year);
                 }
@@ -748,7 +748,7 @@
             }
             // We can't call TimeZone.getDisplayName() because it would not use
             // the custom DateFormatSymbols of this SimpleDateFormat.
-            String custom = TimeZones.lookupDisplayName(formatData.zoneStrings, tz.getID(), daylight, style);
+            String custom = TimeZones.getDisplayName(formatData.zoneStrings, tz.getID(), daylight, style);
             if (custom != null) {
                 buffer.append(custom);
                 return;
@@ -780,6 +780,9 @@
     }
 
     private void appendNumber(StringBuffer buffer, int count, int value) {
+        // TODO: we could avoid using the NumberFormat in most cases for a significant speedup.
+        // The only problem is that we expose the NumberFormat to third-party code, so we'd have
+        // some work to do to work out when the optimization is valid.
         int minimumIntegerDigits = numberFormat.getMinimumIntegerDigits();
         numberFormat.setMinimumIntegerDigits(count);
         numberFormat.format(Integer.valueOf(value), buffer, new FieldPosition(0));
@@ -1268,10 +1271,11 @@
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("defaultCenturyStart", Date.class),
-            new ObjectStreamField("formatData", DateFormatSymbols.class),
-            new ObjectStreamField("pattern", String.class),
-            new ObjectStreamField("serialVersionOnStream", Integer.TYPE), };
+        new ObjectStreamField("defaultCenturyStart", Date.class),
+        new ObjectStreamField("formatData", DateFormatSymbols.class),
+        new ObjectStreamField("pattern", String.class),
+        new ObjectStreamField("serialVersionOnStream", int.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
diff --git a/luni/src/main/java/java/text/StringCharacterIterator.java b/luni/src/main/java/java/text/StringCharacterIterator.java
index 8b0e2b7..13c3543 100644
--- a/luni/src/main/java/java/text/StringCharacterIterator.java
+++ b/luni/src/main/java/java/text/StringCharacterIterator.java
@@ -105,7 +105,7 @@
         try {
             return super.clone();
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/util/AbstractCollection.java b/luni/src/main/java/java/util/AbstractCollection.java
index 5c836eb..7cbdcc0 100644
--- a/luni/src/main/java/java/util/AbstractCollection.java
+++ b/luni/src/main/java/java/util/AbstractCollection.java
@@ -34,7 +34,6 @@
      * Constructs a new instance of this AbstractCollection.
      */
     protected AbstractCollection() {
-        super();
     }
 
     public boolean add(E object) {
diff --git a/luni/src/main/java/java/util/AbstractList.java b/luni/src/main/java/java/util/AbstractList.java
index fe83125..f6e5903 100644
--- a/luni/src/main/java/java/util/AbstractList.java
+++ b/luni/src/main/java/java/util/AbstractList.java
@@ -43,7 +43,6 @@
         int lastPosition = -1;
 
         SimpleListIterator() {
-            super();
             expectedModCount = modCount;
         }
 
@@ -87,10 +86,8 @@
         }
     }
 
-    private final class FullListIterator extends SimpleListIterator implements
-            ListIterator<E> {
+    private final class FullListIterator extends SimpleListIterator implements ListIterator<E> {
         FullListIterator(int start) {
-            super();
             if (start >= 0 && start <= size()) {
                 pos = start - 1;
             } else {
@@ -180,7 +177,6 @@
 
             SubAbstractListIterator(ListIterator<E> it,
                     SubAbstractList<E> list, int offset, int length) {
-                super();
                 iterator = it;
                 subList = list;
                 start = offset;
@@ -239,7 +235,6 @@
         }
 
         SubAbstractList(AbstractList<E> list, int start, int end) {
-            super();
             fullList = list;
             modCount = fullList.modCount;
             offset = start;
@@ -380,7 +375,6 @@
      * Constructs a new instance of this AbstractList.
      */
     protected AbstractList() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/AbstractMap.java b/luni/src/main/java/java/util/AbstractMap.java
index 4789b14..ccfaefe 100644
--- a/luni/src/main/java/java/util/AbstractMap.java
+++ b/luni/src/main/java/java/util/AbstractMap.java
@@ -169,7 +169,6 @@
     }
 
     protected AbstractMap() {
-        super();
     }
 
     /**
@@ -504,4 +503,4 @@
         result.valuesCollection = null;
         return result;
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/main/java/java/util/AbstractSequentialList.java b/luni/src/main/java/java/util/AbstractSequentialList.java
index dcdecaa..3386a5d 100644
--- a/luni/src/main/java/java/util/AbstractSequentialList.java
+++ b/luni/src/main/java/java/util/AbstractSequentialList.java
@@ -30,7 +30,6 @@
      * Constructs a new instance of this AbstractSequentialList.
      */
     protected AbstractSequentialList() {
-        super();
     }
 
     @Override
diff --git a/luni/src/main/java/java/util/AbstractSet.java b/luni/src/main/java/java/util/AbstractSet.java
index b71b05b..a2480ef 100644
--- a/luni/src/main/java/java/util/AbstractSet.java
+++ b/luni/src/main/java/java/util/AbstractSet.java
@@ -31,7 +31,6 @@
      * Constructs a new instance of this AbstractSet.
      */
     protected AbstractSet() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/ArrayList.java b/luni/src/main/java/java/util/ArrayList.java
index c0c51d9..5f848fc 100644
--- a/luni/src/main/java/java/util/ArrayList.java
+++ b/luni/src/main/java/java/util/ArrayList.java
@@ -15,10 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// New implementation: simpler and faster than Harmony implementation.
-// BEGIN android-note
-
 package java.util;
 
 import java.io.IOException;
diff --git a/luni/src/main/java/java/util/Arrays.java b/luni/src/main/java/java/util/Arrays.java
index 8d27f49..26a2872 100644
--- a/luni/src/main/java/java/util/Arrays.java
+++ b/luni/src/main/java/java/util/Arrays.java
@@ -26,15 +26,6 @@
  * @since 1.2
  */
 public class Arrays {
-    // BEGIN android-changed
-    // Replaced Bentely-McIlroy-based sort w/ DualPivotQuicksort
-    // BEGIN android-changed
-
-    // BEGIN android-removed
-    /* Specifies when to switch to insertion sort */
-    // private static final int SIMPLE_LENGTH = 7;
-    // END android-removed
-
     private static class ArrayList<E> extends AbstractList<E> implements
             List<E>, Serializable, RandomAccess {
 
@@ -1737,8 +1728,8 @@
      */
     public static void checkOffsetAndCount(int arrayLength, int offset, int count) {
         if ((offset | count) < 0 || offset > arrayLength || arrayLength - offset < count) {
-            throw new ArrayIndexOutOfBoundsException("offset=" + offset + ", count=" + count +
-                    ", array length=" + arrayLength);
+            throw new ArrayIndexOutOfBoundsException(arrayLength, offset,
+                    count);
         }
     }
 
@@ -1944,7 +1935,7 @@
      *    {@code ((Comparable)first).compareTo(Second)}.
      * If not, you are better off deleting ComparableTimSort to eliminate the
      * code duplication.  In other words, the commented out code below
-     * is the preferable implementation for sorting arrays of comparbles if it
+     * is the preferable implementation for sorting arrays of Comparables if it
      * offers sufficient performance.
      */
 
@@ -1952,10 +1943,9 @@
 //     * A comparator that implements the natural order of a group of
 //     * mutually comparable elements.  Using this comparator saves us
 //     * from duplicating most of the code in this file (one version for
-//     * commparables, one for explicit comparators).
+//     * Comparables, one for explicit comparators).
 //     */
-//    private static final Comparator<Object> NATURAL_ORDER =
-//            new Comparator<Object>() {
+//    private static final Comparator<Object> NATURAL_ORDER = new Comparator<Object>() {
 //        @SuppressWarnings("unchecked")
 //        public int compare(Object first, Object second) {
 //            return ((Comparable<Object>)first).compareTo(second);
@@ -1983,9 +1973,7 @@
      * @see #sort(Object[], int, int)
      */
     public static void sort(Object[] array) {
-        // BEGIN android-changed
         ComparableTimSort.sort(array);
-        // END android-changed
     }
 
     /**
@@ -2009,55 +1997,9 @@
      *                if {@code start < 0} or {@code end > array.length}.
      */
     public static void sort(Object[] array, int start, int end) {
-        // BEGIN android-changed
         ComparableTimSort.sort(array, start, end);
-        // END android-changed
     }
 
-    // BEGIN android-removed
-    /*
-    private static void sort(int start, int end, Object[] array) {
-            ...
-    }
-    private static void swap(int a, int b, Object[] arr) {
-            ...
-    }
-    private static void mergeSort(Object[] in, Object[] out, int start,
-            int end) {
-            ...
-    }
-    private static void mergeSort(Object[] in, Object[] out, int start,
-            int end, Comparator c) {
-            ...
-    }
-    private static int find(Object[] arr, Comparable val, int bnd, int l, int r) {
-            ...
-    }
-    private static int find(Object[] arr, Object val, int bnd, int l, int r,
-            Comparator c) {
-            ...
-    }
-    private static int medChar(int a, int b, int c, String[] arr, int id) {
-            ...
-    }
-    private static int charAt(String str, int i) {
-            ...
-    }
-    private static void copySwap(Object[] src, int from, Object[] dst, int to,
-            int len) {
-            ...
-    }
-    private static void stableStringSort(String[] arr, int start,
-            int end) {
-            ...
-    }
-    private static void stableStringSort(String[] arr, String[] src,
-            String[] dst, int start, int end, int chId) {
-            ...
-    }
-    */
-    // END android-removed
-
     /**
      * Sorts the specified range in the array using the specified {@code Comparator}.
      * All elements must be comparable to each other without a
@@ -2079,11 +2021,8 @@
      * @throws ArrayIndexOutOfBoundsException
      *                if {@code start < 0} or {@code end > array.length}.
      */
-    public static <T> void sort(T[] array, int start, int end,
-            Comparator<? super T> comparator) {
-        // BEGIN android-changed
+    public static <T> void sort(T[] array, int start, int end, Comparator<? super T> comparator) {
         TimSort.sort(array, start, end, comparator);
-        // END android-changed
     }
 
     /**
@@ -2099,9 +2038,7 @@
      *                using the {@code Comparator}.
      */
     public static <T> void sort(T[] array, Comparator<? super T> comparator) {
-        // BEGIN android-changed
         TimSort.sort(array, comparator);
-        // END android-changed
     }
 
     /**
@@ -2123,7 +2060,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 7); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 7);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2153,7 +2090,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 6); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 6);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2183,7 +2120,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 3); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 3);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2213,7 +2150,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 7); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 7);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2243,7 +2180,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 7); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 7);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2273,7 +2210,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 6); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 6);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2303,7 +2240,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 6); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 6);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2333,7 +2270,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 6); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 6);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2363,7 +2300,7 @@
         if (array.length == 0) {
             return "[]";
         }
-        StringBuilder sb = new StringBuilder(array.length * 7); // android-changed
+        StringBuilder sb = new StringBuilder(array.length * 7);
         sb.append('[');
         sb.append(array[0]);
         for (int i = 1; i < array.length; i++) {
@@ -2397,7 +2334,7 @@
             return "null";
         }
         // delegate this to the recursive method
-        StringBuilder buf = new StringBuilder(array.length * 9); // android-changed
+        StringBuilder buf = new StringBuilder(array.length * 9);
         deepToStringImpl(array, new Object[] { array }, buf);
         return buf.toString();
     }
diff --git a/luni/src/main/java/java/util/BitSet.java b/luni/src/main/java/java/util/BitSet.java
index bc76b80..a841315 100644
--- a/luni/src/main/java/java/util/BitSet.java
+++ b/luni/src/main/java/java/util/BitSet.java
@@ -20,227 +20,207 @@
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.Serializable;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.LongBuffer;
+import libcore.io.SizeOf;
 
 /**
- * The {@code BitSet} class implements a bit field. Each element in a
- * {@code BitSet} can be on(1) or off(0). A {@code BitSet} is created with a
- * given size and grows if this size is exceeded. Growth is always rounded to a
- * 64 bit boundary.
+ * The {@code BitSet} class implements a
+ * <a href="http://en.wikipedia.org/wiki/Bit_array">bit array</a>.
+ * Each element is either true or false. A {@code BitSet} is created with a given size and grows
+ * automatically if this size is exceeded.
  */
 public class BitSet implements Serializable, Cloneable {
     private static final long serialVersionUID = 7997698588986878753L;
 
-    private static final int OFFSET = 6;
+    private static final long ALL_ONES = ~0L;
 
-    private static final int ELM_SIZE = 1 << OFFSET;
-
-    private static final int RIGHT_BITS = ELM_SIZE - 1;
-
-    private static final long[] TWO_N_ARRAY = new long[] { 0x1L, 0x2L, 0x4L,
-            0x8L, 0x10L, 0x20L, 0x40L, 0x80L, 0x100L, 0x200L, 0x400L, 0x800L,
-            0x1000L, 0x2000L, 0x4000L, 0x8000L, 0x10000L, 0x20000L, 0x40000L,
-            0x80000L, 0x100000L, 0x200000L, 0x400000L, 0x800000L, 0x1000000L,
-            0x2000000L, 0x4000000L, 0x8000000L, 0x10000000L, 0x20000000L,
-            0x40000000L, 0x80000000L, 0x100000000L, 0x200000000L, 0x400000000L,
-            0x800000000L, 0x1000000000L, 0x2000000000L, 0x4000000000L,
-            0x8000000000L, 0x10000000000L, 0x20000000000L, 0x40000000000L,
-            0x80000000000L, 0x100000000000L, 0x200000000000L, 0x400000000000L,
-            0x800000000000L, 0x1000000000000L, 0x2000000000000L,
-            0x4000000000000L, 0x8000000000000L, 0x10000000000000L,
-            0x20000000000000L, 0x40000000000000L, 0x80000000000000L,
-            0x100000000000000L, 0x200000000000000L, 0x400000000000000L,
-            0x800000000000000L, 0x1000000000000000L, 0x2000000000000000L,
-            0x4000000000000000L, 0x8000000000000000L };
-
+    /**
+     * The bits. Access bit n thus:
+     *
+     *   boolean bit = (bits[n / 64] | (1 << n)) != 0;
+     *
+     * Note that Java's shift operators truncate their rhs to the log2 size of the lhs.
+     * That is, there's no "% 64" needed because it's implicit in the shift.
+     *
+     * TODO: would int[] be significantly more efficient for Android at the moment?
+     */
     private long[] bits;
 
-    private transient boolean needClear;
-
-    private transient int actualArrayLength;
-
-    private transient boolean isLengthActual;
+    /**
+     * The number of elements of 'bits' that are actually in use (non-zero). Amongst other
+     * things, this guarantees that isEmpty is cheap, because we never have to examine the array.
+     */
+    private transient int longCount;
 
     /**
-     * Create a new {@code BitSet} with size equal to 64 bits.
-     *
-     * @see #clear(int)
-     * @see #set(int)
-     * @see #clear()
-     * @see #clear(int, int)
-     * @see #set(int, boolean)
-     * @see #set(int, int)
-     * @see #set(int, int, boolean)
+     * Updates 'longCount' by inspecting 'bits'. Assumes that the new longCount is <= the current
+     * longCount, to avoid scanning large tracts of empty array. This means it's safe to call
+     * directly after a clear operation that may have cleared the highest set bit, but
+     * not safe after an xor operation that may have cleared the highest set bit or
+     * made a new highest set bit. In that case, you'd need to set 'longCount' to a conservative
+     * estimate before calling this method.
+     */
+    private void shrinkSize() {
+        int i = longCount - 1;
+        while (i >= 0 && bits[i] == 0) {
+            --i;
+        }
+        this.longCount = i + 1;
+    }
+
+    /**
+     * Creates a new {@code BitSet} with size equal to 64 bits.
      */
     public BitSet() {
-        bits = new long[1];
-        actualArrayLength = 0;
-        isLengthActual = true;
+        this(new long[1]);
     }
 
     /**
-     * Create a new {@code BitSet} with size equal to nbits. If nbits is not a
-     * multiple of 64, then create a {@code BitSet} with size nbits rounded to
-     * the next closest multiple of 64.
+     * Creates a new {@code BitSet} with size equal to {@code bitCount}, rounded up to
+     * a multiple of 64.
      *
-     * @param nbits
-     *            the size of the bit set.
-     * @throws NegativeArraySizeException
-     *             if {@code nbits} is negative.
-     * @see #clear(int)
-     * @see #set(int)
-     * @see #clear()
-     * @see #clear(int, int)
-     * @see #set(int, boolean)
-     * @see #set(int, int)
-     * @see #set(int, int, boolean)
+     * @throws NegativeArraySizeException if {@code bitCount < 0}.
      */
-    public BitSet(int nbits) {
-        if (nbits < 0) {
+    public BitSet(int bitCount) {
+        if (bitCount < 0) {
             throw new NegativeArraySizeException();
         }
-        bits = new long[(nbits >> OFFSET) + ((nbits & RIGHT_BITS) > 0 ? 1 : 0)];
-        actualArrayLength = 0;
-        isLengthActual = true;
+        this.bits = arrayForBits(bitCount);
+        this.longCount = 0;
     }
 
-    /**
-     * Private constructor called from get(int, int) method
-     *
-     * @param bits
-     *            the size of the bit set
-     */
-    private BitSet(long[] bits, boolean needClear, int actualArrayLength, boolean isLengthActual) {
+    private BitSet(long[] bits) {
         this.bits = bits;
-        this.needClear = needClear;
-        this.actualArrayLength = actualArrayLength;
-        this.isLengthActual = isLengthActual;
+        this.longCount = bits.length;
+        shrinkSize();
     }
 
-    /**
-     * Creates a copy of this {@code BitSet}.
-     *
-     * @return a copy of this {@code BitSet}.
-     */
-    @Override
-    public Object clone() {
+    private static long[] arrayForBits(int bitCount) {
+        return new long[(bitCount + 63)/ 64];
+    }
+
+    @Override public Object clone() {
         try {
             BitSet clone = (BitSet) super.clone();
             clone.bits = bits.clone();
+            clone.shrinkSize();
             return clone;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
-    /**
-     * Compares the argument to this {@code BitSet} and returns whether they are
-     * equal. The object must be an instance of {@code BitSet} with the same
-     * bits set.
-     *
-     * @param obj
-     *            the {@code BitSet} object to compare.
-     * @return a {@code boolean} indicating whether or not this {@code BitSet} and
-     *         {@code obj} are equal.
-     * @see #hashCode
-     */
-    @Override
-    public boolean equals(Object obj) {
-        if (this == obj) {
+    @Override public boolean equals(Object o) {
+        if (this == o) {
             return true;
         }
-        if (obj instanceof BitSet) {
-            long[] bsBits = ((BitSet) obj).bits;
-            int length1 = this.actualArrayLength, length2 = ((BitSet) obj).actualArrayLength;
-            if (this.isLengthActual && ((BitSet) obj).isLengthActual
-                    && length1 != length2) {
+        if (!(o instanceof BitSet)) {
+            return false;
+        }
+        BitSet lhs = (BitSet) o;
+        if (this.longCount != lhs.longCount) {
+            return false;
+        }
+        for (int i = 0; i < longCount; ++i) {
+            if (bits[i] != lhs.bits[i]) {
                 return false;
             }
-            // If one of the BitSets is larger than the other, check to see if
-            // any of its extra bits are set. If so return false.
-            if (length1 <= length2) {
-                for (int i = 0; i < length1; i++) {
-                    if (bits[i] != bsBits[i]) {
-                        return false;
-                    }
-                }
-                for (int i = length1; i < length2; i++) {
-                    if (bsBits[i] != 0) {
-                        return false;
-                    }
-                }
-            } else {
-                for (int i = 0; i < length2; i++) {
-                    if (bits[i] != bsBits[i]) {
-                        return false;
-                    }
-                }
-                for (int i = length2; i < length1; i++) {
-                    if (bits[i] != 0) {
-                        return false;
-                    }
-                }
-            }
-            return true;
         }
-        return false;
+        return true;
     }
 
     /**
-     * Increase the size of the internal array to accommodate {@code len} bits.
-     * The new array max index will be a multiple of 64.
-     *
-     * @param len
-     *            the index the new array needs to be able to access.
+     * Ensures that our long[] can hold at least 64 * desiredLongCount bits.
      */
-    private final void growLength(int len) {
-        long[] tempBits = new long[Math.max(len, bits.length * 2)];
-        System.arraycopy(bits, 0, tempBits, 0, this.actualArrayLength);
-        bits = tempBits;
+    private void ensureCapacity(int desiredLongCount) {
+        if (desiredLongCount <= bits.length) {
+            return;
+        }
+        int newLength = Math.max(desiredLongCount, bits.length * 2);
+        long[] newBits = new long[newLength];
+        System.arraycopy(bits, 0, newBits, 0, longCount);
+        this.bits = newBits;
+        // 'longCount' is unchanged by this operation: the long[] is larger,
+        // but you're not yet using any more of it.
     }
 
-    /**
-     * Computes the hash code for this {@code BitSet}. If two {@code BitSet}s are equal
-     * the have to return the same result for {@code hashCode()}.
-     *
-     * @return the {@code int} representing the hash code for this bit
-     *         set.
-     * @see #equals
-     * @see java.util.Hashtable
-     */
-    @Override
-    public int hashCode() {
+    @Override public int hashCode() {
+        // The RI doesn't use Arrays.hashCode, and explicitly specifies this algorithm.
         long x = 1234;
-        for (int i = 0, length = actualArrayLength; i < length; i++) {
+        for (int i = 0; i < longCount; ++i) {
             x ^= bits[i] * (i + 1);
         }
         return (int) ((x >> 32) ^ x);
     }
 
     /**
-     * Retrieves the bit at index {@code index}. Grows the {@code BitSet} if
-     * {@code index > size}.
+     * Returns the bit at index {@code index}. Indexes greater than the current length return false.
      *
-     * @param index
-     *            the index of the bit to be retrieved.
-     * @return {@code true} if the bit at {@code index} is set,
-     *         {@code false} otherwise.
-     * @throws IndexOutOfBoundsException
-     *             if {@code index} is negative.
-     * @see #clear(int)
-     * @see #set(int)
-     * @see #clear()
-     * @see #clear(int, int)
-     * @see #set(int, boolean)
-     * @see #set(int, int)
-     * @see #set(int, int, boolean)
+     * @throws IndexOutOfBoundsException if {@code index < 0}.
      */
     public boolean get(int index) {
-        checkIndex(index);
-        int arrayPos = index >> OFFSET;
-        if (arrayPos < actualArrayLength) {
-            return (bits[arrayPos] & TWO_N_ARRAY[index & RIGHT_BITS]) != 0;
+        if (index < 0) { // TODO: until we have an inlining JIT.
+            checkIndex(index);
         }
-        return false;
+        int arrayIndex = index / 64;
+        if (arrayIndex >= longCount) {
+            return false;
+        }
+        return (bits[arrayIndex] & (1L << index)) != 0;
+    }
+
+    /**
+     * Sets the bit at index {@code index} to true.
+     *
+     * @throws IndexOutOfBoundsException if {@code index < 0}.
+     */
+    public void set(int index) {
+        if (index < 0) { // TODO: until we have an inlining JIT.
+            checkIndex(index);
+        }
+        int arrayIndex = index / 64;
+        if (arrayIndex >= bits.length) {
+            ensureCapacity(arrayIndex + 1);
+        }
+        bits[arrayIndex] |= (1L << index);
+        longCount = Math.max(longCount, arrayIndex + 1);
+    }
+
+    /**
+     * Clears the bit at index {@code index}.
+     *
+     * @throws IndexOutOfBoundsException if {@code index < 0}.
+     */
+    public void clear(int index) {
+        if (index < 0) { // TODO: until we have an inlining JIT.
+            checkIndex(index);
+        }
+        int arrayIndex = index / 64;
+        if (arrayIndex >= longCount) {
+            return;
+        }
+        bits[arrayIndex] &= ~(1L << index);
+        shrinkSize();
+    }
+
+    /**
+     * Flips the bit at index {@code index}.
+     *
+     * @throws IndexOutOfBoundsException if {@code index < 0}.
+     */
+    public void flip(int index) {
+        if (index < 0) { // TODO: until we have an inlining JIT.
+            checkIndex(index);
+        }
+        int arrayIndex = index / 64;
+        if (arrayIndex >= bits.length) {
+            ensureCapacity(arrayIndex + 1);
+        }
+        bits[arrayIndex] ^= (1L << index);
+        longCount = Math.max(longCount, arrayIndex + 1);
+        shrinkSize();
     }
 
     private void checkIndex(int index) {
@@ -256,23 +236,18 @@
     }
 
     /**
-     * Retrieves the bits starting from {@code fromIndex} to {@code toIndex} and returns
-     * back a new bitset made of these bits. Grows the {@code BitSet} if {@code toIndex > size}.
+     * Returns a new {@code BitSet} containing the
+     * range of bits {@code [fromIndex, toIndex)}, shifted down so that the bit
+     * at {@code fromIndex} is at bit 0 in the new {@code BitSet}.
      *
-     * @param fromIndex
-     *            inclusive beginning position.
-     * @param toIndex
-     *            exclusive ending position.
-     * @return new bitset of the range specified.
      * @throws IndexOutOfBoundsException
      *             if {@code fromIndex} or {@code toIndex} is negative, or if
      *             {@code toIndex} is smaller than {@code fromIndex}.
-     * @see #get(int)
      */
     public BitSet get(int fromIndex, int toIndex) {
         checkRange(fromIndex, toIndex);
 
-        int last = actualArrayLength << OFFSET;
+        int last = 64 * longCount;
         if (fromIndex >= last || fromIndex == toIndex) {
             return new BitSet(0);
         }
@@ -280,91 +255,59 @@
             toIndex = last;
         }
 
-        int idx1 = fromIndex >> OFFSET;
-        int idx2 = (toIndex - 1) >> OFFSET;
-        long factor1 = (~0L) << (fromIndex & RIGHT_BITS);
-        long factor2 = (~0L) >>> (ELM_SIZE - (toIndex & RIGHT_BITS));
+        int firstArrayIndex = fromIndex / 64;
+        int lastArrayIndex = (toIndex - 1) / 64;
+        long lowMask = ALL_ONES << fromIndex;
+        long highMask = ALL_ONES >>> -toIndex;
 
-        if (idx1 == idx2) {
-            long result = (bits[idx1] & (factor1 & factor2)) >>> (fromIndex % ELM_SIZE);
+        if (firstArrayIndex == lastArrayIndex) {
+            long result = (bits[firstArrayIndex] & (lowMask & highMask)) >>> fromIndex;
             if (result == 0) {
                 return new BitSet(0);
             }
-            return new BitSet(new long[] { result }, needClear, 1, true);
-        }
-        long[] newbits = new long[idx2 - idx1 + 1];
-        // first fill in the first and last indexes in the new bitset
-        newbits[0] = bits[idx1] & factor1;
-        newbits[newbits.length - 1] = bits[idx2] & factor2;
-
-        // fill in the in between elements of the new bitset
-        for (int i = 1; i < idx2 - idx1; i++) {
-            newbits[i] = bits[idx1 + i];
+            return new BitSet(new long[] { result });
         }
 
-        // shift all the elements in the new bitset to the right by fromIndex % ELM_SIZE
-        int numBitsToShift = fromIndex & RIGHT_BITS;
-        int actualLen = newbits.length;
+        long[] newBits = new long[lastArrayIndex - firstArrayIndex + 1];
+
+        // first fill in the first and last indexes in the new BitSet
+        newBits[0] = bits[firstArrayIndex] & lowMask;
+        newBits[newBits.length - 1] = bits[lastArrayIndex] & highMask;
+
+        // fill in the in between elements of the new BitSet
+        for (int i = 1; i < lastArrayIndex - firstArrayIndex; i++) {
+            newBits[i] = bits[firstArrayIndex + i];
+        }
+
+        // shift all the elements in the new BitSet to the right
+        int numBitsToShift = fromIndex % 64;
+        int actualLen = newBits.length;
         if (numBitsToShift != 0) {
-            for (int i = 0; i < newbits.length; i++) {
+            for (int i = 0; i < newBits.length; i++) {
                 // shift the current element to the right regardless of
                 // sign
-                newbits[i] = newbits[i] >>> (numBitsToShift);
+                newBits[i] = newBits[i] >>> (numBitsToShift);
 
-                // apply the last x bits of newbits[i+1] to the current
+                // apply the last x bits of newBits[i+1] to the current
                 // element
-                if (i != newbits.length - 1) {
-                    newbits[i] |= newbits[i + 1] << (ELM_SIZE - (numBitsToShift));
+                if (i != newBits.length - 1) {
+                    newBits[i] |= newBits[i + 1] << -numBitsToShift;
                 }
-                if (newbits[i] != 0) {
+                if (newBits[i] != 0) {
                     actualLen = i + 1;
                 }
             }
         }
-        return new BitSet(newbits, needClear, actualLen,
-                newbits[actualLen - 1] != 0);
+        return new BitSet(newBits);
     }
 
     /**
-     * Sets the bit at index {@code index} to 1. Grows the {@code BitSet} if
-     * {@code index > size}.
+     * Sets the bit at index {@code index} to {@code state}.
      *
-     * @param index
-     *            the index of the bit to set.
-     * @throws IndexOutOfBoundsException
-     *             if {@code index} is negative.
-     * @see #clear(int)
-     * @see #clear()
-     * @see #clear(int, int)
+     * @throws IndexOutOfBoundsException if {@code index < 0}.
      */
-    public void set(int index) {
-        checkIndex(index);
-        int len = (index >> OFFSET) + 1;
-        if (len > bits.length) {
-            growLength(len);
-        }
-        bits[len - 1] |= TWO_N_ARRAY[index & RIGHT_BITS];
-        if (len > actualArrayLength) {
-            actualArrayLength = len;
-            isLengthActual = true;
-        }
-        needClear();
-    }
-
-    /**
-     * Sets the bit at index {@code index} to {@code val}. Grows the
-     * {@code BitSet} if {@code index > size}.
-     *
-     * @param index
-     *            the index of the bit to set.
-     * @param val
-     *            value to set the bit.
-     * @throws IndexOutOfBoundsException
-     *             if {@code index} is negative.
-     * @see #set(int)
-     */
-    public void set(int index, boolean val) {
-        if (val) {
+    public void set(int index, boolean state) {
+        if (state) {
             set(index);
         } else {
             clear(index);
@@ -372,71 +315,14 @@
     }
 
     /**
-     * Sets the bits starting from {@code fromIndex} to {@code toIndex}. Grows the
-     * {@code BitSet} if {@code toIndex > size}.
+     * Sets the range of bits {@code [fromIndex, toIndex)} to {@code state}.
      *
-     * @param fromIndex
-     *            inclusive beginning position.
-     * @param toIndex
-     *            exclusive ending position.
      * @throws IndexOutOfBoundsException
      *             if {@code fromIndex} or {@code toIndex} is negative, or if
      *             {@code toIndex} is smaller than {@code fromIndex}.
-     * @see #set(int)
      */
-    public void set(int fromIndex, int toIndex) {
-        checkRange(fromIndex, toIndex);
-
-        if (fromIndex == toIndex) {
-            return;
-        }
-        int len2 = ((toIndex - 1) >> OFFSET) + 1;
-        if (len2 > bits.length) {
-            growLength(len2);
-        }
-
-        int idx1 = fromIndex >> OFFSET;
-        int idx2 = (toIndex - 1) >> OFFSET;
-        long factor1 = (~0L) << (fromIndex & RIGHT_BITS);
-        long factor2 = (~0L) >>> (ELM_SIZE - (toIndex & RIGHT_BITS));
-
-        if (idx1 == idx2) {
-            bits[idx1] |= (factor1 & factor2);
-        } else {
-            bits[idx1] |= factor1;
-            bits[idx2] |= factor2;
-            for (int i = idx1 + 1; i < idx2; i++) {
-                bits[i] |= (~0L);
-            }
-        }
-        if (idx2 + 1 > actualArrayLength) {
-            actualArrayLength = idx2 + 1;
-            isLengthActual = true;
-        }
-        needClear();
-    }
-
-    private void needClear() {
-        this.needClear = true;
-    }
-
-    /**
-     * Sets the bits starting from {@code fromIndex} to {@code toIndex} to the given
-     * {@code val}. Grows the {@code BitSet} if {@code toIndex > size}.
-     *
-     * @param fromIndex
-     *            inclusive beginning position.
-     * @param toIndex
-     *            exclusive ending position.
-     * @param val
-     *            value to set these bits.
-     * @throws IndexOutOfBoundsException
-     *             if {@code fromIndex} or {@code toIndex} is negative, or if
-     *             {@code toIndex} is smaller than {@code fromIndex}.
-     * @see #set(int,int)
-     */
-    public void set(int fromIndex, int toIndex, boolean val) {
-        if (val) {
+    public void set(int fromIndex, int toIndex, boolean state) {
+        if (state) {
             set(fromIndex, toIndex);
         } else {
             clear(fromIndex, toIndex);
@@ -444,383 +330,231 @@
     }
 
     /**
-     * Clears all the bits in this {@code BitSet}.
-     *
-     * @see #clear(int)
-     * @see #clear(int, int)
+     * Clears all the bits in this {@code BitSet}. This method does not change the capacity.
+     * Use {@code clear} if you want to reuse this {@code BitSet} with the same capacity, but
+     * create a new {@code BitSet} if you're trying to potentially reclaim memory.
      */
     public void clear() {
-        if (needClear) {
-            for (int i = 0; i < bits.length; i++) {
-                bits[i] = 0L;
-            }
-            actualArrayLength = 0;
-            isLengthActual = true;
-            needClear = false;
-        }
+        Arrays.fill(bits, 0, longCount, 0L);
+        longCount = 0;
     }
 
     /**
-     * Clears the bit at index {@code index}. Grows the {@code BitSet} if
-     * {@code index > size}.
+     * Sets the range of bits {@code [fromIndex, toIndex)}.
      *
-     * @param index
-     *            the index of the bit to clear.
-     * @throws IndexOutOfBoundsException
-     *             if {@code index} is negative.
-     * @see #clear(int, int)
-     */
-    public void clear(int index) {
-        checkIndex(index);
-        if (!needClear) {
-            return;
-        }
-        int arrayPos = index >> OFFSET;
-        if (arrayPos < actualArrayLength) {
-            bits[arrayPos] &= ~(TWO_N_ARRAY[index & RIGHT_BITS]);
-            if (bits[actualArrayLength - 1] == 0) {
-                isLengthActual = false;
-            }
-        }
-    }
-
-    /**
-     * Clears the bits starting from {@code fromIndex} to {@code toIndex}. Grows the
-     * {@code BitSet} if {@code toIndex > size}.
-     *
-     * @param fromIndex
-     *            inclusive beginning position.
-     * @param toIndex
-     *            exclusive ending position.
      * @throws IndexOutOfBoundsException
      *             if {@code fromIndex} or {@code toIndex} is negative, or if
      *             {@code toIndex} is smaller than {@code fromIndex}.
-     * @see #clear(int)
+     */
+    public void set(int fromIndex, int toIndex) {
+        checkRange(fromIndex, toIndex);
+        if (fromIndex == toIndex) {
+            return;
+        }
+        int firstArrayIndex = fromIndex / 64;
+        int lastArrayIndex = (toIndex - 1) / 64;
+        if (lastArrayIndex >= bits.length) {
+            ensureCapacity(lastArrayIndex + 1);
+        }
+
+        long lowMask = ALL_ONES << fromIndex;
+        long highMask = ALL_ONES >>> -toIndex;
+        if (firstArrayIndex == lastArrayIndex) {
+            bits[firstArrayIndex] |= (lowMask & highMask);
+        } else {
+            int i = firstArrayIndex;
+            bits[i++] |= lowMask;
+            while (i < lastArrayIndex) {
+                bits[i++] |= ALL_ONES;
+            }
+            bits[i++] |= highMask;
+        }
+        longCount = Math.max(longCount, lastArrayIndex + 1);
+    }
+
+    /**
+     * Clears the range of bits {@code [fromIndex, toIndex)}.
+     *
+     * @throws IndexOutOfBoundsException
+     *             if {@code fromIndex} or {@code toIndex} is negative, or if
+     *             {@code toIndex} is smaller than {@code fromIndex}.
      */
     public void clear(int fromIndex, int toIndex) {
         checkRange(fromIndex, toIndex);
-
-        if (!needClear) {
+        if (fromIndex == toIndex || longCount == 0) {
             return;
         }
-        int last = (actualArrayLength << OFFSET);
-        if (fromIndex >= last || fromIndex == toIndex) {
+        int last = 64 * longCount;
+        if (fromIndex >= last) {
             return;
         }
         if (toIndex > last) {
             toIndex = last;
         }
+        int firstArrayIndex = fromIndex / 64;
+        int lastArrayIndex = (toIndex - 1) / 64;
 
-        int idx1 = fromIndex >> OFFSET;
-        int idx2 = (toIndex - 1) >> OFFSET;
-        long factor1 = (~0L) << (fromIndex & RIGHT_BITS);
-        long factor2 = (~0L) >>> (ELM_SIZE - (toIndex & RIGHT_BITS));
-
-        if (idx1 == idx2) {
-            bits[idx1] &= ~(factor1 & factor2);
+        long lowMask = ALL_ONES << fromIndex;
+        long highMask = ALL_ONES >>> -toIndex;
+        if (firstArrayIndex == lastArrayIndex) {
+            bits[firstArrayIndex] &= ~(lowMask & highMask);
         } else {
-            bits[idx1] &= ~factor1;
-            bits[idx2] &= ~factor2;
-            for (int i = idx1 + 1; i < idx2; i++) {
-                bits[i] = 0L;
+            int i = firstArrayIndex;
+            bits[i++] &= ~lowMask;
+            while (i < lastArrayIndex) {
+                bits[i++] = 0L;
             }
+            bits[i++] &= ~highMask;
         }
-        if ((actualArrayLength > 0) && (bits[actualArrayLength - 1] == 0)) {
-            isLengthActual = false;
-        }
+        shrinkSize();
     }
 
     /**
-     * Flips the bit at index {@code index}. Grows the {@code BitSet} if
-     * {@code index > size}.
+     * Flips the range of bits {@code [fromIndex, toIndex)}.
      *
-     * @param index
-     *            the index of the bit to flip.
-     * @throws IndexOutOfBoundsException
-     *             if {@code index} is negative.
-     * @see #flip(int, int)
-     */
-    public void flip(int index) {
-        checkIndex(index);
-        int len = (index >> OFFSET) + 1;
-        if (len > bits.length) {
-            growLength(len);
-        }
-        bits[len - 1] ^= TWO_N_ARRAY[index & RIGHT_BITS];
-        if (len > actualArrayLength) {
-            actualArrayLength = len;
-        }
-        isLengthActual = !((actualArrayLength > 0) && (bits[actualArrayLength - 1] == 0));
-        needClear();
-    }
-
-    /**
-     * Flips the bits starting from {@code fromIndex} to {@code toIndex}. Grows the
-     * {@code BitSet} if {@code toIndex > size}.
-     *
-     * @param fromIndex
-     *            inclusive beginning position.
-     * @param toIndex
-     *            exclusive ending position.
      * @throws IndexOutOfBoundsException
      *             if {@code fromIndex} or {@code toIndex} is negative, or if
      *             {@code toIndex} is smaller than {@code fromIndex}.
-     * @see #flip(int)
      */
     public void flip(int fromIndex, int toIndex) {
         checkRange(fromIndex, toIndex);
-
         if (fromIndex == toIndex) {
             return;
         }
-        int len2 = ((toIndex - 1) >> OFFSET) + 1;
-        if (len2 > bits.length) {
-            growLength(len2);
+        int firstArrayIndex = fromIndex / 64;
+        int lastArrayIndex = (toIndex - 1) / 64;
+        if (lastArrayIndex >= bits.length) {
+            ensureCapacity(lastArrayIndex + 1);
         }
 
-        int idx1 = fromIndex >> OFFSET;
-        int idx2 = (toIndex - 1) >> OFFSET;
-        long factor1 = (~0L) << (fromIndex & RIGHT_BITS);
-        long factor2 = (~0L) >>> (ELM_SIZE - (toIndex & RIGHT_BITS));
-
-        if (idx1 == idx2) {
-            bits[idx1] ^= (factor1 & factor2);
+        long lowMask = ALL_ONES << fromIndex;
+        long highMask = ALL_ONES >>> -toIndex;
+        if (firstArrayIndex == lastArrayIndex) {
+            bits[firstArrayIndex] ^= (lowMask & highMask);
         } else {
-            bits[idx1] ^= factor1;
-            bits[idx2] ^= factor2;
-            for (int i = idx1 + 1; i < idx2; i++) {
-                bits[i] ^= (~0L);
+            int i = firstArrayIndex;
+            bits[i++] ^= lowMask;
+            while (i < lastArrayIndex) {
+                bits[i++] ^= ALL_ONES;
             }
+            bits[i++] ^= highMask;
         }
-        if (len2 > actualArrayLength) {
-            actualArrayLength = len2;
-        }
-        isLengthActual = !((actualArrayLength > 0) && (bits[actualArrayLength - 1] == 0));
-        needClear();
+        longCount = Math.max(longCount, lastArrayIndex + 1);
+        shrinkSize();
     }
 
     /**
-     * Checks if these two {@code BitSet}s have at least one bit set to true in the same
-     * position.
-     *
-     * @param bs
-     *            {@code BitSet} used to calculate the intersection.
-     * @return {@code true} if bs intersects with this {@code BitSet},
-     *         {@code false} otherwise.
+     * Returns true if {@code this.and(bs)} is non-empty, but may be faster than computing that.
      */
     public boolean intersects(BitSet bs) {
         long[] bsBits = bs.bits;
-        int length1 = actualArrayLength, length2 = bs.actualArrayLength;
-
-        if (length1 <= length2) {
-            for (int i = 0; i < length1; i++) {
-                if ((bits[i] & bsBits[i]) != 0L) {
-                    return true;
-                }
-            }
-        } else {
-            for (int i = 0; i < length2; i++) {
-                if ((bits[i] & bsBits[i]) != 0L) {
-                    return true;
-                }
+        int length = Math.min(this.longCount, bs.longCount);
+        for (int i = 0; i < length; ++i) {
+            if ((bits[i] & bsBits[i]) != 0L) {
+                return true;
             }
         }
-
         return false;
     }
 
     /**
-     * Performs the logical AND of this {@code BitSet} with another
-     * {@code BitSet}. The values of this {@code BitSet} are changed accordingly.
-     *
-     * @param bs
-     *            {@code BitSet} to AND with.
-     * @see #or
-     * @see #xor
+     * Logically ands the bits of this {@code BitSet} with {@code bs}.
      */
     public void and(BitSet bs) {
-        long[] bsBits = bs.bits;
-        if (!needClear) {
-            return;
+        int minSize = Math.min(this.longCount, bs.longCount);
+        for (int i = 0; i < minSize; ++i) {
+            bits[i] &= bs.bits[i];
         }
-        int length1 = actualArrayLength, length2 = bs.actualArrayLength;
-        if (length1 <= length2) {
-            for (int i = 0; i < length1; i++) {
-                bits[i] &= bsBits[i];
-            }
-        } else {
-            for (int i = 0; i < length2; i++) {
-                bits[i] &= bsBits[i];
-            }
-            for (int i = length2; i < length1; i++) {
-                bits[i] = 0;
-            }
-            actualArrayLength = length2;
-        }
-        isLengthActual = !((actualArrayLength > 0) && (bits[actualArrayLength - 1] == 0));
+        Arrays.fill(bits, minSize, longCount, 0L);
+        shrinkSize();
     }
 
     /**
-     * Clears all bits in the receiver which are also set in the parameter
-     * {@code BitSet}. The values of this {@code BitSet} are changed accordingly.
-     *
-     * @param bs
-     *            {@code BitSet} to ANDNOT with.
+     * Clears all bits in this {@code BitSet} which are also set in {@code bs}.
      */
     public void andNot(BitSet bs) {
-        long[] bsBits = bs.bits;
-        if (!needClear) {
-            return;
+        int minSize = Math.min(this.longCount, bs.longCount);
+        for (int i = 0; i < minSize; ++i) {
+            bits[i] &= ~bs.bits[i];
         }
-        int range = actualArrayLength < bs.actualArrayLength ? actualArrayLength
-                : bs.actualArrayLength;
-        for (int i = 0; i < range; i++) {
-            bits[i] &= ~bsBits[i];
-        }
-
-        if (actualArrayLength < range) {
-            actualArrayLength = range;
-        }
-        isLengthActual = !((actualArrayLength > 0) && (bits[actualArrayLength - 1] == 0));
+        shrinkSize();
     }
 
     /**
-     * Performs the logical OR of this {@code BitSet} with another {@code BitSet}.
-     * The values of this {@code BitSet} are changed accordingly.
-     *
-     * @param bs
-     *            {@code BitSet} to OR with.
-     * @see #xor
-     * @see #and
+     * Logically ors the bits of this {@code BitSet} with {@code bs}.
      */
     public void or(BitSet bs) {
-        int bsActualLen = bs.getActualArrayLength();
-        if (bsActualLen > bits.length) {
-            long[] tempBits = new long[bsActualLen];
-            System.arraycopy(bs.bits, 0, tempBits, 0, bs.actualArrayLength);
-            for (int i = 0; i < actualArrayLength; i++) {
-                tempBits[i] |= bits[i];
-            }
-            bits = tempBits;
-            actualArrayLength = bsActualLen;
-            isLengthActual = true;
-        } else {
-            long[] bsBits = bs.bits;
-            for (int i = 0; i < bsActualLen; i++) {
-                bits[i] |= bsBits[i];
-            }
-            if (bsActualLen > actualArrayLength) {
-                actualArrayLength = bsActualLen;
-                isLengthActual = true;
-            }
+        int minSize = Math.min(this.longCount, bs.longCount);
+        int maxSize = Math.max(this.longCount, bs.longCount);
+        ensureCapacity(maxSize);
+        for (int i = 0; i < minSize; ++i) {
+            bits[i] |= bs.bits[i];
         }
-        needClear();
+        if (bs.longCount > minSize) {
+            System.arraycopy(bs.bits, minSize, bits, minSize, maxSize - minSize);
+        }
+        longCount = maxSize;
     }
 
     /**
-     * Performs the logical XOR of this {@code BitSet} with another {@code BitSet}.
-     * The values of this {@code BitSet} are changed accordingly.
-     *
-     * @param bs
-     *            {@code BitSet} to XOR with.
-     * @see #or
-     * @see #and
+     * Logically xors the bits of this {@code BitSet} with {@code bs}.
      */
     public void xor(BitSet bs) {
-        int bsActualLen = bs.getActualArrayLength();
-        if (bsActualLen > bits.length) {
-            long[] tempBits = new long[bsActualLen];
-            System.arraycopy(bs.bits, 0, tempBits, 0, bs.actualArrayLength);
-            for (int i = 0; i < actualArrayLength; i++) {
-                tempBits[i] ^= bits[i];
-            }
-            bits = tempBits;
-            actualArrayLength = bsActualLen;
-            isLengthActual = !((actualArrayLength > 0) && (bits[actualArrayLength - 1] == 0));
-        } else {
-            long[] bsBits = bs.bits;
-            for (int i = 0; i < bsActualLen; i++) {
-                bits[i] ^= bsBits[i];
-            }
-            if (bsActualLen > actualArrayLength) {
-                actualArrayLength = bsActualLen;
-                isLengthActual = true;
-            }
+        int minSize = Math.min(this.longCount, bs.longCount);
+        int maxSize = Math.max(this.longCount, bs.longCount);
+        ensureCapacity(maxSize);
+        for (int i = 0; i < minSize; ++i) {
+            bits[i] ^= bs.bits[i];
         }
-        needClear();
+        if (bs.longCount > minSize) {
+            System.arraycopy(bs.bits, minSize, bits, minSize, maxSize - minSize);
+        }
+        longCount = maxSize;
+        shrinkSize();
     }
 
     /**
-     * Returns the number of bits this {@code BitSet} has.
-     *
-     * @return the number of bits contained in this {@code BitSet}.
-     * @see #length
+     * Returns the capacity in bits of the array implementing this {@code BitSet}. This is
+     * unrelated to the length of the {@code BitSet}, and not generally useful.
+     * Use {@link #nextSetBit} to iterate, or {@link #length} to find the highest set bit.
      */
     public int size() {
-        return bits.length << OFFSET;
+        return bits.length * 64;
     }
 
     /**
-     * Returns the number of bits up to and including the highest bit set.
-     *
-     * @return the length of the {@code BitSet}.
+     * Returns the number of bits up to and including the highest bit set. This is unrelated to
+     * the {@link #size} of the {@code BitSet}.
      */
     public int length() {
-        int idx = actualArrayLength - 1;
-        while (idx >= 0 && bits[idx] == 0) {
-            --idx;
-        }
-        actualArrayLength = idx + 1;
-        if (idx == -1) {
+        if (longCount == 0) {
             return 0;
         }
-        int i = ELM_SIZE - 1;
-        long val = bits[idx];
-        while ((val & (TWO_N_ARRAY[i])) == 0 && i > 0) {
-            i--;
-        }
-        return (idx << OFFSET) + i + 1;
-    }
-
-    private final int getActualArrayLength() {
-        if (isLengthActual) {
-            return actualArrayLength;
-        }
-        int idx = actualArrayLength - 1;
-        while (idx >= 0 && bits[idx] == 0) {
-            --idx;
-        }
-        actualArrayLength = idx + 1;
-        isLengthActual = true;
-        return actualArrayLength;
+        return 64 * (longCount - 1) + (64 - Long.numberOfLeadingZeros(bits[longCount - 1]));
     }
 
     /**
      * Returns a string containing a concise, human-readable description of the
-     * receiver.
-     *
-     * @return a comma delimited list of the indices of all bits that are set.
+     * receiver: a comma-delimited list of the indexes of all set bits.
+     * For example: {@code "{0,1,8}"}.
      */
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder(bits.length / 2);
-        int bitCount = 0;
+    @Override public String toString() {
+        //System.err.println("BitSet[longCount=" + longCount + ",bits=" + Arrays.toString(bits) + "]");
+        StringBuilder sb = new StringBuilder(longCount / 2);
         sb.append('{');
         boolean comma = false;
-        for (int i = 0; i < bits.length; i++) {
-            if (bits[i] == 0) {
-                bitCount += ELM_SIZE;
-                continue;
-            }
-            for (int j = 0; j < ELM_SIZE; j++) {
-                if (((bits[i] & (TWO_N_ARRAY[j])) != 0)) {
-                    if (comma) {
-                        sb.append(", ");
+        for (int i = 0; i < longCount; ++i) {
+            if (bits[i] != 0) {
+                for (int j = 0; j < 64; ++j) {
+                    if ((bits[i] & 1L << j) != 0) {
+                        if (comma) {
+                            sb.append(", ");
+                        } else {
+                            comma = true;
+                        }
+                        sb.append(64 * i + j);
                     }
-                    sb.append(bitCount);
-                    comma = true;
                 }
-                bitCount++;
             }
         }
         sb.append('}');
@@ -828,149 +562,192 @@
     }
 
     /**
-     * Returns the position of the first bit that is {@code true} on or after {@code index}.
-     *
-     * @param index
-     *            the starting position (inclusive).
-     * @return -1 if there is no bits that are set to {@code true} on or after {@code index}.
+     * Returns the index of the first bit that is set on or after {@code index}, or -1
+     * if no higher bits are set.
+     * @throws IndexOutOfBoundsException if {@code index < 0}.
      */
     public int nextSetBit(int index) {
         checkIndex(index);
-
-        if (index >= actualArrayLength << OFFSET) {
+        int arrayIndex = index / 64;
+        if (arrayIndex >= longCount) {
             return -1;
         }
-
-        int idx = index >> OFFSET;
-        // first check in the same bit set element
-        if (bits[idx] != 0L) {
-            for (int j = index & RIGHT_BITS; j < ELM_SIZE; j++) {
-                if (((bits[idx] & (TWO_N_ARRAY[j])) != 0)) {
-                    return (idx << OFFSET) + j;
-                }
-            }
-
+        long mask = ALL_ONES << index;
+        if ((bits[arrayIndex] & mask) != 0) {
+            return 64 * arrayIndex + Long.numberOfTrailingZeros(bits[arrayIndex] & mask);
         }
-        idx++;
-        while (idx < actualArrayLength && bits[idx] == 0L) {
-            idx++;
+        while (++arrayIndex < longCount && bits[arrayIndex] == 0) {
         }
-        if (idx == actualArrayLength) {
+        if (arrayIndex == longCount) {
             return -1;
         }
+        return 64 * arrayIndex + Long.numberOfTrailingZeros(bits[arrayIndex]);
+    }
 
-        // we know for sure there is a bit set to true in this element
-        // since the bitset value is not 0L
-        for (int j = 0; j < ELM_SIZE; j++) {
-            if (((bits[idx] & (TWO_N_ARRAY[j])) != 0)) {
-                return (idx << OFFSET) + j;
+    /**
+     * Returns the index of the first bit that is clear on or after {@code index}.
+     * Since all bits past the end are implicitly clear, this never returns -1.
+     * @throws IndexOutOfBoundsException if {@code index < 0}.
+     */
+    public int nextClearBit(int index) {
+        checkIndex(index);
+        int arrayIndex = index / 64;
+        if (arrayIndex >= longCount) {
+            return index;
+        }
+        long mask = ALL_ONES << index;
+        if ((~bits[arrayIndex] & mask) != 0) {
+            return 64 * arrayIndex + Long.numberOfTrailingZeros(~bits[arrayIndex] & mask);
+        }
+        while (++arrayIndex < longCount && bits[arrayIndex] == ALL_ONES) {
+        }
+        if (arrayIndex == longCount) {
+            return size();
+        }
+        return 64 * arrayIndex + Long.numberOfTrailingZeros(~bits[arrayIndex]);
+    }
+
+    /**
+     * Returns the index of the first bit that is set on or before {@code index}, or -1 if
+     * no lower bits are set or {@code index == -1}.
+     * @throws IndexOutOfBoundsException if {@code index < -1}.
+     * @hide 1.7
+     */
+    public int previousSetBit(int index) {
+        if (index == -1) {
+            return -1;
+        }
+        checkIndex(index);
+        // TODO: optimize this.
+        for (int i = index; i >= 0; --i) {
+            if (get(i)) {
+                return i;
             }
         }
-
         return -1;
     }
 
     /**
-     * Returns the position of the first bit that is {@code false} on or after {@code index}.
-     *
-     * @param index
-     *            the starting position (inclusive).
-     * @return the position of the next bit set to {@code false}, even if it is further
-     *         than this {@code BitSet}'s size.
+     * Returns the index of the first bit that is clear on or before {@code index}, or -1 if
+     * no lower bits are clear or {@code index == -1}.
+     * @throws IndexOutOfBoundsException if {@code index < -1}.
+     * @hide 1.7
      */
-    public int nextClearBit(int index) {
+    public int previousClearBit(int index) {
+        if (index == -1) {
+            return -1;
+        }
         checkIndex(index);
-
-        int length = actualArrayLength;
-        int bssize = length << OFFSET;
-        if (index >= bssize) {
-            return index;
-        }
-
-        int idx = index >> OFFSET;
-        // first check in the same bit set element
-        if (bits[idx] != (~0L)) {
-            for (int j = index % ELM_SIZE; j < ELM_SIZE; j++) {
-                if (((bits[idx] & (TWO_N_ARRAY[j])) == 0)) {
-                    return idx * ELM_SIZE + j;
-                }
+        // TODO: optimize this.
+        for (int i = index; i >= 0; --i) {
+            if (!get(i)) {
+                return i;
             }
         }
-        idx++;
-        while (idx < length && bits[idx] == (~0L)) {
-            idx++;
-        }
-        if (idx == length) {
-            return bssize;
-        }
-
-        // we know for sure there is a bit set to true in this element
-        // since the bitset value is not 0L
-        for (int j = 0; j < ELM_SIZE; j++) {
-            if (((bits[idx] & (TWO_N_ARRAY[j])) == 0)) {
-                return (idx << OFFSET) + j;
-            }
-        }
-
-        return bssize;
+        return -1;
     }
 
     /**
-     * Returns true if all the bits in this {@code BitSet} are set to false.
-     *
-     * @return {@code true} if the {@code BitSet} is empty,
-     *         {@code false} otherwise.
+     * Returns true if all the bits in this {@code BitSet} are set to false, false otherwise.
      */
     public boolean isEmpty() {
-        if (!needClear) {
-            return true;
-        }
-        int length = bits.length;
-        for (int idx = 0; idx < length; idx++) {
-            if (bits[idx] != 0L) {
-                return false;
-            }
-        }
-        return true;
+        return (longCount == 0);
     }
 
     /**
      * Returns the number of bits that are {@code true} in this {@code BitSet}.
-     *
-     * @return the number of {@code true} bits in the set.
      */
     public int cardinality() {
-        if (!needClear) {
-            return 0;
+        int result = 0;
+        for (int i = 0; i < longCount; ++i) {
+            result += Long.bitCount(bits[i]);
         }
-        int count = 0;
-        int length = bits.length;
-        // FIXME: need to test performance, if still not satisfied, change it to
-        // 256-bits table based
-        for (int idx = 0; idx < length; idx++) {
-            count += pop(bits[idx] & 0xffffffffL);
-            count += pop(bits[idx] >>> 32);
-        }
-        return count;
+        return result;
     }
 
-    private final int pop(long x) {
-        // BEGIN android-note
-        // delegate to Integer.bitCount(i); consider using native code
-        // END android-note
-        x = x - ((x >>> 1) & 0x55555555);
-        x = (x & 0x33333333) + ((x >>> 2) & 0x33333333);
-        x = (x + (x >>> 4)) & 0x0f0f0f0f;
-        x = x + (x >>> 8);
-        x = x + (x >>> 16);
-        return (int) x & 0x0000003f;
+    /**
+     * Equivalent to {@code BitSet.valueOf(LongBuffer.wrap(longs))}, but likely to be faster.
+     * This is likely to be the fastest way to create a {@code BitSet} because it's closest
+     * to the internal representation.
+     * @hide 1.7
+     */
+    public static BitSet valueOf(long[] longs) {
+        return new BitSet(longs.clone());
     }
 
-    private void readObject(ObjectInputStream ois) throws IOException,
-            ClassNotFoundException {
+    /**
+     * Returns a {@code BitSet} corresponding to {@code longBuffer}, interpreted as a little-endian
+     * sequence of bits. This method does not alter the {@code LongBuffer}.
+     * @hide 1.7
+     */
+    public static BitSet valueOf(LongBuffer longBuffer) {
+        // The bulk get would mutate LongBuffer (even if we reset position later), and it's not
+        // clear that's allowed. My assumption is that it's the long[] variant that's the common
+        // case anyway, so copy the buffer into a long[].
+        long[] longs = new long[longBuffer.remaining()];
+        for (int i = 0; i < longs.length; ++i) {
+            longs[i] = longBuffer.get(longBuffer.position() + i);
+        }
+        return BitSet.valueOf(longs);
+    }
+
+    /**
+     * Equivalent to {@code BitSet.valueOf(ByteBuffer.wrap(bytes))}.
+     * @hide 1.7
+     */
+    public static BitSet valueOf(byte[] bytes) {
+        return BitSet.valueOf(ByteBuffer.wrap(bytes));
+    }
+
+    /**
+     * Returns a {@code BitSet} corresponding to {@code byteBuffer}, interpreted as a little-endian
+     * sequence of bits. This method does not alter the {@code ByteBuffer}.
+     * @hide 1.7
+     */
+    public static BitSet valueOf(ByteBuffer byteBuffer) {
+        byteBuffer = byteBuffer.slice().order(ByteOrder.LITTLE_ENDIAN);
+        long[] longs = arrayForBits(byteBuffer.remaining() * 8);
+        int i = 0;
+        while (byteBuffer.remaining() >= SizeOf.LONG) {
+            longs[i++] = byteBuffer.getLong();
+        }
+        for (int j = 0; byteBuffer.hasRemaining(); ++j) {
+            longs[i] |= ((((long) byteBuffer.get()) & 0xff) << (8*j));
+        }
+        return BitSet.valueOf(longs);
+    }
+
+    /**
+     * Returns a new {@code long[]} containing a little-endian representation of the bits of
+     * this {@code BitSet}, suitable for passing to {@code valueOf} to reconstruct
+     * this {@code BitSet}.
+     * @hide 1.7
+     */
+    public long[] toLongArray() {
+        return Arrays.copyOf(bits, longCount);
+    }
+
+    /**
+     * Returns a new {@code byte[]} containing a little-endian representation the bits of
+     * this {@code BitSet}, suitable for passing to {@code valueOf} to reconstruct
+     * this {@code BitSet}.
+     * @hide 1.7
+     */
+    public byte[] toByteArray() {
+        int bitCount = length();
+        byte[] result = new byte[(bitCount + 7)/ 8];
+        for (int i = 0; i < result.length; ++i) {
+            int lowBit = 8 * i;
+            int arrayIndex = lowBit / 64;
+            result[i] = (byte) (bits[arrayIndex] >>> lowBit);
+        }
+        return result;
+    }
+
+    private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException {
         ois.defaultReadObject();
-        this.isLengthActual = false;
-        this.actualArrayLength = bits.length;
-        this.needClear = this.getActualArrayLength() != 0;
+        // The serialized form doesn't include a 'longCount' field, so we'll have to scan the array.
+        this.longCount = this.bits.length;
+        shrinkSize();
     }
 }
diff --git a/luni/src/main/java/java/util/Calendar.java b/luni/src/main/java/java/util/Calendar.java
index 3368b2d..bef6e26 100644
--- a/luni/src/main/java/java/util/Calendar.java
+++ b/luni/src/main/java/java/util/Calendar.java
@@ -818,7 +818,7 @@
             clone.zone = (TimeZone) zone.clone();
             return clone;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
@@ -1028,8 +1028,7 @@
      * @return a {@code Calendar} subclass instance set to the current date and time in
      *         the specified timezone.
      */
-    public static synchronized Calendar getInstance(TimeZone timezone,
-            Locale locale) {
+    public static synchronized Calendar getInstance(TimeZone timezone, Locale locale) {
         return new GregorianCalendar(timezone, locale);
     }
 
@@ -1353,20 +1352,16 @@
 
     /**
      * Returns the string representation of this {@code Calendar}.
-     *
-     * @return the string representation of this {@code Calendar}.
      */
     @Override
-    @SuppressWarnings("nls")
     public String toString() {
-        StringBuilder result = new StringBuilder(getClass().getName() + "[time="
-                + (isTimeSet ? String.valueOf(time) : "?")
-                + ",areFieldsSet="
-                + areFieldsSet
-                + // ",areAllFieldsSet=" + areAllFieldsSet +
-                ",lenient=" + lenient + ",zone=" + zone + ",firstDayOfWeek="
-                + firstDayOfWeek + ",minimalDaysInFirstWeek="
-                + minimalDaysInFirstWeek);
+        StringBuilder result = new StringBuilder(getClass().getName() +
+                "[time=" + (isTimeSet ? String.valueOf(time) : "?") +
+                ",areFieldsSet=" + areFieldsSet +
+                ",lenient=" + lenient +
+                ",zone=" + zone.getID() +
+                ",firstDayOfWeek=" + firstDayOfWeek +
+                ",minimalDaysInFirstWeek=" + minimalDaysInFirstWeek);
         for (int i = 0; i < FIELD_COUNT; i++) {
             result.append(',');
             result.append(FIELD_NAMES[i]);
@@ -1502,21 +1497,20 @@
         }
     }
 
-    @SuppressWarnings("nls")
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("areFieldsSet", Boolean.TYPE),
-            new ObjectStreamField("fields", int[].class),
-            new ObjectStreamField("firstDayOfWeek", Integer.TYPE),
-            new ObjectStreamField("isSet", boolean[].class),
-            new ObjectStreamField("isTimeSet", Boolean.TYPE),
-            new ObjectStreamField("lenient", Boolean.TYPE),
-            new ObjectStreamField("minimalDaysInFirstWeek", Integer.TYPE),
-            new ObjectStreamField("nextStamp", Integer.TYPE),
-            new ObjectStreamField("serialVersionOnStream", Integer.TYPE),
-            new ObjectStreamField("time", Long.TYPE),
-            new ObjectStreamField("zone", TimeZone.class), };
+        new ObjectStreamField("areFieldsSet", boolean.class),
+        new ObjectStreamField("fields", int[].class),
+        new ObjectStreamField("firstDayOfWeek", int.class),
+        new ObjectStreamField("isSet", boolean[].class),
+        new ObjectStreamField("isTimeSet", boolean.class),
+        new ObjectStreamField("lenient", boolean.class),
+        new ObjectStreamField("minimalDaysInFirstWeek", int.class),
+        new ObjectStreamField("nextStamp", int.class),
+        new ObjectStreamField("serialVersionOnStream", int.class),
+        new ObjectStreamField("time", long.class),
+        new ObjectStreamField("zone", TimeZone.class),
+    };
 
-    @SuppressWarnings("nls")
     private void writeObject(ObjectOutputStream stream) throws IOException {
         complete();
         ObjectOutputStream.PutField putFields = stream.putFields();
@@ -1534,9 +1528,7 @@
         stream.writeFields();
     }
 
-    @SuppressWarnings("nls")
-    private void readObject(ObjectInputStream stream) throws IOException,
-            ClassNotFoundException {
+    private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
         ObjectInputStream.GetField readFields = stream.readFields();
         areFieldsSet = readFields.get("areFieldsSet", false);
         this.fields = (int[]) readFields.get("fields", null);
diff --git a/luni/src/main/java/java/util/Collections.java b/luni/src/main/java/java/util/Collections.java
index 38005ad..b6729b4 100644
--- a/luni/src/main/java/java/util/Collections.java
+++ b/luni/src/main/java/java/util/Collections.java
@@ -32,12 +32,33 @@
  */
 public class Collections {
 
-    private static final class CopiesList<E> extends AbstractList<E> implements
-            Serializable {
+    private static final Iterator<?> EMPTY_ITERATOR = new Iterator<Object>() {
+        @Override public boolean hasNext() {
+            return false;
+        }
+
+        @Override public Object next() {
+            throw new NoSuchElementException();
+        }
+
+        @Override public void remove() {
+            throw new IllegalStateException();
+        }
+    };
+
+    private static final Enumeration<?> EMPTY_ENUMERATION = new Enumeration<Object>() {
+        @Override public boolean hasMoreElements() {
+            return false;
+        }
+
+        @Override public Object nextElement() {
+            throw new NoSuchElementException();
+        }
+    };
+
+    private static final class CopiesList<E> extends AbstractList<E> implements Serializable {
         private static final long serialVersionUID = 2739099268398711800L;
-
         private final int n;
-
         private final E element;
 
         CopiesList(int length, E object) {
@@ -48,18 +69,15 @@
             element = object;
         }
 
-        @Override
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return element == null ? object == null : element.equals(object);
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return n;
         }
 
-        @Override
-        public E get(int location) {
+        @Override public E get(int location) {
             if (location >= 0 && location < n) {
                 return element;
             }
@@ -68,22 +86,19 @@
     }
 
     @SuppressWarnings("unchecked")
-    private static final class EmptyList extends AbstractList implements
-            RandomAccess, Serializable {
+    private static final class EmptyList extends AbstractList
+            implements RandomAccess, Serializable {
         private static final long serialVersionUID = 8842843931221139166L;
 
-        @Override
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return false;
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return 0;
         }
 
-        @Override
-        public Object get(int location) {
+        @Override public Object get(int location) {
             throw new IndexOutOfBoundsException();
         }
 
@@ -93,35 +108,19 @@
     }
 
     @SuppressWarnings("unchecked")
-    private static final class EmptySet extends AbstractSet implements
-            Serializable {
+    private static final class EmptySet extends AbstractSet implements Serializable {
         private static final long serialVersionUID = 1582296315990362920L;
 
-        @Override
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return false;
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return 0;
         }
 
-        @Override
-        public Iterator iterator() {
-            return new Iterator() {
-                public boolean hasNext() {
-                    return false;
-                }
-
-                public Object next() {
-                    throw new NoSuchElementException();
-                }
-
-                public void remove() {
-                    throw new UnsupportedOperationException();
-                }
-            };
+        @Override public Iterator iterator() {
+            return EMPTY_ITERATOR;
         }
 
         private Object readResolve() {
@@ -130,37 +129,30 @@
     }
 
     @SuppressWarnings("unchecked")
-    private static final class EmptyMap extends AbstractMap implements
-            Serializable {
+    private static final class EmptyMap extends AbstractMap implements Serializable {
         private static final long serialVersionUID = 6428348081105594320L;
 
-        @Override
-        public boolean containsKey(Object key) {
+        @Override public boolean containsKey(Object key) {
             return false;
         }
 
-        @Override
-        public boolean containsValue(Object value) {
+        @Override public boolean containsValue(Object value) {
             return false;
         }
 
-        @Override
-        public Set entrySet() {
+        @Override public Set entrySet() {
             return EMPTY_SET;
         }
 
-        @Override
-        public Object get(Object key) {
+        @Override public Object get(Object key) {
             return null;
         }
 
-        @Override
-        public Set keySet() {
+        @Override public Set keySet() {
             return EMPTY_SET;
         }
 
-        @Override
-        public Collection values() {
+        @Override public Collection values() {
             return EMPTY_LIST;
         }
 
@@ -190,16 +182,13 @@
     /**
      * This class is a singleton so that equals() and hashCode() work properly.
      */
-    private static final class ReverseComparator<T> implements Comparator<T>,
-            Serializable {
-
-        private static final ReverseComparator<Object> INSTANCE
-                = new ReverseComparator<Object>();
+    private static final class ReverseComparator<T> implements Comparator<T>, Serializable {
+        private static final ReverseComparator<Object> INSTANCE = new ReverseComparator<Object>();
 
         private static final long serialVersionUID = 7207038068494060240L;
 
         @SuppressWarnings("unchecked")
-        public int compare(T o1, T o2) {
+        @Override public int compare(T o1, T o2) {
             Comparable<T> c2 = (Comparable<T>) o2;
             return c2.compareTo(o1);
         }
@@ -209,8 +198,7 @@
         }
     }
 
-    private static final class ReverseComparator2<T>
-            implements Comparator<T>, Serializable {
+    private static final class ReverseComparator2<T> implements Comparator<T>, Serializable {
         private static final long serialVersionUID = 4374092139857L;
         private final Comparator<T> cmp;
 
@@ -218,7 +206,7 @@
             this.cmp = comparator;
         }
 
-        public int compare(T o1, T o2) {
+        @Override public int compare(T o1, T o2) {
             return cmp.compare(o2, o1);
         }
 
@@ -232,36 +220,31 @@
         }
     }
 
-    private static final class SingletonSet<E> extends AbstractSet<E> implements
-            Serializable {
+    private static final class SingletonSet<E> extends AbstractSet<E> implements Serializable {
         private static final long serialVersionUID = 3193687207550431679L;
-
         final E element;
 
         SingletonSet(E object) {
             element = object;
         }
 
-        @Override
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return element == null ? object == null : element.equals(object);
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return 1;
         }
 
-        @Override
-        public Iterator<E> iterator() {
+        @Override public Iterator<E> iterator() {
             return new Iterator<E>() {
                 boolean hasNext = true;
 
-                public boolean hasNext() {
+                @Override public boolean hasNext() {
                     return hasNext;
                 }
 
-                public E next() {
+                @Override public E next() {
                     if (hasNext) {
                         hasNext = false;
                         return element;
@@ -269,15 +252,14 @@
                     throw new NoSuchElementException();
                 }
 
-                public void remove() {
+                @Override public void remove() {
                     throw new UnsupportedOperationException();
                 }
             };
         }
     }
 
-    private static final class SingletonList<E> extends AbstractList<E>
-            implements Serializable {
+    private static final class SingletonList<E> extends AbstractList<E> implements Serializable {
         private static final long serialVersionUID = 3093736618740652951L;
 
         final E element;
@@ -286,21 +268,18 @@
             element = object;
         }
 
-        @Override
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return element == null ? object == null : element.equals(object);
         }
 
-        @Override
-        public E get(int location) {
+        @Override public E get(int location) {
             if (location == 0) {
                 return element;
             }
             throw new IndexOutOfBoundsException();
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return 1;
         }
     }
@@ -310,7 +289,6 @@
         private static final long serialVersionUID = -6979724477215052911L;
 
         final K k;
-
         final V v;
 
         SingletonMap(K key, V value) {
@@ -318,34 +296,28 @@
             v = value;
         }
 
-        @Override
-        public boolean containsKey(Object key) {
+        @Override public boolean containsKey(Object key) {
             return k == null ? key == null : k.equals(key);
         }
 
-        @Override
-        public boolean containsValue(Object value) {
+        @Override public boolean containsValue(Object value) {
             return v == null ? value == null : v.equals(value);
         }
 
-        @Override
-        public V get(Object key) {
+        @Override public V get(Object key) {
             if (containsKey(key)) {
                 return v;
             }
             return null;
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return 1;
         }
 
-        @Override
-        public Set<Map.Entry<K, V>> entrySet() {
+        @Override public Set<Map.Entry<K, V>> entrySet() {
             return new AbstractSet<Map.Entry<K, V>>() {
-                @Override
-                public boolean contains(Object object) {
+                @Override public boolean contains(Object object) {
                     if (object instanceof Map.Entry) {
                         Map.Entry<?, ?> entry = (Map.Entry<?, ?>) object;
                         return containsKey(entry.getKey())
@@ -354,35 +326,32 @@
                     return false;
                 }
 
-                @Override
-                public int size() {
+                @Override public int size() {
                     return 1;
                 }
 
-                @Override
-                public Iterator<Map.Entry<K, V>> iterator() {
+                @Override public Iterator<Map.Entry<K, V>> iterator() {
                     return new Iterator<Map.Entry<K, V>>() {
                         boolean hasNext = true;
 
-                        public boolean hasNext() {
+                        @Override public boolean hasNext() {
                             return hasNext;
                         }
 
-                        public Map.Entry<K, V> next() {
+                        @Override public Map.Entry<K, V> next() {
                             if (!hasNext) {
                                 throw new NoSuchElementException();
                             }
 
                             hasNext = false;
                             return new MapEntry<K, V>(k, v) {
-                                @Override
-                                public V setValue(V value) {
+                                @Override public V setValue(V value) {
                                     throw new UnsupportedOperationException();
                                 }
                             };
                         }
 
-                        public void remove() {
+                        @Override public void remove() {
                             throw new UnsupportedOperationException();
                         }
                     };
@@ -391,12 +360,9 @@
         }
     }
 
-    static class SynchronizedCollection<E> implements Collection<E>,
-            Serializable {
+    static class SynchronizedCollection<E> implements Collection<E>, Serializable {
         private static final long serialVersionUID = 3053995032091335093L;
-
         final Collection<E> c;
-
         final Object mutex;
 
         SynchronizedCollection(Collection<E> collection) {
@@ -409,86 +375,85 @@
             this.mutex = mutex;
         }
 
-        public boolean add(E object) {
+        @Override public boolean add(E object) {
             synchronized (mutex) {
                 return c.add(object);
             }
         }
 
-        public boolean addAll(Collection<? extends E> collection) {
+        @Override public boolean addAll(Collection<? extends E> collection) {
             synchronized (mutex) {
                 return c.addAll(collection);
             }
         }
 
-        public void clear() {
+        @Override public void clear() {
             synchronized (mutex) {
                 c.clear();
             }
         }
 
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             synchronized (mutex) {
                 return c.contains(object);
             }
         }
 
-        public boolean containsAll(Collection<?> collection) {
+        @Override public boolean containsAll(Collection<?> collection) {
             synchronized (mutex) {
                 return c.containsAll(collection);
             }
         }
 
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             synchronized (mutex) {
                 return c.isEmpty();
             }
         }
 
-        public Iterator<E> iterator() {
+        @Override public Iterator<E> iterator() {
             synchronized (mutex) {
                 return c.iterator();
             }
         }
 
-        public boolean remove(Object object) {
+        @Override public boolean remove(Object object) {
             synchronized (mutex) {
                 return c.remove(object);
             }
         }
 
-        public boolean removeAll(Collection<?> collection) {
+        @Override public boolean removeAll(Collection<?> collection) {
             synchronized (mutex) {
                 return c.removeAll(collection);
             }
         }
 
-        public boolean retainAll(Collection<?> collection) {
+        @Override public boolean retainAll(Collection<?> collection) {
             synchronized (mutex) {
                 return c.retainAll(collection);
             }
         }
 
-        public int size() {
+        @Override public int size() {
             synchronized (mutex) {
                 return c.size();
             }
         }
 
-        public java.lang.Object[] toArray() {
+        @Override public java.lang.Object[] toArray() {
             synchronized (mutex) {
                 return c.toArray();
             }
         }
 
-        @Override
-        public String toString() {
+        @Override public String toString() {
             synchronized (mutex) {
                 return c.toString();
             }
         }
 
-        public <T> T[] toArray(T[] array) {
+        @Override public <T> T[] toArray(T[] array) {
             synchronized (mutex) {
                 return c.toArray(array);
             }
@@ -513,11 +478,9 @@
             super(l, mutex);
         }
 
-        @Override
-        public List<E> subList(int start, int end) {
+        @Override public List<E> subList(int start, int end) {
             synchronized (mutex) {
-                return new SynchronizedRandomAccessList<E>(list.subList(start,
-                        end), mutex);
+                return new SynchronizedRandomAccessList<E>(list.subList(start, end), mutex);
             }
         }
 
@@ -537,10 +500,8 @@
         }
     }
 
-    static class SynchronizedList<E> extends SynchronizedCollection<E>
-            implements List<E> {
+    static class SynchronizedList<E> extends SynchronizedCollection<E> implements List<E> {
         private static final long serialVersionUID = -7754090372962971524L;
-
         final List<E> list;
 
         SynchronizedList(List<E> l) {
@@ -553,39 +514,37 @@
             list = l;
         }
 
-        public void add(int location, E object) {
+        @Override public void add(int location, E object) {
             synchronized (mutex) {
                 list.add(location, object);
             }
         }
 
-        public boolean addAll(int location, Collection<? extends E> collection) {
+        @Override public boolean addAll(int location, Collection<? extends E> collection) {
             synchronized (mutex) {
                 return list.addAll(location, collection);
             }
         }
 
-        @Override
-        public boolean equals(Object object) {
+        @Override public boolean equals(Object object) {
             synchronized (mutex) {
                 return list.equals(object);
             }
         }
 
-        public E get(int location) {
+        @Override public E get(int location) {
             synchronized (mutex) {
                 return list.get(location);
             }
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             synchronized (mutex) {
                 return list.hashCode();
             }
         }
 
-        public int indexOf(Object object) {
+        @Override public int indexOf(Object object) {
             final int size;
             final Object[] array;
             synchronized (mutex) {
@@ -609,7 +568,7 @@
             return -1;
         }
 
-        public int lastIndexOf(Object object) {
+        @Override public int lastIndexOf(Object object) {
             final int size;
             final Object[] array;
             synchronized (mutex) {
@@ -633,31 +592,31 @@
             return -1;
         }
 
-        public ListIterator<E> listIterator() {
+        @Override public ListIterator<E> listIterator() {
             synchronized (mutex) {
                 return list.listIterator();
             }
         }
 
-        public ListIterator<E> listIterator(int location) {
+        @Override public ListIterator<E> listIterator(int location) {
             synchronized (mutex) {
                 return list.listIterator(location);
             }
         }
 
-        public E remove(int location) {
+        @Override public E remove(int location) {
             synchronized (mutex) {
                 return list.remove(location);
             }
         }
 
-        public E set(int location, E object) {
+        @Override public E set(int location, E object) {
             synchronized (mutex) {
                 return list.set(location, object);
             }
         }
 
-        public List<E> subList(int start, int end) {
+        @Override public List<E> subList(int start, int end) {
             synchronized (mutex) {
                 return new SynchronizedList<E>(list.subList(start, end), mutex);
             }
@@ -708,94 +667,91 @@
             this.mutex = mutex;
         }
 
-        public void clear() {
+        @Override public void clear() {
             synchronized (mutex) {
                 m.clear();
             }
         }
 
-        public boolean containsKey(Object key) {
+        @Override public boolean containsKey(Object key) {
             synchronized (mutex) {
                 return m.containsKey(key);
             }
         }
 
-        public boolean containsValue(Object value) {
+        @Override public boolean containsValue(Object value) {
             synchronized (mutex) {
                 return m.containsValue(value);
             }
         }
 
-        public Set<Map.Entry<K, V>> entrySet() {
+        @Override public Set<Map.Entry<K, V>> entrySet() {
             synchronized (mutex) {
                 return new SynchronizedSet<Map.Entry<K, V>>(m.entrySet(), mutex);
             }
         }
 
-        @Override
-        public boolean equals(Object object) {
+        @Override public boolean equals(Object object) {
             synchronized (mutex) {
                 return m.equals(object);
             }
         }
 
-        public V get(Object key) {
+        @Override public V get(Object key) {
             synchronized (mutex) {
                 return m.get(key);
             }
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             synchronized (mutex) {
                 return m.hashCode();
             }
         }
 
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             synchronized (mutex) {
                 return m.isEmpty();
             }
         }
 
-        public Set<K> keySet() {
+        @Override public Set<K> keySet() {
             synchronized (mutex) {
                 return new SynchronizedSet<K>(m.keySet(), mutex);
             }
         }
 
-        public V put(K key, V value) {
+        @Override public V put(K key, V value) {
             synchronized (mutex) {
                 return m.put(key, value);
             }
         }
 
-        public void putAll(Map<? extends K, ? extends V> map) {
+        @Override public void putAll(Map<? extends K, ? extends V> map) {
             synchronized (mutex) {
                 m.putAll(map);
             }
         }
 
-        public V remove(Object key) {
+        @Override public V remove(Object key) {
             synchronized (mutex) {
                 return m.remove(key);
             }
         }
 
-        public int size() {
+        @Override public int size() {
             synchronized (mutex) {
                 return m.size();
             }
         }
 
-        public Collection<V> values() {
+        @Override public Collection<V> values() {
             synchronized (mutex) {
                 return new SynchronizedCollection<V>(m.values(), mutex);
             }
         }
 
-        @Override
-        public String toString() {
+        @Override public String toString() {
             synchronized (mutex) {
                 return m.toString();
             }
@@ -808,8 +764,7 @@
         }
     }
 
-    static class SynchronizedSet<E> extends SynchronizedCollection<E> implements
-            Set<E> {
+    static class SynchronizedSet<E> extends SynchronizedCollection<E> implements Set<E> {
         private static final long serialVersionUID = 487447009682186044L;
 
         SynchronizedSet(Set<E> set) {
@@ -820,15 +775,13 @@
             super(set, mutex);
         }
 
-        @Override
-        public boolean equals(Object object) {
+        @Override public boolean equals(Object object) {
             synchronized (mutex) {
                 return c.equals(object);
             }
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             synchronized (mutex) {
                 return c.hashCode();
             }
@@ -857,39 +810,39 @@
             sm = map;
         }
 
-        public Comparator<? super K> comparator() {
+        @Override public Comparator<? super K> comparator() {
             synchronized (mutex) {
                 return sm.comparator();
             }
         }
 
-        public K firstKey() {
+        @Override public K firstKey() {
             synchronized (mutex) {
                 return sm.firstKey();
             }
         }
 
-        public SortedMap<K, V> headMap(K endKey) {
+        @Override public SortedMap<K, V> headMap(K endKey) {
             synchronized (mutex) {
                 return new SynchronizedSortedMap<K, V>(sm.headMap(endKey),
                         mutex);
             }
         }
 
-        public K lastKey() {
+        @Override public K lastKey() {
             synchronized (mutex) {
                 return sm.lastKey();
             }
         }
 
-        public SortedMap<K, V> subMap(K startKey, K endKey) {
+        @Override public SortedMap<K, V> subMap(K startKey, K endKey) {
             synchronized (mutex) {
                 return new SynchronizedSortedMap<K, V>(sm.subMap(startKey,
                         endKey), mutex);
             }
         }
 
-        public SortedMap<K, V> tailMap(K startKey) {
+        @Override public SortedMap<K, V> tailMap(K startKey) {
             synchronized (mutex) {
                 return new SynchronizedSortedMap<K, V>(sm.tailMap(startKey),
                         mutex);
@@ -903,8 +856,7 @@
         }
     }
 
-    static class SynchronizedSortedSet<E> extends SynchronizedSet<E> implements
-            SortedSet<E> {
+    static class SynchronizedSortedSet<E> extends SynchronizedSet<E> implements SortedSet<E> {
         private static final long serialVersionUID = 8695801310862127406L;
 
         private final SortedSet<E> ss;
@@ -919,38 +871,38 @@
             ss = set;
         }
 
-        public Comparator<? super E> comparator() {
+        @Override public Comparator<? super E> comparator() {
             synchronized (mutex) {
                 return ss.comparator();
             }
         }
 
-        public E first() {
+        @Override public E first() {
             synchronized (mutex) {
                 return ss.first();
             }
         }
 
-        public SortedSet<E> headSet(E end) {
+        @Override public SortedSet<E> headSet(E end) {
             synchronized (mutex) {
                 return new SynchronizedSortedSet<E>(ss.headSet(end), mutex);
             }
         }
 
-        public E last() {
+        @Override public E last() {
             synchronized (mutex) {
                 return ss.last();
             }
         }
 
-        public SortedSet<E> subSet(E start, E end) {
+        @Override public SortedSet<E> subSet(E start, E end) {
             synchronized (mutex) {
                 return new SynchronizedSortedSet<E>(ss.subSet(start, end),
                         mutex);
             }
         }
 
-        public SortedSet<E> tailSet(E start) {
+        @Override public SortedSet<E> tailSet(E start) {
             synchronized (mutex) {
                 return new SynchronizedSortedSet<E>(ss.tailSet(start), mutex);
             }
@@ -963,8 +915,7 @@
         }
     }
 
-    private static class UnmodifiableCollection<E> implements Collection<E>,
-            Serializable {
+    private static class UnmodifiableCollection<E> implements Collection<E>, Serializable {
         private static final long serialVersionUID = 1820017752578914078L;
 
         final Collection<E> c;
@@ -973,88 +924,86 @@
             c = collection;
         }
 
-        public boolean add(E object) {
+        @Override public boolean add(E object) {
             throw new UnsupportedOperationException();
         }
 
-        public boolean addAll(Collection<? extends E> collection) {
+        @Override public boolean addAll(Collection<? extends E> collection) {
             throw new UnsupportedOperationException();
         }
 
-        public void clear() {
+        @Override public void clear() {
             throw new UnsupportedOperationException();
         }
 
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return c.contains(object);
         }
 
-        public boolean containsAll(Collection<?> collection) {
+        @Override public boolean containsAll(Collection<?> collection) {
             return c.containsAll(collection);
         }
 
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             return c.isEmpty();
         }
 
-        public Iterator<E> iterator() {
+        @Override public Iterator<E> iterator() {
             return new Iterator<E>() {
                 Iterator<E> iterator = c.iterator();
 
-                public boolean hasNext() {
+                @Override public boolean hasNext() {
                     return iterator.hasNext();
                 }
 
-                public E next() {
+                @Override public E next() {
                     return iterator.next();
                 }
 
-                public void remove() {
+                @Override public void remove() {
                     throw new UnsupportedOperationException();
                 }
             };
         }
 
-        public boolean remove(Object object) {
+        @Override public boolean remove(Object object) {
             throw new UnsupportedOperationException();
         }
 
-        public boolean removeAll(Collection<?> collection) {
+        @Override public boolean removeAll(Collection<?> collection) {
             throw new UnsupportedOperationException();
         }
 
-        public boolean retainAll(Collection<?> collection) {
+        @Override public boolean retainAll(Collection<?> collection) {
             throw new UnsupportedOperationException();
         }
 
-        public int size() {
+        @Override public int size() {
             return c.size();
         }
 
-        public Object[] toArray() {
+        @Override public Object[] toArray() {
             return c.toArray();
         }
 
-        public <T> T[] toArray(T[] array) {
+        @Override public <T> T[] toArray(T[] array) {
             return c.toArray(array);
         }
 
-        @Override
-        public String toString() {
+        @Override public String toString() {
             return c.toString();
         }
     }
 
-    private static class UnmodifiableRandomAccessList<E> extends
-            UnmodifiableList<E> implements RandomAccess {
+    private static class UnmodifiableRandomAccessList<E> extends UnmodifiableList<E>
+            implements RandomAccess {
         private static final long serialVersionUID = -2542308836966382001L;
 
         UnmodifiableRandomAccessList(List<E> l) {
             super(l);
         }
 
-        @Override
-        public List<E> subList(int start, int end) {
+        @Override public List<E> subList(int start, int end) {
             return new UnmodifiableRandomAccessList<E>(list.subList(start, end));
         }
 
@@ -1085,91 +1034,89 @@
             list = l;
         }
 
-        public void add(int location, E object) {
+        @Override public void add(int location, E object) {
             throw new UnsupportedOperationException();
         }
 
-        public boolean addAll(int location, Collection<? extends E> collection) {
+        @Override public boolean addAll(int location, Collection<? extends E> collection) {
             throw new UnsupportedOperationException();
         }
 
-        @Override
-        public boolean equals(Object object) {
+        @Override public boolean equals(Object object) {
             return list.equals(object);
         }
 
-        public E get(int location) {
+        @Override public E get(int location) {
             return list.get(location);
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return list.hashCode();
         }
 
-        public int indexOf(Object object) {
+        @Override public int indexOf(Object object) {
             return list.indexOf(object);
         }
 
-        public int lastIndexOf(Object object) {
+        @Override public int lastIndexOf(Object object) {
             return list.lastIndexOf(object);
         }
 
-        public ListIterator<E> listIterator() {
+        @Override public ListIterator<E> listIterator() {
             return listIterator(0);
         }
 
-        public ListIterator<E> listIterator(final int location) {
+        @Override public ListIterator<E> listIterator(final int location) {
             return new ListIterator<E>() {
                 ListIterator<E> iterator = list.listIterator(location);
 
-                public void add(E object) {
+                @Override public void add(E object) {
                     throw new UnsupportedOperationException();
                 }
 
-                public boolean hasNext() {
+                @Override public boolean hasNext() {
                     return iterator.hasNext();
                 }
 
-                public boolean hasPrevious() {
+                @Override public boolean hasPrevious() {
                     return iterator.hasPrevious();
                 }
 
-                public E next() {
+                @Override public E next() {
                     return iterator.next();
                 }
 
-                public int nextIndex() {
+                @Override public int nextIndex() {
                     return iterator.nextIndex();
                 }
 
-                public E previous() {
+                @Override public E previous() {
                     return iterator.previous();
                 }
 
-                public int previousIndex() {
+                @Override public int previousIndex() {
                     return iterator.previousIndex();
                 }
 
-                public void remove() {
+                @Override public void remove() {
                     throw new UnsupportedOperationException();
                 }
 
-                public void set(E object) {
+                @Override public void set(E object) {
                     throw new UnsupportedOperationException();
                 }
             };
         }
 
-        public E remove(int location) {
+        @Override public E remove(int location) {
             throw new UnsupportedOperationException();
         }
 
-        public E set(int location, E object) {
+        @Override public E set(int location, E object) {
             throw new UnsupportedOperationException();
         }
 
-        public List<E> subList(int start, int end) {
+        @Override public List<E> subList(int start, int end) {
             return new UnmodifiableList<E>(list.subList(start, end));
         }
 
@@ -1214,30 +1161,27 @@
                     mapEntry = entry;
                 }
 
-                @Override
-                public boolean equals(Object object) {
+                @Override public boolean equals(Object object) {
                     return mapEntry.equals(object);
                 }
 
-                public K getKey() {
+                @Override public K getKey() {
                     return mapEntry.getKey();
                 }
 
-                public V getValue() {
+                @Override public V getValue() {
                     return mapEntry.getValue();
                 }
 
-                @Override
-                public int hashCode() {
+                @Override public int hashCode() {
                     return mapEntry.hashCode();
                 }
 
-                public V setValue(V object) {
+                @Override public V setValue(V object) {
                     throw new UnsupportedOperationException();
                 }
 
-                @Override
-                public String toString() {
+                @Override public String toString() {
                     return mapEntry.toString();
                 }
             }
@@ -1246,27 +1190,25 @@
                 super(set);
             }
 
-            @Override
-            public Iterator<Map.Entry<K, V>> iterator() {
+            @Override public Iterator<Map.Entry<K, V>> iterator() {
                 return new Iterator<Map.Entry<K, V>>() {
                     Iterator<Map.Entry<K, V>> iterator = c.iterator();
 
-                    public boolean hasNext() {
+                    @Override public boolean hasNext() {
                         return iterator.hasNext();
                     }
 
-                    public Map.Entry<K, V> next() {
+                    @Override public Map.Entry<K, V> next() {
                         return new UnmodifiableMapEntry<K, V>(iterator.next());
                     }
 
-                    public void remove() {
+                    @Override public void remove() {
                         throw new UnsupportedOperationException();
                     }
                 };
             }
 
-            @Override
-            public Object[] toArray() {
+            @Override public Object[] toArray() {
                 int length = c.size();
                 Object[] result = new Object[length];
                 Iterator<?> it = iterator();
@@ -1276,9 +1218,8 @@
                 return result;
             }
 
-            @Override
             @SuppressWarnings("unchecked")
-            public <T> T[] toArray(T[] contents) {
+            @Override public <T> T[] toArray(T[] contents) {
                 int size = c.size(), index = 0;
                 Iterator<Map.Entry<K, V>> it = iterator();
                 if (size > contents.length) {
@@ -1299,66 +1240,63 @@
             m = map;
         }
 
-        public void clear() {
+        @Override public void clear() {
             throw new UnsupportedOperationException();
         }
 
-        public boolean containsKey(Object key) {
+        @Override public boolean containsKey(Object key) {
             return m.containsKey(key);
         }
 
-        public boolean containsValue(Object value) {
+        @Override public boolean containsValue(Object value) {
             return m.containsValue(value);
         }
 
-        public Set<Map.Entry<K, V>> entrySet() {
+        @Override public Set<Map.Entry<K, V>> entrySet() {
             return new UnmodifiableEntrySet<K, V>(m.entrySet());
         }
 
-        @Override
-        public boolean equals(Object object) {
+        @Override public boolean equals(Object object) {
             return m.equals(object);
         }
 
-        public V get(Object key) {
+        @Override public V get(Object key) {
             return m.get(key);
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return m.hashCode();
         }
 
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             return m.isEmpty();
         }
 
-        public Set<K> keySet() {
+        @Override public Set<K> keySet() {
             return new UnmodifiableSet<K>(m.keySet());
         }
 
-        public V put(K key, V value) {
+        @Override public V put(K key, V value) {
             throw new UnsupportedOperationException();
         }
 
-        public void putAll(Map<? extends K, ? extends V> map) {
+        @Override public void putAll(Map<? extends K, ? extends V> map) {
             throw new UnsupportedOperationException();
         }
 
-        public V remove(Object key) {
+        @Override public V remove(Object key) {
             throw new UnsupportedOperationException();
         }
 
-        public int size() {
+        @Override public int size() {
             return m.size();
         }
 
-        public Collection<V> values() {
+        @Override public Collection<V> values() {
             return new UnmodifiableCollection<V>(m.values());
         }
 
-        @Override
-        public String toString() {
+        @Override public String toString() {
             return m.toString();
         }
     }
@@ -1371,13 +1309,11 @@
             super(set);
         }
 
-        @Override
-        public boolean equals(Object object) {
+        @Override public boolean equals(Object object) {
             return c.equals(object);
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return c.hashCode();
         }
     }
@@ -1393,27 +1329,27 @@
             sm = map;
         }
 
-        public Comparator<? super K> comparator() {
+        @Override public Comparator<? super K> comparator() {
             return sm.comparator();
         }
 
-        public K firstKey() {
+        @Override public K firstKey() {
             return sm.firstKey();
         }
 
-        public SortedMap<K, V> headMap(K before) {
+        @Override public SortedMap<K, V> headMap(K before) {
             return new UnmodifiableSortedMap<K, V>(sm.headMap(before));
         }
 
-        public K lastKey() {
+        @Override public K lastKey() {
             return sm.lastKey();
         }
 
-        public SortedMap<K, V> subMap(K start, K end) {
+        @Override public SortedMap<K, V> subMap(K start, K end) {
             return new UnmodifiableSortedMap<K, V>(sm.subMap(start, end));
         }
 
-        public SortedMap<K, V> tailMap(K after) {
+        @Override public SortedMap<K, V> tailMap(K after) {
             return new UnmodifiableSortedMap<K, V>(sm.tailMap(after));
         }
     }
@@ -1429,34 +1365,32 @@
             ss = set;
         }
 
-        public Comparator<? super E> comparator() {
+        @Override public Comparator<? super E> comparator() {
             return ss.comparator();
         }
 
-        public E first() {
+        @Override public E first() {
             return ss.first();
         }
 
-        public SortedSet<E> headSet(E before) {
+        @Override public SortedSet<E> headSet(E before) {
             return new UnmodifiableSortedSet<E>(ss.headSet(before));
         }
 
-        public E last() {
+        @Override public E last() {
             return ss.last();
         }
 
-        public SortedSet<E> subSet(E start, E end) {
+        @Override public SortedSet<E> subSet(E start, E end) {
             return new UnmodifiableSortedSet<E>(ss.subSet(start, end));
         }
 
-        public SortedSet<E> tailSet(E after) {
+        @Override public SortedSet<E> tailSet(E after) {
             return new UnmodifiableSortedSet<E>(ss.tailSet(after));
         }
     }
 
-    private Collections() {
-        /* empty */
-    }
+    private Collections() {}
 
     /**
      * Performs a binary search for the specified element in the specified
@@ -1476,8 +1410,7 @@
      *             implement Comparable, or cannot be compared to each other.
      */
     @SuppressWarnings("unchecked")
-    public static <T> int binarySearch(
-            List<? extends Comparable<? super T>> list, T object) {
+    public static <T> int binarySearch(List<? extends Comparable<? super T>> list, T object) {
         if (list == null) {
             throw new NullPointerException();
         }
@@ -1535,9 +1468,6 @@
      *             be compared to each other using the comparator.
      */
     @SuppressWarnings("unchecked")
-    // BEGIN android-note
-    // removed "@param <T> The element type", which is rejected by apicheck
-    // END android-note
     public static <T> int binarySearch(List<? extends T> list, T object,
             Comparator<? super T> comparator) {
         if (comparator == null) {
@@ -1561,7 +1491,7 @@
         int low = 0, mid = list.size(), high = mid - 1, result = -1;
         while (low <= high) {
             mid = (low + high) >>> 1;
-            if ((result = -comparator.compare(list.get(mid),object)) > 0) {
+            if ((result = -comparator.compare(list.get(mid), object)) > 0) {
                 low = mid + 1;
             } else if (result == 0) {
                 return mid;
@@ -1619,11 +1549,11 @@
         return new Enumeration<T>() {
             Iterator<T> it = c.iterator();
 
-            public boolean hasMoreElements() {
+            @Override public boolean hasMoreElements() {
                 return it.hasNext();
             }
 
-            public T nextElement() {
+            @Override public T nextElement() {
                 return it.next();
             }
         };
@@ -1803,9 +1733,6 @@
      * {@code Comparator} that's returned is {@link Serializable}.
      *
      * @return a {@code Comparator} instance.
-     * @see Comparator
-     * @see Comparable
-     * @see Serializable
      */
     @SuppressWarnings("unchecked")
     public static <T> Comparator<T> reverseOrder() {
@@ -1823,7 +1750,6 @@
      * @param c
      *            the {@code Comparator} to reverse or {@code null}.
      * @return a {@code Comparator} instance.
-     * @see Comparator
      * @since 1.5
      */
     public static <T> Comparator<T> reverseOrder(Comparator<T> c) {
@@ -2508,6 +2434,32 @@
     }
 
     /**
+     * Returns an enumeration containing no elements.
+     * @hide 1.7
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> Enumeration<T> emptyEnumeration() {
+        return (Enumeration<T>) EMPTY_ENUMERATION;
+    }
+
+    /**
+     * Returns an iterator containing no elements.
+     * @hide 1.7
+     */
+    @SuppressWarnings("unchecked")
+    public static <T> Iterator<T> emptyIterator() {
+        return (Iterator<T>) EMPTY_ITERATOR;
+    }
+
+    /**
+     * Returns a list iterator containing no elements.
+     * @hide 1.7
+     */
+    public static <T> ListIterator<T> emptyListIterator() {
+        return Collections.<T>emptyList().listIterator();
+    }
+
+    /**
      * Returns a dynamically typesafe view of the specified collection. Trying
      * to insert an element of the wrong type into this collection throws a
      * {@code ClassCastException}. At creation time the types in {@code c} are
@@ -2708,8 +2660,7 @@
         return new AsLIFOQueue<T>(deque);
     }
 
-    private static class SetFromMap<E> extends AbstractSet<E> implements
-            Serializable {
+    private static class SetFromMap<E> extends AbstractSet<E> implements Serializable {
         private static final long serialVersionUID = 2454657854757543876L;
 
         // must named as it, to pass serialization compatibility test.
@@ -2718,63 +2669,51 @@
         private transient Set<E> backingSet;
 
         SetFromMap(final Map<E, Boolean> map) {
-            super();
             m = map;
             backingSet = map.keySet();
         }
 
-        @Override
-        public boolean equals(Object object) {
+        @Override public boolean equals(Object object) {
             return backingSet.equals(object);
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return backingSet.hashCode();
         }
 
-        @Override
-        public boolean add(E object) {
+        @Override public boolean add(E object) {
             return m.put(object, Boolean.TRUE) == null;
         }
 
-        @Override
-        public void clear() {
+        @Override public void clear() {
             m.clear();
         }
 
-        @Override
-        public String toString() {
+        @Override public String toString() {
             return backingSet.toString();
         }
 
-        @Override
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return backingSet.contains(object);
         }
 
-        @Override
-        public boolean containsAll(Collection<?> collection) {
+        @Override public boolean containsAll(Collection<?> collection) {
             return backingSet.containsAll(collection);
         }
 
-        @Override
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             return m.isEmpty();
         }
 
-        @Override
-        public boolean remove(Object object) {
+        @Override public boolean remove(Object object) {
             return m.remove(object) != null;
         }
 
-        @Override
-        public boolean retainAll(Collection<?> collection) {
+        @Override public boolean retainAll(Collection<?> collection) {
             return backingSet.retainAll(collection);
         }
 
-        @Override
-        public Object[] toArray() {
+        @Override public Object[] toArray() {
             return backingSet.toArray();
         }
 
@@ -2783,13 +2722,11 @@
             return backingSet.toArray(contents);
         }
 
-        @Override
-        public Iterator<E> iterator() {
+        @Override public Iterator<E> iterator() {
             return backingSet.iterator();
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return m.size();
         }
 
@@ -2801,112 +2738,94 @@
         }
     }
 
-    private static class AsLIFOQueue<E> extends AbstractQueue<E> implements
-            Serializable {
+    private static class AsLIFOQueue<E> extends AbstractQueue<E> implements Serializable {
         private static final long serialVersionUID = 1802017725587941708L;
 
         // must named as it, to pass serialization compatibility test.
         private final Deque<E> q;
 
         AsLIFOQueue(final Deque<E> deque) {
-            super();
             this.q = deque;
         }
 
-        @Override
-        public Iterator<E> iterator() {
+        @Override public Iterator<E> iterator() {
             return q.iterator();
         }
 
-        @Override
-        public int size() {
+        @Override public int size() {
             return q.size();
         }
 
-        public boolean offer(E o) {
+        @Override public boolean offer(E o) {
             return q.offerFirst(o);
         }
 
-        public E peek() {
+        @Override public E peek() {
             return q.peekFirst();
         }
 
-        public E poll() {
+        @Override public E poll() {
             return q.pollFirst();
         }
 
-        @Override
-        public boolean add(E o) {
+        @Override public boolean add(E o) {
             q.push(o);
             return true;
         }
 
-        @Override
-        public void clear() {
+        @Override public void clear() {
             q.clear();
         }
 
-        @Override
-        public E element() {
+        @Override public E element() {
             return q.getFirst();
         }
 
-        @Override
-        public E remove() {
+        @Override public E remove() {
             return q.pop();
         }
 
-        @Override
-        public boolean contains(Object object) {
+        @Override public boolean contains(Object object) {
             return q.contains(object);
         }
 
-        @Override
-        public boolean containsAll(Collection<?> collection) {
+        @Override public boolean containsAll(Collection<?> collection) {
             return q.containsAll(collection);
         }
 
-        @Override
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             return q.isEmpty();
         }
 
-        @Override
-        public boolean remove(Object object) {
+        @Override public boolean remove(Object object) {
             return q.remove(object);
         }
 
-        @Override
-        public boolean removeAll(Collection<?> collection) {
+        @Override public boolean removeAll(Collection<?> collection) {
             return q.removeAll(collection);
         }
 
-        @Override
-        public boolean retainAll(Collection<?> collection) {
+        @Override public boolean retainAll(Collection<?> collection) {
             return q.retainAll(collection);
         }
 
-        @Override
-        public Object[] toArray() {
+        @Override public Object[] toArray() {
             return q.toArray();
         }
 
-        @Override
-        public <T> T[] toArray(T[] contents) {
+        @Override public <T> T[] toArray(T[] contents) {
             return q.toArray(contents);
         }
 
-        @Override
-        public String toString() {
+        @Override public String toString() {
             return q.toString();
         }
     }
 
     /**
-     * Class represents a dynamically typesafe view of the specified collection.
+     * A dynamically typesafe view of a Collection.
      */
-    private static class CheckedCollection<E> implements Collection<E>,
-            Serializable {
+    private static class CheckedCollection<E> implements Collection<E>, Serializable {
 
         private static final long serialVersionUID = 1578914078182001775L;
 
@@ -2914,13 +2833,6 @@
 
         Class<E> type;
 
-        /**
-         * Constructs a dynamically typesafe view of the specified collection.
-         *
-         * @param c -
-         *            the collection for which an unmodifiable view is to be
-         *            constructed.
-         */
         public CheckedCollection(Collection<E> c, Class<E> type) {
             if (c == null || type == null) {
                 throw new NullPointerException();
@@ -2929,31 +2841,19 @@
             this.type = type;
         }
 
-        /**
-         * @see java.util.Collection#size()
-         */
-        public int size() {
+        @Override public int size() {
             return c.size();
         }
 
-        /**
-         * @see java.util.Collection#isEmpty()
-         */
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             return c.isEmpty();
         }
 
-        /**
-         * @see java.util.Collection#contains(Object)
-         */
-        public boolean contains(Object obj) {
+        @Override public boolean contains(Object obj) {
             return c.contains(obj);
         }
 
-        /**
-         * @see java.util.Collection#iterator()
-         */
-        public Iterator<E> iterator() {
+        @Override public Iterator<E> iterator() {
             Iterator<E> i = c.iterator();
             if (i instanceof ListIterator) {
                 i = new CheckedListIterator<E>((ListIterator<E>) i, type);
@@ -2961,46 +2861,28 @@
             return i;
         }
 
-        /**
-         * @see java.util.Collection#toArray()
-         */
-        public Object[] toArray() {
+        @Override public Object[] toArray() {
             return c.toArray();
         }
 
-        /**
-         * @see java.util.Collection#toArray(Object[])
-         */
-        public <T> T[] toArray(T[] arr) {
+        @Override public <T> T[] toArray(T[] arr) {
             return c.toArray(arr);
         }
 
-        /**
-         * @see java.util.Collection#add(Object)
-         */
-        public boolean add(E obj) {
+        @Override public boolean add(E obj) {
             return c.add(checkType(obj, type));
         }
 
-        /**
-         * @see java.util.Collection#remove(Object)
-         */
-        public boolean remove(Object obj) {
+        @Override public boolean remove(Object obj) {
             return c.remove(obj);
         }
 
-        /**
-         * @see java.util.Collection#containsAll(Collection)
-         */
-        public boolean containsAll(Collection<?> c1) {
+        @Override public boolean containsAll(Collection<?> c1) {
             return c.containsAll(c1);
         }
 
-        /**
-         * @see java.util.Collection#addAll(Collection)
-         */
         @SuppressWarnings("unchecked")
-        public boolean addAll(Collection<? extends E> c1) {
+        @Override public boolean addAll(Collection<? extends E> c1) {
             Object[] array = c1.toArray();
             for (Object o : array) {
                 checkType(o, type);
@@ -3008,32 +2890,19 @@
             return c.addAll((List<E>) Arrays.asList(array));
         }
 
-        /**
-         * @see java.util.Collection#removeAll(Collection)
-         */
-        public boolean removeAll(Collection<?> c1) {
+        @Override public boolean removeAll(Collection<?> c1) {
             return c.removeAll(c1);
         }
 
-        /**
-         * @see java.util.Collection#retainAll(Collection)
-         */
-        public boolean retainAll(Collection<?> c1) {
+        @Override public boolean retainAll(Collection<?> c1) {
             return c.retainAll(c1);
         }
 
-        /**
-         * @see java.util.Collection#clear()
-         */
-        public void clear() {
+        @Override public void clear() {
             c.clear();
         }
 
-        /**
-         * @see java.lang.Object#toString()
-         */
-        @Override
-        public String toString() {
+        @Override public String toString() {
             return c.toString();
         }
     }
@@ -3060,97 +2929,59 @@
             this.type = type;
         }
 
-        /**
-         * @see java.util.Iterator#hasNext()
-         */
-        public boolean hasNext() {
+        @Override public boolean hasNext() {
             return i.hasNext();
         }
 
-        /**
-         * @see java.util.Iterator#next()
-         */
-        public E next() {
+        @Override public E next() {
             return i.next();
         }
 
-        /**
-         * @see java.util.Iterator#remove()
-         */
-        public void remove() {
+        @Override public void remove() {
             i.remove();
         }
 
-        /**
-         * @see java.util.ListIterator#hasPrevious()
-         */
-        public boolean hasPrevious() {
+        @Override public boolean hasPrevious() {
             return i.hasPrevious();
         }
 
-        /**
-         * @see java.util.ListIterator#previous()
-         */
-        public E previous() {
+        @Override public E previous() {
             return i.previous();
         }
 
-        /**
-         * @see java.util.ListIterator#nextIndex()
-         */
-        public int nextIndex() {
+        @Override public int nextIndex() {
             return i.nextIndex();
         }
 
-        /**
-         * @see java.util.ListIterator#previousIndex()
-         */
-        public int previousIndex() {
+        @Override public int previousIndex() {
             return i.previousIndex();
         }
 
-        /**
-         * @see java.util.ListIterator#set(Object)
-         */
-        public void set(E obj) {
+        @Override public void set(E obj) {
             i.set(checkType(obj, type));
         }
 
-        /**
-         * @see java.util.ListIterator#add(Object)
-         */
-        public void add(E obj) {
+        @Override public void add(E obj) {
             i.add(checkType(obj, type));
         }
     }
 
     /**
-     * Class represents a dynamically typesafe view of the specified list.
+     * Class represents a dynamically typesafe view of a List.
      */
-    private static class CheckedList<E> extends CheckedCollection<E> implements
-            List<E> {
+    private static class CheckedList<E> extends CheckedCollection<E> implements List<E> {
 
         private static final long serialVersionUID = 65247728283967356L;
 
         List<E> l;
 
-        /**
-         * Constructs a dynamically typesafe view of the specified list.
-         *
-         * @param l -
-         *            the list for which a dynamically typesafe view is to be
-         *            constructed.
-         */
         public CheckedList(List<E> l, Class<E> type) {
             super(l, type);
             this.l = l;
         }
 
-        /**
-         * @see java.util.List#addAll(int, Collection)
-         */
         @SuppressWarnings("unchecked")
-        public boolean addAll(int index, Collection<? extends E> c1) {
+        @Override public boolean addAll(int index, Collection<? extends E> c1) {
             Object[] array = c1.toArray();
             for (Object o : array) {
                 checkType(o, type);
@@ -3158,165 +2989,95 @@
             return l.addAll(index, (List<E>) Arrays.asList(array));
         }
 
-        /**
-         * @see java.util.List#get(int)
-         */
-        public E get(int index) {
+        @Override public E get(int index) {
             return l.get(index);
         }
 
-        /**
-         * @see java.util.List#set(int, Object)
-         */
-        public E set(int index, E obj) {
+        @Override public E set(int index, E obj) {
             return l.set(index, checkType(obj, type));
         }
 
-        /**
-         * @see java.util.List#add(int, Object)
-         */
-        public void add(int index, E obj) {
+        @Override public void add(int index, E obj) {
             l.add(index, checkType(obj, type));
         }
 
-        /**
-         * @see java.util.List#remove(int)
-         */
-        public E remove(int index) {
+        @Override public E remove(int index) {
             return l.remove(index);
         }
 
-        /**
-         * @see java.util.List#indexOf(Object)
-         */
-        public int indexOf(Object obj) {
+        @Override public int indexOf(Object obj) {
             return l.indexOf(obj);
         }
 
-        /**
-         * @see java.util.List#lastIndexOf(Object)
-         */
-        public int lastIndexOf(Object obj) {
+        @Override public int lastIndexOf(Object obj) {
             return l.lastIndexOf(obj);
         }
 
-        /**
-         * @see java.util.List#listIterator()
-         */
-        public ListIterator<E> listIterator() {
+        @Override public ListIterator<E> listIterator() {
             return new CheckedListIterator<E>(l.listIterator(), type);
         }
 
-        /**
-         * @see java.util.List#listIterator(int)
-         */
-        public ListIterator<E> listIterator(int index) {
+        @Override public ListIterator<E> listIterator(int index) {
             return new CheckedListIterator<E>(l.listIterator(index), type);
         }
 
-        /**
-         * @see java.util.List#subList(int, int)
-         */
-        public List<E> subList(int fromIndex, int toIndex) {
+        @Override public List<E> subList(int fromIndex, int toIndex) {
             return checkedList(l.subList(fromIndex, toIndex), type);
         }
 
-        /**
-         * @see java.util.List#equals(Object)
-         */
-        @Override
-        public boolean equals(Object obj) {
+        @Override public boolean equals(Object obj) {
             return l.equals(obj);
         }
 
-        /**
-         * @see java.util.List#hashCode()
-         */
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return l.hashCode();
         }
     }
 
     /**
-     * Class represents a dynamically typesafe view of the specified
-     * randomAccessList.
+     * A dynamically typesafe view of a RandomAccessList.
      */
-    private static class CheckedRandomAccessList<E> extends CheckedList<E>
-            implements RandomAccess {
+    private static class CheckedRandomAccessList<E> extends CheckedList<E> implements RandomAccess {
 
         private static final long serialVersionUID = 1638200125423088369L;
 
-        /**
-         * Constructs a dynamically typesafe view of the specified
-         * randomAccessList.
-         *
-         * @param l -
-         *            the randomAccessList for which a dynamically typesafe view
-         *            is to be constructed.
-         */
         public CheckedRandomAccessList(List<E> l, Class<E> type) {
             super(l, type);
         }
     }
 
     /**
-     * Class represents a dynamically typesafe view of the specified set.
+     * A dynamically typesafe view of a Set.
      */
-    private static class CheckedSet<E> extends CheckedCollection<E> implements
-            Set<E> {
+    private static class CheckedSet<E> extends CheckedCollection<E> implements Set<E> {
 
         private static final long serialVersionUID = 4694047833775013803L;
 
-        /**
-         * Constructs a dynamically typesafe view of the specified set.
-         *
-         * @param s -
-         *            the set for which a dynamically typesafe view is to be
-         *            constructed.
-         */
         public CheckedSet(Set<E> s, Class<E> type) {
             super(s, type);
         }
 
-        /**
-         * @see java.util.Set#equals(Object)
-         */
-        @Override
-        public boolean equals(Object obj) {
+        @Override public boolean equals(Object obj) {
             return c.equals(obj);
         }
 
-        /**
-         * @see java.util.Set#hashCode()
-         */
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return c.hashCode();
         }
 
     }
 
     /**
-     * Class represents a dynamically typesafe view of the specified map.
+     * A dynamically typesafe view of a Map.
      */
     private static class CheckedMap<K, V> implements Map<K, V>, Serializable {
 
         private static final long serialVersionUID = 5742860141034234728L;
 
         Map<K, V> m;
-
         Class<K> keyType;
-
         Class<V> valueType;
 
-        /**
-         * Constructs a dynamically typesafe view of the specified map.
-         *
-         * @param m -
-         *            the map for which a dynamically typesafe view is to be
-         *            constructed.
-         */
         private CheckedMap(Map<K, V> m, Class<K> keyType, Class<V> valueType) {
             if (m == null || keyType == null || valueType == null) {
                 throw new NullPointerException();
@@ -3326,60 +3087,36 @@
             this.valueType = valueType;
         }
 
-        /**
-         * @see java.util.Map#size()
-         */
-        public int size() {
+        @Override public int size() {
             return m.size();
         }
 
-        /**
-         * @see java.util.Map#isEmpty()
-         */
-        public boolean isEmpty() {
+        @Override public boolean isEmpty() {
             return m.isEmpty();
         }
 
-        /**
-         * @see java.util.Map#containsKey(Object)
-         */
-        public boolean containsKey(Object key) {
+        @Override public boolean containsKey(Object key) {
             return m.containsKey(key);
         }
 
-        /**
-         * @see java.util.Map#containsValue(Object)
-         */
-        public boolean containsValue(Object value) {
+        @Override public boolean containsValue(Object value) {
             return m.containsValue(value);
         }
 
-        /**
-         * @see java.util.Map#get(Object)
-         */
-        public V get(Object key) {
+        @Override public V get(Object key) {
             return m.get(key);
         }
 
-        /**
-         * @see java.util.Map#put(Object, Object)
-         */
-        public V put(K key, V value) {
+        @Override public V put(K key, V value) {
             return m.put(checkType(key, keyType), checkType(value, valueType));
         }
 
-        /**
-         * @see java.util.Map#remove(Object)
-         */
-        public V remove(Object key) {
+        @Override public V remove(Object key) {
             return m.remove(key);
         }
 
-        /**
-         * @see java.util.Map#putAll(Map)
-         */
         @SuppressWarnings("unchecked")
-        public void putAll(Map<? extends K, ? extends V> map) {
+        @Override public void putAll(Map<? extends K, ? extends V> map) {
             int size = map.size();
             if (size == 0) {
                 return;
@@ -3398,78 +3135,41 @@
             }
         }
 
-        /**
-         * @see java.util.Map#clear()
-         */
-        public void clear() {
+        @Override public void clear() {
             m.clear();
         }
 
-        /**
-         * @see java.util.Map#keySet()
-         */
-        public Set<K> keySet() {
+        @Override public Set<K> keySet() {
             return m.keySet();
         }
 
-        /**
-         * @see java.util.Map#values()
-         */
-        public Collection<V> values() {
+        @Override public Collection<V> values() {
             return m.values();
         }
 
-        /**
-         * @see java.util.Map#entrySet()
-         */
-        public Set<Map.Entry<K, V>> entrySet() {
+        @Override public Set<Map.Entry<K, V>> entrySet() {
             return new CheckedEntrySet<K, V>(m.entrySet(), valueType);
         }
 
-        /**
-         * @see java.util.Map#equals(Object)
-         */
-        @Override
-        public boolean equals(Object obj) {
+        @Override public boolean equals(Object obj) {
             return m.equals(obj);
         }
 
-        /**
-         * @see java.util.Map#hashCode()
-         */
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return m.hashCode();
         }
 
-        /**
-         * @see java.lang.Object#toString()
-         */
-        @Override
-        public String toString() {
+        @Override public String toString() {
             return m.toString();
         }
 
         /**
-         * Class represents a dynamically typesafe view of the specified map
-         * entry.
+         * A dynamically typesafe view of a Map.Entry.
          */
         private static class CheckedEntry<K, V> implements Map.Entry<K, V> {
-
             Map.Entry<K, V> e;
-
             Class<V> valueType;
 
-            /**
-             * Constructs a dynamically typesafe view of the specified map
-             * entry.
-             *
-             * @param e
-             *            the map entry for which a dynamically typesafe view is
-             *            to be constructed.
-             * @param valueType
-             *            the type of the value
-             */
             public CheckedEntry(Map.Entry<K, V> e, Class<V> valueType) {
                 if (e == null) {
                     throw new NullPointerException();
@@ -3478,79 +3178,44 @@
                 this.valueType = valueType;
             }
 
-            /**
-             * @see java.util.Map.Entry#getKey()
-             */
-            public K getKey() {
+            @Override public K getKey() {
                 return e.getKey();
             }
 
-            /**
-             * @see java.util.Map.Entry#getValue()
-             */
-            public V getValue() {
+            @Override public V getValue() {
                 return e.getValue();
             }
 
-            /**
-             * @see java.util.Map.Entry#setValue(Object)
-             */
-            public V setValue(V obj) {
+            @Override public V setValue(V obj) {
                 return e.setValue(checkType(obj, valueType));
             }
 
-            /**
-             * @see java.util.Map.Entry#equals(Object)
-             */
-            @Override
-            public boolean equals(Object obj) {
+            @Override public boolean equals(Object obj) {
                 return e.equals(obj);
             }
 
-            /**
-             * @see java.util.Map.Entry#hashCode()
-             */
-            @Override
-            public int hashCode() {
+            @Override public int hashCode() {
                 return e.hashCode();
             }
         }
 
         /**
-         * Class represents a dynamically typesafe view of the specified entry
-         * set.
+         * A dynamically typesafe view of an entry set.
          */
-        private static class CheckedEntrySet<K, V> implements
-                Set<Map.Entry<K, V>> {
-
+        private static class CheckedEntrySet<K, V> implements Set<Map.Entry<K, V>> {
             Set<Map.Entry<K, V>> s;
-
             Class<V> valueType;
 
-            /**
-             * Constructs a dynamically typesafe view of the specified entry
-             * set.
-             *
-             * @param s -
-             *            the entry set for which a dynamically typesafe view is
-             *            to be constructed.
-             */
             public CheckedEntrySet(Set<Map.Entry<K, V>> s, Class<V> valueType) {
                 this.s = s;
                 this.valueType = valueType;
             }
 
-            /**
-             * @see java.util.Set#iterator()
-             */
-            public Iterator<Map.Entry<K, V>> iterator() {
+            @Override public Iterator<Map.Entry<K, V>> iterator() {
                 return new CheckedEntryIterator<K, V>(s.iterator(), valueType);
             }
 
-            /**
-             * @see java.util.Set#toArray()
-             */
-            public Object[] toArray() {
+            @Override public Object[] toArray() {
                 int thisSize = size();
                 Object[] array = new Object[thisSize];
                 Iterator<?> it = iterator();
@@ -3560,11 +3225,8 @@
                 return array;
             }
 
-            /**
-             * @see java.util.Set#toArray(Object[])
-             */
             @SuppressWarnings("unchecked")
-            public <T> T[] toArray(T[] array) {
+            @Override public <T> T[] toArray(T[] array) {
                 int thisSize = size();
                 if (array.length < thisSize) {
                     Class<?> ct = array.getClass().getComponentType();
@@ -3580,273 +3242,154 @@
                 return array;
             }
 
-            /**
-             * @see java.util.Set#retainAll(Collection)
-             */
-            public boolean retainAll(Collection<?> c) {
+            @Override public boolean retainAll(Collection<?> c) {
                 return s.retainAll(c);
             }
 
-            /**
-             * @see java.util.Set#removeAll(Collection)
-             */
-            public boolean removeAll(Collection<?> c) {
+            @Override public boolean removeAll(Collection<?> c) {
                 return s.removeAll(c);
             }
 
-            /**
-             * @see java.util.Set#containsAll(Collection)
-             */
-            public boolean containsAll(Collection<?> c) {
+            @Override public boolean containsAll(Collection<?> c) {
                 return s.containsAll(c);
             }
 
-            /**
-             * @see java.util.Set#addAll(Collection)
-             */
-            public boolean addAll(Collection<? extends Map.Entry<K, V>> c) {
+            @Override public boolean addAll(Collection<? extends Map.Entry<K, V>> c) {
                 throw new UnsupportedOperationException();
             }
 
-            /**
-             * @see java.util.Set#remove(Object)
-             */
-            public boolean remove(Object o) {
+            @Override public boolean remove(Object o) {
                 return s.remove(o);
             }
 
-            /**
-             * @see java.util.Set#contains(Object)
-             */
-            public boolean contains(Object o) {
+            @Override public boolean contains(Object o) {
                 return s.contains(o);
             }
 
-            /**
-             * @see java.util.Set#add(Object)
-             */
-            public boolean add(Map.Entry<K, V> o) {
+            @Override public boolean add(Map.Entry<K, V> o) {
                 throw new UnsupportedOperationException();
             }
 
-            /**
-             * @see java.util.Set#isEmpty()
-             */
-            public boolean isEmpty() {
+            @Override public boolean isEmpty() {
                 return s.isEmpty();
             }
 
-            /**
-             * @see java.util.Set#clear()
-             */
-            public void clear() {
+            @Override public void clear() {
                 s.clear();
             }
 
-            /**
-             * @see java.util.Set#size()
-             */
-            public int size() {
+            @Override public int size() {
                 return s.size();
             }
 
-            /**
-             * @see java.util.Set#hashCode()
-             */
-            @Override
-            public int hashCode() {
+            @Override public int hashCode() {
                 return s.hashCode();
             }
 
-            /**
-             * @see java.util.Set#equals(Object)
-             */
-            @Override
-            public boolean equals(Object object) {
+            @Override public boolean equals(Object object) {
                 return s.equals(object);
             }
 
             /**
-             * Class represents a dynamically typesafe view of the specified
-             * entry iterator.
+             * A dynamically typesafe view of an entry iterator.
              */
-            private static class CheckedEntryIterator<K, V> implements
-                    Iterator<Map.Entry<K, V>> {
-
+            private static class CheckedEntryIterator<K, V> implements Iterator<Map.Entry<K, V>> {
                 Iterator<Map.Entry<K, V>> i;
-
                 Class<V> valueType;
 
-                /**
-                 * Constructs a dynamically typesafe view of the specified entry
-                 * iterator.
-                 *
-                 * @param i -
-                 *            the entry iterator for which a dynamically
-                 *            typesafe view is to be constructed.
-                 */
                 public CheckedEntryIterator(Iterator<Map.Entry<K, V>> i,
                         Class<V> valueType) {
                     this.i = i;
                     this.valueType = valueType;
                 }
 
-                /**
-                 * @see java.util.Iterator#hasNext()
-                 */
-                public boolean hasNext() {
+                @Override public boolean hasNext() {
                     return i.hasNext();
                 }
 
-                /**
-                 * @see java.util.Iterator#remove()
-                 */
-                public void remove() {
+                @Override public void remove() {
                     i.remove();
                 }
 
-                /**
-                 * @see java.util.Iterator#next()
-                 */
-                public Map.Entry<K, V> next() {
+                @Override public Map.Entry<K, V> next() {
                     return new CheckedEntry<K, V>(i.next(), valueType);
                 }
             }
-
         }
-
     }
 
     /**
-     * Class represents a dynamically typesafe view of the specified sortedSet.
+     * A dynamically typesafe view of a SortedSet.
      */
-    private static class CheckedSortedSet<E> extends CheckedSet<E> implements
-            SortedSet<E> {
-
+    private static class CheckedSortedSet<E> extends CheckedSet<E> implements SortedSet<E> {
         private static final long serialVersionUID = 1599911165492914959L;
-
         private SortedSet<E> ss;
 
-        /**
-         * Constructs a dynamically typesafe view of the specified sortedSet.
-         *
-         * @param s -
-         *            the sortedSet for which a dynamically typesafe view is to
-         *            be constructed.
-         */
         public CheckedSortedSet(SortedSet<E> s, Class<E> type) {
             super(s, type);
             this.ss = s;
         }
 
-        /**
-         * @see java.util.SortedSet#comparator()
-         */
-        public Comparator<? super E> comparator() {
+        @Override public Comparator<? super E> comparator() {
             return ss.comparator();
         }
 
-        /**
-         * @see java.util.SortedSet#subSet(Object, Object)
-         */
-        public SortedSet<E> subSet(E fromElement, E toElement) {
+        @Override public SortedSet<E> subSet(E fromElement, E toElement) {
             return new CheckedSortedSet<E>(ss.subSet(fromElement, toElement),
                     type);
         }
 
-        /**
-         * @see java.util.SortedSet#headSet(Object)
-         */
-        public SortedSet<E> headSet(E toElement) {
+        @Override public SortedSet<E> headSet(E toElement) {
             return new CheckedSortedSet<E>(ss.headSet(toElement), type);
         }
 
-        /**
-         * @see java.util.SortedSet#tailSet(Object)
-         */
-        public SortedSet<E> tailSet(E fromElement) {
+        @Override public SortedSet<E> tailSet(E fromElement) {
             return new CheckedSortedSet<E>(ss.tailSet(fromElement), type);
         }
 
-        /**
-         * @see java.util.SortedSet#first()
-         */
-        public E first() {
+        @Override public E first() {
             return ss.first();
         }
 
-        /**
-         * @see java.util.SortedSet#last()
-         */
-        public E last() {
+        @Override public E last() {
             return ss.last();
         }
     }
 
     /**
-     * Class represents a dynamically typesafe view of the specified sortedMap.
+     * A dynamically typesafe view of a SortedMap.
      */
     private static class CheckedSortedMap<K, V> extends CheckedMap<K, V>
             implements SortedMap<K, V> {
-
         private static final long serialVersionUID = 1599671320688067438L;
-
         SortedMap<K, V> sm;
 
-        /**
-         * Constructs a dynamically typesafe view of the specified sortedMap.
-         *
-         * @param m -
-         *            the sortedMap for which a dynamically typesafe view is to
-         *            be constructed.
-         */
         CheckedSortedMap(SortedMap<K, V> m, Class<K> keyType, Class<V> valueType) {
             super(m, keyType, valueType);
             this.sm = m;
         }
 
-        /**
-         * @see java.util.SortedMap#comparator()
-         */
-        public Comparator<? super K> comparator() {
+        @Override public Comparator<? super K> comparator() {
             return sm.comparator();
         }
 
-        /**
-         * @see java.util.SortedMap#subMap(Object, Object)
-         */
-        public SortedMap<K, V> subMap(K fromKey, K toKey) {
-            return new CheckedSortedMap<K, V>(sm.subMap(fromKey, toKey),
-                    keyType, valueType);
+        @Override public SortedMap<K, V> subMap(K fromKey, K toKey) {
+            return new CheckedSortedMap<K, V>(sm.subMap(fromKey, toKey), keyType, valueType);
         }
 
-        /**
-         * @see java.util.SortedMap#headMap(Object)
-         */
-        public SortedMap<K, V> headMap(K toKey) {
-            return new CheckedSortedMap<K, V>(sm.headMap(toKey), keyType,
-                    valueType);
+        @Override public SortedMap<K, V> headMap(K toKey) {
+            return new CheckedSortedMap<K, V>(sm.headMap(toKey), keyType, valueType);
         }
 
-        /**
-         * @see java.util.SortedMap#tailMap(Object)
-         */
-        public SortedMap<K, V> tailMap(K fromKey) {
-            return new CheckedSortedMap<K, V>(sm.tailMap(fromKey), keyType,
-                    valueType);
+        @Override public SortedMap<K, V> tailMap(K fromKey) {
+            return new CheckedSortedMap<K, V>(sm.tailMap(fromKey), keyType, valueType);
         }
 
-        /**
-         * @see java.util.SortedMap#firstKey()
-         */
-        public K firstKey() {
+        @Override public K firstKey() {
             return sm.firstKey();
         }
 
-        /**
-         * @see java.util.SortedMap#lastKey()
-         */
-        public K lastKey() {
+        @Override public K lastKey() {
             return sm.lastKey();
         }
     }
diff --git a/luni/src/main/java/java/util/Comparator.java b/luni/src/main/java/java/util/Comparator.java
index 2d6f598..07582d5 100644
--- a/luni/src/main/java/java/util/Comparator.java
+++ b/luni/src/main/java/java/util/Comparator.java
@@ -32,7 +32,7 @@
     /**
      * Compares the two specified objects to determine their relative ordering. The ordering
      * implied by the return value of this method for all possible pairs of
-     * {@code (object1, object2)} should form an <i>equivalence relation</i>.
+     * {@code (lhs, rhs)} should form an <i>equivalence relation</i>.
      * This means that
      * <ul>
      * <li>{@code compare(a,a)} returns zero for all {@code a}</li>
@@ -43,16 +43,16 @@
      * (a,b,c)}</li>
      * </ul>
      *
-     * @param object1
+     * @param lhs
      *            an {@code Object}.
-     * @param object2
-     *            a second {@code Object} to compare with {@code object1}.
-     * @return an integer < 0 if {@code object1} is less than {@code object2}, 0 if they are
-     *         equal, and > 0 if {@code object1} is greater than {@code object2}.
+     * @param rhs
+     *            a second {@code Object} to compare with {@code lhs}.
+     * @return an integer < 0 if {@code lhs} is less than {@code rhs}, 0 if they are
+     *         equal, and > 0 if {@code lhs} is greater than {@code rhs}.
      * @throws ClassCastException
      *                if objects are not of the correct type.
      */
-    public int compare(T object1, T object2);
+    public int compare(T lhs, T rhs);
 
     /**
      * Compares this {@code Comparator} with the specified {@code Object} and indicates whether they
diff --git a/luni/src/main/java/java/util/ConcurrentModificationException.java b/luni/src/main/java/java/util/ConcurrentModificationException.java
index 03cb223..5e5126a 100644
--- a/luni/src/main/java/java/util/ConcurrentModificationException.java
+++ b/luni/src/main/java/java/util/ConcurrentModificationException.java
@@ -47,4 +47,22 @@
         super(detailMessage);
     }
 
+    /**
+     * Constructs a new {@code ConcurrentModificationException} with the given detail
+     * message and cause.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public ConcurrentModificationException(String detailMessage, Throwable cause) {
+        super(detailMessage, cause);
+    }
+
+    /**
+     * Constructs a new {@code ConcurrentModificationException} with the given cause.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public ConcurrentModificationException(Throwable cause) {
+        super(cause);
+    }
 }
diff --git a/luni/src/main/java/java/util/Currency.java b/luni/src/main/java/java/util/Currency.java
index 8ea8a96..3b80e99 100644
--- a/luni/src/main/java/java/util/Currency.java
+++ b/luni/src/main/java/java/util/Currency.java
@@ -18,118 +18,88 @@
 package java.util;
 
 import java.io.Serializable;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import libcore.icu.ICU;
 import libcore.icu.LocaleData;
 
 /**
- * This class represents a currency as identified in the ISO 4217 currency
- * codes.
+ * A currency corresponding to an <a href="http://en.wikipedia.org/wiki/ISO_4217">ISO 4217</a>
+ * currency code such as "EUR" or "USD".
  */
 public final class Currency implements Serializable {
-
     private static final long serialVersionUID = -158308464356906721L;
 
-    private static final Hashtable<String, Currency> codesToCurrencies = new Hashtable<String, Currency>();
-    private static final Hashtable<Locale, Currency> localesToCurrencies = new Hashtable<Locale, Currency>();
+    private static final HashMap<String, Currency> codesToCurrencies = new HashMap<String, Currency>();
+    private static final HashMap<Locale, Currency> localesToCurrencies = new HashMap<Locale, Currency>();
 
     private final String currencyCode;
 
-    // BEGIN android-added
-    // TODO: this isn't set if we're restored from serialized form,
-    // so getDefaultFractionDigits always returns 0!
-    private transient int defaultFractionDigits;
-    // END android-added
-
     private Currency(String currencyCode) {
-        // BEGIN android-changed
         this.currencyCode = currencyCode;
-
-        // In some places the code XXX is used as the fall back currency.
-        // The RI returns -1, but ICU defaults to 2 for unknown currencies.
-        if (currencyCode.equals("XXX")) {
-            this.defaultFractionDigits = -1;
-            return;
-        }
-
-        // Ensure that we throw if the our currency code isn't an ISO currency code.
-        String symbol = ICU.getCurrencySymbolNative(Locale.US.toString(), currencyCode);
+        String symbol = ICU.getCurrencySymbol(Locale.US.toString(), currencyCode);
         if (symbol == null) {
-            throw badCurrency(currencyCode);
+            throw new IllegalArgumentException("Unsupported ISO 4217 currency code: " +
+                    currencyCode);
         }
-
-        this.defaultFractionDigits = ICU.getCurrencyFractionDigitsNative(currencyCode);
-        if (defaultFractionDigits < 0) {
-            // In practice, I don't think this can fail because ICU doesn't care whether you give
-            // it a valid country code, and will just return a sensible default for the default
-            // locale's currency.
-            throw badCurrency(currencyCode);
-        }
-        // END android-changed
-    }
-
-    private IllegalArgumentException badCurrency(String currencyCode) {
-        throw new IllegalArgumentException("Not a supported ISO 4217 currency code: " +
-                currencyCode);
     }
 
     /**
-     * Returns the {@code Currency} instance for the given currency code.
-     * <p>
-     *
-     * @param currencyCode
-     *            the currency code.
-     * @return the {@code Currency} instance for this currency code.
-     *
+     * Returns the {@code Currency} instance for the given ISO 4217 currency code.
      * @throws IllegalArgumentException
-     *             if the currency code is not a supported ISO 4217 currency
-     *             code.
+     *             if the currency code is not a supported ISO 4217 currency code.
      */
     public static Currency getInstance(String currencyCode) {
-        // BEGIN android-changed
-        Currency currency = codesToCurrencies.get(currencyCode);
-        if (currency == null) {
-            currency = new Currency(currencyCode);
-            codesToCurrencies.put(currencyCode, currency);
+        synchronized (codesToCurrencies) {
+            Currency currency = codesToCurrencies.get(currencyCode);
+            if (currency == null) {
+                currency = new Currency(currencyCode);
+                codesToCurrencies.put(currencyCode, currency);
+            }
+            return currency;
         }
-        return currency;
-        // END android-changed
     }
 
     /**
      * Returns the {@code Currency} instance for this {@code Locale}'s country.
-     *
-     * @param locale
-     *            the {@code Locale} of a country.
-     * @return the {@code Currency} used in the country defined by the locale parameter.
-     *
      * @throws IllegalArgumentException
-     *             if the locale's country is not a supported ISO 3166 Country.
+     *             if the locale's country is not a supported ISO 3166 country.
      */
     public static Currency getInstance(Locale locale) {
-        // BEGIN android-changed
-        Currency currency = localesToCurrencies.get(locale);
-        if (currency != null) {
-            return currency;
-        }
-        String country = locale.getCountry();
-        String variant = locale.getVariant();
-        if (variant.length() > 0 && (variant.equals("EURO") || variant.equals("HK") ||
-                variant.equals("PREEURO"))) {
-            country = country + "_" + variant;
-        }
+        synchronized (localesToCurrencies) {
+            Currency currency = localesToCurrencies.get(locale);
+            if (currency != null) {
+                return currency;
+            }
+            String country = locale.getCountry();
+            String variant = locale.getVariant();
+            if (!variant.isEmpty() && (variant.equals("EURO") || variant.equals("HK") ||
+                    variant.equals("PREEURO"))) {
+                country = country + "_" + variant;
+            }
 
-        String currencyCode = ICU.getCurrencyCodeNative(country);
-        if (currencyCode == null) {
-            throw new IllegalArgumentException("Not a supported ISO 3166 country: " + locale);
-        } else if (currencyCode.equals("None")) {
-            return null;
+            String currencyCode = ICU.getCurrencyCode(country);
+            if (currencyCode == null) {
+                throw new IllegalArgumentException("Unsupported ISO 3166 country: " + locale);
+            } else if (currencyCode.equals("None")) {
+                return null;
+            }
+            Currency result = getInstance(currencyCode);
+            localesToCurrencies.put(locale, result);
+            return result;
         }
-        Currency result = getInstance(currencyCode);
-        localesToCurrencies.put(locale, result);
+    }
+
+    /**
+     * Returns a set of all known currencies.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static Set<Currency> getAvailableCurrencies() {
+        Set<Currency> result = new LinkedHashSet<Currency>();
+        String[] currencyCodes = ICU.getAvailableCurrencyCodes();
+        for (String currencyCode : currencyCodes) {
+            result.add(Currency.getInstance(currencyCode));
+        }
         return result;
-        // END android-changed
     }
 
     /**
@@ -140,7 +110,27 @@
     }
 
     /**
-     * Returns the localized currency symbol for this currency in the user's default locale.
+     * Equivalent to {@code getDisplayName(Locale.getDefault())}.
+     * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
+     * @since 1.7
+     * @hide 1.7
+     */
+    public String getDisplayName() {
+        return getDisplayName(Locale.getDefault());
+    }
+
+    /**
+     * Returns the localized name of this currency in the given {@code locale}.
+     * Returns the ISO 4217 currency code if no localized name is available.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public String getDisplayName(Locale locale) {
+        return ICU.getCurrencyDisplayName(locale.toString(), currencyCode);
+    }
+
+    /**
+     * Equivalent to {@code getSymbol(Locale.getDefault())}.
      * See "<a href="../util/Locale.html#default_locale">Be wary of the default locale</a>".
      */
     public String getSymbol() {
@@ -170,29 +160,28 @@
         }
 
         // Try ICU, and fall back to the currency code if ICU has nothing.
-        String symbol = ICU.getCurrencySymbolNative(locale.toString(), currencyCode);
+        String symbol = ICU.getCurrencySymbol(locale.toString(), currencyCode);
         return symbol != null ? symbol : currencyCode;
     }
 
     /**
-     * Returns the default number of fraction digits for this currency. For
-     * instance, the default number of fraction digits for the US dollar is 2.
-     * For the Japanese Yen the number is 0. In the case of pseudo-currencies,
-     * such as IMF Special Drawing Rights, -1 is returned.
-     *
-     * @return the default number of fraction digits for this currency.
+     * Returns the default number of fraction digits for this currency.
+     * For instance, the default number of fraction digits for the US dollar is 2 because there are
+     * 100 US cents in a US dollar. For the Japanese Yen, the number is 0 because coins smaller
+     * than 1 Yen became invalid in 1953. In the case of pseudo-currencies, such as
+     * IMF Special Drawing Rights, -1 is returned.
      */
     public int getDefaultFractionDigits() {
-        // BEGIN android-changed
-        // return com.ibm.icu.util.Currency.getInstance(currencyCode).getDefaultFractionDigits();
-        return defaultFractionDigits;
-        // END android-changed
+        // In some places the code XXX is used as the fall back currency.
+        // The RI returns -1, but ICU defaults to 2 for unknown currencies.
+        if (currencyCode.equals("XXX")) {
+            return -1;
+        }
+        return ICU.getCurrencyFractionDigits(currencyCode);
     }
 
     /**
      * Returns this currency's ISO 4217 currency code.
-     *
-     * @return this currency's ISO 4217 currency code.
      */
     @Override
     public String toString() {
@@ -202,14 +191,4 @@
     private Object readResolve() {
         return getInstance(currencyCode);
     }
-
-    // TODO: remove this in favor of direct access (and no ResourceBundle cruft).
-    private static ResourceBundle getCurrencyBundle(final Locale locale) {
-        return AccessController.doPrivileged(new PrivilegedAction<ResourceBundle>() {
-            public ResourceBundle run() {
-                String bundle = "org.apache.harmony.luni.internal.locale.Currency";
-                return ResourceBundle.getBundle(bundle, locale);
-            }
-        });
-    }
 }
diff --git a/luni/src/main/java/java/util/Date.java b/luni/src/main/java/java/util/Date.java
index 90cd270..0eab8dc 100644
--- a/luni/src/main/java/java/util/Date.java
+++ b/luni/src/main/java/java/util/Date.java
@@ -24,6 +24,7 @@
 import java.text.DateFormat;
 import java.text.DateFormatSymbols;
 import java.text.SimpleDateFormat;
+import libcore.icu.LocaleData;
 
 /**
  * {@code Date} represents a specific moment in time, to the millisecond.
@@ -184,7 +185,7 @@
         try {
             return super.clone();
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
@@ -470,7 +471,7 @@
                     throw new IllegalArgumentException();
                 }
             } else if (state == LETTERS && nextState != LETTERS) {
-                String text = buffer.toString().toUpperCase();
+                String text = buffer.toString().toUpperCase(Locale.US);
                 buffer.setLength(0);
                 if (text.length() == 1) {
                     throw new IllegalArgumentException();
@@ -653,32 +654,24 @@
     }
 
     /**
-     * Returns the string representation of this {@code Date} in GMT in the format: 22
-     * Jun 1999 13:02:00 GMT
-     *
-     * @return the string representation of this {@code Date} in GMT.
+     * Returns the string representation of this {@code Date} in GMT in the format
+     * {@code "22 Jun 1999 13:02:00 GMT"}.
      *
      * @deprecated use {@link DateFormat}
      */
     @Deprecated
     public String toGMTString() {
-        // TODO: why does this insert the year manually instead of using one SimpleDateFormat?
-        SimpleDateFormat format1 = new SimpleDateFormat("d MMM ", Locale.US);
-        SimpleDateFormat format2 = new SimpleDateFormat(" HH:mm:ss 'GMT'", Locale.US);
+        SimpleDateFormat sdf = new SimpleDateFormat("d MMM y HH:mm:ss 'GMT'", Locale.US);
         TimeZone gmtZone = TimeZone.getTimeZone("GMT");
-        format1.setTimeZone(gmtZone);
-        format2.setTimeZone(gmtZone);
+        sdf.setTimeZone(gmtZone);
         GregorianCalendar gc = new GregorianCalendar(gmtZone);
         gc.setTimeInMillis(milliseconds);
-        return format1.format(this) + gc.get(Calendar.YEAR)
-                + format2.format(this);
+        return sdf.format(this);
     }
 
     /**
      * Returns the string representation of this {@code Date} for the default {@code Locale}.
      *
-     * @return the string representation of this {@code Date} for the default {@code Locale}.
-     *
      * @deprecated use {@link DateFormat}
      */
     @Deprecated
@@ -693,35 +686,39 @@
      * like "Tue Jun 22 13:07:00 PDT 1999". The current default time zone and
      * locale are used. If you need control over the time zone or locale,
      * use {@code SimpleDateFormat} instead.
-     *
-     * @return the string representation of this {@code Date}.
      */
     @Override
     public String toString() {
-        // BEGIN android-changed: fixed to use time zone display names ("PST")
-        // rather than ids ("America/Los_Angeles").
-        // Equivalent to the following one-liner, though that's currently 8x slower
-        // at 1655us versus 195us...
+        // TODO: equivalent to the following one-liner, though that's slower on stingray
+        // at 476us versus 69us...
         //   return new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").format(d);
+        LocaleData localeData = LocaleData.get(Locale.US);
         Calendar cal = new GregorianCalendar(milliseconds);
         TimeZone tz = cal.getTimeZone();
-        return dayOfWeekNames[cal.get(Calendar.DAY_OF_WEEK) - 1] + " " + monthNames[cal.get(Calendar.MONTH)]
-                + " " + toTwoDigits(cal.get(Calendar.DAY_OF_MONTH)) + " " + toTwoDigits(cal.get(Calendar.HOUR_OF_DAY))
-                + ":" + toTwoDigits(cal.get(Calendar.MINUTE)) + ":" + toTwoDigits(cal.get(Calendar.SECOND))
-                + " " + tz.getDisplayName(tz.inDaylightTime(this), TimeZone.SHORT) + " " + cal.get(Calendar.YEAR);
-        // END android-changed
+        StringBuilder result = new StringBuilder();
+        result.append(localeData.shortWeekdayNames[cal.get(Calendar.DAY_OF_WEEK)]);
+        result.append(' ');
+        result.append(localeData.shortMonthNames[cal.get(Calendar.MONTH)]);
+        result.append(' ');
+        appendTwoDigits(result, cal.get(Calendar.DAY_OF_MONTH));
+        result.append(' ');
+        appendTwoDigits(result, cal.get(Calendar.HOUR_OF_DAY));
+        result.append(':');
+        appendTwoDigits(result, cal.get(Calendar.MINUTE));
+        result.append(':');
+        appendTwoDigits(result, cal.get(Calendar.SECOND));
+        result.append(' ');
+        result.append(tz.getDisplayName(tz.inDaylightTime(this), TimeZone.SHORT));
+        result.append(' ');
+        result.append(cal.get(Calendar.YEAR));
+        return result.toString();
     }
-    private static final String[] dayOfWeekNames =
-            { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
-    private static final String[] monthNames =
-            { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
 
-    private String toTwoDigits(int n) {
-        if (n >= 10) {
-            return Integer.toString(n);
-        } else {
-            return "0" + n;
+    private static void appendTwoDigits(StringBuilder sb, int n) {
+        if (n < 10) {
+            sb.append('0');
         }
+        sb.append(n);
     }
 
     /**
diff --git a/luni/src/main/java/java/util/Dictionary.java b/luni/src/main/java/java/util/Dictionary.java
index 1895fa1..8182b2b 100644
--- a/luni/src/main/java/java/util/Dictionary.java
+++ b/luni/src/main/java/java/util/Dictionary.java
@@ -32,7 +32,6 @@
      * Constructs a new instance of this class.
      */
     public Dictionary() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/EmptyStackException.java b/luni/src/main/java/java/util/EmptyStackException.java
index d8a48cc..41e1eec 100644
--- a/luni/src/main/java/java/util/EmptyStackException.java
+++ b/luni/src/main/java/java/util/EmptyStackException.java
@@ -33,6 +33,5 @@
      * in.
      */
     public EmptyStackException() {
-        super();
     }
 }
diff --git a/luni/src/main/java/java/util/EnumMap.java b/luni/src/main/java/java/util/EnumMap.java
index 5da3b86..d3d42b4 100644
--- a/luni/src/main/java/java/util/EnumMap.java
+++ b/luni/src/main/java/java/util/EnumMap.java
@@ -477,7 +477,7 @@
             enumMap.initialization(this);
             return enumMap;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
@@ -755,7 +755,7 @@
 
     private void initialization(Class<K> type) {
         keyType = type;
-        keys = keyType.getEnumConstants();
+        keys = Enum.getSharedConstants(keyType);
         enumSize = keys.length;
         values = new Object[enumSize];
         hasMapping = new boolean[enumSize];
diff --git a/luni/src/main/java/java/util/EnumSet.java b/luni/src/main/java/java/util/EnumSet.java
index 1b4723e..cc8969e 100644
--- a/luni/src/main/java/java/util/EnumSet.java
+++ b/luni/src/main/java/java/util/EnumSet.java
@@ -15,25 +15,13 @@
  */
 package java.util;
 
-// BEGIN android-added
-
 import java.io.Serializable;
-import org.apache.harmony.kernel.vm.LangAccess;
 
 /**
  * An EnumSet is a specialized Set to be used with enums as keys.
  */
 public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E>
         implements Cloneable, Serializable {
-    // BEGIN android-added
-    /*
-     * null-ok; package access to {@code java.lang}, set during
-     * first need. This shouldn't be used directly. Instead, use {@link
-     * SpecialAccess#LANG}, which is guaranteed to be initialized.
-     */
-    static /*package*/ LangAccess LANG_BOOTSTRAP = null;
-    // END android-added
-
     private static final long serialVersionUID = 1009687484059888093L;
 
     final Class<E> elementClass;
@@ -57,13 +45,11 @@
         if (!elementType.isEnum()) {
             throw new ClassCastException(elementType.getClass().getName() + " is not an Enum");
         }
-        // BEGIN android-changed
-        E[] enums = SpecialAccess.LANG.getEnumValuesInOrder(elementType);
+        E[] enums = Enum.getSharedConstants(elementType);
         if (enums.length <= 64) {
             return new MiniEnumSet<E>(elementType, enums);
         }
         return new HugeEnumSet<E>(elementType, enums);
-        // END android-changed
     }
 
     /**
diff --git a/luni/src/main/java/java/util/EventListenerProxy.java b/luni/src/main/java/java/util/EventListenerProxy.java
index adf822a..c4b50ba 100644
--- a/luni/src/main/java/java/util/EventListenerProxy.java
+++ b/luni/src/main/java/java/util/EventListenerProxy.java
@@ -32,7 +32,6 @@
      *            the listener wrapped by this proxy.
      */
     public EventListenerProxy(EventListener listener) {
-        super();
         this.listener = listener;
     }
 
diff --git a/luni/src/main/java/java/util/Formatter.java b/luni/src/main/java/java/util/Formatter.java
index 490ae8e..e9a2f4a 100644
--- a/luni/src/main/java/java/util/Formatter.java
+++ b/luni/src/main/java/java/util/Formatter.java
@@ -30,8 +30,6 @@
 import java.math.BigInteger;
 import java.math.MathContext;
 import java.nio.charset.Charset;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import libcore.icu.LocaleData;
 import libcore.icu.NativeDecimalFormat;
 import libcore.io.IoUtils;
@@ -293,7 +291,7 @@
  * </tr>
  * <tr>
  * <td width="5%">{@code n}</td>
- * <td width="25%">Newline. (The value of the system property {@code "line.separator"}.)</td>
+ * <td width="25%">Newline. (The value of the "line.separator" system property}.)</td>
  * <td width="30%">{@code format("first%nsecond");}</td>
  * <td width="30%">{@code first\nsecond}</td>
  * </tr>
@@ -528,9 +526,6 @@
 public final class Formatter implements Closeable, Flushable {
     private static final char[] ZEROS = new char[] { '0', '0', '0', '0', '0', '0', '0', '0', '0' };
 
-    // The cached line separator.
-    private static String lineSeparator;
-
     /**
      * The enumeration giving the available styles for formatting very large
      * decimal numbers.
@@ -677,9 +672,6 @@
      *             if the filename does not denote a normal and writable file,
      *             or if a new file cannot be created, or if any error arises when
      *             opening or creating the file.
-     * @throws SecurityException
-     *             if there is a {@code SecurityManager} in place which denies permission
-     *             to write to the file in {@code checkWrite(file.getPath())}.
      */
     public Formatter(String fileName) throws FileNotFoundException {
         this(new File(fileName));
@@ -703,9 +695,6 @@
      *             if the filename does not denote a normal and writable file,
      *             or if a new file cannot be created, or if any error arises when
      *             opening or creating the file.
-     * @throws SecurityException
-     *             if there is a {@code SecurityManager} in place which denies permission
-     *             to write to the file in {@code checkWrite(file.getPath())}.
      * @throws UnsupportedEncodingException
      *             if the charset with the specified name is not supported.
      */
@@ -732,9 +721,6 @@
      *             if the filename does not denote a normal and writable file,
      *             or if a new file cannot be created, or if any error arises when
      *             opening or creating the file.
-     * @throws SecurityException
-     *             if there is a {@code SecurityManager} in place which denies permission
-     *             to write to the file in {@code checkWrite(file.getPath())}.
      * @throws UnsupportedEncodingException
      *             if the charset with the specified name is not supported.
      */
@@ -761,9 +747,6 @@
      *             if the {@code File} is not a normal and writable {@code File}, or if a
      *             new {@code File} cannot be created, or if any error rises when opening or
      *             creating the {@code File}.
-     * @throws SecurityException
-     *             if there is a {@code SecurityManager} in place which denies permission
-     *             to write to the {@code File} in {@code checkWrite(file.getPath())}.
      */
     public Formatter(File file) throws FileNotFoundException {
         this(new FileOutputStream(file));
@@ -787,9 +770,6 @@
      *             if the {@code File} is not a normal and writable {@code File}, or if a
      *             new {@code File} cannot be created, or if any error rises when opening or
      *             creating the {@code File}.
-     * @throws SecurityException
-     *             if there is a {@code SecurityManager} in place which denies permission
-     *             to write to the {@code File} in {@code checkWrite(file.getPath())}.
      * @throws UnsupportedEncodingException
      *             if the charset with the specified name is not supported.
      */
@@ -816,9 +796,6 @@
      *             if the {@code File} is not a normal and writable {@code File}, or if a
      *             new {@code File} cannot be created, or if any error rises when opening or
      *             creating the {@code File}.
-     * @throws SecurityException
-     *             if there is a {@code SecurityManager} in place which denies permission
-     *             to write to the {@code File} in {@code checkWrite(file.getPath())}.
      * @throws UnsupportedEncodingException
      *             if the charset with the specified name is not supported.
      */
@@ -1489,7 +1466,7 @@
             result = transformFromPercent();
             break;
         case 'n':
-            result = transformFromLineSeparator();
+            result = System.lineSeparator();
             break;
         case 't': case 'T':
             result = transformFromDateTime();
@@ -1630,17 +1607,6 @@
         return padding("%", 0);
     }
 
-    private CharSequence transformFromLineSeparator() {
-        if (lineSeparator == null) {
-            lineSeparator = AccessController.doPrivileged(new PrivilegedAction<String>() {
-                public String run() {
-                    return System.getProperty("line.separator");
-                }
-            });
-        }
-        return lineSeparator;
-    }
-
     private CharSequence padding(CharSequence source, int startIndex) {
         int start = startIndex;
         int width = formatToken.getWidth();
@@ -2078,17 +2044,17 @@
         StringBuilder result = new StringBuilder();
         switch (conversionType) {
         case 'a': case 'A':
-            transform_a(result);
+            transformA(result);
             break;
         case 'e': case 'E':
-            transform_e(result);
+            transformE(result);
             break;
         case 'f':
-            transform_f(result);
+            transformF(result);
             break;
         case 'g':
         case 'G':
-            transform_g(result);
+            transformG(result);
             break;
         default:
             throw formatToken.unknownFormatConversionException();
@@ -2123,7 +2089,7 @@
         return padding(result, startIndex);
     }
 
-    private void transform_e(StringBuilder result) {
+    private void transformE(StringBuilder result) {
         // All zeros in this method are *pattern* characters, so no localization.
         final int precision = formatToken.getPrecision();
         String pattern = "0E+00";
@@ -2157,7 +2123,7 @@
         }
     }
 
-    private void transform_g(StringBuilder result) {
+    private void transformG(StringBuilder result) {
         int precision = formatToken.getPrecision();
         if (precision == 0) {
             precision = 1;
@@ -2168,7 +2134,7 @@
         if (d == 0.0) {
             precision--;
             formatToken.setPrecision(precision);
-            transform_f(result);
+            transformF(result);
             return;
         }
 
@@ -2178,7 +2144,7 @@
             precision = formatToken.getPrecision();
             precision--;
             formatToken.setPrecision(precision);
-            transform_e(result);
+            transformE(result);
             return;
         }
         BigDecimal b = new BigDecimal(d, new MathContext(precision));
@@ -2215,13 +2181,13 @@
             precision = formatToken.getPrecision();
             precision--;
             formatToken.setPrecision(precision);
-            transform_e(result);
+            transformE(result);
         } else {
-            transform_f(result);
+            transformF(result);
         }
     }
 
-    private void transform_f(StringBuilder result) {
+    private void transformF(StringBuilder result) {
         // All zeros in this method are *pattern* characters, so no localization.
         String pattern = "0.000000";
         final int precision = formatToken.getPrecision();
@@ -2256,7 +2222,7 @@
         }
     }
 
-    private void transform_a(StringBuilder result) {
+    private void transformA(StringBuilder result) {
         if (arg instanceof Float) {
             result.append(Float.toHexString(((Float) arg).floatValue()));
         } else if (arg instanceof Double) {
diff --git a/luni/src/main/java/java/util/GregorianCalendar.java b/luni/src/main/java/java/util/GregorianCalendar.java
index a240708..478e236 100644
--- a/luni/src/main/java/java/util/GregorianCalendar.java
+++ b/luni/src/main/java/java/util/GregorianCalendar.java
@@ -640,9 +640,7 @@
             // FIXME: this has to be wrong; useDaylightTime doesn't mean what they think it means!
             long newTimeAdjusted = newTime;
             if (timeZone.useDaylightTime()) {
-                // BEGIN android-changed: removed unnecessary cast
                 int dstSavings = timeZone.getDSTSavings();
-                // END android-changed
                 newTimeAdjusted += (dstOffset == 0) ? dstSavings : -dstSavings;
             }
 
diff --git a/luni/src/main/java/java/util/HashMap.java b/luni/src/main/java/java/util/HashMap.java
index 7aa6dc2..1b2438b 100644
--- a/luni/src/main/java/java/util/HashMap.java
+++ b/luni/src/main/java/java/util/HashMap.java
@@ -15,10 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// Completely different implementation from harmony.  Runs much faster.
-// BEGIN android-note
-
 package java.util;
 
 import java.io.IOException;
@@ -1000,14 +996,8 @@
 
     private static final long serialVersionUID = 362498820763181265L;
 
-    /**
-     * Serializable fields.
-     *
-     * @serialField loadFactor float
-     *              load factor for this HashMap
-     */
     private static final ObjectStreamField[] serialPersistentFields = {
-        new ObjectStreamField("loadFactor", Float.TYPE)
+        new ObjectStreamField("loadFactor", float.class)
     };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
diff --git a/luni/src/main/java/java/util/HashSet.java b/luni/src/main/java/java/util/HashSet.java
index 2df5299..a35fd56 100644
--- a/luni/src/main/java/java/util/HashSet.java
+++ b/luni/src/main/java/java/util/HashSet.java
@@ -121,7 +121,7 @@
             clone.backingMap = (HashMap<E, HashSet<E>>) backingMap.clone();
             return clone;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/util/Hashtable.java b/luni/src/main/java/java/util/Hashtable.java
index 03e80a9..cea29da 100644
--- a/luni/src/main/java/java/util/Hashtable.java
+++ b/luni/src/main/java/java/util/Hashtable.java
@@ -15,10 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// Completely different implementation from harmony.  Runs much faster.
-// BEGIN android-note
-
 package java.util;
 
 import java.io.IOException;
@@ -1096,15 +1092,9 @@
 
     private static final long serialVersionUID = 1421746759512286392L;
 
-    /**
-     * Serializable fields.
-     *
-     * @serialField loadFactor float
-     *              load factor for this Hashtable
-     */
     private static final ObjectStreamField[] serialPersistentFields = {
-        new ObjectStreamField("threshold", Integer.TYPE),
-        new ObjectStreamField("loadFactor", Float.TYPE)
+        new ObjectStreamField("threshold", int.class),
+        new ObjectStreamField("loadFactor", float.class),
     };
 
     private synchronized void writeObject(ObjectOutputStream stream)
diff --git a/luni/src/main/java/java/util/HugeEnumSet.java b/luni/src/main/java/java/util/HugeEnumSet.java
index 2c6395f..b854372 100644
--- a/luni/src/main/java/java/util/HugeEnumSet.java
+++ b/luni/src/main/java/java/util/HugeEnumSet.java
@@ -31,12 +31,11 @@
 
     private int size;
 
-    // BEGIN android-changed
     /**
      * Constructs an instance.
      *
      * @param elementType non-null; type of the elements
-     * @param enums non-null; prepopulated array of constants in ordinal
+     * @param enums non-null; pre-populated array of constants in ordinal
      * order
      */
     HugeEnumSet(Class<E> elementType, E[] enums) {
@@ -44,7 +43,6 @@
         this.enums = enums;
         bits = new long[(enums.length + BIT_IN_LONG - 1) / BIT_IN_LONG];
     }
-    // END android-changed
 
     private class HugeEnumSetIterator implements Iterator<E> {
 
diff --git a/luni/src/main/java/java/util/IdentityHashMap.java b/luni/src/main/java/java/util/IdentityHashMap.java
index 827ffcf..e693f7d 100644
--- a/luni/src/main/java/java/util/IdentityHashMap.java
+++ b/luni/src/main/java/java/util/IdentityHashMap.java
@@ -761,14 +761,12 @@
     @Override
     public Object clone() {
         try {
-            IdentityHashMap<K, V> cloneHashMap = (IdentityHashMap<K, V>) super
-                    .clone();
+            IdentityHashMap<K, V> cloneHashMap = (IdentityHashMap<K, V>) super.clone();
             cloneHashMap.elementData = newElementArray(elementData.length);
-            System.arraycopy(elementData, 0, cloneHashMap.elementData, 0,
-                    elementData.length);
+            System.arraycopy(elementData, 0, cloneHashMap.elementData, 0, elementData.length);
             return cloneHashMap;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/util/InputMismatchException.java b/luni/src/main/java/java/util/InputMismatchException.java
index 60616d2..3aa7d30 100644
--- a/luni/src/main/java/java/util/InputMismatchException.java
+++ b/luni/src/main/java/java/util/InputMismatchException.java
@@ -35,7 +35,6 @@
      * trace filled in.
      */
     public InputMismatchException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/LinkedHashMap.java b/luni/src/main/java/java/util/LinkedHashMap.java
index 5db8eb6..d8fc02d 100644
--- a/luni/src/main/java/java/util/LinkedHashMap.java
+++ b/luni/src/main/java/java/util/LinkedHashMap.java
@@ -15,10 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// Completely different implementation from harmony.  Runs much faster.
-// BEGIN android-note
-
 package java.util;
 
 /**
@@ -68,7 +64,6 @@
      * Constructs a new empty {@code LinkedHashMap} instance.
      */
     public LinkedHashMap() {
-        super();
         init();
         accessOrder = false;
     }
diff --git a/luni/src/main/java/java/util/LinkedList.java b/luni/src/main/java/java/util/LinkedList.java
index 2d264c2..a1dc8d8 100644
--- a/luni/src/main/java/java/util/LinkedList.java
+++ b/luni/src/main/java/java/util/LinkedList.java
@@ -195,7 +195,6 @@
         private boolean canRemove;
 
         ReverseLinkIterator(LinkedList<ET> linkedList) {
-            super();
             list = linkedList;
             expectedModCount = list.modCount;
             link = list.voidLink;
@@ -469,7 +468,7 @@
             l.addAll(this);
             return l;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/util/ListResourceBundle.java b/luni/src/main/java/java/util/ListResourceBundle.java
index e49c9e3..1508b93 100644
--- a/luni/src/main/java/java/util/ListResourceBundle.java
+++ b/luni/src/main/java/java/util/ListResourceBundle.java
@@ -32,7 +32,6 @@
      * Constructs a new instance of this class.
      */
     public ListResourceBundle() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/Locale.java b/luni/src/main/java/java/util/Locale.java
index 9e26f65..03bafa0 100644
--- a/luni/src/main/java/java/util/Locale.java
+++ b/luni/src/main/java/java/util/Locale.java
@@ -22,10 +22,7 @@
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamField;
 import java.io.Serializable;
-import java.security.AccessController;
 import libcore.icu.ICU;
-import org.apache.harmony.luni.util.PriviAction;
-import org.apache.harmony.luni.util.Util;
 
 /**
  * {@code Locale} represents a language/country/variant combination. Locales are used to
@@ -107,89 +104,85 @@
 
     private static final long serialVersionUID = 9149081749638150636L;
 
-    // Initialize a default which is used during static
-    // initialization of the default for the platform.
-    private static Locale defaultLocale = new Locale();
-
     /**
      * Locale constant for en_CA.
      */
-    public static final Locale CANADA = new Locale("en", "CA");
+    public static final Locale CANADA = new Locale(true, "en", "CA");
 
     /**
      * Locale constant for fr_CA.
      */
-    public static final Locale CANADA_FRENCH = new Locale("fr", "CA");
+    public static final Locale CANADA_FRENCH = new Locale(true, "fr", "CA");
 
     /**
      * Locale constant for zh_CN.
      */
-    public static final Locale CHINA = new Locale("zh", "CN");
+    public static final Locale CHINA = new Locale(true, "zh", "CN");
 
     /**
      * Locale constant for zh.
      */
-    public static final Locale CHINESE = new Locale("zh", "");
+    public static final Locale CHINESE = new Locale(true, "zh", "");
 
     /**
      * Locale constant for en.
      */
-    public static final Locale ENGLISH = new Locale("en", "");
+    public static final Locale ENGLISH = new Locale(true, "en", "");
 
     /**
      * Locale constant for fr_FR.
      */
-    public static final Locale FRANCE = new Locale("fr", "FR");
+    public static final Locale FRANCE = new Locale(true, "fr", "FR");
 
     /**
      * Locale constant for fr.
      */
-    public static final Locale FRENCH = new Locale("fr", "");
+    public static final Locale FRENCH = new Locale(true, "fr", "");
 
     /**
      * Locale constant for de.
      */
-    public static final Locale GERMAN = new Locale("de", "");
+    public static final Locale GERMAN = new Locale(true, "de", "");
 
     /**
      * Locale constant for de_DE.
      */
-    public static final Locale GERMANY = new Locale("de", "DE");
+    public static final Locale GERMANY = new Locale(true, "de", "DE");
 
     /**
      * Locale constant for it.
      */
-    public static final Locale ITALIAN = new Locale("it", "");
+    public static final Locale ITALIAN = new Locale(true, "it", "");
 
     /**
      * Locale constant for it_IT.
      */
-    public static final Locale ITALY = new Locale("it", "IT");
+    public static final Locale ITALY = new Locale(true, "it", "IT");
 
     /**
      * Locale constant for ja_JP.
      */
-    public static final Locale JAPAN = new Locale("ja", "JP");
+    public static final Locale JAPAN = new Locale(true, "ja", "JP");
 
     /**
      * Locale constant for ja.
      */
-    public static final Locale JAPANESE = new Locale("ja", "");
+    public static final Locale JAPANESE = new Locale(true, "ja", "");
 
     /**
      * Locale constant for ko_KR.
      */
-    public static final Locale KOREA = new Locale("ko", "KR");
+    public static final Locale KOREA = new Locale(true, "ko", "KR");
 
     /**
      * Locale constant for ko.
      */
-    public static final Locale KOREAN = new Locale("ko", "");
+    public static final Locale KOREAN = new Locale(true, "ko", "");
 
     /**
      * Locale constant for zh_CN.
      */
-    public static final Locale PRC = new Locale("zh", "CN");
+    public static final Locale PRC = new Locale(true, "zh", "CN");
 
     /**
      * Locale constant for the root locale. The root locale has an empty language,
@@ -197,40 +190,43 @@
      *
      * @since 1.6
      */
-    public static final Locale ROOT = new Locale("", "", "");
+    public static final Locale ROOT = new Locale(true, "", "");
 
     /**
      * Locale constant for zh_CN.
      */
-    public static final Locale SIMPLIFIED_CHINESE = new Locale("zh", "CN");
+    public static final Locale SIMPLIFIED_CHINESE = new Locale(true, "zh", "CN");
 
     /**
      * Locale constant for zh_TW.
      */
-    public static final Locale TAIWAN = new Locale("zh", "TW");
+    public static final Locale TAIWAN = new Locale(true, "zh", "TW");
 
     /**
      * Locale constant for zh_TW.
      */
-    public static final Locale TRADITIONAL_CHINESE = new Locale("zh", "TW");
+    public static final Locale TRADITIONAL_CHINESE = new Locale(true, "zh", "TW");
 
     /**
      * Locale constant for en_GB.
      */
-    public static final Locale UK = new Locale("en", "GB");
+    public static final Locale UK = new Locale(true, "en", "GB");
 
     /**
      * Locale constant for en_US.
      */
-    public static final Locale US = new Locale("en", "US");
+    public static final Locale US = new Locale(true, "en", "US");
 
-    private static final PropertyPermission setLocalePermission = new PropertyPermission(
-            "user.language", "write");
+    /**
+     * The current default locale. It is temporarily assigned to US because we
+     * need a default locale to lookup the real default locale.
+     */
+    private static Locale defaultLocale = US;
 
     static {
-        String language = AccessController.doPrivileged(new PriviAction<String>("user.language", "en"));
-        String region = AccessController.doPrivileged(new PriviAction<String>("user.region", "US"));
-        String variant = AccessController.doPrivileged(new PriviAction<String>("user.variant", ""));
+        String language = System.getProperty("user.language", "en");
+        String region = System.getProperty("user.region", "US");
+        String variant = System.getProperty("user.variant", "");
         defaultLocale = new Locale(language, region, variant);
     }
 
@@ -240,13 +236,16 @@
     private transient String cachedToStringResult;
 
     /**
-     * Constructs a default which is used during static initialization of the
-     * default for the platform.
+     * There's a circular dependency between toLowerCase/toUpperCase and
+     * Locale.US. Work around this by avoiding these methods when constructing
+     * the built-in locales.
+     *
+     * @param unused required for this constructor to have a unique signature
      */
-    private Locale() {
-        languageCode = "en";
-        countryCode = "US";
-        variantCode = "";
+    private Locale(boolean unused, String lowerCaseLanguageCode, String upperCaseCountryCode) {
+        this.languageCode = lowerCaseLanguageCode;
+        this.countryCode = upperCaseCountryCode;
+        this.variantCode = "";
     }
 
     /**
@@ -271,17 +270,14 @@
         if (language == null || country == null || variant == null) {
             throw new NullPointerException();
         }
-        if(language.isEmpty() && country.isEmpty()){
+        if (language.isEmpty() && country.isEmpty()) {
             languageCode = "";
             countryCode = "";
             variantCode = variant;
             return;
         }
-        // BEGIN android-changed
-        // this.uLocale = new ULocale(language, country, variant);
-        // languageCode = uLocale.getLanguage();
-        languageCode = Util.toASCIILowerCase(language);
-        // END android-changed
+
+        languageCode = language.toLowerCase(Locale.US);
         // Map new language codes to the obsolete language
         // codes so the correct resource bundles will be used.
         if (languageCode.equals("he")) {
@@ -292,11 +288,7 @@
             languageCode = "ji";
         }
 
-        // countryCode is defined in ASCII character set
-        // BEGIN android-changed
-        // countryCode = country.length()!=0?uLocale.getCountry():"";
-        countryCode = Util.toASCIIUpperCase(country);
-        // END android-changed
+        countryCode = country.toUpperCase(Locale.US);
 
         // Work around for be compatible with RI
         variantCode = variant;
@@ -560,12 +552,6 @@
         if (locale == null) {
             throw new NullPointerException();
         }
-
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkPermission(setLocalePermission);
-        }
-
         defaultLocale = locale;
     }
 
@@ -609,10 +595,11 @@
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("country", String.class),
-            new ObjectStreamField("hashcode", Integer.TYPE),
-            new ObjectStreamField("language", String.class),
-            new ObjectStreamField("variant", String.class) };
+        new ObjectStreamField("country", String.class),
+        new ObjectStreamField("hashcode", int.class),
+        new ObjectStreamField("language", String.class),
+        new ObjectStreamField("variant", String.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
diff --git a/luni/src/main/java/java/util/MapEntry.java b/luni/src/main/java/java/util/MapEntry.java
index b84697b..519b1cd 100644
--- a/luni/src/main/java/java/util/MapEntry.java
+++ b/luni/src/main/java/java/util/MapEntry.java
@@ -43,7 +43,7 @@
         try {
             return super.clone();
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/util/MiniEnumSet.java b/luni/src/main/java/java/util/MiniEnumSet.java
index c4c7364..3876160 100644
--- a/luni/src/main/java/java/util/MiniEnumSet.java
+++ b/luni/src/main/java/java/util/MiniEnumSet.java
@@ -30,19 +30,17 @@
 
     private long bits;
 
-    // BEGIN android-changed
     /**
      * Constructs an instance.
      *
      * @param elementType non-null; type of the elements
-     * @param enums non-null; prepopulated array of constants in ordinal
+     * @param enums non-null; pre-populated array of constants in ordinal
      * order
      */
     MiniEnumSet(Class<E> elementType, E[] enums) {
         super(elementType);
         this.enums = enums;
     }
-    // END android-changed
 
     private class MiniEnumSetIterator implements Iterator<E> {
 
diff --git a/luni/src/main/java/java/util/NoSuchElementException.java b/luni/src/main/java/java/util/NoSuchElementException.java
index 3583fb9..4c72ea3 100644
--- a/luni/src/main/java/java/util/NoSuchElementException.java
+++ b/luni/src/main/java/java/util/NoSuchElementException.java
@@ -19,12 +19,8 @@
 
 
 /**
- * A {@code NoSuchElementException} is thrown when trying to retrieve an element
- * past the end of an Enumeration, or the first or last element from an empty
- * Vector.
- *
- * @see Enumeration
- * @see java.lang.RuntimeException
+ * Thrown when trying to retrieve an element
+ * past the end of an Enumeration or Iterator.
  */
 public class NoSuchElementException extends RuntimeException {
 
@@ -35,7 +31,6 @@
      * trace filled in.
      */
     public NoSuchElementException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/Observable.java b/luni/src/main/java/java/util/Observable.java
index 5ed4563..2c2877e 100644
--- a/luni/src/main/java/java/util/Observable.java
+++ b/luni/src/main/java/java/util/Observable.java
@@ -38,7 +38,6 @@
      * Constructs a new {@code Observable} object.
      */
     public Observable() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/Properties.java b/luni/src/main/java/java/util/Properties.java
index bff7ebc..1731ad8 100644
--- a/luni/src/main/java/java/util/Properties.java
+++ b/luni/src/main/java/java/util/Properties.java
@@ -31,11 +31,9 @@
 import java.nio.charset.Charset;
 import java.nio.charset.IllegalCharsetNameException;
 import java.nio.charset.UnsupportedCharsetException;
-import java.security.AccessController;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
-import org.apache.harmony.luni.util.PriviAction;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -54,6 +52,13 @@
  * values to be used when a given key is not found in this {@code Properties}
  * instance.
  *
+ * <a name="character_encoding"><h3>Character Encoding</h3></a>
+ * <p>Note that in some cases {@code Properties} uses ISO-8859-1 instead of UTF-8.
+ * ISO-8859-1 is only capable of representing a tiny subset of Unicode.
+ * Use either the {@code loadFromXML}/{@code storeToXML} methods (which use UTF-8 by
+ * default) or the {@code load}/{@code store} overloads that take
+ * an {@code OutputStreamWriter} (so you can supply a UTF-8 instance) instead.
+ *
  * @see Hashtable
  * @see java.lang.System#getProperties
  */
@@ -85,7 +90,6 @@
      * Constructs a new {@code Properties} object.
      */
     public Properties() {
-        super();
     }
 
     /**
@@ -182,80 +186,58 @@
     }
 
     /**
-     * Lists the mappings in this {@code Properties} to the specified
-     * {@code PrintStream} in a
-     * human readable form.
-     *
-     * @param out
-     *            the {@code PrintStream} to write the content to in human readable
-     *            form.
+     * Lists the mappings in this {@code Properties} to {@code out} in a human-readable form.
+     * Note that values are truncated to 37 characters, so this method is rarely useful.
      */
     public void list(PrintStream out) {
-        if (out == null) {
-            throw new NullPointerException();
-        }
-        StringBuilder buffer = new StringBuilder(80);
-        Enumeration<?> keys = propertyNames();
-        while (keys.hasMoreElements()) {
-            String key = (String) keys.nextElement();
-            buffer.append(key);
-            buffer.append('=');
-            String property = (String) super.get(key);
-            Properties def = defaults;
-            while (property == null) {
-                property = (String) def.get(key);
-                def = def.defaults;
-            }
-            if (property.length() > 40) {
-                buffer.append(property.substring(0, 37));
-                buffer.append("...");
-            } else {
-                buffer.append(property);
-            }
-            out.println(buffer.toString());
-            buffer.setLength(0);
-        }
+        listToAppendable(out);
     }
 
     /**
-     * Lists the mappings in this {@code Properties} to the specified
-     * {@code PrintWriter} in a
-     * human readable form.
-     *
-     * @param writer
-     *            the {@code PrintWriter} to write the content to in human
-     *            readable form.
+     * Lists the mappings in this {@code Properties} to {@code out} in a human-readable form.
+     * Note that values are truncated to 37 characters, so this method is rarely useful.
      */
-    public void list(PrintWriter writer) {
-        if (writer == null) {
-            throw new NullPointerException();
-        }
-        StringBuilder buffer = new StringBuilder(80);
-        Enumeration<?> keys = propertyNames();
-        while (keys.hasMoreElements()) {
-            String key = (String) keys.nextElement();
-            buffer.append(key);
-            buffer.append('=');
-            String property = (String) super.get(key);
-            Properties def = defaults;
-            while (property == null) {
-                property = (String) def.get(key);
-                def = def.defaults;
+    public void list(PrintWriter out) {
+        listToAppendable(out);
+    }
+
+    private void listToAppendable(Appendable out) {
+        try {
+            if (out == null) {
+                throw new NullPointerException("out == null");
             }
-            if (property.length() > 40) {
-                buffer.append(property.substring(0, 37));
-                buffer.append("...");
-            } else {
-                buffer.append(property);
+            StringBuilder sb = new StringBuilder(80);
+            Enumeration<?> keys = propertyNames();
+            while (keys.hasMoreElements()) {
+                String key = (String) keys.nextElement();
+                sb.append(key);
+                sb.append('=');
+                String property = (String) super.get(key);
+                Properties def = defaults;
+                while (property == null) {
+                    property = (String) def.get(key);
+                    def = def.defaults;
+                }
+                if (property.length() > 40) {
+                    sb.append(property.substring(0, 37));
+                    sb.append("...");
+                } else {
+                    sb.append(property);
+                }
+                sb.append(System.lineSeparator());
+                out.append(sb.toString());
+                sb.setLength(0);
             }
-            writer.println(buffer.toString());
-            buffer.setLength(0);
+        } catch (IOException ex) {
+            // Appendable.append throws IOException, but PrintStream and PrintWriter don't.
+            throw new AssertionError(ex);
         }
     }
 
     /**
-     * Loads properties from the specified {@code InputStream}. The encoding is
-     * ISO-8859-1.
+     * Loads properties from the specified {@code InputStream}, assumed to be ISO-8859-1.
+     * See "<a href="#character_encoding">Character Encoding</a>".
+     *
      * @param in the {@code InputStream}
      * @throws IOException
      */
@@ -530,9 +512,8 @@
     }
 
     /**
-     * Stores the mappings in this {@code Properties} object to {@code out},
-     * putting the specified comment at the beginning. The encoding is
-     * ISO-8859-1.
+     * Stores properties to the specified {@code OutputStream}, using ISO-8859-1.
+     * See "<a href="#character_encoding">Character Encoding</a>".
      *
      * @param out the {@code OutputStream}
      * @param comment an optional comment to be written, or null
@@ -543,8 +524,6 @@
         store(new OutputStreamWriter(out, "ISO-8859-1"), comment);
     }
 
-    private static String lineSeparator;
-
     /**
      * Stores the mappings in this {@code Properties} object to {@code out},
      * putting the specified comment at the beginning.
@@ -556,28 +535,24 @@
      * @since 1.6
      */
     public synchronized void store(Writer writer, String comment) throws IOException {
-        if (lineSeparator == null) {
-            lineSeparator = AccessController.doPrivileged(new PriviAction<String>("line.separator"));
-        }
-
         if (comment != null) {
             writer.write("#");
             writer.write(comment);
-            writer.write(lineSeparator);
+            writer.write(System.lineSeparator());
         }
         writer.write("#");
         writer.write(new Date().toString());
-        writer.write(lineSeparator);
+        writer.write(System.lineSeparator());
 
-        StringBuilder buffer = new StringBuilder(200);
+        StringBuilder sb = new StringBuilder(200);
         for (Map.Entry<Object, Object> entry : entrySet()) {
             String key = (String) entry.getKey();
-            dumpString(buffer, key, true);
-            buffer.append('=');
-            dumpString(buffer, (String) entry.getValue(), false);
-            buffer.append(lineSeparator);
-            writer.write(buffer.toString());
-            buffer.setLength(0);
+            dumpString(sb, key, true);
+            sb.append('=');
+            dumpString(sb, (String) entry.getValue(), false);
+            sb.append(System.lineSeparator());
+            writer.write(sb.toString());
+            sb.setLength(0);
         }
         writer.flush();
     }
@@ -658,7 +633,7 @@
             for (int i = 0; i < entriesListLength; i++) {
                 Element entry = (Element) entries.item(i);
                 String key = entry.getAttribute("key");
-                String value = getTextContent(entry);
+                String value = entry.getTextContent();
 
                 /*
                  * key != null & value != null but key or(and) value can be
@@ -772,28 +747,12 @@
     }
 
     private String substitutePredefinedEntries(String s) {
-
-        /*
-         * substitution for predefined character entities to use them safely in
-         * XML
-         */
-        return s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(
-                ">", "&gt;").replaceAll("\u0027", "&apos;").replaceAll("\"",
-                "&quot;");
+        // substitution for predefined character entities to use them safely in XML.
+        s = s.replaceAll("&", "&amp;");
+        s = s.replaceAll("<", "&lt;");
+        s = s.replaceAll(">", "&gt;");
+        s = s.replaceAll("'", "&apos;");
+        s = s.replaceAll("\"", "&quot;");
+        return s;
     }
-
-    // BEGIN android-added: our SAX parser still doesn't do this for us.
-    private String getTextContent(Node node) {
-        String result = (node instanceof Text ? ((Text) node).getData() : "");
-
-        Node child = node.getFirstChild();
-        while (child != null) {
-            result = result + getTextContent(child);
-            child = child.getNextSibling();
-        }
-
-        return result;
-    }
-    // END android-added
-
 }
diff --git a/luni/src/main/java/java/util/PropertyPermission.java b/luni/src/main/java/java/util/PropertyPermission.java
index b4ac105..a5a4738 100644
--- a/luni/src/main/java/java/util/PropertyPermission.java
+++ b/luni/src/main/java/java/util/PropertyPermission.java
@@ -24,7 +24,6 @@
 import java.security.BasicPermission;
 import java.security.Permission;
 import java.security.PermissionCollection;
-import org.apache.harmony.luni.util.Util;
 
 /**
  * {@code PropertyPermission} objects represent a permission to access system
@@ -60,8 +59,7 @@
     }
 
     private void decodeActions(String actions) {
-        StringTokenizer tokenizer = new StringTokenizer(Util.toASCIILowerCase(actions),
-                " \t\n\r,");
+        StringTokenizer tokenizer = new StringTokenizer(actions.toLowerCase(Locale.US), " \t\n\r,");
         while (tokenizer.hasMoreTokens()) {
             String token = tokenizer.nextToken();
             if (token.equals("read")) {
@@ -153,8 +151,9 @@
         return new PropertyPermissionCollection();
     }
 
-    private static final ObjectStreamField[] serialPersistentFields = { new ObjectStreamField(
-            "actions", String.class) };
+    private static final ObjectStreamField[] serialPersistentFields = {
+        new ObjectStreamField("actions", String.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
diff --git a/luni/src/main/java/java/util/PropertyPermissionCollection.java b/luni/src/main/java/java/util/PropertyPermissionCollection.java
index 3d4b3a5..6736d32 100644
--- a/luni/src/main/java/java/util/PropertyPermissionCollection.java
+++ b/luni/src/main/java/java/util/PropertyPermissionCollection.java
@@ -76,8 +76,9 @@
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("permissions", Hashtable.class),
-            new ObjectStreamField("all_allowed", Boolean.TYPE) };
+        new ObjectStreamField("permissions", Hashtable.class),
+        new ObjectStreamField("all_allowed", boolean.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         ObjectOutputStream.PutField fields = stream.putFields();
diff --git a/luni/src/main/java/java/util/Random.java b/luni/src/main/java/java/util/Random.java
index dac8eec..7ce74cc 100644
--- a/luni/src/main/java/java/util/Random.java
+++ b/luni/src/main/java/java/util/Random.java
@@ -23,6 +23,11 @@
 /**
  * This class provides methods that return pseudo-random values.
  *
+ * <p>It is dangerous to seed {@code Random} with the current time because
+ * that value is more predictable to an attacker than the default seed.
+ *
+ * <p>This class is thread-safe.
+ *
  * @see java.security.SecureRandom
  */
 public class Random implements Serializable {
@@ -55,9 +60,7 @@
      * unlikely to be duplicated by a subsequent instantiation.
      *
      * <p>The initial state (that is, the seed) is <i>partially</i> based
-     * on the current time of day in milliseconds.</p>
-     *
-     * @see #setSeed
+     * on the current time of day in milliseconds.
      */
     public Random() {
         // Note: Using identityHashCode() to be hermetic wrt subclasses.
@@ -68,10 +71,8 @@
      * Construct a random generator with the given {@code seed} as the
      * initial state. Equivalent to {@code Random r = new Random(); r.setSeed(seed);}.
      *
-     * @param seed
-     *            the seed that will determine the initial state of this random
-     *            number generator.
-     * @see #setSeed
+     * <p>This constructor is mainly useful for <i>predictability</i> in tests.
+     * The default constructor is likely to provide better randomness.
      */
     public Random(long seed) {
         setSeed(seed);
@@ -133,7 +134,7 @@
     /**
      * Returns a pseudo-random (approximately) normally distributed
      * {@code double} with mean 0.0 and standard deviation 1.0.
-     * This method uses the <i>polar method<i> of G. E. P. Box, M.
+     * This method uses the <i>polar method</i> of G. E. P. Box, M.
      * E. Muller, and G. Marsaglia, as described by Donald E. Knuth in <i>The
      * Art of Computer Programming, Volume 2: Seminumerical Algorithms</i>,
      * section 3.4.1, subsection C, algorithm P.
diff --git a/luni/src/main/java/java/util/ResourceBundle.java b/luni/src/main/java/java/util/ResourceBundle.java
index 3c4442c..a34b34a 100644
--- a/luni/src/main/java/java/util/ResourceBundle.java
+++ b/luni/src/main/java/java/util/ResourceBundle.java
@@ -24,8 +24,6 @@
 import java.io.InputStreamReader;
 import java.net.URL;
 import java.net.URLConnection;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import libcore.io.IoUtils;
 
 /**
@@ -271,16 +269,11 @@
     }
 
     private static ClassLoader getLoader() {
-        return AccessController
-                .doPrivileged(new PrivilegedAction<ClassLoader>() {
-                    public ClassLoader run() {
-                        ClassLoader cl = this.getClass().getClassLoader();
-                        if (cl == null) {
-                            cl = ClassLoader.getSystemClassLoader();
-                        }
-                        return cl;
-                    }
-                });
+        ClassLoader cl = ResourceBundle.class.getClassLoader();
+        if (cl == null) {
+            cl = ClassLoader.getSystemClassLoader();
+        }
+        return cl;
     }
 
     /**
@@ -659,14 +652,12 @@
                 listDefault);
 
         public NoFallbackControl(String format) {
-            super();
             listClass = new ArrayList<String>();
             listClass.add(format);
             super.format = Collections.unmodifiableList(listClass);
         }
 
         public NoFallbackControl(List<String> list) {
-            super();
             super.format = list;
         }
 
@@ -681,14 +672,12 @@
 
     private static class SimpleControl extends Control {
         public SimpleControl(String format) {
-            super();
             listClass = new ArrayList<String>();
             listClass.add(format);
             super.format = Collections.unmodifiableList(listClass);
         }
     }
 
-    @SuppressWarnings("nls")
     /**
      * ResourceBundle.Control is a static utility class defines ResourceBundle
      * load access methods, its default access order is as the same as before.
@@ -757,7 +746,6 @@
          *
          */
         protected Control() {
-            super();
             listClass = new ArrayList<String>();
             listClass.add(JAVACLASS);
             listClass.add(JAVAPROPERTIES);
@@ -885,24 +873,16 @@
             if (format == null || loader == null) {
                 throw new NullPointerException();
             }
-            InputStream streams = null;
             final String bundleName = toBundleName(baseName, locale);
             final ClassLoader clsloader = loader;
             ResourceBundle ret;
-            Class<?> cls = null;
-            if (JAVACLASS == format) {
-                cls = AccessController
-                        .doPrivileged(new PrivilegedAction<Class<?>>() {
-                            public Class<?> run() {
-                                try {
-                                    return clsloader.loadClass(bundleName);
-                                } catch (Exception e) {
-                                    return null;
-                                } catch (NoClassDefFoundError e) {
-                                    return null;
-                                }
-                            }
-                        });
+            if (format.equals(JAVACLASS)) {
+                Class<?> cls = null;
+                try {
+                    cls = clsloader.loadClass(bundleName);
+                } catch (Exception e) {
+                } catch (NoClassDefFoundError e) {
+                }
                 if (cls == null) {
                     return null;
                 }
@@ -914,9 +894,9 @@
                     return null;
                 }
             }
-            if (JAVAPROPERTIES == format) {
-                final String resourceName = toResourceName(bundleName,
-                        "properties");
+            if (format.equals(JAVAPROPERTIES)) {
+                InputStream streams = null;
+                final String resourceName = toResourceName(bundleName, "properties");
                 if (reload) {
                     URL url = null;
                     try {
@@ -931,13 +911,7 @@
                     }
                 } else {
                     try {
-                        streams = AccessController
-                                .doPrivileged(new PrivilegedAction<InputStream>() {
-                                    public InputStream run() {
-                                        return clsloader
-                                                .getResourceAsStream(resourceName);
-                                    }
-                                });
+                        streams = clsloader.getResourceAsStream(resourceName);
                     } catch (NullPointerException e) {
                         // do nothing
                     }
@@ -994,10 +968,10 @@
             }
             String bundleName = toBundleName(baseName, locale);
             String suffix = format;
-            if (JAVACLASS == format) {
+            if (format.equals(JAVACLASS)) {
                 suffix = "class";
             }
-            if (JAVAPROPERTIES == format) {
+            if (format.equals(JAVAPROPERTIES)) {
                 suffix = "properties";
             }
             String urlname = toResourceName(bundleName, suffix);
diff --git a/luni/src/main/java/java/util/Scanner.java b/luni/src/main/java/java/util/Scanner.java
index 85de1e7..8f889b3 100644
--- a/luni/src/main/java/java/util/Scanner.java
+++ b/luni/src/main/java/java/util/Scanner.java
@@ -79,20 +79,10 @@
     private static final Pattern LINE_PATTERN;
 
     static {
-        String terminator = "\n|\r\n|\r|\u0085|\u2028|\u2029";
-
-        LINE_TERMINATOR = Pattern.compile(terminator);
-
-        // BEGIN android-note
-        // consider plain old string concatenation for better performance
-        // END android-note
-        StringBuilder multiTerminator = new StringBuilder();
-        MULTI_LINE_TERMINATOR = Pattern.compile(multiTerminator.append("(")
-                .append(terminator).append(")+").toString());
-        StringBuilder line = new StringBuilder();
-        LINE_PATTERN = Pattern.compile(line.append(".*(")
-                .append(terminator).append(")|.+(")
-                .append(terminator).append(")?").toString());
+        String NL = "\n|\r\n|\r|\u0085|\u2028|\u2029";
+        LINE_TERMINATOR = Pattern.compile(NL);
+        MULTI_LINE_TERMINATOR = Pattern.compile("(" + NL + ")+");
+        LINE_PATTERN = Pattern.compile(".*(" + NL + ")|.+(" + NL + ")?");
     }
 
     // The pattern matches anything.
diff --git a/luni/src/main/java/java/util/ServiceLoader.java b/luni/src/main/java/java/util/ServiceLoader.java
index 8fc232f..beacaab 100644
--- a/luni/src/main/java/java/util/ServiceLoader.java
+++ b/luni/src/main/java/java/util/ServiceLoader.java
@@ -20,8 +20,6 @@
 import java.io.IOException;
 import java.io.InputStreamReader;
 import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import libcore.io.IoUtils;
 
 /**
@@ -167,20 +165,16 @@
      * @hide
      */
     public static <S> S loadFromSystemProperty(final Class<S> service) {
-        return AccessController.doPrivileged(new PrivilegedAction<S>() {
-            public S run() {
-                try {
-                    final String className = System.getProperty(service.getName());
-                    if (className != null) {
-                        Class<?> c = ClassLoader.getSystemClassLoader().loadClass(className);
-                        return (S) c.newInstance();
-                    }
-                    return null;
-                } catch (Exception e) {
-                    throw new Error(e);
-                }
+        try {
+            final String className = System.getProperty(service.getName());
+            if (className != null) {
+                Class<?> c = ClassLoader.getSystemClassLoader().loadClass(className);
+                return (S) c.newInstance();
             }
-        });
+            return null;
+        } catch (Exception e) {
+            throw new Error(e);
+        }
     }
 
     @Override
diff --git a/luni/src/main/java/java/util/SimpleTimeZone.java b/luni/src/main/java/java/util/SimpleTimeZone.java
index a57ab9a..6c9b443 100644
--- a/luni/src/main/java/java/util/SimpleTimeZone.java
+++ b/luni/src/main/java/java/util/SimpleTimeZone.java
@@ -74,12 +74,6 @@
 
     private int dstSavings = 3600000;
 
-    // BEGIN android-removed
-    // private final transient com.ibm.icu.util.TimeZone icuTZ;
-    //
-    // private final transient boolean isSimple;
-    // END android-removed
-
     /**
      * Constructs a {@code SimpleTimeZone} with the given base time zone offset from GMT
      * and time zone ID. Timezone IDs can be obtained from
@@ -95,16 +89,6 @@
     public SimpleTimeZone(int offset, final String name) {
         setID(name);
         rawOffset = offset;
-        // BEGIN android-removed
-        // icuTZ = getICUTimeZone(name);
-        // if (icuTZ instanceof com.ibm.icu.util.SimpleTimeZone) {
-        //     isSimple = true;
-        //     icuTZ.setRawOffset(offset);
-        // } else {
-        //     isSimple = false;
-        // }
-        // useDaylight = icuTZ.useDaylightTime();
-        // END android-removed
     }
 
     /**
@@ -228,33 +212,15 @@
     public SimpleTimeZone(int offset, String name, int startMonth,
             int startDay, int startDayOfWeek, int startTime, int endMonth,
             int endDay, int endDayOfWeek, int endTime, int daylightSavings) {
-        // BEGIN android-changed
-        // icuTZ = getICUTimeZone(name);
-        // if (icuTZ instanceof com.ibm.icu.util.SimpleTimeZone) {
-        //     isSimple = true;
-        //     com.ibm.icu.util.SimpleTimeZone tz = (com.ibm.icu.util.SimpleTimeZone)icuTZ;
-        //     tz.setRawOffset(offset);
-        //     tz.setStartRule(startMonth, startDay, startDayOfWeek, startTime);
-        //     tz.setEndRule(endMonth, endDay, endDayOfWeek, endTime);
-        //     tz.setDSTSavings(daylightSavings);
-        // } else {
-        //     isSimple = false;
-        // }
-        // setID(name);
-        // rawOffset = offset;
         this(offset, name);
-        // END android-changed
         if (daylightSavings <= 0) {
             throw new IllegalArgumentException("Invalid daylightSavings: " + daylightSavings);
         }
         dstSavings = daylightSavings;
+        // TODO: do we need to set useDaylight is dstSavings != 0?
 
         setStartRule(startMonth, startDay, startDayOfWeek, startTime);
         setEndRule(endMonth, endDay, endDayOfWeek, endTime);
-
-        // BEGIN android-removed
-        // useDaylight = daylightSavings > 0 || icuTZ.useDaylightTime();
-        // END android-removed
     }
 
     /**
@@ -375,8 +341,6 @@
             checkDay(month, day);
         }
 
-        // BEGIN android-changed
-        // return icuTZ.getOffset(era, year, month, day, dayOfWeek, time);
         if (!useDaylightTime() || era != GregorianCalendar.AD || year < startYear) {
             return rawOffset;
         }
@@ -495,19 +459,17 @@
             }
         }
         return rawOffset + dstSavings;
-        // END android-changed
     }
 
     @Override
     public int getOffset(long time) {
-        // BEGIN android-changed: simplified variant of the ICU4J code.
+        // Simplified variant of the ICU4J code.
         if (!useDaylightTime()) {
             return rawOffset;
         }
         int[] fields = Grego.timeToFields(time + rawOffset, null);
         return getOffset(GregorianCalendar.AD, fields[0], fields[1], fields[2],
                 fields[3], fields[5]);
-        // END android-changed
     }
 
     @Override
@@ -554,11 +516,8 @@
                 && endTime == tz.endTime && endMode == tz.endMode;
     }
 
-    @Override
-    public boolean inDaylightTime(Date time) {
-        // BEGIN android-changed: reuse getOffset.
-        return useDaylightTime() && getOffset(time.getTime()) != rawOffset;
-        // END android-changed
+    @Override public boolean inDaylightTime(Date time) {
+        return useDaylightTime() && getOffset(time.getTime()) != getRawOffset();
     }
 
     private boolean isLeapYear(int year) {
@@ -568,12 +527,10 @@
         return year % 4 == 0;
     }
 
-    // BEGIN android-added
     private int mod7(int num1) {
         int rem = num1 % 7;
         return (num1 < 0 && rem < 0) ? 7 + rem : rem;
     }
-    // END android-added
 
     /**
      * Sets the daylight savings offset in milliseconds for this {@code SimpleTimeZone}.
@@ -656,12 +613,6 @@
         endDayOfWeek = 0; // Initialize this value for hasSameRules()
         endTime = time;
         setEndMode();
-        // BEGIN android-removed
-        // if (isSimple) {
-        //     ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setEndRule(month,
-        //             dayOfMonth, time);
-        // }
-        // END android-removed
     }
 
     /**
@@ -685,12 +636,6 @@
         endDayOfWeek = dayOfWeek;
         endTime = time;
         setEndMode();
-        // BEGIN android-removed
-        // if (isSimple) {
-        //     ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setEndRule(month, day,
-        //             dayOfWeek, time);
-        // }
-        // END android-removed
     }
 
     /**
@@ -709,19 +654,12 @@
      * @param after
      *            selects the day after or before the day of month.
      */
-    public void setEndRule(int month, int day, int dayOfWeek, int time,
-            boolean after) {
+    public void setEndRule(int month, int day, int dayOfWeek, int time, boolean after) {
         endMonth = month;
         endDay = after ? day : -day;
         endDayOfWeek = -dayOfWeek;
         endTime = time;
         setEndMode();
-        // BEGIN android-removed
-        // if (isSimple) {
-        //     ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setEndRule(month, day,
-        //             dayOfWeek, time, after);
-        // }
-        // END android-removed
     }
 
     /**
@@ -733,9 +671,6 @@
     @Override
     public void setRawOffset(int offset) {
         rawOffset = offset;
-        // BEGIN android-removed
-        // icuTZ.setRawOffset(offset);
-        // END android-removed
     }
 
     private void setStartMode() {
@@ -787,12 +722,6 @@
         startDayOfWeek = 0; // Initialize this value for hasSameRules()
         startTime = time;
         setStartMode();
-        // BEGIN android-removed
-        // if (isSimple) {
-        //     ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setStartRule(month,
-        //             dayOfMonth, time);
-        // }
-        // END android-removed
     }
 
     /**
@@ -816,12 +745,6 @@
         startDayOfWeek = dayOfWeek;
         startTime = time;
         setStartMode();
-        // BEGIN android-removed
-        // if (isSimple) {
-        //     ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setStartRule(month, day,
-        //             dayOfWeek, time);
-        // }
-        // END android-removed
     }
 
     /**
@@ -840,19 +763,12 @@
      * @param after
      *            selects the day after or before the day of month.
      */
-    public void setStartRule(int month, int day, int dayOfWeek, int time,
-            boolean after) {
+    public void setStartRule(int month, int day, int dayOfWeek, int time, boolean after) {
         startMonth = month;
         startDay = after ? day : -day;
         startDayOfWeek = -dayOfWeek;
         startTime = time;
         setStartMode();
-        // BEGIN android-removed
-        // if (isSimple) {
-        //     ((com.ibm.icu.util.SimpleTimeZone) icuTZ).setStartRule(month, day,
-        //             dayOfWeek, time, after);
-        // }
-        // END android-removed
     }
 
     /**
@@ -906,22 +822,23 @@
     }
 
     private static final ObjectStreamField[] serialPersistentFields = {
-            new ObjectStreamField("dstSavings", Integer.TYPE),
-            new ObjectStreamField("endDay", Integer.TYPE),
-            new ObjectStreamField("endDayOfWeek", Integer.TYPE),
-            new ObjectStreamField("endMode", Integer.TYPE),
-            new ObjectStreamField("endMonth", Integer.TYPE),
-            new ObjectStreamField("endTime", Integer.TYPE),
-            new ObjectStreamField("monthLength", byte[].class),
-            new ObjectStreamField("rawOffset", Integer.TYPE),
-            new ObjectStreamField("serialVersionOnStream", Integer.TYPE),
-            new ObjectStreamField("startDay", Integer.TYPE),
-            new ObjectStreamField("startDayOfWeek", Integer.TYPE),
-            new ObjectStreamField("startMode", Integer.TYPE),
-            new ObjectStreamField("startMonth", Integer.TYPE),
-            new ObjectStreamField("startTime", Integer.TYPE),
-            new ObjectStreamField("startYear", Integer.TYPE),
-            new ObjectStreamField("useDaylight", Boolean.TYPE), };
+        new ObjectStreamField("dstSavings", int.class),
+        new ObjectStreamField("endDay", int.class),
+        new ObjectStreamField("endDayOfWeek", int.class),
+        new ObjectStreamField("endMode", int.class),
+        new ObjectStreamField("endMonth", int.class),
+        new ObjectStreamField("endTime", int.class),
+        new ObjectStreamField("monthLength", byte[].class),
+        new ObjectStreamField("rawOffset", int.class),
+        new ObjectStreamField("serialVersionOnStream", int.class),
+        new ObjectStreamField("startDay", int.class),
+        new ObjectStreamField("startDayOfWeek", int.class),
+        new ObjectStreamField("startMode", int.class),
+        new ObjectStreamField("startMonth", int.class),
+        new ObjectStreamField("startTime", int.class),
+        new ObjectStreamField("startYear", int.class),
+        new ObjectStreamField("useDaylight", boolean.class),
+    };
 
     private void writeObject(ObjectOutputStream stream) throws IOException {
         int sEndDay = endDay, sEndDayOfWeek = endDayOfWeek + 1, sStartDay = startDay, sStartDayOfWeek = startDayOfWeek + 1;
diff --git a/luni/src/main/java/java/util/SpecialAccess.java b/luni/src/main/java/java/util/SpecialAccess.java
deleted file mode 100644
index 49a904b..0000000
--- a/luni/src/main/java/java/util/SpecialAccess.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package java.util;
-
-import org.apache.harmony.kernel.vm.LangAccess;
-
-/**
- * Holder for special cross-package access objects.
- */
-/*package*/ final class SpecialAccess {
-    /** non-null; package access to {@code java.lang} */
-    static /*package*/ final LangAccess LANG;
-
-    static {
-        /*
-         * Force ClassCache to be initialized, which should set
-         * EnumSet.LANG_BOOTSTRAP.
-         */
-        try {
-            Runnable.class.getMethod("run", (Class[]) null);
-        } catch (NoSuchMethodException ex) {
-            ex.printStackTrace();
-            throw new AssertionError(ex);
-        }
-
-        // This can only be assigned after the above bootstrap.
-        LANG = EnumSet.LANG_BOOTSTRAP;
-
-        if (LANG == null) {
-            throw new AssertionError();
-        }
-    }
-}
diff --git a/luni/src/main/java/java/util/Stack.java b/luni/src/main/java/java/util/Stack.java
index eb24a56..8e51bee 100644
--- a/luni/src/main/java/java/util/Stack.java
+++ b/luni/src/main/java/java/util/Stack.java
@@ -30,7 +30,6 @@
      * Constructs a stack with the default size of {@code Vector}.
      */
     public Stack() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/StringTokenizer.java b/luni/src/main/java/java/util/StringTokenizer.java
index e581088..1b07604 100644
--- a/luni/src/main/java/java/util/StringTokenizer.java
+++ b/luni/src/main/java/java/util/StringTokenizer.java
@@ -18,88 +18,24 @@
 package java.util;
 
 /**
- * The {@code StringTokenizer} class allows an application to break a string
- * into tokens by performing code point comparison. The {@code StringTokenizer}
- * methods do not distinguish among identifiers, numbers, and quoted strings,
- * nor do they recognize and skip comments.
- * <p>
- * The set of delimiters (the codepoints that separate tokens) may be specified
- * either at creation time or on a per-token basis.
- * <p>
- * An instance of {@code StringTokenizer} behaves in one of three ways,
- * depending on whether it was created with the {@code returnDelimiters} flag
- * having the value {@code true} or {@code false}:
- * <ul>
- * <li>If returnDelims is {@code false}, delimiter code points serve to separate
- * tokens. A token is a maximal sequence of consecutive code points that are not
- * delimiters.
- * <li>If returnDelims is {@code true}, delimiter code points are themselves
- * considered to be tokens. In this case a token will be received for each
- * delimiter code point.
- * </ul>
- * <p>
- * A token is thus either one delimiter code point, or a maximal sequence of
- * consecutive code points that are not delimiters.
- * <p>
- * A {@code StringTokenizer} object internally maintains a current position
- * within the string to be tokenized. Some operations advance this current
- * position past the code point processed.
- * <p>
- * A token is returned by taking a substring of the string that was used to
- * create the {@code StringTokenizer} object.
- * <p>
- * Here's an example of the use of the default delimiter {@code StringTokenizer}
- * : <blockquote>
+ * Breaks a string into tokens; new code should probably use {@link String#split}.
  *
+ * <blockquote>
  * <pre>
- * StringTokenizer st = new StringTokenizer(&quot;this is a test&quot;);
+ * // Legacy code:
+ * StringTokenizer st = new StringTokenizer("a:b:c", ":");
  * while (st.hasMoreTokens()) {
- *     println(st.nextToken());
+ *     System.err.println(st.nextToken());
+ * }
+ *
+ * // New code:
+ * for (String token : "a:b:c".split(":")) {
+ *     System.err.println(token);
  * }
  * </pre>
- *
  * </blockquote>
- * <p>
- * This prints the following output: <blockquote>
  *
- * <pre>
- *     this
- *     is
- *     a
- *     test
- * </pre>
- *
- * </blockquote>
- * <p>
- * Here's an example of how to use a {@code StringTokenizer} with a user
- * specified delimiter: <blockquote>
- *
- * <pre>
- * StringTokenizer st = new StringTokenizer(
- *         &quot;this is a test with supplementary characters \ud800\ud800\udc00\udc00&quot;,
- *         &quot; \ud800\udc00&quot;);
- * while (st.hasMoreTokens()) {
- *     println(st.nextToken());
- * }
- * </pre>
- *
- * </blockquote>
- * <p>
- * This prints the following output: <blockquote>
- *
- * <pre>
- *     this
- *     is
- *     a
- *     test
- *     with
- *     supplementary
- *     characters
- *     \ud800
- *     \udc00
- * </pre>
- *
- * </blockquote>
+ * @since 1.0
  */
 public class StringTokenizer implements Enumeration<Object> {
 
diff --git a/luni/src/main/java/java/util/TimSort.java b/luni/src/main/java/java/util/TimSort.java
index 009cdc4..ffe4e17 100644
--- a/luni/src/main/java/java/util/TimSort.java
+++ b/luni/src/main/java/java/util/TimSort.java
@@ -270,7 +270,7 @@
              * pivot < all in [left, start), so pivot belongs at left.  Note
              * that if there are elements equal to pivot, left points to the
              * first slot after them -- that's why this sort is stable.
-             * Slide elements over to make room to make room for pivot.
+             * Slide elements over to make room for pivot.
              */
             int n = start - left;  // The number of elements to move
             // Switch is just an optimization for arraycopy in default case
diff --git a/luni/src/main/java/java/util/TimeZone.java b/luni/src/main/java/java/util/TimeZone.java
index 22ab911..a632186 100644
--- a/luni/src/main/java/java/util/TimeZone.java
+++ b/luni/src/main/java/java/util/TimeZone.java
@@ -19,7 +19,7 @@
 
 import java.io.Serializable;
 import libcore.icu.TimeZones;
-import org.apache.harmony.luni.internal.util.ZoneInfoDB;
+import libcore.util.ZoneInfoDB;
 
 /**
  * {@code TimeZone} represents a time zone, primarily used for configuring a {@link Calendar} or
@@ -170,11 +170,14 @@
 
         boolean useDaylight = daylightTime && useDaylightTime();
 
-        String result = TimeZones.getDisplayName(getID(), daylightTime, style, locale);
+        String[][] zoneStrings = TimeZones.getZoneStrings(locale);
+        String result = TimeZones.getDisplayName(zoneStrings, getID(), daylightTime, style);
         if (result != null) {
             return result;
         }
 
+        // TODO: do we ever get here?
+
         int offset = getRawOffset();
         if (useDaylight && this instanceof SimpleTimeZone) {
             offset += getDSTSavings();
diff --git a/luni/src/main/java/java/util/Timer.java b/luni/src/main/java/java/util/Timer.java
index 15b71c0..beeeb1a 100644
--- a/luni/src/main/java/java/util/Timer.java
+++ b/luni/src/main/java/java/util/Timer.java
@@ -175,7 +175,7 @@
         private boolean finished;
 
         /**
-         * Vector consists of scheduled events, sorted according to
+         * Contains scheduled events, sorted according to
          * {@code when} field of TaskScheduled object.
          */
         private TimerHeap tasks = new TimerHeap();
@@ -324,7 +324,6 @@
         private final TimerImpl impl;
 
         FinalizerHelper(TimerImpl impl) {
-            super();
             this.impl = impl;
         }
 
@@ -362,8 +361,7 @@
      * @throws NullPointerException is {@code name} is {@code null}
      */
     public Timer(String name, boolean isDaemon) {
-        super();
-        if (name == null){
+        if (name == null) {
             throw new NullPointerException("name is null");
         }
         this.impl = new TimerImpl(name, isDaemon);
diff --git a/luni/src/main/java/java/util/TimerTask.java b/luni/src/main/java/java/util/TimerTask.java
index b3c0f6a..6b12168 100644
--- a/luni/src/main/java/java/util/TimerTask.java
+++ b/luni/src/main/java/java/util/TimerTask.java
@@ -78,7 +78,6 @@
      * Creates a new {@code TimerTask}.
      */
     protected TimerTask() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/TooManyListenersException.java b/luni/src/main/java/java/util/TooManyListenersException.java
index d05c3ce..f211467 100644
--- a/luni/src/main/java/java/util/TooManyListenersException.java
+++ b/luni/src/main/java/java/util/TooManyListenersException.java
@@ -32,7 +32,6 @@
      * trace filled in.
      */
     public TooManyListenersException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/TreeSet.java b/luni/src/main/java/java/util/TreeSet.java
index e4f2136..63a51c9 100644
--- a/luni/src/main/java/java/util/TreeSet.java
+++ b/luni/src/main/java/java/util/TreeSet.java
@@ -163,7 +163,7 @@
             }
             return clone;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
diff --git a/luni/src/main/java/java/util/UUID.java b/luni/src/main/java/java/util/UUID.java
index 8a39ead..a932bb2 100644
--- a/luni/src/main/java/java/util/UUID.java
+++ b/luni/src/main/java/java/util/UUID.java
@@ -24,7 +24,7 @@
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 /**
  * UUID is an immutable representation of a 128-bit universally unique
@@ -64,7 +64,6 @@
      *            The 64 least significant bits of the UUID.
      */
     public UUID(long mostSigBits, long leastSigBits) {
-        super();
         this.mostSigBits = mostSigBits;
         this.leastSigBits = leastSigBits;
         init();
@@ -154,8 +153,8 @@
     }
 
     private static UUID makeUuid(byte[] hash, int version) {
-        long msb = OSMemory.peekLong(hash, 0, ByteOrder.BIG_ENDIAN);
-        long lsb = OSMemory.peekLong(hash, 8, ByteOrder.BIG_ENDIAN);
+        long msb = Memory.peekLong(hash, 0, ByteOrder.BIG_ENDIAN);
+        long lsb = Memory.peekLong(hash, 8, ByteOrder.BIG_ENDIAN);
         // Set the version field.
         msb &= ~(0xfL << 12);
         msb |= ((long) version) << 12;
diff --git a/luni/src/main/java/java/util/Vector.java b/luni/src/main/java/java/util/Vector.java
index dcd19f2..c236be0 100644
--- a/luni/src/main/java/java/util/Vector.java
+++ b/luni/src/main/java/java/util/Vector.java
@@ -262,7 +262,7 @@
             vector.elementData = elementData.clone();
             return vector;
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
     }
 
@@ -904,7 +904,7 @@
      * TODO: when we have a VM that can actually inline, move the test in here too!
      */
     private static ArrayIndexOutOfBoundsException arrayIndexOutOfBoundsException(int index, int size) {
-        throw new ArrayIndexOutOfBoundsException("index=" + index + ", size=" + size);
+        throw new ArrayIndexOutOfBoundsException(size, index);
     }
 
     /**
diff --git a/luni/src/main/java/java/util/concurrent/ExecutorService.java b/luni/src/main/java/java/util/concurrent/ExecutorService.java
index ddd77bf..89688e4 100644
--- a/luni/src/main/java/java/util/concurrent/ExecutorService.java
+++ b/luni/src/main/java/java/util/concurrent/ExecutorService.java
@@ -119,14 +119,6 @@
      * <p>This method does not wait for previously submitted tasks to
      * complete execution.  Use {@link #awaitTermination awaitTermination}
      * to do that.
-     *
-     * @throws SecurityException if a security manager exists and
-     *         shutting down this ExecutorService may manipulate
-     *         threads that the caller is not permitted to modify
-     *         because it does not hold {@link
-     *         java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
-     *         or the security manager's <tt>checkAccess</tt> method
-     *         denies access.
      */
     void shutdown();
 
@@ -145,13 +137,6 @@
      * task that fails to respond to interrupts may never terminate.
      *
      * @return list of tasks that never commenced execution
-     * @throws SecurityException if a security manager exists and
-     *         shutting down this ExecutorService may manipulate
-     *         threads that the caller is not permitted to modify
-     *         because it does not hold {@link
-     *         java.lang.RuntimePermission}<tt>("modifyThread")</tt>,
-     *         or the security manager's <tt>checkAccess</tt> method
-     *         denies access.
      */
     List<Runnable> shutdownNow();
 
diff --git a/luni/src/main/java/java/util/concurrent/ThreadPoolExecutor.java b/luni/src/main/java/java/util/concurrent/ThreadPoolExecutor.java
index da2c4c5..6622af8 100644
--- a/luni/src/main/java/java/util/concurrent/ThreadPoolExecutor.java
+++ b/luni/src/main/java/java/util/concurrent/ThreadPoolExecutor.java
@@ -75,12 +75,7 @@
  * alter the thread's name, thread group, priority, daemon status,
  * etc. If a {@code ThreadFactory} fails to create a thread when asked
  * by returning null from {@code newThread}, the executor will
- * continue, but might not be able to execute any tasks. Threads
- * should possess the "modifyThread" {@code RuntimePermission}. If
- * worker threads or other threads using the pool do not possess this
- * permission, service may be degraded: configuration changes may not
- * take effect in a timely manner, and a shutdown pool may remain in a
- * state in which termination is possible but not completed.</dd>
+ * continue, but might not be able to execute any tasks.</dd>
  *
  * <dt>Keep-alive times</dt>
  *
diff --git a/luni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java b/luni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
index a13c920..e8a0d57 100644
--- a/luni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
+++ b/luni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java
@@ -252,15 +252,6 @@
                 // END android-changed
                 modifiers = field.getModifiers();
 
-                // BEGIN android-added
-                SecurityManager smgr = System.getSecurityManager();
-                if (smgr != null) {
-                    int type = Modifier.isPublic(modifiers)
-                            ? Member.PUBLIC : Member.DECLARED;
-                    smgr.checkMemberAccess(tclass, type);
-                    smgr.checkPackageAccess(tclass.getPackage().getName());
-                }
-                // END android-added
                 // BEGIN android-removed
                 // modifiers = field.getModifiers();
                 // sun.reflect.misc.ReflectUtil.ensureMemberAccess(
diff --git a/luni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java b/luni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
index 3d6e5d6..21ef748 100644
--- a/luni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
+++ b/luni/src/main/java/java/util/concurrent/atomic/AtomicLongFieldUpdater.java
@@ -248,15 +248,6 @@
                 field = tclass.getDeclaredField(fieldName);
                 caller = VMStack.getStackClass2(); // android-changed
                 modifiers = field.getModifiers();
-                // BEGIN android-added
-                SecurityManager smgr = System.getSecurityManager();
-                if (smgr != null) {
-                    int type = Modifier.isPublic(modifiers)
-                            ? Member.PUBLIC : Member.DECLARED;
-                    smgr.checkMemberAccess(tclass, type);
-                    smgr.checkPackageAccess(tclass.getPackage().getName());
-                }
-                // END android-added
                 // BEGIN android-removed
                 // sun.reflect.misc.ReflectUtil.ensureMemberAccess(
                 //     caller, tclass, null, modifiers);
@@ -342,15 +333,6 @@
                 field = tclass.getDeclaredField(fieldName);
                 caller = VMStack.getStackClass2(); // android-changed
                 modifiers = field.getModifiers();
-                // BEGIN android-added
-                SecurityManager smgr = System.getSecurityManager();
-                if (smgr != null) {
-                    int type = Modifier.isPublic(modifiers)
-                            ? Member.PUBLIC : Member.DECLARED;
-                    smgr.checkMemberAccess(tclass, type);
-                    smgr.checkPackageAccess(tclass.getPackage().getName());
-                }
-                // END android-added
                 // BEGIN android-removed
                 // sun.reflect.misc.ReflectUtil.ensureMemberAccess(
                 //     caller, tclass, null, modifiers);
diff --git a/luni/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java b/luni/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
index e4ae0cf..8b3da0b 100644
--- a/luni/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
+++ b/luni/src/main/java/java/util/concurrent/atomic/AtomicReferenceFieldUpdater.java
@@ -180,15 +180,6 @@
                 field = tclass.getDeclaredField(fieldName);
                 caller = VMStack.getStackClass2(); // android-changed
                 modifiers = field.getModifiers();
-                // BEGIN android-added
-                SecurityManager smgr = System.getSecurityManager();
-                if (smgr != null) {
-                    int type = Modifier.isPublic(modifiers)
-                            ? Member.PUBLIC : Member.DECLARED;
-                    smgr.checkMemberAccess(tclass, type);
-                    smgr.checkPackageAccess(tclass.getPackage().getName());
-                }
-                // END android-added
                 // BEGIN android-removed
                 // sun.reflect.misc.ReflectUtil.ensureMemberAccess(
                 //     caller, tclass, null, modifiers);
diff --git a/luni/src/main/java/java/util/jar/Attributes.java b/luni/src/main/java/java/util/jar/Attributes.java
index 9041c26..48008ce 100644
--- a/luni/src/main/java/java/util/jar/Attributes.java
+++ b/luni/src/main/java/java/util/jar/Attributes.java
@@ -17,12 +17,11 @@
 
 package java.util.jar;
 
-import java.nio.charset.Charsets;
 import java.util.Collection;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
-import org.apache.harmony.archive.util.Util;
 
 /**
  * The {@code Attributes} class is used to store values for manifest entries.
@@ -51,34 +50,21 @@
      * </pre>
      */
     public static class Name {
-        private final byte[] name;
+        private final String name;
 
-        private int hashCode;
-
-        /**
-         * The class path (a main attribute).
-         */
+        /** The class path (a main attribute). */
         public static final Name CLASS_PATH = new Name("Class-Path");
 
-        /**
-         * The version of the manifest file (a main attribute).
-         */
+        /** The version of the manifest file (a main attribute). */
         public static final Name MANIFEST_VERSION = new Name("Manifest-Version");
 
-        /**
-         * The main class's name (for stand-alone applications).
-         */
+        /** The main class's name (for stand-alone applications). */
         public static final Name MAIN_CLASS = new Name("Main-Class");
 
-        /**
-         * Defines the signature version of the JAR file.
-         */
-        public static final Name SIGNATURE_VERSION = new Name(
-                "Signature-Version");
+        /** Defines the signature version of the JAR file. */
+        public static final Name SIGNATURE_VERSION = new Name("Signature-Version");
 
-        /**
-         * The {@code Content-Type} manifest attribute.
-         */
+        /** The {@code Content-Type} manifest attribute. */
         public static final Name CONTENT_TYPE = new Name("Content-Type");
 
         /**
@@ -91,43 +77,37 @@
          * The {@code Implementation-Title} attribute whose value is a string
          * that defines the title of the extension implementation.
          */
-        public static final Name IMPLEMENTATION_TITLE = new Name(
-                "Implementation-Title");
+        public static final Name IMPLEMENTATION_TITLE = new Name("Implementation-Title");
 
         /**
          * The {@code Implementation-Version} attribute defining the version of
          * the extension implementation.
          */
-        public static final Name IMPLEMENTATION_VERSION = new Name(
-                "Implementation-Version");
+        public static final Name IMPLEMENTATION_VERSION = new Name("Implementation-Version");
 
         /**
          * The {@code Implementation-Vendor} attribute defining the organization
          * that maintains the extension implementation.
          */
-        public static final Name IMPLEMENTATION_VENDOR = new Name(
-                "Implementation-Vendor");
+        public static final Name IMPLEMENTATION_VENDOR = new Name("Implementation-Vendor");
 
         /**
          * The {@code Specification-Title} attribute defining the title of the
          * extension specification.
          */
-        public static final Name SPECIFICATION_TITLE = new Name(
-                "Specification-Title");
+        public static final Name SPECIFICATION_TITLE = new Name("Specification-Title");
 
         /**
          * The {@code Specification-Version} attribute defining the version of
          * the extension specification.
          */
-        public static final Name SPECIFICATION_VERSION = new Name(
-                "Specification-Version");
+        public static final Name SPECIFICATION_VERSION = new Name("Specification-Version");
 
         /**
          * The {@code Specification-Vendor} attribute defining the organization
          * that maintains the extension specification.
          */
-        public static final Name SPECIFICATION_VENDOR = new Name(
-                "Specification-Vendor");
+        public static final Name SPECIFICATION_VENDOR = new Name("Specification-Vendor");
 
         /**
          * The {@code Extension-List} attribute defining the extensions that are
@@ -144,119 +124,57 @@
         /**
          * The {@code Extension-Installation} attribute.
          */
-        public static final Name EXTENSION_INSTALLATION = new Name(
-                "Extension-Installation");
+        public static final Name EXTENSION_INSTALLATION = new Name("Extension-Installation");
 
         /**
          * The {@code Implementation-Vendor-Id} attribute specifies the vendor
          * of an extension implementation if the applet requires an
          * implementation from a specific vendor.
          */
-        public static final Name IMPLEMENTATION_VENDOR_ID = new Name(
-                "Implementation-Vendor-Id");
+        public static final Name IMPLEMENTATION_VENDOR_ID = new Name("Implementation-Vendor-Id");
 
         /**
          * The {@code Implementation-URL} attribute specifying a URL that can be
          * used to obtain the most recent version of the extension if the
          * required version is not already installed.
          */
-        public static final Name IMPLEMENTATION_URL = new Name(
-                "Implementation-URL");
+        public static final Name IMPLEMENTATION_URL = new Name("Implementation-URL");
 
         static final Name NAME = new Name("Name");
 
-        /**
-         * A String which must satisfy the following EBNF grammar to specify an
-         * additional attribute:
-         *
-         * <pre>
-         * name       = alphanum *headerchar
-         * headerchar = alphanum | - | _
-         * alphanum   = {A-Z} | {a-z} | {0-9}
-         * </pre>
-         *
-         * @param s
-         *            The Attribute string.
-         * @exception IllegalArgumentException
-         *                if the string does not satisfy the EBNF grammar.
-         */
-        public Name(String s) {
-            int i = s.length();
-            if (i == 0 || i > Manifest.LINE_LENGTH_LIMIT - 2) {
-                throw new IllegalArgumentException();
+        public Name(String name) {
+            // encoded name + "\r\n" must be <= 72 bytes; ASCII-only so byte count equals char count
+            if (name.isEmpty() || name.length() > Manifest.LINE_LENGTH_LIMIT - 2) {
+                throw new IllegalArgumentException(name);
             }
 
-            name = new byte[i];
-
-            for (; --i >= 0;) {
-                char ch = s.charAt(i);
+            for (int i = 0; i < name.length(); i++) {
+                char ch = name.charAt(i);
                 if (!((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')
                         || ch == '_' || ch == '-' || (ch >= '0' && ch <= '9'))) {
-                    throw new IllegalArgumentException(s);
+                    throw new IllegalArgumentException(name);
                 }
-                name[i] = (byte) ch;
             }
+
+            this.name = name;
         }
 
-        /**
-         * A private constructor for a trusted attribute name.
-         */
-        Name(byte[] buf) {
-            name = buf;
-        }
-
-        byte[] getBytes() {
+        String getName() {
             return name;
         }
 
-        /**
-         * Returns this attribute name.
-         *
-         * @return the attribute name.
-         */
-        @Override
-        public String toString() {
-            return new String(name, Charsets.ISO_8859_1);
+        @Override public boolean equals(Object object) {
+            return object instanceof Name
+                    && ((Name) object).name.equalsIgnoreCase(name);
         }
 
-        /**
-         * Returns whether the argument provided is the same as the attribute
-         * name.
-         *
-         * @return if the attribute names correspond.
-         * @param object
-         *            An attribute name to be compared with this name.
-         */
-        @Override
-        public boolean equals(Object object) {
-            if (object == null || object.getClass() != getClass()
-                    || object.hashCode() != hashCode()) {
-                return false;
-            }
-
-            return Util.asciiEqualsIgnoreCase(name, ((Name) object).name);
+        @Override public int hashCode() {
+            return name.toLowerCase(Locale.US).hashCode();
         }
 
-        /**
-         * Computes a hash code of the name.
-         *
-         * @return the hash value computed from the name.
-         */
-        @Override
-        public int hashCode() {
-            if (hashCode == 0) {
-                int hash = 0, multiplier = 1;
-                for (int i = name.length - 1; i >= 0; i--) {
-                    // 'A' & 0xDF == 'a' & 0xDF, ..., 'Z' & 0xDF == 'z' & 0xDF
-                    hash += (name[i] & 0xDF) * multiplier;
-                    int shifted = multiplier << 5;
-                    multiplier = shifted - multiplier;
-                }
-                hashCode = hash;
-            }
-            return hashCode;
+        @Override public String toString() {
+            return name;
         }
-
     }
 
     /**
@@ -432,7 +350,7 @@
         try {
             clone = (Attributes) super.clone();
         } catch (CloneNotSupportedException e) {
-            throw new AssertionError(e); // android-changed
+            throw new AssertionError(e);
         }
         clone.map = (Map<Object, Object>) ((HashMap) map).clone();
         return clone;
diff --git a/luni/src/main/java/java/util/jar/InitManifest.java b/luni/src/main/java/java/util/jar/InitManifest.java
index 763d8d2..c82a1e44 100644
--- a/luni/src/main/java/java/util/jar/InitManifest.java
+++ b/luni/src/main/java/java/util/jar/InitManifest.java
@@ -19,7 +19,6 @@
 
 import java.io.IOException;
 import java.nio.charset.Charsets;
-import java.util.Arrays;
 import java.util.Map;
 
 /**
@@ -111,32 +110,26 @@
     }
 
     private void readName() throws IOException {
-        int i = 0;
         int mark = pos;
 
         while (pos < buf.length) {
-            byte b = buf[pos++];
-
-            if (b == ':') {
-                byte[] nameBuffer = Arrays.copyOfRange(buf, mark, pos - 1);
-
-                if (buf[pos++] != ' ') {
-                    String name = new String(nameBuffer, Charsets.UTF_8);
-                    throw new IOException(String.format("Invalid value for attribute '%s'", name));
-                }
-
-                name = new Attributes.Name(nameBuffer);
-                return;
+            if (buf[pos++] != ':') {
+                continue;
             }
 
-            if (!((b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') || b == '_'
-                    || b == '-' || (b >= '0' && b <= '9'))) {
-                throw new IOException("Invalid byte " + b + " in attribute");
+            String name = new String(buf, mark, pos - mark - 1, Charsets.US_ASCII);
+
+            if (buf[pos++] != ' ') {
+                throw new IOException(String.format("Invalid value for attribute '%s'", name));
             }
-        }
-        if (i > 0) {
-            throw new IOException("Invalid attribute name: " +
-                    Arrays.toString(Arrays.copyOfRange(buf, mark, buf.length)));
+
+            try {
+                this.name = new Attributes.Name(name);
+            } catch (IllegalArgumentException e) {
+                // new Attributes.Name() throws IllegalArgumentException but we declare IOException
+                throw new IOException(e.getMessage());
+            }
+            return;
         }
     }
 
diff --git a/luni/src/main/java/java/util/jar/JarException.java b/luni/src/main/java/java/util/jar/JarException.java
index 92f61f3..384fdd8 100644
--- a/luni/src/main/java/java/util/jar/JarException.java
+++ b/luni/src/main/java/java/util/jar/JarException.java
@@ -31,7 +31,6 @@
      * Constructs a new {@code JarException} instance.
      */
     public JarException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/jar/JarFile.java b/luni/src/main/java/java/util/jar/JarFile.java
index 6ec24c6..a26a602 100644
--- a/luni/src/main/java/java/util/jar/JarFile.java
+++ b/luni/src/main/java/java/util/jar/JarFile.java
@@ -27,7 +27,6 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 import libcore.io.Streams;
-import org.apache.harmony.archive.util.Util;
 
 /**
  * {@code JarFile} is used to read jar entries and their associated data from
@@ -331,7 +330,7 @@
         for (ZipEntry entry : metaEntries) {
             String entryName = entry.getName();
             // Is this the entry for META-INF/MANIFEST.MF ?
-            if (manifestEntry == null && Util.asciiEqualsIgnoreCase(MANIFEST_NAME, entryName)) {
+            if (manifestEntry == null && entryName.equalsIgnoreCase(MANIFEST_NAME)) {
                 manifestEntry = entry;
                 // If there is no verifier then we don't need to look any further.
                 if (verifier == null) {
@@ -340,9 +339,9 @@
             } else {
                 // Is this an entry that the verifier needs?
                 if (verifier != null
-                        && (Util.asciiEndsWithIgnoreCase(entryName, ".SF")
-                                || Util.asciiEndsWithIgnoreCase(entryName, ".DSA")
-                                || Util.asciiEndsWithIgnoreCase(entryName, ".RSA"))) {
+                        && (endsWithIgnoreCase(entryName, ".SF")
+                                || endsWithIgnoreCase(entryName, ".DSA")
+                                || endsWithIgnoreCase(entryName, ".RSA"))) {
                     signed = true;
                     InputStream is = super.getInputStream(entry);
                     try {
@@ -360,6 +359,10 @@
         }
     }
 
+    private static boolean endsWithIgnoreCase(String s, String suffix) {
+        return s.regionMatches(true, s.length() - suffix.length(), suffix, 0, suffix.length());
+    }
+
     /**
      * Return an {@code InputStream} for reading the decompressed contents of
      * ZIP entry.
diff --git a/luni/src/main/java/java/util/jar/JarInputStream.java b/luni/src/main/java/java/util/jar/JarInputStream.java
index 76180d2..03f765f 100644
--- a/luni/src/main/java/java/util/jar/JarInputStream.java
+++ b/luni/src/main/java/java/util/jar/JarInputStream.java
@@ -21,9 +21,9 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.Locale;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
-import org.apache.harmony.luni.util.Util;
 
 /**
  * The input stream from which the JAR file to be read may be fetched. It is
@@ -58,8 +58,7 @@
      *             If an error occurs reading entries from the input stream.
      * @see ZipInputStream#ZipInputStream(InputStream)
      */
-    public JarInputStream(InputStream stream, boolean verify)
-            throws IOException {
+    public JarInputStream(InputStream stream, boolean verify) throws IOException {
         super(stream);
         if (verify) {
             verifier = new JarVerifier("JarInputStream");
@@ -67,22 +66,19 @@
         if ((mEntry = getNextJarEntry()) == null) {
             return;
         }
-        String name = Util.toASCIIUpperCase(mEntry.getName());
-        if (name.equals(JarFile.META_DIR)) {
+        if (mEntry.getName().equalsIgnoreCase(JarFile.META_DIR)) {
             mEntry = null; // modifies behavior of getNextJarEntry()
             closeEntry();
             mEntry = getNextJarEntry();
-            name = mEntry.getName().toUpperCase();
         }
-        if (name.equals(JarFile.MANIFEST_NAME)) {
+        if (mEntry.getName().equalsIgnoreCase(JarFile.MANIFEST_NAME)) {
             mEntry = null;
             manifest = new Manifest(this, verify);
             closeEntry();
             if (verify) {
                 verifier.setManifest(manifest);
                 if (manifest != null) {
-                    verifier.mainAttributesEnd = manifest
-                            .getMainAttributesEnd();
+                    verifier.mainAttributesEnd = manifest.getMainAttributesEnd();
                 }
             }
 
@@ -198,8 +194,7 @@
                 return null;
             }
             if (verifier != null) {
-                isMeta = Util.toASCIIUpperCase(jarEntry.getName()).startsWith(
-                        JarFile.META_DIR);
+                isMeta = jarEntry.getName().toUpperCase(Locale.US).startsWith(JarFile.META_DIR);
                 if (isMeta) {
                     verStream = new ByteArrayOutputStream();
                 } else {
diff --git a/luni/src/main/java/java/util/jar/JarVerifier.java b/luni/src/main/java/java/util/jar/JarVerifier.java
index cacafa0..81bbe77 100644
--- a/luni/src/main/java/java/util/jar/JarVerifier.java
+++ b/luni/src/main/java/java/util/jar/JarVerifier.java
@@ -25,14 +25,15 @@
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.cert.Certificate;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Iterator;
+import java.util.Locale;
 import java.util.Map;
 import java.util.StringTokenizer;
 import java.util.Vector;
 import org.apache.harmony.luni.util.Base64;
-import org.apache.harmony.luni.util.Util;
 import org.apache.harmony.security.utils.JarUtils;
 
 /**
@@ -171,31 +172,23 @@
             return null;
         }
 
-        Vector<Certificate> certs = new Vector<Certificate>();
-        Iterator<Map.Entry<String, HashMap<String, Attributes>>> it = signatures
-                .entrySet().iterator();
+        ArrayList<Certificate> certs = new ArrayList<Certificate>();
+        Iterator<Map.Entry<String, HashMap<String, Attributes>>> it = signatures.entrySet().iterator();
         while (it.hasNext()) {
             Map.Entry<String, HashMap<String, Attributes>> entry = it.next();
             HashMap<String, Attributes> hm = entry.getValue();
             if (hm.get(name) != null) {
                 // Found an entry for entry name in .SF file
                 String signatureFile = entry.getKey();
-
-                Vector<Certificate> newCerts = getSignerCertificates(
-                        signatureFile, certificates);
-                Iterator<Certificate> iter = newCerts.iterator();
-                while (iter.hasNext()) {
-                    certs.add(iter.next());
-                }
+                certs.addAll(getSignerCertificates(signatureFile, certificates));
             }
         }
 
         // entry is not signed
-        if (certs.size() == 0) {
+        if (certs.isEmpty()) {
             return null;
         }
-        Certificate[] certificatesArray = new Certificate[certs.size()];
-        certs.toArray(certificatesArray);
+        Certificate[] certificatesArray = certs.toArray(new Certificate[certs.size()]);
 
         String algorithms = attributes.getValue("Digest-Algorithms");
         if (algorithms == null) {
@@ -234,7 +227,7 @@
      * @see #removeMetaEntries()
      */
     void addMetaEntry(String name, byte[] buf) {
-        metaEntries.put(Util.toASCIIUpperCase(name), buf);
+        metaEntries.put(name.toUpperCase(Locale.US), buf);
     }
 
     /**
diff --git a/luni/src/main/java/java/util/jar/Manifest.java b/luni/src/main/java/java/util/jar/Manifest.java
index 9145688..c1c96a1 100644
--- a/luni/src/main/java/java/util/jar/Manifest.java
+++ b/luni/src/main/java/java/util/jar/Manifest.java
@@ -84,7 +84,6 @@
      * Creates a new {@code Manifest} instance.
      */
     public Manifest() {
-        super();
     }
 
     /**
@@ -97,7 +96,6 @@
      *             if an IO error occurs while creating this {@code Manifest}
      */
     public Manifest(InputStream is) throws IOException {
-        super();
         read(is);
     }
 
@@ -337,25 +335,18 @@
     }
 
     private static void writeEntry(OutputStream os, Attributes.Name name,
-            String value, CharsetEncoder encoder, ByteBuffer bBuf)
-            throws IOException {
-        byte[] out = name.getBytes();
-        if (out.length > LINE_LENGTH_LIMIT) {
-            throw new IOException("Encoded header name " + name + " exceeded maximum length " +
-                    LINE_LENGTH_LIMIT);
-        }
-
-        os.write(out);
+            String value, CharsetEncoder encoder, ByteBuffer bBuf) throws IOException {
+        String nameString = name.getName();
+        os.write(nameString.getBytes(Charsets.US_ASCII));
         os.write(VALUE_SEPARATOR);
 
         encoder.reset();
-        bBuf.clear().limit(LINE_LENGTH_LIMIT - out.length - 2);
+        bBuf.clear().limit(LINE_LENGTH_LIMIT - nameString.length() - 2);
 
         CharBuffer cBuf = CharBuffer.wrap(value);
-        CoderResult r;
 
         while (true) {
-            r = encoder.encode(cBuf, bBuf, true);
+            CoderResult r = encoder.encode(cBuf, bBuf, true);
             if (CoderResult.UNDERFLOW == r) {
                 r = encoder.flush(bBuf);
             }
diff --git a/luni/src/main/java/java/util/jar/Pack200.java b/luni/src/main/java/java/util/jar/Pack200.java
index 881f53c..0acf241 100644
--- a/luni/src/main/java/java/util/jar/Pack200.java
+++ b/luni/src/main/java/java/util/jar/Pack200.java
@@ -21,8 +21,6 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.SortedMap;
 
 /**
@@ -52,23 +50,14 @@
      * @return an instance of {@code Packer}
      */
     public static Pack200.Packer newPacker() {
-        return (Packer) AccessController
-                .doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        String className = System
-                                .getProperty(SYSTEM_PROPERTY_PACKER,
-                                        "org.apache.harmony.pack200.Pack200PackerAdapter");
-                        try {
-                            // TODO Not sure if this will cause problems with
-                            // loading the packer
-                            return ClassLoader.getSystemClassLoader()
-                                    .loadClass(className).newInstance();
-                        } catch (Exception e) {
-                            throw new Error("Can't load class " + className, e);
-                        }
-                    }
-                });
-
+        String className = System.getProperty(SYSTEM_PROPERTY_PACKER, "org.apache.harmony.pack200.Pack200PackerAdapter");
+        try {
+            // TODO Not sure if this will cause problems with
+            // loading the packer
+            return (Packer) ClassLoader.getSystemClassLoader().loadClass(className).newInstance();
+        } catch (Exception e) {
+            throw new Error("Can't load class " + className, e);
+        }
     }
 
     /**
@@ -82,20 +71,12 @@
      * @return a instance of {@code Unpacker}.
      */
     public static Pack200.Unpacker newUnpacker() {
-        return (Unpacker) AccessController
-                .doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        String className = System
-                                .getProperty(SYSTEM_PROPERTY_UNPACKER,
-                                        "org.apache.harmony.unpack200.Pack200UnpackerAdapter");
-                        try {
-                            return ClassLoader.getSystemClassLoader()
-                                    .loadClass(className).newInstance();
-                        } catch (Exception e) {
-                            throw new Error("Can't load class " + className, e);
-                        }
-                    }
-                });
+        String className = System.getProperty(SYSTEM_PROPERTY_UNPACKER, "org.apache.harmony.unpack200.Pack200UnpackerAdapter");
+        try {
+            return (Unpacker) ClassLoader.getSystemClassLoader().loadClass(className).newInstance();
+        } catch (Exception e) {
+            throw new Error("Can't load class " + className, e);
+        }
     }
 
     /**
diff --git a/luni/src/main/java/java/util/logging/ErrorManager.java b/luni/src/main/java/java/util/logging/ErrorManager.java
index d0516ea..877be0b 100644
--- a/luni/src/main/java/java/util/logging/ErrorManager.java
+++ b/luni/src/main/java/java/util/logging/ErrorManager.java
@@ -56,7 +56,6 @@
      */
     public static final int FORMAT_FAILURE = 5;
 
-    @SuppressWarnings("nls")
     private static final String[] FAILURES = new String[] { "GENERIC_FAILURE",
             "WRITE_FAILURE", "FLUSH_FAILURE", "CLOSE_FAILURE", "OPEN_FAILURE",
             "FORMAT_FAILURE" };
@@ -71,7 +70,6 @@
      * Constructs an instance of {@code ErrorManager}.
      */
     public ErrorManager() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/logging/FileHandler.java b/luni/src/main/java/java/util/logging/FileHandler.java
index 0735911..980955a 100644
--- a/luni/src/main/java/java/util/logging/FileHandler.java
+++ b/luni/src/main/java/java/util/logging/FileHandler.java
@@ -25,8 +25,6 @@
 import java.io.OutputStream;
 import java.nio.channels.FileChannel;
 import java.nio.channels.FileLock;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Hashtable;
 import libcore.io.IoUtils;
 
@@ -146,12 +144,6 @@
      *
      * @throws IOException
      *             if any I/O error occurs.
-     * @throws SecurityException
-     *             if a security manager exists and it determines that the
-     *             caller does not have the required permissions to control this
-     *             handler; required permissions include
-     *             {@code LogPermission("control")},
-     *             {@code FilePermission("write")} etc.
      */
     public FileHandler() throws IOException {
         init(null, null, null, null);
@@ -216,7 +208,6 @@
         setOutputStream(output);
     }
 
-    @SuppressWarnings("nls")
     private void initProperties(String p, Boolean a, Integer l, Integer c) {
         super.initProperties("ALL", null, "java.util.logging.XMLFormatter",
                 null);
@@ -381,12 +372,6 @@
      *            the name pattern for the output file.
      * @throws IOException
      *             if any I/O error occurs.
-     * @throws SecurityException
-     *             if a security manager exists and it determines that the
-     *             caller does not have the required permissions to control this
-     *             handler; required permissions include
-     *             {@code LogPermission("control")},
-     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
      *             if the pattern is empty.
      * @throws NullPointerException
@@ -413,12 +398,6 @@
      *            the append mode.
      * @throws IOException
      *             if any I/O error occurs.
-     * @throws SecurityException
-     *             if a security manager exists and it determines that the
-     *             caller does not have the required permissions to control this
-     *             handler; required permissions include
-     *             {@code LogPermission("control")},
-     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
      *             if {@code pattern} is empty.
      * @throws NullPointerException
@@ -449,12 +428,6 @@
      *            the maximum number of files to use, can not be less than one.
      * @throws IOException
      *             if any I/O error occurs.
-     * @throws SecurityException
-     *             if a security manager exists and it determines that the
-     *             caller does not have the required permissions to control this
-     *             handler; required permissions include
-     *             {@code LogPermission("control")},
-     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
      *             if {@code pattern} is empty, {@code limit < 0} or
      *             {@code count < 1}.
@@ -491,12 +464,6 @@
      *            the append mode.
      * @throws IOException
      *             if any I/O error occurs.
-     * @throws SecurityException
-     *             if a security manager exists and it determines that the
-     *             caller does not have the required permissions to control this
-     *             handler; required permissions include
-     *             {@code LogPermission("control")},
-     *             {@code FilePermission("write")} etc.
      * @throws IllegalArgumentException
      *             if {@code pattern} is empty, {@code limit < 0} or
      *             {@code count < 1}.
@@ -515,13 +482,6 @@
 
     /**
      * Flushes and closes all opened files.
-     *
-     * @throws SecurityException
-     *             if a security manager exists and it determines that the
-     *             caller does not have the required permissions to control this
-     *             handler; required permissions include
-     *             {@code LogPermission("control")},
-     *             {@code FilePermission("write")} etc.
      */
     @Override
     public void close() {
@@ -550,12 +510,7 @@
         super.publish(record);
         flush();
         if (limit > 0 && output.getLength() >= limit) {
-            AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                public Object run() {
-                    findNextGeneration();
-                    return null;
-                }
-            });
+            findNextGeneration();
         }
     }
 
@@ -586,12 +541,6 @@
         }
 
         @Override
-        public void write(byte[] bytes) throws IOException {
-            wrapped.write(bytes);
-            length += bytes.length;
-        }
-
-        @Override
         public void write(byte[] b, int off, int len) throws IOException {
             wrapped.write(b, off, len);
             length += len;
diff --git a/luni/src/main/java/java/util/logging/Formatter.java b/luni/src/main/java/java/util/logging/Formatter.java
index 5e8d98e..b18c2e9 100644
--- a/luni/src/main/java/java/util/logging/Formatter.java
+++ b/luni/src/main/java/java/util/logging/Formatter.java
@@ -32,7 +32,6 @@
      * Constructs a {@code Formatter} object.
      */
     protected Formatter() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/logging/Handler.java b/luni/src/main/java/java/util/logging/Handler.java
index 21e77d7..5a6c14e 100644
--- a/luni/src/main/java/java/util/logging/Handler.java
+++ b/luni/src/main/java/java/util/logging/Handler.java
@@ -19,8 +19,6 @@
 
 import java.io.UnsupportedEncodingException;
 import java.nio.charset.Charset;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
 
 /**
  * A {@code Handler} object accepts a logging request and exports the desired
@@ -78,18 +76,12 @@
     }
 
     // get a instance from given class name, using context classloader
-    private Object getCustomizeInstance(final String className)
-            throws Exception {
-        Class<?> c = AccessController
-                .doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
-                    public Class<?> run() throws Exception {
-                        ClassLoader loader = Thread.currentThread().getContextClassLoader();
-                        if (loader == null) {
-                            loader = ClassLoader.getSystemClassLoader();
-                        }
-                        return loader.loadClass(className);
-                    }
-                });
+    private Object getCustomizeInstance(final String className) throws Exception {
+        ClassLoader loader = Thread.currentThread().getContextClassLoader();
+        if (loader == null) {
+            loader = ClassLoader.getSystemClassLoader();
+        }
+        Class<?> c = loader.loadClass(className);
         return c.newInstance();
     }
 
@@ -159,10 +151,6 @@
      * Closes this handler. A flush operation will be performed and all the
      * associated resources will be freed. Client applications should not use
      * this handler after closing it.
-     *
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public abstract void close();
 
@@ -194,9 +182,6 @@
      * logging.
      *
      * @return the error manager used by this handler.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public ErrorManager getErrorManager() {
         LogManager.getLogManager().checkAccess();
@@ -298,14 +283,10 @@
      *
      * @param encoding
      *            the character encoding to set.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      * @throws UnsupportedEncodingException
      *             if the specified encoding is not supported by the runtime.
      */
-    public void setEncoding(String encoding) throws SecurityException,
-            UnsupportedEncodingException {
+    public void setEncoding(String encoding) throws UnsupportedEncodingException {
         LogManager.getLogManager().checkAccess();
         internalSetEncoding(encoding);
     }
@@ -317,9 +298,6 @@
      *            the error manager to set.
      * @throws NullPointerException
      *             if {@code em} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setErrorManager(ErrorManager em) {
         LogManager.getLogManager().checkAccess();
@@ -334,9 +312,6 @@
      *
      * @param newFilter
      *            the filter to set, may be {@code null}.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setFilter(Filter newFilter) {
         LogManager.getLogManager().checkAccess();
@@ -364,9 +339,6 @@
      *            the formatter to set.
      * @throws NullPointerException
      *             if {@code newFormatter} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setFormatter(Formatter newFormatter) {
         LogManager.getLogManager().checkAccess();
@@ -381,9 +353,6 @@
      *            the logging level to set.
      * @throws NullPointerException
      *             if {@code newLevel} is {@code null}.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setLevel(Level newLevel) {
         if (newLevel == null) {
diff --git a/luni/src/main/java/java/util/logging/Level.java b/luni/src/main/java/java/util/logging/Level.java
index 3671fb2..d4cc82f 100644
--- a/luni/src/main/java/java/util/logging/Level.java
+++ b/luni/src/main/java/java/util/logging/Level.java
@@ -209,9 +209,7 @@
         if (resourceBundleName != null) {
             try {
                 rb = ResourceBundle.getBundle(resourceBundleName,
-                        // BEGIN android-changed
                         Locale.getDefault(), VMStack.getCallingClassLoader());
-                        // BEGIN android-changed
             } catch (MissingResourceException e) {
                 rb = null;
             }
diff --git a/luni/src/main/java/java/util/logging/LogManager.java b/luni/src/main/java/java/util/logging/LogManager.java
index fac3602..449c263 100644
--- a/luni/src/main/java/java/util/logging/LogManager.java
+++ b/luni/src/main/java/java/util/logging/LogManager.java
@@ -17,12 +17,6 @@
 
 package java.util.logging;
 
-// BEGIN android-note
-// this file contains cleaned up documentation and style for contribution
-// upstream.
-// javax.management support (MBeans) has been dropped.
-// END android-note
-
 import java.beans.PropertyChangeListener;
 import java.beans.PropertyChangeSupport;
 import java.io.BufferedInputStream;
@@ -30,8 +24,6 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Collection;
 import java.util.Enumeration;
 import java.util.Hashtable;
@@ -124,9 +116,6 @@
  */
 public class LogManager {
 
-    /** The line separator of the underlying OS. */
-    private static final String lineSeparator = getPrivilegedSystemProperty("line.separator");
-
     /** The shared logging permission. */
     private static final LoggingPermission perm = new LoggingPermission("control", null);
 
@@ -159,34 +148,28 @@
 
     static {
         // init LogManager singleton instance
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-            public Object run() {
-                String className = System.getProperty("java.util.logging.manager");
+        String className = System.getProperty("java.util.logging.manager");
+        if (className != null) {
+            manager = (LogManager) getInstanceByClass(className);
+        }
+        if (manager == null) {
+            manager = new LogManager();
+        }
 
-                if (className != null) {
-                    manager = (LogManager) getInstanceByClass(className);
-                }
-                if (manager == null) {
-                    manager = new LogManager();
-                }
+        // read configuration
+        try {
+            manager.readConfiguration();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
 
-                // read configuration
-                try {
-                    manager.readConfiguration();
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
+        // if global logger has been initialized, set root as its parent
+        Logger root = new Logger("", null);
+        root.setLevel(Level.INFO);
+        Logger.global.setParent(root);
 
-                // if global logger has been initialized, set root as its parent
-                Logger root = new Logger("", null);
-                root.setLevel(Level.INFO);
-                Logger.global.setParent(root);
-
-                manager.addLogger(root);
-                manager.addLogger(Logger.global);
-                return null;
-            }
-        });
+        manager.addLogger(root);
+        manager.addLogger(Logger.global);
     }
 
     /**
@@ -201,42 +184,17 @@
         listeners = new PropertyChangeSupport(this);
         // add shutdown hook to ensure that the associated resource will be
         // freed when JVM exits
-        AccessController.doPrivileged(new PrivilegedAction<Void>() {
-            public Void run() {
-                Runtime.getRuntime().addShutdownHook(new Thread() {
-                    @Override
-                    public void run() {
-                        reset();
-                    }
-                });
-                return null;
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            @Override public void run() {
+                reset();
             }
         });
     }
 
-    /*
-     * Package private utilities Returns the line separator of the underlying
-     * OS.
-     */
-    static String getSystemLineSeparator() {
-        return lineSeparator;
-    }
-
     /**
-     * Check that the caller has {@code LoggingPermission("control")} so
-     * that it is trusted to modify the configuration for logging framework. If
-     * the check passes, just return, otherwise {@code SecurityException}
-     * will be thrown.
-     *
-     * @throws SecurityException
-     *             if there is a security manager in operation and the invoker
-     *             of this method does not have the required security permission
-     *             {@code LoggingPermission("control")}
+     * Does nothing.
      */
     public void checkAccess() {
-        if (System.getSecurityManager() != null) {
-            System.getSecurityManager().checkPermission(perm);
-        }
     }
 
     /**
@@ -295,16 +253,9 @@
         Collection<Logger> allLoggers = loggers.values();
         for (final Logger child : allLoggers) {
             Logger oldParent = child.getParent();
-            if (parent == oldParent
-                    && (name.length() == 0 || child.getName().startsWith(
-                            nameDot))) {
+            if (parent == oldParent && (name.length() == 0 || child.getName().startsWith(nameDot))) {
                 final Logger thisLogger = logger;
-                AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        child.setParent(thisLogger);
-                        return null;
-                    }
-                });
+                child.setParent(thisLogger);
                 if (oldParent != null) {
                     // -- remove from old parent as the parent has been changed
                     oldParent.children.remove(child);
@@ -362,9 +313,6 @@
      *
      * @throws IOException
      *             if any IO related problems happened.
-     * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to perform this action.
      */
     public void readConfiguration() throws IOException {
         // check config class
@@ -397,15 +345,6 @@
         }
     }
 
-    // use privilege code to get system property
-    static String getPrivilegedSystemProperty(final String key) {
-        return AccessController.doPrivileged(new PrivilegedAction<String>() {
-            public String run() {
-                return System.getProperty(key);
-            }
-        });
-    }
-
     // use SystemClassLoader to load class from system classpath
     static Object getInstanceByClass(final String className) {
         try {
@@ -421,7 +360,6 @@
                 return null;
             }
         }
-
     }
 
     // actual initialization process from a given input stream
@@ -469,9 +407,6 @@
      *            the input stream
      * @throws IOException
      *             if any IO related problems happened.
-     * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to perform this action.
      */
     public void readConfiguration(InputStream ins) throws IOException {
         checkAccess();
@@ -480,15 +415,10 @@
 
     /**
      * Reset configuration.
-     * <p>
-     * All handlers are closed and removed from any named loggers. All loggers'
+     *
+     * <p>All handlers are closed and removed from any named loggers. All loggers'
      * level is set to null, except the root logger's level is set to
      * {@code Level.INFO}.
-     * </p>
-     *
-     * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to perform this action.
      */
     public synchronized void reset() {
         checkAccess();
@@ -513,9 +443,6 @@
      *
      * @param l
      *            the {@code PropertyChangeListener} to be added.
-     * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to perform this action.
      */
     public void addPropertyChangeListener(PropertyChangeListener l) {
         if (l == null) {
@@ -531,9 +458,6 @@
      *
      * @param l
      *            the {@code PropertyChangeListener} to be removed.
-     * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to perform this action.
      */
     public void removePropertyChangeListener(PropertyChangeListener l) {
         checkAccess();
@@ -570,7 +494,7 @@
             setLevelRecursively(logger, null);
         }
         newParent.children.add(logger);
-        logger.updateDalvikLogHandler(); // android-only
+        logger.updateDalvikLogHandler();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/logging/LogRecord.java b/luni/src/main/java/java/util/logging/LogRecord.java
index fd34eb4..9944f20 100644
--- a/luni/src/main/java/java/util/logging/LogRecord.java
+++ b/luni/src/main/java/java/util/logging/LogRecord.java
@@ -135,13 +135,13 @@
     private transient Object[] parameters;
 
     // If the source method and source class has been initialized
-    private transient boolean sourceInited;
+    private transient boolean sourceInitialized;
 
     /**
      * Constructs a {@code LogRecord} object using the supplied the logging
      * level and message. The millis property is set to the current time. The
      * sequence property is set to a new unique value, allocated in increasing
-     * order within the virtual machine. The thread ID is set to a unique value
+     * order within the VM. The thread ID is set to a unique value
      * for the current thread. All other properties are set to {@code null}.
      *
      * @param level
@@ -360,8 +360,7 @@
      *  Init the sourceClass and sourceMethod fields.
      */
     private void initSource() {
-        // BEGIN android-changed
-        if (sourceInited) {
+        if (sourceInitialized) {
             return;
         }
 
@@ -377,8 +376,7 @@
             }
         }
 
-        sourceInited = true;
-        // END android-changed
+        sourceInitialized = true;
     }
 
     /**
@@ -389,7 +387,7 @@
      *            {@code null}.
      */
     public void setSourceClassName(String sourceClassName) {
-        sourceInited = true;
+        sourceInitialized = true;
         this.sourceClassName = sourceClassName;
     }
 
@@ -411,7 +409,7 @@
      *            {@code null}.
      */
     public void setSourceMethodName(String sourceMethodName) {
-        sourceInited = true;
+        sourceInitialized = true;
         this.sourceMethodName = sourceMethodName;
     }
 
diff --git a/luni/src/main/java/java/util/logging/Logger.java b/luni/src/main/java/java/util/logging/Logger.java
index 6c7dabb..1ea42e1 100644
--- a/luni/src/main/java/java/util/logging/Logger.java
+++ b/luni/src/main/java/java/util/logging/Logger.java
@@ -17,17 +17,8 @@
 
 package java.util.logging;
 
-// BEGIN android-note
-// this file contains cleaned up documentation and style for contribution
-// upstream
-// It also contains Android-specific optimizations that aren't appropriate for
-// general purpose platforms
-// END android-note
-
 import dalvik.system.DalvikLogHandler;
 import dalvik.system.DalvikLogging;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -81,7 +72,6 @@
  */
 public class Logger {
 
-    // BEGIN android-only
     /** A handler for use when no handler optimization is possible. */
     private static final DalvikLogHandler GENERAL_LOG_HANDLER = new DalvikLogHandler() {
         public void publish(Logger source, String tag, Level level, String message) {
@@ -91,7 +81,6 @@
             source.log(record);
         }
     };
-    // END android-only
 
     /**
      * The name of the global logger. Before using this, see the discussion of how to use
@@ -107,7 +96,7 @@
      * documentation.
      */
     @Deprecated
-    public final static Logger global = new Logger(GLOBAL_LOGGER_NAME, null);
+    public static final Logger global = new Logger(GLOBAL_LOGGER_NAME, null);
 
     /**
      * When converting the concurrent collection of handlers to an array, we
@@ -170,7 +159,6 @@
      */
     final List<Logger> children = new ArrayList<Logger>();
 
-    // BEGIN android-only
     /** the tag used for optimized logging. Derived from the logger name. */
     private final String androidTag;
 
@@ -245,7 +233,6 @@
             logger.updateDalvikLogHandler();
         }
     }
-    // END android-only
 
     /**
      * Constructs a {@code Logger} object with the supplied name and resource
@@ -265,10 +252,8 @@
     protected Logger(String name, String resourceBundleName) {
         this.name = name;
         initResourceBundle(resourceBundleName);
-        // BEGIN android-only
         this.androidTag = DalvikLogging.loggerNameToTag(name);
         updateDalvikLogHandler();
-        // END android-only
     }
 
     /**
@@ -282,12 +267,7 @@
      */
     static ResourceBundle loadResourceBundle(String resourceBundleName) {
         // try context class loader to load the resource
-        ClassLoader cl = AccessController
-                .doPrivileged(new PrivilegedAction<ClassLoader>() {
-                    public ClassLoader run() {
-                        return Thread.currentThread().getContextClassLoader();
-                    }
-                });
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
         if (cl != null) {
             try {
                 return ResourceBundle.getBundle(resourceBundleName, Locale
@@ -297,42 +277,25 @@
             }
         }
         // try system class loader to load the resource
-        cl = AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
-            public ClassLoader run() {
-                return ClassLoader.getSystemClassLoader();
-            }
-        });
+        cl = ClassLoader.getSystemClassLoader();
         if (cl != null) {
             try {
-                return ResourceBundle.getBundle(resourceBundleName, Locale
-                        .getDefault(), cl);
+                return ResourceBundle.getBundle(resourceBundleName, Locale.getDefault(), cl);
             } catch (MissingResourceException e) {
                 // Failed to load using system classloader, ignore
             }
         }
         // try all class loaders up the class stack
-        final Class<?>[] classes = AccessController
-                .doPrivileged(new PrivilegedAction<Class<?>[]>() {
-                    public Class<?>[] run() {
-                        return (new PrivateSecurityManager())
-                                .privateGetClassContext();
-                    }
-                });
+        final Class<?>[] classes = new PrivateSecurityManager().privateGetClassContext();
         // the first class, which is PrivateSecurityManager, is skipped
         for (int i = 1; i < classes.length; i++) {
             final int index = i;
             try {
-                cl = AccessController
-                        .doPrivileged(new PrivilegedAction<ClassLoader>() {
-                            public ClassLoader run() {
-                                return classes[index].getClassLoader();
-                            }
-                        });
+                cl = classes[index].getClassLoader();
                 if (cl == null) {
                     continue;
                 }
-                return ResourceBundle.getBundle(resourceBundleName, Locale
-                        .getDefault(), cl);
+                return ResourceBundle.getBundle(resourceBundleName, Locale.getDefault(), cl);
             } catch (MissingResourceException e) {
                 // Failed to load using the current class's classloader, ignore
             }
@@ -439,14 +402,20 @@
     }
 
     /**
+     * Returns the global {@code Logger}.
+     * @since 1.7
+     * @hide 1.7
+     */
+    public static Logger getGlobal() {
+        return global;
+    }
+
+    /**
      * Adds a handler to this logger. The {@code name} will be fed with log
      * records received by this logger.
      *
      * @param handler
      *            the handler object to add, cannot be {@code null}.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void addHandler(Handler handler) {
         if (handler == null) {
@@ -457,14 +426,13 @@
             LogManager.getLogManager().checkAccess();
         }
         this.handlers.add(handler);
-        updateDalvikLogHandler(); // android-only
+        updateDalvikLogHandler();
     }
 
     /**
      * Set the logger's manager and initializes its configuration from the
      * manager's properties.
      */
-    @SuppressWarnings("nls")
     void setManager(LogManager manager) {
         String levelProperty = manager.getProperty(name + ".level");
         if (levelProperty != null) {
@@ -504,7 +472,7 @@
             }
         }
 
-        updateDalvikLogHandler(); // android-only
+        updateDalvikLogHandler();
     }
 
     /**
@@ -522,9 +490,6 @@
      *
      * @param handler
      *            the handler to be removed.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void removeHandler(Handler handler) {
         // Anonymous loggers can always remove handlers
@@ -535,7 +500,7 @@
             return;
         }
         this.handlers.remove(handler);
-        updateDalvikLogHandler(); // android-only
+        updateDalvikLogHandler();
     }
 
     /**
@@ -552,9 +517,6 @@
      *
      * @param newFilter
      *            the filter to set, may be {@code null}.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setFilter(Filter newFilter) {
         // Anonymous loggers can always set the filter
@@ -580,9 +542,6 @@
      *
      * @param newLevel
      *            the logging level to set.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setLevel(Level newLevel) {
         // Anonymous loggers can always set the level
@@ -611,9 +570,6 @@
      *
      * @param notifyParentHandlers
      *            the new flag indicating whether to use the parent's handlers.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setUseParentHandlers(boolean notifyParentHandlers) {
         // Anonymous loggers can always set the useParentHandlers flag
@@ -621,7 +577,7 @@
             LogManager.getLogManager().checkAccess();
         }
         this.notifyParentHandlers = notifyParentHandlers;
-        updateDalvikLogHandler(); // android-only
+        updateDalvikLogHandler();
     }
 
     /**
@@ -640,9 +596,6 @@
      *
      * @param parent
      *            the parent logger to set.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     public void setParent(Logger parent) {
         if (parent == null) {
@@ -795,7 +748,6 @@
      * @param params
      *            an array of parameters for the method call.
      */
-    @SuppressWarnings("nls")
     public void entering(String sourceClass, String sourceMethod,
             Object[] params) {
         if (!internalIsLoggable(Level.FINER)) {
@@ -986,10 +938,7 @@
         if (!internalIsLoggable(logLevel)) {
             return;
         }
-
-        // BEGIN android-only
         dalvikLogHandler.publish(this, androidTag, logLevel, msg);
-        // END android-only
     }
 
     /**
@@ -1408,6 +1357,6 @@
             }
         }
 
-        updateDalvikLogHandler(); // android-only
+        updateDalvikLogHandler();
     }
 }
diff --git a/luni/src/main/java/java/util/logging/LoggingMXBean.java b/luni/src/main/java/java/util/logging/LoggingMXBean.java
index f2e9554..a36a9d4 100644
--- a/luni/src/main/java/java/util/logging/LoggingMXBean.java
+++ b/luni/src/main/java/java/util/logging/LoggingMXBean.java
@@ -73,9 +73,6 @@
      * @throws IllegalArgumentException
      *             if {@code loggerName} is not a registered logger or if
      *             {@code levelName} is not null and not valid.
-     * @throws SecurityException
-     *             if a security manager exists and the caller doesn't have
-     *             LoggingPermission("control").
      * @see Level#parse(String)
      */
     void setLoggerLevel(String loggerName, String levelName);
diff --git a/luni/src/main/java/java/util/logging/LoggingPermission.java b/luni/src/main/java/java/util/logging/LoggingPermission.java
index ec53956..0f06154 100644
--- a/luni/src/main/java/java/util/logging/LoggingPermission.java
+++ b/luni/src/main/java/java/util/logging/LoggingPermission.java
@@ -22,30 +22,15 @@
 import java.security.Guard;
 
 /**
- * The permission required to control the logging when run with a
- * {@code SecurityManager}.
+ * Legacy security code; this class exists for compatibility only.
  */
-public final class LoggingPermission extends BasicPermission implements Guard,
-        Serializable {
+public final class LoggingPermission extends BasicPermission implements Guard, Serializable {
 
     // for serialization compatibility with J2SE 1.4.2
     private static final long serialVersionUID = 63564341580231582L;
 
     /**
-     * Constructs a {@code LoggingPermission} object required to control the
-     * logging. The {@code SecurityManager} checks the permissions.
-     * <p>
-     * {@code LoggingPermission} objects are created by the security policy code
-     * and depends on the security policy file, therefore programmers shouldn't
-     * normally use them directly.
-     * </p>
-     *
-     * @param name
-     *            currently must be "control".
-     * @param actions
-     *            currently must be either {@code null} or the empty string.
-     * @throws IllegalArgumentException
-     *             if name null or different from {@code string} control.
+     * Legacy security code; this class exists for compatibility only.
      */
     public LoggingPermission(String name, String actions) {
         super(name, actions);
diff --git a/luni/src/main/java/java/util/logging/MemoryHandler.java b/luni/src/main/java/java/util/logging/MemoryHandler.java
index 4e7be49..d29b0ef 100644
--- a/luni/src/main/java/java/util/logging/MemoryHandler.java
+++ b/luni/src/main/java/java/util/logging/MemoryHandler.java
@@ -17,9 +17,6 @@
 
 package java.util.logging;
 
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-
 /**
  * A {@code Handler} put the description of log events into a cycled memory
  * buffer.
@@ -87,22 +84,15 @@
      *             used.
      */
     public MemoryHandler() {
-        super();
         String className = this.getClass().getName();
         // init target
         final String targetName = manager.getProperty(className + ".target");
         try {
-            Class<?> targetClass = AccessController
-                    .doPrivileged(new PrivilegedExceptionAction<Class<?>>() {
-                        public Class<?> run() throws Exception {
-                            ClassLoader loader = Thread.currentThread()
-                                    .getContextClassLoader();
-                            if (loader == null) {
-                                loader = ClassLoader.getSystemClassLoader();
-                            }
-                            return loader.loadClass(targetName);
-                        }
-                    });
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            if (loader == null) {
+                loader = ClassLoader.getSystemClassLoader();
+            }
+            Class<?> targetClass = loader.loadClass(targetName);
             target = (Handler) targetClass.newInstance();
         } catch (Exception e) {
             throw new RuntimeException("Cannot load target handler '" + targetName + "'");
@@ -166,10 +156,6 @@
 
     /**
      * Close this handler and target handler, free all associated resources.
-     *
-     * @throws SecurityException
-     *             if security manager exists and it determines that caller does
-     *             not have the required permissions to control this handler.
      */
     @Override
     public void close() {
@@ -197,8 +183,7 @@
      * @param record
      *            the log record
      */
-    @Override
-    public synchronized void publish(LogRecord record) {
+    @Override public synchronized void publish(LogRecord record) {
         if (!isLoggable(record)) {
             return;
         }
@@ -209,7 +194,6 @@
         if (record.getLevel().intValue() >= push.intValue()) {
             push();
         }
-        return;
     }
 
     /**
@@ -268,9 +252,6 @@
      *
      * @param newLevel
      *                 the new level to set.
-     * @throws SecurityException
-     *                 if security manager exists and it determines that caller
-     *                 does not have the required permissions to control this handler.
      */
     public void setPushLevel(Level newLevel) {
         manager.checkAccess();
diff --git a/luni/src/main/java/java/util/logging/SimpleFormatter.java b/luni/src/main/java/java/util/logging/SimpleFormatter.java
index 38672e7..22527e0 100644
--- a/luni/src/main/java/java/util/logging/SimpleFormatter.java
+++ b/luni/src/main/java/java/util/logging/SimpleFormatter.java
@@ -32,7 +32,6 @@
      * Constructs a new {@code SimpleFormatter}.
      */
     public SimpleFormatter() {
-        super();
     }
 
     /**
@@ -49,10 +48,9 @@
         sb.append(MessageFormat.format("{0, date} {0, time} ",
                 new Object[] { new Date(r.getMillis()) }));
         sb.append(r.getSourceClassName()).append(" ");
-        sb.append(r.getSourceMethodName()).append(
-                LogManager.getSystemLineSeparator());
+        sb.append(r.getSourceMethodName()).append(System.lineSeparator());
         sb.append(r.getLevel().getName()).append(": ");
-        sb.append(formatMessage(r)).append(LogManager.getSystemLineSeparator());
+        sb.append(formatMessage(r)).append(System.lineSeparator());
         if (r.getThrown() != null) {
             sb.append("Throwable occurred: ");
             Throwable t = r.getThrown();
diff --git a/luni/src/main/java/java/util/logging/SocketHandler.java b/luni/src/main/java/java/util/logging/SocketHandler.java
index bcaee09..85a9e6c 100644
--- a/luni/src/main/java/java/util/logging/SocketHandler.java
+++ b/luni/src/main/java/java/util/logging/SocketHandler.java
@@ -71,9 +71,6 @@
      *             if failed to connect to the specified host and port.
      * @throws IllegalArgumentException
      *             if the host name or port number is illegal.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission to control this handler.
      */
     public SocketHandler() throws IOException {
         super(DEFAULT_LEVEL, null, DEFAULT_FORMATTER, null);
@@ -96,9 +93,6 @@
      *             if failed to connect to the specified host and port.
      * @throws IllegalArgumentException
      *             if the host name or port number is illegal.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission to control this handler.
      */
     public SocketHandler(String host, int port) throws IOException {
         super(DEFAULT_LEVEL, null, DEFAULT_FORMATTER, null);
@@ -134,10 +128,6 @@
 
     /**
      * Closes this handler. The network connection to the host is also closed.
-     *
-     * @throws SecurityException
-     *             If a security manager determines that the caller does not
-     *             have the required permission to control this handler.
      */
     @Override
     public void close() {
diff --git a/luni/src/main/java/java/util/logging/StreamHandler.java b/luni/src/main/java/java/util/logging/StreamHandler.java
index 42a02a3..7581835 100644
--- a/luni/src/main/java/java/util/logging/StreamHandler.java
+++ b/luni/src/main/java/java/util/logging/StreamHandler.java
@@ -162,9 +162,6 @@
      *
      * @param os
      *            the new output stream.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      * @throws NullPointerException
      *             if {@code os} is {@code null}.
      */
@@ -185,15 +182,11 @@
      *
      * @param encoding
      *            the character encoding to set.
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      * @throws UnsupportedEncodingException
      *             if the specified encoding is not supported by the runtime.
      */
     @Override
-    public void setEncoding(String encoding) throws SecurityException,
-            UnsupportedEncodingException {
+    public void setEncoding(String encoding) throws UnsupportedEncodingException {
         // flush first before set new encoding
         this.flush();
         super.setEncoding(encoding);
@@ -247,10 +240,6 @@
      * this handler is written out. A flush operation and a subsequent close
      * operation is then performed upon the output stream. Client applications
      * should not use a handler after closing it.
-     *
-     * @throws SecurityException
-     *             if a security manager determines that the caller does not
-     *             have the required permission.
      */
     @Override
     public void close() {
diff --git a/luni/src/main/java/java/util/logging/XMLFormatter.java b/luni/src/main/java/java/util/logging/XMLFormatter.java
index 5e461c4..0d80b3e 100644
--- a/luni/src/main/java/java/util/logging/XMLFormatter.java
+++ b/luni/src/main/java/java/util/logging/XMLFormatter.java
@@ -17,8 +17,6 @@
 
 package java.util.logging;
 
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.text.MessageFormat;
 import java.util.Date;
 import java.util.ResourceBundle;
@@ -32,16 +30,12 @@
  */
 public class XMLFormatter extends Formatter {
 
-    private static final String lineSeperator = LogManager
-            .getSystemLineSeparator();
-
     private static final String indent = "    ";
 
     /**
      * Constructs a new {@code XMLFormatter}.
      */
     public XMLFormatter() {
-        super();
     }
 
     /**
@@ -51,55 +45,42 @@
      *            the log record to be formatted.
      * @return the log record formatted as an XML string.
      */
-    @SuppressWarnings("nls")
     @Override
     public String format(LogRecord r) {
         // call a method of LogRecord to ensure not null
         long time = r.getMillis();
         // format to date
-        String date = MessageFormat.format("{0, date} {0, time}",
-                new Object[] { new Date(time) });
+        String date = MessageFormat.format("{0, date} {0, time}", new Object[] { new Date(time) });
+        String nl = System.lineSeparator();
 
         StringBuilder sb = new StringBuilder();
-        sb.append(("<record>")).append(lineSeperator);
-        sb.append(indent).append(("<date>")).append(date).append(("</date>"))
-                .append(lineSeperator);
-        sb.append(indent).append(("<millis>")).append(time).append(
-                ("</millis>")).append(lineSeperator);
-        sb.append(indent).append(("<sequence>")).append(r.getSequenceNumber())
-                .append(("</sequence>")).append(lineSeperator);
+        sb.append("<record>").append(nl);
+        append(sb, 1, "date", date);
+        append(sb, 1, "millis", time);
+        append(sb, 1, "sequence", r.getSequenceNumber());
         if (r.getLoggerName() != null) {
-            sb.append(indent).append(("<logger>")).append(r.getLoggerName())
-                    .append(("</logger>")).append(lineSeperator);
+            append(sb, 1, "logger", r.getLoggerName());
         }
-        sb.append(indent).append(("<level>")).append(r.getLevel().getName())
-                .append(("</level>")).append(lineSeperator);
+        append(sb, 1, "level", r.getLevel().getName());
         if (r.getSourceClassName() != null) {
-            sb.append(indent).append(("<class>"))
-                    .append(r.getSourceClassName()).append(("</class>"))
-                    .append(lineSeperator);
+            append(sb, 1, "class", r.getSourceClassName());
         }
         if (r.getSourceMethodName() != null) {
-            sb.append(indent).append(("<method>")).append(
-                    r.getSourceMethodName()).append(("</method>")).append(
-                    lineSeperator);
+            append(sb, 1, "method", r.getSourceMethodName());
         }
-        sb.append(indent).append(("<thread>")).append(r.getThreadID()).append(
-                ("</thread>")).append(lineSeperator);
+        append(sb, 1, "thread", r.getThreadID());
         formatMessages(r, sb);
-        Object[] params;
-        if ((params = r.getParameters()) != null) {
+        Object[] params = r.getParameters();
+        if (params != null) {
             for (Object element : params) {
-                sb.append(indent).append(("<param>")).append(element).append(
-                        ("</param>")).append(lineSeperator);
+                append(sb, 1, "param", element);
             }
         }
         formatThrowable(r, sb);
-        sb.append(("</record>")).append(lineSeperator);
+        sb.append("</record>").append(nl);
         return sb.toString();
     }
 
-    @SuppressWarnings("nls")
     private void formatMessages(LogRecord r, StringBuilder sb) {
         // get localized message if has, but don't call Formatter.formatMessage
         // to parse pattern string
@@ -115,53 +96,48 @@
 
             if (message == null) {
                 message = pattern;
-                sb.append(indent).append(("<message>")).append(message).append(
-                        ("</message>")).append(lineSeperator);
+                append(sb, 1, "message", message);
             } else {
-                sb.append(indent).append(("<message>")).append(message).append(
-                        ("</message>")).append(lineSeperator);
-                sb.append(indent).append(("<key>")).append(pattern).append(
-                        ("</key>")).append(lineSeperator);
-                sb.append(indent).append(("<catalog>")).append(
-                        r.getResourceBundleName()).append(("</catalog>"))
-                        .append(lineSeperator);
+                append(sb, 1, "message", message);
+                append(sb, 1, "key", pattern);
+                append(sb, 1, "catalog", r.getResourceBundleName());
             }
         } else if (pattern != null) {
-            sb.append(indent).append(("<message>")).append(pattern).append(
-                    ("</message>")).append(lineSeperator);
+            append(sb, 1, "message", pattern);
         } else {
-            sb.append(indent).append(("<message/>"));
+            sb.append(indent).append("<message/>");
         }
     }
 
-    @SuppressWarnings("nls")
     private void formatThrowable(LogRecord r, StringBuilder sb) {
         Throwable t;
         if ((t = r.getThrown()) != null) {
-            sb.append(indent).append("<exception>").append(lineSeperator);
-            sb.append(indent).append(indent).append("<message>").append(
-                    t.toString()).append("</message>").append(lineSeperator);
+            String nl = System.lineSeparator();
+            sb.append(indent).append("<exception>").append(nl);
+            append(sb, 2, "message", t.toString());
             // format throwable's stack trace
             StackTraceElement[] elements = t.getStackTrace();
             for (StackTraceElement e : elements) {
-                sb.append(indent).append(indent).append("<frame>").append(
-                        lineSeperator);
-                sb.append(indent).append(indent).append(indent).append(
-                        "<class>").append(e.getClassName()).append("</class>")
-                        .append(lineSeperator);
-                sb.append(indent).append(indent).append(indent).append(
-                        "<method>").append(e.getMethodName()).append(
-                        "</method>").append(lineSeperator);
-                sb.append(indent).append(indent).append(indent)
-                        .append("<line>").append(e.getLineNumber()).append(
-                                "</line>").append(lineSeperator);
-                sb.append(indent).append(indent).append("</frame>").append(
-                        lineSeperator);
+                sb.append(indent).append(indent).append("<frame>").append(nl);
+                append(sb, 3, "class", e.getClassName());
+                append(sb, 3, "method", e.getMethodName());
+                append(sb, 3, "line", e.getLineNumber());
+                sb.append(indent).append(indent).append("</frame>").append(nl);
             }
-            sb.append(indent).append("</exception>").append(lineSeperator);
+            sb.append(indent).append("</exception>").append(nl);
         }
     }
 
+    private static void append(StringBuilder sb, int indentCount, String tag, Object value) {
+        for (int i = 0; i < indentCount; ++i) {
+            sb.append(indent);
+        }
+        sb.append("<").append(tag).append(">");
+        sb.append(value);
+        sb.append("</").append(tag).append(">");
+        sb.append(System.lineSeparator());
+    }
+
     /**
      * Returns the header string for a set of log records formatted as XML
      * strings, using the output handler's encoding if it is defined, otherwise
@@ -171,7 +147,6 @@
      *            the output handler, may be {@code null}.
      * @return the header string for log records formatted as XML strings.
      */
-    @SuppressWarnings("nls")
     @Override
     public String getHead(Handler h) {
         String encoding = null;
@@ -179,13 +154,14 @@
             encoding = h.getEncoding();
         }
         if (encoding == null) {
-            encoding = getSystemProperty("file.encoding");
+            encoding = System.getProperty("file.encoding");
         }
         StringBuilder sb = new StringBuilder();
-        sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append(
-                "\" standalone=\"no\"?>").append(lineSeperator);
-        sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">").append(lineSeperator);
-        sb.append(("<log>"));
+        sb.append("<?xml version=\"1.0\" encoding=\"").append(encoding).append("\" standalone=\"no\"?>");
+        sb.append(System.lineSeparator());
+        sb.append("<!DOCTYPE log SYSTEM \"logger.dtd\">");
+        sb.append(System.lineSeparator());
+        sb.append("<log>");
         return sb.toString();
     }
 
@@ -201,13 +177,4 @@
     public String getTail(Handler h) {
         return "</log>";
     }
-
-    // use privilege code to get system property
-    private static String getSystemProperty(final String key) {
-        return AccessController.doPrivileged(new PrivilegedAction<String>() {
-            public String run() {
-                return System.getProperty(key);
-            }
-        });
-    }
 }
diff --git a/luni/src/main/java/java/util/prefs/FilePreferencesFactoryImpl.java b/luni/src/main/java/java/util/prefs/FilePreferencesFactoryImpl.java
index a7b138a..8f2d0aa 100644
--- a/luni/src/main/java/java/util/prefs/FilePreferencesFactoryImpl.java
+++ b/luni/src/main/java/java/util/prefs/FilePreferencesFactoryImpl.java
@@ -30,7 +30,6 @@
     private static final Preferences SYSTEM_ROOT = new FilePreferencesImpl(false);
 
     public FilePreferencesFactoryImpl() {
-        super();
     }
 
     public Preferences userRoot() {
diff --git a/luni/src/main/java/java/util/prefs/FilePreferencesImpl.java b/luni/src/main/java/java/util/prefs/FilePreferencesImpl.java
index 0fd8466..bd367a6 100644
--- a/luni/src/main/java/java/util/prefs/FilePreferencesImpl.java
+++ b/luni/src/main/java/java/util/prefs/FilePreferencesImpl.java
@@ -18,8 +18,6 @@
 
 import java.io.File;
 import java.io.FilenameFilter;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Properties;
@@ -35,41 +33,14 @@
  */
 class FilePreferencesImpl extends AbstractPreferences {
 
-    /*
-     * --------------------------------------------------------------
-     * Class fields
-     * --------------------------------------------------------------
-     */
-
     //prefs file name
     private static final String PREFS_FILE_NAME = "prefs.xml";
 
     //home directory for user prefs
-    private static String USER_HOME;
+    private static String USER_HOME = System.getProperty("user.home") + "/.java/.userPrefs";
 
     //home directory for system prefs
-    private static String SYSTEM_HOME;
-
-    /*
-     * --------------------------------------------------------------
-     * Class initializer
-     * --------------------------------------------------------------
-     */
-    static {
-        AccessController.doPrivileged(new PrivilegedAction<Void>() {
-            public Void run() {
-                USER_HOME = System.getProperty("user.home") + "/.java/.userPrefs";
-                SYSTEM_HOME = System.getProperty("java.home") + "/.systemPrefs";
-                return null;
-            }
-        });
-    }
-
-    /*
-     * --------------------------------------------------------------
-     * Instance fields
-     * --------------------------------------------------------------
-     */
+    private static String SYSTEM_HOME = System.getProperty("java.home") + "/.systemPrefs";
 
     //file path for this preferences node
     private String path;
@@ -117,26 +88,16 @@
 
     private void initPrefs() {
         dir = new File(path);
-        newNode = (AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
-            public Boolean run() {
-                return Boolean.valueOf(!dir.exists());
-            }
-        })).booleanValue();
+        newNode = !dir.exists();
         prefsFile = new File(path + File.separator + PREFS_FILE_NAME);
-        prefs = XMLParser.loadFilePrefs(prefsFile);
+        prefs = XMLParser.readXmlPreferences(prefsFile);
     }
 
     @Override
     protected String[] childrenNamesSpi() throws BackingStoreException {
-        String[] names = AccessController
-        .doPrivileged(new PrivilegedAction<String[]>() {
-            public String[] run() {
-                return dir.list(new FilenameFilter() {
-                    public boolean accept(File parent, String name) {
-                        return new File(path + File.separator + name).isDirectory();
-                    }
-                });
-
+        String[] names = dir.list(new FilenameFilter() {
+            public boolean accept(File parent, String name) {
+                return new File(path + File.separator + name).isDirectory();
             }
         });
         if (names == null) {// file is not a directory, exception case
@@ -160,7 +121,7 @@
                 return;
             }
             // reload
-            Properties currentPrefs = XMLParser.loadFilePrefs(prefsFile);
+            Properties currentPrefs = XMLParser.readXmlPreferences(prefsFile);
             // merge
             Iterator<String> it = removed.iterator();
             while (it.hasNext()) {
@@ -175,7 +136,7 @@
             updated.clear();
             // flush
             prefs = currentPrefs;
-            XMLParser.flushFilePrefs(prefsFile, prefs);
+            XMLParser.writeXmlPreferences(prefsFile, prefs);
         } catch (Exception e) {
             throw new BackingStoreException(e);
         }
@@ -185,7 +146,7 @@
     protected String getSpi(String key) {
         try {
             if (prefs == null) {
-                prefs = XMLParser.loadFilePrefs(prefsFile);
+                prefs = XMLParser.readXmlPreferences(prefsFile);
             }
             return prefs.getProperty(key);
         } catch (Exception e) {
@@ -208,12 +169,8 @@
 
     @Override
     protected void removeNodeSpi() throws BackingStoreException {
-        boolean removeSucceed = (AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
-            public Boolean run() {
-                prefsFile.delete();
-                return Boolean.valueOf(dir.delete());
-            }
-        })).booleanValue();
+        prefsFile.delete();
+        boolean removeSucceed = dir.delete();
         if (!removeSucceed) {
             throw new BackingStoreException("Cannot remove " + toString());
         }
diff --git a/luni/src/main/java/java/util/prefs/Preferences.java b/luni/src/main/java/java/util/prefs/Preferences.java
index 94eb2ab..fad7d7a 100644
--- a/luni/src/main/java/java/util/prefs/Preferences.java
+++ b/luni/src/main/java/java/util/prefs/Preferences.java
@@ -98,9 +98,6 @@
      */
     public static final int MAX_VALUE_LENGTH = 8192;
 
-    //permission
-    private static final RuntimePermission PREFS_PERM = new RuntimePermission("preferences");
-
     //factory used to get user/system prefs root
     private static final PreferencesFactory factory = findPreferencesFactory();
 
@@ -122,7 +119,6 @@
      * Default constructor, for use by subclasses only.
      */
     protected Preferences() {
-        super();
     }
 
     /**
@@ -440,12 +436,8 @@
      *             valid XML document.
      * @throws IOException
      *             if an error occurs while importing.
-     * @throws SecurityException
-     *             if {@code RuntimePermission("preferences")} is denied by a
-     *             SecurityManager.
      */
     public static void importPreferences (InputStream istream) throws InvalidPreferencesFormatException, IOException {
-        checkSecurity();
         if (istream == null){
             throw new MalformedURLException("Inputstream cannot be null");
         }
@@ -803,12 +795,8 @@
      * @return the system preference node for the package of the given class.
      * @throws NullPointerException
      *             if the given class is {@code null}.
-     * @throws SecurityException
-     *             if the {@code RuntimePermission("preferences")} is denied by
-     *             a SecurityManager.
      */
     public static Preferences systemNodeForPackage (Class<?> c) {
-        checkSecurity();
         return factory.systemRoot().node(getNodeName(c));
     }
 
@@ -816,23 +804,11 @@
      * Returns the root node of the system preference hierarchy.
      *
      * @return the system preference hierarchy root node.
-     * @throws SecurityException
-     *             if the {@code RuntimePermission("preferences")} is denied by
-     *             a SecurityManager.
      */
     public static Preferences systemRoot() {
-        checkSecurity();
         return factory.systemRoot();
     }
 
-    //check the RuntimePermission("preferences")
-    private static void checkSecurity() {
-        SecurityManager manager = System.getSecurityManager();
-        if (manager != null){
-            manager.checkPermission(PREFS_PERM);
-        }
-    }
-
     /**
      * Returns the user preference node for the package of the given class.
      * The absolute path of the returned node is one slash followed by the given
@@ -849,12 +825,8 @@
      * @return the user preference node for the package of the given class.
      * @throws NullPointerException
      *             if the given class is {@code null}.
-     * @throws SecurityException
-     *             if the {@code RuntimePermission("preferences")} is denied by
-     *             a SecurityManager.
      */
     public static Preferences userNodeForPackage (Class<?> c) {
-        checkSecurity();
         return factory.userRoot().node(getNodeName(c));
     }
 
@@ -871,12 +843,8 @@
      * Returns the root node of the user preference hierarchy.
      *
      * @return the user preference hierarchy root node.
-     * @throws SecurityException
-     *             if the {@code RuntimePermission("preferences")} is denied by
-     *             a SecurityManager.
      */
     public static Preferences userRoot() {
-        checkSecurity();
         return factory.userRoot();
     }
 
diff --git a/luni/src/main/java/java/util/prefs/XMLParser.java b/luni/src/main/java/java/util/prefs/XMLParser.java
index 97fce86..6546b76 100644
--- a/luni/src/main/java/java/util/prefs/XMLParser.java
+++ b/luni/src/main/java/java/util/prefs/XMLParser.java
@@ -27,20 +27,14 @@
 import java.io.OutputStreamWriter;
 import java.io.Reader;
 import java.io.StringReader;
-import java.nio.channels.FileChannel;
-import java.nio.channels.FileLock;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
 import java.util.ArrayList;
 import java.util.Properties;
 import java.util.StringTokenizer;
+import java.util.UUID;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.ParserConfigurationException;
-import libcore.util.EmptyArray;
 import libcore.io.IoUtils;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -111,9 +105,7 @@
      */
     static {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-        // BEGIN android-changed
         factory.setValidating(false);
-        // END android-changed
         try {
             builder = factory.newDocumentBuilder();
         } catch (ParserConfigurationException e) {
@@ -322,9 +314,6 @@
             case '&':
                 sb.append("&amp;");
                 break;
-            case '\\':
-                sb.append("&apos;");
-                break;
             case '"':
                 sb.append("&quot;");
                 break;
@@ -370,22 +359,12 @@
         } catch (SAXException e) {
             throw new InvalidPreferencesFormatException(e);
         }
-        // BEGIN android-removed
-        // catch (TransformerException e) {
-        //     throw new InvalidPreferencesFormatException(e);
-        // }
-        // END android-removed
     }
 
     private static void loadNode(Preferences prefs, Element node) {
-        // BEGIN android-note
-        // removed throw clause for TransformerException
-        // END android-note
         // load preferences
-        // BEGIN android-changed
         NodeList children = selectNodeList(node, "node");
         NodeList entries = selectNodeList(node, "map/entry");
-        // END android-changed
         int childNumber = children.getLength();
         Preferences[] prefChildren = new Preferences[childNumber];
         int entryNumber = entries.getLength();
@@ -413,7 +392,6 @@
         }
     }
 
-    // BEGIN android-added
     // TODO dirty implementation of a method from javax.xml.xpath
     // should be replaced with a call to a good impl of this method
     private static NodeList selectNodeList(Element documentElement, String string) {
@@ -430,8 +408,7 @@
             for(int i = 0; i < childNodes.getLength(); i++) {
                 Object next = childNodes.item(i);
                 if(next instanceof Element) {
-                    if(((Element) next).getNodeName().equals(path[0])
-                            && next instanceof Node) {
+                    if(((Element) next).getNodeName().equals(path[0])) {
                         input.add((Node)next);
                     }
                 }
@@ -440,8 +417,7 @@
             for(int i = 0; i < childNodes.getLength(); i++) {
                 Object next = childNodes.item(i);
                 if(next instanceof Element) {
-                    if(((Element) next).getNodeName().equals(path[0])
-                            && next instanceof Node) {
+                    if(((Element) next).getNodeName().equals(path[0])) {
                         NodeList nextChildNodes = ((Node)next).getChildNodes();
                         for(int j = 0; j < nextChildNodes.getLength(); j++) {
                             Object subnext = nextChildNodes.item(j);
@@ -460,40 +436,21 @@
 
         return result;
     }
-    // END android-added
 
-    /***************************************************************************
-     * utilities for FilePreferencesImpl, which is default implementation of Linux platform
-     **************************************************************************/
     /**
-     * load preferences from file, if cannot load, create a new one FIXME: need
-     * lock or not?
-     *
-     * @param file    the XML file to be read
-     * @return Properties instance which indicates the preferences key-value pairs
+     * Returns the preferences from {@code xmlFile}. Returns empty properties if
+     * any errors occur.
      */
-    static Properties loadFilePrefs(final File file) {
-        return AccessController.doPrivileged(new PrivilegedAction<Properties>() {
-            public Properties run() {
-                return loadFilePrefsImpl(file);
-            }
-        });
-    }
-
-    static Properties loadFilePrefsImpl(final File file) {
+    static Properties readXmlPreferences(File xmlFile) {
         Properties result = new Properties();
-        if (!file.exists()) {
-            file.getParentFile().mkdirs();
-        } else if (file.canRead()) {
+        if (!xmlFile.exists()) {
+            xmlFile.getParentFile().mkdirs();
+        } else if (xmlFile.canRead()) {
             Reader reader = null;
-            FileLock lock = null;
             try {
-                FileInputStream fileInputStream = new FileInputStream(file);
-                reader = new InputStreamReader(fileInputStream, "UTF-8");
-                FileChannel channel = fileInputStream.getChannel();
-                lock = channel.lock(0L, Long.MAX_VALUE, true);
-                Document doc = builder.parse(new InputSource(reader));
-                NodeList entries = selectNodeList(doc.getDocumentElement(), "entry");
+                reader = new InputStreamReader(new FileInputStream(xmlFile), "UTF-8");
+                Document document = builder.parse(new InputSource(reader));
+                NodeList entries = selectNodeList(document.getDocumentElement(), "entry");
                 int length = entries.getLength();
                 for (int i = 0; i < length; i++) {
                     Element node = (Element) entries.item(i);
@@ -501,70 +458,47 @@
                     String value = node.getAttribute("value");
                     result.setProperty(key, value);
                 }
-                return result;
-            } catch (IOException e) {
-            } catch (SAXException e) {
+            } catch (IOException ignored) {
+            } catch (SAXException ignored) {
             } finally {
-                releaseQuietly(lock);
                 IoUtils.closeQuietly(reader);
             }
         } else {
-            file.delete();
+            // the prefs API requires this to be hostile towards pre-existing files
+            xmlFile.delete();
         }
         return result;
     }
 
     /**
-     *
-     * @param file
-     * @param prefs
-     * @throws PrivilegedActionException
+     * Writes the preferences to {@code xmlFile}.
      */
-    static void flushFilePrefs(final File file, final Properties prefs) throws PrivilegedActionException {
-        AccessController.doPrivileged(new PrivilegedExceptionAction<Object>() {
-            public Object run() throws IOException {
-                flushFilePrefsImpl(file, prefs);
-                return null;
-            }
-        });
-    }
+    static void writeXmlPreferences(File xmlFile, Properties properties) throws IOException {
+        File parent = xmlFile.getParentFile();
+        File temporaryForWriting = new File(parent, "prefs-" + UUID.randomUUID() + ".xml.tmp");
 
-    static void flushFilePrefsImpl(File file, Properties prefs) throws IOException {
         BufferedWriter out = null;
-        FileLock lock = null;
         try {
-            FileOutputStream ostream = new FileOutputStream(file);
-            out = new BufferedWriter(new OutputStreamWriter(ostream, "UTF-8"));
-            FileChannel channel = ostream.getChannel();
-            lock = channel.lock();
+            out = new BufferedWriter(new OutputStreamWriter(
+                    new FileOutputStream(temporaryForWriting), "UTF-8"));
             out.write(HEADER);
             out.newLine();
             out.write(FILE_PREFS);
             out.newLine();
-            if (prefs.size() == 0) {
-                exportEntries(EmptyArray.STRING, EmptyArray.STRING, out);
-            } else {
-                String[] keys = prefs.keySet().toArray(new String[prefs.size()]);
-                int length = keys.length;
-                String[] values = new String[length];
-                for (int i = 0; i < length; i++) {
-                    values[i] = prefs.getProperty(keys[i]);
-                }
-                exportEntries(keys, values, out);
+            String[] keys = properties.keySet().toArray(new String[properties.size()]);
+            int length = keys.length;
+            String[] values = new String[length];
+            for (int i = 0; i < length; i++) {
+                values[i] = properties.getProperty(keys[i]);
             }
-            out.flush();
+            exportEntries(keys, values, out);
+            out.close();
+            if (!temporaryForWriting.renameTo(xmlFile)) {
+                throw new IOException("Failed to write preferences to " + xmlFile);
+            }
         } finally {
-            releaseQuietly(lock);
             IoUtils.closeQuietly(out);
+            temporaryForWriting.delete(); // no-op unless something failed
         }
     }
-
-    private static void releaseQuietly(FileLock lock) {
-        if (lock == null) {
-            return;
-        }
-        try {
-            lock.release();
-        } catch (IOException e) {}
-    }
 }
diff --git a/luni/src/main/java/java/util/regex/PatternSyntaxException.java b/luni/src/main/java/java/util/regex/PatternSyntaxException.java
index 2bbdb46..a8dec47 100644
--- a/luni/src/main/java/java/util/regex/PatternSyntaxException.java
+++ b/luni/src/main/java/java/util/regex/PatternSyntaxException.java
@@ -82,13 +82,12 @@
     /**
      * Returns a detailed error message for the exception. The message is
      * potentially multi-line, and it might include a detailed description, the
-     * original regular expression, and the index at which the error occured.
+     * original regular expression, and the index at which the error occurred.
      *
      * @return the error message.
      */
     @Override
     public String getMessage() {
-        // BEGIN android-changed
         StringBuilder builder = new StringBuilder("Syntax error");
 
         if (desc != null) {
@@ -114,7 +113,6 @@
         }
 
         return builder.toString();
-        // END android-changed
     }
 
     /**
diff --git a/luni/src/main/java/java/util/zip/DataFormatException.java b/luni/src/main/java/java/util/zip/DataFormatException.java
index ec4e867..811c4c5 100644
--- a/luni/src/main/java/java/util/zip/DataFormatException.java
+++ b/luni/src/main/java/java/util/zip/DataFormatException.java
@@ -29,7 +29,6 @@
      * Constructs a new {@code DataFormatException} instance.
      */
     public DataFormatException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/zip/Deflater.java b/luni/src/main/java/java/util/zip/Deflater.java
index 319c5ce..044b976 100644
--- a/luni/src/main/java/java/util/zip/Deflater.java
+++ b/luni/src/main/java/java/util/zip/Deflater.java
@@ -47,9 +47,9 @@
  * </pre>
  * <p>In situations where you don't have all the input in one array (or have so much
  * input that you want to feed it to the deflater in chunks), it's possible to call
- * {@link #setInput} repeatedly, but you're much better off using {@link DeflaterOutputStream}
- * to handle all this for you. {@link DeflaterOutputStream} also helps minimize memory
- * requirements&nbsp;&mdash; the sample code above is very expensive.
+ * {@link #setInput setInput} repeatedly, but you're much better off using
+ * {@link DeflaterOutputStream} to handle all this for you. {@link DeflaterOutputStream} also helps
+ * minimize memory requirements&nbsp;&mdash; the sample code above is very expensive.
  */
 public class Deflater {
 
@@ -184,7 +184,6 @@
      *            {@code true} indicates that no ZLIB header should be written.
      */
     public Deflater(int level, boolean noHeader) {
-        super();
         if (level < DEFAULT_COMPRESSION || level > BEST_COMPRESSION) {
             throw new IllegalArgumentException();
         }
@@ -194,7 +193,7 @@
     }
 
     /**
-     * Deflates the data (previously passed to {@link #setInput}) into the
+     * Deflates the data (previously passed to {@link #setInput setInput}) into the
      * supplied buffer.
      *
      * @return number of bytes of compressed data written to {@code buf}.
@@ -204,7 +203,7 @@
     }
 
     /**
-     * Deflates data (previously passed to {@link #setInput}) into a specific
+     * Deflates data (previously passed to {@link #setInput setInput}) into a specific
      * region within the supplied buffer.
      *
      * @return the number of bytes of compressed data written to {@code buf}.
@@ -214,7 +213,7 @@
     }
 
     /**
-     * Deflates data (previously passed to {@link #setInput}) into a specific
+     * Deflates data (previously passed to {@link #setInput setInput}) into a specific
      * region within the supplied buffer, optionally flushing the input buffer.
      *
      * @param flush one of {@link #NO_FLUSH}, {@link #SYNC_FLUSH} or {@link #FULL_FLUSH}.
@@ -294,7 +293,9 @@
     }
 
     /**
-     * Returns true if all provided data has been successfully compressed.
+     * Returns true if {@link #finish finish} has been called and all
+     * data provided by {@link #setInput setInput} has been
+     * successfully compressed and consumed by {@link #deflate deflate}.
      */
     public synchronized boolean finished() {
         return finished;
@@ -333,7 +334,7 @@
     private native long getTotalOutImpl(long handle);
 
     /**
-     * Returns true if {@link #setInput} must be called before deflation can continue.
+     * Returns true if {@link #setInput setInput} must be called before deflation can continue.
      * If all uncompressed data has been provided to the {@code Deflater},
      * {@link #finish} must be called to ensure the compressed data is output.
      */
@@ -415,7 +416,7 @@
     /**
      * Sets the compression level to be used when compressing data. The
      * compression level must be a value between 0 and 9. This value must be set
-     * prior to calling {@link #setInput}.
+     * prior to calling {@link #setInput setInput}.
      * @exception IllegalArgumentException
      *                If the compression level is invalid.
      */
@@ -432,7 +433,7 @@
     /**
      * Sets the compression strategy to be used. The strategy must be one of
      * FILTERED, HUFFMAN_ONLY or DEFAULT_STRATEGY. This value must be set prior
-     * to calling {@link #setInput}.
+     * to calling {@link #setInput setInput}.
      *
      * @exception IllegalArgumentException
      *                If the strategy specified is not one of FILTERED,
diff --git a/luni/src/main/java/java/util/zip/DeflaterInputStream.java b/luni/src/main/java/java/util/zip/DeflaterInputStream.java
index 5ee1002..c6e95f2 100644
--- a/luni/src/main/java/java/util/zip/DeflaterInputStream.java
+++ b/luni/src/main/java/java/util/zip/DeflaterInputStream.java
@@ -99,13 +99,8 @@
      *
      * @return the byte or -1 if the end of the stream has been reached.
      */
-    @Override
-    public int read() throws IOException {
-        byte[] result = new byte[1];
-        if (read(result, 0, 1) == -1) {
-            return -1;
-        }
-        return result[0] & 0xff;
+    @Override public int read() throws IOException {
+        return Streams.readSingleByte(this);
     }
 
     /**
@@ -114,8 +109,7 @@
      * @return the number of bytes read or -1 if the end of the compressed input
      *         stream has been reached.
      */
-    @Override
-    public int read(byte[] buffer, int offset, int byteCount) throws IOException {
+    @Override public int read(byte[] buffer, int offset, int byteCount) throws IOException {
         checkClosed();
         Arrays.checkOffsetAndCount(buffer.length, offset, byteCount);
         if (byteCount == 0) {
diff --git a/luni/src/main/java/java/util/zip/DeflaterOutputStream.java b/luni/src/main/java/java/util/zip/DeflaterOutputStream.java
index 66e674c..b0bcb99 100644
--- a/luni/src/main/java/java/util/zip/DeflaterOutputStream.java
+++ b/luni/src/main/java/java/util/zip/DeflaterOutputStream.java
@@ -21,6 +21,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Arrays;
+import libcore.io.Streams;
 
 /**
  * This class provides an implementation of {@code FilterOutputStream} that
@@ -171,20 +172,14 @@
         }
         def.finish();
         while (!def.finished()) {
-            if (def.needsInput()) {
-                def.setInput(buf, 0, 0);
-            }
             int byteCount = def.deflate(buf);
             out.write(buf, 0, byteCount);
         }
         done = true;
     }
 
-    @Override
-    public void write(int i) throws IOException {
-        byte[] b = new byte[1];
-        b[0] = (byte) i;
-        write(b, 0, 1);
+    @Override public void write(int i) throws IOException {
+        Streams.writeSingleByte(this, i);
     }
 
     /**
@@ -193,8 +188,7 @@
      * @throws IOException
      *             If an error occurs during writing.
      */
-    @Override
-    public void write(byte[] buffer, int offset, int byteCount) throws IOException {
+    @Override public void write(byte[] buffer, int offset, int byteCount) throws IOException {
         if (done) {
             throw new IOException("attempt to write after finish");
         }
diff --git a/luni/src/main/java/java/util/zip/GZIPInputStream.java b/luni/src/main/java/java/util/zip/GZIPInputStream.java
index 6a8f456..fd73acc 100644
--- a/luni/src/main/java/java/util/zip/GZIPInputStream.java
+++ b/luni/src/main/java/java/util/zip/GZIPInputStream.java
@@ -22,7 +22,7 @@
 import java.io.InputStream;
 import java.nio.ByteOrder;
 import java.util.Arrays;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 /**
  * The {@code GZIPInputStream} class is used to read data stored in the GZIP
@@ -56,7 +56,7 @@
     /**
      * The magic header for the GZIP format.
      */
-    public final static int GZIP_MAGIC = 0x8b1f;
+    public static final int GZIP_MAGIC = 0x8b1f;
 
     /**
      * The checksum algorithm used when handling uncompressed data.
@@ -96,7 +96,7 @@
         super(is, new Inflater(true), size);
         byte[] header = new byte[10];
         readFully(header, 0, header.length);
-        short magic = OSMemory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN);
+        short magic = Memory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN);
         if (magic != (short) GZIP_MAGIC) {
             throw new IOException(String.format("unknown format (magic number %x)", magic));
         }
@@ -110,7 +110,7 @@
             if (hcrc) {
                 crc.update(header, 0, 2);
             }
-            int length = OSMemory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN) & 0xffff;
+            int length = Memory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN) & 0xffff;
             while (length > 0) {
                 int max = length > buf.length ? buf.length : length;
                 int result = in.read(buf, 0, max);
@@ -131,7 +131,7 @@
         }
         if (hcrc) {
             readFully(header, 0, 2);
-            short crc16 = OSMemory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN);
+            short crc16 = Memory.peekShort(header, 0, ByteOrder.LITTLE_ENDIAN);
             if ((short) crc.getValue() != crc16) {
                 throw new IOException("CRC mismatch");
             }
@@ -190,10 +190,10 @@
         System.arraycopy(buf, len - size, b, 0, copySize);
         readFully(b, copySize, trailerSize - copySize);
 
-        if (OSMemory.peekInt(b, 0, ByteOrder.LITTLE_ENDIAN) != (int) crc.getValue()) {
+        if (Memory.peekInt(b, 0, ByteOrder.LITTLE_ENDIAN) != (int) crc.getValue()) {
             throw new IOException("CRC mismatch");
         }
-        if (OSMemory.peekInt(b, 4, ByteOrder.LITTLE_ENDIAN) != inf.getTotalOut()) {
+        if (Memory.peekInt(b, 4, ByteOrder.LITTLE_ENDIAN) != inf.getTotalOut()) {
             throw new IOException("Size mismatch");
         }
     }
diff --git a/luni/src/main/java/java/util/zip/Inflater.java b/luni/src/main/java/java/util/zip/Inflater.java
index 9f430a8..ee10aa7 100644
--- a/luni/src/main/java/java/util/zip/Inflater.java
+++ b/luni/src/main/java/java/util/zip/Inflater.java
@@ -309,7 +309,6 @@
 
     private native void setInputImpl(byte[] buf, int offset, int byteCount, long handle);
 
-    // BEGIN android-only
     synchronized int setFileInput(FileDescriptor fd, long offset, int byteCount) {
         checkOpen();
         inRead = 0;
@@ -318,7 +317,6 @@
     }
 
     private native int setFileInputImpl(FileDescriptor fd, long offset, int byteCount, long handle);
-    // END android-only
 
     private void checkOpen() {
         if (streamHandle == -1) {
diff --git a/luni/src/main/java/java/util/zip/InflaterInputStream.java b/luni/src/main/java/java/util/zip/InflaterInputStream.java
index 35a3d9d..580d605 100644
--- a/luni/src/main/java/java/util/zip/InflaterInputStream.java
+++ b/luni/src/main/java/java/util/zip/InflaterInputStream.java
@@ -62,7 +62,7 @@
 
     static final int BUF_SIZE = 512;
 
-    int nativeEndBufSize = 0; // android-only
+    int nativeEndBufSize = 0;
 
     /**
      * This is the most basic constructor. You only need to pass the {@code
@@ -110,13 +110,11 @@
             throw new IllegalArgumentException();
         }
         this.inf = inflater;
-        // BEGIN android-only
         if (is instanceof ZipFile.RAFStream) {
             nativeEndBufSize = bsize;
         } else {
             buf = new byte[bsize];
         }
-        // END android-only
     }
 
     /**
@@ -126,13 +124,8 @@
      * @throws IOException
      *             if an error occurs reading the byte.
      */
-    @Override
-    public int read() throws IOException {
-        byte[] b = new byte[1];
-        if (read(b, 0, 1) == -1) {
-            return -1;
-        }
-        return b[0] & 0xff;
+    @Override public int read() throws IOException {
+        return Streams.readSingleByte(this);
     }
 
     /**
@@ -193,7 +186,6 @@
      */
     protected void fill() throws IOException {
         checkClosed();
-        // BEGIN android-only
         if (nativeEndBufSize > 0) {
             ZipFile.RAFStream is = (ZipFile.RAFStream)in;
             synchronized (is.mSharedRaf) {
@@ -207,7 +199,6 @@
                 inf.setInput(buf, 0, len);
             }
         }
-        // END android-only
     }
 
     /**
diff --git a/luni/src/main/java/java/util/zip/ZipException.java b/luni/src/main/java/java/util/zip/ZipException.java
index ad68714..b77943e 100644
--- a/luni/src/main/java/java/util/zip/ZipException.java
+++ b/luni/src/main/java/java/util/zip/ZipException.java
@@ -34,7 +34,6 @@
      * Constructs a new {@code ZipException} instance.
      */
     public ZipException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/java/util/zip/ZipFile.java b/luni/src/main/java/java/util/zip/ZipFile.java
index 06be579..e576d85 100644
--- a/luni/src/main/java/java/util/zip/ZipFile.java
+++ b/luni/src/main/java/java/util/zip/ZipFile.java
@@ -26,13 +26,12 @@
 import java.io.InputStream;
 import java.io.RandomAccessFile;
 import java.nio.ByteOrder;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.Enumeration;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import libcore.io.BufferIterator;
 import libcore.io.HeapBufferIterator;
+import libcore.io.Streams;
 
 /**
  * This class provides random read access to a <i>ZIP-archive</i> file.
@@ -60,7 +59,7 @@
      * versions of PKZIP recognize this bit for any
      * compression method.)
      */
-    static final int GPBF_DATA_DESCRIPTOR_FLAG = 1 << 3; // android-added
+    static final int GPBF_DATA_DESCRIPTOR_FLAG = 1 << 3;
 
     /**
      * General Purpose Bit Flags, Bit 11.
@@ -68,7 +67,7 @@
      * the filename and comment fields for this file
      * must be encoded using UTF-8.
      */
-    static final int GPBF_UTF8_FLAG = 1 << 11; // android-added
+    static final int GPBF_UTF8_FLAG = 1 << 11;
 
     /**
      * Open ZIP file for read.
@@ -122,14 +121,7 @@
             throw new IllegalArgumentException();
         }
 
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            security.checkRead(fileName);
-        }
         if ((mode & OPEN_DELETE) != 0) {
-            if (security != null) {
-                security.checkDelete(fileName);
-            }
             fileToDeleteOnClose = file; // file.deleteOnExit();
         } else {
             fileToDeleteOnClose = null;
@@ -183,13 +175,7 @@
                 raf.close();
             }
             if (fileToDeleteOnClose != null) {
-                AccessController.doPrivileged(new PrivilegedAction<Object>() {
-                    public Object run() {
-                        new File(fileName).delete();
-                        return null;
-                    }
-                });
-                // fileToDeleteOnClose.delete();
+                fileToDeleteOnClose.delete();
                 fileToDeleteOnClose = null;
             }
         }
@@ -401,23 +387,15 @@
             mLength = raf.length();
         }
 
-        @Override
-        public int available() throws IOException {
+        @Override public int available() throws IOException {
             return (mOffset < mLength ? 1 : 0);
         }
 
-        @Override
-        public int read() throws IOException {
-            byte[] singleByteBuf = new byte[1];
-            if (read(singleByteBuf, 0, 1) == 1) {
-                return singleByteBuf[0] & 0XFF;
-            } else {
-                return -1;
-            }
+        @Override public int read() throws IOException {
+            return Streams.readSingleByte(this);
         }
 
-        @Override
-        public int read(byte[] b, int off, int len) throws IOException {
+        @Override public int read(byte[] b, int off, int len) throws IOException {
             synchronized (mSharedRaf) {
                 mSharedRaf.seek(mOffset);
                 if (len > mLength - mOffset) {
diff --git a/luni/src/main/java/java/util/zip/ZipInputStream.java b/luni/src/main/java/java/util/zip/ZipInputStream.java
index 560a221..c9f25c0 100644
--- a/luni/src/main/java/java/util/zip/ZipInputStream.java
+++ b/luni/src/main/java/java/util/zip/ZipInputStream.java
@@ -25,8 +25,8 @@
 import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
 import java.util.Arrays;
+import libcore.io.Memory;
 import libcore.io.Streams;
-import org.apache.harmony.luni.platform.OSMemory;
 
 /**
  * This class provides an implementation of {@code FilterInputStream} that
@@ -195,14 +195,14 @@
 
     private void readAndVerifyDataDescriptor(int inB, int out) throws IOException {
         if (hasDD) {
-            in.read(hdrBuf, 0, EXTHDR);
-            int sig = OSMemory.peekInt(hdrBuf, 0, ByteOrder.LITTLE_ENDIAN);
+            Streams.readFully(in, hdrBuf, 0, EXTHDR);
+            int sig = Memory.peekInt(hdrBuf, 0, ByteOrder.LITTLE_ENDIAN);
             if (sig != (int) EXTSIG) {
                 throw new ZipException(String.format("unknown format (EXTSIG=%x)", sig));
             }
-            currentEntry.crc = ((long) OSMemory.peekInt(hdrBuf, EXTCRC, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
-            currentEntry.compressedSize = ((long) OSMemory.peekInt(hdrBuf, EXTSIZ, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
-            currentEntry.size = ((long) OSMemory.peekInt(hdrBuf, EXTLEN, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
+            currentEntry.crc = ((long) Memory.peekInt(hdrBuf, EXTCRC, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
+            currentEntry.compressedSize = ((long) Memory.peekInt(hdrBuf, EXTSIZ, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
+            currentEntry.size = ((long) Memory.peekInt(hdrBuf, EXTLEN, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
         }
         if (currentEntry.crc != crc.getValue()) {
             throw new ZipException("CRC mismatch");
@@ -228,7 +228,7 @@
         }
 
         Streams.readFully(in, hdrBuf, 0, 4);
-        int hdr = OSMemory.peekInt(hdrBuf, 0, ByteOrder.LITTLE_ENDIAN);
+        int hdr = Memory.peekInt(hdrBuf, 0, ByteOrder.LITTLE_ENDIAN);
         if (hdr == CENSIG) {
             entriesEnd = true;
             return null;
@@ -239,26 +239,26 @@
 
         // Read the local header
         Streams.readFully(in, hdrBuf, 0, (LOCHDR - LOCVER));
-        int version = OSMemory.peekShort(hdrBuf, 0, ByteOrder.LITTLE_ENDIAN) & 0xff;
+        int version = Memory.peekShort(hdrBuf, 0, ByteOrder.LITTLE_ENDIAN) & 0xff;
         if (version > ZIPLocalHeaderVersionNeeded) {
             throw new ZipException("Cannot read local header version " + version);
         }
-        short flags = OSMemory.peekShort(hdrBuf, LOCFLG - LOCVER, ByteOrder.LITTLE_ENDIAN);
+        short flags = Memory.peekShort(hdrBuf, LOCFLG - LOCVER, ByteOrder.LITTLE_ENDIAN);
         hasDD = ((flags & ZipFile.GPBF_DATA_DESCRIPTOR_FLAG) != 0);
-        int ceTime = OSMemory.peekShort(hdrBuf, LOCTIM - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
-        int ceModDate = OSMemory.peekShort(hdrBuf, LOCTIM - LOCVER + 2, ByteOrder.LITTLE_ENDIAN) & 0xffff;
-        int ceCompressionMethod = OSMemory.peekShort(hdrBuf, LOCHOW - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
+        int ceTime = Memory.peekShort(hdrBuf, LOCTIM - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
+        int ceModDate = Memory.peekShort(hdrBuf, LOCTIM - LOCVER + 2, ByteOrder.LITTLE_ENDIAN) & 0xffff;
+        int ceCompressionMethod = Memory.peekShort(hdrBuf, LOCHOW - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
         long ceCrc = 0, ceCompressedSize = 0, ceSize = -1;
         if (!hasDD) {
-            ceCrc = ((long) OSMemory.peekInt(hdrBuf, LOCCRC - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
-            ceCompressedSize = ((long) OSMemory.peekInt(hdrBuf, LOCSIZ - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
-            ceSize = ((long) OSMemory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
+            ceCrc = ((long) Memory.peekInt(hdrBuf, LOCCRC - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
+            ceCompressedSize = ((long) Memory.peekInt(hdrBuf, LOCSIZ - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
+            ceSize = ((long) Memory.peekInt(hdrBuf, LOCLEN - LOCVER, ByteOrder.LITTLE_ENDIAN)) & 0xffffffffL;
         }
-        int nameLength = OSMemory.peekShort(hdrBuf, LOCNAM - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
+        int nameLength = Memory.peekShort(hdrBuf, LOCNAM - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
         if (nameLength == 0) {
             throw new ZipException("Entry is not named");
         }
-        int extraLength = OSMemory.peekShort(hdrBuf, LOCEXT - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
+        int extraLength = Memory.peekShort(hdrBuf, LOCEXT - LOCVER, ByteOrder.LITTLE_ENDIAN) & 0xffff;
 
         if (nameLength > nameBuf.length) {
             nameBuf = new byte[nameLength];
diff --git a/luni/src/main/java/java/util/zip/ZipOutputStream.java b/luni/src/main/java/java/util/zip/ZipOutputStream.java
index 55a52bf..f0c79b2 100644
--- a/luni/src/main/java/java/util/zip/ZipOutputStream.java
+++ b/luni/src/main/java/java/util/zip/ZipOutputStream.java
@@ -21,8 +21,8 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.nio.charset.Charsets;
+import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Vector;
 
 /**
  * This class provides an implementation of {@code FilterOutputStream} that
@@ -78,7 +78,7 @@
 
     private String comment;
 
-    private final Vector<String> entries = new Vector<String>();
+    private final ArrayList<String> entries = new ArrayList<String>();
 
     private int compressMethod = DEFLATED;
 
@@ -223,7 +223,7 @@
         if (cDir == null) {
             return;
         }
-        if (entries.size() == 0) {
+        if (entries.isEmpty()) {
             throw new ZipException("No entries");
         }
         if (currentEntry != null) {
@@ -292,7 +292,7 @@
         if (currentEntry.getMethod() == -1) {
             currentEntry.setMethod(compressMethod);
         }
-        // BEGIN android-changed
+
         // Local file header.
         // http://www.pkware.com/documents/casestudies/APPNOTE.TXT
         int flags = currentEntry.getMethod() == STORED ? 0 : ZipFile.GPBF_DATA_DESCRIPTOR_FLAG;
@@ -308,7 +308,6 @@
         }
         writeShort(out, currentEntry.time);
         writeShort(out, currentEntry.modDate);
-        // END android-changed
 
         if (currentEntry.getMethod() == STORED) {
             if (currentEntry.size == -1) {
diff --git a/luni/src/main/java/javax/crypto/Cipher.java b/luni/src/main/java/javax/crypto/Cipher.java
index aaf6b35..af4d013 100644
--- a/luni/src/main/java/javax/crypto/Cipher.java
+++ b/luni/src/main/java/javax/crypto/Cipher.java
@@ -32,7 +32,6 @@
 import java.security.cert.X509Certificate;
 import java.security.spec.AlgorithmParameterSpec;
 import java.util.Set;
-import java.util.StringTokenizer;
 import org.apache.harmony.crypto.internal.NullCipherSpi;
 import org.apache.harmony.security.fortress.Engine;
 
@@ -124,7 +123,7 @@
      */
     private String transformation;
 
-    private static SecureRandom sec_rand;
+    private static SecureRandom secureRandom;
 
     /**
      * Creates a new Cipher instance.
@@ -327,31 +326,33 @@
         return c;
     }
 
-    private static String[] checkTransformation(String transformation)
-            throws NoSuchAlgorithmException {
-        String[] transf = { null, null, null };
-        StringTokenizer st;
-        int i = 0;
-        for (st = new StringTokenizer(transformation, "/"); st.hasMoreElements();) {
-            if (i > 2) {
-                throw invalidTransformation(transformation);
-            }
-            transf[i] = st.nextToken();
-            if (transf[i] != null) {
-                transf[i] = transf[i].trim();
-                if (transf[i].isEmpty()) {
-                    transf[i] = null;
-                }
-                i++;
-            }
+    private static String[] checkTransformation(String transformation) throws NoSuchAlgorithmException {
+        // ignore an extra prefix / characters such as in
+        // "/DES/CBC/PKCS5Paddin" http://b/3387688
+        if (transformation.startsWith("/")) {
+            transformation = transformation.substring(1);
         }
-        if (transf[0] == null) {
+        // 'transformation' should be of the form "algorithm/mode/padding".
+        String[] pieces = transformation.split("/");
+        if (pieces.length > 3) {
             throw invalidTransformation(transformation);
         }
-        if (!(transf[1] == null && transf[2] == null) && (transf[1] == null || transf[2] == null)) {
+        // Empty or missing pieces are represented by null.
+        String[] result = new String[3];
+        for (int i = 0; i < pieces.length; ++i) {
+            String piece = pieces[i].trim();
+            if (!piece.isEmpty()) {
+                result[i] = piece;
+            }
+        }
+        // You MUST specify an algorithm.
+        if (result[0] == null) {
             throw invalidTransformation(transformation);
         }
-        return transf;
+        if (!(result[1] == null && result[2] == null) && (result[1] == null || result[2] == null)) {
+            throw invalidTransformation(transformation);
+        }
+        return result;
     }
 
     /**
@@ -469,13 +470,13 @@
      *             cipher instance.
      */
     public final void init(int opmode, Key key) throws InvalidKeyException {
-        if (sec_rand == null) {
+        if (secureRandom == null) {
             // In theory it might be thread-unsafe but in the given case it's OK
             // since it does not matter which SecureRandom instance is passed
             // to the init()
-            sec_rand = new SecureRandom();
+            secureRandom = new SecureRandom();
         }
-        init(opmode, key, sec_rand);
+        init(opmode, key, secureRandom);
     }
 
     /**
@@ -559,10 +560,10 @@
      */
     public final void init(int opmode, Key key, AlgorithmParameterSpec params)
             throws InvalidKeyException, InvalidAlgorithmParameterException {
-        if (sec_rand == null) {
-            sec_rand = new SecureRandom();
+        if (secureRandom == null) {
+            secureRandom = new SecureRandom();
         }
-        init(opmode, key, params, sec_rand);
+        init(opmode, key, params, secureRandom);
     }
 
     /**
@@ -651,10 +652,10 @@
      */
     public final void init(int opmode, Key key, AlgorithmParameters params)
             throws InvalidKeyException, InvalidAlgorithmParameterException {
-        if (sec_rand == null) {
-            sec_rand = new SecureRandom();
+        if (secureRandom == null) {
+            secureRandom = new SecureRandom();
         }
-        init(opmode, key, params, sec_rand);
+        init(opmode, key, params, secureRandom);
     }
 
     /**
@@ -741,10 +742,10 @@
      */
     public final void init(int opmode, Certificate certificate)
             throws InvalidKeyException {
-        if (sec_rand == null) {
-            sec_rand = new SecureRandom();
+        if (secureRandom == null) {
+            secureRandom = new SecureRandom();
         }
-        init(opmode, certificate, sec_rand);
+        init(opmode, certificate, secureRandom);
     }
 
     /**
diff --git a/luni/src/main/java/javax/crypto/CipherInputStream.java b/luni/src/main/java/javax/crypto/CipherInputStream.java
index 8ad0b84..4de37db 100644
--- a/luni/src/main/java/javax/crypto/CipherInputStream.java
+++ b/luni/src/main/java/javax/crypto/CipherInputStream.java
@@ -35,11 +35,12 @@
  */
 public class CipherInputStream extends FilterInputStream {
 
+    private static final int I_BUFFER_SIZE = 20;
+
     private final Cipher cipher;
-    private final int I_BUFFER_SIZE = 20;
-    private final byte[] i_buffer = new byte[I_BUFFER_SIZE];
-    private int index; // index of the bytes to return from o_buffer
-    private byte[] o_buffer;
+    private final byte[] inputBuffer = new byte[I_BUFFER_SIZE];
+    private int index; // index of the bytes to return from outputBuffer
+    private byte[] outputBuffer;
     private boolean finished;
 
     /**
@@ -83,60 +84,38 @@
     @Override
     public int read() throws IOException {
         if (finished) {
-            return ((o_buffer == null) || (index == o_buffer.length))
+            return ((outputBuffer == null) || (index == outputBuffer.length))
                             ? -1
-                            : o_buffer[index++] & 0xFF;
+                            : outputBuffer[index++] & 0xFF;
         }
-        if ((o_buffer != null) && (index < o_buffer.length)) {
-            return o_buffer[index++] & 0xFF;
+        if ((outputBuffer != null) && (index < outputBuffer.length)) {
+            return outputBuffer[index++] & 0xFF;
         }
         index = 0;
-        o_buffer = null;
-        int num_read;
-        while (o_buffer == null) {
-            if ((num_read = in.read(i_buffer)) == -1) {
+        outputBuffer = null;
+        int byteCount;
+        while (outputBuffer == null) {
+            if ((byteCount = in.read(inputBuffer)) == -1) {
                 try {
-                    o_buffer = cipher.doFinal();
+                    outputBuffer = cipher.doFinal();
                 } catch (Exception e) {
                     throw new IOException(e.getMessage());
                 }
                 finished = true;
                 break;
             }
-            o_buffer = cipher.update(i_buffer, 0, num_read);
+            outputBuffer = cipher.update(inputBuffer, 0, byteCount);
         }
         return read();
     }
 
     /**
-     * Reads the next {@code b.length} bytes from this input stream into buffer
-     * {@code b}.
-     *
-     * @param b
-     *            the buffer to be filled with data.
-     * @return the number of bytes filled into buffer {@code b}, or {@code -1}
-     *         if the end of the stream is reached.
-     * @throws IOException
-     *             if an error occurs.
-     */
-    @Override
-    public int read(byte[] b) throws IOException {
-        return read(b, 0, b.length);
-    }
-
-    /**
      * Reads the next {@code len} bytes from this input stream into buffer
-     * {@code b} starting at offset {@code off}.
+     * {@code buf} starting at offset {@code off}.
      * <p>
      * if {@code b} is {@code null}, the next {@code len} bytes are read and
      * discarded.
      *
-     * @param b
-     *            the buffer to be filled with data.
-     * @param off
-     *            the offset to start in the buffer.
-     * @param len
-     *            the maximum number of bytes to read.
      * @return the number of bytes filled into buffer {@code b}, or {@code -1}
      *         of the of the stream is reached.
      * @throws IOException
@@ -145,19 +124,19 @@
      *             if the underlying input stream is {@code null}.
      */
     @Override
-    public int read(byte[] b, int off, int len) throws IOException {
+    public int read(byte[] buf, int off, int len) throws IOException {
         if (in == null) {
             throw new NullPointerException("Underlying input stream is null");
         }
 
-        int read_b;
         int i;
-        for (i=0; i<len; i++) {
-            if ((read_b = read()) == -1) {
+        for (i = 0; i < len; ++i) {
+            int b = read();
+            if (b == -1) {
                 return (i == 0) ? -1 : i;
             }
-            if (b != null) {
-                b[off+i] = (byte) read_b;
+            if (buf != null) {
+                buf[off+i] = (byte) b;
             }
         }
         return i;
diff --git a/luni/src/main/java/javax/crypto/CipherOutputStream.java b/luni/src/main/java/javax/crypto/CipherOutputStream.java
index da0ba65..11f6429 100644
--- a/luni/src/main/java/javax/crypto/CipherOutputStream.java
+++ b/luni/src/main/java/javax/crypto/CipherOutputStream.java
@@ -20,6 +20,7 @@
 import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.OutputStream;
+import libcore.io.Streams;
 
 /**
  * This class wraps an output stream and a cipher so that {@code write} methods
@@ -34,7 +35,6 @@
 public class CipherOutputStream extends FilterOutputStream {
 
     private final Cipher cipher;
-    private final byte[] arr = new byte[1];
 
     /**
      * Creates a new {@code CipherOutputStream} instance for an {@code
@@ -71,27 +71,8 @@
      * @throws IOException
      *             if an error occurs.
      */
-    @Override
-    public void write(int b) throws IOException {
-        byte[] result;
-        arr[0] = (byte) b;
-        result = cipher.update(arr);
-        if (result != null) {
-            out.write(result);
-        }
-    }
-
-    /**
-     * Writes the buffer of bytes to this cipher output stream.
-     *
-     * @param b
-     *            the buffer of bytes.
-     * @throws IOException
-     *             if an error occurs.
-     */
-    @Override
-    public void write(byte[] b) throws IOException {
-        write(b, 0, b.length);
+    @Override public void write(int b) throws IOException {
+        Streams.writeSingleByte(this, b);
     }
 
     /**
@@ -107,8 +88,7 @@
      * @throws IOException
      *             if an error occurs.
      */
-    @Override
-    public void write(byte[] b, int off, int len) throws IOException {
+    @Override public void write(byte[] b, int off, int len) throws IOException {
         if (len == 0) {
             return;
         }
@@ -163,4 +143,3 @@
         }
     }
 }
-
diff --git a/luni/src/main/java/javax/crypto/SealedObject.java b/luni/src/main/java/javax/crypto/SealedObject.java
index c6f8221..c9c1534 100644
--- a/luni/src/main/java/javax/crypto/SealedObject.java
+++ b/luni/src/main/java/javax/crypto/SealedObject.java
@@ -146,11 +146,9 @@
     public final Object getObject(Key key)
                 throws IOException, ClassNotFoundException,
                        NoSuchAlgorithmException, InvalidKeyException {
-        // BEGIN android-added
         if (key == null) {
             throw new InvalidKeyException("key == null");
         }
-        // END android-added
         try {
             Cipher cipher = Cipher.getInstance(sealAlg);
             if ((paramsAlg != null) && (paramsAlg.length() != 0)) {
diff --git a/luni/src/main/java/javax/crypto/spec/SecretKeySpec.java b/luni/src/main/java/javax/crypto/spec/SecretKeySpec.java
index 99701ff..1868917 100644
--- a/luni/src/main/java/javax/crypto/spec/SecretKeySpec.java
+++ b/luni/src/main/java/javax/crypto/spec/SecretKeySpec.java
@@ -41,7 +41,6 @@
 
     private final byte[] key;
     private final String algorithm;
-    private final String format = "RAW";
 
     /**
      * Creates a new <code>SecretKeySpec</code> for the specified key data and
@@ -98,11 +97,9 @@
         if (key.length == 0) {
             throw new IllegalArgumentException("key.length == 0");
         }
-        // BEGIN android-changed
         if (len < 0 || offset < 0) {
             throw new ArrayIndexOutOfBoundsException("len < 0 || offset < 0");
         }
-        // END android-changed
         if (key.length - offset < len) {
             throw new IllegalArgumentException("key too short");
         }
@@ -129,7 +126,7 @@
      * @return the format name "RAW".
      */
     public String getFormat() {
-        return format;
+        return "RAW";
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/DefaultSocketFactory.java b/luni/src/main/java/javax/net/DefaultSocketFactory.java
index 010c720..4d28d37 100644
--- a/luni/src/main/java/javax/net/DefaultSocketFactory.java
+++ b/luni/src/main/java/javax/net/DefaultSocketFactory.java
@@ -28,7 +28,6 @@
 final class DefaultSocketFactory extends SocketFactory {
 
     DefaultSocketFactory() {
-        super();
     }
 
     @Override
diff --git a/luni/src/main/java/javax/net/ServerSocketFactory.java b/luni/src/main/java/javax/net/ServerSocketFactory.java
index 15ab773..7f9dacb 100644
--- a/luni/src/main/java/javax/net/ServerSocketFactory.java
+++ b/luni/src/main/java/javax/net/ServerSocketFactory.java
@@ -46,7 +46,6 @@
      * Creates a new {@code ServerSocketFactory} instance.
      */
     protected ServerSocketFactory() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/SocketFactory.java b/luni/src/main/java/javax/net/SocketFactory.java
index eb0cfcb..cfdde41 100644
--- a/luni/src/main/java/javax/net/SocketFactory.java
+++ b/luni/src/main/java/javax/net/SocketFactory.java
@@ -48,7 +48,6 @@
      * Creates a new {@code SocketFactory} instance.
      */
     protected SocketFactory() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/DefaultHostnameVerifier.java b/luni/src/main/java/javax/net/ssl/DefaultHostnameVerifier.java
index dc17202..2fed280 100644
--- a/luni/src/main/java/javax/net/ssl/DefaultHostnameVerifier.java
+++ b/luni/src/main/java/javax/net/ssl/DefaultHostnameVerifier.java
@@ -27,9 +27,6 @@
 import java.util.Collections;
 import java.util.List;
 import java.util.Locale;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 
 /**
  * A HostnameVerifier that works the same way as Curl and Firefox.
@@ -51,7 +48,7 @@
      * Looks like we're the only implementation guarding against this.
      * Firefox, Curl, Sun Java 1.4, 5, 6 don't bother with this check.
      */
-    private final static String[] BAD_COUNTRY_2LDS =
+    private static final String[] BAD_COUNTRY_2LDS =
           { "ac", "co", "com", "ed", "edu", "go", "gouv", "gov", "info",
             "lg", "ne", "net", "or", "org" };
 
@@ -159,12 +156,10 @@
          * I tested it with "&#x82b1;&#x5b50;.co.jp" and it worked fine.
          */
         String subjectPrincipal = cert.getSubjectX500Principal().toString();
-        StringTokenizer st = new StringTokenizer(subjectPrincipal, ",");
-        while (st.hasMoreTokens()) {
-            String tok = st.nextToken();
-            int x = tok.indexOf("CN=");
+        for (String token : subjectPrincipal.split(",")) {
+            int x = token.indexOf("CN=");
             if (x >= 0) {
-                return tok.substring(x + 3);
+                return token.substring(x + 3);
             }
         }
         return null;
@@ -185,11 +180,10 @@
         try {
             subjectAlternativeNames = cert.getSubjectAlternativeNames();
         } catch (CertificateParsingException cpe) {
-            Logger.getLogger(DefaultHostnameVerifier.class.getName())
-                    .log(Level.FINE, "Error parsing certificate.", cpe);
+            System.logI("Error parsing certificate", cpe);
             return Collections.emptyList();
         }
-        
+
         if (subjectAlternativeNames == null) {
             return Collections.emptyList();
         }
diff --git a/luni/src/main/java/javax/net/ssl/KeyManagerFactory.java b/luni/src/main/java/javax/net/ssl/KeyManagerFactory.java
index c5c9196..82ce8a1 100644
--- a/luni/src/main/java/javax/net/ssl/KeyManagerFactory.java
+++ b/luni/src/main/java/javax/net/ssl/KeyManagerFactory.java
@@ -17,13 +17,11 @@
 
 package javax.net.ssl;
 
-import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
-import java.security.PrivilegedAction;
 import java.security.Provider;
 import java.security.Security;
 import java.security.UnrecoverableKeyException;
@@ -51,11 +49,7 @@
      * @return the default algorithm name.
      */
     public static final String getDefaultAlgorithm() {
-        return AccessController.doPrivileged(new PrivilegedAction<String>() {
-            public String run() {
-                return Security.getProperty(PROPERTY_NAME);
-            }
-        });
+        return Security.getProperty(PROPERTY_NAME);
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java b/luni/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java
index cc66d9b..a56c99c 100644
--- a/luni/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java
+++ b/luni/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java
@@ -33,7 +33,6 @@
      * Creates a new {@code KeyManagerFactorySpi} instance.
      */
     public KeyManagerFactorySpi() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/SSLContextSpi.java b/luni/src/main/java/javax/net/ssl/SSLContextSpi.java
index c619920..ee2e73e 100644
--- a/luni/src/main/java/javax/net/ssl/SSLContextSpi.java
+++ b/luni/src/main/java/javax/net/ssl/SSLContextSpi.java
@@ -30,7 +30,6 @@
      * Creates a new {@code SSLContextSpi} instance.
      */
     public SSLContextSpi() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/SSLEngine.java b/luni/src/main/java/javax/net/ssl/SSLEngine.java
index f737e98..a6c9946 100644
--- a/luni/src/main/java/javax/net/ssl/SSLEngine.java
+++ b/luni/src/main/java/javax/net/ssl/SSLEngine.java
@@ -34,7 +34,6 @@
      * Creates a new {@code SSLEngine} instance.
      */
     protected SSLEngine() {
-        super();
         peerHost = null;
         peerPort = -1;
     }
@@ -49,7 +48,6 @@
      *            the port of the host.
      */
     protected SSLEngine(String host, int port) {
-        super();
         this.peerHost = host;
         this.peerPort = port;
     }
diff --git a/luni/src/main/java/javax/net/ssl/SSLServerSocket.java b/luni/src/main/java/javax/net/ssl/SSLServerSocket.java
index 8bd8918..0109170 100644
--- a/luni/src/main/java/javax/net/ssl/SSLServerSocket.java
+++ b/luni/src/main/java/javax/net/ssl/SSLServerSocket.java
@@ -36,7 +36,6 @@
      *             if creating the socket fails.
      */
     protected SSLServerSocket() throws IOException {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/SSLServerSocketFactory.java b/luni/src/main/java/javax/net/ssl/SSLServerSocketFactory.java
index e8a7071..cce72cd 100644
--- a/luni/src/main/java/javax/net/ssl/SSLServerSocketFactory.java
+++ b/luni/src/main/java/javax/net/ssl/SSLServerSocketFactory.java
@@ -17,9 +17,7 @@
 
 package javax.net.ssl;
 
-import java.security.AccessController;
 import java.security.NoSuchAlgorithmException;
-import java.security.PrivilegedAction;
 import java.security.Security;
 import javax.net.ServerSocketFactory;
 
@@ -46,23 +44,18 @@
             return defaultServerSocketFactory;
         }
         if (defaultName == null) {
-            AccessController.doPrivileged(new PrivilegedAction<Void>() {
-                public Void run() {
-                    defaultName = Security.getProperty("ssl.ServerSocketFactory.provider");
-                    if (defaultName != null) {
-                        ClassLoader cl = Thread.currentThread().getContextClassLoader();
-                        if (cl == null) {
-                            cl = ClassLoader.getSystemClassLoader();
-                        }
-                        try {
-                            final Class<?> ssfc = Class.forName(defaultName, true, cl);
-                            defaultServerSocketFactory = (ServerSocketFactory) ssfc.newInstance();
-                        } catch (Exception e) {
-                        }
-                    }
-                    return null;
+            defaultName = Security.getProperty("ssl.ServerSocketFactory.provider");
+            if (defaultName != null) {
+                ClassLoader cl = Thread.currentThread().getContextClassLoader();
+                if (cl == null) {
+                    cl = ClassLoader.getSystemClassLoader();
                 }
-            });
+                try {
+                    final Class<?> ssfc = Class.forName(defaultName, true, cl);
+                    defaultServerSocketFactory = (ServerSocketFactory) ssfc.newInstance();
+                } catch (Exception e) {
+                }
+            }
         }
         if (defaultServerSocketFactory == null) {
             SSLContext context;
@@ -87,7 +80,6 @@
      * Creates a new {@code SSLServerSocketFactory} instance.
      */
     protected SSLServerSocketFactory() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/SSLSession.java b/luni/src/main/java/javax/net/ssl/SSLSession.java
index 14a312a..c4ca0a6 100644
--- a/luni/src/main/java/javax/net/ssl/SSLSession.java
+++ b/luni/src/main/java/javax/net/ssl/SSLSession.java
@@ -150,13 +150,7 @@
     public String getProtocol();
 
     /**
-     * Returns the context of this session. If a context is available and a
-     * security manager is installed, the
-     * {@code SSLPermission("getSSLSessionContext"} is checked with the security
-     * manager.
-     *
-     * @return the context of this session or {@code null} if no context is
-     *         available.
+     * Returns the context of this session, or null if no context is available.
      */
     public SSLSessionContext getSessionContext();
 
diff --git a/luni/src/main/java/javax/net/ssl/SSLSocket.java b/luni/src/main/java/javax/net/ssl/SSLSocket.java
index 4539c3b..3de91b2 100644
--- a/luni/src/main/java/javax/net/ssl/SSLSocket.java
+++ b/luni/src/main/java/javax/net/ssl/SSLSocket.java
@@ -34,7 +34,6 @@
      * Creates a TCP socket.
      */
     protected SSLSocket() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/SSLSocketFactory.java b/luni/src/main/java/javax/net/ssl/SSLSocketFactory.java
index b31d4e2..b07d0fd 100644
--- a/luni/src/main/java/javax/net/ssl/SSLSocketFactory.java
+++ b/luni/src/main/java/javax/net/ssl/SSLSocketFactory.java
@@ -19,12 +19,8 @@
 
 import java.io.IOException;
 import java.net.Socket;
-import java.security.AccessController;
 import java.security.NoSuchAlgorithmException;
-import java.security.PrivilegedAction;
 import java.security.Security;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import javax.net.SocketFactory;
 
 /**
@@ -46,32 +42,22 @@
      */
     public static synchronized SocketFactory getDefault() {
         if (defaultSocketFactory != null) {
-            // BEGIN android-added
-            // log("SSLSocketFactory", "Using factory " + defaultSocketFactory, null);
-            // END android-added
             return defaultSocketFactory;
         }
         if (defaultName == null) {
-            AccessController.doPrivileged(new PrivilegedAction<Void>() {
-                public Void run() {
-                    defaultName = Security.getProperty("ssl.SocketFactory.provider");
-                    if (defaultName != null) {
-                        ClassLoader cl = Thread.currentThread().getContextClassLoader();
-                        if (cl == null) {
-                            cl = ClassLoader.getSystemClassLoader();
-                        }
-                        try {
-                            final Class<?> sfc = Class.forName(defaultName, true, cl);
-                            defaultSocketFactory = (SocketFactory) sfc.newInstance();
-                        } catch (Exception e) {
-                            // BEGIN android-added
-                            log("SSLSocketFactory", "Problem creating " + defaultName, e);
-                            // END android-added
-                        }
-                    }
-                    return null;
+            defaultName = Security.getProperty("ssl.SocketFactory.provider");
+            if (defaultName != null) {
+                ClassLoader cl = Thread.currentThread().getContextClassLoader();
+                if (cl == null) {
+                    cl = ClassLoader.getSystemClassLoader();
                 }
-            });
+                try {
+                    final Class<?> sfc = Class.forName(defaultName, true, cl);
+                    defaultSocketFactory = (SocketFactory) sfc.newInstance();
+                } catch (Exception e) {
+                    System.logE("Problem creating " + defaultName, e);
+                }
+            }
         }
 
         if (defaultSocketFactory == null) {
@@ -89,24 +75,13 @@
             // Use internal implementation
             defaultSocketFactory = new DefaultSSLSocketFactory("No SSLSocketFactory installed");
         }
-        // BEGIN android-added
-        // log("SSLSocketFactory", "Using factory " + defaultSocketFactory, null);
-        // END android-added
         return defaultSocketFactory;
     }
 
-    // BEGIN android-added
-    @SuppressWarnings("unchecked")
-    private static void log(String tag, String msg, Throwable throwable) {
-        Logger.getLogger(tag).log(Level.INFO, msg, throwable);
-    }
-    // END android-added
-
     /**
      * Creates a new {@code SSLSocketFactory}.
      */
     public SSLSocketFactory() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/TrustManagerFactory.java b/luni/src/main/java/javax/net/ssl/TrustManagerFactory.java
index 04633a4..fc692ca 100644
--- a/luni/src/main/java/javax/net/ssl/TrustManagerFactory.java
+++ b/luni/src/main/java/javax/net/ssl/TrustManagerFactory.java
@@ -17,13 +17,11 @@
 
 package javax.net.ssl;
 
-import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
-import java.security.PrivilegedAction;
 import java.security.Provider;
 import java.security.Security;
 import org.apache.harmony.security.fortress.Engine;
@@ -50,11 +48,7 @@
      * @return the default algorithm name.
      */
     public static final String getDefaultAlgorithm() {
-        return AccessController.doPrivileged(new PrivilegedAction<String>() {
-            public String run() {
-                return Security.getProperty(PROPERTYNAME);
-            }
-        });
+        return Security.getProperty(PROPERTYNAME);
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java b/luni/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java
index 1b04c5bb..70033e9 100644
--- a/luni/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java
+++ b/luni/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java
@@ -31,7 +31,6 @@
      * Creates a new {@code TrustManagerFactorySpi} instance.
      */
     public TrustManagerFactorySpi() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java b/luni/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java
index 3298d8e..5877f87 100644
--- a/luni/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java
+++ b/luni/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java
@@ -30,7 +30,6 @@
      * Creates a new {@code X509ExtendedKeyManager} instance.
      */
     protected X509ExtendedKeyManager() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/security/auth/DestroyFailedException.java b/luni/src/main/java/javax/security/auth/DestroyFailedException.java
index 27d4dfd..bb4c403 100644
--- a/luni/src/main/java/javax/security/auth/DestroyFailedException.java
+++ b/luni/src/main/java/javax/security/auth/DestroyFailedException.java
@@ -28,7 +28,6 @@
      * Creates an exception of type {@code DestroyFailedException}.
      */
     public DestroyFailedException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/security/auth/PrivateCredentialPermission.java b/luni/src/main/java/javax/security/auth/PrivateCredentialPermission.java
index 5a016e9..f86b2fa 100644
--- a/luni/src/main/java/javax/security/auth/PrivateCredentialPermission.java
+++ b/luni/src/main/java/javax/security/auth/PrivateCredentialPermission.java
@@ -342,7 +342,6 @@
 
         // Creates a new CredOwner with the specified Principal Class and Principal Name
         CredOwner(String principalClass, String principalName) {
-            super();
             if ("*".equals(principalClass)) {
                 isClassWildcard = true;
             }
@@ -382,9 +381,13 @@
 
         // Checks two CredOwner objects for equality.
         @Override
-        public boolean equals(Object obj) {
-            return principalClass.equals(((CredOwner) obj).principalClass)
-                    && principalName.equals(((CredOwner) obj).principalName);
+        public boolean equals(Object o) {
+            if (!(o instanceof CredOwner)) {
+                return false;
+            }
+            CredOwner lhs = (CredOwner) o;
+            return principalClass.equals(lhs.principalClass) &&
+                    principalName.equals(lhs.principalName);
         }
 
         // Returns the hash code value for this object.
diff --git a/luni/src/main/java/javax/security/auth/Subject.java b/luni/src/main/java/javax/security/auth/Subject.java
index ac0fab4..a958484 100644
--- a/luni/src/main/java/javax/security/auth/Subject.java
+++ b/luni/src/main/java/javax/security/auth/Subject.java
@@ -89,7 +89,6 @@
      * credentials and principals with the empty set.
      */
     public Subject() {
-        super();
         principals = new SecureSet<Principal>(_PRINCIPALS);
         publicCredentials = new SecureSet<Object>(_PUBLIC_CREDENTIALS);
         privateCredentials = new SecureSet<Object>(_PRIVATE_CREDENTIALS);
@@ -140,9 +139,6 @@
      */
     @SuppressWarnings("unchecked")
     public static <T> T doAs(Subject subject, PrivilegedAction<T> action) {
-
-        checkPermission(_AS);
-
         return doAs_PrivilegedAction(subject, action, AccessController.getContext());
     }
 
@@ -164,9 +160,6 @@
     @SuppressWarnings("unchecked")
     public static <T> T doAsPrivileged(Subject subject, PrivilegedAction<T> action,
             AccessControlContext context) {
-
-        checkPermission(_AS_PRIVILEGED);
-
         if (context == null) {
             return doAs_PrivilegedAction(subject, action, new AccessControlContext(
                     new ProtectionDomain[0]));
@@ -192,7 +185,6 @@
 
         PrivilegedAction dccAction = new PrivilegedAction() {
             public Object run() {
-
                 return new AccessControlContext(context, combiner);
             }
         };
@@ -217,9 +209,6 @@
     @SuppressWarnings("unchecked")
     public static <T> T doAs(Subject subject, PrivilegedExceptionAction<T> action)
             throws PrivilegedActionException {
-
-        checkPermission(_AS);
-
         return doAs_PrivilegedExceptionAction(subject, action, AccessController.getContext());
     }
 
@@ -244,9 +233,6 @@
     public static <T> T doAsPrivileged(Subject subject,
             PrivilegedExceptionAction<T> action, AccessControlContext context)
             throws PrivilegedActionException {
-
-        checkPermission(_AS_PRIVILEGED);
-
         if (context == null) {
             return doAs_PrivilegedExceptionAction(subject, action,
                     new AccessControlContext(new ProtectionDomain[0]));
@@ -406,8 +392,6 @@
      * works though.
      */
     public void setReadOnly() {
-        checkPermission(_READ_ONLY);
-
         readOnly = true;
     }
 
@@ -482,7 +466,6 @@
      *         context} provided as argument.
      */
     public static Subject getSubject(final AccessControlContext context) {
-        checkPermission(_SUBJECT);
         if (context == null) {
             throw new NullPointerException("AccessControlContext cannot be null");
         }
@@ -499,14 +482,6 @@
         return ((SubjectDomainCombiner) combiner).getSubject();
     }
 
-    // checks passed permission
-    private static void checkPermission(Permission p) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(p);
-        }
-    }
-
     private void checkState() {
         if (readOnly) {
             throw new IllegalStateException("Set is read-only");
@@ -596,7 +571,6 @@
             verifyElement(o);
 
             checkState();
-            checkPermission(permission);
 
             if (!elements.contains(o)) {
                 elements.add(o);
@@ -622,8 +596,6 @@
                     @Override
                     public SST next() {
                         SST obj = iterator.next();
-                        checkPermission(new PrivateCredentialPermission(obj
-                                .getClass().getName(), principals));
                         return obj;
                     }
                 };
@@ -727,8 +699,6 @@
         private void writeObject(ObjectOutputStream out) throws IOException {
 
             if (permission == _PRIVATE_CREDENTIALS) {
-                // iteration causes checkPermission to be called for each element
-                for (SST unused : this) {}
                 setType = SET_PrivCred;
             } else if (permission == _PRINCIPALS) {
                 setType = SET_Principal;
@@ -763,7 +733,6 @@
              */
             public void remove() {
                 checkState();
-                checkPermission(permission);
                 iterator.remove();
             }
         }
diff --git a/luni/src/main/java/javax/security/auth/SubjectDomainCombiner.java b/luni/src/main/java/javax/security/auth/SubjectDomainCombiner.java
index 7d990a1..7b36470 100644
--- a/luni/src/main/java/javax/security/auth/SubjectDomainCombiner.java
+++ b/luni/src/main/java/javax/security/auth/SubjectDomainCombiner.java
@@ -42,7 +42,6 @@
      *            the entity to which this domain combiner is associated.
      */
     public SubjectDomainCombiner(Subject subject) {
-        super();
         if (subject == null) {
             throw new NullPointerException();
         }
@@ -55,11 +54,6 @@
      * @return the entity to which this domain combiner is associated.
      */
     public Subject getSubject() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(_GET);
-        }
-
         return subject;
     }
 
diff --git a/luni/src/main/java/javax/security/auth/callback/PasswordCallback.java b/luni/src/main/java/javax/security/auth/callback/PasswordCallback.java
index 5f18c7e..13f833e 100644
--- a/luni/src/main/java/javax/security/auth/callback/PasswordCallback.java
+++ b/luni/src/main/java/javax/security/auth/callback/PasswordCallback.java
@@ -50,7 +50,6 @@
      *            determines whether the user input should be echoed
      */
     public PasswordCallback(String prompt, boolean echoOn) {
-        super();
         setPrompt(prompt);
         this.echoOn = echoOn;
     }
diff --git a/luni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java b/luni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java
index bee7bd3..4c5b5e4 100644
--- a/luni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java
+++ b/luni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java
@@ -35,7 +35,6 @@
      *            the {@code Callback}
      */
     public UnsupportedCallbackException(Callback callback) {
-        super();
         this.callback = callback;
     }
 
diff --git a/luni/src/main/java/javax/security/auth/login/LoginException.java b/luni/src/main/java/javax/security/auth/login/LoginException.java
index 9433c43..17ca2f5 100644
--- a/luni/src/main/java/javax/security/auth/login/LoginException.java
+++ b/luni/src/main/java/javax/security/auth/login/LoginException.java
@@ -30,7 +30,6 @@
      * Creates a new exception instance and initializes it with default values.
      */
     public LoginException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/security/auth/x500/X500Principal.java b/luni/src/main/java/javax/security/auth/x500/X500Principal.java
index 9e1fb9a..f13dd4f 100644
--- a/luni/src/main/java/javax/security/auth/x500/X500Principal.java
+++ b/luni/src/main/java/javax/security/auth/x500/X500Principal.java
@@ -223,7 +223,7 @@
         String rfc1779Name = dn.getName(RFC1779);
         String rfc2253Name = dn.getName(RFC2253);
 
-        if (format.toUpperCase().equals("RFC1779")) {
+        if (format.equalsIgnoreCase("RFC1779")) {
             StringBuilder resultName = new StringBuilder(rfc1779Name);
             int fromIndex = resultName.length();
             int equalIndex = -1;
@@ -243,7 +243,7 @@
                 fromIndex = commaIndex;
             }
             return resultName.toString();
-        } else if (format.toUpperCase().equals("RFC2253")) {
+        } else if (format.equalsIgnoreCase("RFC2253")) {
             StringBuilder resultName = new StringBuilder(rfc2253Name);
             StringBuilder subsidyName = new StringBuilder(rfc1779Name);
 
diff --git a/luni/src/main/java/javax/security/cert/X509Certificate.java b/luni/src/main/java/javax/security/cert/X509Certificate.java
index fe5b9f7..e85a556 100644
--- a/luni/src/main/java/javax/security/cert/X509Certificate.java
+++ b/luni/src/main/java/javax/security/cert/X509Certificate.java
@@ -21,7 +21,6 @@
 import java.io.InputStream;
 import java.lang.reflect.Constructor;
 import java.math.BigInteger;
-import java.security.AccessController;
 import java.security.InvalidKeyException;
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
@@ -47,19 +46,11 @@
 public abstract class X509Certificate extends Certificate {
 
     private static Constructor constructor;
-
     static {
         try {
-            String classname = (String) AccessController.doPrivileged(
-                new java.security.PrivilegedAction() {
-                    public Object run() {
-                        return Security.getProperty("cert.provider.x509v1");
-                    }
-                }
-            );
+            String classname = Security.getProperty("cert.provider.x509v1");
             Class cl = Class.forName(classname);
-            constructor =
-                cl.getConstructor(new Class[] {InputStream.class});
+            constructor = cl.getConstructor(new Class[] {InputStream.class});
         } catch (Throwable e) {
         }
     }
@@ -68,7 +59,6 @@
      * Creates a new {@code X509Certificate}.
      */
     public X509Certificate() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/xml/datatype/DatatypeConfigurationException.java b/luni/src/main/java/javax/xml/datatype/DatatypeConfigurationException.java
index 3be4265..f0d3fe5 100644
--- a/luni/src/main/java/javax/xml/datatype/DatatypeConfigurationException.java
+++ b/luni/src/main/java/javax/xml/datatype/DatatypeConfigurationException.java
@@ -50,7 +50,6 @@
      */
 
     public DatatypeConfigurationException() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java b/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java
index 3d5c575..6a89dae 100644
--- a/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java
+++ b/luni/src/main/java/javax/xml/datatype/DatatypeFactory.java
@@ -69,6 +69,7 @@
      *
      * <p>Default value is <code>org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl</code>.</p>
      */
+    // This uses "new String" to avoid being inlined as a constant.
     public static final String DATATYPEFACTORY_IMPLEMENTATION_CLASS = new String("org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl");
 
     /**
diff --git a/luni/src/main/java/javax/xml/datatype/FactoryFinder.java b/luni/src/main/java/javax/xml/datatype/FactoryFinder.java
index 9a6b29b..b65f412 100644
--- a/luni/src/main/java/javax/xml/datatype/FactoryFinder.java
+++ b/luni/src/main/java/javax/xml/datatype/FactoryFinder.java
@@ -21,6 +21,7 @@
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -29,7 +30,7 @@
 import libcore.io.IoUtils;
 
 /**
- * <p>Implement pluggabile Datatypes.</p>
+ * <p>Implement pluggable data types.</p>
  *
  * <p>This class is duplicated for each JAXP subpackage so keep it in
  * sync.  It is package private for secure class loading.</p>
@@ -40,29 +41,19 @@
  */
 final class FactoryFinder {
 
-    /**
-     * <p>Name of class to display in output messages.</p>
-     */
+    /** <p>Name of class to display in output messages.</p> */
     private static final String CLASS_NAME = "javax.xml.datatype.FactoryFinder";
 
-    /**
-     * <p>Debug flag to trace loading process.</p>
-     */
+    /** <p>Debug flag to trace loading process.</p> */
     private static boolean debug = false;
 
-    /**
-     * <p>Cache properties for performance.</p>
-     */
+    /** <p>Cache properties for performance.</p> */
     private static Properties cacheProps = new Properties();
 
-    /**
-     * <p>First time requires initialization overhead.</p>
-     */
+    /** <p>First time requires initialization overhead.</p> */
     private static boolean firstTime = true;
 
-    /**
-     * Default columns per line.
-     */
+    /** Default columns per line. */
     private static final int DEFAULT_LINE_LENGTH = 80;
 
     /**
@@ -70,16 +61,11 @@
      *
      * <p>Use try/catch block to support applets, which throws
      * SecurityException out of this code.</p>
-     *
      */
     static {
-        try {
-            String val = SecuritySupport.getSystemProperty("jaxp.debug");
-            // Allow simply setting the prop to turn on debug
-            debug = val != null && (! "false".equals(val));
-        } catch (Exception x) {
-            debug = false;
-        }
+        String val = System.getProperty("jaxp.debug");
+        // Allow simply setting the prop to turn on debug
+        debug = val != null && (! "false".equals(val));
     }
 
     private FactoryFinder() {}
@@ -101,20 +87,17 @@
     /**
      * <p>Find the appropriate <code>ClassLoader</code> to use.</p>
      *
-     * <p>The context ClassLoader is prefered.</p>
+     * <p>The context ClassLoader is preferred.</p>
      *
      * @return <code>ClassLoader</code> to use.
      *
      * @throws ConfigurationError If a valid <code>ClassLoader</code> cannot be identified.
      */
-    private static ClassLoader findClassLoader()
-        throws ConfigurationError {
-        ClassLoader classLoader;
-
+    private static ClassLoader findClassLoader() throws ConfigurationError {
         // Figure out which ClassLoader to use for loading the provider
         // class.  If there is a Context ClassLoader then use it.
 
-        classLoader = SecuritySupport.getContextClassLoader();
+        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
 
         if (debug) debugPrintln(
             "Using context class loader: "
@@ -165,8 +148,7 @@
                 "Provider " + className + " not found", x);
         } catch (Exception x) {
             throw new ConfigurationError(
-                "Provider " + className + " could not be instantiated: " + x,
-                x);
+                "Provider " + className + " could not be instantiated: " + x, x);
         }
     }
 
@@ -182,25 +164,20 @@
      *
      * @throws ConfigurationError If Class cannot be found.
      */
-    static Object find(String factoryId, String fallbackClassName)
-        throws ConfigurationError {
+    static Object find(String factoryId, String fallbackClassName) throws ConfigurationError {
 
         ClassLoader classLoader = findClassLoader();
 
         // Use the system property first
-        try {
-            String systemProp = SecuritySupport.getSystemProperty(factoryId);
-            if (systemProp != null && systemProp.length() > 0) {
-                if (debug) debugPrintln("found " + systemProp + " in the system property " + factoryId);
-                return newInstance(systemProp, classLoader);
-            }
-        } catch (SecurityException se) {
-            ; // NOP, explicitly ignore SecurityException
+        String systemProp = System.getProperty(factoryId);
+        if (systemProp != null && systemProp.length() > 0) {
+            if (debug) debugPrintln("found " + systemProp + " in the system property " + factoryId);
+            return newInstance(systemProp, classLoader);
         }
 
         // try to read from $java.home/lib/jaxp.properties
         try {
-            String javah = SecuritySupport.getSystemProperty("java.home");
+            String javah = System.getProperty("java.home");
             String configFile = javah + File.separator + "lib" + File.separator + "jaxp.properties";
             String factoryClassName = null;
             if (firstTime) {
@@ -208,9 +185,9 @@
                     if (firstTime) {
                         File f = new File(configFile);
                         firstTime = false;
-                        if (SecuritySupport.doesFileExist(f)) {
+                        if (f.exists()) {
                             if (debug) debugPrintln("Read properties file " + f);
-                            cacheProps.load(SecuritySupport.getFileInputStream(f));
+                            cacheProps.load(new FileInputStream(f));
                         }
                     }
                 }
@@ -247,28 +224,19 @@
      *
      * @return instance of provider class if found or null
      */
-    private static Object findJarServiceProvider(String factoryId)
-        throws ConfigurationError
-    {
-
+    private static Object findJarServiceProvider(String factoryId) throws ConfigurationError {
         String serviceId = "META-INF/services/" + factoryId;
         InputStream is = null;
 
         // First try the Context ClassLoader
-        ClassLoader cl = SecuritySupport.getContextClassLoader();
+        ClassLoader cl = Thread.currentThread().getContextClassLoader();
         if (cl != null) {
-            is = SecuritySupport.getResourceAsStream(cl, serviceId);
+            is = cl.getResourceAsStream(serviceId);
+        }
 
-            // If no provider found then try the current ClassLoader
-            if (is == null) {
-                cl = FactoryFinder.class.getClassLoader();
-                is = SecuritySupport.getResourceAsStream(cl, serviceId);
-            }
-        } else {
-            // No Context ClassLoader, try the current
-            // ClassLoader
+        if (is == null) {
             cl = FactoryFinder.class.getClassLoader();
-            is = SecuritySupport.getResourceAsStream(cl, serviceId);
+            is = cl.getResourceAsStream(serviceId);
         }
 
         if (is == null) {
@@ -276,8 +244,7 @@
             return null;
         }
 
-        if (debug) debugPrintln("found jar resource=" + serviceId +
-               " using ClassLoader: " + cl);
+        if (debug) debugPrintln("found jar resource=" + serviceId + " using ClassLoader: " + cl);
 
         BufferedReader rd;
         try {
@@ -344,14 +311,8 @@
         }
     }
 
-
-
     /**
      * Returns the location where the given Class is loaded from.
-     *
-     * @param clazz Class to find load location.
-     *
-     * @return Location where class would be loaded from.
      */
     private static String which(Class clazz) {
         try {
diff --git a/luni/src/main/java/javax/xml/datatype/SecuritySupport.java b/luni/src/main/java/javax/xml/datatype/SecuritySupport.java
deleted file mode 100644
index 0de4e07..0000000
--- a/luni/src/main/java/javax/xml/datatype/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// $Id: SecuritySupport.java 446598 2006-09-15 12:55:40Z jeremias $
-
-package javax.xml.datatype;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport  {
-
-    private SecuritySupport() {}
-
-    static ClassLoader getContextClassLoader() {
-    return (ClassLoader)
-        AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-        ClassLoader cl = null;
-        try {
-            cl = Thread.currentThread().getContextClassLoader();
-        } catch (SecurityException ex) { }
-        return cl;
-        }
-    });
-    }
-
-    static String getSystemProperty(final String propName) {
-    return (String)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return System.getProperty(propName);
-                }
-            });
-    }
-
-    static FileInputStream getFileInputStream(final File file)
-        throws FileNotFoundException
-    {
-    try {
-            return (FileInputStream)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws FileNotFoundException {
-                        return new FileInputStream(file);
-                    }
-                });
-    } catch (PrivilegedActionException e) {
-        throw (FileNotFoundException)e.getException();
-    }
-    }
-
-    static InputStream getResourceAsStream(final ClassLoader cl,
-                                           final String name)
-    {
-        return (InputStream)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    InputStream ris;
-                    if (cl == null) {
-                        ris = ClassLoader.getSystemResourceAsStream(name);
-                    } else {
-                        ris = cl.getResourceAsStream(name);
-                    }
-                    return ris;
-                }
-            });
-    }
-
-    static boolean doesFileExist(final File f) {
-    return ((Boolean)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return f.exists() ? Boolean.TRUE : Boolean.FALSE;
-                }
-            })).booleanValue();
-    }
-
-}
diff --git a/luni/src/main/java/javax/xml/parsers/FactoryConfigurationError.java b/luni/src/main/java/javax/xml/parsers/FactoryConfigurationError.java
index 40d7fe5..745559a 100644
--- a/luni/src/main/java/javax/xml/parsers/FactoryConfigurationError.java
+++ b/luni/src/main/java/javax/xml/parsers/FactoryConfigurationError.java
@@ -42,7 +42,6 @@
      */
 
     public FactoryConfigurationError() {
-        super();
         this.exception = null;
     }
 
diff --git a/luni/src/main/java/javax/xml/parsers/ParserConfigurationException.java b/luni/src/main/java/javax/xml/parsers/ParserConfigurationException.java
index 8374b6e..6929ab7 100644
--- a/luni/src/main/java/javax/xml/parsers/ParserConfigurationException.java
+++ b/luni/src/main/java/javax/xml/parsers/ParserConfigurationException.java
@@ -35,7 +35,6 @@
      */
 
     public ParserConfigurationException() {
-        super();
     }
 
     /**
@@ -50,4 +49,3 @@
     }
 
 }
-
diff --git a/luni/src/main/java/javax/xml/parsers/SecuritySupport.java b/luni/src/main/java/javax/xml/parsers/SecuritySupport.java
deleted file mode 100644
index af46b7e..0000000
--- a/luni/src/main/java/javax/xml/parsers/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// $Id: SecuritySupport.java 670282 2008-06-22 01:00:42Z mrglavas $
-
-package javax.xml.parsers;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport  {
-
-    private SecuritySupport() {}
-
-    static ClassLoader getContextClassLoader() {
-    return (ClassLoader)
-        AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-        ClassLoader cl = null;
-        try {
-            cl = Thread.currentThread().getContextClassLoader();
-        } catch (SecurityException ex) { }
-        return cl;
-        }
-    });
-    }
-
-    static String getSystemProperty(final String propName) {
-    return (String)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return System.getProperty(propName);
-                }
-            });
-    }
-
-    static FileInputStream getFileInputStream(final File file)
-        throws FileNotFoundException
-    {
-    try {
-            return (FileInputStream)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws FileNotFoundException {
-                        return new FileInputStream(file);
-                    }
-                });
-    } catch (PrivilegedActionException e) {
-        throw (FileNotFoundException)e.getException();
-    }
-    }
-
-    static InputStream getResourceAsStream(final ClassLoader cl,
-                                           final String name)
-    {
-        return (InputStream)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    InputStream ris;
-                    if (cl == null) {
-                        ris = ClassLoader.getSystemResourceAsStream(name);
-                    } else {
-                        ris = cl.getResourceAsStream(name);
-                    }
-                    return ris;
-                }
-            });
-    }
-
-    static boolean doesFileExist(final File f) {
-    return ((Boolean)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return f.exists() ? Boolean.TRUE : Boolean.FALSE;
-                }
-            })).booleanValue();
-    }
-
-}
diff --git a/luni/src/main/java/javax/xml/transform/SecuritySupport.java b/luni/src/main/java/javax/xml/transform/SecuritySupport.java
deleted file mode 100644
index 120a958..0000000
--- a/luni/src/main/java/javax/xml/transform/SecuritySupport.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-// $Id: SecuritySupport.java 670282 2008-06-22 01:00:42Z mrglavas $
-
-package javax.xml.transform;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport  {
-
-    private SecuritySupport() {}
-
-    static ClassLoader getContextClassLoader() {
-    return (ClassLoader)
-        AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-        ClassLoader cl = null;
-        try {
-            cl = Thread.currentThread().getContextClassLoader();
-        } catch (SecurityException ex) { }
-        return cl;
-        }
-    });
-    }
-
-    static String getSystemProperty(final String propName) {
-    return (String)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return System.getProperty(propName);
-                }
-            });
-    }
-
-    static FileInputStream getFileInputStream(final File file)
-        throws FileNotFoundException
-    {
-    try {
-            return (FileInputStream)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws FileNotFoundException {
-                        return new FileInputStream(file);
-                    }
-                });
-    } catch (PrivilegedActionException e) {
-        throw (FileNotFoundException)e.getException();
-    }
-    }
-
-    static InputStream getResourceAsStream(final ClassLoader cl,
-                                           final String name)
-    {
-        return (InputStream)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    InputStream ris;
-                    if (cl == null) {
-                        ris = ClassLoader.getSystemResourceAsStream(name);
-                    } else {
-                        ris = cl.getResourceAsStream(name);
-                    }
-                    return ris;
-                }
-            });
-    }
-
-    static boolean doesFileExist(final File f) {
-    return ((Boolean)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return f.exists() ? Boolean.TRUE : Boolean.FALSE;
-                }
-            })).booleanValue();
-    }
-
-}
diff --git a/luni/src/main/java/javax/xml/transform/TransformerFactoryConfigurationError.java b/luni/src/main/java/javax/xml/transform/TransformerFactoryConfigurationError.java
index b738a7c..8a4fee6 100644
--- a/luni/src/main/java/javax/xml/transform/TransformerFactoryConfigurationError.java
+++ b/luni/src/main/java/javax/xml/transform/TransformerFactoryConfigurationError.java
@@ -38,9 +38,6 @@
      * detail message.
      */
     public TransformerFactoryConfigurationError() {
-
-        super();
-
         this.exception = null;
     }
 
diff --git a/luni/src/main/java/javax/xml/validation/SchemaFactory.java b/luni/src/main/java/javax/xml/validation/SchemaFactory.java
index 7d3a1f6..23e4798 100644
--- a/luni/src/main/java/javax/xml/validation/SchemaFactory.java
+++ b/luni/src/main/java/javax/xml/validation/SchemaFactory.java
@@ -179,7 +179,7 @@
      */
     public static SchemaFactory newInstance(String schemaLanguage) {
         ClassLoader cl;
-        cl = SecuritySupport.getContextClassLoader();
+        cl = Thread.currentThread().getContextClassLoader();
 
         if (cl == null) {
             //cl = ClassLoader.getSystemClassLoader();
@@ -312,7 +312,6 @@
      * @see #getFeature(String)
      */
     public void setFeature(String name, boolean value) throws SAXNotRecognizedException, SAXNotSupportedException {
-
         if (name == null) {
             throw new NullPointerException("the name parameter is null");
         }
@@ -340,7 +339,6 @@
      *              if the name parameter is null.
      */
     public void setProperty(String name, Object object) throws SAXNotRecognizedException, SAXNotSupportedException {
-
         if (name == null) {
             throw new NullPointerException("the name parameter is null");
         }
@@ -372,7 +370,6 @@
      * @see #setProperty(String, Object)
      */
     public Object getProperty(String name) throws SAXNotRecognizedException, SAXNotSupportedException {
-
         if (name == null) {
             throw new NullPointerException("the name parameter is null");
         }
diff --git a/luni/src/main/java/javax/xml/validation/SchemaFactoryFinder.java b/luni/src/main/java/javax/xml/validation/SchemaFactoryFinder.java
index 9cf521a..3a6cb83 100644
--- a/luni/src/main/java/javax/xml/validation/SchemaFactoryFinder.java
+++ b/luni/src/main/java/javax/xml/validation/SchemaFactoryFinder.java
@@ -20,14 +20,14 @@
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
-import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Iterator;
-import java.util.NoSuchElementException;
 import java.util.Properties;
 import javax.xml.XMLConstants;
 import libcore.io.IoUtils;
@@ -64,14 +64,9 @@
     private static final int DEFAULT_LINE_LENGTH = 80;
 
     static {
-        // Use try/catch block to support applets
-        try {
-            String val = SecuritySupport.getSystemProperty("jaxp.debug");
-            // Allow simply setting the prop to turn on debug
-            debug = val != null && (! "false".equals(val));
-        } catch (Exception _) {
-            debug = false;
-        }
+        String val = System.getProperty("jaxp.debug");
+        // Allow simply setting the prop to turn on debug
+        debug = val != null && (! "false".equals(val));
     }
 
     /**
@@ -109,30 +104,17 @@
     }
 
     private void debugDisplayClassLoader() {
-        try {
-            if( classLoader == SecuritySupport.getContextClassLoader() ) {
-                debugPrintln("using thread context class loader ("+classLoader+") for search");
-                return;
-            }
-        }
-        // The VM ran out of memory or there was some other serious problem. Re-throw.
-        catch (VirtualMachineError vme) {
-            throw vme;
-        }
-        // ThreadDeath should always be re-thrown
-        catch (ThreadDeath td) {
-            throw td;
-        }
-        catch (Throwable _) {
-            ; // getContextClassLoader() undefined in JDK1.1
+        if (classLoader == Thread.currentThread().getContextClassLoader()) {
+            debugPrintln("using thread context class loader ("+classLoader+") for search");
+            return;
         }
 
-        if( classLoader==ClassLoader.getSystemClassLoader() ) {
+        if (classLoader == ClassLoader.getSystemClassLoader()) {
             debugPrintln("using system class loader ("+classLoader+") for search");
             return;
         }
 
-        debugPrintln("using class loader ("+classLoader+") for search");
+        debugPrintln("using class loader (" + classLoader + ") for search");
     }
 
     /**
@@ -175,7 +157,7 @@
         // system property look up
         try {
             if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
-            String r = SecuritySupport.getSystemProperty(propertyName);
+            String r = System.getProperty(propertyName);
             if (r != null && r.length() > 0) {
                 if (debug) debugPrintln("The value is '"+r+"'");
                 sf = createInstance(r);
@@ -200,7 +182,7 @@
             }
         }
 
-        String javah = SecuritySupport.getSystemProperty( "java.home" );
+        String javah = System.getProperty("java.home");
         String configFile = javah + File.separator +
         "lib" + File.separator + "jaxp.properties";
 
@@ -213,9 +195,9 @@
                     if(firstTime){
                         File f=new File( configFile );
                         firstTime = false;
-                        if(SecuritySupport.doesFileExist(f)){
+                        if(f.exists()){
                             if (debug) debugPrintln("Read properties file " + f);
-                            cacheProps.load(SecuritySupport.getFileInputStream(f));
+                            cacheProps.load(new FileInputStream(f));
                         }
                     }
                 }
@@ -235,35 +217,12 @@
             }
         }
 
-        /**
-        // try to read from $java.home/lib/jaxp.properties
-        try {
-            String javah = ss.getSystemProperty( "java.home" );
-            String configFile = javah + File.separator +
-            "lib" + File.separator + "jaxp.properties";
-            File f = new File( configFile );
-            if( ss.doesFileExist(f)) {
-                sf = loadFromProperty(
-                        propertyName,f.getAbsolutePath(), new FileInputStream(f));
-                if(sf!=null)    return sf;
-            } else {
-                debugPrintln("Tried to read "+ f.getAbsolutePath()+", but it doesn't exist.");
-            }
-        } catch(Throwable e) {
-            if( debug ) {
-                debugPrintln("failed to read $java.home/lib/jaxp.properties");
-                e.printStackTrace();
-            }
-        }
-         */
-
         // try META-INF/services files
-        Iterator sitr = createServiceFileIterator();
-        while(sitr.hasNext()) {
-            URL resource = (URL)sitr.next();
+        for (URL resource : createServiceFileIterator()) {
             if (debug) debugPrintln("looking into " + resource);
             try {
-                sf = loadFromServicesFile(schemaLanguage,resource.toExternalForm(),SecuritySupport.getURLInputStream(resource));
+                sf = loadFromServicesFile(schemaLanguage,resource.toExternalForm(),
+                        resource.openStream());
                 if(sf!=null)    return sf;
             } catch(IOException e) {
                 if( debug ) {
@@ -298,7 +257,7 @@
      */
     SchemaFactory createInstance( String className ) {
         try {
-            if (debug) debugPrintln("instanciating "+className);
+            if (debug) debugPrintln("instantiating "+className);
             Class clazz;
             if( classLoader!=null )
                 clazz = classLoader.loadClass(className);
@@ -321,68 +280,35 @@
             throw td;
         }
         catch (Throwable t) {
-            debugPrintln("failed to instanciate "+className);
+            debugPrintln("failed to instantiate "+className);
             if(debug)   t.printStackTrace();
         }
         return null;
     }
 
-    /** Iterator that lazily computes one value and returns it. */
-    private static abstract class SingleIterator implements Iterator {
-        private boolean seen = false;
-
-        public final void remove() { throw new UnsupportedOperationException(); }
-        public final boolean hasNext() { return !seen; }
-        public final Object next() {
-            if(seen)    throw new NoSuchElementException();
-            seen = true;
-            return value();
-        }
-
-        protected abstract Object value();
-    }
-
     /**
      * Returns an {@link Iterator} that enumerates all
      * the META-INF/services files that we care.
      */
-    private Iterator createServiceFileIterator() {
+    private Iterable<URL> createServiceFileIterator() {
         if (classLoader == null) {
-            return new SingleIterator() {
-                protected Object value() {
-                    ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader();
-                    //return (ClassLoader.getSystemResource( SERVICE_ID ));
-                    return SecuritySupport.getResourceAsURL(classLoader, SERVICE_ID);
-                }
-            };
+            ClassLoader classLoader = SchemaFactoryFinder.class.getClassLoader();
+            return Collections.singleton(classLoader.getResource(SERVICE_ID));
         } else {
             try {
-                //final Enumeration e = classLoader.getResources(SERVICE_ID);
-                final Enumeration e = SecuritySupport.getResources(classLoader, SERVICE_ID);
-                if(debug && !e.hasMoreElements()) {
+                Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
+                if (debug && !e.hasMoreElements()) {
                     debugPrintln("no "+SERVICE_ID+" file was found");
                 }
 
                 // wrap it into an Iterator.
-                return new Iterator() {
-                    public void remove() {
-                        throw new UnsupportedOperationException();
-                    }
-
-                    public boolean hasNext() {
-                        return e.hasMoreElements();
-                    }
-
-                    public Object next() {
-                        return e.nextElement();
-                    }
-                };
+                return Collections.list(e);
             } catch (IOException e) {
                 if (debug) {
                     debugPrintln("failed to enumerate resources "+SERVICE_ID);
                     e.printStackTrace();
                 }
-                return new ArrayList().iterator();  // empty iterator
+                return Collections.emptySet();
             }
         }
     }
@@ -448,7 +374,7 @@
                         break;
                     }
                 }
-                catch (Exception e) {}
+                catch (Exception ignored) {}
             }
             else {
                 break;
@@ -463,8 +389,6 @@
     private static final Class SERVICE_CLASS = SchemaFactory.class;
     private static final String SERVICE_ID = "META-INF/services/" + SERVICE_CLASS.getName();
 
-
-
     private static String which( Class clazz ) {
         return which( clazz.getName(), clazz.getClassLoader() );
     }
@@ -478,17 +402,11 @@
      * @return the source location of the resource, or null if it wasn't found
      */
     private static String which(String classname, ClassLoader loader) {
-
         String classnameAsResource = classname.replace('.', '/') + ".class";
 
-        if( loader==null )  loader = ClassLoader.getSystemClassLoader();
+        if (loader == null)  loader = ClassLoader.getSystemClassLoader();
 
-        //URL it = loader.getResource(classnameAsResource);
-        URL it = SecuritySupport.getResourceAsURL(loader, classnameAsResource);
-        if (it != null) {
-            return it.toString();
-        } else {
-            return null;
-        }
+        URL it = loader.getResource(classnameAsResource);
+        return it != null ? it.toString() : null;
     }
 }
diff --git a/luni/src/main/java/javax/xml/validation/SecuritySupport.java b/luni/src/main/java/javax/xml/validation/SecuritySupport.java
deleted file mode 100644
index eb17feb..0000000
--- a/luni/src/main/java/javax/xml/validation/SecuritySupport.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// $Id: SecuritySupport.java 522337 2007-03-25 20:03:27Z mrglavas $
-
-package javax.xml.validation;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport  {
-
-    private SecuritySupport() {}
-
-    static ClassLoader getContextClassLoader() {
-    return (ClassLoader)
-        AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-        ClassLoader cl = null;
-        try {
-            cl = Thread.currentThread().getContextClassLoader();
-        } catch (SecurityException ex) { }
-        return cl;
-        }
-    });
-    }
-
-    static String getSystemProperty(final String propName) {
-    return (String)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return System.getProperty(propName);
-                }
-            });
-    }
-
-    static FileInputStream getFileInputStream(final File file)
-        throws FileNotFoundException
-    {
-    try {
-            return (FileInputStream)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws FileNotFoundException {
-                        return new FileInputStream(file);
-                    }
-                });
-    } catch (PrivilegedActionException e) {
-        throw (FileNotFoundException)e.getException();
-    }
-    }
-
-    static InputStream getURLInputStream(final URL url)
-        throws IOException
-    {
-    try {
-            return (InputStream)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws IOException {
-                        return url.openStream();
-                    }
-                });
-    } catch (PrivilegedActionException e) {
-        throw (IOException)e.getException();
-    }
-    }
-
-    static URL getResourceAsURL(final ClassLoader cl,
-                                final String name)
-    {
-        return (URL)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    URL url;
-                    if (cl == null) {
-                        url = ClassLoader.getSystemResource(name);
-                    }
-                    else {
-                        url = cl.getResource(name);
-                    }
-                    return url;
-                }
-            });
-    }
-
-    static Enumeration getResources(final ClassLoader cl,
-                                    final String name) throws IOException
-    {
-        try{
-        return (Enumeration)
-            AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                public Object run() throws IOException{
-                    Enumeration enumeration;
-                    if (cl == null) {
-                        enumeration = ClassLoader.getSystemResources(name);
-                    }
-                    else {
-                        enumeration = cl.getResources(name);
-                    }
-                    return enumeration;
-                }
-            });
-        }catch(PrivilegedActionException e){
-            throw (IOException)e.getException();
-        }
-    }
-
-    static InputStream getResourceAsStream(final ClassLoader cl,
-                                           final String name)
-    {
-        return (InputStream)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    InputStream ris;
-                    if (cl == null) {
-                        ris = ClassLoader.getSystemResourceAsStream(name);
-                    } else {
-                        ris = cl.getResourceAsStream(name);
-                    }
-                    return ris;
-                }
-            });
-    }
-
-    static boolean doesFileExist(final File f) {
-    return ((Boolean)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return f.exists() ? Boolean.TRUE : Boolean.FALSE;
-                }
-            })).booleanValue();
-    }
-
-}
diff --git a/luni/src/main/java/javax/xml/xpath/SecuritySupport.java b/luni/src/main/java/javax/xml/xpath/SecuritySupport.java
deleted file mode 100644
index edf7185..0000000
--- a/luni/src/main/java/javax/xml/xpath/SecuritySupport.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-// $Id: SecuritySupport.java 522337 2007-03-25 20:03:27Z mrglavas $
-
-package javax.xml.xpath;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.Enumeration;
-
-/**
- * This class is duplicated for each JAXP subpackage so keep it in sync.
- * It is package private and therefore is not exposed as part of the JAXP
- * API.
- *
- * Security related methods that only work on J2SE 1.2 and newer.
- */
-final class SecuritySupport  {
-
-    private SecuritySupport() {}
-
-    static ClassLoader getContextClassLoader() {
-    return (ClassLoader)
-        AccessController.doPrivileged(new PrivilegedAction() {
-        public Object run() {
-        ClassLoader cl = null;
-        try {
-            cl = Thread.currentThread().getContextClassLoader();
-        } catch (SecurityException ex) { }
-        return cl;
-        }
-    });
-    }
-
-    static String getSystemProperty(final String propName) {
-    return (String)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return System.getProperty(propName);
-                }
-            });
-    }
-
-    static FileInputStream getFileInputStream(final File file)
-        throws FileNotFoundException
-    {
-    try {
-            return (FileInputStream)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws FileNotFoundException {
-                        return new FileInputStream(file);
-                    }
-                });
-    } catch (PrivilegedActionException e) {
-        throw (FileNotFoundException)e.getException();
-    }
-    }
-
-    static InputStream getURLInputStream(final URL url)
-        throws IOException
-    {
-    try {
-            return (InputStream)
-                AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                    public Object run() throws IOException {
-                        return url.openStream();
-                    }
-                });
-    } catch (PrivilegedActionException e) {
-        throw (IOException)e.getException();
-    }
-    }
-
-    static URL getResourceAsURL(final ClassLoader cl,
-                                final String name)
-    {
-        return (URL)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    URL url;
-                    if (cl == null) {
-                        url = ClassLoader.getSystemResource(name);
-                    }
-                    else {
-                        url = cl.getResource(name);
-                    }
-                    return url;
-                }
-            });
-    }
-
-    static Enumeration getResources(final ClassLoader cl,
-                                    final String name) throws IOException
-    {
-        try{
-        return (Enumeration)
-            AccessController.doPrivileged(new PrivilegedExceptionAction() {
-                public Object run() throws IOException{
-                    Enumeration enumeration;
-                    if (cl == null) {
-                        enumeration = ClassLoader.getSystemResources(name);
-                    }
-                    else {
-                        enumeration = cl.getResources(name);
-                    }
-                    return enumeration;
-                }
-            });
-        }catch(PrivilegedActionException e){
-            throw (IOException)e.getException();
-        }
-    }
-
-    static InputStream getResourceAsStream(final ClassLoader cl,
-                                           final String name)
-    {
-        return (InputStream)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    InputStream ris;
-                    if (cl == null) {
-                        ris = ClassLoader.getSystemResourceAsStream(name);
-                    } else {
-                        ris = cl.getResourceAsStream(name);
-                    }
-                    return ris;
-                }
-            });
-    }
-
-    static boolean doesFileExist(final File f) {
-    return ((Boolean)
-            AccessController.doPrivileged(new PrivilegedAction() {
-                public Object run() {
-                    return f.exists() ? Boolean.TRUE : Boolean.FALSE;
-                }
-            })).booleanValue();
-    }
-
-}
diff --git a/luni/src/main/java/javax/xml/xpath/XPathFactory.java b/luni/src/main/java/javax/xml/xpath/XPathFactory.java
index 55f886e..8b1c1fa 100644
--- a/luni/src/main/java/javax/xml/xpath/XPathFactory.java
+++ b/luni/src/main/java/javax/xml/xpath/XPathFactory.java
@@ -142,7 +142,7 @@
                 "XPathFactory#newInstance(String uri) cannot be called with uri == \"\""
             );
         }
-        ClassLoader classLoader = SecuritySupport.getContextClassLoader();
+        ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
         if (classLoader == null) {
             //use the current class loader
             classLoader = XPathFactory.class.getClassLoader();
@@ -150,7 +150,7 @@
         XPathFactory xpathFactory = new XPathFactoryFinder(classLoader).newFactory(uri);
         if (xpathFactory == null) {
             throw new XPathFactoryConfigurationException(
-                "No XPathFctory implementation found for the object model: "
+                "No XPathFactory implementation found for the object model: "
                 + uri
             );
         }
@@ -180,12 +180,12 @@
             throw new XPathFactoryConfigurationException("factoryClassName cannot be null.");
         }
         if (classLoader == null) {
-            classLoader = SecuritySupport.getContextClassLoader();
+            classLoader = Thread.currentThread().getContextClassLoader();
         }
         XPathFactory xpathFactory = new XPathFactoryFinder(classLoader).createInstance(factoryClassName);
         if (xpathFactory == null || !xpathFactory.isObjectModelSupported(uri)) {
             throw new XPathFactoryConfigurationException(
-                "No XPathFctory implementation found for the object model: "
+                "No XPathFactory implementation found for the object model: "
                 + uri
             );
         }
diff --git a/luni/src/main/java/javax/xml/xpath/XPathFactoryFinder.java b/luni/src/main/java/javax/xml/xpath/XPathFactoryFinder.java
index d6ed893..652a1d8 100644
--- a/luni/src/main/java/javax/xml/xpath/XPathFactoryFinder.java
+++ b/luni/src/main/java/javax/xml/xpath/XPathFactoryFinder.java
@@ -20,14 +20,14 @@
 
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.net.URL;
-import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Iterator;
-import java.util.NoSuchElementException;
 import java.util.Properties;
 import javax.xml.validation.SchemaFactory;
 import libcore.io.IoUtils;
@@ -50,14 +50,9 @@
     private static final int DEFAULT_LINE_LENGTH = 80;
 
     static {
-        // Use try/catch block to support applets
-        try {
-            String val = SecuritySupport.getSystemProperty("jaxp.debug");
-            // Allow simply setting the prop to turn on debug
-            debug = val != null && (! "false".equals(val));
-        } catch (Exception _) {
-            debug = false;
-        }
+        String val = System.getProperty("jaxp.debug");
+        // Allow simply setting the prop to turn on debug
+        debug = val != null && (! "false".equals(val));
     }
 
     /**
@@ -92,43 +87,30 @@
      *
      * @param loader
      *      to be used to load resource, {@link SchemaFactory}, and
-     *      {@link SchemaFactoryLoader} implementations during
+     *      {@code SchemaFactoryLoader} implementations during
      *      the resolution process.
      *      If this parameter is null, the default system class loader
      *      will be used.
      */
     public XPathFactoryFinder(ClassLoader loader) {
         this.classLoader = loader;
-        if( debug ) {
+        if (debug) {
             debugDisplayClassLoader();
         }
     }
 
     private void debugDisplayClassLoader() {
-        try {
-            if( classLoader == SecuritySupport.getContextClassLoader() ) {
-                debugPrintln("using thread context class loader ("+classLoader+") for search");
-                return;
-            }
-        }
-        // The VM ran out of memory or there was some other serious problem. Re-throw.
-        catch (VirtualMachineError vme) {
-            throw vme;
-        }
-        // ThreadDeath should always be re-thrown
-        catch (ThreadDeath td) {
-            throw td;
-        }
-        catch (Throwable _) {
-            ; // getContextClassLoader() undefined in JDK1.1
-        }
-
-        if( classLoader==ClassLoader.getSystemClassLoader() ) {
-            debugPrintln("using system class loader ("+classLoader+") for search");
+        if (classLoader == Thread.currentThread().getContextClassLoader()) {
+            debugPrintln("using thread context class loader (" + classLoader + ") for search");
             return;
         }
 
-        debugPrintln("using class loader ("+classLoader+") for search");
+        if (classLoader==ClassLoader.getSystemClassLoader()) {
+            debugPrintln("using system class loader (" + classLoader + ") for search");
+            return;
+        }
+
+        debugPrintln("using class loader (" + classLoader + ") for search");
     }
 
     /**
@@ -160,43 +142,27 @@
      * <p>Lookup a {@link XPathFactory} for the given object model.</p>
      *
      * @param uri identifies the object model.
-     *
-     * @return {@link XPathFactory} for the given object model.
      */
     private XPathFactory _newFactory(String uri) {
         XPathFactory xpf;
-
         String propertyName = SERVICE_CLASS.getName() + ":" + uri;
 
         // system property look up
         try {
             if (debug) debugPrintln("Looking up system property '"+propertyName+"'" );
-            String r = SecuritySupport.getSystemProperty(propertyName);
+            String r = System.getProperty(propertyName);
             if (r != null && r.length() > 0) {
                 if (debug) debugPrintln("The value is '"+r+"'");
                 xpf = createInstance(r);
                 if(xpf!=null)    return xpf;
-            }
-            else if (debug) {
+            } else if (debug) {
                 debugPrintln("The property is undefined.");
             }
-        }
-        // The VM ran out of memory or there was some other serious problem. Re-throw.
-        catch (VirtualMachineError vme) {
-            throw vme;
-        }
-        // ThreadDeath should always be re-thrown
-        catch (ThreadDeath td) {
-            throw td;
-        }
-        catch (Throwable t) {
-            if( debug ) {
-                debugPrintln("failed to look up system property '"+propertyName+"'" );
-                t.printStackTrace();
-            }
+        } catch (Exception e) {
+            e.printStackTrace();
         }
 
-        String javah = SecuritySupport.getSystemProperty( "java.home" );
+        String javah = System.getProperty("java.home");
         String configFile = javah + File.separator +
         "lib" + File.separator + "jaxp.properties";
 
@@ -209,9 +175,9 @@
                     if(firstTime){
                         File f=new File( configFile );
                         firstTime = false;
-                        if(SecuritySupport.doesFileExist(f)){
+                        if (f.exists()) {
                             if (debug) debugPrintln("Read properties file " + f);
-                            cacheProps.load(SecuritySupport.getFileInputStream(f));
+                            cacheProps.load(new FileInputStream(f));
                         }
                     }
                 }
@@ -232,12 +198,10 @@
         }
 
         // try META-INF/services files
-        Iterator sitr = createServiceFileIterator();
-        while(sitr.hasNext()) {
-            URL resource = (URL)sitr.next();
+        for (URL resource : createServiceFileIterator()) {
             if (debug) debugPrintln("looking into " + resource);
             try {
-                xpf = loadFromServicesFile(uri, resource.toExternalForm(), SecuritySupport.getURLInputStream(resource));
+                xpf = loadFromServicesFile(uri, resource.toExternalForm(), resource.openStream());
                 if(xpf!=null)    return xpf;
             } catch(IOException e) {
                 if( debug ) {
@@ -261,14 +225,14 @@
      * <p>Creates an instance of the specified and returns it.</p>
      *
      * @param className
-     *      fully qualified class name to be instanciated.
+     *      fully qualified class name to be instantiated.
      *
      * @return null
      *      if it fails. Error messages will be printed by this method.
      */
     XPathFactory createInstance( String className ) {
         try {
-            if (debug) debugPrintln("instanciating "+className);
+            if (debug) debugPrintln("instantiating "+className);
             Class clazz;
             if( classLoader!=null )
                 clazz = classLoader.loadClass(className);
@@ -292,28 +256,13 @@
         }
         catch (Throwable t) {
             if (debug) {
-                debugPrintln("failed to instanciate "+className);
+                debugPrintln("failed to instantiate "+className);
                 t.printStackTrace();
             }
         }
         return null;
     }
 
-    /** Iterator that lazily computes one value and returns it. */
-    private static abstract class SingleIterator implements Iterator {
-        private boolean seen = false;
-
-        public final void remove() { throw new UnsupportedOperationException(); }
-        public final boolean hasNext() { return !seen; }
-        public final Object next() {
-            if(seen)    throw new NoSuchElementException();
-            seen = true;
-            return value();
-        }
-
-        protected abstract Object value();
-    }
-
     /** Searches for a XPathFactory for a given uri in a META-INF/services file. */
     private XPathFactory loadFromServicesFile(String uri, String resourceName, InputStream in) {
 
@@ -326,7 +275,7 @@
             rd = new BufferedReader(new InputStreamReader(in), DEFAULT_LINE_LENGTH);
         }
 
-        String factoryClassName = null;
+        String factoryClassName;
         XPathFactory resultFactory = null;
         // See spec for provider-configuration files: http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Provider%20Configuration%20File
         while (true) {
@@ -353,13 +302,13 @@
 
                 try {
                     // Found the right XPathFactory if its isObjectModelSupported(String uri) method returns true.
-                    XPathFactory foundFactory = (XPathFactory) createInstance(factoryClassName);
+                    XPathFactory foundFactory = createInstance(factoryClassName);
                     if (foundFactory.isObjectModelSupported(uri)) {
                         resultFactory = foundFactory;
                         break;
                     }
+                } catch (Exception ignored) {
                 }
-                catch (Exception e) {}
             }
             else {
                 break;
@@ -375,43 +324,24 @@
      * Returns an {@link Iterator} that enumerates all
      * the META-INF/services files that we care.
      */
-    private Iterator createServiceFileIterator() {
+    private Iterable<URL> createServiceFileIterator() {
         if (classLoader == null) {
-            return new SingleIterator() {
-                protected Object value() {
-                    ClassLoader classLoader = XPathFactoryFinder.class.getClassLoader();
-                    return SecuritySupport.getResourceAsURL(classLoader, SERVICE_ID);
-                    //return (ClassLoader.getSystemResource( SERVICE_ID ));
-                }
-            };
+            URL resource = XPathFactoryFinder.class.getClassLoader().getResource(SERVICE_ID);
+            return Collections.singleton(resource);
         } else {
             try {
-                //final Enumeration e = classLoader.getResources(SERVICE_ID);
-                final Enumeration e = SecuritySupport.getResources(classLoader, SERVICE_ID);
+                Enumeration<URL> e = classLoader.getResources(SERVICE_ID);
                 if (debug && !e.hasMoreElements()) {
                     debugPrintln("no "+SERVICE_ID+" file was found");
                 }
 
-                // wrap it into an Iterator.
-                return new Iterator() {
-                    public void remove() {
-                        throw new UnsupportedOperationException();
-                    }
-
-                    public boolean hasNext() {
-                        return e.hasMoreElements();
-                    }
-
-                    public Object next() {
-                        return e.nextElement();
-                    }
-                };
+                return Collections.list(e);
             } catch (IOException e) {
                 if (debug) {
                     debugPrintln("failed to enumerate resources "+SERVICE_ID);
                     e.printStackTrace();
                 }
-                return new ArrayList().iterator();  // empty iterator
+                return Collections.emptySet();
             }
         }
     }
@@ -419,8 +349,6 @@
     private static final Class SERVICE_CLASS = XPathFactory.class;
     private static final String SERVICE_ID = "META-INF/services/" + SERVICE_CLASS.getName();
 
-
-
     private static String which( Class clazz ) {
         return which( clazz.getName(), clazz.getClassLoader() );
     }
@@ -434,17 +362,10 @@
      * @return the source location of the resource, or null if it wasn't found
      */
     private static String which(String classname, ClassLoader loader) {
-
         String classnameAsResource = classname.replace('.', '/') + ".class";
+        if (loader==null) loader = ClassLoader.getSystemClassLoader();
 
-        if( loader==null )  loader = ClassLoader.getSystemClassLoader();
-
-        //URL it = loader.getResource(classnameAsResource);
-        URL it = SecuritySupport.getResourceAsURL(loader, classnameAsResource);
-        if (it != null) {
-            return it.toString();
-        } else {
-            return null;
-        }
+        URL it = loader.getResource(classnameAsResource);
+        return it != null ? it.toString() : null;
     }
 }
diff --git a/luni/src/main/java/libcore/icu/CharsetDecoderICU.java b/luni/src/main/java/libcore/icu/CharsetDecoderICU.java
deleted file mode 100644
index 86ba13b..0000000
--- a/luni/src/main/java/libcore/icu/CharsetDecoderICU.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/**
-*******************************************************************************
-* Copyright (C) 1996-2006, International Business Machines Corporation and    *
-* others. All Rights Reserved.                                                *
-*******************************************************************************
-*
-*******************************************************************************
-*/
- /**
-  * A JNI interface for ICU converters.
-  *
-  *
-  * @author Ram Viswanadha, IBM
-  */
-package libcore.icu;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetDecoder;
-import java.nio.charset.CoderResult;
-import java.nio.charset.CodingErrorAction;
-
-public final class CharsetDecoderICU extends CharsetDecoder {
-    private static final int MAX_CHARS_PER_BYTE = 2;
-
-    private static final int INPUT_OFFSET = 0;
-    private static final int OUTPUT_OFFSET = 1;
-    private static final int INVALID_BYTES = 2;
-    private static final int INPUT_HELD = 3;
-    /*
-     * data[INPUT_OFFSET]   = on input contains the start of input and on output the number of input bytes consumed
-     * data[OUTPUT_OFFSET]  = on input contains the start of output and on output the number of output chars written
-     * data[INVALID_BYTES]  = number of invalid bytes
-     * data[INPUT_HELD]     = number of input bytes held in the converter's state
-     */
-    private int[] data = new int[4];
-
-    /* handle to the ICU converter that is opened */
-    private long converterHandle = 0;
-
-    private byte[] input = null;
-    private char[] output= null;
-
-    // BEGIN android-added
-    private byte[] allocatedInput = null;
-    private char[] allocatedOutput = null;
-    // END android-added
-
-    // These instance variables are always assigned in the methods before being used. This class
-    // is inherently thread-unsafe so we don't have to worry about synchronization.
-    private int inEnd;
-    private int outEnd;
-    private int ec;
-    private int savedInputHeldLen;
-
-    public static CharsetDecoderICU newInstance(Charset cs, String icuCanonicalName) {
-        // This complexity is necessary to ensure that even if the constructor, superclass
-        // constructor, or call to updateCallback throw, we still free the native peer.
-        long address = 0;
-        try {
-            address = NativeConverter.openConverter(icuCanonicalName);
-            float averageCharsPerByte = NativeConverter.getAveCharsPerByte(address);
-            CharsetDecoderICU result = new CharsetDecoderICU(cs, averageCharsPerByte, address);
-            address = 0; // CharsetDecoderICU has taken ownership; its finalizer will do the free.
-            result.updateCallback();
-            return result;
-        } finally {
-            if (address != 0) {
-                NativeConverter.closeConverter(address);
-            }
-        }
-    }
-
-    private CharsetDecoderICU(Charset cs, float averageCharsPerByte, long address) {
-        super(cs, averageCharsPerByte, MAX_CHARS_PER_BYTE);
-        this.converterHandle = address;
-    }
-
-    /**
-     * Sets this decoders replacement string. Substitutes the string in input if an
-     * unmappable or illegal sequence is encountered
-     * @param newReplacement to replace the error bytes with
-     * @stable ICU 2.4
-     */
-    protected void implReplaceWith(String newReplacement) {
-        if (converterHandle > 0) {
-            if (newReplacement.length() > NativeConverter.getMaxBytesPerChar(converterHandle)) {
-                throw new IllegalArgumentException();
-            }
-            updateCallback();
-        }
-     }
-
-    /**
-     * Sets the action to be taken if an illegal sequence is encountered
-     * @param newAction action to be taken
-     * @exception IllegalArgumentException
-     * @stable ICU 2.4
-     */
-    protected final void implOnMalformedInput(CodingErrorAction newAction) {
-        updateCallback();
-    }
-
-    /**
-     * Sets the action to be taken if an illegal sequence is encountered
-     * @param newAction action to be taken
-     * @exception IllegalArgumentException
-     * @stable ICU 2.4
-     */
-    protected final void implOnUnmappableCharacter(CodingErrorAction newAction) {
-        updateCallback();
-    }
-
-    private void updateCallback() {
-        ec = NativeConverter.setCallbackDecode(converterHandle, this);
-        if (ErrorCode.isFailure(ec)) {
-            throw ErrorCode.throwException(ec);
-        }
-    }
-
-    /**
-     * Flushes any characters saved in the converter's internal buffer and
-     * resets the converter.
-     * @param out action to be taken
-     * @return result of flushing action and completes the decoding all input.
-     *         Returns CoderResult.UNDERFLOW if the action succeeds.
-     * @stable ICU 2.4
-     */
-    protected final CoderResult implFlush(CharBuffer out) {
-        try {
-            data[OUTPUT_OFFSET] = getArray(out);
-            ec = NativeConverter.flushByteToChar(
-                                            converterHandle,  /* Handle to ICU Converter */
-                                            output,           /* input array of chars */
-                                            outEnd,           /* input index+1 to be written */
-                                            data              /* contains data, inOff,outOff */
-                                            );
-
-            /* If we don't have room for the output, throw an exception*/
-            if (ErrorCode.isFailure(ec)) {
-                if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
-                    return CoderResult.OVERFLOW;
-                } else if (ec == ErrorCode.U_TRUNCATED_CHAR_FOUND) {//CSDL: add this truncated character error handling
-                    if (data[INPUT_OFFSET] > 0) {
-                        return CoderResult.malformedForLength(data[INPUT_OFFSET]);
-                    }
-                } else {
-                    throw ErrorCode.throwException(ec);
-                }
-            }
-            return CoderResult.UNDERFLOW;
-       } finally {
-            /* save the flushed data */
-            setPosition(out);
-            implReset();
-       }
-    }
-
-    protected void implReset() {
-        NativeConverter.resetByteToChar(converterHandle);
-        data[INPUT_OFFSET] = 0;
-        data[OUTPUT_OFFSET] = 0;
-        data[INVALID_BYTES] = 0;
-        data[INPUT_HELD] = 0;
-        savedInputHeldLen = 0;
-        output = null;
-        input = null;
-        allocatedInput = null;
-        allocatedOutput = null;
-        ec = 0;
-        inEnd = 0;
-        outEnd = 0;
-    }
-
-    /**
-     * Decodes one or more bytes. The default behavior of the converter
-     * is stop and report if an error in input stream is encountered.
-     * To set different behavior use @see CharsetDecoder.onMalformedInput()
-     * This  method allows a buffer by buffer conversion of a data stream.
-     * The state of the conversion is saved between calls to convert.
-     * Among other things, this means multibyte input sequences can be
-     * split between calls. If a call to convert results in an Error, the
-     * conversion may be continued by calling convert again with suitably
-     * modified parameters.All conversions should be finished with a call to
-     * the flush method.
-     * @param in buffer to decode
-     * @param out buffer to populate with decoded result
-     * @return result of decoding action. Returns CoderResult.UNDERFLOW if the decoding
-     *         action succeeds or more input is needed for completing the decoding action.
-     * @stable ICU 2.4
-     */
-    protected CoderResult decodeLoop(ByteBuffer in, CharBuffer out){
-        if (!in.hasRemaining()){
-            return CoderResult.UNDERFLOW;
-        }
-
-        data[INPUT_OFFSET] = getArray(in);
-        data[OUTPUT_OFFSET]= getArray(out);
-        data[INPUT_HELD] = 0;
-
-        try{
-            ec = NativeConverter.decode(
-                                converterHandle,  /* Handle to ICU Converter */
-                                input,            /* input array of bytes */
-                                inEnd,            /* last index+1 to be converted */
-                                output,           /* input array of chars */
-                                outEnd,           /* input index+1 to be written */
-                                data,             /* contains data, inOff,outOff */
-                                false             /* don't flush the data */
-                                );
-
-            // Return an error.
-            if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
-                return CoderResult.OVERFLOW;
-            } else if (ec == ErrorCode.U_INVALID_CHAR_FOUND) {
-                return CoderResult.unmappableForLength(data[INVALID_BYTES]);
-            } else if (ec == ErrorCode.U_ILLEGAL_CHAR_FOUND) {
-                return CoderResult.malformedForLength(data[INVALID_BYTES]);
-            }
-            // Decoding succeeded: give us more data.
-            return CoderResult.UNDERFLOW;
-        } finally {
-            setPosition(in);
-            setPosition(out);
-        }
-    }
-
-    /**
-     * Releases the system resources by cleanly closing ICU converter opened
-     * @stable ICU 2.4
-     */
-    @Override protected void finalize() throws Throwable {
-        try {
-            NativeConverter.closeConverter(converterHandle);
-            converterHandle = 0;
-        } finally {
-            super.finalize();
-        }
-    }
-
-    //------------------------------------------
-    // private utility methods
-    //------------------------------------------
-
-    private int getArray(CharBuffer out) {
-        if (out.hasArray()) {
-            // BEGIN android-changed: take arrayOffset into account
-            output = out.array();
-            outEnd = out.arrayOffset() + out.limit();
-            return out.arrayOffset() + out.position();
-            // END android-changed
-        } else {
-            outEnd = out.remaining();
-            // BEGIN android-added
-            if (allocatedOutput == null || (outEnd > allocatedOutput.length)) {
-                allocatedOutput = new char[outEnd];
-            }
-            output = allocatedOutput;
-            // END android-added
-            //since the new
-            // buffer start position
-            // is 0
-            return 0;
-        }
-    }
-
-    private  int getArray(ByteBuffer in) {
-        if (in.hasArray()) {
-            // BEGIN android-changed: take arrayOffset into account
-            input = in.array();
-            inEnd = in.arrayOffset() + in.limit();
-            return in.arrayOffset() + in.position() + savedInputHeldLen;/*exclude the number fo bytes held in previous conversion*/
-            // END android-changed
-        } else {
-            inEnd = in.remaining();
-            // BEGIN android-added
-            if (allocatedInput == null || (inEnd > allocatedInput.length)) {
-                allocatedInput = new byte[inEnd];
-            }
-            input = allocatedInput;
-            // END android-added
-            // save the current position
-            int pos = in.position();
-            in.get(input,0,inEnd);
-            // reset the position
-            in.position(pos);
-            // the start position
-            // of the new buffer
-            // is whatever is savedInputLen
-            return savedInputHeldLen;
-        }
-    }
-
-    private void setPosition(CharBuffer out) {
-        if (out.hasArray()) {
-            out.position(out.position() + data[OUTPUT_OFFSET] - out.arrayOffset());
-        } else {
-            out.put(output, 0, data[OUTPUT_OFFSET]);
-        }
-        // release reference to output array, which may not be ours
-        output = null;
-    }
-
-    private void setPosition(ByteBuffer in) {
-        // ok was there input held in the previous invocation of decodeLoop
-        // that resulted in output in this invocation?
-        in.position(in.position() + data[INPUT_OFFSET] + savedInputHeldLen - data[INPUT_HELD]);
-        savedInputHeldLen = data[INPUT_HELD];
-        // release reference to input array, which may not be ours
-        input = null;
-    }
-}
diff --git a/luni/src/main/java/libcore/icu/CharsetEncoderICU.java b/luni/src/main/java/libcore/icu/CharsetEncoderICU.java
deleted file mode 100644
index 2855a4c..0000000
--- a/luni/src/main/java/libcore/icu/CharsetEncoderICU.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/**
-*******************************************************************************
-* Copyright (C) 1996-2006, International Business Machines Corporation and    *
-* others. All Rights Reserved.                                                  *
-*******************************************************************************
-*
-*******************************************************************************
-*/
-/**
- * A JNI interface for ICU converters.
- *
- *
- * @author Ram Viswanadha, IBM
- */
-package libcore.icu;
-
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CoderResult;
-import java.nio.charset.CodingErrorAction;
-import java.util.HashMap;
-import java.util.Map;
-
-public final class CharsetEncoderICU extends CharsetEncoder {
-    private static final Map<String, byte[]> DEFAULT_REPLACEMENTS = new HashMap<String, byte[]>();
-    static {
-        // ICU has different default replacements to the RI in some cases. There are many
-        // additional cases, but this covers all the charsets that Java guarantees will be
-        // available, which is where compatibility seems most important. (The RI even uses
-        // the byte corresponding to '?' in ASCII as the replacement byte for charsets where that
-        // byte corresponds to an entirely different character.)
-        // It's odd that UTF-8 doesn't use U+FFFD, given that (unlike ISO-8859-1 and US-ASCII) it
-        // can represent it, but this is what the RI does...
-        byte[] questionMark = new byte[] { (byte) '?' };
-        DEFAULT_REPLACEMENTS.put("UTF-8",      questionMark);
-        DEFAULT_REPLACEMENTS.put("ISO-8859-1", questionMark);
-        DEFAULT_REPLACEMENTS.put("US-ASCII",   questionMark);
-    }
-
-    private static final int INPUT_OFFSET = 0;
-    private static final int OUTPUT_OFFSET = 1;
-    private static final int INVALID_CHARS = 2;
-    private static final int INPUT_HELD = 3;
-    /*
-     * data[INPUT_OFFSET]   = on input contains the start of input and on output the number of input chars consumed
-     * data[OUTPUT_OFFSET]  = on input contains the start of output and on output the number of output bytes written
-     * data[INVALID_CHARS]  = number of invalid chars
-     * data[INPUT_HELD]     = number of input chars held in the converter's state
-     */
-    private int[] data = new int[4];
-    /* handle to the ICU converter that is opened */
-    private long converterHandle=0;
-
-    private char[] input = null;
-    private byte[] output = null;
-
-    // BEGIN android-added
-    private char[] allocatedInput = null;
-    private byte[] allocatedOutput = null;
-    // END android-added
-
-    // These instance variables are always assigned in the methods before being used. This class
-    // is inherently thread-unsafe so we don't have to worry about synchronization.
-    private int inEnd;
-    private int outEnd;
-    private int ec;
-    private int savedInputHeldLen;
-
-    public static CharsetEncoderICU newInstance(Charset cs, String icuCanonicalName) {
-        // This complexity is necessary to ensure that even if the constructor, superclass
-        // constructor, or call to updateCallback throw, we still free the native peer.
-        long address = 0;
-        try {
-            address = NativeConverter.openConverter(icuCanonicalName);
-            float averageBytesPerChar = NativeConverter.getAveBytesPerChar(address);
-            float maxBytesPerChar = NativeConverter.getMaxBytesPerChar(address);
-            byte[] replacement = makeReplacement(icuCanonicalName, address);
-            CharsetEncoderICU result = new CharsetEncoderICU(cs, averageBytesPerChar, maxBytesPerChar, replacement, address);
-            address = 0; // CharsetEncoderICU has taken ownership; its finalizer will do the free.
-            result.updateCallback();
-            return result;
-        } finally {
-            if (address != 0) {
-                NativeConverter.closeConverter(address);
-            }
-        }
-    }
-
-    private static byte[] makeReplacement(String icuCanonicalName, long address) {
-        // We have our own map of RI-compatible default replacements (where ICU disagrees)...
-        byte[] replacement = DEFAULT_REPLACEMENTS.get(icuCanonicalName);
-        if (replacement != null) {
-            return replacement.clone();
-        }
-        // ...but fall back to asking ICU.
-        return NativeConverter.getSubstitutionBytes(address);
-    }
-
-    private CharsetEncoderICU(Charset cs, float averageBytesPerChar, float maxBytesPerChar, byte[] replacement, long address) {
-        super(cs, averageBytesPerChar, maxBytesPerChar, replacement);
-        this.converterHandle = address;
-    }
-
-    /**
-     * Sets this encoders replacement string. Substitutes the string in output if an
-     * unmappable or illegal sequence is encountered
-     * @param newReplacement to replace the error chars with
-     * @stable ICU 2.4
-     */
-    protected void implReplaceWith(byte[] newReplacement) {
-        if (converterHandle != 0) {
-            if (newReplacement.length > NativeConverter.getMaxBytesPerChar(converterHandle)) {
-                throw new IllegalArgumentException("Number of replacement Bytes are greater than max bytes per char");
-            }
-            updateCallback();
-        }
-    }
-
-    /**
-     * Sets the action to be taken if an illegal sequence is encountered
-     * @param newAction action to be taken
-     * @exception IllegalArgumentException
-     * @stable ICU 2.4
-     */
-    protected void implOnMalformedInput(CodingErrorAction newAction) {
-        updateCallback();
-    }
-
-    /**
-     * Sets the action to be taken if an illegal sequence is encountered
-     * @param newAction action to be taken
-     * @exception IllegalArgumentException
-     * @stable ICU 2.4
-     */
-    protected void implOnUnmappableCharacter(CodingErrorAction newAction) {
-        updateCallback();
-    }
-
-    private void updateCallback() {
-        ec = NativeConverter.setCallbackEncode(converterHandle, this);
-        if (ErrorCode.isFailure(ec)) {
-            throw ErrorCode.throwException(ec);
-        }
-    }
-
-    /**
-     * Flushes any characters saved in the converter's internal buffer and
-     * resets the converter.
-     * @param out action to be taken
-     * @return result of flushing action and completes the decoding all input.
-     *       Returns CoderResult.UNDERFLOW if the action succeeds.
-     * @stable ICU 2.4
-     */
-    protected CoderResult implFlush(ByteBuffer out) {
-        try {
-            data[OUTPUT_OFFSET] = getArray(out);
-            ec = NativeConverter.flushCharToByte(converterHandle,/* Handle to ICU Converter */
-                                                 output, /* output array of chars */
-                                                 outEnd, /* output index+1 to be written */
-                                                 data /* contains data, inOff,outOff */
-                                                );
-
-            /* If we don't have room for the output, throw an exception*/
-            if (ErrorCode.isFailure(ec)) {
-                if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
-                    return CoderResult.OVERFLOW;
-                } else if (ec == ErrorCode.U_TRUNCATED_CHAR_FOUND) {//CSDL: add this truncated character error handling
-                    if (data[INPUT_OFFSET] > 0) {
-                        return CoderResult.malformedForLength(data[INPUT_OFFSET]);
-                    }
-                } else {
-                    throw ErrorCode.throwException(ec);
-                }
-            }
-            return CoderResult.UNDERFLOW;
-        } finally {
-            setPosition(out);
-            implReset();
-        }
-    }
-
-    /**
-     * Resets the from Unicode mode of converter
-     * @stable ICU 2.4
-     */
-    protected void implReset() {
-        NativeConverter.resetCharToByte(converterHandle);
-        data[INPUT_OFFSET] = 0;
-        data[OUTPUT_OFFSET] = 0;
-        data[INVALID_CHARS] = 0;
-        data[INPUT_HELD] = 0;
-        savedInputHeldLen = 0;
-    }
-
-    /**
-     * Encodes one or more chars. The default behavior of the
-     * converter is stop and report if an error in input stream is encountered.
-     * To set different behavior use @see CharsetEncoder.onMalformedInput()
-     * @param in buffer to decode
-     * @param out buffer to populate with decoded result
-     * @return result of decoding action. Returns CoderResult.UNDERFLOW if the decoding
-     *       action succeeds or more input is needed for completing the decoding action.
-     * @stable ICU 2.4
-     */
-    protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) {
-        if (!in.hasRemaining()) {
-            return CoderResult.UNDERFLOW;
-        }
-
-        data[INPUT_OFFSET] = getArray(in);
-        data[OUTPUT_OFFSET]= getArray(out);
-        data[INPUT_HELD] = 0;
-        // BEGIN android-added
-        data[INVALID_CHARS] = 0; // Make sure we don't see earlier errors.
-        // END android added
-
-        try {
-            /* do the conversion */
-            ec = NativeConverter.encode(converterHandle,/* Handle to ICU Converter */
-                                        input, /* input array of bytes */
-                                        inEnd, /* last index+1 to be converted */
-                                        output, /* output array of chars */
-                                        outEnd, /* output index+1 to be written */
-                                        data, /* contains data, inOff,outOff */
-                                        false /* don't flush the data */
-                                        );
-            if (ErrorCode.isFailure(ec)) {
-                /* If we don't have room for the output return error */
-                if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) {
-                    return CoderResult.OVERFLOW;
-                } else if (ec == ErrorCode.U_INVALID_CHAR_FOUND) {
-                    return CoderResult.unmappableForLength(data[INVALID_CHARS]);
-                } else if (ec == ErrorCode.U_ILLEGAL_CHAR_FOUND) {
-                    // in.position(in.position() - 1);
-                    return CoderResult.malformedForLength(data[INVALID_CHARS]);
-                }
-            }
-            return CoderResult.UNDERFLOW;
-        } finally {
-            /* save state */
-            setPosition(in);
-            setPosition(out);
-        }
-    }
-
-    public boolean canEncode(char c) {
-        return canEncode((int) c);
-    }
-
-    public boolean canEncode(int codePoint) {
-        return NativeConverter.canEncode(converterHandle, codePoint);
-    }
-
-    /**
-     * Releases the system resources by cleanly closing ICU converter opened
-     * @exception Throwable exception thrown by super class' finalize method
-     * @stable ICU 2.4
-     */
-    @Override protected void finalize() throws Throwable {
-        try {
-            NativeConverter.closeConverter(converterHandle);
-            converterHandle=0;
-        } finally {
-            super.finalize();
-        }
-    }
-
-    //------------------------------------------
-    // private utility methods
-    //------------------------------------------
-    private int getArray(ByteBuffer out) {
-        if (out.hasArray()) {
-            // BEGIN android-changed: take arrayOffset into account
-            output = out.array();
-            outEnd = out.arrayOffset() + out.limit();
-            return out.arrayOffset() + out.position();
-            // END android-changed
-        } else {
-            outEnd = out.remaining();
-            // BEGIN android-added
-            if (allocatedOutput == null || (outEnd > allocatedOutput.length)) {
-                allocatedOutput = new byte[outEnd];
-            }
-            output = allocatedOutput;
-            // END android-added
-            //since the new
-            // buffer start position
-            // is 0
-            return 0;
-        }
-    }
-
-    private int getArray(CharBuffer in) {
-        if (in.hasArray()) {
-            // BEGIN android-changed: take arrayOffset into account
-            input = in.array();
-            inEnd = in.arrayOffset() + in.limit();
-            return in.arrayOffset() + in.position() + savedInputHeldLen;/*exclude the number fo bytes held in previous conversion*/
-            // END android-changed
-        } else {
-            inEnd = in.remaining();
-            // BEGIN android-added
-            if (allocatedInput == null || (inEnd > allocatedInput.length)) {
-                allocatedInput = new char[inEnd];
-            }
-            input = allocatedInput;
-            // END android-added
-            // save the current position
-            int pos = in.position();
-            in.get(input,0,inEnd);
-            // reset the position
-            in.position(pos);
-            // the start position
-            // of the new buffer
-            // is whatever is savedInputLen
-            return savedInputHeldLen;
-        }
-
-    }
-    private void setPosition(ByteBuffer out) {
-
-        if (out.hasArray()) {
-            // in getArray method we accessed the
-            // array backing the buffer directly and wrote to
-            // it, so just just set the position and return.
-            // This is done to avoid the creation of temp array.
-            // BEGIN android-changed: take arrayOffset into account
-            out.position(out.position() + data[OUTPUT_OFFSET] - out.arrayOffset());
-            // END android-changed
-        } else {
-            out.put(output, 0, data[OUTPUT_OFFSET]);
-        }
-        // BEGIN android-added
-        // release reference to output array, which may not be ours
-        output = null;
-        // END android-added
-    }
-    private void setPosition(CharBuffer in){
-
-// BEGIN android-removed
-//        // was there input held in the previous invocation of encodeLoop
-//        // that resulted in output in this invocation?
-//        if(data[OUTPUT_OFFSET]>0 && savedInputHeldLen>0){
-//            int len = in.position() + data[INPUT_OFFSET] + savedInputHeldLen;
-//            in.position(len);
-//            savedInputHeldLen = data[INPUT_HELD];
-//        }else{
-//            in.position(in.position() + data[INPUT_OFFSET] + savedInputHeldLen);
-//            savedInputHeldLen = data[INPUT_HELD];
-//            in.position(in.position() - savedInputHeldLen);
-//        }
-// END android-removed
-
-// BEGIN android-added
-        // Slightly rewired original code to make it cleaner. Also
-        // added a fix for the problem where input characters got
-        // lost when invalid characters were encountered. Not sure
-        // what happens when data[INVALID_CHARS] is > 1, though,
-        // since we never saw that happening.
-        int len = in.position() + data[INPUT_OFFSET] + savedInputHeldLen;
-        len -= data[INVALID_CHARS]; // Otherwise position becomes wrong.
-        in.position(len);
-        savedInputHeldLen = data[INPUT_HELD];
-        // was there input held in the previous invocation of encodeLoop
-        // that resulted in output in this invocation?
-        if(!(data[OUTPUT_OFFSET]>0 && savedInputHeldLen>0)){
-            in.position(in.position() - savedInputHeldLen);
-        }
-// END android-added
-
-        // BEGIN android-added
-        // release reference to input array, which may not be ours
-        input = null;
-        // END android-added
-    }
-}
diff --git a/luni/src/main/java/libcore/icu/CollationElementIteratorICU.java b/luni/src/main/java/libcore/icu/CollationElementIteratorICU.java
index 6d85718..05caa0b 100644
--- a/luni/src/main/java/libcore/icu/CollationElementIteratorICU.java
+++ b/luni/src/main/java/libcore/icu/CollationElementIteratorICU.java
@@ -99,11 +99,9 @@
         NativeCollation.setText(address, source);
     }
 
-    // BEGIN android-added
     public void setText(CharacterIterator source) {
         NativeCollation.setText(address, source.toString());
     }
-    // END android-added
 
     /**
      * Get the offset of the current source character.
diff --git a/luni/src/main/java/libcore/icu/ICU.java b/luni/src/main/java/libcore/icu/ICU.java
index f70cf2c..68a8820 100644
--- a/luni/src/main/java/libcore/icu/ICU.java
+++ b/luni/src/main/java/libcore/icu/ICU.java
@@ -127,6 +127,16 @@
         return localesFromStrings(getAvailableNumberFormatLocalesNative());
     }
 
+    /**
+     * Returns the ICU version in use. This is "4.4" for gingerbread, for example.
+     */
+    public static native String getIcuVersion();
+
+    /**
+     * Returns the Unicode version our ICU supports. This is "5.2" for gingerbread, for example.
+     */
+    public static native String getUnicodeVersion();
+
     // --- Case mapping.
 
     public static native String toLowerCase(String s, String localeName);
@@ -141,9 +151,11 @@
     private static native String[] getAvailableLocalesNative();
     private static native String[] getAvailableNumberFormatLocalesNative();
 
-    public static native String getCurrencyCodeNative(String locale);
-    public static native int getCurrencyFractionDigitsNative(String currencyCode);
-    public static native String getCurrencySymbolNative(String locale, String currencyCode);
+    public static native String[] getAvailableCurrencyCodes();
+    public static native String getCurrencyCode(String countryCode);
+    public static native String getCurrencyDisplayName(String locale, String currencyCode);
+    public static native int getCurrencyFractionDigits(String currencyCode);
+    public static native String getCurrencySymbol(String locale, String currencyCode);
 
     public static native String getDisplayCountryNative(String countryCode, String locale);
     public static native String getDisplayLanguageNative(String languageCode, String locale);
diff --git a/luni/src/main/java/libcore/icu/NativeConverter.java b/luni/src/main/java/libcore/icu/NativeConverter.java
index 6165c61..2d8630c 100644
--- a/luni/src/main/java/libcore/icu/NativeConverter.java
+++ b/luni/src/main/java/libcore/icu/NativeConverter.java
@@ -15,83 +15,12 @@
 import java.nio.charset.CodingErrorAction;
 
 public final class NativeConverter {
-    /**
-     * Converts an array of bytes containing characters in an external
-     * encoding into an array of Unicode characters.  This  method allows
-     * buffer-by-buffer conversion of a data stream.  The state of the
-     * conversion is saved between calls.  Among other things,
-     * this means multibyte input sequences can be split between calls.
-     * If a call to results in an error, the conversion may be
-     * continued by calling this method again with suitably modified parameters.
-     * All conversions should be finished with a call to the flush method.
-     *
-     * @param converterHandle Address of converter object created by C code
-     * @param input byte array containing text to be converted.
-     * @param inEnd stop conversion at this offset in input array (exclusive).
-     * @param output character array to receive conversion result.
-     * @param outEnd stop writing to output array at this offset (exclusive).
-     * @param data integer array containing the following data
-     *        data[0] = inputOffset
-     *        data[1] = outputOffset
-     * @return int error code returned by ICU
-     * @internal ICU 2.4
-     */
     public static native int decode(long converterHandle, byte[] input, int inEnd,
             char[] output, int outEnd, int[] data, boolean flush);
 
-    /**
-     * Converts an array of Unicode chars to an array of bytes in an external encoding.
-     * This  method allows a buffer by buffer conversion of a data stream.  The state of the
-     * conversion is saved between calls to convert.  Among other things,
-     * this means multibyte input sequences can be split between calls.
-     * If a call results in an error, the conversion may be
-     * continued by calling this method again with suitably modified parameters.
-     * All conversions should be finished with a call to the flush method.
-     *
-     * @param converterHandle Address of converter object created by C code
-     * @param input char array containing text to be converted.
-     * @param inEnd stop conversion at this offset in input array (exclusive).
-     * @param output byte array to receive conversion result.
-     * @param outEnd stop writing to output array at this offset (exclusive).
-     * @param data integer array containing the following data
-     *        data[0] = inputOffset
-     *        data[1] = outputOffset
-     * @return int error code returned by ICU
-     * @internal ICU 2.4
-     */
     public static native int encode(long converterHandle, char[] input, int inEnd,
             byte[] output, int outEnd, int[] data, boolean flush);
 
-    /**
-     * Writes any remaining output to the output buffer and resets the
-     * converter to its initial state.
-     *
-     * @param converterHandle Address of converter object created by C code
-     * @param output byte array to receive flushed output.
-     * @param outEnd stop writing to output array at this offset (exclusive).
-     * @return int error code returned by ICU
-     * @param data integer array containing the following data
-     *        data[0] = inputOffset
-     *        data[1] = outputOffset
-     * @internal ICU 2.4
-     */
-    public static native int flushCharToByte(long converterHandle, byte[] output, int outEnd, int[] data);
-
-    /**
-     * Writes any remaining output to the output buffer and resets the
-     * converter to its initial state.
-     *
-     * @param converterHandle Address of converter object created by the native code
-     * @param output char array to receive flushed output.
-     * @param outEnd stop writing to output array at this offset (exclusive).
-     * @return int error code returned by ICU
-     * @param data integer array containing the following data
-     *        data[0] = inputOffset
-     *        data[1] = outputOffset
-     * @internal ICU 2.4
-     */
-    public static native int flushByteToChar(long converterHandle, char[] output,  int outEnd, int[] data);
-
     public static native long openConverter(String encoding);
     public static native void closeConverter(long converterHandle);
 
@@ -129,9 +58,9 @@
         return setCallbackDecode(converterHandle,
                 translateCodingErrorAction(decoder.malformedInputAction()),
                 translateCodingErrorAction(decoder.unmappableCharacterAction()),
-                decoder.replacement().toCharArray());
+                decoder.replacement());
     }
-    private static native int setCallbackDecode(long converterHandle, int onMalformedInput, int onUnmappableInput, char[] subChars);
+    private static native int setCallbackDecode(long converterHandle, int onMalformedInput, int onUnmappableInput, String subChars);
 
     public static int setCallbackEncode(long converterHandle, CharsetEncoder encoder) {
         return setCallbackEncode(converterHandle,
diff --git a/luni/src/main/java/libcore/icu/NativePluralRules.java b/luni/src/main/java/libcore/icu/NativePluralRules.java
index a11224e..47cc76b 100644
--- a/luni/src/main/java/libcore/icu/NativePluralRules.java
+++ b/luni/src/main/java/libcore/icu/NativePluralRules.java
@@ -38,7 +38,7 @@
         this.address = address;
     }
 
-    @Override public void finalize() throws Throwable {
+    @Override protected void finalize() throws Throwable {
         try {
             finalizeImpl(address);
         } finally {
diff --git a/luni/src/main/java/libcore/icu/TimeZones.java b/luni/src/main/java/libcore/icu/TimeZones.java
index 1b5de15..841f30f 100644
--- a/luni/src/main/java/libcore/icu/TimeZones.java
+++ b/luni/src/main/java/libcore/icu/TimeZones.java
@@ -16,10 +16,12 @@
 
 package libcore.icu;
 
+import java.util.Arrays;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.Locale;
 import java.util.TimeZone;
-import java.util.logging.Logger;
+import libcore.util.BasicLruCache;
 
 /**
  * Provides access to ICU's time zone data.
@@ -27,129 +29,92 @@
 public final class TimeZones {
     private static final String[] availableTimeZones = TimeZone.getAvailableIDs();
 
+    private static final ZoneStringsCache cachedZoneStrings = new ZoneStringsCache();
+    static {
+        // Ensure that we pull in the zone strings for en_US and the user's default locale.
+        // (All devices must support Locale.US, and it's used for things like HTTP headers.)
+        // This is especially useful on Android because we'll share this via the Zygote.
+        cachedZoneStrings.get(Locale.US);
+        cachedZoneStrings.get(Locale.getDefault());
+    }
+
+    public static class ZoneStringsCache extends BasicLruCache<Locale, String[][]> {
+        // De-duplicate the strings (http://b/2672057).
+        private final HashMap<String, String> internTable = new HashMap<String, String>();
+
+        public ZoneStringsCache() {
+            // We make room for all the time zones known to the system, since each set of strings
+            // isn't particularly large (and we remove duplicates), but is currently (Honeycomb)
+            // really expensive to compute.
+            // If you change this, you might want to change the scope of the intern table too.
+            super(availableTimeZones.length);
+        }
+
+        @Override protected String[][] create(Locale locale) {
+            long start, nativeStart;
+            start = nativeStart = System.currentTimeMillis();
+            String[][] result = getZoneStringsImpl(locale.toString(), availableTimeZones);
+            long nativeEnd = System.currentTimeMillis();
+            internStrings(result);
+            // Ending up in this method too often is an easy way to make your app slow, so we ensure
+            // it's easy to tell from the log (a) what we were doing, (b) how long it took, and
+            // (c) that it's all ICU's fault.
+            long end = System.currentTimeMillis();
+            long duration = end - start;
+            long nativeDuration = nativeEnd - nativeStart;
+            System.logI("Loaded time zone names for " + locale + " in " + duration + "ms" +
+                    " (" + nativeDuration + "ms in ICU)");
+            return result;
+        }
+
+        private synchronized void internStrings(String[][] result) {
+            for (int i = 0; i < result.length; ++i) {
+                for (int j = 1; j <= 4; ++j) {
+                    String original = result[i][j];
+                    String nonDuplicate = internTable.get(original);
+                    if (nonDuplicate == null) {
+                        internTable.put(original, original);
+                    } else {
+                        result[i][j] = nonDuplicate;
+                    }
+                }
+            }
+        }
+    }
+
+    private static final Comparator<String[]> ZONE_STRINGS_COMPARATOR = new Comparator<String[]>() {
+        public int compare(String[] lhs, String[] rhs) {
+            return lhs[0].compareTo(rhs[0]);
+        }
+    };
+
     private TimeZones() {}
 
     /**
-     * Implements TimeZone.getDisplayName by asking ICU.
+     * Returns the appropriate string from 'zoneStrings'. Used with getZoneStrings.
      */
-    public static String getDisplayName(String id, boolean daylight, int style, Locale locale) {
-        // If we already have the strings, linear search through them is 10x quicker than
-        // calling ICU for just the one we want.
-        if (CachedTimeZones.locale.equals(locale)) {
-            String result = lookupDisplayName(CachedTimeZones.names, id, daylight, style);
-            if (result != null) {
-                return result;
-            }
-        }
-        return getDisplayNameImpl(id, daylight, style, locale.toString());
-    }
-
-    public static String lookupDisplayName(String[][] zoneStrings, String id, boolean daylight, int style) {
-        for (String[] row : zoneStrings) {
-            if (row[0].equals(id)) {
-                if (daylight) {
-                    return (style == TimeZone.LONG) ? row[3] : row[4];
-                } else {
-                    return (style == TimeZone.LONG) ? row[1] : row[2];
-                }
+    public static String getDisplayName(String[][] zoneStrings, String id, boolean daylight, int style) {
+        String[] needle = new String[] { id };
+        int index = Arrays.binarySearch(zoneStrings, needle, ZONE_STRINGS_COMPARATOR);
+        if (index >= 0) {
+            String[] row = zoneStrings[index];
+            if (daylight) {
+                return (style == TimeZone.LONG) ? row[3] : row[4];
+            } else {
+                return (style == TimeZone.LONG) ? row[1] : row[2];
             }
         }
         return null;
     }
 
     /**
-     * Initialization holder for default time zone names. This class will
-     * be preloaded by the zygote to share the time and space costs of setting
-     * up the list of time zone names, so although it looks like the lazy
-     * initialization idiom, it's actually the opposite.
-     */
-    private static class CachedTimeZones {
-        /**
-         * Name of default locale at the time this class was initialized.
-         */
-        private static final Locale locale = Locale.getDefault();
-
-        /**
-         * Names of time zones for the default locale.
-         */
-        private static final String[][] names = createZoneStringsFor(locale);
-    }
-
-    /**
-     * Creates array of time zone names for the given locale.
-     * This method takes about 2s to run on a 400MHz ARM11.
-     */
-    private static String[][] createZoneStringsFor(Locale locale) {
-        long start = System.currentTimeMillis();
-
-        /*
-         * The following code is optimized for fast native response (the time a
-         * method call can be in native code is limited). It prepares an empty
-         * array to keep native code from having to create new Java objects. It
-         * also fill in the time zone IDs to speed things up a bit. There's one
-         * array for each time zone name type. (standard/long, standard/short,
-         * daylight/long, daylight/short) The native method that fetches these
-         * strings is faster if it can do all entries of one type, before having
-         * to change to the next type. That's why the array passed down to
-         * native has 5 entries, each providing space for all time zone names of
-         * one type. Likely this access to the fields is much faster in the
-         * native code because there's less array access overhead.
-         */
-        String[][] arrayToFill = new String[5][];
-        arrayToFill[0] = availableTimeZones.clone();
-        arrayToFill[1] = new String[availableTimeZones.length];
-        arrayToFill[2] = new String[availableTimeZones.length];
-        arrayToFill[3] = new String[availableTimeZones.length];
-        arrayToFill[4] = new String[availableTimeZones.length];
-
-        // Don't be distracted by all the code either side of this line: this is the expensive bit!
-        getZoneStringsImpl(arrayToFill, locale.toString());
-
-        // Reorder the entries so we get the expected result.
-        // We also take the opportunity to de-duplicate the names (http://b/2672057).
-        HashMap<String, String> internTable = new HashMap<String, String>();
-        String[][] result = new String[availableTimeZones.length][5];
-        for (int i = 0; i < availableTimeZones.length; ++i) {
-            result[i][0] = arrayToFill[0][i];
-            for (int j = 1; j <= 4; ++j) {
-                String original = arrayToFill[j][i];
-                String nonDuplicate = internTable.get(original);
-                if (nonDuplicate == null) {
-                    internTable.put(original, original);
-                    nonDuplicate = original;
-                }
-                result[i][j] = nonDuplicate;
-            }
-        }
-
-        long duration = System.currentTimeMillis() - start;
-        Logger.global.info("Loaded time zone names for " + locale + " in " + duration + "ms.");
-
-        return result;
-    }
-
-    /**
      * Returns an array of time zone strings, as used by DateFormatSymbols.getZoneStrings.
      */
     public static String[][] getZoneStrings(Locale locale) {
         if (locale == null) {
             locale = Locale.getDefault();
         }
-
-        // TODO: We should force a reboot if the default locale changes.
-        if (CachedTimeZones.locale.equals(locale)) {
-            return clone2dStringArray(CachedTimeZones.names);
-        }
-
-        return createZoneStringsFor(locale);
-    }
-
-    public static String[][] clone2dStringArray(String[][] array) {
-        String[][] result = new String[array.length][];
-        for (int i = 0; i < array.length; ++i) {
-            result[i] = array[i].clone();
-        }
-        return result;
+        return cachedZoneStrings.get(locale);
     }
 
     /**
@@ -162,6 +127,5 @@
     }
 
     private static native String[] forCountryCode(String countryCode);
-    private static native void getZoneStringsImpl(String[][] arrayToFill, String locale);
-    private static native String getDisplayNameImpl(String id, boolean isDST, int style, String locale);
+    private static native String[][] getZoneStringsImpl(String locale, String[] timeZoneIds);
 }
diff --git a/luni/src/main/java/libcore/io/BlockGuardOs.java b/luni/src/main/java/libcore/io/BlockGuardOs.java
new file mode 100644
index 0000000..601cc11
--- /dev/null
+++ b/luni/src/main/java/libcore/io/BlockGuardOs.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import dalvik.system.BlockGuard;
+import java.io.FileDescriptor;
+import java.nio.ByteBuffer;
+import static libcore.io.OsConstants.*;
+
+/**
+ * Informs BlockGuard of any activity it should be aware of.
+ */
+public class BlockGuardOs extends ForwardingOs {
+    public BlockGuardOs(Os os) {
+        super(os);
+    }
+
+    public void fdatasync(FileDescriptor fd) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onWriteToDisk();
+        os.fdatasync(fd);
+    }
+
+    public void fsync(FileDescriptor fd) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onWriteToDisk();
+        os.fsync(fd);
+    }
+
+    public void ftruncate(FileDescriptor fd, long length) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onWriteToDisk();
+        os.ftruncate(fd, length);
+    }
+
+    public FileDescriptor open(String path, int flags, int mode) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onReadFromDisk();
+        if ((mode & O_ACCMODE) != O_RDONLY) {
+            BlockGuard.getThreadPolicy().onWriteToDisk();
+        }
+        return os.open(path, flags, mode);
+    }
+
+    public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onReadFromDisk();
+        return os.read(fd, buffer);
+    }
+
+    public int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onReadFromDisk();
+        return os.read(fd, bytes, byteOffset, byteCount);
+    }
+
+    public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onReadFromDisk();
+        return os.readv(fd, buffers, offsets, byteCounts);
+    }
+
+    public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onWriteToDisk();
+        return os.write(fd, buffer);
+    }
+
+    public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onWriteToDisk();
+        return os.write(fd, bytes, byteOffset, byteCount);
+    }
+
+    public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException {
+        BlockGuard.getThreadPolicy().onWriteToDisk();
+        return os.writev(fd, buffers, offsets, byteCounts);
+    }
+}
diff --git a/luni/src/main/java/libcore/io/ErrnoException.java b/luni/src/main/java/libcore/io/ErrnoException.java
new file mode 100644
index 0000000..c1d95d9
--- /dev/null
+++ b/luni/src/main/java/libcore/io/ErrnoException.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import java.io.IOException;
+import java.net.SocketException;
+import libcore.io.OsConstants;
+
+/**
+ * An unchecked exception thrown when {@link Os} methods fail. This exception contains the native
+ * errno value, for comparison against the constants in {@link OsConstants}, should sophisticated
+ * callers need to adjust their behavior based on the exact failure.
+ */
+public final class ErrnoException extends RuntimeException {
+    private final String functionName;
+    public final int errno;
+
+    public ErrnoException(String functionName, int errno) {
+        this.functionName = functionName;
+        this.errno = errno;
+    }
+
+    public ErrnoException(String functionName, int errno, Throwable cause) {
+        super(cause);
+        this.functionName = functionName;
+        this.errno = errno;
+    }
+
+    /**
+     * Converts the stashed function name and errno value to a human-readable string.
+     * We do this here rather than in the constructor so that callers only pay for
+     * this if they need it.
+     */
+    @Override public String getMessage() {
+        String errnoName = OsConstants.errnoName(errno);
+        if (errnoName == null) {
+            errnoName = "errno " + errno;
+        }
+        String description = Libcore.os.strerror(errno);
+        return functionName + " failed: " + errnoName + " (" + description + ")";
+    }
+
+    public IOException rethrowAsIOException() throws IOException {
+        IOException newException = new IOException(getMessage());
+        newException.initCause(this);
+        throw newException;
+    }
+
+    public SocketException rethrowAsSocketException() throws SocketException {
+        SocketException newException = new SocketException(getMessage());
+        newException.initCause(this);
+        throw newException;
+    }
+}
diff --git a/luni/src/main/java/libcore/io/ForwardingOs.java b/luni/src/main/java/libcore/io/ForwardingOs.java
new file mode 100644
index 0000000..352a41e
--- /dev/null
+++ b/luni/src/main/java/libcore/io/ForwardingOs.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import java.io.FileDescriptor;
+import java.net.InetAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import libcore.util.MutableInt;
+import libcore.util.MutableLong;
+
+/**
+ * Subclass this if you want to override some {@link Os} methods but otherwise delegate.
+ */
+public class ForwardingOs implements Os {
+    protected final Os os;
+
+    public ForwardingOs(Os os) {
+        this.os = os;
+    }
+
+    public boolean access(String path, int mode) throws ErrnoException { return os.access(path, mode); }
+    public void chmod(String path, int mode) throws ErrnoException { os.chmod(path, mode); }
+    public void close(FileDescriptor fd) throws ErrnoException { os.close(fd); }
+    public String[] environ() { return os.environ(); }
+    public int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException { return os.fcntlVoid(fd, cmd); }
+    public int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException { return os.fcntlLong(fd, cmd, arg); }
+    public int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException { return os.fcntlFlock(fd, cmd, arg); }
+    public void fdatasync(FileDescriptor fd) throws ErrnoException { os.fdatasync(fd); }
+    public StructStat fstat(FileDescriptor fd) throws ErrnoException { return os.fstat(fd); }
+    public StructStatFs fstatfs(FileDescriptor fd) throws ErrnoException { return os.fstatfs(fd); }
+    public void fsync(FileDescriptor fd) throws ErrnoException { os.fsync(fd); }
+    public void ftruncate(FileDescriptor fd, long length) throws ErrnoException { os.ftruncate(fd, length); }
+    public String getenv(String name) { return os.getenv(name); }
+    public SocketAddress getsockname(FileDescriptor fd) throws ErrnoException { return os.getsockname(fd); }
+    public int getsockoptByte(FileDescriptor fd, int level, int option) throws ErrnoException { return os.getsockoptByte(fd, level, option); }
+    public InetAddress getsockoptInAddr(FileDescriptor fd, int level, int option) throws ErrnoException { return os.getsockoptInAddr(fd, level, option); }
+    public int getsockoptInt(FileDescriptor fd, int level, int option) throws ErrnoException { return os.getsockoptInt(fd, level, option); }
+    public StructLinger getsockoptLinger(FileDescriptor fd, int level, int option) throws ErrnoException { return os.getsockoptLinger(fd, level, option); }
+    public StructTimeval getsockoptTimeval(FileDescriptor fd, int level, int option) throws ErrnoException { return os.getsockoptTimeval(fd, level, option); }
+    public int ioctlInt(FileDescriptor fd, int cmd, MutableInt arg) throws ErrnoException { return os.ioctlInt(fd, cmd, arg); }
+    public boolean isatty(FileDescriptor fd) { return os.isatty(fd); }
+    public void listen(FileDescriptor fd, int backlog) throws ErrnoException { os.listen(fd, backlog); }
+    public long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException { return os.lseek(fd, offset, whence); }
+    public StructStat lstat(String path) throws ErrnoException { return os.lstat(path); }
+    public void mincore(long address, long byteCount, byte[] vector) throws ErrnoException { os.mincore(address, byteCount, vector); }
+    public void mkdir(String path, int mode) throws ErrnoException { os.mkdir(path, mode); }
+    public void mlock(long address, long byteCount) throws ErrnoException { os.mlock(address, byteCount); }
+    public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException { return os.mmap(address, byteCount, prot, flags, fd, offset); }
+    public void msync(long address, long byteCount, int flags) throws ErrnoException { os.msync(address, byteCount, flags); }
+    public void munlock(long address, long byteCount) throws ErrnoException { os.munlock(address, byteCount); }
+    public void munmap(long address, long byteCount) throws ErrnoException { os.munmap(address, byteCount); }
+    public FileDescriptor open(String path, int flags, int mode) throws ErrnoException { return os.open(path, flags, mode); }
+    public FileDescriptor[] pipe() throws ErrnoException { return os.pipe(); }
+    public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException { return os.read(fd, buffer); }
+    public int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { return os.read(fd, bytes, byteOffset, byteCount); }
+    public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException { return os.readv(fd, buffers, offsets, byteCounts); }
+    public void remove(String path) throws ErrnoException { os.remove(path); }
+    public void rename(String oldPath, String newPath) throws ErrnoException { os.rename(oldPath, newPath); }
+    public long sendfile(FileDescriptor outFd, FileDescriptor inFd, MutableLong inOffset, long byteCount) throws ErrnoException { return os.sendfile(outFd, inFd, inOffset, byteCount); }
+    public void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException { os.setsockoptInt(fd, level, option, value); }
+    public void shutdown(FileDescriptor fd, int how) throws ErrnoException { os.shutdown(fd, how); }
+    public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException { return os.socket(domain, type, protocol); }
+    public StructStat stat(String path) throws ErrnoException { return os.stat(path); }
+    public StructStatFs statfs(String path) throws ErrnoException { return os.statfs(path); }
+    public String strerror(int errno) { return os.strerror(errno); }
+    public void symlink(String oldPath, String newPath) throws ErrnoException { os.symlink(oldPath, newPath); }
+    public long sysconf(int name) { return os.sysconf(name); }
+    public StructUtsname uname() throws ErrnoException { return os.uname(); }
+    public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException { return os.write(fd, buffer); }
+    public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException { return os.write(fd, bytes, byteOffset, byteCount); }
+    public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException { return os.writev(fd, buffers, offsets, byteCounts); }
+}
diff --git a/luni/src/main/java/libcore/io/HeapBufferIterator.java b/luni/src/main/java/libcore/io/HeapBufferIterator.java
index ab44b99..23e457e 100644
--- a/luni/src/main/java/libcore/io/HeapBufferIterator.java
+++ b/luni/src/main/java/libcore/io/HeapBufferIterator.java
@@ -17,7 +17,7 @@
 package libcore.io;
 
 import java.nio.ByteOrder;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 /**
  * Iterates over big- or little-endian bytes in a Java byte[].
@@ -59,19 +59,19 @@
     }
 
     public int readInt() {
-        int result = OSMemory.peekInt(buffer, offset + position, order);
+        int result = Memory.peekInt(buffer, offset + position, order);
         position += SizeOf.INT;
         return result;
     }
 
     public void readIntArray(int[] dst, int dstOffset, int intCount) {
         final int byteCount = intCount * SizeOf.INT;
-        OSMemory.unsafeBulkGet(dst, dstOffset, byteCount, buffer, offset + position, SizeOf.INT, order.needsSwap);
+        Memory.unsafeBulkGet(dst, dstOffset, byteCount, buffer, offset + position, SizeOf.INT, order.needsSwap);
         position += byteCount;
     }
 
     public short readShort() {
-        short result = OSMemory.peekShort(buffer, offset + position, order);
+        short result = Memory.peekShort(buffer, offset + position, order);
         position += SizeOf.SHORT;
         return result;
     }
diff --git a/luni/src/main/java/libcore/io/IoUtils.java b/luni/src/main/java/libcore/io/IoUtils.java
index 29a64ba..0a4de9f 100644
--- a/luni/src/main/java/libcore/io/IoUtils.java
+++ b/luni/src/main/java/libcore/io/IoUtils.java
@@ -18,18 +18,143 @@
 
 import java.io.Closeable;
 import java.io.FileDescriptor;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.io.RandomAccessFile;
+import java.net.InetAddress;
+import java.net.Inet4Address;
+import java.net.InetSocketAddress;
 import java.net.Socket;
+import java.net.SocketAddress;
+import java.net.SocketException;
+import java.net.SocketOptions;
+import java.util.Arrays;
+import libcore.io.ErrnoException;
+import libcore.io.Libcore;
+import libcore.util.MutableInt;
+import static libcore.io.OsConstants.*;
 
 public final class IoUtils {
     private IoUtils() {
     }
 
     /**
-     * Calls close(2) on 'fd'. Also resets the internal int to -1.
+     * Implements java.io/java.net "available" semantics.
      */
-    public static native void close(FileDescriptor fd) throws IOException;
+    public static int available(FileDescriptor fd) throws IOException {
+        try {
+            MutableInt available = new MutableInt(0);
+            int rc = Libcore.os.ioctlInt(fd, FIONREAD, available);
+            if (available.value < 0) {
+                // If the fd refers to a regular file, the result is the difference between
+                // the file size and the file position. This may be negative if the position
+                // is past the end of the file. If the fd refers to a special file masquerading
+                // as a regular file, the result may be negative because the special file
+                // may appear to have zero size and yet a previous read call may have
+                // read some amount of data and caused the file position to be advanced.
+                available.value = 0;
+            }
+            return available.value;
+        } catch (ErrnoException errnoException) {
+            if (errnoException.errno == ENOTTY) {
+                // The fd is unwilling to opine about its read buffer.
+                return 0;
+            }
+            throw errnoException.rethrowAsIOException();
+        }
+    }
+
+    /**
+     * java.io only throws FileNotFoundException when opening files, regardless of what actually
+     * went wrong. Additionally, java.io is more restrictive than POSIX when it comes to opening
+     * directories: POSIX says read-only is okay, but java.io doesn't even allow that. We also
+     * have an Android-specific hack to alter the default permissions.
+     */
+    public static FileDescriptor open(String path, int flags) throws FileNotFoundException {
+        FileDescriptor fd = null;
+        try {
+            // On Android, we don't want default permissions to allow global access.
+            int mode = ((flags & O_ACCMODE) == O_RDONLY) ? 0 : 0600;
+            fd = Libcore.os.open(path, flags, mode);
+            if (fd.valid()) {
+                // Posix open(2) fails with EISDIR only if you ask for write permission.
+                // Java disallows reading directories too.
+                boolean isDirectory = false;
+                if (S_ISDIR(Libcore.os.fstat(fd).st_mode)) {
+                    throw new ErrnoException("open", EISDIR);
+                }
+            }
+            return fd;
+        } catch (ErrnoException errnoException) {
+            try {
+                if (fd != null) {
+                    close(fd);
+                }
+            } catch (IOException ignored) {
+            }
+            FileNotFoundException ex = new FileNotFoundException(path + ": " + errnoException.getMessage());
+            ex.initCause(errnoException);
+            throw ex;
+        }
+    }
+
+    /**
+     * java.io thinks that a read at EOF is an error and should return -1, contrary to traditional
+     * Unix practice where you'd read until you got 0 bytes (and any future read would return -1).
+     */
+    public static int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws IOException {
+        Arrays.checkOffsetAndCount(bytes.length, byteOffset, byteCount);
+        if (byteCount == 0) {
+            return 0;
+        }
+        try {
+            int readCount = Libcore.os.read(fd, bytes, byteOffset, byteCount);
+            if (readCount == 0) {
+                return -1;
+            }
+            return readCount;
+        } catch (ErrnoException errnoException) {
+            if (errnoException.errno == EAGAIN) {
+                // We return 0 rather than throw if we try to read from an empty non-blocking pipe.
+                return 0;
+            }
+            throw errnoException.rethrowAsIOException();
+        }
+    }
+
+    /**
+     * java.io always writes every byte it's asked to, or fails with an error. (That is, unlike
+     * Unix it never just writes as many bytes as happens to be convenient.)
+     */
+    public static void write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws IOException {
+        Arrays.checkOffsetAndCount(bytes.length, byteOffset, byteCount);
+        if (byteCount == 0) {
+            return;
+        }
+        try {
+            while (byteCount > 0) {
+                int bytesWritten = Libcore.os.write(fd, bytes, byteOffset, byteCount);
+                byteCount -= bytesWritten;
+                byteOffset += bytesWritten;
+            }
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
+    }
+
+    /**
+     * Calls close(2) on 'fd'. Also resets the internal int to -1. Does nothing if 'fd' is null
+     * or invalid.
+     */
+    public static void close(FileDescriptor fd) throws IOException {
+        try {
+            if (fd != null && fd.valid()) {
+                Libcore.os.close(fd);
+            }
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
+    }
 
     /**
      * Closes 'closeable', ignoring any exceptions. Does nothing if 'closeable' is null.
@@ -44,6 +169,16 @@
     }
 
     /**
+     * Closes 'fd', ignoring any exceptions. Does nothing if 'fd' is null or invalid.
+     */
+    public static void closeQuietly(FileDescriptor fd) {
+        try {
+            IoUtils.close(fd);
+        } catch (IOException ignored) {
+        }
+    }
+
+    /**
      * Closes 'socket', ignoring any exceptions. Does nothing if 'socket' is null.
      */
     public static void closeQuietly(Socket socket) {
@@ -56,35 +191,146 @@
     }
 
     /**
-     * Returns the int file descriptor from within the given FileDescriptor 'fd'.
+     * Sets 'fd' to be blocking or non-blocking, according to the state of 'blocking'.
      */
-    public static native int getFd(FileDescriptor fd);
+    public static void setBlocking(FileDescriptor fd, boolean blocking) throws IOException {
+        try {
+            int flags = Libcore.os.fcntlVoid(fd, F_GETFL);
+            if (!blocking) {
+                flags |= O_NONBLOCK;
+            } else {
+                flags &= ~O_NONBLOCK;
+            }
+            Libcore.os.fcntlLong(fd, F_SETFL, flags);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsIOException();
+        }
+    }
 
-    /**
-     * Returns a new FileDescriptor whose internal integer is set to 'fd'.
-     */
-    public static FileDescriptor newFileDescriptor(int fd) {
-        FileDescriptor result = new FileDescriptor();
-        setFd(result, fd);
-        return result;
+    public static FileDescriptor socket(boolean stream) throws SocketException {
+        FileDescriptor fd;
+        try {
+            fd = Libcore.os.socket(AF_INET6, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
+
+            // The RFC (http://www.ietf.org/rfc/rfc3493.txt) says that IPV6_MULTICAST_HOPS defaults
+            // to 1. The Linux kernel (at least up to 2.6.38) accidentally defaults to 64 (which
+            // would be correct for the *unicast* hop limit).
+            // See http://www.spinics.net/lists/netdev/msg129022.html, though no patch appears to
+            // have been applied as a result of that discussion. If that bug is ever fixed, we can
+            // remove this code. Until then, we manually set the hop limit on IPv6 datagram sockets.
+            // (IPv4 is already correct.)
+            if (!stream) {
+                Libcore.os.setsockoptInt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, 1);
+            }
+
+            return fd;
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsSocketException();
+        }
     }
 
     /**
-     * Creates a pipe by calling pipe(2), returning the two file descriptors in
-     * elements 0 and 1 of the array 'fds'. fds[0] is the read end of the pipe.
-     * fds[1] is the write end of the pipe. Throws an appropriate IOException on failure.
+     * java.net has its own socket options similar to the underlying Unix ones. We paper over the
+     * differences here.
      */
-    public static native void pipe(int[] fds) throws IOException;
+    public static Object getSocketOption(FileDescriptor fd, int option) throws SocketException {
+        try {
+            return getSocketOptionErrno(fd, option);
+        } catch (ErrnoException errnoException) {
+            throw errnoException.rethrowAsSocketException();
+        }
+    }
 
-    /**
-     * Sets the int file descriptor within the given FileDescriptor 'fd' to 'newValue'.
-     */
-    public static native void setFd(FileDescriptor fd, int newValue);
+    // Socket options used by java.net but not exposed in SocketOptions.
+    public static final int MCAST_JOIN_GROUP = 19;
+    public static final int MCAST_LEAVE_GROUP = 20;
+    public static final int IP_MULTICAST_TTL = 17;
 
-    /**
-     * Sets 'fd' to be blocking or non-blocking, according to the state of 'blocking'.
-     */
-    public static native void setBlocking(FileDescriptor fd, boolean blocking) throws IOException;
+    private static Object getSocketOptionErrno(FileDescriptor fd, int option) throws SocketException {
+        switch (option) {
+        case SocketOptions.IP_MULTICAST_IF2:
+            if (boundIPv4(fd)) {
+                // The caller's asking for an interface index, but that's not how IPv4 works.
+                // Our Java should never get here, because we'll try IP_MULTICAST_IF first and
+                // that will satisfy us.
+                throw new SocketException("no interface index for IPv4");
+            } else {
+                return Libcore.os.getsockoptInt(fd, IPPROTO_IPV6, IPV6_MULTICAST_IF);
+            }
+        case SocketOptions.IP_MULTICAST_IF:
+            return Libcore.os.getsockoptInAddr(fd, IPPROTO_IP, IP_MULTICAST_IF);
+        case SocketOptions.IP_MULTICAST_LOOP:
+            if (boundIPv4(fd)) {
+                // Although IPv6 was cleaned up to use int, and IPv4 non-multicast TTL uses int,
+                // IPv4 multicast TTL uses a byte.
+                return booleanFromInt(Libcore.os.getsockoptByte(fd, IPPROTO_IP, IP_MULTICAST_LOOP));
+            } else {
+                return booleanFromInt(Libcore.os.getsockoptInt(fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP));
+            }
+        case IoUtils.IP_MULTICAST_TTL:
+            if (boundIPv4(fd)) {
+                // Although IPv6 was cleaned up to use int, IPv4 multicast loopback uses a byte.
+                return Libcore.os.getsockoptByte(fd, IPPROTO_IP, IP_MULTICAST_TTL);
+            } else {
+                return Libcore.os.getsockoptInt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS);
+            }
+        case SocketOptions.IP_TOS:
+            if (boundIPv4(fd)) {
+                return Libcore.os.getsockoptInt(fd, IPPROTO_IP, IP_TOS);
+            } else {
+                return Libcore.os.getsockoptInt(fd, IPPROTO_IPV6, IPV6_TCLASS);
+            }
+        case SocketOptions.SO_BROADCAST:
+            return booleanFromInt(Libcore.os.getsockoptInt(fd, SOL_SOCKET, SO_BROADCAST));
+        case SocketOptions.SO_KEEPALIVE:
+            return booleanFromInt(Libcore.os.getsockoptInt(fd, SOL_SOCKET, SO_KEEPALIVE));
+        case SocketOptions.SO_LINGER:
+            StructLinger linger = Libcore.os.getsockoptLinger(fd, SOL_SOCKET, SO_LINGER);
+            if (!linger.isOn()) {
+                return false;
+            }
+            return linger.l_linger;
+        case SocketOptions.SO_OOBINLINE:
+            return booleanFromInt(Libcore.os.getsockoptInt(fd, SOL_SOCKET, SO_OOBINLINE));
+        case SocketOptions.SO_RCVBUF:
+            return Libcore.os.getsockoptInt(fd, SOL_SOCKET, SO_SNDBUF);
+        case SocketOptions.SO_REUSEADDR:
+            return booleanFromInt(Libcore.os.getsockoptInt(fd, SOL_SOCKET, SO_REUSEADDR));
+        case SocketOptions.SO_SNDBUF:
+            return Libcore.os.getsockoptInt(fd, SOL_SOCKET, SO_SNDBUF);
+        case SocketOptions.SO_TIMEOUT:
+            return (int) Libcore.os.getsockoptTimeval(fd, SOL_SOCKET, SO_RCVTIMEO).toMillis();
+        case SocketOptions.TCP_NODELAY:
+            return booleanFromInt(Libcore.os.getsockoptInt(fd, IPPROTO_TCP, TCP_NODELAY));
+        default:
+            throw new SocketException("unknown socket option " + option);
+        }
+    }
+
+    private static boolean boundIPv4(FileDescriptor fd) {
+        SocketAddress sa = Libcore.os.getsockname(fd);
+        if (!(sa instanceof InetSocketAddress)) {
+            return false;
+        }
+        InetSocketAddress isa = (InetSocketAddress) sa;
+        return (isa.getAddress() instanceof Inet4Address);
+    }
+
+    private static boolean booleanFromInt(int i) {
+        return (i != 0);
+    }
+
+    public static InetAddress getSocketLocalAddress(FileDescriptor fd) {
+        SocketAddress sa = Libcore.os.getsockname(fd);
+        InetSocketAddress isa = (InetSocketAddress) sa;
+        return isa.getAddress();
+    }
+
+    public static int getSocketLocalPort(FileDescriptor fd) {
+        SocketAddress sa = Libcore.os.getsockname(fd);
+        InetSocketAddress isa = (InetSocketAddress) sa;
+        return isa.getPort();
+    }
 
     /**
      * Returns the contents of 'path' as a byte array.
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/io/Libcore.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/io/Libcore.java
index 5d1725d..5f57f91 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/io/Libcore.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,10 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.io;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class Libcore {
+    private Libcore() { }
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
-    }
+    public static Os os = new BlockGuardOs(new Posix());
 }
diff --git a/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java b/luni/src/main/java/libcore/io/Memory.java
similarity index 86%
rename from luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
rename to luni/src/main/java/libcore/io/Memory.java
index c567432..ddf0d52 100644
--- a/luni/src/main/java/org/apache/harmony/luni/platform/OSMemory.java
+++ b/luni/src/main/java/libcore/io/Memory.java
@@ -15,19 +15,17 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.platform;
+package libcore.io;
 
+import java.io.FileDescriptor;
 import java.io.IOException;
 import java.nio.ByteOrder;
-import java.nio.channels.FileChannel.MapMode;
 
 /**
- * This class enables direct access to memory.
- *
- * @hide - we should move this in with the NIO stuff it supports, and make it package-private again
+ * Unsafe access to memory.
  */
-public final class OSMemory {
-    private OSMemory() { }
+public final class Memory {
+    private Memory() { }
 
     /**
      * Used to optimize nio heap buffer bulk get operations. 'dst' must be a primitive array.
@@ -166,27 +164,4 @@
     public static native void pokeIntArray(int address, int[] src, int offset, int count, boolean swap);
     public static native void pokeLongArray(int address, long[] src, int offset, int count, boolean swap);
     public static native void pokeShortArray(int address, short[] src, int offset, int count, boolean swap);
-
-    public static int mmap(int fd, long offset, long size, MapMode mapMode) throws IOException {
-        // Check just those errors mmap(2) won't detect.
-        if (offset < 0 || size < 0 || offset > Integer.MAX_VALUE || size > Integer.MAX_VALUE) {
-            throw new IllegalArgumentException("offset=" + offset + " size=" + size);
-        }
-        int intMode = 0; // MapMode.PRIVATE
-        if (mapMode == MapMode.READ_ONLY) {
-            intMode = 1;
-        } else if (mapMode == MapMode.READ_WRITE) {
-            intMode = 2;
-        }
-        return mmapImpl(fd, offset, size, intMode);
-    }
-    private static native int mmapImpl(int fd, long offset, long size, int mapMode);
-
-    public static native void munmap(int addr, long size);
-
-    public static native void load(int addr, long size);
-
-    public static native boolean isLoaded(int addr, long size);
-
-    public static native void msync(int addr, long size);
 }
diff --git a/luni/src/main/java/libcore/io/MemoryMappedFile.java b/luni/src/main/java/libcore/io/MemoryMappedFile.java
index 10ef8f0..f1fc027 100644
--- a/luni/src/main/java/libcore/io/MemoryMappedFile.java
+++ b/luni/src/main/java/libcore/io/MemoryMappedFile.java
@@ -19,10 +19,13 @@
 import java.io.Closeable;
 import java.io.FileDescriptor;
 import java.io.IOException;
+import java.io.RandomAccessFile;
 import java.nio.ByteOrder;
 import java.nio.NioUtils;
 import java.nio.channels.FileChannel;
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Libcore;
+import libcore.io.Memory;
+import static libcore.io.OsConstants.*;
 
 /**
  * A memory-mapped file. Use {@link #mmap} to map a file, {@link #close} to unmap a file,
@@ -30,36 +33,26 @@
  * {@link BufferIterator} over the mapped data.
  */
 public final class MemoryMappedFile implements Closeable {
-    private int address;
+    private long address;
+    private final long size;
 
-    // Until we have 64-bit address spaces, we only need an int for 'size'.
-    private final int size;
-
-    private MemoryMappedFile(int address, int size) {
+    /**
+     * Use this if you've called {@code mmap} yourself.
+     */
+    public MemoryMappedFile(long address, long size) {
         this.address = address;
         this.size = size;
     }
 
-    public static MemoryMappedFile mmap(FileChannel fc, FileChannel.MapMode mapMode, long start, long size) throws IOException {
-        return mmap(NioUtils.getFd(fc), mapMode, start, size);
-    }
-
-    public static MemoryMappedFile mmap(FileDescriptor fd, FileChannel.MapMode mapMode, long start, long size) throws IOException {
-        return mmap(IoUtils.getFd(fd), mapMode, start, size);
-    }
-
-    private static MemoryMappedFile mmap(int fd, FileChannel.MapMode mapMode, long start, long size) throws IOException {
-        if (start < 0) {
-            throw new IllegalArgumentException("start < 0: " + start);
-        }
-        if (size <= 0) {
-            throw new IllegalArgumentException("size <= 0: " + size);
-        }
-        if ((start + size) > Integer.MAX_VALUE) {
-            throw new IllegalArgumentException("(start + size) > Integer.MAX_VALUE");
-        }
-        int address = OSMemory.mmap(fd, start, size, mapMode);
-        return new MemoryMappedFile(address, (int) size);
+    /**
+     * Use this to mmap the whole file read-only.
+     */
+    public static MemoryMappedFile mmapRO(String path) {
+        FileDescriptor fd = Libcore.os.open(path, O_RDONLY, 0);
+        long size = Libcore.os.fstat(fd).st_size;
+        long address = Libcore.os.mmap(0L, size, PROT_READ, MAP_SHARED, fd, 0);
+        Libcore.os.close(fd);
+        return new MemoryMappedFile(address, size);
     }
 
     /**
@@ -70,9 +63,9 @@
      * Calling this method invalidates any iterators over this {@code MemoryMappedFile}. It is an
      * error to use such an iterator after calling {@code close}.
      */
-    public synchronized void close() throws IOException {
+    public synchronized void close() {
         if (address != 0) {
-            OSMemory.munmap(address, size);
+            Libcore.os.munmap(address, size);
             address = 0;
         }
     }
@@ -81,20 +74,20 @@
      * Returns a new iterator that treats the mapped data as big-endian.
      */
     public BufferIterator bigEndianIterator() {
-        return new NioBufferIterator(address, size, ByteOrder.nativeOrder() != ByteOrder.BIG_ENDIAN);
+        return new NioBufferIterator((int) address, (int) size, ByteOrder.nativeOrder() != ByteOrder.BIG_ENDIAN);
     }
 
     /**
      * Returns a new iterator that treats the mapped data as little-endian.
      */
     public BufferIterator littleEndianIterator() {
-        return new NioBufferIterator(address, size, ByteOrder.nativeOrder() != ByteOrder.LITTLE_ENDIAN);
+        return new NioBufferIterator((int) address, (int) size, ByteOrder.nativeOrder() != ByteOrder.LITTLE_ENDIAN);
     }
 
     /**
      * Returns the size in bytes of the memory-mapped region.
      */
-    public int size() {
+    public long size() {
         return size;
     }
 }
diff --git a/luni/src/main/java/libcore/io/NioBufferIterator.java b/luni/src/main/java/libcore/io/NioBufferIterator.java
index 4a44c97..ae29e59 100644
--- a/luni/src/main/java/libcore/io/NioBufferIterator.java
+++ b/luni/src/main/java/libcore/io/NioBufferIterator.java
@@ -16,7 +16,7 @@
 
 package libcore.io;
 
-import org.apache.harmony.luni.platform.OSMemory;
+import libcore.io.Memory;
 
 /**
  * Iterates over big- or little-endian bytes on the native heap.
@@ -46,29 +46,29 @@
     }
 
     public void readByteArray(byte[] dst, int dstOffset, int byteCount) {
-        OSMemory.peekByteArray(address + position, dst, dstOffset, byteCount);
+        Memory.peekByteArray(address + position, dst, dstOffset, byteCount);
         position += byteCount;
     }
 
     public byte readByte() {
-        byte result = OSMemory.peekByte(address + position);
+        byte result = Memory.peekByte(address + position);
         ++position;
         return result;
     }
 
     public int readInt() {
-        int result = OSMemory.peekInt(address + position, swap);
+        int result = Memory.peekInt(address + position, swap);
         position += SizeOf.INT;
         return result;
     }
 
     public void readIntArray(int[] dst, int dstOffset, int intCount) {
-        OSMemory.peekIntArray(address + position, dst, dstOffset, intCount, swap);
+        Memory.peekIntArray(address + position, dst, dstOffset, intCount, swap);
         position += SizeOf.INT * intCount;
     }
 
     public short readShort() {
-        short result = OSMemory.peekShort(address + position, swap);
+        short result = Memory.peekShort(address + position, swap);
         position += SizeOf.SHORT;
         return result;
     }
diff --git a/luni/src/main/java/libcore/io/Os.java b/luni/src/main/java/libcore/io/Os.java
new file mode 100644
index 0000000..0f10584
--- /dev/null
+++ b/luni/src/main/java/libcore/io/Os.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import java.io.FileDescriptor;
+import java.net.InetAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import libcore.util.MutableInt;
+import libcore.util.MutableLong;
+
+public interface Os {
+    public boolean access(String path, int mode) throws ErrnoException;
+    public void chmod(String path, int mode) throws ErrnoException;
+    public void close(FileDescriptor fd) throws ErrnoException;
+    public String[] environ();
+    public int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException;
+    public int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException;
+    public int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException;
+    public void fdatasync(FileDescriptor fd) throws ErrnoException;
+    public StructStat fstat(FileDescriptor fd) throws ErrnoException;
+    public StructStatFs fstatfs(FileDescriptor fd) throws ErrnoException;
+    public void fsync(FileDescriptor fd) throws ErrnoException;
+    public void ftruncate(FileDescriptor fd, long length) throws ErrnoException;
+    public String getenv(String name);
+    public SocketAddress getsockname(FileDescriptor fd) throws ErrnoException;
+    public int getsockoptByte(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public InetAddress getsockoptInAddr(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public int getsockoptInt(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public StructLinger getsockoptLinger(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public StructTimeval getsockoptTimeval(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public int ioctlInt(FileDescriptor fd, int cmd, MutableInt arg) throws ErrnoException;
+    public boolean isatty(FileDescriptor fd);
+    public void listen(FileDescriptor fd, int backlog) throws ErrnoException;
+    public long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException;
+    public void mincore(long address, long byteCount, byte[] vector) throws ErrnoException;
+    public void mkdir(String path, int mode) throws ErrnoException;
+    public void mlock(long address, long byteCount) throws ErrnoException;
+    public long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException;
+    public void msync(long address, long byteCount, int flags) throws ErrnoException;
+    public void munlock(long address, long byteCount) throws ErrnoException;
+    public void munmap(long address, long byteCount) throws ErrnoException;
+    public FileDescriptor open(String path, int flags, int mode) throws ErrnoException;
+    public FileDescriptor[] pipe() throws ErrnoException;
+    public StructStat lstat(String path) throws ErrnoException;
+    public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException;
+    public int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException;
+    public int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException;
+    public void remove(String path) throws ErrnoException;
+    public void rename(String oldPath, String newPath) throws ErrnoException;
+    public long sendfile(FileDescriptor outFd, FileDescriptor inFd, MutableLong inOffset, long byteCount) throws ErrnoException;
+    public void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException;
+    public void shutdown(FileDescriptor fd, int how) throws ErrnoException;
+    public FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException;
+    public StructStat stat(String path) throws ErrnoException;
+    /* TODO: replace statfs with statvfs. */
+    public StructStatFs statfs(String path) throws ErrnoException;
+    public String strerror(int errno);
+    public void symlink(String oldPath, String newPath) throws ErrnoException;
+    public long sysconf(int name);
+    public StructUtsname uname() throws ErrnoException;
+    public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException;
+    public int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException;
+    public int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException;
+}
diff --git a/luni/src/main/java/libcore/io/OsConstants.java b/luni/src/main/java/libcore/io/OsConstants.java
new file mode 100644
index 0000000..616e60a
--- /dev/null
+++ b/luni/src/main/java/libcore/io/OsConstants.java
@@ -0,0 +1,600 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+public final class OsConstants {
+    private OsConstants() { }
+
+    public static boolean S_ISBLK(int mode) { return (mode & S_IFMT) == S_IFBLK; }
+    public static boolean S_ISCHR(int mode) { return (mode & S_IFMT) == S_IFCHR; }
+    public static boolean S_ISDIR(int mode) { return (mode & S_IFMT) == S_IFDIR; }
+    public static boolean S_ISFIFO(int mode) { return (mode & S_IFMT) == S_IFIFO; }
+    public static boolean S_ISREG(int mode) { return (mode & S_IFMT) == S_IFREG; }
+    public static boolean S_ISLNK(int mode) { return (mode & S_IFMT) == S_IFLNK; }
+    public static boolean S_ISSOCK(int mode) { return (mode & S_IFMT) == S_IFSOCK; }
+
+    public static int WEXITSTATUS(int status) { return (status & 0xff00) >> 8; }
+    public static boolean WCOREDUMP(int status) { return (status & 0x80) != 0; }
+    public static int WTERMSIG(int status) { return status & 0x7f; }
+    public static int WSTOPSIG(int status) { return WEXITSTATUS(status); }
+    public static boolean WIFEXITED(int status) { return (WTERMSIG(status) == 0); }
+    public static boolean WIFSTOPPED(int status) { return (WTERMSIG(status) == 0x7f); }
+    public static boolean WIFSIGNALED(int status) { return (WTERMSIG(status + 1) >= 2); }
+
+    public static final int AF_INET = placeholder();
+    public static final int AF_INET6 = placeholder();
+    public static final int AF_UNIX = placeholder();
+    public static final int AF_UNSPEC = placeholder();
+    public static final int E2BIG = placeholder();
+    public static final int EACCES = placeholder();
+    public static final int EADDRINUSE = placeholder();
+    public static final int EADDRNOTAVAIL = placeholder();
+    public static final int EAFNOSUPPORT = placeholder();
+    public static final int EAGAIN = placeholder();
+    public static final int EALREADY = placeholder();
+    public static final int EBADF = placeholder();
+    public static final int EBADMSG = placeholder();
+    public static final int EBUSY = placeholder();
+    public static final int ECANCELED = placeholder();
+    public static final int ECHILD = placeholder();
+    public static final int ECONNABORTED = placeholder();
+    public static final int ECONNREFUSED = placeholder();
+    public static final int ECONNRESET = placeholder();
+    public static final int EDEADLK = placeholder();
+    public static final int EDESTADDRREQ = placeholder();
+    public static final int EDOM = placeholder();
+    public static final int EDQUOT = placeholder();
+    public static final int EEXIST = placeholder();
+    public static final int EFAULT = placeholder();
+    public static final int EFBIG = placeholder();
+    public static final int EHOSTUNREACH = placeholder();
+    public static final int EIDRM = placeholder();
+    public static final int EILSEQ = placeholder();
+    public static final int EINPROGRESS = placeholder();
+    public static final int EINTR = placeholder();
+    public static final int EINVAL = placeholder();
+    public static final int EIO = placeholder();
+    public static final int EISCONN = placeholder();
+    public static final int EISDIR = placeholder();
+    public static final int ELOOP = placeholder();
+    public static final int EMFILE = placeholder();
+    public static final int EMLINK = placeholder();
+    public static final int EMSGSIZE = placeholder();
+    public static final int EMULTIHOP = placeholder();
+    public static final int ENAMETOOLONG = placeholder();
+    public static final int ENETDOWN = placeholder();
+    public static final int ENETRESET = placeholder();
+    public static final int ENETUNREACH = placeholder();
+    public static final int ENFILE = placeholder();
+    public static final int ENOBUFS = placeholder();
+    public static final int ENODATA = placeholder();
+    public static final int ENODEV = placeholder();
+    public static final int ENOENT = placeholder();
+    public static final int ENOEXEC = placeholder();
+    public static final int ENOLCK = placeholder();
+    public static final int ENOLINK = placeholder();
+    public static final int ENOMEM = placeholder();
+    public static final int ENOMSG = placeholder();
+    public static final int ENOPROTOOPT = placeholder();
+    public static final int ENOSPC = placeholder();
+    public static final int ENOSR = placeholder();
+    public static final int ENOSTR = placeholder();
+    public static final int ENOSYS = placeholder();
+    public static final int ENOTCONN = placeholder();
+    public static final int ENOTDIR = placeholder();
+    public static final int ENOTEMPTY = placeholder();
+    public static final int ENOTSOCK = placeholder();
+    public static final int ENOTSUP = placeholder();
+    public static final int ENOTTY = placeholder();
+    public static final int ENXIO = placeholder();
+    public static final int EOPNOTSUPP = placeholder();
+    public static final int EOVERFLOW = placeholder();
+    public static final int EPERM = placeholder();
+    public static final int EPIPE = placeholder();
+    public static final int EPROTO = placeholder();
+    public static final int EPROTONOSUPPORT = placeholder();
+    public static final int EPROTOTYPE = placeholder();
+    public static final int ERANGE = placeholder();
+    public static final int EROFS = placeholder();
+    public static final int ESPIPE = placeholder();
+    public static final int ESRCH = placeholder();
+    public static final int ESTALE = placeholder();
+    public static final int ETIME = placeholder();
+    public static final int ETIMEDOUT = placeholder();
+    public static final int ETXTBSY = placeholder();
+    public static final int EWOULDBLOCK = placeholder();
+    public static final int EXDEV = placeholder();
+    public static final int EXIT_FAILURE = placeholder();
+    public static final int EXIT_SUCCESS = placeholder();
+    public static final int FD_CLOEXEC = placeholder();
+    public static final int FIONREAD = placeholder();
+    public static final int F_DUPFD = placeholder();
+    public static final int F_GETFD = placeholder();
+    public static final int F_GETFL = placeholder();
+    public static final int F_GETLK = placeholder();
+    public static final int F_GETLK64 = placeholder();
+    public static final int F_GETOWN = placeholder();
+    public static final int F_OK = placeholder();
+    public static final int F_RDLCK = placeholder();
+    public static final int F_SETFD = placeholder();
+    public static final int F_SETFL = placeholder();
+    public static final int F_SETLK = placeholder();
+    public static final int F_SETLK64 = placeholder();
+    public static final int F_SETLKW = placeholder();
+    public static final int F_SETLKW64 = placeholder();
+    public static final int F_SETOWN = placeholder();
+    public static final int F_UNLCK = placeholder();
+    public static final int F_WRLCK = placeholder();
+    public static final int IPPROTO_ICMP = placeholder();
+    public static final int IPPROTO_IP = placeholder();
+    public static final int IPPROTO_IPV6 = placeholder();
+    public static final int IPPROTO_RAW = placeholder();
+    public static final int IPPROTO_TCP = placeholder();
+    public static final int IPPROTO_UDP = placeholder();
+    public static final int IPV6_CHECKSUM = placeholder();
+    public static final int IPV6_MULTICAST_HOPS = placeholder();
+    public static final int IPV6_MULTICAST_IF = placeholder();
+    public static final int IPV6_MULTICAST_LOOP = placeholder();
+    public static final int IPV6_RECVDSTOPTS = placeholder();
+    public static final int IPV6_RECVHOPLIMIT = placeholder();
+    public static final int IPV6_RECVHOPOPTS = placeholder();
+    public static final int IPV6_RECVPKTINFO = placeholder();
+    public static final int IPV6_RECVRTHDR = placeholder();
+    public static final int IPV6_RECVTCLASS = placeholder();
+    public static final int IPV6_TCLASS = placeholder();
+    public static final int IPV6_UNICAST_HOPS = placeholder();
+    public static final int IPV6_V6ONLY = placeholder();
+    public static final int IP_MULTICAST_IF = placeholder();
+    public static final int IP_MULTICAST_LOOP = placeholder();
+    public static final int IP_MULTICAST_TTL = placeholder();
+    public static final int IP_TOS = placeholder();
+    public static final int IP_TTL = placeholder();
+    public static final int MAP_FIXED = placeholder();
+    public static final int MAP_PRIVATE = placeholder();
+    public static final int MAP_SHARED = placeholder();
+    public static final int MCAST_JOIN_GROUP = placeholder();
+    public static final int MCAST_LEAVE_GROUP = placeholder();
+    public static final int MCL_CURRENT = placeholder();
+    public static final int MCL_FUTURE = placeholder();
+    public static final int MSG_CTRUNC = placeholder();
+    public static final int MSG_DONTROUTE = placeholder();
+    public static final int MSG_EOR = placeholder();
+    public static final int MSG_OOB = placeholder();
+    public static final int MSG_PEEK = placeholder();
+    public static final int MSG_TRUNC = placeholder();
+    public static final int MSG_WAITALL = placeholder();
+    public static final int MS_ASYNC = placeholder();
+    public static final int MS_INVALIDATE = placeholder();
+    public static final int MS_SYNC = placeholder();
+    public static final int O_ACCMODE = placeholder();
+    public static final int O_APPEND = placeholder();
+    public static final int O_CREAT = placeholder();
+    public static final int O_EXCL = placeholder();
+    public static final int O_NOCTTY = placeholder();
+    public static final int O_NONBLOCK = placeholder();
+    public static final int O_RDONLY = placeholder();
+    public static final int O_RDWR = placeholder();
+    public static final int O_SYNC = placeholder();
+    public static final int O_TRUNC = placeholder();
+    public static final int O_WRONLY = placeholder();
+    public static final int PROT_EXEC = placeholder();
+    public static final int PROT_NONE = placeholder();
+    public static final int PROT_READ = placeholder();
+    public static final int PROT_WRITE = placeholder();
+    public static final int R_OK = placeholder();
+    public static final int SEEK_CUR = placeholder();
+    public static final int SEEK_END = placeholder();
+    public static final int SEEK_SET = placeholder();
+    public static final int SHUT_RD = placeholder();
+    public static final int SHUT_RDWR = placeholder();
+    public static final int SHUT_WR = placeholder();
+    public static final int SOCK_DGRAM = placeholder();
+    public static final int SOCK_RAW = placeholder();
+    public static final int SOCK_SEQPACKET = placeholder();
+    public static final int SOCK_STREAM = placeholder();
+    public static final int SOL_SOCKET = placeholder();
+    public static final int SO_BROADCAST = placeholder();
+    public static final int SO_DEBUG = placeholder();
+    public static final int SO_DONTROUTE = placeholder();
+    public static final int SO_ERROR = placeholder();
+    public static final int SO_KEEPALIVE = placeholder();
+    public static final int SO_LINGER = placeholder();
+    public static final int SO_OOBINLINE = placeholder();
+    public static final int SO_RCVBUF = placeholder();
+    public static final int SO_RCVLOWAT = placeholder();
+    public static final int SO_RCVTIMEO = placeholder();
+    public static final int SO_REUSEADDR = placeholder();
+    public static final int SO_SNDBUF = placeholder();
+    public static final int SO_SNDLOWAT = placeholder();
+    public static final int SO_SNDTIMEO = placeholder();
+    public static final int SO_TYPE = placeholder();
+    public static final int STDERR_FILENO = placeholder();
+    public static final int STDIN_FILENO = placeholder();
+    public static final int STDOUT_FILENO = placeholder();
+    public static final int S_IFBLK = placeholder();
+    public static final int S_IFCHR = placeholder();
+    public static final int S_IFDIR = placeholder();
+    public static final int S_IFIFO = placeholder();
+    public static final int S_IFLNK = placeholder();
+    public static final int S_IFMT = placeholder();
+    public static final int S_IFREG = placeholder();
+    public static final int S_IFSOCK = placeholder();
+    public static final int S_IRGRP = placeholder();
+    public static final int S_IROTH = placeholder();
+    public static final int S_IRUSR = placeholder();
+    public static final int S_IRWXG = placeholder();
+    public static final int S_IRWXO = placeholder();
+    public static final int S_IRWXU = placeholder();
+    public static final int S_ISGID = placeholder();
+    public static final int S_ISUID = placeholder();
+    public static final int S_ISVTX = placeholder();
+    public static final int S_IWGRP = placeholder();
+    public static final int S_IWOTH = placeholder();
+    public static final int S_IWUSR = placeholder();
+    public static final int S_IXGRP = placeholder();
+    public static final int S_IXOTH = placeholder();
+    public static final int S_IXUSR = placeholder();
+    public static final int TCP_NODELAY = placeholder();
+    public static final int WCONTINUED = placeholder();
+    public static final int WEXITED = placeholder();
+    public static final int WNOHANG = placeholder();
+    public static final int WNOWAIT = placeholder();
+    public static final int WSTOPPED = placeholder();
+    public static final int WUNTRACED = placeholder();
+    public static final int W_OK = placeholder();
+    public static final int X_OK = placeholder();
+    public static final int _SC_2_CHAR_TERM = placeholder();
+    public static final int _SC_2_C_BIND = placeholder();
+    public static final int _SC_2_C_DEV = placeholder();
+    public static final int _SC_2_C_VERSION = placeholder();
+    public static final int _SC_2_FORT_DEV = placeholder();
+    public static final int _SC_2_FORT_RUN = placeholder();
+    public static final int _SC_2_LOCALEDEF = placeholder();
+    public static final int _SC_2_SW_DEV = placeholder();
+    public static final int _SC_2_UPE = placeholder();
+    public static final int _SC_2_VERSION = placeholder();
+    public static final int _SC_AIO_LISTIO_MAX = placeholder();
+    public static final int _SC_AIO_MAX = placeholder();
+    public static final int _SC_AIO_PRIO_DELTA_MAX = placeholder();
+    public static final int _SC_ARG_MAX = placeholder();
+    public static final int _SC_ASYNCHRONOUS_IO = placeholder();
+    public static final int _SC_ATEXIT_MAX = placeholder();
+    public static final int _SC_AVPHYS_PAGES = placeholder();
+    public static final int _SC_BC_BASE_MAX = placeholder();
+    public static final int _SC_BC_DIM_MAX = placeholder();
+    public static final int _SC_BC_SCALE_MAX = placeholder();
+    public static final int _SC_BC_STRING_MAX = placeholder();
+    public static final int _SC_CHILD_MAX = placeholder();
+    public static final int _SC_CLK_TCK = placeholder();
+    public static final int _SC_COLL_WEIGHTS_MAX = placeholder();
+    public static final int _SC_DELAYTIMER_MAX = placeholder();
+    public static final int _SC_EXPR_NEST_MAX = placeholder();
+    public static final int _SC_FSYNC = placeholder();
+    public static final int _SC_GETGR_R_SIZE_MAX = placeholder();
+    public static final int _SC_GETPW_R_SIZE_MAX = placeholder();
+    public static final int _SC_IOV_MAX = placeholder();
+    public static final int _SC_JOB_CONTROL = placeholder();
+    public static final int _SC_LINE_MAX = placeholder();
+    public static final int _SC_LOGIN_NAME_MAX = placeholder();
+    public static final int _SC_MAPPED_FILES = placeholder();
+    public static final int _SC_MEMLOCK = placeholder();
+    public static final int _SC_MEMLOCK_RANGE = placeholder();
+    public static final int _SC_MEMORY_PROTECTION = placeholder();
+    public static final int _SC_MESSAGE_PASSING = placeholder();
+    public static final int _SC_MQ_OPEN_MAX = placeholder();
+    public static final int _SC_MQ_PRIO_MAX = placeholder();
+    public static final int _SC_NGROUPS_MAX = placeholder();
+    public static final int _SC_NPROCESSORS_CONF = placeholder();
+    public static final int _SC_NPROCESSORS_ONLN = placeholder();
+    public static final int _SC_OPEN_MAX = placeholder();
+    public static final int _SC_PAGESIZE = placeholder();
+    public static final int _SC_PAGE_SIZE = placeholder();
+    public static final int _SC_PASS_MAX = placeholder();
+    public static final int _SC_PHYS_PAGES = placeholder();
+    public static final int _SC_PRIORITIZED_IO = placeholder();
+    public static final int _SC_PRIORITY_SCHEDULING = placeholder();
+    public static final int _SC_REALTIME_SIGNALS = placeholder();
+    public static final int _SC_RE_DUP_MAX = placeholder();
+    public static final int _SC_RTSIG_MAX = placeholder();
+    public static final int _SC_SAVED_IDS = placeholder();
+    public static final int _SC_SEMAPHORES = placeholder();
+    public static final int _SC_SEM_NSEMS_MAX = placeholder();
+    public static final int _SC_SEM_VALUE_MAX = placeholder();
+    public static final int _SC_SHARED_MEMORY_OBJECTS = placeholder();
+    public static final int _SC_SIGQUEUE_MAX = placeholder();
+    public static final int _SC_STREAM_MAX = placeholder();
+    public static final int _SC_SYNCHRONIZED_IO = placeholder();
+    public static final int _SC_THREADS = placeholder();
+    public static final int _SC_THREAD_ATTR_STACKADDR = placeholder();
+    public static final int _SC_THREAD_ATTR_STACKSIZE = placeholder();
+    public static final int _SC_THREAD_DESTRUCTOR_ITERATIONS = placeholder();
+    public static final int _SC_THREAD_KEYS_MAX = placeholder();
+    public static final int _SC_THREAD_PRIORITY_SCHEDULING = placeholder();
+    public static final int _SC_THREAD_PRIO_INHERIT = placeholder();
+    public static final int _SC_THREAD_PRIO_PROTECT = placeholder();
+    public static final int _SC_THREAD_SAFE_FUNCTIONS = placeholder();
+    public static final int _SC_THREAD_STACK_MIN = placeholder();
+    public static final int _SC_THREAD_THREADS_MAX = placeholder();
+    public static final int _SC_TIMERS = placeholder();
+    public static final int _SC_TIMER_MAX = placeholder();
+    public static final int _SC_TTY_NAME_MAX = placeholder();
+    public static final int _SC_TZNAME_MAX = placeholder();
+    public static final int _SC_VERSION = placeholder();
+    public static final int _SC_XBS5_ILP32_OFF32 = placeholder();
+    public static final int _SC_XBS5_ILP32_OFFBIG = placeholder();
+    public static final int _SC_XBS5_LP64_OFF64 = placeholder();
+    public static final int _SC_XBS5_LPBIG_OFFBIG = placeholder();
+    public static final int _SC_XOPEN_CRYPT = placeholder();
+    public static final int _SC_XOPEN_ENH_I18N = placeholder();
+    public static final int _SC_XOPEN_LEGACY = placeholder();
+    public static final int _SC_XOPEN_REALTIME = placeholder();
+    public static final int _SC_XOPEN_REALTIME_THREADS = placeholder();
+    public static final int _SC_XOPEN_SHM = placeholder();
+    public static final int _SC_XOPEN_UNIX = placeholder();
+    public static final int _SC_XOPEN_VERSION = placeholder();
+    public static final int _SC_XOPEN_XCU_VERSION = placeholder();
+
+    public static String errnoName(int errno) {
+        if (errno == E2BIG) {
+            return "E2BIG";
+        }
+        if (errno == EACCES) {
+            return "EACCES";
+        }
+        if (errno == EADDRINUSE) {
+            return "EADDRINUSE";
+        }
+        if (errno == EADDRNOTAVAIL) {
+            return "EADDRNOTAVAIL";
+        }
+        if (errno == EAFNOSUPPORT) {
+            return "EAFNOSUPPORT";
+        }
+        if (errno == EAGAIN) {
+            return "EAGAIN";
+        }
+        if (errno == EALREADY) {
+            return "EALREADY";
+        }
+        if (errno == EBADF) {
+            return "EBADF";
+        }
+        if (errno == EBADMSG) {
+            return "EBADMSG";
+        }
+        if (errno == EBUSY) {
+            return "EBUSY";
+        }
+        if (errno == ECANCELED) {
+            return "ECANCELED";
+        }
+        if (errno == ECHILD) {
+            return "ECHILD";
+        }
+        if (errno == ECONNABORTED) {
+            return "ECONNABORTED";
+        }
+        if (errno == ECONNREFUSED) {
+            return "ECONNREFUSED";
+        }
+        if (errno == ECONNRESET) {
+            return "ECONNRESET";
+        }
+        if (errno == EDEADLK) {
+            return "EDEADLK";
+        }
+        if (errno == EDESTADDRREQ) {
+            return "EDESTADDRREQ";
+        }
+        if (errno == EDOM) {
+            return "EDOM";
+        }
+        if (errno == EDQUOT) {
+            return "EDQUOT";
+        }
+        if (errno == EEXIST) {
+            return "EEXIST";
+        }
+        if (errno == EFAULT) {
+            return "EFAULT";
+        }
+        if (errno == EFBIG) {
+            return "EFBIG";
+        }
+        if (errno == EHOSTUNREACH) {
+            return "EHOSTUNREACH";
+        }
+        if (errno == EIDRM) {
+            return "EIDRM";
+        }
+        if (errno == EILSEQ) {
+            return "EILSEQ";
+        }
+        if (errno == EINPROGRESS) {
+            return "EINPROGRESS";
+        }
+        if (errno == EINTR) {
+            return "EINTR";
+        }
+        if (errno == EINVAL) {
+            return "EINVAL";
+        }
+        if (errno == EIO) {
+            return "EIO";
+        }
+        if (errno == EISCONN) {
+            return "EISCONN";
+        }
+        if (errno == EISDIR) {
+            return "EISDIR";
+        }
+        if (errno == ELOOP) {
+            return "ELOOP";
+        }
+        if (errno == EMFILE) {
+            return "EMFILE";
+        }
+        if (errno == EMLINK) {
+            return "EMLINK";
+        }
+        if (errno == EMSGSIZE) {
+            return "EMSGSIZE";
+        }
+        if (errno == EMULTIHOP) {
+            return "EMULTIHOP";
+        }
+        if (errno == ENAMETOOLONG) {
+            return "ENAMETOOLONG";
+        }
+        if (errno == ENETDOWN) {
+            return "ENETDOWN";
+        }
+        if (errno == ENETRESET) {
+            return "ENETRESET";
+        }
+        if (errno == ENETUNREACH) {
+            return "ENETUNREACH";
+        }
+        if (errno == ENFILE) {
+            return "ENFILE";
+        }
+        if (errno == ENOBUFS) {
+            return "ENOBUFS";
+        }
+        if (errno == ENODATA) {
+            return "ENODATA";
+        }
+        if (errno == ENODEV) {
+            return "ENODEV";
+        }
+        if (errno == ENOENT) {
+            return "ENOENT";
+        }
+        if (errno == ENOEXEC) {
+            return "ENOEXEC";
+        }
+        if (errno == ENOLCK) {
+            return "ENOLCK";
+        }
+        if (errno == ENOLINK) {
+            return "ENOLINK";
+        }
+        if (errno == ENOMEM) {
+            return "ENOMEM";
+        }
+        if (errno == ENOMSG) {
+            return "ENOMSG";
+        }
+        if (errno == ENOPROTOOPT) {
+            return "ENOPROTOOPT";
+        }
+        if (errno == ENOSPC) {
+            return "ENOSPC";
+        }
+        if (errno == ENOSR) {
+            return "ENOSR";
+        }
+        if (errno == ENOSTR) {
+            return "ENOSTR";
+        }
+        if (errno == ENOSYS) {
+            return "ENOSYS";
+        }
+        if (errno == ENOTCONN) {
+            return "ENOTCONN";
+        }
+        if (errno == ENOTDIR) {
+            return "ENOTDIR";
+        }
+        if (errno == ENOTEMPTY) {
+            return "ENOTEMPTY";
+        }
+        if (errno == ENOTSOCK) {
+            return "ENOTSOCK";
+        }
+        if (errno == ENOTSUP) {
+            return "ENOTSUP";
+        }
+        if (errno == ENOTTY) {
+            return "ENOTTY";
+        }
+        if (errno == ENXIO) {
+            return "ENXIO";
+        }
+        if (errno == EOPNOTSUPP) {
+            return "EOPNOTSUPP";
+        }
+        if (errno == EOVERFLOW) {
+            return "EOVERFLOW";
+        }
+        if (errno == EPERM) {
+            return "EPERM";
+        }
+        if (errno == EPIPE) {
+            return "EPIPE";
+        }
+        if (errno == EPROTO) {
+            return "EPROTO";
+        }
+        if (errno == EPROTONOSUPPORT) {
+            return "EPROTONOSUPPORT";
+        }
+        if (errno == EPROTOTYPE) {
+            return "EPROTOTYPE";
+        }
+        if (errno == ERANGE) {
+            return "ERANGE";
+        }
+        if (errno == EROFS) {
+            return "EROFS";
+        }
+        if (errno == ESPIPE) {
+            return "ESPIPE";
+        }
+        if (errno == ESRCH) {
+            return "ESRCH";
+        }
+        if (errno == ESTALE) {
+            return "ESTALE";
+        }
+        if (errno == ETIME) {
+            return "ETIME";
+        }
+        if (errno == ETIMEDOUT) {
+            return "ETIMEDOUT";
+        }
+        if (errno == ETXTBSY) {
+            return "ETXTBSY";
+        }
+        if (errno == EWOULDBLOCK) {
+            return "EWOULDBLOCK";
+        }
+        if (errno == EXDEV) {
+            return "EXDEV";
+        }
+        return null;
+    }
+
+    private static native void initConstants();
+
+    // A hack to avoid these constants being inlined by javac...
+    private static int placeholder() { return 0; }
+    // ...because we want to initialize them at runtime.
+    static {
+        initConstants();
+    }
+}
diff --git a/luni/src/main/java/libcore/io/Posix.java b/luni/src/main/java/libcore/io/Posix.java
new file mode 100644
index 0000000..6c49e51
--- /dev/null
+++ b/luni/src/main/java/libcore/io/Posix.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import java.io.FileDescriptor;
+import java.net.InetAddress;
+import java.net.SocketAddress;
+import java.nio.ByteBuffer;
+import java.nio.NioUtils;
+import libcore.util.MutableInt;
+import libcore.util.MutableLong;
+
+public final class Posix implements Os {
+    Posix() { }
+
+    public native boolean access(String path, int mode) throws ErrnoException;
+    public native void chmod(String path, int mode) throws ErrnoException;
+    public native void close(FileDescriptor fd) throws ErrnoException;
+    public native String[] environ();
+    public native int fcntlVoid(FileDescriptor fd, int cmd) throws ErrnoException;
+    public native int fcntlLong(FileDescriptor fd, int cmd, long arg) throws ErrnoException;
+    public native int fcntlFlock(FileDescriptor fd, int cmd, StructFlock arg) throws ErrnoException;
+    public native void fdatasync(FileDescriptor fd) throws ErrnoException;
+    public native StructStat fstat(FileDescriptor fd) throws ErrnoException;
+    public native StructStatFs fstatfs(FileDescriptor fd) throws ErrnoException;
+    public native void fsync(FileDescriptor fd) throws ErrnoException;
+    public native void ftruncate(FileDescriptor fd, long length) throws ErrnoException;
+    public native String getenv(String name);
+    public native SocketAddress getsockname(FileDescriptor fd) throws ErrnoException;
+    public native int getsockoptByte(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public native InetAddress getsockoptInAddr(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public native int getsockoptInt(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public native StructLinger getsockoptLinger(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public native StructTimeval getsockoptTimeval(FileDescriptor fd, int level, int option) throws ErrnoException;
+    public native int ioctlInt(FileDescriptor fd, int cmd, MutableInt arg) throws ErrnoException;
+    public native boolean isatty(FileDescriptor fd);
+    public native void listen(FileDescriptor fd, int backlog) throws ErrnoException;
+    public native long lseek(FileDescriptor fd, long offset, int whence) throws ErrnoException;
+    public native void mincore(long address, long byteCount, byte[] vector) throws ErrnoException;
+    public native void mkdir(String path, int mode) throws ErrnoException;
+    public native void mlock(long address, long byteCount) throws ErrnoException;
+    public native long mmap(long address, long byteCount, int prot, int flags, FileDescriptor fd, long offset) throws ErrnoException;
+    public native void msync(long address, long byteCount, int flags) throws ErrnoException;
+    public native void munlock(long address, long byteCount) throws ErrnoException;
+    public native void munmap(long address, long byteCount) throws ErrnoException;
+    public native FileDescriptor open(String path, int flags, int mode) throws ErrnoException;
+    public native FileDescriptor[] pipe() throws ErrnoException;
+    public native StructStat lstat(String path) throws ErrnoException;
+    public int read(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
+        if (buffer.isDirect()) {
+            return readDirectBuffer(fd, buffer, buffer.position(), buffer.remaining());
+        }
+        return read(fd, NioUtils.unsafeArray(buffer), NioUtils.unsafeArrayOffset(buffer) + buffer.position(), buffer.remaining());
+    }
+    private native int readDirectBuffer(FileDescriptor fd, ByteBuffer buffer, int position, int remaining) throws ErrnoException;
+    public native int read(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException;
+    public native int readv(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException;
+    public native void remove(String path) throws ErrnoException;
+    public native void rename(String oldPath, String newPath) throws ErrnoException;
+    public native long sendfile(FileDescriptor outFd, FileDescriptor inFd, MutableLong inOffset, long byteCount) throws ErrnoException;
+    public native void setsockoptInt(FileDescriptor fd, int level, int option, int value) throws ErrnoException;
+    public native void shutdown(FileDescriptor fd, int how) throws ErrnoException;
+    public native FileDescriptor socket(int domain, int type, int protocol) throws ErrnoException;
+    public native StructStat stat(String path) throws ErrnoException;
+    public native StructStatFs statfs(String path) throws ErrnoException;
+    public native String strerror(int errno);
+    public native void symlink(String oldPath, String newPath) throws ErrnoException;
+    public native long sysconf(int name);
+    public native StructUtsname uname() throws ErrnoException;
+    public int write(FileDescriptor fd, ByteBuffer buffer) throws ErrnoException {
+        if (buffer.isDirect()) {
+            return writeDirectBuffer(fd, buffer, buffer.position(), buffer.remaining());
+        }
+        return write(fd, NioUtils.unsafeArray(buffer), NioUtils.unsafeArrayOffset(buffer) + buffer.position(), buffer.remaining());
+    }
+    private native int writeDirectBuffer(FileDescriptor fd, ByteBuffer buffer, int position, int remaining) throws ErrnoException;
+    public native int write(FileDescriptor fd, byte[] bytes, int byteOffset, int byteCount) throws ErrnoException;
+    public native int writev(FileDescriptor fd, Object[] buffers, int[] offsets, int[] byteCounts) throws ErrnoException;
+}
diff --git a/luni/src/main/java/libcore/io/Streams.java b/luni/src/main/java/libcore/io/Streams.java
index 6771369..2ece93c 100644
--- a/luni/src/main/java/libcore/io/Streams.java
+++ b/luni/src/main/java/libcore/io/Streams.java
@@ -30,7 +30,39 @@
     private Streams() {}
 
     /**
-     * Implements {@link java.io.DataInputStream#readFully(byte[], int, int)}.
+     * Implements InputStream.read(int) in terms of InputStream.read(byte[], int, int).
+     * InputStream assumes that you implement InputStream.read(int) and provides default
+     * implementations of the others, but often the opposite is more efficient.
+     */
+    public static int readSingleByte(InputStream in) throws IOException {
+        byte[] buffer = new byte[1];
+        int result = in.read(buffer, 0, 1);
+        return (result != -1) ? buffer[0] & 0xff : -1;
+    }
+
+    /**
+     * Implements OutputStream.write(int) in terms of OutputStream.write(byte[], int, int).
+     * OutputStream assumes that you implement OutputStream.write(int) and provides default
+     * implementations of the others, but often the opposite is more efficient.
+     */
+    public static void writeSingleByte(OutputStream out, int b) throws IOException {
+        byte[] buffer = new byte[1];
+        buffer[0] = (byte) (b & 0xff);
+        out.write(buffer);
+    }
+
+    /**
+     * Fills 'dst' with bytes from 'in', throwing EOFException if insufficient bytes are available.
+     */
+    public static void readFully(InputStream in, byte[] dst) throws IOException {
+        readFully(in, dst, 0, dst.length);
+    }
+
+    /**
+     * Reads exactly 'byteCount' bytes from 'in' (into 'dst' at offset 'offset'), and throws
+     * EOFException if insufficient bytes are available.
+     *
+     * Used to implement {@link java.io.DataInputStream#readFully(byte[], int, int)}.
      */
     public static void readFully(InputStream in, byte[] dst, int offset, int byteCount) throws IOException {
         if (byteCount == 0) {
diff --git a/luni/src/main/java/libcore/io/StructFlock.java b/luni/src/main/java/libcore/io/StructFlock.java
new file mode 100644
index 0000000..6d63064
--- /dev/null
+++ b/luni/src/main/java/libcore/io/StructFlock.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import static libcore.io.OsConstants.*;
+
+/**
+ * Information returned/taken by fcntl(2) F_GETFL and F_SETFL. Corresponds to C's
+ * {@code struct flock} from
+ * <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/fcntl.h.html">&lt;fcntl.h&gt;</a>
+ */
+public final class StructFlock {
+    /** The operation type, one of F_RDLCK, F_WRLCK, or F_UNLCK. */
+    public short l_type;
+
+    /** How to interpret l_start, one of SEEK_CUR, SEEK_END, SEEK_SET. */
+    public short l_whence;
+
+    /** Start offset. */
+    public long l_start; /*off_t*/
+
+    /** Byte count to operate on. */
+    public long l_len; /*off_t*/
+
+    /** Process blocking our lock (filled in by F_GETLK, otherwise unused). */
+    public int l_pid; /*pid_t*/
+}
diff --git a/luni/src/main/java/libcore/io/StructLinger.java b/luni/src/main/java/libcore/io/StructLinger.java
new file mode 100644
index 0000000..9f149af
--- /dev/null
+++ b/luni/src/main/java/libcore/io/StructLinger.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+/**
+ * Corresponds to C's {@code struct linger} from
+ * <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_socket.h.html">&lt;sys/socket.h&gt;</a>
+ */
+public final class StructLinger {
+    /** Whether or not linger is enabled. Non-zero is on. */
+    public final int l_onoff;
+
+    /** Linger time in seconds. */
+    public final int l_linger;
+
+    public StructLinger(int l_onoff, int l_linger) {
+        this.l_onoff = l_onoff;
+        this.l_linger = l_linger;
+    }
+
+    public boolean isOn() {
+        return l_onoff != 0;
+    }
+
+    @Override public String toString() {
+        return "StructLinger[l_onoff=" + l_onoff + ",l_linger=" + l_linger + "]";
+    }
+}
diff --git a/luni/src/main/java/libcore/io/StructStat.java b/luni/src/main/java/libcore/io/StructStat.java
new file mode 100644
index 0000000..9d1a877
--- /dev/null
+++ b/luni/src/main/java/libcore/io/StructStat.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import static libcore.io.OsConstants.*;
+
+/**
+ * File information returned by fstat(2), lstat(2), and stat(2). Corresponds to C's
+ * {@code struct stat} from
+ * <a href="http://www.opengroup.org/onlinepubs/000095399/basedefs/sys/stat.h.html">&lt;stat.h&gt;</a>
+ */
+public final class StructStat {
+    /** Device ID of device containing file. */
+    public final long st_dev; /*dev_t*/
+
+    /** File serial number (inode). */
+    public final long st_ino; /*ino_t*/
+
+    /** Mode (permissions) of file. */
+    public final int st_mode; /*mode_t*/
+
+    /** Number of hard links to the file. */
+    public final long st_nlink; /*nlink_t*/
+
+    /** User ID of file. */
+    public final int st_uid; /*uid_t*/
+
+    /** Group ID of file. */
+    public final int st_gid; /*gid_t*/
+
+    /** Device ID (if file is character or block special). */
+    public final long st_rdev; /*dev_t*/
+
+    /**
+     * For regular files, the file size in bytes.
+     * For symbolic links, the length in bytes of the pathname contained in the symbolic link.
+     * For a shared memory object, the length in bytes.
+     * For a typed memory object, the length in bytes.
+     * For other file types, the use of this field is unspecified.
+     */
+    public final long st_size; /*off_t*/
+
+    /** Time of last access. */
+    public final long st_atime; /*time_t*/
+
+    /** Time of last data modification. */
+    public final long st_mtime; /*time_t*/
+
+    /** Time of last status change. */
+    public final long st_ctime; /*time_t*/
+
+    /**
+     * A file system-specific preferred I/O block size for this object.
+     * For some file system types, this may vary from file to file.
+     */
+    public final long st_blksize; /*blksize_t*/
+
+    /** Number of blocks allocated for this object. */
+    public final long st_blocks; /*blkcnt_t*/
+
+    StructStat(long st_dev, long st_ino, int st_mode, long st_nlink, int st_uid, int st_gid,
+            long st_rdev, long st_size, long st_atime, long st_mtime, long st_ctime,
+            long st_blksize, long st_blocks) {
+        this.st_dev = st_dev;
+        this.st_ino = st_ino;
+        this.st_mode = st_mode;
+        this.st_nlink = st_nlink;
+        this.st_uid = st_uid;
+        this.st_gid = st_gid;
+        this.st_rdev = st_rdev;
+        this.st_size = st_size;
+        this.st_atime = st_atime;
+        this.st_mtime = st_mtime;
+        this.st_ctime = st_ctime;
+        this.st_blksize = st_blksize;
+        this.st_blocks = st_blocks;
+    }
+}
diff --git a/luni/src/main/java/libcore/io/StructStatFs.java b/luni/src/main/java/libcore/io/StructStatFs.java
new file mode 100644
index 0000000..f853c9a
--- /dev/null
+++ b/luni/src/main/java/libcore/io/StructStatFs.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import static libcore.io.OsConstants.*;
+
+/**
+ * File information returned by fstatfs(2) and statfs(2).
+ *
+ * TODO: this should be {@code struct statvfs}, but Bionic doesn't support that yet.
+ * @hide until the TODO is fixed.
+ */
+public final class StructStatFs {
+    /** File system block size (used for block counts). */
+    public final long f_bsize; /*unsigned long*/
+
+    /** Total block count. */
+    public final long f_blocks; /*fsblkcnt_t*/
+
+    /** Free block count. */
+    public final long f_bfree; /*fsblkcnt_t*/
+
+    /** Free block count available to non-root. */
+    public final long f_bavail; /*fsblkcnt_t*/
+
+    /** Total file (inode) count. */
+    public final long f_files; /*fsfilcnt_t*/
+
+    /** Free file (inode) count. */
+    public final long f_ffree; /*fsfilcnt_t*/
+
+    /** Maximum filename length. */
+    public final long f_namemax; /*unsigned long*/
+
+    /** Fundamental file system block size. */
+    public final long f_frsize; /*unsigned long*/
+
+    StructStatFs(long f_bsize, long f_blocks, long f_bfree, long f_bavail,
+            long f_files, long f_ffree, long f_namemax, long f_frsize) {
+        this.f_bsize = f_bsize;
+        this.f_blocks = f_blocks;
+        this.f_bfree = f_bfree;
+        this.f_bavail = f_bavail;
+        this.f_files = f_files;
+        this.f_ffree = f_ffree;
+        this.f_namemax = f_namemax;
+        this.f_frsize = f_frsize;
+    }
+}
diff --git a/luni/src/main/java/libcore/io/StructTimeval.java b/luni/src/main/java/libcore/io/StructTimeval.java
new file mode 100644
index 0000000..0ed3509
--- /dev/null
+++ b/luni/src/main/java/libcore/io/StructTimeval.java
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+/**
+ * Corresponds to C's {@code struct timeval} from
+ * <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_time.h.html">&lt;sys/time.h&gt;</a>
+ */
+public final class StructTimeval {
+    /** Seconds. */
+    public final long tv_sec;
+
+    /** Microseconds. */
+    public final long tv_usec;
+
+    private StructTimeval(long tv_sec, long tv_usec) {
+        this.tv_sec = tv_sec;
+        this.tv_usec = tv_usec;
+    }
+
+    public static StructTimeval fromMillis(long millis) {
+        long tv_sec = millis / 1000;
+        long tv_usec = (millis - (tv_sec * 1000)) * 1000;
+        return new StructTimeval(tv_sec, tv_usec);
+    }
+
+    public long toMillis() {
+        return (tv_sec * 1000) + (tv_usec / 1000);
+    }
+
+    @Override public String toString() {
+        return "StructTimeval[tv_sec=" + tv_sec + ",tv_usec=" + tv_usec + "]";
+    }
+}
diff --git a/luni/src/main/java/libcore/io/StructUtsname.java b/luni/src/main/java/libcore/io/StructUtsname.java
new file mode 100644
index 0000000..4bbde16
--- /dev/null
+++ b/luni/src/main/java/libcore/io/StructUtsname.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.io;
+
+import static libcore.io.OsConstants.*;
+
+/**
+ * Information returned by uname(2). Corresponds to C's
+ * {@code struct utname} from
+ * <a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_utsname.h.html">&lt;sys/utsname.h&gt;</a>
+ */
+public final class StructUtsname {
+    /** The OS name, such as "Linux". */
+    public final String sysname;
+
+    /** The machine's unqualified name on some implementation-defined network. */
+    public final String nodename;
+
+    /** The OS release, such as "2.6.35-27-generic". */
+    public final String release;
+
+    /** The OS version, such as "#48-Ubuntu SMP Tue Feb 22 20:25:29 UTC 2011". */
+    public final String version;
+
+    /** The machine architecture, such as "armv7l" or "x86_64". */
+    public final String machine;
+
+    StructUtsname(String sysname, String nodename, String release, String version, String machine) {
+        this.sysname = sysname;
+        this.nodename = nodename;
+        this.release = release;
+        this.version = version;
+        this.machine = machine;
+    }
+}
diff --git a/luni/src/main/java/libcore/net/MimeUtils.java b/luni/src/main/java/libcore/net/MimeUtils.java
index 28d9c7c..17134e4 100644
--- a/luni/src/main/java/libcore/net/MimeUtils.java
+++ b/luni/src/main/java/libcore/net/MimeUtils.java
@@ -20,8 +20,6 @@
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
@@ -369,6 +367,31 @@
         extensionToMimeTypeMap.put(extension, mimeType);
     }
 
+    private static InputStream getContentTypesPropertiesStream() {
+        // User override?
+        String userTable = System.getProperty("content.types.user.table");
+        if (userTable != null) {
+            File f = new File(userTable);
+            if (f.exists()) {
+                try {
+                    return new FileInputStream(f);
+                } catch (IOException ignored) {
+                }
+            }
+        }
+
+        // Standard location?
+        File f = new File(System.getProperty("java.home"), "lib" + File.separator + "content-types.properties");
+        if (f.exists()) {
+            try {
+                return new FileInputStream(f);
+            } catch (IOException ignored) {
+            }
+        }
+
+        return null;
+    }
+
     /**
      * This isn't what the RI does. The RI doesn't have hard-coded defaults, so supplying your
      * own "content.types.user.table" means you don't get any of the built-ins, and the built-ins
@@ -376,34 +399,7 @@
      */
     private static void applyOverrides() {
         // Get the appropriate InputStream to read overrides from, if any.
-        InputStream stream = AccessController.doPrivileged(new PrivilegedAction<InputStream>() {
-            public InputStream run() {
-                // User override?
-                String userTable = System.getProperty("content.types.user.table");
-                if (userTable != null) {
-                    File f = new File(userTable);
-                    if (f.exists()) {
-                        try {
-                            return new FileInputStream(f);
-                        } catch (IOException ignored) {
-                        }
-                    }
-                }
-
-                // Standard location?
-                File f = new File(System.getProperty("java.home"),
-                        "lib" + File.separator + "content-types.properties");
-                if (f.exists()) {
-                    try {
-                        return new FileInputStream(f);
-                    } catch (IOException ignored) {
-                    }
-                }
-
-                return null;
-            }
-        });
-
+        InputStream stream = getContentTypesPropertiesStream();
         if (stream == null) {
             return;
         }
diff --git a/luni/src/main/java/libcore/net/UriCodec.java b/luni/src/main/java/libcore/net/UriCodec.java
new file mode 100644
index 0000000..46a93b8
--- /dev/null
+++ b/luni/src/main/java/libcore/net/UriCodec.java
@@ -0,0 +1,211 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package libcore.net;
+
+import java.io.ByteArrayOutputStream;
+import java.net.URISyntaxException;
+import java.nio.charset.Charset;
+import java.nio.charset.Charsets;
+
+/**
+ * Encodes and decodes {@code application/x-www-form-urlencoded} content.
+ * Subclasses define exactly which characters are legal.
+ *
+ * <p>By default, UTF-8 is used to encode escaped characters. A single input
+ * character like "\u0080" may be encoded to multiple octets like %C2%80.
+ */
+public abstract class UriCodec {
+
+    /**
+     * Returns true if {@code c} does not need to be escaped.
+     */
+    protected abstract boolean isRetained(char c);
+
+    /**
+     * Throws if {@code s} is invalid according to this encoder.
+     */
+    public void validate(String s) throws URISyntaxException {
+        for (int i = 0; i < s.length();) {
+            char ch = s.charAt(i);
+            if ((ch >= 'a' && ch <= 'z')
+                    || (ch >= 'A' && ch <= 'Z')
+                    || (ch >= '0' && ch <= '9')
+                    || isRetained(ch)) {
+                i++;
+            } else if (ch == '%') {
+                if (i + 2 >= s.length()) {
+                    throw new URISyntaxException(s, "Incomplete % sequence", i);
+                }
+                int d1 = hexToInt(s.charAt(i + 1));
+                int d2 = hexToInt(s.charAt(i + 2));
+                if (d1 == -1 || d2 == -1) {
+                    throw new URISyntaxException(s, "Invalid % sequence: " +
+                            s.substring(i, i + 3), i);
+                }
+                i += 3;
+            } else {
+                throw new URISyntaxException(s, "Illegal character", i);
+            }
+        }
+    }
+
+    /**
+     * Throws if {@code s} contains characters that are not letters, digits or
+     * in {@code legal}.
+     */
+    public static void validateSimple(String s, String legal) throws URISyntaxException {
+        for (int i = 0; i < s.length(); i++) {
+            char ch = s.charAt(i);
+            if (!((ch >= 'a' && ch <= 'z')
+                    || (ch >= 'A' && ch <= 'Z')
+                    || (ch >= '0' && ch <= '9')
+                    || legal.indexOf(ch) > -1)) {
+                throw new URISyntaxException(s, "Illegal character", i);
+            }
+        }
+    }
+
+    /**
+     * Encodes {@code s} and appends the result to {@code builder}.
+     *
+     * @param isPartiallyEncoded true to fix input that has already been
+     *     partially or fully encoded. For example, input of "hello%20world" is
+     *     unchanged with isPartiallyEncoded=true but would be double-escaped to
+     *     "hello%2520world" otherwise.
+     */
+    private void appendEncoded(StringBuilder builder, String s, Charset charset,
+            boolean isPartiallyEncoded) {
+        if (s == null) {
+            throw new NullPointerException();
+        }
+
+        int escapeStart = -1;
+        for (int i = 0; i < s.length(); i++) {
+            char c = s.charAt(i);
+            if ((c >= 'a' && c <= 'z')
+                    || (c >= 'A' && c <= 'Z')
+                    || (c >= '0' && c <= '9')
+                    || isRetained(c)
+                    || (c == '%' && isPartiallyEncoded)) {
+                if (escapeStart != -1) {
+                    appendHex(builder, s.substring(escapeStart, i), charset);
+                    escapeStart = -1;
+                }
+                if (c == '%' && isPartiallyEncoded) {
+                    // this is an encoded 3-character sequence like "%20"
+                    builder.append(s, i, i + 3);
+                    i += 2;
+                } else if (c == ' ') {
+                    builder.append('+');
+                } else {
+                    builder.append(c);
+                }
+            } else if (escapeStart == -1) {
+                escapeStart = i;
+            }
+        }
+        if (escapeStart != -1) {
+            appendHex(builder, s.substring(escapeStart, s.length()), charset);
+        }
+    }
+
+    public String encode(String s, Charset charset) {
+        // Guess a bit larger for encoded form
+        StringBuilder builder = new StringBuilder(s.length() + 16);
+        appendEncoded(builder, s, charset, false);
+        return builder.toString();
+    }
+
+    public void appendEncoded(StringBuilder builder, String s) {
+        appendEncoded(builder, s, Charsets.UTF_8, false);
+    }
+
+    public void appendPartiallyEncoded(StringBuilder builder, String s) {
+        appendEncoded(builder, s, Charsets.UTF_8, true);
+    }
+
+    /**
+     * @param convertPlus true to convert '+' to ' '.
+     */
+    public static String decode(String s, boolean convertPlus, Charset charset) {
+        if (s.indexOf('%') == -1 && (!convertPlus || s.indexOf('+') == -1)) {
+            return s;
+        }
+
+        StringBuilder result = new StringBuilder(s.length());
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        for (int i = 0; i < s.length();) {
+            char c = s.charAt(i);
+            if (c == '%') {
+                do {
+                    if (i + 2 >= s.length()) {
+                        throw new IllegalArgumentException("Incomplete % sequence at: " + i);
+                    }
+                    int d1 = hexToInt(s.charAt(i + 1));
+                    int d2 = hexToInt(s.charAt(i + 2));
+                    if (d1 == -1 || d2 == -1) {
+                        throw new IllegalArgumentException("Invalid % sequence " +
+                                s.substring(i, i + 3) + " at " + i);
+                    }
+                    out.write((byte) ((d1 << 4) + d2));
+                    i += 3;
+                } while (i < s.length() && s.charAt(i) == '%');
+                result.append(new String(out.toByteArray(), charset));
+                out.reset();
+            } else {
+                if (convertPlus && c == '+') {
+                    c = ' ';
+                }
+                result.append(c);
+                i++;
+            }
+        }
+        return result.toString();
+    }
+
+    /**
+     * Like {@link Character#digit}, but without support for non-ASCII
+     * characters.
+     */
+    private static int hexToInt(char c) {
+        if ('0' <= c && c <= '9') {
+            return c - '0';
+        } else if ('a' <= c && c <= 'f') {
+            return 10 + (c - 'a');
+        } else if ('A' <= c && c <= 'F') {
+            return 10 + (c - 'A');
+        } else {
+            return -1;
+        }
+    }
+
+    public static String decode(String s) {
+        return decode(s, false, Charsets.UTF_8);
+    }
+
+    private static void appendHex(StringBuilder builder, String s, Charset charset) {
+        for (byte b : s.getBytes(charset)) {
+            appendHex(builder, b);
+        }
+    }
+
+    private static void appendHex(StringBuilder sb, byte b) {
+        sb.append('%');
+        sb.append(Byte.toHexString(b, true));
+    }
+}
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/AbstractHttpInputStream.java b/luni/src/main/java/libcore/net/http/AbstractHttpInputStream.java
similarity index 94%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/AbstractHttpInputStream.java
rename to luni/src/main/java/libcore/net/http/AbstractHttpInputStream.java
index 4c9505c..40bc554 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/AbstractHttpInputStream.java
+++ b/luni/src/main/java/libcore/net/http/AbstractHttpInputStream.java
@@ -14,12 +14,13 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.CacheRequest;
+import libcore.io.Streams;
 
 /**
  * An input stream for the body of an HTTP response.
@@ -59,9 +60,7 @@
      * need to override the latter.
      */
     @Override public final int read() throws IOException {
-        byte[] buffer = new byte[1];
-        int count = read(buffer, 0, 1);
-        return count == -1 ? -1 : buffer[0] & 0xff;
+        return Streams.readSingleByte(this);
     }
 
     protected final void checkNotClosed() throws IOException {
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/AbstractHttpOutputStream.java b/luni/src/main/java/libcore/net/http/AbstractHttpOutputStream.java
similarity index 94%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/AbstractHttpOutputStream.java
rename to luni/src/main/java/libcore/net/http/AbstractHttpOutputStream.java
index 7cbb81e..1e1b47b 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/AbstractHttpOutputStream.java
+++ b/luni/src/main/java/libcore/net/http/AbstractHttpOutputStream.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.io.OutputStream;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ChunkedInputStream.java b/luni/src/main/java/libcore/net/http/ChunkedInputStream.java
similarity index 97%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ChunkedInputStream.java
rename to luni/src/main/java/libcore/net/http/ChunkedInputStream.java
index 73fd388..7a53728 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ChunkedInputStream.java
+++ b/luni/src/main/java/libcore/net/http/ChunkedInputStream.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.io.InputStream;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ChunkedOutputStream.java b/luni/src/main/java/libcore/net/http/ChunkedOutputStream.java
similarity index 98%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ChunkedOutputStream.java
rename to luni/src/main/java/libcore/net/http/ChunkedOutputStream.java
index 543e495..db65f7b 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/ChunkedOutputStream.java
+++ b/luni/src/main/java/libcore/net/http/ChunkedOutputStream.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/FixedLengthInputStream.java b/luni/src/main/java/libcore/net/http/FixedLengthInputStream.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/FixedLengthInputStream.java
rename to luni/src/main/java/libcore/net/http/FixedLengthInputStream.java
index 3a19f58..3596cd1 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/FixedLengthInputStream.java
+++ b/luni/src/main/java/libcore/net/http/FixedLengthInputStream.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.io.InputStream;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/FixedLengthOutputStream.java b/luni/src/main/java/libcore/net/http/FixedLengthOutputStream.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/FixedLengthOutputStream.java
rename to luni/src/main/java/libcore/net/http/FixedLengthOutputStream.java
index d3c3f02..461eed9 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/FixedLengthOutputStream.java
+++ b/luni/src/main/java/libcore/net/http/FixedLengthOutputStream.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.io.OutputStream;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java b/luni/src/main/java/libcore/net/http/HttpConnection.java
similarity index 99%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java
rename to luni/src/main/java/libcore/net/http/HttpConnection.java
index ddd1dec..13e0971 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnection.java
+++ b/luni/src/main/java/libcore/net/http/HttpConnection.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.BufferedInputStream;
 import java.io.IOException;
@@ -32,8 +32,8 @@
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLSocket;
 import javax.net.ssl.SSLSocketFactory;
-import libcore.util.Objects;
 import libcore.io.IoUtils;
+import libcore.util.Objects;
 import org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl;
 
 /**
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionPool.java b/luni/src/main/java/libcore/net/http/HttpConnectionPool.java
similarity index 91%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionPool.java
rename to luni/src/main/java/libcore/net/http/HttpConnectionPool.java
index bb5e6e1..0fb5261 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpConnectionPool.java
+++ b/luni/src/main/java/libcore/net/http/HttpConnectionPool.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -35,9 +35,6 @@
  * <p>This class <i>doesn't</i> adjust its configuration as system properties
  * are changed. This assumes that the applications that set these parameters do
  * so before making HTTP connections, and that this class is initialized lazily.
- *
- * <p>If a security manager is in place, HTTP connection pooling will be
- * disabled and these system properties will be ignored.
  */
 public final class HttpConnectionPool {
 
@@ -48,12 +45,6 @@
             = new HashMap<HttpConnection.Address, List<HttpConnection>>();
 
     private HttpConnectionPool() {
-        SecurityManager security = System.getSecurityManager();
-        if (security != null) {
-            maxConnections = 0;
-            return;
-        }
-
         String keepAlive = System.getProperty("http.keepAlive");
         if (keepAlive != null && !Boolean.parseBoolean(keepAlive)) {
             maxConnections = 0;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Handler.java b/luni/src/main/java/libcore/net/http/HttpHandler.java
similarity index 95%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Handler.java
rename to luni/src/main/java/libcore/net/http/HttpHandler.java
index 6d37acb..976d49c 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/Handler.java
+++ b/luni/src/main/java/libcore/net/http/HttpHandler.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.net.Proxy;
@@ -27,7 +27,7 @@
  * This is the handler that manages all transactions between the client and a
  * HTTP remote server.
  */
-public class Handler extends URLStreamHandler {
+public class HttpHandler extends URLStreamHandler {
 
     /**
      * Returns a connection to the HTTP server specified by this
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpHeaders.java b/luni/src/main/java/libcore/net/http/HttpHeaders.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpHeaders.java
rename to luni/src/main/java/libcore/net/http/HttpHeaders.java
index 1d02097..8eca3b5 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpHeaders.java
+++ b/luni/src/main/java/libcore/net/http/HttpHeaders.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -24,7 +24,6 @@
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.TreeMap;
-import java.util.logging.Logger;
 
 /**
  * The HTTP status and header lines of a single HTTP message. This class
@@ -77,8 +76,7 @@
              * "Accept\r\n". For platform compatibility and HTTP compliance, we
              * print a warning and ignore null values.
              */
-            Logger.getAnonymousLogger().warning(
-                    "Ignoring HTTP header field " + key + " because its value is null.");
+            System.logW("Ignoring HTTP header field '" + key + "' because its value is null");
             return;
         }
         alternatingKeysAndValues.add(key);
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java b/luni/src/main/java/libcore/net/http/HttpURLConnectionImpl.java
similarity index 97%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
rename to luni/src/main/java/libcore/net/http/HttpURLConnectionImpl.java
index 1d2eacd..3bf2638 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpURLConnectionImpl.java
+++ b/luni/src/main/java/libcore/net/http/HttpURLConnectionImpl.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.BufferedOutputStream;
 import java.io.FileNotFoundException;
@@ -40,9 +40,7 @@
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.nio.charset.Charsets;
-import java.security.AccessController;
 import java.security.Permission;
-import java.security.PrivilegedAction;
 import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.List;
@@ -52,7 +50,6 @@
 import java.util.zip.GZIPInputStream;
 import libcore.io.Streams;
 import org.apache.harmony.luni.util.Base64;
-import org.apache.harmony.luni.util.PriviAction;
 
 /**
  * This subclass extends <code>HttpURLConnection</code> which in turns extends
@@ -187,12 +184,7 @@
         super(url);
         defaultPort = port;
         requestHeader = new HttpHeaders(defaultRequestHeader);
-
-        responseCache = AccessController.doPrivileged(new PrivilegedAction<ResponseCache>() {
-            public ResponseCache run() {
-                return ResponseCache.getDefault();
-            }
-        });
+        responseCache = ResponseCache.getDefault();
     }
 
     /**
@@ -906,8 +898,8 @@
     }
 
     private String getDefaultUserAgent() {
-        String agent = getSystemProperty("http.agent");
-        return agent != null ? agent : ("Java" + getSystemProperty("java.version"));
+        String agent = System.getProperty("http.agent");
+        return agent != null ? agent : ("Java" + System.getProperty("java.version"));
     }
 
     private boolean hasConnectionCloseHeader() {
@@ -1002,10 +994,6 @@
                 : url.getHost();
     }
 
-    private String getSystemProperty(final String property) {
-        return AccessController.doPrivileged(new PriviAction<String>(property));
-    }
-
     @Override public final boolean usingProxy() {
         return (proxy != null && proxy.type() != Proxy.Type.DIRECT);
     }
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/Handler.java b/luni/src/main/java/libcore/net/http/HttpsHandler.java
similarity index 92%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/Handler.java
rename to luni/src/main/java/libcore/net/http/HttpsHandler.java
index 983b827..142d95f 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/Handler.java
+++ b/luni/src/main/java/libcore/net/http/HttpsHandler.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.https;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.net.Proxy;
@@ -26,7 +26,7 @@
 /**
  * Handler for HttpsURLConnection implementation.
  */
-public class Handler extends URLStreamHandler {
+public class HttpsHandler extends URLStreamHandler {
 
     @Override
     protected URLConnection openConnection(URL url) throws IOException {
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/HttpsURLConnectionImpl.java b/luni/src/main/java/libcore/net/http/HttpsURLConnectionImpl.java
similarity index 98%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/HttpsURLConnectionImpl.java
rename to luni/src/main/java/libcore/net/http/HttpsURLConnectionImpl.java
index 46fb786..9f7ae90 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/https/HttpsURLConnectionImpl.java
+++ b/luni/src/main/java/libcore/net/http/HttpsURLConnectionImpl.java
@@ -14,7 +14,7 @@
  *  See the License for the specific language governing permissions and
  *  limitations under the License.
  */
-package org.apache.harmony.luni.internal.net.www.protocol.https;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -35,8 +35,6 @@
 import javax.net.ssl.SSLHandshakeException;
 import javax.net.ssl.SSLPeerUnverifiedException;
 import javax.net.ssl.SSLSocket;
-import org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection;
-import org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl;
 
 /**
  * HttpsURLConnection implementation.
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/RetryableOutputStream.java b/luni/src/main/java/libcore/net/http/RetryableOutputStream.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/RetryableOutputStream.java
rename to luni/src/main/java/libcore/net/http/RetryableOutputStream.java
index de97ccc..67bb5b8 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/RetryableOutputStream.java
+++ b/luni/src/main/java/libcore/net/http/RetryableOutputStream.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/UnknownLengthHttpInputStream.java b/luni/src/main/java/libcore/net/http/UnknownLengthHttpInputStream.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/UnknownLengthHttpInputStream.java
rename to luni/src/main/java/libcore/net/http/UnknownLengthHttpInputStream.java
index 84cf32f..b1167c9 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/http/UnknownLengthHttpInputStream.java
+++ b/luni/src/main/java/libcore/net/http/UnknownLengthHttpInputStream.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.net.http;
 
 import java.io.IOException;
 import java.io.InputStream;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/Handler.java b/luni/src/main/java/libcore/net/url/FileHandler.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/Handler.java
rename to luni/src/main/java/libcore/net/url/FileHandler.java
index 8b15ec8..a1d73c3 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/Handler.java
+++ b/luni/src/main/java/libcore/net/url/FileHandler.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.file;
+package libcore.net.url;
 
 import java.io.IOException;
 import java.net.Proxy;
@@ -27,7 +27,7 @@
  * This is the handler that is responsible for reading files from the file
  * system.
  */
-public class Handler extends URLStreamHandler {
+public class FileHandler extends URLStreamHandler {
 
     /**
      * Returns a connection to the a file pointed by this <code>URL</code> in
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java b/luni/src/main/java/libcore/net/url/FileURLConnection.java
similarity index 97%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java
rename to luni/src/main/java/libcore/net/url/FileURLConnection.java
index 3fb49fd..bc41169 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/file/FileURLConnection.java
+++ b/luni/src/main/java/libcore/net/url/FileURLConnection.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.file;
+package libcore.net.url;
 
 import java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
@@ -28,7 +28,7 @@
 import java.io.PrintStream;
 import java.net.URL;
 import java.net.URLConnection;
-import org.apache.harmony.luni.util.Util;
+import libcore.net.UriCodec;
 
 /**
  * This subclass extends <code>URLConnection</code>.
@@ -60,7 +60,7 @@
         if (fileName == null) {
             fileName = "";
         }
-        fileName = Util.decode(fileName, false);
+        fileName = UriCodec.decode(fileName);
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/Handler.java b/luni/src/main/java/libcore/net/url/FtpHandler.java
similarity index 95%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/Handler.java
rename to luni/src/main/java/libcore/net/url/FtpHandler.java
index 2585310..342a499 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/Handler.java
+++ b/luni/src/main/java/libcore/net/url/FtpHandler.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.ftp;
+package libcore.net.url;
 
 import java.io.IOException;
 import java.net.Proxy;
@@ -23,7 +23,7 @@
 import java.net.URLConnection;
 import java.net.URLStreamHandler;
 
-public class Handler extends URLStreamHandler {
+public class FtpHandler extends URLStreamHandler {
     /**
      * Open a URLConnection on the given URL.
      */
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java b/luni/src/main/java/libcore/net/url/FtpURLConnection.java
similarity index 99%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
rename to luni/src/main/java/libcore/net/url/FtpURLConnection.java
index 2414154..e168428 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLConnection.java
+++ b/luni/src/main/java/libcore/net/url/FtpURLConnection.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.ftp;
+package libcore.net.url;
 
 import java.io.BufferedInputStream;
 import java.io.EOFException;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLInputStream.java b/luni/src/main/java/libcore/net/url/FtpURLInputStream.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLInputStream.java
rename to luni/src/main/java/libcore/net/url/FtpURLInputStream.java
index 9392081..2a8865d 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/ftp/FtpURLInputStream.java
+++ b/luni/src/main/java/libcore/net/url/FtpURLInputStream.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.ftp;
+package libcore.net.url;
 
 import java.io.IOException;
 import java.io.InputStream;
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/Handler.java b/luni/src/main/java/libcore/net/url/JarHandler.java
similarity index 96%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/Handler.java
rename to luni/src/main/java/libcore/net/url/JarHandler.java
index e388369..cee517e 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/Handler.java
+++ b/luni/src/main/java/libcore/net/url/JarHandler.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.jar;
+package libcore.net.url;
 
 import java.io.IOException;
 import java.net.MalformedURLException;
@@ -24,7 +24,7 @@
 import java.net.URLStreamHandler;
 import org.apache.harmony.luni.util.URLUtil;
 
-public class Handler extends URLStreamHandler {
+public class JarHandler extends URLStreamHandler {
     /**
      * Returns a connection to the jar file pointed by this <code>URL</code>
      * in the file system
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java b/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
similarity index 83%
rename from luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java
rename to luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
index 9864350..9a2c898 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/net/www/protocol/jar/JarURLConnectionImpl.java
+++ b/luni/src/main/java/libcore/net/url/JarURLConnectionImpl.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.jar;
+package libcore.net.url;
 
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -28,9 +28,7 @@
 import java.net.JarURLConnection;
 import java.net.MalformedURLException;
 import java.net.URL;
-import java.security.AccessController;
 import java.security.Permission;
-import java.security.PrivilegedAction;
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
@@ -38,7 +36,7 @@
 import java.util.jar.JarEntry;
 import java.util.jar.JarFile;
 import java.util.zip.ZipFile;
-import org.apache.harmony.luni.util.Util;
+import libcore.net.UriCodec;
 
 /**
  * This subclass extends {@code URLConnection}.
@@ -136,54 +134,43 @@
         }
     }
 
-    @SuppressWarnings("nls")
     JarFile openJarFile() throws IOException {
-        JarFile jar = null;
         if (jarFileURL.getProtocol().equals("file")) {
-            jar = new JarFile(new File(Util.decode(jarFileURL.getFile(), false,
-                    "UTF-8")), true, ZipFile.OPEN_READ);
+            String decodedFile = UriCodec.decode(jarFileURL.getFile());
+            return new JarFile(new File(decodedFile), true, ZipFile.OPEN_READ);
         } else {
             final InputStream is = jarFileURL.openConnection().getInputStream();
             try {
-                jar = AccessController
-                        .doPrivileged(new PrivilegedAction<JarFile>() {
-                            public JarFile run() {
-                                FileOutputStream fos = null;
-                                JarFile result = null;
-                                try {
-                                    File tempJar = File.createTempFile("hyjar_", ".tmp", null);
-                                    tempJar.deleteOnExit();
-                                    fos = new FileOutputStream(tempJar);
-                                    byte[] buf = new byte[4096];
-                                    int nbytes = 0;
-                                    while ((nbytes = is.read(buf)) > -1) {
-                                        fos.write(buf, 0, nbytes);
-                                    }
-                                    fos.close();
-                                    result = new JarFile(tempJar, true,
-                                            ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
-                                } catch (IOException e) {
-                                    return null;
-                                } finally {
-                                    if (fos != null) {
-                                        try {
-                                            fos.close();
-                                        } catch (IOException ex) {
-                                            result = null;
-                                        }
-                                    }
-                                }
-                                return result;
-                            }
-                        });
+                FileOutputStream fos = null;
+                JarFile result = null;
+                try {
+                    File tempJar = File.createTempFile("hyjar_", ".tmp", null);
+                    tempJar.deleteOnExit();
+                    fos = new FileOutputStream(tempJar);
+                    byte[] buf = new byte[4096];
+                    int nbytes = 0;
+                    while ((nbytes = is.read(buf)) > -1) {
+                        fos.write(buf, 0, nbytes);
+                    }
+                    fos.close();
+                    return new JarFile(tempJar, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
+                } catch (IOException e) {
+                    return null;
+                } finally {
+                    if (fos != null) {
+                        try {
+                            fos.close();
+                        } catch (IOException ex) {
+                            return null;
+                        }
+                    }
+                }
             } finally {
                 if (is != null) {
                     is.close();
                 }
             }
         }
-
-        return jar;
     }
 
     /**
diff --git a/luni/src/main/java/libcore/util/CollectionUtils.java b/luni/src/main/java/libcore/util/CollectionUtils.java
index 884609c..45c2ae6 100644
--- a/luni/src/main/java/libcore/util/CollectionUtils.java
+++ b/luni/src/main/java/libcore/util/CollectionUtils.java
@@ -17,7 +17,11 @@
 package libcore.util;
 
 import java.lang.ref.Reference;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Iterator;
+import java.util.List;
 
 public final class CollectionUtils {
     private CollectionUtils() {}
@@ -73,4 +77,22 @@
             }
         };
     }
+
+    /**
+     * Sorts and removes duplicate elements from {@code list}. This method does
+     * not use {@link Object#equals}: only the comparator defines equality.
+     */
+    public static <T> void removeDuplicates(List<T> list, Comparator<? super T> comparator) {
+        Collections.sort(list, comparator);
+        int j = 1;
+        for (int i = 1; i < list.size(); i++) {
+            if (comparator.compare(list.get(j - 1), list.get(i)) != 0) {
+                T object = list.get(i);
+                list.set(j++, object);
+            }
+        }
+        if (j < list.size()) {
+            list.subList(j, list.size()).clear();
+        }
+    }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableBoolean.java
similarity index 64%
rename from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
rename to luni/src/main/java/libcore/util/MutableBoolean.java
index 5d1725d..359a8f9 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableBoolean.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableBoolean {
+    public boolean value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableBoolean(boolean value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableByte.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/util/MutableByte.java
index 5d1725d..13f780b 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableByte.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableByte {
+    public byte value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableByte(byte value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableChar.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/util/MutableChar.java
index 5d1725d..1cafc3c 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableChar.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableChar {
+    public char value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableChar(char value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableDouble.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/util/MutableDouble.java
index 5d1725d..4473ae6 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableDouble.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableDouble {
+    public double value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableDouble(double value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableFloat.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/util/MutableFloat.java
index 5d1725d..f81fba5 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableFloat.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableFloat {
+    public float value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableFloat(float value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableInt.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/util/MutableInt.java
index 5d1725d..c8feb3a 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableInt.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableInt {
+    public int value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableInt(int value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableLong.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/util/MutableLong.java
index 5d1725d..ad9b78e 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableLong.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableLong {
+    public long value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableLong(long value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java b/luni/src/main/java/libcore/util/MutableShort.java
similarity index 64%
copy from luni/src/test/java/libcore/xml/ExpatPullParserTest.java
copy to luni/src/main/java/libcore/util/MutableShort.java
index 5d1725d..78b4c33 100644
--- a/luni/src/test/java/libcore/xml/ExpatPullParserTest.java
+++ b/luni/src/main/java/libcore/util/MutableShort.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010 The Android Open Source Project
+ * Copyright (C) 2011 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,14 +14,12 @@
  * limitations under the License.
  */
 
-package libcore.xml;
+package libcore.util;
 
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
+public final class MutableShort {
+    public short value;
 
-public final class ExpatPullParserTest extends PullParserTest {
-
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
+    public MutableShort(short value) {
+        this.value = value;
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/SneakyThrow.java b/luni/src/main/java/libcore/util/SneakyThrow.java
similarity index 98%
rename from luni/src/main/java/org/apache/harmony/luni/util/SneakyThrow.java
rename to luni/src/main/java/libcore/util/SneakyThrow.java
index 6e5e7d4..1911788 100644
--- a/luni/src/main/java/org/apache/harmony/luni/util/SneakyThrow.java
+++ b/luni/src/main/java/libcore/util/SneakyThrow.java
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.harmony.luni.util;
+package libcore.util;
 
 /**
  * Exploits a weakness in the runtime to throw an arbitrary throwable without
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/util/ZoneInfo.java b/luni/src/main/java/libcore/util/ZoneInfo.java
similarity index 74%
rename from luni/src/main/java/org/apache/harmony/luni/internal/util/ZoneInfo.java
rename to luni/src/main/java/libcore/util/ZoneInfo.java
index 89125b0..5a8caf2 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/util/ZoneInfo.java
+++ b/luni/src/main/java/libcore/util/ZoneInfo.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.util;
+package libcore.util;
 
 import java.text.SimpleDateFormat;
 import java.util.Arrays;
@@ -22,8 +22,12 @@
 import java.util.Formatter;
 import java.util.TimeZone;
 
-final class ZoneInfo extends TimeZone {
-
+/**
+ * Our concrete TimeZone implementation, backed by zoneinfo data.
+ *
+ * @hide - used to implement TimeZone
+ */
+public final class ZoneInfo extends TimeZone {
     private static final long MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000;
     private static final long MILLISECONDS_PER_400_YEARS =
             MILLISECONDS_PER_DAY * (400 * 365 + 100 - 3);
@@ -40,6 +44,8 @@
 
     private int mRawOffset;
 
+    private final int mEarliestRawOffset;
+
     private final int[] mTransitions;
     private final int[] mOffsets;
     private final byte[] mTypes;
@@ -55,7 +61,7 @@
         // Use the latest non-daylight offset (if any) as the raw offset.
         int lastStd;
         for (lastStd = mTransitions.length - 1; lastStd >= 0; lastStd--) {
-            if (mIsDsts[mTypes[lastStd] & 0xFF] == 0) {
+            if (mIsDsts[mTypes[lastStd] & 0xff] == 0) {
                 break;
             }
         }
@@ -65,9 +71,20 @@
         if (lastStd >= mTypes.length) {
             mRawOffset = gmtOffsets[0];
         } else {
-            mRawOffset = gmtOffsets[mTypes[lastStd] & 0xFF];
+            mRawOffset = gmtOffsets[mTypes[lastStd] & 0xff];
         }
 
+        // Cache the oldest known raw offset, in case we're asked about times that predate our
+        // transition data.
+        int firstStd = -1;
+        for (int i = 0; i < mTransitions.length; ++i) {
+            if (mIsDsts[mTypes[i] & 0xff] == 0) {
+                firstStd = i;
+                break;
+            }
+        }
+        int earliestRawOffset = (firstStd != -1) ? gmtOffsets[mTypes[firstStd] & 0xff] : mRawOffset;
+
         // Rather than keep offsets from UTC, we use offsets from local time, so the raw offset
         // can be changed and automatically affect all the offsets.
         mOffsets = gmtOffsets;
@@ -87,7 +104,7 @@
         long currentUnixTime = System.currentTimeMillis() / 1000;
         if (mTransitions.length > 0) {
             // (We're really dealing with uint32_t values, so long is most convenient in Java.)
-            long latestScheduleTime = mTransitions[mTransitions.length - 1] & 0xffffffff;
+            long latestScheduleTime = ((long) mTransitions[mTransitions.length - 1]) & 0xffffffff;
             if (currentUnixTime < latestScheduleTime) {
                 usesDst = true;
             }
@@ -95,6 +112,7 @@
         mUseDst = usesDst;
 
         mRawOffset *= 1000;
+        mEarliestRawOffset = earliestRawOffset * 1000;
     }
 
     @Override
@@ -129,45 +147,45 @@
     @Override
     public int getOffset(long when) {
         int unix = (int) (when / 1000);
-        int trans = Arrays.binarySearch(mTransitions, unix);
-
-        if (trans == ~0) {
-            return mRawOffset + mOffsets[0] * 1000;
+        int transition = Arrays.binarySearch(mTransitions, unix);
+        if (transition < 0) {
+            transition = ~transition - 1;
+            if (transition < 0) {
+                // Assume that all times before our first transition correspond to the
+                // oldest-known non-daylight offset. The obvious alternative would be to
+                // use the current raw offset, but that seems like a greater leap of faith.
+                return mEarliestRawOffset;
+            }
         }
-        if (trans < 0) {
-            trans = ~trans - 1;
-        }
-
-        return mRawOffset + mOffsets[mTypes[trans] & 0xFF] * 1000;
+        return mRawOffset + mOffsets[mTypes[transition] & 0xff] * 1000;
     }
 
-    @Override
-    public int getRawOffset() {
+    @Override public boolean inDaylightTime(Date time) {
+        long when = time.getTime();
+        int unix = (int) (when / 1000);
+        int transition = Arrays.binarySearch(mTransitions, unix);
+        if (transition < 0) {
+            transition = ~transition - 1;
+            if (transition < 0) {
+                // Assume that all times before our first transition are non-daylight.
+                // Transition data tends to start with a transition to daylight, so just
+                // copying the first transition would assume the opposite.
+                // http://code.google.com/p/android/issues/detail?id=14395
+                return false;
+            }
+        }
+        return mIsDsts[mTypes[transition] & 0xff] == 1;
+    }
+
+    @Override public int getRawOffset() {
         return mRawOffset;
     }
 
-    @Override
-    public void setRawOffset(int off) {
+    @Override public void setRawOffset(int off) {
         mRawOffset = off;
     }
 
-    @Override
-    public boolean inDaylightTime(Date when) {
-        int unix = (int) (when.getTime() / 1000);
-        int trans = Arrays.binarySearch(mTransitions, unix);
-
-        if (trans == ~0) {
-            return mIsDsts[0] != 0;
-        }
-        if (trans < 0) {
-            trans = ~trans - 1;
-        }
-
-        return mIsDsts[mTypes[trans] & 0xFF] != 0;
-    }
-
-    @Override
-    public boolean useDaylightTime() {
+    @Override public boolean useDaylightTime() {
         return mUseDst;
     }
 
@@ -227,7 +245,7 @@
             String localTime = formatTime(mTransitions[i], this);
             int offset = mOffsets[type];
             int gmtOffset = mRawOffset/1000 + offset;
-            f.format("%4d : time=%10d %s = %s isDst=%d offset=%5d gmtOffset=%d\n",
+            f.format("%4d : time=%11d %s = %s isDst=%d offset=%5d gmtOffset=%d\n",
                     i, mTransitions[i], utcTime, localTime, mIsDsts[type], offset, gmtOffset);
         }
         return sb.toString();
diff --git a/luni/src/main/java/org/apache/harmony/luni/internal/util/ZoneInfoDB.java b/luni/src/main/java/libcore/util/ZoneInfoDB.java
similarity index 88%
rename from luni/src/main/java/org/apache/harmony/luni/internal/util/ZoneInfoDB.java
rename to luni/src/main/java/libcore/util/ZoneInfoDB.java
index c91f597..75dcafe 100644
--- a/luni/src/main/java/org/apache/harmony/luni/internal/util/ZoneInfoDB.java
+++ b/luni/src/main/java/libcore/util/ZoneInfoDB.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.util;
+package libcore.util;
 
 import java.io.IOException;
 import java.io.RandomAccessFile;
@@ -30,6 +30,9 @@
 import libcore.io.IoUtils;
 import libcore.io.MemoryMappedFile;
 
+// TODO: repackage this class, used by frameworks/base.
+import org.apache.harmony.luni.internal.util.TimezoneGetter;
+
 /**
  * A class used to initialize the time zone database.  This implementation uses the
  * 'zoneinfo' database as the source of time zone information.  However, to conserve
@@ -37,7 +40,7 @@
  * second file is used to indicate the starting position of each time zone record.  A
  * third file indicates the version of the zoneinfo database used to generate the data.
  *
- * {@hide}
+ * @hide - used to implement TimeZone
  */
 public final class ZoneInfoDB {
     /**
@@ -74,13 +77,19 @@
         readIndex();
     }
 
-    private static final MemoryMappedFile allZoneData = mapData();
+    /**
+     * Rather than open, read, and close the big data file each time we look up a time zone,
+     * we map the big data file during startup, and then just use the MemoryMappedFile.
+     *
+     * At the moment, this "big" data file is about 500 KiB. At some point, that will be small
+     * enough that we'll just keep the byte[] in memory.
+     */
+    private static final MemoryMappedFile allZoneData = MemoryMappedFile.mmapRO(ZONE_FILE_NAME);
 
     private ZoneInfoDB() {}
 
     /**
-     * Reads the file indicating the database version in use.  If the file is not
-     * present or is unreadable, we assume a version of "2007h".
+     * Reads the file indicating the database version in use.
      */
     private static String readVersion() {
         try {
@@ -102,17 +111,13 @@
      * All this code assumes strings are US-ASCII.
      */
     private static void readIndex() {
-        RandomAccessFile file = null;
-        MemoryMappedFile mappedFile = null;
+        MemoryMappedFile mappedFile = MemoryMappedFile.mmapRO(INDEX_FILE_NAME);
         try {
-            file = new RandomAccessFile(INDEX_FILE_NAME, "r");
-            mappedFile = MemoryMappedFile.mmap(file.getFD(), MapMode.READ_ONLY, 0, file.length());
             readIndex(mappedFile);
         } catch (IOException ex) {
             throw new RuntimeException(ex);
         } finally {
             IoUtils.closeQuietly(mappedFile);
-            IoUtils.closeQuietly(file);
         }
     }
 
@@ -125,7 +130,7 @@
         final int SIZEOF_TZINT = 4;
 
         byte[] idBytes = new byte[SIZEOF_TZNAME];
-        int numEntries = mappedFile.size() / (SIZEOF_TZNAME + 3*SIZEOF_TZINT);
+        int numEntries = (int) mappedFile.size() / (SIZEOF_TZNAME + 3*SIZEOF_TZINT);
 
         char[] idChars = new char[numEntries * SIZEOF_TZNAME];
         int[] idEnd = new int[numEntries];
@@ -164,25 +169,6 @@
         }
     }
 
-    /**
-     * Rather than open, read, and close the big data file each time we look up a time zone,
-     * we map the big data file during startup, and then just use the MemoryMappedFile.
-     *
-     * At the moment, this "big" data file is about 160 KiB. At some point, that will be small
-     * enough that we'll just keep the byte[] in memory.
-     */
-    private static MemoryMappedFile mapData() {
-        RandomAccessFile file = null;
-        try {
-            file = new RandomAccessFile(ZONE_FILE_NAME, "r");
-            return MemoryMappedFile.mmap(file.getFD(), MapMode.READ_ONLY, 0, file.length());
-        } catch (IOException ex) {
-            throw new RuntimeException(ex);
-        } finally {
-            IoUtils.closeQuietly(file);
-        }
-    }
-
     private static TimeZone makeTimeZone(String id) throws IOException {
         // Work out where in the big data file this time zone is.
         int index = Arrays.binarySearch(ids, id);
diff --git a/luni/src/main/java/org/apache/harmony/archive/util/Util.java b/luni/src/main/java/org/apache/harmony/archive/util/Util.java
deleted file mode 100644
index 0875540..0000000
--- a/luni/src/main/java/org/apache/harmony/archive/util/Util.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.archive.util;
-
-/**
- * Helpers for the archive module.
- */
-public class Util {
-
-    /**
-     * Returns whether the given source string ends with the suffix, ignoring
-     * case and assuming that the strings are ascii encoded.
-     *
-     * @param source
-     *            the string to match.
-     * @param suffix
-     *            the suffix to test.
-     * @return {@code true} if the source does end with the given suffix, or
-     *         {@code false} if not.
-     */
-    public static boolean asciiEndsWithIgnoreCase(String source, String suffix) {
-        int length = suffix.length();
-        if (length > source.length()) {
-            return false;
-        }
-        int offset = source.length() - length;
-        for (int i = 0; i < length; i++) {
-            char c1 = source.charAt(i + offset);
-            char c2 = suffix.charAt(i);
-            if (c1 != c2 && toASCIIUpperCase(c1) != toASCIIUpperCase(c2)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Compares the given byte arrays and returns whether they are equal,
-     * ignoring case differences and assuming they are ascii-encoded strings.
-     *
-     * @param buf1
-     *            first byte array to compare.
-     * @param buf2
-     *            second byte array to compare.
-     * @return the result of the comparison.
-     */
-    public static boolean asciiEqualsIgnoreCase(byte[] buf1, byte[] buf2) {
-        if (buf1 == null || buf2 == null) {
-            return false;
-        }
-        if (buf1 == buf2) {
-            return true;
-        }
-        if (buf1.length != buf2.length) {
-            return false;
-        }
-
-        for (int i = 0; i < buf1.length; i++) {
-            byte b1 = buf1[i];
-            byte b2 = buf2[i];
-            if (b1 != b2 && toASCIIUpperCase(b1) != toASCIIUpperCase(b2)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    /**
-     * Compares the given strings and returns whether they are equal, ignoring
-     * case differences and assuming they are ascii-encoded strings.
-     *
-     * @param s1
-     *            first string to compare.
-     * @param s2
-     *            second string to compare.
-     * @return the result of the comparison.
-     */
-    public static boolean asciiEqualsIgnoreCase(String s1, String s2) {
-        if (s1 == null || s2 == null) {
-            return false;
-        }
-        if (s1 == s2) {
-            return true;
-        }
-
-        int length = s1.length();
-        if (length != s2.length()) {
-            return false;
-        }
-
-        for (int i = 0; i < length; i++) {
-            char c1 = s1.charAt(i);
-            char c2 = s2.charAt(i);
-            if (c1 != c2 && toASCIIUpperCase(c1) != toASCIIUpperCase(c2)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    private static final byte toASCIIUpperCase(byte b) {
-        if ('a' <= b && b <= 'z') {
-            return (byte) (b - ('a' - 'A'));
-        }
-        return b;
-    }
-
-    private static final char toASCIIUpperCase(char c) {
-        if ('a' <= c && c <= 'z') {
-            return (char) (c - ('a' - 'A'));
-        }
-        return c;
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/kernel/vm/LangAccess.java b/luni/src/main/java/org/apache/harmony/kernel/vm/LangAccess.java
deleted file mode 100644
index 28c3546..0000000
--- a/luni/src/main/java/org/apache/harmony/kernel/vm/LangAccess.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.kernel.vm;
-
-import dalvik.system.VMStack;
-
-/**
- * Bridge into <code>java.lang</code> from other trusted parts of the
- * core library. Trusted packages either get seeded with an instance
- * of this class directly or may call {@link #getInstance} on this
- * class, to allow them to call into what would otherwise be
- * package-scope functionality in <code>java.lang</code>.
- */
-public abstract class LangAccess {
-    /** unique instance of this class */
-    private static LangAccess theInstance = null;
-
-    /**
-     * Sets the unique instance of this class. This may only be done once.
-     *
-     * @param instance non-null; the instance
-     */
-    public static void setInstance(LangAccess instance) {
-        if (theInstance != null) {
-            throw new UnsupportedOperationException("already initialized");
-        }
-
-        theInstance = instance;
-    }
-
-    /**
-     * Gets the unique instance of this class. This is only allowed in
-     * very limited situations.
-     */
-    public static LangAccess getInstance() {
-        /*
-         * Only code on the bootclasspath is allowed to get at the
-         * instance.
-         */
-        ClassLoader calling = VMStack.getCallingClassLoader2();
-        ClassLoader current = LangAccess.class.getClassLoader();
-
-        if ((calling != null) && (calling != current)) {
-            throw new SecurityException("LangAccess access denied");
-        }
-
-        if (theInstance == null) {
-            throw new UnsupportedOperationException("not yet initialized");
-        }
-
-        return theInstance;
-    }
-
-    /**
-     * Gets a shared array of the enum constants of a given class in
-     * declaration (ordinal) order. It is not safe to hand out this
-     * array to any user code.
-     *
-     * @param clazz non-null; the class in question
-     * @return null-ok; the class's list of enumerated constants in
-     * declaration order or <code>null</code> if the given class is
-     * not an enumeration
-     */
-    public abstract <T> T[] getEnumValuesInOrder(Class<T> clazz);
-
-    /**
-     * Unparks the given thread. This unblocks the thread it if it was
-     * previously parked, or indicates that the thread is "preemptively
-     * unparked" if it wasn't already parked. The latter means that the
-     * next time the thread is told to park, it will merely clear its
-     * latent park bit and carry on without blocking.
-     *
-     * <p>See {@link java.util.concurrent.locks.LockSupport} for more
-     * in-depth information of the behavior of this method.</p>
-     *
-     * @param thread non-null; the thread to unpark
-     */
-    public abstract void unpark(Thread thread);
-
-    /**
-     * Parks the current thread for a particular number of nanoseconds, or
-     * indefinitely. If not indefinitely, this method unparks the thread
-     * after the given number of nanoseconds if no other thread unparks it
-     * first. If the thread has been "preemptively unparked," this method
-     * cancels that unparking and returns immediately. This method may
-     * also return spuriously (that is, without the thread being told to
-     * unpark and without the indicated amount of time elapsing).
-     *
-     * <p>See {@link java.util.concurrent.locks.LockSupport} for more
-     * in-depth information of the behavior of this method.</p>
-     *
-     * @param nanos number of nanoseconds to park for or <code>0</code>
-     * to park indefinitely
-     * @throws IllegalArgumentException thrown if <code>nanos &lt; 0</code>
-     */
-    public abstract void parkFor(long nanos);
-
-    /**
-     * Parks the current thread until the specified system time. This
-     * method attempts to unpark the current thread immediately after
-     * <code>System.currentTimeMillis()</code> reaches the specified
-     * value, if no other thread unparks it first. If the thread has
-     * been "preemptively unparked," this method cancels that
-     * unparking and returns immediately. This method may also return
-     * spuriously (that is, without the thread being told to unpark
-     * and without the indicated amount of time elapsing).
-     *
-     * <p>See {@link java.util.concurrent.locks.LockSupport} for more
-     * in-depth information of the behavior of this method.</p>
-     *
-     * @param time the time after which the thread should be unparked,
-     * in absolute milliseconds-since-the-epoch
-     */
-    public abstract void parkUntil(long time);
-}
diff --git a/luni/src/main/java/org/apache/harmony/kernel/vm/ReflectionAccess.java b/luni/src/main/java/org/apache/harmony/kernel/vm/ReflectionAccess.java
deleted file mode 100644
index fc2dcd1..0000000
--- a/luni/src/main/java/org/apache/harmony/kernel/vm/ReflectionAccess.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.kernel.vm;
-
-import java.lang.reflect.AccessibleObject;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-/**
- * Bridge from <code>java.lang</code> to <code>java.lang.reflect</code>.
- * The package <code>java.lang</code> gets seeded with an instance of
- * this interface, to allow it to call into what would otherwise be
- * package-scope functionality in <code>java.lang.reflect</code>.
- */
-public interface ReflectionAccess {
-    /**
-     * Gets a clone of the given method.
-     *
-     * @param method non-null; the method to clone
-     * @return non-null; the clone
-     */
-    public Method clone(Method method);
-
-    /**
-     * Gets a clone of the given field.
-     *
-     * @param field non-null; the field to clone
-     * @return non-null; the clone
-     */
-    public Field clone(Field field);
-
-    /**
-     * Gets a clone of the given method, where the clone has
-     * its "accessible" flag set to <code>true</code>
-     *
-     * @param method non-null; the method to clone
-     * @return non-null; the accessible clone
-     */
-    public Method accessibleClone(Method method);
-
-    /**
-     * Sets the accessible flag on a given {@link AccessibleObject}
-     * without doing any checks.
-     *
-     * @param ao non-null; the instance in question
-     * @param flag the new value for the accessible flag
-     */
-    public void setAccessibleNoCheck(AccessibleObject ao, boolean flag);
-}
diff --git a/luni/src/main/java/org/apache/harmony/kernel/vm/VM.java b/luni/src/main/java/org/apache/harmony/kernel/vm/VM.java
deleted file mode 100644
index 2e2ccc0..0000000
--- a/luni/src/main/java/org/apache/harmony/kernel/vm/VM.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.kernel.vm;
-
-/**
- * This class must be implemented by the vm vendor. Represents the running
- * virtual machine. All VM specific API are implemented on this class.
- * <p>
- * Note that all methods in VM are static. There is no singleton instance which
- * represents the actively running VM.
- */
-public final class VM {
-
-    /*
-     * kernelVersion has the format: aabbxxyy where: aa - major version of
-     * kernel. Must equal that stored in jcl. bb - minor version of kernel. Must
-     * be >= that in jcl. xx - major version of jcl. Must equal that stored in
-     * kernel. yy - minor version of jcl. Must be >= that in kernel.
-     */
-    private static final int kernelVersion = 0x01000100;
-
-    /**
-     * This method must be provided by the vm vendor, as it is used by
-     * org.apache.harmony.kernel.vm.MsgHelp.setLocale() to get the bootstrap
-     * ClassLoader. MsgHelp uses the bootstrap ClassLoader to find the resource
-     * bundle of messages packaged with the bootstrap classes. Returns the
-     * ClassLoader of the method (including natives) at the specified depth on
-     * the stack of the calling thread. Frames representing the VM
-     * implementation of java.lang.reflect are not included in the list. This is
-     * not a public method as it can return the bootstrap class loader, which
-     * should not be accessed by non-bootstrap classes. Notes:
-     * <ul>
-     * <li>This method operates on the defining classes of methods on stack.
-     * NOT the classes of receivers.</li>
-     * <li>The item at depth zero is the caller of this method</li>
-     * </ul>
-     *
-     * @param depth the stack depth of the requested ClassLoader
-     * @return the ClassLoader at the specified depth
-     * @see java.lang.ClassLoader#getStackClassLoader
-     */
-    static final ClassLoader getStackClassLoader(int depth) {
-        return null;
-    };
-
-    /**
-     * This method must be provided by the vm vendor, as it is used by other
-     * provided class implementations. For example,
-     * java.io.ObjectInputStream.readObject() and
-     * java.io.ObjectInputStream.resolveProxyClass(). It is also useful for
-     * other classes, such as java.rmi.server.RMIClassLoader. Walk the stack and
-     * answer the most recent non-null and non-bootstrap ClassLoader on the
-     * stack of the calling thread. If no such ClassLoader is found, null is
-     * returned. Notes: 1) This method operates on the defining classes of
-     * methods on stack. NOT the classes of receivers.
-     *
-     * @return the first non-bootstrap ClassLoader on the stack
-     */
-    static public final ClassLoader getNonBootstrapClassLoader() {
-        return null;
-    };
-
-    /**
-     * Initialize the classloader.
-     *
-     * @param loader ClassLoader the ClassLoader instance
-     * @param bootLoader boolean true for the bootstrap class loader
-     */
-    public final static void initializeClassLoader(ClassLoader loader, boolean bootLoader) {
-        return;
-    };
-
-    /**
-     * This method must be provided by the vm vendor.
-     *
-     * Searches an internal table of strings for a string equal to the specified
-     * String. If the string is not in the table, it is added. Returns the
-     * string contained in the table which is equal to the specified String. The
-     * same string object is always answered for strings which are equal.
-     *
-     * @param string the String to intern
-     *
-     * @return the interned string equal to the specified String
-     */
-    public static final String intern(String string) {
-        return null;
-    }
-
-    /**
-     * Native used to find and load a class using the VM
-     *
-     * @return java.lang.Class the class or null.
-     * @param className String the name of the class to search for.
-     * @param classLoader the classloader to do the work
-     */
-    static Class<?> findClassOrNull(String className, ClassLoader classLoader) {
-        return null;
-    }
-
-    /**
-     * This method must be included, as it is used by
-     * ResourceBundle.getBundle(), and other places as well. The reference
-     * implementation of this method uses the getStackClassLoader() method.
-     * Returns the ClassLoader of the method that called the caller. i.e. A.x()
-     * calls B.y() calls callerClassLoader(), A's ClassLoader will be returned.
-     * Returns null for the bootstrap ClassLoader.
-     *
-     * @return a ClassLoader or null for the bootstrap ClassLoader
-     * @throws SecurityException when called from a non-bootstrap Class
-     */
-    public static ClassLoader callerClassLoader() {
-        return null;
-    }
-
-    /**
-     * This method must be provided by the vm vendor, as it is used by
-     * org.apache.harmony.luni.util.MsgHelp.setLocale() to get the bootstrap
-     * ClassLoader. MsgHelp uses the bootstrap ClassLoader to find the resource
-     * bundle of messages packaged with the bootstrap classes. The reference
-     * implementation of this method uses the getStackClassLoader() method.
-     *
-     * Returns the ClassLoader of the method that called the caller. i.e. A.x()
-     * calls B.y() calls callerClassLoader(), A's ClassLoader will be returned.
-     * Returns null for the bootstrap ClassLoader.
-     *
-     * @return a ClassLoader
-     *
-     * @throws SecurityException when called from a non-bootstrap Class
-     */
-    public static ClassLoader bootCallerClassLoader() {
-        return null;
-    }
-
-    /**
-     * Native used to dump a string to the system console for debugging.
-     *
-     * @param str String the String to display
-     */
-    public static void dumpString(String str) {
-        return;
-    }
-
-    /**
-     * Get the classpath entry that was used to load the class that is the arg.
-     * <p>
-     * This method is for internal use only.
-     *
-     * @param targetClass Class the class to set the classpath of.
-     * @see java.lang.Class
-     */
-    static int getCPIndexImpl(Class<?> targetClass) {
-        return 0;
-    }
-
-    /**
-     * Does internal initialization required by VM.
-     *
-     */
-    static void initializeVM() {
-    }
-
-    /**
-     * Registers a new virtual-machine shutdown hook. This is equivalent to the
-     * 1.3 API of the same name.
-     *
-     * @param hook the hook (a Thread) to register
-     */
-    public static void addShutdownHook(Thread hook) {
-        return;
-    }
-
-    /**
-     * De-registers a previously-registered virtual-machine shutdown hook. This
-     * is equivalent to the 1.3 API of the same name.
-     *
-     * @param hook the hook (a Thread) to de-register
-     * @return true if the hook could be de-registered
-     */
-    public static boolean removeShutdownHook(Thread hook) {
-        return false;
-    }
-
-    /**
-     * This method must be provided by the vm vendor. Called to signal that the
-     * org.apache.harmony.luni.internal.net.www.protocol.jar.JarURLConnection
-     * class has been loaded and JarURLConnection.closeCachedFiles() should be
-     * called on VM shutdown.
-     */
-    public static void closeJars() {
-        return;
-    }
-
-    /**
-     * This method must be provided by the vm vendor. Called to signal that the
-     * org.apache.harmony.luni.util.DeleteOnExit class has been loaded and
-     * DeleteOnExit.deleteOnExit() should be called on VM shutdown.
-     */
-    public static void deleteOnExit() {
-        return;
-    }
-
-    // Constants used by getClassPathEntryType to indicate the class path entry
-    // type
-    static final int CPE_TYPE_UNKNOWN = 0;
-
-    static final int CPE_TYPE_DIRECTORY = 1;
-
-    static final int CPE_TYPE_JAR = 2;
-
-    static final int CPE_TYPE_TCP = 3;
-
-    static final int CPE_TYPE_UNUSABLE = 5;
-
-    /**
-     * Return the type of the specified entry on the class path for a
-     * ClassLoader. Valid types are: CPE_TYPE_UNKNOWN CPE_TYPE_DIRECTORY
-     * CPE_TYPE_JAR CPE_TYPE_TCP - this is obsolete CPE_TYPE_UNUSABLE
-     *
-     * @param classLoader the ClassLoader
-     * @param cpIndex the index on the class path
-     *
-     * @return a int which specifies the class path entry type
-     */
-    static final int getClassPathEntryType(Object classLoader, int cpIndex) {
-        return 0;
-    }
-
-    /**
-     * Returns command line arguments passed to the VM. Internally these are
-     * broken into optionString and extraInfo. This only returns the
-     * optionString part.
-     * <p>
-     *
-     * @return a String array containing the optionString part of command line
-     *         arguments
-     */
-    public static String[] getVMArgs() {
-        return null;
-    }
-
-    /**
-     * Return the number of entries on the bootclasspath.
-     *
-     * @return an int which is the number of entries on the bootclasspath
-     */
-    static int getClassPathCount() {
-        return 0;
-    }
-
-    /**
-     * Return the specified bootclasspath entry.
-     *
-     * @param index the index of the bootclasspath entry
-     *
-     * @return a byte array containing the bootclasspath entry
-     *             specified in the vm options
-     */
-    static byte[] getPathFromClassPath(int index) {
-        return null;
-    }
-
-    /**
-     * This method must be provided by the vm vendor.
-     *
-     * Returns an int containing the version number of the kernel. Used to check for kernel
-     * compatibility.
-     *
-     * @return an int containing the kernel version number
-     */
-    public static int getKernelVersion() {
-        return kernelVersion;
-    }
-
-}
diff --git a/luni/src/main/java/org/apache/harmony/lang/annotation/AnnotationFactory.java b/luni/src/main/java/org/apache/harmony/lang/annotation/AnnotationFactory.java
index 45a6c75..4667416 100644
--- a/luni/src/main/java/org/apache/harmony/lang/annotation/AnnotationFactory.java
+++ b/luni/src/main/java/org/apache/harmony/lang/annotation/AnnotationFactory.java
@@ -25,8 +25,6 @@
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
@@ -215,14 +213,7 @@
                 }
                 try {
                     if (!el.definingMethod.isAccessible()) {
-                        AccessController.doPrivileged(new PrivilegedAction<Object>(){
-                            public Object run() {
-                                try {
-                                    el.definingMethod.setAccessible(true);
-                                } catch (Exception ignore) {}
-                                return null;
-                            }
-                        });
+                        el.definingMethod.setAccessible(true);
                     }
                     Object otherValue = el.definingMethod.invoke(obj);
                     if (otherValue != null ) {
@@ -265,14 +256,18 @@
      * @return string representation of this annotation
      */
     public String toString() {
-        String res = "@" + klazz.getName() + "(";
-        for(int i = 0; i < elements.length; i++) {
-            if ( i != 0 ) {
-                res += ", ";
+        StringBuilder result = new StringBuilder();
+        result.append('@');
+        result.append(klazz.getName());
+        result.append('(');
+        for(int i = 0; i < elements.length; ++i) {
+            if (i != 0) {
+                result.append(", ");
             }
-            res += elements[i].toString();;
+            result.append(elements[i]);
         }
-        return res + ")";
+        result.append(')');
+        return result.toString();
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java
index 7767222..490daaf 100644
--- a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java
+++ b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/GenericSignatureParser.java
@@ -25,7 +25,7 @@
 
 /**
  * Implements a parser for the generics signature attribute.
- * Uses a top-down, resursive descent parsing approach for the following grammar:
+ * Uses a top-down, recursive descent parsing approach for the following grammar:
  * <pre>
  * ClassSignature ::=
  *     OptFormalTypeParams SuperclassSignature {SuperinterfaceSignature}.
@@ -125,11 +125,11 @@
         } else {
             if(genericDecl instanceof Class) {
                 Class c = (Class) genericDecl;
-                this.formalTypeParameters = ListOfVariables.empty;
+                this.formalTypeParameters = ListOfVariables.EMPTY;
                 this.superclassType = c.getSuperclass();
                 this.interfaceTypes = new ListOfTypes(c.getInterfaces());
             } else {
-                this.formalTypeParameters = ListOfVariables.empty;
+                this.formalTypeParameters = ListOfVariables.EMPTY;
                 this.superclassType = Object.class;
                 this.interfaceTypes = ListOfTypes.EMPTY;
             }
@@ -151,12 +151,12 @@
         } else {
             if(genericDecl instanceof Method) {
                 Method m = (Method) genericDecl;
-                this.formalTypeParameters = ListOfVariables.empty;
+                this.formalTypeParameters = ListOfVariables.EMPTY;
                 this.parameterTypes = new ListOfTypes(m.getParameterTypes());
                 this.exceptionTypes = new ListOfTypes(m.getExceptionTypes());
                 this.returnType = m.getReturnType();
             } else {
-                this.formalTypeParameters = ListOfVariables.empty;
+                this.formalTypeParameters = ListOfVariables.EMPTY;
                 this.parameterTypes = ListOfTypes.EMPTY;
                 this.exceptionTypes = ListOfTypes.EMPTY;
                 this.returnType = void.class;
@@ -179,11 +179,11 @@
         } else {
             if(genericDecl instanceof Constructor) {
                 Constructor c = (Constructor) genericDecl;
-                this.formalTypeParameters = ListOfVariables.empty;
+                this.formalTypeParameters = ListOfVariables.EMPTY;
                 this.parameterTypes = new ListOfTypes(c.getParameterTypes());
                 this.exceptionTypes = new ListOfTypes(c.getExceptionTypes());
             } else {
-                this.formalTypeParameters = ListOfVariables.empty;
+                this.formalTypeParameters = ListOfVariables.EMPTY;
                 this.parameterTypes = ListOfTypes.EMPTY;
                 this.exceptionTypes = ListOfTypes.EMPTY;
             }
diff --git a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForVariable.java b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForVariable.java
index 7a102fb..783d223 100644
--- a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForVariable.java
+++ b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ImplForVariable.java
@@ -23,15 +23,13 @@
 import java.lang.reflect.TypeVariable;
 
 
-public final class ImplForVariable<D extends GenericDeclaration>
-        implements TypeVariable<D> {
+public final class ImplForVariable<D extends GenericDeclaration> implements TypeVariable<D> {
     private ImplForVariable<D> formalVar;
     private final GenericDeclaration declOfVarUser;
     private final String name;
     private D genericDeclaration;
     private ListOfTypes bounds;
 
-
     @Override
     public boolean equals(Object o) {
         if(!(o instanceof TypeVariable)) {
@@ -52,7 +50,6 @@
      * @param genericDecl declaration where a type variable is declared
      * @param name type variable name
      * @param bounds class and interface bounds
-     * @api2vm
      */
     ImplForVariable(D genericDecl, String name, ListOfTypes bounds) {
         this.genericDeclaration = genericDecl;
@@ -65,7 +62,6 @@
     /**
      * @param genericDecl declaration where a type variable is used
      * @param name type variable name
-     * @api2vm
      */
     ImplForVariable(D genericDecl, String name) {
         this.name = name;
@@ -83,46 +79,43 @@
         return null;
     }
 
-    static GenericDeclaration nextLayer(GenericDeclaration decl) {
-            if (decl instanceof Class) {
-                // FIXME: Is the following hierarchy correct?:
-                Class cl = (Class)decl;
-                decl = cl.getEnclosingMethod();
-                if (decl != null) {
-                    return decl;
-                }
-                decl = cl.getEnclosingConstructor();
-                if (decl != null) {
-                    return decl;
-                }
-                return cl.getEnclosingClass();
-            } else if (decl instanceof Method) {
-                return ((Method)decl).getDeclaringClass();
-            } else if (decl instanceof Constructor) {
-                return ((Constructor)decl).getDeclaringClass();
+    private static GenericDeclaration nextLayer(GenericDeclaration decl) {
+        if (decl instanceof Class) {
+            // FIXME: Is the following hierarchy correct?:
+            Class cl = (Class)decl;
+            decl = cl.getEnclosingMethod();
+            if (decl != null) {
+                return decl;
             }
-            throw new RuntimeException("unknown GenericDeclaration2: "
-                    + decl.toString());
+            decl = cl.getEnclosingConstructor();
+            if (decl != null) {
+                return decl;
+            }
+            return cl.getEnclosingClass();
+        } else if (decl instanceof Method) {
+            return ((Method)decl).getDeclaringClass();
+        } else if (decl instanceof Constructor) {
+            return ((Constructor)decl).getDeclaringClass();
+        } else {
+            throw new AssertionError();
+        }
     }
 
     void resolve() {
-        if (formalVar == null) {
-            GenericDeclaration curLayer = declOfVarUser;
-            TypeVariable var = null;
-            do {
-                var = findFormalVar(curLayer, name);
-                if (var != null) break;
-                else {
-                    curLayer = nextLayer(curLayer);
-                    if (curLayer == null) break; // FIXME: SHOULD NEVER HAPPEN!
-                                                 // throw exception: illegal
-                                                 // type variable reference.
-                }
-            } while (true);
-            formalVar = (ImplForVariable<D>)var;
-            this.genericDeclaration = formalVar.genericDeclaration;
-            this.bounds = formalVar.bounds;
+        if (formalVar != null) {
+            return;
         }
+        GenericDeclaration curLayer = declOfVarUser;
+        TypeVariable var;
+        while ((var = findFormalVar(curLayer, name)) == null) {
+            curLayer = nextLayer(curLayer);
+            if (curLayer == null) {
+                throw new AssertionError("illegal type variable reference");
+            }
+        }
+        formalVar = (ImplForVariable<D>) var;
+        this.genericDeclaration = formalVar.genericDeclaration;
+        this.bounds = formalVar.bounds;
     }
 
     public Type[] getBounds() {
diff --git a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ListOfVariables.java b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ListOfVariables.java
index 32b4d0c..0e757ac 100644
--- a/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ListOfVariables.java
+++ b/luni/src/main/java/org/apache/harmony/luni/lang/reflect/ListOfVariables.java
@@ -20,10 +20,9 @@
 import java.util.ArrayList;
 
 class ListOfVariables {
-    public static final TypeVariable[] empty = new ImplForVariable[0];
+    public static final TypeVariable[] EMPTY = new ImplForVariable[0];
 
     ArrayList<TypeVariable<?>> array = new ArrayList<TypeVariable<?>>();
-    int n = 0;
 
     void add (TypeVariable<?> elem) {
         array.add(elem);
diff --git a/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java b/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
deleted file mode 100644
index 2dee305..0000000
--- a/luni/src/main/java/org/apache/harmony/luni/net/SocketInputStream.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.luni.net;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.Socket;
-import java.net.SocketImpl;
-import java.util.Arrays;
-
-/**
- * The SocketInputStream supports the streamed reading of bytes from a socket.
- * Multiple streams may be opened on a socket, so care should be taken to manage
- * opened streams and coordinate read operations between threads.
- */
-class SocketInputStream extends InputStream {
-
-    private final PlainSocketImpl socket;
-
-    /**
-     * Constructs a SocketInputStream for the <code>socket</code>. Read
-     * operations are forwarded to the <code>socket</code>.
-     *
-     * @param socket the socket to be read
-     * @see Socket
-     */
-    public SocketInputStream(SocketImpl socket) {
-        super();
-        this.socket = (PlainSocketImpl) socket;
-    }
-
-    @Override
-    public int available() throws IOException {
-        return socket.available();
-    }
-
-    @Override
-    public void close() throws IOException {
-        socket.close();
-    }
-
-    @Override
-    public int read() throws IOException {
-        byte[] buffer = new byte[1];
-        int result = socket.read(buffer, 0, 1);
-        return (result == -1) ? result : buffer[0] & 0xFF;
-    }
-
-    @Override
-    public int read(byte[] buffer) throws IOException {
-        return read(buffer, 0, buffer.length);
-    }
-
-    @Override
-    public int read(byte[] buffer, int offset, int byteCount) throws IOException {
-        if (byteCount == 0) {
-            return 0;
-        }
-        Arrays.checkOffsetAndCount(buffer.length, offset, byteCount);
-        return socket.read(buffer, offset, byteCount);
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java b/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java
deleted file mode 100644
index 2e64d01..0000000
--- a/luni/src/main/java/org/apache/harmony/luni/net/SocketOutputStream.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.luni.net;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.Socket;
-import java.net.SocketImpl;
-import java.util.Arrays;
-
-class SocketOutputStream extends OutputStream {
-
-    private PlainSocketImpl socket;
-
-    /**
-     * Constructs a SocketOutputStream for the <code>socket</code>. Write
-     * operations are forwarded to the <code>socket</code>.
-     *
-     * @param socket the socket to be written
-     * @see Socket
-     */
-    public SocketOutputStream(SocketImpl socket) {
-        super();
-        this.socket = (PlainSocketImpl) socket;
-    }
-
-    @Override
-    public void close() throws IOException {
-        socket.close();
-    }
-
-    @Override
-    public void write(byte[] buffer) throws IOException {
-        socket.write(buffer, 0, buffer.length);
-    }
-
-    @Override
-    public void write(byte[] buffer, int offset, int byteCount) throws IOException {
-        Arrays.checkOffsetAndCount(buffer.length, offset, byteCount);
-        socket.write(buffer, offset, byteCount);
-    }
-
-    @Override
-    public void write(int oneByte) throws IOException {
-        byte[] buffer = new byte[1];
-        buffer[0] = (byte) (oneByte & 0xFF);
-        socket.write(buffer, 0, 1);
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/luni/platform/FileDescriptorHandler.java b/luni/src/main/java/org/apache/harmony/luni/platform/FileDescriptorHandler.java
deleted file mode 100644
index 0f1b578..0000000
--- a/luni/src/main/java/org/apache/harmony/luni/platform/FileDescriptorHandler.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.luni.platform;
-
-import java.io.FileDescriptor;
-
-/**
- * This interface declares method to get wrapped <code>FileDescriptor</code>.
- */
-public interface FileDescriptorHandler {
-
-    /**
-     * Get the wrapped <code>FileDescriptor</code>.
-     *
-     * @return the wrapped <code>FileDescriptor</code>.
-     */
-    FileDescriptor getFD();
-
-}
diff --git a/luni/src/main/java/org/apache/harmony/luni/platform/IFileSystem.java b/luni/src/main/java/org/apache/harmony/luni/platform/IFileSystem.java
deleted file mode 100644
index 46a8b0e..0000000
--- a/luni/src/main/java/org/apache/harmony/luni/platform/IFileSystem.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-// BEGIN android-note
-// address length was changed from long to int for performance reasons.
-// END android-note
-
-package org.apache.harmony.luni.platform;
-
-import java.io.FileDescriptor;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-/**
- * TODO Type description
- *
- */
-public interface IFileSystem {
-
-    public final int SHARED_LOCK_TYPE = 1;
-
-    public final int EXCLUSIVE_LOCK_TYPE = 2;
-
-    public final int SEEK_SET = 1;
-
-    public final int SEEK_CUR = 2;
-
-    public final int SEEK_END = 4;
-
-    public final int O_RDONLY = 0x00000000;
-
-    public final int O_WRONLY = 0x00000001;
-
-    public final int O_RDWR = 0x00000010;
-
-    public final int O_RDWRSYNC = 0x00000020;
-
-    public final int O_APPEND = 0x00000100;
-
-    public final int O_CREAT = 0x00001000;
-
-    public final int O_EXCL = 0x00010000;
-
-    public final int O_NOCTTY = 0x00100000;
-
-    public final int O_NONBLOCK = 0x01000000;
-
-    public final int O_TRUNC = 0x10000000;
-
-    public long read(int fileDescriptor, byte[] bytes, int offset, int length)
-            throws IOException;
-
-    public long write(int fileDescriptor, byte[] bytes, int offset, int length)
-            throws IOException;
-
-    public long readv(int fileDescriptor, int[] addresses, int[] offsets,
-            int[] lengths, int size) throws IOException;
-
-    public long writev(int fileDescriptor, int[] addresses, int[] offsets,
-            int[] lengths, int size) throws IOException;
-
-    // Required to support direct byte buffers
-    public long readDirect(int fileDescriptor, int address, int offset,
-            int length) throws IOException;
-
-    public long writeDirect(int fileDescriptor, int address, int offset,
-            int length) throws IOException;
-
-    public long length(int fd);
-
-    public boolean lock(int fileDescriptor, long start, long length, int type,
-            boolean waitFlag) throws IOException;
-
-    public void unlock(int fileDescriptor, long start, long length)
-            throws IOException;
-
-    public long seek(int fileDescriptor, long offset, int whence)
-            throws IOException;
-
-    public void fsync(int fileDescriptor, boolean metadata) throws IOException;
-
-    public void truncate(int fileDescriptor, long size) throws IOException;
-
-    /**
-     * Returns the granularity for virtual memory allocation.
-     */
-    public int getAllocGranularity();
-
-    public int open(String path, int mode) throws FileNotFoundException;
-
-    public long transfer(int fileHandler, FileDescriptor socketDescriptor,
-            long offset, long count) throws IOException;
-
-    // BEGIN android-deleted
-    // public long ttyAvailable() throws IOException;
-    // public long ttyRead(byte[] bytes, int offset, int length) throws IOException;
-    // END android-deleted
-
-    // BEGIN android-added
-    public int ioctlAvailable(FileDescriptor fileDescriptor) throws IOException;
-
-    public static class SeekPipeException extends IOException {
-        public SeekPipeException(String message) {
-            super(message);
-        }
-    }
-    // END android-added
-
-}
diff --git a/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java b/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
index 682ec3a..e5a511e 100644
--- a/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
+++ b/luni/src/main/java/org/apache/harmony/luni/platform/INetworkSystem.java
@@ -15,10 +15,6 @@
  *  limitations under the License.
  */
 
-// BEGIN android-note
-// address length was changed from long to int for performance reasons.
-// END android-note
-
 package org.apache.harmony.luni.platform;
 
 import java.io.FileDescriptor;
@@ -61,21 +57,11 @@
 
     public void disconnectDatagram(FileDescriptor fd) throws SocketException;
 
-    public void socket(FileDescriptor fd, boolean stream) throws SocketException;
-
-    public void shutdownInput(FileDescriptor descriptor) throws IOException;
-
-    public void shutdownOutput(FileDescriptor descriptor) throws IOException;
-
     public void sendUrgentData(FileDescriptor fd, byte value);
 
-    public void listen(FileDescriptor fd, int backlog) throws SocketException;
-
     public void connect(FileDescriptor fd, InetAddress inetAddress, int port, int timeout)
             throws SocketException;
 
-    public InetAddress getSocketLocalAddress(FileDescriptor fd);
-
     /**
      * Select the given file descriptors for read and write operations.
      *
@@ -111,25 +97,6 @@
             throws SocketException;
 
     /*
-     * Query the IP stack for the local port to which this socket is bound.
-     *
-     * @param fd the socket descriptor
-     * @return int the local port to which the socket is bound
-     */
-    public int getSocketLocalPort(FileDescriptor fd);
-
-    /*
-     * Query the IP stack for the nominated socket option.
-     *
-     * @param fd the socket descriptor @param opt the socket option type
-     * @return the nominated socket option value
-     *
-     * @throws SocketException if the option is invalid
-     */
-    public Object getSocketOption(FileDescriptor fd, int opt)
-            throws SocketException;
-
-    /*
      * Set the nominated socket option in the IP stack.
      *
      * @param fd the socket descriptor @param opt the option selector @param
@@ -145,8 +112,4 @@
      * concurrently.
      */
     public void close(FileDescriptor fd) throws IOException;
-
-    // TODO: change the single caller so that recv/recvDirect
-    // can mutate the InetAddress as a side-effect.
-    public void setInetAddress(InetAddress sender, byte[] address);
 }
diff --git a/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java b/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
deleted file mode 100644
index 254cf74..0000000
--- a/luni/src/main/java/org/apache/harmony/luni/platform/OSFileSystem.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-// BEGIN android-note
-// address length was changed from long to int for performance reasons.
-// END android-note
-
-package org.apache.harmony.luni.platform;
-
-import java.io.FileDescriptor;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-
-class OSFileSystem implements IFileSystem {
-
-    private static final OSFileSystem singleton = new OSFileSystem();
-
-    public static OSFileSystem getOSFileSystem() {
-        return singleton;
-    }
-
-    private OSFileSystem() {
-    }
-
-    private final void validateLockArgs(int type, long start, long length) {
-        if ((type != IFileSystem.SHARED_LOCK_TYPE)
-                && (type != IFileSystem.EXCLUSIVE_LOCK_TYPE)) {
-            throw new IllegalArgumentException("Illegal lock type requested.");
-        }
-
-        // Start position
-        if (start < 0) {
-            throw new IllegalArgumentException("start < 0");
-        }
-
-        // Length of lock stretch
-        if (length < 0) {
-            throw new IllegalArgumentException("length < 0");
-        }
-    }
-
-    private native int lockImpl(int fd, long start, long length, int type, boolean wait);
-
-    /**
-     * Returns the granularity for virtual memory allocation.
-     * Note that this value for Windows differs from the one for the
-     * page size (64K and 4K respectively).
-     */
-    public native int getAllocGranularity();
-
-    public native long length(int fd);
-
-    public boolean lock(int fd, long start, long length, int type, boolean waitFlag)
-            throws IOException {
-        // Validate arguments
-        validateLockArgs(type, start, length);
-        int result = lockImpl(fd, start, length, type, waitFlag);
-        return result != -1;
-    }
-
-    private native void unlockImpl(int fd, long start, long length) throws IOException;
-
-    public void unlock(int fd, long start, long length) throws IOException {
-        // Validate arguments
-        validateLockArgs(IFileSystem.SHARED_LOCK_TYPE, start, length);
-        unlockImpl(fd, start, length);
-    }
-
-    public native void fsync(int fd, boolean metadata) throws IOException;
-
-    /*
-     * File position seeking.
-     */
-    public native long seek(int fd, long offset, int whence) throws IOException;
-
-    /*
-     * Direct read/write APIs work on addresses.
-     */
-    public native long readDirect(int fd, int address, int offset, int length);
-
-    public native long writeDirect(int fd, int address, int offset, int length);
-
-    /*
-     * Indirect read/writes work on byte[]'s
-     */
-    public native long read(int fd, byte[] bytes, int offset, int length) throws IOException;
-
-    public native long write(int fd, byte[] bytes, int offset, int length) throws IOException;
-
-    /*
-     * Scatter/gather calls.
-     */
-    public native long readv(int fd, int[] addresses, int[] offsets, int[] lengths, int size)
-            throws IOException;
-
-    public native long writev(int fd, int[] addresses, int[] offsets, int[] lengths, int size)
-            throws IOException;
-
-    public native void truncate(int fd, long size) throws IOException;
-
-    public native int open(String path, int mode) throws FileNotFoundException;
-
-    public native long transfer(int fd, FileDescriptor sd, long offset, long count)
-            throws IOException;
-
-    public native int ioctlAvailable(FileDescriptor fileDescriptor) throws IOException;
-}
diff --git a/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java b/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
index 4be00f2..3fc4ab4 100644
--- a/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
+++ b/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
@@ -50,18 +50,8 @@
             throws IOException;
     public native boolean isConnected(FileDescriptor fd, int timeout) throws IOException;
 
-    public native void socket(FileDescriptor fd, boolean stream) throws SocketException;
-
     public native void disconnectDatagram(FileDescriptor fd) throws SocketException;
 
-    public native InetAddress getSocketLocalAddress(FileDescriptor fd);
-
-    public native int getSocketLocalPort(FileDescriptor fd);
-
-    public native Object getSocketOption(FileDescriptor fd, int opt) throws SocketException;
-
-    public native void listen(FileDescriptor fd, int backlog) throws SocketException;
-
     public native int read(FileDescriptor fd, byte[] data, int offset, int count)
             throws IOException;
 
@@ -101,15 +91,9 @@
 
     public native void sendUrgentData(FileDescriptor fd, byte value);
 
-    public native void setInetAddress(InetAddress sender, byte[] address);
-
     public native void setSocketOption(FileDescriptor fd, int opt, Object optVal)
             throws SocketException;
 
-    public native void shutdownInput(FileDescriptor fd) throws IOException;
-
-    public native void shutdownOutput(FileDescriptor fd) throws IOException;
-
     public native void close(FileDescriptor fd) throws IOException;
 
     public native int write(FileDescriptor fd, byte[] data, int offset, int count)
diff --git a/luni/src/main/java/org/apache/harmony/luni/platform/Platform.java b/luni/src/main/java/org/apache/harmony/luni/platform/Platform.java
index fb9caf9..db79a59 100644
--- a/luni/src/main/java/org/apache/harmony/luni/platform/Platform.java
+++ b/luni/src/main/java/org/apache/harmony/luni/platform/Platform.java
@@ -31,7 +31,6 @@
  * exceptions in the runtime. Access to the OS components is restricted to
  * trusted code running on the system classpath.
  *
- * @see IFileSystem
  * @see INetworkSystem
  */
 public class Platform {
@@ -39,9 +38,6 @@
     // now they do because ThreadLocal lookups will be done on most operations, which
     // should be relatively less than the speed of the operation.
     // TODO: measure & fix if needed.
-    public static final IFileSystem FILE_SYSTEM =
-            new BlockGuard.WrappedFileSystem(OSFileSystem.getOSFileSystem());
-
     public static final INetworkSystem NETWORK =
             new BlockGuard.WrappedNetworkSystem(OSNetworkSystem.getOSNetworkSystem());
 }
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/Base64.java b/luni/src/main/java/org/apache/harmony/luni/util/Base64.java
index af35e03..4c9b509 100644
--- a/luni/src/main/java/org/apache/harmony/luni/util/Base64.java
+++ b/luni/src/main/java/org/apache/harmony/luni/util/Base64.java
@@ -64,9 +64,9 @@
             }
         }
         // index in the output array
-        int out_index = 0;
+        int outIndex = 0;
         // index in the input array
-        int in_index = 0;
+        int inIndex = 0;
         // holds the value of the input character
         int bits = 0;
         // holds the value of the input quantum
@@ -102,26 +102,26 @@
             }
             // append the value to the quantum
             quantum = (quantum << 6) | (byte) bits;
-            if (in_index%4 == 3) {
+            if (inIndex%4 == 3) {
                 // 4 characters were read, so make the output:
-                out[out_index++] = (byte) (quantum >> 16);
-                out[out_index++] = (byte) (quantum >> 8);
-                out[out_index++] = (byte) quantum;
+                out[outIndex++] = (byte) (quantum >> 16);
+                out[outIndex++] = (byte) (quantum >> 8);
+                out[outIndex++] = (byte) quantum;
             }
-            in_index++;
+            inIndex++;
         }
         if (pad > 0) {
             // adjust the quantum value according to the padding
             quantum = quantum << (6*pad);
             // make output
-            out[out_index++] = (byte) (quantum >> 16);
+            out[outIndex++] = (byte) (quantum >> 16);
             if (pad == 1) {
-                out[out_index++] = (byte) (quantum >> 8);
+                out[outIndex++] = (byte) (quantum >> 8);
             }
         }
         // create the resulting array
-        byte[] result = new byte[out_index];
-        System.arraycopy(out, 0, result, 0, out_index);
+        byte[] result = new byte[outIndex];
+        System.arraycopy(out, 0, result, 0, outIndex);
         return result;
     }
 
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java b/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
index ac3275e..8fa04fd 100644
--- a/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
+++ b/luni/src/main/java/org/apache/harmony/luni/util/DeleteOnExit.java
@@ -22,7 +22,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 
-// BEGIN android-changed
 /**
  * Implements the actual DeleteOnExit mechanism. Is registered as a shutdown
  * hook in the Runtime, once it is actually being used.
@@ -77,4 +76,3 @@
         }
     }
 }
-// END android-changed
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/FloatingPointParser.java b/luni/src/main/java/org/apache/harmony/luni/util/FloatingPointParser.java
index 1feb323..e08e560 100644
--- a/luni/src/main/java/org/apache/harmony/luni/util/FloatingPointParser.java
+++ b/luni/src/main/java/org/apache/harmony/luni/util/FloatingPointParser.java
@@ -26,15 +26,18 @@
 
     private static final class StringExponentPair {
         String s;
-
-        int e;
-
+        long e;
         boolean negative;
 
-        StringExponentPair(String s, int e, boolean negative) {
-            this.s = s;
-            this.e = e;
-            this.negative = negative;
+        // Flags for two special non-error failure cases.
+        boolean infinity;
+        boolean zero;
+
+        public float specialValue() {
+            if (infinity) {
+                return negative ? Float.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY;
+            }
+            return negative ? -0.0f : 0.0f;
         }
     }
 
@@ -43,16 +46,7 @@
      * integer value (or zero). The exponent will be used to calculate the
      * floating point number by taking the positive integer the String
      * represents and multiplying by 10 raised to the power of the of the
-     * exponent. Returns the closest double value to the real number
-     *
-     * @param s
-     *            the String that will be parsed to a floating point
-     * @param e
-     *            an int represent the 10 to part
-     * @return the double closest to the real number
-     *
-     * @exception NumberFormatException
-     *                if the String doesn't represent a positive integer value
+     * exponent. Returns the closest double value to the real number, or Double.longBitsToDouble(-1).
      */
     private static native double parseDblImpl(String s, int e);
 
@@ -61,16 +55,7 @@
      * integer value (or zero). The exponent will be used to calculate the
      * floating point number by taking the positive integer the String
      * represents and multiplying by 10 raised to the power of the of the
-     * exponent. Returns the closest float value to the real number
-     *
-     * @param s
-     *            the String that will be parsed to a floating point
-     * @param e
-     *            an int represent the 10 to part
-     * @return the float closest to the real number
-     *
-     * @exception NumberFormatException
-     *                if the String doesn't represent a positive integer value
+     * exponent. Returns the closest float value to the real number, or Float.intBitsToFloat(-1).
      */
     private static native float parseFltImpl(String s, int e);
 
@@ -79,33 +64,22 @@
     }
 
     /**
-     * Takes a String and does some initial parsing. Should return a
-     * StringExponentPair containing a String with no leading or trailing white
+     * Returns a StringExponentPair containing a String with no leading or trailing white
      * space and trailing zeroes eliminated. The exponent of the
      * StringExponentPair will be used to calculate the floating point number by
      * taking the positive integer the String represents and multiplying by 10
      * raised to the power of the of the exponent.
-     *
-     * @param s
-     *            the String that will be parsed to a floating point
-     * @param length
-     *            the length of s
-     * @return a StringExponentPair with necessary values
-     *
-     * @exception NumberFormatException
-     *                if the String doesn't pass basic tests
      */
     private static StringExponentPair initialParse(String s, int length, boolean isDouble) {
-        boolean negative = false;
-        char c;
-        int start, end, decimal;
-        int e = 0;
-
-        start = 0;
+        StringExponentPair result = new StringExponentPair();
         if (length == 0) {
             throw invalidReal(s, isDouble);
         }
-        c = s.charAt(length - 1);
+        result.negative = (s.charAt(0) == '-');
+
+        // We ignore trailing double or float indicators; the method you called determines
+        // what you'll get.
+        char c = s.charAt(length - 1);
         if (c == 'D' || c == 'd' || c == 'F' || c == 'f') {
             length--;
             if (length == 0) {
@@ -113,28 +87,49 @@
             }
         }
 
-        end = Math.max(s.indexOf('E'), s.indexOf('e'));
-        if (end > -1) {
+        int end = Math.max(s.indexOf('E'), s.indexOf('e'));
+        if (end != -1) {
+            // Is there anything after the 'e'?
             if (end + 1 == length) {
                 throw invalidReal(s, isDouble);
             }
 
-            int exponent_offset = end + 1;
-            if (s.charAt(exponent_offset) == '+') {
-                if (s.charAt(exponent_offset + 1) == '-') {
-                    throw invalidReal(s, isDouble);
-                }
-                exponent_offset++; // skip the plus sign
-            }
-            try {
-                e = Integer.parseInt(s.substring(exponent_offset, length));
-            } catch (NumberFormatException ex) {
-                // ex contains the exponent substring
-                // only so throw a new exception with
-                // the correct string
-                throw invalidReal(s, isDouble);
+            // Do we have an optional explicit sign?
+            int exponentOffset = end + 1;
+            boolean negativeExponent = false;
+            char firstExponentChar = s.charAt(exponentOffset);
+            if (firstExponentChar == '+' || firstExponentChar == '-') {
+                negativeExponent = (firstExponentChar == '-');
+                ++exponentOffset;
             }
 
+            // Do we have a valid positive integer?
+            String exponentString = s.substring(exponentOffset, length);
+            if (exponentString.isEmpty()) {
+                throw invalidReal(s, isDouble);
+            }
+            for (int i = 0; i < exponentString.length(); ++i) {
+                char ch = exponentString.charAt(i);
+                if (ch < '0' || ch > '9') {
+                    throw invalidReal(s, isDouble);
+                }
+            }
+
+            // Parse the integer exponent.
+            try {
+                result.e = Integer.parseInt(exponentString);
+                if (negativeExponent) {
+                    result.e = -result.e;
+                }
+            } catch (NumberFormatException ex) {
+                // We already checked the string, so the exponent must have been out of range for an int.
+                if (negativeExponent) {
+                    result.zero = true;
+                } else {
+                    result.infinity = true;
+                }
+                return result;
+            }
         } else {
             end = length;
         }
@@ -142,11 +137,12 @@
             throw invalidReal(s, isDouble);
         }
 
+        int start = 0;
         c = s.charAt(start);
         if (c == '-') {
             ++start;
             --length;
-            negative = true;
+            result.negative = true;
         } else if (c == '+') {
             ++start;
             --length;
@@ -155,9 +151,9 @@
             throw invalidReal(s, isDouble);
         }
 
-        decimal = s.indexOf('.');
+        int decimal = s.indexOf('.');
         if (decimal > -1) {
-            e -= end - decimal - 1;
+            result.e -= end - decimal - 1;
             s = s.substring(start, decimal) + s.substring(decimal + 1, end);
         } else {
             s = s.substring(start, end);
@@ -178,84 +174,60 @@
         }
 
         if (end != length || start != 0) {
-            e += length - end;
+            result.e += length - end;
             s = s.substring(start, end);
         }
 
+        // This is a hack for https://issues.apache.org/jira/browse/HARMONY-329
         // Trim the length of very small numbers, natives can only handle down
         // to E-309
         final int APPROX_MIN_MAGNITUDE = -359;
         final int MAX_DIGITS = 52;
         length = s.length();
-        if (length > MAX_DIGITS && e < APPROX_MIN_MAGNITUDE) {
-            int d = Math.min(APPROX_MIN_MAGNITUDE - e, length - 1);
+        if (length > MAX_DIGITS && result.e < APPROX_MIN_MAGNITUDE) {
+            int d = Math.min(APPROX_MIN_MAGNITUDE - (int) result.e, length - 1);
             s = s.substring(0, length - d);
-            e += d;
+            result.e += d;
         }
 
-        return new StringExponentPair(s, e, negative);
+        // This is a hack for https://issues.apache.org/jira/browse/HARMONY-6641
+        // The magic 1024 was determined experimentally; the more plausible -324 and +309 were
+        // not sufficient to pass both our tests and harmony's tests.
+        if (result.e < -1024) {
+            result.zero = true;
+            return result;
+        } else if (result.e > 1024) {
+            result.infinity = true;
+            return result;
+        }
+
+        result.s = s;
+        return result;
     }
 
-    /*
-     * Assumes the string is trimmed.
-     */
-    private static double parseDblName(String namedDouble, int length) {
-        // Valid strings are only +Nan, NaN, -Nan, +Infinity, Infinity,
-        // -Infinity.
-        if ((length != 3) && (length != 4) && (length != 8) && (length != 9)) {
-            throw invalidReal(namedDouble, true);
-        }
-
+    // Parses "+Nan", "NaN", "-Nan", "+Infinity", "Infinity", and "-Infinity", case-insensitively.
+    private static float parseName(String name, boolean isDouble) {
+        // Explicit sign?
         boolean negative = false;
         int i = 0;
-        char firstChar = namedDouble.charAt(i);
+        int length = name.length();
+        char firstChar = name.charAt(i);
         if (firstChar == '-') {
             negative = true;
             ++i;
+            --length;
         } else if (firstChar == '+') {
             ++i;
+            --length;
         }
 
-        if (namedDouble.regionMatches(false, i, "Infinity", 0, 8)) {
-            return negative ? Double.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY;
-        }
-
-        if (namedDouble.regionMatches(false, i, "NaN", 0, 3)) {
-            return Double.NaN;
-        }
-
-        throw invalidReal(namedDouble, true);
-    }
-
-    /*
-     * Assumes the string is trimmed.
-     */
-    private static float parseFltName(String namedFloat, int length) {
-        // Valid strings are only +Nan, NaN, -Nan, +Infinity, Infinity,
-        // -Infinity.
-        if ((length != 3) && (length != 4) && (length != 8) && (length != 9)) {
-            throw invalidReal(namedFloat, false);
-        }
-
-        boolean negative = false;
-        int i = 0;
-        char firstChar = namedFloat.charAt(i);
-        if (firstChar == '-') {
-            negative = true;
-            ++i;
-        } else if (firstChar == '+') {
-            ++i;
-        }
-
-        if (namedFloat.regionMatches(false, i, "Infinity", 0, 8)) {
+        if (length == 8 && name.regionMatches(false, i, "Infinity", 0, 8)) {
             return negative ? Float.NEGATIVE_INFINITY : Float.POSITIVE_INFINITY;
         }
-
-        if (namedFloat.regionMatches(false, i, "NaN", 0, 3)) {
+        if (length == 3 && name.regionMatches(false, i, "NaN", 0, 3)) {
             return Float.NaN;
         }
-
-        throw invalidReal(namedFloat, false);
+        throw invalidReal(name, isDouble);
     }
 
     /**
@@ -278,25 +250,25 @@
 
         // See if this could be a named double
         char last = s.charAt(length - 1);
-        if ((last == 'y') || (last == 'N')) {
-            return parseDblName(s, length);
+        if (last == 'y' || last == 'N') {
+            return parseName(s, true);
         }
 
-        // See if it could be a hexadecimal representation
-        if (s.toLowerCase().indexOf("0x") != -1) {
+        // See if it could be a hexadecimal representation.
+        // We don't use startsWith because there might be a leading sign.
+        if (s.indexOf("0x") != -1 || s.indexOf("0X") != -1) {
             return HexStringParser.parseDouble(s);
         }
 
         StringExponentPair info = initialParse(s, length, true);
-
-        double result = parseDblImpl(info.s, info.e);
+        if (info.infinity || info.zero) {
+            return info.specialValue();
+        }
+        double result = parseDblImpl(info.s, (int) info.e);
         if (Double.doubleToRawLongBits(result) == 0xffffffffffffffffL) {
             throw invalidReal(s, true);
         }
-        if (info.negative) {
-            result = -result;
-        }
-        return result;
+        return info.negative ? -result : result;
     }
 
     /**
@@ -319,23 +291,24 @@
 
         // See if this could be a named float
         char last = s.charAt(length - 1);
-        if ((last == 'y') || (last == 'N')) {
-            return parseFltName(s, length);
+        if (last == 'y' || last == 'N') {
+            return parseName(s, false);
         }
 
         // See if it could be a hexadecimal representation
-        if (s.toLowerCase().indexOf("0x") != -1) {
+        // We don't use startsWith because there might be a leading sign.
+        if (s.indexOf("0x") != -1 || s.indexOf("0X") != -1) {
             return HexStringParser.parseFloat(s);
         }
 
         StringExponentPair info = initialParse(s, length, false);
-        float result = parseFltImpl(info.s, info.e);
+        if (info.infinity || info.zero) {
+            return info.specialValue();
+        }
+        float result = parseFltImpl(info.s, (int) info.e);
         if (Float.floatToRawIntBits(result) == 0xffffffff) {
             throw invalidReal(s, false);
         }
-        if (info.negative) {
-            result = -result;
-        }
-        return result;
+        return info.negative ? -result : result;
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/HexStringParser.java b/luni/src/main/java/org/apache/harmony/luni/util/HexStringParser.java
index 8a9d148..9e20a16 100644
--- a/luni/src/main/java/org/apache/harmony/luni/util/HexStringParser.java
+++ b/luni/src/main/java/org/apache/harmony/luni/util/HexStringParser.java
@@ -68,14 +68,14 @@
 
     private String abandonedNumber="";
 
-    public HexStringParser(int exponent_width, int mantissa_width) {
-        this.EXPONENT_WIDTH = exponent_width;
-        this.MANTISSA_WIDTH = mantissa_width;
+    public HexStringParser(int exponentWidth, int mantissaWidth) {
+        this.EXPONENT_WIDTH = exponentWidth;
+        this.MANTISSA_WIDTH = mantissaWidth;
 
-        this.EXPONENT_BASE = ~(-1L << (exponent_width - 1));
-        this.MAX_EXPONENT = ~(-1L << exponent_width);
+        this.EXPONENT_BASE = ~(-1L << (exponentWidth - 1));
+        this.MAX_EXPONENT = ~(-1L << exponentWidth);
         this.MIN_EXPONENT = -(MANTISSA_WIDTH + 1);
-        this.MANTISSA_MASK = ~(-1L << mantissa_width);
+        this.MANTISSA_MASK = ~(-1L << mantissaWidth);
     }
 
     /*
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java b/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java
deleted file mode 100644
index 9a12825..0000000
--- a/luni/src/main/java/org/apache/harmony/luni/util/PriviAction.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.luni.util;
-
-
-import java.lang.reflect.AccessibleObject;
-import java.security.Policy;
-import java.security.PrivilegedAction;
-import java.security.Security;
-
-/**
- * Helper class to avoid multiple anonymous inner class for
- * <code>{@link java.security.AccessController#doPrivileged(PrivilegedAction)}</code>
- * calls.
- */
-public class PriviAction<T> implements PrivilegedAction<T> {
-
-    private Object arg1;
-
-    private Object arg2;
-
-    private int action;
-
-    private static final int GET_SYSTEM_PROPERTY = 1;
-
-    private static final int GET_SECURITY_POLICY = 2;
-
-    private static final int SET_ACCESSIBLE = 3;
-
-    private static final int GET_SECURITY_PROPERTY = 4;
-
-    /**
-     * Creates a PrivilegedAction to get the security property with the given
-     * name.
-     *
-     * @param property
-     *            the name of the property
-     *
-     * @see Security#getProperty
-     */
-    public static PrivilegedAction<String> getSecurityProperty(String property) {
-        return new PriviAction<String>(GET_SECURITY_PROPERTY, property);
-    }
-
-    private PriviAction(int action, Object arg) {
-        this.action = action;
-        this.arg1 = arg;
-    }
-
-    /**
-     * Creates a PrivilegedAction to get the current security policy object.
-     *
-     * @see Policy#getPolicy
-     */
-    public PriviAction() {
-        action = GET_SECURITY_POLICY;
-    }
-
-    /**
-     * Creates a PrivilegedAction to disable the access checks to the given
-     * object.
-     *
-     * @param object
-     *            the object whose accessible flag will be set to
-     *            <code>true</code>
-     *
-     * @see AccessibleObject#setAccessible(boolean)
-     */
-    public PriviAction(AccessibleObject object) {
-        action = SET_ACCESSIBLE;
-        arg1 = object;
-    }
-
-    /**
-     * Creates a PrivilegedAction to return the value of the system property
-     * with the given key.
-     *
-     * @param property
-     *            the key of the system property
-     *
-     * @see System#getProperty(String)
-     */
-    public PriviAction(String property) {
-        action = GET_SYSTEM_PROPERTY;
-        arg1 = property;
-    }
-
-    /**
-     * Creates a PrivilegedAction to return the value of the system property
-     * with the given key.
-     *
-     * @param property
-     *            the key of the system property
-     * @param defaultAnswer
-     *            the return value if the system property does not exist
-     *
-     * @see System#getProperty(String, String)
-     */
-    public PriviAction(String property, String defaultAnswer) {
-        action = GET_SYSTEM_PROPERTY;
-        arg1 = property;
-        arg2 = defaultAnswer;
-    }
-
-    /**
-     * Performs the actual privileged computation as defined by the constructor.
-     *
-     * @see java.security.PrivilegedAction#run()
-     */
-    @SuppressWarnings("unchecked")
-    public T run() {
-        switch (action) {
-        case GET_SYSTEM_PROPERTY:
-            return (T)System.getProperty((String) arg1, (String) arg2);
-        case GET_SECURITY_PROPERTY:
-            return (T)Security.getProperty((String) arg1);
-        case GET_SECURITY_POLICY:
-            return (T)Policy.getPolicy();
-        case SET_ACCESSIBLE:
-            ((AccessibleObject) arg1).setAccessible(true);
-        }
-        return null;
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/TwoKeyHashMap.java b/luni/src/main/java/org/apache/harmony/luni/util/TwoKeyHashMap.java
index 086d561..35e6c62 100644
--- a/luni/src/main/java/org/apache/harmony/luni/util/TwoKeyHashMap.java
+++ b/luni/src/main/java/org/apache/harmony/luni/util/TwoKeyHashMap.java
@@ -548,7 +548,6 @@
         private EntryIteratorImpl itr;
 
         ValueIteratorImpl() {
-            super();
             this.itr = new EntryIteratorImpl();
         }
 
diff --git a/luni/src/main/java/org/apache/harmony/luni/util/Util.java b/luni/src/main/java/org/apache/harmony/luni/util/Util.java
deleted file mode 100644
index dfc7c20..0000000
--- a/luni/src/main/java/org/apache/harmony/luni/util/Util.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.luni.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.UnsupportedEncodingException;
-
-public final class Util {
-    /**
-     * '%' and two following hex digit characters are converted to the
-     * equivalent byte value. All other characters are passed through
-     * unmodified. e.g. "ABC %24%25" -> "ABC $%"
-     *
-     * @param s
-     *            java.lang.String The encoded string.
-     * @return java.lang.String The decoded version.
-     */
-    public static String decode(String s, boolean convertPlus) {
-        return decode(s, convertPlus, null);
-    }
-
-    /**
-     * '%' and two following hex digit characters are converted to the
-     * equivalent byte value. All other characters are passed through
-     * unmodified. e.g. "ABC %24%25" -> "ABC $%"
-     *
-     * @param s
-     *            java.lang.String The encoded string.
-     * @param encoding
-     *            the specified encoding
-     * @return java.lang.String The decoded version.
-     */
-    public static String decode(String s, boolean convertPlus, String encoding) {
-        if (!convertPlus && s.indexOf('%') == -1)
-            return s;
-        StringBuilder result = new StringBuilder(s.length());
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        for (int i = 0; i < s.length();) {
-            char c = s.charAt(i);
-            if (convertPlus && c == '+')
-                result.append(' ');
-            else if (c == '%') {
-                out.reset();
-                do {
-                    if (i + 2 >= s.length()) {
-                        throw new IllegalArgumentException("Incomplete % sequence at: " + i);
-                    }
-                    int d1 = Character.digit(s.charAt(i + 1), 16);
-                    int d2 = Character.digit(s.charAt(i + 2), 16);
-                    if (d1 == -1 || d2 == -1) {
-                        throw new IllegalArgumentException("Invalid % sequence " +
-                                s.substring(i, i + 3) + " at " + i);
-                    }
-                    out.write((byte) ((d1 << 4) + d2));
-                    i += 3;
-                } while (i < s.length() && s.charAt(i) == '%');
-                if (encoding == null) {
-                    result.append(out.toString());
-                } else {
-                    try {
-                        result.append(out.toString(encoding));
-                    } catch (UnsupportedEncodingException e) {
-                        throw new IllegalArgumentException(e);
-                    }
-                }
-                continue;
-            } else
-                result.append(c);
-            i++;
-        }
-        return result.toString();
-    }
-
-    public static String toASCIILowerCase(String s) {
-        int len = s.length();
-        StringBuilder buffer = new StringBuilder(len);
-        for (int i = 0; i < len; i++) {
-            char c = s.charAt(i);
-            if ('A' <= c && c <= 'Z') {
-                buffer.append((char) (c + ('a' - 'A')));
-            } else {
-                buffer.append(c);
-            }
-        }
-        return buffer.toString();
-    }
-
-    public static String toASCIIUpperCase(String s) {
-        int len = s.length();
-        StringBuilder buffer = new StringBuilder(len);
-        for (int i = 0; i < len; i++) {
-            char c = s.charAt(i);
-            if ('a' <= c && c <= 'z') {
-                buffer.append((char) (c - ('a' - 'A')));
-            } else {
-                buffer.append(c);
-            }
-        }
-        return buffer.toString();
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/security/DefaultPolicyScanner.java b/luni/src/main/java/org/apache/harmony/security/DefaultPolicyScanner.java
index ddbac0a..f2cc0d2 100644
--- a/luni/src/main/java/org/apache/harmony/security/DefaultPolicyScanner.java
+++ b/luni/src/main/java/org/apache/harmony/security/DefaultPolicyScanner.java
@@ -125,9 +125,9 @@
                 break parsing;
 
             case StreamTokenizer.TT_WORD:
-                if (Util.equalsIgnoreCase("keystore", st.sval)) {
+                if (st.sval.equalsIgnoreCase("keystore")) {
                     keystoreEntries.add(readKeystoreEntry(st));
-                } else if (Util.equalsIgnoreCase("grant", st.sval)) {
+                } else if (st.sval.equalsIgnoreCase("grant")) {
                     grantEntries.add(readGrantEntry(st));
                 } else {
                     handleUnexpectedToken(st, "Expected entries are \"grant\" or \"keystore\"");
@@ -206,19 +206,19 @@
             switch (st.nextToken()) {
 
             case StreamTokenizer.TT_WORD:
-                if (Util.equalsIgnoreCase("signedby", st.sval)) {
+                if (st.sval.equalsIgnoreCase("signedby")) {
                     if (st.nextToken() == '"') {
                         ge.signers = st.sval;
                     } else {
                         handleUnexpectedToken(st, "Expected syntax is signedby \"name1,...,nameN\"");
                     }
-                } else if (Util.equalsIgnoreCase("codebase", st.sval)) {
+                } else if (st.sval.equalsIgnoreCase("codebase")) {
                     if (st.nextToken() == '"') {
                         ge.codebase = st.sval;
                     } else {
                         handleUnexpectedToken(st, "Expected syntax is codebase \"url\"");
                     }
-                } else if (Util.equalsIgnoreCase("principal", st.sval)) {
+                } else if (st.sval.equalsIgnoreCase("principal")) {
                     ge.addPrincipal(readPrincipalEntry(st));
                 } else {
                     handleUnexpectedToken(st);
@@ -306,7 +306,7 @@
             switch (st.nextToken()) {
 
             case StreamTokenizer.TT_WORD:
-                if (Util.equalsIgnoreCase("permission", st.sval)) {
+                if (st.sval.equalsIgnoreCase("permission")) {
                     PermissionEntry pe = new PermissionEntry();
                     if (st.nextToken() == StreamTokenizer.TT_WORD) {
                         pe.klass = st.sval;
@@ -324,7 +324,7 @@
                             }
                         }
                         if (st.ttype == StreamTokenizer.TT_WORD
-                                && Util.equalsIgnoreCase("signedby", st.sval)) {
+                                && st.sval.equalsIgnoreCase("signedby")) {
                             if (st.nextToken() == '"') {
                                 pe.signers = st.sval;
                             } else {
diff --git a/luni/src/main/java/org/apache/harmony/security/SystemScope.java b/luni/src/main/java/org/apache/harmony/security/SystemScope.java
index 842e4a6..89cf56b 100644
--- a/luni/src/main/java/org/apache/harmony/security/SystemScope.java
+++ b/luni/src/main/java/org/apache/harmony/security/SystemScope.java
@@ -50,7 +50,6 @@
      * @see java.security.IdentityScope#IdentityScope()
      */
     public SystemScope() {
-        super();
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/security/Util.java b/luni/src/main/java/org/apache/harmony/security/Util.java
deleted file mode 100644
index e6e764f..0000000
--- a/luni/src/main/java/org/apache/harmony/security/Util.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.security;
-
-public class Util {
-
-    public static String toUpperCase(String s) {
-        return org.apache.harmony.luni.util.Util.toASCIIUpperCase(s);
-    }
-
-    public static boolean equalsIgnoreCase(String s1, String s2) {
-        s1 = org.apache.harmony.luni.util.Util.toASCIIUpperCase(s1);
-        s2 = org.apache.harmony.luni.util.Util.toASCIIUpperCase(s2);
-        return s1.equals(s2);
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Any.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Any.java
index 59f8779..d55f2bd 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Any.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Any.java
@@ -30,10 +30,9 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
+public final class ASN1Any extends ASN1Type {
 
-public class ASN1Any extends ASN1Type {
-
-    // default implementation
+    /** default implementation */
     private static final ASN1Any ASN1= new ASN1Any();
 
     /**
@@ -60,12 +59,6 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     /**
      * Tests provided identifier.
      *
@@ -77,7 +70,6 @@
     }
 
     public Object decode(BerInputStream in) throws IOException {
-
         // only read content, doesn't check it
         in.readContent();
 
@@ -91,8 +83,7 @@
      * Extracts array of bytes that represents full encoding from BER input
      * stream.
      *
-     * @param in -
-     *            BER input stream
+     * @param in BER input stream
      * @return array of bytes
      */
     public Object getDecodedObject(BerInputStream in) throws IOException {
@@ -102,12 +93,6 @@
         return bytesEncoded;
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeASN(BerOutputStream out) {
         out.encodeANY();
     }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1BitString.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1BitString.java
index 7b5336c..a1ac7b6 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1BitString.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1BitString.java
@@ -23,13 +23,13 @@
 package org.apache.harmony.security.asn1;
 
 import java.io.IOException;
+import libcore.util.EmptyArray;
 
 /**
  * This class represents ASN.1 Bitstring type.
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public class ASN1BitString extends ASN1StringType {
 
     // default implementation
@@ -60,14 +60,7 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
-    public Object decode(BerInputStream in) throws IOException {
-
+    @Override public Object decode(BerInputStream in) throws IOException {
         in.readBitString();
 
         if (in.isVerify) {
@@ -82,31 +75,21 @@
      * @param in - BER input stream
      * @return BitString object
      */
-    public Object getDecodedObject(BerInputStream in) throws IOException {
+    @Override public Object getDecodedObject(BerInputStream in) throws IOException {
         byte[] bytes = new byte[in.length - 1];
         System.arraycopy(in.buffer, in.contentOffset + 1, bytes, 0,
                 in.length - 1);
         return new BitString(bytes, in.buffer[in.contentOffset]);
     }
 
-    //
-    // Encode
-    //
-
-    public void encodeContent(BerOutputStream out) {
+    @Override public void encodeContent(BerOutputStream out) {
         out.encodeBitString();
     }
 
-    public void setEncodingContent(BerOutputStream out) {
+    @Override public void setEncodingContent(BerOutputStream out) {
         out.length = ((BitString) out.content).bytes.length + 1;
     }
 
-    //
-    //
-    // Named Bit List
-    //
-    //
-
     /**
      * Default implementation for ASN.1 Named Bitstring type
      *
@@ -114,37 +97,20 @@
      * that is mapped to array of boolean.
      */
     public static class ASN1NamedBitList extends ASN1BitString {
-
-        private static final byte[] SET_MASK = { (byte) 128, 64, 32, 16, 8, 4,
-                2, 1 };
-
-        private static final BitString emptyString = new BitString(
-                new byte[] {}, 0);
-
+        private static final byte[] SET_MASK = { (byte) 128, 64, 32, 16, 8, 4, 2, 1};
+        private static final BitString emptyString = new BitString(EmptyArray.BYTE, 0);
         private static final int INDEFINITE_SIZE = -1;
 
         private final int minBits;
-
         private final int maxBits;
 
-        public ASN1NamedBitList() {
-            this.minBits = INDEFINITE_SIZE;
-            this.maxBits = INDEFINITE_SIZE;
-        }
-
         public ASN1NamedBitList(int minBits) {
             this.minBits = minBits;
             this.maxBits = INDEFINITE_SIZE;
         }
 
-        public ASN1NamedBitList(int minBits, int maxBits) {
-            this.minBits = minBits;
-            this.maxBits = maxBits;
-        }
-
-        public Object getDecodedObject(BerInputStream in) throws IOException {
-
-            boolean[] value = null;
+        @Override public Object getDecodedObject(BerInputStream in) throws IOException {
+            boolean[] value;
 
             int unusedBits = in.buffer[in.contentOffset];
             int bitsNumber = (in.length - 1) * 8 - unusedBits;
@@ -175,7 +141,6 @@
             int j = 0;
             byte octet = in.buffer[in.contentOffset + i];
             for (int size = in.length - 1; i < size; i++) {
-
                 for (int k = 0; k < 8; k++, j++) {
                     value[j] = (SET_MASK[k] & octet) != 0;
                 }
@@ -191,8 +156,7 @@
             return value;
         }
 
-        public void setEncodingContent(BerOutputStream out) {
-
+        @Override public void setEncodingContent(BerOutputStream out) {
             boolean[] toEncode = (boolean[]) out.content;
 
             int index = toEncode.length - 1;
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Boolean.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Boolean.java
index 49cc35b..99d2a64 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Boolean.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Boolean.java
@@ -30,10 +30,9 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
+public final class ASN1Boolean extends ASN1Primitive {
 
-public class ASN1Boolean extends ASN1Primitive {
-
-    // default implementation
+    /** default implementation */
     private static final ASN1Boolean ASN1 = new ASN1Boolean();
 
     /**
@@ -60,12 +59,6 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readBoolean();
 
@@ -81,19 +74,13 @@
      * @param in - BER input stream
      * @return java.lang.Boolean object
      */
-    public Object getDecodedObject(BerInputStream in) throws IOException {
+    @Override public Object getDecodedObject(BerInputStream in) throws IOException {
         if (in.buffer[in.contentOffset] == 0) {
             return Boolean.FALSE;
         }
         return Boolean.TRUE;
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeContent(BerOutputStream out) {
         out.encodeBoolean();
     }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Choice.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Choice.java
index ae719a5..90ea48b 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Choice.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Choice.java
@@ -207,14 +207,14 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public abstract class ASN1Choice extends ASN1Type {
-
     public final ASN1Type[] type;
 
-    // identifiers table: [2][number of distinct identifiers]
-    // identifiers[0]: stores identifiers (includes nested choices)
-    // identifiers[1]: stores identifiers' indexes in array of types
+    /**
+     * identifiers table: [2][number of distinct identifiers]
+     * identifiers[0]: stores identifiers (includes nested choices)
+     * identifiers[1]: stores identifiers' indexes in array of types
+     */
     private final int[][] identifiers;
 
     /**
@@ -233,9 +233,8 @@
         }
 
         // create map of all identifiers
-        TreeMap map = new TreeMap();
+        TreeMap<BigInteger, BigInteger> map = new TreeMap<BigInteger, BigInteger>();
         for (int index = 0; index < type.length; index++) {
-
             ASN1Type t = type[index];
 
             if (t instanceof ASN1Any) {
@@ -266,31 +265,26 @@
         // fill identifiers array
         int size = map.size();
         identifiers = new int[2][size];
-        Iterator it = map.entrySet().iterator();
+        Iterator<Map.Entry<BigInteger, BigInteger>> it = map.entrySet().iterator();
 
         for (int i = 0; i < size; i++) {
-            Map.Entry entry = (Map.Entry) it.next();
-            BigInteger identifier = (BigInteger) entry.getKey();
+            Map.Entry<BigInteger, BigInteger> entry = it.next();
+            BigInteger identifier = entry.getKey();
 
             identifiers[0][i] = identifier.intValue();
-            identifiers[1][i] = ((BigInteger) entry.getValue()).intValue();
+            identifiers[1][i] = entry.getValue().intValue();
         }
 
         this.type = type;
     }
 
-    private void addIdentifier(TreeMap map, int identifier, int index){
+    private void addIdentifier(TreeMap<BigInteger, BigInteger> map, int identifier, int index){
         if (map.put(BigInteger.valueOf(identifier), BigInteger.valueOf(index)) != null) {
-            throw new IllegalArgumentException("ASN.1 choice type MUST have alternatives with distinct tags: " + getClass().getName()); // FIXME name
+            throw new IllegalArgumentException("ASN.1 choice type MUST have alternatives "
+                    + "with distinct tags: " + getClass().getName());
         }
     }
 
-    //
-    //
-    // DECODE
-    //
-    //
-
     /**
      * Tests whether one of choice alternatives has the same identifier or not.
      *
@@ -304,7 +298,6 @@
     }
 
     public Object decode(BerInputStream in) throws IOException {
-
         int index = Arrays.binarySearch(identifiers[0], in.tag);
         if (index < 0) {
             throw new ASN1Exception("Failed to decode ASN.1 choice type.  No alternatives were found for " + getClass().getName());// FIXME message
@@ -323,12 +316,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // ENCODE
-    //
-    //
-
     public void encodeASN(BerOutputStream out) {
         encodeContent(out);
     }
@@ -337,12 +324,6 @@
         out.encodeChoice(this);
     }
 
-    /**
-     * TODO Put method description here
-     *
-     * @param object - an object to be encoded
-     * @return
-     */
     public abstract int getIndex(Object object);
 
     public abstract Object getObjectToEncode(Object object);
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Constructured.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Constructed.java
similarity index 89%
rename from luni/src/main/java/org/apache/harmony/security/asn1/ASN1Constructured.java
rename to luni/src/main/java/org/apache/harmony/security/asn1/ASN1Constructed.java
index 2f17d49..add02b3 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Constructured.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Constructed.java
@@ -28,14 +28,13 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
+public abstract class ASN1Constructed extends ASN1Type {
 
-public abstract class ASN1Constructured extends ASN1Type {
-
-    public ASN1Constructured(int tagNumber) {
+    protected ASN1Constructed(int tagNumber) {
         super(CLASS_UNIVERSAL, tagNumber);
     }
 
-    public ASN1Constructured(int tagClass, int tagNumber) {
+    protected ASN1Constructed(int tagClass, int tagNumber) {
         super(tagClass, tagNumber);
     }
 
@@ -50,9 +49,6 @@
         return this.constrId == identifier;
     }
 
-    /**
-     *
-     */
     public void encodeASN(BerOutputStream out) {
         out.encodeTag(constrId);
         encodeContent(out);
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Enumerated.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Enumerated.java
index bc7b208..cccea94 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Enumerated.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Enumerated.java
@@ -23,6 +23,7 @@
 package org.apache.harmony.security.asn1;
 
 import java.io.IOException;
+import java.util.Arrays;
 
 
 /**
@@ -30,8 +31,7 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
-public class ASN1Enumerated extends ASN1Primitive {
+public final class ASN1Enumerated extends ASN1Primitive {
 
     // default implementation
     private static final ASN1Enumerated ASN1 = new ASN1Enumerated();
@@ -60,12 +60,6 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readEnumerated();
 
@@ -78,22 +72,12 @@
     /**
      * Extracts array of bytes from BER input stream.
      *
-     * @param in - BER input stream
      * @return array of bytes
      */
     public Object getDecodedObject(BerInputStream in) throws IOException {
-        byte[] bytesEncoded = new byte[in.length];
-        System.arraycopy(in.buffer, in.contentOffset, bytesEncoded, 0,
-                in.length);
-        return bytesEncoded;
+        return Arrays.copyOfRange(in.buffer, in.contentOffset, in.contentOffset + in.length);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeContent(BerOutputStream out) {
         out.encodeInteger();
     }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Exception.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Exception.java
index cfab29d..c17ee8e 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Exception.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Exception.java
@@ -27,25 +27,11 @@
 /**
  * Thrown by decoder/encoder stream to indicate violation of encoding rules.
  */
+public final class ASN1Exception extends IOException {
 
-public class ASN1Exception extends IOException {
-
-    /**
-     * @serial
-     */
+    /** @serial */
     private static final long serialVersionUID = -3561981263989123987L;
 
-    /**
-     * Constructs an ASN1Exception without a message.
-     */
-    public ASN1Exception(){
-    }
-
-    /**
-     * Constructs an ASN1Exception with a message.
-     *
-     * @param message - a string that describes encoding violation
-     */
     public ASN1Exception(String message){
         super(message);
     }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Explicit.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Explicit.java
index 15dcc97..45e2167 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Explicit.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Explicit.java
@@ -24,18 +24,14 @@
 
 import java.io.IOException;
 
-
 /**
  * This class represents explicitly tagged ASN.1 type.
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
+public final class ASN1Explicit extends ASN1Constructed {
 
-public final class ASN1Explicit extends ASN1Constructured {
-
-    /**
-     * Tagged type
-     */
+    /** Tagged type */
     public final ASN1Type type;
 
     /**
@@ -60,16 +56,9 @@
      */
     public ASN1Explicit(int tagClass, int tagNumber, ASN1Type type) {
         super(tagClass, tagNumber);
-
         this.type = type;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         if (constrId != in.tag) {
             throw new ASN1Exception("ASN.1 explicitly tagged type is expected at [" +
@@ -86,12 +75,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeContent(BerOutputStream out) {
         out.encodeExplicit(this);
     }
@@ -100,8 +83,7 @@
         out.getExplicitLength(this);
     }
 
-    public String toString() {
-        //FIXME fix performance
+    @Override public String toString() {
         return super.toString() + " for type " + type;
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
index 93629ad..e64ebe0 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1GeneralizedTime.java
@@ -32,8 +32,7 @@
  *
  * @see http://asn1.elibel.tm.fr/en/standards/index.htm
  */
-
-public class ASN1GeneralizedTime extends ASN1Time {
+public final class ASN1GeneralizedTime extends ASN1Time {
 
     // default implementation
     private static final ASN1GeneralizedTime ASN1 = new ASN1GeneralizedTime();
@@ -62,12 +61,6 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readGeneralizedTime();
 
@@ -77,12 +70,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeContent(BerOutputStream out) {
         out.encodeGeneralizedTime();
     }
@@ -93,10 +80,9 @@
     // four digit year, seconds always presented
     // and fractional-seconds elements without
     // trailing 0's (must be cut later from content)
-    private final static String GEN_PATTERN = "yyyyMMddHHmmss.SSS";
+    private static final String GEN_PATTERN = "yyyyMMddHHmmss.SSS";
 
     public void setEncodingContent(BerOutputStream out) {
-
         SimpleDateFormat sdf = new SimpleDateFormat(GEN_PATTERN);
         sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
         String temp = sdf.format(out.content);
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Implicit.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Implicit.java
index d910fd1..21c4ec6 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Implicit.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Implicit.java
@@ -30,24 +30,26 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-public class ASN1Implicit extends ASN1Type {
+public final class ASN1Implicit extends ASN1Type {
 
-    // primitive type of tagging
+    /** primitive type of tagging */
     private static final int TAGGING_PRIMITIVE = 0;
 
-    // constructed type of tagging
+    /** constructed type of tagging */
     private static final int TAGGING_CONSTRUCTED = 1;
 
-    // string type of tagging
+    /** string type of tagging */
     private static final int TAGGING_STRING = 2;
 
-    // tagged ASN.1 type
+    /** tagged ASN.1 type */
     private final ASN1Type type;
 
-    // type of tagging. There are three of them
-    // 1) primitive: only primitive identifier is valid
-    // 2) constructed: only constructed identifier is valid
-    // 3) string: both identifiers are valid
+    /**
+     * type of tagging. There are three of them
+     * 1) primitive: only primitive identifier is valid
+     * 2) constructed: only constructed identifier is valid
+     * 3) string: both identifiers are valid
+     */
     private final int taggingType;
 
     /**
@@ -59,19 +61,7 @@
      * @throws IllegalArgumentException - if tagNumber or type is invalid
      */
     public ASN1Implicit(int tagNumber, ASN1Type type) {
-        this(CLASS_CONTEXTSPECIFIC, tagNumber, type);
-    }
-
-    /**
-     * Constructs implicitly tagged ASN.1 type
-     *
-     * @param tagClass - ASN.1 tag class.
-     * @param tagNumber - ASN.1 tag number
-     * @param type - ASN.1 type to be tagged
-     * @throws IllegalArgumentException - if tagNumber, tagClass or type is invalid
-     */
-    public ASN1Implicit(int tagClass, int tagNumber, ASN1Type type) {
-        super(tagClass, tagNumber);
+        super(CLASS_CONTEXTSPECIFIC, tagNumber);
 
         if ((type instanceof ASN1Choice) || (type instanceof ASN1Any)) {
             // According to X.680:
@@ -98,15 +88,6 @@
         }
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
-    /**
-     * TODO
-     */
     public final boolean checkTag(int identifier) {
         switch (taggingType) {
         case TAGGING_PRIMITIVE:
@@ -118,9 +99,6 @@
         }
     }
 
-    /**
-     * TODO
-     */
     public Object decode(BerInputStream in) throws IOException {
         if (!checkTag(in.tag)) {
             // FIXME need look for tagging type
@@ -129,7 +107,7 @@
                     "but got " + Integer.toHexString(in.tag));
         }
 
-        // substitute indentifier for further decoding
+        // substitute identifier for further decoding
         if (id == in.tag) {
             in.tag = type.id;
         } else {
@@ -143,12 +121,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeASN(BerOutputStream out) {
         //FIXME need another way for specifying identifier to be encoded
         if (taggingType == TAGGING_CONSTRUCTED) {
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Integer.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Integer.java
index 9230bbd..6f33d09 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Integer.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Integer.java
@@ -25,16 +25,14 @@
 import java.io.IOException;
 import java.math.BigInteger;
 
-
 /**
  * This class represents ASN.1 Integer type.
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
+public final class ASN1Integer extends ASN1Primitive {
 
-public class ASN1Integer extends ASN1Primitive {
-
-    // default implementation
+    /** default implementation */
     private static final ASN1Integer ASN1 = new ASN1Integer();
 
     /**
@@ -61,12 +59,6 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readInteger();
 
@@ -79,7 +71,6 @@
     /**
      * Extracts array of bytes from BER input stream.
      *
-     * @param in - BER input stream
      * @return array of bytes
      */
     public Object getDecodedObject(BerInputStream in) throws IOException {
@@ -89,12 +80,6 @@
         return bytesEncoded;
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeContent(BerOutputStream out) {
         out.encodeInteger();
     }
@@ -103,7 +88,6 @@
         out.length = ((byte[]) out.content).length;
     }
 
-// BEGIN android-changed
     /**
      * Converts decoded ASN.1 Integer to int value.
      * If the object represents an integer value
@@ -113,7 +97,7 @@
      * @return decoded int value.
      */
     public static int toIntValue(Object decoded) {
-        return new BigInteger((byte[]) decoded).intValue();//FIXME optimize
+        return new BigInteger((byte[]) decoded).intValue();
     }
 
     /**
@@ -123,9 +107,8 @@
      * @return decoded BigInteger value.
      */
     public static BigInteger toBigIntegerValue(Object decoded) {
-        return new BigInteger((byte[]) decoded);//FIXME optimize
+        return new BigInteger((byte[]) decoded);
     }
-// END android-changed
 
     /**
      * Converts primitive int value to a form most suitable for encoding.
@@ -134,7 +117,6 @@
      * @return object suitable for encoding
      */
     public static Object fromIntValue(int value) {
-        //FIXME optimize
         return BigInteger.valueOf(value).toByteArray();
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1OctetString.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1OctetString.java
index 5d113a4..7b344f7 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1OctetString.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1OctetString.java
@@ -23,6 +23,7 @@
 package org.apache.harmony.security.asn1;
 
 import java.io.IOException;
+import java.util.Arrays;
 
 
 /**
@@ -30,10 +31,9 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public class ASN1OctetString extends ASN1StringType {
 
-    // default implementation
+    /** default implementation */
     private static final ASN1OctetString ASN1 = new ASN1OctetString();
 
     /**
@@ -53,20 +53,12 @@
      *
      * The default implementation works with encoding
      * that is represented as byte array.
-     *
-     * @return ASN.1 octet string type default implementation
      */
     public static ASN1OctetString getInstance() {
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
-    public Object decode(BerInputStream in) throws IOException {
+    @Override public Object decode(BerInputStream in) throws IOException {
         in.readOctetString();
 
         if (in.isVerify) {
@@ -78,27 +70,17 @@
     /**
      * Extracts array of bytes from BER input stream.
      *
-     * @param in - BER input stream
      * @return array of bytes
      */
-    public Object getDecodedObject(BerInputStream in) throws IOException {
-        byte[] bytesEncoded = new byte[in.length];
-        System.arraycopy(in.buffer, in.contentOffset, bytesEncoded, 0,
-                in.length);
-        return bytesEncoded;
+    @Override public Object getDecodedObject(BerInputStream in) throws IOException {
+        return Arrays.copyOfRange(in.buffer, in.contentOffset, in.contentOffset + in.length);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
-    public void encodeContent(BerOutputStream out) {
+    @Override public void encodeContent(BerOutputStream out) {
         out.encodeOctetString();
     }
 
-    public void setEncodingContent(BerOutputStream out) {
+    @Override public void setEncodingContent(BerOutputStream out) {
         out.length = ((byte[]) out.content).length;
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Oid.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Oid.java
index b286284..b926b82 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Oid.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Oid.java
@@ -30,10 +30,9 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public class ASN1Oid extends ASN1Primitive {
 
-    // default implementation
+    /** default implementation */
     private static final ASN1Oid ASN1 = new ASN1Oid();
 
     /**
@@ -60,12 +59,6 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readOID();
 
@@ -78,10 +71,9 @@
     /**
      * Extracts array of integers from BER input stream.
      *
-     * @param in - BER input stream
      * @return array of integers
      */
-    public Object getDecodedObject(BerInputStream in) throws IOException {
+    @Override public Object getDecodedObject(BerInputStream in) throws IOException {
         // Allocate and decode
         int oidElement = in.oidElement;
         int[] oid = new int[oidElement];
@@ -106,12 +98,6 @@
         return oid;
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeContent(BerOutputStream out) {
         out.encodeOID();
     }
@@ -144,23 +130,13 @@
         out.length = length;
     }
 
-    //
-    //
-    // OID encoder/decoder for mapping to string
-    //
-    //
-
-    private final static ASN1Oid STRING_OID = new ASN1Oid() {
-
-        public Object getDecodedObject(BerInputStream in) throws IOException {
-
+    private static final ASN1Oid STRING_OID = new ASN1Oid() {
+        @Override public Object getDecodedObject(BerInputStream in) throws IOException {
             StringBuilder buf = new StringBuilder();
 
-            int element;
-
             //Special handling for the first packed OID element
             int octet = in.buffer[in.contentOffset];
-            element = octet & 0x7F;
+            int element = octet & 0x7F;
 
             int index = 0;
             while ((octet & 0x80) != 0) {
@@ -199,11 +175,9 @@
             return buf.toString();
         }
 
-        public void setEncodingContent(BerOutputStream out) {
-
+        @Override public void setEncodingContent(BerOutputStream out) {
             //FIXME this is a stub for a while
             out.content = ObjectIdentifier.toIntArray((String) out.content);
-
             super.setEncodingContent(out);
         }
     };
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1OpenType.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1OpenType.java
deleted file mode 100644
index 44c68b2..0000000
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1OpenType.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Stepan M. Mishura
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.asn1;
-
-import java.io.IOException;
-import org.apache.harmony.security.x501.AttributeType;
-
-
-
-/**
- * Represents ASN.1 open type that is defined by Oid
- *
- * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
- */
-
-public class ASN1OpenType extends ASN1Any {
-
-    private final Id key;
-
-    private final InformationObjectSet pool;
-
-    public ASN1OpenType(Id key, InformationObjectSet pool) {
-        this.key = key;
-        this.pool = pool;
-    }
-
-    public Object decode(BerInputStream in) throws IOException {
-
-        int[] oid = (int[]) in.get(key);
-        if (oid == null) {
-            throw new RuntimeException("");//FIXME message & type
-        }
-
-        AttributeType attr = (AttributeType) pool.get(oid);
-        if (attr == null || (!attr.type.checkTag(in.tag))) {
-            in.content = (byte[]) super.getDecodedObject(in);
-        } else {
-            in.content = attr.type.decode(in);
-        }
-        return in.content;
-    }
-
-    public Object getDecodedObject(BerInputStream in) throws IOException {
-        return in.content;
-    }
-
-    public static class Id extends ASN1Oid {
-
-        public Object decode(BerInputStream in) throws IOException {
-            Object oid = super.decode(in);
-
-            if (oid == null) {
-                in.put(this, super.getDecodedObject(in));
-            } else {
-                in.put(this, oid);
-            }
-            return oid;
-        }
-
-        public Object getDecodedObject(BerInputStream in) throws IOException {
-            return in.get(this);
-        }
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Primitive.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Primitive.java
index 1dc17ec..dd25379 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Primitive.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Primitive.java
@@ -28,7 +28,6 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public abstract class ASN1Primitive extends ASN1Type {
 
     public ASN1Primitive(int tagNumber) {
@@ -38,18 +37,14 @@
     /**
      * Tests provided identifier.
      *
-     * @param identifier -
-     *            identifier to be verified
-     * @return - true if identifier correspond to primitive identifier of this
-     *         ASN.1 type, otherwise false
+     * @param identifier identifier to be verified
+     * @return true if identifier correspond to primitive identifier of this
+     *     ASN.1 type, otherwise false
      */
     public final boolean checkTag(int identifier) {
         return this.id == identifier;
     }
 
-    /**
-     * TODO
-     */
     public void encodeASN(BerOutputStream out) {
         out.encodeTag(id);
         encodeContent(out);
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Sequence.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Sequence.java
index bfaf517..129cb57 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Sequence.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Sequence.java
@@ -30,21 +30,12 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public class ASN1Sequence extends ASN1TypeCollection {
 
     public ASN1Sequence(ASN1Type[] type) {
         super(TAG_SEQUENCE, type);
-
-        //FIXME optional components must be checked for distinct identifiers
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readSequence(this);
 
@@ -54,11 +45,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
     public final void encodeContent(BerOutputStream out) {
         out.encodeSequence(this);
     }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SequenceOf.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SequenceOf.java
index 94b320e..a549eb5 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SequenceOf.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SequenceOf.java
@@ -23,9 +23,6 @@
 package org.apache.harmony.security.asn1;
 
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
 
 
 /**
@@ -33,19 +30,12 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public class ASN1SequenceOf extends ASN1ValueCollection {
 
     public ASN1SequenceOf(ASN1Type type) {
         super(TAG_SEQUENCE, type);
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readSequenceOf(this);
 
@@ -55,12 +45,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public final void encodeContent(BerOutputStream out) {
         out.encodeSequenceOf(this);
     }
@@ -68,27 +52,5 @@
     public final void setEncodingContent(BerOutputStream out) {
         out.getSequenceOfLength(this);
     }
-
-    /**
-     * Creates array wrapper of provided ASN1 type
-     *
-     * @param type - ASN1 type to be wrapped
-     * @return - a wrapper for ASN1 set of type.
-     * @throws IOException
-     * @see org.apache.harmony.security.asn1.ASN1ValueCollection
-     */
-    public static ASN1SequenceOf asArrayOf(ASN1Type type) {
-
-        return new ASN1SequenceOf(type) {
-            public Object getDecodedObject(BerInputStream in)
-                    throws IOException {
-                return ((List) in.content).toArray();
-            }
-
-            public Collection getValues(Object object) {
-                return Arrays.asList((Object[]) object);
-            }
-        };
-    }
 }
 
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Set.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Set.java
index cdf9d64..fff0c64 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Set.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Set.java
@@ -30,24 +30,12 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
-public class ASN1Set extends ASN1TypeCollection {
+public final class ASN1Set extends ASN1TypeCollection {
 
     public ASN1Set(ASN1Type[] type) {
         super(TAG_SET, type);
-
-        //FIXME implement check for distinct tags
-        //if (!hasDistinctTags(type)) {
-        //    throw new RuntimeException("ASN1 set type: " + getClass().getName()
-        //            + " MUST have alternatives with distinct tags");
-        //}
     }
 
-    //
-    //
-    // Decode
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readSet(this);
 
@@ -57,11 +45,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
     public final void encodeContent(BerOutputStream out) {
         out.encodeSet(this);
     }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SetOf.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SetOf.java
index 3358105..8af221a 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SetOf.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1SetOf.java
@@ -23,9 +23,6 @@
 package org.apache.harmony.security.asn1;
 
 import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
 
 
 /**
@@ -33,18 +30,12 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public class ASN1SetOf extends ASN1ValueCollection {
 
     public ASN1SetOf(ASN1Type type) {
         super(TAG_SETOF, type);
     }
 
-    //
-    //
-    // Decode
-    //
-
     public Object decode(BerInputStream in) throws IOException {
         in.readSetOf(this);
 
@@ -54,11 +45,6 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
     public final void encodeContent(BerOutputStream out) {
         out.encodeSetOf(this);
     }
@@ -66,27 +52,5 @@
     public final void setEncodingContent(BerOutputStream out) {
         out.getSetOfLength(this);
     }
-
-    /**
-     * Creates array wrapper of provided ASN1 type
-     *
-     * @param type - ASN1 type to be wrapped
-     * @return - a wrapper for ASN1 set of type.
-     * @throws IOException
-     * @see org.apache.harmony.security.asn1.ASN1ValueCollection
-     */
-    public static ASN1SetOf asArrayOf(ASN1Type type) throws IOException {
-
-        return new ASN1SetOf(type) {
-            public Object getDecodedObject(BerInputStream in)
-                    throws IOException {
-                return ((List) in.content).toArray();
-            }
-
-            public Collection getValues(Object object) {
-                return Arrays.asList((Object[]) object);
-            }
-        };
-    }
 }
 
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1StringType.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1StringType.java
index 689b036..71f5b0e 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1StringType.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1StringType.java
@@ -30,7 +30,6 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public abstract class ASN1StringType extends ASN1Type {
 
     // TODO: what about defining them as separate classes?
@@ -59,14 +58,12 @@
             TAG_UNIVERSALSTRING) {
     };
 
-    public static final ASN1StringType UTF8STRING = new ASN1StringType(
-            TAG_UTF8STRING) {
-
-        public Object getDecodedObject(BerInputStream in) throws IOException {
+    public static final ASN1StringType UTF8STRING = new ASN1StringType(TAG_UTF8STRING) {
+        @Override public Object getDecodedObject(BerInputStream in) throws IOException {
             return new String(in.buffer, in.contentOffset, in.length, Charsets.UTF_8);
         }
 
-        public void setEncodingContent(BerOutputStream out) {
+        @Override public void setEncodingContent(BerOutputStream out) {
             byte[] bytes = ((String) out.content).getBytes(Charsets.UTF_8);
             out.content = bytes;
             out.length = bytes.length;
@@ -77,26 +74,18 @@
         super(tagNumber);
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     /**
      * Tests provided identifier.
      *
-     * @param identifier -
-     *            identifier to be verified
-     * @return - true if identifier correspond to primitive or constructed
-     *         identifier of this ASN.1 string type, otherwise false
+     * @param identifier identifier to be verified
+     * @return true if identifier correspond to primitive or constructed
+     *     identifier of this ASN.1 string type, otherwise false
      */
     public final boolean checkTag(int identifier) {
         return this.id == identifier || this.constrId == identifier;
     }
 
     public Object decode(BerInputStream in) throws IOException {
-
         in.readString(this);
 
         if (in.isVerify) {
@@ -107,9 +96,6 @@
 
     /**
      * Extracts String object from BER input stream.
-     *
-     * @param in - BER input stream
-     * @return java.land.String object
      */
     public Object getDecodedObject(BerInputStream in) throws IOException {
         /* To ensure we get the correct encoding on non-ASCII platforms, specify
@@ -117,12 +103,6 @@
         return new String(in.buffer, in.contentOffset, in.length, Charsets.ISO_8859_1);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     public void encodeASN(BerOutputStream out) {
         out.encodeTag(id);
         encodeContent(out);
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Time.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Time.java
index bed5088..730cac7 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Time.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Time.java
@@ -36,21 +36,12 @@
 
 public abstract class ASN1Time extends ASN1StringType {
 
-    /**
-     * TODO Put ctor description here
-     *
-     * @param tagNumber
-     */
     public ASN1Time(int tagNumber) {
         super(tagNumber);
     }
 
-    public Object getDecodedObject(BerInputStream in) throws IOException {
-
-        // TODO optimize me:
-        // It makes sense use calendar instance instead of times array
+    @Override public Object getDecodedObject(BerInputStream in) throws IOException {
         GregorianCalendar c = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
-
         c.set(Calendar.YEAR, in.times[0]);
         c.set(Calendar.MONTH, in.times[1]-1);
         c.set(Calendar.DAY_OF_MONTH, in.times[2]);
@@ -58,7 +49,6 @@
         c.set(Calendar.MINUTE, in.times[4]);
         c.set(Calendar.SECOND, in.times[5]);
         c.set(Calendar.MILLISECOND, in.times[6]);
-
         return c.getTime();
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Type.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Type.java
index 729ef3a..bc50f5d 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Type.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1Type.java
@@ -31,17 +31,12 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public abstract class ASN1Type implements ASN1Constants {
 
-    /**
-     * Integer representation of primitive identifier.
-     */
+    /** Integer representation of primitive identifier. */
     public final int id;
 
-    /**
-     * Integer representation of constructed identifier.
-     */
+    /** Integer representation of constructed identifier. */
     public final int constrId;
 
     /**
@@ -59,7 +54,6 @@
      *
      * @param tagClass - tag class. MUST be
      *     CLASS_UNIVERSAL, CLASS_APPLICATION, CLASS_CONTEXTSPECIFIC, CLASS_PRIVATE
-     * @param isConstructed - is ASN.1 type is a constructed type.
      * @param tagNumber - ASN.1 tag number.
      * @throws IllegalArgumentException - if tagClass or tagNumber is invalid
      */
@@ -84,12 +78,6 @@
         this.constrId = this.id + PC_CONSTRUCTED;
     }
 
-    //
-    //
-    // Stubs for DER
-    //
-    //
-
     public final Object decode(byte[] encoded) throws IOException {
         return decode(new DerInputStream(encoded));
     }
@@ -116,34 +104,22 @@
     }
 
     public final byte[] encode(Object object) {
-
         DerOutputStream out = new DerOutputStream(this, object);
         return out.encoded;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
     /**
      * Decodes ASN.1 type.
      *
-     * @param in -
-     *            BER input stream
-     * @throws IOException -
-     *             if an I/O error occurs or the end of the stream is reached
+     * @throws IOException if an I/O error occurs or the end of the stream is reached
      */
     public abstract Object decode(BerInputStream in) throws IOException;
 
     /**
      * Tests provided identifier.
      *
-     * @param identifier -
-     *            identifier to be verified
-     * @return - true if identifier is associated with this ASN.1 type,
-     *         otherwise false
+     * @param identifier identifier to be verified
+     * @return true if identifier is associated with this ASN.1 type
      */
     public abstract boolean checkTag(int identifier);
 
@@ -154,26 +130,13 @@
      * selected class of objects during decoding.
      *
      * The default implementation returns an object created by decoding stream.
-     *
-     * @param -
-     *            input stream
-     * @return - created object
      */
-    //FIXME make me public
     protected Object getDecodedObject(BerInputStream in) throws IOException {
         return in.content;
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-
     /**
      * Encodes ASN.1 type.
-     *
-     * @param out - BER output stream
      */
     public abstract void encodeASN(BerOutputStream out);
 
@@ -182,7 +145,6 @@
     public abstract void setEncodingContent(BerOutputStream out);
 
     public int getEncodedLength(BerOutputStream out) { //FIXME name
-
         //tag length
         int len = 1; //FIXME tag length = 1. what about long form?
         //for (; tag > 0; tag = tag >> 8, len++);
@@ -201,10 +163,8 @@
         return len;
     }
 
-    public String toString() {
+    @Override public String toString() {
         // TODO decide whether this method is necessary
-        //FIXME fix performance
-        return this.getClass().getName() + "(tag: 0x"
-                + Integer.toHexString(0xff & this.id) + ")";
+        return getClass().getName() + "(tag: 0x" + Integer.toHexString(0xff & this.id) + ")";
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1TypeCollection.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1TypeCollection.java
index d441a0e..2499fa2 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1TypeCollection.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1TypeCollection.java
@@ -28,31 +28,23 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
+public abstract class ASN1TypeCollection extends ASN1Constructed {
 
-public abstract class ASN1TypeCollection extends ASN1Constructured {
+    public final ASN1Type[] type;
 
-    public final ASN1Type[] type; //TODO comment me
+    public final boolean[] OPTIONAL;
 
-    public final boolean[] OPTIONAL; //TODO comment me
-
-    public final Object[] DEFAULT; //TODO comment me
+    public final Object[] DEFAULT;
 
     /**
      * Constructs ASN.1 collection type.
      *
-     * @param tagNumber - ASN.1 tag number
-     * @param type - a collection of one or more ASN.1 types.
-     * @throws IllegalArgumentException - if tagNumber is invalid
+     * @param tagNumber ASN.1 tag number
+     * @param type a collection of one or more ASN.1 types.
+     * @throws IllegalArgumentException if tagNumber is invalid
      */
-    public ASN1TypeCollection(int tagNumber, ASN1Type[] type) {
+    protected ASN1TypeCollection(int tagNumber, ASN1Type[] type) {
         super(tagNumber);
-        // FIXME what about empty sequence?
-        //        if (type.length == 0) {
-        //            throw new ASN1Exception("ASN1 collection type: "
-        //                    + getClass().getName()
-        //                    + " MUST have at least one component");
-        //        }
-
         this.type = type;
         this.OPTIONAL = new boolean[type.length];
         this.DEFAULT = new Object[type.length];
@@ -61,7 +53,7 @@
     /**
      * Sets a collection component as optional
      *
-     * @param index - an index of a component
+     * @param index an index of a component
      */
     protected final void setOptional(int index) {
         OPTIONAL[index] = true;
@@ -71,8 +63,8 @@
      * Sets a default value for a collection component.
      * The component also became an optional component.
      *
-     * @param object - a component's default value
-     * @param index - an index of a component
+     * @param object a component's default value
+     * @param index an index of a component
      */
     protected final void setDefault(Object object, int index) {
         OPTIONAL[index] = true;
@@ -87,8 +79,8 @@
      *
      * The default implementation throws RuntimeException.
      *
-     * @param object - an object to be encoded
-     * @param values - an array to store an object's values to be encoded
+     * @param object an object to be encoded
+     * @param values an array to store an object's values to be encoded
      */
     protected void getValues(Object object, Object[] values) {
         throw new RuntimeException("ASN.1 type is not designed to be encoded: " + getClass().getName());
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1UTCTime.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1UTCTime.java
index e4c7686..2bc8f4b 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1UTCTime.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1UTCTime.java
@@ -32,29 +32,21 @@
  *
  * @see http://asn1.elibel.tm.fr/en/standards/index.htm
  */
-public class ASN1UTCTime extends ASN1Time {
+public final class ASN1UTCTime extends ASN1Time {
 
-    /**
-     * Length for the pattern: YYMMDDhhmm'Z'
-     */
+    /** Length for the pattern: YYMMDDhhmm'Z' */
     public static final int UTC_HM = 11;
 
-    /**
-     * Length for the pattern: YYMMDDhhmmss'Z'
-     */
+    /** Length for the pattern: YYMMDDhhmmss'Z' */
     public static final int UTC_HMS = 13;
 
-    /**
-     * Length for the pattern: YYMMDDhhmm('+'/'-')hhmm
-     */
+    /** Length for the pattern: YYMMDDhhmm('+'/'-')hhmm */
     public static final int UTC_LOCAL_HM = 15;
 
-    /**
-     * Length for the pattern: YYMMDDhhmmss('+'/'-')hhmm
-     */
+    /** Length for the pattern: YYMMDDhhmmss('+'/'-')hhmm */
     public static final int UTC_LOCAL_HMS = 17;
 
-    // default implementation
+    /** default implementation */
     private static final ASN1UTCTime ASN1 = new ASN1UTCTime();
 
     /**
@@ -81,13 +73,7 @@
         return ASN1;
     }
 
-    //
-    //
-    // Decode
-    //
-    //
-
-    public Object decode(BerInputStream in) throws IOException {
+    @Override public Object decode(BerInputStream in) throws IOException {
         in.readUTCTime();
 
         if (in.isVerify) {
@@ -96,12 +82,7 @@
         return getDecodedObject(in);
     }
 
-    //
-    //
-    // Encode
-    //
-    //
-    public void encodeContent(BerOutputStream out) {
+    @Override public void encodeContent(BerOutputStream out) {
         out.encodeUTCTime();
     }
 
@@ -110,9 +91,9 @@
     // According to X.680 coordinated universal time format:
     // two digit year, seconds always presented,
     // no fractional-seconds elements, 'Z' at the end
-    private final static String UTC_PATTERN = "yyMMddHHmmss'Z'";
+    private static final String UTC_PATTERN = "yyMMddHHmmss'Z'";
 
-    public void setEncodingContent(BerOutputStream out) {
+    @Override public void setEncodingContent(BerOutputStream out) {
         SimpleDateFormat sdf = new SimpleDateFormat(UTC_PATTERN);
         sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
         out.content = sdf.format(out.content).getBytes(Charsets.UTF_8);
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1ValueCollection.java b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1ValueCollection.java
index 43c36c7..751888c 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ASN1ValueCollection.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ASN1ValueCollection.java
@@ -33,23 +33,16 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
+public abstract class ASN1ValueCollection extends ASN1Constructed {
 
-public abstract class ASN1ValueCollection extends ASN1Constructured {
-
-    /**
-     * A value collection of this ASN.1 type
-     */
+    /** A value collection of this ASN.1 type */
     public final ASN1Type type;
 
     /**
      * Constructs ASN1 collection type.
-     *
-     * @param tagNumber - ASN.1 tag number
-     * @param type - ASN.1 type
      */
     public ASN1ValueCollection(int tagNumber, ASN1Type type) {
         super(tagNumber);
-
         this.type = type;
     }
 
@@ -62,7 +55,7 @@
      * @param - an object to be encoded
      * @return - a collection of object's values to be encoded
      */
-    public Collection getValues(Object object) {
-        return (Collection)object;
+    public Collection<?> getValues(Object object) {
+        return (Collection<?>) object;
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/BerInputStream.java b/luni/src/main/java/org/apache/harmony/security/asn1/BerInputStream.java
index 74aadb5..4c1fd37 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/BerInputStream.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/BerInputStream.java
@@ -35,38 +35,42 @@
 
 public class BerInputStream {
 
-    /**
-     * Associated <code>InputStream</code>
-     */
-    protected InputStream in;
-
-    /**
-     * Internal buffer for storing encoded array
-     */
+    private final InputStream in;
     protected byte[] buffer;
 
     /**
      * The position in the buffer.
-     *
      * Next read must place data into the buffer from this offset
      */
     protected int offset = 0;
 
-    // The buffer increment size.
-    // Must be reasonable big to reallocate memory not to often.
-    // Primary is used for decoding indefinite length encoding
+    /**
+     * The buffer increment size.
+     * Must be reasonable big to reallocate memory not to often.
+     * Primary is used for decoding indefinite length encoding
+     */
     private static final int BUF_INCREASE_SIZE = 1024 * 16;
 
-    /**
-     * Indicates indefinite length of the current type
-     */
+    /** Indicates indefinite length of the current type */
     protected static final int INDEFINIT_LENGTH = -1;
 
+    /** Current decoded tag */
+    public int tag;
+
+    /** Current decoded length */
+    protected int length;
+
+    /** Current decoded content */
+    public Object content;
+
+    /** Current decoded tag offset */
+    protected int tagOffset;
+
+    /** Current decoded content offset */
+    protected int contentOffset;
+
     /**
      * Creates stream for decoding.
-     *
-     * @param encoded - bytes array to be decoded
-     * @throws IOException - if an error occurs
      */
     public BerInputStream(byte[] encoded) throws IOException {
         this(encoded, 0, encoded.length);
@@ -75,19 +79,13 @@
     /**
      * Creates stream for decoding.
      *
-     * @param encoded -
-     *            bytes array to be decoded
-     * @param offset -
-     *            the encoding offset
-     * @param expectedLength -
-     *            expected length of full encoding, this includes identifier,
-     *            length an content octets
-     * @throws IOException -
-     *             if an error occurs
+     * @param encoded bytes array to be decoded
+     * @param offset the encoding offset
+     * @param expectedLength expected length of full encoding, this includes
+     *     identifier, length an content octets
      */
-    public BerInputStream(byte[] encoded, int offset, int expectedLength)
-            throws IOException {
-
+    public BerInputStream(byte[] encoded, int offset, int expectedLength) throws IOException {
+        this.in = null;
         this.buffer = encoded;
         this.offset = offset;
 
@@ -104,8 +102,6 @@
      * Creates stream for decoding.
      *
      * Allocates initial buffer of default size
-     *
-     * @param is associated <code>InputStream</code>
      */
     public BerInputStream(InputStream in) throws IOException {
         this(in, BUF_INCREASE_SIZE);
@@ -114,13 +110,9 @@
     /**
      * Creates stream for decoding.
      *
-     * Allocates initial buffer of <code>initialSize</code> size
-     *
      * @param initialSize the internal buffer initial size
-     * @param is associated <code>InputStream</code>
      */
     public BerInputStream(InputStream in, int initialSize) throws IOException {
-
         this.in = in;
         buffer = new byte[initialSize];
 
@@ -143,49 +135,22 @@
     /**
      * Resets this stream to initial state.
      *
-     * @param encoded - a new bytes array to be decoded
-     * @throws IOException - if an error occurs
+     * @param encoded a new bytes array to be decoded
+     * @throws IOException if an error occurs
      */
     public final void reset(byte[] encoded) throws IOException {
         buffer = encoded;
-
         next();
     }
 
     /**
-     * Current decoded tag
-     */
-    public int tag;
-
-    /**
-     * Current decoded length
-     */
-    protected int length;
-
-    /**
-     * Current decoded content
-     */
-    public Object content;
-
-    /**
-     * Current decoded tag offset
-     */
-    protected int tagOffset;
-
-    /**
-     * Current decoded content offset
-     */
-    protected int contentOffset;
-
-    /**
      * Decodes next encoded type.
      * Initializes tag, length, tagOffset and contentOffset variables
      *
      * @return next decoded tag
-     * @throws IOException - if error occured
+     * @throws IOException if error occured
      */
     public int next() throws IOException {
-
         tagOffset = offset;
 
         // read tag
@@ -242,11 +207,8 @@
 
     /**
      * Decodes ASN.1 bitstring type
-     *
-     * @throws IOException - if error occured
      */
     public void readBitString() throws IOException {
-
         if (tag == ASN1Constants.TAG_BITSTRING) {
 
             if (length == 0) {
@@ -257,11 +219,13 @@
 
             // content: check unused bits
             if (buffer[contentOffset] > 7) {
-                throw new ASN1Exception("ASN.1 Bitstring: wrong content at [" + contentOffset + "]. A number of unused bits MUST be in range 0 to 7");
+                throw new ASN1Exception("ASN.1 Bitstring: wrong content at [" + contentOffset
+                        + "]. A number of unused bits MUST be in range 0 to 7");
             }
 
             if (length == 1 && buffer[contentOffset] != 0) {
-                throw new ASN1Exception("ASN.1 Bitstring: wrong content at [" + contentOffset + "]. For empty string unused bits MUST be 0");
+                throw new ASN1Exception("ASN.1 Bitstring: wrong content at [" + contentOffset
+                        + "]. For empty string unused bits MUST be 0");
             }
 
         } else if (tag == ASN1Constants.TAG_C_BITSTRING) {
@@ -273,47 +237,38 @@
 
     /**
      * Decodes ASN.1 Enumerated type
-     *
-     * @throws IOException - if error occured
      */
     public void readEnumerated() throws IOException {
-
         if (tag != ASN1Constants.TAG_ENUM) {
             throw expected("enumerated");
         }
 
-        //
-        // all checks are the same as for ASN.1 integer type
-        //
-
         // check encoded length
         if (length == 0) {
-            throw new ASN1Exception("ASN.1 enumerated: wrong length for identifier at [" + tagOffset + "]");
+            throw new ASN1Exception("ASN.1 enumerated: wrong length for identifier at ["
+                    + tagOffset + "]");
         }
 
         readContent();
 
         // check encoded content
         if (length > 1) {
-
             int bits = buffer[contentOffset] & 0xFF;
             if (buffer[contentOffset + 1] < 0) {
                 bits += 0x100;
             }
 
             if (bits == 0 || bits == 0x1FF) {
-                throw new ASN1Exception("ASN.1 enumerated: wrong content at [" + contentOffset + "]. An integer MUST be encoded in minimum number of octets");
+                throw new ASN1Exception("ASN.1 enumerated: wrong content at [" + contentOffset
+                        + "]. An integer MUST be encoded in minimum number of octets");
             }
         }
     }
 
     /**
      * Decodes ASN.1 boolean type
-     *
-     * @throws IOException - if error occured
      */
     public void readBoolean() throws IOException {
-
         if (tag != ASN1Constants.TAG_BOOLEAN) {
             throw expected("boolean");
         }
@@ -326,25 +281,19 @@
         readContent();
     }
 
-    /**
-     * The last choice index
-     */
+    /** The last choice index */
     public int choiceIndex;
 
-    /**
-     * Keeps last decoded: year, month, day, hour, minute, second, millisecond
-     */
+    /** Keeps last decoded: year, month, day, hour, minute, second, millisecond */
     public int[] times;
 
     /**
      * Decodes ASN.1 GeneralizedTime type
      *
-     * @throws IOException - if error occured
+     * @throws IOException if error occured
      */
     public void readGeneralizedTime() throws IOException {
-
         if (tag == ASN1Constants.TAG_GENERALIZEDTIME) {
-
             // FIXME: any other optimizations?
             readContent();
             // FIXME store string somewhere to allow a custom time type perform
@@ -357,17 +306,17 @@
             }
 
             // check syntax: MUST be YYYYMMDDHHMMSS[(./,)DDD]'Z'
-            if (length != 15 && (length < 17 || length > 19)) // invalid
-                                                                // length
-            {
-                throw new ASN1Exception("ASN.1 GeneralizedTime wrongly encoded at [" + contentOffset + "]");
+            if (length != 15 && (length < 17 || length > 19)) {
+                throw new ASN1Exception("ASN.1 GeneralizedTime wrongly encoded at ["
+                        + contentOffset + "]");
             }
 
             // check content: milliseconds
             if (length > 16) {
                 byte char14 = buffer[contentOffset + 14];
                 if (char14 != '.' && char14 != ',') {
-                    throw new ASN1Exception("ASN.1 GeneralizedTime wrongly encoded at [" + contentOffset + "]");
+                    throw new ASN1Exception("ASN.1 GeneralizedTime wrongly encoded at ["
+                            + contentOffset + "]");
                 }
             }
 
@@ -403,12 +352,10 @@
     /**
      * Decodes ASN.1 UTCTime type
      *
-     * @throws IOException - if an I/O error occurs or the end of the stream is reached
+     * @throws IOException if an I/O error occurs or the end of the stream is reached
      */
     public void readUTCTime() throws IOException {
-
         if (tag == ASN1Constants.TAG_UTCTIME) {
-
             switch (length) {
             case ASN1UTCTime.UTC_HM:
             case ASN1UTCTime.UTC_HMS:
@@ -461,15 +408,10 @@
         }
     }
 
-    //TODO comment me
     private int strToInt(int off, int count) throws ASN1Exception {
-
-        //FIXME works only with buffer
-
-        int c;
         int result = 0;
         for (int i = off, end = off + count; i < end; i++) {
-            c = buffer[i] - 48;
+            int c = buffer[i] - 48;
             if (c < 0 || c > 9) {
                 throw new ASN1Exception("Time encoding has invalid char");
             }
@@ -480,11 +422,8 @@
 
     /**
      * Decodes ASN.1 Integer type
-     *
-     * @throws IOException - if error occured
      */
     public void readInteger() throws IOException {
-
         if (tag != ASN1Constants.TAG_INTEGER) {
             throw expected("integer");
         }
@@ -498,7 +437,6 @@
 
         // check encoded content
         if (length > 1) {
-
             byte firstByte = buffer[offset - length];
             byte secondByte = (byte) (buffer[offset - length + 1] & 0x80);
 
@@ -511,11 +449,8 @@
 
     /**
      * Decodes ASN.1 Octetstring type
-     *
-     * @throws IOException - if error occured
      */
     public void readOctetString() throws IOException {
-
         if (tag == ASN1Constants.TAG_OCTETSTRING) {
             readContent();
         } else if (tag == ASN1Constants.TAG_C_OCTETSTRING) {
@@ -529,16 +464,12 @@
         throw new ASN1Exception("ASN.1 " + what + " identifier expected at [" + tagOffset + "], got " + Integer.toHexString(tag));
     }
 
-    //FIXME comment me
     public int oidElement;
 
     /**
      * Decodes ASN.1 ObjectIdentifier type
-     *
-     * @throws IOException - if error occured
      */
     public void readOID() throws IOException {
-
         if (tag != ASN1Constants.TAG_OID) {
             throw expected("OID");
         }
@@ -557,18 +488,6 @@
 
         oidElement = 1;
         for (int i = 0; i < length; i++, ++oidElement) {
-
-            // According to ASN.1 BER spec:
-            //    leading octet of subidentifier MUST not be 0x80
-            // This assertion is not verified
-            //
-            //if (buffer[contentOffset + i] == (byte)0x80) {
-            //    throw new ASN1Exception(
-            //            "Wrong content for ASN.1 object identifier at ["
-            //                    + contentOffset
-            //                    + "]. Subidentifier MUST be encoded in minimum number of octets");
-            //}
-
             while ((buffer[contentOffset + i] & 0x80) == 0x80) {
                 i++;
             }
@@ -577,12 +496,8 @@
 
     /**
      * Decodes ASN.1 Sequence type
-     *
-     * @param sequence - ASN.1 sequence to be decoded
-     * @throws IOException - if error occured
      */
     public void readSequence(ASN1Sequence sequence) throws IOException {
-
         if (tag != ASN1Constants.TAG_C_SEQUENCE) {
             throw expected("sequence");
         }
@@ -618,7 +533,6 @@
             }
 
         } else {
-
             int seqTagOffset = tagOffset; //store tag offset
 
             Object[] values = new Object[type.length];
@@ -661,12 +575,8 @@
 
     /**
      * Decodes ASN.1 SequenceOf type
-     *
-     * @param sequenceOf - ASN.1 sequence to be decoded
-     * @throws IOException - if error occured
      */
     public void readSequenceOf(ASN1SequenceOf sequenceOf) throws IOException {
-
         if (tag != ASN1Constants.TAG_C_SEQUENCEOF) {
             throw expected("sequenceOf");
         }
@@ -676,12 +586,8 @@
 
     /**
      * Decodes ASN.1 Set type
-     *
-     * @param set - ASN.1 set to be decoded
-     * @throws IOException - if error occured
      */
     public void readSet(ASN1Set set) throws IOException {
-
         if (tag != ASN1Constants.TAG_C_SET) {
             throw expected("set");
         }
@@ -691,12 +597,8 @@
 
     /**
      * Decodes ASN.1 SetOf type
-     *
-     * @param set - ASN.1 set to be decoded
-     * @throws IOException - if error occured
      */
     public void readSetOf(ASN1SetOf setOf) throws IOException {
-
         if (tag != ASN1Constants.TAG_C_SETOF) {
             throw expected("setOf");
         }
@@ -704,9 +606,7 @@
         decodeValueCollection(setOf);
     }
 
-    private final void decodeValueCollection(ASN1ValueCollection collection)
-            throws IOException {
-
+    private void decodeValueCollection(ASN1ValueCollection collection) throws IOException {
         int begOffset = offset;
         int endOffset = begOffset + length;
 
@@ -718,15 +618,15 @@
                 type.decode(this);
             }
         } else {
-
             int seqTagOffset = tagOffset; //store tag offset
 
-            ArrayList values = new ArrayList();
+            ArrayList<Object> values = new ArrayList<Object>();
             while (endOffset > offset) {
                 next();
                 values.add(type.decode(this));
             }
 
+            values.trimToSize();
             content = values;
 
             tagOffset = seqTagOffset; //retrieve tag offset
@@ -740,11 +640,9 @@
     /**
      * Decodes ASN.1 String type
      *
-     * @throws IOException - if an I/O error occurs or the end of the stream is reached
+     * @throws IOException if an I/O error occurs or the end of the stream is reached
      */
     public void readString(ASN1StringType type) throws IOException {
-
-        //FIXME check string content
         if (tag == type.id) {
             readContent();
         } else if (tag == type.constrId) {
@@ -767,8 +665,6 @@
 
     /**
      * Returns internal buffer used for decoding
-     *
-     * @return - buffer
      */
     public final byte[] getBuffer() {
         return buffer;
@@ -776,8 +672,6 @@
 
     /**
      * Returns length of the current content for decoding
-     *
-     * @return - length of content
      */
     public final int getLength() {
         return length;
@@ -785,8 +679,6 @@
 
     /**
      * Returns the current offset
-     *
-     * @return - offset
      */
     public final int getOffset() {
         return offset;
@@ -794,8 +686,6 @@
 
     /**
      * Returns end offset for the current encoded type
-     *
-     * @return - offset
      */
     public final int getEndOffset() {
         return offset + length;
@@ -803,17 +693,11 @@
 
     /**
      * Returns start offset for the current encoded type
-     *
-     * @return - offset
      */
     public final int getTagOffset() {
         return tagOffset;
     }
 
-    public final int getContentOffset() {
-        return contentOffset;
-    }
-
     /**
      * Indicates verify or store mode.
      *
@@ -845,12 +729,8 @@
 
     /**
      * Reads the next encoded byte from the encoded input stream.
-     *
-     * @return the next encoded byte
-     * @throws IOException - if error occured
      */
     protected int read() throws IOException {
-
         if (offset == buffer.length) {
             throw new ASN1Exception("Unexpected end of encoding");
         }
@@ -872,8 +752,6 @@
     /**
      * Reads the next encoded content from the encoded input stream.
      * The method MUST be used for reading a primitive encoded content.
-     *
-     * @throws IOException - if error occured
      */
     public void readContent() throws IOException {
         if (offset + length > buffer.length) {
@@ -902,16 +780,6 @@
         }
     }
 
-    //    // reallocates internal buffer for indefined reading mode
-    //    private void reallocateBuffer(int n) {
-    //        int newSize;
-    //        for (newSize = buffer.length * 2; newSize < buffer.length + n; newSize = newSize * 2)
-    //            ;
-    //        byte[] newBuffer = new byte[newSize];
-    //        System.arraycopy(buffer, 0, newBuffer, 0, buffer.length);
-    //        buffer = newBuffer;
-    //    }
-
     /**
      * Reallocates the buffer in order to make it
      * exactly the size of data it contains
@@ -925,17 +793,9 @@
             buffer = newBuffer;
         }
     }
-
-    //
-    //
-    //
-    //
-    //
-
     private Object[][] pool;
 
     public void put(Object key, Object entry) {
-
         if (pool == null) {
             pool = new Object[2][10];
         }
@@ -960,7 +820,6 @@
     }
 
     public Object get(Object key) {
-
         if (pool == null) {
             return null;
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/BerOutputStream.java b/luni/src/main/java/org/apache/harmony/security/asn1/BerOutputStream.java
index f646e69..36b26bb 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/BerOutputStream.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/BerOutputStream.java
@@ -28,34 +28,21 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public class BerOutputStream {
 
-    /**
-     *  Encoded byte array
-     */
+    /** Encoded byte array */
     public byte[] encoded;
 
-    /**
-     *  current offset
-     */
+    /** current offset */
     protected int offset;
 
-    /**
-     * Current encoded length
-     */
+    /** Current encoded length */
     public int length;
 
-    /**
-     * Current encoded content
-     */
+    /** Current encoded content */
     public Object content;
 
-    public BerOutputStream() {
-    }
-
     public final void encodeTag(int tag) {
-
         encoded[offset++] = (byte) tag; //FIXME long form?
 
         if (length > 127) { //long form
@@ -93,7 +80,7 @@
     }
 
     public void encodeBoolean() {
-        if (((Boolean) content).booleanValue()) {
+        if ((Boolean) content) {
             encoded[offset] = (byte) 0xFF;
         } else {
             encoded[offset] = 0x00;
@@ -190,10 +177,6 @@
         offset += length;
     }
 
-    /*
-     * LENGTH
-     */
-
     public void getChoiceLength(ASN1Choice choice) {
         throw new RuntimeException("Is not implemented yet"); //FIXME
     }
@@ -217,8 +200,4 @@
     public void getSetOfLength(ASN1SetOf setOf) {
         throw new RuntimeException("Is not implemented yet"); //FIXME
     }
-
-    public int getStringLength(Object object) {
-        throw new RuntimeException("Is not implemented yet"); //FIXME
-    }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/BitString.java b/luni/src/main/java/org/apache/harmony/security/asn1/BitString.java
index 64f85a4..b0579ef 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/BitString.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/BitString.java
@@ -27,7 +27,6 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public final class BitString {
 
     private static final byte[] SET_MASK = { (byte) 128, 64, 32, 16, 8, 4, 2, 1 };
@@ -35,27 +34,19 @@
     private static final byte[] RESET_MASK = { 0x7f, (byte) 0xbf, (byte) 0xdf,
             (byte) 0xef, (byte) 0xf7, (byte) 0xfb, (byte) 0xfd, (byte) 0xfe, };
 
-    /**
-     * Sequence of bits padded with unused bits.
-     * @see #unusedBits
-     */
+    /** Sequence of bits padded with unused bits. */
     public final byte[] bytes;
 
-    /**
-     * Number of unused bits in the last byte.
-     */
+    /** Number of unused bits in the last byte. */
     public final int unusedBits;
 
     /**
-     * Constructs bit string
-     *
-     * @param bytes - array of bytes that represents bit string,
+     * @param bytes array of bytes that represents bit string,
      *                including unused bits
-     * @param unusedBits - number of unused bits
+     * @param unusedBits number of unused bits
      * @throws IllegalArgumentException - if parameters are invalid
      */
     public BitString(byte[] bytes, int unusedBits) {
-
         // constraints are set according X.690
         if (unusedBits < 0 || unusedBits > 7) {
             throw new IllegalArgumentException("Number of unused bits MUST be in range 0-7");
@@ -69,11 +60,6 @@
         this.unusedBits = unusedBits;
     }
 
-    /**
-     * Constructs bit string from array of booleans
-     *
-     * @param values - array of booleans
-     */
     public BitString(boolean[] values) {
         unusedBits = values.length % 8;
         int size = values.length / 8;
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/DerInputStream.java b/luni/src/main/java/org/apache/harmony/security/asn1/DerInputStream.java
index 0000952..1fddb82 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/DerInputStream.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/DerInputStream.java
@@ -30,15 +30,17 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public final class DerInputStream extends BerInputStream {
 
+    /** mask for verifying unused bits for ASN.1 bitstring */
+    private static final byte[] UNUSED_BITS_MASK = new byte[] { 0x01, 0x03,
+            0x07, 0x0F, 0x1F, 0x3F, 0x7F };
+
     public DerInputStream(byte[] encoded) throws IOException {
         super(encoded, 0, encoded.length);
     }
 
-    public DerInputStream(byte[] encoded, int offset, int encodingLen)
-            throws IOException {
+    public DerInputStream(byte[] encoded, int offset, int encodingLen) throws IOException {
         super(encoded, offset, encodingLen);
     }
 
@@ -46,11 +48,7 @@
         super(in);
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#next()
-     */
-    public final int next() throws IOException {
-
+    public int next() throws IOException {
         int tag = super.next();
 
         if (length == INDEFINIT_LENGTH) {
@@ -62,18 +60,10 @@
         return tag;
     }
 
-    // mask for verifying unused bits for ASN.1 bitstring
-    private static final byte[] UNUSED_BITS_MASK = new byte[] { 0x01, 0x03,
-            0x07, 0x0F, 0x1F, 0x3F, 0x7F };
-
-
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readBitString()
-     */
     public void readBitString() throws IOException {
-
         if (tag == ASN1Constants.TAG_C_BITSTRING) {
-            throw new ASN1Exception("ASN.1 bitstring: constructed identifier at [" + tagOffset + "]. Not valid for DER.");
+            throw new ASN1Exception("ASN.1 bitstring: constructed identifier at [" + tagOffset
+                    + "]. Not valid for DER.");
         }
 
         super.readBitString();
@@ -82,37 +72,29 @@
         if (length > 1
                 && buffer[contentOffset] != 0
                 && (buffer[offset - 1] & UNUSED_BITS_MASK[buffer[contentOffset] - 1]) != 0) {
-            throw new ASN1Exception("ASN.1 bitstring: wrong content at [" + contentOffset + "]. DER requires zero unused bits in final octet.");
+            throw new ASN1Exception("ASN.1 bitstring: wrong content at [" + contentOffset
+                    + "]. DER requires zero unused bits in final octet.");
         }
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readBoolean()
-     */
     public void readBoolean() throws IOException {
-
         super.readBoolean();
 
         // check encoded content
         if (buffer[contentOffset] != 0 && buffer[contentOffset] != (byte) 0xFF) {
-            throw new ASN1Exception("ASN.1 boolean: wrong content at [" + contentOffset + "]. DER allows only 0x00 or 0xFF values");
+            throw new ASN1Exception("ASN.1 boolean: wrong content at [" + contentOffset
+                    + "]. DER allows only 0x00 or 0xFF values");
         }
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readOctetString()
-     */
     public void readOctetString() throws IOException {
-
         if (tag == ASN1Constants.TAG_C_OCTETSTRING) {
-            throw new ASN1Exception("ASN.1 octetstring: constructed identifier at [" + tagOffset + "]. Not valid for DER.");
+            throw new ASN1Exception("ASN.1 octetstring: constructed identifier at [" + tagOffset
+                    + "]. Not valid for DER.");
         }
         super.readOctetString();
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readSequence(org.apache.harmony.security.asn1.ASN1Sequence)
-     */
     public void readSequence(ASN1Sequence sequence) throws IOException {
         //
         // According to ASN.1 DER spec. sequence MUST not include
@@ -123,9 +105,6 @@
         super.readSequence(sequence);
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readSetOf(org.apache.harmony.security.asn1.ASN1SetOf)
-     */
     public void readSetOf(ASN1SetOf setOf) throws IOException {
         //
         // According to ASN.1 DER spec. set of MUST appear in
@@ -136,63 +115,37 @@
         super.readSetOf(setOf);
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readString(ASN1StringType)
-     */
     public void readString(ASN1StringType type) throws IOException {
-
         if (tag == type.constrId) {
-            throw new ASN1Exception("ASN.1 string: constructed identifier at [" + tagOffset + "]. Not valid for DER.");
+            throw new ASN1Exception("ASN.1 string: constructed identifier at [" + tagOffset
+                    + "]. Not valid for DER.");
         }
         super.readString(type);
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readUTCTime()
-     */
     public void readUTCTime() throws IOException {
-
         if (tag == ASN1Constants.TAG_C_UTCTIME) {
             // It is a string type and it can be encoded as primitive or constructed.
-            throw new ASN1Exception("ASN.1 UTCTime: constructed identifier at [" + tagOffset + "]. Not valid for DER.");
+            throw new ASN1Exception("ASN.1 UTCTime: constructed identifier at [" + tagOffset
+                    + "]. Not valid for DER.");
         }
 
         // check format: DER uses YYMMDDHHMMSS'Z' only
         if (length != ASN1UTCTime.UTC_HMS) {
-            throw new ASN1Exception("ASN.1 UTCTime: wrong format for DER, identifier at [" + tagOffset + "]");
+            throw new ASN1Exception("ASN.1 UTCTime: wrong format for DER, identifier at ["
+                    + tagOffset + "]");
         }
 
         super.readUTCTime();
     }
 
-    /**
-     * @see org.apache.harmony.security.asn1.BerInputStream#readGeneralizedTime()
-     */
     public void readGeneralizedTime() throws IOException {
-
         if (tag == ASN1Constants.TAG_C_GENERALIZEDTIME) {
             // It is a string type and it can be encoded as primitive or constructed.
-            throw new ASN1Exception("ASN.1 GeneralizedTime: constructed identifier at [" + tagOffset + "]. Not valid for DER.");
+            throw new ASN1Exception("ASN.1 GeneralizedTime: constructed identifier at ["
+                    + tagOffset + "]. Not valid for DER.");
         }
 
         super.readGeneralizedTime();
-
-        // FIXME makes sense only if we support all GeneralizedTime formats
-        // late check syntax: the last char MUST be Z
-        //if (buffer[offset - 1] != 'Z') {
-        //    throw new ASN1Exception(
-        //            "ASN.1 GeneralizedTime wrongly encoded at ["
-        //                    + contentOffset + ']');
-        //}
-
-        // the fractional-seconds elements, if present MUST
-        // omit all trailing zeros
-        // FIXME implement me
-        //        if () {
-        //            throw new IOException(
-        //                    "DER ASN.1 GeneralizedTime wrongly encoded at ["
-        //                            + contentOffset
-        //                            + "]. Trailing zeros MUST be omitted");
-        //        }
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/DerOutputStream.java b/luni/src/main/java/org/apache/harmony/security/asn1/DerOutputStream.java
index 84030e7..e9c4ab7 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/DerOutputStream.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/DerOutputStream.java
@@ -30,46 +30,36 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public final class DerOutputStream extends BerOutputStream {
+    private static final int initSize = 32;
+    private int index;
+    private int[][] len = new int[initSize][];
+    private Object[][] val = new Object[initSize][];
 
     public DerOutputStream(ASN1Type asn1, Object object) {
-        super();
-
         content = object;
-
         index = -1;
         asn1.setEncodingContent(this);
-
         encoded = new byte[asn1.getEncodedLength(this)];
-
         index = 0;
         asn1.encodeASN(this);
     }
 
-    public void encodeChoice(ASN1Choice choice) {
-
+    @Override public void encodeChoice(ASN1Choice choice) {
         ASN1Type type = (ASN1Type) val[index][0];
-
         content = val[index][1];
-
         index++;
-
         type.encodeASN(this);
     }
 
-    public void encodeExplicit(ASN1Explicit explicit) {
-
+    @Override public void encodeExplicit(ASN1Explicit explicit) {
         content = val[index][0];
         length = len[index][0];
-
         index++;
-
         explicit.type.encodeASN(this);
     }
 
-    public void encodeSequence(ASN1Sequence sequence) {
-
+    @Override public void encodeSequence(ASN1Sequence sequence) {
         ASN1Type[] type = sequence.type;
 
         Object[] values = val[index];
@@ -77,7 +67,6 @@
 
         index++;
         for (int i = 0; i < type.length; i++) {
-
             if (values[i] == null) {
                 continue;
             }
@@ -89,43 +78,27 @@
         }
     }
 
-    public void encodeSequenceOf(ASN1SequenceOf sequenceOf) {
+    @Override public void encodeSequenceOf(ASN1SequenceOf sequenceOf) {
         encodeValueCollection(sequenceOf);
     }
 
-    public void encodeSetOf(ASN1SetOf setOf) {
+    @Override public void encodeSetOf(ASN1SetOf setOf) {
         encodeValueCollection(setOf);
     }
 
-    private final void encodeValueCollection(ASN1ValueCollection collection) {
-
+    private void encodeValueCollection(ASN1ValueCollection collection) {
         Object[] values = val[index];
         int[] compLens = len[index];
 
         index++;
         for (int i = 0; i < values.length; i++) {
-
             content = values[i];
             length = compLens[i];
-
             collection.type.encodeASN(this);
         }
     }
 
-    /*
-     * DATA
-     */
-
-    private final static int initSize = 32;
-
-    private int index;
-
-    private int[][] len = new int[initSize][];
-
-    private Object[][] val = new Object[initSize][];
-
     private void push(int[] lengths, Object[] values) {
-
         index++;
         if (index == val.length) {
 
@@ -141,12 +114,7 @@
         val[index] = values;
     }
 
-    /*
-     * LENGTH
-     */
-
-    public void getChoiceLength(ASN1Choice choice) {
-
+    @Override public void getChoiceLength(ASN1Choice choice) {
         int i = choice.getIndex(content);
         content = choice.getObjectToEncode(content);
 
@@ -161,8 +129,7 @@
         values[1] = content;
     }
 
-    public void getExplicitLength(ASN1Explicit explicit) {
-
+    @Override public void getExplicitLength(ASN1Explicit explicit) {
         Object[] values = new Object[1];
         int[] compLens = new int[1];
 
@@ -180,8 +147,7 @@
         length = explicit.type.getEncodedLength(this);
     }
 
-    public void getSequenceLength(ASN1Sequence sequence) {
-
+    @Override public void getSequenceLength(ASN1Sequence sequence) {
         ASN1Type[] type = sequence.type;
 
         Object[] values = new Object[type.length];
@@ -222,16 +188,15 @@
         length = seqLen;
     }
 
-    public void getSequenceOfLength(ASN1SequenceOf sequence) {
+    @Override public void getSequenceOfLength(ASN1SequenceOf sequence) {
         getValueOfLength(sequence);
     }
 
-    public void getSetOfLength(ASN1SetOf setOf) {
+    @Override public void getSetOfLength(ASN1SetOf setOf) {
         getValueOfLength(setOf);
     }
 
     private void getValueOfLength(ASN1ValueCollection collection) {
-
         //FIXME what about another way?
         Object[] cv = collection.getValues(content).toArray();
 
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/InformationObjectSet.java b/luni/src/main/java/org/apache/harmony/security/asn1/InformationObjectSet.java
deleted file mode 100644
index c652543..0000000
--- a/luni/src/main/java/org/apache/harmony/security/asn1/InformationObjectSet.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Stepan M. Mishura
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.asn1;
-
-import java.util.Arrays;
-import org.apache.harmony.security.x501.AttributeType;
-
-
-/**
- * Represents Information Object Set.
- *
- * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
- */
-
-public class InformationObjectSet {
-
-    private final int capacity;
-
-    private final Entry[][] pool;
-
-    public InformationObjectSet() {
-        this(64, 10);
-    }
-
-    public InformationObjectSet(int capacity, int size) {
-        this.capacity = capacity;
-        pool = new Entry[capacity][size];
-    }
-
-    public void put(AttributeType at) {
-        put(at.oid.getOid(), at);
-    }
-
-    public void put(int[] oid, Object object) {
-
-        int index = hashIntArray(oid) % capacity;
-        // look for OID in the pool
-        Entry[] list = pool[index];
-        int i = 0;
-        for (; list[i] != null; i++) {
-
-            // check wrong static initialization: no duplicate OIDs
-            if (Arrays.equals(oid, list[i].oid)) {
-                throw new Error(); //FIXME message
-            }
-        }
-
-        // check : to avoid NPE
-        if (i == (capacity - 1)) {
-            throw new Error(); //FIXME message
-        }
-        list[i] = new Entry(oid, object);
-    }
-
-    public Object get(int[] oid) {
-        int index = hashIntArray(oid) % capacity;
-
-        // look for OID in the pool
-        Entry[] list = pool[index];
-        for (int i = 0; list[i] != null; i++) {
-            if (Arrays.equals(oid, list[i].oid)) {
-                return list[i].object;
-            }
-        }
-        return null;
-    }
-
-    // FIXME change me to Arrays.hashCode(int[])
-    private int hashIntArray(int[] array) {
-        int intHash = 0;
-        for (int i = 0; i < array.length && i < 4; i++) {
-            intHash += array[i] << (8 * i); //TODO what about to find better one?
-        }
-        return intHash & 0x7FFFFFFF; // only positive
-    }
-
-    private static class Entry {
-        public int[] oid;
-
-        public Object object;
-
-        public Entry(int[] oid, Object object) {
-            this.oid = oid;
-            this.object = object;
-        }
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/security/asn1/ObjectIdentifier.java b/luni/src/main/java/org/apache/harmony/security/asn1/ObjectIdentifier.java
index 199f30c..24140e5 100644
--- a/luni/src/main/java/org/apache/harmony/security/asn1/ObjectIdentifier.java
+++ b/luni/src/main/java/org/apache/harmony/security/asn1/ObjectIdentifier.java
@@ -38,20 +38,19 @@
  *
  * @see <a href="http://asn1.elibel.tm.fr/en/standards/index.htm">ASN.1</a>
  */
-
 public final class ObjectIdentifier {
 
-    // OID as array of integers
+    /** OID as array of integers */
     private final int[] oid;
 
-    // OID as string
+    /** OID as string */
     private String soid;
 
     /**
      * Creates ObjectIdentifier(OID) from array of integers.
      *
-     * @param oid - array of integers
-     * @throws IllegalArgumentException - if oid is invalid or null
+     * @param oid array of integers
+     * @throws IllegalArgumentException if oid is invalid or null
      */
     public ObjectIdentifier(int[] oid) {
         validate(oid);
@@ -61,30 +60,15 @@
     /**
      * Creates ObjectIdentifier(OID) from string representation.
      *
-     * @param strOid - oid string
-     * @throws IllegalArgumentException - if oid string is invalid or null
+     * @param strOid oid string
+     * @throws IllegalArgumentException if oid string is invalid or null
      */
     public ObjectIdentifier(String strOid) {
         this.oid = toIntArray(strOid);
         this.soid = strOid;
     }
 
-    /**
-     * Returns array of integers.
-     *
-     * @return array of integers
-     */
-    public int[] getOid() {
-        return oid;
-    }
-
-    /**
-     * Compares object with OID for equality.
-     *
-     * @return true if object is ObjectIdentifier and it has the same
-     *         representation as array of integers, otherwise false
-     */
-    public boolean equals(Object o) {
+    @Override public boolean equals(Object o) {
         if (this == o) {
             return true;
         }
@@ -94,20 +78,14 @@
         return Arrays.equals(oid, ((ObjectIdentifier) o).oid);
     }
 
-    /**
-     * @see java.lang.Object#toString()
-     */
-    public String toString() {
+    @Override public String toString() {
         if (soid == null) {
             soid = toString(oid);
         }
         return soid;
     }
 
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode() {
+    @Override public int hashCode() {
         // FIXME change me to Arrays.hashCode(int[])
         int intHash = 0;
         for (int i = 0; i < oid.length && i < 4; i++) {
@@ -119,11 +97,10 @@
     /**
      * Validates ObjectIdentifier (OID).
      *
-     * @param oid - oid as array of integers
-     * @throws IllegalArgumentException - if oid is invalid or null
+     * @param oid oid as array of integers
+     * @throws IllegalArgumentException if oid is invalid or null
      */
     public static void validate(int[] oid) {
-
         if (oid == null) {
             throw new IllegalArgumentException("oid == null");
         }
@@ -133,107 +110,27 @@
         }
 
         if (oid[0] > 2) {
-            throw new IllegalArgumentException("Valid values for first subidentifier are 0, 1 and 2");
+            throw new IllegalArgumentException(
+                    "Valid values for first subidentifier are 0, 1 and 2");
         } else if (oid[0] != 2 && oid[1] > 39) {
-            throw new IllegalArgumentException("If the first subidentifier has 0 or 1 value the second subidentifier value MUST be less than 40");
+            throw new IllegalArgumentException("If the first subidentifier has 0 or 1 value the "
+                    + "second subidentifier value MUST be less than 40");
         }
 
-        for (int i = 0; i < oid.length; i++) {
-            if (oid[i] < 0) {
+        for (int anOid : oid) {
+            if (anOid < 0) {
                 throw new IllegalArgumentException("Subidentifier MUST have positive value");
             }
         }
     }
 
-    // FIXME: implement me
-    //    /**
-    //     * Validates ObjectIdentifier (OID).
-    //     *
-    //     * @param oid - oid as string
-    //     * @throws IllegalArgumentException - if oid string  is invalid or null
-    //     */
-    //    public static void validate(String oid) {
-    //
-    //        if (oid == null) {
-    //            throw new NullPointerException();
-    //        }
-    //
-    //        int length = oid.length();
-    //        if (length < 3 || oid.charAt(1) != '.') {
-    //            throw new IllegalArgumentException("Invalid oid string");
-    //        }
-    //
-    //        int pos = 2;
-    //        int subidentifier = 0;
-    //        switch (oid.charAt(0)) {
-    //        case '0':
-    //        case '1':
-    //            for (char c = oid.charAt(pos);;) {
-    //                if (c < '0' || c > '9') {
-    //                    throw new IllegalArgumentException("Invalid oid string");
-    //                } else {
-    //                    subidentifier = subidentifier * 10 + c - '0';
-    //                }
-    //
-    //                pos++;
-    //                if (pos == length) {
-    //                    break;
-    //                }
-    //
-    //                c = oid.charAt(pos);
-    //                if (c == '.') {
-    //                    pos++;
-    //                    if (pos == length) {
-    //                        throw new IllegalArgumentException("Invalid oid string");
-    //                    }
-    //                    break;
-    //                }
-    //            }
-    //
-    //            if (subidentifier > 39) {
-    //                throw new IllegalArgumentException(
-    //                        "If the first subidentifier has 0 or 1 value the second "
-    //                                + "subidentifier value MUST be less then 40.");
-    //            }
-    //            break;
-    //        case '2':
-    //            break;
-    //        default:
-    //            throw new IllegalArgumentException(
-    //                    "Valid values for first subidentifier are 0, 1 and 2");
-    //        }
-    //
-    //        if (pos == length) {
-    //            return;
-    //        }
-    //
-    //        for (char c = oid.charAt(pos);;) {
-    //            if (c < '0' || c > '9') {
-    //                throw new IllegalArgumentException("Invalid oid string");
-    //            }
-    //
-    //            pos++;
-    //            if (pos == length) {
-    //                return;
-    //            }
-    //
-    //            c = oid.charAt(pos);
-    //            if (c == '.') {
-    //                pos++;
-    //                if (pos == length) {
-    //                    throw new IllegalArgumentException("Invalid oid string");
-    //                }
-    //            }
-    //        }
-    //    }
-
     /**
      * Returns string representation of OID.
      *
      * Note: it is supposed that passed array of integers
      * contains valid OID value, so no checks are performed.
      *
-     * @param oid - oid as array of integers
+     * @param oid oid as array of integers
      * @return oid string representation
      */
     public static String toString(int[] oid) {
@@ -247,7 +144,6 @@
         return sb.toString();
     }
 
-    // BEGIN android-changed
     /**
      * Gets ObjectIdentifier (OID) from string representation.
      *
@@ -255,9 +151,9 @@
      *     OID = subidentifier 1*("." subidentifier)
      *     subidentifier = 1*(digit)
      *
-     * @param oidString -  string representation of OID
-     * @return - oid as array of integers
-     * @throws IllegalArgumentException - if oid string is invalid or null
+     * @param str string representation of OID
+     * @return oid as array of integers
+     * @throws IllegalArgumentException if oid string is invalid or null
      */
     public static int[] toIntArray(String str) {
         return toIntArray(str, true);
@@ -269,7 +165,7 @@
      *
      * String representation is defined as for {@link #toIntArray}.
      *
-     * @param oidString -  string representation of OID
+     * @param str string representation of OID
      * @return true if oidString has valid syntax or false if not
      */
     public static boolean isOID(String str) {
@@ -283,10 +179,10 @@
      *     OID = subidentifier 1*("." subidentifier)
      *     subidentifier = 1*(digit)
      *
-     * @param oidString -  string representation of OID
-     * @return - oid as array of integers or null if the oid string is
+     * @param str string representation of OID
+     * @return oid as array of integers or null if the oid string is
      * invalid or null and shouldThrow is false
-     * @throws IllegalArgumentException - if oid string is invalid or null and
+     * @throws IllegalArgumentException if oid string is invalid or null and
      * shouldThrow is true
      */
     private static int[] toIntArray(String str, boolean shouldThrow) {
@@ -368,5 +264,4 @@
 
         return oid;
     }
-    // END android-changed
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicy.java b/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicy.java
index ebdce53..8d07013 100644
--- a/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicy.java
+++ b/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicy.java
@@ -24,7 +24,6 @@
 
 import java.io.File;
 import java.net.URL;
-import java.security.AccessController;
 import java.security.CodeSource;
 import java.security.Permission;
 import java.security.PermissionCollection;
@@ -270,8 +269,7 @@
      */
     public synchronized void refresh() {
         Set<PolicyEntry> fresh = new HashSet<PolicyEntry>();
-        Properties system = new Properties(AccessController
-                .doPrivileged(new PolicyUtils.SystemKit()));
+        Properties system = System.getProperties();
         system.setProperty("/", File.separator);
         URL[] policyLocations = PolicyUtils.getPolicyURLs(system,
                                                           JAVA_SECURITY_POLICY,
diff --git a/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicyParser.java b/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicyParser.java
index 9857680..7f55e6f 100644
--- a/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicyParser.java
+++ b/luni/src/main/java/org/apache/harmony/security/fortress/DefaultPolicyParser.java
@@ -27,7 +27,6 @@
 import java.io.InputStreamReader;
 import java.io.Reader;
 import java.net.URL;
-import java.security.AccessController;
 import java.security.CodeSource;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -44,7 +43,6 @@
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
-import java.util.StringTokenizer;
 import org.apache.harmony.security.DefaultPolicyScanner;
 import org.apache.harmony.security.DefaultPolicyScanner.GrantEntry;
 import org.apache.harmony.security.DefaultPolicyScanner.KeystoreEntry;
@@ -108,15 +106,9 @@
      * @return a collection of PolicyEntry objects, may be empty
      * @throws Exception IO error while reading location or file syntax error
      */
-    public Collection<PolicyEntry>parse(URL location, Properties system)
-            throws Exception {
-
+    public Collection<PolicyEntry>parse(URL location, Properties system) throws Exception {
         boolean resolve = PolicyUtils.canExpandProperties();
-        Reader r =
-            new BufferedReader(
-                    new InputStreamReader(
-                            AccessController.doPrivileged(
-                                    new PolicyUtils.URLLoader(location))));
+        Reader r = new BufferedReader(new InputStreamReader(location.openStream()));
 
         Collection<GrantEntry> grantEntries = new HashSet<GrantEntry>();
         List<KeystoreEntry> keystores = new ArrayList<KeystoreEntry>();
@@ -381,17 +373,15 @@
      * @throws Exception if KeyStore is <code>null</code>
      * or if it failed to provide a certificate
      */
-    protected Certificate[] resolveSigners(KeyStore ks, String signers)
-            throws Exception {
+    protected Certificate[] resolveSigners(KeyStore ks, String signers) throws Exception {
         if (ks == null) {
             throw new KeyStoreException("No KeyStore to resolve signers: " + signers);
         }
 
         Collection<Certificate> certs = new HashSet<Certificate>();
-        StringTokenizer snt = new StringTokenizer(signers, ",");
-        while (snt.hasMoreTokens()) {
+        for (String signer : signers.split(",")) {
             //XXX cache found certs ??
-            certs.add(ks.getCertificate(snt.nextToken().trim()));
+            certs.add(ks.getCertificate(signer.trim()));
         }
         return certs.toArray(new Certificate[certs.size()]);
     }
@@ -456,8 +446,7 @@
                 }
                 KeyStore ks = KeyStore.getInstance(ke.type);
                 URL location = new URL(base, ke.url);
-                InputStream is = AccessController
-                        .doPrivileged(new PolicyUtils.URLLoader(location));
+                InputStream is = location.openStream();
                 try {
                     ks.load(is, null);
                 }
diff --git a/luni/src/main/java/org/apache/harmony/security/fortress/Engine.java b/luni/src/main/java/org/apache/harmony/security/fortress/Engine.java
index 7dbc476..d5e925e 100644
--- a/luni/src/main/java/org/apache/harmony/security/fortress/Engine.java
+++ b/luni/src/main/java/org/apache/harmony/security/fortress/Engine.java
@@ -24,7 +24,7 @@
 
 import java.security.NoSuchAlgorithmException;
 import java.security.Provider;
-import org.apache.harmony.security.Util;
+import java.util.Locale;
 
 
 /**
@@ -138,18 +138,14 @@
         Provider.Service service;
         ServiceCacheEntry cacheEntry = this.serviceCache;
         if (cacheEntry != null
-                && Util.equalsIgnoreCase(algorithm, cacheEntry.algorithm)
+                && cacheEntry.algorithm.equalsIgnoreCase(algorithm)
                 && Services.refreshNumber != cacheEntry.refreshNumber) {
             service = cacheEntry.service;
         } else {
             if (Services.isEmpty()) {
                 throw notFound(serviceName, algorithm);
             }
-            String name = new StringBuilder(128)
-                    .append(this.serviceName)
-                    .append(".")
-                    .append(Util.toUpperCase(algorithm))
-                    .toString();
+            String name = this.serviceName + "." + algorithm.toUpperCase(Locale.US);
             service = Services.getService(name);
             if (service == null) {
                 throw notFound(serviceName, algorithm);
diff --git a/luni/src/main/java/org/apache/harmony/security/fortress/PolicyUtils.java b/luni/src/main/java/org/apache/harmony/security/fortress/PolicyUtils.java
index 43bc44a..c22314b 100644
--- a/luni/src/main/java/org/apache/harmony/security/fortress/PolicyUtils.java
+++ b/luni/src/main/java/org/apache/harmony/security/fortress/PolicyUtils.java
@@ -28,19 +28,15 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.security.AccessController;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.Permissions;
-import java.security.PrivilegedAction;
-import java.security.PrivilegedExceptionAction;
 import java.security.Security;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Properties;
-import org.apache.harmony.security.Util;
 
 /**
  * This class consist of a number of static methods, which provide a common functionality
@@ -53,166 +49,6 @@
     private PolicyUtils() {}
 
     /**
-     * Auxiliary action for opening InputStream from specified location.
-     */
-    public static class URLLoader implements PrivilegedExceptionAction<InputStream> {
-
-        /**
-         * URL of target location.
-         */
-        public URL location;
-
-        /**
-         *  Constructor with target URL parameter.
-         */
-        public URLLoader(URL location) {
-            this.location = location;
-        }
-
-        /**
-         * Returns InputStream from the target URL.
-         */
-        public InputStream run() throws Exception {
-            return location.openStream();
-        }
-    }
-
-    /**
-     * Auxiliary action for accessing system properties in a bundle.
-     */
-    public static class SystemKit implements PrivilegedAction<Properties> {
-
-        /**
-         * Returns system properties.
-         */
-        public Properties run() {
-            return System.getProperties();
-        }
-    }
-
-    /**
-     * Auxiliary action for accessing specific system property.
-     */
-    public static class SystemPropertyAccessor implements PrivilegedAction<String> {
-
-        /**
-         * A key of a required system property.
-         */
-        public String key;
-
-        /**
-         * Constructor with a property key parameter.
-         */
-        public SystemPropertyAccessor(String key) {
-            this.key = key;
-        }
-
-        /**
-         * Handy one-line replacement of
-         * &quot;provide key and supply action&quot; code block,
-         * for reusing existing action instance.
-         */
-        public PrivilegedAction<String> key(String key) {
-            this.key = key;
-            return this;
-        }
-
-        /**
-         * Returns specified system property.
-         */
-        public String run() {
-            return System.getProperty(key);
-        }
-    }
-
-    /**
-     * Auxiliary action for accessing specific security property.
-     */
-    public static class SecurityPropertyAccessor implements PrivilegedAction<String> {
-
-        private String key;
-
-        /**
-         * Constructor with a property key parameter.
-         */
-        public SecurityPropertyAccessor(String key) {
-            super();
-            this.key = key;
-        }
-
-        public PrivilegedAction<String> key(String key) {
-            this.key = key;
-            return this;
-        }
-
-        /**
-         * Returns specified security property.
-         */
-        public String run() {
-            return Security.getProperty(key);
-        }
-    }
-
-    /**
-     * Auxiliary action for loading a provider by specific security property.
-     */
-    public static class ProviderLoader<T> implements PrivilegedAction<T> {
-
-        private String key;
-
-        /**
-         * Acceptable provider superclass.
-         */
-        private Class<T> expectedType;
-
-        /**
-         * Constructor taking property key and acceptable provider
-         * superclass parameters.
-         */
-        public ProviderLoader(String key, Class<T> expected) {
-            super();
-            this.key = key;
-            this.expectedType = expected;
-        }
-
-        /**
-         * Returns provider instance by specified security property.
-         * The <code>key</code> should map to a fully qualified classname.
-         *
-         * @throws SecurityException if no value specified for the key
-         * in security properties or if an Exception has occurred
-         * during classloading and instantiating.
-         */
-        public T run() {
-            String klassName = Security.getProperty(key);
-            if (klassName == null || klassName.length() == 0) {
-                throw new SecurityException("Provider implementation should be specified via '" +
-                        key + "' security property");
-            }
-            // TODO accurate classloading
-            try {
-                Class<?> klass = Class.forName(klassName, true,
-                        Thread.currentThread().getContextClassLoader());
-                if (expectedType != null && klass.isAssignableFrom(expectedType)){
-                    throw new SecurityException("Provided class " + klassName +
-                            " does not implement " + expectedType.getName());
-                }
-                //FIXME expectedType.cast(klass.newInstance());
-                return (T)klass.newInstance();
-            }
-            catch (SecurityException se){
-                throw se;
-            }
-            catch (Exception e) {
-                // TODO log error ??
-                SecurityException se = new SecurityException("Unable to instantiate provider: " + klassName);
-                se.initCause(e);
-                throw se;
-            }
-        }
-    }
-
-    /**
      * Specific exception to signal that property expansion failed
      * due to unknown key.
      */
@@ -421,8 +257,7 @@
      * @see #expand(String, Properties)
      */
     public static boolean canExpandProperties() {
-        return !Util.equalsIgnoreCase(FALSE,AccessController
-                .doPrivileged(new SecurityPropertyAccessor(POLICY_EXPAND)));
+        return !Security.getProperty(POLICY_EXPAND).equalsIgnoreCase(FALSE);
     }
 
     /**
@@ -460,15 +295,12 @@
     public static URL[] getPolicyURLs(final Properties system,
             final String systemUrlKey, final String securityUrlPrefix) {
 
-        final SecurityPropertyAccessor security = new SecurityPropertyAccessor(
-                null);
         final List<URL> urls = new ArrayList<URL>();
         boolean dynamicOnly = false;
         URL dynamicURL = null;
 
         //first check if policy is set via system properties
-        if (!Util.equalsIgnoreCase(FALSE, AccessController
-                .doPrivileged(security.key(POLICY_ALLOW_DYNAMIC)))) {
+        if (!Security.getProperty(POLICY_ALLOW_DYNAMIC).equalsIgnoreCase(FALSE)) {
             String location = system.getProperty(systemUrlKey);
             if (location != null) {
                 if (location.startsWith("=")) {
@@ -480,17 +312,10 @@
                     location = expandURL(location, system);
                     // location can be a file, but we need an url...
                     final File f = new File(location);
-                    dynamicURL = AccessController
-                            .doPrivileged(new PrivilegedExceptionAction<URL>() {
-
-                                public URL run() throws Exception {
-                                    if (f.exists()) {
-                                        return f.toURI().toURL();
-                                    } else {
-                                        return null;
-                                    }
-                                }
-                            });
+                    dynamicURL = null;
+                    if (f.exists()) {
+                        dynamicURL = f.toURI().toURL();
+                    }
                     if (dynamicURL == null) {
                         dynamicURL = new URL(location);
                     }
@@ -505,9 +330,7 @@
         if (!dynamicOnly) {
             int i = 1;
             while (true) {
-                String location = AccessController
-                        .doPrivileged(security.key(new StringBuilder(
-                                securityUrlPrefix).append(i++).toString()));
+                String location = Security.getProperty(securityUrlPrefix + (i++));
                 if (location == null) {
                     break;
                 }
diff --git a/luni/src/main/java/org/apache/harmony/security/fortress/SecurityUtils.java b/luni/src/main/java/org/apache/harmony/security/fortress/SecurityUtils.java
index 933bf83..c63a57db 100644
--- a/luni/src/main/java/org/apache/harmony/security/fortress/SecurityUtils.java
+++ b/luni/src/main/java/org/apache/harmony/security/fortress/SecurityUtils.java
@@ -25,18 +25,10 @@
 import java.security.AccessControlContext;
 import java.util.WeakHashMap;
 
-//FIXME: move this class under umbrella of protected packages -
-// see lib/java.security: property 'package.access',
-// so only trusted classes like Thread and AccessController will
-// have an access to this class.
-// This is to remove dependency on VMStack, to reduce number
-// of VM2API-dependent classes.
-
 /**
  * The class is used to perform an exchange of information between
  * java.lang.Thread and java.security.AccessController.<br>
- * The data to exchange is inherited contexts for the Thread-s.
- *
+ * The data to exchange is inherited contexts for the Threads.
  */
 public final class SecurityUtils {
 
@@ -94,17 +86,7 @@
      * It may also return null if no Thread found in the map - that seems
      * possible during VM startup process.
      */
-    public static AccessControlContext getContext(Thread thread)
-            throws SecurityException {
-
-        // ~fixme: see 'fixme' at the top of the file
-        /*
-         Class cl = VMStack.getCallerClass(0);
-         if (cl != AccessController.class) {
-         throw new SecurityException("You ["+cl+"] do not have access to this resource.");
-         }
-         */
-
+    public static AccessControlContext getContext(Thread thread) throws SecurityException {
         synchronized (ACC_CACHE) {
             return ACC_CACHE.get(thread);
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/fortress/Services.java b/luni/src/main/java/org/apache/harmony/security/fortress/Services.java
index 7c2cff2..d97e0f4 100644
--- a/luni/src/main/java/org/apache/harmony/security/fortress/Services.java
+++ b/luni/src/main/java/org/apache/harmony/security/fortress/Services.java
@@ -22,15 +22,13 @@
 
 package org.apache.harmony.security.fortress;
 
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.security.Provider;
 import java.security.Security;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
-import org.apache.harmony.security.Util;
 
 
 /**
@@ -42,16 +40,14 @@
 public class Services {
 
     // The HashMap that contains information about preferred implementations for
-    // all serviceName.algName in the registered providers
-    // BEGIN android-changed
-    // set the initial size to 600 so we don't grow to 1024 by default because
+    // all serviceName.algName in the registered providers.
+    // Set the initial size to 600 so we don't grow to 1024 by default because
     // initialization adds a few entries more than the growth threshold.
     private static final Map<String, Provider.Service> services
             = new HashMap<String, Provider.Service>(600);
-    // save default SecureRandom service as well.
-    // avoids similar provider/services iteration in SecureRandom constructor
+    // Save default SecureRandom service as well.
+    // Avoids similar provider/services iteration in SecureRandom constructor
     private static Provider.Service secureRandom;
-    // END android-changed
 
     // Need refresh flag
     private static boolean needRefresh; // = false;
@@ -66,14 +62,8 @@
 
     // Hash for quick provider access by name
     private static final Map<String, Provider> providersNames = new HashMap<String, Provider>(20);
-
     static {
-        AccessController.doPrivileged(new PrivilegedAction<Object>() {
-            public Object run() {
-                loadProviders();
-                return null;
-            }
-        });
+        loadProviders();
     }
 
     // Load statically registered providers and init Services Info
@@ -167,23 +157,17 @@
      * @param p
      */
     public static void initServiceInfo(Provider p) {
-        StringBuilder sb = new StringBuilder(128);
-
         for (Provider.Service serv : p.getServices()) {
             String type = serv.getType();
             if (secureRandom == null && type.equals("SecureRandom")) {
                 secureRandom = serv;
             }
-            sb.delete(0, sb.length());
-            String key = sb.append(type).append(".").append(
-                    Util.toUpperCase(serv.getAlgorithm())).toString();
+            String key = type + "." + serv.getAlgorithm().toUpperCase(Locale.US);
             if (!services.containsKey(key)) {
                 services.put(key, serv);
             }
             for (String alias : Engine.door.getAliases(serv)) {
-                sb.delete(0, sb.length());
-                key = sb.append(type).append(".").append(Util.toUpperCase(alias))
-                        .toString();
+                key = type + "." + alias.toUpperCase(Locale.US);
                 if (!services.containsKey(key)) {
                     services.put(key, serv);
                 }
diff --git a/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequest.java b/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequest.java
index 7af53e6..3d36d37 100644
--- a/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequest.java
+++ b/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequest.java
@@ -38,52 +38,37 @@
  *
  * Signature ::= BIT STRING
  */
-public class CertificationRequest {
+public final class CertificationRequest {
 
-    // the value of certificationRequestInfo field of the structure
+    /** the value of certificationRequestInfo field of the structure */
     private CertificationRequestInfo info;
 
-    // the value of signatureAlgorithm field of the structure
+    /** the value of signatureAlgorithm field of the structure */
     private AlgorithmIdentifier algId;
 
-    // the value of signature field of the structure
+    /** the value of signature field of the structure */
     private byte[] signature;
 
-    // the ASN.1 encoded form of CertificationRequest
+    /** the ASN.1 encoded form of CertificationRequest */
     private byte[] encoding;
 
     public CertificationRequest(CertificationRequestInfo info,
             AlgorithmIdentifier algId, byte[] signature) {
         this.info = info;
         this.algId = algId;
-        this.signature = new byte[signature.length];
-        System.arraycopy(signature, 0, this.signature, 0, signature.length);
+        this.signature = signature.clone();
     }
 
-    // private constructor with encoding given
     private CertificationRequest(CertificationRequestInfo info,
             AlgorithmIdentifier algId, byte[] signature, byte[] encoding) {
         this(info, algId, signature);
         this.encoding = encoding;
     }
 
-    /**
-     * @return Returns the algId.
-     */
-    public AlgorithmIdentifier getAlgId() {
-        return algId;
-    }
-
-    /**
-     * @return Returns the info.
-     */
     public CertificationRequestInfo getInfo() {
         return info;
     }
 
-    /**
-     * @return Returns the signature.
-     */
     public byte[] getSignature() {
         byte[] result = new byte[signature.length];
         System.arraycopy(signature, 0, result, 0, signature.length);
@@ -109,7 +94,6 @@
 
         public Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
-
             return new CertificationRequest(
                     (CertificationRequestInfo) values[0],
                     (AlgorithmIdentifier) values[1],
@@ -119,7 +103,6 @@
 
         protected void getValues(Object object, Object[] values) {
             CertificationRequest certReq = (CertificationRequest) object;
-
             values[0] = certReq.info;
             values[1] = certReq.algId;
             values[2] = new BitString(certReq.signature, 0);
diff --git a/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequestInfo.java b/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequestInfo.java
index d90b446..d13f952 100644
--- a/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequestInfo.java
+++ b/luni/src/main/java/org/apache/harmony/security/pkcs10/CertificationRequestInfo.java
@@ -30,72 +30,44 @@
 import org.apache.harmony.security.x509.SubjectPublicKeyInfo;
 
 /**
-   CertificationRequestInfo ::= SEQUENCE {
-     version Version,
-     subject Name,
-     subjectPublicKeyInfo SubjectPublicKeyInfo,
-     attributes [0] IMPLICIT Attributes }
+ * CertificationRequestInfo ::= SEQUENCE {
+ *   version Version,
+ *   subject Name,
+ *   subjectPublicKeyInfo SubjectPublicKeyInfo,
+ *   attributes [0] IMPLICIT Attributes }
+ *
+ * Version ::= INTEGER
+ *
+ * Attributes ::= SET OF Attribute
+ */
+public final class CertificationRequestInfo {
+    private final int version;
 
-   Version ::= INTEGER
+    /** the value of subject field of the structure */
+    private final Name subject;
 
-   Attributes ::= SET OF Attribute
-*/
+    /** the value of subjectPublicKeyInfo field of the structure */
+    private final SubjectPublicKeyInfo subjectPublicKeyInfo;
 
-public class CertificationRequestInfo {
-    // version
-    private int version;
+    /** the value of attributes field of the structure */
+    private final List<?> attributes;
 
-    // the value of subject field of the structure
-    private Name subject;
+    /** the ASN.1 encoded form of CertificationRequestInfo */
+    private byte[] encoding;
 
-    // the value of subjectPublicKeyInfo field of the structure
-    private SubjectPublicKeyInfo subjectPublicKeyInfo;
-
-    // the value of attributes field of the structure
-    private List attributes;
-
-    // the ASN.1 encoded form of CertificationRequestInfo
-    private byte [] encoding;
-
-    public CertificationRequestInfo(int version, Name subject,
-            SubjectPublicKeyInfo subjectPublicKeyInfo, List attributes) {
+    private CertificationRequestInfo(int version, Name subject,
+            SubjectPublicKeyInfo subjectPublicKeyInfo, List<?> attributes, byte [] encoding) {
         this.version = version;
         this.subject = subject;
         this.subjectPublicKeyInfo = subjectPublicKeyInfo;
         this.attributes = attributes;
-    }
-
-    // private constructor with encoding given
-    private CertificationRequestInfo(int version, Name subject,
-            SubjectPublicKeyInfo subjectPublicKeyInfo, List attributes, byte [] encoding) {
-        this(version, subject, subjectPublicKeyInfo, attributes);
         this.encoding = encoding;
     }
 
-    /**
-     * @return Returns the attributes.
-     */
-    public List getAttributes() {
-        return attributes;
-    }
-
-    /**
-     * @return Returns the subject.
-     */
     public Name getSubject() {
         return subject;
     }
 
-    /**
-     * @return Returns the subjectPublicKeyInfo.
-     */
-    public SubjectPublicKeyInfo getSubjectPublicKeyInfo() {
-        return subjectPublicKeyInfo;
-    }
-
-    /**
-     * @return Returns the version.
-     */
     public int getVersion() {
         return version;
     }
@@ -111,8 +83,7 @@
         return encoding;
     }
 
-
-    public String toString() {
+    @Override public String toString() {
         StringBuilder res = new StringBuilder();
         res.append("-- CertificationRequestInfo:");
         res.append("\n version: ");
@@ -120,9 +91,9 @@
         res.append("\n subject: ");
         res.append(subject.getName(X500Principal.CANONICAL));
         res.append("\n subjectPublicKeyInfo: ");
-        res.append("\n\t algorithm: "
-                + subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm());
-        res.append("\n\t public key: " + subjectPublicKeyInfo.getPublicKey());
+        res.append("\n\t algorithm: ");
+        res.append(subjectPublicKeyInfo.getAlgorithmIdentifier().getAlgorithm());
+        res.append("\n\t public key: ").append(subjectPublicKeyInfo.getPublicKey());
         res.append("\n attributes: ");
         if (attributes != null) {
             res.append(attributes.toString());
@@ -141,25 +112,23 @@
                     AttributeTypeAndValue.ASN1))    // attributes
             }) {
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new CertificationRequestInfo(
                     ASN1Integer.toIntValue(values[0]),
                     (Name) values[1],
                     (SubjectPublicKeyInfo) values[2],
-                    (List) values[3],
+                    (List<?>) values[3],
                     in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             CertificationRequestInfo certReqInfo = (CertificationRequestInfo) object;
-
             values[0] = ASN1Integer.fromIntValue(certReqInfo.version);
             values[1] = certReqInfo.subject;
             values[2] = certReqInfo.subjectPublicKeyInfo;
             values[3] = certReqInfo.attributes;
         }
     };
-
 }
 
diff --git a/luni/src/main/java/org/apache/harmony/security/pkcs7/AuthenticatedAttributes.java b/luni/src/main/java/org/apache/harmony/security/pkcs7/AuthenticatedAttributes.java
index 5483aec..5a08a16 100644
--- a/luni/src/main/java/org/apache/harmony/security/pkcs7/AuthenticatedAttributes.java
+++ b/luni/src/main/java/org/apache/harmony/security/pkcs7/AuthenticatedAttributes.java
@@ -27,26 +27,26 @@
 import org.apache.harmony.security.x501.AttributeTypeAndValue;
 
 /**
- *
  * As defined in PKCS #7: Cryptographic Message Syntax Standard
  * (http://www.ietf.org/rfc/rfc2315.txt):
  * authenticatedAttributes is a set of attributes that are signed (i.e., authenticated) by the signer
  */
-class AuthenticatedAttributes {
+final class AuthenticatedAttributes {
     private byte[] encoding;
-    private List authenticatedAttributes;
+    private final List<AttributeTypeAndValue> authenticatedAttributes;
 
-    public AuthenticatedAttributes(byte[] encoding, List authenticatedAttributes) {
+    private AuthenticatedAttributes(byte[] encoding,
+            List<AttributeTypeAndValue> authenticatedAttributes) {
         this.encoding = encoding;
         this.authenticatedAttributes = authenticatedAttributes;
     }
-    public List getAttributes() {
+
+    public List<AttributeTypeAndValue> getAttributes() {
         return authenticatedAttributes;
     }
 
     /**
      * Returns ASN.1 encoded form of this authenticatedAttributes.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -57,9 +57,9 @@
 
     public static final ASN1SetOf ASN1 =
         new ASN1SetOf(AttributeTypeAndValue.ASN1) {
-        public Object getDecodedObject(BerInputStream in) {
+        @Override public Object getDecodedObject(BerInputStream in) {
             return new AuthenticatedAttributes(in.getEncoded(),
-                    (List) in.content);
+                    (List<AttributeTypeAndValue>) in.content);
         }
     };
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/pkcs7/ContentInfo.java b/luni/src/main/java/org/apache/harmony/security/pkcs7/ContentInfo.java
index fbe06a6..c8d3076 100644
--- a/luni/src/main/java/org/apache/harmony/security/pkcs7/ContentInfo.java
+++ b/luni/src/main/java/org/apache/harmony/security/pkcs7/ContentInfo.java
@@ -40,8 +40,7 @@
  *       content      [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL
  *     }
  */
-
-public class ContentInfo {
+public final class ContentInfo {
 
     // OIDs
     public static final int[] DATA = new int[] {1, 2, 840, 113549, 1, 7, 1};
@@ -51,15 +50,10 @@
     public static final int[] DIGESTED_DATA = new int[] {1, 2, 840, 113549, 1, 7, 5};
     public static final int[] ENCRYPTED_DATA = new int[] {1, 2, 840, 113549, 1, 7, 6};
 
-    private int[] oid;
-    private Object content;
+    private final int[] oid;
+    private final Object content;
     private byte[] encoding;
 
-    public ContentInfo(int[] oid, Object content) {
-        this.oid = oid;
-        this.content = content;
-    }
-
     private ContentInfo(int[] oid, Object content, byte[] encoding) {
         this.oid = oid;
         this.content = content;
@@ -91,12 +85,12 @@
         return encoding;
     }
 
-    public String toString() {
+    @Override public String toString() {
         StringBuilder res = new StringBuilder();
         res.append("==== ContentInfo:");
         res.append("\n== ContentType (OID): ");
-        for (int i = 0; i< oid.length; i++) {
-            res.append(oid[i]);
+        for (int i : oid) {
+            res.append(i);
             res.append(' ');
         }
         res.append("\n== Content: ");
@@ -118,7 +112,7 @@
             setOptional(1); // content is optional
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             ContentInfo ci = (ContentInfo) object;
             values[0] = ci.oid;
             if (ci.content != null) {
@@ -135,7 +129,7 @@
             }
         }
 
-        protected Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override protected Object getDecodedObject(BerInputStream in) throws IOException {
             Object[] values = (Object[]) in.content;
             int[] oid = (int[]) values[0];
             if (Arrays.equals(oid, DATA)) {
@@ -153,8 +147,7 @@
                         SignedData.ASN1.decode((byte[])values[1]),
                         in.getEncoded());
             }
-            return new ContentInfo((int[])values[0], (byte[])values[1],
-                    in.getEncoded());
+            return new ContentInfo((int[]) values[0], values[1], in.getEncoded());
         }
    };
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/pkcs7/SignedData.java b/luni/src/main/java/org/apache/harmony/security/pkcs7/SignedData.java
index 69156fe..eaf245c 100644
--- a/luni/src/main/java/org/apache/harmony/security/pkcs7/SignedData.java
+++ b/luni/src/main/java/org/apache/harmony/security/pkcs7/SignedData.java
@@ -46,21 +46,18 @@
  *   crls
  *     [1] IMPLICIT CertificateRevocationLists OPTIONAL,
  *   signerInfos SignerInfos }
- *
  */
+public final class SignedData {
+    private final int version;
+    private final List<?> digestAlgorithms;
+    private final ContentInfo contentInfo;
+    private final List<Certificate> certificates;
+    private final List<CertificateList> crls;
+    private final List<SignerInfo> signerInfos;
 
-public class SignedData {
-
-    private int version;
-
-    private List digestAlgorithms;
-    private ContentInfo contentInfo;
-    private List certificates;
-    private List crls;
-    private List signerInfos;
-
-    public SignedData(int version, List digestAlgorithms, ContentInfo contentInfo,
-            List certificates, List crls, List signerInfos) {
+    private SignedData(int version, List<?> digestAlgorithms, ContentInfo contentInfo,
+            List<Certificate> certificates, List<CertificateList> crls,
+            List<SignerInfo> signerInfos) {
         this.version = version;
         this.digestAlgorithms = digestAlgorithms;
         this.contentInfo = contentInfo;
@@ -69,40 +66,23 @@
         this.signerInfos = signerInfos;
     }
 
-    public List getCertificates() {
+    public List<Certificate> getCertificates() {
         return certificates;
     }
 
-    public List getCRLs() {
+    public List<CertificateList> getCRLs() {
         return crls;
     }
 
-    public List getSignerInfos() {
+    public List<SignerInfo> getSignerInfos() {
         return signerInfos;
     }
 
-    /**
-     * @return Returns the contentInfo.
-     */
-    public ContentInfo getContentInfo() {
-        return contentInfo;
-    }
-
-    /**
-     * @return Returns the digestAlgorithms.
-     */
-    public List getDigestAlgorithms() {
-        return digestAlgorithms;
-    }
-
-    /**
-     * @return Returns the version.
-     */
     public int getVersion() {
         return version;
     }
 
-    public String toString() {
+    @Override public String toString() {
         StringBuilder res = new StringBuilder();
         res.append("---- SignedData:");
         res.append("\nversion: ");
@@ -138,7 +118,7 @@
             setOptional(4); // crls is optional
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             SignedData sd = (SignedData) object;
             values[0] = new byte[] {(byte)sd.version};
             values[1] = sd.digestAlgorithms;
@@ -148,15 +128,15 @@
             values[5] = sd.signerInfos;
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new SignedData(
                         ASN1Integer.toIntValue(values[0]),
-                        (List) values[1],
+                        (List<?>) values[1],
                         (ContentInfo) values[2],
-                        (List) values[3],
-                        (List) values[4],
-                        (List) values[5]
+                        (List<Certificate>) values[3],
+                        (List<CertificateList>) values[4],
+                        (List<SignerInfo>) values[5]
                     );
         }
     };
diff --git a/luni/src/main/java/org/apache/harmony/security/pkcs7/SignerInfo.java b/luni/src/main/java/org/apache/harmony/security/pkcs7/SignerInfo.java
index aa40fdd..baaa090 100644
--- a/luni/src/main/java/org/apache/harmony/security/pkcs7/SignerInfo.java
+++ b/luni/src/main/java/org/apache/harmony/security/pkcs7/SignerInfo.java
@@ -53,33 +53,27 @@
  *   unauthenticatedAttributes
  *     [1] IMPLICIT Attributes OPTIONAL
  *  }
- *
  */
-public class SignerInfo {
+public final class SignerInfo {
+    private final int version;
+    private final X500Principal issuer;
+    private final BigInteger serialNumber;
+    private final AlgorithmIdentifier digestAlgorithm;
+    private final AuthenticatedAttributes authenticatedAttributes;
+    private final AlgorithmIdentifier digestEncryptionAlgorithm;
+    private final byte[] encryptedDigest;
+    private final List<?> unauthenticatedAttributes;
 
-    private int version;
-    private X500Principal issuer;
-    private BigInteger serialNumber;
-
-    private AlgorithmIdentifier digestAlgorithm;
-    private AuthenticatedAttributes authenticatedAttributes;
-    private AlgorithmIdentifier digestEncryptionAlgorithm;
-    private byte[] encryptedDigest;
-    private List unauthenticatedAttributes;
-
-    public SignerInfo(int version,
+    private SignerInfo(int version,
             Object[] issuerAndSerialNumber,
             AlgorithmIdentifier digestAlgorithm,
             AuthenticatedAttributes authenticatedAttributes,
             AlgorithmIdentifier digestEncryptionAlgorithm,
             byte[] encryptedDigest,
-            List unauthenticatedAttributes
-            ) {
+            List<?> unauthenticatedAttributes) {
         this.version = version;
         this.issuer = ((Name)issuerAndSerialNumber[0]).getX500Principal();
-        // BEGIN android-changed
         this.serialNumber = ASN1Integer.toBigIntegerValue(issuerAndSerialNumber[1]);
-        // END android-changed
         this.digestAlgorithm = digestAlgorithm;
         this.authenticatedAttributes = authenticatedAttributes;
         this.digestEncryptionAlgorithm = digestEncryptionAlgorithm;
@@ -99,15 +93,11 @@
         return digestAlgorithm.getAlgorithm();
     }
 
-    public String getdigestAlgorithm() {
-        return digestAlgorithm.getAlgorithm();
-    }
-
     public String getDigestEncryptionAlgorithm() {
         return digestEncryptionAlgorithm.getAlgorithm();
     }
 
-    public List getAuthenticatedAttributes() {
+    public List<AttributeTypeAndValue> getAuthenticatedAttributes() {
         if (authenticatedAttributes == null) {
             return null;
         }
@@ -159,7 +149,7 @@
             })
         {
             // method to encode
-            public void getValues(Object object, Object[] values) {
+            @Override public void getValues(Object object, Object[] values) {
                 Object [] issAndSerial = (Object[])object;
                 values[0] = issAndSerial[0];
                 values[1] = issAndSerial[1];
@@ -182,7 +172,7 @@
             setOptional(6); // unauthenticatedAttributes is optional
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             SignerInfo si = (SignerInfo) object;
             values[0] = new byte[] {(byte)si.version};
             try {
@@ -201,7 +191,7 @@
             values[6] = si.unauthenticatedAttributes;
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new SignerInfo(
                         ASN1Integer.toIntValue(values[0]),
diff --git a/luni/src/main/java/org/apache/harmony/security/pkcs8/PrivateKeyInfo.java b/luni/src/main/java/org/apache/harmony/security/pkcs8/PrivateKeyInfo.java
index be7e3b3..400bf86 100644
--- a/luni/src/main/java/org/apache/harmony/security/pkcs8/PrivateKeyInfo.java
+++ b/luni/src/main/java/org/apache/harmony/security/pkcs8/PrivateKeyInfo.java
@@ -47,22 +47,15 @@
  *
  *  Attributes ::= SET OF Attribute
  */
-
-public class PrivateKeyInfo {
-
-    private int version;
-
-    private AlgorithmIdentifier privateKeyAlgorithm;
-
-    private byte[] privateKey;
-
-    private List attributes;
-
+public final class PrivateKeyInfo {
+    private final int version;
+    private final AlgorithmIdentifier privateKeyAlgorithm;
+    private final byte[] privateKey;
+    private final List<?> attributes;
     private byte[] encoding;
 
     public PrivateKeyInfo(int version, AlgorithmIdentifier privateKeyAlgorithm,
             byte[] privateKey, List attributes) {
-
         this.version = version;
         this.privateKeyAlgorithm = privateKeyAlgorithm;
         this.privateKey = privateKey;
@@ -76,29 +69,20 @@
         this.encoding = encoding;
     }
 
-    /**
-     * @return Returns version.
-     */
     public int getVersion() {
         return version;
     }
 
-    /**
-     * @return Returns AlgorithmIdentifier.
-     */
     public AlgorithmIdentifier getAlgorithmIdentifier() {
         return privateKeyAlgorithm;
     }
 
-    /**
-     * @return Returns List of attributes.
-     */
     public List getAttributes() {
         return attributes;
     }
 
     /**
-     * @return Returns the OCTET STRING.
+     * Returns the OCTET STRING.
      */
     public byte[] getPrivateKey() {
         return privateKey;
@@ -106,7 +90,6 @@
 
     /**
      * Returns ASN.1 encoded form of this PrivateKeyInfo.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -129,23 +112,18 @@
         }
 
         protected Object getDecodedObject(BerInputStream in) {
-
             Object[] values = (Object[]) in.content;
-
             return new PrivateKeyInfo(ASN1Integer.toIntValue(values[0]),
                     (AlgorithmIdentifier) values[1], (byte[]) values[2],
                     (List) values[3], in.getEncoded());
         }
 
         protected void getValues(Object object, Object[] values) {
-
             PrivateKeyInfo privateKeyInfo = (PrivateKeyInfo) object;
-
             values[0] = ASN1Integer.fromIntValue(privateKeyInfo.version);
             values[1] = privateKeyInfo.privateKeyAlgorithm;
             values[2] = privateKeyInfo.privateKey;
             values[3] = privateKeyInfo.attributes;
         }
     };
-
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/cert/Cache.java b/luni/src/main/java/org/apache/harmony/security/provider/cert/Cache.java
index f3dd402..a2c5b4c 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/cert/Cache.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/cert/Cache.java
@@ -138,25 +138,6 @@
         cache = new Object[cache_size];
     }
 
-    // BEGIN android-removed
-    // /**
-    //  * Creates the Cache object of size of 900.
-    //  * @param pref_size specifies how many leading/trailing bytes of object's
-    //  * encoded form will be used for hash computation
-    //  */
-    // public Cache(int pref_size) {
-    //     this(pref_size, 900);
-    // }
-    //
-    // /**
-    //  * Creates the Cache object of size of 900.
-    //  */
-    // public Cache() {
-    //     this(28, 900);
-    // }
-    // END android-removed
-
-    // BEGIN android-added
     /**
      * Creates the Cache object of size of 9.
      * @param pref_size specifies how many leading/trailing bytes of object's
@@ -172,7 +153,6 @@
     public Cache() {
         this(28, 9);
     }
-    // END android-added
 
     /**
      * Returns the hash code for the array. This code is used to
@@ -342,4 +322,3 @@
     }
 
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/cert/DRLCertFactory.java b/luni/src/main/java/org/apache/harmony/security/provider/cert/DRLCertFactory.java
index a4537e8..790be67 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/cert/DRLCertFactory.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/cert/DRLCertFactory.java
@@ -22,16 +22,9 @@
 
 package org.apache.harmony.security.provider.cert;
 
-import java.security.AccessController;
 import java.security.Provider;
 
-
-/**
- * Master class (provider) for X509 Certificate Factory
- * Implementation.
- */
 public final class DRLCertFactory extends Provider {
-
     /**
      * @serial
      */
@@ -42,22 +35,10 @@
      */
     public DRLCertFactory() {
         // specification of the provider name, version, and description.
-
-        // BEGIN android-changed
-        // Avoid using a message resource string here, since it forces loading
-        // all the messages in a non-error context.
         super("DRLCertFactory", 1.0, "ASN.1, DER, PkiPath, PKCS7");
-        // END android-changed
-
-        AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
-            public Void run() {
-                // register the service
-                put("CertificateFactory.X509",
-                    "org.apache.harmony.security.provider.cert.X509CertFactoryImpl");
-                // mapping the alias
-                put("Alg.Alias.CertificateFactory.X.509", "X509");
-                    return null;
-            }
-        });
+        // register the service
+        put("CertificateFactory.X509", "org.apache.harmony.security.provider.cert.X509CertFactoryImpl");
+        // mapping the alias
+        put("Alg.Alias.CertificateFactory.X.509", "X509");
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertFactoryImpl.java b/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertFactoryImpl.java
index 0b1f797..ac76a89 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertFactoryImpl.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertFactoryImpl.java
@@ -36,6 +36,7 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
+import libcore.io.Streams;
 import org.apache.harmony.luni.util.Base64;
 import org.apache.harmony.security.asn1.ASN1Constants;
 import org.apache.harmony.security.asn1.BerInputStream;
@@ -124,7 +125,7 @@
         if (inStream == null) {
             throw new CertificateException("inStream == null");
         }
-        ArrayList result = new ArrayList();
+        ArrayList<Certificate> result = new ArrayList<Certificate>();
         try {
             if (!inStream.markSupported()) {
                 // create the mark supporting wrapper
@@ -210,12 +211,10 @@
                 if (data == null) {
                     throw new CertificateException("Invalid PKCS7 data provided");
                 }
-                List certs = data.getCertificates();
+                List<org.apache.harmony.security.x509.Certificate> certs = data.getCertificates();
                 if (certs != null) {
-                    for (int i = 0; i < certs.size(); i++) {
-                        result.add(new X509CertImpl(
-                            (org.apache.harmony.security.x509.Certificate)
-                                certs.get(i)));
+                    for (org.apache.harmony.security.x509.Certificate cert : certs) {
+                        result.add(new X509CertImpl(cert));
                     }
                 }
                 return result;
@@ -267,7 +266,7 @@
         if (inStream == null) {
             throw new CRLException("inStream == null");
         }
-        ArrayList result = new ArrayList();
+        ArrayList<CRL> result = new ArrayList<CRL>();
         try {
             if (!inStream.markSupported()) {
                 inStream = new RestoringInputStream(inStream);
@@ -351,11 +350,10 @@
                 if (data == null) {
                     throw new CRLException("Invalid PKCS7 data provided");
                 }
-                List crls = data.getCRLs();
+                List<CertificateList> crls = data.getCRLs();
                 if (crls != null) {
-                    for (int i = 0; i < crls.size(); i++) {
-                        result.add(new X509CRLImpl(
-                            (CertificateList) crls.get(i)));
+                    for (CertificateList crl : crls) {
+                        result.add(new X509CRLImpl(crl));
                     }
                 }
                 return result;
@@ -645,7 +643,7 @@
                 if (encoding.length < CERT_CACHE_SEED_LENGTH) {
                     throw new CertificateException("Bad Certificate encoding");
                 }
-                inStream.read(encoding);
+                Streams.readFully(inStream, encoding);
                 Certificate res = (Certificate) CERT_CACHE.get(hash, encoding);
                 if (res != null) {
                     return res;
@@ -716,7 +714,7 @@
                 if (encoding.length < CRL_CACHE_SEED_LENGTH) {
                     throw new CRLException("Bad CRL encoding");
                 }
-                inStream.read(encoding);
+                Streams.readFully(inStream, encoding);
                 CRL res = (CRL) CRL_CACHE.get(hash, encoding);
                 if (res != null) {
                     return res;
@@ -834,11 +832,6 @@
         }
 
         @Override
-        public int read(byte[] b) throws IOException {
-            return read(b, 0, b.length);
-        }
-
-        @Override
         public int read(byte[] b, int off, int len) throws IOException {
             int read_b;
             int i;
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertImpl.java b/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertImpl.java
index d8f79bc..776677e 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertImpl.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertImpl.java
@@ -60,14 +60,12 @@
  * @see org.apache.harmony.security.x509.Certificate
  * @see java.security.cert.X509Certificate
  */
-public class X509CertImpl extends X509Certificate {
+public final class X509CertImpl extends X509Certificate {
 
-    /**
-     * @serial
-     */
+    /** @serial */
     private static final long serialVersionUID = 2972248729446736154L;
 
-    // the core object to be wrapped in X509Certificate
+    /** the core object to be wrapped in X509Certificate */
     private final Certificate certificate;
 
     // to speed up access to the info, the following fields
@@ -139,19 +137,11 @@
     // ----------------- Public methods implementations ------------------
     //
 
-    /**
-     * @see java.security.cert.X509Certificate#checkValidity()
-     * method documentation for more information.
-     */
     public void checkValidity()
             throws CertificateExpiredException, CertificateNotYetValidException {
         checkValidity(System.currentTimeMillis());
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#checkValidity(Date)
-     * method documentation for more information.
-     */
     public void checkValidity(Date date)
             throws CertificateExpiredException, CertificateNotYetValidException {
         checkValidity(date.getTime());
@@ -169,18 +159,10 @@
         }
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getVersion()
-     * method documentation for more information.
-     */
     public int getVersion() {
         return tbsCert.getVersion() + 1;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSerialNumber()
-     * method documentation for more information.
-     */
     public BigInteger getSerialNumber() {
         BigInteger result = serialNumber;
         if (result == null) {
@@ -189,18 +171,10 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getIssuerDN()
-     * method documentation for more information.
-     */
     public Principal getIssuerDN() {
         return getIssuerX500Principal();
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getIssuerX500Principal()
-     * method documentation for more information.
-     */
     public X500Principal getIssuerX500Principal() {
         X500Principal result = issuer;
         if (result == null) {
@@ -210,18 +184,10 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSubjectDN()
-     * method documentation for more information.
-     */
     public Principal getSubjectDN() {
         return getSubjectX500Principal();
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSubjectX500Principal()
-     * method documentation for more information.
-     */
     public X500Principal getSubjectX500Principal() {
         X500Principal result = subject;
         if (result == null) {
@@ -231,13 +197,10 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getNotBefore()
-     * method documentation for more information.
-     */
     public Date getNotBefore() {
         return new Date(getNotBeforeInternal());
     }
+
     private long getNotBeforeInternal() {
         long result = notBefore;
         if (result == -1) {
@@ -246,13 +209,10 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getNotAfter()
-     * method documentation for more information.
-     */
     public Date getNotAfter() {
         return new Date(getNotAfterInternal());
     }
+
     private long getNotAfterInternal() {
         long result = notAfter;
         if (result == -1) {
@@ -261,13 +221,10 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getTBSCertificate()
-     * method documentation for more information.
-     */
     public byte[] getTBSCertificate() throws CertificateEncodingException {
         return getTbsCertificateInternal().clone();
     }
+
     private byte[] getTbsCertificateInternal() {
         byte[] result = tbsCertificate;
         if (result == null) {
@@ -276,13 +233,10 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSignature()
-     * method documentation for more information.
-     */
     public byte[] getSignature() {
         return getSignatureInternal().clone();
     }
+
     private byte[] getSignatureInternal() {
         byte[] result = signature;
         if (result == null) {
@@ -291,10 +245,6 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSigAlgName()
-     * method documentation for more information.
-     */
     public String getSigAlgName() {
         String result = sigAlgName;
         if (result == null) {
@@ -310,10 +260,6 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSigAlgOID()
-     * method documentation for more information.
-     */
     public String getSigAlgOID() {
         String result = sigAlgOID;
         if (result == null) {
@@ -323,10 +269,6 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSigAlgParams()
-     * method documentation for more information.
-     */
     public byte[] getSigAlgParams() {
         if (nullSigAlgParams) {
             return null;
@@ -343,26 +285,14 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getIssuerUniqueID()
-     * method documentation for more information.
-     */
     public boolean[] getIssuerUniqueID() {
         return tbsCert.getIssuerUniqueID();
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSubjectUniqueID()
-     * method documentation for more information.
-     */
     public boolean[] getSubjectUniqueID() {
         return tbsCert.getSubjectUniqueID();
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getKeyUsage()
-     * method documentation for more information.
-     */
     public boolean[] getKeyUsage() {
         if (extensions == null) {
             return null;
@@ -370,11 +300,7 @@
         return extensions.valueOfKeyUsage();
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getExtendedKeyUsage()
-     * method documentation for more information.
-     */
-    public List/*<String>*/ getExtendedKeyUsage()
+    public List<String> getExtendedKeyUsage()
                                 throws CertificateParsingException {
         if (extensions == null) {
             return null;
@@ -386,10 +312,6 @@
         }
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getBasicConstraints()
-     * method documentation for more information.
-     */
     public int getBasicConstraints() {
         if (extensions == null) {
             return Integer.MAX_VALUE;
@@ -397,12 +319,7 @@
         return extensions.valueOfBasicConstrains();
     }
 
-    /**
-     * @see java.security.cert.X509Certificate#getSubjectAlternativeNames()
-     * method documentation for more information.
-     */
-    public Collection/*<List<?>>*/ getSubjectAlternativeNames()
-                                throws CertificateParsingException {
+    public Collection<List<?>> getSubjectAlternativeNames() throws CertificateParsingException {
         if (extensions == null) {
             return null;
         }
@@ -420,8 +337,7 @@
      * @see java.security.cert.X509Certificate#getIssuerAlternativeNames()
      * method documentation for more information.
      */
-    public Collection/*FIXME <List<?>>*/ getIssuerAlternativeNames()
-                                throws CertificateParsingException {
+    public Collection<List<?>> getIssuerAlternativeNames() throws CertificateParsingException {
         if (extensions == null) {
             return null;
         }
@@ -439,10 +355,6 @@
     // ----- java.security.cert.Certificate methods implementations ------
     //
 
-    /**
-     * @see java.security.cert.Certificate#getEncoded()
-     * method documentation for more information.
-     */
     public byte[] getEncoded() throws CertificateEncodingException {
         return getEncodedInternal().clone();
     }
@@ -454,10 +366,6 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.Certificate#getPublicKey()
-     * method documentation for more information.
-     */
     public PublicKey getPublicKey() {
         PublicKey result = publicKey;
         if (result == null) {
@@ -466,19 +374,10 @@
         return result;
     }
 
-    /**
-     * @see java.security.cert.Certificate#toString()
-     * method documentation for more information.
-     */
     public String toString() {
         return certificate.toString();
     }
 
-    /**
-     * Verifies the signature of the certificate.
-     * @see java.security.cert.Certificate#verify(PublicKey)
-     * method documentation for more information.
-     */
     public void verify(PublicKey key)
                          throws CertificateException, NoSuchAlgorithmException,
                                 InvalidKeyException, NoSuchProviderException,
@@ -499,11 +398,6 @@
         }
     }
 
-    /**
-     * Verifies the signature of the certificate.
-     * @see java.security.cert.Certificate#verify(PublicKey,String)
-     * method documentation for more information.
-     */
     public void verify(PublicKey key, String sigProvider)
                          throws CertificateException, NoSuchAlgorithmException,
                                 InvalidKeyException, NoSuchProviderException,
@@ -528,7 +422,7 @@
     /**
      * Implements a faster RSA verification method that delegates to OpenSSL
      * native code. In all other aspects it behaves just like the ordinary
-     * {@link verify} method.
+     * {@link #verify} method.
      *
      * @param key The RSA public key to use
      *
@@ -567,11 +461,7 @@
     // ----- java.security.cert.X509Extension methods implementations ----
     //
 
-    /**
-     * @see java.security.cert.X509Extension#getNonCriticalExtensionOIDs()
-     * method documentation for more information.
-     */
-    public Set getNonCriticalExtensionOIDs() {
+    public Set<String> getNonCriticalExtensionOIDs() {
         if (extensions == null) {
             return null;
         }
@@ -579,11 +469,7 @@
         return extensions.getNonCriticalExtensions();
     }
 
-    /**
-     * @see java.security.cert.X509Extension#getCriticalExtensionOIDs()
-     * method documentation for more information.
-     */
-    public Set getCriticalExtensionOIDs() {
+    public Set<String> getCriticalExtensionOIDs() {
         if (extensions == null) {
             return null;
         }
@@ -591,10 +477,6 @@
         return extensions.getCriticalExtensions();
     }
 
-    /**
-     * @see java.security.cert.X509Extension#getExtensionValue(String)
-     * method documentation for more information.
-     */
     public byte[] getExtensionValue(String oid) {
         if (extensions == null) {
             return null;
@@ -604,10 +486,6 @@
         return (ext == null) ? null : ext.getRawExtnValue();
     }
 
-    /**
-     * @see java.security.cert.X509Extension#hasUnsupportedCriticalExtension()
-     * method documentation for more information.
-     */
     public boolean hasUnsupportedCriticalExtension() {
         if (extensions == null) {
             return false;
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertPathImpl.java b/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertPathImpl.java
index e961d1f..b65d345 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertPathImpl.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/cert/X509CertPathImpl.java
@@ -171,14 +171,14 @@
                     throw new CertificateException(
                             "Incorrect PKCS7 encoded form: missing signed data");
                 }
-                List certs = sd.getCertificates();
+                List<Certificate> certs = sd.getCertificates();
                 if (certs == null) {
                     // empty chain of certificates
-                    certs = new ArrayList();
+                    certs = new ArrayList<Certificate>();
                 }
-                List result = new ArrayList();
-                for (int i=0; i<certs.size(); i++) {
-                    result.add(new X509CertImpl((Certificate) certs.get(i)));
+                List<X509CertImpl> result = new ArrayList<X509CertImpl>();
+                for (Certificate cert : certs) {
+                    result.add(new X509CertImpl(cert));
                 }
                 return new X509CertPathImpl(result, PKCS7, ci.getEncoded());
             }
@@ -224,13 +224,13 @@
                 if (sd == null) {
                     throw new CertificateException("Incorrect PKCS7 encoded form: missing signed data");
                 }
-                List certs = sd.getCertificates();
+                List<Certificate> certs = sd.getCertificates();
                 if (certs == null) {
-                    certs = new ArrayList();
+                    certs = new ArrayList<Certificate>();
                 }
-                List result = new ArrayList();
-                for (int i=0; i<certs.size(); i++) {
-                    result.add(new X509CertImpl((Certificate) certs.get(i)));
+                List<X509CertImpl> result = new ArrayList<X509CertImpl>();
+                for (Certificate cert : certs) {
+                    result.add(new X509CertImpl(cert));
                 }
                 return new X509CertPathImpl(result, PKCS7, ci.getEncoded());
             }
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java
index 8e3774b..70a2449 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/CryptoProvider.java
@@ -17,7 +17,6 @@
 
 package org.apache.harmony.security.provider.crypto;
 
-import java.security.AccessController;
 import java.security.Provider;
 
 /**
@@ -38,8 +37,7 @@
      */
     public CryptoProvider() {
 
-        super("Crypto", 1.0,
-                "HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)");
+        super("Crypto", 1.0, "HARMONY (SHA1 digest; SecureRandom; SHA1withDSA signature)");
 
         //  names of classes implementing services
         final String MD_NAME = "org.apache.harmony.security.provider.crypto.SHA1_MessageDigestImpl";
@@ -50,45 +48,36 @@
         final String SIGN_ALIAS = "SHA1withDSA";
 
 
-        final String KEYF_NAME =
-                 "org.apache.harmony.security.provider.crypto.DSAKeyFactoryImpl";
+        final String KEYF_NAME = "org.apache.harmony.security.provider.crypto.DSAKeyFactoryImpl";
 
-        AccessController.doPrivileged(new java.security.PrivilegedAction<Void>() {
+        put("MessageDigest.SHA-1", MD_NAME);
+        put("MessageDigest.SHA-1 ImplementedIn", "Software");
+        put("Alg.Alias.MessageDigest.SHA1", "SHA-1");
+        put("Alg.Alias.MessageDigest.SHA", "SHA-1");
 
-            public Void run() {
+        if (RandomBitsSupplier.isServiceAvailable()) {
+            put("SecureRandom.SHA1PRNG", SR_NAME);
+            put("SecureRandom.SHA1PRNG ImplementedIn", "Software");
+        }
 
-                put("MessageDigest.SHA-1", MD_NAME);
-                put("MessageDigest.SHA-1 ImplementedIn", "Software");
-                put("Alg.Alias.MessageDigest.SHA1", "SHA-1");
-                put("Alg.Alias.MessageDigest.SHA", "SHA-1");
+        put("Signature.SHA1withDSA", SIGN_NAME);
+        put("Signature.SHA1withDSA ImplementedIn", "Software");
+        put("Alg.Alias.Signature.SHAwithDSA", SIGN_ALIAS);
+        put("Alg.Alias.Signature.DSAwithSHA1", SIGN_ALIAS);
+        put("Alg.Alias.Signature.SHA1/DSA", SIGN_ALIAS);
+        put("Alg.Alias.Signature.SHA/DSA", SIGN_ALIAS);
+        put("Alg.Alias.Signature.SHA-1/DSA", SIGN_ALIAS);
+        put("Alg.Alias.Signature.DSA", SIGN_ALIAS);
+        put("Alg.Alias.Signature.DSS", SIGN_ALIAS);
 
-                if (RandomBitsSupplier.isServiceAvailable()) {
-                    put("SecureRandom.SHA1PRNG", SR_NAME);
-                    put("SecureRandom.SHA1PRNG ImplementedIn", "Software");
-                }
+        put("Alg.Alias.Signature.OID.1.2.840.10040.4.3", SIGN_ALIAS);
+        put("Alg.Alias.Signature.1.2.840.10040.4.3", SIGN_ALIAS);
+        put("Alg.Alias.Signature.1.3.14.3.2.13", SIGN_ALIAS);
+        put("Alg.Alias.Signature.1.3.14.3.2.27", SIGN_ALIAS);
 
-                put("Signature.SHA1withDSA", SIGN_NAME);
-                put("Signature.SHA1withDSA ImplementedIn", "Software");
-                put("Alg.Alias.Signature.SHAwithDSA", SIGN_ALIAS);
-                put("Alg.Alias.Signature.DSAwithSHA1", SIGN_ALIAS);
-                put("Alg.Alias.Signature.SHA1/DSA", SIGN_ALIAS);
-                put("Alg.Alias.Signature.SHA/DSA", SIGN_ALIAS);
-                put("Alg.Alias.Signature.SHA-1/DSA", SIGN_ALIAS);
-                put("Alg.Alias.Signature.DSA", SIGN_ALIAS);
-                put("Alg.Alias.Signature.DSS", SIGN_ALIAS);
-
-                put("Alg.Alias.Signature.OID.1.2.840.10040.4.3", SIGN_ALIAS);
-                put("Alg.Alias.Signature.1.2.840.10040.4.3", SIGN_ALIAS);
-                put("Alg.Alias.Signature.1.3.14.3.2.13", SIGN_ALIAS);
-                put("Alg.Alias.Signature.1.3.14.3.2.27", SIGN_ALIAS);
-
-                put("KeyFactory.DSA", KEYF_NAME);
-                put("KeyFactory.DSA ImplementedIn", "Software");
-                put("Alg.Alias.KeyFactory.1.3.14.3.2.12", "DSA");
-                put("Alg.Alias.KeyFactory.1.2.840.10040.4.1", "DSA");
-
-                return null;
-            }
-        });
+        put("KeyFactory.DSA", KEYF_NAME);
+        put("KeyFactory.DSA ImplementedIn", "Software");
+        put("Alg.Alias.KeyFactory.1.3.14.3.2.12", "DSA");
+        put("Alg.Alias.KeyFactory.1.2.840.10040.4.1", "DSA");
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/RandomBitsSupplier.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/RandomBitsSupplier.java
index 993914a..3862132 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/crypto/RandomBitsSupplier.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/RandomBitsSupplier.java
@@ -23,10 +23,8 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.security.AccessController;
 import java.security.ProviderException;
 
-
 /**
  *  The static class providing access on Linux platform
  *  to system means for generating true random bits. <BR>
@@ -37,25 +35,24 @@
  *  If no device available the service is not available,
  *  that is, provider shouldn't register the algorithm. <BR>
  */
-
-
 public class RandomBitsSupplier implements SHA1_Data {
 
 
     /**
-     *  BufferedInputStream to read from device
+     * InputStream to read from device
+     *
+     * Using a BufferedInputStream leads to problems
+     * on Android in rare cases, since the
+     * BufferedInputStream's available() issues an
+     * ioctl(), and the pseudo device doesn't seem
+     * to like that. Since we're reading bigger
+     * chunks and not single bytes, the FileInputStream
+     * shouldn't be slower, so we use that. Same might
+     * apply to other Linux platforms.
+     *
+     * TODO: the above doesn't sound true.
      */
-    // BEGIN android-changed
-    // Using a BufferedInputStream leads to problems
-    // on Android in rare cases, since the
-    // BufferedInputStream's available() issues an
-    // iotcl(), and the pseudo device doesn't seem
-    // to like that. Since we're reading bigger
-    // chunks and not single bytes, the FileInputStream
-    // shouldn't be slower, so we use that. Same might
-    // apply to other Linux platforms.
-    private static FileInputStream bis = null;
-    // END android-changed
+    private static FileInputStream fis = null;
 
     /**
      * File to connect to device
@@ -67,41 +64,23 @@
      */
     private static boolean serviceAvailable = false;
 
+    /**
+     *  names of random devices on Linux platform
+     */
+    private static final String DEVICE_NAMES[] = { "/dev/urandom" /*, "/dev/random" */ };
 
     static {
-        AccessController.doPrivileged(
-            new java.security.PrivilegedAction() {
-                public Object run() {
-
-                    for ( int i = 0 ; i < DEVICE_NAMES.length ; i++ ) {
-                        File file = new File(DEVICE_NAMES[i]);
-
-                        try {
-                            if ( file.canRead() ) {
-                                // BEGIN android-modified
-                                bis = new FileInputStream(file);
-                                // END android-modified
-                                randomFile = file;
-                                serviceAvailable = true;
-                                return null;
-                            }
-                        } catch (FileNotFoundException e) {
-                        }
-                    }
-
-                    // BEGIN android-removed
-//                    // If we have come out of the above loop, then we have been unable to
-//                    // access /dev/*random, so try to fall back to using the system random() API
-//                    try {
-//                        System.loadLibrary(LIBRARY_NAME);
-//                        serviceAvailable = true;
-//                    } catch (UnsatisfiedLinkError e) {
-//                        serviceAvailable = false;
-//                    }
-                    return null;
+        for (String deviceName : DEVICE_NAMES) {
+            try {
+                File file = new File(deviceName);
+                if (file.canRead()) {
+                    fis = new FileInputStream(file);
+                    randomFile = file;
+                    serviceAvailable = true;
                 }
+            } catch (FileNotFoundException e) {
             }
-        );
+        }
     }
 
 
@@ -129,7 +108,7 @@
         try {
             for ( ; ; ) {
 
-                bytesRead = bis.read(bytes, offset, numBytes-total);
+                bytesRead = fis.read(bytes, offset, numBytes-total);
 
 
                 // the below case should not occur because /dev/random or /dev/urandom is a special file
@@ -155,18 +134,6 @@
         return bytes;
     }
 
-
-    // BEGIN android-removed
-//    /**
-//     * On platforms with no "random" devices available, this native
-//     * method uses system API calls to generate random numbers<BR>
-//     *
-//     * In case of any runtime failure ProviderException gets thrown.
-//     */
-//    private static native synchronized boolean getUnixSystemRandom(byte[] randomBits, int numBytes);
-    // END android-removed
-
-
     /**
      * The method returns byte array of requested length provided service is available.
      * ProviderException gets thrown otherwise.
@@ -179,7 +146,6 @@
      *       InvalidArgumentException - if numBytes <= 0
      */
     public static byte[] getRandomBits(int numBytes) {
-
         if (numBytes <= 0) {
             throw new IllegalArgumentException(Integer.toString(numBytes));
         }
@@ -190,8 +156,6 @@
             throw new ProviderException("ATTENTION: service is not available : no random devices");
         }
 
-        // BEGIN android-changed
         return getUnixDeviceRandom(numBytes);
-        // END android-changed
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java
index cd9da59..2420fbe 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1PRNG_SecureRandomImpl.java
@@ -24,6 +24,7 @@
 import java.io.Serializable;
 import java.security.InvalidParameterException;
 import java.security.SecureRandomSpi;
+import libcore.io.Streams;
 import libcore.util.EmptyArray;
 
 /**
@@ -523,7 +524,6 @@
         }
 
         nextBIndex = ois.readInt();
-        ois.read(nextBytes, nextBIndex, HASHBYTES_TO_USE - nextBIndex);
+        Streams.readFully(ois, nextBytes, nextBIndex, HASHBYTES_TO_USE - nextBIndex);
     }
-
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1_Data.java b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1_Data.java
index 0e30e03..b559576 100644
--- a/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1_Data.java
+++ b/luni/src/main/java/org/apache/harmony/security/provider/crypto/SHA1_Data.java
@@ -80,20 +80,4 @@
      * in this implementation # is set to 20 (in general # varies from 1 to 20)
      */
     static final int DIGEST_LENGTH = 20;
-
-
-    // BEGIN android-removed
-//    /**
-//     *  name of native library to use on Windows platform
-//     */
-//    static final String LIBRARY_NAME = "hysecurity";
-    // END android-removed
-
-
-    /**
-     *  names of random devices on Linux platform
-     */
-    // BEGIN android-changed: /dev/random seems to be empty on Android
-    static final String DEVICE_NAMES[] = { "/dev/urandom" /*, "/dev/random" */ };
-    // END android-changed
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/utils/AlgNameMapper.java b/luni/src/main/java/org/apache/harmony/security/utils/AlgNameMapper.java
index 8305c70..9ad5373 100644
--- a/luni/src/main/java/org/apache/harmony/security/utils/AlgNameMapper.java
+++ b/luni/src/main/java/org/apache/harmony/security/utils/AlgNameMapper.java
@@ -25,10 +25,10 @@
 import java.security.Provider;
 import java.security.Security;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Set;
-import org.apache.harmony.security.Util;
 import org.apache.harmony.security.asn1.ObjectIdentifier;
 
 /**
@@ -83,7 +83,7 @@
 
     static {
         for (String[] element : knownAlgMappings) {
-            String algUC = Util.toUpperCase(element[1]);
+            String algUC = element[1].toUpperCase(Locale.US);
             alg2OidMap.put(algUC, element[0]);
             oid2AlgMap.put(element[0], algUC);
             // map upper case alg name to its original name
@@ -113,7 +113,7 @@
      */
     public static String map2OID(String algName) {
         // alg2OidMap map contains upper case keys
-        return alg2OidMap.get(Util.toUpperCase(algName));
+        return alg2OidMap.get(algName.toUpperCase(Locale.US));
     }
 
     /**
@@ -136,7 +136,7 @@
      * @return algorithm name
      */
     public static String getStandardName(String algName) {
-        return algAliasesMap.get(Util.toUpperCase(algName));
+        return algAliasesMap.get(algName.toUpperCase(Locale.US));
     }
 
     // Searches given provider for mappings like
@@ -153,7 +153,7 @@
                 if (key.startsWith(keyPrfix2find)) {
                     String alias = key.substring(keyPrfix2find.length());
                     String alg = (String)me.getValue();
-                    String algUC = Util.toUpperCase(alg);
+                    String algUC = alg.toUpperCase(Locale.US);
                     if (isOID(alias)) {
                         if (alias.startsWith("OID.")) {
                             alias = alias.substring(4);
@@ -172,8 +172,8 @@
                             algAliasesMap.put(algUC, alg);
                         }
                            // Do not override known standard names
-                    } else if (!algAliasesMap.containsKey(Util.toUpperCase(alias))) {
-                        algAliasesMap.put(Util.toUpperCase(alias), alg);
+                    } else if (!algAliasesMap.containsKey(alias.toUpperCase(Locale.US))) {
+                        algAliasesMap.put(alias.toUpperCase(Locale.US), alg);
                     }
                 }
             }
@@ -187,9 +187,7 @@
      * @return 'true' if parameter represents OID
      */
     public static boolean isOID(String alias) {
-        // BEGIN android-changed
         return ObjectIdentifier.isOID(normalize(alias));
-        // END android-changed
     }
 
     /**
@@ -203,18 +201,4 @@
             ? oid.substring(4)
             : oid;
     }
-
-    /**
-     * Present all internal maps as formatted string
-     * @return Internal maps String representation
-     */
-    public static String dump() {
-        StringBuilder sb = new StringBuilder("alg2OidMap: ");
-        sb.append(alg2OidMap);
-        sb.append("\noid2AlgMap: ");
-        sb.append(oid2AlgMap);
-        sb.append("\nalgAliasesMap: ");
-        sb.append(algAliasesMap);
-        return sb.toString();
-    }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/utils/Array.java b/luni/src/main/java/org/apache/harmony/security/utils/Array.java
index afcb19d..582ca7d 100644
--- a/luni/src/main/java/org/apache/harmony/security/utils/Array.java
+++ b/luni/src/main/java/org/apache/harmony/security/utils/Array.java
@@ -33,6 +33,15 @@
     private Array() {
     }
 
+    public static String getBytesAsString(byte[] data) {
+        StringBuilder result = new StringBuilder(data.length * 3);
+        for (int i = 0; i < data.length; ++i) {
+            result.append(Byte.toHexString(data[i], false));
+            result.append(' ');
+        }
+        return result.toString();
+    }
+
     /**
      * Represents <code>array</code> as <code>String</code>
      * for printing. Array length can be up to 32767
@@ -67,13 +76,9 @@
             // put delimiter
             sb.append(' ');
             // put current byte
-            int currentByte = (0xff & array[i]);
-            String hexTail = Integer.toHexString(currentByte);
-            if (hexTail.length() == 1) {
-                sb.append('0');
-            }
-            sb.append(hexTail);
+            sb.append(Byte.toHexString(array[i], false));
             // form character representation part
+            int currentByte = (0xff & array[i]);
             char currentChar = (char)(currentByte & 0xffff);
             // FIXME if needed (how to distinguish PRINTABLE chars?)
             charForm.append(
diff --git a/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java b/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
index 9013eba..70a13f7 100644
--- a/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
+++ b/luni/src/main/java/org/apache/harmony/security/utils/JarUtils.java
@@ -72,20 +72,21 @@
         if (signedData == null) {
             throw new IOException("No SignedData found");
         }
-        Collection encCerts = signedData.getCertificates();
+        Collection<org.apache.harmony.security.x509.Certificate> encCerts
+                = signedData.getCertificates();
         if (encCerts.isEmpty()) {
             return null;
         }
         X509Certificate[] certs = new X509Certificate[encCerts.size()];
         int i = 0;
-        for (Iterator it = encCerts.iterator(); it.hasNext();) {
-            certs[i++]= new X509CertImpl((org.apache.harmony.security.x509.Certificate)it.next());
+        for (org.apache.harmony.security.x509.Certificate encCert : encCerts) {
+            certs[i++] = new X509CertImpl(encCert);
         }
 
-        List sigInfos = signedData.getSignerInfos();
+        List<SignerInfo> sigInfos = signedData.getSignerInfos();
         SignerInfo sigInfo;
         if (!sigInfos.isEmpty()) {
-            sigInfo = (SignerInfo)sigInfos.get(0);
+            sigInfo = sigInfos.get(0);
         } else {
             return null;
         }
@@ -115,18 +116,13 @@
 
         // Get Signature instance
         Signature sig = null;
-        String da = sigInfo.getdigestAlgorithm();
+        String da = sigInfo.getDigestAlgorithm();
         String dea = sigInfo.getDigestEncryptionAlgorithm();
         String alg = null;
         if (da != null && dea != null) {
             alg = da + "with" +  dea;
-            try{
-                // BEGIN android-removed
-                // sig = OpenSSLSignature.getInstance(alg);
-                // END android-removed
-                // BEGIN android-added
+            try {
                 sig = OpenSSLSignature.getInstance(alg);
-                // END android-removed
             } catch (NoSuchAlgorithmException e) {}
         }
         if (sig == null) {
@@ -134,13 +130,8 @@
             if (alg == null) {
                 return null;
             }
-            try{
-                // BEGIN android-removed
-                // sig = OpenSSLSignature.getInstance(alg);
-                // END android-removed
-                // BEGIN android-added
+            try {
                 sig = OpenSSLSignature.getInstance(alg);
-                // END android-removed
             } catch (NoSuchAlgorithmException e) {
                 return null;
             }
@@ -150,7 +141,7 @@
         // If the authenticatedAttributes field of SignerInfo contains more than zero attributes,
         // compute the message digest on the ASN.1 DER encoding of the Attributes value.
         // Otherwise, compute the message digest on the data.
-        List atr = sigInfo.getAuthenticatedAttributes();
+        List<AttributeTypeAndValue> atr = sigInfo.getAuthenticatedAttributes();
 
         byte[] sfBytes = new byte[signature.available()];
         signature.read(sfBytes);
@@ -163,9 +154,8 @@
             // If the authenticatedAttributes field contains the message-digest attribute,
             // verify that it equals the computed digest of the signature file
             byte[] existingDigest = null;
-            for (Iterator it = atr.iterator(); it.hasNext();) {
-                AttributeTypeAndValue a = (AttributeTypeAndValue)it.next();
-                if (Arrays.equals(a.getType().getOid(), MESSAGE_DIGEST_OID) ){
+            for (AttributeTypeAndValue a : atr) {
+                if (Arrays.equals(a.getType().getOid(), MESSAGE_DIGEST_OID)) {
 //TODO value                    existingDigest = a.AttributeValue;
                 }
             }
diff --git a/luni/src/main/java/org/apache/harmony/security/x501/AttributeType.java b/luni/src/main/java/org/apache/harmony/security/x501/AttributeType.java
deleted file mode 100644
index 6e11358..0000000
--- a/luni/src/main/java/org/apache/harmony/security/x501/AttributeType.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-/**
-* @author Stepan M. Mishura
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.x501;
-
-import org.apache.harmony.security.asn1.ASN1Type;
-import org.apache.harmony.security.asn1.ObjectIdentifier;
-
-
-/**
- * X.501 Attribute Type
- *
- * This is a draft class for Module InformationFramework (X.501).
- *
- * @see <a href="http://www.itu.int/ITU-T/asn1/database/itu-t/x/x501/2001/InformationFramework.html">X.501</a>
- */
-
-public class AttributeType {
-
-    public final ObjectIdentifier oid;
-
-    public final ASN1Type type;
-
-    public AttributeType(ObjectIdentifier oid, ASN1Type type) {
-        this.oid = oid;
-        this.type = type;
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/security/x501/AttributeTypeAndValue.java b/luni/src/main/java/org/apache/harmony/security/x501/AttributeTypeAndValue.java
index 6dbf416..89f5b3e 100644
--- a/luni/src/main/java/org/apache/harmony/security/x501/AttributeTypeAndValue.java
+++ b/luni/src/main/java/org/apache/harmony/security/x501/AttributeTypeAndValue.java
@@ -26,9 +26,8 @@
 import java.nio.charset.Charsets;
 import java.util.Arrays;
 import java.util.HashMap;
-import java.util.Iterator;
+import java.util.Locale;
 import javax.security.auth.x500.X500Principal;
-import org.apache.harmony.security.Util;
 import org.apache.harmony.security.asn1.ASN1Constants;
 import org.apache.harmony.security.asn1.ASN1Oid;
 import org.apache.harmony.security.asn1.ASN1Sequence;
@@ -42,146 +41,105 @@
 /**
  * X.501 AttributeTypeAndValue
  */
-public class AttributeTypeAndValue {
+public final class AttributeTypeAndValue {
 
-    // Country code attribute (name from RFC 1779)
-    private static final ObjectIdentifier C;
+    /** known attribute types for RFC1779 (see Table 1) */
+    private static final HashMap<String, ObjectIdentifier> RFC1779_NAMES
+            = new HashMap<String, ObjectIdentifier>(10);
 
-    // Common name attribute (name from RFC 1779)
-    private static final ObjectIdentifier CN;
+    /** known keywords attribute */
+    private static final HashMap<String, ObjectIdentifier> KNOWN_NAMES
+            = new HashMap<String, ObjectIdentifier>(30);
 
-    // Domain component attribute (name from RFC 2253)
-    private static final ObjectIdentifier DC;
+    /** known attribute types for RFC2253 (see 2.3.  Converting AttributeTypeAndValue) */
+    private static final HashMap<String, ObjectIdentifier> RFC2253_NAMES
+            = new HashMap<String, ObjectIdentifier>(10);
 
-    // DN qualifier attribute (name from API spec)
-    private static final ObjectIdentifier DNQ;
+    /** known attribute types for RFC2459 (see API spec.) */
+    private static final HashMap<String, ObjectIdentifier> RFC2459_NAMES
+            = new HashMap<String, ObjectIdentifier>(10);
 
-    private static final ObjectIdentifier DNQUALIFIER;
+    /** Country code attribute (name from RFC 1779) */
+    private static final ObjectIdentifier C
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 6 }, "C", RFC1779_NAMES);
 
-    // Email Address attribute (name from API spec)
-    private static final ObjectIdentifier EMAILADDRESS;
+    /** Common name attribute (name from RFC 1779) */
+    private static final ObjectIdentifier CN
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 3 }, "CN", RFC1779_NAMES);
 
-    // Generation attribute (qualifies an individual's name)
-    // (name from API spec)
-    private static final ObjectIdentifier GENERATION;
+    /** Domain component attribute (name from RFC 2253) */
+    private static final ObjectIdentifier DC = new ObjectIdentifier(
+            new int[] { 0, 9, 2342, 19200300, 100, 1, 25 }, "DC", RFC2253_NAMES);
 
-    // Given name attribute (name from API spec)
-    private static final ObjectIdentifier GIVENNAME;
+    /** DN qualifier attribute (name from API spec) */
+    private static final ObjectIdentifier DNQ
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 46 }, "DNQ", RFC2459_NAMES);
 
-    // Initials attribute (initials of an individual's name)
-    // (name from API spec)
-    private static final ObjectIdentifier INITIALS;
+    private static final ObjectIdentifier DNQUALIFIER
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 46 }, "DNQUALIFIER", RFC2459_NAMES);
 
-    // Name of a locality attribute (name from RFC 1779)
-    private static final ObjectIdentifier L;
+    /** Email Address attribute (name from API spec) */
+    private static final ObjectIdentifier EMAILADDRESS = new ObjectIdentifier(
+            new int[] { 1, 2, 840, 113549, 1, 9, 1}, "EMAILADDRESS", RFC2459_NAMES);
 
-    // Organization name attribute (name from RFC 1779)
-    private static final ObjectIdentifier O;
+    /** Generation attribute (qualifies an individual's name) (name from API spec) */
+    private static final ObjectIdentifier GENERATION
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 44 }, "GENERATION", RFC2459_NAMES);
 
-    // Organizational unit name attribute (name from RFC 1779)
-    private static final ObjectIdentifier OU;
+    /** Given name attribute (name from API spec) */
+    private static final ObjectIdentifier GIVENNAME
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 42 }, "GIVENNAME", RFC2459_NAMES);
 
-    // Serial number attribute (serial number of a device)
-    // (name from API spec)
-    private static final ObjectIdentifier SERIALNUMBER;
+    /** Initials attribute (initials of an individual's name) (name from API spec) */
+    private static final ObjectIdentifier INITIALS
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 43 }, "INITIALS", RFC2459_NAMES);
 
-    // Attribute for the full name of a state or province
-    // (name from RFC 1779)
-    private static final ObjectIdentifier ST;
+    /** Name of a locality attribute (name from RFC 1779) */
+    private static final ObjectIdentifier L
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 7 }, "L", RFC1779_NAMES);
 
-    // Street attribute (name from RFC 1779)
-    private static final ObjectIdentifier STREET;
+    /** Organization name attribute (name from RFC 1779) */
+    private static final ObjectIdentifier O
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 10 }, "O", RFC1779_NAMES);
 
-    // Surname attribute (comes from an individual's parent name)
-    // (name from API spec)
-    private static final ObjectIdentifier SURNAME;
+    /** Organizational unit name attribute (name from RFC 1779) */
+    private static final ObjectIdentifier OU
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 11 }, "OU", RFC1779_NAMES);
 
-    // Title attribute (object in an organization)(name from API spec)
-    private static final ObjectIdentifier T;
+    /** Serial number attribute (serial number of a device) (name from API spec) */
+    private static final ObjectIdentifier SERIALNUMBER
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 5 }, "SERIALNUMBER", RFC2459_NAMES);
 
-    // User identifier attribute (name from RFC 2253)
-    private static final ObjectIdentifier UID;
+    /** Attribute for the full name of a state or province (name from RFC 1779) */
+    private static final ObjectIdentifier ST
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 8 }, "ST", RFC1779_NAMES);
 
-    //
-    // OID's pool
-    //
+    /** Street attribute (name from RFC 1779) */
+    private static final ObjectIdentifier STREET
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 9 }, "STREET", RFC1779_NAMES);
 
-    // pool's capacity
-    private static final int CAPACITY;
+    /** Surname attribute (comes from an individual's parent name) (name from API spec) */
+    private static final ObjectIdentifier SURNAME
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 4 }, "SURNAME", RFC2459_NAMES);
 
-    // pool's size
-    private static final int SIZE;
+    /** Title attribute (object in an organization)(name from API spec) */
+    private static final ObjectIdentifier T
+            = new ObjectIdentifier(new int[] { 2, 5, 4, 12 }, "T", RFC2459_NAMES);
 
-    // pool: contains all recognizable attribute type keywords
-    private static final ObjectIdentifier[][] KNOWN_OIDS;
+    /** User identifier attribute (name from RFC 2253) */
+    private static final ObjectIdentifier UID = new ObjectIdentifier(
+            new int[]{ 0, 9, 2342, 19200300, 100, 1, 1 }, "UID", RFC2253_NAMES);
 
-    // known keywords attribute
-    private static final HashMap KNOWN_NAMES = new HashMap(30);
+    /** pool's capacity */
+    private static final int CAPACITY = 10;
 
-    // known attribute types for RFC1779 (see Table 1)
-    private static final HashMap RFC1779_NAMES = new HashMap(10);
+    /** pool's size */
+    private static final int SIZE = 10;
 
-    // known attribute types for RFC2253
-    // (see 2.3.  Converting AttributeTypeAndValue)
-    private static final HashMap RFC2253_NAMES = new HashMap(10);
-
-    // known attribute types for RFC2459 (see API spec.)
-    private static final HashMap RFC2459_NAMES = new HashMap(10);
+    /** pool: contains all recognizable attribute type keywords */
+    private static final ObjectIdentifier[][] KNOWN_OIDS = new ObjectIdentifier[SIZE][CAPACITY];
 
     static {
-
-        // pool initialization
-        CAPACITY = 10;
-        SIZE = 10;
-        KNOWN_OIDS = new ObjectIdentifier[SIZE][CAPACITY];
-
-        // init known attribute type keywords
-        C = new ObjectIdentifier(new int[] { 2, 5, 4, 6 }, "C", RFC1779_NAMES);
-        CN = new ObjectIdentifier(new int[] { 2, 5, 4, 3 }, "CN", RFC1779_NAMES);
-
-        DC = new ObjectIdentifier(
-                new int[] { 0, 9, 2342, 19200300, 100, 1, 25 }, "DC",
-                RFC2253_NAMES);
-        // DN qualifier aliases
-        DNQ = new ObjectIdentifier(new int[] { 2, 5, 4, 46 }, "DNQ",
-                RFC2459_NAMES);
-        DNQUALIFIER = new ObjectIdentifier(new int[] { 2, 5, 4, 46 },
-                "DNQUALIFIER", RFC2459_NAMES);
-
-        EMAILADDRESS = new ObjectIdentifier(new int[] { 1, 2, 840, 113549, 1,
-                9, 1 }, "EMAILADDRESS", RFC2459_NAMES);
-
-        GENERATION = new ObjectIdentifier(new int[] { 2, 5, 4, 44 },
-                "GENERATION", RFC2459_NAMES);
-        GIVENNAME = new ObjectIdentifier(new int[] { 2, 5, 4, 42 },
-                "GIVENNAME", RFC2459_NAMES);
-
-        INITIALS = new ObjectIdentifier(new int[] { 2, 5, 4, 43 }, "INITIALS",
-                RFC2459_NAMES);
-
-        L = new ObjectIdentifier(new int[] { 2, 5, 4, 7 }, "L", RFC1779_NAMES);
-
-        O = new ObjectIdentifier(new int[] { 2, 5, 4, 10 }, "O", RFC1779_NAMES);
-        OU = new ObjectIdentifier(new int[] { 2, 5, 4, 11 }, "OU",
-                RFC1779_NAMES);
-
-        SERIALNUMBER = new ObjectIdentifier(new int[] { 2, 5, 4, 5 },
-                "SERIALNUMBER", RFC2459_NAMES);
-        ST = new ObjectIdentifier(new int[] { 2, 5, 4, 8 }, "ST", RFC1779_NAMES);
-        STREET = new ObjectIdentifier(new int[] { 2, 5, 4, 9 }, "STREET",
-                RFC1779_NAMES);
-        SURNAME = new ObjectIdentifier(new int[] { 2, 5, 4, 4 }, "SURNAME",
-                RFC2459_NAMES);
-
-        T = new ObjectIdentifier(new int[] { 2, 5, 4, 12 }, "T", RFC2459_NAMES);
-
-        UID = new ObjectIdentifier(
-                new int[] { 0, 9, 2342, 19200300, 100, 1, 1 }, "UID",
-                RFC2253_NAMES);
-
-        //
-        // RFC1779
-        //
         RFC1779_NAMES.put(CN.getName(), CN);
         RFC1779_NAMES.put(L.getName(), L);
         RFC1779_NAMES.put(ST.getName(), ST);
@@ -190,17 +148,10 @@
         RFC1779_NAMES.put(C.getName(), C);
         RFC1779_NAMES.put(STREET.getName(), STREET);
 
-        //
-        // RFC2253: includes all from RFC1779
-        //
         RFC2253_NAMES.putAll(RFC1779_NAMES);
-
         RFC2253_NAMES.put(DC.getName(), DC);
         RFC2253_NAMES.put(UID.getName(), UID);
 
-        //
-        // RFC2459
-        //
         RFC2459_NAMES.put(DNQ.getName(), DNQ);
         RFC2459_NAMES.put(DNQUALIFIER.getName(), DNQUALIFIER);
         RFC2459_NAMES.put(EMAILADDRESS.getName(), EMAILADDRESS);
@@ -211,45 +162,31 @@
         RFC2459_NAMES.put(SURNAME.getName(), SURNAME);
         RFC2459_NAMES.put(T.getName(), T);
 
-        //
-        // Init KNOWN_OIDS pool
-        //
-
         // add from RFC2253 (includes RFC1779)
-        Iterator it = RFC2253_NAMES.values().iterator();
-        while (it.hasNext()) {
-            addOID((ObjectIdentifier) it.next());
+        for (ObjectIdentifier objectIdentifier : RFC2253_NAMES.values()) {
+            addOID(objectIdentifier);
         }
 
         // add attributes from RFC2459
-        it = RFC2459_NAMES.values().iterator();
-        while (it.hasNext()) {
-            Object o = it.next();
-
+        for (ObjectIdentifier o : RFC2459_NAMES.values()) {
             //don't add DNQUALIFIER because it has the same oid as DNQ
             if (!(o == DNQUALIFIER)) {
-                addOID((ObjectIdentifier) o);
+                addOID(o);
             }
         }
 
-        //
-        // Init KNOWN_NAMES pool
-        //
-
         KNOWN_NAMES.putAll(RFC2253_NAMES); // RFC2253 includes RFC1779
         KNOWN_NAMES.putAll(RFC2459_NAMES);
     }
 
-    //Attribute type
+    /** Attribute type */
     private final ObjectIdentifier oid;
 
-    //Attribute value
+    /** Attribute value */
     private final AttributeValue value;
 
     // for decoder only
-    private AttributeTypeAndValue(int[] oid, AttributeValue value)
-            throws IOException {
-
+    private AttributeTypeAndValue(int[] oid, AttributeValue value) throws IOException {
         ObjectIdentifier thisOid = getOID(oid);
         if (thisOid == null) {
             thisOid = new ObjectIdentifier(oid);
@@ -269,13 +206,9 @@
      * @throws IOException
      *             if OID can not be created from its string representation
      */
-    public AttributeTypeAndValue(String sOid, AttributeValue value)
-            throws IOException {
+    public AttributeTypeAndValue(String sOid, AttributeValue value) throws IOException {
         if (sOid.charAt(0) >= '0' && sOid.charAt(0) <= '9') {
-
-            int[] array = org.apache.harmony.security.asn1.ObjectIdentifier
-                    .toIntArray(sOid);
-
+            int[] array = org.apache.harmony.security.asn1.ObjectIdentifier.toIntArray(sOid);
             ObjectIdentifier thisOid = getOID(array);
             if (thisOid == null) {
                 thisOid = new ObjectIdentifier(array);
@@ -283,7 +216,7 @@
             this.oid = thisOid;
 
         } else {
-            this.oid = (ObjectIdentifier) KNOWN_NAMES.get(Util.toUpperCase(sOid));
+            this.oid = KNOWN_NAMES.get(sOid.toUpperCase(Locale.US));
             if (this.oid == null) {
                 throw new IOException("Unrecognizable attribute name: " + sOid);
             }
@@ -295,62 +228,57 @@
      * Appends AttributeTypeAndValue string representation
      *
      * @param attrFormat - format of DN
-     * @param buf - string buffer to be used
      */
-    public void appendName(String attrFormat, StringBuffer buf) {
-
+    public void appendName(String attrFormat, StringBuilder sb) {
         boolean hexFormat = false;
         if (X500Principal.RFC1779.equals(attrFormat)) {
             if (RFC1779_NAMES == oid.getGroup()) {
-                buf.append(oid.getName());
+                sb.append(oid.getName());
             } else {
-                buf.append(oid.toOIDString());
+                sb.append(oid.toOIDString());
             }
 
-            buf.append('=');
+            sb.append('=');
             if (value.escapedString == value.getHexString()) {
-                //FIXME all chars in upper case
-                buf.append(Util.toUpperCase(value.getHexString()));
+                sb.append(value.getHexString().toUpperCase(Locale.US));
             } else if (value.escapedString.length() != value.rawString.length()) {
                 // was escaped
-                value.appendQEString(buf);
+                value.appendQEString(sb);
             } else {
-                buf.append(value.escapedString);
+                sb.append(value.escapedString);
             }
         } else {
             Object group = oid.getGroup();
             // RFC2253 includes names from RFC1779
             if (RFC1779_NAMES == group || RFC2253_NAMES == group) {
-                buf.append(oid.getName());
+                sb.append(oid.getName());
 
                 if (X500Principal.CANONICAL.equals(attrFormat)) {
                     // only PrintableString and UTF8String in string format
                     // all others are output in hex format
-                    // BEGIN android-changed
-                    // no hex for teletex; see bug 2102191
+                    // no hex for teletex; see http://b/2102191
                     int tag = value.getTag();
                     if (!ASN1StringType.UTF8STRING.checkTag(tag)
                             && !ASN1StringType.PRINTABLESTRING.checkTag(tag)
                             && !ASN1StringType.TELETEXSTRING.checkTag(tag)) {
                         hexFormat = true;
                     }
-                    // END android-changed
                 }
 
             } else {
-                buf.append(oid.toString());
+                sb.append(oid.toString());
                 hexFormat = true;
             }
 
-            buf.append('=');
+            sb.append('=');
 
             if (hexFormat) {
-                buf.append(value.getHexString());
+                sb.append(value.getHexString());
             } else {
                 if (X500Principal.CANONICAL.equals(attrFormat)) {
-                    buf.append(value.makeCanonical());
+                    sb.append(value.makeCanonical());
                 } else {
-                    buf.append(value.escapedString);
+                    sb.append(value.escapedString);
                 }
             }
         }
@@ -358,8 +286,6 @@
 
     /**
      * Gets type of the AttributeTypeAndValue
-     *
-     * @return ObjectIdentifier
      */
     public ObjectIdentifier getType() {
         return oid;
@@ -385,16 +311,13 @@
      *          bmpString               BMPString (SIZE (1..MAX)) }
      *
      */
-
-    public static final ASN1Type attributeValue = new ASN1Type(
-            ASN1Constants.TAG_PRINTABLESTRING) {
+    public static final ASN1Type attributeValue = new ASN1Type(ASN1Constants.TAG_PRINTABLESTRING) {
 
         public boolean checkTag(int tag) {
             return true;
         }
 
         public Object decode(BerInputStream in) throws IOException {
-
             // FIXME what about constr???
             String str = null;
             if (DirectoryString.ASN1.checkTag(in.tag)) {
@@ -412,7 +335,7 @@
             return new AttributeValue(str, bytesEncoded, in.tag);
         }
 
-        public Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override public Object getDecodedObject(BerInputStream in) throws IOException {
             // stub to avoid wrong decoder usage
             throw new RuntimeException("AttributeValue getDecodedObject MUST NOT be invoked");
         }
@@ -421,7 +344,6 @@
         // Encode
         //
         public void encodeASN(BerOutputStream out) {
-
             AttributeValue av = (AttributeValue) out.content;
 
             if (av.encoded != null) {
@@ -435,19 +357,14 @@
         }
 
         public void setEncodingContent(BerOutputStream out) {
-
             AttributeValue av = (AttributeValue) out.content;
 
             if (av.encoded != null) {
                 out.length = av.encoded.length;
             } else {
-
                 if (av.getTag() == ASN1Constants.TAG_UTF8STRING) {
-
                     out.content = av.rawString;
-
                     ASN1StringType.UTF8STRING.setEncodingContent(out);
-
                     av.bytes = (byte[]) out.content;
                     out.content = av;
                 } else {
@@ -462,10 +379,8 @@
             throw new RuntimeException("AttributeValue encodeContent MUST NOT be invoked");
         }
 
-        public int getEncodedLength(BerOutputStream out) { //FIXME name
-
+        @Override public int getEncodedLength(BerOutputStream out) { //FIXME name
             AttributeValue av = (AttributeValue) out.content;
-
             if (av.encoded != null) {
                 return out.length;
             } else {
@@ -477,23 +392,22 @@
     public static final ASN1Sequence ASN1 = new ASN1Sequence(new ASN1Type[] {
             ASN1Oid.getInstance(), attributeValue }) {
 
-        protected Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override protected Object getDecodedObject(BerInputStream in) throws IOException {
             Object[] values = (Object[]) in.content;
-            return new AttributeTypeAndValue((int[]) values[0],
-                    (AttributeValue) values[1]);
+            return new AttributeTypeAndValue((int[]) values[0], (AttributeValue) values[1]);
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             AttributeTypeAndValue atav = (AttributeTypeAndValue) object;
-
             values[0] = atav.oid.getOid();
             values[1] = atav.value;
         }
     };
 
-    // returns known OID or null
+    /**
+     * Returns known OID or null.
+     */
     private static ObjectIdentifier getOID(int[] oid) {
-
         int index = hashIntArray(oid) % CAPACITY;
 
         // look for OID in the pool
@@ -506,10 +420,11 @@
         return null;
     }
 
-    // adds known OID to pool
-    // for static AttributeTypeAndValue initialization only
+    /**
+     * Adds known OID to pool.
+     * for static AttributeTypeAndValue initialization only
+     */
     private static void addOID(ObjectIdentifier oid) {
-
         int[] newOid = oid.getOid();
         int index = hashIntArray(newOid) % CAPACITY;
 
@@ -517,7 +432,6 @@
         ObjectIdentifier[] list = KNOWN_OIDS[index];
         int i = 0;
         for (; list[i] != null; i++) {
-
             // check wrong static initialization: no duplicate OIDs
             if (Arrays.equals(newOid, list[i].getOid())) {
                 throw new Error("ObjectIdentifier: invalid static initialization; " +
@@ -533,7 +447,9 @@
         list[i] = oid;
     }
 
-    // returns hash for array of integers
+    /**
+     * Returns hash for array of integers.
+     */
     private static int hashIntArray(int[] oid) {
         int intHash = 0;
         for (int i = 0; i < oid.length && i < 4; i++) {
diff --git a/luni/src/main/java/org/apache/harmony/security/x501/AttributeValue.java b/luni/src/main/java/org/apache/harmony/security/x501/AttributeValue.java
index ecce1e0..2369d0f 100644
--- a/luni/src/main/java/org/apache/harmony/security/x501/AttributeValue.java
+++ b/luni/src/main/java/org/apache/harmony/security/x501/AttributeValue.java
@@ -25,13 +25,11 @@
 import java.io.IOException;
 import org.apache.harmony.security.asn1.ASN1StringType;
 import org.apache.harmony.security.asn1.DerInputStream;
-import org.apache.harmony.security.x509.Utils;
-
 
 /**
  * X.501 Attribute Value
  */
-public class AttributeValue {
+public final class AttributeValue {
 
     public final boolean wasEncoded;
 
@@ -47,8 +45,9 @@
 
     public boolean hasQE; // raw string contains '"' or '\'
 
-    public AttributeValue(String parsedString, boolean hasQorE) {
+    public String rawString;
 
+    public AttributeValue(String parsedString, boolean hasQorE) {
         wasEncoded = false;
 
         this.hasQE = hasQorE;
@@ -58,7 +57,6 @@
     }
 
     public AttributeValue(String hexString, byte[] encoded) {
-
         wasEncoded = true;
 
         this.hexString = hexString;
@@ -84,10 +82,7 @@
         }
     }
 
-    public String rawString;
-
     public AttributeValue(String rawString, byte[] encoded, int tag) {
-
         wasEncoded = true;
 
         this.encoded = encoded;
@@ -102,27 +97,41 @@
         }
     }
 
+    /**
+     * Checks if the string is PrintableString (see X.680)
+     */
+    private static boolean isPrintableString(String str) {
+        for (int i = 0; i< str.length(); ++i) {
+            char ch = str.charAt(i);
+            if (!(ch == 0x20
+            || ch >= 0x27 && ch<= 0x29 // '()
+            || ch >= 0x2B && ch<= 0x3A // +,-./0-9:
+            || ch == '='
+            || ch == '?'
+            || ch >= 'A' && ch<= 'Z'
+            || ch >= 'a' && ch<= 'z')) {
+                return false;
+            }
+        }
+        return true;
+    }
+
     public int getTag() {
         if (tag == -1) {
-            if (Utils.isPrintableString(rawString)) {
-                tag = ASN1StringType.PRINTABLESTRING.id;
-            } else {
-                tag = ASN1StringType.UTF8STRING.id;
-            }
+            tag = isPrintableString(rawString)
+                    ? ASN1StringType.PRINTABLESTRING.id
+                    : ASN1StringType.UTF8STRING.id;
         }
         return tag;
     }
 
     public String getHexString() {
         if (hexString == null) {
-
             if (!wasEncoded) {
                 //FIXME optimize me: what about reusable OutputStream???
-                if (Utils.isPrintableString(rawString)) {
-                    encoded = ASN1StringType.PRINTABLESTRING.encode(rawString);
-                } else {
-                    encoded = ASN1StringType.UTF8STRING.encode(rawString);
-                }
+                encoded = isPrintableString(rawString)
+                        ? ASN1StringType.PRINTABLESTRING.encode(rawString)
+                        : ASN1StringType.UTF8STRING.encode(rawString);
             }
 
             StringBuilder buf = new StringBuilder(encoded.length * 2 + 1);
@@ -148,33 +157,32 @@
         return hexString;
     }
 
-    public void appendQEString(StringBuffer buf) {
-        buf.append('"');
+    public void appendQEString(StringBuilder sb) {
+        sb.append('"');
         if (hasQE) {
             char c;
             for (int i = 0; i < rawString.length(); i++) {
                 c = rawString.charAt(i);
                 if (c == '"' || c == '\\') {
-                    buf.append('\\');
+                    sb.append('\\');
                 }
-                buf.append(c);
+                sb.append(c);
             }
         } else {
-            buf.append(rawString);
+            sb.append(rawString);
         }
-        buf.append('"');
+        sb.append('"');
     }
 
-    //
-    // Escapes:
-    // 1) chars ",", "+", """, "\", "<", ">", ";" (RFC 2253)
-    // 2) chars "#", "=" (required by RFC 1779)
-    // 3) a space char at the beginning or end
-    // 4) according to the requirement to be RFC 1779 compatible:
-    //    '#' char is escaped in any position
-    //
+    /**
+     * Escapes:
+     * 1) chars ",", "+", """, "\", "<", ">", ";" (RFC 2253)
+     * 2) chars "#", "=" (required by RFC 1779)
+     * 3) a space char at the beginning or end
+     * 4) according to the requirement to be RFC 1779 compatible:
+     *    '#' char is escaped in any position
+     */
     private String makeEscaped(String name) {
-
         int length = name.length();
         if (length == 0) {
             return name;
@@ -220,7 +228,6 @@
     }
 
     public String makeCanonical() {
-
         int length = rawString.length();
         if (length == 0) {
             return rawString;
@@ -236,11 +243,9 @@
 
         int bufLength;
         for (; index < length; index++) {
-
             char ch = rawString.charAt(index);
 
             switch (ch) {
-
             case ' ':
                 bufLength = buf.length();
                 if (bufLength == 0 || buf.charAt(bufLength - 1) == ' ') {
diff --git a/luni/src/main/java/org/apache/harmony/security/x501/Attributes.java b/luni/src/main/java/org/apache/harmony/security/x501/Attributes.java
deleted file mode 100644
index 294fc8f..0000000
--- a/luni/src/main/java/org/apache/harmony/security/x501/Attributes.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-/**
-* @author Stepan M. Mishura
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.x501;
-
-import org.apache.harmony.security.asn1.ASN1OpenType;
-import org.apache.harmony.security.asn1.ASN1Sequence;
-import org.apache.harmony.security.asn1.ASN1SetOf;
-import org.apache.harmony.security.asn1.ASN1Type;
-import org.apache.harmony.security.asn1.InformationObjectSet;
-
-
-/**
- * X.501 Attributes
- *
- * This is a draft class for Module InformationFramework (X.501).
- *
- * @see <a href="http://www.itu.int/ITU-T/asn1/database/itu-t/x/x501/2001/InformationFramework.html">X.501</a>
- */
-
-public class Attributes {
-
-
-    /**
-     * The class corresponds to following ASN.1 type:
-     *
-     * Attribute ::= SEQUENCE {
-     *     type  AttributeType,
-     *     values SET SIZE (0..MAX) OF AttributeValue }
-     *
-     * AttributeType ::= OBJECT IDENTIFIER
-     *
-     * AttributeValue ::= ANY DEFINED BY AttributeType
-     *
-     */
-    public static ASN1Sequence getASN1(InformationObjectSet set) {
-        ASN1OpenType.Id id = new ASN1OpenType.Id();
-        ASN1OpenType any = new ASN1OpenType(id, set);
-
-        return new ASN1Sequence(new ASN1Type[] { id, new ASN1SetOf(any) });
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/security/x501/DirectoryString.java b/luni/src/main/java/org/apache/harmony/security/x501/DirectoryString.java
index 9c1eba6..902442f 100644
--- a/luni/src/main/java/org/apache/harmony/security/x501/DirectoryString.java
+++ b/luni/src/main/java/org/apache/harmony/security/x501/DirectoryString.java
@@ -45,7 +45,7 @@
  *   }
  * </pre>
  */
-public class DirectoryString {
+public final class DirectoryString {
 
     public static final ASN1Choice ASN1 = new ASN1Choice(new ASN1Type[] {
            ASN1StringType.TELETEXSTRING,
diff --git a/luni/src/main/java/org/apache/harmony/security/x501/Name.java b/luni/src/main/java/org/apache/harmony/security/x501/Name.java
index c3c4ffd..54ef4ef 100644
--- a/luni/src/main/java/org/apache/harmony/security/x501/Name.java
+++ b/luni/src/main/java/org/apache/harmony/security/x501/Name.java
@@ -23,10 +23,10 @@
 package org.apache.harmony.security.x501;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Locale;
 import javax.security.auth.x500.X500Principal;
@@ -40,22 +40,22 @@
 /**
  * X.501 Name
  */
-public class Name {
+public final class Name {
 
-    //ASN.1 DER encoding of Name
+    /** ASN.1 DER encoding of Name */
     private volatile byte[] encoded;
 
-    // RFC1779 string
+    /** RFC1779 string */
     private String rfc1779String;
 
-    // RFC2253 string
+    /** RFC2253 string */
     private String rfc2253String;
 
-    //CANONICAL string
+    /** CANONICAL string */
     private String canonicalString;
 
-    //Collection of RDNs
-    private List rdn;
+    /** Collection of RDNs */
+    private List<List<AttributeTypeAndValue>> rdn;
 
     /**
      * Creates new <code>Name</code> instance from its DER encoding
@@ -64,7 +64,6 @@
      * @throws IOException - if encoding is wrong
      */
     public Name(byte[] encoding) throws IOException {
-
         DerInputStream in = new DerInputStream(encoding);
 
         if (in.getEndOffset() != encoding.length) {
@@ -73,7 +72,7 @@
 
         ASN1.decode(in);
 
-        this.rdn = (List) in.content;
+        this.rdn = (List<List<AttributeTypeAndValue>>) in.content;
     }
 
     /**
@@ -86,8 +85,7 @@
         rdn = new DNParser(name).parse();
     }
 
-    // Creates Name instance
-    private Name(List rdn) {
+    private Name(List<List<AttributeTypeAndValue>> rdn) {
         this.rdn = rdn;
     }
 
@@ -105,13 +103,10 @@
      * Returns Relative Distinguished Name as <code>String</code> according
      * the format requested
      *
-     * @param format
-     *            Name format requested
-     * @return Relative Distinguished Name as <code>String</code> according
-     *         the format requested
+     * @param format one of X500Principal.CANONICAL, X500Principal.RFC1779, or
+     *     X500Principal.RFC2253, case insensitive
      */
     public String getName(String format) {
-
         //
         // check X500Principal constants first
         //
@@ -169,31 +164,24 @@
     /**
      * Returns Relative Distinguished Name as <code>String</code> according
      * the format requested, format is int value
-     *
-     * @param format
-     *            Name format requested
-     * @return Relative Distinguished Name as <code>String</code> according
-     *         the format requested
      */
     private String getName0(String format) {
-
-        StringBuffer name = new StringBuffer();
+        StringBuilder name = new StringBuilder();
 
         // starting with the last element and moving to the first.
         for (int i = rdn.size() - 1; i >= 0; i--) {
-            List atavList = (List) rdn.get(i);
+            List<AttributeTypeAndValue> atavList = rdn.get(i);
 
             if (X500Principal.CANONICAL == format) {
-                List sortedList = new LinkedList(atavList);
-                Collections.sort(sortedList, new AttributeTypeAndValueComparator());
-                atavList = sortedList;
+                atavList = new ArrayList<AttributeTypeAndValue>(atavList);
+                Collections.sort(atavList, new AttributeTypeAndValueComparator());
             }
 
             // Relative Distinguished Name to string
-            Iterator it = atavList.iterator();
+            Iterator<AttributeTypeAndValue> it = atavList.iterator();
             while (it.hasNext()) {
-                AttributeTypeAndValue _ava = (AttributeTypeAndValue) it.next();
-                _ava.appendName(format, name);
+                AttributeTypeAndValue attributeTypeAndValue = it.next();
+                attributeTypeAndValue.appendName(format, name);
                 if (it.hasNext()) {
                     // multi-valued RDN
                     if (X500Principal.RFC1779 == format) {
@@ -244,18 +232,17 @@
      *     SET OF AttributeTypeAndValue
      *
      */
-
     public static final ASN1SetOf ASN1_RDN = new ASN1SetOf(
             AttributeTypeAndValue.ASN1);
 
     public static final ASN1SequenceOf ASN1 = new ASN1SequenceOf(ASN1_RDN) {
 
         public Object getDecodedObject(BerInputStream in) {
-            return new Name((List) in.content);
+            return new Name((List<List<AttributeTypeAndValue>>) in.content);
         }
 
         public Collection getValues(Object object) {
-            return ((Name) object).rdn; //FIXME what about get method?
+            return ((Name) object).rdn;
         }
     };
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/AccessDescription.java b/luni/src/main/java/org/apache/harmony/security/x509/AccessDescription.java
index c539f37..0f2fe6d 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/AccessDescription.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/AccessDescription.java
@@ -34,25 +34,18 @@
  *  AccessDescription  ::=  SEQUENCE {
  *      accessMethod          OBJECT IDENTIFIER,
  *      accessLocation        GeneralName  }
- *
  */
-public class AccessDescription {
+public final class AccessDescription {
 
-    // the value of access method
+    /** the value of access method */
     private final String accessMethod;
 
-    // the value of accessLocation
+    /** the value of accessLocation */
     private final GeneralName accessLocation;
 
-    private byte [] encoding;
+    private byte[] encoding;
 
-    public AccessDescription(String accessMethod, GeneralName accessLocation) {
-        this.accessMethod = accessMethod;
-        this.accessLocation = accessLocation;
-    }
-
-    private AccessDescription(String accessMethod, GeneralName accessLocation,
-            byte[] encoding) {
+    private AccessDescription(String accessMethod, GeneralName accessLocation, byte[] encoding) {
         this.accessMethod = accessMethod;
         this.accessLocation = accessLocation;
         this.encoding = encoding;
@@ -60,7 +53,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 AccessDescription.
-     * @return a byte array containing ASN.1 encoded form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -69,7 +61,7 @@
         return encoding;
     }
 
-    public String toString() {
+    @Override public String toString() {
         StringBuilder res = new StringBuilder();
         res.append("\n-- AccessDescription:");
         res.append("\naccessMethod:  ");
@@ -81,41 +73,24 @@
     }
 
     /**
-     * @return Returns the accessLocation.
-     */
-    public GeneralName getAccessLocation() {
-        return accessLocation;
-    }
-
-    /**
-     * @return Returns the accessMethod.
-     */
-    public String getAccessMethod() {
-        return accessMethod;
-    }
-
-    /**
      * Custom AccessDescription DER encoder/decoder
      */
     public static final ASN1Sequence ASN1 = new ASN1Sequence(new ASN1Type[] {
             ASN1Oid.getInstance(),
             GeneralName.ASN1 }) {
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new AccessDescription(
                     ObjectIdentifier.toString((int[]) values[0]),
                     (GeneralName) values[1], in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             AccessDescription ad = (AccessDescription) object;
-
             values[0] = ObjectIdentifier.toIntArray(ad.accessMethod);
             values[1] = ad.accessLocation;
         }
     };
-
 }
 
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/AlgorithmIdentifier.java b/luni/src/main/java/org/apache/harmony/security/x509/AlgorithmIdentifier.java
index 9298ba5..1ab12e6 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/AlgorithmIdentifier.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/AlgorithmIdentifier.java
@@ -47,42 +47,25 @@
  *  }
  * </pre>
  */
-public class AlgorithmIdentifier {
-
-    // the value of algorithm field
+public final class AlgorithmIdentifier {
+    /** the value of algorithm field */
     private String algorithm;
-    // the name of the algorithm
+    /** the name of the algorithm */
     private String algorithmName;
-    // the value of parameters field
+    /** the value of parameters field */
     private byte[] parameters;
-    // the encoding of AlgorithmIdentifier value
+    /** the encoding of AlgorithmIdentifier value */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   algorithm:  String
-     */
     public AlgorithmIdentifier(String algorithm) {
         this(algorithm, null, null);
     }
 
-    /**
-     * TODO
-     * @param   algorithm:  String
-     * @param   parameters: byte[]
-     */
     public AlgorithmIdentifier(String algorithm, byte[] parameters) {
         this(algorithm, parameters, null);
     }
 
-    //
-    // TODO
-    // @param   algorithm:  String
-    // @param   parameters: byte[]
-    // @param   encoding:   byte[]
-    //
-    private AlgorithmIdentifier(String algorithm, byte[] parameters,
-                                byte[] encoding) {
+    private AlgorithmIdentifier(String algorithm, byte[] parameters, byte[] encoding) {
         this.algorithm = algorithm;
         this.parameters = parameters;
         this.encoding = encoding;
@@ -90,7 +73,6 @@
 
     /**
      * Returns the value of algorithm field of the structure.
-     * @return  algorithm
      */
     public String getAlgorithm() {
         return algorithm;
@@ -100,7 +82,6 @@
      * Returns the name of the algorithm corresponding to
      * its OID. If there is no the such correspondence,
      * algorithm OID is returned.
-     * @return  algorithm
      */
     public String getAlgorithmName() {
         if (algorithmName == null) {
@@ -114,7 +95,6 @@
 
     /**
      * Returns the value of parameters field of the structure.
-     * @return  parameters
      */
     public byte[] getParameters() {
         return parameters;
@@ -122,7 +102,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 AlgorithmIdentifier value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -131,7 +110,7 @@
         return encoding;
     }
 
-    public boolean equals(Object ai) {
+    @Override public boolean equals(Object ai) {
         if (!(ai instanceof AlgorithmIdentifier)) {
             return false;
         }
@@ -142,22 +121,19 @@
                     : Arrays.equals(parameters, algid.parameters));
     }
 
-    public int hashCode() {
-        return algorithm.hashCode() * 37 + (parameters != null ? parameters.hashCode() : 0);
+    @Override public int hashCode() {
+        return algorithm.hashCode() * 37 + (parameters != null ? Arrays.hashCode(parameters) : 0);
     }
 
-    /**
-     * Places the string representation into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer) {
-        buffer.append(getAlgorithmName());
+    public void dumpValue(StringBuilder sb) {
+        sb.append(getAlgorithmName());
         if (parameters == null) {
-            buffer.append(", no params, ");
+            sb.append(", no params, ");
         } else {
-            buffer.append(", params unparsed, ");
+            sb.append(", params unparsed, ");
         }
-        buffer.append("OID = ");
-        buffer.append(getAlgorithm());
+        sb.append("OID = ");
+        sb.append(getAlgorithm());
     }
 
     /**
@@ -169,13 +145,13 @@
             setOptional(1); // parameters are optional
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new AlgorithmIdentifier(ObjectIdentifier
                     .toString((int[]) values[0]), (byte[]) values[1]);
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
 
             AlgorithmIdentifier aID = (AlgorithmIdentifier) object;
 
@@ -183,5 +159,4 @@
             values[1] = aID.getParameters();
         }
     };
-
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/AlternativeName.java b/luni/src/main/java/org/apache/harmony/security/x509/AlternativeName.java
index 0e84512..f46e7d0 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/AlternativeName.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/AlternativeName.java
@@ -18,7 +18,6 @@
 package org.apache.harmony.security.x509;
 
 import java.io.IOException;
-import java.util.List;
 
 /**
  * This class implements the values of Subject Alternative Name
@@ -27,29 +26,19 @@
  * For more information about these extensions see RFC 3280
  * at http://www.ietf.org/rfc/rfc3280.txt
  */
-public class AlternativeName extends ExtensionValue {
+public final class AlternativeName extends ExtensionValue {
 
     // constants indicating which alternative name is presented
     // by this object
     public static final boolean ISSUER = false;
     public static final boolean SUBJECT = true;
 
-    // indicating which alternative name is presented by this object
+    /** indicating which alternative name is presented by this object */
     private boolean which;
-    // the alternative names
+    /** the alternative names */
     private GeneralNames alternativeNames;
 
     /**
-     * Creates the extension object for given alternative names.
-     * @param which specifies which alternative names are given
-     * (Subject's or Issuer's)
-     */
-    public AlternativeName(boolean which, GeneralNames alternativeNames) {
-        this.which = which;
-        this.alternativeNames = alternativeNames;
-    }
-
-    /**
      * Creates the extension object on the base of its encoded form.
      * @param which specifies which alternative names are given
      * (Subject's or Issuer's)
@@ -57,39 +46,22 @@
     public AlternativeName(boolean which, byte[] encoding) throws IOException {
         super(encoding);
         this.which = which;
-        this.alternativeNames =
-            (GeneralNames) GeneralNames.ASN1.decode(encoding);
-    }
-
-    /**
-     * Returns the list of alternative names.
-     * The list is in the collection of pairs:<br>
-     * [Integer (tag of GeneralName), Object (name value)]
-     */
-    public List getAlternativeNames() {
-        return alternativeNames.getPairsList();
+        this.alternativeNames = (GeneralNames) GeneralNames.ASN1.decode(encoding);
     }
 
     /**
      * Returns ASN.1 encoded form of this X.509 AlternativeName value.
-     * @return a byte array containing ASN.1 encode form.
      */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = GeneralNames.ASN1.encode(alternativeNames);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append((which) ? "Subject" : "Issuer")
-            .append(" Alternative Names [\n");
-        alternativeNames.dumpValue(buffer, prefix + "  ");
-        buffer.append(prefix).append("]\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append((which) ? "Subject" : "Issuer").append(" Alternative Names [\n");
+        alternativeNames.dumpValue(sb, prefix + "  ");
+        sb.append(prefix).append("]\n");
     }
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/AuthorityKeyIdentifier.java b/luni/src/main/java/org/apache/harmony/security/x509/AuthorityKeyIdentifier.java
index ad07476..be43ba7 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/AuthorityKeyIdentifier.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/AuthorityKeyIdentifier.java
@@ -51,8 +51,7 @@
  *   KeyIdentifier ::= OCTET STRING
  * </pre>
  */
-public class AuthorityKeyIdentifier extends ExtensionValue {
-
+public final class AuthorityKeyIdentifier extends ExtensionValue {
     private final byte[] keyIdentifier;
     private final GeneralNames authorityCertIssuer;
     private final BigInteger authorityCertSerialNumber;
@@ -65,41 +64,35 @@
         this.authorityCertSerialNumber = authorityCertSerialNumber;
     }
 
-    public static AuthorityKeyIdentifier decode(byte[] encoding)
-            throws IOException {
-        AuthorityKeyIdentifier aki =
-            (AuthorityKeyIdentifier) ASN1.decode(encoding);
+    public static AuthorityKeyIdentifier decode(byte[] encoding) throws IOException {
+        AuthorityKeyIdentifier aki = (AuthorityKeyIdentifier) ASN1.decode(encoding);
         aki.encoding = encoding;
         return aki;
     }
 
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(this);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("AuthorityKeyIdentifier [\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("AuthorityKeyIdentifier [\n");
         if (keyIdentifier != null) {
-            buffer.append(prefix).append("  keyIdentifier:\n");
-            buffer.append(Array.toString(keyIdentifier, prefix + "    "));
+            sb.append(prefix).append("  keyIdentifier:\n");
+            sb.append(Array.toString(keyIdentifier, prefix + "    "));
         }
         if (authorityCertIssuer != null) {
-            buffer.append(prefix).append("  authorityCertIssuer: [\n");
-            authorityCertIssuer.dumpValue(buffer, prefix + "    ");
-            buffer.append(prefix).append("  ]\n");
+            sb.append(prefix).append("  authorityCertIssuer: [\n");
+            authorityCertIssuer.dumpValue(sb, prefix + "    ");
+            sb.append(prefix).append("  ]\n");
         }
         if (authorityCertSerialNumber != null) {
-            buffer.append(prefix).append("  authorityCertSerialNumber: ")
-                .append(authorityCertSerialNumber).append('\n');
+            sb.append(prefix).append("  authorityCertSerialNumber: ");
+            sb.append(authorityCertSerialNumber).append('\n');
         }
-        buffer.append(prefix).append("]\n");
+        sb.append(prefix).append("]\n");
     }
 
     public static final ASN1Type ASN1 = new ASN1Sequence(
@@ -114,7 +107,7 @@
             setOptional(2);
         }
 
-        protected Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override protected Object getDecodedObject(BerInputStream in) throws IOException {
             Object[] values = (Object[]) in.content;
 
             byte[] enc = (byte[]) values[2];
@@ -127,10 +120,8 @@
                     (GeneralNames) values[1], authorityCertSerialNumber);
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             AuthorityKeyIdentifier akid = (AuthorityKeyIdentifier) object;
-
             values[0] = akid.keyIdentifier;
             values[1] = akid.authorityCertIssuer;
             if (akid.authorityCertSerialNumber != null) {
@@ -139,4 +130,3 @@
         }
     };
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/BasicConstraints.java b/luni/src/main/java/org/apache/harmony/security/x509/BasicConstraints.java
index 214b3a8..6a473f5 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/BasicConstraints.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/BasicConstraints.java
@@ -34,46 +34,30 @@
  *   id-ce-basicConstraints OBJECT IDENTIFIER ::=  { id-ce 19 }
  *
  *   BasicConstraints ::= SEQUENCE {
- *        cA                      BOOLEAN DEFAULT FALSE,
+ *        ca                      BOOLEAN DEFAULT FALSE,
  *        pathLenConstraint       INTEGER (0..MAX) OPTIONAL
  *   }
  * </pre>
  * (as specified in RFC 3280)
  */
-public class BasicConstraints extends ExtensionValue {
-
-    // is CA
-    private boolean cA = false;
-    // path len constraint
+public final class BasicConstraints extends ExtensionValue {
+    /** is CA */
+    private boolean ca = false;
+    /** path len constraint */
     private int pathLenConstraint = Integer.MAX_VALUE;
 
-    // Constructor for creating the extension without
-    // encoding provided
-    /**
-     * Creates the extension object on the base of the values of
-     * fields of the structure..
-     */
-    public BasicConstraints(boolean cA, int pathLenConstraint) {
-        this.cA = cA;
-        this.pathLenConstraint = pathLenConstraint;
-    }
-
     /**
      * Creates the extension object on the base of its encoded form.
      */
     public BasicConstraints(byte[] encoding) throws IOException {
         super(encoding);
         Object[] values = (Object[]) ASN1.decode(encoding);
-        cA = ((Boolean) values[0]).booleanValue();
+        ca = (Boolean) values[0];
         if (values[1] != null) {
             pathLenConstraint = new BigInteger((byte[]) values[1]).intValue();
         }
     }
 
-    public boolean getCA() {
-        return cA;
-    }
-
     public int getPathLenConstraint() {
         return pathLenConstraint;
     }
@@ -83,20 +67,14 @@
      */
     public byte[] getEncoded() {
         if (encoding == null) {
-            encoding = ASN1.encode(
-                    new Object[] {Boolean.valueOf(cA),
-                        BigInteger.valueOf(pathLenConstraint)});
+            encoding = ASN1.encode(new Object[]{ca, BigInteger.valueOf(pathLenConstraint) });
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("BasicConstraints [\n").append(prefix)
-            .append("  CA: ").append(cA)
+    public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("BasicConstraints [\n").append(prefix)
+            .append("  CA: ").append(ca)
             .append("\n  ").append(prefix).append("pathLenConstraint: ")
             .append(pathLenConstraint).append('\n').append(prefix)
             .append("]\n");
@@ -112,16 +90,14 @@
             setOptional(1);
         }
 
-        public Object getDecodedObject(BerInputStream in)
-                throws IOException {
+        public Object getDecodedObject(BerInputStream in) throws IOException {
             return in.content;
         }
 
         protected void getValues(Object object, Object[] values) {
-            Object[] vals = (Object[]) object;
-            values[0] = (Boolean) vals[0];
-            values[1] = ((BigInteger) vals[1]).toByteArray();
+            Object[] array = (Object[]) object;
+            values[0] = array[0];
+            values[1] = ((BigInteger) array[1]).toByteArray();
         }
-
     };
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/CRLDistributionPoints.java b/luni/src/main/java/org/apache/harmony/security/x509/CRLDistributionPoints.java
index 781de29..5080add 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/CRLDistributionPoints.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/CRLDistributionPoints.java
@@ -24,7 +24,6 @@
 
 import java.io.IOException;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.harmony.security.asn1.ASN1SequenceOf;
 import org.apache.harmony.security.asn1.ASN1Type;
@@ -65,19 +64,11 @@
  *  }
  * </pre>
  */
-public class CRLDistributionPoints extends ExtensionValue {
-
-    private List distributionPoints;
+public final class CRLDistributionPoints extends ExtensionValue {
+    private List<DistributionPoint> distributionPoints;
     private byte[] encoding;
 
-    public CRLDistributionPoints(List distributionPoints) {
-        if ((distributionPoints == null) || (distributionPoints.size() == 0)) {
-            throw new IllegalArgumentException("distributionPoints are empty");
-        }
-        this.distributionPoints = distributionPoints;
-    }
-
-    public CRLDistributionPoints(List distributionPoints, byte[] encoding) {
+    private CRLDistributionPoints(List<DistributionPoint> distributionPoints, byte[] encoding) {
         if ((distributionPoints == null) || (distributionPoints.size() == 0)) {
             throw new IllegalArgumentException("distributionPoints are empty");
         }
@@ -85,46 +76,36 @@
         this.encoding = encoding;
     }
 
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(this);
         }
         return encoding;
     }
 
-    public static CRLDistributionPoints decode(byte[] encoding)
-            throws IOException {
-        CRLDistributionPoints cdp = (CRLDistributionPoints) ASN1.decode(encoding);
-        return cdp;
+    public static CRLDistributionPoints decode(byte[] encoding) throws IOException {
+        return (CRLDistributionPoints) ASN1.decode(encoding);
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("CRL Distribution Points: [\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("CRL Distribution Points: [\n");
         int number = 0;
-        for (Iterator it=distributionPoints.iterator();
-                it.hasNext();) {
-            buffer.append(prefix).append("  [").append(++number).append("]\n");
-            ((DistributionPoint) it.next()).dumpValue(buffer, prefix + "  ");
+        for (DistributionPoint distributionPoint : distributionPoints) {
+            sb.append(prefix).append("  [").append(++number).append("]\n");
+            distributionPoint.dumpValue(sb, prefix + "  ");
         }
-        buffer.append(prefix).append("]\n");
+        sb.append(prefix).append("]\n");
     }
 
     /**
      * Custom X.509 decoder.
      */
-    public static final ASN1Type ASN1 =
-        new ASN1SequenceOf(DistributionPoint.ASN1) {
-
-        public Object getDecodedObject(BerInputStream in) {
-            return new CRLDistributionPoints((List)in.content,
-                    in.getEncoded());
+    public static final ASN1Type ASN1 = new ASN1SequenceOf(DistributionPoint.ASN1) {
+        @Override public Object getDecodedObject(BerInputStream in) {
+            return new CRLDistributionPoints((List<DistributionPoint>) in.content, in.getEncoded());
         }
 
-        public Collection getValues(Object object) {
+        @Override public Collection<?> getValues(Object object) {
             CRLDistributionPoints dps = (CRLDistributionPoints) object;
             return dps.distributionPoints;
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/CRLNumber.java b/luni/src/main/java/org/apache/harmony/security/x509/CRLNumber.java
index 72a20ec..0038068 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/CRLNumber.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/CRLNumber.java
@@ -33,19 +33,11 @@
  * </pre>
  * (as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt)
  */
-public class CRLNumber extends ExtensionValue {
-
-    // crl number value
+public final class CRLNumber extends ExtensionValue {
+    /** crl number value */
     private final BigInteger number;
 
     /**
-     * Constructs the object on the base of the invalidity date value.
-     */
-    public CRLNumber(BigInteger number) {
-        this.number = number;
-    }
-
-    /**
      * Constructs the object on the base of its encoded form.
      */
     public CRLNumber(byte[] encoding) throws IOException {
@@ -62,22 +54,16 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 CRLNumber value.
-     * @return a byte array containing ASN.1 encoded form.
      */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(number.toByteArray());
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("CRL Number: [ ").append(number).append(
-                " ]\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("CRL Number: [ ").append(number).append(" ]\n");
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/Certificate.java b/luni/src/main/java/org/apache/harmony/security/x509/Certificate.java
index ca1abb0..d4bb29e6 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/Certificate.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/Certificate.java
@@ -45,23 +45,16 @@
  *  }
  * </pre>
  */
-public class Certificate {
-
-    // the value of tbsCertificate field of the structure
+public final class Certificate {
+    /** the value of tbsCertificate field of the structure */
     private final TBSCertificate tbsCertificate;
-    // the value of signatureAlgorithm field of the structure
+    /** the value of signatureAlgorithm field of the structure */
     private final AlgorithmIdentifier signatureAlgorithm;
-    // the value of signatureValue field of the structure
+    /** the value of signatureValue field of the structure */
     private final byte[] signatureValue;
-    // the ASN.1 encoded form of Certificate
+    /** the ASN.1 encoded form of Certificate */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   tbsCertificate: TBSCertificate
-     * @param   signatureAlgorithm: AlgorithmIdentifier
-     * @param   signatureValue: byte[]
-     */
     public Certificate(TBSCertificate tbsCertificate,
                        AlgorithmIdentifier signatureAlgorithm,
                        byte[] signatureValue) {
@@ -72,13 +65,6 @@
                                                     signatureValue.length);
     }
 
-    //
-    // TODO
-    // @param   tbsCertificate: TBSCertificate
-    // @param   signatureAlgorithm: AlgorithmIdentifier
-    // @param   signatureValue: byte[]
-    // @param   encoding:   byte[]
-    //
     private Certificate(TBSCertificate tbsCertificate,
                        AlgorithmIdentifier signatureAlgorithm,
                        byte[] signatureValue, byte[] encoding) {
@@ -88,46 +74,33 @@
 
     /**
      * Returns the value of tbsCertificate field of the structure.
-     * @return  tbsCertificate
      */
     public TBSCertificate getTbsCertificate() {
         return tbsCertificate;
     }
 
     /**
-     * Returns the value of signatureAlgorithm field of the structure.
-     * @return  signatureAlgorithm
-     */
-    public AlgorithmIdentifier getSignatureAlgorithm() {
-        return signatureAlgorithm;
-    }
-
-    /**
      * Returns the value of signatureValue field of the structure.
-     * @return  signatureValue
      */
     public byte[] getSignatureValue() {
-        byte[] result = new byte[signatureValue.length];
-        System.arraycopy(signatureValue, 0, result, 0, signatureValue.length);
-        return result;
+        return signatureValue.clone();
     }
 
-    public String toString() {
-        StringBuffer buffer = new StringBuffer();
-        buffer.append("X.509 Certificate:\n[\n");
-        tbsCertificate.dumpValue(buffer);
-        buffer.append("\n  Algorithm: [");
-        signatureAlgorithm.dumpValue(buffer);
-        buffer.append(']');
-        buffer.append("\n  Signature Value:\n");
-        buffer.append(Array.toString(signatureValue, ""));
-        buffer.append(']');
-        return buffer.toString();
+    @Override public String toString() {
+        StringBuilder result = new StringBuilder();
+        result.append("X.509 Certificate:\n[\n");
+        tbsCertificate.dumpValue(result);
+        result.append("\n  Algorithm: [");
+        signatureAlgorithm.dumpValue(result);
+        result.append(']');
+        result.append("\n  Signature Value:\n");
+        result.append(Array.toString(signatureValue, ""));
+        result.append(']');
+        return result.toString();
     }
 
     /**
      * Returns ASN.1 encoded form of this X.509 TBSCertificate value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -143,24 +116,20 @@
         new ASN1Sequence(new ASN1Type[]
                 {TBSCertificate.ASN1, AlgorithmIdentifier.ASN1, ASN1BitString.getInstance()}) {
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new Certificate(
                     (TBSCertificate) values[0],
                     (AlgorithmIdentifier) values[1],
                     ((BitString) values[2]).bytes, // FIXME keep as BitString object
-                    in.getEncoded()
-                    );
+                    in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             Certificate cert = (Certificate) object;
-
             values[0] = cert.tbsCertificate;
             values[1] = cert.signatureAlgorithm;
             values[2] = new BitString(cert.signatureValue, 0);
         }
     };
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/CertificateIssuer.java b/luni/src/main/java/org/apache/harmony/security/x509/CertificateIssuer.java
index 4627a9b..544ff8e 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/CertificateIssuer.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/CertificateIssuer.java
@@ -37,28 +37,17 @@
  * In java implementation it is presumed that GeneralNames consist of
  * one element and its type is directoryName.
  */
-public class CertificateIssuer extends ExtensionValue {
-
-    // certificate issuer value
+public final class CertificateIssuer extends ExtensionValue {
+    /** certificate issuer value */
     private X500Principal issuer;
 
     /**
-     * Creates an object on the base of GeneralName structure.
-     */
-    public CertificateIssuer(GeneralName issuer) {
-        super(ASN1.encode(issuer));
-    }
-
-    /**
      * Creates an object on the base of its encoded form.
      */
     public CertificateIssuer(byte[] encoding) {
         super(encoding);
     }
 
-    /**
-     * Returns the issuer.
-     */
     public X500Principal getIssuer() throws IOException {
         if (issuer == null) {
             issuer = (X500Principal) ASN1.decode(getEncoded());
@@ -66,36 +55,30 @@
         return issuer;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Certificate Issuer: ");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Certificate Issuer: ");
         if (issuer == null) {
             try {
                 issuer = getIssuer();
             } catch (IOException e) {
                 // incorrect extension value encoding
-                buffer.append("Unparseable (incorrect!) extension value:\n");
-                super.dumpValue(buffer);
+                sb.append("Unparseable (incorrect!) extension value:\n");
+                super.dumpValue(sb);
             }
         }
-        buffer.append(issuer).append('\n');
+        sb.append(issuer).append('\n');
     }
 
     /**
      * ASN.1 Encoder/Decoder.
      */
-    public static final ASN1Type ASN1 = new ASN1Sequence(new ASN1Type[] {
-        GeneralName.ASN1
-    }) {
-        public Object getDecodedObject(BerInputStream in) {
+    public static final ASN1Type ASN1 = new ASN1Sequence(new ASN1Type[] { GeneralName.ASN1 }) {
+        @Override public Object getDecodedObject(BerInputStream in) {
             return ((Name) ((GeneralName) ((Object[]) in.content)[0])
                     .getName()).getX500Principal();
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             values[0] = object;
         }
     };
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/CertificateList.java b/luni/src/main/java/org/apache/harmony/security/x509/CertificateList.java
index fbc170d..85d8789 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/CertificateList.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/CertificateList.java
@@ -45,23 +45,16 @@
  *  }
  * </pre>
  */
-public class CertificateList {
-
-    // the value of tbsCertList field of the structure
+public final class CertificateList {
+    /** the value of tbsCertList field of the structure */
     private final TBSCertList tbsCertList;
-    // the value of signatureAlgorithm field of the structure
+    /** the value of signatureAlgorithm field of the structure */
     private final AlgorithmIdentifier signatureAlgorithm;
-    // the value of signatureValue field of the structure
+    /** the value of signatureValue field of the structure */
     private final byte[] signatureValue;
-    // the ASN.1 encoded form of CertList
+    /** the ASN.1 encoded form of CertList */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   tbsCertList: TBSCertList
-     * @param   signatureAlgorithm: AlgorithmIdentifier
-     * @param   signatureValue: byte[]
-     */
     public CertificateList(TBSCertList tbsCertList,
                        AlgorithmIdentifier signatureAlgorithm,
                        byte[] signatureValue) {
@@ -72,13 +65,6 @@
                                                     signatureValue.length);
     }
 
-    //
-    // TODO
-    // @param   tbsCertList: TBSCertList
-    // @param   signatureAlgorithm: AlgorithmIdentifier
-    // @param   signatureValue: byte[]
-    // @param   encoding:   byte[]
-    //
     private CertificateList(TBSCertList tbsCertList,
                        AlgorithmIdentifier signatureAlgorithm,
                        byte[] signatureValue, byte[] encoding) {
@@ -88,23 +74,13 @@
 
     /**
      * Returns the value of tbsCertList field of the structure.
-     * @return  tbsCertList
      */
     public TBSCertList getTbsCertList() {
         return tbsCertList;
     }
 
     /**
-     * Returns the value of signatureAlgorithm field of the structure.
-     * @return  signatureAlgorithm
-     */
-    public AlgorithmIdentifier getSignatureAlgorithm() {
-        return signatureAlgorithm;
-    }
-
-    /**
      * Returns the value of signatureValue field of the structure.
-     * @return  signatureValue
      */
     public byte[] getSignatureValue() {
         byte[] result = new byte[signatureValue.length];
@@ -112,17 +88,16 @@
         return result;
     }
 
-    public String toString() {
-        StringBuffer res = new StringBuffer();
-        tbsCertList.dumpValue(res);
-        res.append("\nSignature Value:\n");
-        res.append(Array.toString(signatureValue, ""));
-        return res.toString();
+    @Override public String toString() {
+        StringBuilder result = new StringBuilder();
+        tbsCertList.dumpValue(result);
+        result.append("\nSignature Value:\n");
+        result.append(Array.toString(signatureValue, ""));
+        return result.toString();
     }
 
     /**
      * Returns ASN.1 encoded form of this X.509 TBSCertList value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -139,7 +114,7 @@
                 {TBSCertList.ASN1, AlgorithmIdentifier.ASN1,
                     ASN1BitString.getInstance()}) {
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new CertificateList(
                     (TBSCertList) values[0],
@@ -149,14 +124,11 @@
                     );
         }
 
-        protected void getValues(Object object, Object[] values) {
-
-            CertificateList certlist = (CertificateList) object;
-
-            values[0] = certlist.tbsCertList;
-            values[1] = certlist.signatureAlgorithm;
-            values[2] = new BitString(certlist.signatureValue, 0);
+        @Override protected void getValues(Object object, Object[] values) {
+            CertificateList certificateList = (CertificateList) object;
+            values[0] = certificateList.tbsCertList;
+            values[1] = certificateList.signatureAlgorithm;
+            values[2] = new BitString(certificateList.signatureValue, 0);
         }
     };
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/CertificatePolicies.java b/luni/src/main/java/org/apache/harmony/security/x509/CertificatePolicies.java
index 86ac9a1..5f2959a 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/CertificatePolicies.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/CertificatePolicies.java
@@ -25,7 +25,6 @@
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.harmony.security.asn1.ASN1SequenceOf;
 import org.apache.harmony.security.asn1.ASN1Type;
@@ -42,14 +41,11 @@
  * <pre>
  *   certificatePolicies ::= SEQUENCE SIZE (1..MAX) OF PolicyInformation
  * </pre>
- *
  */
-
-public class CertificatePolicies extends ExtensionValue {
-
-    // the values of policyInformation field of the structure
-    private List policyInformations;
-    // the ASN.1 encoded form of CertificatePolicies
+public final class CertificatePolicies extends ExtensionValue {
+    /** the values of policyInformation field of the structure */
+    private List<PolicyInformation> policyInformations;
+    /** the ASN.1 encoded form of CertificatePolicies */
     private byte[] encoding;
 
     /**
@@ -57,49 +53,28 @@
      */
     public CertificatePolicies() {}
 
-    /**
-     * TODO
-     * @param   policyInformations: List
-     */
-    public CertificatePolicies(List policyInformations) {
-        this.policyInformations = policyInformations;
-    }
-
-    public static CertificatePolicies decode(byte[] encoding)
-            throws IOException {
+    public static CertificatePolicies decode(byte[] encoding) throws IOException {
         CertificatePolicies cps = ((CertificatePolicies) ASN1.decode(encoding));
         cps.encoding = encoding;
         return cps;
     }
 
-    //
-    // TODO
-    // @param   policyInformations: List
-    // @param   encoding:   byte[]
-    //
-    private CertificatePolicies(List policyInformations, byte[] encoding) {
+    private CertificatePolicies(List<PolicyInformation> policyInformations, byte[] encoding) {
         this.policyInformations = policyInformations;
         this.encoding = encoding;
     }
 
     /**
      * Returns the values of policyInformation field of the structure.
-     * @return  policyInformations
      */
-    public List getPolicyInformations() {
-        return new ArrayList(policyInformations);
+    public List<PolicyInformation> getPolicyInformations() {
+        return new ArrayList<PolicyInformation>(policyInformations);
     }
 
-    /**
-     * TODO
-     * @param   policyInformation:  PolicyInformation
-     * @return
-     */
-    public CertificatePolicies addPolicyInformation(
-            PolicyInformation policyInformation) {
+    public CertificatePolicies addPolicyInformation(PolicyInformation policyInformation) {
         encoding = null;
         if (policyInformations == null) {
-            policyInformations = new ArrayList();
+            policyInformations = new ArrayList<PolicyInformation>();
         }
         policyInformations.add(policyInformation);
         return this;
@@ -107,44 +82,36 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 CertificatePolicies value.
-     * @return a byte array containing ASN.1 encode form.
      */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(this);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("CertificatePolicies [\n");
-        for (Iterator it=policyInformations.iterator(); it.hasNext();) {
-            buffer.append(prefix);
-            buffer.append("  ");
-            ((PolicyInformation) it.next()).dumpValue(buffer);
-            buffer.append('\n');
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("CertificatePolicies [\n");
+        for (PolicyInformation policyInformation : policyInformations) {
+            sb.append(prefix);
+            sb.append("  ");
+            policyInformation.dumpValue(sb);
+            sb.append('\n');
         }
-        buffer.append(prefix).append("]\n");
+        sb.append(prefix).append("]\n");
     }
 
     /**
      * ASN.1 DER X.509 CertificatePolicies encoder/decoder class.
      */
-    public static final ASN1Type ASN1 =
-        new ASN1SequenceOf(PolicyInformation.ASN1) {
-
-        public Object getDecodedObject(BerInputStream in) {
-            return new CertificatePolicies((List) in.content, in.getEncoded());
+    public static final ASN1Type ASN1 = new ASN1SequenceOf(PolicyInformation.ASN1) {
+        @Override public Object getDecodedObject(BerInputStream in) {
+            return new CertificatePolicies((List<PolicyInformation>) in.content, in.getEncoded());
         }
 
-        public Collection getValues(Object object) {
+        @Override public Collection getValues(Object object) {
             CertificatePolicies cps = (CertificatePolicies) object;
             return cps.policyInformations;
         }
     };
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/DNParser.java b/luni/src/main/java/org/apache/harmony/security/x509/DNParser.java
index 4f2ccd8..980ab05 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/DNParser.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/DNParser.java
@@ -42,45 +42,38 @@
  * RFC 1779: A String Representation of Distinguished Names
  *   http://www.ietf.org/rfc/rfc1779.txt
  */
-public class DNParser {
+public final class DNParser {
+    private int pos;
+    private int beg;
+    private int end;
 
-    // length of distinguished name string
-    protected final int length;
+    /** distinguished name chars */
+    private final char[] chars;
 
-    protected int pos, beg, end;
+    /** raw string contains '"' or '\' */
+    private boolean hasQE;
 
-    // tmp vars to store positions of the currently parsed item
-    protected int cur;
-
-    // distinguished name chars
-    protected char[] chars;
-
-    // raw string contains '"' or '\'
-    protected boolean hasQE;
-
-    // DER encoding of currently parsed item
-    protected byte[] encoded;
+    /** DER encoding of currently parsed item */
+    private byte[] encoded;
 
     /**
-     * Constructs DN parser
-     *
      * @param dn - distinguished name string to be parsed
      */
     public DNParser(String dn) throws IOException {
-        this.length = dn.length();
         chars = dn.toCharArray();
     }
 
-    // gets next attribute type: (ALPHA 1*keychar) / oid
-    protected String nextAT() throws IOException {
-
+    /**
+     * Returns the next attribute type: (ALPHA 1*keychar) / oid
+     */
+    private String nextAT() throws IOException {
         hasQE = false; // reset
 
         // skip preceding space chars, they can present after
         // comma or semicolon (compatibility with RFC 1779)
-        for (; pos < length && chars[pos] == ' '; pos++) {
+        for (; pos < chars.length && chars[pos] == ' '; pos++) {
         }
-        if (pos == length) {
+        if (pos == chars.length) {
             return null; // reached the end of DN
         }
 
@@ -89,11 +82,11 @@
 
         // attribute type chars
         pos++;
-        for (; pos < length && chars[pos] != '=' && chars[pos] != ' '; pos++) {
+        for (; pos < chars.length && chars[pos] != '=' && chars[pos] != ' '; pos++) {
             // we don't follow exact BNF syntax here:
             // accept any char except space and '='
         }
-        if (pos >= length) {
+        if (pos >= chars.length) {
             // unexpected end of DN
             throw new IOException("Invalid distinguished name string");
         }
@@ -104,10 +97,10 @@
         // skip trailing space chars between attribute type and '='
         // (compatibility with RFC 1779)
         if (chars[pos] == ' ') {
-            for (; pos < length && chars[pos] != '=' && chars[pos] == ' '; pos++) {
+            for (; pos < chars.length && chars[pos] != '=' && chars[pos] == ' '; pos++) {
             }
 
-            if (chars[pos] != '=' || pos == length) {
+            if (chars[pos] != '=' || pos == chars.length) {
                 // unexpected end of DN
                 throw new IOException("Invalid distinguished name string");
             }
@@ -117,7 +110,7 @@
 
         // skip space chars between '=' and attribute value
         // (compatibility with RFC 1779)
-        for (; pos < length && chars[pos] == ' '; pos++) {
+        for (; pos < chars.length && chars[pos] == ' '; pos++) {
         }
 
         // in case of oid attribute type skip its prefix: "oid." or "OID."
@@ -132,15 +125,15 @@
         return new String(chars, beg, end - beg);
     }
 
-    // gets quoted attribute value: QUOTATION *( quotechar / pair ) QUOTATION
-    protected String quotedAV() throws IOException {
-
+    /**
+     * Returns a quoted attribute value: QUOTATION *( quotechar / pair ) QUOTATION
+     */
+    private String quotedAV() throws IOException {
         pos++;
         beg = pos;
         end = beg;
         while (true) {
-
-            if (pos == length) {
+            if (pos == chars.length) {
                 // unexpected end of DN
                 throw new IOException("Invalid distinguished name string");
             }
@@ -161,16 +154,17 @@
 
         // skip trailing space chars before comma or semicolon.
         // (compatibility with RFC 1779)
-        for (; pos < length && chars[pos] == ' '; pos++) {
+        for (; pos < chars.length && chars[pos] == ' '; pos++) {
         }
 
         return new String(chars, beg, end - beg);
     }
 
-    // gets hex string attribute value: "#" hexstring
+    /**
+     * Returns a hex string attribute value: "#" hexstring
+     */
     private String hexAV() throws IOException {
-
-        if (pos + 4 >= length) {
+        if (pos + 4 >= chars.length) {
             // encoded byte array  must be not less then 4 c
             throw new IOException("Invalid distinguished name string");
         }
@@ -178,10 +172,9 @@
         beg = pos; // store '#' position
         pos++;
         while (true) {
-
             // check for end of attribute value
             // looks for space and component separators
-            if (pos == length || chars[pos] == '+' || chars[pos] == ','
+            if (pos == chars.length || chars[pos] == '+' || chars[pos] == ','
                     || chars[pos] == ';') {
                 end = pos;
                 break;
@@ -192,7 +185,7 @@
                 pos++;
                 // skip trailing space chars before comma or semicolon.
                 // (compatibility with RFC 1779)
-                for (; pos < length && chars[pos] == ' '; pos++) {
+                for (; pos < chars.length && chars[pos] == ' '; pos++) {
                 }
                 break;
             } else if (chars[pos] >= 'A' && chars[pos] <= 'F') {
@@ -218,14 +211,14 @@
         return new String(chars, beg, hexLen);
     }
 
-    // gets string attribute value: *( stringchar / pair )
-    protected String escapedAV() throws IOException {
-
+    /**
+     * Returns a string attribute value: *( stringchar / pair ).
+     */
+    private String escapedAV() throws IOException {
         beg = pos;
         end = pos;
         while (true) {
-
-            if (pos >= length) {
+            if (pos >= chars.length) {
                 // the end of DN has been found
                 return new String(chars, beg, end - beg);
             }
@@ -244,15 +237,15 @@
             case ' ':
                 // need to figure out whether space defines
                 // the end of attribute value or not
-                cur = end;
+                int cur = end;
 
                 pos++;
                 chars[end++] = ' ';
 
-                for (; pos < length && chars[pos] == ' '; pos++) {
+                for (; pos < chars.length && chars[pos] == ' '; pos++) {
                     chars[end++] = ' ';
                 }
-                if (pos == length || chars[pos] == ',' || chars[pos] == '+'
+                if (pos == chars.length || chars[pos] == ',' || chars[pos] == '+'
                         || chars[pos] == ';') {
                     // separator char or the end of DN has beed found
                     return new String(chars, beg, cur - beg);
@@ -265,11 +258,12 @@
         }
     }
 
-    // returns escaped char
+    /**
+     * Returns an escaped char
+     */
     private char getEscaped() throws IOException {
-
         pos++;
-        if (pos == length) {
+        if (pos == chars.length) {
             throw new IOException("Invalid distinguished name string");
         }
 
@@ -299,10 +293,10 @@
         }
     }
 
-    // decodes UTF-8 char
-    // see http://www.unicode.org for UTF-8 bit distribution table
+    /**
+     * Decodes a UTF-8 char.
+     */
     protected char getUTF8() throws IOException {
-
         int res = getByte(pos);
         pos++; //FIXME tmp
 
@@ -325,7 +319,7 @@
             int b;
             for (int i = 0; i < count; i++) {
                 pos++;
-                if (pos == length || chars[pos] != '\\') {
+                if (pos == chars.length || chars[pos] != '\\') {
                     return 0x3F; //FIXME failed to decode UTF-8 char - return '?'
                 }
                 pos++;
@@ -344,22 +338,21 @@
         }
     }
 
-    // Returns byte representation of a char pair
-    // The char pair is composed of DN char in
-    // specified 'position' and the next char
-    // According to BNF syntax:
-    // hexchar    = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
-    //                    / "a" / "b" / "c" / "d" / "e" / "f"
-    protected int getByte(int position) throws IOException {
-
-        if ((position + 1) >= length) {
+    /**
+     * Returns byte representation of a char pair
+     * The char pair is composed of DN char in
+     * specified 'position' and the next char
+     * According to BNF syntax:
+     * hexchar    = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"
+     *                     / "a" / "b" / "c" / "d" / "e" / "f"
+     */
+    private int getByte(int position) throws IOException {
+        if ((position + 1) >= chars.length) {
             // to avoid ArrayIndexOutOfBoundsException
             throw new IOException("Invalid distinguished name string");
         }
 
-        int b1, b2;
-
-        b1 = chars[position];
+        int b1 = chars[position];
         if (b1 >= '0' && b1 <= '9') {
             b1 = b1 - '0';
         } else if (b1 >= 'a' && b1 <= 'f') {
@@ -370,7 +363,7 @@
             throw new IOException("Invalid distinguished name string");
         }
 
-        b2 = chars[position + 1];
+        int b2 = chars[position + 1];
         if (b2 >= '0' && b2 <= '9') {
             b2 = b2 - '0';
         } else if (b2 >= 'a' && b2 <= 'f') {
@@ -390,62 +383,49 @@
      * @return a list of Relative Distinguished Names(RND),
      *         each RDN is represented as a list of AttributeTypeAndValue objects
      */
-    public List parse() throws IOException {
+    public List<List<AttributeTypeAndValue>> parse() throws IOException {
+        List<List<AttributeTypeAndValue>> list = new ArrayList<List<AttributeTypeAndValue>>();
 
-        List list = new ArrayList();
-
-        String attValue;
         String attType = nextAT();
         if (attType == null) {
             return list; //empty list of RDNs
         }
 
-        List atav = new ArrayList();
+        List<AttributeTypeAndValue> atav = new ArrayList<AttributeTypeAndValue>();
         while (true) {
-
-            if (pos == length) {
-
+            if (pos == chars.length) {
                 //empty Attribute Value
-                atav.add(new AttributeTypeAndValue(attType, new AttributeValue(
-                        "", false)));
+                atav.add(new AttributeTypeAndValue(attType, new AttributeValue("", false)));
                 list.add(0, atav);
-
                 return list;
             }
 
             switch (chars[pos]) {
             case '"':
-                attValue = quotedAV();
-                atav.add(new AttributeTypeAndValue(attType, new AttributeValue(
-                        attValue, hasQE)));
+                atav.add(new AttributeTypeAndValue(attType, new AttributeValue(quotedAV(), hasQE)));
                 break;
             case '#':
-                attValue = hexAV();
-
-                atav.add(new AttributeTypeAndValue(attType, new AttributeValue(
-                        attValue, encoded)));
+                atav.add(new AttributeTypeAndValue(attType, new AttributeValue(hexAV(), encoded)));
                 break;
             case '+':
             case ',':
             case ';': // compatibility with RFC 1779: semicolon can separate RDNs
                 //empty attribute value
-                atav.add(new AttributeTypeAndValue(attType, new AttributeValue(
-                        "", false)));
+                atav.add(new AttributeTypeAndValue(attType, new AttributeValue("", false)));
                 break;
             default:
-                attValue = escapedAV();
                 atav.add(new AttributeTypeAndValue(attType, new AttributeValue(
-                        attValue, hasQE)));
+                        escapedAV(), hasQE)));
             }
 
-            if (pos >= length) {
+            if (pos >= chars.length) {
                 list.add(0, atav);
                 return list;
             }
 
             if (chars[pos] == ',' || chars[pos] == ';') {
                 list.add(0, atav);
-                atav = new ArrayList();
+                atav = new ArrayList<AttributeTypeAndValue>();
             } else if (chars[pos] != '+') {
                 throw new IOException("Invalid distinguished name string");
             }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/DistributionPoint.java b/luni/src/main/java/org/apache/harmony/security/x509/DistributionPoint.java
index f631582..c82d4a0 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/DistributionPoint.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/DistributionPoint.java
@@ -64,18 +64,11 @@
  *  }
  * </pre>
  */
-public class DistributionPoint {
-
+public final class DistributionPoint {
     private final DistributionPointName distributionPoint;
     private final ReasonFlags reasons;
     private final GeneralNames cRLIssuer;
 
-    public DistributionPoint() {
-        distributionPoint = null;
-        reasons = null;
-        cRLIssuer = null;
-    }
-
     public DistributionPoint(DistributionPointName distributionPoint,
             ReasonFlags reasons, GeneralNames cRLIssuer) {
         if ((reasons != null) && (distributionPoint == null) && (cRLIssuer == null)) {
@@ -86,28 +79,24 @@
         this.cRLIssuer = cRLIssuer;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix);
-        buffer.append("Distribution Point: [\n");
+    public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix);
+        sb.append("Distribution Point: [\n");
         if (distributionPoint != null) {
-            distributionPoint.dumpValue(buffer, prefix + "  ");
+            distributionPoint.dumpValue(sb, prefix + "  ");
         }
         if (reasons != null) {
-            reasons.dumpValue(buffer, prefix + "  ");
+            reasons.dumpValue(sb, prefix + "  ");
         }
         if (cRLIssuer != null) {
-            buffer.append(prefix);
-            buffer.append("  CRL Issuer: [\n");
-            cRLIssuer.dumpValue(buffer, prefix + "    ");
-            buffer.append(prefix);
-            buffer.append("  ]\n");
+            sb.append(prefix);
+            sb.append("  CRL Issuer: [\n");
+            cRLIssuer.dumpValue(sb, prefix + "    ");
+            sb.append(prefix);
+            sb.append("  ]\n");
         }
-        buffer.append(prefix);
-        buffer.append("]\n");
+        sb.append(prefix);
+        sb.append("]\n");
     }
 
     /**
@@ -124,13 +113,13 @@
             setOptional(2);
         }
 
-        protected Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override protected Object getDecodedObject(BerInputStream in) throws IOException {
             Object[] values = (Object[]) in.content;
             return new DistributionPoint((DistributionPointName) values[0],
                     (ReasonFlags) values[1], (GeneralNames) values[2]);
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             DistributionPoint dp = (DistributionPoint) object;
             values[0] = dp.distributionPoint;
             values[1] = dp.reasons;
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/DistributionPointName.java b/luni/src/main/java/org/apache/harmony/security/x509/DistributionPointName.java
index 79bee58..893c2ce 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/DistributionPointName.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/DistributionPointName.java
@@ -66,12 +66,10 @@
  *  }
  * </pre>
  */
-public class DistributionPointName {
-
+public final class DistributionPointName {
     private final GeneralNames fullName;
     private final Name nameRelativeToCRLIssuer;
 
-
     public DistributionPointName(GeneralNames fullName) {
         this.fullName = fullName;
         this.nameRelativeToCRLIssuer = null;
@@ -82,23 +80,18 @@
         this.nameRelativeToCRLIssuer = nameRelativeToCRLIssuer;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix);
-        buffer.append("Distribution Point Name: [\n");
+    public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix);
+        sb.append("Distribution Point Name: [\n");
         if (fullName != null) {
-            fullName.dumpValue(buffer, prefix + "  ");
+            fullName.dumpValue(sb, prefix + "  ");
         } else {
-            buffer.append(prefix);
-            buffer.append("  ");
-            buffer.append(nameRelativeToCRLIssuer.getName(
-                        X500Principal.RFC2253));
+            sb.append(prefix);
+            sb.append("  ");
+            sb.append(nameRelativeToCRLIssuer.getName(X500Principal.RFC2253));
         }
-        buffer.append(prefix);
-        buffer.append("]\n");
+        sb.append(prefix);
+        sb.append("]\n");
     }
 
     public static final ASN1Choice ASN1 = new ASN1Choice(new ASN1Type[] {
@@ -110,7 +103,7 @@
             return (dpn.fullName == null) ? 1 : 0;
         }
 
-        protected Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override protected Object getDecodedObject(BerInputStream in) throws IOException {
             DistributionPointName result = null;
             if (in.choiceIndex == 0) {
                 result = new DistributionPointName((GeneralNames) in.content);
@@ -132,4 +125,3 @@
         }
     };
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/EDIPartyName.java b/luni/src/main/java/org/apache/harmony/security/x509/EDIPartyName.java
index c0197b4..d64e65b 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/EDIPartyName.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/EDIPartyName.java
@@ -51,56 +51,22 @@
  *   }
  * </pre>
  */
-public class EDIPartyName {
-    // the value of nameAssigner field of the structure
-    private String nameAssigner;
-    // the value of partyName field of the structure
-    private String partyName;
-    // the ASN.1 encoded form of EDIPartyName
+public final class EDIPartyName {
+    /** the value of nameAssigner field of the structure */
+    private final String nameAssigner;
+    /** the value of partyName field of the structure */
+    private final String partyName;
+    /** the ASN.1 encoded form of EDIPartyName */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   nameAssigner:   String
-     * @param   partyName:  String
-     */
-    public EDIPartyName(String nameAssigner, String partyName) {
-        this.nameAssigner = nameAssigner;
-        this.partyName = partyName;
-    }
-
-    //
-    // TODO
-    // @param   nameAssigner:   String
-    // @param   partyName:  String
-    // @param   encoding:   byte[]
-    //
-    private EDIPartyName(String nameAssigner, String partyName,
-                         byte[] encoding) {
+    private EDIPartyName(String nameAssigner, String partyName, byte[] encoding) {
         this.nameAssigner = nameAssigner;
         this.partyName = partyName;
         this.encoding = encoding;
     }
 
     /**
-     * Returns the value of nameAssigner field of the structure.
-     * @return  nameAssigner
-     */
-    public String getNameAssigner() {
-        return nameAssigner;
-    }
-
-    /**
-     * Returns the value of partyName field of the structure.
-     * @return  partyName
-     */
-    public String getPartyName() {
-        return partyName;
-    }
-
-    /**
      * Returns ASN.1 encoded form of this X.509 EDIPartyName value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -121,13 +87,13 @@
             setOptional(0);
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new EDIPartyName((String) values[0], (String) values[1],
                     in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             EDIPartyName epn = (EDIPartyName) object;
             values[0] = epn.nameAssigner;
             values[1] = epn.partyName;
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/ExtendedKeyUsage.java b/luni/src/main/java/org/apache/harmony/security/x509/ExtendedKeyUsage.java
index fd9223a..9a91503 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/ExtendedKeyUsage.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/ExtendedKeyUsage.java
@@ -40,18 +40,10 @@
  * </pre>
  * (as specified in RFC 3280  http://www.ietf.org/rfc/rfc3280.txt
  */
-public class ExtendedKeyUsage extends ExtensionValue {
+public final class ExtendedKeyUsage extends ExtensionValue {
 
     // the value of extension
-    private List keys;
-
-    /**
-     * Creates an object on the base of list of integer arrays representing
-     * key purpose IDs.
-     */
-    public ExtendedKeyUsage(List keys) {
-        this.keys = keys;
-    }
+    private List<String> keys;
 
     /**
      * Creates the extension object on the base of its encoded form.
@@ -64,59 +56,48 @@
      * Returns the list of string representation of OIDs corresponding
      * to key purpose IDs.
      */
-    public List getExtendedKeyUsage() throws IOException {
+    public List<String> getExtendedKeyUsage() throws IOException {
         if (keys == null) {
-            keys = (List) ASN1.decode(getEncoded());
+            keys = (List<String>) ASN1.decode(getEncoded());
         }
         return keys;
     }
 
-    /**
-     * Returns the encoded form of the object.
-     */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(keys);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Extended Key Usage: ");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Extended Key Usage: ");
         if (keys == null) {
             try {
                 keys = getExtendedKeyUsage();
             } catch (IOException e) {
                 // incorrect extension value encoding
-                super.dumpValue(buffer);
+                super.dumpValue(sb);
                 return;
             }
         }
-        buffer.append('[');
-        for (Iterator it=keys.iterator(); it.hasNext();) {
-            buffer.append(" \"").append(it.next()).append('"');
+        sb.append('[');
+        for (Iterator<?> it = keys.iterator(); it.hasNext();) {
+            sb.append(" \"").append(it.next()).append('"');
             if (it.hasNext()) {
-                buffer.append(',');
+                sb.append(',');
             }
         }
-        buffer.append(" ]\n");
+        sb.append(" ]\n");
     }
 
     /**
      * ASN.1 Encoder/Decoder.
      */
-    public static final ASN1Type ASN1 =
-        new ASN1SequenceOf(new ASN1Oid() {
-
-            public Object getDecodedObject(BerInputStream in)
-                    throws IOException {
-                int[] oid = (int[]) super.getDecodedObject(in);
-                return ObjectIdentifier.toString(oid);
-            }
-
-        });
+    public static final ASN1Type ASN1 = new ASN1SequenceOf(new ASN1Oid() {
+        public Object getDecodedObject(BerInputStream in) throws IOException {
+            int[] oid = (int[]) super.getDecodedObject(in);
+            return ObjectIdentifier.toString(oid);
+        }
+    });
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/Extension.java b/luni/src/main/java/org/apache/harmony/security/x509/Extension.java
index f30c73f..e5011e8 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/Extension.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/Extension.java
@@ -49,8 +49,7 @@
  *  }
  * </pre>
  */
-
-public class Extension {
+public final class Extension {
     // critical constants
     public static final boolean CRITICAL = true;
     public static final boolean NON_CRITICAL = false;
@@ -102,12 +101,6 @@
     // tells whether extension value has been decoded or not
     private boolean valueDecoded = false;
 
-    /**
-     * TODO
-     * @param   extnID: String
-     * @param   critical:   boolean
-     * @param   extnValue:  byte[]
-     */
     public Extension(String extnID, boolean critical,
             ExtensionValue extnValueObject) {
         this.extnID_str = extnID;
@@ -118,12 +111,6 @@
         this.extnValue = extnValueObject.getEncoded();
     }
 
-    /**
-     * TODO
-     * @param   extnID: String
-     * @param   critical:   boolean
-     * @param   extnValue:  byte[]
-     */
     public Extension(String extnID, boolean critical, byte[] extnValue) {
         this.extnID_str = extnID;
         this.extnID = ObjectIdentifier.toIntArray(extnID);
@@ -131,43 +118,20 @@
         this.extnValue = extnValue;
     }
 
-    /**
-     * TODO
-     * @param   extnID: int[]
-     * @param   critical:   boolean
-     * @param   extnValue:  byte[]
-     */
     public Extension(int[] extnID, boolean critical, byte[] extnValue) {
         this.extnID = extnID;
         this.critical = critical;
         this.extnValue = extnValue;
     }
 
-    /**
-     * TODO
-     * @param   extnID: String
-     * @param   extnValue:  byte[]
-     */
     public Extension(String extnID, byte[] extnValue) {
         this(extnID, NON_CRITICAL, extnValue);
     }
 
-    /**
-     * TODO
-     * @param   extnID: int[]
-     * @param   extnValue:  byte[]
-     */
     public Extension(int[] extnID, byte[] extnValue) {
         this(extnID, NON_CRITICAL, extnValue);
     }
 
-    //
-    // TODO
-    // @param   extnID: int[]
-    // @param   critical:   boolean
-    // @param   extnValue:  byte[]
-    // @param   encoding:   byte[]
-    //
     private Extension(int[] extnID, boolean critical, byte[] extnValue,
             byte[] rawExtnValue, byte[] encoding,
             ExtensionValue decodedExtValue) {
@@ -180,7 +144,6 @@
 
     /**
      * Returns the value of extnID field of the structure.
-     * @return  extnID
      */
     public String getExtnID() {
         if (extnID_str == null) {
@@ -191,7 +154,6 @@
 
     /**
      * Returns the value of critical field of the structure.
-     * @return  critical
      */
     public boolean getCritical() {
         return critical;
@@ -199,7 +161,6 @@
 
     /**
      * Returns the value of extnValue field of the structure.
-     * @return  extnValue
      */
     public byte[] getExtnValue() {
         return extnValue;
@@ -208,7 +169,6 @@
     /**
      * Returns the raw (undecoded octet string) value of extnValue
      * field of the structure.
-     * @return  rawExtnValue
      */
     public byte[] getRawExtnValue() {
         if (rawExtnValue == null) {
@@ -219,7 +179,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 Extension value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -228,18 +187,18 @@
         return encoding;
     }
 
-    public boolean equals(Object ext) {
+    @Override public boolean equals(Object ext) {
         if (!(ext instanceof Extension)) {
             return false;
         }
-        Extension extn = (Extension) ext;
-        return Arrays.equals(extnID, extn.extnID)
-            && (critical == extn.critical)
-            && Arrays.equals(extnValue, extn.extnValue);
+        Extension extension = (Extension) ext;
+        return Arrays.equals(extnID, extension.extnID)
+            && (critical == extension.critical)
+            && Arrays.equals(extnValue, extension.extnValue);
     }
 
-    public int hashCode() {
-        return (extnID.hashCode() * 37 + (critical ? 1 : 0)) * 37 + extnValue.hashCode();
+    @Override public int hashCode() {
+        return (Arrays.hashCode(extnID) * 37 + (critical ? 1 : 0)) * 37 + Arrays.hashCode(extnValue);
     }
 
     public ExtensionValue getDecodedExtensionValue() throws IOException {
@@ -253,7 +212,8 @@
         if (!valueDecoded) {
             try {
                 decodeExtensionValue();
-            } catch (IOException e) { }
+            } catch (IOException ignored) {
+            }
         }
         if (extnValueObject instanceof KeyUsage) {
             return (KeyUsage) extnValueObject;
@@ -266,7 +226,8 @@
         if (!valueDecoded) {
             try {
                 decodeExtensionValue();
-            } catch (IOException e) { }
+            } catch (IOException ignored) {
+            }
         }
         if (extnValueObject instanceof BasicConstraints) {
             return (BasicConstraints) extnValueObject;
@@ -280,131 +241,113 @@
             return;
         }
         valueDecoded = true;
-        if (oidEquals(extnID, SUBJ_KEY_ID)) {
+        if (Arrays.equals(extnID, SUBJ_KEY_ID)) {
             extnValueObject = SubjectKeyIdentifier.decode(extnValue);
-        } else if (oidEquals(extnID, KEY_USAGE)) {
+        } else if (Arrays.equals(extnID, KEY_USAGE)) {
             extnValueObject = new KeyUsage(extnValue);
-        } else if (oidEquals(extnID, SUBJECT_ALT_NAME)) {
+        } else if (Arrays.equals(extnID, SUBJECT_ALT_NAME)) {
             extnValueObject = new AlternativeName(
                     AlternativeName.SUBJECT, extnValue);
-        } else if (oidEquals(extnID, ISSUER_ALTERNATIVE_NAME)) {
+        } else if (Arrays.equals(extnID, ISSUER_ALTERNATIVE_NAME)) {
             extnValueObject = new AlternativeName(
                     AlternativeName.SUBJECT, extnValue);
-        } else if (oidEquals(extnID, BASIC_CONSTRAINTS)) {
+        } else if (Arrays.equals(extnID, BASIC_CONSTRAINTS)) {
             extnValueObject = new BasicConstraints(extnValue);
-        } else if (oidEquals(extnID, NAME_CONSTRAINTS)) {
+        } else if (Arrays.equals(extnID, NAME_CONSTRAINTS)) {
             extnValueObject = NameConstraints.decode(extnValue);
-        } else if (oidEquals(extnID, CERTIFICATE_POLICIES)) {
+        } else if (Arrays.equals(extnID, CERTIFICATE_POLICIES)) {
             extnValueObject = CertificatePolicies.decode(extnValue);
-        } else if (oidEquals(extnID, AUTH_KEY_ID)) {
+        } else if (Arrays.equals(extnID, AUTH_KEY_ID)) {
             extnValueObject = AuthorityKeyIdentifier.decode(extnValue);
-        } else if (oidEquals(extnID, POLICY_CONSTRAINTS)) {
+        } else if (Arrays.equals(extnID, POLICY_CONSTRAINTS)) {
             extnValueObject = new PolicyConstraints(extnValue);
-        } else if (oidEquals(extnID, EXTENDED_KEY_USAGE)) {
+        } else if (Arrays.equals(extnID, EXTENDED_KEY_USAGE)) {
             extnValueObject = new ExtendedKeyUsage(extnValue);
-        } else if (oidEquals(extnID, INHIBIT_ANY_POLICY)) {
+        } else if (Arrays.equals(extnID, INHIBIT_ANY_POLICY)) {
             extnValueObject = new InhibitAnyPolicy(extnValue);
-        } else if (oidEquals(extnID, CERTIFICATE_ISSUER)) {
+        } else if (Arrays.equals(extnID, CERTIFICATE_ISSUER)) {
             extnValueObject = new CertificateIssuer(extnValue);
-        } else if (oidEquals(extnID, CRL_DISTR_POINTS)) {
+        } else if (Arrays.equals(extnID, CRL_DISTR_POINTS)) {
             extnValueObject = CRLDistributionPoints.decode(extnValue);
-        } else if (oidEquals(extnID, CERTIFICATE_ISSUER)) {
+        } else if (Arrays.equals(extnID, CERTIFICATE_ISSUER)) {
             extnValueObject = new ReasonCode(extnValue);
-        } else if (oidEquals(extnID, INVALIDITY_DATE)) {
+        } else if (Arrays.equals(extnID, INVALIDITY_DATE)) {
             extnValueObject = new InvalidityDate(extnValue);
-        } else if (oidEquals(extnID, REASON_CODE)) {
+        } else if (Arrays.equals(extnID, REASON_CODE)) {
             extnValueObject = new ReasonCode(extnValue);
-        } else if (oidEquals(extnID, CRL_NUMBER)) {
+        } else if (Arrays.equals(extnID, CRL_NUMBER)) {
             extnValueObject = new CRLNumber(extnValue);
-        } else if (oidEquals(extnID, ISSUING_DISTR_POINTS)) {
+        } else if (Arrays.equals(extnID, ISSUING_DISTR_POINTS)) {
             extnValueObject = IssuingDistributionPoint.decode(extnValue);
-        } else if (oidEquals(extnID, AUTHORITY_INFO_ACCESS)) {
+        } else if (Arrays.equals(extnID, AUTHORITY_INFO_ACCESS)) {
             extnValueObject = InfoAccessSyntax.decode(extnValue);
-        } else if (oidEquals(extnID, SUBJECT_INFO_ACCESS)) {
+        } else if (Arrays.equals(extnID, SUBJECT_INFO_ACCESS)) {
             extnValueObject = InfoAccessSyntax.decode(extnValue);
         }
     }
 
-    /**
-     * Places the string representation into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append("OID: ").append(getExtnID())
-            .append(", Critical: ").append(critical).append('\n');
+    public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append("OID: ").append(getExtnID()).append(", Critical: ").append(critical).append('\n');
         if (!valueDecoded) {
             try {
                 decodeExtensionValue();
-            } catch (IOException e) { }
+            } catch (IOException ignored) {
+            }
         }
         if (extnValueObject != null) {
-            extnValueObject.dumpValue(buffer, prefix);
+            extnValueObject.dumpValue(sb, prefix);
             return;
         }
         // else: dump unparsed hex representation
-        buffer.append(prefix);
-        if (oidEquals(extnID, SUBJ_DIRECTORY_ATTRS)) {
-            buffer.append("Subject Directory Attributes Extension");
-        } else if (oidEquals(extnID, SUBJ_KEY_ID)) {
-            buffer.append("Subject Key Identifier Extension");
-        } else if (oidEquals(extnID, KEY_USAGE)) {
-            buffer.append("Key Usage Extension");
-        } else if (oidEquals(extnID, PRIVATE_KEY_USAGE_PERIOD)) {
-            buffer.append("Private Key Usage Period Extension");
-        } else if (oidEquals(extnID, SUBJECT_ALT_NAME)) {
-            buffer.append("Subject Alternative Name Extension");
-        } else if (oidEquals(extnID, ISSUER_ALTERNATIVE_NAME)) {
-            buffer.append("Issuer Alternative Name Extension");
-        } else if (oidEquals(extnID, BASIC_CONSTRAINTS)) {
-            buffer.append("Basic Constraints Extension");
-        } else if (oidEquals(extnID, NAME_CONSTRAINTS)) {
-            buffer.append("Name Constraints Extension");
-        } else if (oidEquals(extnID, CRL_DISTR_POINTS)) {
-            buffer.append("CRL Distribution Points Extension");
-        } else if (oidEquals(extnID, CERTIFICATE_POLICIES)) {
-            buffer.append("Certificate Policies Extension");
-        } else if (oidEquals(extnID, POLICY_MAPPINGS)) {
-            buffer.append("Policy Mappings Extension");
-        } else if (oidEquals(extnID, AUTH_KEY_ID)) {
-            buffer.append("Authority Key Identifier Extension");
-        } else if (oidEquals(extnID, POLICY_CONSTRAINTS)) {
-            buffer.append("Policy Constraints Extension");
-        } else if (oidEquals(extnID, EXTENDED_KEY_USAGE)) {
-            buffer.append("Extended Key Usage Extension");
-        } else if (oidEquals(extnID, INHIBIT_ANY_POLICY)) {
-            buffer.append("Inhibit Any-Policy Extension");
-        } else if (oidEquals(extnID, AUTHORITY_INFO_ACCESS)) {
-            buffer.append("Authority Information Access Extension");
-        } else if (oidEquals(extnID, SUBJECT_INFO_ACCESS)) {
-            buffer.append("Subject Information Access Extension");
-        } else if (oidEquals(extnID, INVALIDITY_DATE)) {
-            buffer.append("Invalidity Date Extension");
-        } else if (oidEquals(extnID, CRL_NUMBER)) {
-            buffer.append("CRL Number Extension");
-        } else if (oidEquals(extnID, REASON_CODE)) {
-            buffer.append("Reason Code Extension");
+        sb.append(prefix);
+        if (Arrays.equals(extnID, SUBJ_DIRECTORY_ATTRS)) {
+            sb.append("Subject Directory Attributes Extension");
+        } else if (Arrays.equals(extnID, SUBJ_KEY_ID)) {
+            sb.append("Subject Key Identifier Extension");
+        } else if (Arrays.equals(extnID, KEY_USAGE)) {
+            sb.append("Key Usage Extension");
+        } else if (Arrays.equals(extnID, PRIVATE_KEY_USAGE_PERIOD)) {
+            sb.append("Private Key Usage Period Extension");
+        } else if (Arrays.equals(extnID, SUBJECT_ALT_NAME)) {
+            sb.append("Subject Alternative Name Extension");
+        } else if (Arrays.equals(extnID, ISSUER_ALTERNATIVE_NAME)) {
+            sb.append("Issuer Alternative Name Extension");
+        } else if (Arrays.equals(extnID, BASIC_CONSTRAINTS)) {
+            sb.append("Basic Constraints Extension");
+        } else if (Arrays.equals(extnID, NAME_CONSTRAINTS)) {
+            sb.append("Name Constraints Extension");
+        } else if (Arrays.equals(extnID, CRL_DISTR_POINTS)) {
+            sb.append("CRL Distribution Points Extension");
+        } else if (Arrays.equals(extnID, CERTIFICATE_POLICIES)) {
+            sb.append("Certificate Policies Extension");
+        } else if (Arrays.equals(extnID, POLICY_MAPPINGS)) {
+            sb.append("Policy Mappings Extension");
+        } else if (Arrays.equals(extnID, AUTH_KEY_ID)) {
+            sb.append("Authority Key Identifier Extension");
+        } else if (Arrays.equals(extnID, POLICY_CONSTRAINTS)) {
+            sb.append("Policy Constraints Extension");
+        } else if (Arrays.equals(extnID, EXTENDED_KEY_USAGE)) {
+            sb.append("Extended Key Usage Extension");
+        } else if (Arrays.equals(extnID, INHIBIT_ANY_POLICY)) {
+            sb.append("Inhibit Any-Policy Extension");
+        } else if (Arrays.equals(extnID, AUTHORITY_INFO_ACCESS)) {
+            sb.append("Authority Information Access Extension");
+        } else if (Arrays.equals(extnID, SUBJECT_INFO_ACCESS)) {
+            sb.append("Subject Information Access Extension");
+        } else if (Arrays.equals(extnID, INVALIDITY_DATE)) {
+            sb.append("Invalidity Date Extension");
+        } else if (Arrays.equals(extnID, CRL_NUMBER)) {
+            sb.append("CRL Number Extension");
+        } else if (Arrays.equals(extnID, REASON_CODE)) {
+            sb.append("Reason Code Extension");
         } else {
-            buffer.append("Unknown Extension");
+            sb.append("Unknown Extension");
         }
-        buffer.append('\n').append(prefix)
-            .append("Unparsed Extension Value:\n");
-        buffer.append(Array.toString(extnValue, prefix));
+        sb.append('\n').append(prefix).append("Unparsed Extension Value:\n");
+        sb.append(Array.toString(extnValue, prefix));
     }
 
 
-    // Compares two OIDs
-    private static boolean oidEquals(int[] oid1, int[] oid2) {
-        int length = oid1.length;
-        if (length != oid2.length) {
-            return false;
-        }
-        while (length > 0) {
-            if (oid1[--length] != oid2[length]) {
-                return false;
-            }
-        }
-        return true;
-    }
-
     /**
      * X.509 Extension encoder/decoder.
      */
@@ -412,8 +355,7 @@
             ASN1Oid.getInstance(),
             ASN1Boolean.getInstance(),
             new ASN1OctetString() {
-                public Object getDecodedObject(BerInputStream in)
-                                                throws IOException {
+                @Override public Object getDecodedObject(BerInputStream in) throws IOException {
                     // first - decoded octet string,
                     // second - raw encoding of octet string
                     return new Object[]
@@ -425,7 +367,7 @@
             setDefault(Boolean.FALSE, 1);
         }
 
-        protected Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override protected Object getDecodedObject(BerInputStream in) throws IOException {
             Object[] values = (Object[]) in.content;
 
             int[] oid = (int[]) values[0];
@@ -434,22 +376,18 @@
 
             ExtensionValue decodedExtValue = null;
             // decode Key Usage and Basic Constraints extension values
-            if (oidEquals(oid, KEY_USAGE)) {
+            if (Arrays.equals(oid, KEY_USAGE)) {
                 decodedExtValue = new KeyUsage(extnValue);
-            } else if (oidEquals(oid, BASIC_CONSTRAINTS)) {
+            } else if (Arrays.equals(oid, BASIC_CONSTRAINTS)) {
                 decodedExtValue = new BasicConstraints(extnValue);
             }
 
-            return
-                new Extension((int[]) values[0],
-                    ((Boolean) values[1]).booleanValue(),
+            return new Extension((int[]) values[0], (Boolean) values[1],
                     extnValue, rawExtnValue, in.getEncoded(), decodedExtValue);
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             Extension ext = (Extension) object;
-
             values[0] = ext.extnID;
             values[1] = (ext.critical) ? Boolean.TRUE : Boolean.FALSE;
             values[2] = ext.extnValue;
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/ExtensionValue.java b/luni/src/main/java/org/apache/harmony/security/x509/ExtensionValue.java
index 87f72eb..62e9159 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/ExtensionValue.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/ExtensionValue.java
@@ -24,52 +24,35 @@
  */
 public class ExtensionValue {
 
-    /**
-     * Encoded form of the extension.
-     */
+    /** Encoded form of the extension. */
     protected byte[] encoding;
 
-    /**
-     * Default constructor.
-     */
-    public ExtensionValue() { }
+    /** Default constructor. */
+    public ExtensionValue() {}
 
-    /**
-     * Creates the object on the base of its encoded form.
-     */
+    /** Creates the object on the base of its encoded form. */
     public ExtensionValue(byte[] encoding) {
         this.encoding = encoding;
     }
 
-    /**
-     * Returns encoded form of the object.
-     */
+    /** Returns encoded form of the object. */
     public byte[] getEncoded() {
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Unparseable extension value:\n");
+    public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Unparseable extension value:\n");
         if (encoding == null) {
             encoding = getEncoded();
         }
         if (encoding == null) {
-            buffer.append("NULL\n");
+            sb.append("NULL\n");
         } else {
-            buffer.append(Array.toString(encoding, prefix));
+            sb.append(Array.toString(encoding, prefix));
         }
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer) {
-        dumpValue(buffer, "");
-    };
+    public void dumpValue(StringBuilder sb) {
+        dumpValue(sb, "");
+    }
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/Extensions.java b/luni/src/main/java/org/apache/harmony/security/x509/Extensions.java
index 9bff5f2..3336b0d 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/Extensions.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/Extensions.java
@@ -28,7 +28,6 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
 import javax.security.auth.x500.X500Principal;
@@ -48,8 +47,7 @@
  *  Extensions  ::=  SEQUENCE SIZE (1..MAX) OF Extension
  * </pre>
  */
-
-public class Extensions {
+public final class Extensions {
 
     // Supported critical extensions oids:
     private static List SUPPORTED_CRITICAL = Arrays.asList(
@@ -58,14 +56,14 @@
 
     // the values of extensions of the structure
     private List<Extension> extensions;
-    private Set critical;
-    private Set noncritical;
+    private Set<String> critical;
+    private Set<String> noncritical;
     // the flag showing is there any unsupported critical extension
     // in the list of extensions or not.
     private boolean hasUnsupported;
     // map containing the oid of extensions as a keys and
     // Extension objects as values
-    private HashMap oidMap;
+    private HashMap<String, Extension> oidMap;
     // the ASN.1 encoded form of Extensions
     private byte[] encoding;
 
@@ -74,11 +72,7 @@
      */
     public Extensions() {}
 
-    /**
-     * TODO
-     * @param   extensions: List
-     */
-    public Extensions(List extensions) {
+    public Extensions(List<Extension> extensions) {
         this.extensions = extensions;
     }
 
@@ -88,9 +82,8 @@
 
     /**
      * Returns the list of critical extensions.
-     * @return  extensions
      */
-    public Set getCriticalExtensions() {
+    public Set<String> getCriticalExtensions() {
         if (critical == null) {
             makeOidsLists();
         }
@@ -99,9 +92,8 @@
 
     /**
      * Returns the list of critical extensions.
-     * @return  extensions
      */
-    public Set getNonCriticalExtensions() {
+    public Set<String> getNonCriticalExtensions() {
         if (noncritical == null) {
             makeOidsLists();
         }
@@ -124,12 +116,11 @@
             return;
         }
         int size = extensions.size();
-        critical = new HashSet(size);
-        noncritical = new HashSet(size);
-        for (int i=0; i<size; i++) {
-            Extension extn = extensions.get(i);
-            String oid = extn.getExtnID();
-            if (extn.getCritical()) {
+        critical = new HashSet<String>(size);
+        noncritical = new HashSet<String>(size);
+        for (Extension extension : extensions) {
+            String oid = extension.getExtnID();
+            if (extension.getCritical()) {
                 if (!SUPPORTED_CRITICAL.contains(oid)) {
                     hasUnsupported = true;
                 }
@@ -142,22 +133,18 @@
 
     /**
      * Returns the values of extensions.
-     * @param oid - the OID of needed extension.
-     * @return  extensions
      */
     public Extension getExtensionByOID(String oid) {
         if (extensions == null) {
             return null;
         }
         if (oidMap == null) {
-            oidMap = new HashMap();
-            Iterator it = extensions.iterator();
-            while (it.hasNext()) {
-                Extension extn = (Extension) it.next();
-                oidMap.put(extn.getExtnID(), extn);
+            oidMap = new HashMap<String, Extension>();
+            for (Extension extension : extensions) {
+                oidMap.put(extension.getExtnID(), extension);
             }
         }
-        return (Extension) oidMap.get(oid);
+        return oidMap.get(oid);
     }
 
 
@@ -188,9 +175,9 @@
      * than 9.
      */
     public boolean[] valueOfKeyUsage() {
-        Extension extn = getExtensionByOID("2.5.29.15");
-        KeyUsage kUsage = null;
-        if ((extn == null) || ((kUsage = extn.getKeyUsageValue()) == null)) {
+        Extension extension = getExtensionByOID("2.5.29.15");
+        KeyUsage kUsage;
+        if ((extension == null) || ((kUsage = extension.getKeyUsageValue()) == null)) {
             return null;
         }
         return kUsage.getKeyUsage();
@@ -213,13 +200,12 @@
      * and null
      * @throws IOException if extension was incorrectly encoded.
      */
-    public List valueOfExtendedKeyUsage() throws IOException {
-        Extension extn = getExtensionByOID("2.5.29.37");
-        if (extn == null) {
+    public List<String> valueOfExtendedKeyUsage() throws IOException {
+        Extension extension = getExtensionByOID("2.5.29.37");
+        if (extension == null) {
             return null;
         }
-        return ((ExtendedKeyUsage)
-                extn.getDecodedExtensionValue()).getExtendedKeyUsage();
+        return ((ExtendedKeyUsage) extension.getDecodedExtensionValue()).getExtendedKeyUsage();
     }
 
     /**
@@ -240,10 +226,9 @@
      * and Integer.MAX_VALUE if does not.
      */
     public int valueOfBasicConstrains() {
-        Extension extn = getExtensionByOID("2.5.29.19");
-        BasicConstraints bc = null;
-        if ((extn == null)
-                || ((bc = extn.getBasicConstraintsValue()) == null)) {
+        Extension extension = getExtensionByOID("2.5.29.19");
+        BasicConstraints bc;
+        if ((extension == null) || ((bc = extension.getBasicConstraintsValue()) == null)) {
             return Integer.MAX_VALUE;
         }
         return bc.getPathLenConstraint();
@@ -264,13 +249,12 @@
      * (Integer (tag), Object (name value)) if extension presents, and
      * null if does not.
      */
-    public List valueOfSubjectAlternativeName() throws IOException {
-        Extension extn = getExtensionByOID("2.5.29.17");
-        if (extn == null) {
+    public Collection<List<?>> valueOfSubjectAlternativeName() throws IOException {
+        Extension extension = getExtensionByOID("2.5.29.17");
+        if (extension == null) {
             return null;
         }
-        return ((GeneralNames) GeneralNames.ASN1.decode(extn.getExtnValue()))
-                .getPairsList();
+        return ((GeneralNames) GeneralNames.ASN1.decode(extension.getExtnValue())).getPairsList();
     }
 
     /**
@@ -288,13 +272,12 @@
      * (Integer (tag), Object (name value)) if extension presents, and
      * null if does not.
      */
-    public List valueOfIssuerAlternativeName() throws IOException {
-        Extension extn = getExtensionByOID("2.5.29.18");
-        if (extn == null) {
+    public Collection<List<?>> valueOfIssuerAlternativeName() throws IOException {
+        Extension extension = getExtensionByOID("2.5.29.18");
+        if (extension == null) {
             return null;
         }
-        return ((GeneralNames)
-                GeneralNames.ASN1.decode(extn.getExtnValue())).getPairsList();
+        return ((GeneralNames) GeneralNames.ASN1.decode(extension.getExtnValue())).getPairsList();
     }
 
     /**
@@ -310,46 +293,16 @@
      *
      * @return the value of Certificate Issuer Extension
      */
-    public X500Principal valueOfCertificateIssuerExtension()
-                                                        throws IOException {
-        Extension extn = getExtensionByOID("2.5.29.29");
-        if (extn == null) {
+    public X500Principal valueOfCertificateIssuerExtension() throws IOException {
+        Extension extension = getExtensionByOID("2.5.29.29");
+        if (extension == null) {
             return null;
         }
-        return ((CertificateIssuer)
-                extn.getDecodedExtensionValue()).getIssuer();
-    }
-
-    /**
-     * TODO
-     * @param   extn:  Extension
-     * @return
-     */
-    public void addExtension(Extension extn) {
-        encoding = null;
-        if (extensions == null) {
-            extensions = new ArrayList();
-        }
-        extensions.add(extn);
-        if (oidMap != null) {
-            oidMap.put(extn.getExtnID(), extn);
-        }
-        if (critical != null) {
-            String oid = extn.getExtnID();
-            if (extn.getCritical()) {
-                if (!SUPPORTED_CRITICAL.contains(oid)) {
-                    hasUnsupported = true;
-                }
-                critical.add(oid);
-            } else {
-                noncritical.add(oid);
-            }
-        }
+        return ((CertificateIssuer) extension.getDecodedExtensionValue()).getIssuer();
     }
 
     /**
      * Returns ASN.1 encoded form of this X.509 Extensions value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -358,42 +311,32 @@
         return encoding;
     }
 
-    public boolean equals(Object exts) {
-        if (!(exts instanceof Extensions)) {
+    @Override public boolean equals(Object other) {
+        if (!(other instanceof Extensions)) {
             return false;
         }
-        Extensions extns = (Extensions) exts;
-        return ((extensions == null) || (extensions.size() == 0)
-                    ? ((extns.extensions == null)
-                            || (extns.extensions.size() == 0))
-                    : ((extns.extensions == null)
-                            || (extns.extensions.size() == 0))
-                        ? false
-                        : (extensions.containsAll(extns.extensions)
-                            && (extensions.size() == extns.extensions.size()))
-                );
+        Extensions that = (Extensions) other;
+        return (this.extensions == null || this.extensions.isEmpty())
+                    ? (that.extensions == null || that.extensions.isEmpty())
+                    : (this.extensions.equals(that.extensions));
     }
 
-    public int hashCode() {
-        int hashcode = 0;
+    @Override public int hashCode() {
+        int hashCode = 0;
         if (extensions != null) {
-            hashcode = extensions.hashCode();
+            hashCode = extensions.hashCode();
         }
-        return hashcode;
+        return hashCode;
     }
 
-    /**
-     * Places the string representation into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
+    public void dumpValue(StringBuilder sb, String prefix) {
         if (extensions == null) {
             return;
         }
         int num = 1;
         for (Extension extension: extensions) {
-            buffer.append('\n').append(prefix)
-                .append('[').append(num++).append("]: ");
-            extension.dumpValue(buffer, prefix);
+            sb.append('\n').append(prefix).append('[').append(num++).append("]: ");
+            extension.dumpValue(sb, prefix);
         }
     }
 
@@ -401,14 +344,13 @@
      * Custom X.509 Extensions decoder.
      */
     public static final ASN1Type ASN1 = new ASN1SequenceOf(Extension.ASN1) {
-
-        public Object getDecodedObject(BerInputStream in) {
-            return new Extensions((List)in.content);
+        @Override public Object getDecodedObject(BerInputStream in) {
+            return new Extensions((List<Extension>) in.content);
         }
 
-        public Collection getValues(Object object) {
-            Extensions exts = (Extensions) object;
-            return (exts.extensions == null) ? new ArrayList() : exts.extensions;
+        @Override public Collection getValues(Object object) {
+            Extensions extensions = (Extensions) object;
+            return (extensions.extensions == null) ? new ArrayList() : extensions.extensions;
         }
     };
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/GeneralName.java b/luni/src/main/java/org/apache/harmony/security/x509/GeneralName.java
index d52fe89..d8188be 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/GeneralName.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/GeneralName.java
@@ -23,13 +23,15 @@
 package org.apache.harmony.security.x509;
 
 import java.io.IOException;
+import java.net.InetAddress;
 import java.net.URI;
 import java.net.URISyntaxException;
-import java.nio.charset.Charsets;
+import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
+import java.util.Locale;
 import javax.security.auth.x500.X500Principal;
 import org.apache.harmony.security.asn1.ASN1Choice;
 import org.apache.harmony.security.asn1.ASN1Implicit;
@@ -39,6 +41,7 @@
 import org.apache.harmony.security.asn1.ASN1Type;
 import org.apache.harmony.security.asn1.BerInputStream;
 import org.apache.harmony.security.asn1.ObjectIdentifier;
+import org.apache.harmony.security.utils.Array;
 import org.apache.harmony.security.x501.Name;
 
 /**
@@ -83,10 +86,14 @@
  *
  * </pre>
  *
+ * <p>This class doesn't support masked addresses like "10.9.8.0/255.255.255.0".
+ * These are only necessary for NameConstraints, which are not exposed in the
+ * Java certificate API.
+ *
  * @see org.apache.harmony.security.x509.NameConstraints
  * @see org.apache.harmony.security.x509.GeneralSubtree
  */
-public class GeneralName {
+public final class GeneralName {
 
     /**
      * The values of the tags of fields
@@ -116,13 +123,13 @@
         nameASN1[REG_ID] = ASN1Oid.getInstance();
     }
 
-    // the tag of the name type
+    /** the tag of the name type */
     private int tag;
-    // the name value (can be String or byte array)
+    /** the name value (can be String or byte array) */
     private Object name;
-    // the ASN.1 encoded form of GeneralName
+    /** the ASN.1 encoded form of GeneralName */
     private byte[] encoding;
-    // the ASN.1 encoded form of GeneralName's field
+    /** the ASN.1 encoded form of GeneralName's field */
     private byte[] name_encoding;
 
     /**
@@ -141,7 +148,6 @@
      * To make the GeneralName object with such names use another constructor.
      * @param tag is an integer which value corresponds to the name type.
      * @param name is a name value corresponding to the tag.
-     * <pre>
      */
     public GeneralName(int tag, String name) throws IOException {
         if (name == null) {
@@ -183,37 +189,21 @@
         }
     }
 
-    /**
-     * TODO
-     * @param   name:   OtherName
-     */
     public GeneralName(OtherName name) {
         this.tag = OTHER_NAME;
         this.name = name;
     }
 
-    /**
-     * TODO
-     * @param   name:   ORAddress
-     */
     public GeneralName(ORAddress name) {
         this.tag = X400_ADDR;
         this.name = name;
     }
 
-    /**
-     * TODO
-     * @param   name:   Name
-     */
     public GeneralName(Name name) {
         this.tag = DIR_NAME;
         this.name = name;
     }
 
-    /**
-     * TODO
-     * @param   name:   EDIPartyName
-     */
     public GeneralName(EDIPartyName name) {
         this.tag = EDIP_NAME;
         this.name = name;
@@ -259,7 +249,6 @@
 
     /**
      * Returns the tag of the name in the structure
-     * @return the tag of the name
      */
     public int getTag() {
         return tag;
@@ -288,16 +277,11 @@
         return name;
     }
 
-    /**
-     * TODO
-     * @param   _gname: Object
-     * @return
-     */
-    public boolean equals(Object _gname) {
-        if (!(_gname instanceof GeneralName)) {
+    public boolean equals(Object other) {
+        if (!(other instanceof GeneralName)) {
             return false;
         }
-        GeneralName gname = (GeneralName) _gname;
+        GeneralName gname = (GeneralName) other;
         if (this.tag != gname.tag) {
             return false;
         }
@@ -320,7 +304,6 @@
             default:
                 // should never happen
         }
-        //System.out.println(false);
         return false;
     }
 
@@ -336,7 +319,7 @@
         case X400_ADDR:
         case OTHER_NAME:
         case EDIP_NAME:
-            return getEncoded().hashCode();
+            return Arrays.hashCode(getEncoded());
         default:
             return super.hashCode();
         }
@@ -365,8 +348,8 @@
                 // Mail address [1]:
                 // a@b.c - particular address is acceptable by the same address,
                 // or by b.c - host name.
-                return ((String) gname.getName()).toLowerCase()
-                    .endsWith(((String) name).toLowerCase());
+                return ((String) gname.getName()).toLowerCase(Locale.US)
+                    .endsWith(((String) name).toLowerCase(Locale.US));
             case DNS_NAME:
                 // DNS name [2] that can be constructed by simply adding
                 // to the left hand side of the name satisfies the name
@@ -376,7 +359,7 @@
                 if (dns.equalsIgnoreCase(_dns)) {
                     return true;
                 } else {
-                    return _dns.toLowerCase().endsWith("." + dns.toLowerCase());
+                    return _dns.toLowerCase(Locale.US).endsWith("." + dns.toLowerCase(Locale.US));
                 }
             case UR_ID:
                 // For URIs the constraint ".xyz.com" is satisfied by both
@@ -398,7 +381,7 @@
                                 ? uri.substring(begin)
                                 : uri.substring(begin, end);
                 if (host.startsWith(".")) {
-                    return _host.toLowerCase().endsWith(host.toLowerCase());
+                    return _host.toLowerCase(Locale.US).endsWith(host.toLowerCase(Locale.US));
                 } else {
                     return host.equalsIgnoreCase(_host);
                 }
@@ -411,9 +394,12 @@
                 if (length == _length) {
                     return Arrays.equals(address, _address);
                 } else if (length == 2*_length) {
-                    for (int i=0; i<_address.length; i++) {
-                        if ((_address[i] < address[i])
-                                || (_address[i] > address[i+_length])) {
+                    for (int i = 0; i < _address.length; i++) {
+                        // TODO: should the 2nd IP address be treated as a range or as a mask?
+                        int octet = _address[i] & 0xff;
+                        int min = address[i] & 0xff;
+                        int max = address[i + _length] & 0xff;
+                        if ((octet < min) || (octet > max)) {
                             return false;
                         }
                     }
@@ -457,9 +443,9 @@
      * otherName, X400Address, ediPartyName returned as byte arrays
      * containing the ASN.1 DER encoded form of the name.
      */
-    public List getAsList() {
-        ArrayList result = new ArrayList();
-        result.add(Integer.valueOf(tag)); // android-changed
+    public List<Object> getAsList() {
+        ArrayList<Object> result = new ArrayList<Object>();
+        result.add(tag);
         switch (tag) {
             case OTHER_NAME:
                 result.add(((OtherName) name).getEncoded());
@@ -490,33 +476,12 @@
         return Collections.unmodifiableList(result);
     }
 
-    //
-    // TODO
-    // @param   data:   byte[]
-    // @return
-    //
-    private String getBytesAsString(byte[] data) {
-        String result = "";
-        for (int i=0; i<data.length; i++) {
-            String tail = Integer.toHexString(0x00ff & data[i]);
-            if (tail.length() == 1) {
-                tail = "0" + tail;
-            }
-            result += tail + " ";
-        }
-        return result;
-    }
-
-    /**
-     * TODO
-     * @return
-     */
     public String toString() {
         String result = "";
         switch (tag) {
             case OTHER_NAME:
                 result = "otherName[0]: "
-                         + getBytesAsString(getEncoded());
+                         + Array.getBytesAsString(getEncoded());
                 break;
             case RFC822_NAME:
                 result = "rfc822Name[1]: " + name;
@@ -532,7 +497,7 @@
                 break;
             case X400_ADDR:
                 result = "x400Address[3]: "
-                         + getBytesAsString(getEncoded());
+                         + Array.getBytesAsString(getEncoded());
                 break;
             case DIR_NAME:
                 result = "directoryName[4]: "
@@ -540,7 +505,7 @@
                 break;
             case EDIP_NAME:
                 result = "ediPartyName[5]: "
-                         + getBytesAsString(getEncoded());
+                         + Array.getBytesAsString(getEncoded());
                 break;
             case IP_ADDR:
                 result = "iPAddress[7]: " + ipBytesToStr((byte[]) name);
@@ -553,7 +518,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 GeneralName value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -580,13 +544,14 @@
      * by RFC 1123 (section 2.1).
      */
     public static void checkDNS(String dns) throws IOException {
-        byte[] bytes = dns.toLowerCase().getBytes(Charsets.UTF_8);
+        String string = dns.toLowerCase(Locale.US);
+        int length = string.length();
         // indicates if it is a first letter of the label
         boolean first_letter = true;
-        for (int i=0; i<bytes.length; i++) {
-            byte ch = bytes[i];
+        for (int i = 0; i < length; i++) {
+            char ch = string.charAt(i);
             if (first_letter) {
-                if ((bytes.length > 2) && (ch == '*') && (bytes[1] == '.')) {
+                if ((length > 2) && (ch == '*') && (string.charAt(1) == '.')) {
                     first_letter = false;
                     continue;
                 }
@@ -603,7 +568,7 @@
             if (ch == '.') {
                 // check the end of the previous label, it should not
                 // be '-' sign
-                if (bytes[i-1] == '-') {
+                if (string.charAt(i-1) == '-') {
                     throw new IOException("Incorrect DNS name: label ends with '-': " + dns);
                 }
                 first_letter = true;
@@ -631,231 +596,64 @@
     }
 
     /**
-     * Converts OID into array of bytes.
+     * Converts OID into array of ints.
      */
     public static int[] oidStrToInts(String oid) throws IOException {
-        byte[] bytes = oid.getBytes(Charsets.UTF_8);
-        if (bytes[bytes.length-1] == '.') {
+        int length = oid.length();
+        if (oid.charAt(length-1) == '.') {
             throw new IOException("Bad OID: " + oid);
         }
-        int[] result = new int[bytes.length/2+1]; // best case: a.b.c.d.e
+        int[] result = new int[length/2+1]; // best case: a.b.c.d.e
         int number = 0; // the number of OID's components
-        for (int i=0; i<bytes.length; i++) {
+        for (int i = 0; i < length; i++) {
             int value = 0;
             int pos = i;
-            while ((i < bytes.length) && (bytes[i] >= '0')
-                        && (bytes[i] <= '9')) {
-                value = 10 * value + (bytes[i++] - 48);
+            for (; i < length; i++) {
+                char ch = oid.charAt(i);
+                if ((ch < '0') || (ch > '9')) {
+                    break;
+                }
+                value = 10 * value + (ch - '0');
             }
             if (i == pos) {
                 // the number was not read
                 throw new IOException("Bad OID: " + oid);
             }
             result[number++] = value;
-            if (i >= bytes.length) {
+            if (i == length) {
                 break;
             }
-            if (bytes[i] != '.') {
+            char ch = oid.charAt(i);
+            if (ch != '.') {
                 throw new IOException("Bad OID: " + oid);
             }
         }
         if (number < 2) {
             throw new IOException("OID should consist of no less than 2 components: " + oid);
         }
-        int[] res = new int[number];
-        for (int i=0; i<number; i++) {
-            res[i] = result[i];
-        }
-        return res;
+        return Arrays.copyOfRange(result, 0, number);
     }
 
     /**
-     * Helper method. Converts the String representation of IP address
-     * to the array of bytes. IP addresses are expected in two versions:<br>
-     * IPv4 - in dot-decimal notation<br>
-     * IPv6 - in colon hexadecimal notation<br>
-     * Also method works with the ranges of the addresses represented
-     * as 2 addresses separated by '/' character.
-     * @param   address :   String representation of IP address
-     * @return  byte representation of IP address
+     * Returns the bytes of the given IP address or masked IP address.
      */
     public static byte[] ipStrToBytes(String ip) throws IOException {
-        boolean isIPv4 = (ip.indexOf('.') > 0);
-        // number of components (should be 4 or 8)
-        int num_components = (isIPv4) ? 4 : 16;
-        if (ip.indexOf('/') > 0) {
-            num_components *= 2; // this is a range of addresses
+        if (!InetAddress.isNumeric(ip)) {
+            throw new IOException("Not an IP address: " + ip);
         }
-        // the resulting array
-        byte[] result = new byte[num_components];
-        byte[] ip_bytes = ip.getBytes(Charsets.UTF_8);
-        // number of address component to be read
-        int component = 0;
-        // if it is reading the second bound of a range
-        boolean reading_second_bound = false;
-        if (isIPv4) {
-            // IPv4 address is expected in the form of dot-decimal notation:
-            //      1.100.2.200
-            // or in the range form:
-            //      1.100.2.200/1.100.3.300
-            int i = 0;
-            while (i < ip_bytes.length) {
-                int digits = 0;
-                // the value of the address component
-                int value = 0;
-                while ((i < ip_bytes.length) && (ip_bytes[i] >= '0') && (ip_bytes[i] <= '9')) {
-                    digits++;
-                    if (digits > 3) {
-                        throw new IOException("Component of IPv4 address should consist of no more than 3 decimal digits: " + ip);
-                    }
-                    value = 10 * value + (ip_bytes[i] - 48);
-                    i++;
-                }
-                if (digits == 0) {
-                    // ip_bytes[i] is not a number
-                    throw badIp(4, ip);
-                }
-                result[component] = (byte) value;
-                component++;
-                if (i >= ip_bytes.length) {
-                    // no more bytes
-                    break;
-                }
-                // check the reached delimiter
-                if ((ip_bytes[i] != '.' && ip_bytes[i] != '/')) {
-                    throw badIp(4, ip);
-                }
-                // check the correctness of the range
-                if (ip_bytes[i] == '/') {
-                    if (reading_second_bound) {
-                        // more than 2 bounds in the range
-                        throw badIp(4, ip);
-                    }
-                    if (component != 4) {
-                        throw new IOException("IPv4 address should consist of 4 decimal numbers: " + ip);
-                    }
-                    reading_second_bound = true;
-                }
-                // check the number of the components
-                if (component > ((reading_second_bound) ? 7 : 3)) {
-                    throw new IOException("IPv4 address should consist of 4 decimal numbers: " + ip);
-                }
-                i++;
-            }
-            // check the number of read components
-            if (component != num_components) {
-                throw new IOException("IPv4 address should consist of 4 decimal numbers: " + ip);
-            }
-        } else {
-            // IPv6 address is expected in the form of
-            // colon hexadecimal notation:
-            // 010a:020b:3337:1000:FFFA:ABCD:9999:0000
-            // or in a range form:
-            // 010a:020b:3337:1000:FFFA:ABCD:9999:0000/010a:020b:3337:1000:FFFA:ABCD:9999:1111
-            if (ip_bytes.length != 39 && ip_bytes.length != 79) {
-                // incorrect length of the string representation
-                throw badIp(6, ip);
-            }
-            int value = 0;
-            // indicates the reading of the second half of byte
-            boolean second_hex = false;
-            // if the delimiter (':' or '/') is expected
-            boolean expect_delimiter = false;
-            for (int i=0; i<ip_bytes.length; i++) {
-                byte bytik = ip_bytes[i];
-                if ((bytik >= '0') && (bytik <= '9')) {
-                    value = (bytik - 48); // '0':0, '1':1, ... , '9':9
-                } else if ((bytik >= 'A') && (bytik <= 'F')) {
-                    value = (bytik - 55); // 'A':10, 'B':11, ... , 'F':15
-                } else if ((bytik >= 'a') && (bytik <= 'f')) {
-                    value = (bytik - 87); // 'a':10, 'b':11, ... , 'f':15
-                } else if (second_hex) {
-                    // second hex value of a byte is expected but was not read
-                    // (it is the situation like: ...ABCD:A:ABCD...)
-                    throw badIp(6, ip);
-                } else if ((bytik == ':') || (bytik == '/')) {
-                    if (component % 2 == 1) {
-                        // second byte of the component is omitted
-                        // (it is the situation like: ... ABDC:AB:ABCD ...)
-                        throw badIp(6, ip);
-                    }
-                    if (bytik == '/') {
-                        if (reading_second_bound) {
-                            // more than 2 bounds in the range
-                            throw badIp(6, ip);
-                        }
-                        if (component != 16) {
-                            // check the number of read components
-                            throw new IOException("IPv6 address should consist of 8 hexadecimal numbers: " + ip);
-                        }
-                        reading_second_bound = true;
-                    }
-                    expect_delimiter = false;
-                    continue;
-                } else {
-                    throw badIp(6, ip);
-                }
-                if (expect_delimiter) { // delimiter is expected but was not read
-                    throw badIp(6, ip);
-                }
-                if (!second_hex) {
-                    // first half of byte has been read
-                    result[component] = (byte) (value << 4);
-                    second_hex = true;
-                } else {
-                    // second half of byte has been read
-                    result[component] = (byte)
-                        ((result[component] & 0xFF) | value);
-                    // delimiter is expected if 2 bytes were read
-                    expect_delimiter = (component % 2 == 1);
-                    second_hex = false;
-                    component++;
-                }
-            }
-            // check the correctness of the read address:
-            if (second_hex || (component % 2 == 1)) {
-                throw badIp(6, ip);
-            }
-        }
-        return result;
-    }
-
-    private static IOException badIp(int v, String ip) throws IOException {
-        throw new IOException("Incorrect IPv" + v + " representation: " + ip);
+        return InetAddress.getByName(ip).getAddress();
     }
 
     /**
-     * Helper method. Converts the byte array representation of ip address
-     * to the String.
-     * @param   ip :   byte array representation of ip address
-     *  If the length of byte array 4 then it represents an IP v4
-     *  and the output String will be in the dotted quad form.
-     *  If the length is 16 then it represents an IP v6
-     *  and the output String will be returned in format "p1:p2:...:p8",
-     *  where p1-p8 are hexadecimal values representing the eight 16-bit
-     *  pieces of the address.
-     *  If the length is 8 or 32 then it represents an address range (RFC 1519)
-     *  and the output String will contain 2 IP address divided by "/"
-     * @return  String representation of ip address
+     * Returns the string form of the given IP address. Addresses of length 2x
+     * the canonical length are treated as a route/mask pair.
      */
     public static String ipBytesToStr(byte[] ip) {
-        String result = "";
-        if (ip.length < 9) { // IP v4
-            for (int i=0; i<ip.length; i++) {
-                result += Integer.toString(ip[i] & 0xff);
-                if (i != ip.length-1) {
-                    result += (i == 3) ? "/": ".";
-                }
-            }
-        } else {
-            for (int i=0; i<ip.length; i++) {
-                result += Integer.toHexString(0x00ff & ip[i]);
-                if ((i % 2 != 0) && (i != ip.length-1)) {
-                    result += (i == 15) ? "/": ":";
-                }
-            }
+        try {
+            return InetAddress.getByAddress(null, ip).getHostAddress();
+        } catch (UnknownHostException e) {
+            throw new IllegalArgumentException("Unexpected IP address: " + Arrays.toString(ip));
         }
-        return result;
     }
 
     public static final ASN1Choice ASN1 = new ASN1Choice(new ASN1Type[] {
@@ -877,7 +675,7 @@
             return  ((GeneralName) object).tag;
         }
 
-        public Object getDecodedObject(BerInputStream in) throws IOException {
+        @Override public Object getDecodedObject(BerInputStream in) throws IOException {
             GeneralName result;
             switch (in.choiceIndex) {
                 case OTHER_NAME: // OtherName
@@ -917,44 +715,4 @@
             return result;
         }
     };
-
-    // public static void printAsHex(int perLine,
-    //         String prefix,
-    //         String delimiter,
-    //         byte[] data) {
-    //     for (int i=0; i<data.length; i++) {
-    //         String tail = Integer.toHexString(0x000000ff & data[i]);
-    //         if (tail.length() == 1) {
-    //             tail = "0" + tail;
-    //         }
-    //         System.out.print(prefix + "0x" + tail + delimiter);
-
-    //         if (((i+1)%perLine) == 0) {
-    //             System.out.println();
-    //         }
-    //     }
-    //     System.out.println();
-    // }
-
-    // public static void main(String[] args) {
-    //     System.out.println(">> "+new BigInteger(new byte[] {(byte)23, (byte)255}).toString(2));
-    //     System.out.println(ipBytesToStr(new byte[] {(byte)255, (byte)23, (byte)128, (byte)130}));
-    //     System.out.println(ipBytesToStr(new byte[] {(byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130}));
-    //     System.out.println(ipBytesToStr(new byte[] {(byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130}));
-    //     System.out.println(ipBytesToStr(new byte[] {(byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130,
-    //                                                 (byte)255, (byte)23, (byte)128, (byte)130}));
-    //     ipStrToBytes("1.2.3.4");
-    //     ipStrToBytes("1.2.3.4/4.3.2.1");
-    //     printAsHex(8, "", " ", ipStrToBytes("ff17:8082:ff17:8082:ff17:8082:ff17:8082/ff17:8082:ff17:8082:ff17:8082:ff17:8082"));
-    // }
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/GeneralNames.java b/luni/src/main/java/org/apache/harmony/security/x509/GeneralNames.java
index adec066..93c4af1 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/GeneralNames.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/GeneralNames.java
@@ -24,7 +24,6 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.harmony.security.asn1.ASN1SequenceOf;
 import org.apache.harmony.security.asn1.ASN1Type;
@@ -47,99 +46,59 @@
  * @see org.apache.harmony.security.x509.NameConstraints
  * @see org.apache.harmony.security.x509.GeneralSubtree
  */
-public class GeneralNames {
-
-    // the values of GeneralName
-    private List generalNames;
-    // the ASN.1 encoded form of GeneralNames
+public final class GeneralNames {
+    /** the values of GeneralName */
+    private List<GeneralName> generalNames;
+    /** the ASN.1 encoded form of GeneralNames */
     private byte[] encoding;
 
-    /**
-     * Constructs an object representing the value of GeneralNames.
-     */
     public GeneralNames() {
-        generalNames = new ArrayList();
+        generalNames = new ArrayList<GeneralName>();
     }
 
-    /**
-     * TODO
-     * @param   generalNames:   List
-     */
-    public GeneralNames(List generalNames) {
+    public GeneralNames(List<GeneralName> generalNames) {
         this.generalNames = generalNames;
     }
 
-    //
-    // TODO
-    // @param   generalNames:   List
-    // @param   encoding:   byte[]
-    //
-    private GeneralNames(List generalNames, byte[] encoding) {
+    private GeneralNames(List<GeneralName> generalNames, byte[] encoding) {
         this.generalNames = generalNames;
         this.encoding = encoding;
     }
 
     /**
      * Returns the list of values.
-     * @return  names
      */
-    public List getNames() {
+    public List<GeneralName> getNames() {
         if ((generalNames == null) || (generalNames.size() == 0)) {
             return null;
         }
-        return new ArrayList(generalNames);
+        return new ArrayList<GeneralName>(generalNames);
     }
 
     /**
      * Returns the collection of pairs: (Integer (tag), Object (name value))*
-     * @return the collection of pairs: (Integer (tag), Object (name value))*
      */
-    public List getPairsList() {
-        ArrayList result = new ArrayList();
+    public Collection<List<?>> getPairsList() {
+        Collection<List<?>> result = new ArrayList<List<?>>();
         if (generalNames == null) {
             return result;
         }
-        Iterator it = generalNames.iterator();
-        while (it.hasNext()) {
-            result.add(((GeneralName) it.next()).getAsList());
+        for (GeneralName generalName : generalNames) {
+            result.add(generalName.getAsList());
         }
         return result;
     }
 
-    /**
-     * TODO
-     * @param   name:   GeneralName
-     * @return
-     */
     public void addName(GeneralName name) {
         encoding = null;
         if (generalNames == null) {
-            generalNames = new ArrayList();
+            generalNames = new ArrayList<GeneralName>();
         }
         generalNames.add(name);
     }
 
-    /* *
-     * TODO
-     * @param   name:   GeneralName
-     * @return
-     *
-    public GeneralName getNameByTag(int tag) {
-        encoding = null;
-        if ((generalNames == null) || (generalNames.size() == 0)) {
-            return null;
-        }
-        for (int i=0; i<generalNames.size(); i++) {
-            if (((GeneralName) generalName.get(i)).getTag() == tag) {
-            }
-        }
-        generalNames.add(name);
-    }
-     */
-
     /**
      * Returns ASN.1 encoded form of this X.509 GeneralNames value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -148,18 +107,14 @@
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
+    public void dumpValue(StringBuilder sb, String prefix) {
         if (generalNames == null) {
             return;
         }
-        for (Iterator it=generalNames.iterator(); it.hasNext();) {
-            buffer.append(prefix);
-            buffer.append(it.next());
-            buffer.append('\n');
+        for (GeneralName generalName : generalNames) {
+            sb.append(prefix);
+            sb.append(generalName);
+            sb.append('\n');
         }
     }
 
@@ -167,12 +122,11 @@
      * ASN.1 DER X.509 GeneralNames encoder/decoder class.
      */
     public static final ASN1Type ASN1 = new ASN1SequenceOf(GeneralName.ASN1) {
-
-        public Object getDecodedObject(BerInputStream in) {
-            return new GeneralNames((List)in.content, in.getEncoded());
+        @Override public Object getDecodedObject(BerInputStream in) {
+            return new GeneralNames((List<GeneralName>) in.content, in.getEncoded());
         }
 
-        public Collection getValues(Object object) {
+        @Override public Collection getValues(Object object) {
             GeneralNames gns = (GeneralNames) object;
             return gns.generalNames;
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtree.java b/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtree.java
index 4ea1b41..42987b6 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtree.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtree.java
@@ -50,40 +50,16 @@
  * @see org.apache.harmony.security.x509.NameConstraints
  * @see org.apache.harmony.security.x509.GeneralName
  */
-public class GeneralSubtree {
-
-    // the value of base field of the structure
+public final class GeneralSubtree {
+    /** the value of base field of the structure */
     private final GeneralName base;
-    // the value of minimum field of the structure
+    /** the value of minimum field of the structure */
     private final int minimum;
-    // the value of maximum field of the structure
+    /** the value of maximum field of the structure */
     private final int maximum;
-    // the ASN.1 encoded form of GeneralSubtree
+    /** the ASN.1 encoded form of GeneralSubtree */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   base:   GeneralName
-     */
-    public GeneralSubtree(GeneralName base) {
-        this(base, 0, -1);
-    }
-
-    /**
-     * TODO
-     * @param   base:   GeneralName
-     * @param   minimum:    int
-     */
-    public GeneralSubtree(GeneralName base, int minimum) {
-        this(base, minimum, -1);
-    }
-
-    /**
-     * TODO
-     * @param   base:   GeneralName
-     * @param   minimum:    int
-     * @param   maximum:    int
-     */
     public GeneralSubtree(GeneralName base, int minimum, int maximum) {
         this.base = base;
         this.minimum = minimum;
@@ -92,31 +68,13 @@
 
     /**
      * Returns the value of base field of the structure.
-     * @return  base
      */
     public GeneralName getBase() {
         return base;
     }
 
     /**
-     * Returns the value of maximum field of the structure.
-     * @return  maximum
-     */
-    public int getMaximum() {
-        return maximum;
-    }
-
-    /**
-     * Returns the value of minimum field of the structure.
-     * @return  minimum
-     */
-    public int getMinimum() {
-        return minimum;
-    }
-
-    /**
      * Returns ASN.1 encoded form of this X.509 GeneralSubtree value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -125,20 +83,14 @@
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("General Subtree: [\n");
-        buffer.append(prefix).append("  base: ").append(base).append('\n');
-        buffer.append(prefix).append("  minimum: ")
-            .append(minimum).append('\n');
+    public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("General Subtree: [\n");
+        sb.append(prefix).append("  base: ").append(base).append('\n');
+        sb.append(prefix).append("  minimum: ").append(minimum).append('\n');
         if (maximum >= 0) {
-            buffer.append(prefix).append("  maximum: ")
-                .append(maximum).append('\n');
+            sb.append(prefix).append("  maximum: ").append(maximum).append('\n');
         }
-        buffer.append(prefix).append("]\n");
+        sb.append(prefix).append("]\n");
     }
 
     /**
@@ -153,7 +105,7 @@
             setOptional(2);                 // maximum optional
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             int maximum = -1; // is optional maximum missing?
             if (values[2] != null) {
@@ -164,10 +116,8 @@
                     maximum);
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             GeneralSubtree gs = (GeneralSubtree) object;
-
             values[0] = gs.base;
             values[1] = ASN1Integer.fromIntValue(gs.minimum);
             if (gs.maximum > -1) {
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtrees.java b/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtrees.java
index 426454a..34f4bc7 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtrees.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/GeneralSubtrees.java
@@ -44,53 +44,26 @@
  * @see org.apache.harmony.security.x509.NameConstraints
  * @see org.apache.harmony.security.x509.GeneralSubtree
  */
-
-public class GeneralSubtrees {
-
-    // the list of values of GeneralSubtrees
-    private List generalSubtrees;
-    // the ASN.1 encoded form of GeneralSubtrees
+public final class GeneralSubtrees {
+    /** the list of values of GeneralSubtrees */
+    private List<GeneralSubtree> generalSubtrees;
+    /** the ASN.1 encoded form of GeneralSubtrees */
     private byte[] encoding;
 
-    /**
-     * Constructs an object representing the value of GeneralSubtrees.
-     */
-    public GeneralSubtrees() {}
-
-    /**
-     * TODO
-     * @param   generalSubtrees:    List
-     */
-    public GeneralSubtrees(List generalSubtrees) {
+    public GeneralSubtrees(List<GeneralSubtree> generalSubtrees) {
         // TODO: the size should not be less than one
         this.generalSubtrees = generalSubtrees;
     }
 
     /**
      * Returns the list of values of subtrees.
-     * @return  subtrees
      */
-    public List getSubtrees() {
+    public List<GeneralSubtree> getSubtrees() {
         return generalSubtrees;
     }
 
     /**
-     * TODO
-     * @param   subtree:    GeneralSubtree
-     * @return
-     */
-    public GeneralSubtrees addSubtree(GeneralSubtree subtree) {
-        encoding = null;
-        if (generalSubtrees == null) {
-            generalSubtrees = new ArrayList();
-        }
-        generalSubtrees.add(subtree);
-        return this;
-    }
-
-    /**
      * Returns ASN.1 encoded form of this X.509 AlgorithmIdentifier value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -103,15 +76,15 @@
      * ASN.1 DER X.509 GeneralSubtrees encoder/decoder class.
      */
     public static final ASN1Type ASN1 = new ASN1SequenceOf(GeneralSubtree.ASN1) {
-
-        public Object getDecodedObject(BerInputStream in) {
-            return new GeneralSubtrees((List)in.content);
+        @Override public Object getDecodedObject(BerInputStream in) {
+            return new GeneralSubtrees((List<GeneralSubtree>) in.content);
         }
 
-        public Collection getValues(Object object) {
+        @Override public Collection getValues(Object object) {
             GeneralSubtrees gss = (GeneralSubtrees) object;
             return (gss.generalSubtrees == null)
-                ? new ArrayList() : gss.generalSubtrees;
+                    ? new ArrayList<GeneralSubtree>()
+                    : gss.generalSubtrees;
         }
     };
 }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/InfoAccessSyntax.java b/luni/src/main/java/org/apache/harmony/security/x509/InfoAccessSyntax.java
index 5f26b1e..cd0dd4d 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/InfoAccessSyntax.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/InfoAccessSyntax.java
@@ -18,9 +18,7 @@
 package org.apache.harmony.security.x509;
 
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.harmony.security.asn1.ASN1SequenceOf;
 import org.apache.harmony.security.asn1.ASN1Type;
@@ -46,16 +44,10 @@
  *      accessLocation        GeneralName  }
  *
  */
-public class InfoAccessSyntax extends ExtensionValue {
+public final class InfoAccessSyntax extends ExtensionValue {
+    private final List<?> accessDescriptions;
 
-    private final List accessDescriptions;
-
-    public InfoAccessSyntax(List accessDescriptions) throws IOException {
-        this(accessDescriptions, null);
-    }
-
-    private InfoAccessSyntax(List accessDescriptions, byte[] encoding)
-            throws IOException {
+    private InfoAccessSyntax(List<?> accessDescriptions, byte[] encoding) throws IOException {
         if (accessDescriptions == null || accessDescriptions.isEmpty()) {
             throw new IOException("AccessDescriptions list is null or empty");
         }
@@ -63,15 +55,10 @@
         this.encoding = encoding;
     }
 
-    public List getAccessDescriptions() {
-        return new ArrayList(accessDescriptions);
-    }
-
     /**
      * Returns ASN.1 encoded form of this X.509 InfoAccessSyntax.
-     * @return a byte array containing ASN.1 encoded form.
      */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(this);
         }
@@ -82,31 +69,26 @@
         return ((InfoAccessSyntax) ASN1.decode(encoding));
     }
 
-    public String toString() {
+    @Override public String toString() {
         StringBuilder res = new StringBuilder();
         res.append("\n---- InfoAccessSyntax:");
         if (accessDescriptions != null) {
-            for (Iterator it = accessDescriptions.iterator(); it.hasNext();) {
+            for (Object accessDescription : accessDescriptions) {
                 res.append('\n');
-                res.append(it.next());
+                res.append(accessDescription);
             }
         }
         res.append("\n---- InfoAccessSyntax END\n");
         return res.toString();
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("AccessDescriptions:\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("AccessDescriptions:\n");
         if (accessDescriptions == null || accessDescriptions.isEmpty()) {
-            buffer.append("NULL\n");
+            sb.append("NULL\n");
         } else {
-            Iterator itr = accessDescriptions.iterator();
-            while (itr.hasNext()) {
-                buffer.append(itr.next().toString());
+            for (Object accessDescription : accessDescriptions) {
+                sb.append(accessDescription.toString());
             }
         }
     }
@@ -117,14 +99,12 @@
      * encoder/decoder class.
      */
     public static final ASN1Type ASN1 = new ASN1SequenceOf(AccessDescription.ASN1) {
-
-        public Object getDecodedObject(BerInputStream in) throws IOException {
-            return new InfoAccessSyntax((List)in.content, in.getEncoded());
+        @Override public Object getDecodedObject(BerInputStream in) throws IOException {
+            return new InfoAccessSyntax((List<?>) in.content, in.getEncoded());
         }
 
-        public Collection getValues(Object object) {
-            InfoAccessSyntax aias = (InfoAccessSyntax) object;
-            return aias.accessDescriptions;
+        @Override public Collection getValues(Object object) {
+            return ((InfoAccessSyntax) object).accessDescriptions;
         }
     };
 
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/InhibitAnyPolicy.java b/luni/src/main/java/org/apache/harmony/security/x509/InhibitAnyPolicy.java
index df0d95d..b27471e 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/InhibitAnyPolicy.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/InhibitAnyPolicy.java
@@ -33,17 +33,10 @@
  * </pre>
  * (as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt).
  */
-public class InhibitAnyPolicy extends ExtensionValue {
+public final class InhibitAnyPolicy extends ExtensionValue {
 
-    // the value of the extension
-    private int skipCerts;
-
-    /**
-     * Create the object on the base of SkipCerts value.
-     */
-    public InhibitAnyPolicy(int skipCerts) {
-        this.skipCerts = skipCerts;
-    }
+    /** the value of the extension */
+    private final int skipCerts;
 
     /**
      * Creates an object on the base of its encoded form.
@@ -55,17 +48,9 @@
     }
 
     /**
-     * Return the value of the extension.
-     */
-    public int getSkipCerts() {
-        return skipCerts;
-    }
-
-    /**
      * Returns ASN.1 encoded form of the object.
-     * @return a byte array containing ASN.1 encoded form.
      */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1Integer.getInstance()
                 .encode(ASN1Integer.fromIntValue(skipCerts));
@@ -73,13 +58,7 @@
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Inhibit Any-Policy: ")
-            .append(skipCerts).append('\n');
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Inhibit Any-Policy: ").append(skipCerts).append('\n');
     }
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/InvalidityDate.java b/luni/src/main/java/org/apache/harmony/security/x509/InvalidityDate.java
index a0dce86..b7c1847 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/InvalidityDate.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/InvalidityDate.java
@@ -31,19 +31,11 @@
  * </pre>
  * (as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt)
  */
-public class InvalidityDate extends ExtensionValue {
-
-    // invalidity date value
+public final class InvalidityDate extends ExtensionValue {
+    /** invalidity date value */
     private final Date date;
 
     /**
-     * Constructs the object on the base of the invalidity date value.
-     */
-    public InvalidityDate(Date date) {
-        this.date = date;
-    }
-
-    /**
      * Constructs the object on the base of its encoded form.
      */
     public InvalidityDate(byte[] encoding) throws IOException {
@@ -60,22 +52,16 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 InvalidityDate value.
-     * @return a byte array containing ASN.1 encoded form.
      */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(date);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Invalidity Date: [ ")
-            .append(date).append(" ]\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Invalidity Date: [ ").append(date).append(" ]\n");
     }
 
     /**
@@ -83,4 +69,3 @@
      */
     public static final ASN1Type ASN1 = ASN1GeneralizedTime.getInstance();
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/IssuingDistributionPoint.java b/luni/src/main/java/org/apache/harmony/security/x509/IssuingDistributionPoint.java
index a92a622..17533a3 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/IssuingDistributionPoint.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/IssuingDistributionPoint.java
@@ -41,8 +41,7 @@
  * </pre>
  * (as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt)
  */
-public class IssuingDistributionPoint extends ExtensionValue {
-
+public final class IssuingDistributionPoint extends ExtensionValue {
     // values of the fields of the structure
     private DistributionPointName distributionPoint;
     private boolean onlyContainsUserCerts = false;
@@ -101,79 +100,25 @@
         this.onlyContainsAttributeCerts = onlyContainsAttributeCerts;
     }
 
-    /**
-     * Returns value of distributionPoint field of the structure.
-     */
-    public DistributionPointName getDistributionPoint() {
-        return distributionPoint;
-    }
-
-    /**
-     * Returns value of onlyContainsUserCerts field of the structure.
-     */
-    public boolean getOnlyContainsUserCerts() {
-        return onlyContainsUserCerts;
-    }
-
-    /**
-     * Returns value of onlyContainsCACerts field of the structure.
-     */
-    public boolean getOnlyContainsCACerts() {
-        return onlyContainsCACerts;
-    }
-
-    /**
-     * Returns value of onlySomeReasons field of the structure.
-     */
-    public ReasonFlags getOnlySomeReasons() {
-        return onlySomeReasons;
-    }
-
-    /**
-     * Returns value of indirectCRL field of the structure.
-     */
-    public boolean getIndirectCRL() {
-        return indirectCRL;
-    }
-
-    /**
-     * Returns value of onlyContainsAttributeCerts field of the structure.
-     */
-    public boolean getOnlyContainsAttributeCerts() {
-        return onlyContainsAttributeCerts;
-    }
-
-    /**
-     * Returns ASN.1 encoded form of this X.509 IssuingDistributionPoint value.
-     * @return a byte array containing ASN.1 encoded form.
-     */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(this);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Issuing Distribution Point: [\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Issuing Distribution Point: [\n");
         if (distributionPoint != null) {
-            distributionPoint.dumpValue(buffer, "  " + prefix);
+            distributionPoint.dumpValue(sb, "  " + prefix);
         }
-        buffer.append(prefix).append("  onlyContainsUserCerts: ")
-            .append(onlyContainsUserCerts).append('\n');
-        buffer.append(prefix).append("  onlyContainsCACerts: ")
-            .append(onlyContainsCACerts).append('\n');
+        sb.append(prefix).append("  onlyContainsUserCerts: ").append(onlyContainsUserCerts).append('\n');
+        sb.append(prefix).append("  onlyContainsCACerts: ").append(onlyContainsCACerts).append('\n');
         if (onlySomeReasons != null) {
-            onlySomeReasons.dumpValue(buffer, prefix + "  ");
+            onlySomeReasons.dumpValue(sb, prefix + "  ");
         }
-        buffer.append(prefix).append("  indirectCRL: ")
-            .append(indirectCRL).append('\n');
-        buffer.append(prefix).append("  onlyContainsAttributeCerts: ")
-            .append(onlyContainsAttributeCerts).append('\n');
+        sb.append(prefix).append("  indirectCRL: ").append(indirectCRL).append('\n');
+        sb.append(prefix).append("  onlyContainsAttributeCerts: ").append(onlyContainsAttributeCerts).append('\n');
     }
 
     /**
@@ -200,26 +145,20 @@
 
         protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
-            IssuingDistributionPoint idp =
-                new IssuingDistributionPoint(
-                        (DistributionPointName) values[0],
-                        (ReasonFlags) values[3]);
+            IssuingDistributionPoint idp = new IssuingDistributionPoint(
+                    (DistributionPointName) values[0], (ReasonFlags) values[3]);
             idp.encoding = in.getEncoded();
             if (values[1] != null) {
-                idp.setOnlyContainsUserCerts(
-                        ((Boolean) values[1]).booleanValue());
+                idp.setOnlyContainsUserCerts((Boolean) values[1]);
             }
             if (values[2] != null) {
-                idp.setOnlyContainsCACerts(
-                        ((Boolean) values[2]).booleanValue());
+                idp.setOnlyContainsCACerts((Boolean) values[2]);
             }
             if (values[4] != null) {
-                idp.setIndirectCRL(
-                        ((Boolean) values[4]).booleanValue());
+                idp.setIndirectCRL((Boolean) values[4]);
             }
             if (values[5] != null) {
-                idp.setOnlyContainsAttributeCerts(
-                        ((Boolean) values[5]).booleanValue());
+                idp.setOnlyContainsAttributeCerts((Boolean) values[5]);
             }
             return idp;
         }
@@ -236,4 +175,3 @@
     };
 
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/KeyUsage.java b/luni/src/main/java/org/apache/harmony/security/x509/KeyUsage.java
index 2207a1a..c3cb165 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/KeyUsage.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/KeyUsage.java
@@ -43,11 +43,9 @@
  * </pre>
  * (as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt)
  */
-public class KeyUsage extends ExtensionValue {
+public final class KeyUsage extends ExtensionValue {
 
-    /**
-     * The names of the usages.
-     */
+    /** The names of the usages. */
     private static final String[] USAGES = {
         "digitalSignature",
         "nonRepudiation",
@@ -60,17 +58,10 @@
         "decipherOnly",
     };
 
-    // the value of extension
+    /** the value of extension */
     private final boolean[] keyUsage;
 
     /**
-     * Creates the extension object corresponding to the given key usage.
-     */
-    public KeyUsage(boolean[] keyUsage) {
-        this.keyUsage = keyUsage;
-    }
-
-    /**
      * Creates the extension object on the base of its encoded form.
      */
     public KeyUsage(byte[] encoding) throws IOException {
@@ -82,30 +73,21 @@
         return keyUsage;
     }
 
-    /**
-     * Returns the encoded of the object.
-     * @return a byte array containing ASN.1 encoded form.
-     */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(keyUsage);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("KeyUsage [\n");
-        for (int i=0; i<keyUsage.length; i++) {
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("KeyUsage [\n");
+        for (int i = 0; i < keyUsage.length; i++) {
             if (keyUsage[i]) {
-                buffer.append(prefix).append("  ")
-                    .append(USAGES[i]).append('\n');
+                sb.append(prefix).append("  ").append(USAGES[i]).append('\n');
             }
         }
-        buffer.append(prefix).append("]\n");
+        sb.append(prefix).append("]\n");
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/NameConstraints.java b/luni/src/main/java/org/apache/harmony/security/x509/NameConstraints.java
index e1a5588..ee7530c 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/NameConstraints.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/NameConstraints.java
@@ -25,7 +25,6 @@
 import java.io.IOException;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import org.apache.harmony.security.asn1.ASN1Implicit;
 import org.apache.harmony.security.asn1.ASN1OctetString;
@@ -51,46 +50,34 @@
  *
  * </pre>
  *
- *
  * @see org.apache.harmony.security.x509.GeneralSubtree
  * @see org.apache.harmony.security.x509.GeneralName
  */
-public class NameConstraints extends ExtensionValue {
-
-    // the value of permittedSubtrees field of the structure
+public final class NameConstraints extends ExtensionValue {
+    /** the value of permittedSubtrees field of the structure */
     private final GeneralSubtrees permittedSubtrees;
-    // the value of excludedSubtrees field of the structure
+    /** the value of excludedSubtrees field of the structure */
     private final GeneralSubtrees excludedSubtrees;
-    // the ASN.1 encoded form of NameConstraints
+    /** the ASN.1 encoded form of NameConstraints */
     private byte[] encoding;
 
-    // helper fields
-    private ArrayList[] permitted_names;
-    private ArrayList[] excluded_names;
-
-    /**
-     * Default ctor
-     */
-    public NameConstraints() {
-        this(null, null);
-    }
+    private ArrayList<GeneralName>[] permitted_names;
+    private ArrayList<GeneralName>[] excluded_names;
 
     /**
      * Constructs <code>NameConstrains</code> object
-     * @param   permittedSubtrees:  GeneralSubtrees
-     * @param   excludedSubtrees:   GeneralSubtrees
      */
     public NameConstraints(GeneralSubtrees permittedSubtrees,
                            GeneralSubtrees excludedSubtrees) {
         if (permittedSubtrees != null) {
-            List ps = permittedSubtrees.getSubtrees();
-            if ((ps == null) || (ps.size() == 0)) {
+            List<GeneralSubtree> ps = permittedSubtrees.getSubtrees();
+            if (ps == null || ps.isEmpty()) {
                 throw new IllegalArgumentException("permittedSubtrees are empty");
             }
         }
         if (excludedSubtrees != null) {
-            List es = excludedSubtrees.getSubtrees();
-            if ((es == null) || (es.size() == 0)) {
+            List<GeneralSubtree> es = excludedSubtrees.getSubtrees();
+            if (es == null || es.isEmpty()) {
                 throw new IllegalArgumentException("excludedSubtrees are empty");
             }
         }
@@ -98,12 +85,6 @@
         this.excludedSubtrees = excludedSubtrees;
     }
 
-    //
-    // Constructs NameConstrains object
-    // @param   permittedSubtrees:  GeneralSubtrees
-    // @param   excludedSubtrees:   GeneralSubtrees
-    // @param   encoding:   byte[]
-    //
     private NameConstraints(GeneralSubtrees permittedSubtrees,
                             GeneralSubtrees excludedSubtrees, byte[] encoding) {
         this(permittedSubtrees, excludedSubtrees);
@@ -114,31 +95,25 @@
         return (NameConstraints) ASN1.decode(encoding);
     }
 
-    /**
-     * Returns ASN.1 encoded form of this X.509 NameConstraints value.
-     * @return a byte array containing ASN.1 encode form.
-     */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(this);
         }
         return encoding;
     }
 
-    //
-    // Prepare the data structure to speed up the checking process.
-    //
+    /**
+     * Prepare the data structure to speed up the checking process.
+     */
     private void prepareNames() {
         // array of lists with permitted General Names divided by type
         permitted_names = new ArrayList[9];
         if (permittedSubtrees != null) {
-            Iterator it =  permittedSubtrees.getSubtrees().iterator();
-            while (it.hasNext()) {
-                GeneralName name = ((GeneralSubtree) it.next()).getBase();
-                //System.out.println("PERMITTED: "+name);
+            for (GeneralSubtree generalSubtree : permittedSubtrees.getSubtrees()) {
+                GeneralName name = generalSubtree.getBase();
                 int tag = name.getTag();
                 if (permitted_names[tag] == null) {
-                    permitted_names[tag] = new ArrayList();
+                    permitted_names[tag] = new ArrayList<GeneralName>();
                 }
                 permitted_names[tag].add(name);
             }
@@ -146,22 +121,20 @@
         // array of lists with excluded General Names divided by type
         excluded_names = new ArrayList[9];
         if (excludedSubtrees != null) {
-            Iterator it =  excludedSubtrees.getSubtrees().iterator();
-            while (it.hasNext()) {
-                GeneralName name = ((GeneralSubtree) it.next()).getBase();
-                //System.out.println("EXCLUDED: "+name);
+            for (GeneralSubtree generalSubtree : excludedSubtrees.getSubtrees()) {
+                GeneralName name = generalSubtree.getBase();
                 int tag = name.getTag();
                 if (excluded_names[tag] == null) {
-                    excluded_names[tag] = new ArrayList();
+                    excluded_names[tag] = new ArrayList<GeneralName>();
                 }
                 excluded_names[tag].add(name);
             }
         }
     }
 
-    //
-    // Returns the value of certificate extension
-    //
+    /**
+     * Returns the value of certificate extension
+     */
     private byte[] getExtensionValue(X509Certificate cert, String OID) {
         try {
             byte[] bytes = cert.getExtensionValue(OID);
@@ -185,9 +158,9 @@
      * names the same (i.e. method does not check if it CA's certificate or not,
      * or if the names differ or not. This check if it is needed should be done
      * by caller before calling this method).
-     * @param   X509Certificate :   X.509 Certificate to be checked.
-     * @return  true, if the certificate is acceptable according
-     *          these NameConstraints restrictions, and false otherwise.
+     * @param   cert X.509 Certificate to be checked.
+     * @return  true if the certificate is acceptable according
+     *          these NameConstraints restrictions
      */
     public boolean isAcceptable(X509Certificate cert) {
         if (permitted_names == null) {
@@ -195,10 +168,10 @@
         }
 
         byte[] bytes = getExtensionValue(cert, "2.5.29.17");
-        List names;
+        List<GeneralName> names;
         try {
             names = (bytes == null)
-                ? new ArrayList(1) // will check the subject field only
+                ? new ArrayList<GeneralName>(1) // will check the subject field only
                 : ((GeneralNames) GeneralNames.ASN1.decode(bytes)).getNames();
         } catch (IOException e) {
             // the certificate is broken;
@@ -217,31 +190,26 @@
     }
 
     /**
-     * Check if this list of names is acceptable accoring to this
+     * Check if this list of names is acceptable according to this
      * NameConstraints object.
-     * @param   names:  List
-     * @return
      */
-    public boolean isAcceptable(List names) {
+    public boolean isAcceptable(List<GeneralName> names) {
         if (permitted_names == null) {
             prepareNames();
         }
 
-        Iterator it = names.iterator();
         // check map: shows which types of permitted alternative names are
         // presented in the certificate
         boolean[] types_presented = new boolean[9];
         // check map: shows if permitted name of presented type is found
         // among the certificate's alternative names
         boolean[] permitted_found = new boolean[9];
-        while (it.hasNext()) {
-            GeneralName name = (GeneralName) it.next();
+        for (GeneralName name : names) {
             int type = name.getTag();
             // search the name in excluded names
             if (excluded_names[type] != null) {
-                for (int i=0; i<excluded_names[type].size(); i++) {
-                    if (((GeneralName) excluded_names[type].get(i))
-                            .isAcceptable(name)) {
+                for (int i = 0; i < excluded_names[type].size(); i++) {
+                    if (excluded_names[type].get(i).isAcceptable(name)) {
                         return false;
                     }
                 }
@@ -251,16 +219,15 @@
             // names - we do not need to check others)
             if ((permitted_names[type] != null) && (!permitted_found[type])) {
                 types_presented[type] = true;
-                for (int i=0; i<permitted_names[type].size(); i++) {
-                    if (((GeneralName) permitted_names[type].get(i))
-                            .isAcceptable(name)) {
+                for (int i = 0; i < permitted_names[type].size(); i++) {
+                    if (permitted_names[type].get(i).isAcceptable(name)) {
                         // found one permitted name of such type
                         permitted_found[type] = true;
                     }
                 }
             }
         }
-        for (int type=0; type<9; type++) {
+        for (int type = 0; type < 9; type++) {
             if (types_presented[type] && !permitted_found[type]) {
                 return false;
             }
@@ -268,29 +235,23 @@
         return true;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Name Constraints: [\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Name Constraints: [\n");
         if (permittedSubtrees != null) {
-            buffer.append(prefix).append("  Permitted: [\n");
-            for (Iterator it=permittedSubtrees.getSubtrees().iterator();
-                    it.hasNext();) {
-                ((GeneralSubtree) it.next()).dumpValue(buffer, prefix + "    ");
+            sb.append(prefix).append("  Permitted: [\n");
+            for (GeneralSubtree generalSubtree : permittedSubtrees.getSubtrees()) {
+                generalSubtree.dumpValue(sb, prefix + "    ");
             }
-            buffer.append(prefix).append("  ]\n");
+            sb.append(prefix).append("  ]\n");
         }
         if (excludedSubtrees != null) {
-            buffer.append(prefix).append("  Excluded: [\n");
-            for (Iterator it=excludedSubtrees.getSubtrees().iterator();
-                    it.hasNext();) {
-                ((GeneralSubtree) it.next()).dumpValue(buffer, prefix + "    ");
+            sb.append(prefix).append("  Excluded: [\n");
+            for (GeneralSubtree generalSubtree : excludedSubtrees.getSubtrees()) {
+                generalSubtree.dumpValue(sb, prefix + "    ");
             }
-            buffer.append(prefix).append("  ]\n");
+            sb.append(prefix).append("  ]\n");
         }
-        buffer.append('\n').append(prefix).append("]\n");
+        sb.append('\n').append(prefix).append("]\n");
     }
 
     /**
@@ -304,7 +265,7 @@
             setOptional(1);
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new NameConstraints(
                     (GeneralSubtrees) values[0],
@@ -312,10 +273,8 @@
                     in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             NameConstraints nc = (NameConstraints) object;
-
             values[0] = nc.permittedSubtrees;
             values[1] = nc.excludedSubtrees;
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/ORAddress.java b/luni/src/main/java/org/apache/harmony/security/x509/ORAddress.java
index f5b4bae..1e6b0a7 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/ORAddress.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/ORAddress.java
@@ -45,19 +45,13 @@
  *
  * TODO: this class needs to be finished.
  */
-public class ORAddress {
+public final class ORAddress {
 
-    // the ASN.1 encoded form of ORAddress
+    /** the ASN.1 encoded form of ORAddress */
     private byte[] encoding;
 
     /**
-     * TODO
-     */
-    public ORAddress() {}
-
-    /**
      * Returns ASN.1 encoded form of this X.509 ORAddress value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -71,21 +65,16 @@
      */
     public static final ASN1Sequence ASN1 = new ASN1Sequence(new ASN1Type[] {
             new ASN1Sequence(new ASN1Type[] {}) {
-                protected Object getDecodedObject(Object[] values) {
-                    return null;
-                }
-
-                protected void getValues(Object object, Object[] values) {
-                }
+                @Override protected void getValues(Object object, Object[] values) {}
             }}) {
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             return new ORAddress();
         }
 
-        private final Object foo = new Object();  //$NON-LOCK-1$
+        private final Object foo = new Object();
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             values[0] = foo;
         }
     };
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/OtherName.java b/luni/src/main/java/org/apache/harmony/security/x509/OtherName.java
index d0e9693..cb83f2e 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/OtherName.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/OtherName.java
@@ -45,29 +45,18 @@
  *   }
  * </pre>
  */
-public class OtherName {
-    // the value of typeID field of the structure
+public final class OtherName {
+    /** the value of typeID field of the structure */
     private String typeID;
-    // the value of value field of the structure
+    /** the value of value field of the structure */
     private byte[] value;
-    // the ASN.1 encoded form of OtherName
+    /** the ASN.1 encoded form of OtherName */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   typeID: String
-     * @param   value:  byte[]
-     */
     public OtherName(String typeID, byte[] value) {
         this(typeID, value, null);
     }
 
-    //
-    // TODO
-    // @param   typeID: String
-    // @param   value:  byte[]
-    // @param   encoding:   byte[]
-    //
     private OtherName(String typeID, byte[] value, byte[] encoding) {
         this.typeID = typeID;
         this.value = value;
@@ -75,16 +64,7 @@
     }
 
     /**
-     * Returns the value of typeID field of the structure.
-     * @return  typeID
-     */
-    public String getTypeID() {
-        return typeID;
-    }
-
-    /**
      * Returns the value of value field of the structure.
-     * @return  value
      */
     public byte[] getValue() {
         return value;
@@ -92,7 +72,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 OtherName value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -108,16 +87,14 @@
             ASN1Oid.getInstance(),
             new ASN1Explicit(0, ASN1Any.getInstance()) }) {
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new OtherName(ObjectIdentifier.toString((int[]) values[0]),
                     (byte[]) values[1], in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             OtherName on = (OtherName) object;
-
             values[0] = ObjectIdentifier.toIntArray(on.typeID);
             values[1] = on.value;
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/PolicyConstraints.java b/luni/src/main/java/org/apache/harmony/security/x509/PolicyConstraints.java
index fffcdbd..1c4d4f1 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/PolicyConstraints.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/PolicyConstraints.java
@@ -53,44 +53,20 @@
  * @see org.apache.harmony.security.x509.GeneralSubtree
  * @see org.apache.harmony.security.x509.GeneralName
  */
-public class PolicyConstraints extends ExtensionValue {
-
-    // the value of requireExplicitPolicy field of the structure
+public final class PolicyConstraints extends ExtensionValue {
+    /** the value of requireExplicitPolicy field of the structure */
     private final BigInteger requireExplicitPolicy;
-    // the value of inhibitPolicyMapping field of the structure
+    /** the value of inhibitPolicyMapping field of the structure */
     private final BigInteger inhibitPolicyMapping;
-    // the ASN.1 encoded form of PolicyConstraints;
+    /** the ASN.1 encoded form of PolicyConstraints */
     private byte[] encoding;
 
-    /**
-     * TODO
-     */
-    public PolicyConstraints() {
-        this(null, null);
-    }
-
-    /**
-     * TODO
-     * @param   requireExplicitPolicy:  GeneralSubtrees
-     * @param   inhibitPolicyMapping:   GeneralSubtrees
-     */
     public PolicyConstraints(BigInteger requireExplicitPolicy,
             BigInteger inhibitPolicyMapping) {
         this.requireExplicitPolicy = requireExplicitPolicy;
         this.inhibitPolicyMapping = inhibitPolicyMapping;
     }
 
-    /**
-     * TODO
-     * @param   requireExplicitPolicy:  GeneralSubtrees
-     * @param   inhibitPolicyMapping:   GeneralSubtrees
-     */
-    public PolicyConstraints(int requireExplicitPolicy,
-            int inhibitPolicyMapping) {
-        this.requireExplicitPolicy = BigInteger.valueOf(requireExplicitPolicy);
-        this.inhibitPolicyMapping = BigInteger.valueOf(inhibitPolicyMapping);
-    }
-
     public PolicyConstraints(byte[] encoding) throws IOException {
         super(encoding);
         PolicyConstraints pc = (PolicyConstraints) ASN1.decode(encoding);
@@ -98,12 +74,6 @@
         this.inhibitPolicyMapping = pc.inhibitPolicyMapping;
     }
 
-    //
-    // TODO
-    // @param   requireExplicitPolicy:  GeneralSubtrees
-    // @param   inhibitPolicyMapping:   GeneralSubtrees
-    // @param   encoding:   byte[]
-    //
     private PolicyConstraints(BigInteger requireExplicitPolicy,
                             BigInteger inhibitPolicyMapping, byte[] encoding) {
         this(requireExplicitPolicy, inhibitPolicyMapping);
@@ -112,30 +82,23 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 PolicyConstraints value.
-     * @return a byte array containing ASN.1 encode form.
      */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(this);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("PolicyConstraints: [\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("PolicyConstraints: [\n");
         if (requireExplicitPolicy != null) {
-            buffer.append(prefix).append("  requireExplicitPolicy: ")
-                .append(requireExplicitPolicy).append('\n');
+            sb.append(prefix).append("  requireExplicitPolicy: ").append(requireExplicitPolicy).append('\n');
         }
         if (inhibitPolicyMapping != null) {
-            buffer.append(prefix).append("  inhibitPolicyMapping: ")
-                .append(inhibitPolicyMapping).append('\n');
+            sb.append(prefix).append("  inhibitPolicyMapping: ").append(inhibitPolicyMapping).append('\n');
         }
-        buffer.append(prefix).append("]\n");
+        sb.append(prefix).append("]\n");
     }
 
     /**
@@ -149,7 +112,7 @@
             setOptional(1);
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             BigInteger requireExplicitPolicy = null;
             BigInteger inhibitPolicyMapping = null;
@@ -164,10 +127,8 @@
                     in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             PolicyConstraints pc = (PolicyConstraints) object;
-
             values[0] = pc.requireExplicitPolicy.toByteArray();
             values[1] = pc.inhibitPolicyMapping.toByteArray();
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/PolicyInformation.java b/luni/src/main/java/org/apache/harmony/security/x509/PolicyInformation.java
index bdade63..77bd0b1 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/PolicyInformation.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/PolicyInformation.java
@@ -48,25 +48,18 @@
  * TODO: This class is not fully implemented, implemented only work
  * with OIDs.
  */
-
-public class PolicyInformation {
-
-    // the value of policyIdentifier field of the structure
-    private String policyIdentifier;
-    // the ASN.1 encoded form of PolicyInformation
+public final class PolicyInformation {
+    /** the value of policyIdentifier field of the structure */
+    private final String policyIdentifier;
+    /** the ASN.1 encoded form of PolicyInformation */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   policyIdentifier:   String
-     */
     public PolicyInformation(String policyIdentifier) {
         this.policyIdentifier = policyIdentifier;
     }
 
     /**
      * Returns the value of policyIdentifier field of the structure.
-     * @return  policyIdentifier
      */
     public String getPolicyIdentifier() {
         return policyIdentifier;
@@ -74,7 +67,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 PolicyInformation value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -83,13 +75,8 @@
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer) {
-        buffer.append("Policy Identifier [")
-            .append(policyIdentifier).append(']');
+    public void dumpValue(StringBuilder sb) {
+        sb.append("Policy Identifier [").append(policyIdentifier).append(']');
     }
 
     /**
@@ -101,18 +88,14 @@
             setOptional(1);
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
-            return new PolicyInformation(ObjectIdentifier
-                    .toString((int[]) values[0]));
+            return new PolicyInformation(ObjectIdentifier.toString((int[]) values[0]));
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             PolicyInformation pi = (PolicyInformation) object;
-
             values[0] = ObjectIdentifier.toIntArray(pi.policyIdentifier);
         }
     };
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/PolicyQualifierInfo.java b/luni/src/main/java/org/apache/harmony/security/x509/PolicyQualifierInfo.java
index 7eda5cf..96aa633 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/PolicyQualifierInfo.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/PolicyQualifierInfo.java
@@ -48,7 +48,7 @@
  * </pre>
  *
  */
-public class PolicyQualifierInfo {
+public final class PolicyQualifierInfo {
     // Contains only ASN1 DER decoder currently
     public static final ASN1Sequence ASN1 =
         new ASN1Sequence(new ASN1Type[] {ASN1Oid.getInstance(), ASN1Any.getInstance()}) {
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java b/luni/src/main/java/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java
index b0e14d5..5cb2cb9 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/PrivateKeyUsagePeriod.java
@@ -44,32 +44,19 @@
  * }
  * </pre>
  */
-public class PrivateKeyUsagePeriod {
-
-    // the value of notBeforeDate field of the structure
+public final class PrivateKeyUsagePeriod {
+    /** the value of notBeforeDate field of the structure */
     private final Date notBeforeDate;
-    // the value of notAfterDate field of the structure
+    /** the value of notAfterDate field of the structure */
     private final Date notAfterDate;
-    // the ASN.1 encoded form of PrivateKeyUsagePeriod
+    /** the ASN.1 encoded form of PrivateKeyUsagePeriod */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   notBeforeDate:  Date
-     * @param   notAfterDate:   Date
-     */
     public PrivateKeyUsagePeriod(Date notBeforeDate, Date notAfterDate) {
         this(notBeforeDate, notAfterDate, null);
     }
 
-    //
-    // TODO
-    // @param   notBeforeDate:  Date
-    // @param   notAfterDate:   Date
-    // @param   encoding:   byte[]
-    //
-    private PrivateKeyUsagePeriod(Date notBeforeDate,
-                                  Date notAfterDate, byte[] encoding) {
+    private PrivateKeyUsagePeriod(Date notBeforeDate, Date notAfterDate, byte[] encoding) {
         this.notBeforeDate = notBeforeDate;
         this.notAfterDate = notAfterDate;
         this.encoding = encoding;
@@ -77,7 +64,6 @@
 
     /**
      * Returns the value of notBefore field of the structure.
-     * @return  notBefore
      */
     public Date getNotBefore() {
         return notBeforeDate;
@@ -85,7 +71,6 @@
 
     /**
      * Returns the value of notAfter field of the structure.
-     * @return  notAfter
      */
     public Date getNotAfter() {
         return notAfterDate;
@@ -93,7 +78,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 PrivateKeyUsagePeriod value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -113,17 +97,13 @@
             setOptional(1);
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[])in.content;
-            return
-                new PrivateKeyUsagePeriod((Date) values[0], (Date) values[1],
-                        in.getEncoded());
+            return new PrivateKeyUsagePeriod((Date) values[0], (Date) values[1], in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             PrivateKeyUsagePeriod pkup = (PrivateKeyUsagePeriod) object;
-
             values[0] = pkup.notBeforeDate;
             values[1] = pkup.notAfterDate;
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/ReasonCode.java b/luni/src/main/java/org/apache/harmony/security/x509/ReasonCode.java
index d94e8b3..183ecde 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/ReasonCode.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/ReasonCode.java
@@ -42,7 +42,7 @@
  * </pre>
  * (as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt)
  */
-public class ReasonCode extends ExtensionValue {
+public final class ReasonCode extends ExtensionValue {
 
     // predefined reason code values
     public static final byte UNSPECIFIED = 0;
@@ -59,69 +59,53 @@
     // the reason code value
     private final byte code;
 
-    public ReasonCode(byte code) {
-        this.code = code;
-    }
-
     public ReasonCode(byte[] encoding) throws IOException {
         super(encoding);
         this.code = ((byte[]) ASN1.decode(encoding))[0];
     }
 
-    public int getCode() {
-        return code;
-    }
-
-    /**
-     * Returns ASN.1 encoded form of this X.509 ReasonCode value.
-     * @return a byte array containing ASN.1 encode form.
-     */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1.encode(new byte[] { code });
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("Reason Code: [ ");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("Reason Code: [ ");
         switch (code) {
-            case UNSPECIFIED:
-                buffer.append("unspecified");
-                break;
-            case KEY_COMPROMISE:
-                buffer.append("keyCompromise");
-                break;
-            case CA_COMPROMISE:
-                buffer.append("cACompromise");
-                break;
-            case AFFILIATION_CHANGED:
-                buffer.append("affiliationChanged");
-                break;
-            case SUPERSEDED:
-                buffer.append("superseded");
-                break;
-            case CESSATION_OF_OPERATION:
-                buffer.append("cessationOfOperation");
-                break;
-            case CERTIFICATE_HOLD:
-                buffer.append("certificateHold");
-                break;
-            case REMOVE_FROM_CRL:
-                buffer.append("removeFromCRL");
-                break;
-            case PRIVILEGE_WITHDRAWN:
-                buffer.append("privilegeWithdrawn");
-                break;
-            case AA_COMPROMISE:
-                buffer.append("aACompromise");
-                break;
+        case UNSPECIFIED:
+            sb.append("unspecified");
+            break;
+        case KEY_COMPROMISE:
+            sb.append("keyCompromise");
+            break;
+        case CA_COMPROMISE:
+            sb.append("cACompromise");
+            break;
+        case AFFILIATION_CHANGED:
+            sb.append("affiliationChanged");
+            break;
+        case SUPERSEDED:
+            sb.append("superseded");
+            break;
+        case CESSATION_OF_OPERATION:
+            sb.append("cessationOfOperation");
+            break;
+        case CERTIFICATE_HOLD:
+            sb.append("certificateHold");
+            break;
+        case REMOVE_FROM_CRL:
+            sb.append("removeFromCRL");
+            break;
+        case PRIVILEGE_WITHDRAWN:
+            sb.append("privilegeWithdrawn");
+            break;
+        case AA_COMPROMISE:
+            sb.append("aACompromise");
+            break;
         }
-        buffer.append(" ]\n");
+        sb.append(" ]\n");
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/ReasonFlags.java b/luni/src/main/java/org/apache/harmony/security/x509/ReasonFlags.java
index 0be3637..5231e61 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/ReasonFlags.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/ReasonFlags.java
@@ -49,7 +49,7 @@
  *  }
  *  </pre>
  */
-public class ReasonFlags {
+public final class ReasonFlags {
 
     /**
      * The names of the reasons.
@@ -66,8 +66,8 @@
         "aACompromise"
     };
 
-    // the value of extension
-    private boolean[] flags;
+    /** the value of extension */
+    private final boolean[] flags;
 
     /**
      * Creates the extension object corresponding to the given flags.
@@ -76,21 +76,16 @@
         this.flags = flags;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix);
-        buffer.append("ReasonFlags [\n");
+    public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix);
+        sb.append("ReasonFlags [\n");
         for (int i=0; i<flags.length; i++) {
             if (flags[i]) {
-                buffer.append(prefix).append("  ")
-                    .append(REASONS[i]).append('\n');
+                sb.append(prefix).append("  ").append(REASONS[i]).append('\n');
             }
         }
-        buffer.append(prefix);
-        buffer.append("]\n");
+        sb.append(prefix);
+        sb.append("]\n");
     }
 
     /**
@@ -108,4 +103,3 @@
         }
     };
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/SubjectKeyIdentifier.java b/luni/src/main/java/org/apache/harmony/security/x509/SubjectKeyIdentifier.java
index 185a6ca..7415002 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/SubjectKeyIdentifier.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/SubjectKeyIdentifier.java
@@ -35,7 +35,7 @@
  * </pre>
  * (as specified in RFC 3280 http://www.ietf.org/rfc/rfc3280.txt)
  */
-public class SubjectKeyIdentifier extends ExtensionValue {
+public final class SubjectKeyIdentifier extends ExtensionValue {
 
     // the value of key identifier
     private final byte[] keyIdentifier;
@@ -58,25 +58,16 @@
         return res;
     }
 
-    /**
-     * Returns ASN.1 encoded form of extension.
-     * @return a byte array containing ASN.1 encoded form.
-     */
-    public byte[] getEncoded() {
+    @Override public byte[] getEncoded() {
         if (encoding == null) {
             encoding = ASN1OctetString.getInstance().encode(keyIdentifier);
         }
         return encoding;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer, String prefix) {
-        buffer.append(prefix).append("SubjectKeyIdentifier: [\n");
-        buffer.append(Array.toString(keyIdentifier, prefix));
-        buffer.append(prefix).append("]\n");
+    @Override public void dumpValue(StringBuilder sb, String prefix) {
+        sb.append(prefix).append("SubjectKeyIdentifier: [\n");
+        sb.append(Array.toString(keyIdentifier, prefix));
+        sb.append(prefix).append("]\n");
     }
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java b/luni/src/main/java/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java
index 1117fc2..545d489 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/SubjectPublicKeyInfo.java
@@ -49,47 +49,26 @@
  *  }
  * </pre>
  */
-public class SubjectPublicKeyInfo {
-
-    // the value of algorithmID field of the structure
+public final class SubjectPublicKeyInfo {
+    /** the value of algorithmID field of the structure */
     private AlgorithmIdentifier algorithmID;
-    // the value of subjectPublicKey field of the structure
+    /** the value of subjectPublicKey field of the structure */
     private byte[] subjectPublicKey;
-    // the public key corresponding to this SubjectPublicKeyInfo
+    /** the public key corresponding to this SubjectPublicKeyInfo */
     private PublicKey publicKey;
-    // the value of unusedBits field of the structure
+    /** the value of unusedBits field of the structure */
     private int unusedBits;
-    // the ASN.1 encoded form of SubjectPublicKeyInfo
+    /** the ASN.1 encoded form of SubjectPublicKeyInfo */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   algID:  AlgorithmIdentifier
-     * @param   subjectPublicKey:   byte[]
-     */
-    public SubjectPublicKeyInfo(AlgorithmIdentifier algID,
-                                byte[] subjectPublicKey) {
+    public SubjectPublicKeyInfo(AlgorithmIdentifier algID, byte[] subjectPublicKey) {
         this(algID, subjectPublicKey, 0);
     }
 
-    /**
-     * TODO
-     * @param   algID:  AlgorithmIdentifier
-     * @param   subjectPublicKey:   byte[]
-     * @param   unused: int
-     */
-    public SubjectPublicKeyInfo(AlgorithmIdentifier algID,
-                                byte[] subjectPublicKey, int unused) {
+    public SubjectPublicKeyInfo(AlgorithmIdentifier algID, byte[] subjectPublicKey, int unused) {
         this(algID, subjectPublicKey, 0, null);
     }
 
-    //
-    // TODO
-    // @param   algID:  AlgorithmIdentifier
-    // @param   subjectPublicKey:   byte[]
-    // @param   unused: int
-    // @param   encoding:   byte[]
-    //
     private SubjectPublicKeyInfo(AlgorithmIdentifier algID,
                                  byte[] subjectPublicKey, int unused,
                                  byte[] encoding) {
@@ -101,7 +80,6 @@
 
     /**
      * Returns the value of algorithmIdentifier field of the structure.
-     * @return  algorithmIdentifier
      */
     public AlgorithmIdentifier getAlgorithmIdentifier() {
         return algorithmID;
@@ -109,23 +87,13 @@
 
     /**
      * Returns the value of subjectPublicKey field of the structure.
-     * @return  subjectPublicKey
      */
     public byte[] getSubjectPublicKey() {
         return subjectPublicKey;
     }
 
     /**
-     * Returns the value of unusedBits field of the structure.
-     * @return  unusedBits
-     */
-    public int getUnusedBits() {
-        return unusedBits;
-    }
-
-    /**
      * Returns ASN.1 encoded form of this X.509 SubjectPublicKeyInfo value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -137,7 +105,6 @@
     /**
      * Returns The PublicKey corresponding to this SubjectPublicKeyInfo
      * instance.
-     * @return public key corresponding to this SubjectPublicKeyInfo.
      */
     public PublicKey getPublicKey() {
         if (publicKey == null) {
@@ -151,8 +118,8 @@
                 }
                 publicKey = KeyFactory.getInstance(alg)
                     .generatePublic(new X509EncodedKeySpec(getEncoded()));
-            } catch (InvalidKeySpecException e) {
-            } catch (NoSuchAlgorithmException e) {
+            } catch (InvalidKeySpecException ignored) {
+            } catch (NoSuchAlgorithmException ignored) {
             }
             if (publicKey == null) {
                 publicKey = new X509PublicKey(alg_oid, getEncoded(),
@@ -164,8 +131,7 @@
 
     public static final ASN1Sequence ASN1 = new ASN1Sequence(new ASN1Type[] {
             AlgorithmIdentifier.ASN1, ASN1BitString.getInstance() }) {
-
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new SubjectPublicKeyInfo(
                     (AlgorithmIdentifier) values[0],
@@ -174,10 +140,8 @@
                     in.getEncoded());
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             SubjectPublicKeyInfo spki = (SubjectPublicKeyInfo) object;
-
             values[0] = spki.algorithmID;
             values[1] = new BitString(spki.subjectPublicKey, spki.unusedBits);
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/TBSCertList.java b/luni/src/main/java/org/apache/harmony/security/x509/TBSCertList.java
index 78b294d..aad8990 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/TBSCertList.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/TBSCertList.java
@@ -26,7 +26,6 @@
 import java.math.BigInteger;
 import java.util.Arrays;
 import java.util.Date;
-import java.util.Iterator;
 import java.util.List;
 import javax.security.auth.x500.X500Principal;
 import org.apache.harmony.security.asn1.ASN1Explicit;
@@ -65,23 +64,22 @@
  *   }
  * </pre>
  */
-public class TBSCertList {
-
-    // the value of version field of the structure
+public final class TBSCertList {
+    /** the value of version field of the structure */
     private final int version;
-    // the value of signature field of the structure
+    /** the value of signature field of the structure */
     private final AlgorithmIdentifier signature;
-    // the value of issuer field of the structure
+    /** the value of issuer field of the structure */
     private final Name issuer;
-    // the value of thisUpdate of the structure
+    /** the value of thisUpdate of the structure */
     private final Date thisUpdate;
-    // the value of nextUpdate of the structure
+    /** the value of nextUpdate of the structure */
     private final Date nextUpdate;
-    // the value of revokedCertificates of the structure
-    private final List revokedCertificates;
-    // the value of crlExtensions field of the structure
+    /** the value of revokedCertificates of the structure */
+    private final List<RevokedCertificate> revokedCertificates;
+    /** the value of crlExtensions field of the structure */
     private final Extensions crlExtensions;
-    // the ASN.1 encoded form of TBSCertList
+    /** the ASN.1 encoded form of TBSCertList */
     private byte[] encoding;
 
     public static class RevokedCertificate {
@@ -157,20 +155,13 @@
                     + (crlEntryExtensions == null ? 0 : crlEntryExtensions.hashCode());
         }
 
-        /**
-         * Places the string representation of extension value
-         * into the StringBuffer object.
-         */
-        public void dumpValue(StringBuffer buffer, String prefix) {
-            buffer.append(prefix).append("Certificate Serial Number: ")
-                .append(userCertificate).append('\n');
-            buffer.append(prefix).append("Revocation Date: ")
-                .append(revocationDate);
+        public void dumpValue(StringBuilder sb, String prefix) {
+            sb.append(prefix).append("Certificate Serial Number: ").append(userCertificate).append('\n');
+            sb.append(prefix).append("Revocation Date: ").append(revocationDate);
             if (crlEntryExtensions != null) {
-                buffer.append('\n').append(prefix)
-                    .append("CRL Entry Extensions: [");
-                crlEntryExtensions.dumpValue(buffer, prefix + "  ");
-                buffer.append(prefix).append(']');
+                sb.append('\n').append(prefix).append("CRL Entry Extensions: [");
+                crlEntryExtensions.dumpValue(sb, prefix + "  ");
+                sb.append(prefix).append(']');
             }
         }
 
@@ -181,9 +172,8 @@
                 setOptional(2);
             }
 
-            protected Object getDecodedObject(BerInputStream in) {
+            @Override protected Object getDecodedObject(BerInputStream in) {
                 Object[] values = (Object[]) in.content;
-
                 return new RevokedCertificate(
                             new BigInteger((byte[]) values[0]),
                             (Date) values[1],
@@ -191,9 +181,8 @@
                         );
             }
 
-            protected void getValues(Object object, Object[] values) {
+            @Override protected void getValues(Object object, Object[] values) {
                 RevokedCertificate rcert = (RevokedCertificate) object;
-
                 values[0] = rcert.userCertificate.toByteArray();
                 values[1] = rcert.revocationDate;
                 values[2] = rcert.crlEntryExtensions;
@@ -201,63 +190,10 @@
         };
     }
 
-    /**
-     * Constructs the instance of TBSCertList without optional fields.
-     * Take a note, that regarding to the rfc 3280 (p. 49):
-     * "When CRLs are issued, the CRLs MUST be version 2 CRLs, include the date
-     * by which the next CRL will be issued in the nextUpdate field (section
-     * 5.1.2.5), include the CRL number extension (section 5.2.3), and include
-     * the authority key identifier extension (section 5.2.1). Conforming
-     * applications that support CRLs are REQUIRED to process both version 1 and
-     * version 2 complete CRLs that provide revocation information for all
-     * certificates issued by one CA. Conforming applications are NOT REQUIRED
-     * to support processing of delta CRLs, indirect CRLs, or CRLs with a scope
-     * other than all certificates issued by one CA."
-     * @param   signature:  AlgorithmIdentifier
-     * @param   issuer: Name
-     * @param   thisUpdate: Time
-     */
-    public TBSCertList(AlgorithmIdentifier signature,
-            Name issuer, Date thisUpdate) {
-        this.version = 1;
-        this.signature = signature;
-        this.issuer = issuer;
-        this.thisUpdate = thisUpdate;
-        this.nextUpdate = null;
-        this.revokedCertificates = null;
-        this.crlExtensions = null;
-    }
-
-    /**
-     * Constructs the instance of TBSCertList with all optional fields
-     * @param   version: version of the CRL. Should be 1 or 2.
-     * Note that if the version of CRL is 1, then nextUpdate,
-     * crlExtensions fields of CRL and crlEntryExtensions field
-     * of CRL entry must not be presented in CRL.
-     * FIXME: do check for it.
-     * @param   signature:  AlgorithmIdentifier
-     * @param   issuer: Name
-     * @param   thisUpdate: Time
-     * @param   nextUpdate: Time
-     * @param   revokedCertificates:    List
-     * @param   crlExtensions:  Extensions
-     */
-    public TBSCertList(int version, AlgorithmIdentifier signature,
-            Name issuer, Date thisUpdate, Date nextUpdate,
-            List revokedCertificates, Extensions crlExtensions) {
-        this.version = version;
-        this.signature = signature;
-        this.issuer = issuer;
-        this.thisUpdate = thisUpdate;
-        this.nextUpdate = nextUpdate;
-        this.revokedCertificates = revokedCertificates;
-        this.crlExtensions = crlExtensions;
-    }
-
-    // Constructs the object with associated ASN.1 encoding
+    /** Constructs the object with associated ASN.1 encoding */
     private TBSCertList(int version, AlgorithmIdentifier signature,
             Name issuer, Date thisUpdate, Date nextUpdate,
-            List revokedCertificates, Extensions crlExtensions,
+            List<RevokedCertificate> revokedCertificates, Extensions crlExtensions,
             byte[] encoding) {
         this.version = version;
         this.signature = signature;
@@ -271,7 +207,6 @@
 
     /**
      * Returns the value of version field of the structure.
-     * @return  version
      */
     public int getVersion() {
         return version;
@@ -279,7 +214,6 @@
 
     /**
      * Returns the value of signature field of the structure.
-     * @return  signature
      */
     public AlgorithmIdentifier getSignature() {
         return signature;
@@ -287,7 +221,6 @@
 
     /**
      * Returns the value of issuer field of the structure.
-     * @return  issuer
      */
     public Name getIssuer() {
         return issuer;
@@ -295,7 +228,6 @@
 
     /**
      * Returns the value of thisUpdate field of the structure.
-     * @return thisUpdate
      */
     public Date getThisUpdate() {
         return thisUpdate;
@@ -303,7 +235,6 @@
 
     /**
      * Returns the value of nextUpdate field of the structure.
-     * @return nextUpdate
      */
     public Date getNextUpdate() {
         return nextUpdate;
@@ -311,15 +242,13 @@
 
     /**
      * Returns the value of revokedCertificates field of the structure.
-     * @return revokedCertificates
      */
-    public List getRevokedCertificates() {
+    public List<RevokedCertificate> getRevokedCertificates() {
         return revokedCertificates;
     }
 
     /**
      * Returns the value of crlExtensions field of the structure.
-     * @return  extensions
      */
     public Extensions getCrlExtensions() {
         return crlExtensions;
@@ -327,7 +256,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 TBSCertList value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -336,66 +264,56 @@
         return encoding;
     }
 
-    public boolean equals(Object tbs) {
-        if (!(tbs instanceof TBSCertList)) {
+    @Override public boolean equals(Object other) {
+        if (!(other instanceof TBSCertList)) {
             return false;
         }
-        TBSCertList tbscert = (TBSCertList) tbs;
-        return (version == tbscert.version)
-            && (signature.equals(tbscert.signature))
-            // FIXME use Name.equals when it will be implemented
-            && (Arrays.equals(issuer.getEncoded(), tbscert.issuer.getEncoded()))
-            && ((thisUpdate.getTime() / 1000)
-                    == (tbscert.thisUpdate.getTime() / 1000))
-            && ((nextUpdate == null)
-                    ? tbscert.nextUpdate == null
-                    : ((nextUpdate.getTime() / 1000)
-                        == (tbscert.nextUpdate.getTime() / 1000)))
-            && ((((revokedCertificates == null)
-                            || (tbscert.revokedCertificates == null))
-                    && (revokedCertificates == tbscert.revokedCertificates))
-                || (revokedCertificates.containsAll(tbscert.revokedCertificates)
-                    && (revokedCertificates.size()
-                        == tbscert.revokedCertificates.size())))
-            && ((crlExtensions == null)
-                    ? tbscert.crlExtensions == null
-                    : crlExtensions.equals(tbscert.crlExtensions));
+        TBSCertList that = (TBSCertList) other;
+        return version == that.version
+            && signature.equals(that.signature)
+            && Arrays.equals(issuer.getEncoded(), that.issuer.getEncoded())
+            && thisUpdate.getTime() / 1000
+                    == that.thisUpdate.getTime() / 1000
+            && (nextUpdate == null
+                    ? that.nextUpdate == null
+                    : nextUpdate.getTime() / 1000
+                        == that.nextUpdate.getTime() / 1000)
+            && ((revokedCertificates == null || that.revokedCertificates == null)
+                && revokedCertificates == that.revokedCertificates
+                || revokedCertificates.equals(that.revokedCertificates))
+            && (crlExtensions == null
+                    ? that.crlExtensions == null
+                    : crlExtensions.equals(that.crlExtensions));
     }
 
-    public int hashCode() {
+    @Override public int hashCode() {
         return ((version * 37 + signature.hashCode()) * 37
-                + issuer.getEncoded().hashCode()) * 37
+                + Arrays.hashCode(issuer.getEncoded())) * 37
                 + (int)thisUpdate.getTime() / 1000;
     }
 
-    /**
-     * Places the string representation of extension value
-     * into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer) {
-        buffer.append("X.509 CRL v").append(version);
-        buffer.append("\nSignature Algorithm: [");
-        signature.dumpValue(buffer);
-        buffer.append(']');
-        buffer.append("\nIssuer: ").append(issuer.getName(X500Principal.RFC2253));
-        buffer.append("\n\nThis Update: ").append(thisUpdate);
-        buffer.append("\nNext Update: ").append(nextUpdate).append('\n');
+    public void dumpValue(StringBuilder sb) {
+        sb.append("X.509 CRL v").append(version);
+        sb.append("\nSignature Algorithm: [");
+        signature.dumpValue(sb);
+        sb.append(']');
+        sb.append("\nIssuer: ").append(issuer.getName(X500Principal.RFC2253));
+        sb.append("\n\nThis Update: ").append(thisUpdate);
+        sb.append("\nNext Update: ").append(nextUpdate).append('\n');
         if (revokedCertificates != null) {
-            buffer.append("\nRevoked Certificates: ")
-                .append(revokedCertificates.size()).append(" [");
+            sb.append("\nRevoked Certificates: ").append(revokedCertificates.size()).append(" [");
             int number = 1;
-            for (Iterator it = revokedCertificates.iterator();it.hasNext();) {
-                buffer.append("\n  [").append(number++).append(']');
-                ((RevokedCertificate) it.next()).dumpValue(buffer, "  ");
-                buffer.append('\n');
+            for (RevokedCertificate revokedCertificate : revokedCertificates) {
+                sb.append("\n  [").append(number++).append(']');
+                revokedCertificate.dumpValue(sb, "  ");
+                sb.append('\n');
             }
-            buffer.append("]\n");
+            sb.append("]\n");
         }
         if (crlExtensions != null) {
-            buffer.append("\nCRL Extensions: ")
-                .append(crlExtensions.size()).append(" [");
-            crlExtensions.dumpValue(buffer, "  ");
-            buffer.append("]\n");
+            sb.append("\nCRL Extensions: ").append(crlExtensions.size()).append(" [");
+            crlExtensions.dumpValue(sb, "  ");
+            sb.append("]\n");
         }
     }
 
@@ -418,8 +336,7 @@
             setOptional(6);
         }
 
-        protected Object getDecodedObject(BerInputStream in)
-                        throws IOException {
+        @Override protected Object getDecodedObject(BerInputStream in) throws IOException {
             Object[] values = (Object[]) in.content;
             return new TBSCertList(
                         (values[0] == null)
@@ -429,13 +346,13 @@
                         (Name) values[2],
                         (Date) values[3],
                         (Date) values[4],
-                        (List) values[5],
+                        (List<RevokedCertificate>) values[5],
                         (Extensions) values[6],
                         in.getEncoded()
                     );
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             TBSCertList tbs = (TBSCertList) object;
             values[0] = (tbs.version > 1)
                 ? ASN1Integer.fromIntValue(tbs.version - 1) : null;
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/TBSCertificate.java b/luni/src/main/java/org/apache/harmony/security/x509/TBSCertificate.java
index 5711630..9d622c9 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/TBSCertificate.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/TBSCertificate.java
@@ -60,63 +60,31 @@
  *  }
  * </pre>
  */
-public class TBSCertificate {
+public final class TBSCertificate {
 
-    // the value of version field of the structure
+    /** the value of version field of the structure */
     private final int version;
-    // the value of serialNumber field of the structure
+    /** the value of serialNumber field of the structure */
     private final BigInteger serialNumber;
-    // the value of signature field of the structure
+    /** the value of signature field of the structure */
     private final AlgorithmIdentifier signature;
-    // the value of issuer field of the structure
+    /** the value of issuer field of the structure */
     private final Name issuer;
-    // the value of validity field of the structure
+    /** the value of validity field of the structure */
     private final Validity validity;
-    // the value of subject field of the structure
+    /** the value of subject field of the structure */
     private final Name subject;
-    // the value of subjectPublicKeyInfo field of the structure
+    /** the value of subjectPublicKeyInfo field of the structure */
     private final SubjectPublicKeyInfo subjectPublicKeyInfo;
-    // the value of issuerUniqueID field of the structure
+    /** the value of issuerUniqueID field of the structure */
     private final boolean[] issuerUniqueID;
-    // the value of subjectUniqueID field of the structure
+    /** the value of subjectUniqueID field of the structure */
     private final boolean[] subjectUniqueID;
-    // the value of extensions field of the structure
+    /** the value of extensions field of the structure */
     private final Extensions extensions;
-    // the ASN.1 encoded form of TBSCertificate
-    byte[] encoding;
+    /** the ASN.1 encoded form of TBSCertificate */
+    private byte[] encoding;
 
-    /**
-     * Constructs the instance of TBSCertificate without optional
-     * fields (issuerUniqueID, subjectUniqueID, extensions)
-     * @param   version :   int
-     * @param   serialNumber    :   BigInteger
-     * @param   signature   :   AlgorithmIdentifier
-     * @param   issuer  :   Name
-     * @param   validity    :   Validity
-     * @param   subject :   Name
-     * @param   subjectPublicKeyInfo    :   SubjectPublicKeyInfo
-     */
-    public TBSCertificate(int version, BigInteger serialNumber,
-                          AlgorithmIdentifier signature, Name issuer,
-                          Validity validity, Name subject,
-                          SubjectPublicKeyInfo subjectPublicKeyInfo) {
-        this(version, serialNumber, signature, issuer, validity, subject,
-             subjectPublicKeyInfo, null, null, null);
-    }
-
-    /**
-     * TODO
-     * @param   version:    int
-     * @param   serialNumber:   BigInteger
-     * @param   signature:  AlgorithmIdentifier
-     * @param   issuer: Name
-     * @param   validity:   Validity
-     * @param   subject:    Name
-     * @param   subjectPublicKeyInfo:   SubjectPublicKeyInfo
-     * @param   issuerUniqueID: byte[]
-     * @param   subjectUniqueID:    byte[]
-     * @param   extensions: Extensions
-     */
     public TBSCertificate(int version, BigInteger serialNumber,
                           AlgorithmIdentifier signature, Name issuer,
                           Validity validity, Name subject,
@@ -135,20 +103,6 @@
         this.extensions = extensions;
     }
 
-    //
-    // TODO
-    // @param   version:    int
-    // @param   serialNumber:   BigInteger
-    // @param   signature:  AlgorithmIdentifier
-    // @param   issuer: Name
-    // @param   validity:   Validity
-    // @param   subject:    Name
-    // @param   subjectPublicKeyInfo:   SubjectPublicKeyInfo
-    // @param   issuerUniqueID: byte[]
-    // @param   subjectUniqueID:    byte[]
-    // @param   extensions: Extensions
-    // @param   encoding:   byte[]
-    //
     private TBSCertificate(int version, BigInteger serialNumber,
                           AlgorithmIdentifier signature, Name issuer,
                           Validity validity, Name subject,
@@ -162,7 +116,6 @@
 
     /**
      * Returns the value of version field of the structure.
-     * @return  version
      */
     public int getVersion() {
         return version;
@@ -170,7 +123,6 @@
 
     /**
      * Returns the value of serialNumber field of the structure.
-     * @return  serialNumber
      */
     public BigInteger getSerialNumber() {
         return serialNumber;
@@ -178,7 +130,6 @@
 
     /**
      * Returns the value of signature field of the structure.
-     * @return  signature
      */
     public AlgorithmIdentifier getSignature() {
         return signature;
@@ -186,7 +137,6 @@
 
     /**
      * Returns the value of issuer field of the structure.
-     * @return  issuer
      */
     public Name getIssuer() {
         return issuer;
@@ -194,7 +144,6 @@
 
     /**
      * Returns the value of validity field of the structure.
-     * @return  validity
      */
     public Validity getValidity() {
         return validity;
@@ -202,7 +151,6 @@
 
     /**
      * Returns the value of subject field of the structure.
-     * @return  subject
      */
     public Name getSubject() {
         return subject;
@@ -210,7 +158,6 @@
 
     /**
      * Returns the value of subjectPublicKeyInfo field of the structure.
-     * @return  subjectPublicKeyInfo
      */
     public SubjectPublicKeyInfo getSubjectPublicKeyInfo() {
         return subjectPublicKeyInfo;
@@ -218,7 +165,6 @@
 
     /**
      * Returns the value of issuerUniqueID field of the structure.
-     * @return  issuerUniqueID
      */
     public boolean[] getIssuerUniqueID() {
         return issuerUniqueID;
@@ -226,7 +172,6 @@
 
     /**
      * Returns the value of subjectUniqueID field of the structure.
-     * @return  subjectUniqueID
      */
     public boolean[] getSubjectUniqueID() {
         return subjectUniqueID;
@@ -234,7 +179,6 @@
 
     /**
      * Returns the value of extensions field of the structure.
-     * @return  extensions
      */
     public Extensions getExtensions() {
         return extensions;
@@ -242,7 +186,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 TBSCertificate value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -251,45 +194,36 @@
         return encoding;
     }
 
-    /**
-     * Places the string representation into the StringBuffer object.
-     */
-    public void dumpValue(StringBuffer buffer) {
-        buffer.append('[');
-        buffer.append("\n  Version: V").append(version+1);
-        buffer.append("\n  Subject: ")
-            .append(subject.getName(X500Principal.RFC2253));
-        buffer.append("\n  Signature Algorithm: ");
-        signature.dumpValue(buffer);
-        buffer.append("\n  Key: ");
-        buffer.append(subjectPublicKeyInfo.getPublicKey().toString());
-        buffer.append("\n  Validity: [From: ");
-        buffer.append(validity.getNotBefore());
-        buffer.append("\n               To: ");
-        buffer.append(validity.getNotAfter()).append(']');
-        buffer.append("\n  Issuer: ");
-        buffer.append(issuer.getName(X500Principal.RFC2253));
-        buffer.append("\n  Serial Number: ");
-        buffer.append(serialNumber);
+    public void dumpValue(StringBuilder sb) {
+        sb.append('[');
+        sb.append("\n  Version: V").append(version+1);
+        sb.append("\n  Subject: ").append(subject.getName(X500Principal.RFC2253));
+        sb.append("\n  Signature Algorithm: ");
+        signature.dumpValue(sb);
+        sb.append("\n  Key: ").append(subjectPublicKeyInfo.getPublicKey().toString());
+        sb.append("\n  Validity: [From: ").append(validity.getNotBefore());
+        sb.append("\n               To: ").append(validity.getNotAfter()).append(']');
+        sb.append("\n  Issuer: ").append(issuer.getName(X500Principal.RFC2253));
+        sb.append("\n  Serial Number: ").append(serialNumber);
         if (issuerUniqueID != null) {
-            buffer.append("\n  Issuer Id: ");
-            for (int i=0; i<issuerUniqueID.length; i++) {
-                buffer.append(issuerUniqueID[i] ? '1' : '0');
+            sb.append("\n  Issuer Id: ");
+            for (boolean b : issuerUniqueID) {
+                sb.append(b ? '1' : '0');
             }
         }
         if (subjectUniqueID != null) {
-            buffer.append("\n  Subject Id: ");
-            for (int i=0; i<subjectUniqueID.length; i++) {
-                buffer.append(subjectUniqueID[i] ? '1' : '0');
+            sb.append("\n  Subject Id: ");
+            for (boolean b : subjectUniqueID) {
+                sb.append(b ? '1' : '0');
             }
         }
         if (extensions != null) {
-            buffer.append("\n\n  Extensions: ");
-            buffer.append("[\n");
-            extensions.dumpValue(buffer, "    ");
-            buffer.append("  ]");
+            sb.append("\n\n  Extensions: ");
+            sb.append("[\n");
+            extensions.dumpValue(sb, "    ");
+            sb.append("  ]");
         }
-        buffer.append("\n]");
+        sb.append("\n]");
     }
 
     /**
@@ -309,7 +243,7 @@
             setOptional(9);
         }
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
 
             boolean[] issuerUniqueID = (values[7] == null)
@@ -331,7 +265,7 @@
                     );
         }
 
-        protected void getValues(Object object, Object[] values) {
+        @Override protected void getValues(Object object, Object[] values) {
             TBSCertificate tbs = (TBSCertificate) object;
             values[0] = ASN1Integer.fromIntValue(tbs.version);
             values[1] = tbs.serialNumber.toByteArray();
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/Time.java b/luni/src/main/java/org/apache/harmony/security/x509/Time.java
index b60711a..5576ac3 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/Time.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/Time.java
@@ -41,8 +41,7 @@
  * }
  * </pre>
  */
-public class Time {
-
+public final class Time {
     private static final long JAN_01_2050 = 2524608000000L;
 
     public static final ASN1Choice ASN1 = new ASN1Choice(new ASN1Type[] {
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/Utils.java b/luni/src/main/java/org/apache/harmony/security/x509/Utils.java
deleted file mode 100644
index 99951a1..0000000
--- a/luni/src/main/java/org/apache/harmony/security/x509/Utils.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Alexander V. Esin
-* @version $Revision$
-*/
-
-package org.apache.harmony.security.x509;
-
-/**
- * Text utils for processing DN string representations
- */
-
-public class Utils {
-
-    /**
-     * Checks if the string is PrintableString (see X.680)
-     * @param str input string
-     * @return true if the string is PrintableString, false otherwise
-     */
-    public static boolean isPrintableString(String str) {
-        for (int i= 0; i< str.length(); ++i) {
-            char ch= str.charAt(i);
-            if (!(ch== 0x20
-                || ch>= 0x27 && ch<= 0x29 // '()
-                || ch>= 0x2B && ch<= 0x3A // +,-./0-9:
-                || ch== '='
-                || ch== '?'
-                || ch>= 'A' && ch<= 'Z'
-                || ch>= 'a' && ch<= 'z')) {
-                return false;
-            }
-        }
-        return true;
-    }
-}
\ No newline at end of file
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/Validity.java b/luni/src/main/java/org/apache/harmony/security/x509/Validity.java
index 5f5cbd2..708979e 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/Validity.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/Validity.java
@@ -42,19 +42,14 @@
  *  }
  * </pre>
  */
-public class Validity {
-    // the value of notBefore field of the structure
+public final class Validity {
+    /** the value of notBefore field of the structure */
     private final Date notBefore;
-    // the value of notAfter field of the structure
+    /** the value of notAfter field of the structure */
     private final Date notAfter;
-    // the ASN.1 encoded form of Validity
+    /** the ASN.1 encoded form of Validity */
     private byte[] encoding;
 
-    /**
-     * TODO
-     * @param   notBefore:  Date
-     * @param   notAfter:   Date
-     */
     public Validity(Date notBefore, Date notAfter) {
         this.notBefore = notBefore;
         this.notAfter = notAfter;
@@ -62,7 +57,6 @@
 
     /**
      * Returns the value of notBefore field of the structure.
-     * @return  notBefore
      */
     public Date getNotBefore() {
         return notBefore;
@@ -70,7 +64,6 @@
 
     /**
      * Returns the value of notAfter field of the structure.
-     * @return  notAfter
      */
     public Date getNotAfter() {
         return notAfter;
@@ -78,7 +71,6 @@
 
     /**
      * Returns ASN.1 encoded form of this X.509 Validity value.
-     * @return a byte array containing ASN.1 encode form.
      */
     public byte[] getEncoded() {
         if (encoding == null) {
@@ -93,15 +85,13 @@
     public static final ASN1Sequence ASN1
         = new ASN1Sequence(new ASN1Type[] {Time.ASN1, Time.ASN1 }) {
 
-        protected Object getDecodedObject(BerInputStream in) {
+        @Override protected Object getDecodedObject(BerInputStream in) {
             Object[] values = (Object[]) in.content;
             return new Validity((Date) values[0], (Date) values[1]);
         }
 
-        protected void getValues(Object object, Object[] values) {
-
+        @Override protected void getValues(Object object, Object[] values) {
             Validity validity = (Validity) object;
-
             values[0] = validity.notBefore;
             values[1] = validity.notAfter;
         }
diff --git a/luni/src/main/java/org/apache/harmony/security/x509/X509PublicKey.java b/luni/src/main/java/org/apache/harmony/security/x509/X509PublicKey.java
index 08b19d5..b08bd8a 100644
--- a/luni/src/main/java/org/apache/harmony/security/x509/X509PublicKey.java
+++ b/luni/src/main/java/org/apache/harmony/security/x509/X509PublicKey.java
@@ -19,12 +19,9 @@
 
 import java.security.PublicKey;
 
-public class X509PublicKey implements PublicKey {
-
+public final class X509PublicKey implements PublicKey {
     private final String algorithm;
-
     private final byte[] encoded;
-
     private final byte[] keyBytes;
 
     public X509PublicKey(String algorithm, byte[] encoded, byte[] keyBytes) {
@@ -52,7 +49,6 @@
         buf.append(", params unparsed, unparsed keybits = \n");
         // TODO: implement compatible toString method()
         // buf.append(Arrays.toString(keyBytes));
-
         return buf.toString();
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/text/BidiRun.java b/luni/src/main/java/org/apache/harmony/text/BidiRun.java
deleted file mode 100644
index b1490ef..0000000
--- a/luni/src/main/java/org/apache/harmony/text/BidiRun.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.text;
-
-/**
- * TODO: type description
- */
-public class BidiRun {
-    private final int start;
-
-    private final int limit;
-
-    private final int level;
-
-    public BidiRun(int start, int limit, int level) {
-        this.start = start;
-        this.limit = limit;
-        this.level = level;
-    }
-
-    public int getLevel() {
-        return level;
-    }
-
-    public int getLimit() {
-        return limit;
-    }
-
-    public int getStart() {
-        return start;
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/text/NativeBidi.java b/luni/src/main/java/org/apache/harmony/text/NativeBidi.java
deleted file mode 100644
index f19dc18..0000000
--- a/luni/src/main/java/org/apache/harmony/text/NativeBidi.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.text;
-
-/**
- * Dalvik Bidi wrapper. Derived from an old version of Harmony; today they call
- * straight through to ICU4J.
- */
-
-public final class NativeBidi {
-
-    public static final int UBIDI_DEFAULT_LTR = 0xfe;
-
-    public static final int UBIDI_DEFAULT_RTL = 0xff;
-
-    public static final int UBIDI_MAX_EXPLICIT_LEVEL = 61;
-
-    public static final int UBIDI_LEVEL_OVERRIDE = 0x80;
-
-    public static final int UBIDI_KEEP_BASE_COMBINING = 1;
-
-    public static final int UBIDI_DO_MIRRORING = 2;
-
-    public static final int UBIDI_INSERT_LRM_FOR_NUMERIC = 4;
-
-    public static final int UBIDI_REMOVE_BIDI_CONTROLS = 8;
-
-    public static final int UBIDI_OUTPUT_REVERSE = 16;
-
-    public static final int UBiDiDirection_UBIDI_LTR = 0;
-
-    public static final int UBiDiDirection_UBIDI_RTL = 1;
-
-    public static final int UBiDiDirection_UBIDI_MIXED = 2;
-
-    // Allocate a UBiDi structure.
-    public static native long ubidi_open();
-
-    // ubidi_close() must be called to free the memory associated with a
-    // UBiDi object.
-    public static native void ubidi_close(long pBiDi);
-
-    // Perform the Unicode BiDi algorithm.
-    public static native void ubidi_setPara(long pBiDi, char[] text,
-            int length, int paraLevel, byte[] embeddingLevels);
-
-    // ubidi_setLine() sets a UBiDi to contain the reordering information,
-    // especially the resolved levels, for all the characters in a line of
-    // text.
-    public static native long ubidi_setLine(final long pParaBiDi, int start, int limit);
-
-    // Get the directionality of the text.
-    public static native int ubidi_getDirection(final long pBiDi);
-
-    // Get the length of the text.
-    public static native int ubidi_getLength(final long pBiDi);
-
-    // Get the paragraph level of the text.
-    public static native byte ubidi_getParaLevel(final long pBiDi);
-
-    // Get an array of levels for each character.
-    public static native byte[] ubidi_getLevels(long pBiDi);
-
-    // Get the number of runs.
-    public static native int ubidi_countRuns(long pBiDi);
-
-    // Get the BidiRuns
-    public static native BidiRun[] ubidi_getRuns(long pBidi);
-
-    // This is a convenience function that does not use a UBiDi object
-    public static native int[] ubidi_reorderVisual(byte[] levels, int length);
-}
diff --git a/luni/src/main/java/org/apache/harmony/xml/ExpatParser.java b/luni/src/main/java/org/apache/harmony/xml/ExpatParser.java
index 01b08f2..82c8e2a 100644
--- a/luni/src/main/java/org/apache/harmony/xml/ExpatParser.java
+++ b/luni/src/main/java/org/apache/harmony/xml/ExpatParser.java
@@ -22,8 +22,6 @@
 import java.net.URI;
 import java.net.URL;
 import java.net.URLConnection;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import libcore.io.IoUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -39,7 +37,6 @@
  * Adapts SAX API to the Expat native XML parser. Not intended for reuse
  * across documents.
  *
- * @see org.apache.harmony.xml.ExpatPullParser
  * @see org.apache.harmony.xml.ExpatReader
  */
 class ExpatParser {
@@ -278,8 +275,7 @@
                     systemId = systemUri.toString();
                 }
             } catch (Exception e) {
-                Logger.getLogger(ExpatParser.class.getName()).log(Level.INFO,
-                        "Could not resolve '" + systemId + "' relative to"
+                System.logI("Could not resolve '" + systemId + "' relative to"
                         + " '" + this.systemId + "' at " + locator, e);
             }
         }
diff --git a/luni/src/main/java/org/apache/harmony/xml/ExpatPullParser.java b/luni/src/main/java/org/apache/harmony/xml/ExpatPullParser.java
deleted file mode 100644
index 2ddf464..0000000
--- a/luni/src/main/java/org/apache/harmony/xml/ExpatPullParser.java
+++ /dev/null
@@ -1,963 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.xml;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Reader;
-import org.xml.sax.Attributes;
-import org.xml.sax.ContentHandler;
-import org.xml.sax.Locator;
-import org.xml.sax.SAXException;
-import org.xmlpull.v1.XmlPullParser;
-import org.xmlpull.v1.XmlPullParserException;
-
-/**
- * Fast, partial XmlPullParser implementation based upon Expat. Does not
- * support validation or {@code DOCTYPE} processing.
- */
-public class ExpatPullParser implements XmlPullParser {
-    /**
-     * This feature is identified by http://xmlpull.org/v1/doc/features.html#relaxed
-     * If this feature is supported that means that XmlPull parser will be
-     * lenient when checking XML well formedness.
-     * NOTE: use it only if XML input is not well-formed and in general usage
-     * if this feature is discouraged
-     * NOTE: as there is no definition of what is relaxed XML parsing
-     * therefore what parser will do completely depends on implementation used
-     */
-    public static final String FEATURE_RELAXED =
-            "http://xmlpull.org/v1/doc/features.html#relaxed";
-
-    private static final int BUFFER_SIZE = 8096;
-
-    private static final String NOT_A_START_TAG = "This is not a start tag.";
-
-    private Document document;
-    private boolean processNamespaces = false;
-    private boolean relaxed = false;
-
-    public void setFeature(String name, boolean state)
-            throws XmlPullParserException {
-        if (name == null) {
-            // Required by API.
-            throw new IllegalArgumentException("Null feature name");
-        }
-
-        if (name.equals(FEATURE_PROCESS_NAMESPACES)) {
-            processNamespaces = state;
-            return;
-        }
-
-        if (name.equals(FEATURE_RELAXED)) {
-            relaxed = true;
-            return;
-        }
-
-        // You're free to turn these features off because we don't support them.
-        if (!state && (name.equals(FEATURE_REPORT_NAMESPACE_ATTRIBUTES)
-                || name.equals(FEATURE_PROCESS_DOCDECL)
-                || name.equals(FEATURE_VALIDATION))) {
-            return;
-        }
-
-        throw new XmlPullParserException("Unsupported feature: " + name);
-    }
-
-    public boolean getFeature(String name) {
-        if (name == null) {
-            // Required by API.
-            throw new IllegalArgumentException("Null feature name");
-        }
-
-        // We always support namespaces, but no other features.
-        return name.equals(FEATURE_PROCESS_NAMESPACES) && processNamespaces;
-    }
-
-    /**
-     * Returns true if this parser processes namespaces.
-     *
-     * @see #setNamespaceProcessingEnabled(boolean)
-     */
-    public boolean isNamespaceProcessingEnabled() {
-        return processNamespaces;
-    }
-
-    /**
-     * Enables or disables namespace processing. Set to false by default.
-     *
-     * @see #isNamespaceProcessingEnabled()
-     */
-    public void setNamespaceProcessingEnabled(boolean processNamespaces) {
-        this.processNamespaces = processNamespaces;
-    }
-
-    public void setProperty(String name, Object value)
-            throws XmlPullParserException {
-        if (name == null) {
-            // Required by API.
-            throw new IllegalArgumentException("Null feature name");
-        }
-
-        // We don't support any properties.
-        throw new XmlPullParserException("Properties aren't supported.");
-    }
-
-    public Object getProperty(String name) {
-        return null;
-    }
-
-    public void setInput(Reader in) throws XmlPullParserException {
-        this.document = new CharDocument(in, processNamespaces);
-    }
-
-    public void setInput(InputStream in, String encodingName)
-            throws XmlPullParserException {
-        this.document = new ByteDocument(in, encodingName, processNamespaces);
-    }
-
-    public String getInputEncoding() {
-        return this.document.getEncoding();
-    }
-
-    /**
-     * Not supported.
-     *
-     * @throws UnsupportedOperationException always
-     */
-    public void defineEntityReplacementText(String entityName,
-            String replacementText) throws XmlPullParserException {
-        throw new UnsupportedOperationException();
-    }
-
-    public int getNamespaceCount(int depth) throws XmlPullParserException {
-        return document.currentEvent.namespaceStack.countAt(depth);
-    }
-
-    public String getNamespacePrefix(int pos) throws XmlPullParserException {
-        String prefix = document.currentEvent.namespaceStack.prefixAt(pos);
-        @SuppressWarnings("StringEquality")
-        boolean hasPrefix = prefix != "";
-        return hasPrefix ? prefix : null;
-    }
-
-    public String getNamespaceUri(int pos) throws XmlPullParserException {
-        return document.currentEvent.namespaceStack.uriAt(pos);
-    }
-
-    public String getNamespace(String prefix) {
-        // In XmlPullParser API, null == default namespace.
-        if (prefix == null) {
-            // Internally, we use empty string instead of null.
-            prefix = "";
-        }
-
-        return document.currentEvent.namespaceStack.uriFor(prefix);
-    }
-
-    public int getDepth() {
-        return this.document.getDepth();
-    }
-
-    public String getPositionDescription() {
-        return "line " + getLineNumber() + ", column " + getColumnNumber();
-    }
-
-    /**
-     * Not supported.
-     *
-     * @return {@literal -1} always
-     */
-    public int getLineNumber() {
-        // We would have to record the line number in each event.
-        return -1;
-    }
-
-    /**
-     * Not supported.
-     *
-     * @return {@literal -1} always
-     */
-    public int getColumnNumber() {
-        // We would have to record the column number in each event.
-        return -1;
-    }
-
-    public boolean isWhitespace() throws XmlPullParserException {
-        if (getEventType() != TEXT) {
-            throw new XmlPullParserException("Not on text.");
-        }
-
-        String text = getText();
-
-        if (text.length() == 0) {
-            return true;
-        }
-
-        int length = text.length();
-        for (int i = 0; i < length; i++) {
-            if (!Character.isWhitespace(text.charAt(i))) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    public String getText() {
-        final StringBuilder builder = this.document.currentEvent.getText();
-        return builder == null ? null : builder.toString();
-    }
-
-    public char[] getTextCharacters(int[] holderForStartAndLength) {
-        final StringBuilder builder = this.document.currentEvent.getText();
-
-        final int length = builder.length();
-        char[] characters = new char[length];
-        builder.getChars(0, length, characters, 0);
-
-        holderForStartAndLength[0] = 0;
-        holderForStartAndLength[1] = length;
-
-        return characters;
-    }
-
-    public String getNamespace() {
-        return this.document.currentEvent.getNamespace();
-    }
-
-    public String getName() {
-        return this.document.currentEvent.getName();
-    }
-
-    /**
-     * Not supported.
-     *
-     * @throws UnsupportedOperationException always
-     */
-    public String getPrefix() {
-        throw new UnsupportedOperationException();
-    }
-
-    public boolean isEmptyElementTag() throws XmlPullParserException {
-        return this.document.isCurrentElementEmpty();
-    }
-
-    public int getAttributeCount() {
-        return this.document.currentEvent.getAttributeCount();
-    }
-
-    public String getAttributeNamespace(int index) {
-        return this.document.currentEvent.getAttributeNamespace(index);
-    }
-
-    public String getAttributeName(int index) {
-        return this.document.currentEvent.getAttributeName(index);
-    }
-
-    /**
-     * Not supported.
-     *
-     * @throws UnsupportedOperationException always
-     */
-    public String getAttributePrefix(int index) {
-        throw new UnsupportedOperationException();
-    }
-
-    public String getAttributeType(int index) {
-        return "CDATA";
-    }
-
-    public boolean isAttributeDefault(int index) {
-        return false;
-    }
-
-    public String getAttributeValue(int index) {
-        return this.document.currentEvent.getAttributeValue(index);
-    }
-
-    public String getAttributeValue(String namespace, String name) {
-        return this.document.currentEvent.getAttributeValue(namespace, name);
-    }
-
-    public int getEventType() throws XmlPullParserException {
-        return this.document.currentEvent.getType();
-    }
-
-    public int next() throws XmlPullParserException, IOException {
-        return this.document.dequeue();
-    }
-
-    /**
-     * Not supported.
-     *
-     * @throws UnsupportedOperationException always
-     */
-    public int nextToken() throws XmlPullParserException, IOException {
-        throw new UnsupportedOperationException();
-    }
-
-    public void require(int type, String namespace, String name)
-            throws XmlPullParserException, IOException {
-        if (type != getEventType()
-                || (namespace != null && !namespace.equals(getNamespace()))
-                || (name != null && !name.equals(getName()))) {
-            throw new XmlPullParserException("expected "
-                    + TYPES[type] + getPositionDescription());
-        }
-    }
-
-    public String nextText() throws XmlPullParserException, IOException {
-        if (this.document.currentEvent.getType() != START_TAG)
-            throw new XmlPullParserException("Not on start tag.");
-
-        int next = this.document.dequeue();
-        switch (next) {
-            case TEXT: return getText();
-            case END_TAG: return "";
-            default: throw new XmlPullParserException(
-                "Unexpected event type: " + TYPES[next]);
-        }
-    }
-
-    public int nextTag() throws XmlPullParserException, IOException {
-        int eventType = next();
-        if (eventType == TEXT && isWhitespace()) {
-            eventType = next();
-        }
-        if (eventType != START_TAG && eventType != END_TAG) {
-            throw new XmlPullParserException(
-                "Expected start or end tag", this, null);
-        }
-        return eventType;
-    }
-
-    /**
-     * Immutable namespace stack. Pushing a new namespace on to the stack
-     * only results in one object allocation. Most operations are O(N) where
-     * N is the stack size. Accessing recently pushed namespaces, like those
-     * for the current element, is significantly faster.
-     */
-    static class NamespaceStack {
-
-        /** An empty stack. */
-        static final NamespaceStack EMPTY = new NamespaceStack();
-
-        private final NamespaceStack parent;
-        private final String prefix;
-        private final String uri;
-        private final int index;
-        private final int depth;
-
-        /**
-         * Constructs an actual namespace stack node. Internally, the nodes
-         * and the stack are one in the same making for a very efficient
-         * implementation. The user just sees an immutable stack and the
-         * builder.
-         */
-        private NamespaceStack(NamespaceStack parent, String prefix,
-                String uri, int depth) {
-            this.parent = parent;
-            this.prefix = prefix;
-            this.uri = uri;
-            this.index = parent.index + 1;
-            this.depth = depth;
-        }
-
-        /**
-         * Constructs a dummy node which only serves to point to the bottom
-         * of the stack. Using an actual node instead of null simplifies the
-         * code.
-         */
-        private NamespaceStack() {
-            this.parent = null;
-            this.prefix = null;
-            this.uri = null;
-
-            // This node has an index of -1 since the actual first node in the
-            // stack has index 0.
-            this.index = -1;
-
-            // The actual first node will have a depth of 1.
-            this.depth = 0;
-        }
-
-        String uriFor(String prefix) {
-            for (NamespaceStack node = this; node.index >= 0;
-                    node = node.parent) {
-                if (node.prefix.equals(prefix)) {
-                    return node.uri;
-                }
-            }
-
-            // Not found.
-            return null;
-        }
-
-        /**
-         * Gets the prefix at the given index in the stack.
-         */
-        String prefixAt(int index) {
-            return nodeAt(index).prefix;
-        }
-
-        /**
-         * Gets the URI at the given index in the stack.
-         */
-        String uriAt(int index) {
-            return nodeAt(index).uri;
-        }
-
-        private NamespaceStack nodeAt(int index) {
-            if (index > this.index) {
-                throw new IndexOutOfBoundsException("Index > size.");
-            }
-            if (index < 0) {
-                throw new IndexOutOfBoundsException("Index < 0.");
-            }
-
-            NamespaceStack node = this;
-            while (index != node.index) {
-                node = node.parent;
-            }
-            return node;
-        }
-
-        /**
-         * Gets the size of the stack at the given element depth.
-         */
-        int countAt(int depth) {
-            if (depth > this.depth) {
-                throw new IndexOutOfBoundsException("Depth > maximum.");
-            }
-            if (depth < 0) {
-                throw new IndexOutOfBoundsException("Depth < 0.");
-            }
-
-            NamespaceStack node = this;
-            while (depth < node.depth) {
-                node = node.parent;
-            }
-            return node.index + 1;
-        }
-
-        /** Builds a NamespaceStack. */
-        static class Builder {
-
-            NamespaceStack top = EMPTY;
-
-            /**
-             * Pushes a namespace onto the stack.
-             *
-             * @param depth of the element upon which the namespace was
-             *  declared
-             */
-            void push(String prefix, String uri, int depth) {
-                top = new NamespaceStack(top, prefix, uri, depth);
-            }
-
-            /**
-             * Pops all namespaces from the given element depth.
-             */
-            void pop(int depth) {
-                // Remove all nodes at the specified depth.
-                while (top != null && top.depth == depth) {
-                    top = top.parent;
-                }
-            }
-
-            /** Returns the current stack. */
-            NamespaceStack build() {
-                return top;
-            }
-        }
-    }
-
-    /**
-     * Base class for events. Implements event chaining and defines event API
-     * along with common implementations which can be overridden.
-     */
-    static abstract class Event {
-
-        /** Element depth at the time of this event. */
-        final int depth;
-
-        /** The namespace stack at the time of this event. */
-        final NamespaceStack namespaceStack;
-
-        /** Next event in the queue. */
-        Event next = null;
-
-        Event(int depth, NamespaceStack namespaceStack) {
-            this.depth = depth;
-            this.namespaceStack = namespaceStack;
-        }
-
-        void setNext(Event next) {
-            this.next = next;
-        }
-
-        Event getNext() {
-            return next;
-        }
-
-        StringBuilder getText() {
-            return null;
-        }
-
-        String getNamespace() {
-            return null;
-        }
-
-        String getName() {
-            return null;
-        }
-
-        int getAttributeCount() {
-            return -1;
-        }
-
-        String getAttributeNamespace(int index) {
-            throw new IndexOutOfBoundsException(NOT_A_START_TAG);
-        }
-
-        String getAttributeName(int index) {
-            throw new IndexOutOfBoundsException(NOT_A_START_TAG);
-        }
-
-        String getAttributeValue(int index) {
-            throw new IndexOutOfBoundsException(NOT_A_START_TAG);
-        }
-
-        abstract int getType();
-
-        String getAttributeValue(String namespace, String name) {
-            throw new IndexOutOfBoundsException(NOT_A_START_TAG);
-        }
-
-        public int getDepth() {
-            return this.depth;
-        }
-    }
-
-    static class StartDocumentEvent extends Event {
-
-        public StartDocumentEvent() {
-            super(0, NamespaceStack.EMPTY);
-        }
-
-        @Override
-        int getType() {
-            return START_DOCUMENT;
-        }
-    }
-
-    static class StartTagEvent extends Event {
-
-        final String name;
-        final String namespace;
-        final Attributes attributes;
-        final boolean processNamespaces;
-
-        StartTagEvent(String namespace,
-                String name,
-                ExpatParser expatParser,
-                int depth,
-                NamespaceStack namespaceStack,
-                boolean processNamespaces) {
-            super(depth, namespaceStack);
-            this.namespace = namespace;
-            this.name = name;
-            this.attributes = expatParser.cloneAttributes();
-            this.processNamespaces = processNamespaces;
-        }
-
-        @Override
-        String getNamespace() {
-            return namespace;
-        }
-
-        @Override
-        String getName() {
-            return name;
-        }
-
-        @Override
-        int getAttributeCount() {
-            return attributes.getLength();
-        }
-
-        @Override
-        String getAttributeNamespace(int index) {
-            return attributes.getURI(index);
-        }
-
-        @Override
-        String getAttributeName(int index) {
-            return processNamespaces ? attributes.getLocalName(index)
-                    : attributes.getQName(index);
-        }
-
-        @Override
-        String getAttributeValue(int index) {
-            return attributes.getValue(index);
-        }
-
-        @Override
-        String getAttributeValue(String namespace, String name) {
-            if (namespace == null) {
-                namespace = "";
-            }
-
-            return attributes.getValue(namespace, name);
-        }
-
-        @Override
-        int getType() {
-            return START_TAG;
-        }
-    }
-
-    static class EndTagEvent extends Event {
-
-        final String namespace;
-        final String localName;
-
-        EndTagEvent(String namespace, String localName, int depth,
-                NamespaceStack namespaceStack) {
-            super(depth, namespaceStack);
-            this.namespace = namespace;
-            this.localName = localName;
-        }
-
-        @Override
-        String getName() {
-            return this.localName;
-        }
-
-        @Override
-        String getNamespace() {
-            return this.namespace;
-        }
-
-        @Override
-        int getType() {
-            return END_TAG;
-        }
-    }
-
-    static class TextEvent extends Event {
-
-        final StringBuilder builder;
-
-        public TextEvent(int initialCapacity, int depth,
-                NamespaceStack namespaceStack) {
-            super(depth, namespaceStack);
-            this.builder = new StringBuilder(initialCapacity);
-        }
-
-        @Override
-        int getType() {
-            return TEXT;
-        }
-
-        @Override
-        StringBuilder getText() {
-            return this.builder;
-        }
-
-        void append(char[] text, int start, int length) {
-            builder.append(text, start, length);
-        }
-    }
-
-    static class EndDocumentEvent extends Event {
-
-        EndDocumentEvent() {
-            super(0, NamespaceStack.EMPTY);
-        }
-
-        @Override
-        Event getNext() {
-            throw new IllegalStateException("End of document.");
-        }
-
-        @Override
-        void setNext(Event next) {
-            throw new IllegalStateException("End of document.");
-        }
-
-        @Override
-        int getType() {
-            return END_DOCUMENT;
-        }
-    }
-
-    /**
-     * Encapsulates the parsing context of the current document.
-     */
-    abstract class Document {
-
-        final String encoding;
-        final ExpatParser parser;
-        final boolean processNamespaces;
-
-        TextEvent textEvent = null;
-        boolean finished = false;
-
-        Document(String encoding, boolean processNamespaces) {
-            this.encoding = encoding;
-            this.processNamespaces = processNamespaces;
-
-            ExpatReader xmlReader = new ExpatReader();
-            xmlReader.setContentHandler(new SaxHandler());
-
-            this.parser = new ExpatParser(
-                    encoding, xmlReader, processNamespaces, null, null);
-        }
-
-        /** Namespace stack builder. */
-        NamespaceStack.Builder namespaceStackBuilder
-                = new NamespaceStack.Builder();
-
-        Event currentEvent = new StartDocumentEvent();
-        Event last = currentEvent;
-
-        /**
-         * Sends some more XML to the parser.
-         */
-        void pump() throws IOException, XmlPullParserException {
-            if (this.finished) {
-                return;
-            }
-
-            int length = buffer();
-
-            // End of document.
-            if (length == -1) {
-                this.finished = true;
-                if (!relaxed) {
-                    try {
-                        parser.finish();
-                    } catch (SAXException e) {
-                        throw new XmlPullParserException(
-                            "Premature end of document.", ExpatPullParser.this, e);
-                    }
-                }
-                add(new EndDocumentEvent());
-                return;
-            }
-
-            if (length == 0) {
-                return; // TODO: can't happen?
-            }
-
-            flush(parser, length);
-        }
-
-        /**
-         * Reads data into the buffer.
-         *
-         * @return the length of data buffered or {@code -1} if we've reached
-         *  the end of the data.
-         */
-        abstract int buffer() throws IOException;
-
-        /**
-         * Sends buffered data to the parser.
-         *
-         * @param parser the parser to flush to
-         * @param length of data buffered
-         */
-        abstract void flush(ExpatParser parser, int length)
-                throws XmlPullParserException;
-
-        /**
-         * Adds an event.
-         */
-        void add(Event event) {
-            // Flush pre-exising text event if necessary.
-            if (textEvent != null) {
-                last.setNext(textEvent);
-                last = textEvent;
-                textEvent = null;
-            }
-
-            last.setNext(event);
-            last = event;
-        }
-
-        /**
-         * Moves to the next event in the queue.
-         *
-         * @return type of next event
-         */
-        int dequeue() throws XmlPullParserException, IOException {
-            Event next;
-
-            while ((next = currentEvent.getNext()) == null) {
-                pump();
-            }
-
-            currentEvent.next = null;
-            currentEvent = next;
-
-            return currentEvent.getType();
-        }
-
-        String getEncoding() {
-            return this.encoding;
-        }
-
-        int getDepth() {
-            return currentEvent.getDepth();
-        }
-
-        /**
-         * Returns true if we're on a start element and the next event is
-         * its corresponding end element.
-         *
-         * @throws XmlPullParserException if we aren't on a start element
-         */
-        boolean isCurrentElementEmpty() throws XmlPullParserException {
-            if (currentEvent.getType() != START_TAG) {
-                throw new XmlPullParserException(NOT_A_START_TAG);
-            }
-
-            Event next;
-
-            try {
-                while ((next = currentEvent.getNext()) == null) {
-                    pump();
-                }
-            } catch (IOException ex) {
-                throw new XmlPullParserException(ex.toString());
-            }
-
-            return next.getType() == END_TAG;
-        }
-
-        private class SaxHandler implements ContentHandler {
-
-            int depth = 0;
-
-            public void startPrefixMapping(String prefix, String uri)
-                    throws SAXException {
-                // Depth + 1--we aren't actually in the element yet.
-                namespaceStackBuilder.push(prefix, uri, depth + 1);
-            }
-
-            public void startElement(String uri, String localName, String qName,
-                    Attributes attributes) {
-                String name = processNamespaces ? localName : qName;
-
-                add(new StartTagEvent(uri, name, parser, ++this.depth,
-                        namespaceStackBuilder.build(), processNamespaces));
-            }
-
-            public void endElement(String uri, String localName, String qName) {
-                String name = processNamespaces ? localName : qName;
-
-                int depth = this.depth--;
-                add(new EndTagEvent(uri, name, depth,
-                        namespaceStackBuilder.build()));
-                namespaceStackBuilder.pop(depth);
-            }
-
-            public void characters(char[] ch, int start, int length) {
-                // Ignore empty strings.
-                if (length == 0) {
-                    return;
-                }
-
-                // Start a new text event if necessary.
-                if (textEvent == null) {
-                    textEvent = new TextEvent(length, this.depth,
-                            namespaceStackBuilder.build());
-                }
-
-                // Append to an existing text event.
-                textEvent.append(ch, start, length);
-            }
-
-            public void setDocumentLocator(Locator locator) {}
-            public void startDocument() throws SAXException {}
-            public void endDocument() throws SAXException {}
-            public void endPrefixMapping(String prefix) throws SAXException {}
-            public void ignorableWhitespace(char[] ch, int start, int length)
-                    throws SAXException {}
-            public void processingInstruction(String target, String data)
-                    throws SAXException {}
-            public void skippedEntity(String name) throws SAXException {}
-        }
-    }
-
-    class CharDocument extends Document {
-
-        final char[] buffer = new char[BUFFER_SIZE / 2];
-        final Reader in;
-
-        CharDocument(Reader in, boolean processNamespaces) {
-            super("UTF-16", processNamespaces);
-            this.in = in;
-        }
-
-        @Override
-        int buffer() throws IOException {
-            return in.read(buffer);
-        }
-
-        @Override
-        void flush(ExpatParser parser, int length)
-                throws XmlPullParserException {
-            try {
-                parser.append(buffer, 0, length);
-            } catch (SAXException e) {
-                throw new XmlPullParserException(
-                        "Error parsing document.", ExpatPullParser.this, e);
-            }
-        }
-    }
-
-    class ByteDocument extends Document {
-
-        final byte[] buffer = new byte[BUFFER_SIZE];
-        final InputStream in;
-
-        ByteDocument(InputStream in, String encoding,
-                boolean processNamespaces) {
-            super(encoding, processNamespaces);
-            this.in = in;
-        }
-
-        @Override
-        int buffer() throws IOException {
-            return in.read(buffer);
-        }
-
-        @Override
-        void flush(ExpatParser parser, int length)
-                throws XmlPullParserException {
-            try {
-                parser.append(buffer, 0, length);
-            } catch (SAXException e) {
-                throw new XmlPullParserException(
-                        "Error parsing document.", ExpatPullParser.this, e);
-            }
-        }
-    }
-}
diff --git a/luni/src/main/java/org/apache/harmony/xml/ExpatReader.java b/luni/src/main/java/org/apache/harmony/xml/ExpatReader.java
index 972f3ed..90fa181 100644
--- a/luni/src/main/java/org/apache/harmony/xml/ExpatReader.java
+++ b/luni/src/main/java/org/apache/harmony/xml/ExpatReader.java
@@ -53,24 +53,26 @@
             = "http://xml.org/sax/properties/lexical-handler";
 
     private static class Feature {
-
         private static final String BASE_URI = "http://xml.org/sax/features/";
-
         private static final String VALIDATION = BASE_URI + "validation";
         private static final String NAMESPACES = BASE_URI + "namespaces";
-        private static final String NAMESPACE_PREFIXES
-                = BASE_URI + "namespace-prefixes";
-        private static final String STRING_INTERNING
-                = BASE_URI + "string-interning";
+        private static final String NAMESPACE_PREFIXES = BASE_URI + "namespace-prefixes";
+        private static final String STRING_INTERNING = BASE_URI + "string-interning";
+        private static final String EXTERNAL_GENERAL_ENTITIES
+                = BASE_URI + "external-general-entities";
+        private static final String EXTERNAL_PARAMETER_ENTITIES
+                = BASE_URI + "external-parameter-entities";
     }
 
     public boolean getFeature(String name)
             throws SAXNotRecognizedException, SAXNotSupportedException {
         if (name == null) {
-            throw new NullPointerException("name");
+            throw new NullPointerException("name == null");
         }
 
-        if (name.equals(Feature.VALIDATION)) {
+        if (name.equals(Feature.VALIDATION)
+                || name.equals(Feature.EXTERNAL_GENERAL_ENTITIES)
+                || name.equals(Feature.EXTERNAL_PARAMETER_ENTITIES)) {
             return false;
         }
 
@@ -92,10 +94,12 @@
     public void setFeature(String name, boolean value)
             throws SAXNotRecognizedException, SAXNotSupportedException {
         if (name == null) {
-            throw new NullPointerException("name");
+            throw new NullPointerException("name == null");
         }
 
-        if (name.equals(Feature.VALIDATION)) {
+        if (name.equals(Feature.VALIDATION)
+                || name.equals(Feature.EXTERNAL_GENERAL_ENTITIES)
+                || name.equals(Feature.EXTERNAL_PARAMETER_ENTITIES)) {
             if (value) {
                 throw new SAXNotSupportedException("Cannot enable " + name);
             } else {
@@ -129,7 +133,7 @@
     public Object getProperty(String name)
             throws SAXNotRecognizedException, SAXNotSupportedException {
         if (name == null) {
-            throw new NullPointerException("name");
+            throw new NullPointerException("name == null");
         }
 
         if (name.equals(LEXICAL_HANDLER_PROPERTY)) {
@@ -142,7 +146,7 @@
     public void setProperty(String name, Object value)
             throws SAXNotRecognizedException, SAXNotSupportedException {
         if (name == null) {
-            throw new NullPointerException("name");
+            throw new NullPointerException("name == null");
         }
 
         if (name.equals(LEXICAL_HANDLER_PROPERTY)) {
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java
index 8ee8a33..5d45039 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java
@@ -292,28 +292,4 @@
             super.finalize();
         }
     }
-
-    /**
-     * Byte array wrapper. Implements equals() and hashCode().
-     */
-    static class ByteArray {
-
-        private final byte[] bytes;
-
-        ByteArray(byte[] bytes) {
-            this.bytes = bytes;
-        }
-
-        @Override
-        public int hashCode() {
-            return Arrays.hashCode(bytes);
-        }
-
-        @Override
-        @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
-        public boolean equals(Object o) {
-            ByteArray other = (ByteArray) o;
-            return Arrays.equals(bytes, other.bytes);
-        }
-    }
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ByteArray.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ByteArray.java
new file mode 100644
index 0000000..8a000c5
--- /dev/null
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ByteArray.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.xnet.provider.jsse;
+
+import java.util.Arrays;
+
+/**
+ * Byte array wrapper for hashtable use. Implements equals() and hashCode().
+ */
+final class ByteArray {
+    private final byte[] bytes;
+    private final int hashCode;
+
+    ByteArray(byte[] bytes) {
+        this.bytes = bytes;
+        this.hashCode = Arrays.hashCode(bytes);
+    }
+
+    @Override public int hashCode() {
+        return hashCode;
+    }
+
+    @Override public boolean equals(Object o) {
+        if (!(o instanceof ByteArray)) {
+            return false;
+        }
+        ByteArray lhs = (ByteArray) o;
+        return Arrays.equals(bytes, lhs.bytes);
+    }
+}
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java
index dbd9519..9bc28a0 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java
@@ -23,7 +23,7 @@
 import java.security.cert.CertificateException;
 import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
-import java.util.Vector;
+import java.util.ArrayList;
 
 /**
  * Represents server/client certificate message
@@ -50,8 +50,7 @@
      * @param length
      * @throws IOException
      */
-    public CertificateMessage(HandshakeIODataStream in, int length)
-            throws IOException {
+    public CertificateMessage(HandshakeIODataStream in, int length) throws IOException {
         int l = in.readUint24(); // total_length
         if (l == 0) {  // message contais no certificates
             if (length != 3) { // no more bytes after total_length
@@ -70,30 +69,25 @@
             fatalAlert(AlertProtocol.INTERNAL_ERROR, "INTERNAL ERROR", e);
             return;
         }
-        Vector<Certificate> certs_vector = new Vector<Certificate>();
+        ArrayList<X509Certificate> certsList = new ArrayList<X509Certificate>();
         int size = 0;
         int enc_size = 0;
         while (l > 0) {
             size = in.readUint24();
             l -= 3;
             try {
-                certs_vector.add(cf.generateCertificate(in));
+                certsList.add((X509Certificate) cf.generateCertificate(in));
             } catch (CertificateException e) {
                 fatalAlert(AlertProtocol.DECODE_ERROR, "DECODE ERROR", e);
             }
             l -= size;
             enc_size += size;
         }
-        certs = new X509Certificate[certs_vector.size()];
-        for (int i = 0; i < certs.length; i++) {
-            certs[i] = (X509Certificate) certs_vector.elementAt(i);
-        }
+        certs = certsList.toArray(new X509Certificate[certsList.size()]);
         this.length = 3 + 3 * certs.length + enc_size;
         if (this.length != length) {
-            fatalAlert(AlertProtocol.DECODE_ERROR,
-                    "DECODE ERROR: incorrect CertificateMessage");
+            fatalAlert(AlertProtocol.DECODE_ERROR, "DECODE ERROR: incorrect CertificateMessage");
         }
-
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java
index 49f63bf..f3be44c 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java
@@ -19,8 +19,9 @@
 
 import java.io.IOException;
 import java.security.cert.X509Certificate;
-import java.util.Vector;
+import java.util.ArrayList;
 import javax.security.auth.x500.X500Principal;
+import libcore.io.Streams;
 
 /**
  *
@@ -85,31 +86,25 @@
      * @param length
      * @throws IOException
      */
-    public CertificateRequest(HandshakeIODataStream in, int length)
-            throws IOException {
+    public CertificateRequest(HandshakeIODataStream in, int length) throws IOException {
         int size = in.readUint8();
         certificate_types = new byte[size];
-        in.read(certificate_types, 0, size);
+        Streams.readFully(in, certificate_types);
         size = in.readUint16();
         int totalPrincipalsLength = 0;
         int principalLength = 0;
-        Vector<X500Principal> principals = new Vector<X500Principal>();
+        ArrayList<X500Principal> principals = new ArrayList<X500Principal>();
         while (totalPrincipalsLength < size) {
             principalLength = in.readUint16(); // encoded X500Principal size
             principals.add(new X500Principal(in));
             totalPrincipalsLength += 2;
             totalPrincipalsLength += principalLength;
         }
-        certificate_authorities = new X500Principal[principals.size()];
-        for (int i = 0; i < certificate_authorities.length; i++) {
-            certificate_authorities[i] = principals.elementAt(i);
-        }
+        certificate_authorities = principals.toArray(new X500Principal[principals.size()]);
         this.length = 3 + certificate_types.length + totalPrincipalsLength;
         if (this.length != length) {
-            fatalAlert(AlertProtocol.DECODE_ERROR,
-                    "DECODE ERROR: incorrect CertificateRequest");
+            fatalAlert(AlertProtocol.DECODE_ERROR, "DECODE ERROR: incorrect CertificateRequest");
         }
-
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
index a09914e..1f1d789 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
@@ -86,13 +86,11 @@
         } else if (parameters.getEnableSessionCreation()){
             isResuming = false;
             session = new SSLSessionImpl(parameters.getSecureRandom());
-            // BEGIN android-added
             if (engineOwner != null) {
                 session.setPeer(engineOwner.getPeerHost(), engineOwner.getPeerPort());
             } else {
                 session.setPeer(socketOwner.getInetAddress().getHostName(), socketOwner.getPort());
             }
-            // END android-added
             session.protocol = ProtocolVersion.getLatestVersion(parameters.getEnabledProtocols());
             recordProtocol.setVersion(session.protocol.version);
         } else {
@@ -109,13 +107,11 @@
         if (parameters.getEnableSessionCreation()){
             isResuming = false;
             session = new SSLSessionImpl(parameters.getSecureRandom());
-            // BEGIN android-added
             if (engineOwner != null) {
                 session.setPeer(engineOwner.getPeerHost(), engineOwner.getPeerPort());
             } else {
                 session.setPeer(socketOwner.getInetAddress().getHostName(), socketOwner.getPort());
             }
-            // END android-added
             session.protocol = ProtocolVersion.getLatestVersion(parameters.getEnabledProtocols());
             recordProtocol.setVersion(session.protocol.version);
             startSession();
@@ -133,9 +129,7 @@
         if (isResuming) {
             cipher_suites = new CipherSuite[] { session.cipherSuite };
         } else {
-            // BEGIN android-changed
             cipher_suites = parameters.getEnabledCipherSuitesMember();
-            // END android-changed
         }
         clientHello = new ClientHello(parameters.getSecureRandom(),
                 session.protocol.version, session.id, cipher_suites);
@@ -215,9 +209,7 @@
                     }
 
                     //check cipher_suite
-                    // BEGIN android-changed
                     CipherSuite[] enabledSuites = parameters.getEnabledCipherSuitesMember();
-                    // END android-changed
                     find: {
                         for (int i = 0; i < enabledSuites.length; i++) {
                             if (serverHello.cipher_suite.equals(enabledSuites[i])) {
@@ -304,9 +296,7 @@
                     serverFinished = new Finished(io_stream, length);
                     verifyFinished(serverFinished.getData());
                     session.lastAccessedTime = System.currentTimeMillis();
-                    // BEGIN android-added
                     session.context = parameters.getClientSessionContext();
-                    // END android-added
                     parameters.getClientSessionContext().putSession(session);
                     if (isResuming) {
                         sendChangeCipherSpec();
@@ -578,7 +568,6 @@
             return null; // starts new session
         }
 
-        // BEGIN android-changed
         ClientSessionContext context = parameters.getClientSessionContext();
         SSLSessionImpl session
                 = (SSLSessionImpl) context.getSession(host, port);
@@ -586,7 +575,6 @@
             session = (SSLSessionImpl) session.clone();
         }
         return session;
-        // END android-changed
     }
 
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java
index 5fcbba5..1bded5d 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java
@@ -20,6 +20,7 @@
 import java.io.IOException;
 import java.security.SecureRandom;
 import java.util.Arrays;
+import libcore.io.Streams;
 import libcore.util.EmptyArray;
 
 /**
@@ -88,7 +89,7 @@
         client_version = new byte[2];
         client_version[0] = (byte) in.readUint8();
         client_version[1] = (byte) in.readUint8();
-        in.read(random, 0, 32);
+        Streams.readFully(in, random);
         int size = in.read();
         session_id = new byte[size];
         in.read(session_id, 0, size);
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java
index bfe2bd0..2bae8d0 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java
@@ -19,6 +19,7 @@
 
 import java.io.IOException;
 import java.math.BigInteger;
+import libcore.io.Streams;
 import libcore.util.EmptyArray;
 
 /**
@@ -109,7 +110,7 @@
                 this.length = 2 + size;
             }
             exchange_keys = new byte[size];
-            in.read(exchange_keys, 0, size);
+            Streams.readFully(in, exchange_keys);
             if (this.length != length) {
                 fatalAlert(AlertProtocol.DECODE_ERROR, "DECODE ERROR: incorrect ClientKeyExchange");
             }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java
index 97ededd..0b358aa 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java
@@ -39,6 +39,10 @@
         super(10, 0);
     }
 
+    public int size() {
+        return sessionsByHostAndPort.size();
+    }
+
     public void setPersistentCache(SSLClientSessionCache persistentCache) {
         this.persistentCache = persistentCache;
     }
@@ -94,7 +98,7 @@
     }
 
     @Override
-    void putSession(SSLSession session) {
+    public void putSession(SSLSession session) {
         super.putSession(session);
 
         String host = session.getPeerHost();
@@ -126,16 +130,16 @@
             this.port = port;
         }
 
-        @Override
-        public int hashCode() {
+        @Override public int hashCode() {
             return host.hashCode() * 31 + port;
         }
 
-        @Override
-        @SuppressWarnings("EqualsWhichDoesntCheckParameterClass")
-        public boolean equals(Object o) {
-            HostAndPort other = (HostAndPort) o;
-            return host.equals(other.host) && port == other.port;
+        @Override public boolean equals(Object o) {
+            if (!(o instanceof HostAndPort)) {
+                return false;
+            }
+            HostAndPort lhs = (HostAndPort) o;
+            return host.equals(lhs.host) && port == lhs.port;
         }
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java
index 9859be7..c110275 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java
@@ -58,6 +58,5 @@
                 handshaker.delegatedTaskErr = e;
             }
         }
-
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java
index 1dcdd20..7fe2d7f 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java
@@ -28,8 +28,6 @@
     private static final long serialVersionUID = 1838636631255369519L;
 
     public EndOfBufferException() {
-        super();
     }
 
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java
index 631679a..3874709 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java
@@ -28,7 +28,6 @@
     private static final long serialVersionUID = -4673611435974054413L;
 
     public EndOfSourceException() {
-        super();
     }
 
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCache.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCache.java
index 9558ceb..822d829 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCache.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCache.java
@@ -39,7 +39,7 @@
  */
 public class FileClientSessionCache {
 
-    static final int MAX_SIZE = 12; // ~72k
+    public static final int MAX_SIZE = 12; // ~72k
 
     static final java.util.logging.Logger logger
             = java.util.logging.Logger.getLogger(
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java
index 720e7a6..ee9f667 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java
@@ -21,6 +21,7 @@
 import java.io.PrintStream;
 import java.security.MessageDigest;
 import java.util.Arrays;
+import java.util.Locale;
 import javax.net.ssl.SSLHandshakeException;
 
 /**
@@ -367,32 +368,6 @@
         return res;
     }
 
-    // ---------------------- Debud functionality -------------------------
-
-    protected void printContent(PrintStream outstream) {
-        int perLine = 20;
-        String prefix = " ";
-        String delimiter = "";
-
-        for (int i=write_pos_beg; i<write_pos; i++) {
-            String tail = Integer.toHexString(
-                    0x00ff & buffer[i]).toUpperCase();
-            if (tail.length() == 1) {
-                tail = "0" + tail;
-            }
-            outstream.print(prefix + tail + delimiter);
-
-            if (((i-write_pos_beg+1)%10) == 0) {
-                outstream.print(" ");
-            }
-
-            if (((i-write_pos_beg+1)%perLine) == 0) {
-                outstream.println();
-            }
-        }
-        outstream.println();
-    }
-
     // ---------------------- Message Digest Functionality ----------------
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java
index bd83989..f8016f1 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java
@@ -43,22 +43,22 @@
     /**
      * Handshake status NEED_UNWRAP - HandshakeProtocol needs to receive data
      */
-    public final static int NEED_UNWRAP = 1;
+    public static final int NEED_UNWRAP = 1;
 
     /**
      * Handshake status NOT_HANDSHAKING - is not currently handshaking
      */
-    public final static int NOT_HANDSHAKING = 2;
+    public static final int NOT_HANDSHAKING = 2;
 
     /**
      * Handshake status FINISHED - HandshakeProtocol has just finished
      */
-    public final static int FINISHED = 3;
+    public static final int FINISHED = 3;
 
     /**
      * Handshake status NEED_TASK - HandshakeProtocol needs the results of delegated task
      */
-    public final static int NEED_TASK = 4;
+    public static final int NEED_TASK = 4;
 
     /**
      * Current handshake status
@@ -518,8 +518,8 @@
     }
 
     /**
-     * Shutdownes the protocol. It will be impossiblke to use the instance
-     * after the calling of this method.
+     * Shuts down the protocol. It will be impossible to use the instance
+     * after calling this method.
      */
     protected void shutdown() {
         clearMessages();
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/IndexedPKIXParameters.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/IndexedPKIXParameters.java
index 802ec52..90baa87 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/IndexedPKIXParameters.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/IndexedPKIXParameters.java
@@ -63,7 +63,7 @@
         synchronized (subjectToTrustAnchors) {
             List<TrustAnchor> anchors = subjectToTrustAnchors.get(subject);
             if (anchors == null) {
-                anchors = new ArrayList<TrustAnchor>();
+                anchors = new ArrayList<TrustAnchor>(1);
                 subjectToTrustAnchors.put(subject, anchors);
             }
             anchors.add(anchor);
@@ -138,22 +138,4 @@
         }
         return false;
     }
-
-    /**
-     * Wraps a byte[] and adds equals() and hashCode() support.
-     */
-    static class Bytes {
-        final byte[] bytes;
-        final int hash;
-        Bytes(byte[] bytes) {
-            this.bytes = bytes;
-            this.hash = Arrays.hashCode(bytes);
-        }
-        @Override public int hashCode() {
-            return hash;
-        }
-        @Override public boolean equals(Object o) {
-            return Arrays.equals(bytes, ((Bytes) o).bytes);
-        }
-    }
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java
index 62b6560..84507bd 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java
@@ -17,8 +17,6 @@
 
 package org.apache.harmony.xnet.provider.jsse;
 
-import java.security.AccessController;
-import java.security.PrivilegedAction;
 import java.security.Provider;
 
 /**
@@ -108,17 +106,13 @@
 
     public JSSEProvider() {
         super("HarmonyJSSE", 1.0, "Harmony JSSE Provider");
-        AccessController.doPrivileged(new PrivilegedAction<Void>() {
-            public Void run() {
-                put("SSLContext.SSL", SSLContextImpl.class.getName());
-                put("SSLContext.SSLv3", SSLContextImpl.class.getName());
-                put("SSLContext.TLS", SSLContextImpl.class.getName());
-                put("SSLContext.TLSv1", SSLContextImpl.class.getName());
 
-                put("KeyManagerFactory.X509", KeyManagerFactoryImpl.class.getName());
-                put("TrustManagerFactory.X509", TrustManagerFactoryImpl.class.getName());
-                return null;
-            }
-        });
+        put("SSLContext.SSL", SSLContextImpl.class.getName());
+        put("SSLContext.SSLv3", SSLContextImpl.class.getName());
+        put("SSLContext.TLS", SSLContextImpl.class.getName());
+        put("SSLContext.TLSv1", SSLContextImpl.class.getName());
+
+        put("KeyManagerFactory.X509", KeyManagerFactoryImpl.class.getName());
+        put("TrustManagerFactory.X509", TrustManagerFactoryImpl.class.getName());
     }
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java
index 2dcc252..261f3c7 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java
@@ -20,7 +20,6 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -61,15 +60,9 @@
             }
         } else {
             keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
-            String keyStoreName = AccessController
-                    .doPrivileged(new java.security.PrivilegedAction<String>() {
-                        public String run() {
-                            return System.getProperty("javax.net.ssl.keyStore");
-                        }
-                    });
+            String keyStoreName = System.getProperty("javax.net.ssl.keyStore");
             String keyStorePwd = null;
-            if (keyStoreName == null || keyStoreName.equalsIgnoreCase("NONE")
-                    || keyStoreName.length() == 0) {
+            if (keyStoreName == null || keyStoreName.equalsIgnoreCase("NONE") || keyStoreName.isEmpty()) {
                 try {
                     keyStore.load(null, null);
                 } catch (IOException e) {
@@ -78,22 +71,14 @@
                     throw new KeyStoreException(e);
                 }
             } else {
-                keyStorePwd = AccessController
-                        .doPrivileged(new java.security.PrivilegedAction<String>() {
-                            public String run() {
-                                return System
-                                        .getProperty("javax.net.ssl.keyStorePassword");
-                            }
-                        });
+                keyStorePwd = System.getProperty("javax.net.ssl.keyStorePassword");
                 if (keyStorePwd == null) {
                     pwd = EmptyArray.CHAR;
                 } else {
                     pwd = keyStorePwd.toCharArray();
                 }
                 try {
-                    keyStore.load(new FileInputStream(new File(keyStoreName)),
-                            pwd);
-
+                    keyStore.load(new FileInputStream(new File(keyStoreName)), pwd);
                 } catch (FileNotFoundException e) {
                     throw new KeyStoreException(e);
                 } catch (IOException e) {
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java
index 6955ab1..8ccf687 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java
@@ -26,11 +26,12 @@
 import java.security.UnrecoverableEntryException;
 import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import java.util.List;
-import java.util.Vector;
+import java.util.Locale;
 import javax.net.ssl.SSLEngine;
 import javax.net.ssl.X509ExtendedKeyManager;
 import javax.security.auth.x500.X500Principal;
@@ -58,7 +59,6 @@
      * @param pwd
      */
     public KeyManagerImpl(KeyStore keyStore, char[] pwd) {
-        super();
         this.hash = new Hashtable<String, PrivateKeyEntry>();
         final Enumeration<String> aliases;
         try {
@@ -95,11 +95,9 @@
     }
 
     public X509Certificate[] getCertificateChain(String alias) {
-        // BEGIN android-changed
         if (alias == null) {
             return null;
         }
-        // END android-changed
         if (hash.containsKey(alias)) {
             Certificate[] certs = hash.get(alias).getCertificateChain();
             if (certs[0] instanceof X509Certificate) {
@@ -123,11 +121,9 @@
     }
 
     public PrivateKey getPrivateKey(String alias) {
-        // BEGIN android-changed
         if (alias == null) {
             return null;
         }
-        // END android-changed
         if (hash.containsKey(alias)) {
             return hash.get(alias).getPrivateKey();
         }
@@ -151,7 +147,7 @@
             return null;
         }
         List<Principal> issuersList = (issuers == null) ? null : Arrays.asList(issuers);
-        Vector<String> found = new Vector<String>();
+        ArrayList<String> found = new ArrayList<String>();
         for (Enumeration<String> aliases = hash.keys(); aliases.hasMoreElements();) {
             final String alias = aliases.nextElement();
             final KeyStore.PrivateKeyEntry entry = hash.get(alias);
@@ -159,7 +155,7 @@
             final Certificate cert = chain[0];
             final String certKeyAlg = cert.getPublicKey().getAlgorithm();
             final String certSigAlg = (cert instanceof X509Certificate
-                                       ? ((X509Certificate) cert).getSigAlgName().toUpperCase()
+                                       ? ((X509Certificate) cert).getSigAlgName().toUpperCase(Locale.US)
                                        : null);
             for (String keyAlgorithm : keyTypes) {
                 if (keyAlgorithm == null) {
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java
index d4a0e39..a2688e2 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java
@@ -18,6 +18,7 @@
 package org.apache.harmony.xnet.provider.jsse;
 
 import java.io.PrintStream;
+import java.util.Locale;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import libcore.util.EmptyArray;
@@ -67,32 +68,24 @@
             printAsHex(16, " ", "", data, offset, len);
         }
 
-        public void printAsHex(int perLine,
-                String prefix,
-                String delimiter,
-                byte[] data) {
+        public void printAsHex(int perLine, String prefix, String delimiter, byte[] data) {
             printAsHex(perLine, prefix, delimiter, data, 0, data.length);
         }
 
-        public void printAsHex(int perLine,
-                String prefix,
-                String delimiter,
+        public void printAsHex(int perLine, String prefix, String delimiter,
                 byte[] data, int offset, int len) {
-            String line = "";
-            for (int i=0; i<len; i++) {
-                String tail =
-                    Integer.toHexString(0x00ff & data[i+offset]).toUpperCase();
-                if (tail.length() == 1) {
-                    tail = "0" + tail;
-                }
-                line += prefix + tail + delimiter;
+            StringBuilder line = new StringBuilder();
+            for (int i = 0; i < len; i++) {
+                line.append(prefix);
+                line.append(Byte.toHexString(data[i+offset], false));
+                line.append(delimiter);
 
                 if (((i+1)%perLine) == 0) {
-                    super.println(line);
-                    line = "";
+                    super.println(line.toString());
+                    line = new StringBuilder();
                 }
             }
-            super.println(line);
+            super.println(line.toString());
         }
     }
 
@@ -100,12 +93,7 @@
 
     static {
         try {
-            names = AccessController
-                    .doPrivileged(new PrivilegedAction<String[]>() {
-                        public String[] run() {
-                            return System.getProperty("jsse", "").split(",");
-                        }
-                    });
+            names = System.getProperty("jsse", "").split(",");
         } catch (Exception e) {
             names = EmptyArray.STRING;
         }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java
index c2c2172..51a9eea 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java
@@ -180,7 +180,7 @@
      * be passed for compatibility as to provide the hint that we
      * support secure renegotiation.
      */
-    public static String TLS_EMPTY_RENEGOTIATION_INFO_SCSV
+    public static final String TLS_EMPTY_RENEGOTIATION_INFO_SCSV
             = "TLS_EMPTY_RENEGOTIATION_INFO_SCSV";
 
     static {
@@ -283,13 +283,13 @@
     }
 
     // SSL mode from ssl.h
-    public static long SSL_MODE_HANDSHAKE_CUTTHROUGH = 0x00000040L;
+    public static final long SSL_MODE_HANDSHAKE_CUTTHROUGH = 0x00000040L;
 
     // SSL options from ssl.h
-    public static long SSL_OP_NO_TICKET      = 0x00004000L;
-    public static long SSL_OP_NO_COMPRESSION = 0x00020000L;
-    public static long SSL_OP_NO_SSLv3       = 0x02000000L;
-    public static long SSL_OP_NO_TLSv1       = 0x04000000L;
+    public static final long SSL_OP_NO_TICKET      = 0x00004000L;
+    public static final long SSL_OP_NO_COMPRESSION = 0x00020000L;
+    public static final long SSL_OP_NO_SSLv3       = 0x02000000L;
+    public static final long SSL_OP_NO_TLSv1       = 0x04000000L;
 
     public static native int SSL_CTX_new();
 
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java
index 1a837c5..c3cdaad 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java
@@ -27,7 +27,6 @@
     private IOException instantiationException;
 
     public OpenSSLServerSocketFactoryImpl() {
-        super();
         try {
             this.sslParameters = SSLParametersImpl.getDefault();
             this.sslParameters.setUseClientMode(false);
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
index 1900d04..20219e0 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java
@@ -37,9 +37,7 @@
     private String[] enabledCipherSuites = NativeCrypto.getDefaultCipherSuites();
     private String[] enabledCompressionMethods = NativeCrypto.getDefaultCompressionMethods();
 
-    protected OpenSSLServerSocketImpl(SSLParametersImpl sslParameters)
-        throws IOException {
-        super();
+    protected OpenSSLServerSocketImpl(SSLParametersImpl sslParameters) throws IOException {
         this.sslParameters = sslParameters;
     }
 
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
index 4ba1247..42d7f0e 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java
@@ -23,8 +23,8 @@
 import java.security.cert.Certificate;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
 import java.util.Map;
-import java.util.Vector;
 import java.util.Set;
 import javax.net.ssl.SSLPeerUnverifiedException;
 import javax.net.ssl.SSLPermission;
@@ -363,18 +363,11 @@
     /**
      * Returns the context to which the actual SSL session is bound. A SSL
      * context consists of (1) a possible delegate, (2) a provider and (3) a
-     * protocol. If the security manager is activated and one tries to access
-     * the SSL context an exception may be thrown if a
-     * <code>SSLPermission("getSSLSessionContext")</code>
-     * permission is not set.
+     * protocol.
      * @return the SSL context used for this session, or null if it is
      * unavailable.
      */
     public SSLSessionContext getSessionContext() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new SSLPermission("getSSLSessionContext"));
-        }
         return sessionContext;
     }
 
@@ -433,7 +426,7 @@
      *         bound to this SSL session.
      */
     public String[] getValueNames() {
-        Vector<String> v = new Vector<String>();
+        ArrayList<String> v = new ArrayList<String>();
         AccessControlContext current = AccessController.getContext();
         Set<Map.Entry<String, Object>> set = values.entrySet();
         for (Map.Entry<String, Object> o : set) {
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
index d84e28a..84da7e3 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java
@@ -100,9 +100,7 @@
      */
     private int timeoutMilliseconds = 0;
 
-    // BEGIN android-added
     private int handshakeTimeoutMilliseconds = -1;  // -1 = same as timeout; 0 = infinite
-    // END android-added
     private String wrappedHost;
     private int wrappedPort;
 
@@ -114,7 +112,6 @@
      * @throws IOException if network fails
      */
     protected OpenSSLSocketImpl(SSLParametersImpl sslParameters) throws IOException {
-        super();
         this.socket = this;
         this.fd = NativeCrypto.getFileDescriptor(socket);
         init(sslParameters);
@@ -131,7 +128,6 @@
                                 String[] enabledProtocols,
                                 String[] enabledCipherSuites,
                                 String[] enabledCompressionMethods) throws IOException {
-        super();
         this.socket = this;
         this.fd = NativeCrypto.getFileDescriptor(socket);
         init(sslParameters, enabledProtocols, enabledCipherSuites, enabledCompressionMethods);
@@ -206,7 +202,6 @@
      */
     protected OpenSSLSocketImpl(Socket socket, String host, int port,
             boolean autoClose, SSLParametersImpl sslParameters) throws IOException {
-        super();
         this.socket = socket;
         this.fd = NativeCrypto.getFileDescriptor(socket);
         this.wrappedHost = host;
@@ -472,13 +467,11 @@
                                             NativeCrypto.SSL_MODE_HANDSHAKE_CUTTHROUGH);
             }
 
-            // BEGIN android-added
             // Temporarily use a different timeout for the handshake process
             int savedTimeoutMilliseconds = getSoTimeout();
             if (handshakeTimeoutMilliseconds >= 0) {
                 setSoTimeout(handshakeTimeoutMilliseconds);
             }
-            // END android-added
 
             int sslSessionNativePointer;
             try {
@@ -524,12 +517,10 @@
                                          + getInetAddress().getHostName() + ".");
             }
 
-            // BEGIN android-added
             // Restore the original timeout now that the handshake is complete
             if (handshakeTimeoutMilliseconds >= 0) {
                 setSoTimeout(savedTimeoutMilliseconds);
             }
-            // END android-added
 
             // if not, notifyHandshakeCompletedListeners later in handshakeCompleted() callback
             if (handshakeCompleted) {
@@ -1184,7 +1175,6 @@
         return timeoutMilliseconds;
     }
 
-    // BEGIN android-added
     /**
      * Set the handshake timeout on this socket.  This timeout is specified in
      * milliseconds and will be used only during the handshake process.
@@ -1194,7 +1184,6 @@
     public void setHandshakeTimeout(int timeoutMilliseconds) throws SocketException {
         this.handshakeTimeoutMilliseconds = timeoutMilliseconds;
     }
-    // END android-added
 
     /**
      * Closes the SSL socket. Once closed, a socket is not available for further
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java
index e09230b..0e1e130 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java
@@ -28,11 +28,6 @@
 import javax.net.ssl.SSLSocketFactory;
 import javax.net.ssl.TrustManager;
 
-// BEGIN android-note
-//  Modified heavily during SSLSessionContext refactoring. Added support for
-//  persistent session caches.
-// END android-note
-
 /**
  * Implementation of SSLContext service provider interface.
  */
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java
index be8fb08..af03325 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java
@@ -81,7 +81,6 @@
     private Logger.Stream logger = Logger.getStream("engine");
 
     protected SSLEngineImpl(SSLParametersImpl sslParameters) {
-        super();
         this.sslParameters = sslParameters;
     }
 
@@ -753,4 +752,3 @@
             : SSLEngineResult.Status.OK;
     }
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java
index 2e62e44..2a6c5d6 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java
@@ -78,11 +78,9 @@
      * Reads and returns uint64 value.
      */
     public long readUint64() throws IOException {
-        // BEGIN android-changed
         long hi = readUint32();
         long lo = readUint32();
         return (hi << 32) | lo;
-        // END android-changed
     }
 
     /**
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParametersImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParametersImpl.java
index 405e5dd..fdad872 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParametersImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParametersImpl.java
@@ -33,7 +33,7 @@
 import javax.net.ssl.X509TrustManager;
 
 /**
- * The instances of this class incapsulate all the info
+ * The instances of this class encapsulate all the info
  * about enabled cipher suites and protocols,
  * as well as the information about client/server mode of
  * ssl socket, whether it require/want client authentication or not,
@@ -53,12 +53,10 @@
 
     // client session context contains the set of reusable
     // client-side SSL sessions
-// BEGIN android-changed
     private final ClientSessionContext clientSessionContext;
     // server session context contains the set of reusable
     // server-side SSL sessions
     private final ServerSessionContext serverSessionContext;
-// END android-changed
     // source of authentication keys
     private X509KeyManager keyManager;
     // source of authentication trust decisions
@@ -67,9 +65,7 @@
     private SecureRandom secureRandom;
 
     // cipher suites available for SSL connection
-    // BEGIN android-changed
     private CipherSuite[] enabledCipherSuites;
-    // END android-changed
     // string representations of available cipher suites
     private String[] enabledCipherSuiteNames = null;
 
@@ -85,14 +81,12 @@
     // if the peer with this parameters allowed to cteate new SSL session
     private boolean enable_session_creation = true;
 
-// BEGIN android-changed
     protected CipherSuite[] getEnabledCipherSuitesMember() {
         if (enabledCipherSuites == null) {
             this.enabledCipherSuites = CipherSuite.DEFAULT_CIPHER_SUITES;
         }
         return enabledCipherSuites;
     }
-// END android-changed
 
     /**
      * Initializes the parameters. Naturally this constructor is used
@@ -103,13 +97,11 @@
      * SecureRandom)} for more information
      */
     protected SSLParametersImpl(KeyManager[] kms, TrustManager[] tms,
-// BEGIN android-changed
             SecureRandom sr, ClientSessionContext clientSessionContext,
             ServerSessionContext serverSessionContext)
             throws KeyManagementException {
         this.serverSessionContext = serverSessionContext;
         this.clientSessionContext = clientSessionContext;
-// END android-changed
 
         // It's not described by the spec of SSLContext what should happen
         // if the arrays of length 0 are specified. This implementation
@@ -150,7 +142,7 @@
         // null, we don't replace it by a new instance. The native code below
         // then directly accesses /dev/urandom. Not the most elegant solution,
         // but faster than going through the SecureRandom object.
-            secureRandom = sr;
+        secureRandom = sr;
         // END android-added
     }
 
@@ -170,18 +162,14 @@
     /**
      * @return server session context
      */
-// BEGIN android-changed
     protected ServerSessionContext getServerSessionContext() {
-// END android-changed
         return serverSessionContext;
     }
 
     /**
      * @return client session context
      */
-// BEGIN android-changed
     protected ClientSessionContext getClientSessionContext() {
-// END android-changed
         return clientSessionContext;
     }
 
@@ -215,23 +203,19 @@
         return secureRandom;
     }
 
-    // BEGIN android-added
     /**
      * @return the secure random member reference, even it is null
      */
     protected SecureRandom getSecureRandomMember() {
         return secureRandom;
     }
-    // END android-added
 
     /**
      * @return the names of enabled cipher suites
      */
     protected String[] getEnabledCipherSuites() {
         if (enabledCipherSuiteNames == null) {
-            // BEGIN android-added
             CipherSuite[] enabledCipherSuites = getEnabledCipherSuitesMember();
-            // END android-added
             enabledCipherSuiteNames = new String[enabledCipherSuites.length];
             for (int i = 0; i< enabledCipherSuites.length; i++) {
                 enabledCipherSuiteNames[i] = enabledCipherSuites[i].getName();
@@ -364,13 +348,11 @@
      */
     @Override
     protected Object clone() {
-// BEGIN android-changed
         try {
             return super.clone();
         } catch (CloneNotSupportedException e) {
             throw new AssertionError(e);
         }
-// END android-changed
     }
 
     private static X509KeyManager getDefaultKeyManager() {
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java
index fa001b2..22872f8 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketFactoryImpl.java
@@ -36,7 +36,6 @@
      * Constructor.
      */
     public SSLServerSocketFactoryImpl() {
-        super();
         try {
             this.sslParameters = SSLParametersImpl.getDefault();
             this.sslParameters.setUseClientMode(false);
@@ -51,7 +50,6 @@
      * Constructor.
      */
     protected SSLServerSocketFactoryImpl(SSLParametersImpl sslParameters) {
-        super();
         this.sslParameters = (SSLParametersImpl) sslParameters.clone();
         this.sslParameters.setUseClientMode(false);
     }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java
index f54101f..477d03d 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSocketImpl.java
@@ -44,9 +44,7 @@
      * @param   sslParameters:  SSLParameters
      * @throws  IOException
      */
-    protected SSLServerSocketImpl(SSLParametersImpl sslParameters)
-        throws IOException {
-        super();
+    protected SSLServerSocketImpl(SSLParametersImpl sslParameters) throws IOException {
         this.sslParameters = sslParameters;
     }
 
@@ -249,16 +247,6 @@
         SSLSocketImpl s = new SSLSocketImpl(
                 (SSLParametersImpl) sslParameters.clone());
         implAccept(s);
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            try {
-                sm.checkAccept(s.getInetAddress().getHostAddress(),
-                        s.getPort());
-            } catch(SecurityException e) {
-                s.close();
-                throw e;
-            }
-        }
         s.init();
         if (logger != null) {
             logger.println("SSLServerSocketImpl: accepted, initialized");
@@ -276,4 +264,3 @@
 
     // -----------------------------------------------------------------
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
index d88ee95..deb0399 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java
@@ -24,9 +24,9 @@
 import java.security.cert.Certificate;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
+import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Vector;
 import javax.net.ssl.SSLPeerUnverifiedException;
 import javax.net.ssl.SSLPermission;
 import javax.net.ssl.SSLSession;
@@ -57,7 +57,6 @@
         final AccessControlContext acc;
 
         ValueKey(String name) {
-            super();
             this.name = name;
             this.acc = AccessController.getContext();
         }
@@ -121,9 +120,7 @@
     /**
      * Context of the session
      */
-// BEGIN android-changed
     SSLSessionContext context;
-// END android-changed
 
     /**
      * certificates were sent to the peer
@@ -281,10 +278,6 @@
     }
 
     public SSLSessionContext getSessionContext() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new SSLPermission("getSSLSessionContext"));
-        }
         return context;
     }
 
@@ -296,7 +289,7 @@
     }
 
     public String[] getValueNames() {
-        final Vector<String> v = new Vector<String>();
+        final ArrayList<String> v = new ArrayList<String>();
         final AccessControlContext currAcc = AccessController.getContext();
         for (ValueKey key : values.keySet()) {
             if (Objects.equal(currAcc, key.acc)) {
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
index 2b3fe32..6984cd8 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketImpl.java
@@ -48,10 +48,10 @@
     // alert protocol to be used
     private AlertProtocol alertProtocol;
     // application data input stream, this stream is presented by
-    // ssl socket as an input stream. Additionaly this object is a
+    // ssl socket as an input stream. Additionally this object is a
     // place where application data will be stored by record protocol
     private SSLSocketInputStream appDataIS;
-    // outcoming application data stream
+    // outgoing application data stream
     private SSLSocketOutputStream appDataOS;
     // active session object
     private SSLSessionImpl session;
@@ -82,7 +82,6 @@
      * for more information.
      */
     protected SSLSocketImpl(SSLParametersImpl sslParameters) {
-        super();
         this.sslParameters = sslParameters;
         // init should be called after creation!
     }
@@ -450,9 +449,6 @@
         }
     }
 
-
-    // ---------------- Socket's methods overridings -------------------
-
     /**
      * This method works according to the specification of implemented class.
      * @see javax.net.ssl.SSLSocket#getInputStream()
@@ -550,8 +546,7 @@
      */
     @Override
     public void shutdownOutput() {
-        throw new UnsupportedOperationException(
-                "Method shutdownOutput() is not supported.");
+        throw new UnsupportedOperationException();
     }
 
     /**
@@ -559,21 +554,11 @@
      */
     @Override
     public void shutdownInput() {
-        throw new UnsupportedOperationException(
-                "Method shutdownInput() is not supported.");
-    }
-
-    /**
-     * Returns the string representation of the object.
-     */
-    @Override
-    public String toString() {
-        return "[SSLSocketImpl]";
+        throw new UnsupportedOperationException();
     }
 
     // -----------------------------------------------------------------
 
-    // Shutdownes the ssl socket and makes all cleanup work.
     private void shutdown() {
         if (handshake_started) {
             alertProtocol.shutdown();
@@ -588,7 +573,7 @@
 
     /**
      * This method is called by SSLSocketInputStream class
-     * when client application tryes to read application data from
+     * when client application tries to read application data from
      * the stream, but there is no data in its underlying buffer.
      * @throws  IOException
      */
@@ -635,7 +620,7 @@
                                     + type + " has been got"));
                 }
                 if (alertProtocol.hasAlert()) {
-                    // warning alert occured during wrap or unwrap
+                    // warning alert occurred during wrap or unwrap
                     // (note: fatal alert causes AlertException
                     // to be thrown)
                     output.write(alertProtocol.wrap());
@@ -660,11 +645,10 @@
     }
 
     /**
-     * This method is called by SSLSocketOutputStream when client application
-     * tryes to send the data over ssl protocol.
+     * This method is called by SSLSocketOutputStream when a client application
+     * tries to send the data over ssl protocol.
      */
-    protected void writeAppData(byte[] data, int offset, int len)
-                                                    throws IOException {
+    protected void writeAppData(byte[] data, int offset, int len) throws IOException {
         if (!handshake_started) {
             startHandshake();
         }
@@ -698,14 +682,14 @@
     }
 
     /*
-     * Performs handshake proccess over this connection. The handshake
+     * Performs handshake process over this connection. The handshake
      * process is directed by the handshake status code provided by
      * handshake protocol. If this status is NEED_WRAP, method retrieves
      * handshake message from handshake protocol and sends it to another peer.
      * If this status is NEED_UNWRAP, method receives and processes handshake
      * message from another peer. Each of this stages (wrap/unwrap) change
      * the state of handshake protocol and this process is performed
-     * until handshake status is FINISHED. After handshake process is finnished
+     * until handshake status is FINISHED. After handshake process is finished
      * handshake completed event are sent to the registered listeners.
      * For more information about the handshake process see
      * TLS v1 specification (http://www.ietf.org/rfc/rfc2246.txt) p 7.3.
@@ -766,7 +750,7 @@
                             "Handshake passed unexpected status: "+status));
                 }
                 if (alertProtocol.hasAlert()) {
-                    // warning alert uccured during wrap or unwrap
+                    // warning alert occurred during wrap or unwrap
                     // (note: fatal alert causes AlertException
                     // to be thrown)
                     output.write(alertProtocol.wrap());
@@ -840,4 +824,3 @@
         throw reason;
     }
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java
index 950518b..8016579 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketInputStream.java
@@ -26,16 +26,15 @@
  * for SSLSocket. It accumulates the application data
  * received by SSL protocol.
  */
-public final class SSLSocketInputStream
-        extends InputStream {
+public final class SSLSocketInputStream extends InputStream {
 
     // The size of the internal data buffer.
     // It should not be less than maximum data chunk enclosed
     // in one ssl packet.
-    private final int size = SSLRecordProtocol.MAX_DATA_LENGTH;
+    private static final int BUFFER_SIZE = SSLRecordProtocol.MAX_DATA_LENGTH;
 
     // Internal buffer accumulating the received application data
-    private byte[] buffer = new byte[size];
+    private byte[] buffer = new byte[BUFFER_SIZE];
 
     // position of the next byte to read from the buffer
     private int pos;
@@ -70,7 +69,7 @@
         end_reached = true;
     }
 
-    // ------------------ InputStream implementetion -------------------
+    // ------------------ InputStream implementation -------------------
 
     /**
      * Returns the number of bytes available for reading without blocking.
@@ -108,28 +107,14 @@
                 return -1;
             }
             // If there is no data in the buffer
-            // - will block untill the data will be provided by
+            // - will block until the data will be provided by
             // record layer
             owner.needAppData();
         }
         return buffer[pos++] & 0xFF;
     }
 
-    /**
-     * Method acts as described in spec for superclass.
-     * @see java.io.InputStream#read(byte[])
-     */
-    @Override
-    public int read(byte[] b) throws IOException {
-        return read(b, 0, b.length);
-    }
-
-    /**
-     * Method acts as described in spec for superclass.
-     * @see java.io.InputStream#read(byte[],int,int)
-     */
-    @Override
-    public int read(byte[] b, int off, int len) throws IOException {
+    @Override public int read(byte[] b, int off, int len) throws IOException {
         int read_b;
         int i = 0;
         do {
@@ -142,10 +127,10 @@
         return i;
     }
 
-    // The helper class devivering the application data from the record layer
+    // The helper class delivering the application data from the record layer
     // to this input stream.
     // It 'adapts' the InputStream interface to Appendable, which is used for
-    // transmition of income data from the record protocol to its clients.
+    // transmission of income data from the record protocol to its clients.
     private class Adapter implements org.apache.harmony.xnet.provider.jsse.Appendable {
         /**
          * Appends the data to the stream.
@@ -154,20 +139,20 @@
          */
         public void append(byte[] src) {
             int length = src.length;
-            if (size - (end - pos) < length) {
+            if (BUFFER_SIZE - (end - pos) < length) {
                 // If the size of the buffer is greater than or equals to
                 // SSLRecordProtocol.MAX_DATA_LENGTH this situation will
                 // happen iff:
                 // 1. the length of received data fragment is greater
                 // than allowed by the spec
-                // 2. it is rehandhaking stage and we have got several
+                // 2. it is rehandshaking stage and we have got several
                 // extra app data messages.
                 // In any case it is better to throw alert exception.
                 throw new AlertException(AlertProtocol.INTERNAL_ERROR,
                         new SSLException("Could not accept income app data."));
             }
-            if (end + length > size) {
-                // move the content of the buffer to the beginnig
+            if (end + length > BUFFER_SIZE) {
+                // move the content of the buffer to the beginning
                 System.arraycopy(buffer, pos, buffer, 0, end-pos);
                 end -= pos;
                 pos = 0;
@@ -177,4 +162,3 @@
         }
     }
 }
-
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java
index b5a110d..2666eee 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSocketOutputStream.java
@@ -19,6 +19,7 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
+import libcore.io.Streams;
 
 /**
  * This is a application data output stream used in SSLSocket
@@ -27,29 +28,18 @@
  * and then sent to the peer host.
  */
 public class SSLSocketOutputStream extends OutputStream {
-
     private final SSLSocketImpl owner;
 
     protected SSLSocketOutputStream(SSLSocketImpl owner) {
         this.owner = owner;
     }
 
-    private final byte[] singleByte = new byte[1];
-
-    @Override
-    public void write(int b) throws IOException {
-        singleByte[0] = (byte) (b & 0xFF);
-        owner.writeAppData(singleByte, 0, 1);
-    }
-
-    @Override
-    public void write(byte[] b) throws IOException {
-        owner.writeAppData(b, 0, b.length);
+    @Override public void write(int b) throws IOException {
+        Streams.writeSingleByte(this, b);
     }
 
     @Override
     public void write(byte[] b, int off, int len) throws IOException {
         owner.writeAppData(b, off, len);
     }
-
 }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java
index f9df058..7961cdc 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java
@@ -264,9 +264,7 @@
 
                     clientFinished = new Finished(io_stream, length);
                     verifyFinished(clientFinished.getData());
-                    // BEGIN android-added
                     session.context = parameters.getServerSessionContext();
-                    // END android-added
                     parameters.getServerSessionContext().putSession(session);
                     if (!isResuming) {
                         sendChangeCipherSpec();
@@ -402,13 +400,11 @@
                            "SSL Session may not be created");
             }
             session = new SSLSessionImpl(cipher_suite, parameters.getSecureRandom());
-            // BEGIN android-added
             if (engineOwner != null) {
                 session.setPeer(engineOwner.getPeerHost(), engineOwner.getPeerPort());
             } else {
                 session.setPeer(socketOwner.getInetAddress().getHostName(), socketOwner.getPort());
             }
-            // END android-added
         }
 
         recordProtocol.setVersion(clientHello.client_version);
@@ -635,13 +631,11 @@
             if (!clientSuite.supported) {
                 continue;
             }
-            // BEGIN android-changed
             for (CipherSuite enabledCipherSuite : parameters.getEnabledCipherSuitesMember()) {
                 if (clientSuite.equals(enabledCipherSuite)) {
                     return clientSuite;
                 }
             }
-            // END android-changed
         }
         return null;
     }
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java
index 1fa848a..00a25f8 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java
@@ -19,6 +19,7 @@
 
 import java.io.IOException;
 import java.security.SecureRandom;
+import libcore.io.Streams;
 
 /**
  *
@@ -86,7 +87,7 @@
 
         server_version[0] = (byte) in.read();
         server_version[1] = (byte) in.read();
-        in.read(random, 0, 32);
+        Streams.readFully(in, random);
         int size = in.readUint8();
         session_id = new byte[size];
         in.read(session_id, 0, size);
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java
index a0816ae..fef4f5f 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java
@@ -22,7 +22,6 @@
 import java.io.FileNotFoundException;
 import java.io.InputStream;
 import java.io.IOException;
-import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -51,27 +50,14 @@
         if (ks != null) {
             keyStore = ks;
         } else {
-            // BEGIN android-added
             if (System.getProperty("javax.net.ssl.trustStore") == null) {
-                String file = System.getProperty("java.home")
-                    + java.io.File.separator + "etc" + java.io.File.separator
-                    + "security" + java.io.File.separator
-                    + "cacerts.bks";
-
-                System.setProperty("javax.net.ssl.trustStore", file);
+                String filename = System.getProperty("java.home") + "/etc/security/cacerts.bks";
+                System.setProperty("javax.net.ssl.trustStore", filename);
             }
-            // END android-added
             keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
-            String keyStoreName = AccessController
-                    .doPrivileged(new java.security.PrivilegedAction<String>() {
-                        public String run() {
-                            return System
-                                    .getProperty("javax.net.ssl.trustStore");
-                        }
-                    });
+            String keyStoreName = System.getProperty("javax.net.ssl.trustStore");
             String keyStorePwd = null;
-            if (keyStoreName == null || keyStoreName.equalsIgnoreCase("NONE")
-                    || keyStoreName.length() == 0) {
+            if (keyStoreName == null || keyStoreName.equalsIgnoreCase("NONE") || keyStoreName.isEmpty()) {
                 try {
                     keyStore.load(null, null);
                 } catch (IOException e) {
@@ -82,13 +68,7 @@
                     throw new KeyStoreException(e);
                 }
             } else {
-                keyStorePwd = AccessController
-                        .doPrivileged(new java.security.PrivilegedAction<String>() {
-                            public String run() {
-                                return System
-                                        .getProperty("javax.net.ssl.trustStorePassword");
-                            }
-                        });
+                keyStorePwd = System.getProperty("javax.net.ssl.trustStorePassword");
                 char[] pwd;
                 if (keyStorePwd == null) {
                     pwd = EmptyArray.CHAR;
diff --git a/luni/src/main/java/org/xml/sax/SAXException.java b/luni/src/main/java/org/xml/sax/SAXException.java
index d4c02b3..b8d0a9b 100644
--- a/luni/src/main/java/org/xml/sax/SAXException.java
+++ b/luni/src/main/java/org/xml/sax/SAXException.java
@@ -42,7 +42,6 @@
      */
     public SAXException ()
     {
-    super();
     this.exception = null;
     }
 
@@ -69,7 +68,6 @@
      */
     public SAXException (Exception e)
     {
-    super();
     this.exception = e;
     }
 
diff --git a/luni/src/main/java/org/xml/sax/SAXNotRecognizedException.java b/luni/src/main/java/org/xml/sax/SAXNotRecognizedException.java
index 69ba807..d6bb88d 100644
--- a/luni/src/main/java/org/xml/sax/SAXNotRecognizedException.java
+++ b/luni/src/main/java/org/xml/sax/SAXNotRecognizedException.java
@@ -34,7 +34,6 @@
      */
     public SAXNotRecognizedException ()
     {
-    super();
     }
 
 
diff --git a/luni/src/main/java/org/xml/sax/SAXNotSupportedException.java b/luni/src/main/java/org/xml/sax/SAXNotSupportedException.java
index 3b51da6..9da85ea 100644
--- a/luni/src/main/java/org/xml/sax/SAXNotSupportedException.java
+++ b/luni/src/main/java/org/xml/sax/SAXNotSupportedException.java
@@ -34,7 +34,6 @@
      */
     public SAXNotSupportedException ()
     {
-    super();
     }
 
 
diff --git a/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java b/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java
index 3b3b6d9..52fa1e5 100644
--- a/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java
+++ b/luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java
@@ -37,18 +37,16 @@
  */
 public class Attributes2Impl extends AttributesImpl implements Attributes2
 {
-    private boolean    declared [];
-    private boolean    specified [];
+    private boolean[] declared;
+    private boolean[] specified;
 
 
     /**
      * Construct a new, empty Attributes2Impl object.
      */
     public Attributes2Impl () {
-        // BEGIN android-added
         declared = EmptyArray.BOOLEAN;
         specified = EmptyArray.BOOLEAN;
-        // END android-added
     }
 
 
@@ -246,12 +244,8 @@
 
     int length = getLength ();
 
-    // BEGIN android-changed
     if (length > specified.length) {
-    // END android-changed
-        boolean    newFlags [];
-
-        newFlags = new boolean [length];
+        boolean[] newFlags = new boolean [length];
         System.arraycopy (declared, 0, newFlags, 0, declared.length);
         declared = newFlags;
 
diff --git a/luni/src/main/java/org/xml/sax/helpers/AttributeListImpl.java b/luni/src/main/java/org/xml/sax/helpers/AttributeListImpl.java
index 5b94743..1ae19da 100644
--- a/luni/src/main/java/org/xml/sax/helpers/AttributeListImpl.java
+++ b/luni/src/main/java/org/xml/sax/helpers/AttributeListImpl.java
@@ -5,7 +5,7 @@
 
 package org.xml.sax.helpers;
 
-import java.util.Vector;
+import java.util.ArrayList;
 import org.xml.sax.AttributeList;
 
 
@@ -136,11 +136,10 @@
      * @see #removeAttribute
      * @see org.xml.sax.DocumentHandler#startElement
      */
-    public void addAttribute (String name, String type, String value)
-    {
-    names.addElement(name);
-    types.addElement(type);
-    values.addElement(value);
+    public void addAttribute(String name, String type, String value) {
+        names.add(name);
+        types.add(type);
+        values.add(value);
     }
 
 
@@ -158,15 +157,13 @@
      * @param name The attribute name.
      * @see #addAttribute
      */
-    public void removeAttribute (String name)
-    {
-    int i = names.indexOf(name);
-
-    if (i >= 0) {
-        names.removeElementAt(i);
-        types.removeElementAt(i);
-        values.removeElementAt(i);
-    }
+    public void removeAttribute(String name) {
+        int i = names.indexOf(name);
+        if (i != -1) {
+            names.remove(i);
+            types.remove(i);
+            values.remove(i);
+        }
     }
 
 
@@ -180,11 +177,10 @@
      *
      * @see org.xml.sax.DocumentHandler#startElement
      */
-    public void clear ()
-    {
-    names.removeAllElements();
-    types.removeAllElements();
-    values.removeAllElements();
+    public void clear() {
+        names.clear();
+        types.clear();
+        values.clear();
     }
 
 
@@ -200,9 +196,8 @@
      * @return The number of attributes in the list.
      * @see org.xml.sax.AttributeList#getLength
      */
-    public int getLength ()
-    {
-    return names.size();
+    public int getLength() {
+        return names.size();
     }
 
 
@@ -214,16 +209,11 @@
      *         is no attribute at that position.
      * @see org.xml.sax.AttributeList#getName(int)
      */
-    public String getName (int i)
-    {
-    if (i < 0) {
-        return null;
-    }
-    try {
-        return (String)names.elementAt(i);
-    } catch (ArrayIndexOutOfBoundsException e) {
-        return null;
-    }
+    public String getName(int i) {
+        if (i < 0 || i >= names.size()) {
+            return null;
+        }
+        return names.get(i);
     }
 
 
@@ -237,16 +227,11 @@
      *         that position.
      * @see org.xml.sax.AttributeList#getType(int)
      */
-    public String getType (int i)
-    {
-    if (i < 0) {
-        return null;
-    }
-    try {
-        return (String)types.elementAt(i);
-    } catch (ArrayIndexOutOfBoundsException e) {
-        return null;
-    }
+    public String getType(int i) {
+        if (i < 0 || i >= types.size()) {
+            return null;
+        }
+        return types.get(i);
     }
 
 
@@ -258,16 +243,11 @@
      *         there is no attribute at that position.
      * @see org.xml.sax.AttributeList#getValue(int)
      */
-    public String getValue (int i)
-    {
-    if (i < 0) {
-        return null;
-    }
-    try {
-        return (String)values.elementAt(i);
-    } catch (ArrayIndexOutOfBoundsException e) {
-        return null;
-    }
+    public String getValue(int i) {
+        if (i < 0 || i >= values.size()) {
+            return null;
+        }
+        return values.get(i);
     }
 
 
@@ -280,9 +260,8 @@
      *         read).
      * @see org.xml.sax.AttributeList#getType(java.lang.String)
      */
-    public String getType (String name)
-    {
-    return getType(names.indexOf(name));
+    public String getType(String name) {
+        return getType(names.indexOf(name));
     }
 
 
@@ -294,9 +273,8 @@
      *         exist.
      * @see org.xml.sax.AttributeList#getValue(java.lang.String)
      */
-    public String getValue (String name)
-    {
-    return getValue(names.indexOf(name));
+    public String getValue(String name) {
+        return getValue(names.indexOf(name));
     }
 
 
@@ -305,9 +283,9 @@
     // Internal state.
     ////////////////////////////////////////////////////////////////////
 
-    Vector names = new Vector();
-    Vector types = new Vector();
-    Vector values = new Vector();
+    private ArrayList<String> names = new ArrayList<String>();
+    private ArrayList<String> types = new ArrayList<String>();
+    private ArrayList<String> values = new ArrayList<String>();
 
 }
 
diff --git a/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java b/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java
index bff22b0..5f96797 100644
--- a/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java
+++ b/luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java
@@ -6,11 +6,11 @@
 
 package org.xml.sax.helpers;
 
+import java.util.ArrayList;
+import java.util.Collections;
 import java.util.EmptyStackException;
 import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Vector;
-
 
 /**
  * Encapsulate Namespace logic for use by applications using SAX,
@@ -86,7 +86,7 @@
      * <p>This is the Namespace URI that is automatically mapped
      * to the "xml" prefix.</p>
      */
-    public final static String XMLNS =
+    public static final String XMLNS =
     "http://www.w3.org/XML/1998/namespace";
 
 
@@ -106,15 +106,14 @@
      * @see #setNamespaceDeclUris
      * @see #isNamespaceDeclUris
      */
-    public final static String NSDECL =
+    public static final String NSDECL =
     "http://www.w3.org/xmlns/2000/";
 
 
     /**
      * An empty enumeration.
      */
-    private final static Enumeration EMPTY_ENUMERATION =
-    new Vector().elements();
+    private static final Enumeration EMPTY_ENUMERATION = Collections.enumeration(Collections.emptyList());
 
 
     ////////////////////////////////////////////////////////////////////
@@ -442,17 +441,16 @@
      * @see #getDeclaredPrefixes
      * @see #getURI
      */
-    public Enumeration getPrefixes (String uri)
-    {
-    Vector prefixes = new Vector();
-    Enumeration allPrefixes = getPrefixes();
-    while (allPrefixes.hasMoreElements()) {
-        String prefix = (String)allPrefixes.nextElement();
-        if (uri.equals(getURI(prefix))) {
-        prefixes.addElement(prefix);
+    public Enumeration getPrefixes(String uri) {
+        ArrayList<String> prefixes = new ArrayList<String>();
+        Enumeration allPrefixes = getPrefixes();
+        while (allPrefixes.hasMoreElements()) {
+            String prefix = (String) allPrefixes.nextElement();
+            if (uri.equals(getURI(prefix))) {
+                prefixes.add(prefix);
+            }
         }
-    }
-    return prefixes.elements();
+        return Collections.enumeration(prefixes);
     }
 
 
@@ -596,32 +594,31 @@
      * @param uri The associated Namespace URI.
      * @see org.xml.sax.helpers.NamespaceSupport#declarePrefix
      */
-    void declarePrefix (String prefix, String uri)
-    {
-                // Lazy processing...
-        if (!declsOK)
-        throw new IllegalStateException (
-            "can't declare any more prefixes in this context");
+    void declarePrefix(String prefix, String uri) {
+        // Lazy processing...
+        if (!declsOK) {
+            throw new IllegalStateException ("can't declare any more prefixes in this context");
+        }
         if (!declSeen) {
-        copyTables();
+            copyTables();
         }
         if (declarations == null) {
-        declarations = new Vector();
+            declarations = new ArrayList<String>();
         }
 
         prefix = prefix.intern();
         uri = uri.intern();
         if ("".equals(prefix)) {
-        if ("".equals(uri)) {
-            defaultNS = null;
+            if ("".equals(uri)) {
+                defaultNS = null;
+            } else {
+                defaultNS = uri;
+            }
         } else {
-            defaultNS = uri;
+            prefixTable.put(prefix, uri);
+            uriTable.put(uri, prefix); // may wipe out another prefix
         }
-        } else {
-        prefixTable.put(prefix, uri);
-        uriTable.put(uri, prefix); // may wipe out another prefix
-        }
-        declarations.addElement(prefix);
+        declarations.add(prefix);
     }
 
 
@@ -754,13 +751,8 @@
      * @return An enumeration of prefixes (possibly empty).
      * @see org.xml.sax.helpers.NamespaceSupport#getDeclaredPrefixes
      */
-    Enumeration getDeclaredPrefixes ()
-    {
-        if (declarations == null) {
-        return EMPTY_ENUMERATION;
-        } else {
-        return declarations.elements();
-        }
+    Enumeration getDeclaredPrefixes() {
+        return (declarations == null) ? EMPTY_ENUMERATION : Collections.enumeration(declarations);
     }
 
 
@@ -831,7 +823,7 @@
     // Internal state.
     ////////////////////////////////////////////////////////////////
 
-    private Vector declarations = null;
+    private ArrayList<String> declarations = null;
     private boolean declSeen = false;
     private Context parent = null;
     }
diff --git a/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java b/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
index 9910080..9d1c683 100644
--- a/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
+++ b/luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java
@@ -7,8 +7,8 @@
 package org.xml.sax.helpers;
 
 import java.io.IOException;
+import java.util.ArrayList;
 import java.util.Enumeration;
-import java.util.Vector;
 import org.xml.sax.AttributeList;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -74,7 +74,6 @@
     public ParserAdapter ()
       throws SAXException
     {
-    super();
 
     String driver = System.getProperty("org.xml.sax.parser");
 
@@ -119,7 +118,6 @@
      */
     public ParserAdapter (Parser parser)
     {
-    super();
     setup(parser);
     }
 
@@ -153,10 +151,10 @@
     //
     // Internal constants for the sake of convenience.
     //
-    private final static String FEATURES = "http://xml.org/sax/features/";
-    private final static String NAMESPACES = FEATURES + "namespaces";
-    private final static String NAMESPACE_PREFIXES = FEATURES + "namespace-prefixes";
-    private final static String XMLNS_URIs = FEATURES + "xmlns-uris";
+    private static final String FEATURES = "http://xml.org/sax/features/";
+    private static final String NAMESPACES = FEATURES + "namespaces";
+    private static final String NAMESPACE_PREFIXES = FEATURES + "namespace-prefixes";
+    private static final String XMLNS_URIs = FEATURES + "xmlns-uris";
 
 
     /**
@@ -475,14 +473,12 @@
      * @exception SAXException The client may raise a
      *            processing exception.
      */
-    public void startElement (String qName, AttributeList qAtts)
-    throws SAXException
-    {
-                // These are exceptions from the
-                // first pass; they should be
-                // ignored if there's a second pass,
-                // but reported otherwise.
-    Vector exceptions = null;
+    public void startElement (String qName, AttributeList qAtts) throws SAXException {
+        // These are exceptions from the
+        // first pass; they should be
+        // ignored if there's a second pass,
+        // but reported otherwise.
+        ArrayList<SAXParseException> exceptions = null;
 
                 // If we're not doing Namespace
                 // processing, dispatch this quickly.
@@ -575,18 +571,19 @@
         atts.addAttribute(attName[0], attName[1], attName[2],
                   type, value);
         } catch (SAXException e) {
-        if (exceptions == null)
-            exceptions = new Vector();
-        exceptions.addElement(e);
-        atts.addAttribute("", attQName, attQName, type, value);
+            if (exceptions == null) {
+                exceptions = new ArrayList<SAXParseException>();
+            }
+            exceptions.add((SAXParseException) e);
+            atts.addAttribute("", attQName, attQName, type, value);
         }
     }
 
     // now handle the deferred exception reports
     if (exceptions != null && errorHandler != null) {
-        for (int i = 0; i < exceptions.size(); i++)
-        errorHandler.error((SAXParseException)
-                (exceptions.elementAt(i)));
+        for (SAXParseException ex : exceptions) {
+            errorHandler.error(ex);
+        }
     }
 
                 // OK, finally report the event.
diff --git a/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java b/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java
index 7614b85..4b4dd71 100644
--- a/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java
+++ b/luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java
@@ -73,7 +73,6 @@
      */
     public XMLFilterImpl ()
     {
-    super();
     }
 
 
@@ -87,7 +86,6 @@
      */
     public XMLFilterImpl (XMLReader parent)
     {
-        super();
     setParent(parent);
     }
 
diff --git a/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java b/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java
index abd7e59..c683229 100644
--- a/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java
+++ b/luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java
@@ -439,7 +439,7 @@
     /**
      * Internal class to wrap a SAX2 Attributes object for SAX1.
      */
-    final class AttributesAdapter implements AttributeList
+    static final class AttributesAdapter implements AttributeList
     {
     AttributesAdapter ()
     {
diff --git a/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java b/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
index 1d750b6..54117bb 100644
--- a/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
+++ b/luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java
@@ -10,6 +10,7 @@
 import java.io.BufferedReader;
 import java.io.InputStream;
 import java.io.InputStreamReader;
+import java.nio.charset.Charsets;
 import org.xml.sax.SAXException;
 import org.xml.sax.XMLReader;
 
@@ -125,7 +126,7 @@
             in = loader.getResourceAsStream (service);
 
         if (in != null) {
-            reader = new BufferedReader (new InputStreamReader (in, "UTF8"));
+            reader = new BufferedReader (new InputStreamReader (in, Charsets.UTF_8));
             className = reader.readLine ();
             in.close ();
         }
diff --git a/luni/src/main/java/sun/misc/Unsafe.java b/luni/src/main/java/sun/misc/Unsafe.java
index 1080414..33bb9f1 100644
--- a/luni/src/main/java/sun/misc/Unsafe.java
+++ b/luni/src/main/java/sun/misc/Unsafe.java
@@ -19,7 +19,6 @@
 import dalvik.system.VMStack;
 import java.lang.reflect.Field;
 import java.lang.reflect.Modifier;
-import org.apache.harmony.kernel.vm.LangAccess;
 
 /**
  * The package name notwithstanding, this class is the quasi-standard
@@ -31,15 +30,10 @@
     /** non-null; unique instance of this class */
     private static final Unsafe THE_ONE = new Unsafe();
 
-    /** non-null; the lang-access utility instance */
-    private final LangAccess lang;
-
     /**
      * This class is only privately instantiable.
      */
-    private Unsafe() {
-        lang = LangAccess.getInstance();
-    }
+    private Unsafe() {}
 
     /**
      * Gets the unique instance of this class. This is only allowed in
@@ -324,9 +318,9 @@
      */
     public void park(boolean absolute, long time) {
         if (absolute) {
-            lang.parkUntil(time);
+            Thread.currentThread().parkUntil(time);
         } else {
-            lang.parkFor(time);
+            Thread.currentThread().parkFor(time);
         }
     }
 
@@ -340,7 +334,7 @@
      */
     public void unpark(Object obj) {
         if (obj instanceof Thread) {
-            lang.unpark((Thread) obj);
+            ((Thread) obj).unpark();
         } else {
             throw new IllegalArgumentException("valid for Threads only");
         }
diff --git a/luni/src/main/native/JniConstants.cpp b/luni/src/main/native/JniConstants.cpp
index e147e0c..646bd3f 100644
--- a/luni/src/main/native/JniConstants.cpp
+++ b/luni/src/main/native/JniConstants.cpp
@@ -21,29 +21,41 @@
 jclass JniConstants::bidiRunClass;
 jclass JniConstants::bigDecimalClass;
 jclass JniConstants::booleanClass;
-jclass JniConstants::byteClass;
 jclass JniConstants::byteArrayClass;
+jclass JniConstants::byteClass;
 jclass JniConstants::charsetICUClass;
 jclass JniConstants::constructorClass;
 jclass JniConstants::datagramPacketClass;
 jclass JniConstants::deflaterClass;
 jclass JniConstants::doubleClass;
+jclass JniConstants::errnoExceptionClass;
 jclass JniConstants::fieldClass;
 jclass JniConstants::fieldPositionIteratorClass;
-jclass JniConstants::multicastGroupRequestClass;
+jclass JniConstants::fileDescriptorClass;
 jclass JniConstants::inetAddressClass;
+jclass JniConstants::inetSocketAddressClass;
 jclass JniConstants::inflaterClass;
 jclass JniConstants::integerClass;
 jclass JniConstants::interfaceAddressClass;
 jclass JniConstants::localeDataClass;
 jclass JniConstants::longClass;
 jclass JniConstants::methodClass;
+jclass JniConstants::multicastGroupRequestClass;
+jclass JniConstants::mutableIntClass;
+jclass JniConstants::mutableLongClass;
 jclass JniConstants::parsePositionClass;
 jclass JniConstants::patternSyntaxExceptionClass;
 jclass JniConstants::realToStringClass;
 jclass JniConstants::socketClass;
 jclass JniConstants::socketImplClass;
+jclass JniConstants::stringArrayClass;
 jclass JniConstants::stringClass;
+jclass JniConstants::structFlockClass;
+jclass JniConstants::structLingerClass;
+jclass JniConstants::structStatClass;
+jclass JniConstants::structStatFsClass;
+jclass JniConstants::structTimevalClass;
+jclass JniConstants::structUtsnameClass;
 
 static jclass findClass(JNIEnv* env, const char* name) {
     jclass result = reinterpret_cast<jclass>(env->NewGlobalRef(env->FindClass(name)));
@@ -55,19 +67,22 @@
 }
 
 void JniConstants::init(JNIEnv* env) {
-    bidiRunClass = findClass(env, "org/apache/harmony/text/BidiRun");
+    bidiRunClass = findClass(env, "java/text/Bidi$Run");
     bigDecimalClass = findClass(env, "java/math/BigDecimal");
     booleanClass = findClass(env, "java/lang/Boolean");
     byteClass = findClass(env, "java/lang/Byte");
     byteArrayClass = findClass(env, "[B");
-    charsetICUClass = findClass(env, "libcore/icu/CharsetICU");
+    charsetICUClass = findClass(env, "java/nio/charset/CharsetICU");
     constructorClass = findClass(env, "java/lang/reflect/Constructor");
     datagramPacketClass = findClass(env, "java/net/DatagramPacket");
     deflaterClass = findClass(env, "java/util/zip/Deflater");
     doubleClass = findClass(env, "java/lang/Double");
+    errnoExceptionClass = findClass(env, "libcore/io/ErrnoException");
     fieldClass = findClass(env, "java/lang/reflect/Field");
     fieldPositionIteratorClass = findClass(env, "libcore/icu/NativeDecimalFormat$FieldPositionIterator");
+    fileDescriptorClass = findClass(env, "java/io/FileDescriptor");
     inetAddressClass = findClass(env, "java/net/InetAddress");
+    inetSocketAddressClass = findClass(env, "java/net/InetSocketAddress");
     inflaterClass = findClass(env, "java/util/zip/Inflater");
     integerClass = findClass(env, "java/lang/Integer");
     interfaceAddressClass = findClass(env, "java/net/InterfaceAddress");
@@ -75,10 +90,19 @@
     longClass = findClass(env, "java/lang/Long");
     methodClass = findClass(env, "java/lang/reflect/Method");
     multicastGroupRequestClass = findClass(env, "java/net/MulticastGroupRequest");
+    mutableIntClass = findClass(env, "libcore/util/MutableInt");
+    mutableLongClass = findClass(env, "libcore/util/MutableLong");
     parsePositionClass = findClass(env, "java/text/ParsePosition");
     patternSyntaxExceptionClass = findClass(env, "java/util/regex/PatternSyntaxException");
     realToStringClass = findClass(env, "java/lang/RealToString");
     socketClass = findClass(env, "java/net/Socket");
     socketImplClass = findClass(env, "java/net/SocketImpl");
+    stringArrayClass = findClass(env, "[Ljava/lang/String;");
     stringClass = findClass(env, "java/lang/String");
+    structFlockClass = findClass(env, "libcore/io/StructFlock");
+    structLingerClass = findClass(env, "libcore/io/StructLinger");
+    structStatClass = findClass(env, "libcore/io/StructStat");
+    structStatFsClass = findClass(env, "libcore/io/StructStatFs");
+    structTimevalClass = findClass(env, "libcore/io/StructTimeval");
+    structUtsnameClass = findClass(env, "libcore/io/StructUtsname");
 }
diff --git a/luni/src/main/native/JniConstants.h b/luni/src/main/native/JniConstants.h
index 576b1a6..2cc41a7 100644
--- a/luni/src/main/native/JniConstants.h
+++ b/luni/src/main/native/JniConstants.h
@@ -43,16 +43,19 @@
     static jclass bidiRunClass;
     static jclass bigDecimalClass;
     static jclass booleanClass;
-    static jclass byteClass;
     static jclass byteArrayClass;
+    static jclass byteClass;
     static jclass charsetICUClass;
     static jclass constructorClass;
     static jclass datagramPacketClass;
     static jclass deflaterClass;
     static jclass doubleClass;
+    static jclass errnoExceptionClass;
     static jclass fieldClass;
     static jclass fieldPositionIteratorClass;
+    static jclass fileDescriptorClass;
     static jclass inetAddressClass;
+    static jclass inetSocketAddressClass;
     static jclass inflaterClass;
     static jclass integerClass;
     static jclass interfaceAddressClass;
@@ -60,12 +63,21 @@
     static jclass longClass;
     static jclass methodClass;
     static jclass multicastGroupRequestClass;
+    static jclass mutableIntClass;
+    static jclass mutableLongClass;
     static jclass parsePositionClass;
     static jclass patternSyntaxExceptionClass;
     static jclass realToStringClass;
     static jclass socketClass;
     static jclass socketImplClass;
+    static jclass stringArrayClass;
     static jclass stringClass;
+    static jclass structFlockClass;
+    static jclass structLingerClass;
+    static jclass structStatClass;
+    static jclass structStatFsClass;
+    static jclass structTimevalClass;
+    static jclass structUtsnameClass;
 };
 
 #define NATIVE_METHOD(className, functionName, signature) \
diff --git a/luni/src/main/native/NetworkUtilities.cpp b/luni/src/main/native/NetworkUtilities.cpp
index 23c1edf..2257287 100644
--- a/luni/src/main/native/NetworkUtilities.cpp
+++ b/luni/src/main/native/NetworkUtilities.cpp
@@ -60,15 +60,15 @@
     return true;
 }
 
-jbyteArray socketAddressToByteArray(JNIEnv* env, sockaddr_storage* ss) {
-    void* rawAddress;
+jbyteArray socketAddressToByteArray(JNIEnv* env, const sockaddr_storage* ss) {
+    const void* rawAddress;
     size_t addressLength;
     if (ss->ss_family == AF_INET) {
-        sockaddr_in* sin = reinterpret_cast<sockaddr_in*>(ss);
+        const sockaddr_in* sin = reinterpret_cast<const sockaddr_in*>(ss);
         rawAddress = &sin->sin_addr.s_addr;
         addressLength = 4;
     } else if (ss->ss_family == AF_INET6) {
-        sockaddr_in6* sin6 = reinterpret_cast<sockaddr_in6*>(ss);
+        const sockaddr_in6* sin6 = reinterpret_cast<const sockaddr_in6*>(ss);
         rawAddress = &sin6->sin6_addr.s6_addr;
         addressLength = 16;
     } else {
@@ -85,7 +85,7 @@
     if (byteArray == NULL) {
         return NULL;
     }
-    env->SetByteArrayRegion(byteArray, 0, addressLength, reinterpret_cast<jbyte*>(rawAddress));
+    env->SetByteArrayRegion(byteArray, 0, addressLength, reinterpret_cast<const jbyte*>(rawAddress));
     return byteArray;
 }
 
@@ -101,11 +101,22 @@
     return env->CallStaticObjectMethod(JniConstants::inetAddressClass, getByAddressMethod, byteArray);
 }
 
-jobject socketAddressToInetAddress(JNIEnv* env, sockaddr_storage* ss) {
+jobject socketAddressToInetAddress(JNIEnv* env, const sockaddr_storage* ss) {
     jbyteArray byteArray = socketAddressToByteArray(env, ss);
     return byteArrayToInetAddress(env, byteArray);
 }
 
+bool inetAddressToSocketAddress(JNIEnv* env, jobject inetAddress, int port, sockaddr_storage* ss) {
+    // Get the byte array that stores the IP address bytes in the InetAddress.
+    if (inetAddress == NULL) {
+        jniThrowNullPointerException(env, NULL);
+        return false;
+    }
+    static jfieldID fid = env->GetFieldID(JniConstants::inetAddressClass, "ipaddress", "[B");
+    jbyteArray addressBytes = reinterpret_cast<jbyteArray>(env->GetObjectField(inetAddress, fid));
+    return byteArrayToSocketAddress(env, NULL, addressBytes, port, ss);
+}
+
 bool setBlocking(int fd, bool blocking) {
     int flags = fcntl(fd, F_GETFL);
     if (flags == -1) {
diff --git a/luni/src/main/native/NetworkUtilities.h b/luni/src/main/native/NetworkUtilities.h
index 76e622e..a3438c8 100644
--- a/luni/src/main/native/NetworkUtilities.h
+++ b/luni/src/main/native/NetworkUtilities.h
@@ -25,11 +25,13 @@
 bool byteArrayToSocketAddress(JNIEnv* env, jclass, jbyteArray byteArray, int port, sockaddr_storage* ss);
 
 // Convert from sockaddr_storage to byte[].
-jbyteArray socketAddressToByteArray(JNIEnv* env, sockaddr_storage* ss);
+jbyteArray socketAddressToByteArray(JNIEnv* env, const sockaddr_storage* ss);
 
 // Convert from sockaddr_storage to InetAddress.
-jobject socketAddressToInetAddress(JNIEnv* env, sockaddr_storage* ss);
+jobject socketAddressToInetAddress(JNIEnv* env, const sockaddr_storage* ss);
 
+// Convert from InetAddress to sockaddr_storage.
+bool inetAddressToSocketAddress(JNIEnv* env, jobject inetAddress, int port, sockaddr_storage* ss);
 
 
 // Changes 'fd' to be blocking/non-blocking. Returns false and sets errno on failure.
diff --git a/luni/src/main/native/Register.cpp b/luni/src/main/native/Register.cpp
index a6e49dc..0b7b1ff 100644
--- a/luni/src/main/native/Register.cpp
+++ b/luni/src/main/native/Register.cpp
@@ -21,17 +21,10 @@
 
 #include <stdlib.h>
 
-namespace android {
-    extern int register_dalvik_system_TouchDex(JNIEnv* env);
-}
-
 extern int register_java_io_Console(JNIEnv* env);
 extern int register_java_io_File(JNIEnv* env);
-extern int register_java_io_FileDescriptor(JNIEnv* env);
 extern int register_java_io_ObjectStreamClass(JNIEnv* env);
 extern int register_java_lang_Character(JNIEnv* env);
-extern int register_java_lang_Double(JNIEnv* env);
-extern int register_java_lang_Float(JNIEnv* env);
 extern int register_java_lang_Math(JNIEnv* env);
 extern int register_java_lang_ProcessManager(JNIEnv* env);
 extern int register_java_lang_RealToString(JNIEnv* env);
@@ -42,6 +35,7 @@
 extern int register_java_net_NetworkInterface(JNIEnv* env);
 extern int register_java_nio_ByteOrder(JNIEnv* env);
 extern int register_java_nio_charset_Charsets(JNIEnv* env);
+extern int register_java_text_Bidi(JNIEnv* env);
 extern int register_java_util_regex_Matcher(JNIEnv* env);
 extern int register_java_util_regex_Pattern(JNIEnv* env);
 extern int register_java_util_zip_Adler32(JNIEnv* env);
@@ -57,14 +51,13 @@
 extern int register_libcore_icu_NativeNormalizer(JNIEnv* env);
 extern int register_libcore_icu_NativePluralRules(JNIEnv* env);
 extern int register_libcore_icu_TimeZones(JNIEnv* env);
-extern int register_libcore_io_IoUtils(JNIEnv* env);
+extern int register_libcore_io_Memory(JNIEnv* env);
+extern int register_libcore_io_OsConstants(JNIEnv* env);
+extern int register_libcore_io_Posix(JNIEnv* env);
 extern int register_libcore_net_RawSocket(JNIEnv* env);
 extern int register_org_apache_harmony_dalvik_NativeTestTarget(JNIEnv* env);
-extern int register_org_apache_harmony_luni_platform_OSFileSystem(JNIEnv* env);
-extern int register_org_apache_harmony_luni_platform_OSMemory(JNIEnv* env);
 extern int register_org_apache_harmony_luni_platform_OSNetworkSystem(JNIEnv* env);
 extern int register_org_apache_harmony_luni_util_fltparse(JNIEnv* env);
-extern int register_org_apache_harmony_text_NativeBidi(JNIEnv* env);
 extern int register_org_apache_harmony_xml_ExpatParser(JNIEnv* env);
 extern int register_org_apache_harmony_xnet_provider_jsse_NativeCrypto(JNIEnv* env);
 
@@ -77,11 +70,8 @@
     bool result =
             register_java_io_Console(env) != -1 &&
             register_java_io_File(env) != -1 &&
-            register_java_io_FileDescriptor(env) != -1 &&
             register_java_io_ObjectStreamClass(env) != -1 &&
             register_java_lang_Character(env) != -1 &&
-            register_java_lang_Double(env) != -1 &&
-            register_java_lang_Float(env) != -1 &&
             register_java_lang_Math(env) != -1 &&
             register_java_lang_ProcessManager(env) != -1 &&
             register_java_lang_RealToString(env) != -1 &&
@@ -92,6 +82,7 @@
             register_java_net_NetworkInterface(env) != -1 &&
             register_java_nio_ByteOrder(env) != -1 &&
             register_java_nio_charset_Charsets(env) != -1 &&
+            register_java_text_Bidi(env) != -1 &&
             register_java_util_regex_Matcher(env) != -1 &&
             register_java_util_regex_Pattern(env) != -1 &&
             register_java_util_zip_Adler32(env) != -1 &&
@@ -107,18 +98,16 @@
             register_libcore_icu_NativeNormalizer(env) != -1 &&
             register_libcore_icu_NativePluralRules(env) != -1 &&
             register_libcore_icu_TimeZones(env) != -1 &&
-            register_libcore_io_IoUtils(env) != -1 &&
+            register_libcore_io_Memory(env) != -1 &&
+            register_libcore_io_OsConstants(env) != -1 &&
+            register_libcore_io_Posix(env) != -1 &&
             register_libcore_net_RawSocket(env) != -1 &&
-            register_org_apache_harmony_luni_platform_OSFileSystem(env) != -1 &&
-            register_org_apache_harmony_luni_platform_OSMemory(env) != -1 &&
+            register_org_apache_harmony_dalvik_NativeTestTarget(env) != -1 &&
             register_org_apache_harmony_luni_platform_OSNetworkSystem(env) != -1 &&
             register_org_apache_harmony_luni_util_fltparse(env) != -1 &&
-            register_org_apache_harmony_text_NativeBidi(env) != -1 &&
+            register_org_apache_harmony_xml_ExpatParser(env) != -1 &&
             register_org_apache_harmony_xnet_provider_jsse_NativeCrypto(env) != -1 &&
-            // Initialize the Android classes last, as they have dependencies on the "corer" core classes.
-            android::register_dalvik_system_TouchDex(env) != -1 &&
-            register_org_apache_harmony_dalvik_NativeTestTarget(env) != -1 &&
-            register_org_apache_harmony_xml_ExpatParser(env) != -1;
+            true;
 
     if (!result) {
         LOGE("Failed to initialize the core libraries; aborting...");
diff --git a/luni/src/main/native/TimeZones.cpp b/luni/src/main/native/TimeZones.cpp
deleted file mode 100644
index dbe351f..0000000
--- a/luni/src/main/native/TimeZones.cpp
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "TimeZones"
-
-#include "ErrorCode.h"
-#include "JNIHelp.h"
-#include "JniConstants.h"
-#include "ScopedJavaUnicodeString.h"
-#include "ScopedLocalRef.h"
-#include "ScopedUtfChars.h"
-#include "UniquePtr.h"
-#include "unicode/smpdtfmt.h"
-#include "unicode/timezone.h"
-
-extern Locale getLocale(JNIEnv* env, jstring localeName);
-
-static jstring formatDate(JNIEnv* env, const SimpleDateFormat& fmt, const UDate& when) {
-    UnicodeString str;
-    fmt.format(when, str);
-    return env->NewString(str.getBuffer(), str.length());
-}
-
-static TimeZone* timeZoneFromId(JNIEnv* env, jstring javaZoneId) {
-    ScopedJavaUnicodeString zoneID(env, javaZoneId);
-    return TimeZone::createTimeZone(zoneID.unicodeString());
-}
-
-static jobjectArray TimeZones_forCountryCode(JNIEnv* env, jclass, jstring countryCode) {
-    ScopedUtfChars countryChars(env, countryCode);
-    if (countryChars.c_str() == NULL) {
-        return NULL;
-    }
-
-    UniquePtr<StringEnumeration> ids(TimeZone::createEnumeration(countryChars.c_str()));
-    if (ids.get() == NULL) {
-        return NULL;
-    }
-    UErrorCode status = U_ZERO_ERROR;
-    int32_t idCount = ids->count(status);
-    if (U_FAILURE(status)) {
-        icu4jni_error(env, status);
-        return NULL;
-    }
-
-    jobjectArray result = env->NewObjectArray(idCount, JniConstants::stringClass, NULL);
-    for (int32_t i = 0; i < idCount; ++i) {
-        const UnicodeString* id = ids->snext(status);
-        if (U_FAILURE(status)) {
-            icu4jni_error(env, status);
-            return NULL;
-        }
-        ScopedLocalRef<jstring> idString(env, env->NewString(id->getBuffer(), id->length()));
-        env->SetObjectArrayElement(result, i, idString.get());
-    }
-    return result;
-}
-
-static jstring TimeZones_getDisplayNameImpl(JNIEnv* env, jclass, jstring zoneId, jboolean isDST, jint style, jstring localeId) {
-    UniquePtr<TimeZone> zone(timeZoneFromId(env, zoneId));
-    Locale locale = getLocale(env, localeId);
-    // Try to get the display name of the TimeZone according to the Locale
-    UnicodeString displayName;
-    zone->getDisplayName((UBool)isDST, (style == 0 ? TimeZone::SHORT : TimeZone::LONG), locale, displayName);
-    return env->NewString(displayName.getBuffer(), displayName.length());
-}
-
-static void TimeZones_getZoneStringsImpl(JNIEnv* env, jclass, jobjectArray outerArray, jstring localeName) {
-    Locale locale = getLocale(env, localeName);
-
-    // We could use TimeZone::getDisplayName, but that's way too slow.
-    // The cost of this method goes from 0.5s to 4.5s on a Nexus One.
-    // Much of the saving comes from caching SimpleDateFormat instances.
-    UErrorCode status = U_ZERO_ERROR;
-    UnicodeString longPattern("zzzz", "");
-    SimpleDateFormat longFormat(longPattern, locale, status);
-    UnicodeString shortPattern("z", "");
-    SimpleDateFormat shortFormat(shortPattern, locale, status);
-
-    jobjectArray longStdArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 1);
-    jobjectArray shortStdArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 2);
-    jobjectArray longDstArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 3);
-    jobjectArray shortDstArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 4);
-
-    // 15th January 2008
-    UDate date1 = 1203105600000.0;
-    // 15th July 2008
-    UDate date2 = 1218826800000.0;
-
-    jobjectArray zoneIds = (jobjectArray) env->GetObjectArrayElement(outerArray, 0);
-    int zoneIdCount = env->GetArrayLength(zoneIds);
-    for (int i = 0; i < zoneIdCount; ++i) {
-        ScopedLocalRef<jstring> id(env, reinterpret_cast<jstring>(env->GetObjectArrayElement(zoneIds, i)));
-        UniquePtr<TimeZone> tz(timeZoneFromId(env, id.get()));
-
-        longFormat.setTimeZone(*tz);
-        shortFormat.setTimeZone(*tz);
-
-        int32_t daylightOffset;
-        int32_t rawOffset;
-        tz->getOffset(date1, false, rawOffset, daylightOffset, status);
-        UDate standardDate;
-        UDate daylightSavingDate;
-        if (daylightOffset != 0) {
-            // The Timezone is reporting that we are in daylight time
-            // for the winter date.  The dates are for the wrong hemisphere,
-            // swap them.
-            standardDate = date2;
-            daylightSavingDate = date1;
-        } else {
-            standardDate = date1;
-            daylightSavingDate = date2;
-        }
-
-        ScopedLocalRef<jstring> shortStd(env, formatDate(env, shortFormat, standardDate));
-        env->SetObjectArrayElement(shortStdArray, i, shortStd.get());
-
-        ScopedLocalRef<jstring> longStd(env, formatDate(env, longFormat, standardDate));
-        env->SetObjectArrayElement(longStdArray, i, longStd.get());
-
-        if (tz->useDaylightTime()) {
-            ScopedLocalRef<jstring> shortDst(env, formatDate(env, shortFormat, daylightSavingDate));
-            env->SetObjectArrayElement(shortDstArray, i, shortDst.get());
-
-            ScopedLocalRef<jstring> longDst(env, formatDate(env, longFormat, daylightSavingDate));
-            env->SetObjectArrayElement(longDstArray, i, longDst.get());
-        } else {
-            env->SetObjectArrayElement(shortDstArray, i, shortStd.get());
-            env->SetObjectArrayElement(longDstArray, i, longStd.get());
-        }
-    }
-}
-
-static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(TimeZones, getDisplayNameImpl, "(Ljava/lang/String;ZILjava/lang/String;)Ljava/lang/String;"),
-    NATIVE_METHOD(TimeZones, forCountryCode, "(Ljava/lang/String;)[Ljava/lang/String;"),
-    NATIVE_METHOD(TimeZones, getZoneStringsImpl, "([[Ljava/lang/String;Ljava/lang/String;)V"),
-};
-int register_libcore_icu_TimeZones(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "libcore/icu/TimeZones", gMethods, NELEM(gMethods));
-}
diff --git a/luni/src/main/native/java_io_Console.cpp b/luni/src/main/native/java_io_Console.cpp
index 7af5204..9150fb7 100644
--- a/luni/src/main/native/java_io_Console.cpp
+++ b/luni/src/main/native/java_io_Console.cpp
@@ -24,10 +24,6 @@
 #include <termios.h>
 #include <unistd.h>
 
-static jboolean Console_isatty(JNIEnv*, jclass, jint fd) {
-    return TEMP_FAILURE_RETRY(isatty(fd));
-}
-
 static jint Console_setEchoImpl(JNIEnv* env, jclass, jboolean on, jint previousState) {
     termios state;
     if (TEMP_FAILURE_RETRY(tcgetattr(STDIN_FILENO, &state)) == -1) {
@@ -48,7 +44,6 @@
 }
 
 static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(Console, isatty, "(I)Z"),
     NATIVE_METHOD(Console, setEchoImpl, "(ZI)I"),
 };
 int register_java_io_Console(JNIEnv* env) {
diff --git a/luni/src/main/native/java_io_File.cpp b/luni/src/main/native/java_io_File.cpp
index 3004fc4..20cbb7e 100644
--- a/luni/src/main/native/java_io_File.cpp
+++ b/luni/src/main/native/java_io_File.cpp
@@ -19,15 +19,15 @@
 
 #include "JNIHelp.h"
 #include "JniConstants.h"
-#include "LocalArray.h"
+#include "JniException.h"
 #include "ScopedFd.h"
-#include "ScopedLocalRef.h"
 #include "ScopedPrimitiveArray.h"
 #include "ScopedUtfChars.h"
-#include "StaticAssert.h"
 #include "readlink.h"
+#include "toStringArray.h"
 
 #include <string>
+#include <vector>
 
 #include <dirent.h>
 #include <errno.h>
@@ -41,73 +41,6 @@
 #include <unistd.h>
 #include <utime.h>
 
-static jboolean File_deleteImpl(JNIEnv* env, jclass, jstring javaPath) {
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-    return (remove(path.c_str()) == 0);
-}
-
-static bool doStat(JNIEnv* env, jstring javaPath, struct stat& sb) {
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-    return (stat(path.c_str(), &sb) == 0);
-}
-
-static jlong File_lengthImpl(JNIEnv* env, jclass, jstring javaPath) {
-    struct stat sb;
-    if (!doStat(env, javaPath, sb)) {
-        // The RI returns 0 on error. (Even for errors like EACCES or ELOOP.)
-        return 0;
-    }
-    return sb.st_size;
-}
-
-static jlong File_lastModifiedImpl(JNIEnv* env, jclass, jstring javaPath) {
-    struct stat sb;
-    if (!doStat(env, javaPath, sb)) {
-        return 0;
-    }
-    return static_cast<jlong>(sb.st_mtime) * 1000L;
-}
-
-static jboolean File_isDirectoryImpl(JNIEnv* env, jclass, jstring javaPath) {
-    struct stat sb;
-    return (doStat(env, javaPath, sb) && S_ISDIR(sb.st_mode));
-}
-
-static jboolean File_isFileImpl(JNIEnv* env, jclass, jstring javaPath) {
-    struct stat sb;
-    return (doStat(env, javaPath, sb) && S_ISREG(sb.st_mode));
-}
-
-static jboolean doAccess(JNIEnv* env, jstring javaPath, int mode) {
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-    return (access(path.c_str(), mode) == 0);
-}
-
-static jboolean File_existsImpl(JNIEnv* env, jclass, jstring javaPath) {
-    return doAccess(env, javaPath, F_OK);
-}
-
-static jboolean File_canExecuteImpl(JNIEnv* env, jclass, jstring javaPath) {
-    return doAccess(env, javaPath, X_OK);
-}
-
-static jboolean File_canReadImpl(JNIEnv* env, jclass, jstring javaPath) {
-    return doAccess(env, javaPath, R_OK);
-}
-
-static jboolean File_canWriteImpl(JNIEnv* env, jclass, jstring javaPath) {
-    return doAccess(env, javaPath, W_OK);
-}
-
 static jstring File_readlink(JNIEnv* env, jclass, jstring javaPath) {
     ScopedUtfChars path(env, javaPath);
     if (path.c_str() == NULL) {
@@ -156,72 +89,6 @@
     return (utime(path.c_str(), &times) == 0);
 }
 
-static jboolean doChmod(JNIEnv* env, jstring javaPath, mode_t mask, bool set) {
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-
-    struct stat sb;
-    if (stat(path.c_str(), &sb) == -1) {
-        return JNI_FALSE;
-    }
-    mode_t newMode = set ? (sb.st_mode | mask) : (sb.st_mode & ~mask);
-    return (chmod(path.c_str(), newMode) == 0);
-}
-
-static jboolean File_setExecutableImpl(JNIEnv* env, jclass, jstring javaPath,
-        jboolean set, jboolean ownerOnly) {
-    return doChmod(env, javaPath, ownerOnly ? S_IXUSR : (S_IXUSR | S_IXGRP | S_IXOTH), set);
-}
-
-static jboolean File_setReadableImpl(JNIEnv* env, jclass, jstring javaPath,
-        jboolean set, jboolean ownerOnly) {
-    return doChmod(env, javaPath, ownerOnly ? S_IRUSR : (S_IRUSR | S_IRGRP | S_IROTH), set);
-}
-
-static jboolean File_setWritableImpl(JNIEnv* env, jclass, jstring javaPath,
-        jboolean set, jboolean ownerOnly) {
-    return doChmod(env, javaPath, ownerOnly ? S_IWUSR : (S_IWUSR | S_IWGRP | S_IWOTH), set);
-}
-
-static bool doStatFs(JNIEnv* env, jstring javaPath, struct statfs& sb) {
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-
-    int rc = statfs(path.c_str(), &sb);
-    return (rc != -1);
-}
-
-static jlong File_getFreeSpaceImpl(JNIEnv* env, jclass, jstring javaPath) {
-    struct statfs sb;
-    if (!doStatFs(env, javaPath, sb)) {
-        return 0;
-    }
-    STATIC_ASSERT(sizeof(sb.f_bfree) == sizeof(jlong), statfs_not_64_bit);
-    return sb.f_bfree * sb.f_bsize; // free block count * block size in bytes.
-}
-
-static jlong File_getTotalSpaceImpl(JNIEnv* env, jclass, jstring javaPath) {
-    struct statfs sb;
-    if (!doStatFs(env, javaPath, sb)) {
-        return 0;
-    }
-    STATIC_ASSERT(sizeof(sb.f_blocks) == sizeof(jlong), statfs_not_64_bit);
-    return sb.f_blocks * sb.f_bsize; // total block count * block size in bytes.
-}
-
-static jlong File_getUsableSpaceImpl(JNIEnv* env, jclass, jstring javaPath) {
-    struct statfs sb;
-    if (!doStatFs(env, javaPath, sb)) {
-        return 0;
-    }
-    STATIC_ASSERT(sizeof(sb.f_bavail) == sizeof(jlong), statfs_not_64_bit);
-    return sb.f_bavail * sb.f_bsize; // non-root free block count * block size in bytes.
-}
-
 // Iterates over the filenames in the given directory.
 class ScopedReaddir {
 public:
@@ -262,66 +129,7 @@
     void operator=(const ScopedReaddir&);
 };
 
-// DirEntry and DirEntries is a minimal equivalent of std::forward_list
-// for the filenames.
-struct DirEntry {
-    DirEntry(const char* filename) : name(strlen(filename)) {
-        strcpy(&name[0], filename);
-        next = NULL;
-    }
-    // On Linux, the ext family all limit the length of a directory entry to
-    // less than 256 characters.
-    LocalArray<256> name;
-    DirEntry* next;
-};
-
-class DirEntries {
-public:
-    DirEntries() : mSize(0), mHead(NULL) {
-    }
-
-    ~DirEntries() {
-        while (mHead) {
-            pop_front();
-        }
-    }
-
-    bool push_front(const char* name) {
-        DirEntry* oldHead = mHead;
-        mHead = new DirEntry(name);
-        if (mHead == NULL) {
-            return false;
-        }
-        mHead->next = oldHead;
-        ++mSize;
-        return true;
-    }
-
-    const char* front() const {
-        return &mHead->name[0];
-    }
-
-    void pop_front() {
-        DirEntry* popped = mHead;
-        if (popped != NULL) {
-            mHead = popped->next;
-            --mSize;
-            delete popped;
-        }
-    }
-
-    size_t size() const {
-        return mSize;
-    }
-
-private:
-    size_t mSize;
-    DirEntry* mHead;
-
-    // Disallow copy and assignment.
-    DirEntries(const DirEntries&);
-    void operator=(const DirEntries&);
-};
+typedef std::vector<std::string> DirEntries;
 
 // Reads the directory referred to by 'pathBytes', adding each directory entry
 // to 'entries'.
@@ -338,10 +146,8 @@
     const char* filename;
     while ((filename = dir.next()) != NULL) {
         if (strcmp(filename, ".") != 0 && strcmp(filename, "..") != 0) {
-            if (!entries.push_front(filename)) {
-                jniThrowException(env, "java/lang/OutOfMemoryError", NULL);
-                return false;
-            }
+            // TODO: this hides allocation failures from us. Push directory iteration up into Java?
+            entries.push_back(filename);
         }
     }
     return true;
@@ -349,109 +155,19 @@
 
 static jobjectArray File_listImpl(JNIEnv* env, jclass, jstring javaPath) {
     // Read the directory entries into an intermediate form.
-    DirEntries files;
-    if (!readDirectory(env, javaPath, files)) {
+    DirEntries entries;
+    if (!readDirectory(env, javaPath, entries)) {
         return NULL;
     }
     // Translate the intermediate form into a Java String[].
-    jobjectArray result = env->NewObjectArray(files.size(), JniConstants::stringClass, NULL);
-    for (int i = 0; files.size() != 0; files.pop_front(), ++i) {
-        ScopedLocalRef<jstring> javaFilename(env, env->NewStringUTF(files.front()));
-        if (env->ExceptionCheck()) {
-            return NULL;
-        }
-        env->SetObjectArrayElement(result, i, javaFilename.get());
-        if (env->ExceptionCheck()) {
-            return NULL;
-        }
-    }
-    return result;
-}
-
-static jboolean File_mkdirImpl(JNIEnv* env, jclass, jstring javaPath) {
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-
-    // On Android, we don't want default permissions to allow global access.
-    return (mkdir(path.c_str(), S_IRWXU) == 0);
-}
-
-static jboolean File_createNewFileImpl(JNIEnv* env, jclass, jstring javaPath) {
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-
-    // On Android, we don't want default permissions to allow global access.
-    ScopedFd fd(open(path.c_str(), O_CREAT | O_EXCL, 0600));
-    if (fd.get() != -1) {
-        // We created a new file. Success!
-        return JNI_TRUE;
-    }
-    if (errno == EEXIST) {
-        // The file already exists.
-        return JNI_FALSE;
-    }
-    jniThrowIOException(env, errno);
-    return JNI_FALSE; // Ignored by Java; keeps the C++ compiler happy.
-}
-
-static jboolean File_renameToImpl(JNIEnv* env, jclass, jstring javaOldPath, jstring javaNewPath) {
-    ScopedUtfChars oldPath(env, javaOldPath);
-    if (oldPath.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-
-    ScopedUtfChars newPath(env, javaNewPath);
-    if (newPath.c_str() == NULL) {
-        return JNI_FALSE;
-    }
-
-    return (rename(oldPath.c_str(), newPath.c_str()) == 0);
-}
-
-static void File_symlink(JNIEnv* env, jclass, jstring javaOldPath, jstring javaNewPath) {
-    ScopedUtfChars oldPath(env, javaOldPath);
-    if (oldPath.c_str() == NULL) {
-        return;
-    }
-
-    ScopedUtfChars newPath(env, javaNewPath);
-    if (newPath.c_str() == NULL) {
-        return;
-    }
-
-    if (symlink(oldPath.c_str(), newPath.c_str()) == -1) {
-        jniThrowIOException(env, errno);
-    }
+    return toStringArray(env, entries);
 }
 
 static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(File, canExecuteImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, canReadImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, canWriteImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, createNewFileImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, deleteImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, existsImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, getFreeSpaceImpl, "(Ljava/lang/String;)J"),
-    NATIVE_METHOD(File, getTotalSpaceImpl, "(Ljava/lang/String;)J"),
-    NATIVE_METHOD(File, getUsableSpaceImpl, "(Ljava/lang/String;)J"),
-    NATIVE_METHOD(File, isDirectoryImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, isFileImpl, "(Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, lastModifiedImpl, "(Ljava/lang/String;)J"),
-    NATIVE_METHOD(File, lengthImpl, "(Ljava/lang/String;)J"),
     NATIVE_METHOD(File, listImpl, "(Ljava/lang/String;)[Ljava/lang/String;"),
-    NATIVE_METHOD(File, mkdirImpl, "(Ljava/lang/String;)Z"),
     NATIVE_METHOD(File, readlink, "(Ljava/lang/String;)Ljava/lang/String;"),
     NATIVE_METHOD(File, realpath, "(Ljava/lang/String;)Ljava/lang/String;"),
-    NATIVE_METHOD(File, renameToImpl, "(Ljava/lang/String;Ljava/lang/String;)Z"),
-    NATIVE_METHOD(File, setExecutableImpl, "(Ljava/lang/String;ZZ)Z"),
     NATIVE_METHOD(File, setLastModifiedImpl, "(Ljava/lang/String;J)Z"),
-    NATIVE_METHOD(File, setReadableImpl, "(Ljava/lang/String;ZZ)Z"),
-    NATIVE_METHOD(File, setWritableImpl, "(Ljava/lang/String;ZZ)Z"),
-    NATIVE_METHOD(File, symlink, "(Ljava/lang/String;Ljava/lang/String;)V"),
 };
 int register_java_io_File(JNIEnv* env) {
     return jniRegisterNativeMethods(env, "java/io/File", gMethods, NELEM(gMethods));
diff --git a/luni/src/main/native/java_io_FileDescriptor.cpp b/luni/src/main/native/java_io_FileDescriptor.cpp
deleted file mode 100644
index c70f905..0000000
--- a/luni/src/main/native/java_io_FileDescriptor.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-#define LOG_TAG "FileDescriptor"
-
-#include "JNIHelp.h"
-#include "JniConstants.h"
-
-#include <errno.h>
-#include <unistd.h>
-
-static void FileDescriptor_syncImpl(JNIEnv* env, jobject obj) {
-    int fd = jniGetFDFromFileDescriptor(env, obj);
-    int rc = fsync(fd);
-    if (rc == -1) {
-        /*
-         * If fd is a socket, then fsync(fd) is defined to fail with
-         * errno EINVAL. This isn't actually cause for concern.
-         * TODO: Look into not bothering to call fsync() at all if
-         * we know we are dealing with a socket.
-         */
-        if (errno != EINVAL) {
-            char buf[BUFSIZ];
-            jniThrowException(env, "java/io/SyncFailedException",
-                    jniStrError(errno, buf, sizeof(buf)));
-        }
-    }
-}
-
-static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(FileDescriptor, syncImpl, "()V"),
-};
-int register_java_io_FileDescriptor(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "java/io/FileDescriptor", gMethods, NELEM(gMethods));
-}
diff --git a/luni/src/main/native/java_lang_Character.cpp b/luni/src/main/native/java_lang_Character.cpp
index 66860e8..a20c0e7 100644
--- a/luni/src/main/native/java_lang_Character.cpp
+++ b/luni/src/main/native/java_lang_Character.cpp
@@ -39,6 +39,20 @@
     return u_isMirrored(codePoint);
 }
 
+static jstring Character_getNameImpl(JNIEnv* env, jclass, jint codePoint) {
+    // U_UNICODE_CHAR_NAME gives us the modern names for characters. For control characters,
+    // we need U_EXTENDED_CHAR_NAME to get "NULL" rather than "BASIC LATIN 0" and so on.
+    // We could just use U_EXTENDED_CHAR_NAME except that it returns strings for characters
+    // that aren't unassigned but that don't have names, and those strings aren't in the form
+    // Java specifies.
+    bool isControl = (codePoint <= 0x1f || (codePoint >= 0x7f && codePoint <= 0x9f));
+    UCharNameChoice nameType = isControl ? U_EXTENDED_CHAR_NAME : U_UNICODE_CHAR_NAME;
+    UErrorCode status = U_ZERO_ERROR;
+    char buf[BUFSIZ]; // TODO: is there a more sensible upper bound?
+    int32_t byteCount = u_charName(codePoint, nameType, &buf[0], sizeof(buf), &status);
+    return (U_FAILURE(status) || byteCount == 0) ? NULL : env->NewStringUTF(buf);
+}
+
 static jint Character_getNumericValueImpl(JNIEnv*, jclass, jint codePoint) {
     double result = u_getNumericValue(codePoint);
     if (result == U_NO_NUMERIC_VALUE) {
@@ -125,6 +139,7 @@
     NATIVE_METHOD(Character, digitImpl, "(II)I"),
     NATIVE_METHOD(Character, forNameImpl, "(Ljava/lang/String;)I"),
     NATIVE_METHOD(Character, getDirectionalityImpl, "(I)B"),
+    NATIVE_METHOD(Character, getNameImpl, "(I)Ljava/lang/String;"),
     NATIVE_METHOD(Character, getNumericValueImpl, "(I)I"),
     NATIVE_METHOD(Character, getTypeImpl, "(I)I"),
     NATIVE_METHOD(Character, isDefinedImpl, "(I)Z"),
diff --git a/luni/src/main/native/java_lang_Double.cpp b/luni/src/main/native/java_lang_Double.cpp
deleted file mode 100644
index f8b6be8..0000000
--- a/luni/src/main/native/java_lang_Double.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2005 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Double"
-
-#include "JNIHelp.h"
-#include "JniConstants.h"
-#include "java_lang_Double.h"
-
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-static const jlong NaN = 0x7ff8000000000000ULL;
-
-static jlong Double_doubleToLongBits(JNIEnv*, jclass, jdouble doubleValue) {
-    //  For this method all values in the NaN range are normalized to the canonical NaN value.
-    return isnan(doubleValue) ? NaN : Double::doubleToRawLongBits(doubleValue);
-}
-
-static jlong Double_doubleToRawLongBits(JNIEnv*, jclass, jdouble doubleValue) {
-    return Double::doubleToRawLongBits(doubleValue);
-}
-
-static jdouble Double_longBitsToDouble(JNIEnv*, jclass, jlong bits) {
-    return Double::longBitsToDouble(bits);
-}
-
-static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(Double, doubleToLongBits, "(D)J"),
-    NATIVE_METHOD(Double, doubleToRawLongBits, "(D)J"),
-    NATIVE_METHOD(Double, longBitsToDouble, "(J)D"),
-};
-int register_java_lang_Double(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "java/lang/Double", gMethods, NELEM(gMethods));
-}
diff --git a/luni/src/main/native/java_lang_Double.h b/luni/src/main/native/java_lang_Double.h
deleted file mode 100644
index 2f63c0d..0000000
--- a/luni/src/main/native/java_lang_Double.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JAVA_LANG_DOUBLE_H_included
-#define JAVA_LANG_DOUBLE_H_included
-
-#include <stdint.h>
-
-union Double {
-public:
-    static inline double longBitsToDouble(uint64_t bits) {
-        Double result;
-        result.bits = bits;
-        return result.doubleValue;
-    }
-
-    static inline uint64_t doubleToRawLongBits(double doubleValue) {
-        Double result;
-        result.doubleValue = doubleValue;
-        return result.bits;
-    }
-
-private:
-    uint64_t bits;
-    double doubleValue;
-};
-
-#endif  // JAVA_LANG_DOUBLE_H_included
diff --git a/luni/src/main/native/java_lang_Float.cpp b/luni/src/main/native/java_lang_Float.cpp
deleted file mode 100644
index 93384df..0000000
--- a/luni/src/main/native/java_lang_Float.cpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2005 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "Float"
-
-#include "JNIHelp.h"
-#include "JniConstants.h"
-#include "java_lang_Float.h"
-
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-static const jint NaN = 0x7fc00000;
-
-static jint Float_floatToIntBits(JNIEnv*, jclass, jfloat floatValue) {
-    //  For this method all values in the NaN range are normalized to the canonical NaN value.
-    return isnanf(floatValue) ? NaN : Float::floatToRawIntBits(floatValue);
-}
-
-static jint Float_floatToRawIntBits(JNIEnv*, jclass, jfloat floatValue) {
-    return Float::floatToRawIntBits(floatValue);
-}
-
-static jfloat Float_intBitsToFloat(JNIEnv*, jclass, jint bits) {
-    return Float::intBitsToFloat(bits);
-}
-
-static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(Float, floatToIntBits, "(F)I"),
-    NATIVE_METHOD(Float, floatToRawIntBits, "(F)I"),
-    NATIVE_METHOD(Float, intBitsToFloat, "(I)F"),
-};
-int register_java_lang_Float(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "java/lang/Float", gMethods, NELEM(gMethods));
-}
diff --git a/luni/src/main/native/java_lang_Float.h b/luni/src/main/native/java_lang_Float.h
deleted file mode 100644
index e60d953..0000000
--- a/luni/src/main/native/java_lang_Float.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef JAVA_LANG_FLOAT_H_included
-#define JAVA_LANG_FLOAT_H_included
-
-#include <stdint.h>
-
-union Float {
-public:
-    static inline float intBitsToFloat(uint32_t bits) {
-        Float result;
-        result.bits = bits;
-        return result.floatValue;
-    }
-
-    static inline uint32_t floatToRawIntBits(float floatValue) {
-        Float result;
-        result.floatValue = floatValue;
-        return result.bits;
-    }
-
-private:
-    uint32_t bits;
-    float floatValue;
-};
-
-#endif  // JAVA_LANG_FLOAT_H_included
diff --git a/luni/src/main/native/java_lang_Math.cpp b/luni/src/main/native/java_lang_Math.cpp
index 03c2e4b..021ec96 100644
--- a/luni/src/main/native/java_lang_Math.cpp
+++ b/luni/src/main/native/java_lang_Math.cpp
@@ -23,14 +23,6 @@
 #include <stdlib.h>
 #include <math.h>
 
-static jdouble Math_sin(JNIEnv*, jclass, jdouble a) {
-    return sin(a);
-}
-
-static jdouble Math_cos(JNIEnv*, jclass, jdouble a) {
-    return cos(a);
-}
-
 static jdouble Math_tan(JNIEnv*, jclass, jdouble a) {
     return tan(a);
 }
@@ -55,10 +47,6 @@
     return log(a);
 }
 
-static jdouble Math_sqrt(JNIEnv*, jclass, jdouble a) {
-    return sqrt(a);
-}
-
 static jdouble Math_IEEEremainder(JNIEnv*, jclass, jdouble a, jdouble b) {
     return remainder(a, b);
 }
@@ -119,10 +107,6 @@
     return nextafter(a, b);
 }
 
-static jfloat Math_nextafterf(JNIEnv*, jclass, jfloat a, jfloat b) {
-    return nextafterf(a, b);
-}
-
 static JNINativeMethod gMethods[] = {
     NATIVE_METHOD(Math, IEEEremainder, "(DD)D"),
     NATIVE_METHOD(Math, acos, "(D)D"),
@@ -131,7 +115,6 @@
     NATIVE_METHOD(Math, atan2, "(DD)D"),
     NATIVE_METHOD(Math, cbrt, "(D)D"),
     NATIVE_METHOD(Math, ceil, "(D)D"),
-    NATIVE_METHOD(Math, cos, "(D)D"),
     NATIVE_METHOD(Math, cosh, "(D)D"),
     NATIVE_METHOD(Math, exp, "(D)D"),
     NATIVE_METHOD(Math, expm1, "(D)D"),
@@ -141,12 +124,9 @@
     NATIVE_METHOD(Math, log10, "(D)D"),
     NATIVE_METHOD(Math, log1p, "(D)D"),
     NATIVE_METHOD(Math, nextafter, "(DD)D"),
-    NATIVE_METHOD(Math, nextafterf, "(FF)F"),
     NATIVE_METHOD(Math, pow, "(DD)D"),
     NATIVE_METHOD(Math, rint, "(D)D"),
-    NATIVE_METHOD(Math, sin, "(D)D"),
     NATIVE_METHOD(Math, sinh, "(D)D"),
-    NATIVE_METHOD(Math, sqrt, "(D)D"),
     NATIVE_METHOD(Math, tan, "(D)D"),
     NATIVE_METHOD(Math, tanh, "(D)D"),
 };
diff --git a/luni/src/main/native/java_lang_StrictMath.cpp b/luni/src/main/native/java_lang_StrictMath.cpp
index 24c15b0..7b412d5 100644
--- a/luni/src/main/native/java_lang_StrictMath.cpp
+++ b/luni/src/main/native/java_lang_StrictMath.cpp
@@ -21,7 +21,6 @@
 #include "jni.h"
 #include "JNIHelp.h"
 #include "JniConstants.h"
-#include "java_lang_Float.h"
 
 static jdouble StrictMath_sin(JNIEnv*, jclass, jdouble a) {
     return ieee_sin(a);
@@ -119,24 +118,6 @@
     return ieee_nextafter(a, b);
 }
 
-// TODO: we should make Float.floatToRawBits and Float.intBitsToFloat intrinsics, and move
-// this kind of code into Java.
-static jfloat StrictMath_nextafterf(JNIEnv*, jclass, jfloat arg1, jfloat arg2) {
-    jint hx = Float::floatToRawIntBits(arg1);
-    jint hy = Float::floatToRawIntBits(arg2);
-
-    if (!(hx & 0x7fffffff)) { /* arg1 == 0 */
-        return Float::intBitsToFloat((hy & 0x80000000) | 0x1);
-    }
-
-    if ((hx > 0) ^ (hx > hy)) { /* |arg1| < |arg2| */
-        hx += 1;
-    } else {
-        hx -= 1;
-    }
-    return Float::intBitsToFloat(hx);
-}
-
 static JNINativeMethod gMethods[] = {
     NATIVE_METHOD(StrictMath, IEEEremainder, "(DD)D"),
     NATIVE_METHOD(StrictMath, acos, "(D)D"),
@@ -155,7 +136,6 @@
     NATIVE_METHOD(StrictMath, log10, "(D)D"),
     NATIVE_METHOD(StrictMath, log1p, "(D)D"),
     NATIVE_METHOD(StrictMath, nextafter, "(DD)D"),
-    NATIVE_METHOD(StrictMath, nextafterf, "(FF)F"),
     NATIVE_METHOD(StrictMath, pow, "(DD)D"),
     NATIVE_METHOD(StrictMath, rint, "(D)D"),
     NATIVE_METHOD(StrictMath, sin, "(D)D"),
diff --git a/luni/src/main/native/java_lang_System.cpp b/luni/src/main/native/java_lang_System.cpp
index a5c3f68..d972b45 100644
--- a/luni/src/main/native/java_lang_System.cpp
+++ b/luni/src/main/native/java_lang_System.cpp
@@ -19,23 +19,41 @@
 #include "JNIHelp.h"
 #include "JniConstants.h"
 #include "ScopedUtfChars.h"
+#include "android/log.h"
+#include "openssl/opensslv.h"
+#include "toStringArray.h"
+#include "zlib.h"
 
+#include <string>
+#include <vector>
+
+#include <limits.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
-static jstring System_getEnvByName(JNIEnv* env, jclass, jstring javaName) {
-    ScopedUtfChars name(env, javaName);
-    if (name.c_str() == NULL) {
-        return NULL;
+static void System_log(JNIEnv* env, jclass, jchar type, jstring javaMessage, jthrowable exception) {
+    ScopedUtfChars message(env, javaMessage);
+    if (message.c_str() == NULL) {
+        // Since this function is used for last-gasp debugging output, be noisy on failure.
+        LOGE("message.c_str() == NULL");
+        return;
     }
-    return env->NewStringUTF(getenv(name.c_str()));
-}
-
-// Pointer to complete environment.
-extern char** environ;
-
-static jstring System_getEnvByIndex(JNIEnv* env, jclass, jint index) {
-    return env->NewStringUTF(environ[index]);
+    int priority;
+    switch (type) {
+    case 'D': case 'd': priority = ANDROID_LOG_DEBUG;   break;
+    case 'E': case 'e': priority = ANDROID_LOG_ERROR;   break;
+    case 'F': case 'f': priority = ANDROID_LOG_FATAL;   break;
+    case 'I': case 'i': priority = ANDROID_LOG_INFO;    break;
+    case 'S': case 's': priority = ANDROID_LOG_SILENT;  break;
+    case 'V': case 'v': priority = ANDROID_LOG_VERBOSE; break;
+    case 'W': case 'w': priority = ANDROID_LOG_WARN;    break;
+    default:            priority = ANDROID_LOG_DEFAULT; break;
+    }
+    LOG_PRI(priority, LOG_TAG, "%s", message.c_str());
+    if (exception != NULL) {
+        jniLogException(env, priority, LOG_TAG, exception);
+    }
 }
 
 // Sets a field via JNI. Used for the standard streams, which are read-only otherwise.
@@ -53,10 +71,22 @@
     env->SetStaticObjectField(clazz, fieldID, object);
 }
 
+static jobjectArray System_specialProperties(JNIEnv* env, jclass) {
+    std::vector<std::string> properties;
+
+    char path[PATH_MAX];
+    properties.push_back(std::string("user.dir=") + getcwd(path, sizeof(path)));
+
+    properties.push_back("android.zlib.version=" ZLIB_VERSION);
+    properties.push_back("android.openssl.version=" OPENSSL_VERSION_TEXT);
+
+    return toStringArray(env, properties);
+}
+
 static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(System, getEnvByIndex, "(I)Ljava/lang/String;"),
-    NATIVE_METHOD(System, getEnvByName, "(Ljava/lang/String;)Ljava/lang/String;"),
+    NATIVE_METHOD(System, log, "(CLjava/lang/String;Ljava/lang/Throwable;)V"),
     NATIVE_METHOD(System, setFieldImpl, "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Object;)V"),
+    NATIVE_METHOD(System, specialProperties, "()[Ljava/lang/String;"),
 };
 int register_java_lang_System(JNIEnv* env) {
     return jniRegisterNativeMethods(env, "java/lang/System", gMethods, NELEM(gMethods));
diff --git a/luni/src/main/native/NativeBN.cpp b/luni/src/main/native/java_math_NativeBN.cpp
similarity index 100%
rename from luni/src/main/native/NativeBN.cpp
rename to luni/src/main/native/java_math_NativeBN.cpp
diff --git a/luni/src/main/native/java_net_InetAddress.cpp b/luni/src/main/native/java_net_InetAddress.cpp
index 7681463..e6b66e9 100644
--- a/luni/src/main/native/java_net_InetAddress.cpp
+++ b/luni/src/main/native/java_net_InetAddress.cpp
@@ -36,17 +36,6 @@
 #include <arpa/inet.h>
 #include <sys/socket.h>
 
-static jstring InetAddress_gethostname(JNIEnv* env, jclass)
-{
-    char name[256];
-    int r = gethostname(name, 256);
-    if (r == 0) {
-        return env->NewStringUTF(name);
-    } else {
-        return NULL;
-    }
-}
-
 #if LOG_DNS
 static void logIpString(addrinfo* ai, const char* name)
 {
@@ -311,7 +300,6 @@
 static JNINativeMethod gMethods[] = {
     NATIVE_METHOD(InetAddress, byteArrayToIpString, "([B)Ljava/lang/String;"),
     NATIVE_METHOD(InetAddress, getaddrinfo, "(Ljava/lang/String;)[[B"),
-    NATIVE_METHOD(InetAddress, gethostname, "()Ljava/lang/String;"),
     NATIVE_METHOD(InetAddress, getnameinfo, "([B)Ljava/lang/String;"),
     NATIVE_METHOD(InetAddress, ipStringToByteArray, "(Ljava/lang/String;)[B"),
 };
diff --git a/luni/src/main/native/NativeBidi.cpp b/luni/src/main/native/java_text_Bidi.cpp
similarity index 73%
rename from luni/src/main/native/NativeBidi.cpp
rename to luni/src/main/native/java_text_Bidi.cpp
index 3fa299b..f44fe3d 100644
--- a/luni/src/main/native/NativeBidi.cpp
+++ b/luni/src/main/native/java_text_Bidi.cpp
@@ -15,7 +15,7 @@
  * limitations under the License.
  */
 
-#define LOG_TAG "NativeBidi"
+#define LOG_TAG "Bidi"
 
 #include "ErrorCode.h"
 #include "JNIHelp.h"
@@ -64,15 +64,15 @@
     return reinterpret_cast<BiDiData*>(static_cast<uintptr_t>(ptr))->uBiDi();
 }
 
-static jlong NativeBidi_ubidi_open(JNIEnv*, jclass) {
+static jlong Bidi_ubidi_open(JNIEnv*, jclass) {
     return reinterpret_cast<uintptr_t>(new BiDiData(ubidi_open()));
 }
 
-static void NativeBidi_ubidi_close(JNIEnv*, jclass, jlong ptr) {
+static void Bidi_ubidi_close(JNIEnv*, jclass, jlong ptr) {
     delete biDiData(ptr);
 }
 
-static void NativeBidi_ubidi_setPara(JNIEnv* env, jclass, jlong ptr, jcharArray text, jint length, jint paraLevel, jbyteArray newEmbeddingLevels) {
+static void Bidi_ubidi_setPara(JNIEnv* env, jclass, jlong ptr, jcharArray text, jint length, jint paraLevel, jbyteArray newEmbeddingLevels) {
     BiDiData* data = biDiData(ptr);
     // Copy the new embedding levels from the Java heap to the native heap.
     if (newEmbeddingLevels != NULL) {
@@ -91,7 +91,7 @@
     icu4jni_error(env, err);
 }
 
-static jlong NativeBidi_ubidi_setLine(JNIEnv* env, jclass, jlong ptr, jint start, jint limit) {
+static jlong Bidi_ubidi_setLine(JNIEnv* env, jclass, jlong ptr, jint start, jint limit) {
     UErrorCode err = U_ZERO_ERROR;
     UBiDi* sized = ubidi_openSized(limit - start, 0, &err);
     if (icu4jni_error(env, err) != FALSE) {
@@ -103,19 +103,19 @@
     return reinterpret_cast<uintptr_t>(lineData.release());
 }
 
-static jint NativeBidi_ubidi_getDirection(JNIEnv*, jclass, jlong ptr) {
+static jint Bidi_ubidi_getDirection(JNIEnv*, jclass, jlong ptr) {
     return ubidi_getDirection(uBiDi(ptr));
 }
 
-static jint NativeBidi_ubidi_getLength(JNIEnv*, jclass, jlong ptr) {
+static jint Bidi_ubidi_getLength(JNIEnv*, jclass, jlong ptr) {
     return ubidi_getLength(uBiDi(ptr));
 }
 
-static jbyte NativeBidi_ubidi_getParaLevel(JNIEnv*, jclass, jlong ptr) {
+static jbyte Bidi_ubidi_getParaLevel(JNIEnv*, jclass, jlong ptr) {
     return ubidi_getParaLevel(uBiDi(ptr));
 }
 
-static jbyteArray NativeBidi_ubidi_getLevels(JNIEnv* env, jclass, jlong ptr) {
+static jbyteArray Bidi_ubidi_getLevels(JNIEnv* env, jclass, jlong ptr) {
     UErrorCode err = U_ZERO_ERROR;
     const UBiDiLevel* levels = ubidi_getLevels(uBiDi(ptr), &err);
     if (icu4jni_error(env, err)) {
@@ -127,14 +127,17 @@
     return result;
 }
 
-static jint NativeBidi_ubidi_countRuns(JNIEnv* env, jclass, jlong ptr) {
+static jint Bidi_ubidi_countRuns(JNIEnv* env, jclass, jlong ptr) {
     UErrorCode err = U_ZERO_ERROR;
     int count = ubidi_countRuns(uBiDi(ptr), &err);
     icu4jni_error(env, err);
     return count;
 }
 
-static jobjectArray NativeBidi_ubidi_getRuns(JNIEnv* env, jclass, jlong ptr) {
+/**
+ * TODO: if we care about performance, we might just want to use an int[] instead of a Run[].
+ */
+static jobjectArray Bidi_ubidi_getRuns(JNIEnv* env, jclass, jlong ptr) {
     UBiDi* ubidi = uBiDi(ptr);
     UErrorCode err = U_ZERO_ERROR;
     int runCount = ubidi_countRuns(ubidi, &err);
@@ -155,7 +158,7 @@
     return runs;
 }
 
-static jintArray NativeBidi_ubidi_reorderVisual(JNIEnv* env, jclass, jbyteArray javaLevels, jint length) {
+static jintArray Bidi_ubidi_reorderVisual(JNIEnv* env, jclass, jbyteArray javaLevels, jint length) {
     ScopedByteArrayRO levelBytes(env, javaLevels);
     if (levelBytes.get() == NULL) {
         return NULL;
@@ -172,19 +175,18 @@
 }
 
 static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(NativeBidi, ubidi_close, "(J)V"),
-    NATIVE_METHOD(NativeBidi, ubidi_countRuns, "(J)I"),
-    NATIVE_METHOD(NativeBidi, ubidi_getDirection, "(J)I"),
-    NATIVE_METHOD(NativeBidi, ubidi_getLength, "(J)I"),
-    NATIVE_METHOD(NativeBidi, ubidi_getLevels, "(J)[B"),
-    NATIVE_METHOD(NativeBidi, ubidi_getParaLevel, "(J)B"),
-    NATIVE_METHOD(NativeBidi, ubidi_getRuns, "(J)[Lorg/apache/harmony/text/BidiRun;"),
-    NATIVE_METHOD(NativeBidi, ubidi_open, "()J"),
-    NATIVE_METHOD(NativeBidi, ubidi_reorderVisual, "([BI)[I"),
-    NATIVE_METHOD(NativeBidi, ubidi_setLine, "(JII)J"),
-    NATIVE_METHOD(NativeBidi, ubidi_setPara, "(J[CII[B)V"),
+    NATIVE_METHOD(Bidi, ubidi_close, "(J)V"),
+    NATIVE_METHOD(Bidi, ubidi_countRuns, "(J)I"),
+    NATIVE_METHOD(Bidi, ubidi_getDirection, "(J)I"),
+    NATIVE_METHOD(Bidi, ubidi_getLength, "(J)I"),
+    NATIVE_METHOD(Bidi, ubidi_getLevels, "(J)[B"),
+    NATIVE_METHOD(Bidi, ubidi_getParaLevel, "(J)B"),
+    NATIVE_METHOD(Bidi, ubidi_getRuns, "(J)[Ljava/text/Bidi$Run;"),
+    NATIVE_METHOD(Bidi, ubidi_open, "()J"),
+    NATIVE_METHOD(Bidi, ubidi_reorderVisual, "([BI)[I"),
+    NATIVE_METHOD(Bidi, ubidi_setLine, "(JII)J"),
+    NATIVE_METHOD(Bidi, ubidi_setPara, "(J[CII[B)V"),
 };
-int register_org_apache_harmony_text_NativeBidi(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "org/apache/harmony/text/NativeBidi",
-            gMethods, NELEM(gMethods));
+int register_java_text_Bidi(JNIEnv* env) {
+    return jniRegisterNativeMethods(env, "java/text/Bidi", gMethods, NELEM(gMethods));
 }
diff --git a/luni/src/main/native/java_util_zip_Deflater.cpp b/luni/src/main/native/java_util_zip_Deflater.cpp
index 2f27f5c..82d081b 100644
--- a/luni/src/main/native/java_util_zip_Deflater.cpp
+++ b/luni/src/main/native/java_util_zip_Deflater.cpp
@@ -52,10 +52,8 @@
      * that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
      * plus a few kilobytes for small objects."
      */
-    // TODO: should we just use DEF_WBITS (15) and DEF_MEM_LEVEL (8) now?
-    int windowBits = noHeader ? -12 : 12; // Was 15, made it 12 to reduce memory consumption. Use MAX_WBITS for fastest.
-    int memLevel = 5; // Was 9 (MAX_MEM_LEVEL), made it 5 to reduce memory consumption. Might result
-                      // in out-of-memory problems according to some web pages.
+    int windowBits = noHeader ? -DEF_WBITS : DEF_WBITS;
+    int memLevel = DEF_MEM_LEVEL;
     int err = deflateInit2(&jstream->stream, level, Z_DEFLATED, windowBits, memLevel, strategy);
     if (err != Z_OK) {
         throwExceptionForZlibError(env, "java/lang/IllegalArgumentException", err);
diff --git a/luni/src/main/native/ICU.cpp b/luni/src/main/native/libcore_icu_ICU.cpp
similarity index 71%
rename from luni/src/main/native/ICU.cpp
rename to luni/src/main/native/libcore_icu_ICU.cpp
index 72e962a..f04238e 100644
--- a/luni/src/main/native/ICU.cpp
+++ b/luni/src/main/native/libcore_icu_ICU.cpp
@@ -19,11 +19,14 @@
 #include "ErrorCode.h"
 #include "JNIHelp.h"
 #include "JniConstants.h"
+#include "ScopedFd.h"
 #include "ScopedJavaUnicodeString.h"
 #include "ScopedLocalRef.h"
+#include "ScopedStringChars.h"
 #include "ScopedUtfChars.h"
 #include "UniquePtr.h"
 #include "cutils/log.h"
+#include "toStringArray.h"
 #include "unicode/calendar.h"
 #include "unicode/datefmt.h"
 #include "unicode/dcfmtsym.h"
@@ -42,10 +45,18 @@
 #include "unicode/ustring.h"
 #include "ureslocs.h"
 #include "valueOf.h"
+
+#include <errno.h>
+#include <fcntl.h>
 #include <stdlib.h>
 #include <string.h>
-#include <time.h>
+#include <string>
+#include <sys/mman.h>
+#include <sys/stat.h>
 #include <sys/time.h>
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
 
 class ScopedResourceBundle {
 public:
@@ -74,22 +85,14 @@
     return Locale::createFromName(ScopedUtfChars(env, localeName).c_str());
 }
 
-static jint ICU_getCurrencyFractionDigitsNative(JNIEnv* env, jclass, jstring javaCurrencyCode) {
-    UErrorCode status = U_ZERO_ERROR;
-    UniquePtr<NumberFormat> fmt(NumberFormat::createCurrencyInstance(status));
-    if (U_FAILURE(status)) {
-        return -1;
-    }
+static jint ICU_getCurrencyFractionDigits(JNIEnv* env, jclass, jstring javaCurrencyCode) {
     ScopedJavaUnicodeString currencyCode(env, javaCurrencyCode);
-    fmt->setCurrency(currencyCode.unicodeString().getBuffer(), status);
-    if (U_FAILURE(status)) {
-        return -1;
-    }
-    // for CurrencyFormats the minimum and maximum fraction digits are the same.
-    return fmt->getMinimumFractionDigits();
+    UnicodeString icuCurrencyCode(currencyCode.unicodeString());
+    UErrorCode status = U_ZERO_ERROR;
+    return ucurr_getDefaultFractionDigits(icuCurrencyCode.getTerminatedBuffer(), &status);
 }
 
-static jstring ICU_getCurrencyCodeNative(JNIEnv* env, jclass, jstring javaKey) {
+static jstring ICU_getCurrencyCode(JNIEnv* env, jclass, jstring javaCountryCode) {
     UErrorCode status = U_ZERO_ERROR;
     ScopedResourceBundle supplData(ures_openDirect(U_ICUDATA_CURR, "supplementalData", &status));
     if (U_FAILURE(status)) {
@@ -101,8 +104,8 @@
         return NULL;
     }
 
-    ScopedUtfChars key(env, javaKey);
-    ScopedResourceBundle currency(ures_getByKey(currencyMap.get(), key.c_str(), NULL, &status));
+    ScopedUtfChars countryCode(env, javaCountryCode);
+    ScopedResourceBundle currency(ures_getByKey(currencyMap.get(), countryCode.c_str(), NULL, &status));
     if (U_FAILURE(status)) {
         return NULL;
     }
@@ -112,15 +115,12 @@
         return env->NewStringUTF("None");
     }
 
-    // check if there is a 'to' date. If there is, the currency isn't used anymore.
+    // Check if there's a 'to' date. If there is, the currency isn't used anymore.
     ScopedResourceBundle currencyTo(ures_getByKey(currencyElem.get(), "to", NULL, &status));
     if (!U_FAILURE(status)) {
-        // return and let the caller throw an exception
         return NULL;
     }
-    // We need to reset 'status'. It works like errno in that ICU doesn't set it
-    // to U_ZERO_ERROR on success: it only touches it on error, and the test
-    // above means it now holds a failure code.
+    // Ignore the failure to find a 'to' date.
     status = U_ZERO_ERROR;
 
     ScopedResourceBundle currencyId(ures_getByKey(currencyElem.get(), "id", NULL, &status));
@@ -129,15 +129,31 @@
         return env->NewStringUTF("None");
     }
 
-    int length;
-    const jchar* id = ures_getString(currencyId.get(), &length, &status);
-    if (U_FAILURE(status) || length == 0) {
-        return env->NewStringUTF("None");
-    }
-    return env->NewString(id, length);
+    int32_t charCount;
+    const jchar* chars = ures_getString(currencyId.get(), &charCount, &status);
+    return (charCount == 0) ? env->NewStringUTF("None") : env->NewString(chars, charCount);
 }
 
-static jstring ICU_getCurrencySymbolNative(JNIEnv* env, jclass, jstring locale, jstring currencyCode) {
+static jstring ICU_getCurrencyDisplayName(JNIEnv* env, jclass, jstring javaLocaleName, jstring javaCurrencyCode) {
+    ScopedUtfChars localeName(env, javaLocaleName);
+    ScopedJavaUnicodeString currencyCode(env, javaCurrencyCode);
+    UnicodeString icuCurrencyCode(currencyCode.unicodeString());
+    UErrorCode status = U_ZERO_ERROR;
+    UBool isChoiceFormat;
+    int32_t charCount;
+    const UChar* chars = ucurr_getName(icuCurrencyCode.getTerminatedBuffer(), localeName.c_str(),
+            UCURR_LONG_NAME, &isChoiceFormat, &charCount, &status);
+    if (status == U_USING_DEFAULT_WARNING) {
+        // ICU's default is English. We want the ISO 4217 currency code instead.
+        chars = icuCurrencyCode.getBuffer();
+        charCount = icuCurrencyCode.length();
+    }
+    return (charCount == 0) ? NULL : env->NewString(chars, charCount);
+}
+
+static jstring ICU_getCurrencySymbol(JNIEnv* env, jclass, jstring locale, jstring currencyCode) {
+    // We can't use ucurr_getName because it doesn't distinguish between using data root from
+    // the root locale and parroting back the input because it's never heard of the currency code.
     ScopedUtfChars localeName(env, locale);
     UErrorCode status = U_ZERO_ERROR;
     ScopedResourceBundle currLoc(ures_open(U_ICUDATA_CURR, localeName.c_str(), &status));
@@ -156,13 +172,12 @@
         return NULL;
     }
 
-    int currSymbL;
-    const jchar* currSymbU = ures_getStringByIndex(currencyElems.get(), 0, &currSymbL, &status);
+    int32_t charCount;
+    const jchar* chars = ures_getStringByIndex(currencyElems.get(), 0, &charCount, &status);
     if (U_FAILURE(status)) {
         return NULL;
     }
-
-    return (currSymbL == 0) ? NULL : env->NewString(currSymbU, currSymbL);
+    return (charCount == 0) ? NULL : env->NewString(chars, charCount);
 }
 
 static jstring ICU_getDisplayCountryNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) {
@@ -199,19 +214,6 @@
     return env->NewStringUTF(loc.getISO3Language());
 }
 
-static jobjectArray toStringArray(JNIEnv* env, const char* const* strings) {
-    size_t count = 0;
-    while (strings[count] != NULL) {
-        ++count;
-    }
-    jobjectArray result = env->NewObjectArray(count, JniConstants::stringClass, NULL);
-    for (size_t i = 0; i < count; ++i) {
-        ScopedLocalRef<jstring> s(env, env->NewStringUTF(strings[i]));
-        env->SetObjectArrayElement(result, i, s.get());
-    }
-    return result;
-}
-
 static jobjectArray ICU_getISOCountriesNative(JNIEnv* env, jclass) {
     return toStringArray(env, Locale::getISOCountries());
 }
@@ -220,39 +222,28 @@
     return toStringArray(env, Locale::getISOLanguages());
 }
 
-template <typename Counter, typename Getter>
-static jobjectArray getAvailableLocales(JNIEnv* env, Counter* counter, Getter* getter) {
-    size_t count = (*counter)();
-    jobjectArray result = env->NewObjectArray(count, JniConstants::stringClass, NULL);
-    for (size_t i = 0; i < count; ++i) {
-        ScopedLocalRef<jstring> s(env, env->NewStringUTF((*getter)(i)));
-        env->SetObjectArrayElement(result, i, s.get());
-    }
-    return result;
-}
-
 static jobjectArray ICU_getAvailableLocalesNative(JNIEnv* env, jclass) {
-    return getAvailableLocales(env, uloc_countAvailable, uloc_getAvailable);
+    return toStringArray(env, uloc_countAvailable, uloc_getAvailable);
 }
 
 static jobjectArray ICU_getAvailableBreakIteratorLocalesNative(JNIEnv* env, jclass) {
-    return getAvailableLocales(env, ubrk_countAvailable, ubrk_getAvailable);
+    return toStringArray(env, ubrk_countAvailable, ubrk_getAvailable);
 }
 
 static jobjectArray ICU_getAvailableCalendarLocalesNative(JNIEnv* env, jclass) {
-    return getAvailableLocales(env, ucal_countAvailable, ucal_getAvailable);
+    return toStringArray(env, ucal_countAvailable, ucal_getAvailable);
 }
 
 static jobjectArray ICU_getAvailableCollatorLocalesNative(JNIEnv* env, jclass) {
-    return getAvailableLocales(env, ucol_countAvailable, ucol_getAvailable);
+    return toStringArray(env, ucol_countAvailable, ucol_getAvailable);
 }
 
 static jobjectArray ICU_getAvailableDateFormatLocalesNative(JNIEnv* env, jclass) {
-    return getAvailableLocales(env, udat_countAvailable, udat_getAvailable);
+    return toStringArray(env, udat_countAvailable, udat_getAvailable);
 }
 
 static jobjectArray ICU_getAvailableNumberFormatLocalesNative(JNIEnv* env, jclass) {
-    return getAvailableLocales(env, unum_countAvailable, unum_getAvailable);
+    return toStringArray(env, unum_countAvailable, unum_getAvailable);
 }
 
 static bool getDayIntVector(JNIEnv*, UResourceBundle* gregorian, int* values) {
@@ -274,54 +265,55 @@
     return true;
 }
 
+// This allows you to leave extra space at the beginning or end of the array to support the
+// month names and day names arrays.
+static jobjectArray toStringArray(JNIEnv* env, UResourceBundle* rb, size_t size, int capacity, size_t offset) {
+    if (capacity == -1) {
+        capacity = size;
+    }
+    jobjectArray result = env->NewObjectArray(capacity, JniConstants::stringClass, NULL);
+    if (result == NULL) {
+        return NULL;
+    }
+    UErrorCode status = U_ZERO_ERROR;
+    for (size_t i = 0; i < size; ++i) {
+        int charCount;
+        const jchar* chars = ures_getStringByIndex(rb, i, &charCount, &status);
+        if (U_FAILURE(status)) {
+            return NULL;
+        }
+        ScopedLocalRef<jstring> s(env, env->NewString(chars, charCount));
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
+        env->SetObjectArrayElement(result, offset + i, s.get());
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
+    }
+    return result;
+}
+
 static jobjectArray getAmPmMarkers(JNIEnv* env, UResourceBundle* gregorian) {
     UErrorCode status = U_ZERO_ERROR;
-    ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "AmPmMarkers", NULL, &status));
+    ScopedResourceBundle amPmMarkers(ures_getByKey(gregorian, "AmPmMarkers", NULL, &status));
     if (U_FAILURE(status)) {
         return NULL;
     }
-
-    int lengthAm, lengthPm;
-    const jchar* am = ures_getStringByIndex(gregorianElems.get(), 0, &lengthAm, &status);
-    const jchar* pm = ures_getStringByIndex(gregorianElems.get(), 1, &lengthPm, &status);
-
-    if (U_FAILURE(status)) {
-        return NULL;
-    }
-
-    jobjectArray amPmMarkers = env->NewObjectArray(2, JniConstants::stringClass, NULL);
-    ScopedLocalRef<jstring> amU(env, env->NewString(am, lengthAm));
-    env->SetObjectArrayElement(amPmMarkers, 0, amU.get());
-    ScopedLocalRef<jstring> pmU(env, env->NewString(pm, lengthPm));
-    env->SetObjectArrayElement(amPmMarkers, 1, pmU.get());
-
-    return amPmMarkers;
+    return toStringArray(env, amPmMarkers.get(), ures_getSize(amPmMarkers.get()), -1, 0);
 }
 
 static jobjectArray getEras(JNIEnv* env, UResourceBundle* gregorian) {
     UErrorCode status = U_ZERO_ERROR;
-    ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "eras", NULL, &status));
+    ScopedResourceBundle eras(ures_getByKey(gregorian, "eras", NULL, &status));
     if (U_FAILURE(status)) {
         return NULL;
     }
-
-    ScopedResourceBundle eraElems(ures_getByKey(gregorianElems.get(), "abbreviated", NULL, &status));
+    ScopedResourceBundle abbreviatedEras(ures_getByKey(eras.get(), "abbreviated", NULL, &status));
     if (U_FAILURE(status)) {
         return NULL;
     }
-
-    int eraCount = ures_getSize(eraElems.get());
-    jobjectArray eras = env->NewObjectArray(eraCount, JniConstants::stringClass, NULL);
-    for (int i = 0; i < eraCount; ++i) {
-        int eraLength;
-        const jchar* era = ures_getStringByIndex(eraElems.get(), i, &eraLength, &status);
-        if (U_FAILURE(status)) {
-            return NULL;
-        }
-        ScopedLocalRef<jstring> eraU(env, env->NewString(era, eraLength));
-        env->SetObjectArrayElement(eras, i, eraU.get());
-    }
-    return eras;
+    return toStringArray(env, abbreviatedEras.get(), ures_getSize(abbreviatedEras.get()), -1, 0);
 }
 
 enum NameType { REGULAR, STAND_ALONE };
@@ -338,18 +330,9 @@
 
     // The months array has a trailing empty string. The days array has a leading empty string.
     int count = ures_getSize(valuesBundle.get());
-    jobjectArray result = env->NewObjectArray(count + 1, JniConstants::stringClass, NULL);
+    int offset = months ? 0 : 1;
+    jobjectArray result = toStringArray(env, valuesBundle.get(), count, count + 1, offset);
     env->SetObjectArrayElement(result, months ? count : 0, env->NewStringUTF(""));
-    int arrayOffset = months ? 0 : 1;
-    for (int i = 0; i < count; ++i) {
-        int nameLength;
-        const jchar* name = ures_getStringByIndex(valuesBundle.get(), i, &nameLength, &status);
-        if (U_FAILURE(status)) {
-            return NULL;
-        }
-        ScopedLocalRef<jstring> nameString(env, env->NewString(name, nameLength));
-        env->SetObjectArrayElement(result, arrayOffset++, nameString.get());
-    }
     return result;
 }
 
@@ -492,10 +475,10 @@
     status = U_ZERO_ERROR;
 
     jstring countryCode = env->NewStringUTF(Locale::createFromName(localeName.c_str()).getCountry());
-    jstring internationalCurrencySymbol = ICU_getCurrencyCodeNative(env, NULL, countryCode);
+    jstring internationalCurrencySymbol = ICU_getCurrencyCode(env, NULL, countryCode);
     jstring currencySymbol = NULL;
     if (internationalCurrencySymbol != NULL) {
-        currencySymbol = ICU_getCurrencySymbolNative(env, NULL, locale, internationalCurrencySymbol);
+        currencySymbol = ICU_getCurrencySymbol(env, NULL, locale, internationalCurrencySymbol);
     } else {
         internationalCurrencySymbol = env->NewStringUTF("XXX");
     }
@@ -532,16 +515,59 @@
     return s == original ? javaString : env->NewString(s.getBuffer(), s.length());
 }
 
+static jstring versionString(JNIEnv* env, const UVersionInfo& version) {
+    char versionString[U_MAX_VERSION_STRING_LENGTH];
+    u_versionToString(const_cast<UVersionInfo&>(version), &versionString[0]);
+    return env->NewStringUTF(versionString);
+}
+
+static jstring ICU_getIcuVersion(JNIEnv* env, jclass) {
+    UVersionInfo icuVersion;
+    u_getVersion(icuVersion);
+    return versionString(env, icuVersion);
+}
+
+static jstring ICU_getUnicodeVersion(JNIEnv* env, jclass) {
+    UVersionInfo unicodeVersion;
+    u_getUnicodeVersion(unicodeVersion);
+    return versionString(env, unicodeVersion);
+}
+
+
+struct EnumerationCounter {
+    const size_t count;
+    EnumerationCounter(size_t count) : count(count) {}
+    size_t operator()() { return count; }
+};
+struct EnumerationGetter {
+    UEnumeration* e;
+    UErrorCode* status;
+    EnumerationGetter(UEnumeration* e, UErrorCode* status) : e(e), status(status) {}
+    const UChar* operator()(int32_t* charCount) { return uenum_unext(e, charCount, status); }
+};
+static jobject ICU_getAvailableCurrencyCodes(JNIEnv* env, jclass) {
+    UErrorCode status = U_ZERO_ERROR;
+    UEnumeration* e(ucurr_openISOCurrencies(UCURR_COMMON|UCURR_NON_DEPRECATED, &status));
+    EnumerationCounter counter(uenum_count(e, &status));
+    EnumerationGetter getter(e, &status);
+    jobject result = toStringArray16(env, &counter, &getter);
+    icu4jni_error(env, status);
+    uenum_close(e);
+    return result;
+}
+
 static JNINativeMethod gMethods[] = {
     NATIVE_METHOD(ICU, getAvailableBreakIteratorLocalesNative, "()[Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getAvailableCalendarLocalesNative, "()[Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getAvailableCollatorLocalesNative, "()[Ljava/lang/String;"),
+    NATIVE_METHOD(ICU, getAvailableCurrencyCodes, "()[Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getAvailableDateFormatLocalesNative, "()[Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getAvailableLocalesNative, "()[Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getAvailableNumberFormatLocalesNative, "()[Ljava/lang/String;"),
-    NATIVE_METHOD(ICU, getCurrencyCodeNative, "(Ljava/lang/String;)Ljava/lang/String;"),
-    NATIVE_METHOD(ICU, getCurrencyFractionDigitsNative, "(Ljava/lang/String;)I"),
-    NATIVE_METHOD(ICU, getCurrencySymbolNative, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
+    NATIVE_METHOD(ICU, getCurrencyCode, "(Ljava/lang/String;)Ljava/lang/String;"),
+    NATIVE_METHOD(ICU, getCurrencyDisplayName, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
+    NATIVE_METHOD(ICU, getCurrencyFractionDigits, "(Ljava/lang/String;)I"),
+    NATIVE_METHOD(ICU, getCurrencySymbol, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getDisplayCountryNative, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getDisplayLanguageNative, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getDisplayVariantNative, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
@@ -549,25 +575,61 @@
     NATIVE_METHOD(ICU, getISO3LanguageNative, "(Ljava/lang/String;)Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getISOCountriesNative, "()[Ljava/lang/String;"),
     NATIVE_METHOD(ICU, getISOLanguagesNative, "()[Ljava/lang/String;"),
+    NATIVE_METHOD(ICU, getIcuVersion, "()Ljava/lang/String;"),
+    NATIVE_METHOD(ICU, getUnicodeVersion, "()Ljava/lang/String;"),
     NATIVE_METHOD(ICU, initLocaleDataImpl, "(Ljava/lang/String;Llibcore/icu/LocaleData;)Z"),
     NATIVE_METHOD(ICU, toLowerCase, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
     NATIVE_METHOD(ICU, toUpperCase, "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"),
 };
 int register_libcore_icu_ICU(JNIEnv* env) {
+    std::string path;
+    path = u_getDataDirectory();
+    path += "/";
+    path += U_ICUDATA_NAME;
+    path += ".dat";
+
+    #define FAIL_WITH_STRERROR(s) \
+        LOGE("Couldn't " s " '%s': %s", path.c_str(), strerror(errno)); \
+        return -1;
+    #define MAYBE_FAIL_WITH_ICU_ERROR(s) \
+        if (status != U_ZERO_ERROR) {\
+            LOGE("Couldn't initialize ICU (" s "): %s (%s)", u_errorName(status), path.c_str()); \
+            return -1; \
+        }
+
+    // Open the file and get its length.
+    ScopedFd fd(open(path.c_str(), O_RDONLY));
+    if (fd.get() == -1) {
+        FAIL_WITH_STRERROR("open");
+    }
+    struct stat sb;
+    if (fstat(fd.get(), &sb) == -1) {
+        FAIL_WITH_STRERROR("stat");
+    }
+
+    // Map it.
+    void* data = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd.get(), 0);
+    if (data == MAP_FAILED) {
+        FAIL_WITH_STRERROR("mmap");
+    }
+
+    // Tell the kernel that accesses are likely to be random rather than sequential.
+    if (madvise(data, sb.st_size, MADV_RANDOM) == -1) {
+        FAIL_WITH_STRERROR("madvise(MADV_RANDOM)");
+    }
+
+    // Tell ICU to use our memory-mapped data.
+    UErrorCode status = U_ZERO_ERROR;
+    udata_setCommonData(data, &status);
+    MAYBE_FAIL_WITH_ICU_ERROR("udata_setCommonData");
+    // Tell ICU it can *only* use our memory-mapped data.
+    udata_setFileAccess(UDATA_NO_FILES, &status);
+    MAYBE_FAIL_WITH_ICU_ERROR("udata_setFileAccess");
+
     // Failures to find the ICU data tend to be somewhat obscure because ICU loads its data on first
     // use, which can be anywhere. Force initialization up front so we can report a nice clear error
     // and bail.
-    UErrorCode status = U_ZERO_ERROR;
     u_init(&status);
-    if (status != U_ZERO_ERROR) {
-        LOGE("Couldn't initialize ICU: %s", u_errorName(status));
-        return -1;
-    }
-    // Temporary work-around for http://b/3443476.
-    udata_setFileAccess(UDATA_ONLY_PACKAGES, &status);
-    if (status != U_ZERO_ERROR) {
-        LOGE("Couldn't tell ICU to only use packages: %s", u_errorName(status));
-        return -1;
-    }
+    MAYBE_FAIL_WITH_ICU_ERROR("u_init");
     return jniRegisterNativeMethods(env, "libcore/icu/ICU", gMethods, NELEM(gMethods));
 }
diff --git a/luni/src/main/native/NativeBreakIterator.cpp b/luni/src/main/native/libcore_icu_NativeBreakIterator.cpp
similarity index 100%
rename from luni/src/main/native/NativeBreakIterator.cpp
rename to luni/src/main/native/libcore_icu_NativeBreakIterator.cpp
diff --git a/luni/src/main/native/NativeCollation.cpp b/luni/src/main/native/libcore_icu_NativeCollation.cpp
similarity index 100%
rename from luni/src/main/native/NativeCollation.cpp
rename to luni/src/main/native/libcore_icu_NativeCollation.cpp
diff --git a/luni/src/main/native/NativeConverter.cpp b/luni/src/main/native/libcore_icu_NativeConverter.cpp
similarity index 73%
rename from luni/src/main/native/NativeConverter.cpp
rename to luni/src/main/native/libcore_icu_NativeConverter.cpp
index 7587fc6..9ef1d04 100644
--- a/luni/src/main/native/NativeConverter.cpp
+++ b/luni/src/main/native/libcore_icu_NativeConverter.cpp
@@ -20,14 +20,19 @@
 #include "JniConstants.h"
 #include "ScopedLocalRef.h"
 #include "ScopedPrimitiveArray.h"
+#include "ScopedStringChars.h"
 #include "ScopedUtfChars.h"
 #include "UniquePtr.h"
 #include "cutils/log.h"
+#include "toStringArray.h"
 #include "unicode/ucnv.h"
 #include "unicode/ucnv_cb.h"
 #include "unicode/uniset.h"
 #include "unicode/ustring.h"
 #include "unicode/utypes.h"
+
+#include <vector>
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -35,16 +40,18 @@
 #define NativeConverter_IGNORE 1
 #define NativeConverter_REPLACE 2
 
+#define MAX_REPLACEMENT_LENGTH 32 // equivalent to UCNV_ERROR_BUFFER_LENGTH
+
 struct DecoderCallbackContext {
-    int length;
-    UChar subUChars[256];
+    UChar replacementChars[MAX_REPLACEMENT_LENGTH];
+    size_t replacementCharCount;
     UConverterToUCallback onUnmappableInput;
     UConverterToUCallback onMalformedInput;
 };
 
 struct EncoderCallbackContext {
-    int length;
-    char subBytes[256];
+    char replacementBytes[MAX_REPLACEMENT_LENGTH];
+    size_t replacementByteCount;
     UConverterFromUCallback onUnmappableInput;
     UConverterFromUCallback onMalformedInput;
 };
@@ -108,20 +115,14 @@
     *sourceOffset = (mySource - uSource.get()) - *sourceOffset;
     *targetOffset = (reinterpret_cast<jbyte*>(cTarget) - uTarget.get()) - *targetOffset;
 
-    // Check how much more input is necessary to complete what's in the converter's internal buffer.
-    UErrorCode minorErrorCode = U_ZERO_ERROR;
-    int32_t pending = ucnv_fromUCountPending(cnv, &minorErrorCode);
-    if (U_SUCCESS(minorErrorCode)) {
-        myData[3] = pending;
-    }
-
     // If there was an error, count the problematic characters.
     if (errorCode == U_ILLEGAL_CHAR_FOUND || errorCode == U_INVALID_CHAR_FOUND) {
-        int8_t len = 32;
+        int8_t invalidUCharCount = 32;
         UChar invalidUChars[32];
-        ucnv_getInvalidUChars(cnv, invalidUChars, &len, &minorErrorCode);
+        UErrorCode minorErrorCode = U_ZERO_ERROR;
+        ucnv_getInvalidUChars(cnv, invalidUChars, &invalidUCharCount, &minorErrorCode);
         if (U_SUCCESS(minorErrorCode)) {
-            myData[2] = len;
+            myData[2] = invalidUCharCount;
         }
     }
     return errorCode;
@@ -160,18 +161,14 @@
     *sourceOffset = mySource - reinterpret_cast<const char*>(uSource.get()) - *sourceOffset;
     *targetOffset = cTarget - uTarget.get() - *targetOffset;
 
-    // Check how much more input is necessary to complete what's in the converter's internal buffer.
-    UErrorCode minorErrorCode = U_ZERO_ERROR;
-    jint pending = ucnv_toUCountPending(cnv, &minorErrorCode);
-    myData[3] = pending;
-
     // If there was an error, count the problematic bytes.
     if (errorCode == U_ILLEGAL_CHAR_FOUND || errorCode == U_INVALID_CHAR_FOUND) {
-        int8_t len = 32;
-        char invalidChars[32] = {'\0'};
-        ucnv_getInvalidChars(cnv, invalidChars, &len, &minorErrorCode);
+        int8_t invalidByteCount = 32;
+        char invalidBytes[32] = {'\0'};
+        UErrorCode minorErrorCode = U_ZERO_ERROR;
+        ucnv_getInvalidChars(cnv, invalidBytes, &invalidByteCount, &minorErrorCode);
         if (U_SUCCESS(minorErrorCode)) {
-            myData[2] = len;
+            myData[2] = invalidByteCount;
         }
     }
 
@@ -207,58 +204,6 @@
     return (cnv != NULL) ? ((ucnv_getMaxCharSize(cnv) + ucnv_getMinCharSize(cnv)) / 2.0) : -1;
 }
 
-static jint NativeConverter_flushByteToChar(JNIEnv* env, jclass, jlong address,
-        jcharArray target, jint targetEnd, jintArray data) {
-    UConverter* cnv = toUConverter(address);
-    if (cnv == NULL) {
-        return U_ILLEGAL_ARGUMENT_ERROR;
-    }
-    ScopedCharArrayRW uTarget(env, target);
-    if (uTarget.get() == NULL) {
-        return U_ILLEGAL_ARGUMENT_ERROR;
-    }
-    ScopedIntArrayRW myData(env, data);
-    if (myData.get() == NULL) {
-        return U_ILLEGAL_ARGUMENT_ERROR;
-    }
-    char source = '\0';
-    jint* targetOffset = &myData[1];
-    const char* mySource = &source;
-    const char* mySourceLimit = &source;
-    UChar* cTarget = uTarget.get() + *targetOffset;
-    const UChar* cTargetLimit = uTarget.get() + targetEnd;
-    UErrorCode errorCode = U_ZERO_ERROR;
-    ucnv_toUnicode(cnv, &cTarget, cTargetLimit, &mySource, mySourceLimit, NULL, TRUE, &errorCode);
-    *targetOffset = cTarget - uTarget.get() - *targetOffset;
-    return errorCode;
-}
-
-static jint NativeConverter_flushCharToByte(JNIEnv* env, jclass, jlong address,
-        jbyteArray target, jint targetEnd, jintArray data) {
-    UConverter* cnv = toUConverter(address);
-    if (cnv == NULL) {
-        return U_ILLEGAL_ARGUMENT_ERROR;
-    }
-    ScopedByteArrayRW uTarget(env, target);
-    if (uTarget.get() == NULL) {
-        return U_ILLEGAL_ARGUMENT_ERROR;
-    }
-    ScopedIntArrayRW myData(env, data);
-    if (myData.get() == NULL) {
-        return U_ILLEGAL_ARGUMENT_ERROR;
-    }
-    jchar source = '\0';
-    jint* targetOffset = &myData[1];
-    const jchar* mySource = &source;
-    const UChar* mySourceLimit= &source;
-    char* cTarget = reinterpret_cast<char*>(uTarget.get() + *targetOffset);
-    const char* cTargetLimit = reinterpret_cast<char*>(uTarget.get() + targetEnd);
-    UErrorCode errorCode = U_ZERO_ERROR;
-    ucnv_fromUnicode(cnv, &cTarget, cTargetLimit, &mySource, mySourceLimit, NULL, TRUE, &errorCode);
-    *targetOffset = reinterpret_cast<jbyte*>(cTarget) - uTarget.get() - *targetOffset;
-    return errorCode;
-}
-
 static jboolean NativeConverter_canEncode(JNIEnv*, jclass, jlong address, jint codeUnit) {
     UErrorCode errorCode = U_ZERO_ERROR;
     UConverter* cnv = toUConverter(address);
@@ -330,10 +275,19 @@
 static jobjectArray NativeConverter_getAvailableCharsetNames(JNIEnv* env, jclass) {
     int32_t num = ucnv_countAvailable();
     jobjectArray result = env->NewObjectArray(num, JniConstants::stringClass, NULL);
+    if (result == NULL) {
+        return NULL;
+    }
     for (int i = 0; i < num; ++i) {
         const char* name = ucnv_getAvailableName(i);
         ScopedLocalRef<jstring> javaCanonicalName(env, getJavaCanonicalName(env, name));
+        if (javaCanonicalName.get() == NULL) {
+            return NULL;
+        }
         env->SetObjectArrayElement(result, i, javaCanonicalName.get());
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
     }
     return result;
 }
@@ -342,7 +296,7 @@
     // Get an upper bound on the number of aliases...
     const char* myEncName = icuCanonicalName;
     UErrorCode error = U_ZERO_ERROR;
-    int32_t aliasCount = ucnv_countAliases(myEncName, &error);
+    size_t aliasCount = ucnv_countAliases(myEncName, &error);
     if (aliasCount == 0 && myEncName[0] == 'x' && myEncName[1] == '-') {
         myEncName = myEncName + 2;
         aliasCount = ucnv_countAliases(myEncName, &error);
@@ -352,26 +306,18 @@
     }
 
     // Collect the aliases we want...
-    const char* aliasArray[aliasCount];
-    int actualAliasCount = 0;
-    for(int i = 0; i < aliasCount; ++i) {
-        const char* name = ucnv_getAlias(myEncName, (uint16_t) i, &error);
+    std::vector<std::string> aliases;
+    for (size_t i = 0; i < aliasCount; ++i) {
+        const char* name = ucnv_getAlias(myEncName, i, &error);
         if (!U_SUCCESS(error)) {
             return NULL;
         }
         // TODO: why do we ignore these ones?
         if (strchr(name, '+') == 0 && strchr(name, ',') == 0) {
-            aliasArray[actualAliasCount++]= name;
+            aliases.push_back(name);
         }
     }
-
-    // Convert our C++ char*[] into a Java String[]...
-    jobjectArray result = env->NewObjectArray(actualAliasCount, JniConstants::stringClass, NULL);
-    for (int i = 0; i < actualAliasCount; ++i) {
-        ScopedLocalRef<jstring> alias(env, env->NewStringUTF(aliasArray[i]));
-        env->SetObjectArrayElement(result, i, alias.get());
-    }
-    return result;
+    return toStringArray(env, aliases);
 }
 
 static const char* getICUCanonicalName(const char* name) {
@@ -429,58 +375,47 @@
     }
     const EncoderCallbackContext* context = reinterpret_cast<const EncoderCallbackContext*>(rawContext);
     *err = U_ZERO_ERROR;
-    ucnv_cbFromUWriteBytes(fromArgs, context->subBytes, context->length, 0, err);
+    ucnv_cbFromUWriteBytes(fromArgs, context->replacementBytes, context->replacementByteCount, 0, err);
 }
 
 static UConverterFromUCallback getFromUCallback(int32_t mode) {
     switch(mode) {
-    case NativeConverter_REPORT:
-        return UCNV_FROM_U_CALLBACK_STOP;
-    case NativeConverter_IGNORE:
-        return UCNV_FROM_U_CALLBACK_SKIP;
-    case NativeConverter_REPLACE:
-        return encoderReplaceCallback;
+    case NativeConverter_IGNORE: return UCNV_FROM_U_CALLBACK_SKIP;
+    case NativeConverter_REPLACE: return encoderReplaceCallback;
+    case NativeConverter_REPORT: return UCNV_FROM_U_CALLBACK_STOP;
     }
     abort();
 }
 
 static jint NativeConverter_setCallbackEncode(JNIEnv* env, jclass, jlong address,
-        jint onMalformedInput, jint onUnmappableInput, jbyteArray subBytes) {
+        jint onMalformedInput, jint onUnmappableInput, jbyteArray javaReplacement) {
     UConverter* cnv = toUConverter(address);
     if (!cnv) {
         return U_ILLEGAL_ARGUMENT_ERROR;
     }
-    UConverterFromUCallback fromUOldAction = NULL;
-    const void* fromUOldContext = NULL;
-    ucnv_getFromUCallBack(cnv, &fromUOldAction, const_cast<const void**>(&fromUOldContext));
 
-    /* fromUOldContext can only be DecodeCallbackContext since
-     * the converter created is private data for the decoder
-     * and callbacks can only be set via this method!
-     */
-    EncoderCallbackContext* fromUNewContext=NULL;
-    UConverterFromUCallback fromUNewAction=NULL;
-    if (fromUOldContext == NULL) {
-        fromUNewContext = new EncoderCallbackContext;
-        fromUNewAction = CHARSET_ENCODER_CALLBACK;
-    } else {
-        fromUNewContext = const_cast<EncoderCallbackContext*>(
-                reinterpret_cast<const EncoderCallbackContext*>(fromUOldContext));
-        fromUNewAction = fromUOldAction;
-        fromUOldAction = NULL;
-        fromUOldContext = NULL;
+    UConverterFromUCallback oldCallback = NULL;
+    const void* oldCallbackContext = NULL;
+    ucnv_getFromUCallBack(cnv, &oldCallback, const_cast<const void**>(&oldCallbackContext));
+
+    EncoderCallbackContext* callbackContext = const_cast<EncoderCallbackContext*>(
+            reinterpret_cast<const EncoderCallbackContext*>(oldCallbackContext));
+    if (callbackContext == NULL) {
+        callbackContext = new EncoderCallbackContext;
     }
-    fromUNewContext->onMalformedInput = getFromUCallback(onMalformedInput);
-    fromUNewContext->onUnmappableInput = getFromUCallback(onUnmappableInput);
-    ScopedByteArrayRO sub(env, subBytes);
-    if (sub.get() == NULL) {
+
+    callbackContext->onMalformedInput = getFromUCallback(onMalformedInput);
+    callbackContext->onUnmappableInput = getFromUCallback(onUnmappableInput);
+
+    ScopedByteArrayRO replacementBytes(env, javaReplacement);
+    if (replacementBytes.get() == NULL) {
         return U_ILLEGAL_ARGUMENT_ERROR;
     }
-    fromUNewContext->length = sub.size();
-    memcpy(fromUNewContext->subBytes, sub.get(), sub.size());
+    memcpy(callbackContext->replacementBytes, replacementBytes.get(), replacementBytes.size());
+    callbackContext->replacementByteCount = replacementBytes.size();
+
     UErrorCode errorCode = U_ZERO_ERROR;
-    ucnv_setFromUCallBack(cnv, fromUNewAction, fromUNewContext, &fromUOldAction, &fromUOldContext,
-            &errorCode);
+    ucnv_setFromUCallBack(cnv, CHARSET_ENCODER_CALLBACK, callbackContext, NULL, NULL, &errorCode);
     return errorCode;
 }
 
@@ -498,7 +433,7 @@
     }
     const DecoderCallbackContext* context = reinterpret_cast<const DecoderCallbackContext*>(rawContext);
     *err = U_ZERO_ERROR;
-    ucnv_cbToUWriteUChars(toArgs,context->subUChars, context->length, 0, err);
+    ucnv_cbToUWriteUChars(toArgs,context->replacementChars, context->replacementCharCount, 0, err);
 }
 
 static UConverterToUCallback getToUCallback(int32_t mode) {
@@ -535,43 +470,34 @@
 }
 
 static jint NativeConverter_setCallbackDecode(JNIEnv* env, jclass, jlong address,
-        jint onMalformedInput, jint onUnmappableInput, jcharArray subChars) {
+        jint onMalformedInput, jint onUnmappableInput, jstring javaReplacement) {
     UConverter* cnv = toUConverter(address);
     if (cnv == NULL) {
         return U_ILLEGAL_ARGUMENT_ERROR;
     }
 
-    UConverterToUCallback toUOldAction;
-    const void* toUOldContext;
-    ucnv_getToUCallBack(cnv, &toUOldAction, &toUOldContext);
+    UConverterToUCallback oldCallback;
+    const void* oldCallbackContext;
+    ucnv_getToUCallBack(cnv, &oldCallback, &oldCallbackContext);
 
-    /* toUOldContext can only be DecodeCallbackContext since
-     * the converter created is private data for the decoder
-     * and callbacks can only be set via this method!
-     */
-    DecoderCallbackContext* toUNewContext = NULL;
-    UConverterToUCallback toUNewAction = NULL;
-    if (toUOldContext == NULL) {
-        toUNewContext = new DecoderCallbackContext;
-        toUNewAction = CHARSET_DECODER_CALLBACK;
-    } else {
-        toUNewContext = const_cast<DecoderCallbackContext*>(
-                reinterpret_cast<const DecoderCallbackContext*>(toUOldContext));
-        toUNewAction = toUOldAction;
-        toUOldAction = NULL;
-        toUOldContext = NULL;
+    DecoderCallbackContext* callbackContext = const_cast<DecoderCallbackContext*>(
+            reinterpret_cast<const DecoderCallbackContext*>(oldCallbackContext));
+    if (callbackContext == NULL) {
+        callbackContext = new DecoderCallbackContext;
     }
-    toUNewContext->onMalformedInput = getToUCallback(onMalformedInput);
-    toUNewContext->onUnmappableInput = getToUCallback(onUnmappableInput);
-    ScopedCharArrayRO sub(env, subChars);
-    if (sub.get() == NULL) {
+
+    callbackContext->onMalformedInput = getToUCallback(onMalformedInput);
+    callbackContext->onUnmappableInput = getToUCallback(onUnmappableInput);
+
+    ScopedStringChars replacement(env, javaReplacement);
+    if (replacement.get() == NULL) {
         return U_ILLEGAL_ARGUMENT_ERROR;
     }
-    toUNewContext->length = sub.size();
-    u_strncpy(toUNewContext->subUChars, sub.get(), sub.size());
+    u_strncpy(callbackContext->replacementChars, replacement.get(), replacement.size());
+    callbackContext->replacementCharCount = replacement.size();
+
     UErrorCode errorCode = U_ZERO_ERROR;
-    ucnv_setToUCallBack(cnv, toUNewAction, toUNewContext, &toUOldAction, &toUOldContext,
-            &errorCode);
+    ucnv_setToUCallBack(cnv, CHARSET_DECODER_CALLBACK, callbackContext, NULL, NULL, &errorCode);
     return errorCode;
 }
 
@@ -585,9 +511,9 @@
         return NULL;
     }
     UErrorCode status = U_ZERO_ERROR;
-    char subBytes[10];
-    int8_t len = sizeof(subBytes);
-    ucnv_getSubstChars(cnv, subBytes, &len, &status);
+    char replacementBytes[MAX_REPLACEMENT_LENGTH];
+    int8_t len = sizeof(replacementBytes);
+    ucnv_getSubstChars(cnv, replacementBytes, &len, &status);
     if (!U_SUCCESS(status)) {
         return env->NewByteArray(0);
     }
@@ -595,7 +521,7 @@
     if (result == NULL) {
         return NULL;
     }
-    env->SetByteArrayRegion(result, 0, len, reinterpret_cast<jbyte*>(subBytes));
+    env->SetByteArrayRegion(result, 0, len, reinterpret_cast<jbyte*>(replacementBytes));
     return result;
 }
 
@@ -670,8 +596,6 @@
     NATIVE_METHOD(NativeConverter, contains, "(Ljava/lang/String;Ljava/lang/String;)Z"),
     NATIVE_METHOD(NativeConverter, decode, "(J[BI[CI[IZ)I"),
     NATIVE_METHOD(NativeConverter, encode, "(J[CI[BI[IZ)I"),
-    NATIVE_METHOD(NativeConverter, flushByteToChar, "(J[CI[I)I"),
-    NATIVE_METHOD(NativeConverter, flushCharToByte, "(J[BI[I)I"),
     NATIVE_METHOD(NativeConverter, getAvailableCharsetNames, "()[Ljava/lang/String;"),
     NATIVE_METHOD(NativeConverter, getAveBytesPerChar, "(J)F"),
     NATIVE_METHOD(NativeConverter, getAveCharsPerByte, "(J)F"),
@@ -681,7 +605,7 @@
     NATIVE_METHOD(NativeConverter, openConverter, "(Ljava/lang/String;)J"),
     NATIVE_METHOD(NativeConverter, resetByteToChar, "(J)V"),
     NATIVE_METHOD(NativeConverter, resetCharToByte, "(J)V"),
-    NATIVE_METHOD(NativeConverter, setCallbackDecode, "(JII[C)I"),
+    NATIVE_METHOD(NativeConverter, setCallbackDecode, "(JIILjava/lang/String;)I"),
     NATIVE_METHOD(NativeConverter, setCallbackEncode, "(JII[B)I"),
 };
 int register_libcore_icu_NativeConverter(JNIEnv* env) {
diff --git a/luni/src/main/native/NativeDecimalFormat.cpp b/luni/src/main/native/libcore_icu_NativeDecimalFormat.cpp
similarity index 100%
rename from luni/src/main/native/NativeDecimalFormat.cpp
rename to luni/src/main/native/libcore_icu_NativeDecimalFormat.cpp
diff --git a/luni/src/main/native/NativeIDN.cpp b/luni/src/main/native/libcore_icu_NativeIDN.cpp
similarity index 100%
rename from luni/src/main/native/NativeIDN.cpp
rename to luni/src/main/native/libcore_icu_NativeIDN.cpp
diff --git a/luni/src/main/native/NativeNormalizer.cpp b/luni/src/main/native/libcore_icu_NativeNormalizer.cpp
similarity index 100%
rename from luni/src/main/native/NativeNormalizer.cpp
rename to luni/src/main/native/libcore_icu_NativeNormalizer.cpp
diff --git a/luni/src/main/native/NativePluralRules.cpp b/luni/src/main/native/libcore_icu_NativePluralRules.cpp
similarity index 100%
rename from luni/src/main/native/NativePluralRules.cpp
rename to luni/src/main/native/libcore_icu_NativePluralRules.cpp
diff --git a/luni/src/main/native/libcore_icu_TimeZones.cpp b/luni/src/main/native/libcore_icu_TimeZones.cpp
new file mode 100644
index 0000000..e8d54cc
--- /dev/null
+++ b/luni/src/main/native/libcore_icu_TimeZones.cpp
@@ -0,0 +1,233 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "TimeZones"
+
+#include <map>
+#include <vector>
+
+#include "ErrorCode.h"
+#include "JNIHelp.h"
+#include "JniConstants.h"
+#include "ScopedJavaUnicodeString.h"
+#include "ScopedLocalRef.h"
+#include "ScopedUtfChars.h"
+#include "UniquePtr.h"
+#include "unicode/smpdtfmt.h"
+#include "unicode/timezone.h"
+
+extern Locale getLocale(JNIEnv* env, jstring localeName);
+
+static jobjectArray TimeZones_forCountryCode(JNIEnv* env, jclass, jstring countryCode) {
+    ScopedUtfChars countryChars(env, countryCode);
+    if (countryChars.c_str() == NULL) {
+        return NULL;
+    }
+
+    UniquePtr<StringEnumeration> ids(TimeZone::createEnumeration(countryChars.c_str()));
+    if (ids.get() == NULL) {
+        return NULL;
+    }
+    UErrorCode status = U_ZERO_ERROR;
+    int32_t idCount = ids->count(status);
+    if (U_FAILURE(status)) {
+        icu4jni_error(env, status);
+        return NULL;
+    }
+
+    jobjectArray result = env->NewObjectArray(idCount, JniConstants::stringClass, NULL);
+    for (int32_t i = 0; i < idCount; ++i) {
+        const UnicodeString* id = ids->snext(status);
+        if (U_FAILURE(status)) {
+            icu4jni_error(env, status);
+            return NULL;
+        }
+        ScopedLocalRef<jstring> idString(env, env->NewString(id->getBuffer(), id->length()));
+        env->SetObjectArrayElement(result, i, idString.get());
+    }
+    return result;
+}
+
+struct TimeZoneNames {
+    TimeZone* tz;
+
+    UnicodeString longStd;
+    UnicodeString shortStd;
+    UnicodeString longDst;
+    UnicodeString shortDst;
+
+    UDate standardDate;
+    UDate daylightSavingDate;
+};
+
+static void setStringArrayElement(JNIEnv* env, jobjectArray array, int i, const UnicodeString& s) {
+    ScopedLocalRef<jstring> javaString(env, env->NewString(s.getBuffer(), s.length()));
+    env->SetObjectArrayElement(array, i, javaString.get());
+}
+
+static bool isUtc(const UnicodeString& id) {
+    static UnicodeString etcUct("Etc/UCT", 7, US_INV);
+    static UnicodeString etcUtc("Etc/UTC", 7, US_INV);
+    static UnicodeString etcUniversal("Etc/Universal", 13, US_INV);
+    static UnicodeString etcZulu("Etc/Zulu", 8, US_INV);
+
+    static UnicodeString uct("UCT", 3, US_INV);
+    static UnicodeString utc("UTC", 3, US_INV);
+    static UnicodeString universal("Universal", 9, US_INV);
+    static UnicodeString zulu("Zulu", 4, US_INV);
+
+    return id == etcUct || id == etcUtc || id == etcUniversal || id == etcZulu ||
+            id == uct || id == utc || id == universal || id == zulu;
+}
+
+static jobjectArray TimeZones_getZoneStringsImpl(JNIEnv* env, jclass, jstring localeName, jobjectArray timeZoneIds) {
+    Locale locale = getLocale(env, localeName);
+
+    // We could use TimeZone::getDisplayName, but that's even slower
+    // because it creates a new SimpleDateFormat each time.
+    // We're better off using SimpleDateFormat directly.
+
+    // We can't use DateFormatSymbols::getZoneStrings because that
+    // uses its own set of time zone ids and contains empty strings
+    // instead of GMT offsets (a pity, because it's a bit faster than this code).
+
+    UErrorCode status = U_ZERO_ERROR;
+    UnicodeString longPattern("zzzz", 4, US_INV);
+    SimpleDateFormat longFormat(longPattern, locale, status);
+    // 'z' only uses "common" abbreviations. 'V' allows all known abbreviations.
+    // For example, "PST" is in common use in en_US, but "CET" isn't.
+    UnicodeString commonShortPattern("z", 1, US_INV);
+    SimpleDateFormat shortFormat(commonShortPattern, locale, status);
+    UnicodeString allShortPattern("V", 1, US_INV);
+    SimpleDateFormat allShortFormat(allShortPattern, locale, status);
+
+    UnicodeString utc("UTC", 3, US_INV);
+
+    // TODO: use of fixed dates prevents us from using the correct historical name when formatting dates.
+    // TODO: use of dates not in the current year could cause us to output obsoleted names.
+    // 15th January 2008
+    UDate date1 = 1203105600000.0;
+    // 15th July 2008
+    UDate date2 = 1218826800000.0;
+
+    // In the first pass, we get the long names for the time zone.
+    // We also get any commonly-used abbreviations.
+    std::vector<TimeZoneNames> table;
+    typedef std::map<UnicodeString, UnicodeString*> AbbreviationMap;
+    AbbreviationMap usedAbbreviations;
+    size_t idCount = env->GetArrayLength(timeZoneIds);
+    for (size_t i = 0; i < idCount; ++i) {
+        ScopedLocalRef<jstring> javaZoneId(env,
+                reinterpret_cast<jstring>(env->GetObjectArrayElement(timeZoneIds, i)));
+        ScopedJavaUnicodeString zoneId(env, javaZoneId.get());
+        UnicodeString id(zoneId.unicodeString());
+
+        TimeZoneNames row;
+        if (isUtc(id)) {
+            // ICU doesn't have names for the UTC zones; it just says "GMT+00:00" for both
+            // long and short names. We don't want this. The best we can do is use "UTC"
+            // for everything (since we don't know how to say "Universal Coordinated Time").
+            row.tz = NULL;
+            row.longStd = row.shortStd = row.longDst = row.shortDst = utc;
+            table.push_back(row);
+            usedAbbreviations[utc] = &utc;
+            continue;
+        }
+
+        row.tz = TimeZone::createTimeZone(id);
+        longFormat.setTimeZone(*row.tz);
+        shortFormat.setTimeZone(*row.tz);
+
+        int32_t daylightOffset;
+        int32_t rawOffset;
+        row.tz->getOffset(date1, false, rawOffset, daylightOffset, status);
+        if (daylightOffset != 0) {
+            // The TimeZone is reporting that we are in daylight time for the winter date.
+            // The dates are for the wrong hemisphere, so swap them.
+            row.standardDate = date2;
+            row.daylightSavingDate = date1;
+        } else {
+            row.standardDate = date1;
+            row.daylightSavingDate = date2;
+        }
+
+        longFormat.format(row.standardDate, row.longStd);
+        shortFormat.format(row.standardDate, row.shortStd);
+        if (row.tz->useDaylightTime()) {
+            longFormat.format(row.daylightSavingDate, row.longDst);
+            shortFormat.format(row.daylightSavingDate, row.shortDst);
+        } else {
+            row.longDst = row.longStd;
+            row.shortDst = row.shortStd;
+        }
+
+        table.push_back(row);
+        usedAbbreviations[row.shortStd] = &row.longStd;
+        usedAbbreviations[row.shortDst] = &row.longDst;
+    }
+
+    // In the second pass, we create the Java String[][].
+    // We also look for any uncommon abbreviations that don't conflict with ones we've already seen.
+    jobjectArray result = env->NewObjectArray(idCount, JniConstants::stringArrayClass, NULL);
+    UnicodeString gmt("GMT", 3, US_INV);
+    for (size_t i = 0; i < table.size(); ++i) {
+        TimeZoneNames& row(table[i]);
+        // Did we get a GMT offset instead of an abbreviation?
+        if (row.shortStd.length() > 3 && row.shortStd.startsWith(gmt)) {
+            // See if we can do better...
+            UnicodeString uncommonStd, uncommonDst;
+            allShortFormat.setTimeZone(*row.tz);
+            allShortFormat.format(row.standardDate, uncommonStd);
+            if (row.tz->useDaylightTime()) {
+                allShortFormat.format(row.daylightSavingDate, uncommonDst);
+            } else {
+                uncommonDst = uncommonStd;
+            }
+
+            // If this abbreviation isn't already in use, we can use it.
+            AbbreviationMap::iterator it = usedAbbreviations.find(uncommonStd);
+            if (it == usedAbbreviations.end() || *(it->second) == row.longStd) {
+                row.shortStd = uncommonStd;
+                usedAbbreviations[row.shortStd] = &row.longStd;
+            }
+            it = usedAbbreviations.find(uncommonDst);
+            if (it == usedAbbreviations.end() || *(it->second) == row.longDst) {
+                row.shortDst = uncommonDst;
+                usedAbbreviations[row.shortDst] = &row.longDst;
+            }
+        }
+        // Fill in whatever we got.
+        ScopedLocalRef<jobjectArray> javaRow(env, env->NewObjectArray(5, JniConstants::stringClass, NULL));
+        ScopedLocalRef<jstring> id(env, reinterpret_cast<jstring>(env->GetObjectArrayElement(timeZoneIds, i)));
+        env->SetObjectArrayElement(javaRow.get(), 0, id.get());
+        setStringArrayElement(env, javaRow.get(), 1, row.longStd);
+        setStringArrayElement(env, javaRow.get(), 2, row.shortStd);
+        setStringArrayElement(env, javaRow.get(), 3, row.longDst);
+        setStringArrayElement(env, javaRow.get(), 4, row.shortDst);
+        env->SetObjectArrayElement(result, i, javaRow.get());
+        delete row.tz;
+    }
+
+    return result;
+}
+
+static JNINativeMethod gMethods[] = {
+    NATIVE_METHOD(TimeZones, forCountryCode, "(Ljava/lang/String;)[Ljava/lang/String;"),
+    NATIVE_METHOD(TimeZones, getZoneStringsImpl, "(Ljava/lang/String;[Ljava/lang/String;)[[Ljava/lang/String;"),
+};
+int register_libcore_icu_TimeZones(JNIEnv* env) {
+    return jniRegisterNativeMethods(env, "libcore/icu/TimeZones", gMethods, NELEM(gMethods));
+}
diff --git a/luni/src/main/native/libcore_io_IoUtils.cpp b/luni/src/main/native/libcore_io_IoUtils.cpp
deleted file mode 100644
index b7d312b..0000000
--- a/luni/src/main/native/libcore_io_IoUtils.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "IoUtils"
-
-#include "JNIHelp.h"
-#include "JniConstants.h"
-#include "NetworkUtilities.h"
-#include "ScopedPrimitiveArray.h"
-
-#include <errno.h>
-#include <unistd.h>
-
-static void IoUtils_close(JNIEnv* env, jclass, jobject fileDescriptor) {
-    // Get the FileDescriptor's 'fd' field and clear it.
-    // We need to do this before we can throw an IOException (http://b/3222087).
-    int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-    jniSetFileDescriptorOfFD(env, fileDescriptor, -1);
-
-    jint rc = TEMP_FAILURE_RETRY(close(fd));
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-    }
-}
-
-static jint IoUtils_getFd(JNIEnv* env, jclass, jobject fileDescriptor) {
-    return jniGetFDFromFileDescriptor(env, fileDescriptor);
-}
-
-static void IoUtils_pipe(JNIEnv* env, jclass, jintArray javaFds) {
-    ScopedIntArrayRW fds(env, javaFds);
-    if (fds.get() == NULL) {
-        return;
-    }
-    int rc = pipe(&fds[0]);
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-        return;
-    }
-}
-
-static void IoUtils_setFd(JNIEnv* env, jclass, jobject fileDescriptor, jint newValue) {
-    return jniSetFileDescriptorOfFD(env, fileDescriptor, newValue);
-}
-
-static void IoUtils_setBlocking(JNIEnv* env, jclass, jobject fileDescriptor, jboolean blocking) {
-    int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-    if (fd == -1) {
-        return;
-    }
-    if (!setBlocking(fd, blocking)) {
-        jniThrowIOException(env, errno);
-    }
-}
-
-static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(IoUtils, close, "(Ljava/io/FileDescriptor;)V"),
-    NATIVE_METHOD(IoUtils, getFd, "(Ljava/io/FileDescriptor;)I"),
-    NATIVE_METHOD(IoUtils, pipe, "([I)V"),
-    NATIVE_METHOD(IoUtils, setFd, "(Ljava/io/FileDescriptor;I)V"),
-    NATIVE_METHOD(IoUtils, setBlocking, "(Ljava/io/FileDescriptor;Z)V"),
-};
-int register_libcore_io_IoUtils(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "libcore/io/IoUtils", gMethods, NELEM(gMethods));
-}
diff --git a/luni/src/main/native/libcore_io_Memory.cpp b/luni/src/main/native/libcore_io_Memory.cpp
new file mode 100644
index 0000000..13ac4a0
--- /dev/null
+++ b/luni/src/main/native/libcore_io_Memory.cpp
@@ -0,0 +1,347 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Memory"
+
+#include "JNIHelp.h"
+#include "JniConstants.h"
+#include "ScopedPrimitiveArray.h"
+#include "UniquePtr.h"
+
+#include <byteswap.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/mman.h>
+
+#if defined(__arm__)
+// 32-bit ARM has load/store alignment restrictions for longs.
+#define LONG_ALIGNMENT_MASK 0x3
+#elif defined(__i386__)
+// x86 can load anything at any alignment.
+#define LONG_ALIGNMENT_MASK 0x0
+#else
+#error unknown load/store alignment restrictions for this architecture
+#endif
+
+template <typename T> static T cast(jint address) {
+    return reinterpret_cast<T>(static_cast<uintptr_t>(address));
+}
+
+static inline void swapShorts(jshort* dstShorts, const jshort* srcShorts, size_t count) {
+    // Do 32-bit swaps as long as possible...
+    jint* dst = reinterpret_cast<jint*>(dstShorts);
+    const jint* src = reinterpret_cast<const jint*>(srcShorts);
+    for (size_t i = 0; i < count / 2; ++i) {
+        jint v = *src++;                            // v=ABCD
+        v = bswap_32(v);                            // v=DCBA
+        jint v2 = (v << 16) | ((v >> 16) & 0xffff); // v=BADC
+        *dst++ = v2;
+    }
+    // ...with one last 16-bit swap if necessary.
+    if ((count % 2) != 0) {
+        jshort v = *reinterpret_cast<const jshort*>(src);
+        *reinterpret_cast<jshort*>(dst) = bswap_16(v);
+    }
+}
+
+static inline void swapInts(jint* dstInts, const jint* srcInts, size_t count) {
+    for (size_t i = 0; i < count; ++i) {
+        jint v = *srcInts++;
+        *dstInts++ = bswap_32(v);
+    }
+}
+
+static inline void swapLongs(jlong* dstLongs, const jlong* srcLongs, size_t count) {
+    jint* dst = reinterpret_cast<jint*>(dstLongs);
+    const jint* src = reinterpret_cast<const jint*>(srcLongs);
+    for (size_t i = 0; i < count; ++i) {
+        jint v1 = *src++;
+        jint v2 = *src++;
+        *dst++ = bswap_32(v2);
+        *dst++ = bswap_32(v1);
+    }
+}
+
+static void Memory_memmove(JNIEnv*, jclass, jint dstAddress, jint srcAddress, jlong length) {
+    memmove(cast<void*>(dstAddress), cast<const void*>(srcAddress), length);
+}
+
+static jbyte Memory_peekByte(JNIEnv*, jclass, jint srcAddress) {
+    return *cast<const jbyte*>(srcAddress);
+}
+
+static void Memory_peekByteArray(JNIEnv* env, jclass, jint srcAddress, jbyteArray dst, jint dstOffset, jint byteCount) {
+    env->SetByteArrayRegion(dst, dstOffset, byteCount, cast<const jbyte*>(srcAddress));
+}
+
+// Implements the peekXArray methods:
+// - For unswapped access, we just use the JNI SetXArrayRegion functions.
+// - For swapped access, we use GetXArrayElements and our own copy-and-swap routines.
+//   GetXArrayElements is disproportionately cheap on Dalvik because it doesn't copy (as opposed
+//   to Hotspot, which always copies). The SWAP_FN copies and swaps in one pass, which is cheaper
+//   than copying and then swapping in a second pass. Depending on future VM/GC changes, the
+//   swapped case might need to be revisited.
+#define PEEKER(SCALAR_TYPE, JNI_NAME, SWAP_TYPE, SWAP_FN) { \
+    if (swap) { \
+        Scoped ## JNI_NAME ## ArrayRW elements(env, dst); \
+        if (elements.get() == NULL) { \
+            return; \
+        } \
+        const SWAP_TYPE* src = cast<const SWAP_TYPE*>(srcAddress); \
+        SWAP_FN(reinterpret_cast<SWAP_TYPE*>(elements.get()) + dstOffset, src, count); \
+    } else { \
+        const SCALAR_TYPE* src = cast<const SCALAR_TYPE*>(srcAddress); \
+        env->Set ## JNI_NAME ## ArrayRegion(dst, dstOffset, count, src); \
+    } \
+}
+
+static void Memory_peekCharArray(JNIEnv* env, jclass, jint srcAddress, jcharArray dst, jint dstOffset, jint count, jboolean swap) {
+    PEEKER(jchar, Char, jshort, swapShorts);
+}
+
+static void Memory_peekDoubleArray(JNIEnv* env, jclass, jint srcAddress, jdoubleArray dst, jint dstOffset, jint count, jboolean swap) {
+    PEEKER(jdouble, Double, jlong, swapLongs);
+}
+
+static void Memory_peekFloatArray(JNIEnv* env, jclass, jint srcAddress, jfloatArray dst, jint dstOffset, jint count, jboolean swap) {
+    PEEKER(jfloat, Float, jint, swapInts);
+}
+
+static void Memory_peekIntArray(JNIEnv* env, jclass, jint srcAddress, jintArray dst, jint dstOffset, jint count, jboolean swap) {
+    PEEKER(jint, Int, jint, swapInts);
+}
+
+static void Memory_peekLongArray(JNIEnv* env, jclass, jint srcAddress, jlongArray dst, jint dstOffset, jint count, jboolean swap) {
+    PEEKER(jlong, Long, jlong, swapLongs);
+}
+
+static void Memory_peekShortArray(JNIEnv* env, jclass, jint srcAddress, jshortArray dst, jint dstOffset, jint count, jboolean swap) {
+    PEEKER(jshort, Short, jshort, swapShorts);
+}
+
+static void Memory_pokeByte(JNIEnv*, jclass, jint dstAddress, jbyte value) {
+    *cast<jbyte*>(dstAddress) = value;
+}
+
+static void Memory_pokeByteArray(JNIEnv* env, jclass, jint dstAddress, jbyteArray src, jint offset, jint length) {
+    env->GetByteArrayRegion(src, offset, length, cast<jbyte*>(dstAddress));
+}
+
+// Implements the pokeXArray methods:
+// - For unswapped access, we just use the JNI GetXArrayRegion functions.
+// - For swapped access, we use GetXArrayElements and our own copy-and-swap routines.
+//   GetXArrayElements is disproportionately cheap on Dalvik because it doesn't copy (as opposed
+//   to Hotspot, which always copies). The SWAP_FN copies and swaps in one pass, which is cheaper
+//   than copying and then swapping in a second pass. Depending on future VM/GC changes, the
+//   swapped case might need to be revisited.
+#define POKER(SCALAR_TYPE, JNI_NAME, SWAP_TYPE, SWAP_FN) { \
+    if (swap) { \
+        Scoped ## JNI_NAME ## ArrayRO elements(env, src); \
+        if (elements.get() == NULL) { \
+            return; \
+        } \
+        const SWAP_TYPE* src = reinterpret_cast<const SWAP_TYPE*>(elements.get()) + srcOffset; \
+        SWAP_FN(cast<SWAP_TYPE*>(dstAddress), src, count); \
+    } else { \
+        env->Get ## JNI_NAME ## ArrayRegion(src, srcOffset, count, cast<SCALAR_TYPE*>(dstAddress)); \
+    } \
+}
+
+static void Memory_pokeCharArray(JNIEnv* env, jclass, jint dstAddress, jcharArray src, jint srcOffset, jint count, jboolean swap) {
+    POKER(jchar, Char, jshort, swapShorts);
+}
+
+static void Memory_pokeDoubleArray(JNIEnv* env, jclass, jint dstAddress, jdoubleArray src, jint srcOffset, jint count, jboolean swap) {
+    POKER(jdouble, Double, jlong, swapLongs);
+}
+
+static void Memory_pokeFloatArray(JNIEnv* env, jclass, jint dstAddress, jfloatArray src, jint srcOffset, jint count, jboolean swap) {
+    POKER(jfloat, Float, jint, swapInts);
+}
+
+static void Memory_pokeIntArray(JNIEnv* env, jclass, jint dstAddress, jintArray src, jint srcOffset, jint count, jboolean swap) {
+    POKER(jint, Int, jint, swapInts);
+}
+
+static void Memory_pokeLongArray(JNIEnv* env, jclass, jint dstAddress, jlongArray src, jint srcOffset, jint count, jboolean swap) {
+    POKER(jlong, Long, jlong, swapLongs);
+}
+
+static void Memory_pokeShortArray(JNIEnv* env, jclass, jint dstAddress, jshortArray src, jint srcOffset, jint count, jboolean swap) {
+    POKER(jshort, Short, jshort, swapShorts);
+}
+
+static jshort Memory_peekShort(JNIEnv*, jclass, jint srcAddress, jboolean swap) {
+    jshort result = *cast<const jshort*>(srcAddress);
+    if (swap) {
+        result = bswap_16(result);
+    }
+    return result;
+}
+
+static void Memory_pokeShort(JNIEnv*, jclass, jint dstAddress, jshort value, jboolean swap) {
+    if (swap) {
+        value = bswap_16(value);
+    }
+    *cast<jshort*>(dstAddress) = value;
+}
+
+static jint Memory_peekInt(JNIEnv*, jclass, jint srcAddress, jboolean swap) {
+    jint result = *cast<const jint*>(srcAddress);
+    if (swap) {
+        result = bswap_32(result);
+    }
+    return result;
+}
+
+static void Memory_pokeInt(JNIEnv*, jclass, jint dstAddress, jint value, jboolean swap) {
+    if (swap) {
+        value = bswap_32(value);
+    }
+    *cast<jint*>(dstAddress) = value;
+}
+
+static jlong Memory_peekLong(JNIEnv*, jclass, jint srcAddress, jboolean swap) {
+    jlong result;
+    if ((srcAddress & LONG_ALIGNMENT_MASK) == 0) {
+        result = *cast<const jlong*>(srcAddress);
+    } else {
+        // Handle unaligned memory access one byte at a time
+        const jbyte* src = cast<const jbyte*>(srcAddress);
+        jbyte* dst = reinterpret_cast<jbyte*>(&result);
+        dst[0] = src[0];
+        dst[1] = src[1];
+        dst[2] = src[2];
+        dst[3] = src[3];
+        dst[4] = src[4];
+        dst[5] = src[5];
+        dst[6] = src[6];
+        dst[7] = src[7];
+    }
+    if (swap) {
+        result = bswap_64(result);
+    }
+    return result;
+}
+
+static void Memory_pokeLong(JNIEnv*, jclass, jint dstAddress, jlong value, jboolean swap) {
+    if (swap) {
+        value = bswap_64(value);
+    }
+    if ((dstAddress & LONG_ALIGNMENT_MASK) == 0) {
+        *cast<jlong*>(dstAddress) = value;
+    } else {
+        // Handle unaligned memory access one byte at a time
+        const jbyte* src = reinterpret_cast<const jbyte*>(&value);
+        jbyte* dst = cast<jbyte*>(dstAddress);
+        dst[0] = src[0];
+        dst[1] = src[1];
+        dst[2] = src[2];
+        dst[3] = src[3];
+        dst[4] = src[4];
+        dst[5] = src[5];
+        dst[6] = src[6];
+        dst[7] = src[7];
+    }
+}
+
+static void unsafeBulkCopy(jbyte* dst, const jbyte* src, jint byteCount,
+        jint sizeofElement, jboolean swap) {
+    if (!swap) {
+        memcpy(dst, src, byteCount);
+        return;
+    }
+
+    if (sizeofElement == 2) {
+        jshort* dstShorts = reinterpret_cast<jshort*>(dst);
+        const jshort* srcShorts = reinterpret_cast<const jshort*>(src);
+        swapShorts(dstShorts, srcShorts, byteCount / 2);
+    } else if (sizeofElement == 4) {
+        jint* dstInts = reinterpret_cast<jint*>(dst);
+        const jint* srcInts = reinterpret_cast<const jint*>(src);
+        swapInts(dstInts, srcInts, byteCount / 4);
+    } else if (sizeofElement == 8) {
+        jlong* dstLongs = reinterpret_cast<jlong*>(dst);
+        const jlong* srcLongs = reinterpret_cast<const jlong*>(src);
+        swapLongs(dstLongs, srcLongs, byteCount / 8);
+    }
+}
+
+static void Memory_unsafeBulkGet(JNIEnv* env, jclass, jobject dstObject, jint dstOffset,
+        jint byteCount, jbyteArray srcArray, jint srcOffset, jint sizeofElement, jboolean swap) {
+    ScopedByteArrayRO srcBytes(env, srcArray);
+    if (srcBytes.get() == NULL) {
+        return;
+    }
+    jarray dstArray = reinterpret_cast<jarray>(dstObject);
+    jbyte* dstBytes = reinterpret_cast<jbyte*>(env->GetPrimitiveArrayCritical(dstArray, NULL));
+    if (dstBytes == NULL) {
+        return;
+    }
+    jbyte* dst = dstBytes + dstOffset*sizeofElement;
+    const jbyte* src = srcBytes.get() + srcOffset;
+    unsafeBulkCopy(dst, src, byteCount, sizeofElement, swap);
+    env->ReleasePrimitiveArrayCritical(dstArray, dstBytes, 0);
+}
+
+static void Memory_unsafeBulkPut(JNIEnv* env, jclass, jbyteArray dstArray, jint dstOffset,
+        jint byteCount, jobject srcObject, jint srcOffset, jint sizeofElement, jboolean swap) {
+    ScopedByteArrayRW dstBytes(env, dstArray);
+    if (dstBytes.get() == NULL) {
+        return;
+    }
+    jarray srcArray = reinterpret_cast<jarray>(srcObject);
+    jbyte* srcBytes = reinterpret_cast<jbyte*>(env->GetPrimitiveArrayCritical(srcArray, NULL));
+    if (srcBytes == NULL) {
+        return;
+    }
+    jbyte* dst = dstBytes.get() + dstOffset;
+    const jbyte* src = srcBytes + srcOffset*sizeofElement;
+    unsafeBulkCopy(dst, src, byteCount, sizeofElement, swap);
+    env->ReleasePrimitiveArrayCritical(srcArray, srcBytes, 0);
+}
+
+static JNINativeMethod gMethods[] = {
+    NATIVE_METHOD(Memory, memmove, "(IIJ)V"),
+    NATIVE_METHOD(Memory, peekByte, "(I)B"),
+    NATIVE_METHOD(Memory, peekByteArray, "(I[BII)V"),
+    NATIVE_METHOD(Memory, peekCharArray, "(I[CIIZ)V"),
+    NATIVE_METHOD(Memory, peekDoubleArray, "(I[DIIZ)V"),
+    NATIVE_METHOD(Memory, peekFloatArray, "(I[FIIZ)V"),
+    NATIVE_METHOD(Memory, peekInt, "(IZ)I"),
+    NATIVE_METHOD(Memory, peekIntArray, "(I[IIIZ)V"),
+    NATIVE_METHOD(Memory, peekLong, "(IZ)J"),
+    NATIVE_METHOD(Memory, peekLongArray, "(I[JIIZ)V"),
+    NATIVE_METHOD(Memory, peekShort, "(IZ)S"),
+    NATIVE_METHOD(Memory, peekShortArray, "(I[SIIZ)V"),
+    NATIVE_METHOD(Memory, pokeByte, "(IB)V"),
+    NATIVE_METHOD(Memory, pokeByteArray, "(I[BII)V"),
+    NATIVE_METHOD(Memory, pokeCharArray, "(I[CIIZ)V"),
+    NATIVE_METHOD(Memory, pokeDoubleArray, "(I[DIIZ)V"),
+    NATIVE_METHOD(Memory, pokeFloatArray, "(I[FIIZ)V"),
+    NATIVE_METHOD(Memory, pokeInt, "(IIZ)V"),
+    NATIVE_METHOD(Memory, pokeIntArray, "(I[IIIZ)V"),
+    NATIVE_METHOD(Memory, pokeLong, "(IJZ)V"),
+    NATIVE_METHOD(Memory, pokeLongArray, "(I[JIIZ)V"),
+    NATIVE_METHOD(Memory, pokeShort, "(ISZ)V"),
+    NATIVE_METHOD(Memory, pokeShortArray, "(I[SIIZ)V"),
+    NATIVE_METHOD(Memory, unsafeBulkGet, "(Ljava/lang/Object;II[BIIZ)V"),
+    NATIVE_METHOD(Memory, unsafeBulkPut, "([BIILjava/lang/Object;IIZ)V"),
+};
+int register_libcore_io_Memory(JNIEnv* env) {
+    return jniRegisterNativeMethods(env, "libcore/io/Memory", gMethods, NELEM(gMethods));
+}
diff --git a/luni/src/main/native/libcore_io_OsConstants.cpp b/luni/src/main/native/libcore_io_OsConstants.cpp
new file mode 100644
index 0000000..6165256
--- /dev/null
+++ b/luni/src/main/native/libcore_io_OsConstants.cpp
@@ -0,0 +1,360 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "OsConstants"
+
+#include "JNIHelp.h"
+#include "JniConstants.h"
+#include "ScopedLocalRef.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <unistd.h>
+
+static void initConstant(JNIEnv* env, jclass c, const char* fieldName, int value) {
+    jfieldID field = env->GetStaticFieldID(c, fieldName, "I");
+    env->SetStaticIntField(c, field, value);
+}
+
+static void OsConstants_initConstants(JNIEnv* env, jclass c) {
+    initConstant(env, c, "AF_INET", AF_INET);
+    initConstant(env, c, "AF_INET6", AF_INET6);
+    initConstant(env, c, "AF_UNIX", AF_UNIX);
+    initConstant(env, c, "AF_UNSPEC", AF_UNSPEC);
+    initConstant(env, c, "E2BIG", E2BIG);
+    initConstant(env, c, "EACCES", EACCES);
+    initConstant(env, c, "EADDRINUSE", EADDRINUSE);
+    initConstant(env, c, "EADDRNOTAVAIL", EADDRNOTAVAIL);
+    initConstant(env, c, "EAFNOSUPPORT", EAFNOSUPPORT);
+    initConstant(env, c, "EAGAIN", EAGAIN);
+    initConstant(env, c, "EALREADY", EALREADY);
+    initConstant(env, c, "EBADF", EBADF);
+    initConstant(env, c, "EBADMSG", EBADMSG);
+    initConstant(env, c, "EBUSY", EBUSY);
+    initConstant(env, c, "ECANCELED", ECANCELED);
+    initConstant(env, c, "ECHILD", ECHILD);
+    initConstant(env, c, "ECONNABORTED", ECONNABORTED);
+    initConstant(env, c, "ECONNREFUSED", ECONNREFUSED);
+    initConstant(env, c, "ECONNRESET", ECONNRESET);
+    initConstant(env, c, "EDEADLK", EDEADLK);
+    initConstant(env, c, "EDESTADDRREQ", EDESTADDRREQ);
+    initConstant(env, c, "EDOM", EDOM);
+    initConstant(env, c, "EDQUOT", EDQUOT);
+    initConstant(env, c, "EEXIST", EEXIST);
+    initConstant(env, c, "EFAULT", EFAULT);
+    initConstant(env, c, "EFBIG", EFBIG);
+    initConstant(env, c, "EHOSTUNREACH", EHOSTUNREACH);
+    initConstant(env, c, "EIDRM", EIDRM);
+    initConstant(env, c, "EILSEQ", EILSEQ);
+    initConstant(env, c, "EINPROGRESS", EINPROGRESS);
+    initConstant(env, c, "EINTR", EINTR);
+    initConstant(env, c, "EINVAL", EINVAL);
+    initConstant(env, c, "EIO", EIO);
+    initConstant(env, c, "EISCONN", EISCONN);
+    initConstant(env, c, "EISDIR", EISDIR);
+    initConstant(env, c, "ELOOP", ELOOP);
+    initConstant(env, c, "EMFILE", EMFILE);
+    initConstant(env, c, "EMLINK", EMLINK);
+    initConstant(env, c, "EMSGSIZE", EMSGSIZE);
+    initConstant(env, c, "EMULTIHOP", EMULTIHOP);
+    initConstant(env, c, "ENAMETOOLONG", ENAMETOOLONG);
+    initConstant(env, c, "ENETDOWN", ENETDOWN);
+    initConstant(env, c, "ENETRESET", ENETRESET);
+    initConstant(env, c, "ENETUNREACH", ENETUNREACH);
+    initConstant(env, c, "ENFILE", ENFILE);
+    initConstant(env, c, "ENOBUFS", ENOBUFS);
+    initConstant(env, c, "ENODATA", ENODATA);
+    initConstant(env, c, "ENODEV", ENODEV);
+    initConstant(env, c, "ENOENT", ENOENT);
+    initConstant(env, c, "ENOEXEC", ENOEXEC);
+    initConstant(env, c, "ENOLCK", ENOLCK);
+    initConstant(env, c, "ENOLINK", ENOLINK);
+    initConstant(env, c, "ENOMEM", ENOMEM);
+    initConstant(env, c, "ENOMSG", ENOMSG);
+    initConstant(env, c, "ENOPROTOOPT", ENOPROTOOPT);
+    initConstant(env, c, "ENOSPC", ENOSPC);
+    initConstant(env, c, "ENOSR", ENOSR);
+    initConstant(env, c, "ENOSTR", ENOSTR);
+    initConstant(env, c, "ENOSYS", ENOSYS);
+    initConstant(env, c, "ENOTCONN", ENOTCONN);
+    initConstant(env, c, "ENOTDIR", ENOTDIR);
+    initConstant(env, c, "ENOTEMPTY", ENOTEMPTY);
+    initConstant(env, c, "ENOTSOCK", ENOTSOCK);
+    initConstant(env, c, "ENOTSUP", ENOTSUP);
+    initConstant(env, c, "ENOTTY", ENOTTY);
+    initConstant(env, c, "ENXIO", ENXIO);
+    initConstant(env, c, "EOPNOTSUPP", EOPNOTSUPP);
+    initConstant(env, c, "EOVERFLOW", EOVERFLOW);
+    initConstant(env, c, "EPERM", EPERM);
+    initConstant(env, c, "EPIPE", EPIPE);
+    initConstant(env, c, "EPROTO", EPROTO);
+    initConstant(env, c, "EPROTONOSUPPORT", EPROTONOSUPPORT);
+    initConstant(env, c, "EPROTOTYPE", EPROTOTYPE);
+    initConstant(env, c, "ERANGE", ERANGE);
+    initConstant(env, c, "EROFS", EROFS);
+    initConstant(env, c, "ESPIPE", ESPIPE);
+    initConstant(env, c, "ESRCH", ESRCH);
+    initConstant(env, c, "ESTALE", ESTALE);
+    initConstant(env, c, "ETIME", ETIME);
+    initConstant(env, c, "ETIMEDOUT", ETIMEDOUT);
+    initConstant(env, c, "ETXTBSY", ETXTBSY);
+    initConstant(env, c, "EWOULDBLOCK", EWOULDBLOCK);
+    initConstant(env, c, "EXDEV", EXDEV);
+    initConstant(env, c, "EXIT_FAILURE", EXIT_FAILURE);
+    initConstant(env, c, "EXIT_SUCCESS", EXIT_SUCCESS);
+    initConstant(env, c, "FD_CLOEXEC", FD_CLOEXEC);
+    initConstant(env, c, "FIONREAD", FIONREAD);
+    initConstant(env, c, "F_DUPFD", F_DUPFD);
+    initConstant(env, c, "F_GETFD", F_GETFD);
+    initConstant(env, c, "F_GETFL", F_GETFL);
+    initConstant(env, c, "F_GETLK", F_GETLK);
+    initConstant(env, c, "F_GETLK64", F_GETLK64);
+    initConstant(env, c, "F_GETOWN", F_GETOWN);
+    initConstant(env, c, "F_OK", F_OK);
+    initConstant(env, c, "F_RDLCK", F_RDLCK);
+    initConstant(env, c, "F_SETFD", F_SETFD);
+    initConstant(env, c, "F_SETFL", F_SETFL);
+    initConstant(env, c, "F_SETLK", F_SETLK);
+    initConstant(env, c, "F_SETLK64", F_SETLK64);
+    initConstant(env, c, "F_SETLKW", F_SETLKW);
+    initConstant(env, c, "F_SETLKW64", F_SETLKW64);
+    initConstant(env, c, "F_SETOWN", F_SETOWN);
+    initConstant(env, c, "F_UNLCK", F_UNLCK);
+    initConstant(env, c, "F_WRLCK", F_WRLCK);
+    initConstant(env, c, "IPPROTO_ICMP", IPPROTO_ICMP);
+    initConstant(env, c, "IPPROTO_IP", IPPROTO_IP);
+    initConstant(env, c, "IPPROTO_IPV6", IPPROTO_IPV6);
+    initConstant(env, c, "IPPROTO_RAW", IPPROTO_RAW);
+    initConstant(env, c, "IPPROTO_TCP", IPPROTO_TCP);
+    initConstant(env, c, "IPPROTO_UDP", IPPROTO_UDP);
+    initConstant(env, c, "IPV6_CHECKSUM", IPV6_CHECKSUM);
+    initConstant(env, c, "IPV6_MULTICAST_HOPS", IPV6_MULTICAST_HOPS);
+    initConstant(env, c, "IPV6_MULTICAST_IF", IPV6_MULTICAST_IF);
+    initConstant(env, c, "IPV6_MULTICAST_LOOP", IPV6_MULTICAST_LOOP);
+    initConstant(env, c, "IPV6_RECVDSTOPTS", IPV6_RECVDSTOPTS);
+    initConstant(env, c, "IPV6_RECVHOPLIMIT", IPV6_RECVHOPLIMIT);
+    initConstant(env, c, "IPV6_RECVHOPOPTS", IPV6_RECVHOPOPTS);
+    initConstant(env, c, "IPV6_RECVPKTINFO", IPV6_RECVPKTINFO);
+    initConstant(env, c, "IPV6_RECVRTHDR", IPV6_RECVRTHDR);
+    initConstant(env, c, "IPV6_RECVTCLASS", IPV6_RECVTCLASS);
+    initConstant(env, c, "IPV6_TCLASS", IPV6_TCLASS);
+    initConstant(env, c, "IPV6_UNICAST_HOPS", IPV6_UNICAST_HOPS);
+    initConstant(env, c, "IPV6_V6ONLY", IPV6_V6ONLY);
+    initConstant(env, c, "IP_MULTICAST_IF", IP_MULTICAST_IF);
+    initConstant(env, c, "IP_MULTICAST_LOOP", IP_MULTICAST_LOOP);
+    initConstant(env, c, "IP_MULTICAST_TTL", IP_MULTICAST_TTL);
+    initConstant(env, c, "IP_TOS", IP_TOS);
+    initConstant(env, c, "IP_TTL", IP_TTL);
+    initConstant(env, c, "MAP_FIXED", MAP_FIXED);
+    initConstant(env, c, "MAP_PRIVATE", MAP_PRIVATE);
+    initConstant(env, c, "MAP_SHARED", MAP_SHARED);
+    initConstant(env, c, "MCAST_JOIN_GROUP", MCAST_JOIN_GROUP);
+    initConstant(env, c, "MCAST_LEAVE_GROUP", MCAST_LEAVE_GROUP);
+    initConstant(env, c, "MCL_CURRENT", MCL_CURRENT);
+    initConstant(env, c, "MCL_FUTURE", MCL_FUTURE);
+    initConstant(env, c, "MSG_CTRUNC", MSG_CTRUNC);
+    initConstant(env, c, "MSG_DONTROUTE", MSG_DONTROUTE);
+    initConstant(env, c, "MSG_EOR", MSG_EOR);
+    initConstant(env, c, "MSG_OOB", MSG_OOB);
+    initConstant(env, c, "MSG_PEEK", MSG_PEEK);
+    initConstant(env, c, "MSG_TRUNC", MSG_TRUNC);
+    initConstant(env, c, "MSG_WAITALL", MSG_WAITALL);
+    initConstant(env, c, "MS_ASYNC", MS_ASYNC);
+    initConstant(env, c, "MS_INVALIDATE", MS_INVALIDATE);
+    initConstant(env, c, "MS_SYNC", MS_SYNC);
+    initConstant(env, c, "O_ACCMODE", O_ACCMODE);
+    initConstant(env, c, "O_APPEND", O_APPEND);
+    initConstant(env, c, "O_CREAT", O_CREAT);
+    initConstant(env, c, "O_EXCL", O_EXCL);
+    initConstant(env, c, "O_NOCTTY", O_NOCTTY);
+    initConstant(env, c, "O_NONBLOCK", O_NONBLOCK);
+    initConstant(env, c, "O_RDONLY", O_RDONLY);
+    initConstant(env, c, "O_RDWR", O_RDWR);
+    initConstant(env, c, "O_SYNC", O_SYNC);
+    initConstant(env, c, "O_TRUNC", O_TRUNC);
+    initConstant(env, c, "O_WRONLY", O_WRONLY);
+    initConstant(env, c, "PROT_EXEC", PROT_EXEC);
+    initConstant(env, c, "PROT_NONE", PROT_NONE);
+    initConstant(env, c, "PROT_READ", PROT_READ);
+    initConstant(env, c, "PROT_WRITE", PROT_WRITE);
+    initConstant(env, c, "R_OK", R_OK);
+    initConstant(env, c, "SEEK_CUR", SEEK_CUR);
+    initConstant(env, c, "SEEK_END", SEEK_END);
+    initConstant(env, c, "SEEK_SET", SEEK_SET);
+    initConstant(env, c, "SHUT_RD", SHUT_RD);
+    initConstant(env, c, "SHUT_RDWR", SHUT_RDWR);
+    initConstant(env, c, "SHUT_WR", SHUT_WR);
+    initConstant(env, c, "SOCK_DGRAM", SOCK_DGRAM);
+    initConstant(env, c, "SOCK_RAW", SOCK_RAW);
+    initConstant(env, c, "SOCK_SEQPACKET", SOCK_SEQPACKET);
+    initConstant(env, c, "SOCK_STREAM", SOCK_STREAM);
+    initConstant(env, c, "SOL_SOCKET", SOL_SOCKET);
+    initConstant(env, c, "SO_BROADCAST", SO_BROADCAST);
+    initConstant(env, c, "SO_DEBUG", SO_DEBUG);
+    initConstant(env, c, "SO_DONTROUTE", SO_DONTROUTE);
+    initConstant(env, c, "SO_ERROR", SO_ERROR);
+    initConstant(env, c, "SO_KEEPALIVE", SO_KEEPALIVE);
+    initConstant(env, c, "SO_LINGER", SO_LINGER);
+    initConstant(env, c, "SO_OOBINLINE", SO_OOBINLINE);
+    initConstant(env, c, "SO_RCVBUF", SO_RCVBUF);
+    initConstant(env, c, "SO_RCVLOWAT", SO_RCVLOWAT);
+    initConstant(env, c, "SO_RCVTIMEO", SO_RCVTIMEO);
+    initConstant(env, c, "SO_REUSEADDR", SO_REUSEADDR);
+    initConstant(env, c, "SO_SNDBUF", SO_SNDBUF);
+    initConstant(env, c, "SO_SNDLOWAT", SO_SNDLOWAT);
+    initConstant(env, c, "SO_SNDTIMEO", SO_SNDTIMEO);
+    initConstant(env, c, "SO_TYPE", SO_TYPE);
+    initConstant(env, c, "STDERR_FILENO", STDERR_FILENO);
+    initConstant(env, c, "STDIN_FILENO", STDIN_FILENO);
+    initConstant(env, c, "STDOUT_FILENO", STDOUT_FILENO);
+    initConstant(env, c, "S_IFBLK", S_IFBLK);
+    initConstant(env, c, "S_IFCHR", S_IFCHR);
+    initConstant(env, c, "S_IFDIR", S_IFDIR);
+    initConstant(env, c, "S_IFIFO", S_IFIFO);
+    initConstant(env, c, "S_IFLNK", S_IFLNK);
+    initConstant(env, c, "S_IFMT", S_IFMT);
+    initConstant(env, c, "S_IFREG", S_IFREG);
+    initConstant(env, c, "S_IFSOCK", S_IFSOCK);
+    initConstant(env, c, "S_IRGRP", S_IRGRP);
+    initConstant(env, c, "S_IROTH", S_IROTH);
+    initConstant(env, c, "S_IRUSR", S_IRUSR);
+    initConstant(env, c, "S_IRWXG", S_IRWXG);
+    initConstant(env, c, "S_IRWXO", S_IRWXO);
+    initConstant(env, c, "S_IRWXU", S_IRWXU);
+    initConstant(env, c, "S_ISGID", S_ISGID);
+    initConstant(env, c, "S_ISUID", S_ISUID);
+    initConstant(env, c, "S_ISVTX", S_ISVTX);
+    initConstant(env, c, "S_IWGRP", S_IWGRP);
+    initConstant(env, c, "S_IWOTH", S_IWOTH);
+    initConstant(env, c, "S_IWUSR", S_IWUSR);
+    initConstant(env, c, "S_IXGRP", S_IXGRP);
+    initConstant(env, c, "S_IXOTH", S_IXOTH);
+    initConstant(env, c, "S_IXUSR", S_IXUSR);
+    initConstant(env, c, "TCP_NODELAY", TCP_NODELAY);
+    initConstant(env, c, "WCONTINUED", WCONTINUED);
+    initConstant(env, c, "WEXITED", WEXITED);
+    initConstant(env, c, "WNOHANG", WNOHANG);
+    initConstant(env, c, "WNOWAIT", WNOWAIT);
+    initConstant(env, c, "WSTOPPED", WSTOPPED);
+    initConstant(env, c, "WUNTRACED", WUNTRACED);
+    initConstant(env, c, "W_OK", W_OK);
+    initConstant(env, c, "X_OK", X_OK);
+    initConstant(env, c, "_SC_2_CHAR_TERM", _SC_2_CHAR_TERM);
+    initConstant(env, c, "_SC_2_C_BIND", _SC_2_C_BIND);
+    initConstant(env, c, "_SC_2_C_DEV", _SC_2_C_DEV);
+    initConstant(env, c, "_SC_2_C_VERSION", _SC_2_C_VERSION);
+    initConstant(env, c, "_SC_2_FORT_DEV", _SC_2_FORT_DEV);
+    initConstant(env, c, "_SC_2_FORT_RUN", _SC_2_FORT_RUN);
+    initConstant(env, c, "_SC_2_LOCALEDEF", _SC_2_LOCALEDEF);
+    initConstant(env, c, "_SC_2_SW_DEV", _SC_2_SW_DEV);
+    initConstant(env, c, "_SC_2_UPE", _SC_2_UPE);
+    initConstant(env, c, "_SC_2_VERSION", _SC_2_VERSION);
+    initConstant(env, c, "_SC_AIO_LISTIO_MAX", _SC_AIO_LISTIO_MAX);
+    initConstant(env, c, "_SC_AIO_MAX", _SC_AIO_MAX);
+    initConstant(env, c, "_SC_AIO_PRIO_DELTA_MAX", _SC_AIO_PRIO_DELTA_MAX);
+    initConstant(env, c, "_SC_ARG_MAX", _SC_ARG_MAX);
+    initConstant(env, c, "_SC_ASYNCHRONOUS_IO", _SC_ASYNCHRONOUS_IO);
+    initConstant(env, c, "_SC_ATEXIT_MAX", _SC_ATEXIT_MAX);
+    initConstant(env, c, "_SC_AVPHYS_PAGES", _SC_AVPHYS_PAGES);
+    initConstant(env, c, "_SC_BC_BASE_MAX", _SC_BC_BASE_MAX);
+    initConstant(env, c, "_SC_BC_DIM_MAX", _SC_BC_DIM_MAX);
+    initConstant(env, c, "_SC_BC_SCALE_MAX", _SC_BC_SCALE_MAX);
+    initConstant(env, c, "_SC_BC_STRING_MAX", _SC_BC_STRING_MAX);
+    initConstant(env, c, "_SC_CHILD_MAX", _SC_CHILD_MAX);
+    initConstant(env, c, "_SC_CLK_TCK", _SC_CLK_TCK);
+    initConstant(env, c, "_SC_COLL_WEIGHTS_MAX", _SC_COLL_WEIGHTS_MAX);
+    initConstant(env, c, "_SC_DELAYTIMER_MAX", _SC_DELAYTIMER_MAX);
+    initConstant(env, c, "_SC_EXPR_NEST_MAX", _SC_EXPR_NEST_MAX);
+    initConstant(env, c, "_SC_FSYNC", _SC_FSYNC);
+    initConstant(env, c, "_SC_GETGR_R_SIZE_MAX", _SC_GETGR_R_SIZE_MAX);
+    initConstant(env, c, "_SC_GETPW_R_SIZE_MAX", _SC_GETPW_R_SIZE_MAX);
+    initConstant(env, c, "_SC_IOV_MAX", _SC_IOV_MAX);
+    initConstant(env, c, "_SC_JOB_CONTROL", _SC_JOB_CONTROL);
+    initConstant(env, c, "_SC_LINE_MAX", _SC_LINE_MAX);
+    initConstant(env, c, "_SC_LOGIN_NAME_MAX", _SC_LOGIN_NAME_MAX);
+    initConstant(env, c, "_SC_MAPPED_FILES", _SC_MAPPED_FILES);
+    initConstant(env, c, "_SC_MEMLOCK", _SC_MEMLOCK);
+    initConstant(env, c, "_SC_MEMLOCK_RANGE", _SC_MEMLOCK_RANGE);
+    initConstant(env, c, "_SC_MEMORY_PROTECTION", _SC_MEMORY_PROTECTION);
+    initConstant(env, c, "_SC_MESSAGE_PASSING", _SC_MESSAGE_PASSING);
+    initConstant(env, c, "_SC_MQ_OPEN_MAX", _SC_MQ_OPEN_MAX);
+    initConstant(env, c, "_SC_MQ_PRIO_MAX", _SC_MQ_PRIO_MAX);
+    initConstant(env, c, "_SC_NGROUPS_MAX", _SC_NGROUPS_MAX);
+    initConstant(env, c, "_SC_NPROCESSORS_CONF", _SC_NPROCESSORS_CONF);
+    initConstant(env, c, "_SC_NPROCESSORS_ONLN", _SC_NPROCESSORS_ONLN);
+    initConstant(env, c, "_SC_OPEN_MAX", _SC_OPEN_MAX);
+    initConstant(env, c, "_SC_PAGESIZE", _SC_PAGESIZE);
+    initConstant(env, c, "_SC_PAGE_SIZE", _SC_PAGE_SIZE);
+    initConstant(env, c, "_SC_PASS_MAX", _SC_PASS_MAX);
+    initConstant(env, c, "_SC_PHYS_PAGES", _SC_PHYS_PAGES);
+    initConstant(env, c, "_SC_PRIORITIZED_IO", _SC_PRIORITIZED_IO);
+    initConstant(env, c, "_SC_PRIORITY_SCHEDULING", _SC_PRIORITY_SCHEDULING);
+    initConstant(env, c, "_SC_REALTIME_SIGNALS", _SC_REALTIME_SIGNALS);
+    initConstant(env, c, "_SC_RE_DUP_MAX", _SC_RE_DUP_MAX);
+    initConstant(env, c, "_SC_RTSIG_MAX", _SC_RTSIG_MAX);
+    initConstant(env, c, "_SC_SAVED_IDS", _SC_SAVED_IDS);
+    initConstant(env, c, "_SC_SEMAPHORES", _SC_SEMAPHORES);
+    initConstant(env, c, "_SC_SEM_NSEMS_MAX", _SC_SEM_NSEMS_MAX);
+    initConstant(env, c, "_SC_SEM_VALUE_MAX", _SC_SEM_VALUE_MAX);
+    initConstant(env, c, "_SC_SHARED_MEMORY_OBJECTS", _SC_SHARED_MEMORY_OBJECTS);
+    initConstant(env, c, "_SC_SIGQUEUE_MAX", _SC_SIGQUEUE_MAX);
+    initConstant(env, c, "_SC_STREAM_MAX", _SC_STREAM_MAX);
+    initConstant(env, c, "_SC_SYNCHRONIZED_IO", _SC_SYNCHRONIZED_IO);
+    initConstant(env, c, "_SC_THREADS", _SC_THREADS);
+    initConstant(env, c, "_SC_THREAD_ATTR_STACKADDR", _SC_THREAD_ATTR_STACKADDR);
+    initConstant(env, c, "_SC_THREAD_ATTR_STACKSIZE", _SC_THREAD_ATTR_STACKSIZE);
+    initConstant(env, c, "_SC_THREAD_DESTRUCTOR_ITERATIONS", _SC_THREAD_DESTRUCTOR_ITERATIONS);
+    initConstant(env, c, "_SC_THREAD_KEYS_MAX", _SC_THREAD_KEYS_MAX);
+    initConstant(env, c, "_SC_THREAD_PRIORITY_SCHEDULING", _SC_THREAD_PRIORITY_SCHEDULING);
+    initConstant(env, c, "_SC_THREAD_PRIO_INHERIT", _SC_THREAD_PRIO_INHERIT);
+    initConstant(env, c, "_SC_THREAD_PRIO_PROTECT", _SC_THREAD_PRIO_PROTECT);
+    initConstant(env, c, "_SC_THREAD_SAFE_FUNCTIONS", _SC_THREAD_SAFE_FUNCTIONS);
+    initConstant(env, c, "_SC_THREAD_STACK_MIN", _SC_THREAD_STACK_MIN);
+    initConstant(env, c, "_SC_THREAD_THREADS_MAX", _SC_THREAD_THREADS_MAX);
+    initConstant(env, c, "_SC_TIMERS", _SC_TIMERS);
+    initConstant(env, c, "_SC_TIMER_MAX", _SC_TIMER_MAX);
+    initConstant(env, c, "_SC_TTY_NAME_MAX", _SC_TTY_NAME_MAX);
+    initConstant(env, c, "_SC_TZNAME_MAX", _SC_TZNAME_MAX);
+    initConstant(env, c, "_SC_VERSION", _SC_VERSION);
+    initConstant(env, c, "_SC_XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32);
+    initConstant(env, c, "_SC_XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG);
+    initConstant(env, c, "_SC_XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64);
+    initConstant(env, c, "_SC_XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG);
+    initConstant(env, c, "_SC_XOPEN_CRYPT", _SC_XOPEN_CRYPT);
+    initConstant(env, c, "_SC_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N);
+    initConstant(env, c, "_SC_XOPEN_LEGACY", _SC_XOPEN_LEGACY);
+    initConstant(env, c, "_SC_XOPEN_REALTIME", _SC_XOPEN_REALTIME);
+    initConstant(env, c, "_SC_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS);
+    initConstant(env, c, "_SC_XOPEN_SHM", _SC_XOPEN_SHM);
+    initConstant(env, c, "_SC_XOPEN_UNIX", _SC_XOPEN_UNIX);
+    initConstant(env, c, "_SC_XOPEN_VERSION", _SC_XOPEN_VERSION);
+    initConstant(env, c, "_SC_XOPEN_XCU_VERSION", _SC_XOPEN_XCU_VERSION);
+}
+
+static JNINativeMethod gMethods[] = {
+    NATIVE_METHOD(OsConstants, initConstants, "()V"),
+};
+int register_libcore_io_OsConstants(JNIEnv* env) {
+    return jniRegisterNativeMethods(env, "libcore/io/OsConstants", gMethods, NELEM(gMethods));
+}
diff --git a/luni/src/main/native/libcore_io_Posix.cpp b/luni/src/main/native/libcore_io_Posix.cpp
new file mode 100644
index 0000000..6c86011
--- /dev/null
+++ b/luni/src/main/native/libcore_io_Posix.cpp
@@ -0,0 +1,749 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#define LOG_TAG "Posix"
+
+#include "JNIHelp.h"
+#include "JniConstants.h"
+#include "JniException.h"
+#include "NetworkUtilities.h"
+#include "ScopedPrimitiveArray.h"
+#include "ScopedUtfChars.h"
+#include "StaticAssert.h"
+#include "toStringArray.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <stdlib.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/sendfile.h>
+#include <sys/socket.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/utsname.h>
+#include <sys/vfs.h> // Bionic doesn't have <sys/statvfs.h>
+#include <unistd.h>
+
+static void throwErrnoException(JNIEnv* env, const char* name) {
+    int errnum = errno;
+
+    jthrowable cause = NULL;
+    if (env->ExceptionCheck()) {
+        cause = env->ExceptionOccurred();
+        env->ExceptionClear();
+    }
+
+    ScopedLocalRef<jstring> javaName(env, env->NewStringUTF(name));
+    if (javaName.get() == NULL) {
+        // Not really much we can do here. We're probably dead in the water,
+        // but let's try to stumble on...
+        env->ExceptionClear();
+    }
+
+    jobject exception;
+    if (cause != NULL) {
+        static jmethodID ctor = env->GetMethodID(JniConstants::errnoExceptionClass, "<init>",
+                "(Ljava/lang/String;ILjava/lang/Throwable;)V");
+        exception = env->NewObject(JniConstants::errnoExceptionClass, ctor,
+                javaName.get(), errnum, cause);
+    } else {
+        static jmethodID ctor = env->GetMethodID(JniConstants::errnoExceptionClass, "<init>",
+                "(Ljava/lang/String;I)V");
+        exception = env->NewObject(JniConstants::errnoExceptionClass, ctor, javaName.get(), errnum);
+    }
+    env->Throw(reinterpret_cast<jthrowable>(exception));
+}
+
+template <typename rc_t>
+static rc_t throwIfMinusOne(JNIEnv* env, const char* name, rc_t rc) {
+    if (rc == rc_t(-1)) {
+        throwErrnoException(env, name);
+    }
+    return rc;
+}
+
+template <typename T>
+class IoVec {
+public:
+    IoVec(JNIEnv* env, size_t bufferCount) : mEnv(env), mBufferCount(bufferCount) {
+    }
+
+    bool init(jobjectArray javaBuffers, jintArray javaOffsets, jintArray javaByteCounts) {
+        // We can't delete our local references until after the I/O, so make sure we have room.
+        if (mEnv->PushLocalFrame(mBufferCount + 16) < 0) {
+            return false;
+        }
+        ScopedIntArrayRO offsets(mEnv, javaOffsets);
+        if (offsets.get() == NULL) {
+            return false;
+        }
+        ScopedIntArrayRO byteCounts(mEnv, javaByteCounts);
+        if (byteCounts.get() == NULL) {
+            return false;
+        }
+        // TODO: Linux actually has a 1024 buffer limit. glibc works around this, and we should too.
+        for (size_t i = 0; i < mBufferCount; ++i) {
+            jobject buffer = mEnv->GetObjectArrayElement(javaBuffers, i);
+            jbyte* ptr;
+            if (mEnv->IsInstanceOf(buffer, JniConstants::byteArrayClass)) {
+                // We need to pin the array for the duration.
+                jbyteArray byteArray = reinterpret_cast<jbyteArray>(buffer);
+                mScopedByteArrays.push_back(new T(mEnv, byteArray));
+                ptr = const_cast<jbyte*>(mScopedByteArrays.back()->get());
+            } else {
+                // A direct ByteBuffer is easier.
+                ptr = reinterpret_cast<jbyte*>(mEnv->GetDirectBufferAddress(buffer));
+            }
+            if (ptr == NULL) {
+                return false;
+            }
+            struct iovec iov;
+            iov.iov_base = reinterpret_cast<void*>(ptr + offsets[i]);
+            iov.iov_len = byteCounts[i];
+            mIoVec.push_back(iov);
+        }
+        return true;
+    }
+
+    ~IoVec() {
+        for (size_t i = 0; i < mScopedByteArrays.size(); ++i) {
+            delete mScopedByteArrays[i];
+        }
+        mEnv->PopLocalFrame(NULL);
+    }
+
+    iovec* get() {
+        return &mIoVec[0];
+    }
+
+    size_t size() {
+        return mBufferCount;
+    }
+
+private:
+    JNIEnv* mEnv;
+    size_t mBufferCount;
+    std::vector<iovec> mIoVec;
+    std::vector<T*> mScopedByteArrays;
+};
+
+static jobject makeInetSocketAddress(JNIEnv* env, const sockaddr_storage* ss, int port) {
+    jobject inetAddress = socketAddressToInetAddress(env, ss);
+    if (inetAddress == NULL) {
+        return NULL;
+    }
+    static jmethodID ctor = env->GetMethodID(JniConstants::inetSocketAddressClass, "<init>",
+            "(Ljava/net/InetAddress;I)V");
+    return env->NewObject(JniConstants::inetSocketAddressClass, ctor, inetAddress, port);
+}
+
+static jobject makeSocketAddress(JNIEnv* env, const sockaddr_storage* ss) {
+    if (ss->ss_family == AF_INET) {
+        int port = ntohs(reinterpret_cast<const sockaddr_in*>(ss)->sin_port);
+        return makeInetSocketAddress(env, ss, port);
+    } else if (ss->ss_family == AF_INET6) {
+        int port = ntohs(reinterpret_cast<const sockaddr_in6*>(ss)->sin6_port);
+        return makeInetSocketAddress(env, ss, port);
+    }
+    // TODO: support AF_UNIX and AF_UNSPEC, and have some other behavior for other families
+    return NULL;
+}
+
+static jobject makeStructStat(JNIEnv* env, const struct stat& sb) {
+    static jmethodID ctor = env->GetMethodID(JniConstants::structStatClass, "<init>",
+            "(JJIJIIJJJJJJJ)V");
+    return env->NewObject(JniConstants::structStatClass, ctor,
+            static_cast<jlong>(sb.st_dev), static_cast<jlong>(sb.st_ino),
+            static_cast<jint>(sb.st_mode), static_cast<jlong>(sb.st_nlink),
+            static_cast<jint>(sb.st_uid), static_cast<jint>(sb.st_gid),
+            static_cast<jlong>(sb.st_rdev), static_cast<jlong>(sb.st_size),
+            static_cast<jlong>(sb.st_atime), static_cast<jlong>(sb.st_mtime),
+            static_cast<jlong>(sb.st_ctime), static_cast<jlong>(sb.st_blksize),
+            static_cast<jlong>(sb.st_blocks));
+}
+
+static jobject makeStructStatFs(JNIEnv* env, const struct statfs& sb) {
+    STATIC_ASSERT(sizeof(sb.f_bavail) == sizeof(jlong), statfs_not_64_bit);
+    STATIC_ASSERT(sizeof(sb.f_bfree) == sizeof(jlong), statfs_not_64_bit);
+    STATIC_ASSERT(sizeof(sb.f_blocks) == sizeof(jlong), statfs_not_64_bit);
+
+    static jmethodID ctor = env->GetMethodID(JniConstants::structStatFsClass, "<init>",
+            "(JJJJJJJJ)V");
+    return env->NewObject(JniConstants::structStatFsClass, ctor, static_cast<jlong>(sb.f_bsize),
+            static_cast<jlong>(sb.f_blocks), static_cast<jlong>(sb.f_bfree),
+            static_cast<jlong>(sb.f_bavail), static_cast<jlong>(sb.f_files),
+            static_cast<jlong>(sb.f_ffree), static_cast<jlong>(sb.f_namelen),
+            static_cast<jlong>(sb.f_frsize));
+}
+
+static jobject makeStructLinger(JNIEnv* env, const struct linger& l) {
+    static jmethodID ctor = env->GetMethodID(JniConstants::structLingerClass, "<init>", "(II)V");
+    return env->NewObject(JniConstants::structLingerClass, ctor, l.l_onoff, l.l_linger);
+}
+
+static jobject makeStructTimeval(JNIEnv* env, const struct timeval& tv) {
+    static jmethodID ctor = env->GetMethodID(JniConstants::structTimevalClass, "<init>", "(JJ)V");
+    return env->NewObject(JniConstants::structTimevalClass, ctor,
+            static_cast<jlong>(tv.tv_sec), static_cast<jlong>(tv.tv_usec));
+}
+
+static jobject makeStructUtsname(JNIEnv* env, const struct utsname& buf) {
+#define TO_JAVA_STRING(NAME) \
+        jstring NAME = env->NewStringUTF(buf. NAME); \
+        if (NAME == NULL) return NULL;
+
+    TO_JAVA_STRING(sysname);
+    TO_JAVA_STRING(nodename);
+    TO_JAVA_STRING(release);
+    TO_JAVA_STRING(version);
+    TO_JAVA_STRING(machine);
+#undef TO_JAVA_STRING
+
+    static jmethodID ctor = env->GetMethodID(JniConstants::structUtsnameClass, "<init>",
+            "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
+    return env->NewObject(JniConstants::structUtsnameClass, ctor,
+            sysname, nodename, release, version, machine);
+};
+
+static jobject doStat(JNIEnv* env, jstring javaPath, bool isLstat) {
+    ScopedUtfChars path(env, javaPath);
+    if (path.c_str() == NULL) {
+        return NULL;
+    }
+    struct stat sb;
+    int rc = isLstat ? TEMP_FAILURE_RETRY(lstat(path.c_str(), &sb))
+                     : TEMP_FAILURE_RETRY(stat(path.c_str(), &sb));
+    if (rc == -1) {
+        throwErrnoException(env, isLstat ? "lstat" : "stat");
+        return NULL;
+    }
+    return makeStructStat(env, sb);
+}
+
+static jboolean Posix_access(JNIEnv* env, jobject, jstring javaPath, jint mode) {
+    ScopedUtfChars path(env, javaPath);
+    if (path.c_str() == NULL) {
+        return JNI_FALSE;
+    }
+    int rc = TEMP_FAILURE_RETRY(access(path.c_str(), mode));
+    if (rc == -1) {
+        throwErrnoException(env, "access");
+    }
+    return (rc == 0);
+}
+
+static void Posix_chmod(JNIEnv* env, jobject, jstring javaPath, jint mode) {
+    ScopedUtfChars path(env, javaPath);
+    if (path.c_str() == NULL) {
+        return;
+    }
+    throwIfMinusOne(env, "chmod", TEMP_FAILURE_RETRY(chmod(path.c_str(), mode)));
+}
+
+static void Posix_close(JNIEnv* env, jobject, jobject javaFd) {
+    // Get the FileDescriptor's 'fd' field and clear it.
+    // We need to do this before we can throw an IOException (http://b/3222087).
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    jniSetFileDescriptorOfFD(env, javaFd, -1);
+
+    // Even if close(2) fails with EINTR, the fd will have been closed.
+    // Using TEMP_FAILURE_RETRY will either lead to EBADF or closing someone else's fd.
+    // http://lkml.indiana.edu/hypermail/linux/kernel/0509.1/0877.html
+    throwIfMinusOne(env, "close", close(fd));
+}
+
+static jobjectArray Posix_environ(JNIEnv* env, jobject) {
+    extern char** environ; // Standard, but not in any header file.
+    return toStringArray(env, environ);
+}
+
+static jint Posix_fcntlVoid(JNIEnv* env, jobject, jobject javaFd, jint cmd) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    return throwIfMinusOne(env, "fcntl", TEMP_FAILURE_RETRY(fcntl(fd, cmd)));
+}
+
+static jint Posix_fcntlLong(JNIEnv* env, jobject, jobject javaFd, jint cmd, jlong arg) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    return throwIfMinusOne(env, "fcntl", TEMP_FAILURE_RETRY(fcntl(fd, cmd, arg)));
+}
+
+static jint Posix_fcntlFlock(JNIEnv* env, jobject, jobject javaFd, jint cmd, jobject javaFlock) {
+    static jfieldID typeFid = env->GetFieldID(JniConstants::structFlockClass, "l_type", "S");
+    static jfieldID whenceFid = env->GetFieldID(JniConstants::structFlockClass, "l_whence", "S");
+    static jfieldID startFid = env->GetFieldID(JniConstants::structFlockClass, "l_start", "J");
+    static jfieldID lenFid = env->GetFieldID(JniConstants::structFlockClass, "l_len", "J");
+    static jfieldID pidFid = env->GetFieldID(JniConstants::structFlockClass, "l_pid", "I");
+
+    struct flock64 lock;
+    memset(&lock, 0, sizeof(lock));
+    lock.l_type = env->GetShortField(javaFlock, typeFid);
+    lock.l_whence = env->GetShortField(javaFlock, whenceFid);
+    lock.l_start = env->GetLongField(javaFlock, startFid);
+    lock.l_len = env->GetLongField(javaFlock, lenFid);
+    lock.l_pid = env->GetIntField(javaFlock, pidFid);
+
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    int rc = throwIfMinusOne(env, "fcntl", TEMP_FAILURE_RETRY(fcntl(fd, cmd, &lock)));
+    if (rc != -1) {
+        env->SetShortField(javaFlock, typeFid, lock.l_type);
+        env->SetShortField(javaFlock, whenceFid, lock.l_whence);
+        env->SetLongField(javaFlock, startFid, lock.l_start);
+        env->SetLongField(javaFlock, lenFid, lock.l_len);
+        env->SetIntField(javaFlock, pidFid, lock.l_pid);
+    }
+    return rc;
+}
+
+static void Posix_fdatasync(JNIEnv* env, jobject, jobject javaFd) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    throwIfMinusOne(env, "fdatasync", TEMP_FAILURE_RETRY(fdatasync(fd)));
+}
+
+static jobject Posix_fstat(JNIEnv* env, jobject, jobject javaFd) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    struct stat sb;
+    int rc = TEMP_FAILURE_RETRY(fstat(fd, &sb));
+    if (rc == -1) {
+        throwErrnoException(env, "fstat");
+        return NULL;
+    }
+    return makeStructStat(env, sb);
+}
+
+static jobject Posix_fstatfs(JNIEnv* env, jobject, jobject javaFd) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    struct statfs sb;
+    int rc = TEMP_FAILURE_RETRY(fstatfs(fd, &sb));
+    if (rc == -1) {
+        throwErrnoException(env, "fstatfs");
+        return NULL;
+    }
+    return makeStructStatFs(env, sb);
+}
+
+static void Posix_fsync(JNIEnv* env, jobject, jobject javaFd) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    throwIfMinusOne(env, "fsync", TEMP_FAILURE_RETRY(fsync(fd)));
+}
+
+static void Posix_ftruncate(JNIEnv* env, jobject, jobject javaFd, jlong length) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    throwIfMinusOne(env, "ftruncate", TEMP_FAILURE_RETRY(ftruncate64(fd, length)));
+}
+
+static jstring Posix_getenv(JNIEnv* env, jobject, jstring javaName) {
+    ScopedUtfChars name(env, javaName);
+    if (name.c_str() == NULL) {
+        return NULL;
+    }
+    return env->NewStringUTF(getenv(name.c_str()));
+}
+
+static jobject Posix_getsockname(JNIEnv* env, jobject, jobject javaFd) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    sockaddr_storage ss;
+    sockaddr* sa = reinterpret_cast<sockaddr*>(&ss);
+    socklen_t byteCount = sizeof(ss);
+    memset(&ss, 0, byteCount);
+    int rc = TEMP_FAILURE_RETRY(getsockname(fd, sa, &byteCount));
+    if (rc == -1) {
+        throwErrnoException(env, "getsockname");
+        return NULL;
+    }
+    return makeSocketAddress(env, &ss);
+}
+
+static jint Posix_getsockoptByte(JNIEnv* env, jobject, jobject javaFd, jint level, jint option) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    u_char result = 0;
+    socklen_t size = sizeof(result);
+    throwIfMinusOne(env, "getsockopt", TEMP_FAILURE_RETRY(getsockopt(fd, level, option, &result, &size)));
+    return result;
+}
+
+static jobject Posix_getsockoptInAddr(JNIEnv* env, jobject, jobject javaFd, jint level, jint option) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    sockaddr_storage ss;
+    memset(&ss, 0, sizeof(ss));
+    ss.ss_family = AF_INET; // This is only for the IPv4-only IP_MULTICAST_IF.
+    sockaddr_in* sa = reinterpret_cast<sockaddr_in*>(&ss);
+    socklen_t size = sizeof(sa->sin_addr);
+    int rc = TEMP_FAILURE_RETRY(getsockopt(fd, level, option, &sa->sin_addr, &size));
+    if (rc == -1) {
+        throwErrnoException(env, "getsockopt");
+        return NULL;
+    }
+    return socketAddressToInetAddress(env, &ss);
+}
+
+static jint Posix_getsockoptInt(JNIEnv* env, jobject, jobject javaFd, jint level, jint option) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    jint result = 0;
+    socklen_t size = sizeof(result);
+    throwIfMinusOne(env, "getsockopt", TEMP_FAILURE_RETRY(getsockopt(fd, level, option, &result, &size)));
+    return result;
+}
+
+static jobject Posix_getsockoptLinger(JNIEnv* env, jobject, jobject javaFd, jint level, jint option) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    struct linger l;
+    socklen_t size = sizeof(l);
+    memset(&l, 0, size);
+    int rc = TEMP_FAILURE_RETRY(getsockopt(fd, level, option, &l, &size));
+    if (rc == -1) {
+        throwErrnoException(env, "getsockopt");
+        return NULL;
+    }
+    return makeStructLinger(env, l);
+}
+
+static jobject Posix_getsockoptTimeval(JNIEnv* env, jobject, jobject javaFd, jint level, jint option) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    struct timeval tv;
+    socklen_t size = sizeof(tv);
+    memset(&tv, 0, size);
+    int rc = TEMP_FAILURE_RETRY(getsockopt(fd, level, option, &tv, &size));
+    if (rc == -1) {
+        throwErrnoException(env, "getsockopt");
+        return NULL;
+    }
+    return makeStructTimeval(env, tv);
+}
+
+static jint Posix_ioctlInt(JNIEnv* env, jobject, jobject javaFd, jint cmd, jobject javaArg) {
+    // This is complicated because ioctls may return their result by updating their argument
+    // or via their return value, so we need to support both.
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    static jfieldID valueFid = env->GetFieldID(JniConstants::mutableIntClass, "value", "I");
+    jint arg = env->GetIntField(javaArg, valueFid);
+    int rc = throwIfMinusOne(env, "ioctl", TEMP_FAILURE_RETRY(ioctl(fd, cmd, &arg)));
+    if (!env->ExceptionCheck()) {
+        env->SetIntField(javaArg, valueFid, arg);
+    }
+    return rc;
+}
+
+static jboolean Posix_isatty(JNIEnv* env, jobject, jobject javaFd) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    return TEMP_FAILURE_RETRY(isatty(fd)) == 0;
+}
+
+static void Posix_listen(JNIEnv* env, jobject, jobject javaFd, jint backlog) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    throwIfMinusOne(env, "listen", TEMP_FAILURE_RETRY(listen(fd, backlog)));
+}
+
+static jlong Posix_lseek(JNIEnv* env, jobject, jobject javaFd, jlong offset, jint whence) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    return throwIfMinusOne(env, "lseek", TEMP_FAILURE_RETRY(lseek64(fd, offset, whence)));
+}
+
+static jobject Posix_lstat(JNIEnv* env, jobject, jstring javaPath) {
+    return doStat(env, javaPath, true);
+}
+
+static void Posix_mincore(JNIEnv* env, jobject, jlong address, jlong byteCount, jbyteArray javaVector) {
+    ScopedByteArrayRW vector(env, javaVector);
+    if (vector.get() == NULL) {
+        return;
+    }
+    void* ptr = reinterpret_cast<void*>(static_cast<uintptr_t>(address));
+    unsigned char* vec = reinterpret_cast<unsigned char*>(vector.get());
+    throwIfMinusOne(env, "mincore", TEMP_FAILURE_RETRY(mincore(ptr, byteCount, vec)));
+}
+
+static void Posix_mkdir(JNIEnv* env, jobject, jstring javaPath, jint mode) {
+    ScopedUtfChars path(env, javaPath);
+    if (path.c_str() == NULL) {
+        return;
+    }
+    throwIfMinusOne(env, "mkdir", TEMP_FAILURE_RETRY(mkdir(path.c_str(), mode)));
+}
+
+static void Posix_mlock(JNIEnv* env, jobject, jlong address, jlong byteCount) {
+    void* ptr = reinterpret_cast<void*>(static_cast<uintptr_t>(address));
+    throwIfMinusOne(env, "mlock", TEMP_FAILURE_RETRY(mlock(ptr, byteCount)));
+}
+
+static jlong Posix_mmap(JNIEnv* env, jobject, jlong address, jlong byteCount, jint prot, jint flags, jobject javaFd, jlong offset) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    void* suggestedPtr = reinterpret_cast<void*>(static_cast<uintptr_t>(address));
+    void* ptr = mmap(suggestedPtr, byteCount, prot, flags, fd, offset);
+    if (ptr == MAP_FAILED) {
+        throwErrnoException(env, "mmap");
+    }
+    return static_cast<jlong>(reinterpret_cast<uintptr_t>(ptr));
+}
+
+static void Posix_msync(JNIEnv* env, jobject, jlong address, jlong byteCount, jint flags) {
+    void* ptr = reinterpret_cast<void*>(static_cast<uintptr_t>(address));
+    throwIfMinusOne(env, "msync", TEMP_FAILURE_RETRY(msync(ptr, byteCount, flags)));
+}
+
+static void Posix_munlock(JNIEnv* env, jobject, jlong address, jlong byteCount) {
+    void* ptr = reinterpret_cast<void*>(static_cast<uintptr_t>(address));
+    throwIfMinusOne(env, "munlock", TEMP_FAILURE_RETRY(munlock(ptr, byteCount)));
+}
+
+static void Posix_munmap(JNIEnv* env, jobject, jlong address, jlong byteCount) {
+    void* ptr = reinterpret_cast<void*>(static_cast<uintptr_t>(address));
+    throwIfMinusOne(env, "munmap", TEMP_FAILURE_RETRY(munmap(ptr, byteCount)));
+}
+
+static jobject Posix_open(JNIEnv* env, jobject, jstring javaPath, jint flags, jint mode) {
+    ScopedUtfChars path(env, javaPath);
+    if (path.c_str() == NULL) {
+        return NULL;
+    }
+    int fd = throwIfMinusOne(env, "open", TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)));
+    return fd != -1 ? jniCreateFileDescriptor(env, fd) : NULL;
+}
+
+static jobjectArray Posix_pipe(JNIEnv* env, jobject) {
+    int fds[2];
+    throwIfMinusOne(env, "pipe", TEMP_FAILURE_RETRY(pipe(&fds[0])));
+    jobjectArray result = env->NewObjectArray(2, JniConstants::fileDescriptorClass, NULL);
+    if (result == NULL) {
+        return NULL;
+    }
+    for (int i = 0; i < 2; ++i) {
+        ScopedLocalRef<jobject> fd(env, jniCreateFileDescriptor(env, fds[i]));
+        if (fd.get() == NULL) {
+            return NULL;
+        }
+        env->SetObjectArrayElement(result, i, fd.get());
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
+    }
+    return result;
+}
+
+static jint Posix_read(JNIEnv* env, jobject, jobject javaFd, jbyteArray javaBytes, jint byteOffset, jint byteCount) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    ScopedByteArrayRW bytes(env, javaBytes);
+    if (bytes.get() == NULL) {
+        return -1;
+    }
+    return throwIfMinusOne(env, "read", TEMP_FAILURE_RETRY(read(fd, bytes.get() + byteOffset, byteCount)));
+}
+
+static jint Posix_readDirectBuffer(JNIEnv* env, jobject, jobject javaFd, jobject byteBuffer, jint position, jint remaining) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    jbyte* ptr = reinterpret_cast<jbyte*>(env->GetDirectBufferAddress(byteBuffer));
+    return throwIfMinusOne(env, "read", TEMP_FAILURE_RETRY(read(fd, ptr + position, remaining)));
+}
+
+static jint Posix_readv(JNIEnv* env, jobject, jobject javaFd, jobjectArray buffers, jintArray offsets, jintArray byteCounts) {
+    IoVec<ScopedByteArrayRW> ioVec(env, env->GetArrayLength(buffers));
+    if (!ioVec.init(buffers, offsets, byteCounts)) {
+        return -1;
+    }
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    return throwIfMinusOne(env, "readv", TEMP_FAILURE_RETRY(readv(fd, ioVec.get(), ioVec.size())));
+}
+
+static void Posix_remove(JNIEnv* env, jobject, jstring javaPath) {
+    ScopedUtfChars path(env, javaPath);
+    if (path.c_str() == NULL) {
+        return;
+    }
+    throwIfMinusOne(env, "remove", TEMP_FAILURE_RETRY(remove(path.c_str())));
+}
+
+static void Posix_rename(JNIEnv* env, jobject, jstring javaOldPath, jstring javaNewPath) {
+    ScopedUtfChars oldPath(env, javaOldPath);
+    if (oldPath.c_str() == NULL) {
+        return;
+    }
+    ScopedUtfChars newPath(env, javaNewPath);
+    if (newPath.c_str() == NULL) {
+        return;
+    }
+    throwIfMinusOne(env, "rename", TEMP_FAILURE_RETRY(rename(oldPath.c_str(), newPath.c_str())));
+}
+
+static jlong Posix_sendfile(JNIEnv* env, jobject, jobject javaOutFd, jobject javaInFd, jobject javaOffset, jlong byteCount) {
+    int outFd = jniGetFDFromFileDescriptor(env, javaOutFd);
+    int inFd = jniGetFDFromFileDescriptor(env, javaInFd);
+    static jfieldID valueFid = env->GetFieldID(JniConstants::mutableLongClass, "value", "J");
+    off_t offset = 0;
+    off_t* offsetPtr = NULL;
+    if (javaOffset != NULL) {
+        // TODO: fix bionic so we can have a 64-bit off_t!
+        offset = env->GetLongField(javaOffset, valueFid);
+        offsetPtr = &offset;
+    }
+    jlong result = throwIfMinusOne(env, "sendfile", TEMP_FAILURE_RETRY(sendfile(outFd, inFd, offsetPtr, byteCount)));
+    if (javaOffset != NULL) {
+        env->SetLongField(javaOffset, valueFid, offset);
+    }
+    return result;
+}
+
+static void Posix_setsockoptInt(JNIEnv* env, jobject, jobject javaFd, jint level, jint option, jint value) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    throwIfMinusOne(env, "setsockopt", TEMP_FAILURE_RETRY(setsockopt(fd, level, option, &value, sizeof(value))));
+}
+
+static void Posix_shutdown(JNIEnv* env, jobject, jobject javaFd, jint how) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    throwIfMinusOne(env, "shutdown", TEMP_FAILURE_RETRY(shutdown(fd, how)));
+}
+
+static jobject Posix_socket(JNIEnv* env, jobject, jint domain, jint type, jint protocol) {
+    int fd = throwIfMinusOne(env, "socket", TEMP_FAILURE_RETRY(socket(domain, type, protocol)));
+    return fd != -1 ? jniCreateFileDescriptor(env, fd) : NULL;
+}
+
+static jobject Posix_stat(JNIEnv* env, jobject, jstring javaPath) {
+    return doStat(env, javaPath, false);
+}
+
+static jobject Posix_statfs(JNIEnv* env, jobject, jstring javaPath) {
+    ScopedUtfChars path(env, javaPath);
+    if (path.c_str() == NULL) {
+        return NULL;
+    }
+    struct statfs sb;
+    int rc = TEMP_FAILURE_RETRY(statfs(path.c_str(), &sb));
+    if (rc == -1) {
+        throwErrnoException(env, "statfs");
+        return NULL;
+    }
+    return makeStructStatFs(env, sb);
+}
+
+static jstring Posix_strerror(JNIEnv* env, jobject, jint errnum) {
+    char buffer[BUFSIZ];
+    const char* message = jniStrError(errnum, buffer, sizeof(buffer));
+    return env->NewStringUTF(message);
+}
+
+static void Posix_symlink(JNIEnv* env, jobject, jstring javaOldPath, jstring javaNewPath) {
+    ScopedUtfChars oldPath(env, javaOldPath);
+    if (oldPath.c_str() == NULL) {
+        return;
+    }
+    ScopedUtfChars newPath(env, javaNewPath);
+    if (newPath.c_str() == NULL) {
+        return;
+    }
+    throwIfMinusOne(env, "symlink", TEMP_FAILURE_RETRY(symlink(oldPath.c_str(), newPath.c_str())));
+}
+
+static jlong Posix_sysconf(JNIEnv* env, jobject, jint name) {
+    // Since -1 is a valid result from sysconf(3), detecting failure is a little more awkward.
+    errno = 0;
+    long result = sysconf(name);
+    if (result == -1L && errno == EINVAL) {
+        throwErrnoException(env, "sysconf");
+    }
+    return result;
+}
+
+static jobject Posix_uname(JNIEnv* env, jobject) {
+    struct utsname buf;
+    if (throwIfMinusOne(env, "uname", TEMP_FAILURE_RETRY(uname(&buf))) == -1) {
+        return NULL;
+    }
+    return makeStructUtsname(env, buf);
+}
+
+static jint Posix_write(JNIEnv* env, jobject, jobject javaFd, jbyteArray javaBytes, jint byteOffset, jint byteCount) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    ScopedByteArrayRO bytes(env, javaBytes);
+    if (bytes.get() == NULL) {
+        return -1;
+    }
+    return throwIfMinusOne(env, "write", TEMP_FAILURE_RETRY(write(fd, bytes.get() + byteOffset, byteCount)));
+}
+
+static jint Posix_writeDirectBuffer(JNIEnv* env, jobject, jobject javaFd, jobject byteBuffer, jint position, jint remaining) {
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    jbyte* ptr = reinterpret_cast<jbyte*>(env->GetDirectBufferAddress(byteBuffer));
+    return throwIfMinusOne(env, "write", TEMP_FAILURE_RETRY(write(fd, ptr + position, remaining)));
+}
+
+static jint Posix_writev(JNIEnv* env, jobject, jobject javaFd, jobjectArray buffers, jintArray offsets, jintArray byteCounts) {
+    IoVec<ScopedByteArrayRO> ioVec(env, env->GetArrayLength(buffers));
+    if (!ioVec.init(buffers, offsets, byteCounts)) {
+        return -1;
+    }
+    int fd = jniGetFDFromFileDescriptor(env, javaFd);
+    return throwIfMinusOne(env, "writev", TEMP_FAILURE_RETRY(writev(fd, ioVec.get(), ioVec.size())));
+}
+
+static JNINativeMethod gMethods[] = {
+    NATIVE_METHOD(Posix, access, "(Ljava/lang/String;I)Z"),
+    NATIVE_METHOD(Posix, chmod, "(Ljava/lang/String;I)V"),
+    NATIVE_METHOD(Posix, close, "(Ljava/io/FileDescriptor;)V"),
+    NATIVE_METHOD(Posix, environ, "()[Ljava/lang/String;"),
+    NATIVE_METHOD(Posix, fcntlVoid, "(Ljava/io/FileDescriptor;I)I"),
+    NATIVE_METHOD(Posix, fcntlLong, "(Ljava/io/FileDescriptor;IJ)I"),
+    NATIVE_METHOD(Posix, fcntlFlock, "(Ljava/io/FileDescriptor;ILlibcore/io/StructFlock;)I"),
+    NATIVE_METHOD(Posix, fdatasync, "(Ljava/io/FileDescriptor;)V"),
+    NATIVE_METHOD(Posix, fstat, "(Ljava/io/FileDescriptor;)Llibcore/io/StructStat;"),
+    NATIVE_METHOD(Posix, fstatfs, "(Ljava/io/FileDescriptor;)Llibcore/io/StructStatFs;"),
+    NATIVE_METHOD(Posix, fsync, "(Ljava/io/FileDescriptor;)V"),
+    NATIVE_METHOD(Posix, ftruncate, "(Ljava/io/FileDescriptor;J)V"),
+    NATIVE_METHOD(Posix, getenv, "(Ljava/lang/String;)Ljava/lang/String;"),
+    NATIVE_METHOD(Posix, getsockname, "(Ljava/io/FileDescriptor;)Ljava/net/SocketAddress;"),
+    NATIVE_METHOD(Posix, getsockoptByte, "(Ljava/io/FileDescriptor;II)I"),
+    NATIVE_METHOD(Posix, getsockoptInAddr, "(Ljava/io/FileDescriptor;II)Ljava/net/InetAddress;"),
+    NATIVE_METHOD(Posix, getsockoptInt, "(Ljava/io/FileDescriptor;II)I"),
+    NATIVE_METHOD(Posix, getsockoptLinger, "(Ljava/io/FileDescriptor;II)Llibcore/io/StructLinger;"),
+    NATIVE_METHOD(Posix, getsockoptTimeval, "(Ljava/io/FileDescriptor;II)Llibcore/io/StructTimeval;"),
+    NATIVE_METHOD(Posix, ioctlInt, "(Ljava/io/FileDescriptor;ILlibcore/util/MutableInt;)I"),
+    NATIVE_METHOD(Posix, isatty, "(Ljava/io/FileDescriptor;)Z"),
+    NATIVE_METHOD(Posix, listen, "(Ljava/io/FileDescriptor;I)V"),
+    NATIVE_METHOD(Posix, lseek, "(Ljava/io/FileDescriptor;JI)J"),
+    NATIVE_METHOD(Posix, lstat, "(Ljava/lang/String;)Llibcore/io/StructStat;"),
+    NATIVE_METHOD(Posix, mincore, "(JJ[B)V"),
+    NATIVE_METHOD(Posix, mkdir, "(Ljava/lang/String;I)V"),
+    NATIVE_METHOD(Posix, mlock, "(JJ)V"),
+    NATIVE_METHOD(Posix, mmap, "(JJIILjava/io/FileDescriptor;J)J"),
+    NATIVE_METHOD(Posix, msync, "(JJI)V"),
+    NATIVE_METHOD(Posix, munlock, "(JJ)V"),
+    NATIVE_METHOD(Posix, munmap, "(JJ)V"),
+    NATIVE_METHOD(Posix, open, "(Ljava/lang/String;II)Ljava/io/FileDescriptor;"),
+    NATIVE_METHOD(Posix, pipe, "()[Ljava/io/FileDescriptor;"),
+    NATIVE_METHOD(Posix, read, "(Ljava/io/FileDescriptor;[BII)I"),
+    NATIVE_METHOD(Posix, readDirectBuffer, "(Ljava/io/FileDescriptor;Ljava/nio/ByteBuffer;II)I"),
+    NATIVE_METHOD(Posix, readv, "(Ljava/io/FileDescriptor;[Ljava/lang/Object;[I[I)I"),
+    NATIVE_METHOD(Posix, remove, "(Ljava/lang/String;)V"),
+    NATIVE_METHOD(Posix, rename, "(Ljava/lang/String;Ljava/lang/String;)V"),
+    NATIVE_METHOD(Posix, sendfile, "(Ljava/io/FileDescriptor;Ljava/io/FileDescriptor;Llibcore/util/MutableLong;J)J"),
+    NATIVE_METHOD(Posix, setsockoptInt, "(Ljava/io/FileDescriptor;III)V"),
+    NATIVE_METHOD(Posix, shutdown, "(Ljava/io/FileDescriptor;I)V"),
+    NATIVE_METHOD(Posix, socket, "(III)Ljava/io/FileDescriptor;"),
+    NATIVE_METHOD(Posix, stat, "(Ljava/lang/String;)Llibcore/io/StructStat;"),
+    NATIVE_METHOD(Posix, statfs, "(Ljava/lang/String;)Llibcore/io/StructStatFs;"),
+    NATIVE_METHOD(Posix, strerror, "(I)Ljava/lang/String;"),
+    NATIVE_METHOD(Posix, symlink, "(Ljava/lang/String;Ljava/lang/String;)V"),
+    NATIVE_METHOD(Posix, sysconf, "(I)J"),
+    NATIVE_METHOD(Posix, uname, "()Llibcore/io/StructUtsname;"),
+    NATIVE_METHOD(Posix, write, "(Ljava/io/FileDescriptor;[BII)I"),
+    NATIVE_METHOD(Posix, writeDirectBuffer, "(Ljava/io/FileDescriptor;Ljava/nio/ByteBuffer;II)I"),
+    NATIVE_METHOD(Posix, writev, "(Ljava/io/FileDescriptor;[Ljava/lang/Object;[I[I)I"),
+};
+int register_libcore_io_Posix(JNIEnv* env) {
+    return jniRegisterNativeMethods(env, "libcore/io/Posix", gMethods, NELEM(gMethods));
+}
diff --git a/luni/src/main/native/libcore_net_RawSocket.cpp b/luni/src/main/native/libcore_net_RawSocket.cpp
index 7878986..b23208d 100644
--- a/luni/src/main/native/libcore_net_RawSocket.cpp
+++ b/luni/src/main/native/libcore_net_RawSocket.cpp
@@ -39,6 +39,11 @@
 #include <netinet/ip.h>
 #include <linux/udp.h>
 
+union GCC_HIDDEN sockunion {
+    sockaddr sa;
+    sockaddr_ll sll;
+} su;
+
 /*
  * Creates a socket suitable for raw socket operations.  The socket is
  * bound to the interface specified by the supplied name.  The socket
@@ -51,24 +56,19 @@
 static void RawSocket_create(JNIEnv* env, jclass, jobject fileDescriptor,
     jstring interfaceName) {
 
-  union sockunion {
-    struct sockaddr sa;
-    struct sockaddr_ll sll;
-  } su;
-
-  short protocol = ETH_P_IP;
   ScopedUtfChars ifname(env, interfaceName);
-
   if (ifname.c_str() == NULL) {
     return;
   }
 
+  short protocol = ETH_P_IP;
+  sockunion su;
   memset(&su, 0, sizeof(su));
   su.sll.sll_family = PF_PACKET;
   su.sll.sll_protocol = htons(protocol);
   su.sll.sll_ifindex = if_nametoindex(ifname.c_str());
-  int sock = socket(PF_PACKET, SOCK_DGRAM, htons(protocol));
 
+  int sock = socket(PF_PACKET, SOCK_DGRAM, htons(protocol));
   if (sock == -1) {
     LOGE("Can't create socket %s", strerror(errno));
     jniThrowSocketException(env, errno);
@@ -76,7 +76,6 @@
   }
 
   jniSetFileDescriptorOfFD(env, fileDescriptor, sock);
-
   if (!setBlocking(sock, false)) {
     LOGE("Can't set non-blocking mode on socket %s", strerror(errno));
     jniThrowSocketException(env, errno);
@@ -84,7 +83,6 @@
   }
 
   int err = bind(sock, &su.sa, sizeof(su));
-
   if (err != 0) {
     LOGE("Socket bind error %s", strerror(errno));
     jniThrowSocketException(env, errno);
@@ -108,29 +106,23 @@
     return 0;
   }
 
-  union sockunion {
-    struct sockaddr sa;
-    struct sockaddr_ll sll;
-  } su;
-  short protocol = ETH_P_IP;
   ScopedUtfChars ifname(env, interfaceName);
-
   if (ifname.c_str() == NULL) {
     return 0;
   }
 
   ScopedByteArrayRO byteArray(env, packet);
-
   if (byteArray.get() == NULL) {
     return 0;
   }
 
   ScopedByteArrayRO mac(env, destMac);
-
   if (mac.get() == NULL) {
     return 0;
   }
 
+  short protocol = ETH_P_IP;
+  sockunion su;
   memset(&su, 0, sizeof(su));
   su.sll.sll_hatype = htons(1); // ARPHRD_ETHER
   su.sll.sll_halen = mac.size();
@@ -140,7 +132,6 @@
   su.sll.sll_ifindex = if_nametoindex(ifname.c_str());
 
   int err;
-
   {
     int intFd = fd.get();
     AsynchronousSocketCloseMonitor monitor(intFd);
@@ -163,33 +154,29 @@
     jint timeout_millis)
 {
   NetFd fd(env, fileDescriptor);
-
   if (fd.isClosed()) {
     return 0;
   }
 
   ScopedByteArrayRW body(env, packet);
   jbyte* packetData = body.get();
-
   if (packetData == NULL) {
     return 0;
   }
 
   packetData += offset;
 
-  int packetSize = byteCount;
-  unsigned int size = 0;
-  struct pollfd fds[1];
-
+  pollfd fds[1];
   fds[0].fd = fd.get();
   fds[0].events = POLLIN;
   int retval = poll(fds, 1, timeout_millis);
-
   if (retval <= 0) {
     return 0;
   }
 
+  unsigned int size = 0;
   {
+    int packetSize = byteCount;
     int intFd = fd.get();
     AsynchronousSocketCloseMonitor monitor(intFd);
     size = NET_FAILURE_RETRY(fd, read(intFd, packetData, packetSize));
@@ -201,20 +188,16 @@
 
   // quick check for UDP type & UDP port
   // the packet is an IP header, UDP header, and UDP payload
-  if ((size < (sizeof(struct iphdr) + sizeof(struct udphdr)))) {
+  if ((size < (sizeof(iphdr) + sizeof(udphdr)))) {
     return 0;  // runt packet
   }
 
-  u_int8_t ip_proto = ((struct iphdr *) packetData)->protocol;
-
+  u_int8_t ip_proto = ((iphdr *) packetData)->protocol;
   if (ip_proto != IPPROTO_UDP) {
     return 0;  // something other than UDP
   }
 
-  __be16 destPort =
-      htons((reinterpret_cast<struct udphdr*>
-             (packetData + sizeof(struct iphdr)))->dest);
-
+  __be16 destPort = htons((reinterpret_cast<udphdr*>(packetData + sizeof(iphdr)))->dest);
   if (destPort != port) {
     return 0; // something other than requested port
   }
@@ -222,19 +205,12 @@
   return size;
 }
 
-/*
- * JNI registration
- */
 static JNINativeMethod gRawMethods[] = {
-  NATIVE_METHOD(RawSocket, create,
-                "(Ljava/io/FileDescriptor;Ljava/lang/String;)V"),
-  NATIVE_METHOD(RawSocket, sendPacket,
-                "(Ljava/io/FileDescriptor;Ljava/lang/String;[B[BII)I"),
-  NATIVE_METHOD(RawSocket, recvPacket,
-                "(Ljava/io/FileDescriptor;[BIIII)I"),
+  NATIVE_METHOD(RawSocket, create, "(Ljava/io/FileDescriptor;Ljava/lang/String;)V"),
+  NATIVE_METHOD(RawSocket, sendPacket, "(Ljava/io/FileDescriptor;Ljava/lang/String;[B[BII)I"),
+  NATIVE_METHOD(RawSocket, recvPacket, "(Ljava/io/FileDescriptor;[BIIII)I"),
 };
 
 int register_libcore_net_RawSocket(JNIEnv* env) {
-  return jniRegisterNativeMethods(env,
-         "libcore/net/RawSocket", gRawMethods, NELEM(gRawMethods));
+  return jniRegisterNativeMethods(env, "libcore/net/RawSocket", gRawMethods, NELEM(gRawMethods));
 }
diff --git a/luni/src/main/native/org_apache_harmony_luni_platform_OSFileSystem.cpp b/luni/src/main/native/org_apache_harmony_luni_platform_OSFileSystem.cpp
deleted file mode 100644
index 4a9a6f0..0000000
--- a/luni/src/main/native/org_apache_harmony_luni_platform_OSFileSystem.cpp
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-#define LOG_TAG "OSFileSystem"
-
-/* Values for HyFileOpen */
-#define HyOpenRead    1
-#define HyOpenWrite   2
-#define HyOpenCreate  4
-#define HyOpenTruncate  8
-#define HyOpenAppend  16
-/* Use this flag with HyOpenCreate, if this flag is specified then
- * trying to create an existing file will fail
- */
-#define HyOpenCreateNew 64
-#define HyOpenSync      128
-#define SHARED_LOCK_TYPE 1L
-
-#include "JNIHelp.h"
-#include "JniConstants.h"
-#include "JniException.h"
-#include "LocalArray.h"
-#include "ScopedPrimitiveArray.h"
-#include "ScopedUtfChars.h"
-#include "UniquePtr.h"
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/uio.h>
-#include <unistd.h>
-
-#if HAVE_SYS_SENDFILE_H
-#include <sys/sendfile.h>
-#else
-/*
- * Define a small adapter function: sendfile() isn't part of a standard,
- * and its definition differs between Linux, BSD, and OS X. This version
- * works for OS X but will probably not work on other BSDish systems.
- * Note: We rely on function overloading here to define a same-named
- * function with different arguments.
- */
-#include <sys/socket.h>
-#include <sys/types.h>
-static inline ssize_t sendfile(int out_fd, int in_fd, off_t* offset, size_t count) {
-    off_t len = count;
-    int result = sendfile(in_fd, out_fd, *offset, &len, NULL, 0);
-    if (result < 0) {
-        return -1;
-    }
-    return len;
-}
-#endif
-
-static int EsTranslateOpenFlags(int flags) {
-    int realFlags = 0;
-
-    if (flags & HyOpenAppend) {
-        realFlags |= O_APPEND;
-    }
-    if (flags & HyOpenTruncate) {
-        realFlags |= O_TRUNC;
-    }
-    if (flags & HyOpenCreate) {
-        realFlags |= O_CREAT;
-    }
-    if (flags & HyOpenCreateNew) {
-        realFlags |= O_EXCL | O_CREAT;
-    }
-#ifdef O_SYNC
-    if (flags & HyOpenSync) {
-        realFlags |= O_SYNC;
-    }
-#endif
-    if (flags & HyOpenRead) {
-        if (flags & HyOpenWrite) {
-            return (O_RDWR | realFlags);
-        }
-        return (O_RDONLY | realFlags);
-    }
-    if (flags & HyOpenWrite) {
-        return (O_WRONLY | realFlags);
-    }
-    return -1;
-}
-
-static jlong translateLockLength(jlong length) {
-    // FileChannel.tryLock uses Long.MAX_VALUE to mean "lock the whole
-    // file", where POSIX would use 0. We can support that special case,
-    // even for files whose actual length we can't represent. For other
-    // out of range lengths, though, we want our range checking to fire.
-    return (length == 0x7fffffffffffffffLL) ? 0 : length;
-}
-
-static struct flock64 flockFromStartAndLength(jlong start, jlong length) {
-    struct flock64 lock;
-    memset(&lock, 0, sizeof(lock));
-
-    lock.l_whence = SEEK_SET;
-    lock.l_start = start;
-    lock.l_len = length;
-
-    return lock;
-}
-
-static jint OSFileSystem_lockImpl(JNIEnv*, jobject, jint fd,
-        jlong start, jlong length, jint typeFlag, jboolean waitFlag) {
-
-    length = translateLockLength(length);
-    struct flock64 lock(flockFromStartAndLength(start, length));
-
-    if ((typeFlag & SHARED_LOCK_TYPE) == SHARED_LOCK_TYPE) {
-        lock.l_type = F_RDLCK;
-    } else {
-        lock.l_type = F_WRLCK;
-    }
-
-    int waitMode = (waitFlag) ? F_SETLKW64 : F_SETLK64;
-    return TEMP_FAILURE_RETRY(fcntl(fd, waitMode, &lock));
-}
-
-static void OSFileSystem_unlockImpl(JNIEnv* env, jobject, jint fd, jlong start, jlong length) {
-    length = translateLockLength(length);
-    struct flock64 lock(flockFromStartAndLength(start, length));
-    lock.l_type = F_UNLCK;
-
-    int rc = TEMP_FAILURE_RETRY(fcntl(fd, F_SETLKW64, &lock));
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-    }
-}
-
-/**
- * Returns the granularity of the starting address for virtual memory allocation.
- * (It's the same as the page size.)
- */
-static jint OSFileSystem_getAllocGranularity(JNIEnv*, jobject) {
-    static int allocGranularity = getpagesize();
-    return allocGranularity;
-}
-
-// Translate three Java int[]s to a native iovec[] for readv and writev.
-static iovec* initIoVec(JNIEnv* env,
-        jintArray jBuffers, jintArray jOffsets, jintArray jLengths, jint size) {
-    UniquePtr<iovec[]> vectors(new iovec[size]);
-    if (vectors.get() == NULL) {
-        jniThrowException(env, "java/lang/OutOfMemoryError", "native heap");
-        return NULL;
-    }
-    ScopedIntArrayRO buffers(env, jBuffers);
-    if (buffers.get() == NULL) {
-        return NULL;
-    }
-    ScopedIntArrayRO offsets(env, jOffsets);
-    if (offsets.get() == NULL) {
-        return NULL;
-    }
-    ScopedIntArrayRO lengths(env, jLengths);
-    if (lengths.get() == NULL) {
-        return NULL;
-    }
-    for (int i = 0; i < size; ++i) {
-        vectors[i].iov_base = reinterpret_cast<void*>(buffers[i] + offsets[i]);
-        vectors[i].iov_len = lengths[i];
-    }
-    return vectors.release();
-}
-
-static jlong OSFileSystem_readv(JNIEnv* env, jobject, jint fd,
-        jintArray jBuffers, jintArray jOffsets, jintArray jLengths, jint size) {
-    UniquePtr<iovec[]> vectors(initIoVec(env, jBuffers, jOffsets, jLengths, size));
-    if (vectors.get() == NULL) {
-        return -1;
-    }
-    long result = readv(fd, vectors.get(), size);
-    if (result == 0) {
-        return -1;
-    }
-    if (result == -1) {
-        jniThrowIOException(env, errno);
-    }
-    return result;
-}
-
-static jlong OSFileSystem_writev(JNIEnv* env, jobject, jint fd,
-        jintArray jBuffers, jintArray jOffsets, jintArray jLengths, jint size) {
-    UniquePtr<iovec[]> vectors(initIoVec(env, jBuffers, jOffsets, jLengths, size));
-    if (vectors.get() == NULL) {
-        return -1;
-    }
-    long result = writev(fd, vectors.get(), size);
-    if (result == -1) {
-        jniThrowIOException(env, errno);
-    }
-    return result;
-}
-
-static jlong OSFileSystem_transfer(JNIEnv* env, jobject, jint fd, jobject sd,
-        jlong offset, jlong count) {
-
-    int socket = jniGetFDFromFileDescriptor(env, sd);
-    if (socket == -1) {
-        return -1;
-    }
-
-    /* Value of offset is checked in jint scope (checked in java layer)
-       The conversion here is to guarantee no value lost when converting offset to off_t
-     */
-    off_t off = offset;
-
-    ssize_t rc = sendfile(socket, fd, &off, count);
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-    }
-    return rc;
-}
-
-static jlong OSFileSystem_readDirect(JNIEnv* env, jobject, jint fd,
-        jint buf, jint offset, jint byteCount) {
-    if (byteCount == 0) {
-        return 0;
-    }
-    jbyte* dst = reinterpret_cast<jbyte*>(buf + offset);
-    jlong rc = TEMP_FAILURE_RETRY(read(fd, dst, byteCount));
-    if (rc == 0) {
-        return -1;
-    }
-    if (rc == -1) {
-        // We return 0 rather than throw if we try to read from an empty non-blocking pipe.
-        if (errno == EAGAIN) {
-            return 0;
-        }
-        jniThrowIOException(env, errno);
-    }
-    return rc;
-}
-
-static jlong OSFileSystem_read(JNIEnv* env, jobject, jint fd,
-        jbyteArray byteArray, jint offset, jint byteCount) {
-    ScopedByteArrayRW bytes(env, byteArray);
-    if (bytes.get() == NULL) {
-        return 0;
-    }
-    jint buf = static_cast<jint>(reinterpret_cast<uintptr_t>(bytes.get()));
-    return OSFileSystem_readDirect(env, NULL, fd, buf, offset, byteCount);
-}
-
-static jlong OSFileSystem_writeDirect(JNIEnv* env, jobject, jint fd,
-        jint buf, jint offset, jint byteCount) {
-    if (byteCount == 0) {
-        return 0;
-    }
-    jbyte* src = reinterpret_cast<jbyte*>(buf + offset);
-    jlong rc = TEMP_FAILURE_RETRY(write(fd, src, byteCount));
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-    }
-    return rc;
-}
-
-static jlong OSFileSystem_write(JNIEnv* env, jobject, jint fd,
-        jbyteArray byteArray, jint offset, jint byteCount) {
-    ScopedByteArrayRO bytes(env, byteArray);
-    if (bytes.get() == NULL) {
-        return 0;
-    }
-    jint buf = static_cast<jint>(reinterpret_cast<uintptr_t>(bytes.get()));
-    return OSFileSystem_writeDirect(env, NULL, fd, buf, offset, byteCount);
-}
-
-static jlong OSFileSystem_seek(JNIEnv* env, jobject, jint fd, jlong offset, jint javaWhence) {
-    /* Convert whence argument */
-    int nativeWhence = 0;
-    switch (javaWhence) {
-    case 1:
-        nativeWhence = SEEK_SET;
-        break;
-    case 2:
-        nativeWhence = SEEK_CUR;
-        break;
-    case 4:
-        nativeWhence = SEEK_END;
-        break;
-    default:
-        return -1;
-    }
-
-    jlong result = lseek64(fd, offset, nativeWhence);
-    if (result == -1) {
-        if (errno == ESPIPE) {
-            jniThrowExceptionWithErrno(env,
-                    "org/apache/harmony/luni/platform/IFileSystem$SeekPipeException",
-                    errno);
-        } else {
-            jniThrowIOException(env, errno);
-        }
-    }
-    return result;
-}
-
-static void OSFileSystem_fsync(JNIEnv* env, jobject, jint fd, jboolean metadataToo) {
-    int rc = metadataToo ? fsync(fd) : fdatasync(fd);
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-    }
-}
-
-static jint OSFileSystem_truncate(JNIEnv* env, jobject, jint fd, jlong length) {
-    int rc = ftruncate64(fd, length);
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-    }
-    return rc;
-}
-
-static jint OSFileSystem_open(JNIEnv* env, jobject, jstring javaPath, jint jflags) {
-    int flags = 0;
-    int mode = 0;
-
-    // On Android, we don't want default permissions to allow global access.
-    switch (jflags) {
-    case 0:
-        flags = HyOpenRead;
-        mode = 0;
-        break;
-    case 1:
-        flags = HyOpenCreate | HyOpenWrite | HyOpenTruncate;
-        mode = 0600;
-        break;
-    case 16:
-        flags = HyOpenRead | HyOpenWrite | HyOpenCreate;
-        mode = 0600;
-        break;
-    case 32:
-        flags = HyOpenRead | HyOpenWrite | HyOpenCreate | HyOpenSync;
-        mode = 0600;
-        break;
-    case 256:
-        flags = HyOpenWrite | HyOpenCreate | HyOpenAppend;
-        mode = 0600;
-        break;
-    }
-
-    flags = EsTranslateOpenFlags(flags);
-
-    ScopedUtfChars path(env, javaPath);
-    if (path.c_str() == NULL) {
-        return -1;
-    }
-    jint fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode));
-
-    // Posix open(2) fails with EISDIR only if you ask for write permission.
-    // Java disallows reading directories too.
-    if (fd != -1) {
-        struct stat sb;
-        int rc = fstat(fd, &sb);
-        if (rc == -1 || S_ISDIR(sb.st_mode)) {
-            // Use EISDIR if that was the case; fail with the fstat(2) error otherwise.
-            close(fd);
-            fd = -1;
-            if (S_ISDIR(sb.st_mode)) {
-                errno = EISDIR;
-            }
-        }
-    }
-
-    if (fd == -1) {
-        // Get the human-readable form of errno.
-        char buffer[80];
-        const char* reason = jniStrError(errno, &buffer[0], sizeof(buffer));
-
-        // Construct a message that includes the path and the reason.
-        LocalArray<128> message(path.size() + 2 + strlen(reason) + 1 + 1);
-        snprintf(&message[0], message.size(), "%s (%s)", path.c_str(), reason);
-
-        // We always throw FileNotFoundException, regardless of the specific
-        // failure. (This appears to be true of the RI too.)
-        jniThrowException(env, "java/io/FileNotFoundException", &message[0]);
-    }
-    return fd;
-}
-
-static jint OSFileSystem_ioctlAvailable(JNIEnv*env, jobject, jobject fileDescriptor) {
-    /*
-     * On underlying platforms Android cares about (read "Linux"),
-     * ioctl(fd, FIONREAD, &avail) is supposed to do the following:
-     *
-     * If the fd refers to a regular file, avail is set to
-     * the difference between the file size and the current cursor.
-     * This may be negative if the cursor is past the end of the file.
-     *
-     * If the fd refers to an open socket or the read end of a
-     * pipe, then avail will be set to a number of bytes that are
-     * available to be read without blocking.
-     *
-     * If the fd refers to a special file/device that has some concept
-     * of buffering, then avail will be set in a corresponding way.
-     *
-     * If the fd refers to a special device that does not have any
-     * concept of buffering, then the ioctl call will return a negative
-     * number, and errno will be set to ENOTTY.
-     *
-     * If the fd refers to a special file masquerading as a regular file,
-     * then avail may be returned as negative, in that the special file
-     * may appear to have zero size and yet a previous read call may have
-     * actually read some amount of data and caused the cursor to be
-     * advanced.
-     */
-    int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
-    if (fd == -1) {
-        return -1;
-    }
-    int avail = 0;
-    int rc = ioctl(fd, FIONREAD, &avail);
-    if (rc >= 0) {
-        /*
-         * Success, but make sure not to return a negative number (see
-         * above).
-         */
-        if (avail < 0) {
-            avail = 0;
-        }
-    } else if (errno == ENOTTY) {
-        /* The fd is unwilling to opine about its read buffer. */
-        avail = 0;
-    } else {
-        /* Something strange is happening. */
-        jniThrowIOException(env, errno);
-    }
-
-    return avail;
-}
-
-static jlong OSFileSystem_length(JNIEnv* env, jobject, jint fd) {
-    struct stat sb;
-    jint rc = TEMP_FAILURE_RETRY(fstat(fd, &sb));
-    if (rc == -1) {
-        jniThrowIOException(env, errno);
-    }
-    return sb.st_size;
-}
-
-static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(OSFileSystem, fsync, "(IZ)V"),
-    NATIVE_METHOD(OSFileSystem, getAllocGranularity, "()I"),
-    NATIVE_METHOD(OSFileSystem, ioctlAvailable, "(Ljava/io/FileDescriptor;)I"),
-    NATIVE_METHOD(OSFileSystem, length, "(I)J"),
-    NATIVE_METHOD(OSFileSystem, lockImpl, "(IJJIZ)I"),
-    NATIVE_METHOD(OSFileSystem, open, "(Ljava/lang/String;I)I"),
-    NATIVE_METHOD(OSFileSystem, read, "(I[BII)J"),
-    NATIVE_METHOD(OSFileSystem, readDirect, "(IIII)J"),
-    NATIVE_METHOD(OSFileSystem, readv, "(I[I[I[II)J"),
-    NATIVE_METHOD(OSFileSystem, seek, "(IJI)J"),
-    NATIVE_METHOD(OSFileSystem, transfer, "(ILjava/io/FileDescriptor;JJ)J"),
-    NATIVE_METHOD(OSFileSystem, truncate, "(IJ)V"),
-    NATIVE_METHOD(OSFileSystem, unlockImpl, "(IJJ)V"),
-    NATIVE_METHOD(OSFileSystem, write, "(I[BII)J"),
-    NATIVE_METHOD(OSFileSystem, writeDirect, "(IIII)J"),
-    NATIVE_METHOD(OSFileSystem, writev, "(I[I[I[II)J"),
-};
-int register_org_apache_harmony_luni_platform_OSFileSystem(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "org/apache/harmony/luni/platform/OSFileSystem", gMethods,
-            NELEM(gMethods));
-}
diff --git a/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp b/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp
deleted file mode 100644
index 5b19626..0000000
--- a/luni/src/main/native/org_apache_harmony_luni_platform_OSMemory.cpp
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "OSMemory"
-
-#include "JNIHelp.h"
-#include "JniConstants.h"
-#include "ScopedPrimitiveArray.h"
-#include "UniquePtr.h"
-#include "java_lang_Float.h"
-#include "java_lang_Double.h"
-
-#include <byteswap.h>
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-
-#if defined(__arm__)
-// 32-bit ARM has load/store alignment restrictions for longs.
-#define LONG_ALIGNMENT_MASK 0x3
-#elif defined(__i386__)
-// x86 can load anything at any alignment.
-#define LONG_ALIGNMENT_MASK 0x0
-#else
-#error unknown load/store alignment restrictions for this architecture
-#endif
-
-template <typename T> static T cast(jint address) {
-    return reinterpret_cast<T>(static_cast<uintptr_t>(address));
-}
-
-static inline void swapShorts(jshort* dstShorts, const jshort* srcShorts, size_t count) {
-    // Do 32-bit swaps as long as possible...
-    jint* dst = reinterpret_cast<jint*>(dstShorts);
-    const jint* src = reinterpret_cast<const jint*>(srcShorts);
-    for (size_t i = 0; i < count / 2; ++i) {
-        jint v = *src++;                            // v=ABCD
-        v = bswap_32(v);                            // v=DCBA
-        jint v2 = (v << 16) | ((v >> 16) & 0xffff); // v=BADC
-        *dst++ = v2;
-    }
-    // ...with one last 16-bit swap if necessary.
-    if ((count % 2) != 0) {
-        jshort v = *reinterpret_cast<const jshort*>(src);
-        *reinterpret_cast<jshort*>(dst) = bswap_16(v);
-    }
-}
-
-static inline void swapInts(jint* dstInts, const jint* srcInts, size_t count) {
-    for (size_t i = 0; i < count; ++i) {
-        jint v = *srcInts++;
-        *dstInts++ = bswap_32(v);
-    }
-}
-
-static inline void swapLongs(jlong* dstLongs, const jlong* srcLongs, size_t count) {
-    jint* dst = reinterpret_cast<jint*>(dstLongs);
-    const jint* src = reinterpret_cast<const jint*>(srcLongs);
-    for (size_t i = 0; i < count; ++i) {
-        jint v1 = *src++;
-        jint v2 = *src++;
-        *dst++ = bswap_32(v2);
-        *dst++ = bswap_32(v1);
-    }
-}
-
-static void OSMemory_memmove(JNIEnv*, jclass, jint dstAddress, jint srcAddress, jlong length) {
-    memmove(cast<void*>(dstAddress), cast<const void*>(srcAddress), length);
-}
-
-static jbyte OSMemory_peekByte(JNIEnv*, jclass, jint srcAddress) {
-    return *cast<const jbyte*>(srcAddress);
-}
-
-static void OSMemory_peekByteArray(JNIEnv* env, jclass, jint srcAddress, jbyteArray dst, jint dstOffset, jint byteCount) {
-    env->SetByteArrayRegion(dst, dstOffset, byteCount, cast<const jbyte*>(srcAddress));
-}
-
-// Implements the peekXArray methods:
-// - For unswapped access, we just use the JNI SetXArrayRegion functions.
-// - For swapped access, we use GetXArrayElements and our own copy-and-swap routines.
-//   GetXArrayElements is disproportionately cheap on Dalvik because it doesn't copy (as opposed
-//   to Hotspot, which always copies). The SWAP_FN copies and swaps in one pass, which is cheaper
-//   than copying and then swapping in a second pass. Depending on future VM/GC changes, the
-//   swapped case might need to be revisited.
-#define PEEKER(SCALAR_TYPE, JNI_NAME, SWAP_TYPE, SWAP_FN) { \
-    if (swap) { \
-        Scoped ## JNI_NAME ## ArrayRW elements(env, dst); \
-        if (elements.get() == NULL) { \
-            return; \
-        } \
-        const SWAP_TYPE* src = cast<const SWAP_TYPE*>(srcAddress); \
-        SWAP_FN(reinterpret_cast<SWAP_TYPE*>(elements.get()) + dstOffset, src, count); \
-    } else { \
-        const SCALAR_TYPE* src = cast<const SCALAR_TYPE*>(srcAddress); \
-        env->Set ## JNI_NAME ## ArrayRegion(dst, dstOffset, count, src); \
-    } \
-}
-
-static void OSMemory_peekCharArray(JNIEnv* env, jclass, jint srcAddress, jcharArray dst, jint dstOffset, jint count, jboolean swap) {
-    PEEKER(jchar, Char, jshort, swapShorts);
-}
-
-static void OSMemory_peekDoubleArray(JNIEnv* env, jclass, jint srcAddress, jdoubleArray dst, jint dstOffset, jint count, jboolean swap) {
-    PEEKER(jdouble, Double, jlong, swapLongs);
-}
-
-static void OSMemory_peekFloatArray(JNIEnv* env, jclass, jint srcAddress, jfloatArray dst, jint dstOffset, jint count, jboolean swap) {
-    PEEKER(jfloat, Float, jint, swapInts);
-}
-
-static void OSMemory_peekIntArray(JNIEnv* env, jclass, jint srcAddress, jintArray dst, jint dstOffset, jint count, jboolean swap) {
-    PEEKER(jint, Int, jint, swapInts);
-}
-
-static void OSMemory_peekLongArray(JNIEnv* env, jclass, jint srcAddress, jlongArray dst, jint dstOffset, jint count, jboolean swap) {
-    PEEKER(jlong, Long, jlong, swapLongs);
-}
-
-static void OSMemory_peekShortArray(JNIEnv* env, jclass, jint srcAddress, jshortArray dst, jint dstOffset, jint count, jboolean swap) {
-    PEEKER(jshort, Short, jshort, swapShorts);
-}
-
-static void OSMemory_pokeByte(JNIEnv*, jclass, jint dstAddress, jbyte value) {
-    *cast<jbyte*>(dstAddress) = value;
-}
-
-static void OSMemory_pokeByteArray(JNIEnv* env, jclass, jint dstAddress, jbyteArray src, jint offset, jint length) {
-    env->GetByteArrayRegion(src, offset, length, cast<jbyte*>(dstAddress));
-}
-
-// Implements the pokeXArray methods:
-// - For unswapped access, we just use the JNI GetXArrayRegion functions.
-// - For swapped access, we use GetXArrayElements and our own copy-and-swap routines.
-//   GetXArrayElements is disproportionately cheap on Dalvik because it doesn't copy (as opposed
-//   to Hotspot, which always copies). The SWAP_FN copies and swaps in one pass, which is cheaper
-//   than copying and then swapping in a second pass. Depending on future VM/GC changes, the
-//   swapped case might need to be revisited.
-#define POKER(SCALAR_TYPE, JNI_NAME, SWAP_TYPE, SWAP_FN) { \
-    if (swap) { \
-        Scoped ## JNI_NAME ## ArrayRO elements(env, src); \
-        if (elements.get() == NULL) { \
-            return; \
-        } \
-        const SWAP_TYPE* src = reinterpret_cast<const SWAP_TYPE*>(elements.get()) + srcOffset; \
-        SWAP_FN(cast<SWAP_TYPE*>(dstAddress), src, count); \
-    } else { \
-        env->Get ## JNI_NAME ## ArrayRegion(src, srcOffset, count, cast<SCALAR_TYPE*>(dstAddress)); \
-    } \
-}
-
-static void OSMemory_pokeCharArray(JNIEnv* env, jclass, jint dstAddress, jcharArray src, jint srcOffset, jint count, jboolean swap) {
-    POKER(jchar, Char, jshort, swapShorts);
-}
-
-static void OSMemory_pokeDoubleArray(JNIEnv* env, jclass, jint dstAddress, jdoubleArray src, jint srcOffset, jint count, jboolean swap) {
-    POKER(jdouble, Double, jlong, swapLongs);
-}
-
-static void OSMemory_pokeFloatArray(JNIEnv* env, jclass, jint dstAddress, jfloatArray src, jint srcOffset, jint count, jboolean swap) {
-    POKER(jfloat, Float, jint, swapInts);
-}
-
-static void OSMemory_pokeIntArray(JNIEnv* env, jclass, jint dstAddress, jintArray src, jint srcOffset, jint count, jboolean swap) {
-    POKER(jint, Int, jint, swapInts);
-}
-
-static void OSMemory_pokeLongArray(JNIEnv* env, jclass, jint dstAddress, jlongArray src, jint srcOffset, jint count, jboolean swap) {
-    POKER(jlong, Long, jlong, swapLongs);
-}
-
-static void OSMemory_pokeShortArray(JNIEnv* env, jclass, jint dstAddress, jshortArray src, jint srcOffset, jint count, jboolean swap) {
-    POKER(jshort, Short, jshort, swapShorts);
-}
-
-static jshort OSMemory_peekShort(JNIEnv*, jclass, jint srcAddress, jboolean swap) {
-    jshort result = *cast<const jshort*>(srcAddress);
-    if (swap) {
-        result = bswap_16(result);
-    }
-    return result;
-}
-
-static void OSMemory_pokeShort(JNIEnv*, jclass, jint dstAddress, jshort value, jboolean swap) {
-    if (swap) {
-        value = bswap_16(value);
-    }
-    *cast<jshort*>(dstAddress) = value;
-}
-
-static jint OSMemory_peekInt(JNIEnv*, jclass, jint srcAddress, jboolean swap) {
-    jint result = *cast<const jint*>(srcAddress);
-    if (swap) {
-        result = bswap_32(result);
-    }
-    return result;
-}
-
-static void OSMemory_pokeInt(JNIEnv*, jclass, jint dstAddress, jint value, jboolean swap) {
-    if (swap) {
-        value = bswap_32(value);
-    }
-    *cast<jint*>(dstAddress) = value;
-}
-
-static jlong OSMemory_peekLong(JNIEnv*, jclass, jint srcAddress, jboolean swap) {
-    jlong result;
-    if ((srcAddress & LONG_ALIGNMENT_MASK) == 0) {
-        result = *cast<const jlong*>(srcAddress);
-    } else {
-        // Handle unaligned memory access one byte at a time
-        const jbyte* src = cast<const jbyte*>(srcAddress);
-        jbyte* dst = reinterpret_cast<jbyte*>(&result);
-        dst[0] = src[0];
-        dst[1] = src[1];
-        dst[2] = src[2];
-        dst[3] = src[3];
-        dst[4] = src[4];
-        dst[5] = src[5];
-        dst[6] = src[6];
-        dst[7] = src[7];
-    }
-    if (swap) {
-        result = bswap_64(result);
-    }
-    return result;
-}
-
-static void OSMemory_pokeLong(JNIEnv*, jclass, jint dstAddress, jlong value, jboolean swap) {
-    if (swap) {
-        value = bswap_64(value);
-    }
-    if ((dstAddress & LONG_ALIGNMENT_MASK) == 0) {
-        *cast<jlong*>(dstAddress) = value;
-    } else {
-        // Handle unaligned memory access one byte at a time
-        const jbyte* src = reinterpret_cast<const jbyte*>(&value);
-        jbyte* dst = cast<jbyte*>(dstAddress);
-        dst[0] = src[0];
-        dst[1] = src[1];
-        dst[2] = src[2];
-        dst[3] = src[3];
-        dst[4] = src[4];
-        dst[5] = src[5];
-        dst[6] = src[6];
-        dst[7] = src[7];
-    }
-}
-
-static jint OSMemory_mmapImpl(JNIEnv* env, jclass, jint fd, jlong offset, jlong size, jint mapMode) {
-    int prot, flags;
-    switch (mapMode) {
-    case 0: // MapMode.PRIVATE
-        prot = PROT_READ|PROT_WRITE;
-        flags = MAP_PRIVATE;
-        break;
-    case 1: // MapMode.READ_ONLY
-        prot = PROT_READ;
-        flags = MAP_SHARED;
-        break;
-    case 2: // MapMode.READ_WRITE
-        prot = PROT_READ|PROT_WRITE;
-        flags = MAP_SHARED;
-        break;
-    default:
-        jniThrowIOException(env, EINVAL);
-        LOGE("bad mapMode %i", mapMode);
-        return -1;
-    }
-
-    void* mapAddress = mmap(0, size, prot, flags, fd, offset);
-    if (mapAddress == MAP_FAILED) {
-        jniThrowIOException(env, errno);
-    }
-    return reinterpret_cast<uintptr_t>(mapAddress);
-}
-
-static void OSMemory_munmap(JNIEnv*, jclass, jint address, jlong size) {
-    munmap(cast<void*>(address), size);
-}
-
-static void OSMemory_load(JNIEnv*, jclass, jint address, jlong size) {
-    if (mlock(cast<void*>(address), size) != -1) {
-        munlock(cast<void*>(address), size);
-    }
-}
-
-static jboolean OSMemory_isLoaded(JNIEnv*, jclass, jint address, jlong size) {
-    if (size == 0) {
-        return JNI_TRUE;
-    }
-
-    static int page_size = getpagesize();
-
-    int align_offset = address % page_size;// addr should align with the boundary of a page.
-    address -= align_offset;
-    size += align_offset;
-    int page_count = (size + page_size - 1) / page_size;
-
-    UniquePtr<unsigned char[]> vec(new unsigned char[page_count]);
-    int rc = mincore(cast<void*>(address), size, vec.get());
-    if (rc == -1) {
-        return JNI_FALSE;
-    }
-
-    for (int i = 0; i < page_count; ++i) {
-        if (vec[i] != 1) {
-            return JNI_FALSE;
-        }
-    }
-    return JNI_TRUE;
-}
-
-static void OSMemory_msync(JNIEnv*, jclass, jint address, jlong size) {
-    msync(cast<void*>(address), size, MS_SYNC);
-}
-
-static void unsafeBulkCopy(jbyte* dst, const jbyte* src, jint byteCount,
-        jint sizeofElement, jboolean swap) {
-    if (!swap) {
-        memcpy(dst, src, byteCount);
-        return;
-    }
-
-    if (sizeofElement == 2) {
-        jshort* dstShorts = reinterpret_cast<jshort*>(dst);
-        const jshort* srcShorts = reinterpret_cast<const jshort*>(src);
-        swapShorts(dstShorts, srcShorts, byteCount / 2);
-    } else if (sizeofElement == 4) {
-        jint* dstInts = reinterpret_cast<jint*>(dst);
-        const jint* srcInts = reinterpret_cast<const jint*>(src);
-        swapInts(dstInts, srcInts, byteCount / 4);
-    } else if (sizeofElement == 8) {
-        jlong* dstLongs = reinterpret_cast<jlong*>(dst);
-        const jlong* srcLongs = reinterpret_cast<const jlong*>(src);
-        swapLongs(dstLongs, srcLongs, byteCount / 8);
-    }
-}
-
-static void OSMemory_unsafeBulkGet(JNIEnv* env, jclass, jobject dstObject, jint dstOffset,
-        jint byteCount, jbyteArray srcArray, jint srcOffset, jint sizeofElement, jboolean swap) {
-    ScopedByteArrayRO srcBytes(env, srcArray);
-    if (srcBytes.get() == NULL) {
-        return;
-    }
-    jarray dstArray = reinterpret_cast<jarray>(dstObject);
-    jbyte* dstBytes = reinterpret_cast<jbyte*>(env->GetPrimitiveArrayCritical(dstArray, NULL));
-    if (dstBytes == NULL) {
-        return;
-    }
-    jbyte* dst = dstBytes + dstOffset*sizeofElement;
-    const jbyte* src = srcBytes.get() + srcOffset;
-    unsafeBulkCopy(dst, src, byteCount, sizeofElement, swap);
-    env->ReleasePrimitiveArrayCritical(dstArray, dstBytes, 0);
-}
-
-static void OSMemory_unsafeBulkPut(JNIEnv* env, jclass, jbyteArray dstArray, jint dstOffset,
-        jint byteCount, jobject srcObject, jint srcOffset, jint sizeofElement, jboolean swap) {
-    ScopedByteArrayRW dstBytes(env, dstArray);
-    if (dstBytes.get() == NULL) {
-        return;
-    }
-    jarray srcArray = reinterpret_cast<jarray>(srcObject);
-    jbyte* srcBytes = reinterpret_cast<jbyte*>(env->GetPrimitiveArrayCritical(srcArray, NULL));
-    if (srcBytes == NULL) {
-        return;
-    }
-    jbyte* dst = dstBytes.get() + dstOffset;
-    const jbyte* src = srcBytes + srcOffset*sizeofElement;
-    unsafeBulkCopy(dst, src, byteCount, sizeofElement, swap);
-    env->ReleasePrimitiveArrayCritical(srcArray, srcBytes, 0);
-}
-
-static JNINativeMethod gMethods[] = {
-    NATIVE_METHOD(OSMemory, isLoaded, "(IJ)Z"),
-    NATIVE_METHOD(OSMemory, load, "(IJ)V"),
-    NATIVE_METHOD(OSMemory, memmove, "(IIJ)V"),
-    NATIVE_METHOD(OSMemory, mmapImpl, "(IJJI)I"),
-    NATIVE_METHOD(OSMemory, msync, "(IJ)V"),
-    NATIVE_METHOD(OSMemory, munmap, "(IJ)V"),
-    NATIVE_METHOD(OSMemory, peekByte, "(I)B"),
-    NATIVE_METHOD(OSMemory, peekByteArray, "(I[BII)V"),
-    NATIVE_METHOD(OSMemory, peekCharArray, "(I[CIIZ)V"),
-    NATIVE_METHOD(OSMemory, peekDoubleArray, "(I[DIIZ)V"),
-    NATIVE_METHOD(OSMemory, peekFloatArray, "(I[FIIZ)V"),
-    NATIVE_METHOD(OSMemory, peekInt, "(IZ)I"),
-    NATIVE_METHOD(OSMemory, peekIntArray, "(I[IIIZ)V"),
-    NATIVE_METHOD(OSMemory, peekLong, "(IZ)J"),
-    NATIVE_METHOD(OSMemory, peekLongArray, "(I[JIIZ)V"),
-    NATIVE_METHOD(OSMemory, peekShort, "(IZ)S"),
-    NATIVE_METHOD(OSMemory, peekShortArray, "(I[SIIZ)V"),
-    NATIVE_METHOD(OSMemory, pokeByte, "(IB)V"),
-    NATIVE_METHOD(OSMemory, pokeByteArray, "(I[BII)V"),
-    NATIVE_METHOD(OSMemory, pokeCharArray, "(I[CIIZ)V"),
-    NATIVE_METHOD(OSMemory, pokeDoubleArray, "(I[DIIZ)V"),
-    NATIVE_METHOD(OSMemory, pokeFloatArray, "(I[FIIZ)V"),
-    NATIVE_METHOD(OSMemory, pokeInt, "(IIZ)V"),
-    NATIVE_METHOD(OSMemory, pokeIntArray, "(I[IIIZ)V"),
-    NATIVE_METHOD(OSMemory, pokeLong, "(IJZ)V"),
-    NATIVE_METHOD(OSMemory, pokeLongArray, "(I[JIIZ)V"),
-    NATIVE_METHOD(OSMemory, pokeShort, "(ISZ)V"),
-    NATIVE_METHOD(OSMemory, pokeShortArray, "(I[SIIZ)V"),
-    NATIVE_METHOD(OSMemory, unsafeBulkGet, "(Ljava/lang/Object;II[BIIZ)V"),
-    NATIVE_METHOD(OSMemory, unsafeBulkPut, "([BIILjava/lang/Object;IIZ)V"),
-};
-int register_org_apache_harmony_luni_platform_OSMemory(JNIEnv* env) {
-    return jniRegisterNativeMethods(env, "org/apache/harmony/luni/platform/OSMemory",
-            gMethods, NELEM(gMethods));
-}
diff --git a/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp b/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp
index 03d1e69..b68f033 100644
--- a/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp
+++ b/luni/src/main/native/org_apache_harmony_luni_platform_OSNetworkSystem.cpp
@@ -35,29 +35,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/ioctl.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <sys/un.h>
 #include <unistd.h>
 
-// Temporary hack to build on systems that don't have up-to-date libc headers.
-#ifndef IPV6_TCLASS
-#ifdef __linux__
-#define IPV6_TCLASS 67 // Linux
-#else
-#define IPV6_TCLASS -1 // BSD(-like); TODO: Something better than this!
-#endif
-#endif
-
-/*
- * TODO: The multicast code is highly platform-dependent, and for now
- * we just punt on anything but Linux.
- */
-#ifdef __linux__
-#define ENABLE_MULTICAST
-#endif
-
 #define JAVASOCKOPT_IP_MULTICAST_IF 16
 #define JAVASOCKOPT_IP_MULTICAST_IF2 31
 #define JAVASOCKOPT_IP_MULTICAST_LOOP 18
@@ -81,18 +63,6 @@
 #define SOCKET_OP_READ 1
 #define SOCKET_OP_WRITE 2
 
-static struct CachedFields {
-    jfieldID iaddr_ipaddress;
-    jfieldID integer_class_value;
-    jfieldID boolean_class_value;
-    jfieldID socketimpl_address;
-    jfieldID socketimpl_port;
-    jfieldID socketimpl_localport;
-    jfieldID dpack_address;
-    jfieldID dpack_port;
-    jfieldID dpack_length;
-} gCachedFields;
-
 /**
  * Returns the port number in a sockaddr_storage structure.
  *
@@ -193,23 +163,6 @@
     sockaddr_storage mTmp;
 };
 
-/**
- * Converts an InetAddress object and port number to a native address structure.
- */
-static bool inetAddressToSocketAddress(JNIEnv* env, jobject inetAddress,
-        int port, sockaddr_storage* ss) {
-    // Get the byte array that stores the IP address bytes in the InetAddress.
-    if (inetAddress == NULL) {
-        jniThrowNullPointerException(env, NULL);
-        return false;
-    }
-    jbyteArray addressBytes =
-        reinterpret_cast<jbyteArray>(env->GetObjectField(inetAddress,
-            gCachedFields.iaddr_ipaddress));
-
-    return byteArrayToSocketAddress(env, NULL, addressBytes, port, ss);
-}
-
 // Converts a number of milliseconds to a timeval.
 static timeval toTimeval(long ms) {
     timeval tv;
@@ -218,11 +171,6 @@
     return tv;
 }
 
-// Converts a timeval to a number of milliseconds.
-static long toMs(const timeval& tv) {
-    return tv.tv_sec * 1000 + tv.tv_usec / 1000;
-}
-
 /**
  * Query OS for timestamp.
  * Retrieve the current value of system clock and convert to milliseconds.
@@ -236,10 +184,10 @@
  * timeval.tv_usec are long
  */
 static int time_msec_clock() {
-    timeval tp;
+    timeval tv;
     struct timezone tzp;
-    gettimeofday(&tp, &tzp);
-    return toMs(tp);
+    gettimeofday(&tv, &tzp);
+    return tv.tv_sec * 1000 + tv.tv_usec / 1000;
 }
 
 /**
@@ -354,7 +302,6 @@
     JNIEnv* mEnv;
 };
 
-#ifdef ENABLE_MULTICAST
 static void mcastJoinLeaveGroup(JNIEnv* env, int fd, jobject javaGroupRequest, bool join) {
     group_req groupRequest;
 
@@ -379,7 +326,7 @@
     if (rc == -1 && errno == EINVAL) {
         // Maybe we're a 32-bit binary talking to a 64-bit kernel?
         // glibc doesn't automatically handle this.
-        struct group_req64 {
+        struct GCC_HIDDEN group_req64 {
             uint32_t gr_interface;
             uint32_t my_padding;
             sockaddr_storage gr_group;
@@ -394,68 +341,6 @@
         return;
     }
 }
-#endif // def ENABLE_MULTICAST
-
-static bool initCachedFields(JNIEnv* env) {
-    memset(&gCachedFields, 0, sizeof(gCachedFields));
-    struct CachedFields* c = &gCachedFields;
-
-    struct fieldInfo {
-        jfieldID* field;
-        jclass clazz;
-        const char* name;
-        const char* type;
-    } fields[] = {
-        {&c->iaddr_ipaddress, JniConstants::inetAddressClass, "ipaddress", "[B"},
-        {&c->integer_class_value, JniConstants::integerClass, "value", "I"},
-        {&c->boolean_class_value, JniConstants::booleanClass, "value", "Z"},
-        {&c->socketimpl_port, JniConstants::socketImplClass, "port", "I"},
-        {&c->socketimpl_localport, JniConstants::socketImplClass, "localport", "I"},
-        {&c->socketimpl_address, JniConstants::socketImplClass, "address", "Ljava/net/InetAddress;"},
-        {&c->dpack_address, JniConstants::datagramPacketClass, "address", "Ljava/net/InetAddress;"},
-        {&c->dpack_port, JniConstants::datagramPacketClass, "port", "I"},
-        {&c->dpack_length, JniConstants::datagramPacketClass, "length", "I"}
-    };
-    for (unsigned i = 0; i < sizeof(fields) / sizeof(fields[0]); i++) {
-        fieldInfo f = fields[i];
-        *f.field = env->GetFieldID(f.clazz, f.name, f.type);
-        if (*f.field == NULL) return false;
-    }
-    return true;
-}
-
-static void OSNetworkSystem_socket(JNIEnv* env, jobject, jobject fileDescriptor, jboolean stream) {
-    if (fileDescriptor == NULL) {
-        jniThrowNullPointerException(env, NULL);
-        errno = EBADF;
-        return;
-    }
-
-    // Try IPv6 but fall back to IPv4...
-    int type = stream ? SOCK_STREAM : SOCK_DGRAM;
-    int fd = socket(AF_INET6, type, 0);
-    if (fd == -1 && errno == EAFNOSUPPORT) {
-        fd = socket(AF_INET, type, 0);
-    }
-    if (fd == -1) {
-        jniThrowSocketException(env, errno);
-        return;
-    } else {
-        jniSetFileDescriptorOfFD(env, fileDescriptor, fd);
-    }
-
-#ifdef __linux__
-    // The RFC (http://www.ietf.org/rfc/rfc3493.txt) says that IPV6_MULTICAST_HOPS defaults to 1.
-    // The Linux kernel (at least up to 2.6.32) accidentally defaults to 64 (which would be correct
-    // for the *unicast* hop limit). See http://www.spinics.net/lists/netdev/msg129022.html.
-    // When that bug is fixed, we can remove this code. Until then, we manually set the hop
-    // limit on IPv6 datagram sockets. (IPv4 is already correct.)
-    if (type == SOCK_DGRAM && getSocketAddressFamily(fd) == AF_INET6) {
-        int ttl = 1;
-        setsockopt(fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, &ttl, sizeof(int));
-    }
-#endif
-}
 
 static jint OSNetworkSystem_writeDirect(JNIEnv* env, jobject,
         jobject fileDescriptor, jint address, jint offset, jint count) {
@@ -602,18 +487,6 @@
     }
 }
 
-static void OSNetworkSystem_listen(JNIEnv* env, jobject, jobject fileDescriptor, jint backlog) {
-    NetFd fd(env, fileDescriptor);
-    if (fd.isClosed()) {
-        return;
-    }
-
-    int rc = listen(fd.get(), backlog);
-    if (rc == -1) {
-        jniThrowSocketException(env, errno);
-    }
-}
-
 static void OSNetworkSystem_accept(JNIEnv* env, jobject, jobject serverFileDescriptor,
         jobject newSocket, jobject clientFileDescriptor) {
 
@@ -670,8 +543,6 @@
             return;
         }
         int remotePort = getSocketAddressPort(&ss);
-        env->SetObjectField(newSocket, gCachedFields.socketimpl_address, remoteAddress);
-        env->SetIntField(newSocket, gCachedFields.socketimpl_port, remotePort);
 
         // Local port.
         memset(&ss, 0, addrLen);
@@ -682,7 +553,13 @@
             return;
         }
         int localPort = getSocketAddressPort(&ss);
-        env->SetIntField(newSocket, gCachedFields.socketimpl_localport, localPort);
+
+        static jfieldID addressFid = env->GetFieldID(JniConstants::socketImplClass, "address", "Ljava/net/InetAddress;");
+        static jfieldID localPortFid = env->GetFieldID(JniConstants::socketImplClass, "localport", "I");
+        static jfieldID portFid = env->GetFieldID(JniConstants::socketImplClass, "port", "I");
+        env->SetObjectField(newSocket, addressFid, remoteAddress);
+        env->SetIntField(newSocket, portFid, remotePort);
+        env->SetIntField(newSocket, localPortFid, localPort);
     }
 
     jniSetFileDescriptorOfFD(env, clientFileDescriptor, clientFd);
@@ -719,11 +596,6 @@
     }
 }
 
-static void OSNetworkSystem_setInetAddress(JNIEnv* env, jobject,
-        jobject sender, jbyteArray address) {
-    env->SetObjectField(sender, gCachedFields.iaddr_ipaddress, address);
-}
-
 // TODO: can we merge this with recvDirect?
 static jint OSNetworkSystem_readDirect(JNIEnv* env, jobject, jobject fileDescriptor,
         jint address, jint count) {
@@ -804,8 +676,11 @@
         return 0;
     }
 
+    static jfieldID addressFid = env->GetFieldID(JniConstants::datagramPacketClass, "address", "Ljava/net/InetAddress;");
+    static jfieldID lengthFid = env->GetFieldID(JniConstants::datagramPacketClass, "length", "I");
+    static jfieldID portFid = env->GetFieldID(JniConstants::datagramPacketClass, "port", "I");
     if (packet != NULL) {
-        env->SetIntField(packet, gCachedFields.dpack_length, bytesReceived);
+        env->SetIntField(packet, lengthFid, bytesReceived);
         if (!connected) {
             jbyteArray addr = socketAddressToByteArray(env, &ss);
             if (addr == NULL) {
@@ -816,8 +691,8 @@
             if (sender == NULL) {
                 return 0;
             }
-            env->SetObjectField(packet, gCachedFields.dpack_address, sender);
-            env->SetIntField(packet, gCachedFields.dpack_port, port);
+            env->SetObjectField(packet, addressFid, sender);
+            env->SetIntField(packet, portFid, port);
         }
     }
     return bytesReceived;
@@ -991,178 +866,6 @@
             translateFdSet(env, writeFDArray, countWriteC, writeFds, flagArray.get(), countReadC, SOCKET_OP_WRITE);
 }
 
-static jobject OSNetworkSystem_getSocketLocalAddress(JNIEnv* env,
-        jobject, jobject fileDescriptor) {
-    NetFd fd(env, fileDescriptor);
-    if (fd.isClosed()) {
-        return NULL;
-    }
-
-    sockaddr_storage ss;
-    socklen_t ssLen = sizeof(ss);
-    memset(&ss, 0, ssLen);
-    int rc = getsockname(fd.get(), reinterpret_cast<sockaddr*>(&ss), &ssLen);
-    if (rc == -1) {
-        // TODO: the public API doesn't allow failure, so this whole method
-        // represents a broken design. In practice, though, getsockname can't
-        // fail unless we give it invalid arguments.
-        LOGE("getsockname failed: %s (errno=%i)", strerror(errno), errno);
-        return NULL;
-    }
-    return socketAddressToInetAddress(env, &ss);
-}
-
-static jint OSNetworkSystem_getSocketLocalPort(JNIEnv* env, jobject,
-        jobject fileDescriptor) {
-    NetFd fd(env, fileDescriptor);
-    if (fd.isClosed()) {
-        return 0;
-    }
-
-    sockaddr_storage ss;
-    socklen_t ssLen = sizeof(ss);
-    memset(&ss, 0, sizeof(ss));
-    int rc = getsockname(fd.get(), reinterpret_cast<sockaddr*>(&ss), &ssLen);
-    if (rc == -1) {
-        // TODO: the public API doesn't allow failure, so this whole method
-        // represents a broken design. In practice, though, getsockname can't
-        // fail unless we give it invalid arguments.
-        LOGE("getsockname failed: %s (errno=%i)", strerror(errno), errno);
-        return 0;
-    }
-    return getSocketAddressPort(&ss);
-}
-
-template <typename T>
-static bool getSocketOption(JNIEnv* env, const NetFd& fd, int level, int option, T* value) {
-    socklen_t size = sizeof(*value);
-    int rc = getsockopt(fd.get(), level, option, value, &size);
-    if (rc == -1) {
-        LOGE("getSocketOption(fd=%i, level=%i, option=%i) failed: %s (errno=%i)",
-                fd.get(), level, option, strerror(errno), errno);
-        jniThrowSocketException(env, errno);
-        return false;
-    }
-    return true;
-}
-
-static jobject getSocketOption_Boolean(JNIEnv* env, const NetFd& fd, int level, int option) {
-    int value;
-    return getSocketOption(env, fd, level, option, &value) ? booleanValueOf(env, value) : NULL;
-}
-
-static jobject getSocketOption_Integer(JNIEnv* env, const NetFd& fd, int level, int option) {
-    int value;
-    return getSocketOption(env, fd, level, option, &value) ? integerValueOf(env, value) : NULL;
-}
-
-static jobject OSNetworkSystem_getSocketOption(JNIEnv* env, jobject, jobject fileDescriptor, jint option) {
-    NetFd fd(env, fileDescriptor);
-    if (fd.isClosed()) {
-        return NULL;
-    }
-
-    int family = getSocketAddressFamily(fd.get());
-    if (family != AF_INET && family != AF_INET6) {
-        jniThrowSocketException(env, EAFNOSUPPORT);
-        return NULL;
-    }
-
-    switch (option) {
-    case JAVASOCKOPT_TCP_NODELAY:
-        return getSocketOption_Boolean(env, fd, IPPROTO_TCP, TCP_NODELAY);
-    case JAVASOCKOPT_SO_SNDBUF:
-        return getSocketOption_Integer(env, fd, SOL_SOCKET, SO_SNDBUF);
-    case JAVASOCKOPT_SO_RCVBUF:
-        return getSocketOption_Integer(env, fd, SOL_SOCKET, SO_RCVBUF);
-    case JAVASOCKOPT_SO_BROADCAST:
-        return getSocketOption_Boolean(env, fd, SOL_SOCKET, SO_BROADCAST);
-    case JAVASOCKOPT_SO_REUSEADDR:
-        return getSocketOption_Boolean(env, fd, SOL_SOCKET, SO_REUSEADDR);
-    case JAVASOCKOPT_SO_KEEPALIVE:
-        return getSocketOption_Boolean(env, fd, SOL_SOCKET, SO_KEEPALIVE);
-    case JAVASOCKOPT_SO_OOBINLINE:
-        return getSocketOption_Boolean(env, fd, SOL_SOCKET, SO_OOBINLINE);
-    case JAVASOCKOPT_IP_TOS:
-        if (family == AF_INET) {
-            return getSocketOption_Integer(env, fd, IPPROTO_IP, IP_TOS);
-        } else {
-            return getSocketOption_Integer(env, fd, IPPROTO_IPV6, IPV6_TCLASS);
-        }
-    case JAVASOCKOPT_SO_LINGER:
-        {
-            linger lingr;
-            bool ok = getSocketOption(env, fd, SOL_SOCKET, SO_LINGER, &lingr);
-            if (!ok) {
-                return NULL; // We already threw.
-            } else if (!lingr.l_onoff) {
-                return booleanValueOf(env, false);
-            } else {
-                return integerValueOf(env, lingr.l_linger);
-            }
-        }
-    case JAVASOCKOPT_SO_TIMEOUT:
-        {
-            timeval timeout;
-            bool ok = getSocketOption(env, fd, SOL_SOCKET, SO_RCVTIMEO, &timeout);
-            return ok ? integerValueOf(env, toMs(timeout)) : NULL;
-        }
-#ifdef ENABLE_MULTICAST
-    case JAVASOCKOPT_IP_MULTICAST_IF:
-        {
-            // Although setsockopt(2) can take an ip_mreqn for IP_MULTICAST_IF, getsockopt(2)
-            // always returns an in_addr.
-            sockaddr_storage ss;
-            memset(&ss, 0, sizeof(ss));
-            ss.ss_family = AF_INET; // This call is IPv4-only.
-            sockaddr_in* sa = reinterpret_cast<sockaddr_in*>(&ss);
-            if (!getSocketOption(env, fd, IPPROTO_IP, IP_MULTICAST_IF, &sa->sin_addr)) {
-                return NULL;
-            }
-            return socketAddressToInetAddress(env, &ss);
-        }
-    case JAVASOCKOPT_IP_MULTICAST_IF2:
-        if (family == AF_INET) {
-            // The caller's asking for an interface index, but that's not how IPv4 works.
-            // Our Java should never get here, because we'll try IP_MULTICAST_IF first and
-            // that will satisfy us.
-            jniThrowSocketException(env, EAFNOSUPPORT);
-        } else {
-            return getSocketOption_Integer(env, fd, IPPROTO_IPV6, IPV6_MULTICAST_IF);
-        }
-    case JAVASOCKOPT_IP_MULTICAST_LOOP:
-        if (family == AF_INET) {
-            // Although IPv6 was cleaned up to use int, IPv4 multicast loopback uses a byte.
-            u_char loopback;
-            bool ok = getSocketOption(env, fd, IPPROTO_IP, IP_MULTICAST_LOOP, &loopback);
-            return ok ? booleanValueOf(env, loopback) : NULL;
-        } else {
-            return getSocketOption_Boolean(env, fd, IPPROTO_IPV6, IPV6_MULTICAST_LOOP);
-        }
-    case JAVASOCKOPT_MULTICAST_TTL:
-        if (family == AF_INET) {
-            // Although IPv6 was cleaned up to use int, and IPv4 non-multicast TTL uses int,
-            // IPv4 multicast TTL uses a byte.
-            u_char ttl;
-            bool ok = getSocketOption(env, fd, IPPROTO_IP, IP_MULTICAST_TTL, &ttl);
-            return ok ? integerValueOf(env, ttl) : NULL;
-        } else {
-            return getSocketOption_Integer(env, fd, IPPROTO_IPV6, IPV6_MULTICAST_HOPS);
-        }
-#else
-    case JAVASOCKOPT_MULTICAST_TTL:
-    case JAVASOCKOPT_IP_MULTICAST_IF:
-    case JAVASOCKOPT_IP_MULTICAST_IF2:
-    case JAVASOCKOPT_IP_MULTICAST_LOOP:
-        jniThrowException(env, "java/lang/UnsupportedOperationException", NULL);
-        return NULL;
-#endif // def ENABLE_MULTICAST
-    default:
-        jniThrowSocketException(env, ENOPROTOOPT);
-        return NULL;
-    }
-}
-
 template <typename T>
 static void setSocketOption(JNIEnv* env, const NetFd& fd, int level, int option, T* value) {
     int rc = setsockopt(fd.get(), level, option, value, sizeof(*value));
@@ -1182,9 +885,9 @@
     int intVal;
     bool wasBoolean = false;
     if (env->IsInstanceOf(optVal, JniConstants::integerClass)) {
-        intVal = (int) env->GetIntField(optVal, gCachedFields.integer_class_value);
+        intVal = intValue(env, optVal);
     } else if (env->IsInstanceOf(optVal, JniConstants::booleanClass)) {
-        intVal = (int) env->GetBooleanField(optVal, gCachedFields.boolean_class_value);
+        intVal = (int) booleanValue(env, optVal);
         wasBoolean = true;
     } else if (env->IsInstanceOf(optVal, JniConstants::inetAddressClass)) {
         // We use optVal directly as an InetAddress for IP_MULTICAST_IF.
@@ -1262,7 +965,6 @@
     case JAVASOCKOPT_TCP_NODELAY:
         setSocketOption(env, fd, IPPROTO_TCP, TCP_NODELAY, &intVal);
         return;
-#ifdef ENABLE_MULTICAST
     case JAVASOCKOPT_MCAST_JOIN_GROUP:
         mcastJoinLeaveGroup(env, fd.get(), optVal, true);
         return;
@@ -1323,40 +1025,11 @@
             }
             return;
         }
-#else
-    case JAVASOCKOPT_MULTICAST_TTL:
-    case JAVASOCKOPT_MCAST_JOIN_GROUP:
-    case JAVASOCKOPT_MCAST_LEAVE_GROUP:
-    case JAVASOCKOPT_IP_MULTICAST_IF:
-    case JAVASOCKOPT_IP_MULTICAST_IF2:
-    case JAVASOCKOPT_IP_MULTICAST_LOOP:
-        jniThrowException(env, "java/lang/UnsupportedOperationException", NULL);
-        return;
-#endif // def ENABLE_MULTICAST
     default:
         jniThrowSocketException(env, ENOPROTOOPT);
     }
 }
 
-static void doShutdown(JNIEnv* env, jobject fileDescriptor, int how) {
-    NetFd fd(env, fileDescriptor);
-    if (fd.isClosed()) {
-        return;
-    }
-    int rc = shutdown(fd.get(), how);
-    if (rc == -1) {
-        jniThrowSocketException(env, errno);
-    }
-}
-
-static void OSNetworkSystem_shutdownInput(JNIEnv* env, jobject, jobject fd) {
-    doShutdown(env, fd, SHUT_RD);
-}
-
-static void OSNetworkSystem_shutdownOutput(JNIEnv* env, jobject, jobject fd) {
-    doShutdown(env, fd, SHUT_WR);
-}
-
 static void OSNetworkSystem_close(JNIEnv* env, jobject, jobject fileDescriptor) {
     NetFd fd(env, fileDescriptor);
     if (fd.isClosed()) {
@@ -1378,11 +1051,7 @@
     NATIVE_METHOD(OSNetworkSystem, connectNonBlocking, "(Ljava/io/FileDescriptor;Ljava/net/InetAddress;I)Z"),
     NATIVE_METHOD(OSNetworkSystem, connect, "(Ljava/io/FileDescriptor;Ljava/net/InetAddress;II)V"),
     NATIVE_METHOD(OSNetworkSystem, disconnectDatagram, "(Ljava/io/FileDescriptor;)V"),
-    NATIVE_METHOD(OSNetworkSystem, getSocketLocalAddress, "(Ljava/io/FileDescriptor;)Ljava/net/InetAddress;"),
-    NATIVE_METHOD(OSNetworkSystem, getSocketLocalPort, "(Ljava/io/FileDescriptor;)I"),
-    NATIVE_METHOD(OSNetworkSystem, getSocketOption, "(Ljava/io/FileDescriptor;I)Ljava/lang/Object;"),
     NATIVE_METHOD(OSNetworkSystem, isConnected, "(Ljava/io/FileDescriptor;I)Z"),
-    NATIVE_METHOD(OSNetworkSystem, listen, "(Ljava/io/FileDescriptor;I)V"),
     NATIVE_METHOD(OSNetworkSystem, read, "(Ljava/io/FileDescriptor;[BII)I"),
     NATIVE_METHOD(OSNetworkSystem, readDirect, "(Ljava/io/FileDescriptor;II)I"),
     NATIVE_METHOD(OSNetworkSystem, recv, "(Ljava/io/FileDescriptor;Ljava/net/DatagramPacket;[BIIZZ)I"),
@@ -1391,17 +1060,12 @@
     NATIVE_METHOD(OSNetworkSystem, send, "(Ljava/io/FileDescriptor;[BIIILjava/net/InetAddress;)I"),
     NATIVE_METHOD(OSNetworkSystem, sendDirect, "(Ljava/io/FileDescriptor;IIIILjava/net/InetAddress;)I"),
     NATIVE_METHOD(OSNetworkSystem, sendUrgentData, "(Ljava/io/FileDescriptor;B)V"),
-    NATIVE_METHOD(OSNetworkSystem, setInetAddress, "(Ljava/net/InetAddress;[B)V"),
     NATIVE_METHOD(OSNetworkSystem, setSocketOption, "(Ljava/io/FileDescriptor;ILjava/lang/Object;)V"),
-    NATIVE_METHOD(OSNetworkSystem, shutdownInput, "(Ljava/io/FileDescriptor;)V"),
-    NATIVE_METHOD(OSNetworkSystem, shutdownOutput, "(Ljava/io/FileDescriptor;)V"),
-    NATIVE_METHOD(OSNetworkSystem, socket, "(Ljava/io/FileDescriptor;Z)V"),
     NATIVE_METHOD(OSNetworkSystem, write, "(Ljava/io/FileDescriptor;[BII)I"),
     NATIVE_METHOD(OSNetworkSystem, writeDirect, "(Ljava/io/FileDescriptor;III)I"),
 };
 
 int register_org_apache_harmony_luni_platform_OSNetworkSystem(JNIEnv* env) {
     AsynchronousSocketCloseMonitor::init();
-    return initCachedFields(env) && jniRegisterNativeMethods(env,
-            "org/apache/harmony/luni/platform/OSNetworkSystem", gMethods, NELEM(gMethods));
+    return jniRegisterNativeMethods(env, "org/apache/harmony/luni/platform/OSNetworkSystem", gMethods, NELEM(gMethods));
 }
diff --git a/luni/src/main/native/org_apache_harmony_luni_util_FloatingPointParser.cpp b/luni/src/main/native/org_apache_harmony_luni_util_FloatingPointParser.cpp
index 1428a80..70a6d4b 100644
--- a/luni/src/main/native/org_apache_harmony_luni_util_FloatingPointParser.cpp
+++ b/luni/src/main/native/org_apache_harmony_luni_util_FloatingPointParser.cpp
@@ -20,6 +20,7 @@
 #include <math.h>
 #include "JNIHelp.h"
 #include "JniConstants.h"
+#include "JniException.h"
 #include "ScopedUtfChars.h"
 #include "cbigint.h"
 
@@ -510,7 +511,7 @@
   free(y);
   free(D);
   free(D2);
-  jniThrowException(env, "java/lang/OutOfMemoryError", NULL);
+  jniThrowOutOfMemoryError(env, NULL);
   return z;
 }
 
@@ -984,7 +985,7 @@
   free(y);
   free(D);
   free(D2);
-  jniThrowException(env, "java/lang/OutOfMemoryError", NULL);
+  jniThrowOutOfMemoryError(env, NULL);
   return z;
 }
 
diff --git a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
index a5ee710..4ef4378 100644
--- a/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
+++ b/luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp
@@ -18,6 +18,7 @@
 
 #include "JNIHelp.h"
 #include "JniConstants.h"
+#include "JniException.h"
 #include "LocalArray.h"
 #include "ScopedJavaUnicodeString.h"
 #include "ScopedLocalRef.h"
@@ -34,10 +35,6 @@
 
 #define BUCKET_COUNT 128
 
-static void throw_OutOfMemoryError(JNIEnv* env) {
-    jniThrowException(env, "java/lang/OutOfMemoryError", "Out of memory.");
-}
-
 /**
  * Wrapper around an interned string.
  */
@@ -76,7 +73,7 @@
             int newCapacity = capacity * 2;
             jstring* newArray = new jstring[newCapacity];
             if (newArray == NULL) {
-                throw_OutOfMemoryError(env);
+                jniThrowOutOfMemoryError(env, NULL);
                 return;
             }
             memcpy(newArray, array, capacity * sizeof(jstring));
@@ -250,7 +247,7 @@
     // Allocate a new wrapper.
     UniquePtr<InternedString> wrapper(new InternedString);
     if (wrapper.get() == NULL) {
-        throw_OutOfMemoryError(env);
+        jniThrowOutOfMemoryError(env, NULL);
         return NULL;
     }
 
@@ -258,7 +255,7 @@
     // TODO: sometimes we already know the length. Reuse it if so.
     char* copy = new char[strlen(bytes) + 1];
     if (copy == NULL) {
-        throw_OutOfMemoryError(env);
+        jniThrowOutOfMemoryError(env, NULL);
         return NULL;
     }
     strcpy(copy, bytes);
@@ -380,7 +377,7 @@
         // Expand the bucket.
         bucket = expandInternedStringBucket(bucket, internedString);
         if (bucket == NULL) {
-            throw_OutOfMemoryError(env);
+            jniThrowOutOfMemoryError(env, NULL);
             return NULL;
         }
 
@@ -395,7 +392,7 @@
         // Create a new bucket with one entry.
         bucket = newInternedStringBucket(internedString);
         if (bucket == NULL) {
-            throw_OutOfMemoryError(env);
+            jniThrowOutOfMemoryError(env, NULL);
             return NULL;
         }
 
@@ -847,7 +844,7 @@
     XML_Parser parent = (XML_Parser) parentParser;
     XML_Parser entityParser = XML_ExternalEntityParserCreate(parent, context.c_str(), NULL);
     if (entityParser == NULL) {
-        throw_OutOfMemoryError(env);
+        jniThrowOutOfMemoryError(env, NULL);
     }
 
     return (jint) entityParser;
@@ -956,7 +953,7 @@
     // Allocate parsing context.
     UniquePtr<ParsingContext> context(new ParsingContext(object));
     if (context.get() == NULL) {
-        throw_OutOfMemoryError(env);
+        jniThrowOutOfMemoryError(env, NULL);
         return 0;
     }
 
@@ -992,7 +989,7 @@
         XML_SetUnparsedEntityDeclHandler(parser, unparsedEntityDecl);
         XML_SetUserData(parser, context.release());
     } else {
-        throw_OutOfMemoryError(env);
+        jniThrowOutOfMemoryError(env, NULL);
         return 0;
     }
 
@@ -1278,7 +1275,7 @@
 
     char* buffer = new char[totalSize];
     if (buffer == NULL) {
-        throw_OutOfMemoryError(env);
+        jniThrowOutOfMemoryError(env, NULL);
         return 0;
     }
 
diff --git a/luni/src/main/native/NativeCrypto.cpp b/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
similarity index 98%
rename from luni/src/main/native/NativeCrypto.cpp
rename to luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
index 3388acc..c682c23 100644
--- a/luni/src/main/native/NativeCrypto.cpp
+++ b/luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp
@@ -673,7 +673,7 @@
  * public static native int EVP_DigestInit(int)
  */
 static int NativeCrypto_EVP_DigestInit(JNIEnv* env, jclass, EVP_MD* evp_md) {
-    JNI_TRACE("NativeCrypto_EVP_DigestInit(%d)", evp_md);
+    JNI_TRACE("NativeCrypto_EVP_DigestInit(%p)", evp_md);
 
     if (evp_md == NULL) {
         jniThrowNullPointerException(env, NULL);
@@ -720,7 +720,7 @@
         return NULL;
     }
 
-    JNI_TRACE("NativeCrypto_EVP_get_digestbyname(%s) => %d", algorithmChars.c_str(), result);
+    JNI_TRACE("NativeCrypto_EVP_get_digestbyname(%s) => %p", algorithmChars.c_str(), evp_md);
     return (jint) evp_md;
 }
 
@@ -736,7 +736,7 @@
     }
 
     int result = EVP_MD_size(evp_md);
-    JNI_TRACE("NativeCrypto_EVP_MD_size(%p) => %d", ctx, result);
+    JNI_TRACE("NativeCrypto_EVP_MD_size(%p) => %d", evp_md, result);
     return result;
 }
 
@@ -1000,8 +1000,9 @@
         }
     }
 
+    int result = ok == 1;
     JNI_TRACE("NativeCrypto_verifySignature => %d", result);
-    return ok == 1;
+    return result;
 }
 
 static void NativeCrypto_RAND_seed(JNIEnv* env, jclass, jbyteArray seed) {
@@ -2298,12 +2299,12 @@
     }
     if (fdObject == NULL) {
         jniThrowNullPointerException(env, "fd == null");
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake fd == null => 0", ssl);
         return 0;
     }
     if (shc == NULL) {
         jniThrowNullPointerException(env, "sslHandshakeCallbacks == null");
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake sslHandshakeCallbacks == null => 0", ssl);
         return 0;
     }
 
@@ -2311,7 +2312,7 @@
     if (fd.isClosed()) {
         // SocketException thrown by NetFd.isClosed
         SSL_clear(ssl);
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake fd.isClosed() => 0", ssl);
         return 0;
     }
 
@@ -2322,7 +2323,7 @@
         throwSSLExceptionWithSslErrors(env, ssl, SSL_ERROR_NONE,
                                        "Error setting the file descriptor");
         SSL_clear(ssl);
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake SSL_set_fd => 0", ssl);
         return 0;
     }
 
@@ -2333,7 +2334,7 @@
     if (!setBlocking(fd.get(), false)) {
         throwSSLExceptionStr(env, "Unable to make socket non blocking");
         SSL_clear(ssl);
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake setBlocking => 0", ssl);
         return 0;
     }
 
@@ -2344,7 +2345,7 @@
     if (appData == NULL) {
         throwSSLExceptionStr(env, "Unable to create application data");
         SSL_clear(ssl);
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake appData => 0", ssl);
         return 0;
     }
     SSL_set_app_data(ssl, reinterpret_cast<char*>(appData));
@@ -2363,7 +2364,7 @@
         if (!appData->setCallbackState(env, shc, fdObject)) {
             // SocketException thrown by NetFd.isClosed
             SSL_clear(ssl);
-            JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+            JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake setCallbackState => 0", ssl);
             return 0;
         }
         ret = SSL_do_handshake(ssl);
@@ -2371,7 +2372,7 @@
         // cert_verify_callback threw exception
         if (env->ExceptionCheck()) {
             SSL_clear(ssl);
-            JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+            JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake clearCallbackState => 0", ssl);
             return 0;
         }
         // success case
@@ -2402,20 +2403,20 @@
             if (selectResult == THROWN_SOCKETEXCEPTION) {
                 // SocketException thrown by NetFd.isClosed
                 SSL_clear(ssl);
-                JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+                JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake sslSelect => 0", ssl);
                 return 0;
             }
             if (selectResult == -1) {
                 throwSSLExceptionWithSslErrors(env, ssl, SSL_ERROR_SYSCALL, "handshake error");
                 SSL_clear(ssl);
-                JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+                JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake selectResult == -1 => 0", ssl);
                 return 0;
             }
             if (selectResult == 0) {
                 throwSocketTimeoutException(env, "SSL handshake timed out");
                 SSL_clear(ssl);
                 freeSslErrorState();
-                JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+                JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake selectResult == 0 => 0", ssl);
                 return 0;
             }
         } else {
@@ -2438,7 +2439,7 @@
             throwSSLExceptionWithSslErrors(env, ssl, sslError, "SSL handshake terminated");
         }
         SSL_clear(ssl);
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake clean error => 0", ssl);
         return 0;
     }
 
@@ -2451,7 +2452,7 @@
         int sslError = SSL_get_error(ssl, ret);
         throwSSLExceptionWithSslErrors(env, ssl, sslError, "SSL handshake aborted");
         SSL_clear(ssl);
-        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake => 0", ssl);
+        JNI_TRACE("ssl=%p NativeCrypto_SSL_do_handshake unclean error => 0", ssl);
         return 0;
     }
     SSL_SESSION* ssl_session = SSL_get1_session(ssl);
diff --git a/luni/src/main/native/sub.mk b/luni/src/main/native/sub.mk
index 16059fe..1ab475c 100644
--- a/luni/src/main/native/sub.mk
+++ b/luni/src/main/native/sub.mk
@@ -1,3 +1,4 @@
+# -*- mode: makefile -*-
 # This file is included by the top-level libcore Android.mk.
 # It's not a normal makefile, so we don't include CLEAR_VARS
 # or BUILD_*_LIBRARY.
@@ -5,55 +6,53 @@
 LOCAL_SRC_FILES := \
 	AsynchronousSocketCloseMonitor.cpp \
 	ErrorCode.cpp \
-	ICU.cpp \
 	JniConstants.cpp \
 	JniException.cpp \
-	NativeBN.cpp \
-	NativeBidi.cpp \
-	NativeBreakIterator.cpp \
-	NativeCollation.cpp \
-	NativeConverter.cpp \
-	NativeCrypto.cpp \
-	NativeDecimalFormat.cpp \
-	NativeIDN.cpp \
-	NativeNormalizer.cpp \
-	NativePluralRules.cpp \
 	NetworkUtilities.cpp \
 	Register.cpp \
-	TimeZones.cpp \
 	cbigint.cpp \
 	ifaddrs-android.cpp \
 	java_io_Console.cpp \
 	java_io_File.cpp \
-	java_io_FileDescriptor.cpp \
 	java_io_ObjectStreamClass.cpp \
 	java_lang_Character.cpp \
-	java_lang_Double.cpp \
-	java_lang_Float.cpp \
 	java_lang_Math.cpp \
 	java_lang_ProcessManager.cpp \
 	java_lang_RealToString.cpp \
 	java_lang_StrictMath.cpp \
 	java_lang_System.cpp \
+	java_math_NativeBN.cpp \
 	java_net_InetAddress.cpp \
 	java_net_NetworkInterface.cpp \
 	java_nio_ByteOrder.cpp \
 	java_nio_charset_Charsets.cpp \
+	java_text_Bidi.cpp \
 	java_util_regex_Matcher.cpp \
 	java_util_regex_Pattern.cpp \
 	java_util_zip_Adler32.cpp \
 	java_util_zip_CRC32.cpp \
 	java_util_zip_Deflater.cpp \
 	java_util_zip_Inflater.cpp \
-	libcore_io_IoUtils.cpp \
+	libcore_icu_ICU.cpp \
+	libcore_icu_NativeBreakIterator.cpp \
+	libcore_icu_NativeCollation.cpp \
+	libcore_icu_NativeConverter.cpp \
+	libcore_icu_NativeDecimalFormat.cpp \
+	libcore_icu_NativeIDN.cpp \
+	libcore_icu_NativeNormalizer.cpp \
+	libcore_icu_NativePluralRules.cpp \
+	libcore_icu_TimeZones.cpp \
+	libcore_io_Memory.cpp \
+	libcore_io_OsConstants.cpp \
+	libcore_io_Posix.cpp \
 	libcore_net_RawSocket.cpp \
-	org_apache_harmony_luni_platform_OSFileSystem.cpp \
-	org_apache_harmony_luni_platform_OSMemory.cpp \
 	org_apache_harmony_luni_platform_OSNetworkSystem.cpp \
 	org_apache_harmony_luni_util_FloatingPointParser.cpp \
 	org_apache_harmony_xml_ExpatParser.cpp \
+	org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp \
 	readlink.cpp \
 	realpath.cpp \
+	toStringArray.cpp \
 	valueOf.cpp
 
 LOCAL_C_INCLUDES += \
diff --git a/luni/src/main/native/toStringArray.cpp b/luni/src/main/native/toStringArray.cpp
new file mode 100644
index 0000000..affd238
--- /dev/null
+++ b/luni/src/main/native/toStringArray.cpp
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "JniConstants.h"
+#include "toStringArray.h"
+
+#include <string>
+#include <vector>
+
+struct VectorCounter {
+    const std::vector<std::string>& strings;
+    VectorCounter(const std::vector<std::string>& strings) : strings(strings) {}
+    size_t operator()() {
+        return strings.size();
+    }
+};
+struct VectorGetter {
+    const std::vector<std::string>& strings;
+    VectorGetter(const std::vector<std::string>& strings) : strings(strings) {}
+    const char* operator()(size_t i) {
+        return strings[i].c_str();
+    }
+};
+
+jobjectArray toStringArray(JNIEnv* env, const std::vector<std::string>& strings) {
+    VectorCounter counter(strings);
+    VectorGetter getter(strings);
+    return toStringArray<VectorCounter, VectorGetter>(env, &counter, &getter);
+}
+
+struct ArrayCounter {
+    const char* const* strings;
+    ArrayCounter(const char* const* strings) : strings(strings) {}
+    size_t operator()() {
+        size_t count = 0;
+        while (strings[count] != NULL) {
+            ++count;
+        }
+        return count;
+    }
+};
+
+struct ArrayGetter {
+    const char* const* strings;
+    ArrayGetter(const char* const* strings) : strings(strings) {}
+    const char* operator()(size_t i) {
+        return strings[i];
+    }
+};
+
+jobjectArray toStringArray(JNIEnv* env, const char* const* strings) {
+    ArrayCounter counter(strings);
+    ArrayGetter getter(strings);
+    return toStringArray(env, &counter, &getter);
+}
diff --git a/luni/src/main/native/toStringArray.h b/luni/src/main/native/toStringArray.h
new file mode 100644
index 0000000..85efcb0
--- /dev/null
+++ b/luni/src/main/native/toStringArray.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "jni.h"
+#include "ScopedLocalRef.h"
+
+#include <string>
+#include <vector>
+
+template <typename Counter, typename Getter>
+jobjectArray toStringArray(JNIEnv* env, Counter* counter, Getter* getter) {
+    size_t count = (*counter)();
+    jobjectArray result = env->NewObjectArray(count, JniConstants::stringClass, NULL);
+    if (result == NULL) {
+        return NULL;
+    }
+    for (size_t i = 0; i < count; ++i) {
+        ScopedLocalRef<jstring> s(env, env->NewStringUTF((*getter)(i)));
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
+        env->SetObjectArrayElement(result, i, s.get());
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
+    }
+    return result;
+}
+
+template <typename Counter, typename Getter>
+jobjectArray toStringArray16(JNIEnv* env, Counter* counter, Getter* getter) {
+    size_t count = (*counter)();
+    jobjectArray result = env->NewObjectArray(count, JniConstants::stringClass, NULL);
+    if (result == NULL) {
+        return NULL;
+    }
+    for (size_t i = 0; i < count; ++i) {
+        int32_t charCount;
+        const jchar* chars = (*getter)(&charCount);
+        ScopedLocalRef<jstring> s(env, env->NewString(chars, charCount));
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
+        env->SetObjectArrayElement(result, i, s.get());
+        if (env->ExceptionCheck()) {
+            return NULL;
+        }
+    }
+    return result;
+}
+
+jobjectArray toStringArray(JNIEnv* env, const std::vector<std::string>& strings);
+jobjectArray toStringArray(JNIEnv* env, const char* const* strings);
diff --git a/luni/src/main/native/valueOf.cpp b/luni/src/main/native/valueOf.cpp
index a3475e3..310d48c 100644
--- a/luni/src/main/native/valueOf.cpp
+++ b/luni/src/main/native/valueOf.cpp
@@ -41,3 +41,13 @@
 jobject longValueOf(JNIEnv* env, jlong value) {
     return valueOf(env, JniConstants::longClass, "(J)Ljava/lang/Long;", value);
 }
+
+jboolean booleanValue(JNIEnv* env, jobject javaLangBoolean) {
+    static jfieldID fid = env->GetFieldID(JniConstants::booleanClass, "value", "Z");
+    return env->GetBooleanField(javaLangBoolean, fid);
+}
+
+jint intValue(JNIEnv* env, jobject javaLangInteger) {
+    static jfieldID fid = env->GetFieldID(JniConstants::integerClass, "value", "I");
+    return env->GetIntField(javaLangInteger, fid);
+}
diff --git a/luni/src/main/native/valueOf.h b/luni/src/main/native/valueOf.h
index 5c8588f..592977d 100644
--- a/luni/src/main/native/valueOf.h
+++ b/luni/src/main/native/valueOf.h
@@ -24,4 +24,9 @@
 jobject integerValueOf(JNIEnv* env, jint i);
 jobject longValueOf(JNIEnv* env, jlong l);
 
+// Note that these aren't equivalent to the Number methods: the jobject MUST be of the exact
+// type specified. This is less general but faster (and currently sufficient).
+jboolean booleanValue(JNIEnv* env, jobject javaLangBoolean);
+jint intValue(JNIEnv* env, jobject javaLangInteger);
+
 #endif  // VALUE_OF_H_included
diff --git a/luni/src/test/java-internal/org/apache/harmony/archive/util/UtilTest.java b/luni/src/test/java-internal/org/apache/harmony/archive/util/UtilTest.java
deleted file mode 100644
index 7e1c4bd..0000000
--- a/luni/src/test/java-internal/org/apache/harmony/archive/util/UtilTest.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.archive.util;
-
-import junit.framework.TestCase;
-
-public class UtilTest extends TestCase {
-    private static final String ASCII_ALPHABET_LC = "abcdefghijklmnopqrstuvwxyz";
-    private static final String ASCII_ALPHABET_UC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
-    private static final byte[] ASCII_ALPHABET_LC_BYTES;
-    private static final byte[] ASCII_ALPHABET_UC_BYTES;
-
-    static {
-        ASCII_ALPHABET_LC_BYTES = new byte[ASCII_ALPHABET_LC.length()];
-        for (int i = 0; i < ASCII_ALPHABET_LC_BYTES.length; i++) {
-            final char c = ASCII_ALPHABET_LC.charAt(i);
-            final byte b = (byte) c;
-            assert ((char) b) == c;
-            ASCII_ALPHABET_LC_BYTES[i] = b;
-        }
-
-        ASCII_ALPHABET_UC_BYTES = new byte[ASCII_ALPHABET_UC.length()];
-        for (int i = 0; i < ASCII_ALPHABET_UC_BYTES.length; i++) {
-            final char c = ASCII_ALPHABET_UC.charAt(i);
-            final byte b = (byte) c;
-            assert ((char) b) == c;
-            ASCII_ALPHABET_UC_BYTES[i] = b;
-        }
-    }
-
-    public void testasciiEndsWithIgnoreCase() {
-        final String s1 = ASCII_ALPHABET_LC;
-        final String s2 = ASCII_ALPHABET_UC;
-        assertTrue(Util.asciiEndsWithIgnoreCase(s1, s2));
-        assertTrue(Util.asciiEndsWithIgnoreCase(s2, s1));
-        assertTrue(Util.asciiEndsWithIgnoreCase(s1, "wxyz"));
-    }
-
-    public void testasciiEqualsIgnoreCase() {
-        final String s1 = ASCII_ALPHABET_LC;
-        final String s2 = ASCII_ALPHABET_UC;
-        assertTrue(Util.asciiEqualsIgnoreCase(s1, s2));
-        assertTrue(Util.asciiEqualsIgnoreCase(s2, s1));
-    }
-
-    public void testEqualsIgnoreCaseByteArrayByteArray() {
-        assertTrue(Util.asciiEqualsIgnoreCase(ASCII_ALPHABET_LC_BYTES,
-                ASCII_ALPHABET_LC_BYTES));
-        assertTrue(Util.asciiEqualsIgnoreCase(ASCII_ALPHABET_LC_BYTES,
-                ASCII_ALPHABET_UC_BYTES));
-        assertTrue(Util.asciiEqualsIgnoreCase(ASCII_ALPHABET_UC_BYTES,
-                ASCII_ALPHABET_UC_BYTES));
-    }
-
-}
diff --git a/luni/src/test/java/com/android/org/bouncycastle/jce/provider/AllTests.java b/luni/src/test/java/com/android/org/bouncycastle/jce/provider/AllTests.java
deleted file mode 100644
index 3ec53a4..0000000
--- a/luni/src/test/java/com/android/org/bouncycastle/jce/provider/AllTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.android.org.bouncycastle.jce.provider;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for " + AllTests.class.getPackage());
-        suite.addTestSuite(PKIXCertPathValidatorSpiTest.class);
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/dalvik/system/DexClassLoaderTest.java b/luni/src/test/java/dalvik/system/DexClassLoaderTest.java
index c34b5cd..c7bfc80 100644
--- a/luni/src/test/java/dalvik/system/DexClassLoaderTest.java
+++ b/luni/src/test/java/dalvik/system/DexClassLoaderTest.java
@@ -74,10 +74,15 @@
     }
 
     /**
-     * Copy a resource in the package directory to the indicated file.
+     * Copy a resource in the package directory to the indicated
+     * target file, but only if the target file doesn't exist.
      */
     private static void copyResource(ClassLoader loader, String resourceName,
             File destination) throws IOException {
+        if (destination.exists()) {
+            return;
+        }
+
         InputStream in =
             loader.getResourceAsStream(PACKAGE_PATH + resourceName);
         FileOutputStream out = new FileOutputStream(destination);
diff --git a/luni/src/test/java/libcore/icu/TimeZonesTest.java b/luni/src/test/java/libcore/icu/TimeZonesTest.java
deleted file mode 100644
index 7f45c3d..0000000
--- a/luni/src/test/java/libcore/icu/TimeZonesTest.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package libcore.icu;
-
-public class TimeZonesTest extends junit.framework.TestCase {
-    public void test_getZoneStrings() throws Exception {
-        // Check that corrupting our array doesn't affect other callers.
-        assertNotNull(TimeZones.getZoneStrings(null)[0]);
-        TimeZones.getZoneStrings(null)[0] = null;
-        assertNotNull(TimeZones.getZoneStrings(null)[0]);
-        // getDisplayTimezones actually returns a String[][] rather than a String[].
-        assertNotNull(TimeZones.getZoneStrings(null)[0][0]);
-        TimeZones.getZoneStrings(null)[0][0] = null;
-        assertNotNull(TimeZones.getZoneStrings(null)[0][0]);
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/luni/platform/OSMemoryTest.java b/luni/src/test/java/libcore/io/MemoryTest.java
similarity index 82%
rename from luni/src/test/java/org/apache/harmony/luni/platform/OSMemoryTest.java
rename to luni/src/test/java/libcore/io/MemoryTest.java
index 5c283d4..a533f15 100644
--- a/luni/src/test/java/org/apache/harmony/luni/platform/OSMemoryTest.java
+++ b/luni/src/test/java/libcore/io/MemoryTest.java
@@ -15,12 +15,12 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.platform;
+package libcore.io;
 
 import dalvik.system.VMRuntime;
 import junit.framework.TestCase;
 
-public class OSMemoryTest extends TestCase {
+public class MemoryTest extends TestCase {
     public void testSetIntArray() {
         int[] values = { 3, 7, 31, 127, 8191, 131071, 524287, 2147483647 };
         int[] swappedValues = new int[values.length];
@@ -34,18 +34,18 @@
         int ptr = (int) runtime.addressOf(array);
 
         // Regular copy.
-        OSMemory.pokeIntArray(ptr, values, 0, values.length, false);
+        Memory.pokeIntArray(ptr, values, 0, values.length, false);
         assertIntsEqual(values, ptr, false);
         assertIntsEqual(swappedValues, ptr, true);
 
         // Swapped copy.
-        OSMemory.pokeIntArray(ptr, values, 0, values.length, true);
+        Memory.pokeIntArray(ptr, values, 0, values.length, true);
         assertIntsEqual(values, ptr, true);
         assertIntsEqual(swappedValues, ptr, false);
 
         // Swapped copies of slices (to ensure we test non-zero offsets).
         for (int i = 0; i < values.length; ++i) {
-            OSMemory.pokeIntArray(ptr + i * scale, values, i, 1, true);
+            Memory.pokeIntArray(ptr + i * scale, values, i, 1, true);
         }
         assertIntsEqual(values, ptr, true);
         assertIntsEqual(swappedValues, ptr, false);
@@ -53,7 +53,7 @@
 
     private void assertIntsEqual(int[] expectedValues, int ptr, boolean swap) {
         for (int i = 0; i < expectedValues.length; ++i) {
-            assertEquals(expectedValues[i], OSMemory.peekInt(ptr + 4 * i, swap));
+            assertEquals(expectedValues[i], Memory.peekInt(ptr + 4 * i, swap));
         }
     }
 
@@ -67,18 +67,18 @@
         int ptr = (int) runtime.addressOf(array);
 
         // Regular copy. Memset first so we start from a known state.
-        OSMemory.pokeShortArray(ptr, values, 0, values.length, false);
+        Memory.pokeShortArray(ptr, values, 0, values.length, false);
         assertShortsEqual(values, ptr, false);
         assertShortsEqual(swappedValues, ptr, true);
 
         // Swapped copy.
-        OSMemory.pokeShortArray(ptr, values, 0, values.length, true);
+        Memory.pokeShortArray(ptr, values, 0, values.length, true);
         assertShortsEqual(values, ptr, true);
         assertShortsEqual(swappedValues, ptr, false);
 
         // Swapped copies of slices (to ensure we test non-zero offsets).
         for (int i = 0; i < values.length; ++i) {
-            OSMemory.pokeShortArray(ptr + i * scale, values, i, 1, true);
+            Memory.pokeShortArray(ptr + i * scale, values, i, 1, true);
         }
         assertShortsEqual(values, ptr, true);
         assertShortsEqual(swappedValues, ptr, false);
@@ -86,7 +86,7 @@
 
     private void assertShortsEqual(short[] expectedValues, int ptr, boolean swap) {
         for (int i = 0; i < expectedValues.length; ++i) {
-            assertEquals(expectedValues[i], OSMemory.peekShort(ptr + 2 * i, swap));
+            assertEquals(expectedValues[i], Memory.peekShort(ptr + 2 * i, swap));
         }
     }
 }
diff --git a/luni/src/test/java/libcore/java/io/FileDescriptorTest.java b/luni/src/test/java/libcore/java/io/FileDescriptorTest.java
new file mode 100644
index 0000000..4315b81
--- /dev/null
+++ b/luni/src/test/java/libcore/java/io/FileDescriptorTest.java
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.io;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import junit.framework.TestCase;
+
+public class FileDescriptorTest extends TestCase {
+    public void testReadOnlyFileDescriptorSync() throws Exception {
+        File f= File.createTempFile("FileDescriptorTest", "tmp");
+        new RandomAccessFile(f, "r").getFD().sync();
+    }
+}
diff --git a/luni/src/test/java/libcore/java/io/FileInputStreamTest.java b/luni/src/test/java/libcore/java/io/FileInputStreamTest.java
index d622afc..30f5ed0 100644
--- a/luni/src/test/java/libcore/java/io/FileInputStreamTest.java
+++ b/luni/src/test/java/libcore/java/io/FileInputStreamTest.java
@@ -18,23 +18,17 @@
 
 import java.io.FileDescriptor;
 import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
-
 import junit.framework.TestCase;
 import libcore.io.IoUtils;
+import libcore.io.Libcore;
 
 public final class FileInputStreamTest extends TestCase {
     private static final int TOTAL_SIZE = 1024;
     private static final int SKIP_SIZE = 100;
 
-    private static void createPipes(FileDescriptor pipe[]) throws IOException {
-        int fds[] = new int[2];
-        IoUtils.pipe(fds);
-        pipe[0] = IoUtils.newFileDescriptor(fds[0]);
-        pipe[1] = IoUtils.newFileDescriptor(fds[1]);
-    }
-
     private static class DataFeeder extends Thread {
         private FileDescriptor mOutFd;
 
@@ -62,8 +56,7 @@
         }
     }
 
-    private void verifyData(FileInputStream is, int start, int count)
-            throws IOException {
+    private void verifyData(FileInputStream is, int start, int count) throws IOException {
         byte buffer[] = new byte[count];
         assertEquals(count, is.read(buffer));
         for (int i = 0; i < count; ++i) {
@@ -71,15 +64,8 @@
         }
     }
 
-    private static void closeQuietly(FileDescriptor fd) {
-        try {
-            if (fd != null) IoUtils.close(fd);
-        } catch (Throwable t) {}
-    }
-
     public void testSkipInPipes() throws Exception {
-        FileDescriptor pipe[] = new FileDescriptor[2];
-        createPipes(pipe);
+        FileDescriptor[] pipe = Libcore.os.pipe();
         DataFeeder feeder = new DataFeeder(pipe[1]);
         try {
             feeder.start();
@@ -90,7 +76,15 @@
             feeder.join(1000);
             assertFalse(feeder.isAlive());
         } finally {
-            closeQuietly(pipe[0]);
+            IoUtils.closeQuietly(pipe[0]);
+        }
+    }
+
+    public void testDirectories() throws Exception {
+        try {
+            new FileInputStream(".");
+            fail();
+        } catch (FileNotFoundException expected) {
         }
     }
 }
diff --git a/luni/src/test/java/libcore/java/io/FileTest.java b/luni/src/test/java/libcore/java/io/FileTest.java
index 535975d6..df55222 100644
--- a/luni/src/test/java/libcore/java/io/FileTest.java
+++ b/luni/src/test/java/libcore/java/io/FileTest.java
@@ -23,6 +23,7 @@
 import java.io.InputStreamReader;
 import java.io.IOException;
 import java.util.UUID;
+import libcore.io.Libcore;
 
 public class FileTest extends junit.framework.TestCase {
     private static File createTemporaryDirectory() throws Exception {
@@ -181,11 +182,54 @@
         assertEquals(target.getCanonicalPath(), linkName.getCanonicalPath());
     }
 
-    private static void ln_s(File target, File linkName) throws Exception {
+    private static void ln_s(File target, File linkName) {
         ln_s(target.toString(), linkName.toString());
     }
 
-    private static void ln_s(String target, String linkName) throws Exception {
-        File.symlink(target, linkName);
+    private static void ln_s(String target, String linkName) {
+        Libcore.os.symlink(target, linkName);
+    }
+
+    public void test_createNewFile() throws Exception {
+        File f = File.createTempFile("FileTest", "tmp");
+        assertFalse(f.createNewFile()); // EEXIST -> false
+        assertFalse(f.getParentFile().createNewFile()); // EEXIST -> false, even if S_ISDIR
+        try {
+            new File(f, "poop").createNewFile(); // ENOTDIR -> throw
+            fail();
+        } catch (IOException expected) {
+        }
+        try {
+            new File("").createNewFile(); // ENOENT -> throw
+            fail();
+        } catch (IOException expected) {
+        }
+    }
+
+    public void test_rename() throws Exception {
+        File f = File.createTempFile("FileTest", "tmp");
+        assertFalse(f.renameTo(new File("")));
+        assertFalse(new File("").renameTo(f));
+        assertFalse(f.renameTo(new File(".")));
+        assertTrue(f.renameTo(f));
+    }
+
+    public void test_getAbsolutePath() throws Exception {
+        String originalUserDir = System.getProperty("user.dir");
+        try {
+            File f = new File("poop");
+            System.setProperty("user.dir", "/a");
+            assertEquals("/a/poop", f.getAbsolutePath());
+            System.setProperty("user.dir", "/b");
+            assertEquals("/b/poop", f.getAbsolutePath());
+        } finally {
+            System.setProperty("user.dir", originalUserDir);
+        }
+    }
+
+    public void test_getSpace() throws Exception {
+        assertTrue(new File("/").getFreeSpace() >= 0);
+        assertTrue(new File("/").getTotalSpace() >= 0);
+        assertTrue(new File("/").getUsableSpace() >= 0);
     }
 }
diff --git a/luni/src/test/java/libcore/java/io/OldCharArrayReaderTest.java b/luni/src/test/java/libcore/java/io/OldCharArrayReaderTest.java
index 31277e0..a28b84f 100644
--- a/luni/src/test/java/libcore/java/io/OldCharArrayReaderTest.java
+++ b/luni/src/test/java/libcore/java/io/OldCharArrayReaderTest.java
@@ -27,7 +27,7 @@
     CharArrayReader cr;
 
     /**
-     * @tests java.io.CharArrayReader#CharArrayReader(char[])
+     * java.io.CharArrayReader#CharArrayReader(char[])
      */
     public void test_Constructor$C() {
         // Test for method java.io.CharArrayReader(char [])
@@ -41,7 +41,7 @@
     }
 
     /**
-     * @tests java.io.CharArrayReader#CharArrayReader(char[], int, int)
+     * java.io.CharArrayReader#CharArrayReader(char[], int, int)
      */
     public void test_Constructor$CII() throws IOException {
         try {
@@ -76,7 +76,7 @@
     }
 
     /**
-     * @tests java.io.CharArrayReader#close()
+     * java.io.CharArrayReader#close()
      */
     public void test_close() {
         cr = new CharArrayReader(hw);
@@ -91,7 +91,7 @@
     }
 
     /**
-     * @tests java.io.CharArrayReader#mark(int)
+     * java.io.CharArrayReader#mark(int)
      */
     public void test_markI() throws IOException {
         cr = new CharArrayReader(hw);
@@ -112,7 +112,7 @@
     }
 
     /**
-     * @tests java.io.CharArrayReader#markSupported()
+     * java.io.CharArrayReader#markSupported()
      */
     public void test_markSupported() {
         cr = new CharArrayReader(hw);
@@ -120,7 +120,7 @@
     }
 
     /**
-     * @tests java.io.CharArrayReader#read()
+     * java.io.CharArrayReader#read()
      */
     public void test_read() throws IOException {
         cr = new CharArrayReader(hw);
@@ -140,7 +140,7 @@
     }
 
     /**
-     * @tests java.io.CharArrayReader#read(char[], int, int)
+     * java.io.CharArrayReader#read(char[], int, int)
      */
     public void test_read$CII() throws IOException {
         // Test for method int java.io.CharArrayReader.read(char [], int, int)
@@ -214,7 +214,7 @@
     }
 
     /**
-     * @tests java.io.CharArrayReader#reset()
+     * java.io.CharArrayReader#reset()
      */
     public void test_reset() throws IOException {
         cr = new CharArrayReader(hw);
diff --git a/luni/src/test/java/libcore/java/io/OldLineNumberReaderTest.java b/luni/src/test/java/libcore/java/io/OldLineNumberReaderTest.java
index 7e27698..71c7bbe 100644
--- a/luni/src/test/java/libcore/java/io/OldLineNumberReaderTest.java
+++ b/luni/src/test/java/libcore/java/io/OldLineNumberReaderTest.java
@@ -50,7 +50,7 @@
     }
 
     /**
-     * @tests java.io.LineNumberReader#read()
+     * java.io.LineNumberReader#read()
      */
     public void test_read() throws IOException {
         lnr = new LineNumberReader(new StringReader(text));
@@ -72,7 +72,7 @@
     }
 
     /**
-     * @tests java.io.LineNumberReader#read(char[], int, int)
+     * java.io.LineNumberReader#read(char[], int, int)
      */
     public void test_read$CII() throws IOException {
         lnr = new LineNumberReader(new StringReader(text));
diff --git a/luni/src/test/java/libcore/java/io/OldObjectOutputStreamTest.java b/luni/src/test/java/libcore/java/io/OldObjectOutputStreamTest.java
index cf01d9d..f05da69 100644
--- a/luni/src/test/java/libcore/java/io/OldObjectOutputStreamTest.java
+++ b/luni/src/test/java/libcore/java/io/OldObjectOutputStreamTest.java
@@ -148,7 +148,7 @@
     static final String INIT_STR_VALUE = "a string that is blortz";
 
     /**
-     * @tests java.io.ObjectOutputStream#ObjectOutputStream(java.io.OutputStream)
+     * java.io.ObjectOutputStream#ObjectOutputStream(java.io.OutputStream)
      */
     public void test_ConstructorLjava_io_OutputStream() throws IOException {
         oos.close();
diff --git a/luni/src/test/java/libcore/java/io/OldPushbackReaderTest.java b/luni/src/test/java/libcore/java/io/OldPushbackReaderTest.java
index 31d921b..b4f5ab6 100644
--- a/luni/src/test/java/libcore/java/io/OldPushbackReaderTest.java
+++ b/luni/src/test/java/libcore/java/io/OldPushbackReaderTest.java
@@ -30,7 +30,7 @@
     String pbString = "Hello World";
 
     /**
-     * @tests java.io.PushbackReader#PushbackReader(java.io.Reader)
+     * java.io.PushbackReader#PushbackReader(java.io.Reader)
      */
     public void test_ConstructorLjava_io_Reader() {
         // Test for method java.io.PushbackReader(java.io.Reader)
@@ -53,7 +53,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#PushbackReader(java.io.Reader, int)
+     * java.io.PushbackReader#PushbackReader(java.io.Reader, int)
      */
     public void test_ConstructorLjava_io_ReaderI() throws IOException {
         PushbackReader tobj;
@@ -78,7 +78,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#close()
+     * java.io.PushbackReader#close()
      */
     public void test_close() throws IOException {
         PushbackReader tobj;
@@ -97,7 +97,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#markSupported()
+     * java.io.PushbackReader#markSupported()
      */
     public void test_markSupported() {
         assertFalse("Test 1: markSupported() must return false.",
@@ -105,7 +105,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#read()
+     * java.io.PushbackReader#read()
      */
     public void test_read() throws IOException {
         PushbackReader tobj;
@@ -122,7 +122,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#read(char[], int, int)
+     * java.io.PushbackReader#read(char[], int, int)
      */
     public void test_read$CII() throws IOException {
         PushbackReader tobj;
@@ -156,7 +156,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#read(char[], int, int)
+     * java.io.PushbackReader#read(char[], int, int)
      */
     public void test_read_$CII_Exception() throws IOException {
         pbr = new PushbackReader(new StringReader(pbString), 10);
@@ -224,7 +224,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#ready()
+     * java.io.PushbackReader#ready()
      */
     public void test_ready() throws IOException {
         PushbackReader tobj;
@@ -240,7 +240,7 @@
         }
     }
     /**
-     * @tests java.io.PushbackReader#unread(char[])
+     * java.io.PushbackReader#unread(char[])
      */
     public void test_unread$C() throws IOException {
         PushbackReader tobj;
@@ -281,7 +281,7 @@
 
     /**
      * @throws IOException
-     * @tests java.io.PushbackReader#skip(long)
+     * java.io.PushbackReader#skip(long)
      */
     public void test_skip$J() throws IOException {
         PushbackReader tobj;
@@ -300,7 +300,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#unread(char[], int, int)
+     * java.io.PushbackReader#unread(char[], int, int)
      */
     public void test_unread$CII() throws IOException {
         PushbackReader tobj;
@@ -345,7 +345,7 @@
     }
 
     /**
-     * @tests java.io.PushbackReader#unread(int)
+     * java.io.PushbackReader#unread(int)
      */
     public void test_unreadI() throws IOException {
         PushbackReader tobj;
diff --git a/luni/src/test/java/libcore/java/io/OldRandomAccessFileTest.java b/luni/src/test/java/libcore/java/io/OldRandomAccessFileTest.java
index c63cd7e..5e360cc 100644
--- a/luni/src/test/java/libcore/java/io/OldRandomAccessFileTest.java
+++ b/luni/src/test/java/libcore/java/io/OldRandomAccessFileTest.java
@@ -46,7 +46,7 @@
     static final int testLength = testString.length();
 
     /**
-     * @tests java.io.RandomAccessFile#RandomAccessFile(java.io.File,
+     * java.io.RandomAccessFile#RandomAccessFile(java.io.File,
      *        java.lang.String)
      */
     public void test_ConstructorLjava_io_FileLjava_lang_String() throws Exception {
@@ -99,7 +99,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#RandomAccessFile(java.lang.String,
+     * java.io.RandomAccessFile#RandomAccessFile(java.lang.String,
      *        java.lang.String)
      */
     public void test_ConstructorLjava_lang_StringLjava_lang_String()
@@ -163,7 +163,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#close()
+     * java.io.RandomAccessFile#close()
      */
     public void test_close() {
         // Test for method void java.io.RandomAccessFile.close()
@@ -176,7 +176,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#getChannel()
+     * java.io.RandomAccessFile#getChannel()
      */
     public void test_getChannel() throws IOException {
 
@@ -196,7 +196,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#getFD()
+     * java.io.RandomAccessFile#getFD()
      */
     public void test_getFD() throws IOException {
         // Test for method java.io.FileDescriptor
@@ -210,7 +210,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#getFilePointer()
+     * java.io.RandomAccessFile#getFilePointer()
      */
     public void test_getFilePointer() throws IOException {
         // Test for method long java.io.RandomAccessFile.getFilePointer()
@@ -228,7 +228,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#length()
+     * java.io.RandomAccessFile#length()
      */
     public void test_length() throws IOException {
         // Test for method long java.io.RandomAccessFile.length()
@@ -246,7 +246,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#read()
+     * java.io.RandomAccessFile#read()
      */
     public void test_read_write() throws IOException {
         int i;
@@ -286,7 +286,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#read(byte[])
+     * java.io.RandomAccessFile#read(byte[])
      */
     public void test_read$B() throws IOException {
         FileOutputStream fos = new java.io.FileOutputStream(fileName);
@@ -315,7 +315,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#read(byte[], int, int)
+     * java.io.RandomAccessFile#read(byte[], int, int)
      */
     public void test_read$BII() throws IOException {
         int bytesRead;
@@ -377,8 +377,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readBoolean()
-     * @tests java.io.RandomAccessFile#writeBoolean(boolean)
+     * java.io.RandomAccessFile#readBoolean()
+     * java.io.RandomAccessFile#writeBoolean(boolean)
      */
     public void test_read_writeBoolean() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -414,8 +414,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readByte()
-     * @tests java.io.RandomAccessFile#writeByte(byte)
+     * java.io.RandomAccessFile#readByte()
+     * java.io.RandomAccessFile#writeByte(byte)
      */
     public void test_read_writeByte() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -460,8 +460,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readChar()
-     * @tests java.io.RandomAccessFile#writeChar(char)
+     * java.io.RandomAccessFile#readChar()
+     * java.io.RandomAccessFile#writeChar(char)
      */
     public void test_read_writeChar() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -506,8 +506,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readDouble()
-     * @tests java.io.RandomAccessFile#writeDouble(double)
+     * java.io.RandomAccessFile#readDouble()
+     * java.io.RandomAccessFile#writeDouble(double)
      */
     public void test_read_writeDouble() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -543,8 +543,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readFloat()
-     * @tests java.io.RandomAccessFile#writeFloat(double)
+     * java.io.RandomAccessFile#readFloat()
+     * java.io.RandomAccessFile#writeFloat(double)
      */
     public void test_read_writeFloat() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -580,8 +580,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readInt()
-     * @tests java.io.RandomAccessFile#writeInt(char)
+     * java.io.RandomAccessFile#readInt()
+     * java.io.RandomAccessFile#writeInt(char)
      */
     public void test_read_writeInt() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -626,8 +626,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readLong()
-     * @tests java.io.RandomAccessFile#writeLong(char)
+     * java.io.RandomAccessFile#readLong()
+     * java.io.RandomAccessFile#writeLong(char)
      */
     public void test_read_writeLong() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -672,8 +672,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readShort()
-     * @tests java.io.RandomAccessFile#writeShort(short)
+     * java.io.RandomAccessFile#readShort()
+     * java.io.RandomAccessFile#writeShort(short)
      */
     public void test_read_writeShort() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -718,8 +718,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readUTF()
-     * @tests java.io.RandomAccessFile#writeShort(char)
+     * java.io.RandomAccessFile#readUTF()
+     * java.io.RandomAccessFile#writeShort(char)
      */
     public void test_read_writeUTF() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -751,8 +751,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#writeBytes(java.lang.String)
-     * @tests java.io.RandomAccessFile#readFully(byte[])
+     * java.io.RandomAccessFile#writeBytes(java.lang.String)
+     * java.io.RandomAccessFile#readFully(byte[])
      */
     public void test_readFully$B_writeBytesLjava_lang_String() throws IOException {
         byte[] buf = new byte[testLength];
@@ -794,8 +794,8 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#writeBytes(java.lang.String)
-     * @tests java.io.RandomAccessFile#readFully(byte[], int, int)
+     * java.io.RandomAccessFile#writeBytes(java.lang.String)
+     * java.io.RandomAccessFile#readFully(byte[], int, int)
      */
     public void test_readFully$BII() throws IOException {
         byte[] buf = new byte[testLength];
@@ -857,7 +857,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readUnsignedByte()
+     * java.io.RandomAccessFile#readUnsignedByte()
      */
     public void test_readUnsignedByte() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -884,7 +884,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readUnsignedShort()
+     * java.io.RandomAccessFile#readUnsignedShort()
      */
     public void test_readUnsignedShort() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -911,7 +911,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#readLine()
+     * java.io.RandomAccessFile#readLine()
      */
     public void test_readLine() throws IOException {
         // Test for method java.lang.String java.io.RandomAccessFile.readLine()
@@ -936,7 +936,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#seek(long)
+     * java.io.RandomAccessFile#seek(long)
      */
     public void test_seekJ() throws IOException {
         // Test for method void java.io.RandomAccessFile.seek(long)
@@ -964,7 +964,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#skipBytes(int)
+     * java.io.RandomAccessFile#skipBytes(int)
      */
     public void test_skipBytesI() throws IOException {
         byte[] buf = new byte[5];
@@ -996,7 +996,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#skipBytes(int)
+     * java.io.RandomAccessFile#skipBytes(int)
      */
     public void test_setLengthJ() throws IOException {
         int bytesRead;
@@ -1050,7 +1050,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#write(byte[])
+     * java.io.RandomAccessFile#write(byte[])
      */
     public void test_write$B() throws IOException {
         byte[] rbuf = new byte[4000];
@@ -1092,7 +1092,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#write(byte[], int, int)
+     * java.io.RandomAccessFile#write(byte[], int, int)
      */
     public void test_write$BII() throws Exception {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
@@ -1161,7 +1161,7 @@
     }
 
     /**
-     * @tests java.io.RandomAccessFile#writeChars(java.lang.String)
+     * java.io.RandomAccessFile#writeChars(java.lang.String)
      */
     public void test_writeCharsLjava_lang_String() throws IOException {
         RandomAccessFile raf = new java.io.RandomAccessFile(fileName, "rw");
diff --git a/luni/src/test/java/libcore/java/io/OutputStreamWriterTest.java b/luni/src/test/java/libcore/java/io/OutputStreamWriterTest.java
new file mode 100644
index 0000000..af9ec9b
--- /dev/null
+++ b/luni/src/test/java/libcore/java/io/OutputStreamWriterTest.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.io;
+
+import java.io.*;
+import java.util.Arrays;
+import junit.framework.TestCase;
+
+public class OutputStreamWriterTest extends TestCase {
+    private class FlushCountingOutputStream extends OutputStream {
+        int flushCount;
+        public void write(int b) {
+        }
+        @Override public void flush() throws IOException {
+            ++flushCount;
+        }
+    }
+
+    public void testFlushCount() throws Exception {
+        FlushCountingOutputStream os = new FlushCountingOutputStream();
+        OutputStreamWriter writer = new OutputStreamWriter(os, "UTF-8");
+        char[] chars = new char[16*1024];
+        Arrays.fill(chars, 'x');
+        for (int i = 0; i < 10; ++i) {
+            writer.write(chars);
+        }
+        assertEquals(0, os.flushCount);
+        writer.flush();
+        assertEquals(1, os.flushCount);
+        writer.close();
+        assertEquals(1, os.flushCount);
+    }
+
+    private void testFlush(boolean includeSecondHalf) throws Exception {
+        // OutputStreamWriter has an internal 8KiB buffer.
+        // We write enough characters to fill that, but leave data in the encoder.
+        // (Specifically, half a surrogate pair.)
+        // On flush/close, the writer needs to admit defeat and write the replacement character.
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        OutputStreamWriter writer = new OutputStreamWriter(baos, "UTF-32BE");
+        char[] cs = new char[8192/4 + 1];
+        Arrays.fill(cs, 'x');
+        cs[cs.length - 1] = '\ud842'; // One half of a surrogate pair (the other being U+df9f).
+        writer.write(cs, 0, cs.length);
+        writer.flush();
+        assertEquals(8192, baos.size()); // Just the 'x's so far.
+        if (includeSecondHalf) {
+            writer.write(0xdf9f);
+        }
+        writer.close();
+        // We should have 8192 32-bit big-endian 'x's...
+        byte[] bytes = baos.toByteArray();
+        assertEquals(8196, bytes.length);
+        int i = 0;
+        while (i < 8192) {
+            assertEquals((byte) 0, bytes[i++]);
+            assertEquals((byte) 0, bytes[i++]);
+            assertEquals((byte) 0, bytes[i++]);
+            assertEquals((byte) 'x', bytes[i++]);
+        }
+        if (includeSecondHalf) {
+            // ...followed by a 32-bit big-endian U+20b9f.
+            assertEquals((byte) 0x00, bytes[i++]);
+            assertEquals((byte) 0x02, bytes[i++]);
+            assertEquals((byte) 0x0b, bytes[i++]);
+            assertEquals((byte) 0x9f, bytes[i++]);
+        } else {
+            // ...followed by a 32-bit big-endian replacement character (U+fffd).
+            assertEquals((byte) 0, bytes[i++]);
+            assertEquals((byte) 0, bytes[i++]);
+            assertEquals((byte) 0xff, bytes[i++]);
+            assertEquals((byte) 0xfd, bytes[i++]);
+        }
+    }
+
+    public void testFlush_halfSurrogate() throws Exception {
+        testFlush(false);
+    }
+
+    public void testFlush_wholeSurrogate() throws Exception {
+        testFlush(true);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/io/RandomAccessFileTest.java b/luni/src/test/java/libcore/java/io/RandomAccessFileTest.java
index 8524502..57d101d 100644
--- a/luni/src/test/java/libcore/java/io/RandomAccessFileTest.java
+++ b/luni/src/test/java/libcore/java/io/RandomAccessFileTest.java
@@ -71,4 +71,17 @@
             System.runFinalization();
         }
     }
+
+    public void testDirectories() throws Exception {
+        try {
+            new RandomAccessFile(".", "r");
+            fail();
+        } catch (FileNotFoundException expected) {
+        }
+        try {
+            new RandomAccessFile(".", "rw");
+            fail();
+        } catch (FileNotFoundException expected) {
+        }
+    }
 }
diff --git a/luni/src/test/java/libcore/java/io/StreamTokenizerTest.java b/luni/src/test/java/libcore/java/io/StreamTokenizerTest.java
new file mode 100644
index 0000000..418d193
--- /dev/null
+++ b/luni/src/test/java/libcore/java/io/StreamTokenizerTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.io;
+
+import java.io.StreamTokenizer;
+import java.io.StringReader;
+import java.util.Locale;
+import junit.framework.TestCase;
+
+public class StreamTokenizerTest extends TestCase {
+    public void testLowerCase() throws Exception {
+        Locale.setDefault(Locale.US);
+        StreamTokenizer st = new StreamTokenizer(new StringReader("aIb aIb"));
+        st.lowerCaseMode(true);
+        st.nextToken();
+        assertEquals("aib", st.sval);
+
+        Locale.setDefault(new Locale("tr", "TR"));
+        st.nextToken();
+        assertEquals("a\u0131b", st.sval);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/ArrayIndexOutOfBoundsExceptionTest.java b/luni/src/test/java/libcore/java/lang/ArrayIndexOutOfBoundsExceptionTest.java
index 041b931..98e497d 100644
--- a/luni/src/test/java/libcore/java/lang/ArrayIndexOutOfBoundsExceptionTest.java
+++ b/luni/src/test/java/libcore/java/lang/ArrayIndexOutOfBoundsExceptionTest.java
@@ -25,7 +25,7 @@
             bs[2] = 0;
             fail();
         } catch (ArrayIndexOutOfBoundsException ex) {
-            assertEquals("index=2 length=1", ex.getMessage());
+            assertEquals("length=1; index=2", ex.getMessage());
         }
     }
 
@@ -35,7 +35,7 @@
             byte b = bs[2];
             fail();
         } catch (ArrayIndexOutOfBoundsException ex) {
-            assertEquals("index=2 length=1", ex.getMessage());
+            assertEquals("length=1; index=2", ex.getMessage());
         }
     }
 
@@ -45,7 +45,7 @@
             ds[2] = 0.0;
             fail();
         } catch (ArrayIndexOutOfBoundsException ex) {
-            assertEquals("index=2 length=1", ex.getMessage());
+            assertEquals("length=1; index=2", ex.getMessage());
         }
     }
 
@@ -55,7 +55,7 @@
             double d = ds[2];
             fail();
         } catch (ArrayIndexOutOfBoundsException ex) {
-            assertEquals("index=2 length=1", ex.getMessage());
+            assertEquals("length=1; index=2", ex.getMessage());
         }
     }
 
@@ -65,7 +65,7 @@
             os[2] = null;
             fail();
         } catch (ArrayIndexOutOfBoundsException ex) {
-            assertEquals("index=2 length=1", ex.getMessage());
+            assertEquals("length=1; index=2", ex.getMessage());
         }
     }
 
@@ -75,7 +75,7 @@
             Object o = os[2];
             fail();
         } catch (ArrayIndexOutOfBoundsException ex) {
-            assertEquals("index=2 length=1", ex.getMessage());
+            assertEquals("length=1; index=2", ex.getMessage());
         }
     }
 }
diff --git a/luni/src/test/java/libcore/java/lang/ArrayStoreExceptionTest.java b/luni/src/test/java/libcore/java/lang/ArrayStoreExceptionTest.java
index 1b4288e..c25245f 100644
--- a/luni/src/test/java/libcore/java/lang/ArrayStoreExceptionTest.java
+++ b/luni/src/test/java/libcore/java/lang/ArrayStoreExceptionTest.java
@@ -19,7 +19,7 @@
 import junit.framework.TestCase;
 
 public final class ArrayStoreExceptionTest extends TestCase {
-    public void testArrayStoreException() throws Exception {
+    public void testArrayStoreException_store1() throws Exception {
         Object[] array = new String[10];
         Object o = new Exception();
         try {
@@ -27,7 +27,128 @@
             fail();
         } catch (ArrayStoreException ex) {
             ex.printStackTrace();
-            assertEquals("java.lang.Exception cannot be stored in an array of type java.lang.String[]", ex.getMessage());
+            assertEquals("java.lang.Exception cannot be stored in an array of type "
+                    + "java.lang.String[]",
+                    ex.getMessage());
         }
     }
+
+    public void testArrayStoreException_store2() throws Exception {
+        Object[] array = new Nonce[10][];
+        Object o = new Integer(5);
+        try {
+            array[0] = o;
+            fail();
+        } catch (ArrayStoreException ex) {
+            assertEquals("java.lang.Integer cannot be stored in an array of type "
+                    + "libcore.java.lang.ArrayStoreExceptionTest$Nonce[][]",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_store3() throws Exception {
+        Object[] array = new Float[10][];
+        Object o = new Nonce[1];
+        try {
+            array[0] = o;
+            fail();
+        } catch (ArrayStoreException ex) {
+            assertEquals("libcore.java.lang.ArrayStoreExceptionTest$Nonce[] cannot be stored "
+                    + "in an array of type java.lang.Float[][]",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_arraycopy1() throws Exception {
+        String[] src = new String[] { null, null, null, null, "hello", "goodbye" };
+        Integer[] dest = new Integer[10];
+        try {
+            System.arraycopy(src, 1, dest, 0, 5);
+        } catch (ArrayStoreException ex) {
+            ex.printStackTrace();
+            assertEquals("source[4] of type java.lang.String cannot be stored in destination "
+                    + "array of type java.lang.Integer[]",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_arraycopy2() throws Exception {
+        String[] src = new String[1];
+        int[] dest = new int[1];
+        try {
+            System.arraycopy(src, 0, dest, 0, 1);
+        } catch (ArrayStoreException ex) {
+            assertEquals("java.lang.String[] and int[] are incompatible array types",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_arraycopy3() throws Exception {
+        float[] src = new float[1];
+        Runnable[] dest = new Runnable[1];
+        try {
+            System.arraycopy(src, 0, dest, 0, 1);
+        } catch (ArrayStoreException ex) {
+            assertEquals("float[] and java.lang.Runnable[] are incompatible array types",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_arraycopy4() throws Exception {
+        boolean[] src = new boolean[1];
+        double[][] dest = new double[1][];
+        try {
+            System.arraycopy(src, 0, dest, 0, 1);
+        } catch (ArrayStoreException ex) {
+            assertEquals("boolean[] and double[][] are incompatible array types",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_arraycopy5() throws Exception {
+        String src = "blort";
+        Object[] dest = new Object[1];
+        try {
+            System.arraycopy(src, 0, dest, 0, 1);
+        } catch (ArrayStoreException ex) {
+            assertEquals("source of type java.lang.String is not an array",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_arraycopy6() throws Exception {
+        Object[] src = new Object[1];
+        Integer dest = new Integer(5);
+        try {
+            System.arraycopy(src, 0, dest, 0, 1);
+        } catch (ArrayStoreException ex) {
+            assertEquals("destination of type java.lang.Integer is not an array",
+                    ex.getMessage());
+        }
+    }
+
+    public void testArrayStoreException_arraycopy7() throws Exception {
+        /*
+         * This test demonstrates that the exception message complains
+         * about the source in cases where neither source nor
+         * destination is an array.
+         */
+        Nonce src = new Nonce();
+        String dest = "blort";
+        try {
+            System.arraycopy(src, 0, dest, 0, 1);
+        } catch (ArrayStoreException ex) {
+            assertEquals("source of type libcore.java.lang.ArrayStoreExceptionTest$Nonce "
+                    + "is not an array",
+                    ex.getMessage());
+        }
+    }
+
+    /**
+     * This class is just used so that we have an example of getting a
+     * message that includes an inner class.
+     */
+    private static class Nonce {
+        // This space intentionally left blank.
+    }
 }
diff --git a/luni/src/test/java/libcore/java/lang/BooleanTest.java b/luni/src/test/java/libcore/java/lang/BooleanTest.java
new file mode 100644
index 0000000..1ee5421
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/BooleanTest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang;
+
+public class BooleanTest extends junit.framework.TestCase {
+    public void test_TRUE() {
+        assertSame(Boolean.TRUE, Boolean.valueOf(true));
+        assertTrue(Boolean.TRUE.booleanValue());
+    }
+
+    public void test_FALSE() {
+        assertSame(Boolean.FALSE, Boolean.valueOf(false));
+        assertFalse(Boolean.FALSE.booleanValue());
+    }
+
+    public void test_compare() throws Exception {
+        assertEquals(0, Boolean.compare(true, true));
+        assertEquals(0, Boolean.compare(false, false));
+        assertTrue(Boolean.compare(false, true) < 0);
+        assertTrue(Boolean.compare(true, false) > 0);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/ByteTest.java b/luni/src/test/java/libcore/java/lang/ByteTest.java
new file mode 100644
index 0000000..761a7f9
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/ByteTest.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang;
+
+public class ByteTest extends junit.framework.TestCase {
+    public void test_compare() throws Exception {
+        final byte min = Byte.MIN_VALUE;
+        final byte zero = (byte) 0;
+        final byte max = Byte.MAX_VALUE;
+        assertTrue(Byte.compare(max,  max)  == 0);
+        assertTrue(Byte.compare(min,  min)  == 0);
+        assertTrue(Byte.compare(zero, zero) == 0);
+        assertTrue(Byte.compare(max,  zero) > 0);
+        assertTrue(Byte.compare(max,  min)  > 0);
+        assertTrue(Byte.compare(zero, max)  < 0);
+        assertTrue(Byte.compare(zero, min)  > 0);
+        assertTrue(Byte.compare(min,  zero) < 0);
+        assertTrue(Byte.compare(min,  max)  < 0);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/CharacterTest.java b/luni/src/test/java/libcore/java/lang/CharacterTest.java
index 8ababfd..5dbc28e 100644
--- a/luni/src/test/java/libcore/java/lang/CharacterTest.java
+++ b/luni/src/test/java/libcore/java/lang/CharacterTest.java
@@ -31,4 +31,84 @@
             assertEquals(new Character((char) c), Character.valueOf((char) c));
         }
     }
+
+    public void test_isBmpCodePoint() throws Exception {
+        assertTrue(Character.isBmpCodePoint(0x0000));
+        assertTrue(Character.isBmpCodePoint(0x0666));
+        assertTrue(Character.isBmpCodePoint(0xffff));
+        assertFalse(Character.isBmpCodePoint(0x10000));
+        assertFalse(Character.isBmpCodePoint(-1));
+        assertFalse(Character.isBmpCodePoint(Integer.MAX_VALUE));
+        assertFalse(Character.isBmpCodePoint(Integer.MIN_VALUE));
+    }
+
+    public void test_isSurrogate() throws Exception {
+        assertFalse(Character.isSurrogate('\u0000'));
+        assertFalse(Character.isSurrogate('\u0666'));
+        assertFalse(Character.isSurrogate((char) (Character.MIN_SURROGATE - 1)));
+        for (char ch = Character.MIN_SURROGATE; ch <= Character.MAX_SURROGATE; ++ch) {
+            assertTrue(Character.isSurrogate(ch));
+        }
+        assertFalse(Character.isSurrogate((char) (Character.MAX_SURROGATE + 1)));
+    }
+
+    public void test_highSurrogate() throws Exception {
+        // The behavior for non-supplementary code points (like these two) is undefined.
+        // These are the obvious results if you don't do anything special.
+        assertEquals(0xd7c0, Character.highSurrogate(0x0000));
+        assertEquals(0xd7c1, Character.highSurrogate(0x0666));
+        // These two tests must pass, though.
+        assertEquals(0xd800, Character.highSurrogate(0x010000));
+        assertEquals(0xdbff, Character.highSurrogate(0x10ffff));
+    }
+
+    public void test_lowSurrogate() throws Exception {
+        // The behavior for non-supplementary code points (like these two) is undefined.
+        // These are the obvious results if you don't do anything special.
+        assertEquals(0xdc00, Character.lowSurrogate(0x0000));
+        assertEquals(0xde66, Character.lowSurrogate(0x0666));
+        // These two tests must pass, though.
+        assertEquals(0xdc00, Character.lowSurrogate(0x010000));
+        assertEquals(0xdfff, Character.lowSurrogate(0x10ffff));
+    }
+
+    public void test_getName() throws Exception {
+        // Character.getName requires the corresponding ICU data.
+        assertEquals("NULL", Character.getName(0x0000));
+        assertEquals("BELL", Character.getName(0x0007));
+        assertEquals("LATIN SMALL LETTER L", Character.getName('l'));
+        // This changed name from Unicode 1.0. Used to be "OPENING...".
+        assertEquals("LEFT CURLY BRACKET", Character.getName('{'));
+        assertEquals("ARABIC-INDIC DIGIT SIX", Character.getName(0x0666));
+        assertEquals("LINEAR B SYLLABLE B008 A", Character.getName(0x010000));
+
+        // Some private use code points.
+        assertEquals("PRIVATE USE AREA E000", Character.getName(0xe000));
+        assertEquals("SUPPLEMENTARY PRIVATE USE AREA A F0000", Character.getName(0xf0000));
+
+        // An unassigned code point.
+        assertNull(Character.getName(0x10ffff));
+
+        try {
+            Character.getName(-1);
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+        try {
+            Character.getName(Integer.MAX_VALUE);
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+        try {
+            Character.getName(Integer.MIN_VALUE);
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+    }
+
+    public void test_compare() throws Exception {
+        assertEquals(0, Character.compare('a', 'a'));
+        assertTrue(Character.compare('a', 'b') < 0);
+        assertTrue(Character.compare('b', 'a') > 0);
+    }
 }
diff --git a/luni/src/test/java/libcore/java/lang/ClassCastExceptionTest.java b/luni/src/test/java/libcore/java/lang/ClassCastExceptionTest.java
index 780f620..ec3aa46 100644
--- a/luni/src/test/java/libcore/java/lang/ClassCastExceptionTest.java
+++ b/luni/src/test/java/libcore/java/lang/ClassCastExceptionTest.java
@@ -16,6 +16,8 @@
 
 package libcore.java.lang;
 
+import java.io.InputStream;
+import java.lang.reflect.Array;
 import java.util.EnumMap;
 import java.util.EnumSet;
 import junit.framework.TestCase;
@@ -46,10 +48,74 @@
             Exception.class.asSubclass(String.class);
             fail();
         } catch (ClassCastException ex) {
-            assertEquals("java.lang.Exception cannot be cast to java.lang.String", ex.getMessage());
+            assertEquals("java.lang.Exception cannot be cast to java.lang.String",
+                    ex.getMessage());
         }
     }
 
+    public void testCastOperator() throws Exception {
+        try {
+            Object o = (InputStream) makeInteger();
+            fail();
+        } catch (ClassCastException ex) {
+            assertEquals("java.lang.Integer cannot be cast to java.io.InputStream",
+                    ex.getMessage());
+        }
+    }
+
+    public void testCastOperatorWithArrays() throws Exception {
+        try {
+            Object o = (E) makeArray(String.class);
+            fail();
+        } catch (ClassCastException ex) {
+            assertEquals("java.lang.String[] cannot be cast to "
+                    + "libcore.java.lang.ClassCastExceptionTest$E",
+                    ex.getMessage());
+        }
+
+        try {
+            Object o = (E) makeArray(float.class);
+            fail();
+        } catch (ClassCastException ex) {
+            assertEquals("float[] cannot be cast to libcore.java.lang.ClassCastExceptionTest$E",
+                    ex.getMessage());
+        }
+
+        try {
+            Object o = (E) makeArray(char[].class);
+            fail();
+        } catch (ClassCastException ex) {
+            assertEquals("char[][] cannot be cast to libcore.java.lang.ClassCastExceptionTest$E",
+                    ex.getMessage());
+        }
+
+        try {
+            Object o = (Object[][][]) makeInteger();
+            fail();
+        } catch (ClassCastException ex) {
+            assertEquals("java.lang.Integer cannot be cast to java.lang.Object[][][]",
+                    ex.getMessage());
+        }
+    }
+
+    /**
+     * Helper for {@link #testCastOperator} and {@link
+     * #testCastOperatorWithArrays}, above. It's important that the
+     * return type is {@code Object}, since otherwise the compiler
+     * will just reject the code.
+     */
+    private static Object makeInteger() {
+        return new Integer(5);
+    }
+
+    /**
+     * Helper for {@link #testCastOperatorWithArrays} above. It's important that
+     * the return type is {@code Object}.
+     */
+    private static Object makeArray(Class clazz) {
+        return Array.newInstance(clazz, 1);
+    }
+
     enum E { A, B, C };
     enum F { A, B, C };
 
diff --git a/luni/src/test/java/libcore/java/lang/ClassNotFoundExceptionTest.java b/luni/src/test/java/libcore/java/lang/ClassNotFoundExceptionTest.java
new file mode 100644
index 0000000..6eb97c2
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/ClassNotFoundExceptionTest.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang;
+
+import junit.framework.TestCase;
+
+public final class ClassNotFoundExceptionTest extends TestCase {
+    public void testIllegalName() throws Exception {
+        try {
+            // There is no such thing as an array of void.
+            Class.forName("[V");
+            fail();
+        } catch (ClassNotFoundException ex) {
+            assertEquals("[V", ex.getMessage());
+        }
+    }
+
+    public void testValidName() throws Exception {
+        try {
+            Class.forName("blort.Zorch");
+            fail();
+        } catch (ClassNotFoundException ex) {
+            assertEquals("blort.Zorch", ex.getMessage());
+        }
+    }
+
+    public void testValidArrayName() throws Exception {
+        try {
+            Class.forName("[[Lblort.Zorch;");
+            fail();
+        } catch (ClassNotFoundException ex) {
+            assertEquals("[[Lblort.Zorch;", ex.getMessage());
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/DoubleTest.java b/luni/src/test/java/libcore/java/lang/DoubleTest.java
index f92ae33..e4c7459 100644
--- a/luni/src/test/java/libcore/java/lang/DoubleTest.java
+++ b/luni/src/test/java/libcore/java/lang/DoubleTest.java
@@ -19,9 +19,110 @@
 import junit.framework.TestCase;
 
 public class DoubleTest extends TestCase {
-    // http://b/3238333
-    public void test3238333() throws Exception {
+    public void testDoubleToStringUnsignedDivide() throws Exception {
+        // http://b/3238333
         assertEquals("0.008", Double.toString(0.008));
         assertEquals("0.008366", Double.toString(0.008366));
+        // http://code.google.com/p/android/issues/detail?id=14033
+        assertEquals("0.009", Double.toString(0.009));
+        // http://code.google.com/p/android/issues/detail?id=14302
+        assertEquals("0.008567856012638986", Double.toString(0.008567856012638986));
+        assertEquals("0.010206713752229896", Double.toString(0.010206713752229896));
+    }
+
+    public void testNamedDoubles() throws Exception {
+        assertEquals(Double.NaN, Double.parseDouble("NaN"));
+        assertEquals(Double.NaN, Double.parseDouble("-NaN"));
+        assertEquals(Double.NaN, Double.parseDouble("+NaN"));
+        try {
+            Double.parseDouble("NNaN");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+        try {
+            Double.parseDouble("NaNN");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+
+        assertEquals(Double.POSITIVE_INFINITY, Double.parseDouble("+Infinity"));
+        assertEquals(Double.POSITIVE_INFINITY, Double.parseDouble("Infinity"));
+        assertEquals(Double.NEGATIVE_INFINITY, Double.parseDouble("-Infinity"));
+        try {
+            Double.parseDouble("IInfinity");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+        try {
+            Double.parseDouble("Infinityy");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+    }
+
+    public void testSuffixParsing() throws Exception {
+        String[] badStrings = { "1ff", "1fd", "1df", "1dd" };
+        for (String string : badStrings) {
+            try {
+                Double.parseDouble(string);
+                fail(string);
+            } catch (NumberFormatException expected) {
+            }
+        }
+        assertEquals(1.0, Double.parseDouble("1f"));
+        assertEquals(1.0, Double.parseDouble("1d"));
+        assertEquals(1.0, Double.parseDouble("1F"));
+        assertEquals(1.0, Double.parseDouble("1D"));
+        assertEquals(1.0, Double.parseDouble("1.D"));
+        assertEquals(1.0, Double.parseDouble("1.E0D"));
+        assertEquals(1.0, Double.parseDouble(".1E1D"));
+    }
+
+    public void testExponentParsing() throws Exception {
+        String[] strings = {
+            // Exponents missing integer values.
+            "1.0e", "1.0e+", "1.0e-",
+            // Exponents with too many explicit signs.
+            "1.0e++1", "1.0e+-1", "1.0e-+1", "1.0e--1"
+        };
+        for (String string : strings) {
+            try {
+                Double.parseDouble(string);
+                fail(string);
+            } catch (NumberFormatException expected) {
+            }
+        }
+
+        assertEquals(1.0e-323, Double.parseDouble("1.0e-323"));
+        assertEquals(0.0, Double.parseDouble("1.0e-324"));
+        assertEquals(-1.0e-323, Double.parseDouble("-1.0e-323"));
+        assertEquals(-0.0, Double.parseDouble("-1.0e-324"));
+
+        assertEquals(1.0e+308, Double.parseDouble("1.0e+308"));
+        assertEquals(Double.POSITIVE_INFINITY, Double.parseDouble("1.0e+309"));
+        assertEquals(-1.0e+308, Double.parseDouble("-1.0e+308"));
+        assertEquals(Double.NEGATIVE_INFINITY, Double.parseDouble("-1.0e+309"));
+
+        assertEquals(Double.POSITIVE_INFINITY, Double.parseDouble("1.0e+9999999999"));
+        assertEquals(Double.NEGATIVE_INFINITY, Double.parseDouble("-1.0e+9999999999"));
+        assertEquals(0.0, Double.parseDouble("1.0e-9999999999"));
+        assertEquals(-0.0, Double.parseDouble("-1.0e-9999999999"));
+
+        assertEquals(Double.POSITIVE_INFINITY, Double.parseDouble("320.0e+2147483647"));
+        assertEquals(-0.0, Double.parseDouble("-1.4e-2147483314"));
+    }
+
+    /**
+     * This value has been known to cause javac and java to infinite loop.
+     * http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
+     */
+    public void testParseLargestSubnormalDoublePrecision() {
+        assertEquals(2.2250738585072014E-308, Double.parseDouble("2.2250738585072012e-308"));
+        assertEquals(2.2250738585072014E-308, Double.parseDouble("0.00022250738585072012e-304"));
+        assertEquals(2.2250738585072014E-308, Double.parseDouble("00000002.2250738585072012e-308"));
+        assertEquals(2.2250738585072014E-308, Double.parseDouble("2.225073858507201200000e-308"));
+        assertEquals(2.2250738585072014E-308, Double.parseDouble("2.2250738585072012e-00308"));
+        assertEquals(2.2250738585072014E-308, Double.parseDouble("2.22507385850720129978001e-308"));
+        assertEquals(-2.2250738585072014E-308, Double.parseDouble("-2.2250738585072012e-308"));
     }
 }
diff --git a/luni/src/test/java/libcore/java/lang/FloatTest.java b/luni/src/test/java/libcore/java/lang/FloatTest.java
index 3708d87..00e1597 100644
--- a/luni/src/test/java/libcore/java/lang/FloatTest.java
+++ b/luni/src/test/java/libcore/java/lang/FloatTest.java
@@ -22,9 +22,92 @@
         // http://code.google.com/p/android/issues/detail?id=4185
         assertEquals(2358.166016f, Float.valueOf("2358.166016"));
     }
+
     public void test_valueOf_String2() throws Exception {
         // This threw OutOfMemoryException.
         // http://code.google.com/p/android/issues/detail?id=3156
         assertEquals(-2.14748365E9f, Float.valueOf(String.valueOf(Integer.MIN_VALUE)));
     }
+
+    public void testNamedFloats() throws Exception {
+        assertEquals(Float.NaN, Float.parseFloat("NaN"));
+        assertEquals(Float.NaN, Float.parseFloat("-NaN"));
+        assertEquals(Float.NaN, Float.parseFloat("+NaN"));
+        try {
+            Float.parseFloat("NNaN");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+        try {
+            Float.parseFloat("NaNN");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+
+        assertEquals(Float.POSITIVE_INFINITY, Float.parseFloat("+Infinity"));
+        assertEquals(Float.POSITIVE_INFINITY, Float.parseFloat("Infinity"));
+        assertEquals(Float.NEGATIVE_INFINITY, Float.parseFloat("-Infinity"));
+        try {
+            Float.parseFloat("IInfinity");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+        try {
+            Float.parseFloat("Infinityy");
+            fail();
+        } catch (NumberFormatException expected) {
+        }
+    }
+
+    public void testSuffixParsing() throws Exception {
+        String[] badStrings = { "1ff", "1fd", "1df", "1dd" };
+        for (String string : badStrings) {
+            try {
+                Float.parseFloat(string);
+                fail(string);
+            } catch (NumberFormatException expected) {
+            }
+        }
+        assertEquals(1.0f, Float.parseFloat("1f"));
+        assertEquals(1.0f, Float.parseFloat("1d"));
+        assertEquals(1.0f, Float.parseFloat("1F"));
+        assertEquals(1.0f, Float.parseFloat("1D"));
+        assertEquals(1.0f, Float.parseFloat("1.D"));
+        assertEquals(1.0f, Float.parseFloat("1.E0D"));
+        assertEquals(1.0f, Float.parseFloat(".1E1D"));
+    }
+
+    public void testExponentParsing() throws Exception {
+        String[] strings = {
+            // Exponents missing integer values.
+            "1.0e", "1.0e+", "1.0e-",
+            // Exponents with too many explicit signs.
+            "1.0e++1", "1.0e+-1", "1.0e-+1", "1.0e--1"
+        };
+        for (String string : strings) {
+            try {
+                Float.parseFloat(string);
+                fail(string);
+            } catch (NumberFormatException expected) {
+            }
+        }
+
+        assertEquals(1.0e-45f, Float.parseFloat("1.0e-45"));
+        assertEquals(0.0f, Float.parseFloat("1.0e-46"));
+        assertEquals(-1.0e-45f, Float.parseFloat("-1.0e-45"));
+        assertEquals(-0.0f, Float.parseFloat("-1.0e-46"));
+
+        assertEquals(1.0e+38f, Float.parseFloat("1.0e+38"));
+        assertEquals(Float.POSITIVE_INFINITY, Float.parseFloat("1.0e+39"));
+        assertEquals(-1.0e+38f, Float.parseFloat("-1.0e+38"));
+        assertEquals(Float.NEGATIVE_INFINITY, Float.parseFloat("-1.0e+39"));
+
+        assertEquals(Float.POSITIVE_INFINITY, Float.parseFloat("1.0e+9999999999"));
+        assertEquals(Float.NEGATIVE_INFINITY, Float.parseFloat("-1.0e+9999999999"));
+        assertEquals(0.0f, Float.parseFloat("1.0e-9999999999"));
+        assertEquals(-0.0f, Float.parseFloat("-1.0e-9999999999"));
+
+        assertEquals(Float.POSITIVE_INFINITY, Float.parseFloat("320.0E+2147483647"));
+        assertEquals(-0.0f, Float.parseFloat("-1.4E-2147483314"));
+    }
 }
diff --git a/luni/src/test/java/libcore/java/lang/IntegerTest.java b/luni/src/test/java/libcore/java/lang/IntegerTest.java
new file mode 100644
index 0000000..2d8c082
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/IntegerTest.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang;
+
+public class IntegerTest extends junit.framework.TestCase {
+    public void test_compare() throws Exception {
+        final int min = Integer.MIN_VALUE;
+        final int zero = 0;
+        final int max = Integer.MAX_VALUE;
+        assertTrue(Integer.compare(max,  max)  == 0);
+        assertTrue(Integer.compare(min,  min)  == 0);
+        assertTrue(Integer.compare(zero, zero) == 0);
+        assertTrue(Integer.compare(max,  zero) > 0);
+        assertTrue(Integer.compare(max,  min)  > 0);
+        assertTrue(Integer.compare(zero, max)  < 0);
+        assertTrue(Integer.compare(zero, min)  > 0);
+        assertTrue(Integer.compare(min,  zero) < 0);
+        assertTrue(Integer.compare(min,  max)  < 0);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/IntrinsicTest.java b/luni/src/test/java/libcore/java/lang/IntrinsicTest.java
new file mode 100644
index 0000000..fcf0522
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/IntrinsicTest.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang;
+
+import junit.framework.TestCase;
+
+public final class IntrinsicTest extends TestCase {
+    public void testString_charAt() throws Exception {
+        "hello".charAt(0);
+        String.class.getMethod("charAt", int.class).invoke("hello", 0);
+    }
+
+    public void testString_compareTo() throws Exception {
+        "hello".compareTo("world");
+        String.class.getMethod("compareTo", String.class).invoke("hello", "world");
+    }
+
+    public void testString_equals() throws Exception {
+        "hello".equals("world");
+        String.class.getMethod("equals", Object.class).invoke("hello", "world");
+    }
+
+    public void testString_fastIndexOf_II() throws Exception {
+        "hello".indexOf('l');
+        String.class.getMethod("indexOf", int.class).invoke("hello", 'l');
+    }
+
+    public void testString_isEmpty() throws Exception {
+        "hello".isEmpty();
+        String.class.getMethod("isEmpty").invoke("hello");
+    }
+
+    public void testString_length() throws Exception {
+        "hello".length();
+        String.class.getMethod("length").invoke("hello");
+    }
+
+    public void testMath_abs() throws Exception {
+        Math.abs(1);
+        Math.class.getMethod("abs", int.class).invoke(null, 1);
+        Math.abs(1L);
+        Math.class.getMethod("abs", long.class).invoke(null, 1L);
+        Math.abs(1.0f);
+        Math.class.getMethod("abs", float.class).invoke(null, 1.0f);
+        Math.abs(1.0);
+        Math.class.getMethod("abs", double.class).invoke(null, 1.0);
+    }
+
+    public void testMath_min() throws Exception {
+        Math.min(1, 2);
+        Math.class.getMethod("min", int.class, int.class).invoke(null, 1, 2);
+    }
+
+    public void testMath_max() throws Exception {
+        Math.max(1, 2);
+        Math.class.getMethod("max", int.class, int.class).invoke(null, 1, 2);
+    }
+
+    public void testMath_sqrt() throws Exception {
+        Math.sqrt(2.0);
+        Math.class.getMethod("sqrt", double.class).invoke(null, 2.0);
+    }
+
+    public void testMath_cos() throws Exception {
+        Math.cos(Math.PI);
+        Math.class.getMethod("cos", double.class).invoke(null, Math.PI);
+    }
+
+    public void testMath_sin() throws Exception {
+        Math.sin(Math.PI);
+        Math.class.getMethod("sin", double.class).invoke(null, Math.PI);
+    }
+
+    public void testFloat_floatToIntBits() throws Exception {
+        Float.floatToIntBits(0.0f);
+        Float.class.getMethod("floatToIntBits", float.class).invoke(null, 0.0f);
+    }
+
+    public void testFloat_floatToRawIntBits() throws Exception {
+        Float.floatToRawIntBits(0.0f);
+        Float.class.getMethod("floatToRawIntBits", float.class).invoke(null, 0.0f);
+    }
+
+    public void testFloat_intBitsToFloat() throws Exception {
+        Float.intBitsToFloat(0);
+        Float.class.getMethod("intBitsToFloat", int.class).invoke(null, 0);
+    }
+
+    public void testDouble_doubleToLongBits() throws Exception {
+        Double.doubleToLongBits(0.0);
+        Double.class.getMethod("doubleToLongBits", double.class).invoke(null, 0.0);
+    }
+
+    public void testDouble_doubleToRawLongBits() throws Exception {
+        Double.doubleToRawLongBits(0.0);
+        Double.class.getMethod("doubleToRawLongBits", double.class).invoke(null, 0.0);
+    }
+
+    public void testDouble_longBitsToDouble() throws Exception {
+        Double.longBitsToDouble(0L);
+        Double.class.getMethod("longBitsToDouble", long.class).invoke(null, 0L);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/LongTest.java b/luni/src/test/java/libcore/java/lang/LongTest.java
new file mode 100644
index 0000000..08bdd15
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/LongTest.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang;
+
+public class LongTest extends junit.framework.TestCase {
+    public void test_compare() throws Exception {
+        final long min = Long.MIN_VALUE;
+        final long zero = 0L;
+        final long max = Long.MAX_VALUE;
+        assertTrue(Long.compare(max,  max)  == 0);
+        assertTrue(Long.compare(min,  min)  == 0);
+        assertTrue(Long.compare(zero, zero) == 0);
+        assertTrue(Long.compare(max,  zero) > 0);
+        assertTrue(Long.compare(max,  min)  > 0);
+        assertTrue(Long.compare(zero, max)  < 0);
+        assertTrue(Long.compare(zero, min)  > 0);
+        assertTrue(Long.compare(min,  zero) < 0);
+        assertTrue(Long.compare(min,  max)  < 0);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/OldObjectTest.java b/luni/src/test/java/libcore/java/lang/OldObjectTest.java
index dd0e217..08471b2 100644
--- a/luni/src/test/java/libcore/java/lang/OldObjectTest.java
+++ b/luni/src/test/java/libcore/java/lang/OldObjectTest.java
@@ -38,38 +38,6 @@
     TestThread1 thr1;
     TestThread2 thr2;
 
-
-    @SideEffect("Causes OutOfMemoryError to test finalization")
-    public void test_finalize() {
-        isCalled = false;
-        class TestObject extends Object {
-
-            Vector<StringBuffer> v = new Vector<StringBuffer>();
-            public void add() {
-                v.add(new StringBuffer(10000));
-            }
-
-            protected void finalize() throws Throwable {
-                isCalled = true;
-                super.finalize();
-            }
-        }
-
-        TestObject to = new TestObject();
-
-        try {
-            while(true) {
-                to.add();
-            }
-        } catch(OutOfMemoryError oome) {
-            //expected
-            to = null;
-        }
-        System.gc();
-        System.runFinalization();
-        assertTrue(isCalled);
-    }
-
     public void test_clone() {
         MockCloneableObject mco = new MockCloneableObject();
         try {
diff --git a/luni/src/test/java/libcore/java/lang/OldStringBufferTest.java b/luni/src/test/java/libcore/java/lang/OldStringBufferTest.java
index 84828c4..f81ce5e 100644
--- a/luni/src/test/java/libcore/java/lang/OldStringBufferTest.java
+++ b/luni/src/test/java/libcore/java/lang/OldStringBufferTest.java
@@ -17,7 +17,9 @@
 
 package libcore.java.lang;
 
-public class OldStringBufferTest extends junit.framework.TestCase {
+import junit.framework.TestCase;
+
+public class OldStringBufferTest extends TestCase {
 
     StringBuffer testBuffer = new StringBuffer("This is a test buffer");
 
@@ -38,19 +40,9 @@
     }
 
     public void test_ensureCapacityI() {
-        // Test for method void java.lang.StringBuffer.ensureCapacity(int)
         StringBuffer sb = new StringBuffer(10);
-
         sb.ensureCapacity(-2);
         assertEquals("Failed to increase capacity.", 10, sb.capacity());
-
-
-        try {
-            sb.ensureCapacity(Integer.MAX_VALUE);
-            fail("OutOfMemoryError should be thrown.");
-        } catch(java.lang.OutOfMemoryError oome) {
-            //expected
-        }
     }
 
     public void test_getCharsII$CI() {
diff --git a/luni/src/test/java/libcore/java/lang/OldThreadGroupTest.java b/luni/src/test/java/libcore/java/lang/OldThreadGroupTest.java
index 5fe81a8..a7e0075 100644
--- a/luni/src/test/java/libcore/java/lang/OldThreadGroupTest.java
+++ b/luni/src/test/java/libcore/java/lang/OldThreadGroupTest.java
@@ -17,7 +17,11 @@
 
 package libcore.java.lang;
 
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
 import junit.framework.TestCase;
 
 public class OldThreadGroupTest extends TestCase implements Thread.UncaughtExceptionHandler {
@@ -118,67 +122,43 @@
                 inListOfThreads(listOfThreads));
     }
 
-    public void test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ() {
-        int numThreads = initialThreadGroup.activeCount();
-        Thread[] listOfThreads = new Thread[numThreads];
+    public void test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ() throws Exception {
+        // capture the initial condition
+        int initialThreadCount = initialThreadGroup.activeCount();
+        Thread[] initialThreads = new Thread[initialThreadCount];
+        assertEquals(initialThreadCount, initialThreadGroup.enumerate(initialThreads, false));
+        assertEquals(initialThreadCount, initialThreadGroup.enumerate(initialThreads, true));
+        assertTrue(inListOfThreads(initialThreads));
 
-        int countThread = initialThreadGroup.enumerate(listOfThreads, false);
-        assertEquals(numThreads, countThread);
-
-        countThread = initialThreadGroup.enumerate(listOfThreads, true);
-        assertEquals(numThreads, countThread);
-        assertTrue("Current thread must be in enumeration of threads",
-                inListOfThreads(listOfThreads));
-
-        ThreadGroup subGroup = new ThreadGroup(initialThreadGroup, "Test Group 1");
-        int subThreadsCount = 3;
-        Vector<MyThread> subThreads = populateGroupsWithThreads(subGroup,
-                subThreadsCount);
-
-        countThread = initialThreadGroup.enumerate(listOfThreads, true);
-        assertEquals(numThreads, countThread);
-        assertTrue("Current thread must be in enumeration of threads",
-                inListOfThreads(listOfThreads));
-
-        for(MyThread thr:subThreads) {
-            thr.start();
+        // start some the threads and see how the count changes
+        ThreadGroup group = new ThreadGroup(initialThreadGroup, "enumerateThreadArray");
+        int groupSize = 3;
+        List<MyThread> newThreads = populateGroupsWithThreads(group, groupSize);
+        assertEquals(initialThreadCount, initialThreadGroup.enumerate(initialThreads, true));
+        assertTrue(inListOfThreads(initialThreads));
+        for(MyThread thread : newThreads) {
+            thread.start();
         }
-        // lets give them some time to start
-        try {
-            Thread.sleep(500);
-        } catch (InterruptedException ie) {
-            fail("Should not be interrupted");
+        Thread.sleep(500); // starting threads isn't instant!
+        int afterStartCount = initialThreadGroup.activeCount();
+        Set<Thread> initialPlusNew = new HashSet<Thread>();
+        initialPlusNew.addAll(Arrays.asList(initialThreads));
+        initialPlusNew.addAll(newThreads);
+        Thread[] afterStartThreads = new Thread[afterStartCount];
+        assertEquals(afterStartCount, initialThreadGroup.enumerate(afterStartThreads, true));
+        assertEquals(initialPlusNew, new HashSet<Thread>(Arrays.asList(afterStartThreads)));
+        assertTrue(inListOfThreads(afterStartThreads));
+
+        // kill the threads and count 'em again
+        for(MyThread thread : newThreads) {
+            thread.interrupt();
         }
-
-        int numThreads2 = initialThreadGroup.activeCount();
-        listOfThreads = new Thread[numThreads2];
-
-        assertEquals(numThreads + subThreadsCount, numThreads2);
-
-        countThread = initialThreadGroup.enumerate(listOfThreads, true);
-        assertEquals(numThreads2, countThread);
-        assertTrue("Current thread must be in enumeration of threads",
-                inListOfThreads(listOfThreads));
-
-        for(MyThread thr:subThreads) {
-            thr.interrupt();
-        }
-        // lets give them some time to die
-        try {
-            Thread.sleep(500);
-        } catch (InterruptedException ie) {
-            fail("Should not be interrupted");
-        }
-
-        int numThreads3 = initialThreadGroup.activeCount();
-        listOfThreads = new Thread[numThreads3];
-
-        assertEquals(numThreads, numThreads3);
-
-        countThread = initialThreadGroup.enumerate(listOfThreads, false);
-        assertEquals(numThreads3, countThread);
-        assertTrue("Current thread must be in enumeration of threads",
-                inListOfThreads(listOfThreads));
+        Thread.sleep(500); // killing threads isn't instant
+        int afterDeathCount = initialThreadGroup.activeCount();
+        Thread[] afterDeathThreads = new Thread[afterDeathCount];
+        assertEquals(afterDeathCount, initialThreadGroup.enumerate(afterDeathThreads, false));
+        assertEquals(Arrays.asList(initialThreads), Arrays.asList(afterDeathThreads));
+        assertTrue(inListOfThreads(afterDeathThreads));
     }
 
     public void test_enumerateLThreadGroupArray() {
@@ -204,7 +184,7 @@
 
     public void test_enumerateLThreadGroupArrayLZ() {
         ThreadGroup thrGroup = new ThreadGroup("Test Group 1");
-        Vector<MyThread> subThreads = populateGroupsWithThreads(thrGroup, 3);
+        List<MyThread> subThreads = populateGroupsWithThreads(thrGroup, 3);
         int numGroupThreads = thrGroup.activeGroupCount();
         ThreadGroup[] listOfGroups = new ThreadGroup[numGroupThreads];
 
@@ -222,7 +202,7 @@
         assertEquals(0, thrGroup.enumerate(listOfGroups, false));
 
         ThreadGroup subGroup1 = new ThreadGroup(thrGroup, "Test Group 2");
-        Vector<MyThread> subThreads1 = populateGroupsWithThreads(subGroup1, 3);
+        List<MyThread> subThreads1 = populateGroupsWithThreads(subGroup1, 3);
         numGroupThreads = thrGroup.activeGroupCount();
         listOfGroups = new ThreadGroup[numGroupThreads];
 
@@ -243,7 +223,7 @@
          }
 
         ThreadGroup subGroup2 = new ThreadGroup(subGroup1, "Test Group 3");
-        Vector<MyThread> subThreads2 = populateGroupsWithThreads(subGroup2, 3);
+        List<MyThread> subThreads2 = populateGroupsWithThreads(subGroup2, 3);
         numGroupThreads = thrGroup.activeGroupCount();
         listOfGroups = new ThreadGroup[numGroupThreads];
 
@@ -252,7 +232,7 @@
     }
 
     /**
-     * @tests java.lang.ThreadGroup#interrupt()
+     * java.lang.ThreadGroup#interrupt()
      */
     private static boolean interrupted = false;
     public void test_interrupt() {
@@ -303,10 +283,11 @@
             // Ignore
         }
 
-        // No-op in Android. Must neither have an effect nor throw an exception.
-        Thread.State state = thread.getState();
-        group.resume();
-        assertEquals(state, thread.getState());
+        try {
+            group.resume();
+            fail();
+        } catch (UnsupportedOperationException expected) {
+        }
     }
 
     private Thread launchFiveSecondDummyThread(ThreadGroup group) {
@@ -356,7 +337,7 @@
     }
 
     private ThreadGroup[] groups(ThreadGroup parent) {
-        // No API to get the count of immediate children only ?
+        // No API to get the count of immediate children only
         int count = parent.activeGroupCount();
         ThreadGroup[] all = new ThreadGroup[count];
         parent.enumerate(all, false);
@@ -367,42 +348,24 @@
                 break;
             }
         }
-        ThreadGroup[] result;
-        if (actualSize == all.length) {
-            result = all;
-        } else {
-            result = new ThreadGroup[actualSize];
-            System.arraycopy(all, 0, result, 0, actualSize);
-        }
-
-        return result;
-
+        return Arrays.copyOfRange(all, 0, actualSize);
     }
 
-    private Vector<MyThread> populateGroupsWithThreads(final ThreadGroup aGroup,
-            final int threadCount) {
-        Vector<MyThread> result = new Vector<MyThread>();
-        populateGroupsWithThreads(aGroup, threadCount, result);
+    private List<MyThread> populateGroupsWithThreads(ThreadGroup group, int threadCount) {
+        List<MyThread> result = new ArrayList<MyThread>();
+        populateGroupsWithThreads(group, threadCount, result);
         return result;
-
     }
 
-    private void populateGroupsWithThreads(final ThreadGroup aGroup,
-            final int threadCount, final Vector<MyThread> allCreated) {
+    private void populateGroupsWithThreads(ThreadGroup group, int threadCount, List<MyThread> out) {
         for (int i = 0; i < threadCount; i++) {
-            final int iClone = i;
-            final String name = "(MyThread)N =" + iClone + "/" + threadCount
-                    + " ,Vector size at creation: " + allCreated.size();
-
-            MyThread t = new MyThread(aGroup, name);
-            allCreated.addElement(t);
+            out.add(new MyThread(group, "MyThread " + i + " of " + threadCount));
         }
 
         // Recursively for subgroups (if any)
-        ThreadGroup[] children = groups(aGroup);
+        ThreadGroup[] children = groups(group);
         for (ThreadGroup element : children) {
-            populateGroupsWithThreads(element, threadCount, allCreated);
+            populateGroupsWithThreads(element, threadCount, out);
         }
-
     }
 }
diff --git a/luni/src/test/java/libcore/java/lang/OldThreadTest.java b/luni/src/test/java/libcore/java/lang/OldThreadTest.java
index 1094d33..1e189f6 100644
--- a/luni/src/test/java/libcore/java/lang/OldThreadTest.java
+++ b/luni/src/test/java/libcore/java/lang/OldThreadTest.java
@@ -116,7 +116,7 @@
                     try {
                         Thread.sleep(100);
                         LockSupport.unpark(parker);
-                    } catch (InterruptedException ignored) {
+                    } catch (InterruptedException expected) {
                     }
                 }
             }
@@ -169,7 +169,7 @@
     }
 
     /**
-     * @tests java.lang.Thread#sleep(long)
+     * java.lang.Thread#sleep(long)
      */
     public void test_sleepJ() {
         // Note: Not too much we can test here that can be reliably measured.
@@ -394,10 +394,11 @@
             // Ignore
         }
 
-        // No-op in Android. Must neither have an effect nor throw an exception.
-        Thread.State state = thread.getState();
-        thread.stop();
-        assertEquals(state, thread.getState());
+        try {
+            thread.stop();
+            fail();
+        } catch (UnsupportedOperationException expected) {
+        }
     }
 
     public void test_start() {
@@ -429,10 +430,11 @@
             // Ignore
         }
 
-        // No-op in Android. Must neither have an effect nor throw an exception.
-        Thread.State state = thread.getState();
-        thread.stop(new Exception("Oops!"));
-        assertEquals(state, thread.getState());
+        try {
+            thread.stop(new Exception("Oops!"));
+            fail();
+        } catch (UnsupportedOperationException expected) {
+        }
     }
 
     @SuppressWarnings("deprecation")
@@ -445,10 +447,11 @@
             // Ignore
         }
 
-        // No-op in Android. Must neither have an effect nor throw an exception.
-        Thread.State state = thread.getState();
-        thread.suspend();
-        assertEquals(state, thread.getState());
+        try {
+            thread.suspend();
+            fail();
+        } catch (UnsupportedOperationException expected) {
+        }
     }
 
     Thread st, ct, spinner;
diff --git a/luni/src/test/java/libcore/java/lang/ShortTest.java b/luni/src/test/java/libcore/java/lang/ShortTest.java
new file mode 100644
index 0000000..ab987bd
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/ShortTest.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang;
+
+public class ShortTest extends junit.framework.TestCase {
+    public void test_compare() throws Exception {
+        final short min = Short.MIN_VALUE;
+        final short zero = 0;
+        final short max = Short.MAX_VALUE;
+        assertTrue(Short.compare(max,  max)  == 0);
+        assertTrue(Short.compare(min,  min)  == 0);
+        assertTrue(Short.compare(zero, zero) == 0);
+        assertTrue(Short.compare(max,  zero) > 0);
+        assertTrue(Short.compare(max,  min)  > 0);
+        assertTrue(Short.compare(zero, max)  < 0);
+        assertTrue(Short.compare(zero, min)  > 0);
+        assertTrue(Short.compare(min,  zero) < 0);
+        assertTrue(Short.compare(min,  max)  < 0);
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/StringIndexOutOfBoundsExceptionTest.java b/luni/src/test/java/libcore/java/lang/StringIndexOutOfBoundsExceptionTest.java
index bba8a96..822e37f 100644
--- a/luni/src/test/java/libcore/java/lang/StringIndexOutOfBoundsExceptionTest.java
+++ b/luni/src/test/java/libcore/java/lang/StringIndexOutOfBoundsExceptionTest.java
@@ -24,13 +24,24 @@
             "hello".charAt(-1);
             fail();
         } catch (StringIndexOutOfBoundsException ex) {
-            assertEquals("index=-1 length=5", ex.getMessage());
+            assertEquals("length=5; index=-1", ex.getMessage());
         }
+
         try {
             "hello".charAt(7);
             fail();
         } catch (StringIndexOutOfBoundsException ex) {
-            assertEquals("index=7 length=5", ex.getMessage());
+            assertEquals("length=5; index=7", ex.getMessage());
+        }
+    }
+
+    public void testSubstring() throws Exception {
+        try {
+            "hello there".substring(9,14);
+            fail();
+        } catch (StringIndexOutOfBoundsException ex) {
+            assertEquals("length=11; regionStart=9; regionLength=5",
+                    ex.getMessage());
         }
     }
 }
diff --git a/luni/src/test/java/libcore/java/lang/StringTest.java b/luni/src/test/java/libcore/java/lang/StringTest.java
index 799e8db..42a7aad 100644
--- a/luni/src/test/java/libcore/java/lang/StringTest.java
+++ b/luni/src/test/java/libcore/java/lang/StringTest.java
@@ -26,6 +26,7 @@
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import java.util.Arrays;
+import java.util.Locale;
 import junit.framework.TestCase;
 
 public class StringTest extends TestCase {
@@ -212,4 +213,101 @@
     static class HasLiteral {
         static String literal = "[5058, 9962, 1563, 5744]";
     }
+
+    private static final String LATIN_CAPITAL_I = "I";
+    private static final String LATIN_CAPITAL_I_WITH_DOT_ABOVE = "\u0130";
+    private static final String LATIN_SMALL_I = "i";
+    private static final String LATIN_SMALL_DOTLESS_I = "\u0131";
+
+    private static final String[] LATIN_I_VARIANTS = {
+        LATIN_SMALL_I,
+        LATIN_SMALL_DOTLESS_I,
+        LATIN_CAPITAL_I,
+        LATIN_CAPITAL_I_WITH_DOT_ABOVE,
+    };
+
+    public void testCaseMapping_tr_TR() {
+        Locale trTR = new Locale("tr", "TR");
+        assertEquals(LATIN_SMALL_I, LATIN_SMALL_I.toLowerCase(trTR));
+        assertEquals(LATIN_SMALL_I, LATIN_CAPITAL_I_WITH_DOT_ABOVE.toLowerCase(trTR));
+        assertEquals(LATIN_SMALL_DOTLESS_I, LATIN_SMALL_DOTLESS_I.toLowerCase(trTR));
+
+        assertEquals(LATIN_CAPITAL_I, LATIN_CAPITAL_I.toUpperCase(trTR));
+        assertEquals(LATIN_CAPITAL_I_WITH_DOT_ABOVE, LATIN_CAPITAL_I_WITH_DOT_ABOVE.toUpperCase(trTR));
+        assertEquals(LATIN_CAPITAL_I_WITH_DOT_ABOVE, LATIN_SMALL_I.toUpperCase(trTR));
+
+        assertEquals(LATIN_CAPITAL_I, LATIN_SMALL_DOTLESS_I.toUpperCase(trTR));
+        assertEquals(LATIN_SMALL_DOTLESS_I, LATIN_CAPITAL_I.toLowerCase(trTR));
+    }
+
+    public void testCaseMapping_en_US() {
+        Locale enUs = new Locale("en", "US");
+        assertEquals(LATIN_CAPITAL_I, LATIN_SMALL_I.toUpperCase(enUs));
+        assertEquals(LATIN_CAPITAL_I, LATIN_CAPITAL_I.toUpperCase(enUs));
+        assertEquals(LATIN_CAPITAL_I_WITH_DOT_ABOVE, LATIN_CAPITAL_I_WITH_DOT_ABOVE.toUpperCase(enUs));
+
+        assertEquals(LATIN_SMALL_I, LATIN_SMALL_I.toLowerCase(enUs));
+        assertEquals(LATIN_SMALL_I, LATIN_CAPITAL_I.toLowerCase(enUs));
+        assertEquals(LATIN_SMALL_DOTLESS_I, LATIN_SMALL_DOTLESS_I.toLowerCase(enUs));
+
+        assertEquals(LATIN_CAPITAL_I, LATIN_SMALL_DOTLESS_I.toUpperCase(enUs));
+        // http://b/3325799: Android fails this with an extra combining "dot above".
+        assertEquals(LATIN_SMALL_I, LATIN_CAPITAL_I_WITH_DOT_ABOVE.toLowerCase(enUs));
+    }
+
+    public void testEqualsIgnoreCase_tr_TR() {
+        testEqualsIgnoreCase(new Locale("tr", "TR"));
+    }
+
+    public void testEqualsIgnoreCase_en_US() {
+        testEqualsIgnoreCase(new Locale("en", "US"));
+    }
+
+    /**
+     * String.equalsIgnoreCase should not depend on the locale.
+     */
+    private void testEqualsIgnoreCase(Locale locale) {
+        Locale defaultLocale = Locale.getDefault();
+        Locale.setDefault(locale);
+        try {
+            for (String a : LATIN_I_VARIANTS) {
+                for (String b : LATIN_I_VARIANTS) {
+                    if (!a.equalsIgnoreCase(b)) {
+                        fail("Expected " + a + " to equal " + b + " in " +  locale);
+                    }
+                }
+            }
+        } finally {
+            Locale.setDefault(defaultLocale);
+        }
+    }
+
+    public void testRegionMatches_ignoreCase_en_US() {
+        testRegionMatches_ignoreCase(new Locale("en", "US"));
+    }
+
+    public void testRegionMatches_ignoreCase_tr_TR() {
+        testRegionMatches_ignoreCase(new Locale("tr", "TR"));
+    }
+
+    private void testRegionMatches_ignoreCase(Locale locale) {
+        Locale defaultLocale = Locale.getDefault();
+        Locale.setDefault(locale);
+        try {
+            for (String a : LATIN_I_VARIANTS) {
+                for (String b : LATIN_I_VARIANTS) {
+                    if (!a.regionMatches(true, 0, b, 0, b.length())) {
+                        fail("Expected " + a + " to equal " + b + " in " +  locale);
+                    }
+                }
+            }
+        } finally {
+            Locale.setDefault(defaultLocale);
+        }
+    }
+
+    // http://code.google.com/p/android/issues/detail?id=15266
+    public void test_replaceAll() throws Exception {
+        assertEquals("project_Id", "projectId".replaceAll("(?!^)(\\p{Upper})(?!$)", "_$1"));
+    }
 }
diff --git a/luni/src/test/java/libcore/java/lang/SystemTest.java b/luni/src/test/java/libcore/java/lang/SystemTest.java
index 55f31c6..a7b6225 100644
--- a/luni/src/test/java/libcore/java/lang/SystemTest.java
+++ b/luni/src/test/java/libcore/java/lang/SystemTest.java
@@ -18,8 +18,55 @@
 
 import junit.framework.TestCase;
 
+import java.io.BufferedWriter;
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.Formatter;
+
 public class SystemTest extends TestCase {
 
+    public void testLineSeparator() throws Exception {
+        try {
+            // Before Java 7, the small number of classes that wanted the line separator would
+            // use System.getProperty. Now they should use System.lineSeparator instead, and the
+            // "line.separator" property has no effect after the VM has started.
+
+            // Test System.lineSeparator directly.
+            assertEquals("\n", System.lineSeparator());
+            System.setProperty("line.separator", "poop");
+            assertEquals("\n", System.lineSeparator());
+            assertFalse(System.lineSeparator().equals(System.getProperty("line.separator")));
+
+            // java.io.BufferedWriter --- uses System.lineSeparator on Android but not on RI.
+            StringWriter sw = new StringWriter();
+            BufferedWriter bw = new BufferedWriter(sw);
+            bw.newLine();
+            bw.flush();
+            assertEquals(System.lineSeparator(), sw.toString());
+            assertFalse(System.lineSeparator().equals(System.getProperty("line.separator")));
+
+            // java.io.PrintStream --- uses System.lineSeparator on Android but not on RI.
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            new PrintStream(baos).println();
+            assertEquals(System.lineSeparator(), new String(baos.toByteArray(), "UTF-8"));
+            assertFalse(System.lineSeparator().equals(System.getProperty("line.separator")));
+
+            // java.io.PrintWriter --- uses System.lineSeparator on Android but not on RI.
+            sw = new StringWriter();
+            new PrintWriter(sw).println();
+            assertEquals(System.lineSeparator(), sw.toString());
+            assertFalse(System.lineSeparator().equals(System.getProperty("line.separator")));
+
+            // java.util.Formatter --- uses System.lineSeparator on both.
+            assertEquals(System.lineSeparator(), new Formatter().format("%n").toString());
+            assertFalse(System.lineSeparator().equals(System.getProperty("line.separator")));
+        } finally {
+            System.setProperty("line.separator", "\n");
+        }
+    }
+
     public void testArrayCopyTargetNotArray() {
         try {
             System.arraycopy(new char[5], 0, "Hello", 0, 3);
@@ -61,44 +108,4 @@
                     e.getMessage());
         }
     }
-
-    /**
-     * http://b/issue?id=2136462
-     */
-    public void testBackFromTheDead() {
-        try {
-            new ConstructionFails();
-        } catch (AssertionError expected) {
-        }
-
-        for (int i = 0; i < 20; i++) {
-            if (ConstructionFails.INSTANCE != null) {
-                fail("finalize() called, even though constructor failed!");
-            }
-
-            induceGc(i);
-        }
-    }
-
-    private void induceGc(int rev) {
-        System.gc();
-        try {
-            byte[] b = new byte[1024 << rev];
-        } catch (OutOfMemoryError e) {
-        }
-    }
-
-    static class ConstructionFails {
-        private static ConstructionFails INSTANCE;
-
-        ConstructionFails() {
-            throw new AssertionError();
-        }
-
-        @Override protected void finalize() throws Throwable {
-            INSTANCE = this;
-            new AssertionError("finalize() called, even though constructor failed!")
-                    .printStackTrace();
-        }
-    }
 }
diff --git a/luni/src/test/java/libcore/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java b/luni/src/test/java/libcore/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java
new file mode 100644
index 0000000..7e3e982
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang.annotation;
+
+import java.io.ByteArrayOutputStream;
+import java.io.NotSerializableException;
+import java.io.ObjectOutputStream;
+import java.lang.annotation.AnnotationTypeMismatchException;
+import java.lang.reflect.Method;
+
+public class AnnotationTypeMismatchExceptionTest extends junit.framework.TestCase {
+    public void testGetters() throws Exception {
+        Method m = String.class.getMethod("length");
+        AnnotationTypeMismatchException ex = new AnnotationTypeMismatchException(m, "poop");
+        assertSame(m, ex.element());
+        assertEquals("poop", ex.foundType());
+    }
+
+    public void testSerialization() throws Exception {
+        Method m = String.class.getMethod("length");
+        AnnotationTypeMismatchException original = new AnnotationTypeMismatchException(m, "poop");
+
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        try {
+            // AnnotationTypeMismatchException is broken: it's Serializable but has a non-transient
+            // non-serializable field of type Method.
+            new ObjectOutputStream(out).writeObject(original);
+            fail();
+        } catch (NotSerializableException expected) {
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java b/luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java
new file mode 100644
index 0000000..3dda61e
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/ref/FinalizeTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2011 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang.ref;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import junit.framework.TestCase;
+
+public final class FinalizeTest extends TestCase {
+
+    public void testFinalizeIsCalled() throws Exception {
+        AtomicBoolean finalized = new AtomicBoolean();
+        createFinalizableObject(finalized);
+
+        induceFinalization();
+        if (!finalized.get()) {
+            fail();
+        }
+    }
+
+    /**
+     * Prevent live-precise bugs from interfering with analysis of what is
+     * reachable. Do not inline this method; otherwise tests may fail on VMs
+     * that are not live-precise. http://b/4191345
+     */
+    private void createFinalizableObject(final AtomicBoolean finalized) {
+        new X() {
+            @Override protected void finalize() throws Throwable {
+                super.finalize();
+                finalized.set(true);
+            }
+        };
+    }
+
+    static class X {}
+
+    /**
+     * http://b/issue?id=2136462
+     */
+    public void testBackFromTheDead() throws Exception {
+        try {
+            new ConstructionFails();
+        } catch (AssertionError expected) {
+        }
+
+        induceFinalization();
+
+        if (ConstructionFails.INSTANCE != null) {
+            fail("finalize() called, even though constructor failed!");
+        }
+    }
+
+    private void induceFinalization() throws Exception {
+        System.gc();
+        System.runFinalization();
+    }
+
+    static class ConstructionFails {
+        private static ConstructionFails INSTANCE;
+
+        ConstructionFails() {
+            throw new AssertionError();
+        }
+
+        @Override protected void finalize() throws Throwable {
+            INSTANCE = this;
+            new AssertionError("finalize() called, even though constructor failed!")
+                    .printStackTrace();
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/reflect/AnnotationsTest.java b/luni/src/test/java/libcore/java/lang/reflect/AnnotationsTest.java
new file mode 100644
index 0000000..c23775e
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/reflect/AnnotationsTest.java
@@ -0,0 +1,137 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang.reflect;
+
+import java.lang.annotation.Annotation;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+import junit.framework.TestCase;
+
+public final class AnnotationsTest extends TestCase {
+
+    public void testClassDirectAnnotations() {
+        assertAnnotatedElement(Type.class, AnnotationA.class, AnnotationB.class);
+    }
+
+    public void testClassInheritedAnnotations() {
+        assertAnnotatedElement(ExtendsType.class, AnnotationB.class);
+    }
+
+    public void testConstructorAnnotations() throws Exception {
+        Constructor<Type> constructor = Type.class.getConstructor();
+        assertAnnotatedElement(constructor, AnnotationA.class, AnnotationC.class);
+    }
+
+    public void testFieldAnnotations() throws Exception {
+        Field field = Type.class.getField("field");
+        assertAnnotatedElement(field, AnnotationA.class, AnnotationD.class);
+    }
+
+    public void testMethodAnnotations() throws Exception {
+        Method method = Type.class.getMethod("method", String.class, String.class);
+        assertAnnotatedElement(method, AnnotationB.class, AnnotationC.class);
+    }
+
+    public void testParameterAnnotations() throws Exception {
+        Method method = Type.class.getMethod("method", String.class, String.class);
+        Annotation[][] parameterAnnotations = method.getParameterAnnotations();
+        assertEquals(2, parameterAnnotations.length);
+        assertEquals(set(AnnotationB.class, AnnotationD.class),
+                annotationsToTypes(parameterAnnotations[0]));
+        assertEquals(set(AnnotationC.class, AnnotationD.class),
+                annotationsToTypes(parameterAnnotations[1]));
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface AnnotationA {}
+
+    @Inherited
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface AnnotationB {}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface AnnotationC {}
+
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface AnnotationD {}
+
+    @AnnotationA @AnnotationB
+    public static class Type {
+        @AnnotationA @AnnotationC public Type() {}
+        @AnnotationA @AnnotationD public String field;
+        @AnnotationB @AnnotationC public void method(@AnnotationB @AnnotationD String parameter1,
+                @AnnotationC @AnnotationD String parameter2) {}
+    }
+
+    public static class ExtendsType extends Type {}
+
+
+    private void assertAnnotatedElement(
+            AnnotatedElement element, Class<? extends Annotation>... expectedAnnotations) {
+        Set<Class<? extends Annotation>> actualTypes = annotationsToTypes(element.getAnnotations());
+        Set<Class<? extends Annotation>> expectedTypes = set(expectedAnnotations);
+        assertEquals(expectedTypes, actualTypes);
+
+        // getAnnotations() should be consistent with isAnnotationPresent() and getAnnotation()
+        assertPresent(expectedTypes.contains(AnnotationA.class), element, AnnotationA.class);
+        assertPresent(expectedTypes.contains(AnnotationB.class), element, AnnotationB.class);
+        assertPresent(expectedTypes.contains(AnnotationC.class), element, AnnotationC.class);
+
+        try {
+            element.isAnnotationPresent(null);
+            fail();
+        } catch (NullPointerException expected) {
+        }
+
+        try {
+            element.getAnnotation(null);
+            fail();
+        } catch (NullPointerException expected) {
+        }
+    }
+
+    private Set<Class<? extends Annotation>> annotationsToTypes(Annotation[] annotations) {
+        Set<Class<? extends Annotation>> result = new HashSet<Class<? extends Annotation>>();
+        for (Annotation annotation : annotations) {
+            result.add(annotation.annotationType());
+        }
+        return result;
+    }
+
+    private void assertPresent(boolean present, AnnotatedElement element,
+            Class<? extends Annotation> annotation) {
+        if (present) {
+            assertNotNull(element.getAnnotation(annotation));
+            assertTrue(element.isAnnotationPresent(annotation));
+        } else {
+            assertNull(element.getAnnotation(annotation));
+            assertFalse(element.isAnnotationPresent(annotation));
+        }
+    }
+
+    private <T> Set<T> set(T... instances) {
+        return new HashSet<T>(Arrays.asList(instances));
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/reflect/ModifierTest.java b/luni/src/test/java/libcore/java/lang/reflect/ModifierTest.java
new file mode 100644
index 0000000..1bde157
--- /dev/null
+++ b/luni/src/test/java/libcore/java/lang/reflect/ModifierTest.java
@@ -0,0 +1,105 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.lang.reflect;
+
+import java.lang.reflect.Modifier;
+
+public class ModifierTest extends junit.framework.TestCase {
+    public void test_classModifiers() {
+        assertEquals(0xc1f, Modifier.classModifiers());
+    }
+
+    public void test_constructorModifiers() {
+        assertEquals(0x007, Modifier.constructorModifiers());
+    }
+
+    public void test_fieldModifiers() {
+        assertEquals(0x0df, Modifier.fieldModifiers());
+    }
+
+    public void test_interfaceModifiers() {
+        assertEquals(0xc0f, Modifier.interfaceModifiers());
+    }
+
+    public void test_methodModifiers() {
+        assertEquals(0xd3f, Modifier.methodModifiers());
+    }
+
+    public void test_isAbstractI() {
+        assertTrue(Modifier.isAbstract(Modifier.ABSTRACT));
+        assertTrue(!Modifier.isAbstract(-1 & ~Modifier.ABSTRACT));
+    }
+
+    public void test_isFinalI() {
+        assertTrue(Modifier.isFinal(Modifier.FINAL));
+        assertTrue(!Modifier.isFinal(-1 & ~Modifier.FINAL));
+    }
+
+    public void test_isInterfaceI() {
+        assertTrue(Modifier.isInterface(Modifier.INTERFACE));
+        assertTrue(!Modifier.isInterface(-1 & ~Modifier.INTERFACE));
+    }
+
+    public void test_isNativeI() {
+        assertTrue(Modifier.isNative(Modifier.NATIVE));
+        assertTrue(!Modifier.isNative(-1 & ~Modifier.NATIVE));
+    }
+
+    public void test_isPrivateI() {
+        assertTrue(Modifier.isPrivate(Modifier.PRIVATE));
+        assertTrue(!Modifier.isPrivate(-1 & ~Modifier.PRIVATE));
+    }
+
+    public void test_isProtectedI() {
+        assertTrue(Modifier.isProtected(Modifier.PROTECTED));
+        assertTrue(!Modifier.isProtected(-1 & ~Modifier.PROTECTED));
+    }
+
+    public void test_isPublicI() {
+        assertTrue(Modifier.isPublic(Modifier.PUBLIC));
+        assertTrue(!Modifier.isPublic(-1 & ~Modifier.PUBLIC));
+    }
+
+    public void test_isStaticI() {
+        assertTrue(Modifier.isStatic(Modifier.STATIC));
+        assertTrue(!Modifier.isStatic(-1 & ~Modifier.STATIC));
+    }
+
+    public void test_isStrictI() {
+        assertTrue(Modifier.isStrict(Modifier.STRICT));
+        assertTrue(!Modifier.isStrict(-1 & ~Modifier.STRICT));
+    }
+
+    public void test_isSynchronizedI() {
+        assertTrue(Modifier.isSynchronized(Modifier.SYNCHRONIZED));
+        assertTrue(!Modifier.isSynchronized(-1 & ~Modifier.SYNCHRONIZED));
+    }
+
+    public void test_isTransientI() {
+        assertTrue(Modifier.isTransient(Modifier.TRANSIENT));
+        assertTrue(!Modifier.isTransient(-1 & ~Modifier.TRANSIENT));
+    }
+
+    public void test_isVolatileI() {
+        assertTrue(Modifier.isVolatile(Modifier.VOLATILE));
+        assertTrue(!Modifier.isVolatile(-1 & ~Modifier.VOLATILE));
+    }
+
+    public void test_toStringI() {
+        assertEquals("public abstract", Modifier.toString(Modifier.PUBLIC | Modifier.ABSTRACT));
+    }
+}
diff --git a/luni/src/test/java/libcore/java/lang/reflect/OldGenericReflectionCornerCases.java b/luni/src/test/java/libcore/java/lang/reflect/OldGenericReflectionCornerCases.java
index 21d9cc2..907b8eb 100644
--- a/luni/src/test/java/libcore/java/lang/reflect/OldGenericReflectionCornerCases.java
+++ b/luni/src/test/java/libcore/java/lang/reflect/OldGenericReflectionCornerCases.java
@@ -17,10 +17,6 @@
 package libcore.java.lang.reflect;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -33,7 +29,6 @@
  * type parameters, equality of type parameters, wildcard types, parameterized
  * types and multiple bounds.
  */
-@TestTargetClass(Method.class)
 public class OldGenericReflectionCornerCases extends GenericReflectionTestsBase {
 
     static class Pair<T, S> {}
@@ -41,20 +36,6 @@
     static class WildcardEquality<T> {
         void wildcardEquality(Pair<? extends T, ? extends T> param) {}
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getTypeParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getGenericParameterTypes",
-            args = {}
-        )
-    })
     @SuppressWarnings("unchecked")
     public void testWildcardEquality() throws Exception {
         Class<? extends WildcardEquality> clazz = WildcardEquality.class;
@@ -98,20 +79,6 @@
     static class WildcardUnEquality<T> {
         void wildcardUnEquality(Pair<? extends T, ? super T> param) {}
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getTypeParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getGenericParameterTypes",
-            args = {}
-        )
-    })
     @SuppressWarnings("unchecked")
     public void testWildcardUnEquality() throws Exception {
         Class<? extends WildcardUnEquality> clazz = WildcardUnEquality.class;
@@ -154,20 +121,6 @@
     static class MultipleBoundedWildcardUnEquality<T extends Object & Comparable<MultipleBoundedWildcardUnEquality<T>>> {
         void multipleBoundedWildcardUnEquality(Pair<? extends T, ? super T> param) {}
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getTypeParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getGenericParameterTypes",
-            args = {}
-        )
-    })
     @SuppressWarnings("unchecked")
     @KnownFailure("Fails in CTS but passes under run-core-tests")
     public void testMultipleBoundedWildcardUnEquality() throws Exception {
@@ -224,20 +177,6 @@
     static class MultipleBoundedWildcardEquality<T extends Object & Comparable<MultipleBoundedWildcardEquality<T>>> {
         void multipleBoundedWildcardEquality(Pair<? extends T, ? extends T> param) {}
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getTypeParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getGenericParameterTypes",
-            args = {}
-        )
-    })
     @SuppressWarnings("unchecked")
     @KnownFailure("Fails in CTS but passes under run-core-tests")
     public void testMultipleBoundedWildcard() throws Exception {
diff --git a/luni/src/test/java/libcore/java/lang/reflect/OldGenericTypesTest.java b/luni/src/test/java/libcore/java/lang/reflect/OldGenericTypesTest.java
index aad08e1..f93b683 100644
--- a/luni/src/test/java/libcore/java/lang/reflect/OldGenericTypesTest.java
+++ b/luni/src/test/java/libcore/java/lang/reflect/OldGenericTypesTest.java
@@ -17,9 +17,6 @@
 package libcore.java.lang.reflect;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
@@ -31,7 +28,6 @@
 /**
  * Tests type parameters declared on classes.
  */
-@TestTargetClass(Constructor.class)
 public class OldGenericTypesTest extends GenericReflectionTestsBase {
 
     static class GenericType<T>{
@@ -66,12 +62,6 @@
     }
 
     static interface InterfaceTest<T>{}
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Check positive functionality.",
-        method = "getGenericParameterTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void testConstructorGenericType() throws Exception {
         Class<? extends ConstructorGenericType> clazz = ConstructorGenericType.class;
@@ -83,12 +73,6 @@
 
         assertEquals(typeVariable, parameterType);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "getGenericParameterTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void testStaticMethodGenericType() throws Exception {
         Class<? extends GenericType> clazz = GenericType.class;
@@ -102,12 +86,6 @@
         assertInstanceOf(TypeVariable.class, parameterType);
         assertEquals(method, ((TypeVariable)parameterType).getGenericDeclaration());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "getGenericParameterTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void testHidingMethodGenericType() throws Exception {
         Class<? extends GenericType> clazz = GenericType.class;
@@ -127,12 +105,6 @@
         void multipleGenericTypesS(S s){}
         void multipleGenericTypesTS(T t, S s){}
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "getGenericParameterTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void testMultipleGenericTypes() throws Exception {
         //Type parameters
@@ -170,12 +142,6 @@
         assertEquals(typeVariableS, multipleGenericTypesTSTypeS);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTypeParameters",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void testMultipleBoundedGenericTypes() throws Exception {
         //Type parameters
@@ -193,12 +159,6 @@
         Type boundS = boundsS[0];
         assertEquals(typeVariableT, boundS);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "getGenericParameterTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     @KnownFailure("Fails in CTS but passes under run-core-tests")
     public void testSimpleInheritance() throws Exception {
@@ -221,12 +181,6 @@
         TypeVariable actualSuperTypeVariable = (TypeVariable) actualTypeArguments[0];
         assertEquals(subTypeVariable, actualSuperTypeVariable);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check exceptions.",
-        method = "getGenericParameterTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void testInnerClassTest() throws Exception {
         Class<? extends InnerClassTest> clazz =InnerClassTest.class;
@@ -257,12 +211,6 @@
         TypeVariable<?> methodTypeVariable = (TypeVariable<?>) methodParameterTypes[0];
         assertEquals(clazz, methodTypeVariable.getGenericDeclaration());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions are not verified.",
-        method = "getGenericExceptionTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void testException() throws Exception {
         Class<? extends ExceptionTest> clazz = ExceptionTest.class;
diff --git a/luni/src/test/java/libcore/java/lang/reflect/ReflectionTest.java b/luni/src/test/java/libcore/java/lang/reflect/ReflectionTest.java
index 42ef01d..3b092e5 100644
--- a/luni/src/test/java/libcore/java/lang/reflect/ReflectionTest.java
+++ b/luni/src/test/java/libcore/java/lang/reflect/ReflectionTest.java
@@ -19,6 +19,7 @@
 import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Field;
+import java.lang.reflect.Member;
 import java.lang.reflect.Method;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -51,15 +52,15 @@
         assertEquals(fieldOneRaw, fieldOne.toGenericString());
 
         Field fieldTwo = C.class.getDeclaredField("fieldTwo");
-        assertEquals("transient volatile java.util.Map " + classC + ".fieldTwo",
+        assertEquals("private transient volatile java.util.Map " + classC + ".fieldTwo",
                 fieldTwo.toString());
-        assertEquals("transient volatile java.util.Map<" + classA + ", java.lang.String> "
+        assertEquals("private transient volatile java.util.Map<" + classA + ", java.lang.String> "
                 + classC + ".fieldTwo", fieldTwo.toGenericString());
 
         Field fieldThree = C.class.getDeclaredField("fieldThree");
-        String fieldThreeRaw = "java.lang.Object[] " + classC + ".fieldThree";
+        String fieldThreeRaw = "protected java.lang.Object[] " + classC + ".fieldThree";
         assertEquals(fieldThreeRaw, fieldThree.toString());
-        String fieldThreeGeneric = "K[] " + classC + ".fieldThree";
+        String fieldThreeGeneric = "protected K[] " + classC + ".fieldThree";
         assertEquals(fieldThreeGeneric, fieldThree.toGenericString());
 
         Field fieldFour = C.class.getDeclaredField("fieldFour");
@@ -132,6 +133,127 @@
         assertEquals(RandomAccess.class, bounds[2]);
     }
 
+    public void testGetFieldNotFound() throws Exception {
+        try {
+            D.class.getField("noField");
+            fail();
+        } catch (NoSuchFieldException expected) {
+        }
+    }
+
+    public void testGetDeclaredFieldNotFound() throws Exception {
+        try {
+            D.class.getDeclaredField("noField");
+            fail();
+        } catch (NoSuchFieldException expected) {
+        }
+    }
+
+    public void testGetFieldNull() throws Exception {
+        try {
+            D.class.getField(null);
+            fail();
+        } catch (NullPointerException expected) {
+        }
+    }
+
+    public void testGetDeclaredFieldNull() throws Exception {
+        try {
+            D.class.getDeclaredField(null);
+            fail();
+        } catch (NullPointerException expected) {
+        }
+    }
+
+    public void testGetFieldIsRecursive() throws Exception {
+        Field field = D.class.getField("fieldOne");
+        assertEquals(C.class, field.getDeclaringClass());
+    }
+
+    public void testGetDeclaredFieldIsNotRecursive() {
+        try {
+            D.class.getDeclaredField("fieldOne");
+            fail();
+        } catch (NoSuchFieldException expected) {
+        }
+    }
+
+    public void testGetFieldIsPublicOnly() throws Exception {
+        C.class.getField("fieldOne"); // public
+        try {
+            C.class.getField("fieldTwo"); // private
+            fail();
+        } catch (NoSuchFieldException expected) {
+        }
+        try {
+            C.class.getField("fieldThree"); // protected
+            fail();
+        } catch (NoSuchFieldException expected) {
+        }
+        try {
+            C.class.getField("fieldFour"); // package-private
+            fail();
+        } catch (NoSuchFieldException expected) {
+        }
+    }
+
+    public void testGetDeclaredFieldIsAllVisibilities() throws Exception {
+        C.class.getDeclaredField("fieldOne"); // public
+        C.class.getDeclaredField("fieldTwo"); // private
+        C.class.getDeclaredField("fieldThree"); // protected
+        C.class.getDeclaredField("fieldFour"); // package-private
+    }
+
+    public void testGetFieldViaExtendsThenImplements() throws Exception {
+        Field field = ExtendsImplementsDefinesMember.class.getField("field");
+        assertEquals(DefinesMember.class, field.getDeclaringClass());
+    }
+
+    public void testGetFieldViaImplementsThenExtends() throws Exception {
+        Field field = ImplementsExtendsDefinesMember.class.getField("field");
+        assertEquals(DefinesMember.class, field.getDeclaringClass());
+    }
+
+    public void testGetFieldsViaExtendsThenImplements() throws Exception {
+        Field[] fields = ExtendsImplementsDefinesMember.class.getFields();
+        assertTrue(names(fields).contains("field"));
+    }
+
+    public void testGetFieldsViaImplementsThenExtends() throws Exception {
+        Field[] fields = ImplementsExtendsDefinesMember.class.getFields();
+        assertTrue(names(fields).contains("field"));
+    }
+
+    public void testGetMethodViaExtendsThenImplements() throws Exception {
+        Method method = ExtendsImplementsDefinesMember.class.getMethod("method");
+        assertEquals(DefinesMember.class, method.getDeclaringClass());
+    }
+
+    public void testGetMethodViaImplementsThenExtends() throws Exception {
+        Method method = ImplementsExtendsDefinesMember.class.getMethod("method");
+        assertEquals(DefinesMember.class, method.getDeclaringClass());
+    }
+
+    public void testGetMethodsViaExtendsThenImplements() throws Exception {
+        Method[] methods = ExtendsImplementsDefinesMember.class.getMethods();
+        assertTrue(names(methods).contains("method"));
+    }
+
+    public void testGetMethodsViaImplementsThenExtends() throws Exception {
+        Method[] methods = ImplementsExtendsDefinesMember.class.getMethods();
+        assertTrue(names(methods).contains("method"));
+    }
+
+    public void testGetMethodsContainsNoDuplicates() throws Exception {
+        Method[] methods = ExtendsAndImplementsDefinesMember.class.getMethods();
+        assertEquals(1, count(names(methods), "method"));
+    }
+
+    public void testGetFieldsContainsNoDuplicates() throws Exception {
+        Field[] fields = ExtendsAndImplementsDefinesMember.class.getFields();
+        assertEquals(1, count(names(fields), "field"));
+    }
+
     static class A {}
     static class AList extends ArrayList<A> {}
 
@@ -139,8 +261,8 @@
 
     public static abstract class C<K> {
         public static A fieldOne;
-        transient volatile Map<A, String> fieldTwo;
-        K[] fieldThree;
+        private transient volatile Map<A, String> fieldTwo;
+        protected K[] fieldThree;
         Map<? super Integer, Integer[]> fieldFour;
         String[][][][][] fieldFive;
 
@@ -159,4 +281,42 @@
             return null;
         }
     }
+
+    public static class D extends C<String> {
+        public D(A a) throws B {
+            super(a);
+        }
+        @Override public Map<A, String> methodTwo(List<A> onlyParameter) {
+            return null;
+        }
+    }
+
+    interface DefinesMember {
+        String field = "s";
+        void method();
+    }
+    static abstract class ImplementsDefinesMember implements DefinesMember {}
+    static abstract class ExtendsImplementsDefinesMember extends ImplementsDefinesMember {}
+    interface ExtendsDefinesMember extends DefinesMember {}
+    static abstract class ImplementsExtendsDefinesMember implements ExtendsDefinesMember {}
+    static abstract class ExtendsAndImplementsDefinesMember extends ImplementsDefinesMember
+            implements DefinesMember {}
+
+    private List<String> names(Member[] methods) {
+        List<String> result = new ArrayList<String>();
+        for (Member method : methods) {
+            result.add(method.getName());
+        }
+        return result;
+    }
+
+    private int count(List<?> list, Object element) {
+        int result = 0;
+        for (Object o : list) {
+            if (o.equals(element)) {
+                result++;
+            }
+        }
+        return result;
+    }
 }
diff --git a/luni/src/test/java/libcore/java/math/MathContextTest.java b/luni/src/test/java/libcore/java/math/MathContextTest.java
new file mode 100644
index 0000000..b021218
--- /dev/null
+++ b/luni/src/test/java/libcore/java/math/MathContextTest.java
@@ -0,0 +1,87 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.math;
+
+import java.math.MathContext;
+import java.math.RoundingMode;
+
+public class MathContextTest extends junit.framework.TestCase {
+    public void testConstructor() throws Exception {
+        // All the rounding modes.
+        for (RoundingMode rm : RoundingMode.values()) {
+            MathContext mc = new MathContext("precision=1 roundingMode=" + rm);
+            assertEquals(1, mc.getPrecision());
+            assertEquals(rm, mc.getRoundingMode());
+        }
+
+        // A few precisions.
+        for (int p = 0; p < 10; ++p) {
+            MathContext mc = new MathContext("precision=" + p + " roundingMode=" + RoundingMode.UP);
+            assertEquals(p, mc.getPrecision());
+            assertEquals(RoundingMode.UP, mc.getRoundingMode());
+        }
+
+        // Case-sensitive keywords.
+        new MathContext("precision=1 roundingMode=UP");
+        try {
+            new MathContext("Precision=1 roundingMode=UP");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+        try {
+            new MathContext("precision=1 RoundingMode=UP");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+
+        // Case-sensitive rounding modes.
+        try {
+            new MathContext("precision=1 roundingMode=up");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+
+        // Exactly one space (U+0020).
+        try {
+            new MathContext("precision=1roundingMode=UP");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+        try {
+            new MathContext("precision=1  roundingMode=UP");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+        try {
+            new MathContext("precision=1\troundingMode=UP");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+
+        // No leading or trailing space.
+        try {
+            new MathContext(" precision=1 roundingMode=UP");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+        try {
+            new MathContext("precision=1 roundingMode=UP ");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/java/math/OldBigDecimalArithmeticTest.java b/luni/src/test/java/libcore/java/math/OldBigDecimalArithmeticTest.java
index 6e22c63..623b854 100644
--- a/luni/src/test/java/libcore/java/math/OldBigDecimalArithmeticTest.java
+++ b/luni/src/test/java/libcore/java/math/OldBigDecimalArithmeticTest.java
@@ -517,7 +517,7 @@
         assertEquals("incorrect value", "1000000", bd.toString());
     }
     /**
-     * @tests java.math.BigDecimal#add(java.math.BigDecimal)
+     * java.math.BigDecimal#add(java.math.BigDecimal)
      */
     public void test_addBigDecimal() {
         BigDecimal add1 = new BigDecimal("23.456");
@@ -534,7 +534,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.MathContext) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingModeUP() {
@@ -549,7 +549,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.RoundingMode) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingModeDOWN() {
@@ -564,7 +564,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.RoundingMode) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingModeCEILING() {
@@ -579,7 +579,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.RoundingMode) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingModeFLOOR() {
@@ -594,7 +594,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.RoundingMode) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingModeHALF_UP() {
@@ -609,7 +609,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.RoundingMode) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingModeHALF_DOWN() {
@@ -628,7 +628,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.RoundingMode) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingModeHALF_EVEN() {
@@ -643,7 +643,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#divide(java.math.BigDecimal,
+     * java.math.BigDecimal#divide(java.math.BigDecimal,
      *        java.math.RoundingMode) divide(BigDecimal, RoundingMode)
      */
     public void test_DivideBigDecimalRoundingExc() {
diff --git a/luni/src/test/java/libcore/java/math/OldBigDecimalConstructorsTest.java b/luni/src/test/java/libcore/java/math/OldBigDecimalConstructorsTest.java
index dffa392..e0ca50d 100644
--- a/luni/src/test/java/libcore/java/math/OldBigDecimalConstructorsTest.java
+++ b/luni/src/test/java/libcore/java/math/OldBigDecimalConstructorsTest.java
@@ -713,7 +713,7 @@
 // ANDROID ADDED
 
     /**
-     * @tests java.math.BigDecimal#BigDecimal(java.math.BigInteger, int)
+     * java.math.BigDecimal#BigDecimal(java.math.BigInteger, int)
      */
     public void test_Constructor_java_math_BigInteger_int() {
         BigInteger value = new BigInteger("12345908");
@@ -732,7 +732,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#BigDecimal(double)
+     * java.math.BigDecimal#BigDecimal(double)
      */
     public void test_Constructor_Double() {
         BigDecimal big = new BigDecimal(123E04);
@@ -760,7 +760,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#BigDecimal(java.lang.String)
+     * java.math.BigDecimal#BigDecimal(java.lang.String)
      */
     public void test_Constructor_java_lang_String() throws NumberFormatException {
         BigDecimal big = new BigDecimal("345.23499600293850");
diff --git a/luni/src/test/java/libcore/java/math/OldBigDecimalConvertTest.java b/luni/src/test/java/libcore/java/math/OldBigDecimalConvertTest.java
index 3ce40a6..8f01a17 100644
--- a/luni/src/test/java/libcore/java/math/OldBigDecimalConvertTest.java
+++ b/luni/src/test/java/libcore/java/math/OldBigDecimalConvertTest.java
@@ -118,7 +118,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#longValueExact() Long value of a positive
+     * java.math.BigDecimal#longValueExact() Long value of a positive
      *        BigDecimal
      */
     public void test_LongValueExactFloatPos() {
diff --git a/luni/src/test/java/libcore/java/math/OldBigDecimalTest.java b/luni/src/test/java/libcore/java/math/OldBigDecimalTest.java
index cedb3e6..08724c5 100644
--- a/luni/src/test/java/libcore/java/math/OldBigDecimalTest.java
+++ b/luni/src/test/java/libcore/java/math/OldBigDecimalTest.java
@@ -25,7 +25,7 @@
     BigInteger value = new BigInteger("12345908");
 
     /**
-     * @tests java.math.BigDecimal#BigDecimal(double)
+     * java.math.BigDecimal#BigDecimal(double)
      */
     public void test_ConstructorD() {
         //
@@ -50,7 +50,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#BigDecimal(java.lang.String)
+     * java.math.BigDecimal#BigDecimal(java.lang.String)
      */
     public void test_constructor_String_plus_exp() {
         /*
@@ -67,7 +67,7 @@
     }
 
     /**
-     * @tests java.math.BigDecimal#setScale(int, java.math.RoundingMode)
+     * java.math.BigDecimal#setScale(int, java.math.RoundingMode)
      */
     public void test_setScaleILjava_math_RoundingMode() {
         BigDecimal setScale1 = new BigDecimal(2.323E102);
diff --git a/luni/src/test/java/libcore/java/math/OldBigIntegerConstructorsTest.java b/luni/src/test/java/libcore/java/math/OldBigIntegerConstructorsTest.java
index 954d360..44caec2 100644
--- a/luni/src/test/java/libcore/java/math/OldBigIntegerConstructorsTest.java
+++ b/luni/src/test/java/libcore/java/math/OldBigIntegerConstructorsTest.java
@@ -27,7 +27,7 @@
 public class OldBigIntegerConstructorsTest extends TestCase {
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstrString1() {
         String s = "0";
@@ -37,7 +37,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstrString2() {
         String s = "-2147483648";
@@ -48,7 +48,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstrString3() {
         String s = "2147483647";
@@ -59,7 +59,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstrStringExc1() {
         try {
@@ -70,7 +70,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstrStringExc2() {
         try {
@@ -81,7 +81,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstrStringExc3() {
         try {
@@ -92,7 +92,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstrStringExc4() {
         try {
diff --git a/luni/src/test/java/libcore/java/math/OldBigIntegerOperateBitsTest.java b/luni/src/test/java/libcore/java/math/OldBigIntegerOperateBitsTest.java
index dfbb66c..f215c11 100644
--- a/luni/src/test/java/libcore/java/math/OldBigIntegerOperateBitsTest.java
+++ b/luni/src/test/java/libcore/java/math/OldBigIntegerOperateBitsTest.java
@@ -28,7 +28,7 @@
 
 
     /**
-     * @tests java.math.BigInteger#getLowestSetBit() getLowestSetBit for
+     * java.math.BigInteger#getLowestSetBit() getLowestSetBit for
      *        negative BigInteger
      */
     public void test_getLowestSetBitNeg() {
@@ -43,7 +43,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#getLowestSetBit() getLowestSetBit for
+     * java.math.BigInteger#getLowestSetBit() getLowestSetBit for
      *        positive BigInteger
      */
     public void test_getLowestSetBitPos() {
@@ -74,7 +74,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#getLowestSetBit() getLowestSetBit for zero
+     * java.math.BigInteger#getLowestSetBit() getLowestSetBit for zero
      *        BigInteger
      */
     public void test_getLowestSetBitZero() {
diff --git a/luni/src/test/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpHeadersTest.java b/luni/src/test/java/libcore/java/net/HttpHeadersTest.java
similarity index 96%
rename from luni/src/test/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpHeadersTest.java
rename to luni/src/test/java/libcore/java/net/HttpHeadersTest.java
index ff9aa58..4650184 100644
--- a/luni/src/test/java/org/apache/harmony/luni/internal/net/www/protocol/http/HttpHeadersTest.java
+++ b/luni/src/test/java/libcore/java/net/HttpHeadersTest.java
@@ -14,10 +14,11 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.luni.internal.net.www.protocol.http;
+package libcore.java.net;
 
 import java.util.Arrays;
 import junit.framework.TestCase;
+import libcore.net.http.HttpHeaders;
 
 public class HttpHeadersTest extends TestCase {
     // http://code.google.com/p/android/issues/detail?id=6684
diff --git a/luni/src/test/java/libcore/java/net/InetAddressTest.java b/luni/src/test/java/libcore/java/net/InetAddressTest.java
index 07eb5d7..b23dbf8 100644
--- a/luni/src/test/java/libcore/java/net/InetAddressTest.java
+++ b/luni/src/test/java/libcore/java/net/InetAddressTest.java
@@ -44,4 +44,8 @@
         assertTrue(InetAddress.parseNumericAddress(null).isLoopbackAddress());
         assertTrue(InetAddress.parseNumericAddress("").isLoopbackAddress());
     }
+
+    public void test_getLoopbackAddress() throws Exception {
+        assertTrue(InetAddress.getLoopbackAddress().isLoopbackAddress());
+    }
 }
diff --git a/luni/src/test/java/libcore/java/net/OldFileNameMapTest.java b/luni/src/test/java/libcore/java/net/OldFileNameMapTest.java
index 02d7c8e..de9caa9 100644
--- a/luni/src/test/java/libcore/java/net/OldFileNameMapTest.java
+++ b/luni/src/test/java/libcore/java/net/OldFileNameMapTest.java
@@ -16,11 +16,6 @@
 
 package libcore.java.net;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.net.FileNameMap;
@@ -43,4 +38,3 @@
         }
     }
 }
-
diff --git a/luni/src/test/java/libcore/java/net/OldResponseCacheTest.java b/luni/src/test/java/libcore/java/net/OldResponseCacheTest.java
index 71e2176..d292414 100644
--- a/luni/src/test/java/libcore/java/net/OldResponseCacheTest.java
+++ b/luni/src/test/java/libcore/java/net/OldResponseCacheTest.java
@@ -16,10 +16,6 @@
 
 package libcore.java.net;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -43,43 +39,15 @@
 import tests.support.Support_TestWebData;
 import tests.support.Support_TestWebServer;
 
-@TestTargetClass(value = ResponseCache.class)
 public class OldResponseCacheTest extends TestCase {
 
 
 
-    /**
-     * @tests java.net.ResponseCache#getDefault()
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getDefault method.",
-        method = "getDefault",
-        args = {}
-    )
     public void test_GetDefault() throws Exception {
         assertNull(ResponseCache.getDefault());
     }
 
-    /**
-     * @tests java.net.ResponseCache#setDefault(ResponseCache)
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "This is a complete subset of tests for setDefault method.",
-            method = "setDefault",
-            args = {java.net.ResponseCache.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "This is a complete subset of tests for setDefault method.",
-            method = "ResponseCache",
-            args = {}
-        )
-    })
-    public void test_SetDefaultLjava_net_ResponseCache_Normal()
-            throws Exception {
+    public void test_SetDefaultLjava_net_ResponseCache_Normal() throws Exception {
         ResponseCache rc1 = new MockResponseCache();
         ResponseCache rc2 = new MockResponseCache();
         ResponseCache.setDefault(rc1);
@@ -90,12 +58,6 @@
         assertNull(ResponseCache.getDefault());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {URI.class, String.class, Map.class}
-    )
     public void test_get() throws Exception {
         String uri = "http://localhost/";
         URL url  = new URL(uri);
@@ -118,12 +80,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "put",
-        args = {URI.class, URLConnection.class}
-    )
     public void test_put() throws Exception {
         // Create test ResponseCache
         TestResponseCache cache = new TestResponseCache(
diff --git a/luni/src/test/java/libcore/java/net/OldSocketTest.java b/luni/src/test/java/libcore/java/net/OldSocketTest.java
index 68105ce..6247719 100644
--- a/luni/src/test/java/libcore/java/net/OldSocketTest.java
+++ b/luni/src/test/java/libcore/java/net/OldSocketTest.java
@@ -747,12 +747,8 @@
         int portNumber = Support_PortManager.getNextPort();
         s = new Socket(InetAddress.getLocalHost().getHostName(), sport,
                 InetAddress.getLocalHost(), portNumber);
-        assertTrue("Returned incorrect string: " + s.toString()
-                + " localHost: " + InetAddress.getLocalHost(), s.toString()
-                .equals(
-                        "Socket[addr=" + InetAddress.getLocalHost() + ",port="
-                                + s.getPort() + ",localport="
-                                + s.getLocalPort() + "]"));
+        assertEquals("Socket[address=" + InetAddress.getLocalHost() + ",port=" + s.getPort()
+                + ",localPort=" + s.getLocalPort() + "]", s.toString());
     }
 
     // AndroidOnly: RI returns wrong value for EOF
diff --git a/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java b/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
index 71fb962..aa36378 100644
--- a/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
+++ b/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
@@ -18,9 +18,6 @@
 package libcore.java.net;
 
 import dalvik.annotation.SideEffect;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
@@ -43,17 +40,6 @@
 import tests.support.Support_TestWebServer;
 import tests.support.resource.Support_Resources;
 
-@TestTargetClass(
-    value = URLClassLoader.class,
-    untestedMethods = {
-        @TestTargetNew(
-            level = TestLevel.NOT_NECESSARY,
-            notes = "findClass uses defineClass which is not implemented",
-            method = "findClass",
-            args = {java.lang.String.class}
-        )
-    }
-)
 public class OldURLClassLoaderTest extends junit.framework.TestCase {
 
     URLClassLoader ucl;
@@ -68,7 +54,7 @@
     };
 
     /**
-     * @tests java.net.URLClassLoader#URLClassLoader(java.net.URL[])
+     * java.net.URLClassLoader#URLClassLoader(java.net.URL[])
      */
     public void test_Constructor$Ljava_net_URL() throws MalformedURLException {
         URL[] u = new URL[0];
@@ -99,7 +85,7 @@
     }
 
     /**
-     * @tests java.net.URLClassLoader#findResources(java.lang.String)
+     * java.net.URLClassLoader#findResources(java.lang.String)
      */
     public void test_findResourcesLjava_lang_String() throws Exception {
         Enumeration<URL> res = null;
@@ -142,12 +128,6 @@
         assertEquals("Incorrect number of resources returned", 2, i);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addURL",
-        args = { URL.class }
-    )
     public void test_addURLLjava_net_URL() throws MalformedURLException {
         URL[] u = new URL[0];
 
@@ -243,15 +223,6 @@
         }
     }
 
-    /**
-     * @tests java.net.URLClassLoader#findResource(java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "findResource",
-        args = {java.lang.String.class}
-    )
     @SideEffect("Support_TestWebServer requires isolation.")
     public void test_findResourceLjava_lang_String() throws Exception {
         int port = Support_PortManager.getNextPort();
@@ -278,12 +249,6 @@
     /**
      * Regression for Harmony-2237
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test",
-        method = "findResource",
-        args = {java.lang.String.class}
-    )
     @SideEffect("Support_TestWebServer requires isolation.")
     public void test_findResource_String() throws Exception {
         File tempFile1 = File.createTempFile("textFile", ".txt");
diff --git a/luni/src/test/java/libcore/java/net/OldURLDecoderTest.java b/luni/src/test/java/libcore/java/net/OldURLDecoderTest.java
deleted file mode 100644
index 86a2961..0000000
--- a/luni/src/test/java/libcore/java/net/OldURLDecoderTest.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package libcore.java.net;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import junit.framework.TestCase;
-import tests.support.Support_Configuration;
-
-public class OldURLDecoderTest extends TestCase {
-
-    public void test_decodeLjava_lang_String_Ljava_lang_String() {
-        String enc = "UTF-8";
-
-        String [] urls = { "http://" + Support_Configuration.HomeAddress +
-                           "/test?hl=en&q=te+st",
-                           "file://a+b/c/d.e-f*g_+l",
-                           "jar:file://a.jar+!/b.c/",
-                           "ftp://test:pwd@localhost:2121/%D0%9C",
-                           "%D0%A2%D0%B5%D1%81%D1%82+URL+for+test"};
-
-        String [] expected = {"http://" + Support_Configuration.HomeAddress +
-                              "/test?hl=en&q=te st",
-                              "file://a b/c/d.e-f*g_ l",
-                              "jar:file://a.jar !/b.c/"};
-
-        for(int i = 0; i < urls.length - 2; i++) {
-            try {
-                assertEquals(expected[i], URLDecoder.decode(urls[i], enc));
-            } catch (UnsupportedEncodingException e) {
-                fail("UnsupportedEncodingException: " + e.getMessage());
-            }
-        }
-
-        try {
-            URLDecoder.decode(urls[urls.length - 2], enc);
-            URLDecoder.decode(urls[urls.length - 1], enc);
-        } catch (UnsupportedEncodingException e) {
-            fail("UnsupportedEncodingException: " + e.getMessage());
-        }
-    }
-}
diff --git a/luni/src/test/java/libcore/java/net/OldURLEncoderTest.java b/luni/src/test/java/libcore/java/net/OldURLEncoderTest.java
deleted file mode 100644
index 8616e2c..0000000
--- a/luni/src/test/java/libcore/java/net/OldURLEncoderTest.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package libcore.java.net;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import junit.framework.TestCase;
-import tests.support.Support_Configuration;
-
-public class OldURLEncoderTest extends TestCase {
-
-    public void test_encodeLjava_lang_StringLjava_lang_String() {
-
-        String enc = "UTF-8";
-
-        String [] urls = {"http://" + Support_Configuration.HomeAddress +
-                              "/test?hl=en&q=te st",
-                              "file://a b/c/d.e-f*g_ l",
-                              "jar:file://a.jar !/b.c/\u1052",
-                              "ftp://test:pwd@localhost:2121/%D0%9C"};
-
-        String [] expected = { "http%3A%2F%2Fjcltest.apache.org%2Ftest%3Fhl%" +
-                "3Den%26q%3Dte+st",
-                "file%3A%2F%2Fa+b%2Fc%2Fd.e-f*g_+l",
-                "jar%3Afile%3A%2F%2Fa.jar+%21%2Fb.c%2F%E1%81%92"};
-
-        for(int i = 0; i < urls.length-1; i++) {
-            try {
-                String encodedString = URLEncoder.encode(urls[i], enc);
-                assertEquals(expected[i], encodedString);
-                assertEquals(urls[i], URLDecoder.decode(encodedString, enc));
-            } catch (UnsupportedEncodingException e) {
-                fail("UnsupportedEncodingException: " + e.getMessage());
-            }
-        }
-
-        try {
-            String encodedString = URLEncoder.encode(urls[urls.length - 1], enc);
-            assertEquals(urls[urls.length - 1], URLDecoder.decode(encodedString, enc));
-        } catch (UnsupportedEncodingException e) {
-            fail("UnsupportedEncodingException: " + e.getMessage());
-        }
-
-        try {
-            URLDecoder.decode("", "");
-            fail("UnsupportedEncodingException expected");
-        } catch (UnsupportedEncodingException e) {
-            //expected
-        }
-    }
-}
diff --git a/luni/src/test/java/libcore/java/net/OldURLStreamHandlerFactoryTest.java b/luni/src/test/java/libcore/java/net/OldURLStreamHandlerFactoryTest.java
deleted file mode 100644
index 5434992..0000000
--- a/luni/src/test/java/libcore/java/net/OldURLStreamHandlerFactoryTest.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package libcore.java.net;
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandler;
-import java.net.URLStreamHandlerFactory;
-import junit.framework.TestCase;
-import tests.support.Support_Configuration;
-
-public final class OldURLStreamHandlerFactoryTest extends TestCase {
-
-    URLStreamHandlerFactory oldFactory = null;
-    Field factoryField = null;
-
-    boolean isTestable = false;
-
-    boolean isOpenConnectionCalled = false;
-    boolean isCreateURLStreamHandlerCalled = false;
-
-    public void test_createURLStreamHandler() throws MalformedURLException {
-
-        if(isTestable) {
-
-            TestURLStreamHandlerFactory shf = new TestURLStreamHandlerFactory();
-            assertFalse(isCreateURLStreamHandlerCalled);
-            URL.setURLStreamHandlerFactory(shf);
-            URL url = new URL("http://" +
-                    Support_Configuration.SpecialInetTestAddress);
-
-            try {
-                url.openConnection();
-                assertTrue(isCreateURLStreamHandlerCalled);
-                assertTrue(isOpenConnectionCalled);
-            } catch (Exception e) {
-                fail("Exception during test : " + e.getMessage());
-
-            }
-
-            try {
-                URL.setURLStreamHandlerFactory(shf);
-                fail("java.lang.Error was not thrown.");
-            } catch(java.lang.Error e) {
-                //expected
-            }
-
-            try {
-                URL.setURLStreamHandlerFactory(null);
-                fail("java.lang.Error was not thrown.");
-            } catch(java.lang.Error e) {
-                //expected
-            }
-
-        } else {
-            TestURLStreamHandlerFactory shf = new TestURLStreamHandlerFactory();
-            URLStreamHandler sh = shf.createURLStreamHandler("");
-            assertNotNull(sh.toString());
-        }
-    }
-
-    public void setUp() {
-        Field [] fields = URL.class.getDeclaredFields();
-        int counter = 0;
-        for (Field field : fields) {
-            if (URLStreamHandlerFactory.class.equals(field.getType())) {
-                counter++;
-                factoryField = field;
-            }
-        }
-
-        if(counter == 1) {
-
-            isTestable = true;
-
-            factoryField.setAccessible(true);
-            try {
-                oldFactory = (URLStreamHandlerFactory) factoryField.get(null);
-            } catch (IllegalArgumentException e) {
-                fail("IllegalArgumentException was thrown during setUp: "
-                        + e.getMessage());
-            } catch (IllegalAccessException e) {
-                fail("IllegalAccessException was thrown during setUp: "
-                        + e.getMessage());
-            }
-        }
-    }
-
-    public void tearDown() throws IllegalAccessException {
-        if(isTestable) {
-            factoryField.set(null, null);
-            URL.setURLStreamHandlerFactory(oldFactory);
-        }
-    }
-
-    class TestURLStreamHandlerFactory implements URLStreamHandlerFactory {
-
-        public URLStreamHandler createURLStreamHandler(String protocol) {
-            isCreateURLStreamHandlerCalled = true;
-            return new TestURLStreamHandler();
-        }
-    }
-
-    class TestURLStreamHandler extends URLStreamHandler {
-        @Override
-        protected URLConnection openConnection(URL u) throws IOException {
-            isOpenConnectionCalled = true;
-            return null;
-        }
-    }
-}
diff --git a/luni/src/test/java/libcore/java/net/OldURLStreamHandlerTest.java b/luni/src/test/java/libcore/java/net/OldURLStreamHandlerTest.java
index 51d6001..a47d833 100644
--- a/luni/src/test/java/libcore/java/net/OldURLStreamHandlerTest.java
+++ b/luni/src/test/java/libcore/java/net/OldURLStreamHandlerTest.java
@@ -78,10 +78,8 @@
     }
 
     public void test_hostsEqualLjava_net_URLLjava_net_URL() throws Exception {
-        String loopback = getLoopbackAddressAsHost();
-
         URL url1 = new URL("ftp://localhost:21/*test");
-        URL url2 = new URL("http://" + loopback + "/_test");
+        URL url2 = new URL("http://localhost/_test");
         assertTrue(handler.hostsEqual(url1, url2));
 
         URL url3 = new URL("http://foo/_test_goo");
@@ -118,13 +116,11 @@
     }
 
     public void test_sameFile() throws Exception {
-        String loopback = getLoopbackAddressAsHost();
-
         URL url1  = new URL("http://test:pwd@localhost:80/foo/foo1.c");
-        URL url2  = new URL("http://test:pwd@" + loopback + ":80/foo/foo1.c");
-        URL url3  = new URL("http://test:pwd@" + loopback + ":80/foo/foo2.c");
-        URL url4  = new URL("ftp://test:pwd@" + loopback + ":21/foo/foo2.c");
-        URL url5  = new URL("ftp://test:pwd@" + loopback + ":21/foo/foo1/foo2.c");
+        URL url2  = new URL("http://test:pwd@localhost:80/foo/foo1.c");
+        URL url3  = new URL("http://test:pwd@localhost:80/foo/foo2.c");
+        URL url4  = new URL("ftp://test:pwd@localhost:21/foo/foo2.c");
+        URL url5  = new URL("ftp://test:pwd@localhost:21/foo/foo1/foo2.c");
         URL url6  = new URL("http://test/foo/foo1.c");
 
         assertTrue("Test case 1", handler.sameFile(url1, url2));
@@ -175,53 +171,45 @@
         handler = new MockURLStreamHandler();
     }
 
-    private String getLoopbackAddressAsHost() throws UnknownHostException {
-        InetAddress localhost = InetAddress.getByName("localhost");
-        return localhost instanceof Inet6Address
-                ? "[" + localhost.getHostAddress() + "]"
-                : localhost.getHostAddress();
-    }
-
     class MockURLStreamHandler extends URLStreamHandler {
 
-        @Override
-        protected URLConnection openConnection(URL arg0) throws IOException {
+        @Override protected URLConnection openConnection(URL arg0) throws IOException {
             return null;
         }
 
-        public boolean equals(URL u1, URL u2) {
-            return super.equals(u1, u2);
+        @Override public boolean equals(URL a, URL b) {
+            return super.equals(a, b);
         }
 
-        public int getDefaultPort() {
+        @Override public int getDefaultPort() {
             return super.getDefaultPort();
         }
 
-        public InetAddress getHostAddress(URL u) {
+        @Override public InetAddress getHostAddress(URL u) {
             return super.getHostAddress(u);
         }
 
-        public int hashCode(URL u) {
+        @Override public int hashCode(URL u) {
             return super.hashCode(u);
         }
 
-        public boolean hostsEqual(URL u1, URL u2) {
-            return super.hostsEqual(u1, u2);
+        @Override public boolean hostsEqual(URL a, URL b) {
+            return super.hostsEqual(a, b);
         }
 
-        public URLConnection openConnection(URL u, Proxy p) throws IOException {
+        @Override public URLConnection openConnection(URL u, Proxy p) throws IOException {
             return super.openConnection(u, p);
         }
 
-        public void parseURL(URL u, String spec, int start, int limit) {
+        @Override public void parseURL(URL u, String spec, int start, int limit) {
             super.parseURL(u, spec, start, limit);
         }
 
-        public boolean sameFile(URL u1, URL u2) {
-            return super.sameFile(u1, u2);
+        @Override public boolean sameFile(URL a, URL b) {
+            return super.sameFile(a, b);
         }
 
-        public void setURL(URL u,
+        @Override public void setURL(URL u,
                 String protocol,
                 String host,
                 int port,
@@ -230,7 +218,7 @@
             super.setURL(u, protocol, host, port, file, ref);
         }
 
-        public void setURL(URL u,
+        @Override public void setURL(URL u,
                 String protocol,
                 String host,
                 int port,
@@ -243,7 +231,7 @@
                     userInfo, path, query, ref);
         }
 
-        public String toExternalForm(URL u) {
+        @Override public String toExternalForm(URL u) {
             return super.toExternalForm(u);
         }
     }
diff --git a/luni/src/test/java/libcore/java/net/OldURLTest.java b/luni/src/test/java/libcore/java/net/OldURLTest.java
index 07a03af..58caf2e 100644
--- a/luni/src/test/java/libcore/java/net/OldURLTest.java
+++ b/luni/src/test/java/libcore/java/net/OldURLTest.java
@@ -16,9 +16,6 @@
 
 package libcore.java.net;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.File;
@@ -43,7 +40,6 @@
 import java.util.List;
 import junit.framework.TestCase;
 
-@TestTargetClass(URL.class)
 public class OldURLTest extends TestCase {
 
     private static final String helloWorldString = "Hello World";
@@ -56,15 +52,6 @@
         super.tearDown();
     }
 
-    /**
-     * @tests java.net.URL#URL(java.lang.String, java.lang.String, int, java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Regression test.",
-        method = "URL",
-        args = {java.lang.String.class, java.lang.String.class, int.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_StringILjava_lang_String()
             throws MalformedURLException {
         // Regression for HARMONY-83
@@ -77,16 +64,6 @@
         }
     }
 
-    /**
-     * @tests java.net.URL#URL(java.lang.String, java.lang.String,
-     *        java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "URL",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_String() throws MalformedURLException {
         // Strange behavior in reference, the hostname contains a ':' so it gets wrapped in '[', ']'
         URL testURL = new URL("http", "www.apache.org:8082", "test.html#anch");
@@ -104,16 +81,6 @@
         }
     }
 
-    /**
-     * @tests java.net.URL#URL(String, String, String)
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test.",
-        method = "URL",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_java_protocol_handler_pkgs_prop() throws MalformedURLException {
         // Regression test for Harmony-3094
         final String HANDLER_PKGS = "java.protocol.handler.pkgs";
@@ -126,15 +93,6 @@
         }
     }
 
-    /**
-     * Test method for {@link java.net.URL#hashCode()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() throws MalformedURLException {
         URL testURL1 = new URL("http", "www.apache.org:8080", "test.html#anch");
         URL testURL2 = new URL("http", "www.apache.org:8080", "test.html#anch");
@@ -146,15 +104,6 @@
                 .hashCode() == changedURL.hashCode());
     }
 
-    /**
-     * Test method for {@link java.net.URL#setURLStreamHandlerFactory(java.net.URLStreamHandlerFactory)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "cannot test since no sophisticated StreamHandlerFactory available.",
-        method = "setURLStreamHandlerFactory",
-        args = {java.net.URLStreamHandlerFactory.class}
-    )
     public void testSetURLStreamHandlerFactory() throws MalformedURLException, IOException, IllegalArgumentException, IllegalAccessException {
         URLStreamHandlerFactory factory = new MyURLStreamHandlerFactory();
         Field streamHandlerFactoryField = null;
@@ -199,15 +148,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#URL(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "URL",
-        args = {java.lang.String.class}
-    )
     public void testURLString() throws MalformedURLException {
         URL testURL = new URL("ftp://myname@host.dom/etc/motd");
 
@@ -227,15 +167,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#URL(java.net.URL, java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "URL",
-        args = {java.net.URL.class, java.lang.String.class}
-    )
     public void testURLURLString() throws MalformedURLException {
 
         URL gamelan = new URL("http://www.gamelan.com/pages/");
@@ -282,15 +213,6 @@
         }
     }
 
-    /**
-     * Test method for {@link java.net.URL#equals(java.lang.Object)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEqualsObject() throws MalformedURLException {
         URL testURL1 = new URL("http", "www.apache.org", 8080, "test.html");
         URL wrongProto = new URL("ftp", "www.apache.org", 8080, "test.html");
@@ -310,15 +232,6 @@
         assertTrue("Assert 4: error in equals: same", testURL3.equals(testURL4));
     }
 
-    /**
-     * Test method for {@link java.net.URL#sameFile(java.net.URL)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "non trivial reference test fails",
-        method = "sameFile",
-        args = {java.net.URL.class}
-    )
     public void testSameFile() throws MalformedURLException {
         URL gamelan = new URL("file:///pages/index.html");
         URL gamelanFalse = new URL("file:///pages/out/index.html");
@@ -335,15 +248,6 @@
         assertFalse(url.sameFile(url1));
     }
 
-    /**
-     * Test method for {@link java.net.URL#getContent()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "image and sound content not testable: mime types",
-        method = "getContent",
-        args = {}
-    )
     public void testGetContent() throws MalformedURLException {
 
         File sampleFile = createTempHelloWorldFile();
@@ -371,15 +275,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#openStream()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "openStream",
-        args = {}
-    )
     public void testOpenStream() throws MalformedURLException, IOException {
 
         File sampleFile = createTempHelloWorldFile();
@@ -422,15 +317,6 @@
         }
     }
 
-    /**
-     * Test method for {@link java.net.URL#openConnection()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "openConnection",
-        args = {}
-    )
     public void testOpenConnection() throws MalformedURLException, IOException {
 
         File sampleFile = createTempHelloWorldFile();
@@ -458,15 +344,6 @@
         }
     }
 
-    /**
-     * Test method for {@link java.net.URL#toURI()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toURI",
-        args = {}
-    )
     public void testToURI() throws MalformedURLException, URISyntaxException {
         String testHTTPURLString = "http://www.gamelan.com/pages/";
         String testFTPURLString = "ftp://myname@host.dom/etc/motd";
@@ -517,15 +394,6 @@
         }
     }
 
-    /**
-     * Test method for {@link java.net.URL#toString()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() throws MalformedURLException {
         URL testHTTPURL = new URL("http://www.gamelan.com/pages/");
         URL testFTPURL = new URL("ftp://myname@host.dom/etc/motd");
@@ -536,15 +404,6 @@
         assertEquals("http://www.gamelan.com/pages/", testHTTPURL.toString());
     }
 
-    /**
-     * Test method for {@link java.net.URL#toExternalForm()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "simple tests",
-        method = "toExternalForm",
-        args = {}
-    )
     public void testToExternalForm() throws MalformedURLException {
         URL testHTTPURL = new URL("http://www.gamelan.com/pages/");
         URL testFTPURL = new URL("ftp://myname@host.dom/etc/motd");
@@ -555,15 +414,6 @@
         assertEquals("http://www.gamelan.com/pages/", testHTTPURL.toExternalForm());
     }
 
-    /**
-     * Test method for {@link java.net.URL#getFile()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFile",
-        args = {}
-    )
     public void testGetFile() throws MalformedURLException {
 
         File sampleFile = createTempHelloWorldFile();
@@ -574,15 +424,6 @@
         assertEquals(sampleFile.getPath(),fileURL.getFile());
     }
 
-    /**
-     * Test method for {@link java.net.URL#getPort()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPort",
-        args = {}
-    )
     public void testGetPort() throws MalformedURLException {
         URL testHTTPURL = new URL("http://www.gamelan.com/pages/");
         URL testFTPURL = new URL("ftp://myname@host.dom/etc/motd");
@@ -595,15 +436,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#getProtocol()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.COMPLETE,
-      notes = "",
-      method = "getProtocol",
-      args = {}
-    )
     public void testGetProtocol() throws MalformedURLException {
         URL testHTTPURL = new URL("http://www.gamelan.com/pages/");
         URL testHTTPSURL = new URL("https://www.gamelan.com/pages/");
@@ -619,15 +451,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#getRef()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getRef",
-        args = {}
-    )
     public void testGetRef() throws MalformedURLException {
         URL gamelan = new URL("http://www.gamelan.com/pages/");
 
@@ -644,15 +467,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#getQuery()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getQuery",
-        args = {}
-    )
     public void testGetQuery() throws MalformedURLException {
         URL urlQuery = new URL(
                 "http://www.example.com/index.html?attrib1=value1&attrib2=value&attrib3#anchor");
@@ -665,15 +479,6 @@
         assertTrue(output == null || "".equals(output));
     }
 
-    /**
-     * Test method for {@link java.net.URL#getPath()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPath",
-        args = {}
-    )
     public void testGetPath() throws MalformedURLException {
         URL url = new URL("http://www.example.com");
         String output = url.getPath();
@@ -684,15 +489,6 @@
         assertEquals("/foo/index.html",url2.getPath());
     }
 
-    /**
-     * Test method for {@link java.net.URL#getUserInfo()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getUserInfo",
-        args = {}
-    )
     public void testGetUserInfo() throws MalformedURLException {
         URL urlNoUserInfo = new URL("http://www.java2s.com:8080");
         URL url = new URL("ftp://myUser:password@host.dom/etc/motd");
@@ -702,15 +498,6 @@
         assertTrue("".equals(userInfo) || null == userInfo);
     }
 
-    /**
-     * Test method for {@link java.net.URL#getAuthority()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAuthority",
-        args = {}
-    )
     public void testGetAuthority() throws MalformedURLException, URISyntaxException {
         // legal authority information userInfo (user,password),domain,port
 
@@ -727,15 +514,6 @@
         assertTrue("".equals(output) || null == output);
     }
 
-    /**
-     * Test method for {@link java.net.URL#getDefaultPort()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultPort",
-        args = {}
-    )
     public void testGetDefaultPort() throws MalformedURLException {
         URL testHTTPURL = new URL("http://www.gamelan.com/pages/");
         URL testFTPURL = new URL("ftp://myname@host.dom/etc/motd");
@@ -873,15 +651,6 @@
         }
     }
 
-    /**
-     * Test method for {@link java.net.URL#URL(java.lang.String, java.lang.String, int, java.lang.String, java.net.URLStreamHandler)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch. No meaningful MalformedURLException foundwhich doesn't end as a NullPointerException.",
-        method = "URL",
-        args = {java.lang.String.class, java.lang.String.class, int.class, java.lang.String.class, java.net.URLStreamHandler.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_StringILjava_lang_StringLjava_net_URLStreamHandler()
             throws Exception {
         u = new URL("http", "www.yahoo.com", 8080, "test.html#foo", null);
@@ -918,15 +687,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#getContent(java.lang.Class[])}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "throws unexpected exception: NullPointerException in first execution",
-        method = "getContent",
-        args = {java.lang.Class[].class}
-    )
     public void test_getContent_LJavaLangClass() throws Exception {
 
         File sampleFile = createTempHelloWorldFile();
@@ -965,15 +725,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#URL(java.net.URL, java.lang.String, java.net.URLStreamHandler)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch",
-        method = "URL",
-        args = {java.net.URL.class, java.lang.String.class, java.net.URLStreamHandler.class}
-    )
     public void testURLURLStringURLStreamHandler() throws MalformedURLException {
         u = new URL("http://www.yahoo.com");
         // basic ones
@@ -1030,15 +781,6 @@
 
     }
 
-    /**
-     * Test method for {@link java.net.URL#toExternalForm()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "From harmony branch",
-        method = "toExternalForm",
-        args = {}
-    )
     public void test_toExternalForm_Relative() throws MalformedURLException {
         String strURL = "http://a/b/c/d;p?q";
         String ref = "?y";
@@ -1046,12 +788,6 @@
         assertEquals("http://a/b/c/?y", url.toExternalForm());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "From harmony branch",
-        method = "toExternalForm",
-        args = {}
-    )
     public void test_toExternalForm_Absolute() throws MalformedURLException {
         String strURL = "http://localhost?name=value";
         URL url = new URL(strURL);
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index f2d2413..5a67d8d 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -28,7 +28,6 @@
 import java.net.ConnectException;
 import java.net.HttpRetryException;
 import java.net.HttpURLConnection;
-import java.net.InetAddress;
 import java.net.PasswordAuthentication;
 import java.net.ProtocolException;
 import java.net.Proxy;
@@ -87,11 +86,11 @@
     };
 
     private MockWebServer server = new MockWebServer();
-    private String hostname;
+    private String hostName;
 
     @Override protected void setUp() throws Exception {
         super.setUp();
-        hostname = InetAddress.getLocalHost().getHostName();
+        hostName = server.getHostName();
     }
 
     @Override protected void tearDown() throws Exception {
@@ -417,7 +416,7 @@
             if (responseCode != 401) {
                 readAscii(conn.getInputStream(), Integer.MAX_VALUE);
             }
-        } catch (IOException ignored) {
+        } catch (IOException expected) {
         }
 
         Set<URI> expectedCachedUris = shouldPut
@@ -1068,7 +1067,7 @@
         testMarkAndReset(TransferKind.END_OF_STREAM);
     }
 
-    public void testMarkAndReset(TransferKind transferKind) throws IOException {
+    private void testMarkAndReset(TransferKind transferKind) throws IOException {
         MockResponse response = new MockResponse();
         transferKind.setBody(response, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", 1024);
         server.enqueue(response);
@@ -1510,9 +1509,9 @@
                 readAscii(server.getUrl("/").openStream(), Integer.MAX_VALUE));
 
         RecordedRequest first = server.takeRequest();
-        assertContains(first.getHeaders(), "Host: " + hostname + ":" + server.getPort());
+        assertContains(first.getHeaders(), "Host: " + hostName + ":" + server.getPort());
         RecordedRequest second = server2.takeRequest();
-        assertContains(second.getHeaders(), "Host: " + hostname + ":" + server2.getPort());
+        assertContains(second.getHeaders(), "Host: " + hostName + ":" + server2.getPort());
         RecordedRequest third = server.takeRequest();
         assertEquals("Expected connection reuse", 1, third.getSequenceNumber());
 
@@ -1542,9 +1541,9 @@
             assertEquals("DEF", readAscii(url.openStream(), Integer.MAX_VALUE));
             assertEquals("GHI", readAscii(url.openStream(), Integer.MAX_VALUE));
 
-            assertEquals(Arrays.asList("verify " + hostname), hostnameVerifier.calls);
+            assertEquals(Arrays.asList("verify " + hostName), hostnameVerifier.calls);
             assertEquals(Arrays.asList("checkServerTrusted ["
-                    + "CN=" + hostname + " 1, "
+                    + "CN=" + hostName + " 1, "
                     + "CN=Test Intermediate Certificate Authority 1, "
                     + "CN=Test Root Certificate Authority 1"
                     + "] RSA"),
@@ -1819,6 +1818,8 @@
         // beyond ascii
         testUrlToUriMapping("\u0080", "%C2%80", "%C2%80", "%C2%80", "%C2%80");
         testUrlToUriMapping("\u20ac", "\u20ac", "\u20ac", "\u20ac", "\u20ac");
+        testUrlToUriMapping("\ud842\udf9f",
+                "\ud842\udf9f", "\ud842\udf9f", "\ud842\udf9f", "\ud842\udf9f");
     }
 
     public void testLenientUrlToUriNul() throws Exception {
diff --git a/luni/src/test/java/libcore/java/net/URLStreamHandlerFactoryTest.java b/luni/src/test/java/libcore/java/net/URLStreamHandlerFactoryTest.java
new file mode 100644
index 0000000..de50e16
--- /dev/null
+++ b/luni/src/test/java/libcore/java/net/URLStreamHandlerFactoryTest.java
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.net;
+
+import java.lang.reflect.Field;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+import java.net.URLStreamHandlerFactory;
+import junit.framework.TestCase;
+import libcore.java.net.customstreamhandler.http.Handler;
+
+public final class URLStreamHandlerFactoryTest extends TestCase {
+    private URLStreamHandlerFactory oldFactory;
+    private Field factoryField;
+    private boolean isCreateURLStreamHandlerCalled;
+
+    public void setUp() throws IllegalAccessException {
+        for (Field field : URL.class.getDeclaredFields()) {
+            if (URLStreamHandlerFactory.class.equals(field.getType())) {
+                assertNull("URL declares multiple URLStreamHandlerFactory fields", factoryField);
+                factoryField = field;
+                factoryField.setAccessible(true);
+                oldFactory = (URLStreamHandlerFactory) factoryField.get(null);
+                return;
+            }
+        }
+
+        fail("URL does not declare a URLStreamHandlerFactory field");
+    }
+
+    public void tearDown() throws IllegalAccessException {
+        factoryField.set(null, null);
+        URL.setURLStreamHandlerFactory(oldFactory);
+    }
+
+    public void testCreateURLStreamHandler() throws Exception {
+        TestURLStreamHandlerFactory shf = new TestURLStreamHandlerFactory();
+        assertFalse(isCreateURLStreamHandlerCalled);
+
+        URL.setURLStreamHandlerFactory(shf);
+        URL url = new URL("http://android.com/");
+
+        URLConnection connection = url.openConnection();
+        assertTrue(connection instanceof Handler.HandlerURLConnection);
+
+        try {
+            URL.setURLStreamHandlerFactory(shf);
+            fail();
+        } catch (Error expected) {
+        }
+
+        try {
+            URL.setURLStreamHandlerFactory(null);
+            fail();
+        } catch (Error expected) {
+        }
+    }
+
+    public void testInstallCustomProtocolHandler() throws Exception {
+        // clear cached protocol handlers if they exist
+        factoryField.set(null, null);
+        URL.setURLStreamHandlerFactory(oldFactory);
+
+        try {
+            System.setProperty("java.protocol.handler.pkgs", getHandlerPackageName());
+            URLConnection connection = new URL("http://android.com/").openConnection();
+            assertTrue(connection instanceof Handler.HandlerURLConnection);
+        } finally {
+            System.clearProperty("java.protocol.handler.pkgs");
+        }
+    }
+
+    public void testFirstUseIsCached() throws Exception {
+        // clear cached protocol handlers if they exist
+        factoryField.set(null, null);
+        URL.setURLStreamHandlerFactory(oldFactory);
+
+        // creating a connection should use the platform's default stream handler
+        URLConnection connection1 = new URL("http://android.com/").openConnection();
+        assertFalse(connection1 instanceof Handler.HandlerURLConnection);
+
+        try {
+            // set the property and get another connection. The property should not be honored
+            System.setProperty("java.protocol.handler.pkgs", getHandlerPackageName());
+            URLConnection connection2 = new URL("http://android.com/").openConnection();
+            assertFalse(connection2 instanceof Handler.HandlerURLConnection);
+        } finally {
+            System.clearProperty("java.protocol.handler.pkgs");
+        }
+    }
+
+    private String getHandlerPackageName() {
+        String className = Handler.class.getName();
+        return className.substring(0, className.indexOf(".http.Handler"));
+    }
+
+    class TestURLStreamHandlerFactory implements URLStreamHandlerFactory {
+        @Override public URLStreamHandler createURLStreamHandler(String protocol) {
+            isCreateURLStreamHandlerCalled = true;
+            return new Handler();
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/java/net/URLTest.java b/luni/src/test/java/libcore/java/net/URLTest.java
index 633a33c..1765630 100644
--- a/luni/src/test/java/libcore/java/net/URLTest.java
+++ b/luni/src/test/java/libcore/java/net/URLTest.java
@@ -16,6 +16,8 @@
 
 package libcore.java.net;
 
+import java.net.Inet6Address;
+import java.net.InetAddress;
 import java.net.URL;
 import junit.framework.TestCase;
 
@@ -41,6 +43,37 @@
         assertEquals(-1, url.getPort());
     }
 
+    /**
+     * Android's URL.equals() works as if the network is down. This is different
+     * from the RI, which does potentially slow and inconsistent DNS lookups in
+     * URL.equals.
+     */
+    public void testEqualsDoesNotDoHostnameResolution() throws Exception {
+        for (InetAddress inetAddress : InetAddress.getAllByName("localhost")) {
+            String address = inetAddress.getHostAddress();
+            if (inetAddress instanceof Inet6Address) {
+                address = "[" + address + "]";
+            }
+            URL urlByHostName = new URL("http://localhost/foo?bar=baz#quux");
+            URL urlByAddress = new URL("http://" + address + "/foo?bar=baz#quux");
+            assertFalse("Expected " + urlByHostName + " to not equal " + urlByAddress,
+                    urlByHostName.equals(urlByAddress));
+        }
+    }
+
+    public void testEqualsCaseMapping() throws Exception {
+        assertEquals(new URL("HTTP://localhost/foo?bar=baz#quux"),
+                new URL("HTTP://localhost/foo?bar=baz#quux"));
+        assertTrue(new URL("http://localhost/foo?bar=baz#quux").equals(
+                new URL("http://LOCALHOST/foo?bar=baz#quux")));
+        assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
+                new URL("http://localhost/FOO?bar=baz#quux")));
+        assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
+                new URL("http://localhost/foo?BAR=BAZ#quux")));
+        assertFalse(new URL("http://localhost/foo?bar=baz#quux").equals(
+                new URL("http://localhost/foo?bar=baz#QUUX")));
+    }
+
     public void testEqualsWithNullHost() throws Exception {
         assertFalse(new URL("file", null, -1, "/a/").equals(new URL("file:/a/")));
         assertFalse(new URL("http", null, 80, "/a/").equals(new URL("http:/a/")));
diff --git a/luni/src/test/java/libcore/java/net/UrlEncodingTest.java b/luni/src/test/java/libcore/java/net/UrlEncodingTest.java
new file mode 100644
index 0000000..6318836
--- /dev/null
+++ b/luni/src/test/java/libcore/java/net/UrlEncodingTest.java
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.net;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.nio.charset.IllegalCharsetNameException;
+import java.nio.charset.UnsupportedCharsetException;
+import junit.framework.TestCase;
+
+public final class UrlEncodingTest extends TestCase {
+
+    public void testUriRetainsOriginalEncoding() throws Exception {
+        assertEquals("%61", new URI("http://foo#%61").getRawFragment());
+    }
+
+    /**
+     * URLDecoder and URI disagree on what '+' should decode to.
+     */
+    public void testDecodingPlus() throws Exception {
+        assertEquals("a b", URLDecoder.decode("a+b"));
+        assertEquals("a b", URLDecoder.decode("a+b", "UTF-8"));
+        assertEquals("a+b", new URI("http://foo#a+b").getFragment());
+    }
+
+    public void testEncodingPlus() throws Exception {
+        assertEquals("a%2Bb", URLEncoder.encode("a+b"));
+        assertEquals("a%2Bb", URLEncoder.encode("a+b", "UTF-8"));
+        assertEquals("a+b", new URI("http", "foo", "/", "a+b").getRawFragment());
+    }
+
+    public void testDecodingSpace() throws Exception {
+        assertEquals("a b", URLDecoder.decode("a b"));
+        assertEquals("a b", URLDecoder.decode("a b", "UTF-8"));
+        try {
+            new URI("http://foo#a b");
+            fail();
+        } catch (URISyntaxException expected) {
+        }
+    }
+
+    public void testEncodingSpace() throws Exception {
+        assertEquals("a+b", URLEncoder.encode("a b"));
+        assertEquals("a+b", URLEncoder.encode("a b", "UTF-8"));
+        assertEquals("a%20b", new URI("http", "foo", "/", "a b").getRawFragment());
+    }
+
+    public void testUriDecodingPartial() throws Exception {
+        try {
+            new URI("http://foo#%");
+            fail();
+        } catch (URISyntaxException expected) {
+        }
+        try {
+            new URI("http://foo#%0");
+            fail();
+        } catch (URISyntaxException expected) {
+        }
+    }
+
+    public void testUrlDecoderDecodingPartial() throws Exception {
+        try {
+            URLDecoder.decode("%");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+        try {
+            URLDecoder.decode("%0");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+    }
+
+    public void testUriDecodingInvalid() {
+        try {
+            new URI("http://foo#%0g");
+            fail();
+        } catch (URISyntaxException expected) {
+        }
+    }
+
+    public void testUrlDecoderDecodingInvalid() {
+        try {
+            URLDecoder.decode("%0g");
+            fail();
+        } catch (IllegalArgumentException expected) {
+        }
+    }
+
+    public void testUrlDecoderFailsOnNullCharset() throws Exception {
+        try {
+            URLDecoder.decode("ab", null);
+            fail();
+        } catch (IllegalCharsetNameException expected) {
+        } catch (NullPointerException expected) {
+        }
+    }
+
+    public void testUrlDecoderFailsOnEmptyCharset() {
+        try {
+            URLDecoder.decode("ab", "");
+            fail();
+        } catch (IllegalCharsetNameException expected) {
+        } catch (UnsupportedEncodingException expected) {
+        }
+    }
+
+    public void testUrlEncoderFailsOnNullCharset() throws Exception {
+        try {
+            URLEncoder.encode("ab", null);
+            fail();
+        } catch (IllegalCharsetNameException expected) {
+        } catch (NullPointerException expected) {
+        }
+    }
+
+    public void testUrlEncoderFailsOnEmptyCharset() {
+        try {
+            URLEncoder.encode("ab", "");
+            fail();
+        } catch (IllegalCharsetNameException expected) {
+        } catch (UnsupportedEncodingException expected) {
+        }
+    }
+
+    /**
+     * The RI looks up the charset lazily; Android looks it up eagerly. Either
+     * behavior is acceptable.
+     */
+    public void testUrlDecoderIgnoresUnnecessaryCharset() throws Exception {
+        try {
+            assertEquals("ab", URLDecoder.decode("ab", "no-such-charset"));
+            // no fail()
+        } catch (UnsupportedCharsetException expected) {
+        }
+    }
+
+    public void testUrlEncoderFailsOnInvalidCharset() throws Exception {
+        try {
+            URLEncoder.encode("ab", "no-such-charset");
+            fail();
+        } catch (UnsupportedCharsetException expected) {
+        } catch (UnsupportedEncodingException expected) {
+        }
+    }
+
+    public void testDecoding() throws Exception {
+        assertDecoded("a\u0000b", "a%00b");
+        assertDecoded("a b", "a%20b");
+        assertDecoded("a+b", "a%2bb");
+        assertDecoded("a%b", "a%25b");
+        assertDecoded("a\u007fb", "a%7fb");
+    }
+
+    public void testEncoding() throws Exception {
+        assertEncoded("a%25b", "a%b");
+        assertEncoded("a%7Fb", "a\u007fb");
+    }
+
+    public void testDecodingLiterals() throws Exception {
+        assertDecoded("\ud842\udf9f", "\ud842\udf9f");
+    }
+
+    public void testDecodingBrokenUtf8SequenceYieldsReplacementCharacter() throws Exception {
+        assertDecoded("a\ufffdb", "a%ffb");
+    }
+
+    public void testDecodingUtf8Octets() throws Exception {
+        assertDecoded("\u20AC", "%e2%82%ac");
+        assertDecoded("\ud842\udf9f", "%f0%a0%ae%9f");
+    }
+
+    public void testDecodingNonUsDigits() throws Exception {
+        try {
+            new URI("http://foo#" + "%\u0664\u0661");
+            fail();
+        } catch (URISyntaxException expected) {
+        }
+        try {
+            URLDecoder.decode("%\u0664\u0661");
+            fail(); // RI fails this test returning "A"
+        } catch (IllegalArgumentException expected) {
+        }
+    }
+
+    /**
+     * Android's URLEncoder.encode() failed for surrogate pairs, encoding them
+     * as two replacement characters ("??"). http://b/3436051
+     */
+    public void testUrlEncoderEncodesNonPrintableNonAsciiCharacters() throws Exception {
+        assertEquals("%00", URLEncoder.encode("\u0000", "UTF-8"));
+        assertEquals("%00", URLEncoder.encode("\u0000"));
+        assertEquals("%E2%82%AC", URLEncoder.encode("\u20AC", "UTF-8"));
+        assertEquals("%E2%82%AC", URLEncoder.encode("\u20AC"));
+        assertEquals("%F0%A0%AE%9F", URLEncoder.encode("\ud842\udf9f", "UTF-8"));
+        assertEquals("%F0%A0%AE%9F", URLEncoder.encode("\ud842\udf9f"));
+    }
+
+    public void testUriDoesNotEncodeNonPrintableNonAsciiCharacters() throws Exception {
+        assertEquals("\u20AC", new URI("http", "foo", "/", "\u20AC").getRawFragment());
+        assertEquals("\ud842\udf9f", new URI("http", "foo", "/", "\ud842\udf9f").getRawFragment());
+    }
+
+    public void testUriEncodesControlCharacters() throws Exception {
+        assertEquals("%01", new URI("http", "foo", "/", "\u0001").getRawFragment());
+
+        // The RI fails this, encoding \u0001 but not \u0000
+        assertEquals("%00", new URI("http", "foo", "/", "\u0000").getRawFragment());
+    }
+
+    public void testEncodeAndDecode() throws Exception {
+        assertRoundTrip("http://jcltest.apache.org/test?hl=en&q=te st",
+                "http%3A%2F%2Fjcltest.apache.org%2Ftest%3Fhl%3Den%26q%3Dte+st");
+        assertRoundTrip ("file://a b/c/d.e-f*g_ l",
+                "file%3A%2F%2Fa+b%2Fc%2Fd.e-f*g_+l");
+        assertRoundTrip("jar:file://a.jar !/b.c/\u1052",
+                "jar%3Afile%3A%2F%2Fa.jar+%21%2Fb.c%2F%E1%81%92");
+        assertRoundTrip("ftp://test:pwd@localhost:2121/%D0%9C",
+                "ftp%3A%2F%2Ftest%3Apwd%40localhost%3A2121%2F%25D0%259C");
+    }
+
+    /**
+     * Asserts that {@code original} decodes to {@code decoded} using both URI
+     * and UrlDecoder.
+     */
+    private void assertDecoded(String decoded, String original) throws Exception {
+        assertEquals(decoded, new URI("http://foo#" + original).getFragment());
+        assertEquals(decoded, URLDecoder.decode(original));
+        assertEquals(decoded, URLDecoder.decode(original, "UTF-8"));
+    }
+
+    /**
+     * Asserts that {@code original} encodes to {@code encoded} using both URI
+     * and URLEncoder.
+     */
+    private void assertEncoded(String encoded, String original) throws Exception {
+        assertEquals(encoded, URLEncoder.encode(original, "UTF-8"));
+        assertEquals(encoded, URLEncoder.encode(original));
+        assertEquals(encoded, new URI("http", "foo", "/", original).getRawFragment());
+    }
+
+    private void assertRoundTrip(String original, String encoded) throws Exception {
+        assertEquals(encoded, URLEncoder.encode(original, "UTF-8"));
+        assertEquals(original, URLDecoder.decode(encoded, "UTF-8"));
+    }
+}
diff --git a/luni/src/test/java/libcore/java/net/customstreamhandler/http/Handler.java b/luni/src/test/java/libcore/java/net/customstreamhandler/http/Handler.java
new file mode 100644
index 0000000..40c1b09
--- /dev/null
+++ b/luni/src/test/java/libcore/java/net/customstreamhandler/http/Handler.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.net.customstreamhandler.http;
+
+import java.io.IOException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.net.URLStreamHandler;
+
+/**
+ * This specially-named class is created reflectively by {@link URL}. For the
+ * test to be effective, its name must be "Handler" and parent package name must
+ * be "http".
+ */
+public final class Handler extends URLStreamHandler {
+    @Override protected URLConnection openConnection(URL url) throws IOException {
+        return new HandlerURLConnection(url);
+    }
+
+    public static class HandlerURLConnection extends URLConnection {
+        protected HandlerURLConnection(URL url) {
+            super(url);
+        }
+
+        @Override public void connect() throws IOException {
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/java/nio/BufferTest.java b/luni/src/test/java/libcore/java/nio/BufferTest.java
index ec85235..fd9c0ed 100644
--- a/luni/src/test/java/libcore/java/nio/BufferTest.java
+++ b/luni/src/test/java/libcore/java/nio/BufferTest.java
@@ -416,4 +416,39 @@
         b.putShort((short) 0);
         assertEquals(2, b.position());
     }
+
+    // This test will fail on the RI. Our direct buffers are cooler than theirs.
+    // http://b/3384431
+    public void testDirectByteBufferHasArray() throws Exception {
+        ByteBuffer b = ByteBuffer.allocateDirect(10);
+        assertTrue(b.isDirect());
+        // Check the buffer has an array of the right size.
+        assertTrue(b.hasArray());
+        assertEquals(0, b.arrayOffset());
+        byte[] array = b.array();
+        assertEquals(10, array.length);
+        // Check that writes to the array show up in the buffer.
+        assertEquals(0, b.get(0));
+        array[0] = 1;
+        assertEquals(1, b.get(0));
+        // Check that writes to the buffer show up in the array.
+        assertEquals(1, array[0]);
+        b.put(0, (byte) 0);
+        assertEquals(0, array[0]);
+    }
+
+    public void testSliceOffset() throws Exception {
+        // Slicing changes the array offset.
+        ByteBuffer buffer = ByteBuffer.allocate(10);
+        buffer.get();
+        ByteBuffer slice = buffer.slice();
+        assertEquals(0, buffer.arrayOffset());
+        assertEquals(1, slice.arrayOffset());
+
+        ByteBuffer directBuffer = ByteBuffer.allocateDirect(10);
+        directBuffer.get();
+        ByteBuffer directSlice = directBuffer.slice();
+        assertEquals(0, directBuffer.arrayOffset());
+        assertEquals(1, directSlice.arrayOffset());
+    }
 }
diff --git a/luni/src/test/java/libcore/java/nio/NoArrayTest.java b/luni/src/test/java/libcore/java/nio/NoArrayTest.java
index 04d9af1..7654604 100644
--- a/luni/src/test/java/libcore/java/nio/NoArrayTest.java
+++ b/luni/src/test/java/libcore/java/nio/NoArrayTest.java
@@ -21,22 +21,17 @@
 import junit.framework.TestCase;
 
 public final class NoArrayTest extends TestCase {
-
-    public void testWrappedReadOnly() {
+    public void testReadOnly() {
+        // A read-only buffer must not expose its array.
         assertNoArray(ByteBuffer.wrap(new byte[32]).asReadOnlyBuffer());
-    }
-
-    public void testAllocatedReadOnly() {
         assertNoArray(ByteBuffer.allocate(32).asReadOnlyBuffer());
-    }
-
-    public void testAllocatedDirect() {
-        assertNoArray(ByteBuffer.allocateDirect(32));
+        assertNoArray(ByteBuffer.allocateDirect(32).asReadOnlyBuffer());
     }
 
     private void assertNoArray(ByteBuffer buf) {
+        assertFalse(buf.hasArray());
         try {
-            buf.asReadOnlyBuffer().array();
+            buf.array();
             fail();
         } catch (ReadOnlyBufferException expected) {
         } catch (UnsupportedOperationException expected) {
diff --git a/luni/src/test/java/libcore/java/nio/SelectorTest.java b/luni/src/test/java/libcore/java/nio/SelectorTest.java
index 8c75566..9bc1b04 100644
--- a/luni/src/test/java/libcore/java/nio/SelectorTest.java
+++ b/luni/src/test/java/libcore/java/nio/SelectorTest.java
@@ -16,6 +16,7 @@
 
 package libcore.java.nio;
 
+import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 import java.nio.channels.NoConnectionPendingException;
@@ -23,6 +24,8 @@
 import java.nio.channels.Selector;
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
 import junit.framework.TestCase;
 import tests.support.Support_PortManager;
 
@@ -60,9 +63,7 @@
     }
 
     // http://code.google.com/p/android/issues/detail?id=4237
-    public void test_connectFinish_fails()
-            throws Exception {
-
+    public void test_connectFinish_fails() throws Exception {
         final SocketChannel channel = SocketChannel.open();
         channel.configureBlocking(false);
         channel.register(selector, SelectionKey.OP_CONNECT);
@@ -108,5 +109,35 @@
             fail();
         }
     }
+
+    // http://code.google.com/p/android/issues/detail?id=15388
+    public void testInterrupted() throws IOException {
+        Thread.currentThread().interrupt();
+        int count = selector.select();
+        assertEquals(0, count);
+    }
+
+    public void testManyWakeupCallsTriggerOnlyOneWakeup() throws Exception {
+        selector.wakeup();
+        selector.wakeup();
+        selector.wakeup();
+        selector.select();
+
+        // create a latch that will reach 0 when select returns
+        final CountDownLatch selectReturned = new CountDownLatch(1);
+        Thread thread = new Thread(new Runnable() {
+            @Override public void run() {
+                try {
+                    selector.select();
+                    selectReturned.countDown();
+                } catch (IOException ignored) {
+                }
+            }
+        });
+        thread.start();
+
+        // select doesn't ever return, so await() times out and returns false
+        assertFalse(selectReturned.await(500, TimeUnit.MILLISECONDS));
+    }
 }
 
diff --git a/luni/src/test/java/libcore/java/nio/channels/FileChannelTest.java b/luni/src/test/java/libcore/java/nio/channels/FileChannelTest.java
index 3b3a82c2..e221675 100644
--- a/luni/src/test/java/libcore/java/nio/channels/FileChannelTest.java
+++ b/luni/src/test/java/libcore/java/nio/channels/FileChannelTest.java
@@ -18,14 +18,17 @@
 
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.FileOutputStream;
 import java.nio.ByteBuffer;
 import java.nio.channels.FileChannel;
+import libcore.io.IoUtils;
 
 public class FileChannelTest extends junit.framework.TestCase {
-    public void test_read_intoReadOnlyByteArrays() throws Exception {
+    public void testReadOnlyByteArrays() throws Exception {
         ByteBuffer readOnly = ByteBuffer.allocate(1).asReadOnlyBuffer();
-        File tmp = File.createTempFile("empty", "tmp");
-        tmp.deleteOnExit();
+        File tmp = File.createTempFile("FileChannelTest", "tmp");
+
+        // You can't read into a read-only buffer...
         FileChannel fc = new FileInputStream(tmp).getChannel();
         try {
             fc.read(readOnly);
@@ -47,5 +50,48 @@
             fail();
         } catch (IllegalArgumentException expected) {
         }
+        fc.close();
+
+
+        // But you can write from a read-only buffer...
+        fc = new FileOutputStream(tmp).getChannel();
+        fc.write(readOnly);
+        fc.write(new ByteBuffer[] { readOnly });
+        fc.write(new ByteBuffer[] { readOnly }, 0, 1);
+        fc.write(readOnly, 0L);
+        fc.close();
+    }
+
+    public void test_readv() throws Exception {
+        File tmp = File.createTempFile("FileChannelTest", "tmp");
+        FileChannel fc = new FileOutputStream(tmp).getChannel();
+        fc.write(ByteBuffer.wrap("abcdABCD".getBytes("US-ASCII")));
+        fc.close();
+        // Check that both direct and non-direct buffers work.
+        fc = new FileInputStream(tmp).getChannel();
+        ByteBuffer[] buffers = new ByteBuffer[] { ByteBuffer.allocateDirect(4), ByteBuffer.allocate(4) };
+        assertEquals(8, fc.read(buffers));
+        fc.close();
+        assertEquals(8, buffers[0].limit() + buffers[1].limit());
+        byte[] bytes = new byte[4];
+        buffers[0].flip();
+        buffers[0].get(bytes);
+        assertEquals("abcd", new String(bytes, "US-ASCII"));
+        buffers[1].flip();
+        buffers[1].get(bytes);
+        assertEquals("ABCD", new String(bytes, "US-ASCII"));
+    }
+
+    public void test_writev() throws Exception {
+        File tmp = File.createTempFile("FileChannelTest", "tmp");
+        FileChannel fc = new FileOutputStream(tmp).getChannel();
+        // Check that both direct and non-direct buffers work.
+        ByteBuffer[] buffers = new ByteBuffer[] { ByteBuffer.allocateDirect(4), ByteBuffer.allocate(4) };
+        buffers[0].put("abcd".getBytes("US-ASCII")).flip();
+        buffers[1].put("ABCD".getBytes("US-ASCII")).flip();
+        assertEquals(8, fc.write(buffers));
+        fc.close();
+        assertEquals(8, tmp.length());
+        assertEquals("abcdABCD", new String(IoUtils.readFileAsByteArray(tmp.getPath()), "US-ASCII"));
     }
 }
diff --git a/luni/src/test/java/libcore/java/nio/channels/OldFileChannelTest.java b/luni/src/test/java/libcore/java/nio/channels/OldFileChannelTest.java
index 363dbd6..9388888 100644
--- a/luni/src/test/java/libcore/java/nio/channels/OldFileChannelTest.java
+++ b/luni/src/test/java/libcore/java/nio/channels/OldFileChannelTest.java
@@ -16,10 +16,6 @@
 
 package libcore.java.nio.channels;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -40,17 +36,6 @@
 import java.util.Arrays;
 import junit.framework.TestCase;
 
-@TestTargetClass(
-    value = FileChannel.class,
-    untestedMethods = {
-        @TestTargetNew(
-            level = TestLevel.NOT_NECESSARY,
-            notes = "empty protected constructor",
-            method = "FileChannel",
-            args = {}
-        )
-    }
-)
 public final class OldFileChannelTest extends TestCase {
 
     private static final int CAPACITY = 100;
@@ -159,15 +144,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#force(boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "force",
-        args = {boolean.class}
-    )
     public void test_forceZ() throws Exception {
         ByteBuffer writeBuffer = ByteBuffer.wrap(CONTENT_AS_BYTES);
         writeOnlyFileChannel.write(writeBuffer);
@@ -226,15 +202,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#tryLock(long, long, boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "tryLock",
-        args = {long.class, long.class, boolean.class}
-    )
     public void test_tryLockJJZ_IllegalArgument() throws Exception {
         try {
             writeOnlyFileChannel.tryLock(0, -1, false);
@@ -287,15 +254,6 @@
         lockOne.release();
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer, long)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "read",
-        args = {java.nio.ByteBuffer.class, long.class}
-    )
     public void test_readLByteBufferJ_Null() throws Exception {
         ByteBuffer readBuffer = null;
 
@@ -391,15 +349,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer, long)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "read",
-        args = {java.nio.ByteBuffer.class, long.class}
-    )
     public void test_readLByteBufferJ_IllegalArgument() throws Exception {
         ByteBuffer readBuffer = ByteBuffer.allocate(CAPACITY);
 
@@ -451,15 +400,6 @@
     }
 
 
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer[])
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {java.nio.ByteBuffer[].class}
-    )
     public void test_read$LByteBuffer() throws Exception {
         FileChannel mockChannel = new MockFileChannel();
         ByteBuffer[] buffers = new ByteBuffer[2];
@@ -469,15 +409,6 @@
         assertTrue(((MockFileChannel)mockChannel).isReadCalled);
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer[], int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {java.nio.ByteBuffer[].class, int.class, int.class}
-    )
     public void test_read$LByteBufferII_Null() throws Exception {
 
         try {
@@ -711,15 +642,7 @@
             // expected
         }
     }
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer[], int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException.",
-        method = "read",
-        args = {java.nio.ByteBuffer[].class, int.class, int.class}
-    )
+
     public void test_read$LByteBufferII_IndexOutOfBound() throws Exception {
         ByteBuffer[] readBuffers = new ByteBuffer[2];
         readBuffers[0] = ByteBuffer.allocate(CAPACITY);
@@ -785,15 +708,6 @@
         doTestForIOOBException(writeOnlyFileChannel, readBuffersNull);
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer[], int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {java.nio.ByteBuffer[].class, int.class, int.class}
-    )
     public void test_read$LByteBufferII_EmptyFile() throws Exception {
         ByteBuffer[] readBuffers = new ByteBuffer[2];
         readBuffers[0] = ByteBuffer.allocate(CAPACITY);
@@ -804,15 +718,6 @@
         assertEquals(0, readBuffers[1].position());
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer[], int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "read",
-        args = {java.nio.ByteBuffer[].class, int.class, int.class}
-    )
     public void test_read$LByteBufferII_EmptyBuffers() throws Exception {
         ByteBuffer[] readBuffers = new ByteBuffer[2];
         readBuffers[0] = ByteBuffer.allocate(CAPACITY);
@@ -835,24 +740,6 @@
         assertEquals(CONTENT_AS_BYTES_LENGTH, result);
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#isOpen()
-     * @tests java.nio.channels.FileChannel#close()
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "isOpen",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "close",
-            args = {}
-        )
-    })
     public void test_isOpen() throws Exception {
         // Regression for HARMONY-40
         File logFile = File.createTempFile("out", "tmp");
@@ -865,15 +752,6 @@
         assertFalse("Assert 0: Channel is still open", channel.isOpen());
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies ClosedChannelException.",
-        method = "write",
-        args = {java.nio.ByteBuffer.class}
-    )
     public void test_writeLByteBuffer_Closed() throws Exception {
         ByteBuffer writeBuffer = ByteBuffer.allocate(CAPACITY);
 
@@ -925,15 +803,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer, long)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "write",
-        args = {java.nio.ByteBuffer.class, long.class}
-    )
     public void test_writeLByteBufferJ_Null() throws Exception {
         ByteBuffer writeBuffer = null;
 
@@ -1029,15 +898,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#read(ByteBuffer,long)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IOException.",
-        method = "read",
-        args = {java.nio.ByteBuffer.class, long.class}
-    )
     public void test_writeLByteBufferJ_Postion_As_Long() throws Exception {
         ByteBuffer writeBuffer = ByteBuffer.wrap(TEST_BYTES);
         try {
@@ -1047,15 +907,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer, long)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "write",
-        args = {java.nio.ByteBuffer.class, long.class}
-    )
     public void test_writeLByteBufferJ_IllegalArgument() throws Exception {
         ByteBuffer writeBuffer = ByteBuffer.allocate(CAPACITY);
 
@@ -1106,15 +957,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "write",
-        args = {java.nio.ByteBuffer.class, long.class}
-    )
     public void test_writeLByteBufferJ_NonZeroPosition() throws Exception {
         final int pos = 5;
         ByteBuffer writeBuffer = ByteBuffer.wrap(CONTENT_AS_BYTES);
@@ -1135,15 +977,6 @@
         assertTrue(Arrays.equals(test.getBytes(), inputBuffer));
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer[])
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies ClosedChannelException.",
-        method = "write",
-        args = {java.nio.ByteBuffer[].class}
-    )
     public void test_write$LByteBuffer_Closed() throws Exception {
         ByteBuffer[] writeBuffers = new ByteBuffer[2];
         writeBuffers[0] = ByteBuffer.allocate(CAPACITY);
@@ -1174,15 +1007,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer[])
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NonWritableChannelException",
-        method = "write",
-        args = {java.nio.ByteBuffer[].class}
-    )
     public void test_write$LByteBuffer_ReadOnly() throws Exception {
         ByteBuffer[] writeBuffers = new ByteBuffer[2];
         writeBuffers[0] = ByteBuffer.allocate(CAPACITY);
@@ -1196,15 +1020,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer[])
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "write",
-        args = {java.nio.ByteBuffer[].class}
-    )
     public void test_write$LByteBuffer_EmptyBuffers() throws Exception {
         ByteBuffer[] writeBuffers = new ByteBuffer[2];
         writeBuffers[0] = ByteBuffer.allocate(this.CONTENT_LENGTH);
@@ -1223,15 +1038,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer[])
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "write",
-        args = {java.nio.ByteBuffer[].class}
-    )
     public void test_write$LByteBuffer() throws Exception {
         ByteBuffer[] writeBuffers = new ByteBuffer[2];
         writeBuffers[0] = ByteBuffer.wrap(CONTENT_AS_BYTES);
@@ -1257,15 +1063,6 @@
         assertTrue(Arrays.equals(CONTENT_AS_BYTES, inputBuffer));
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer[],int,int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "write",
-        args = {java.nio.ByteBuffer[].class, int.class, int.class}
-    )
     public void test_write$LByteBufferII_Null() throws Exception {
         ByteBuffer[] writeBuffers = null;
 
@@ -1315,15 +1112,7 @@
             // expected
         }
     }
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer[],int,int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException.",
-        method = "write",
-        args = {java.nio.ByteBuffer[].class, int.class, int.class}
-    )
+
     public void test_write$LByteBufferII_IndexOutOfBound() throws Exception {
         ByteBuffer[] writeBuffers = new ByteBuffer[2];
         writeBuffers[0] = ByteBuffer.allocate(this.CONTENT_LENGTH);
@@ -1441,15 +1230,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#write(ByteBuffer[],int,int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "write",
-        args = {java.nio.ByteBuffer[].class, int.class, int.class}
-    )
     public void test_write$LByteBufferII_EmptyBuffers() throws Exception {
         ByteBuffer[] writeBuffers = new ByteBuffer[2];
         writeBuffers[0] = ByteBuffer.allocate(this.CONTENT_LENGTH);
@@ -1468,15 +1248,6 @@
         }
     }
 
-    /**
-     * @tests java.nio.channels.FileChannel#transferTo(long,long,WritableByteChannel)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "transferTo",
-        args = {long.class, long.class, java.nio.channels.WritableByteChannel.class}
-    )
     public void test_transferToJJLWritableByteChannel_IllegalArgument()
             throws Exception {
         WritableByteChannel writableByteChannel = DatagramChannel.open();
diff --git a/luni/src/test/java/libcore/java/nio/channels/OldServerSocketChannelTest.java b/luni/src/test/java/libcore/java/nio/channels/OldServerSocketChannelTest.java
index 7bc8780..fb63512 100644
--- a/luni/src/test/java/libcore/java/nio/channels/OldServerSocketChannelTest.java
+++ b/luni/src/test/java/libcore/java/nio/channels/OldServerSocketChannelTest.java
@@ -17,9 +17,6 @@
 
 package libcore.java.nio.channels;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.net.ServerSocket;
@@ -33,7 +30,6 @@
 /*
  * test for ServerSocketChannel
  */
-@TestTargetClass(ServerSocketChannel.class)
 public class OldServerSocketChannelTest extends TestCase {
 
     private static final int TIME_UNIT = 200;
@@ -75,15 +71,6 @@
     // -------------------------------------------------------------------
     // Test for methods in abstract class.
     // -------------------------------------------------------------------
-    /*
-     * Test method for 'java.nio.channels.ServerSocketChannel()'
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ServerSocketChannel",
-        args = {java.nio.channels.spi.SelectorProvider.class}
-    )
     public void testConstructor() throws IOException {
         ServerSocketChannel channel =
                 SelectorProvider.provider().openServerSocketChannel();
@@ -91,24 +78,12 @@
         assertSame(SelectorProvider.provider(),channel.provider());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "isOpen",
-        args = {}
-    )
     public void testIsOpen() throws Exception {
         assertTrue(this.serverChannel.isOpen());
         this.serverChannel.close();
         assertFalse(this.serverChannel.isOpen());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies ClosedByInterruptException.",
-        method = "accept",
-        args = {}
-    )
     public void test_accept_Block_NoConnect_interrupt() throws IOException {
         assertTrue(this.serverChannel.isBlocking());
         ServerSocket gotSocket = this.serverChannel.socket();
diff --git a/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java b/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java
index 2f81918..f182375 100644
--- a/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java
+++ b/luni/src/test/java/libcore/java/nio/channels/OldSocketChannelTest.java
@@ -18,9 +18,6 @@
 package libcore.java.nio.channels;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
@@ -40,7 +37,6 @@
 import junit.framework.TestCase;
 import tests.support.Support_PortManager;
 
-@TestTargetClass(SocketChannel.class)
 /**
  * Tests for SocketChannel and its default implementation.
  */
@@ -247,15 +243,6 @@
         return connected;
     }
 
-    /**
-     * @tests java.nio.channels.SocketChannel#read(ByteBuffer)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "write",
-        args = {java.nio.ByteBuffer.class}
-    )
     @BrokenTest("Occasionally fail in CTS, but works in CoreTestRunner")
     public void test_writeLjava_nio_ByteBuffer_Nonblocking_HugeData() throws IOException {
         // initialize write content
@@ -299,16 +286,6 @@
         }
     }
 
-    /**
-     * @throws IOException
-     * @tests java.nio.channels.SocketChannel#read(ByteBuffer)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {java.nio.ByteBuffer[].class}
-    )
     public void test_socketChannel_read_DirectByteBuffer() throws InterruptedException, IOException {
 
         ServerThread server = new ServerThread();
diff --git a/luni/src/test/java/libcore/java/nio/charset/OldCharsetDecoderTest.java b/luni/src/test/java/libcore/java/nio/charset/CharsetDecoderTest.java
similarity index 65%
rename from luni/src/test/java/libcore/java/nio/charset/OldCharsetDecoderTest.java
rename to luni/src/test/java/libcore/java/nio/charset/CharsetDecoderTest.java
index 8f37f63..e874a1b 100644
--- a/luni/src/test/java/libcore/java/nio/charset/OldCharsetDecoderTest.java
+++ b/luni/src/test/java/libcore/java/nio/charset/CharsetDecoderTest.java
@@ -25,11 +25,7 @@
 import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
 
-public class OldCharsetDecoderTest extends junit.framework.TestCase {
-    private static final String CHARSET = "UTF-16";
-
-    private static final String SAMPLE_STRING = "Android";
-
+public class CharsetDecoderTest extends junit.framework.TestCase {
     // None of the harmony or jtreg tests actually check that replaceWith does the right thing!
     public void test_replaceWith() throws Exception {
         CharsetDecoder d = Charset.forName("UTF-16").newDecoder();
@@ -42,8 +38,8 @@
 
     // http://code.google.com/p/android/issues/detail?id=4237
     public void test_ByteArray_decode_no_offset() throws Exception {
-        CharsetDecoder decoder = getCharsetDecoderUnderTest();
-        byte[] arr = getEncodedByteArrayFixture();
+        CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder();
+        byte[] arr = encode("UTF-16", "Android");
         ByteBuffer inBuffer = ByteBuffer.wrap(arr, 0, arr.length).slice();
         CharBuffer outBuffer = CharBuffer.allocate(arr.length);
         decoder.reset();
@@ -51,13 +47,13 @@
         assertFalse(coderResult.toString(), coderResult.isError());
         decoder.flush(outBuffer);
         outBuffer.flip();
-        assertEquals(SAMPLE_STRING, outBuffer.toString().trim());
+        assertEquals("Android", outBuffer.toString().trim());
     }
 
     // http://code.google.com/p/android/issues/detail?id=4237
     public void test_ByteArray_decode_with_offset() throws Exception {
-        CharsetDecoder decoder = getCharsetDecoderUnderTest();
-        byte[] arr = getEncodedByteArrayFixture();
+        CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder();
+        byte[] arr = encode("UTF-16", "Android");
         arr = prependByteToByteArray(arr, new Integer(1).byteValue());
         int offset = 1;
         ByteBuffer inBuffer = ByteBuffer.wrap(arr, offset, arr.length - offset).slice();
@@ -67,17 +63,17 @@
         assertFalse(coderResult.toString(), coderResult.isError());
         decoder.flush(outBuffer);
         outBuffer.flip();
-        assertEquals(SAMPLE_STRING, outBuffer.toString().trim());
+        assertEquals("Android", outBuffer.toString().trim());
     }
 
     // http://code.google.com/p/android/issues/detail?id=4237
     public void test_ByteArray_decode_with_offset_using_facade_method() throws Exception {
-        CharsetDecoder decoder = getCharsetDecoderUnderTest();
-        byte[] arr = getEncodedByteArrayFixture();
+        CharsetDecoder decoder = Charset.forName("UTF-16").newDecoder();
+        byte[] arr = encode("UTF-16", "Android");
         arr = prependByteToByteArray(arr, new Integer(1).byteValue());
         int offset = 1;
         CharBuffer outBuffer = decoder.decode(ByteBuffer.wrap(arr, offset, arr.length - offset));
-        assertEquals(SAMPLE_STRING, outBuffer.toString().trim());
+        assertEquals("Android", outBuffer.toString().trim());
     }
 
     private static byte[] prependByteToByteArray(byte[] arr, byte b) {
@@ -87,12 +83,26 @@
         return result;
     }
 
-    private static CharsetDecoder getCharsetDecoderUnderTest() {
-        return Charset.forName(CHARSET).newDecoder();
+    private static byte[] encode(String charsetName, String s) throws Exception {
+        CharsetEncoder encoder = Charset.forName(charsetName).newEncoder();
+        return encoder.encode(CharBuffer.wrap(s)).array();
     }
 
-    private byte[] getEncodedByteArrayFixture() throws CharacterCodingException {
-        CharsetEncoder encoder = Charset.forName(CHARSET).newEncoder();
-        return encoder.encode(CharBuffer.wrap(SAMPLE_STRING)).array();
+    public void testUtf8BytesSplitAcrossMultipleWrites() throws Exception {
+        CharsetDecoder decoder = Charset.forName("UTF-8").newDecoder();
+        CharBuffer cb = CharBuffer.allocate(128);
+        CoderResult cr;
+        cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0xe2 }), cb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x98 }), cb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        cr = decoder.decode(ByteBuffer.wrap(new byte[] { (byte) 0x83 }), cb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        cr = decoder.decode(ByteBuffer.wrap(new byte[0]), cb, true);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        cr = decoder.flush(cb);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(1, cb.position());
+        assertEquals('\u2603', cb.get(0));
     }
 }
diff --git a/luni/src/test/java/libcore/java/nio/charset/CharsetEncoderTest.java b/luni/src/test/java/libcore/java/nio/charset/CharsetEncoderTest.java
index 87e7306..d733a9f 100644
--- a/luni/src/test/java/libcore/java/nio/charset/CharsetEncoderTest.java
+++ b/luni/src/test/java/libcore/java/nio/charset/CharsetEncoderTest.java
@@ -16,9 +16,11 @@
 
 package libcore.java.nio.charset;
 
+import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
+import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
 import java.util.Arrays;
 
@@ -59,4 +61,147 @@
     public void test_defaultReplacementBytesUtf_8() throws Exception {
         assertReplacementBytesForEncoder("UTF-8", new byte[] { (byte) '?' });
     }
+
+    public void testSurrogatePairAllAtOnce() throws Exception {
+        // okay: surrogate pair seen all at once is decoded to U+20b9f.
+        Charset cs = Charset.forName("UTF-32BE");
+        CharsetEncoder e = cs.newEncoder();
+        ByteBuffer bb = ByteBuffer.allocate(128);
+        CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\ud842', '\udf9f' }), bb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(4, bb.position());
+        assertEquals((byte) 0x00, bb.get(0));
+        assertEquals((byte) 0x02, bb.get(1));
+        assertEquals((byte) 0x0b, bb.get(2));
+        assertEquals((byte) 0x9f, bb.get(3));
+    }
+
+    public void testMalformedSurrogatePair() throws Exception {
+        // malformed: low surrogate first is detected as an error.
+        Charset cs = Charset.forName("UTF-32BE");
+        CharsetEncoder e = cs.newEncoder();
+        ByteBuffer bb = ByteBuffer.allocate(128);
+        CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\udf9f' }), bb, false);
+        assertTrue(cr.toString(), cr.isMalformed());
+        assertEquals(1, cr.length());
+    }
+
+    public void testCharsetEncoderSurrogatesBrokenByDesign_IGNORE_RI() throws Exception {
+        testCharsetEncoderSurrogatesBrokenByDesign_RI(CodingErrorAction.IGNORE);
+    }
+
+    public void testCharsetEncoderSurrogatesBrokenByDesign_REPORT_RI() throws Exception {
+        testCharsetEncoderSurrogatesBrokenByDesign_RI(CodingErrorAction.REPORT);
+    }
+
+    public void testCharsetEncoderSurrogatesBrokenByDesign_REPLACE_RI() throws Exception {
+        testCharsetEncoderSurrogatesBrokenByDesign_RI(CodingErrorAction.REPLACE);
+    }
+
+    private void testCharsetEncoderSurrogatesBrokenByDesign_RI(CodingErrorAction cea) throws Exception {
+        // stupid: on the RI, writing the two halves of the surrogate pair in separate writes
+        // is an error because the CharsetEncoder doesn't remember it's half-way through a
+        // surrogate pair across the two calls!
+
+        // IGNORE just ignores both characters, REPORT complains that the second is
+        // invalid (because it doesn't remember seeing the first), and REPLACE inserts a
+        // replacement character U+fffd when it sees the second character (because it too
+        // doesn't remember seeing the first).
+
+        Charset cs = Charset.forName("UTF-32BE");
+        CharsetEncoder e = cs.newEncoder();
+        e.onMalformedInput(cea);
+        e.onUnmappableCharacter(cea);
+        ByteBuffer bb = ByteBuffer.allocate(128);
+        CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\ud842' }), bb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(0, bb.position());
+        cr = e.encode(CharBuffer.wrap(new char[] { '\udf9f' }), bb, false);
+        if (cea == CodingErrorAction.REPORT) {
+            assertTrue(cr.toString(), cr.isMalformed());
+            assertEquals(1, cr.length());
+            return;
+        }
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        int expectedPosition = 0;
+        if (cea == CodingErrorAction.REPLACE) {
+            expectedPosition = 4;
+            assertEquals(expectedPosition, bb.position());
+            System.err.println(Arrays.toString(Arrays.copyOfRange(bb.array(), 0, bb.position())));
+            assertEquals((byte) 0x00, bb.get(0));
+            assertEquals((byte) 0x00, bb.get(1));
+            assertEquals((byte) 0xff, bb.get(2));
+            assertEquals((byte) 0xfd, bb.get(3));
+        }
+        assertEquals(expectedPosition, bb.position());
+        cr = e.encode(CharBuffer.wrap(new char[] { }), bb, true);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(expectedPosition, bb.position());
+        cr = e.flush(bb);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(expectedPosition, bb.position());
+    }
+
+    public void testCharsetEncoderSurrogatesBrokenByDesign_IGNORE() throws Exception {
+        testCharsetEncoderSurrogatesBrokenByDesign(CodingErrorAction.IGNORE);
+    }
+
+    public void testCharsetEncoderSurrogatesBrokenByDesign_REPORT() throws Exception {
+        testCharsetEncoderSurrogatesBrokenByDesign(CodingErrorAction.REPORT);
+    }
+
+    public void testCharsetEncoderSurrogatesBrokenByDesign_REPLACE() throws Exception {
+        testCharsetEncoderSurrogatesBrokenByDesign(CodingErrorAction.REPLACE);
+    }
+
+    private void testCharsetEncoderSurrogatesBrokenByDesign(CodingErrorAction cea) throws Exception {
+        // Writing the two halves of the surrogate pair in separate writes works just fine.
+        // This is true of Android and ICU, but not of the RI.
+        Charset cs = Charset.forName("UTF-32BE");
+        CharsetEncoder e = cs.newEncoder();
+        e.onMalformedInput(cea);
+        e.onUnmappableCharacter(cea);
+        ByteBuffer bb = ByteBuffer.allocate(128);
+        CoderResult cr = e.encode(CharBuffer.wrap(new char[] { '\ud842' }), bb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(0, bb.position());
+        cr = e.encode(CharBuffer.wrap(new char[] { '\udf9f' }), bb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        int expectedPosition = 4;
+        assertEquals(expectedPosition, bb.position());
+        System.err.println(Arrays.toString(Arrays.copyOfRange(bb.array(), 0, bb.position())));
+        assertEquals((byte) 0x00, bb.get(0));
+        assertEquals((byte) 0x02, bb.get(1));
+        assertEquals((byte) 0x0b, bb.get(2));
+        assertEquals((byte) 0x9f, bb.get(3));
+        cr = e.encode(CharBuffer.wrap(new char[] { }), bb, true);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(expectedPosition, bb.position());
+        cr = e.flush(bb);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(expectedPosition, bb.position());
+    }
+
+    public void testFlushWithoutEndOfInput() throws Exception {
+        Charset cs = Charset.forName("UTF-32BE");
+        CharsetEncoder e = cs.newEncoder();
+        ByteBuffer bb = ByteBuffer.allocate(128);
+        CoderResult cr = e.encode(CharBuffer.wrap(new char[] { 'x' }), bb, false);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(4, bb.position());
+        try {
+            cr = e.flush(bb);
+        } catch (IllegalStateException expected) {
+            // you must call encode with endOfInput true before you can flush.
+        }
+
+        // We had a bug where we wouldn't reset inEnd before calling encode in implFlush.
+        // That would result in flush outputting garbage.
+        cr = e.encode(CharBuffer.wrap(new char[] { 'x' }), bb, true);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(8, bb.position());
+        cr = e.flush(bb);
+        assertEquals(CoderResult.UNDERFLOW, cr);
+        assertEquals(8, bb.position());
+    }
 }
diff --git a/luni/src/test/java/libcore/java/nio/charset/OldCharsetEncoderDecoderBufferTest.java b/luni/src/test/java/libcore/java/nio/charset/OldCharsetEncoderDecoderBufferTest.java
index 583cb47..6465d9e 100644
--- a/luni/src/test/java/libcore/java/nio/charset/OldCharsetEncoderDecoderBufferTest.java
+++ b/luni/src/test/java/libcore/java/nio/charset/OldCharsetEncoderDecoderBufferTest.java
@@ -24,7 +24,7 @@
 import junit.framework.TestCase;
 
 
-/* See bug 1844104.
+/* See bug http://b/1844104.
  * Checks for ICU encoder/decoder buffer corruption.
  */
 public class OldCharsetEncoderDecoderBufferTest extends TestCase {
@@ -77,8 +77,8 @@
         assertEquals('a', inArray[0]);
         assertEquals('b', inArray[1]);
 
-        ByteBuffer inWithoutArray = ByteBuffer.allocateDirect(1);
-        inWithoutArray.put(0, (byte)'x');
+        // A read-only ByteBuffer must not expose its array.
+        ByteBuffer inWithoutArray = ByteBuffer.wrap(new byte[] { (byte) 'x' }).asReadOnlyBuffer();
         assertFalse(inWithoutArray.hasArray());
         decoder.decode(inWithoutArray, out, true);
 
@@ -106,7 +106,11 @@
         assertEquals(0, buffer[2]);
 
         out = ByteBuffer.allocateDirect(10);
-        assertFalse(out.hasArray());
+        // It's no longer possible to get a byte buffer without a backing byte[] on Android.
+        // This test is useless on Android, unless that changes again. (You can't even
+        // subclass ByteBuffer because -- although it's non-final -- both the RI and Android
+        // have [different] package-private abstract methods you'd need to implement but can't.)
+        //assertFalse(out.hasArray());
         encoder.encode(CharBuffer.wrap("x"), out, true);
 
         // check whether the second decode corrupted the first buffer
diff --git a/luni/src/test/java/libcore/java/security/AccessControllerTest.java b/luni/src/test/java/libcore/java/security/AccessControllerTest.java
index 0848c5c..1f7da91 100644
--- a/luni/src/test/java/libcore/java/security/AccessControllerTest.java
+++ b/luni/src/test/java/libcore/java/security/AccessControllerTest.java
@@ -17,27 +17,27 @@
 package libcore.java.security;
 
 import java.security.AccessControlContext;
-import java.security.AccessControlException;
 import java.security.AccessController;
 import java.security.DomainCombiner;
 import java.security.Permission;
 import java.security.Permissions;
 import java.security.PrivilegedAction;
 import java.security.ProtectionDomain;
+import java.util.concurrent.atomic.AtomicInteger;
+import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 
+/**
+ * Android doesn't fully support access controller. This tests that actions are
+ * passed through without permission enforcement.
+ */
 public final class AccessControllerTest extends TestCase {
 
     public void testDoPrivilegedWithCombiner() {
         final Permission permission = new RuntimePermission("do stuff");
         final DomainCombiner union = new DomainCombiner() {
             public ProtectionDomain[] combine(ProtectionDomain[] a, ProtectionDomain[] b) {
-                a = (a == null) ? new ProtectionDomain[0] : a;
-                b = (b == null) ? new ProtectionDomain[0] : b;
-                ProtectionDomain[] union = new ProtectionDomain[a.length + b.length];
-                System.arraycopy(a, 0, union, 0, a.length);
-                System.arraycopy(b, 0, union, a.length, b.length);
-                return union;
+                throw new AssertionFailedError("Expected combiner to be unused");
             }
         };
 
@@ -45,26 +45,19 @@
         AccessControlContext accessControlContext = new AccessControlContext(
                 new AccessControlContext(new ProtectionDomain[] { protectionDomain }), union);
 
+        final AtomicInteger actionCount = new AtomicInteger();
+
         AccessController.doPrivileged(new PrivilegedAction<Void>() {
             public Void run() {
-                // in this block we lack our requested permission
-                assertSame(union, AccessController.getContext().getDomainCombiner());
-                assertPermission(false, permission);
+                assertEquals(null, AccessController.getContext().getDomainCombiner());
+                AccessController.getContext().checkPermission(permission);
 
+                // Calling doPrivileged again would have exercised the combiner
                 AccessController.doPrivileged(new PrivilegedAction<Void>() {
                     public Void run() {
-                        // nest doPrivileged to get it back.
-                        assertNull(AccessController.getContext().getDomainCombiner());
-                        assertPermission(true, permission);
-                        return null;
-                    }
-                });
-
-                AccessController.doPrivilegedWithCombiner(new PrivilegedAction<Void>() {
-                    public Void run() {
-                        // nest doPrivilegedWithCombiner() to get it back and keep the combiner.
-                        assertSame(union, AccessController.getContext().getDomainCombiner());
-                        assertPermission(true, permission);
+                        actionCount.incrementAndGet();
+                        assertEquals(null, AccessController.getContext().getDomainCombiner());
+                        AccessController.getContext().checkPermission(permission);
                         return null;
                     }
                 });
@@ -72,17 +65,7 @@
                 return null;
             }
         }, accessControlContext);
-    }
 
-    private void assertPermission(boolean granted, Permission permission) {
-        if (granted) {
-            AccessController.getContext().checkPermission(permission);
-        } else {
-            try {
-                AccessController.getContext().checkPermission(permission);
-                fail("Had unexpected permission: " + permission);
-            } catch (AccessControlException expected) {
-            }
-        }
+        assertEquals(1, actionCount.get());
     }
 }
diff --git a/luni/src/test/java/libcore/java/security/KeyStoreTest.java b/luni/src/test/java/libcore/java/security/KeyStoreTest.java
index 73e69ef..d8d3928 100644
--- a/luni/src/test/java/libcore/java/security/KeyStoreTest.java
+++ b/luni/src/test/java/libcore/java/security/KeyStoreTest.java
@@ -53,10 +53,17 @@
 
 public class KeyStoreTest extends TestCase {
 
-    private static final PrivateKeyEntry PRIVATE_KEY
-            = TestKeyStore.getServer().getPrivateKey("RSA", "RSA");
-    private static final PrivateKeyEntry PRIVATE_KEY_2
-            = TestKeyStore.getClientCertificate().getPrivateKey("RSA", "RSA");
+    private static final PrivateKeyEntry PRIVATE_KEY;
+    private static final PrivateKeyEntry PRIVATE_KEY_2;
+    static {
+        try {
+            PRIVATE_KEY = TestKeyStore.getServer().getPrivateKey("RSA", "RSA");
+            PRIVATE_KEY_2 = TestKeyStore.getClientCertificate().getPrivateKey("RSA", "RSA");
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
     private static final SecretKey SECRET_KEY = generateSecretKey();
     private static final SecretKey SECRET_KEY_2 = generateSecretKey();
 
diff --git a/luni/src/test/java/libcore/java/security/OldAlgorithmParameterGeneratorTest.java b/luni/src/test/java/libcore/java/security/OldAlgorithmParameterGeneratorTest.java
index 5985403..968bd53 100644
--- a/luni/src/test/java/libcore/java/security/OldAlgorithmParameterGeneratorTest.java
+++ b/luni/src/test/java/libcore/java/security/OldAlgorithmParameterGeneratorTest.java
@@ -17,11 +17,9 @@
 
 package libcore.java.security;
 
-import dalvik.annotation.TestTargetClass;
 import java.security.AlgorithmParameterGenerator;
 import java.security.SecureRandom;
 
-@TestTargetClass(AlgorithmParameterGenerator.class)
 public class OldAlgorithmParameterGeneratorTest extends junit.framework.TestCase {
 
     public void test_initI() throws Exception {
diff --git a/luni/src/test/java/libcore/java/security/OldDHTest.java b/luni/src/test/java/libcore/java/security/OldDHTest.java
index 95cdfe5..421d153 100644
--- a/luni/src/test/java/libcore/java/security/OldDHTest.java
+++ b/luni/src/test/java/libcore/java/security/OldDHTest.java
@@ -16,8 +16,6 @@
 package libcore.java.security;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 import java.security.AlgorithmParameterGenerator;
 import java.security.AlgorithmParameters;
 import java.security.KeyPair;
@@ -29,11 +27,6 @@
 
 public class OldDHTest extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        method = "method",
-        args = {}
-    )
     @BrokenTest("Suffers from DH slowness, disabling for now")
     public void testDHGen() throws Exception {
         KeyPairGenerator gen = null;
diff --git a/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java b/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java
index 5a308e3..d69e0e2 100644
--- a/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java
+++ b/luni/src/test/java/libcore/java/security/cert/OldPKIXParametersTest.java
@@ -23,9 +23,6 @@
 package libcore.java.security.cert;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.io.ByteArrayInputStream;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
@@ -43,18 +40,8 @@
 /**
  * Tests for <code>PKIXParameters</code> fields and methods
  */
-@TestTargetClass(PKIXParameters.class)
 public class OldPKIXParametersTest extends TestCase {
 
-    /**
-     * Test for <code>clone()</code> method<br>
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void testClone() throws InvalidAlgorithmParameterException {
         Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet();
         if (taSet == null) {
@@ -112,12 +99,6 @@
      *
      * @throws InvalidAlgorithmParameterException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isPolicyMappingInhibited",
-        args = {}
-    )
     public final void testIsPolicyMappingInhibited() throws Exception {
         Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet();
         if (taSet == null) {
@@ -146,12 +127,6 @@
      *
      * @throws InvalidAlgorithmParameterException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isRevocationEnabled",
-        args = {}
-    )
     public final void testIsRevocationEnabled() throws Exception {
         Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet();
         if (taSet == null) {
@@ -176,12 +151,6 @@
     /**
      * Test for <code>toString</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() throws Exception {
         Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet();
         if (taSet == null) {
@@ -207,12 +176,6 @@
      * @throws InvalidAlgorithmParameterException
      * @throws KeyStoreException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies everything except null argument",
-        method = "PKIXParameters",
-        args = {java.security.KeyStore.class}
-    )
     @BrokenTest("Fails in CTS environment, but passes in CoreTestRunner")
     public final void testPKIXParametersKeyStore04() throws Exception {
 
diff --git a/luni/src/test/java/libcore/java/security/cert/SubjectAlternativeNameTest.java b/luni/src/test/java/libcore/java/security/cert/SubjectAlternativeNameTest.java
new file mode 100644
index 0000000..88d5011
--- /dev/null
+++ b/luni/src/test/java/libcore/java/security/cert/SubjectAlternativeNameTest.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.security.cert;
+
+import com.android.org.bouncycastle.asn1.x509.GeneralName;
+import java.io.ByteArrayInputStream;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509Certificate;
+import java.util.Collection;
+import java.util.List;
+import junit.framework.TestCase;
+import libcore.java.security.TestKeyStore;
+
+public final class SubjectAlternativeNameTest extends TestCase {
+
+    /**
+     * The spec doesn't cover this, but we require that IP addresses are
+     * formatted consistently with InetAddress.getHostAddress().
+     */
+    public void testFormatIpv4Address() throws Exception {
+        assertEquals("127.0.0.1", formatIpAddress(new byte[]{127, 0, 0, 1}));
+    }
+
+    public void testFormatIpv4MappedAddress() throws Exception {
+        byte[] mappedAddress = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, 127, 0, 0, 1 };
+        assertEquals("127.0.0.1", formatIpAddress(mappedAddress));
+    }
+
+    public void testFormatIpv6Address() throws Exception {
+        byte[] ipAddress = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
+        String decoded = formatIpAddress(ipAddress);
+        assertTrue(decoded, decoded.equals("::1") || decoded.equals("0:0:0:0:0:0:0:1"));
+    }
+
+    private String formatIpAddress(byte[] ipAddress) throws Exception {
+        Certificate root = new TestKeyStore.Builder()
+                .addSubjectAltNameIpAddress(ipAddress)
+                .build()
+                .getRootCertificate("RSA");
+        X509Certificate javaCertificate = bouncycastleToJava(root);
+        Collection<List<?>> subjectAlternativeNames = javaCertificate.getSubjectAlternativeNames();
+        assertEquals(1, subjectAlternativeNames.size());
+        List<?> subjectAlternativeName = subjectAlternativeNames.iterator().next();
+        assertEquals(2, subjectAlternativeName.size());
+        assertEquals(GeneralName.iPAddress, subjectAlternativeName.get(0));
+        return (String) subjectAlternativeName.get(1);
+    }
+
+    private X509Certificate bouncycastleToJava(Certificate certificate) throws Exception {
+        byte[] encoded = certificate.getEncoded();
+        CertificateFactory factory = CertificateFactory.getInstance("X.509");
+        return (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(encoded));
+    }
+}
diff --git a/luni/src/test/java/libcore/java/security/cert/X509CertSelectorTest.java b/luni/src/test/java/libcore/java/security/cert/X509CertSelectorTest.java
new file mode 100644
index 0000000..4a5658c
--- /dev/null
+++ b/luni/src/test/java/libcore/java/security/cert/X509CertSelectorTest.java
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.security.cert;
+
+import com.android.org.bouncycastle.asn1.x509.GeneralName;
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.security.cert.Certificate;
+import java.security.cert.CertificateFactory;
+import java.security.cert.X509CertSelector;
+import java.security.cert.X509Certificate;
+import junit.framework.TestCase;
+import libcore.java.security.TestKeyStore;
+
+public final class X509CertSelectorTest extends TestCase {
+
+    public void testMatchIpv4SubjectAlternativeName() throws Exception {
+        X509CertSelector certSelector = new X509CertSelector();
+        certSelector.addSubjectAlternativeName(GeneralName.iPAddress, "127.0.0.1");
+
+        byte[] match = { 127, 0, 0, 1 };
+        assertTrue(certSelector.match(newCertWithSubjectAltNameIpAddress(match)));
+
+        byte[] noMatch = { 127, 0, 0, 2 };
+        assertFalse(certSelector.match(newCertWithSubjectAltNameIpAddress(noMatch)));
+    }
+
+    public void testMatchIpv4MappedSubjectAlternativeName() throws Exception {
+        X509CertSelector certSelector = new X509CertSelector();
+        certSelector.addSubjectAlternativeName(GeneralName.iPAddress, "::ffff:127.0.0.1");
+
+        byte[] match = { 127, 0, 0, 1 };
+        assertTrue(certSelector.match(newCertWithSubjectAltNameIpAddress(match)));
+
+        byte[] noMatch = { 127, 0, 0, 2 };
+        assertFalse(certSelector.match(newCertWithSubjectAltNameIpAddress(noMatch)));
+    }
+
+    public void testMatchIpv6SubjectAlternativeName() throws Exception {
+        X509CertSelector certSelector = new X509CertSelector();
+        certSelector.setMatchAllSubjectAltNames(false);
+        certSelector.addSubjectAlternativeName(GeneralName.iPAddress, "::1");
+
+        byte[] match = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
+        assertTrue(certSelector.match(newCertWithSubjectAltNameIpAddress(match)));
+
+        byte[] noMatch = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2 };
+        assertFalse(certSelector.match(newCertWithSubjectAltNameIpAddress(noMatch)));
+    }
+
+    public void testMatchMaskedIpv4NameConstraint() throws Exception {
+        byte[] excluded = { (byte) 192, (byte) 168, 0, 1 };
+        X509CertSelector certSelector = new X509CertSelector();
+        certSelector.addPathToName(GeneralName.iPAddress, "127.0.0.1");
+
+        byte[] directMatch = { 127, 0, 0, 1, -1, -1, -1, -1 };
+        assertTrue(certSelector.match(newCertWithNameConstraint(directMatch, excluded)));
+
+        byte[] noMatch = { 127, 0, 0, 2, -1, -1, -1, 127 };
+        assertFalse(certSelector.match(newCertWithNameConstraint(noMatch, excluded)));
+
+        // TODO: test that requires mask to match
+    }
+
+    public void testMatchMaskedIpv6NameConstraint() throws Exception {
+        byte[] excluded = {
+                0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0
+        };
+        X509CertSelector certSelector = new X509CertSelector();
+        certSelector.addPathToName(GeneralName.iPAddress, "1::1");
+
+        byte[] directMatch = {
+                0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127
+        };
+        assertTrue(certSelector.match(newCertWithNameConstraint(directMatch, excluded)));
+
+        byte[] noMatch = {
+                0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
+                -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127
+        };
+        assertFalse(certSelector.match(newCertWithNameConstraint(noMatch, excluded)));
+
+        // TODO: test that requires mask to match
+    }
+
+    public void testMatchMalformedSubjectAlternativeName() throws Exception {
+        X509CertSelector certSelector = new X509CertSelector();
+        try {
+            certSelector.addSubjectAlternativeName(GeneralName.iPAddress, "1::x");
+            fail();
+        } catch (IOException expected) {
+        }
+        try {
+            certSelector.addSubjectAlternativeName(GeneralName.iPAddress, "127.0.0.x");
+            fail();
+        } catch (IOException expected) {
+        }
+    }
+
+    private X509Certificate newCertWithSubjectAltNameIpAddress(byte[] ipAddress) throws Exception {
+        TestKeyStore testKeyStore = new TestKeyStore.Builder()
+                .addSubjectAltNameIpAddress(ipAddress)
+                .build();
+        return bouncycastleToJava(testKeyStore.getRootCertificate("RSA"));
+    }
+
+    private X509Certificate newCertWithNameConstraint(byte[] permitted, byte[] excluded)
+            throws Exception {
+        TestKeyStore testKeyStore = new TestKeyStore.Builder()
+                .addNameConstraint(true, permitted)
+                .addNameConstraint(false, excluded)
+                .ca(true)
+                .build();
+        return bouncycastleToJava(testKeyStore.getRootCertificate("RSA"));
+    }
+
+    private X509Certificate bouncycastleToJava(Certificate certificate) throws Exception {
+        byte[] encoded = certificate.getEncoded();
+        CertificateFactory factory = CertificateFactory.getInstance("X.509");
+        return (X509Certificate) factory.generateCertificate(new ByteArrayInputStream(encoded));
+    }
+}
diff --git a/luni/src/test/java/tests/sql/ConnectionTest.java b/luni/src/test/java/libcore/java/sql/OldConnectionTest.java
similarity index 72%
rename from luni/src/test/java/tests/sql/ConnectionTest.java
rename to luni/src/test/java/libcore/java/sql/OldConnectionTest.java
index efa8aa4..0edee1c 100755
--- a/luni/src/test/java/tests/sql/ConnectionTest.java
+++ b/luni/src/test/java/libcore/java/sql/OldConnectionTest.java
@@ -14,57 +14,28 @@
  * limitations under the License.
  */
 
-package tests.sql;
+package libcore.java.sql;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
-import java.io.IOException;
+import java.sql.CallableStatement;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.DriverManager;
-import java.sql.SQLWarning;
-import java.sql.Savepoint;
-import java.sql.Statement;
 import java.sql.PreparedStatement;
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.sql.SQLWarning;
+import java.sql.Savepoint;
+import java.sql.Statement;
 
-import java.sql.CallableStatement;
-import java.util.Map;
+public final class OldConnectionTest extends OldSQLTest {
 
-import junit.framework.Test;
-
-@TestTargetClass(Connection.class)
-public class ConnectionTest extends SQLTest {
-
-    /**
-     * @test {@link java.sql.Connection#createStatement()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createStatement",
-        args = {}
-    )
-    public void testCreateStatement() {
-
-        Statement statement = null;
-        try {
-            statement = conn.createStatement();
-            assertNotNull(statement);
-            //check default values
-            assertEquals(ResultSet.FETCH_UNKNOWN, statement.getFetchDirection());
-            assertNull(statement.getWarnings());
-            assertTrue(statement.getQueryTimeout() > 0);
-        } catch (SQLException sqle) {
-            fail("SQL Exception was thrown: " + sqle.getMessage());
-        } catch (Exception e) {
-            fail("Unexpected Exception " + e.getMessage());
-        }
+    public void testCreateStatement() throws SQLException {
+        Statement statement = conn.createStatement();
+        assertNotNull(statement);
+        //check default values
+        assertEquals(ResultSet.FETCH_UNKNOWN, statement.getFetchDirection());
+        assertNull(statement.getWarnings());
+        assertTrue(statement.getQueryTimeout() > 0);
         try {
             conn.close();
             statement.executeQuery("select * from zoo");
@@ -74,17 +45,7 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Connection#createStatement(int resultSetType, int
-     *       resultSetConcurrency)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Exception tests fail.",
-        method = "createStatement",
-        args = {int.class, int.class}
-    )
-    @KnownFailure("Scrolling on a forward only RS not allowed. conn.close() does not wrap up")
+    // Scrolling on a forward only RS not allowed. conn.close() does not wrap up
     public void testCreateStatement_int_int() throws SQLException {
         Statement st = null;
         ResultSet rs = null;
@@ -101,9 +62,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -125,9 +83,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -136,7 +91,7 @@
             }
         }
 
-     // test forward only
+        // test forward only
         try {
             st = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
                     ResultSet.CONCUR_READ_ONLY);
@@ -149,9 +104,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -177,9 +129,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -203,9 +152,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -217,7 +163,7 @@
         conn.close();
 
         try {
-        // exception is not specified for this case
+            // exception is not specified for this case
             conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, -1);
             fail("Illigal arguments: should return exception.");
         } catch (SQLException sqle) {
@@ -225,7 +171,7 @@
         }
 
         try {
-        // exception is not specified for this case
+           // exception is not specified for this case
             conn.createStatement(Integer.MIN_VALUE, ResultSet.CONCUR_READ_ONLY);
             fail("Illigal arguments: should return exception.");
         } catch (SQLException sqle) {
@@ -233,17 +179,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Connection#createStatement(int resultSetType, int
-     *       resultSetConcurrency, int resultSetHoldability)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "ResultSet.HOLD_CURSORS_AT_COMMIT",
-        method = "createStatement",
-        args = {int.class, int.class, int.class}
-    )
-    public void testCreateStatement_int_int_int() {
+    public void testCreateStatement_int_int_int() throws SQLException {
         Statement st = null;
         try {
             assertNotNull(conn);
@@ -257,13 +193,7 @@
             int pos = rs.getRow();
             conn.commit();
             assertEquals("ResultSet cursor position has changed",pos, rs.getRow());
-            try {
-                rs.close();
-            } catch (SQLException sqle) {
-                fail("Unexpected exception was thrown during closing ResultSet");
-            }
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
+            rs.close();
         } finally {
             try {
                 if (st != null) st.close();
@@ -278,17 +208,10 @@
         } catch (SQLException sqle) {
             //ok
         }
-
     }
 
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "ResultSet.CLOSE_CURSORS_AT_COMMIT as argument is not supported",
-            method = "createStatement",
-            args = {int.class, int.class, int.class}
-        )
-    @KnownFailure("not supported")
-    public void testCreateStatementIntIntIntNotSupported() {
+    // known failure: not supported
+    public void testCreateStatementIntIntIntNotSupported() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
@@ -304,37 +227,21 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             if (st != null) {
-            try {
-                st.close();
-            } catch (SQLException ee) {
-            }
+                try {
+                    st.close();
+                } catch (SQLException ee) {
+                }
             }
         }
     }
 
-    /**
-     * @test java.sql.Connection#getMetaData()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "getMetaData",
-        args = {}
-    )
-    @KnownFailure("conn.close() does not wrap up")
-    public void testGetMetaData() throws SQLException{
-        try {
-            DatabaseMetaData md = conn.getMetaData();
-            Connection con = md.getConnection();
-            assertEquals(conn, con);
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
-        }
+    // conn.close() does not wrap up
+    public void testGetMetaData() throws SQLException {
+        DatabaseMetaData md = conn.getMetaData();
+        Connection con = md.getConnection();
+        assertEquals(conn, con);
 
         conn.close();
         try {
@@ -345,28 +252,10 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#clearWarnings()
-     *
-     * TODO clearWarnings is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "test fails. not supported. always returns null.",
-        method = "clearWarnings",
-        args = {}
-    )
-    @KnownFailure("not supported")
-    public void testClearWarnings() throws SQLException {
-
-        try {
-            SQLWarning w = conn.getWarnings();
-            assertNull(w);
-        } catch (Exception e) {
-            fail("Unexpected Exception: " + e.getMessage());
-        }
-
+    // TODO clearWarnings is not supported
+    public void testClearWarnings() throws Exception {
+        SQLWarning w = conn.getWarnings();
+        assertNull(w);
 
         Statement st = null;
         try {
@@ -382,13 +271,9 @@
             }
         }
 
-        try {
-            conn.clearWarnings();
-            SQLWarning w = conn.getWarnings();
-            assertNull(w);
-        } catch (Exception e) {
-            fail("Unexpected Exception: " + e.getMessage());
-        }
+        conn.clearWarnings();
+        w = conn.getWarnings();
+        assertNull(w);
 
         try {
             st = conn.createStatement();
@@ -404,12 +289,8 @@
         }
 
         //Test for correct functionality
-        try {
-            SQLWarning w = conn.getWarnings();
-            assertNotNull(w);
-        } catch (Exception e) {
-            fail("Unexpected Exception: " + e.getMessage());
-        }
+        w = conn.getWarnings();
+        assertNotNull(w);
 
         conn.close();
         try {
@@ -422,20 +303,8 @@
     }
 
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#getWarnings()
-     *
-     * TODO GetWarnings is not supported: returns null
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported. always returns null. SQLException test fails",
-        method = "getWarnings",
-        args = {}
-    )
-    @KnownFailure("not supported")
-   public void testGetWarnings() throws SQLException {
+    // TODO GetWarnings is not supported: returns null
+    public void testGetWarnings() throws Exception {
         Statement st = null;
         int errorCode1 = -1;
         int errorCode2 = -1;
@@ -449,12 +318,8 @@
             errorCode1 = e.getErrorCode();
         }
 
-        try {
-            SQLWarning wrs = conn.getWarnings();
-            assertNull(wrs);
-        } catch (Exception e) {
-            fail("Change test implementation: get warnings is supported now");
-        }
+        SQLWarning wrs = conn.getWarnings();
+        assertNull(wrs);
 
         // tests implementation: but errorcodes need to change too -> change impl.
         /*
@@ -511,49 +376,24 @@
         }
     }
 
-    /**
-     * @test java.sql.Connection#getAutoCommit()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking missed",
-        method = "getAutoCommit",
-        args = {}
-    )
-    public void testGetAutoCommit() {
-        try {
-            conn.setAutoCommit(true);
-            assertTrue(conn.getAutoCommit());
-            conn.setAutoCommit(false);
-            assertFalse(conn.getAutoCommit());
-            conn.setAutoCommit(true);
-            assertTrue(conn.getAutoCommit());
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
-        }
+    public void testGetAutoCommit() throws SQLException {
+        conn.setAutoCommit(true);
+        assertTrue(conn.getAutoCommit());
+        conn.setAutoCommit(false);
+        assertFalse(conn.getAutoCommit());
+        conn.setAutoCommit(true);
+        assertTrue(conn.getAutoCommit());
     }
 
-    /**
-     * @test java.sql.Connection#setAutoCommit(boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test throws exception",
-        method = "setAutoCommit",
-        args = {boolean.class}
-    )
-    @KnownFailure("conn.close() does not wrap up")
+    // conn.close() does not wrap up
     public void testSetAutoCommit() throws SQLException {
-
         Statement st = null;
         ResultSet rs = null;
         ResultSet rs1 = null;
         try {
             conn.setAutoCommit(true);
             st = conn.createStatement();
-            st
-                    .execute("insert into zoo (id, name, family) values (3, 'Chichichi', 'monkey');");
+            st.execute("insert into zoo (id, name, family) values (3, 'Chichichi', 'monkey');");
             conn.commit();
         } catch (SQLException e) {
             //ok
@@ -569,8 +409,6 @@
             st.execute("select * from zoo");
             rs = st.getResultSet();
             assertEquals(3, getCount(rs));
-        } catch (SQLException e) {
-            fail("Unexpected Exception thrown");
         } finally {
             try {
                 st.close();
@@ -582,8 +420,7 @@
         try {
             conn.setAutoCommit(false);
             st = conn.createStatement();
-            st
-                    .execute("insert into zoo (id, name, family) values (4, 'Burenka', 'cow');");
+            st.execute("insert into zoo (id, name, family) values (4, 'Burenka', 'cow');");
             st.execute("select * from zoo");
             rs = st.getResultSet();
             assertEquals(4, getCount(rs));
@@ -591,9 +428,6 @@
             // Check cursors closed after commit
             rs1 = st.getResultSet();
             assertEquals(0, getCount(rs1));
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -613,26 +447,12 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#isReadOnly()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Instead of SQLException nullpointer exception is thrown.",
-        method = "isReadOnly",
-        args = {}
-    )
-    @KnownFailure("conn.close() does not wrap up")
+    // conn.close() does not wrap up
     public void testIsReadOnly() throws SQLException {
-        try {
-            conn.setReadOnly(true);
-            assertTrue(conn.isReadOnly());
-            conn.setReadOnly(false);
-            assertFalse(conn.isReadOnly());
-        } catch (SQLException sqle) {
-            fail("SQLException was thrown: " + sqle.getMessage());
-        }
+        conn.setReadOnly(true);
+        assertTrue(conn.isReadOnly());
+        conn.setReadOnly(false);
+        assertFalse(conn.isReadOnly());
 
         conn.close();
         try {
@@ -643,17 +463,7 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#setReadOnly(boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Not supported. test fails",
-        method = "setReadOnly",
-        args = {boolean.class}
-    )
-    @KnownFailure("not supported")
+    // not supported
     public void testSetReadOnly() throws SQLException {
 
         // Pseudo test: not supported test
@@ -663,8 +473,6 @@
             st = conn.createStatement();
             st.execute("insert into zoo (id, name, family) values (3, 'ChiChiChi', 'monkey');");
            // fail("SQLException is not thrown");
-        } catch (SQLException sqle) {
-           fail("Set readonly is actually implemented: activate correct test");
         } finally {
             try {
                 st.close();
@@ -706,8 +514,6 @@
             conn.setReadOnly(false);
             st = conn.createStatement();
             st.execute("insert into zoo (id, name, family) values (4, 'ChiChiChi', 'monkey');");
-        } catch (SQLException sqle) {
-            fail("SQLException was thrown: " + sqle.getMessage());
         } finally {
             try {
                 st.close();
@@ -724,27 +530,10 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#getHoldability()
-     *
-     * TODO ResultSet.CLOSE_CURSORS_AT_COMMIT is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "+option ResultSet.CLOSE_CURSORS_AT_COMMIT not supported. SQLException test fails.",
-        method = "getHoldability",
-        args = {}
-    )
-    @KnownFailure("not supported")
+    // TODO ResultSet.CLOSE_CURSORS_AT_COMMIT is not supported
     public void testGetHoldability() throws SQLException {
-        try {
-            conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
-            assertEquals(ResultSet.HOLD_CURSORS_OVER_COMMIT, conn
-                    .getHoldability());
-        } catch (SQLException sqle) {
-            fail("SQLException was thrown: " + sqle.getMessage());
-        }
+        conn.setHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT);
+        assertEquals(ResultSet.HOLD_CURSORS_OVER_COMMIT, conn.getHoldability());
 
         try {
             conn.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
@@ -754,7 +543,7 @@
             assertEquals("not supported", e.getMessage());
         }
 
-       // Exception checking
+        // Exception checking
 
         conn.close();
 
@@ -766,19 +555,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Connection#setHoldability(int)
-     *
-     * TODO ResultSet.CLOSE_CURSORS_AT_COMMIT is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "ResultSet.CLOSE_CURSORS_AT_COMMIT is not supported",
-        method = "setHoldability",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
-    public void testSetHoldability() {
+    // TODO ResultSet.CLOSE_CURSORS_AT_COMMIT is not supported
+    public void testSetHoldability() throws SQLException {
         Statement st = null;
         try {
             conn.setAutoCommit(false);
@@ -801,13 +579,7 @@
             st.execute("insert into zoo (id, name, family) values (4, 'ChiChiChi', 'monkey');");
             rs = st.getResultSet();
             conn.commit();
-            try {
-                rs.next();
-            } catch (SQLException sqle) {
-                fail("SQLException was thrown: " + sqle.getMessage());
-            }
-        } catch (SQLException sqle) {
-            fail("SQLException was thrown: " + sqle.getMessage());
+            rs.next();
         } finally {
             try {
                 st.close();
@@ -823,40 +595,22 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#getTransactionIsolation()
-     *
-     * TODO only Connection.TRANSACTION_SERIALIZABLE is supported
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "SQLException testing throws exception. Connection.TRANSACTION_SERIALIZABLE.",
-        method = "getTransactionIsolation",
-        args = {}
-    )
-    @KnownFailure("not supported")
+    // TODO only Connection.TRANSACTION_SERIALIZABLE is supported
     public void testGetTransactionIsolation() throws SQLException {
-        try {
-            conn
-                    .setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
-            assertEquals(Connection.TRANSACTION_READ_UNCOMMITTED, conn
-                    .getTransactionIsolation());
-            conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
-            assertEquals(Connection.TRANSACTION_READ_COMMITTED, conn
-                    .getTransactionIsolation());
-            conn
-                    .setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
-           assertEquals(Connection.TRANSACTION_REPEATABLE_READ, conn
-                    .getTransactionIsolation());
-            conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
-            assertEquals(Connection.TRANSACTION_SERIALIZABLE, conn
-                    .getTransactionIsolation());
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
-        }
+        conn.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
+        assertEquals(Connection.TRANSACTION_READ_UNCOMMITTED, conn
+                .getTransactionIsolation());
+        conn.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
+        assertEquals(Connection.TRANSACTION_READ_COMMITTED, conn
+                .getTransactionIsolation());
+        conn.setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
+       assertEquals(Connection.TRANSACTION_REPEATABLE_READ, conn
+                .getTransactionIsolation());
+        conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+        assertEquals(Connection.TRANSACTION_SERIALIZABLE, conn
+                .getTransactionIsolation());
 
-       // Exception checking
+        // Exception checking
 
         conn.close();
 
@@ -868,18 +622,7 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#getTransactionIsolation()
-     *
-     * TODO only Connection.TRANSACTION_SERIALIZABLE is supported
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "not supported options",
-        method = "getTransactionIsolation",
-        args = {}
-    )
+    // TODO only Connection.TRANSACTION_SERIALIZABLE is supported
     public void testGetTransactionIsolationNotSupported() throws SQLException {
       /*
       try {
@@ -900,19 +643,8 @@
       */
     }
 
-    /**
-     * @test java.sql.Connection#setTransactionIsolation(int)
-     *
-     * TODO only Connection.TRANSACTION_SERIALIZABLE is supported
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not fully supported",
-        method = "setTransactionIsolation",
-        args = {int.class}
-    )
-    public void testSetTransactionIsolation() {
-        try {
+    // TODO only Connection.TRANSACTION_SERIALIZABLE is supported
+    public void testSetTransactionIsolation() throws SQLException {
 //            conn
 //                  .setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
 //            assertEquals(Connection.TRANSACTION_READ_UNCOMMITTED, conn
@@ -924,12 +656,8 @@
 //                    .setTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
 //            assertEquals(Connection.TRANSACTION_REPEATABLE_READ, conn
 //                    .getTransactionIsolation());
-            conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
-            assertEquals(Connection.TRANSACTION_SERIALIZABLE, conn
-                    .getTransactionIsolation());
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
-        }
+        conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+        assertEquals(Connection.TRANSACTION_SERIALIZABLE, conn.getTransactionIsolation());
 
         try {
             conn.setTransactionIsolation(0);
@@ -939,19 +667,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Connection#setCatalog(String catalog)
-     *
-     * TODO setCatalog method does nothing: Hint default catalog sqlite_master.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setCatalog",
-        args = {java.lang.String.class}
-    )
-    public void testSetCatalog() {
-
+    // TODO setCatalog method does nothing: Hint default catalog sqlite_master.
+    public void testSetCatalog() throws SQLException {
         String[] catalogs = { "test", "test1", "test" };
         Statement st = null;
         try {
@@ -964,8 +681,6 @@
                 st.equals("drop table test_table;");
 
             }
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 st.close();
@@ -1032,45 +747,19 @@
         */
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#getCatalog()
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported. test fails",
-        method = "getCatalog",
-        args = {}
-    )
-    @KnownFailure("not supported")
-     public void testGetCatalog() throws SQLException {
-
-
+    // not supported
+    public void testGetCatalog() throws SQLException {
         // test default catalog
-        try {
-            assertEquals("sqlite_master", conn.getCatalog());
-        } catch (SQLException sqle) {
-            fail("SQL Exception " + sqle.getMessage());
-        } catch (Exception e) {
-            fail("Unexpected Exception " + e.getMessage());
-        }
-
+        assertEquals("sqlite_master", conn.getCatalog());
 
         String[] catalogs = { "sqlite_test", "sqlite_test1", "sqlite_test" };
         Statement st = null;
-        try {
-            for (int i = 0; i < catalogs.length; i++) {
-                conn.setCatalog(catalogs[i]);
-                assertNull(conn.getCatalog());
-            }
-        } catch (SQLException sqle) {
-            fail("SQL Exception " + sqle.getMessage());
-        } catch (Exception e) {
-            fail("Reeimplement tests now that the method is implemented");
+        for (int i = 0; i < catalogs.length; i++) {
+            conn.setCatalog(catalogs[i]);
+            assertNull(conn.getCatalog());
         }
 
-       // Exception checking
+        // Exception checking
 
         conn.close();
 
@@ -1082,17 +771,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Connection#setTypeMap(Map<String,Class<?>> map)
-     *
-     * TODO setTypeMap is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setTypeMap",
-        args = {java.util.Map.class}
-    )
+    // TODO setTypeMap is not supported
     public void testSetTypeMap() {
         /*
         try {
@@ -1118,18 +797,7 @@
         */
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#getTypeMap()
-     *
-     * TODO getTypeMap is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getTypeMap",
-        args = {}
-    )
+    // TODO getTypeMap is not supported
     public void testGetTypeMap() throws SQLException {
         /*
         try {
@@ -1159,17 +827,7 @@
         */
     }
 
-    /**
-     * @test java.sql.Connection#nativeSQL(String sql)
-     *
-     * TODO nativeSQL is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "nativeSQL",
-        args = {java.lang.String.class}
-    )
+    // TODO nativeSQL is not supported
     public void testNativeSQL() throws SQLException{
         String[] queries = {
                 "select * from zoo;",
@@ -1192,8 +850,6 @@
             }
         } catch (SQLException sqle) {
             //ok
-        } catch (Exception e) {
-            fail("Unexpected Exception " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -1221,20 +877,9 @@
         } catch (SQLException e) {
             //ok
         }
-
     }
 
-    /**
-     * @test java.sql.Connection#prepareCall(String sql)
-     *
-     * TODO prepareCall is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "prepareCall",
-        args = {java.lang.String.class}
-    )
+    // TODO prepareCall is not supported
     public void testPrepareCall() throws SQLException {
         CallableStatement cstmt = null;
         ResultSet rs = null;
@@ -1252,7 +897,6 @@
             st1.execute("select * from zoo");
             rs1 = st1.getResultSet();
             assertEquals(3, getCount(rs1));
-
         } catch (SQLException e) {
             //ok not supported
         } finally {
@@ -1281,7 +925,7 @@
             // expected
         }
 
- // Exception checking
+        // Exception checking
 
         conn.close();
 
@@ -1294,18 +938,7 @@
 
     }
 
-    /**
-     * @test java.sql.Connection#prepareCall(String sql, int resultSetType, int
-     *       resultSetConcurrency)
-     *
-     * TODO prepareCall is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "prepareCall",
-        args = {java.lang.String.class, int.class, int.class}
-    )
+    // TODO prepareCall is not supported
     public void testPrepareCall_String_int_int() {
         CallableStatement cstmt = null;
         ResultSet rs = null;
@@ -1418,18 +1051,7 @@
         */
     }
 
-    /**
-     * @test java.sql.Connection#prepareCall(String sql, int resultSetType, int
-     *       resultSetConcurrency, int resultSetHoldability)
-     *
-     * TODO prepareCall is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "prepareCall",
-        args = {java.lang.String.class, int.class, int.class, int.class}
-    )
+    // TODO prepareCall is not supported
     public void testPrepareCall_String_int_int_int() {
         CallableStatement cstmt = null;
         ResultSet rs = null;
@@ -1498,16 +1120,7 @@
 
     }
 
-    /**
-     * @test java.sql.Connection#prepareStatement(String sql)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "prepareStatement",
-        args = {java.lang.String.class}
-    )
-       public void testPrepareStatement() {
+    public void testPrepareStatement() throws SQLException {
         PreparedStatement prst = null;
         Statement st = null;
         ResultSet rs = null;
@@ -1525,8 +1138,6 @@
             st.execute("select * from zoo where family = 'cat'");
             rs1 = st.getResultSet();
             assertEquals(1, getCount(rs1));
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -1551,24 +1162,10 @@
         } catch (Exception e) {
             //ok
         }
-
-
     }
 
-
-    /**
-     * @test { @link java.sql.Connection#prepareStatement(String sql, int
-     *       autoGeneratedKeys) }
-     */
-//  TODO Crashes VM. Fix later.
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Statment.Return_generated_keys/getGeneratedKeys is not supported",
-        method = "prepareStatement",
-        args = {java.lang.String.class, int.class}
-    )
-    @KnownFailure("not supported")
-    public void testPrepareStatement_String_int() {
+    // TODO Crashes VM. Fix later.
+    public void testPrepareStatement_String_int() throws SQLException {
         PreparedStatement prst = null;
         PreparedStatement prst1 = null;
         Statement st = null;
@@ -1587,7 +1184,6 @@
           //ok not supported
         }
 
-
         try {
             String insert = "insert into zoo (id, name, family) values (?, ?, ?);";
 
@@ -1608,8 +1204,6 @@
             rs4 = prst.getGeneratedKeys();
             assertEquals(0, getCount(rs4));
 
-
-
             prst1 = conn.prepareStatement(insert, Statement.RETURN_GENERATED_KEYS);
             prst1.setInt(1, 5);
             prst1.setString(2, "Layka");
@@ -1617,13 +1211,8 @@
 
             prst1.execute();
 
-
-
             rs5 = prst1.getGeneratedKeys();
             assertEquals(0, getCount(rs5));
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -1633,20 +1222,9 @@
             } catch (Exception ee) {
             }
         }
-
-
     }
 
-    /**
-     * @test java.sql.Connection#commit()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "commit",
-        args = {}
-    )
-    public void testCommit() {
+    public void testCommit() throws SQLException {
         Statement st = null;
         Statement st1 = null;
         Statement st2 = null;
@@ -1660,10 +1238,8 @@
             conn.setAutoCommit(false);
 
             st = conn.createStatement();
-            st
-                    .execute("insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');");
-            st
-                    .execute("insert into zoo (id, name, family) values (4, 'Orel', 'eagle');");
+            st.execute("insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');");
+            st.execute("insert into zoo (id, name, family) values (4, 'Orel', 'eagle');");
 
             st1 = conn.createStatement();
             st1.execute("select * from zoo");
@@ -1675,8 +1251,6 @@
                 st2.execute("select * from zoo");
                 rs2 = st2.getResultSet();
                 assertEquals(4, getCount(rs2));
-            } catch (SQLException e) {
-                fail("SQLException is thrown: " + e.toString());
             } finally {
                 try {
                     rs2.close();
@@ -1693,8 +1267,6 @@
                 rs3 = st3.getResultSet();
                 conn.commit();
                 assertEquals(4, getCount(rs3));
-            } catch (SQLException e) {
-                fail("SQLException is thrown: " + e.toString());
             } finally {
                 try {
                     if (rs3 != null) rs3.close();
@@ -1702,8 +1274,6 @@
                 } catch (SQLException ee) {
                 }
             }
-        } catch (SQLException sqle) {
-            fail("SQLException was thrown: " + sqle.toString());
         } finally {
             try {
                 rs1.close();
@@ -1712,20 +1282,8 @@
             } catch (Exception ee) {
             }
         }
-
-
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.Connection#rollback()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "rollback",
-        args = {}
-    )
     public void testRollback() throws SQLException {
         Statement st = null;
         Statement st1 = null;
@@ -1736,18 +1294,13 @@
         try {
             conn.setAutoCommit(false);
             st = conn.createStatement();
-            st
-                    .execute("insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');");
-            st
-                    .execute("insert into zoo (id, name, family) values (4, 'Orel', 'eagle');");
+            st.execute("insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');");
+            st.execute("insert into zoo (id, name, family) values (4, 'Orel', 'eagle');");
             conn.rollback();
             st1 = conn.createStatement();
             st1.execute("select * from zoo");
             rs1 = st1.getResultSet();
             assertEquals("Rollback was ineffective",2, getCount(rs1));
-
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
         } finally {
             conn.setAutoCommit(true);
             try {
@@ -1759,12 +1312,9 @@
         }
         try {
             conn.setAutoCommit(false);
-
             st = conn.createStatement();
-            st
-                    .execute("insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');");
-            st
-                    .execute("insert into zoo (id, name, family) values (4, 'Orel', 'eagle');");
+            st.execute("insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');");
+            st.execute("insert into zoo (id, name, family) values (4, 'Orel', 'eagle');");
 
             if (!conn.getAutoCommit()) {
                 st1 = conn.createStatement();
@@ -1785,8 +1335,6 @@
                     st3.execute("select * from zoo");
                     rs3 = st3.getResultSet();
                     assertEquals(4, getCount(rs3));
-                } catch (SQLException e) {
-                    fail("SQLException is thrown: " + e.toString());
                 } finally {
                     conn.setAutoCommit(true);
                     try {
@@ -1800,8 +1348,6 @@
             } else {
                 fail("Error in test setup: cannot turn autocommit off.");
             }
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
         } finally {
             try {
                 st.close();
@@ -1820,29 +1366,14 @@
         }
     }
 
-    /**
-     * @test java.sql.Connection#setSavepoint()
-     *
-     * TODO setSavepoint is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setSavepoint",
-        args = {}
-    )
-    public void testSetSavepoint() {
+    // TODO setSavepoint is not supported
+    public void testSetSavepoint() throws SQLException {
+        conn.setAutoCommit(false);
 
         try {
-            conn.setAutoCommit(false);
-
-                try {
-                    Savepoint sp = conn.setSavepoint();
-                } catch (SQLException e) {
-                    // ok not supported
-                }
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
+            Savepoint sp = conn.setSavepoint();
+        } catch (SQLException e) {
+            // ok not supported
         }
 
 
@@ -1959,31 +1490,15 @@
         */
     }
 
-    /**
-     * @test java.sql.Connection#setSavepoint(String name)
-     *
-     * TODO setSavepoint is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setSavepoint",
-        args = {java.lang.String.class}
-    )
-    public void testSetSavepoint_String() {
-
+    // TODO setSavepoint is not supported
+    public void testSetSavepoint_String() throws SQLException {
         String testSavepoint = "testSavepoint";
+        conn.setAutoCommit(false);
 
         try {
-            conn.setAutoCommit(false);
-
-                try {
-                    Savepoint sp = conn.setSavepoint(testSavepoint);
-                } catch (SQLException e) {
-                    // ok not supported
-                }
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
+            Savepoint sp = conn.setSavepoint(testSavepoint);
+        } catch (SQLException e) {
+            // ok not supported
         }
 
     /*
@@ -2097,29 +1612,15 @@
         */
     }
 
-    /**
-     * @test java.sql.Connection#rollback(Savepoint savepoint)
-     *
-     * TODO Savepoint is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "rollback",
-        args = {java.sql.Savepoint.class}
-    )
-    public void testRollback_Savepoint() {
+    // TODO Savepoint is not supported
+    public void testRollback_Savepoint() throws SQLException {
         Savepoint sp = new DummySavePoint();
-        try {
-            conn.setAutoCommit(false);
+        conn.setAutoCommit(false);
 
-                try {
-                    conn.rollback(sp);
-                } catch (SQLException e) {
-                    //ok
-                }
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
+        try {
+            conn.rollback(sp);
+        } catch (SQLException e) {
+            //ok
         }
         /*
         Statement st = null;
@@ -2232,29 +1733,15 @@
         */
     }
 
-    /**
-     * @test java.sql.Connection#releaseSavepoint(Savepoint savepoint)
-     *
-     * TODO Savepoint is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "releaseSavepoint",
-        args = {java.sql.Savepoint.class}
-    )
-    public void testReleaseSavepoint_Savepoint() {
+    // TODO Savepoint is not supported
+    public void testReleaseSavepoint_Savepoint() throws SQLException {
         Savepoint sp = new DummySavePoint();
-        try {
-            conn.setAutoCommit(false);
+        conn.setAutoCommit(false);
 
-                try {
-                    conn.releaseSavepoint(sp);
-                } catch (SQLException e) {
-                    //ok
-                }
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
+        try {
+            conn.releaseSavepoint(sp);
+        } catch (SQLException e) {
+            //ok
         }
         /*
 
@@ -2364,19 +1851,7 @@
         */
     }
 
-    /**
-     * @test java.sql.Connection#prepareStatement(String sql, int[]
-     *       columnIndexes)
-     *
-     * TODO prepareStatement(String sql, int[] columnIndexes) is not
-     * supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "prepareStatement",
-        args = {java.lang.String.class, int[].class}
-    )
+    // TODO prepareStatement(String sql, int[] columnIndexes) is not supported
     public void testPrepareStatement_String_intArray() {
         PreparedStatement prst = null;
         try {
@@ -2459,17 +1934,7 @@
         */
     }
 
-    /**
-     * @test java.sql.Connection#prepareStatement(String sql, int resultSetType,
-     *       int resultSetConcurrency)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "not fully supported",
-        method = "prepareStatement",
-        args = {java.lang.String.class, int.class, int.class}
-    )
-    public void testPrepareStatement_String_int_int() {
+    public void testPrepareStatement_String_int_int() throws SQLException {
         String query = "insert into zoo (id, name, family) values (?, ?, ?);";
         PreparedStatement st = null;
         ResultSet rs = null;
@@ -2485,9 +1950,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             try {
                 if (rs != null) rs.close();
@@ -2510,9 +1972,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
         } finally {
             try {
                 rs.close();
@@ -2535,15 +1994,8 @@
         }
     }
 
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "not supported options: ResultSet.TYPE_SCROLL_INSENSITIVE," +
-                    "ResultSet.CONCUR_UPDATABLE",
-            method = "prepareStatement",
-            args = {java.lang.String.class, int.class, int.class}
-        )
-    @KnownFailure("not supported")
-    public void testPrepareStatementNotSupported() {
+    // not supported
+    public void testPrepareStatementNotSupported() throws SQLException {
         String query = "insert into zoo (id, name, family) values (?, ?, ?);";
         PreparedStatement st = null;
         ResultSet rs = null;
@@ -2553,18 +2005,11 @@
                     ResultSet.CONCUR_UPDATABLE);
             st.execute("select name, family from zoo");
             rs = st.getResultSet();
-            try {
-                rs.insertRow();
-                rs.updateObject("family", "bird");
-                rs.next();
-                rs.previous();
-                assertEquals("parrot", (rs.getString(1)));
-            } catch (SQLException sqle) {
-                fail("Got Exception "+sqle.getMessage());
-            }
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
+            rs.insertRow();
+            rs.updateObject("family", "bird");
+            rs.next();
+            rs.previous();
+            assertEquals("parrot", (rs.getString(1)));
         } finally {
             try {
                 if (rs != null) rs.close();
@@ -2572,23 +2017,10 @@
             } catch (SQLException ee) {
             }
         }
-
     }
 
-
-
-    /**
-     * @test java.sql.Connection#prepareStatement(String sql, int resultSetType,
-     *       int resultSetConcurrency, int resultSetHoldability)
-     */
     //  TODO Crashes VM. Fix later.
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Not fully implemented: ResultSet.CLOSE_CURSORS_AT_COMMIT not supported",
-        method = "prepareStatement",
-        args = {java.lang.String.class, int.class, int.class, int.class}
-    )
-    public void testPrepareStatement_String_int_int_int() {
+    public void testPrepareStatement_String_int_int_int() throws SQLException {
         String query = "insert into zoo (id, name, family) values (?, ?, ?);";
         PreparedStatement st = null;
         ResultSet rs = null;
@@ -2601,13 +2033,7 @@
             st.setString(3, "Cock");
             st.execute("select id, name from zoo");
             rs = st.getResultSet();
-            try {
-                rs.close();
-            } catch (SQLException sqle) {
-                fail("Unexpected exception was thrown during closing ResultSet");
-            }
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
+            rs.close();
         } finally {
             try {
                 if (rs != null) rs.close();
@@ -2650,19 +2076,7 @@
 
     }
 
-    /**
-     * @test java.sql.Connection#prepareStatement(String sql, String[]
-     *       columnNames)
-     *
-     * TODO prepareStatement(String sql, String[] columnNames) method is
-     * not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "prepareStatement",
-        args = {java.lang.String.class, java.lang.String[].class}
-    )
+    // TODO prepareStatement(String sql, String[] columnNames) method is not supported
     public void testPrepareStatement_String_StringArray() {
         PreparedStatement prst = null;
         PreparedStatement prst1 = null;
@@ -2742,44 +2156,21 @@
 
     }
 
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported: it should release all resources but it doesn't",
-        method = "close",
-        args = {}
-    )
-    public void testClose() {
-        try {
-
-
-
-            if (! conn.isClosed()) {
-            conn.close();
-            }
-            assertTrue(conn.isClosed());
-
-            try {
-            conn.prepareCall("select * from zoo");
-            fail("Should not be able to prepare query closed connection");
-            } catch (SQLException e) {
-                //ok
-            }
-        } catch (SQLException e) {
-            fail("Error in implementation");
-            e.printStackTrace();
+    public void testClose() throws SQLException {
+        if (! conn.isClosed()) {
+        conn.close();
         }
+        assertTrue(conn.isClosed());
 
+        try {
+        conn.prepareCall("select * from zoo");
+        fail("Should not be able to prepare query closed connection");
+        } catch (SQLException e) {
+            //ok
+        }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "isClosed",
-        args = {}
-    )
     public void testIsClosed() throws Exception {
-
         assertFalse(conn.isClosed());
         conn.close();
         assertTrue(conn.isClosed());
@@ -2790,18 +2181,13 @@
         st.execute("select * from zoo");
     }
 
-
     private static class DummySavePoint implements Savepoint{
-
         public int getSavepointId()  {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public String getSavepointName() {
-            // TODO Auto-generated method stub
             return "NoName";
         }
-
     }
 }
diff --git a/luni/src/test/java/libcore/java/sql/OldDriverPropertyInfoTest.java b/luni/src/test/java/libcore/java/sql/OldDriverPropertyInfoTest.java
index 7f7cc66..6ff9fd5 100644
--- a/luni/src/test/java/libcore/java/sql/OldDriverPropertyInfoTest.java
+++ b/luni/src/test/java/libcore/java/sql/OldDriverPropertyInfoTest.java
@@ -23,7 +23,7 @@
 import java.util.Properties;
 import junit.framework.TestCase;
 
-public class OldDriverPropertyInfoTest extends TestCase {
+public final class OldDriverPropertyInfoTest extends TestCase {
 
     static final String validName = "testname";
     static final String validValue = "testvalue";
diff --git a/luni/src/test/java/tests/sql/PreparedStatementTest.java b/luni/src/test/java/libcore/java/sql/OldPreparedStatementTest.java
similarity index 65%
rename from luni/src/test/java/tests/sql/PreparedStatementTest.java
rename to luni/src/test/java/libcore/java/sql/OldPreparedStatementTest.java
index f69e374..8fd8665 100755
--- a/luni/src/test/java/tests/sql/PreparedStatementTest.java
+++ b/luni/src/test/java/libcore/java/sql/OldPreparedStatementTest.java
@@ -14,15 +14,8 @@
  * limitations under the License.
  */
 
-package tests.sql;
+package libcore.java.sql;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
@@ -34,7 +27,6 @@
 import java.sql.Blob;
 import java.sql.Clob;
 import java.sql.Date;
-import java.sql.ParameterMetaData;
 import java.sql.PreparedStatement;
 import java.sql.Ref;
 import java.sql.ResultSet;
@@ -44,15 +36,13 @@
 import java.sql.Time;
 import java.sql.Timestamp;
 import java.sql.Types;
-import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.GregorianCalendar;
 import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
 
-@TestTargetClass(PreparedStatement.class)
-public class PreparedStatementTest extends SQLTest {
+public final class OldPreparedStatementTest extends OldSQLTest {
 
     String queryAllSelect = "select * from type";
 
@@ -97,8 +87,6 @@
             for (int i = 0; i < queries.length; i++) {
                 st.execute(queries[i]);
             }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.toString());
         } finally {
             try {
                 st.close();
@@ -107,13 +95,11 @@
         }
     }
 
-    public void tearDown() {
+    public void tearDown() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
             st.execute("drop table if exists type");
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 st.close();
@@ -123,15 +109,6 @@
         super.tearDown();
     }
 
-    /**
-     * @test java.sql.PreparedStatement#addBatch()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addBatch",
-        args = {}
-    )
     public void testAddBatch() throws SQLException {
         PreparedStatement ps = null;
         try {
@@ -160,8 +137,6 @@
                 } catch (SQLException ee) {
                 }
             }
-        } catch (SQLException e) {
-            fail("SQLException is thrown "+e.getMessage());
         } finally {
             try {
                 ps.close();
@@ -197,17 +172,8 @@
     }
 
 
-    /**
-     * @test java.sql.PreparedStatement#execute()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "execute",
-        args = {}
-    )
-    @KnownFailure("preparedStatement.execute() does not return false on update.")
-    public void testExecute() {
+    // preparedStatement.execute() does not return false on update.
+    public void testExecute() throws SQLException {
         Statement st = null;
         PreparedStatement ps = null;
         try {
@@ -223,8 +189,6 @@
             ps = conn.prepareStatement("select * from zoo");
             assertTrue(ps.execute());
             assertEquals(3, getCount(ps.getResultSet()));
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 ps.close();
@@ -244,8 +208,6 @@
             ResultSet rs = st.getResultSet();
             rs.next();
             assertEquals("cat", rs.getString(1));
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 ps.close();
@@ -260,8 +222,6 @@
             ps = conn.prepareStatement(query);
             assertFalse(ps.execute());
             assertTrue(ps.getUpdateCount() > 0);
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 ps.close();
@@ -274,8 +234,6 @@
             ps = conn.prepareStatement(query);
             ps.setInt(1, 1);
             assertTrue(ps.execute());
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 ps.close();
@@ -287,8 +245,6 @@
             String query = "select name, family from zoo where id = ?";
             ps = conn.prepareStatement(query);
             ps.execute();
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 ps.close();
@@ -312,18 +268,7 @@
         }
     }
 
-
-    /**
-     * @test java.sql.PreparedStatement#executeQuery()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "executeQuery",
-        args = {}
-    )
-      public void testExecuteQuery() {
-
+    public void testExecuteQuery() throws SQLException {
         String[] queries2 = {
                 "update zoo set name='Masha', family='cat' where id=;",
                 "insert into hutch (id, animal_id, address) values (1, ?,'Birds-house, 1');",
@@ -356,8 +301,6 @@
             assertEquals(1, rs.getInt(1));
             assertEquals("Kesha", rs.getString(2));
             assertEquals("parrot", rs.getString(3));
-        } catch (SQLException e) {
-            fail("SQLException is thrown for query");
         } finally {
             try {
                 ps.close();
@@ -371,8 +314,6 @@
             ResultSet rs = ps.executeQuery();
             assertNotNull(rs);
             assertFalse(rs.next());
-        } catch (SQLException e) {
-            fail("SQLException is thrown for query");
         } finally {
             try {
                 ps.close();
@@ -381,17 +322,8 @@
         }
     }
 
-     // TODO Crashes VM. Fix later.
-    /**
-     * @test {@link java.sql.PreparedStatement#executeUpdate()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "executeUpdate",
-        args = {}
-    )
-      public void testExecuteUpdate() {
+    // TODO Crashes VM. Fix later.
+    public void testExecuteUpdate() throws SQLException {
           String[] queries1 = { "insert into hutch (id, animal_id, address) values (1, ?, 'Birds-house, 1');",
                               "insert into hutch (id, animal_id, address) values (?, 1, 'Horse-house, 5');",
                               "create view address as select address from hutch where animal_id=2" };
@@ -421,8 +353,6 @@
               ps.setInt(1, 1);
               int updateCount1 = ps.executeUpdate();
               assertEquals(1, updateCount1);
-          } catch (SQLException e) {
-              fail("SQLException is thrown for query");
           } finally {
               try {
                   ps.close();
@@ -431,23 +361,10 @@
       }
 
     /**
-     * @test java.sql.PreparedStatement#getMetaData()
-     *
-     *  Test Fails:
-     * TODO Doesn't pass. according to Java docs:
-     * it is possible to invoke the method getMetaData on a
-     * PreparedStatement object before it is executed.
+     * TODO Doesn't pass. according to spec, it is possible to invoke the
+     * method getMetaData on a PreparedStatement object before it is executed.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMetaData",
-        args = {}
-    )
-    @KnownFailure("it is not possible to invoke the method getMetaData on a " +
-                  "PreparedStatement object before it is executed: got NullPointerException."+
-                  "Test passes on RI.")
-    public void testGetMetaData() {
+    public void testGetMetaData() throws SQLException {
         PreparedStatement ps = null;
 
         // Specification testing
@@ -458,12 +375,6 @@
             assertNotNull(ps);
             ResultSetMetaData meta = ps.getMetaData();
             assertNotNull(meta);
-        } catch (SQLException sqle) {
-            fail("SQLException is thrown: " + sqle.toString());
-            sqle.printStackTrace();
-        } catch (Exception e) {
-            fail("Unspecified Exception: " + e.toString());
-            e.printStackTrace();
         } finally {
             try {
                 ps.close();
@@ -478,8 +389,6 @@
             assertNotNull(rsmd);
             assertEquals(3, rsmd.getColumnCount());
             assertEquals("id", rsmd.getColumnName(1));
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 ps.close();
@@ -496,23 +405,14 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.PreparedStatement#getParameterMetaData()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getParameterMetaData",
-        args = {}
-    )
     public void testGetParameterMetaData() throws SQLException {
         PreparedStatement ps = null;
         String query = "select * from zoo where id = ?";
         ps = conn.prepareStatement(query);
 
         try {
-            ParameterMetaData rsmd = ps.getParameterMetaData();
+            ps.getParameterMetaData();
+            fail();
         } catch (SQLException e) {
             assertEquals("not supported",e.getMessage());
         } finally {
@@ -534,17 +434,9 @@
 
 
     /**
-     * @test java.sql.PreparedStatement#clearParameters()
      * Test fails: clearparameters should be implemented with Stmt.reset()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Test fails: clearparameters should be implemented with Stmt.reset()",
-        method = "clearParameters",
-        args = {}
-    )
-    @KnownFailure("First Exception test fails: parameters not cleared.")
-     public void testClearParameters() {
+    public void testClearParameters() throws SQLException {
         PreparedStatement ps = null;
         try {
             String query = "select * from zoo where id = ? and family=?";
@@ -554,7 +446,6 @@
                 ps.execute();
                 fail("SQLException is not thrown during execute method after calling clearParameters()");
             } catch (SQLException sql) {
-
             }
             ps.setInt(1, 2);
             ps.setString(2, "dog");
@@ -581,27 +472,15 @@
             } catch (SQLException sqle) {
                 fail("SQLException is thrown during execute method after calling clearParameters() twice");
             }
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 ps.close();
             } catch (SQLException ee) {
             }
         }
-
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setInt(int parameterIndex, int x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setInt",
-        args = {int.class, int.class}
-    )
-    @KnownFailure("exception test fails")
+    // exception test fails
     public void testSetInt() throws SQLException {
 
         PreparedStatement ps = null;
@@ -617,8 +496,6 @@
                         + Integer.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     ps.close();
@@ -635,8 +512,6 @@
                         + Integer.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     ps.close();
@@ -652,9 +527,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
 
@@ -664,17 +536,8 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setLong(int parameterIndex, long x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setLong",
-        args = {int.class, long.class}
-    )
-    @KnownFailure("exception test fails")
-    public void testSetLong() {
+    // exception test fails
+    public void testSetLong() throws SQLException {
 
         PreparedStatement ps = null;
         try {
@@ -685,13 +548,9 @@
                 ps.setLong(1, Long.MAX_VALUE);
                 ps.execute();
                 st = conn.createStatement();
-                st
-                        .execute("select * from type where LongVal="
-                                + Long.MAX_VALUE);
+                st.execute("select * from type where LongVal=" + Long.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -703,13 +562,9 @@
                 ps.setLong(1, Long.MIN_VALUE);
                 ps.execute();
                 st = conn.createStatement();
-                st
-                        .execute("select * from type where LongVal="
-                                + Long.MAX_VALUE);
+                st.execute("select * from type where LongVal=" + Long.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -724,12 +579,8 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (SQLException ee) {
             }
@@ -737,17 +588,7 @@
 
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.PreparedStatement#setFloat(int parameterIndex, float x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setFloat",
-        args = {int.class, float.class}
-    )
-    @KnownFailure("exception test fails")
+    // exception test fails
     public void testSetFloat() throws SQLException {
         float value1 = 12345678.12345689f;
         float value2 = -12345678.12345689f;
@@ -766,8 +607,6 @@
                 st.execute("select * from type where FloatVal=" + value1);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -782,8 +621,6 @@
                 st.execute("select * from type where FloatVal=" + value2);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -798,9 +635,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
 
@@ -810,19 +644,8 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.PreparedStatement#setDouble(int parameterIndex, double x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDouble",
-        args = {int.class, double.class}
-    )
-    @KnownFailure("exception test fails")
+    // exception test fails
     public void testSetDouble() throws SQLException {
-
         PreparedStatement ps = null;
         String query = "insert into type (DoubleVal) values (?);";
         ps = conn.prepareStatement(query);
@@ -838,8 +661,6 @@
                         + Double.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -855,8 +676,6 @@
                         + Double.MIN_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -871,9 +690,6 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
 
@@ -881,23 +697,11 @@
             } catch (SQLException ee) {
             }
         }
-
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setString(int parameterIndex, String x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setString",
-        args = {int.class, java.lang.String.class}
-    )
-    @KnownFailure("exception test fails")
-    public void testSetString_charField() {
-
+    // exception test fails
+    public void testSetString_charField() throws SQLException {
         PreparedStatement ps = null;
-
         try {
             String query = "insert into type (charStr) values (?);";
             ps = conn.prepareStatement(query);
@@ -911,8 +715,6 @@
                 st.execute("select * from type where charStr='" + str + "'");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -927,8 +729,6 @@
                 st.execute("select * from type where charStr=''");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -940,12 +740,9 @@
                 ps.setString(1, "                   ");
                 ps.execute();
                 st = conn.createStatement();
-                st
-                        .execute("select * from type where charStr='                   '");
+                st.execute("select * from type where charStr='                   '");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -953,20 +750,10 @@
                 }
             }
 
-            try {
-                ps.setString(1, " test & text * test % text * test ^ text ");
-                ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown");
-            }
-
-            try {
-                ps.setString(1, null);
-                ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-
+            ps.setString(1, " test & text * test % text * test ^ text ");
+            ps.execute();
+            ps.setString(1, null);
+            ps.execute();
             ps.close();
 
             try {
@@ -975,30 +762,16 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (SQLException ee) {
             }
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setString(int parameterIndex, String x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setString",
-        args = {int.class, java.lang.String.class}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testSetString_tinyTextField() {
-
+    // statment.close() does not wrap up
+    public void testSetString_tinyTextField() throws SQLException {
         PreparedStatement ps = null;
         try {
             String str = "test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test";
@@ -1012,8 +785,6 @@
                 st.execute("select * from type where TText='" + str + "'");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1028,8 +799,6 @@
                 st.execute("select * from type where TText=''");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1041,12 +810,9 @@
                 ps.setString(1, "                   ");
                 ps.execute();
                 st = conn.createStatement();
-                st
-                        .execute("select * from type where TText='                   '");
+                st.execute("select * from type where TText='                   '");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1055,9 +821,8 @@
             }
 
             try {
-                ps.setString(
-                                1,
-                                "test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test*test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test-test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test+test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test?test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test#test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test ");
+                ps.setString(1,
+                        "test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test*test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test-test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test+test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test?test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test#test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test ");
                 ps.execute();
             } catch (SQLException sqle) {
                 fail("SQLException is thrown");
@@ -1078,30 +843,15 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (SQLException ee) {
             }
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setString(int parameterIndex, String x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setString",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetString_textField() {
-
+    public void testSetString_textField() throws SQLException {
         PreparedStatement ps = null;
         try {
             String str = "test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test";
@@ -1115,8 +865,6 @@
                 st.execute("select * from type where TextVal='" + str + "'");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1131,8 +879,6 @@
                 st.execute("select * from type where TextVal=''");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1144,12 +890,9 @@
                 ps.setString(1, "                   ");
                 ps.execute();
                 st = conn.createStatement();
-                st
-                        .execute("select * from type where TextVal='                   '");
+                st.execute("select * from type where TextVal='                   '");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1157,25 +900,15 @@
                 }
             }
 
-
-            try {
-                String longString = " test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/";
-                for (int i = 0; i < 10; i++) {
-                    longString += longString;
-                }
-                ps.setString(1, longString);
-                ps.execute();
-
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown");
+            String longString = " test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/";
+            for (int i = 0; i < 10; i++) {
+                longString += longString;
             }
+            ps.setString(1, longString);
+            ps.execute();
 
-            try {
-                ps.setString(1, null);
-                ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
+            ps.setString(1, null);
+            ps.execute();
 
             ps.close();
 
@@ -1185,28 +918,15 @@
             } catch (SQLException sqle) {
                 // expected
             }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (SQLException ee) {
             }
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setString(int parameterIndex, String x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setString",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetString_mediumTextField() {
-
+    public void testSetString_mediumTextField() throws SQLException {
         PreparedStatement ps = null;
         try {
             String str = "test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test";
@@ -1220,8 +940,6 @@
                 st.execute("select * from type where MText='" + str + "'");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1236,8 +954,6 @@
                 st.execute("select * from type where MText=''");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1253,8 +969,6 @@
                         .execute("select * from type where MText='                   '");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1262,13 +976,8 @@
                 }
             }
 
-            try {
-                ps.setString(1, null);
-                ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-
+            ps.setString(1, null);
+            ps.execute();
             ps.close();
 
             try {
@@ -1277,32 +986,16 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (Exception ee) {
             }
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setString(int parameterIndex, String x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setString",
-        args = {int.class, java.lang.String.class}
-    )
-    @KnownFailure("exception test fails")
-    public void testSetString_longTextField() {
-
+    // exception test fails
+    public void testSetString_longTextField() throws SQLException {
         PreparedStatement ps = null;
         try {
             String str = "test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test/test^text$test%test(text)test@text5test~test^text$test%test(text)test@text5test";
@@ -1316,8 +1009,6 @@
                 st.execute("select * from type where LText='" + str + "'");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1332,8 +1023,6 @@
                 st.execute("select * from type where LText=''");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1345,12 +1034,9 @@
                 ps.setString(1, "                   ");
                 ps.execute();
                 st = conn.createStatement();
-                st
-                        .execute("select * from type where LText='                   '");
+                st.execute("select * from type where LText='                   '");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1358,13 +1044,8 @@
                 }
             }
 
-            try {
-                ps.setString(1, null);
-                ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-
+            ps.setString(1, null);
+            ps.execute();
             ps.close();
 
             try {
@@ -1373,31 +1054,16 @@
             } catch (SQLException sqle) {
                 // expected
             }
-
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (Exception ee) {
             }
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setShort(int parameterIndex, short x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setShort",
-        args = {int.class, short.class}
-    )
-    @KnownFailure("exception test fails")
-    public void testSetShort() {
-
+    // exception test fails
+    public void testSetShort() throws SQLException {
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         PreparedStatement ps2 = null;
@@ -1412,8 +1078,6 @@
                 st.execute("select * from type where Sint=" + Short.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1428,8 +1092,6 @@
                 st.execute("select * from type where Sint=" + Short.MIN_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1448,28 +1110,16 @@
 
             String query1 = "insert into type (Tint) values (?);";
             ps1 = conn.prepareStatement(query1);
-            try {
-                ps1.setShort(1, Short.MAX_VALUE);
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: "+sqle.getMessage());
-            }
+            ps1.setShort(1, Short.MAX_VALUE);
 
             String query2 = "insert into type (IntVal) values (?);";
             ps2 = conn.prepareStatement(query2);
-            try {
-                ps2.setShort(1, Short.MAX_VALUE);
-                ps2.execute();
-                st = conn.createStatement();
-                st
-                        .execute("select * from type where IntVal="
-                                + Short.MAX_VALUE);
-                ResultSet rs = st.getResultSet();
-                assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps2.setShort(1, Short.MAX_VALUE);
+            ps2.execute();
+            st = conn.createStatement();
+            st.execute("select * from type where IntVal=" + Short.MAX_VALUE);
+            ResultSet rs = st.getResultSet();
+            assertEquals(1, getCount(rs));
         } finally {
             try {
 
@@ -1481,19 +1131,8 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setBoolean(int parameterIndex, boolean
-     *       x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setBoolean",
-        args = {int.class, boolean.class}
-    )
-    @KnownFailure("exception test fails")
-    public void testSetBoolean() {
-
+    // exception test fails
+    public void testSetBoolean() throws SQLException {
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -1507,8 +1146,6 @@
                 st.execute("select * from type where BoolVal = 0");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1523,8 +1160,6 @@
                 st.execute("select * from type where BoolVal= 1");
                 ResultSet rs = st.getResultSet();
                 assertEquals(2, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1543,15 +1178,8 @@
 
             String query1 = "insert into type (Tint) values (?);";
             ps1 = conn.prepareStatement(query1);
-            try {
-                ps1.setBoolean(1, true);
-                ps1.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setBoolean(1, true);
+            ps1.execute();
         } finally {
             try {
 
@@ -1562,18 +1190,8 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setByte(int parameterIndex, byte x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setByte",
-        args = {int.class, byte.class}
-    )
-    @KnownFailure("exception test fails")
-    public void testSetByte() {
-
+    // exception test fails
+    public void testSetByte() throws SQLException {
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -1587,8 +1205,6 @@
                 st.execute("select * from type where Tint=" + Byte.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1603,8 +1219,6 @@
                 st.execute("select * from type where Tint=" + Byte.MIN_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -1630,15 +1244,8 @@
 
             String query1 = "insert into type (IntVal) values (?);";
             ps1 = conn.prepareStatement(query1);
-            try {
-                ps1.setByte(1, Byte.MAX_VALUE);
-                ps1.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setByte(1, Byte.MAX_VALUE);
+            ps1.execute();
         } finally {
             try {
 
@@ -1649,20 +1256,9 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setBytes(int parameterIndex, byte[] x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setBytes",
-        args = {int.class, byte[].class}
-    )
-    @KnownFailure("preparedStatement.execute() does not return false on update.")
-    public void testSetBytes() {
-
+    // preparedStatement.execute() does not return false on update.
+    public void testSetBytes() throws SQLException {
         byte[] bytesArray = {1, 0};
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -1695,16 +1291,9 @@
             String query1 = "insert into type (TBlob) values (?);";
             ps1 = conn.prepareStatement(query1);
 
-            try {
-                ps.setBytes(1, bytesArray);
-                assertFalse(ps.execute());
-                assertTrue(ps.getUpdateCount() > 0);
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps.setBytes(1, bytesArray);
+            assertFalse(ps.execute());
+            assertTrue(ps.getUpdateCount() > 0);
         } finally {
             try {
 
@@ -1715,35 +1304,18 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setBigDecimal(int parameterIndex,
-     *       BigDecimal x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setBigDecimal",
-        args = {int.class, java.math.BigDecimal.class}
-    )
-    @KnownFailure("preparedStatement.execute() does not return false on update.")
-    public void testSetBigDecimal() {
-
+    // preparedStatement.execute() does not return false on update.
+    public void testSetBigDecimal() throws SQLException {
         BigDecimal bd = new BigDecimal("50");
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
             String query = "insert into type (DecVal) values (?);";
             ps = conn.prepareStatement(query);
             Statement st = null;
-            try {
-                ps.setBigDecimal(1, bd);
-                assertFalse(ps.execute());
-                assertTrue(ps.getUpdateCount() > 0);
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
-
+            ps.setBigDecimal(1, bd);
+            assertFalse(ps.execute());
+            assertTrue(ps.getUpdateCount() > 0);
 
             try {
                 ps.setBigDecimal(2, bd);
@@ -1763,16 +1335,9 @@
             String query1 = "insert into type (Tint) values (?);";
             ps1 = conn.prepareStatement(query1);
 
-            try {
-                ps1.setBigDecimal(1, bd);
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown");
-            }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setBigDecimal(1, bd);
         } finally {
             try {
-
                 if (ps != null) ps.close();
                 if (ps1 != null) ps1.close();
             } catch (SQLException ee) {
@@ -1781,25 +1346,15 @@
     }
 
     /**
-     * @test java.sql.PreparedStatement#setDate(int parameterIndex, Date x)
+     * preparedStatement.execute() does not return false on update. Setting a
+     * data for a declared INTEGER should throw Exception
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "First exception test fails: integer and date are incompatible"
-               +" by spec.",
-        method = "setDate",
-        args = {int.class, java.sql.Date.class}
-    )
-    @KnownFailure("preparedStatement.execute() does not return false on update. "+
-            "Setting a data for a declared INTEGER should throw Exception")
-    public void testSetDate_int_Date() {
+    public void testSetDate_int_Date() throws SQLException {
         Calendar cal = new GregorianCalendar(1799, 5, 26);
-
         Date[] dates = {
                 new Date(cal.getTimeInMillis()), new Date(Integer.MAX_VALUE),
                 new Date(123456789)};
 
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -1807,13 +1362,9 @@
             ps = conn.prepareStatement(query);
 
             for (int i = 0; i < dates.length; i++) {
-                try {
-                    ps.setDate(1, dates[i]);
-                    assertFalse(ps.execute());
-                    assertTrue(ps.getUpdateCount() > 0);
-                } catch (SQLException sqle) {
-                    fail("SQLException is thrown: " + sqle.getMessage());
-                }
+                ps.setDate(1, dates[i]);
+                assertFalse(ps.execute());
+                assertTrue(ps.getUpdateCount() > 0);
             }
 
             try {
@@ -1843,11 +1394,8 @@
                 assertEquals("SQLite.Exception: error in prepare", sqle
                         .getMessage());
             }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 if (ps != null) ps.close();
                 if (ps1 != null) ps1.close();
             } catch (SQLException ee) {
@@ -1855,19 +1403,8 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setDate(int parameterIndex, Date x,
-     *       Calendar cal)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDate",
-        args = {int.class, java.sql.Date.class, java.util.Calendar.class}
-    )
-    @KnownFailure("preparedStatement.execute() does not return false on update.")
-    public void testSetDate_int_Date_Calendar() {
-
+    // preparedStatement.execute() does not return false on update.
+    public void testSetDate_int_Date_Calendar() throws SQLException {
         Calendar[] cals = { Calendar.getInstance(),
                 Calendar.getInstance(Locale.GERMANY),
                 Calendar.getInstance(TimeZone.getDefault()) };
@@ -1876,7 +1413,6 @@
         Date[] dates = { new Date(cal.getTimeInMillis()), new Date(Integer.MAX_VALUE),
                 new Date(123456789) };
 
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -1884,14 +1420,9 @@
             ps = conn.prepareStatement(query);
 
             for (int i = 0; i < dates.length; i++) {
-
-                try {
-                    ps.setDate(1, dates[i], cals[i]);
-                    assertFalse(ps.execute());
-                    assertTrue(ps.getUpdateCount() > 0);
-                } catch (SQLException sqle) {
-                    fail("SQLException is thrown: " + sqle.getMessage());
-                }
+                ps.setDate(1, dates[i], cals[i]);
+                assertFalse(ps.execute());
+                assertTrue(ps.getUpdateCount() > 0);
             }
 
             try {
@@ -1913,18 +1444,10 @@
             String query1 = "insert into type (Tint) values (?);";
             ps1 = conn.prepareStatement(query1);
 
-            try {
-                ps1.setDate(1, dates[0], cals[2]);
-                ps1.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown");
-            }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setDate(1, dates[0], cals[2]);
+            ps1.execute();
         } finally {
             try {
-
                 if (ps != null) ps.close();
                 if (ps1 != null) ps1.close();
             } catch (SQLException ee) {
@@ -1933,18 +1456,9 @@
     }
 
     /**
-     * @test java.sql.PreparedStatement#setNull(int parameterIndex, int sqlType)
-     *
-     * this test doesn't passed on RI
+     * This test doesn't pass on RI
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setNull",
-        args = {int.class, int.class}
-    )
-    public void testSetNull_int_int() {
-
+    public void testSetNull_int_int() throws SQLException {
         PreparedStatement ps = null;
         try {
             String query = "insert into type (BoolVal, IntVal) values ('true', ?);";
@@ -1953,8 +1467,6 @@
             try {
                 ps.setNull(1, Types.INTEGER);
                 ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     ps.close();
@@ -1968,8 +1480,6 @@
             try {
                 ps.setNull(1, Types.BIGINT);
                 ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     ps.close();
@@ -1983,8 +1493,6 @@
             try {
                 ps.setNull(1, Types.DECIMAL);
                 ps.execute();
-             } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     ps.close();
@@ -1998,8 +1506,6 @@
             try {
                 ps.setNull(1, Types.DATE);
                 ps.execute();
-            } catch (SQLException sqle) {
-               fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     ps.close();
@@ -2013,8 +1519,6 @@
             try {
                 ps.setNull(1, Types.BLOB);
                 ps.execute();
-            } catch (SQLException sqle) {
-               fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     ps.close();
@@ -2024,18 +1528,10 @@
 
             query = "insert into type (BoolVal, TextVal) values ('true', ?);";
             ps = conn.prepareStatement(query);
-
-            try {
-                ps.setNull(1, Types.CHAR);
-                ps.execute();
-            } catch (SQLException sqle) {
-               fail("SQLException is thrown: " + sqle.getMessage());
-            }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps.setNull(1, Types.CHAR);
+            ps.execute();
         } finally {
             try {
-
                 ps.close();
             } catch (Exception ee) {
             }
@@ -2043,20 +1539,12 @@
     }
 
     /**
-     * @test {@link java.sql.PreparedStatement#setNull(int, int, String)}
-     *
      * UDTs and Ref types not supported in SQLite v 3
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setNull",
-        args = {int.class, int.class, java.lang.String.class}
-    )
-    public void testSetNullIntintString() {
+    public void testSetNullIntintString() throws SQLException {
         // test UDT
         String typeCreationStmtUDT = "CREATE TYPE addressType AS "
-        +"( street INTEGER, zip TEXT);";
+                + "( street INTEGER, zip TEXT);";
         String personTableCreateUDT = "CREATE TABLE person (name TEXT, address addressType);";
         Statement st = null;
         PreparedStatement ps = null;
@@ -2079,10 +1567,9 @@
                 } catch (Exception ee) {
                 }
             }
-
         } catch (SQLException e) {
-         // UDTs or Ref types not supported
-           // ok
+            // UDTs or Ref types not supported
+            // ok
         } finally {
             try {
                 st.execute("drop table if exists person");
@@ -2093,86 +1580,61 @@
 
         // test non UDT REF type Exception checking
         String personTableCreate = "create table person (name TEXT, Address TEXT)";
+        try {
+            st = conn.createStatement();
+            st.execute(personTableCreate);
+            String insert
+                    = "insert into person (name, address) values (?, '1600 Amphitheatre Mountain View');";
+            ps = conn.prepareStatement(insert);
             try {
-
-                st = conn.createStatement();
-                st.execute(personTableCreate);
-                String insert = "insert into person (name, address) values (?, '1600 Amphitheatre Mountain View');";
-                ps = conn.prepareStatement(insert);
-                try {
-                    ps.setNull(1,1, "");
-                    ps.execute();
-                } catch (SQLException sqle) {
-                    assertEquals("SQLite.Exception: error in step",sqle.getMessage());
-                } finally {
-                    try {
-                        st.close();
-                    } catch (Exception ee) {
-                    }
-                }
-
-            } catch (SQLException e) {
-                fail("SQLException is thrown: " + e.getMessage());
-                e.printStackTrace();
+                ps.setNull(1, 1, "");
+                ps.execute();
+            } catch (SQLException sqle) {
+                assertEquals("SQLite.Exception: error in step", sqle.getMessage());
             } finally {
                 try {
-                    st.execute("drop table if exists person");
-                    ps.close();
+                    st.close();
                 } catch (Exception ee) {
                 }
             }
+        } finally {
+            try {
+                st.execute("drop table if exists person");
+                ps.close();
+            } catch (Exception ee) {
+            }
+        }
 
-         // test non UDT REF type OK
+        // test non UDT REF type OK
 
-            personTableCreate = "create table person (name TEXT, Address TEXT)";
+        personTableCreate = "create table person (name TEXT, Address TEXT)";
+        try {
+            st = conn.createStatement();
+            st.execute("drop table if exists person");
+            st.execute(personTableCreate);
+            String insert
+                    = "insert into person (name, address) values (?, '1600 Amphitheatre Mountain View');";
+            ps = conn.prepareStatement(insert);
+            try {
+                ps.setNull(1, 1, "");
+                ps.execute();
+            } finally {
                 try {
-
-                    st = conn.createStatement();
-                    st.execute("drop table if exists person");
-                    st.execute(personTableCreate);
-                    String insert = "insert into person (name, address) values (?, '1600 Amphitheatre Mountain View');";
-                    ps = conn.prepareStatement(insert);
-                    try {
-                        ps.setNull(1,1, "");
-                        ps.execute();
-                    } catch (SQLException sqle) {
-                        fail("SQLException is thrown: " + sqle.getMessage());
-                        sqle.printStackTrace();
-                    } finally {
-                        try {
-                            st.close();
-                        } catch (Exception ee) {
-                        }
-                    }
-
-                } catch (SQLException e) {
-                    fail("SQLException is thrown: " + e.getMessage());
-                    e.printStackTrace();
-                } finally {
-                    try {
-                        st.execute("drop table if exists person");
-                        ps.close();
-                    } catch (Exception ee) {
-                    }
+                    st.close();
+                } catch (Exception ee) {
                 }
-
-
+            }
+        } finally {
+            try {
+                st.execute("drop table if exists person");
+                ps.close();
+            } catch (Exception ee) {
+            }
+        }
     }
 
-
-    /**
-     * @test java.sql.PreparedStatement#setObject(int parameterIndex, Object x)
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setObject",
-        args = {int.class, java.lang.Object.class}
-    )
-    @KnownFailure("exception test fails")
-    public void testSetObject_int_Object() {
-
+    // exception test fails
+    public void testSetObject_int_Object() throws SQLException {
         PreparedStatement ps = null;
         try {
             String query = "insert into type (IntVal) values (?);";
@@ -2186,8 +1648,6 @@
                         + Integer.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2205,8 +1665,6 @@
                 st.execute("select * from type where LongVal='test text';");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2236,8 +1694,6 @@
                         + d.getTime() + "';");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2252,8 +1708,6 @@
             try {
                 ps.setObject(1, null);
                 ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2261,11 +1715,8 @@
                 }
             }
 
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (Exception ee) {
             }
@@ -2279,21 +1730,10 @@
 
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setObject(int parameterIndex, Object x,
-     *       int targetSqlType)
-     *
-     * this test doesn't pass on RI
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not all types supported",
-        method = "setObject",
-        args = {int.class, java.lang.Object.class, int.class}
-    )
-    @KnownFailure("Fails for Types.DATE")
-    public void testSetObject_int_Object_int() {
-
+     /**
+      * This test doesn't pass on RI
+      */
+    public void testSetObject_int_Object_int() throws SQLException {
         PreparedStatement ps = null;
         try {
             String query = "insert into type (IntVal) values (?);";
@@ -2307,8 +1747,6 @@
                         + Integer.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2326,8 +1764,6 @@
                 st.execute("select * from type where LongVal='test text';");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2337,19 +1773,13 @@
 
             query = "insert into type (DecVal) values (?);";
             ps = conn.prepareStatement(query);
-
-            try {
-                ps.setObject(1, new Object(), Types.DECIMAL);
-                ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.toString());
-            }
+            ps.setObject(1, new Object(), Types.DECIMAL);
+            ps.execute();
 
             query = "insert into type (dateVal) values (?);";
             ps = conn.prepareStatement(query);
             Date d = new Date(123456789);
 
-
             try {
                 ps.setObject(1, d, Types.DATE);
                 ps.execute();
@@ -2358,8 +1788,6 @@
                         + d.getTime() + "';");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2374,20 +1802,14 @@
             try {
                 ps.setObject(1, "", Types.BLOB);
                 ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
                 } catch (Exception ee) {
                 }
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (Exception ee) {
             }
@@ -2399,24 +1821,12 @@
         } catch (SQLException e) {
             // ok
         }
-
     }
 
     /**
-     * @test java.sql.PreparedStatement#setObject(int parameterIndex, Object x,
-     *       int targetSqlType, int scale)
-     *
-     * this test doesn't pass on RI
+     * This test doesn't pass on RI; Fails for Types.DATE
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setObject",
-        args = {int.class, java.lang.Object.class, int.class, int.class}
-    )
-    @KnownFailure("Fails for Types.DATE")
-    public void testSetObject_int_Object_int_int() {
-
+    public void testSetObject_int_Object_int_int() throws SQLException {
         PreparedStatement ps = null;
         try {
             String query = "insert into type (IntVal) values (?);";
@@ -2431,8 +1841,6 @@
                         + Integer.MAX_VALUE);
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2450,8 +1858,6 @@
                 st.execute("select * from type where LongVal='test text';");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2462,13 +1868,8 @@
             query = "insert into type (DecVal) values (?);";
             ps = conn.prepareStatement(query);
             BigDecimal bd2 = new BigDecimal("12.21");
-
-            try {
-                ps.setObject(1, bd2, Types.DECIMAL, 2);
-                ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
-            }
+            ps.setObject(1, bd2, Types.DECIMAL, 2);
+            ps.execute();
 
             query = "insert into type (dateVal) values (?);";
             ps = conn.prepareStatement(query);
@@ -2481,8 +1882,6 @@
                         + d.getTime() + "';");
                 ResultSet rs = st.getResultSet();
                 assertEquals(1, getCount(rs));
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
@@ -2497,20 +1896,14 @@
             try {
                 ps.setObject(1, "", Types.BLOB, 0);
                 ps.execute();
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.getMessage());
             } finally {
                 try {
                     st.close();
                 } catch (Exception ee) {
                 }
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
-
                 ps.close();
             } catch (Exception ee) {
             }
@@ -2524,22 +1917,11 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setTime(int parameterIndex, Time x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setTime",
-        args = {int.class, java.sql.Time.class}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testSetTimeint_Time() {
-
+    // statement.close() does not wrap up
+    public void testSetTimeint_Time() throws SQLException {
         Time[] times = { new Time(24, 25, 26), new Time(Integer.MAX_VALUE),
                 new Time(123456789) };
 
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -2555,8 +1937,6 @@
                             + times[i].getTime() + "'");
                     ResultSet rs = st.getResultSet();
                     assertEquals(1, getCount(rs));
-                } catch (SQLException sqle) {
-                    fail("SQLException is thrown: " + sqle.getMessage());
                 } finally {
                     try {
                         st.close();
@@ -2582,19 +1962,10 @@
             }
             String query1 = "insert into type (Tint) values (?)";
             ps1 = conn.prepareStatement(query1);
-
-            try {
-                ps1.setTime(1, times[0]);
-                ps1.execute();
-
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.toString());
-            }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setTime(1, times[0]);
+            ps1.execute();
         } finally {
             try {
-
                 ps.close();
                 ps1.close();
             } catch (Exception ee) {
@@ -2602,19 +1973,8 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setTime(int parameterIndex, Time x,
-     *       Calendar cal)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setTime",
-        args = {int.class, java.sql.Time.class, java.util.Calendar.class}
-    )
-    @KnownFailure("preparedStatement.execute() does not return False on update.")
-    public void testSetTime_int_Time_Calendar() {
-
+    // preparedStatement.execute() does not return False on update.
+    public void testSetTime_int_Time_Calendar() throws SQLException {
         Calendar[] cals = { Calendar.getInstance(),
                 Calendar.getInstance(Locale.GERMANY),
                 Calendar.getInstance(TimeZone.getDefault()) };
@@ -2622,7 +1982,6 @@
         Time[] times = { new Time(24, 25, 26), new Time(Integer.MAX_VALUE),
                 new Time(123456789) };
 
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -2634,8 +1993,6 @@
                     ps.setTime(1, times[i], cals[i]);
                     assertFalse(ps.execute());
                     assertTrue(ps.getUpdateCount() > 0);
-                } catch (SQLException sqle) {
-                    fail("SQLException is thrown: " + sqle.getMessage());
                 } finally {
                     try {
                         st.close();
@@ -2661,19 +2018,10 @@
             }
             String query1 = "insert into type (Tint) values (?);";
             ps1 = conn.prepareStatement(query1);
-
-            try {
-                ps1.setTime(1, times[0], cals[2]);
-                ps1.execute();
-
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.toString());
-            }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setTime(1, times[0], cals[2]);
+            ps1.execute();
         } finally {
             try {
-
                 ps.close();
                 ps1.close();
             } catch (Exception ee) {
@@ -2681,23 +2029,11 @@
         }
     }
 
-    /**
-     * @test java.sql.PreparedStatement#setTimestamp(int parameterIndex,
-     *       Timestamp x)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setTimestamp",
-        args = {int.class, java.sql.Timestamp.class}
-    )
-    @KnownFailure("preparedStatement.execute() does not return false on update.")
-    public void testSetTimestamp_int_Timestamp() {
-
+    // preparedStatement.execute() does not return false on update.
+    public void testSetTimestamp_int_Timestamp() throws SQLException {
         Timestamp[] timestamps = { new Timestamp(2007, 10, 17, 19, 06, 50, 23),
                 new Timestamp(123) };
 
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -2705,13 +2041,9 @@
             ps = conn.prepareStatement(query);
 
             for (int i = 0; i < timestamps.length; i++) {
-                try {
-                    ps.setTimestamp(1, timestamps[i]);
-                    assertFalse(ps.execute());
-                    assertTrue(ps.getUpdateCount() > 0);
-                } catch (SQLException sqle) {
-                    fail("SQLException is thrown: " + sqle.getMessage());
-                }
+                ps.setTimestamp(1, timestamps[i]);
+                assertFalse(ps.execute());
+                assertTrue(ps.getUpdateCount() > 0);
             }
 
             try {
@@ -2729,19 +2061,10 @@
             }
             String query1 = "insert into type (Tint) values (?);";
             ps1 = conn.prepareStatement(query1);
-
-            try {
-                ps1.setTimestamp(1, timestamps[0]);
-                ps1.execute();
-
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.toString());
-            }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setTimestamp(1, timestamps[0]);
+            ps1.execute();
         } finally {
             try {
-
                 ps.close();
                 ps1.close();
             } catch (Exception ee) {
@@ -2749,15 +2072,6 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setBlob(int, java.sql.Blob)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setBlob",
-        args = {int.class, java.sql.Blob.class}
-    )
     public void testSetBlob() {
         ResultSet res = null;
         PreparedStatement ps = null;
@@ -2772,15 +2086,6 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setClob(int, java.sql.Clob)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setClob",
-        args = {int.class, java.sql.Clob.class}
-    )
     public void testSetClob() {
         ResultSet res = null;
         PreparedStatement ps = null;
@@ -2795,18 +2100,8 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setTimestamp(int, Timestamp, Calendar)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setTimestamp",
-        args = {int.class, java.sql.Timestamp.class, java.util.Calendar.class}
-    )
-    @KnownFailure("preparedStatement.execute() does not return false on update.")
-    public void testSetTimestampIntTimestampCalendar() {
+    // preparedStatement.execute() does not return false on update.
+    public void testSetTimestampIntTimestampCalendar() throws SQLException {
         Calendar[] cals = { Calendar.getInstance(),
                 Calendar.getInstance(Locale.GERMANY),
                 Calendar.getInstance(TimeZone.getDefault()) };
@@ -2814,7 +2109,6 @@
         Timestamp[] timestamps = { new Timestamp(2007, 10, 17, 19, 06, 50, 23),
                 new Timestamp(123) };
 
-
         PreparedStatement ps = null;
         PreparedStatement ps1 = null;
         try {
@@ -2826,8 +2120,6 @@
                     ps.setTimestamp(1, timestamps[i], cals[i]);
                     assertFalse(ps.execute());
                     assertTrue(ps.getUpdateCount() > 0);
-                } catch (SQLException sqle) {
-                    fail("SQLException is thrown: " + sqle.getMessage());
                 } finally {
                     try {
                         st.close();
@@ -2853,19 +2145,10 @@
             }
             String query1 = "insert into type (Tint) values (?);";
             ps1 = conn.prepareStatement(query1);
-
-            try {
-                ps1.setTimestamp(1, timestamps[0], cals[2]);
-                ps1.execute();
-
-            } catch (SQLException sqle) {
-                fail("SQLException is thrown: " + sqle.toString());
-            }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ps1.setTimestamp(1, timestamps[0], cals[2]);
+            ps1.execute();
         } finally {
             try {
-
                 ps.close();
                 ps1.close();
             } catch (Exception ee) {
@@ -2873,16 +2156,6 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setURL(int, java.net.URL)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setURL",
-        args = {int.class, java.net.URL.class}
-    )
     public void testSetURL() {
         ResultSet res = null;
         PreparedStatement ps = null;
@@ -2900,16 +2173,6 @@
 
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setArray(int, java.sql.Array)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setArray",
-        args = {int.class, java.sql.Array.class}
-    )
     public void testSetArray() {
         ResultSet res = null;
         PreparedStatement ps = null;
@@ -2928,16 +2191,6 @@
 
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setRef(int, java.sql.Ref)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setRef",
-        args = {int.class, java.sql.Ref.class}
-    )
     public void testSetRef() {
         ResultSet res = null;
         PreparedStatement ps = null;
@@ -2953,16 +2206,6 @@
 
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setUnicodeStream(int, java.io.InputStream, int)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setUnicodeStream",
-        args = {int.class, java.io.InputStream.class, int.class}
-    )
     public void testSetUnicodestream() {
         ResultSet res = null;
         PreparedStatement ps = null;
@@ -2981,41 +2224,21 @@
         }
     }
 
-    public void testSetCharacterSteam() {
-        ResultSet res = null;
-        PreparedStatement ps = null;
-        try {
-            String query = "insert into type (TText) values (?);";
-            ps = conn.prepareStatement(query);
-            InputStream file = Class.forName(this.getClass().getName())
-            .getResourceAsStream("/blob.c");
-            assertNotNull("Error in test setup: file not found",file);
-            Reader reader = new InputStreamReader(file);
-            ps.setCharacterStream(1, reader, 100);
-        } catch (Exception e) {
-            fail("Error in test setup "+e.getMessage());
-            e.printStackTrace();
-        }
+    public void testSetCharacterSteam() throws SQLException {
+        String query = "insert into type (TText) values (?);";
+        PreparedStatement ps = conn.prepareStatement(query);
+        InputStream file = OldPreparedStatementTest.class.getResourceAsStream("/blob.c");
+        assertNotNull("Error in test setup: file not found",file);
+        Reader reader = new InputStreamReader(file);
+        ps.setCharacterStream(1, reader, 100);
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setAsciiStream(int, InputStream, int)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setAsciiStream",
-        args = {int.class, java.io.InputStream.class, int.class}
-    )
-    public void testSetAxciiStream() {
+    public void testSetAsciiStream() {
         ResultSet res = null;
-        PreparedStatement ps = null;
         try {
             String query = "insert into type (TText) values (?);";
-            ps = conn.prepareStatement(query);
-            InputStream file = Class.forName(this.getClass().getName())
-            .getResourceAsStream("/blob.c");
+            PreparedStatement ps = conn.prepareStatement(query);
+            InputStream file = OldPreparedStatementTest.class.getResourceAsStream("/blob.c");
             ps.setAsciiStream(0, file, 100);
             fail("Exception expected not supported");
         } catch (SQLException e) {
@@ -3026,112 +2249,76 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.PreparedStatement#setBinaryStream(int, InputStream, int)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setBinaryStream",
-        args = {int.class, java.io.InputStream.class, int.class}
-    )
-    public void testSetBinaryStream() {
-
-        ResultSet res = null;
-        PreparedStatement ps = null;
+    public void testSetBinaryStream() throws Exception {
         try {
             String query = "insert into type (TText) values (?);";
-            ps = conn.prepareStatement(query);
-            InputStream file = Class.forName(this.getClass().getName())
-            .getResourceAsStream("/blob.c");
+            PreparedStatement ps = conn.prepareStatement(query);
+            InputStream file = OldPreparedStatementTest.class.getResourceAsStream("/blob.c");
             ps.setBinaryStream(0, file, 100);
             fail("Exception expected not supported");
-        } catch (SQLException e) {
-            // ok
-        } catch (Exception e) {
-            fail("Error in test setup "+e.getMessage());
-            e.printStackTrace();
+        } catch (SQLException expected) {
         }
     }
 
     private class MockRef implements Ref {
-
         public String getBaseTypeName() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public Object getObject() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public Object getObject(Map<String, Class<?>> map) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
-        public void setObject(Object value) throws SQLException {
-            // TODO Auto-generated method stub
-
-        }
-
+        public void setObject(Object value) throws SQLException {}
     }
 
     private class MockArray implements Array {
 
         public Object getArray() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public Object getArray(long index, int count) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public Object getArray(long index, int count, Map<String, Class<?>> map)
                 throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public Object getArray(Map<String, Class<?>> map) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public int getBaseType() throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public String getBaseTypeName() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public ResultSet getResultSet() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public ResultSet getResultSet(long index, int count)
                 throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public ResultSet getResultSet(long index, int count,
                 Map<String, Class<?>> map) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public ResultSet getResultSet(Map<String, Class<?>> map)
                 throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
@@ -3141,48 +2328,39 @@
     private class MockBlob implements Blob {
 
         public InputStream getBinaryStream() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public byte[] getBytes(long pos, int length) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public long length() throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public long position(Blob pattern, long start) throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public long position(byte[] pattern, long start) throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public OutputStream setBinaryStream(long pos) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public int setBytes(long pos, byte[] theBytes) throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public int setBytes(long pos, byte[] theBytes, int offset, int len)
                 throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public void truncate(long len) throws SQLException {
-            // TODO Auto-generated method stub
 
         }
 
@@ -3196,60 +2374,47 @@
     private class MockClob implements Clob {
 
         public InputStream getAsciiStream() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public Reader getCharacterStream() throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public String getSubString(long pos, int length) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public long length() throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public long position(Clob searchstr, long start) throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public long position(String searchstr, long start) throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public OutputStream setAsciiStream(long pos) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public Writer setCharacterStream(long pos) throws SQLException {
-            // TODO Auto-generated method stub
             return null;
         }
 
         public int setString(long pos, String str) throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
         public int setString(long pos, String str, int offset, int len)
                 throws SQLException {
-            // TODO Auto-generated method stub
             return 0;
         }
 
-        public void truncate(long len) throws SQLException {
-            // TODO Auto-generated method stub
-
-        }
+        public void truncate(long len) throws SQLException {}
 
         public void free() throws SQLException {}
 
diff --git a/luni/src/test/java/libcore/java/sql/OldResultSetGetterTests.java b/luni/src/test/java/libcore/java/sql/OldResultSetGetterTests.java
new file mode 100644
index 0000000..1b8b140
--- /dev/null
+++ b/luni/src/test/java/libcore/java/sql/OldResultSetGetterTests.java
@@ -0,0 +1,1458 @@
+/*
+ * Copyright (C) 2007 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.sql;
+
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.sql.DatabaseMetaData;
+import java.sql.Date;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.GregorianCalendar;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.ListIterator;
+
+/**
+ * Tests based on
+ * <a href="http://java.sun.com/products/jdbc/download.html">JDBC 1.0 API spec</a> Table 1.0
+ */
+public final class OldResultSetGetterTests extends OldSQLTest {
+
+    String queryAllSelect = "select * from type";
+
+    ResultSet res = null;
+
+    Statement st = null;
+
+    // Judgement concerning support is based on the result of ResultSet.getOject
+    // and Table 1 of JDBC 1.0 spec.
+    static boolean booleanSupported = false;
+    static boolean blobSupported = false;
+    static boolean bigIntSupported = false;
+    static boolean smallIntSupported = false;
+    static boolean mediumIntSupported = false;
+    static boolean realSupported = false;
+    static boolean floatSupported = false;
+    static boolean dateSupported = false;
+    static boolean timeSupported = false;
+    static boolean timeStampSupported = false;
+    static boolean dateTimeSupported = false;
+    static boolean urlSupported= false;
+    static boolean tinyIntSupported = false;
+    static boolean decimalSupported = false;
+    static boolean numericSupported = false;
+
+    static List<String> colNames = Arrays.asList("BoolVal", "IntVal", "LongVal",
+            "Bint", "Tint", "Sint", "Mint", "IntegerVal", "RealVal",
+            "DoubleVal", "FloatVal", "DecVal", "NumVal", "charStr",
+            "dateVal", "timeVal", "TS", "DT", "TBlob", "BlobVal", "MBlob",
+            "LBlob", "TText", "TextVal", "MText", "LText", "MaxLongVal",
+            "MinLongVal", "validURL", "invalidURL");
+
+    static List<String> values = Arrays.asList("1", "-1", "22", "2", "33",
+         "3","1","2","3.9","23.2","33.3","44",
+        "5", "test string", "1799-05-26", "12:35:45", "2007-10-09 14:28:02.0",
+        "1221-09-22 10:11:55","1","2","3","4","Test text message tiny",
+        "Test text", "Test text message medium",
+        "Test text message long");
+
+    static boolean[] supported = new boolean[]{
+        booleanSupported,
+        true,
+        true,
+        bigIntSupported,
+        tinyIntSupported,
+        smallIntSupported,
+        mediumIntSupported,
+        true,
+        realSupported,
+        true,
+        floatSupported,
+        decimalSupported,
+        numericSupported,
+        true,
+        dateSupported,
+        timeSupported,
+        timeStampSupported,
+        dateTimeSupported,
+        blobSupported,
+        blobSupported,
+        blobSupported,
+        blobSupported,
+        true,
+        true,
+        true,
+        true,
+        bigIntSupported,
+        bigIntSupported,
+        urlSupported,
+        urlSupported
+      };
+
+    // Not supported: BIT,VARBINARY, LONGVARBINARY, BINARY, VARCHAR, LONGVARCHAR
+    static Class[] typeMap = new Class[]{
+            java.lang.String.class, //
+            java.lang.Integer.class,//Types.INTEGER,
+            java.lang.Integer.class, //Types.LONG, not a JDBC 1.0 type
+            java.lang.Long.class,  // Types.BIGINT,
+            java.lang.Byte.class,            // Types.TINYINT,
+            java.lang.Short.class, // Types.SMALLINT,
+            java.lang.Integer.class, //Types.MEDIUMINT, , not a JDBC 1.0 type
+            java.lang.Integer.class, // Types.Integer
+            java.lang.Float.class,   // Types.REAL,
+            java.lang.Double.class,  // Types.FLOAT,
+            java.lang.Double.class, // Types.DOUBLE,
+            java.math.BigDecimal.class, // Types.DECIMAL,
+            java.math.BigDecimal.class, // Types.NUMERIC,
+            java.lang.String.class,     // Types.CHAR
+            java.sql.Date.class,        // Types.DATE,
+            java.sql.Time.class,        // Types.TIME,
+            java.sql.Timestamp.class,  // Types.TIMESTAMP,
+            java.sql.Date.class,       // types datetime, not a JDBC 1.0 type
+            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
+            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
+            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
+            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
+            java.lang.String.class,    // not a JDBC 1.0 type
+            java.lang.String.class,    // not a JDBC 1.0 type
+            java.lang.String.class,    // not a JDBC 1.0 type
+            java.lang.String.class,    // not a JDBC 1.0 type
+            java.lang.Long.class,      // Types.BIGINT,
+            java.lang.Long.class,      // Types.BIGINT,
+            java.net.URL.class,        // not a JDBC 1.0 type
+            java.net.URL.class         // not a JDBC 1.0 type
+
+
+    };
+
+    // first inserted row : actual values
+    // second inserted row: null values
+    String[] queries = {
+            "create table type (" +
+
+            " BoolVal BOOLEAN," + " IntVal INT," + " LongVal LONG,"
+                    + " Bint BIGINT," + " Tint TINYINT," + " Sint SMALLINT,"
+                    + " Mint MEDIUMINT, " +
+
+                    " IntegerVal INTEGER, " + " RealVal REAL, "
+                    + " DoubleVal DOUBLE, " + " FloatVal FLOAT, "
+                    + " DecVal DECIMAL, " +
+
+                    " NumVal NUMERIC, " + " charStr CHAR(20), "
+                    + " dateVal DATE, " + " timeVal TIME, " + " TS TIMESTAMP, "
+                    +
+
+                    " DT DATETIME, " + " TBlob TINYBLOB, " + " BlobVal BLOB, "
+                    + " MBlob MEDIUMBLOB, " + " LBlob LONGBLOB, " +
+
+                    " TText TINYTEXT, " + " TextVal TEXT, "
+                    + " MText MEDIUMTEXT, " + " LText LONGTEXT, " +
+
+                    " MaxLongVal BIGINT, MinLongVal BIGINT, "+
+
+                    " validURL URL, invalidURL URL "+
+
+                    ");"
+             ,
+
+            "insert into type (BoolVal, IntVal, LongVal, Bint, Tint, Sint, Mint,"
+                    + "IntegerVal, RealVal, DoubleVal, FloatVal, DecVal,"
+                    + "NumVal, charStr, dateVal, timeVal, TS,"
+                    + "DT, TBlob, BlobVal, MBlob, LBlob,"
+                    + "TText, TextVal, MText, LText, MaxLongVal, MinLongVal,"
+                    + " validURL, invalidURL"
+                    + ") "
+                    + "values (1, -1, 22, 2, 33,"
+                    + "3, 1, 2, 3.9, 23.2, 33.3, 44,"
+                    + "5, 'test string', '1799-05-26', '12:35:45', '2007-10-09 14:28:02.0',"
+                    + "'1221-09-22 10:11:55', 1, 2, 3, 4,"
+                    + "'Test text message tiny', 'Test text',"
+                    + " 'Test text message medium', 'Test text message long', "
+                    + Long.MAX_VALUE+", "+Long.MIN_VALUE+", "
+                    + "'http://www.android.com', 'helloWorld' "+
+                    ");"
+            ,
+
+           "insert into type (BoolVal, IntVal, LongVal, Bint, Tint, Sint, Mint,"
+                    + "IntegerVal, RealVal, DoubleVal, FloatVal, DecVal,"
+                    + "NumVal, charStr, dateVal, timeVal, TS,"
+                    + "DT, TBlob, BlobVal, MBlob, LBlob,"
+                    + "TText, TextVal, MText, LText, MaxLongVal, MinLongVal,"
+                    +" validURL, invalidURL"
+                    + ") "
+                    + "values (null, null, null, null, null,"
+                    + "null, null, null, null, null, null, null,"
+                    + "null, null, null, null, null,"
+                    + "null, null, null, null, null,"
+                    + "null, null, null, null,null, null, null, null);"
+    };
+
+    @Override
+    public void setUp() throws Exception {
+        super.setUp();
+        conn.setAutoCommit(false);
+        st = conn.createStatement();
+        for (int i = 0; i < queries.length; i++) {
+            st.execute(queries[i]);
+        }
+        res = st.executeQuery(queryAllSelect);
+        assertTrue(res.next());
+    }
+
+    public void tearDown() throws SQLException {
+        try {
+            st.execute("drop table if exists type");
+            st.close();
+            res.close();
+        } finally {
+            try {
+                st.close();
+                res.close();
+            } catch (SQLException ee) {
+            }
+        }
+        super.tearDown();
+    }
+
+    public void testGetBytesInt() throws SQLException {
+        int i = 1;
+        // null value
+        i = 1;
+        res.next();
+        for (String t : values) {
+            assertNull(res.getBytes(i));
+            i++;
+        }
+
+        try {
+            res.close();
+            res.getBytes(24);
+            fail("Should get Exception");
+        } catch (SQLException e) {
+            //ok
+        }
+
+    }
+
+    public void testGetBytesIntVarbinary() throws SQLException {
+        Statement st = null;
+        Statement stQuery = null;
+        PreparedStatement stPrep = null;
+        ResultSet res = null;
+
+        // setup
+        try {
+            String testString = "HelloWorld";
+            st = conn.createStatement();
+            st.executeUpdate("create table testBinary (VARBINARY value);");
+            stPrep = conn
+                    .prepareStatement("insert into testBinary values (?);");
+            stPrep.setBytes(1, testString.getBytes());
+            stPrep.execute();
+
+            stQuery = conn.createStatement();
+            res = stQuery.executeQuery("select * from testBinary");
+            assertTrue(res.next());
+            byte[] output = res.getBytes(1);
+            String helloTest = new String(output);
+            assertNotNull(helloTest);
+            assertEquals(testString, helloTest);
+        } finally {
+            if (res != null) res.close();
+            if (stPrep != null) stPrep.close();
+            if (st != null) st.close();
+            if (stQuery != null) stQuery.close();
+        }
+    }
+
+    public void testGetBytesIntBinary() throws SQLException {
+
+        Statement st = null;
+        Statement stQuery = null;
+        PreparedStatement stPrep = null;
+        ResultSet res = null;
+
+
+        // setup
+
+        String testString = "HelloWorld";
+        st = conn.createStatement();
+        st.executeUpdate("create table testBinary (BINARY value);");
+        stPrep = conn.prepareStatement("insert into testBinary values (?);");
+        stPrep.setBytes(1, testString.getBytes());
+        stPrep.execute();
+        try {
+            stQuery = conn.createStatement();
+            res = stQuery.executeQuery("select * from testBinary");
+            assertTrue(res.next());
+            byte[] output = res.getBytes(1);
+            String helloTest = new String(output);
+            assertNotNull(helloTest);
+            assertEquals(testString, helloTest);
+        } finally {
+            if (res != null) res.close();
+            if (stPrep != null) stPrep.close();
+            if (st != null) st.close();
+            if (stQuery != null) stQuery.close();
+        }
+    }
+
+    public void testGetBytesString() throws SQLException {
+        int i = 1;
+
+        // null value
+        res.next();
+        for (String t : colNames) {
+            assertNull(res.getBytes(t));
+        }
+
+        try {
+            res.close();
+            res.getBytes(colNames.get(24));
+            fail("Should get Exception");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    // last assertion fails: invalid conversion. Test passes on RI
+    public void testGetBytesStringVarbinary() throws SQLException {
+        Statement st = null;
+        Statement stQuery = null;
+        PreparedStatement stPrep = null;
+        ResultSet res = null;
+
+        // setup
+        try {
+            String testString = "HelloWorld";
+            st = conn.createStatement();
+            st.executeUpdate("create table testBinary (VARBINARY value);");
+            stPrep = conn
+                    .prepareStatement("insert into testBinary values (?);");
+            stPrep.setBytes(1, testString.getBytes());
+            stPrep.execute();
+
+            stQuery = conn.createStatement();
+            res = stQuery.executeQuery("select value from testBinary");
+            assertTrue(res.next());
+            byte[] output = res.getBytes("value");
+            String helloTest = new String(output);
+            assertNotNull(helloTest);
+            assertEquals(testString, helloTest);
+        } finally {
+            if (res != null) res.close();
+            if (stPrep != null) stPrep.close();
+            if (st != null) st.close();
+            if (stQuery != null) stQuery.close();
+        }
+
+    }
+
+     // last assertion fails: invalid conversion. Test passes on RI
+    public void testGetBytesStringBinary() throws SQLException {
+        Statement st = null;
+        Statement stQuery = null;
+        PreparedStatement stPrep = null;
+        ResultSet res = null;
+
+        // setup
+
+        String testString = "HelloWorld";
+        st = conn.createStatement();
+        st.executeUpdate("create table testBinary (BINARY value);");
+        stPrep = conn.prepareStatement("insert into testBinary values (?);");
+        stPrep.setBytes(1, testString.getBytes());
+        stPrep.execute();
+        try {
+            stQuery = conn.createStatement();
+            res = stQuery.executeQuery("select value from testBinary");
+            assertTrue(res.next());
+            byte[] output = res.getBytes("value");
+            String helloTest = new String(output);
+            assertNotNull(helloTest);
+            assertEquals(testString, helloTest);
+        } finally {
+            if (res != null) res.close();
+            if (stPrep != null) stPrep.close();
+            if (st != null) st.close();
+            if (stQuery != null) stQuery.close();
+        }
+    }
+
+    public void testGetConcurrency() throws SQLException {
+        assertEquals(ResultSet.CONCUR_UPDATABLE, res.getConcurrency());
+    }
+
+    public void testGetDateInt() throws SQLException {
+        GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
+        Date input = new Date(testCal.getTimeInMillis());
+        Date d = res.getDate(15);
+        assertEquals(input.toString(),"1799-05-26");
+        assertEquals(input,d);
+
+        try {
+            d = res.getDate(500);
+            fail("Should get exception");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        // null value
+        assertTrue(res.next());
+        d = res.getDate(15);
+        assertNull(d);
+    }
+
+    public void testGetDateIntCalendar() throws SQLException {
+        GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
+        Date input = new Date(testCal.getTimeInMillis());
+        Date d = res.getDate(15, testCal);
+
+        assertEquals(input.toString(),"1799-05-26");
+        assertEquals(input,d);
+
+        try {
+            d = res.getDate(500, testCal);
+            fail("Should get exception");
+        } catch (SQLException e) {
+            //ok
+        }
+
+
+        // null value
+        assertTrue(res.next());
+        d = res.getDate(15,testCal);
+        assertNull(d);
+    }
+
+    public void testGetDateString() throws SQLException {
+        GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
+        Date input = new Date(testCal.getTimeInMillis());
+        Date d = res.getDate("dateVal");
+        assertEquals(input.toString(),"1799-05-26");
+        assertEquals(input,d);
+
+        try {
+            d = res.getDate("bla");
+            fail("Should get exception");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        // null value
+        assertTrue(res.next());
+        d = res.getDate("dateVal");
+        assertNull(d);
+    }
+
+    public void testGetDateStringCalendar() throws SQLException {
+        GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
+        Date input = new Date(testCal.getTimeInMillis());
+        Date d = res.getDate("dateVal", testCal);
+        assertEquals(input.toString(),"1799-05-26");
+        assertEquals(input,d);
+
+        try {
+            res.getDate("bla", testCal);
+            fail("Should get exception");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        // null value
+        assertTrue(res.next());
+        d = res.getDate("dateVal",testCal);
+        assertNull(d);
+    }
+
+    public void testGetDoubleInt() throws SQLException {
+        double output = 0.0;
+        double[] input = {2.0, 3.9 , 23.2};
+
+        output = res.getDouble(8);
+        assertEquals(input[0],output);
+
+        output = res.getDouble(9);
+        assertEquals(input[1],output);
+
+        output = res.getDouble(10);
+        assertEquals(input[2],output);
+
+        try  {
+            res.getDouble(500);
+        } catch (SQLException e) {
+            //ok
+        }
+
+        // null value
+        res.next();
+        output = res.getDouble(8);
+        assertEquals(0.0,output);
+
+        output = res.getDouble(9);
+        assertEquals(0.0,output);
+
+        output = res.getDouble(10);
+        assertEquals(0.0,output);
+    }
+
+    public void testGetDoubleString() throws SQLException {
+        double input = 23.2;
+        double output = 0.0;
+
+        output = res.getDouble("DoubleVal");
+        assertEquals (input,output);
+
+        try{
+            res.getDouble("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+
+        // null value
+        assertTrue(res.next());
+        output = res.getDouble("DoubleVal");
+        assertEquals (0.0 , output);
+    }
+
+    public void testGetFloatInt() throws SQLException {
+        float defaultF = 0.0f;
+        float[] input = {3.9f, 23.2f, 33.3f};
+
+        float output = res.getFloat(9);
+        assertEquals(input[0], output);
+
+        output = res.getFloat(10);
+        assertEquals(input[1], output);
+
+        output = res.getFloat(11);
+        assertEquals(input[2], output);
+
+        try {
+            res.getFloat(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        res.next();
+        output = res.getFloat(8);
+        assertEquals(defaultF, output);
+
+        output = res.getFloat(9);
+        assertEquals(defaultF, output);
+
+        output = res.getFloat(10);
+        assertEquals(defaultF, output);
+    }
+
+    public void testGetFloatString() throws SQLException {
+        float defaultF = 0.0f;
+        String[] input = {"RealVal", "DoubleVal", "FloatVal"};
+        float[] inputF = {3.9f, 23.2f, 33.3f};
+
+        float output = res.getFloat(input[0]);
+        assertEquals(inputF[0], output);
+
+        output = res.getFloat(input[1]);
+        assertEquals(inputF[1], output);
+
+        output = res.getFloat(input[2]);
+        assertEquals(inputF[2], output);
+
+        try {
+            res.getFloat(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        res.next();
+        output = res.getFloat(8);
+        assertEquals(defaultF, output);
+
+        output = res.getFloat(9);
+        assertEquals(defaultF, output);
+
+        output = res.getFloat(10);
+        assertEquals(defaultF, output);
+    }
+
+    public void testGetIntInt() throws SQLException {
+        // real input val -1, 22, 2, 33,3, 1, 2
+        List<Integer> input = Arrays.asList(1, -1, 22, 2, 33,3, 1, 2);
+        ListIterator<Integer> it = input.listIterator();
+        Double test2 = new Double(23.2);
+        for (int i = 1;i<9;i++ ) {
+            assertEquals(it.next().intValue(),res.getInt(i));
+        }
+
+        try {
+            res.getInt(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        res.next();
+        for (int i = 2;i<11;i++ ) {
+            assertEquals(0,res.getInt(i));
+        }
+    }
+
+    public void testGetIntString() throws SQLException {
+        List<String> inputS = Arrays.asList("BoolVal", "IntVal", "LongVal",
+                "Bint", "Tint", "Sint", "Mint", "IntegerVal");
+        ListIterator<String> itS = inputS.listIterator();
+        List<Integer> input = Arrays.asList(1, -1, 22, 2, 33, 3, 1, 2);
+        ListIterator<Integer> it = input.listIterator();
+        while (it.hasNext()) {
+            assertEquals(it.next().intValue(), res.getInt(itS.next()));
+        }
+
+        try {
+            res.getInt("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        res.next();
+        for (String s : inputS) {
+            assertEquals(0, res.getInt(s));
+        }
+    }
+
+    public void testGetLongInt() throws SQLException {
+        long maxVal = Long.MAX_VALUE;
+        long minVal = Long.MIN_VALUE;
+
+        assertEquals(maxVal, res.getLong(27));
+        assertEquals(minVal, res.getLong(28));
+
+        try {
+            res.getInt(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        res.next();
+        assertEquals(0, res.getLong(27));
+        assertEquals(0, res.getLong(28));
+    }
+
+    public void testGetLongString() throws SQLException {
+        long maxVal = Long.MAX_VALUE;
+        long minVal = Long.MIN_VALUE;
+        assertEquals(maxVal, res.getLong("MaxLongVal"));
+        assertEquals(minVal, res.getLong("MinLongVal"));
+
+        try {
+            res.getInt("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        res.next();
+        assertEquals(0,res.getLong("MaxLongVal"));
+        assertEquals(0,res.getLong("MinLongVal"));
+    }
+
+    /**
+     * Test method for {@link java.sql.ResultSet#getMetaData()}.
+     * type mappings according to
+     * http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec/jdbc-spec.frame8.html
+     * Not supported datatypes are not checked.
+     *
+     * Wrong value returned for Long: java.lang.String (VARCHAR)
+     */
+    public void testGetMetaData() throws SQLException {
+        /*
+         * List<String> types = Arrays.asList("BOOLEAN", "INT", "LONG",
+         * "BIGINT", "TINYINT", "SMALLINT", "MEDIUMINT", "INTEGER", "REAL",
+         * "DOUBLE", "FLOAT", "DECIMAL", "NUMERIC", "CHAR(20)", "DATE", "TIME",
+         * "TIMESTAMP", "DATETIME", "TINYBLOB", "BLOB", "MEDIUMBLOB",
+         * "LONGBLOB", "TINYTEXT", "TEXT", "MEDIUMTEXT", "LONGTEXT", "BIGINT",
+         * "BIGINT","URL","URL");
+         */
+        List<String> types = Arrays.asList("VARCHAR", "INTEGER", "INTEGER",
+                "BIGINT", "SMALLINT", "SHORT", "INTEGER", "INTEGER", "FLOAT",
+                "DOUBLE", "DOUBLE", "DECIMAL", "NUMERIC", "VARCHAR", "DATE",
+                "TIME", "TIMESTAMP", "DATETIME", "BLOB", "BLOB", "BLOB",
+                "BLOB", "VARCHAR", "VARCHAR", "VARCHAR", "VARCHAR", "BIGINT",
+                "BIGINT", "URL", "URL");
+
+
+
+        ListIterator<String> it = types.listIterator();
+        ListIterator<String> colNameIt = colNames.listIterator();
+        ResultSetMetaData meta = res.getMetaData();
+        assertNotNull(meta);
+        assertEquals("Error in test setup. Columns do not match", types
+                .size(), meta.getColumnCount());
+        for (int i = 1; i < 31; i++) {
+            String colName = colNameIt.next();
+            String type = it.next();
+            if (supported[i - 1]) {
+                assertTrue("Wrong column name at " + i, colName
+                        .equalsIgnoreCase(meta.getColumnName(i)));
+                assertTrue("Wrong type at " + i+" required" +type+ " but is "+meta.getColumnTypeName(i), type.equalsIgnoreCase(meta
+                        .getColumnTypeName(i)));
+            }
+        }
+    }
+
+    // Wrong value returned for Long: java.lang.String
+    public void testGetObjectInt() throws SQLException {
+        for (int i = 1; i <= typeMap.length; i++) {
+            if (supported[i-1]) {
+                Object value = res.getObject(i);
+                assertTrue("value " + value.getClass().getName()
+                        + " does not correspond " + typeMap[i-1] + "at "+i, value
+                        .getClass().equals(typeMap[i-1]));
+            }
+        }
+
+        try {
+            res.getObject(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+        res.next();
+        for (int i = 1; i <= typeMap.length; i++) {
+            Object value = res.getObject(i);
+            assertNull(value);
+        }
+    }
+
+    // Wrong value returned for Long: java.lang.String
+    public void testGetObjectString() throws SQLException {
+        ListIterator<String> colNameIt = colNames.listIterator();
+        for (int i = 1; i <= typeMap.length; i++) {
+            String name = colNameIt.next();
+            if (supported[i-1]) {
+                Object value = res.getObject(name);
+                assertTrue("value " + value.getClass().getName()
+                        + " for "+name+" does not correspond " + typeMap[i-1] + "at "+i, value
+                        .getClass().equals(typeMap[i-1]));
+            }
+        }
+
+        try {
+            res.getObject("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+
+        colNameIt = colNames.listIterator();
+        res.next();
+        for (int i = 1; i <= typeMap.length; i++) {
+                Object value = res.getObject(colNameIt.next());
+               assertNull(value);
+        }
+    }
+
+    // If there is no current row 0 must be returned. res.close() does not wrap up
+    public void testGetRow() throws SQLException {
+        assertEquals(1, res.getRow());
+        assertTrue(res.isFirst());
+        res.next();
+        assertEquals(2, res.getRow());
+        assertTrue(res.isLast());
+        res.next();
+        assertTrue(res.isAfterLast());
+        assertEquals(0, res.getRow());
+
+        try {
+            res.close();
+            res.getRow();
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    public void testGetShortInt() throws SQLException {
+        short shorty = res.getShort(6);
+        assertEquals(3,shorty);
+
+        res.next();
+        shorty = res.getShort(6);
+        assertEquals(0,shorty);
+
+        try {
+            res.getShort(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    public void testGetShortString() throws SQLException {
+        short shorty = res.getShort("Sint");
+        assertEquals(3,shorty);
+
+        res.next();
+        shorty = res.getShort("Sint");
+        assertEquals(0,shorty);
+
+        try {
+            res.getShort("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    /**
+     * According to spec info.getStatement should return null but an exception
+     * is thrown: stale result set.
+     */
+    public void testGetStatement() throws SQLException {
+        DatabaseMetaData meta = conn.getMetaData();
+        ResultSet info = meta.getTypeInfo();
+        Statement statement2 = info.getStatement();
+        assertNull(statement2);
+
+        statement2 = res.getStatement();
+        assertEquals(st, statement2);
+
+       // exception testing
+        try {
+            res.close();
+            res.getStatement();
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    public void testGetStringInt() throws SQLException {
+        List<String> texts = Arrays.asList("Test text message tiny",
+                "Test text", "Test text message medium",
+                "Test text message long");
+        int i = 23;
+
+        //text and exception testing
+        for (String t : texts) {
+            assertEquals(t, res.getString(i));
+            i++;
+        }
+
+        // the rest: everything should work with getString
+
+        texts = Arrays.asList("1", "-1", "22", "2", "33",
+         "3","1","2","3.9","23.2","33.3","44",
+        "5", "test string", "1799-05-26", "12:35:45", "2007-10-09 14:28:02.0",
+        "1221-09-22 10:11:55","1","2","3","4");
+        i= 1;
+
+        for (String t : texts) {
+            assertEquals(t, res.getString(i));
+            i++;
+        }
+
+        //null testing
+        i = 1;
+        res.next();
+        for (String t : values) {
+            assertNull(res.getString(i));
+            i++;
+        }
+
+        // exception testing
+        try {
+            res.getString(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+
+    }
+
+    public void testGetStringString() throws SQLException {
+        ListIterator<String> colNameIt = colNames.listIterator();
+        for (String t : values) {
+            assertEquals(t, res.getString(colNameIt.next()));
+        }
+
+        res.next();
+        for (String name: colNames) {
+            assertNull(res.getString(name));
+        }
+
+        try {
+            res.getString("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    // getTime should return Time value for a TIMESTAMP type but returns null
+    public void testGetTimeInt() throws SQLException {
+        // values "12:35:45", "2007-10-09 14:28:02.0", "1221-09-22 10:11:55"
+
+        Calendar cal = new GregorianCalendar();
+        cal.clear();
+        cal.set(Calendar.HOUR_OF_DAY, 12);
+        cal.set(Calendar.MINUTE, 35);
+        cal.set(Calendar.SECOND, 45);
+        cal.set(Calendar.MILLISECOND, 0);
+        // set with calendar value (correct init time: since epoch)
+        long millis = cal.getTime().getTime();
+        Time t1 = new java.sql.Time(millis);
+        assertNotNull("t1", t1);
+
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis2 = cal2.getTime().getTime();
+        Time t2 = new java.sql.Time(millis2);
+
+        int i = 16;
+
+        Time resTime = res.getTime(i);
+        assertNotNull("Pos " + i + " null", resTime);
+        assertEquals(t1.toString(), resTime.toString());
+        assertEquals(t1.getTime(), resTime.getTime());
+        assertEquals(t1, resTime);
+        // Compatibility Test: TIMESTAMP value
+        i = 17;
+
+        resTime = res.getTime(i);
+        assertNotNull("Pos " + i + " null", resTime);
+        assertEquals(t2.toString(), resTime.toString());
+        assertEquals(t2.getTime(), resTime.getTime());
+        assertEquals(t2, resTime);
+
+        i = 16;
+        res.next();
+        assertNull(res.getTime(i));
+
+        try {
+            res.getTime(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+     // getTime on TIMESTAMP value fails: returns null
+    public void testGetTimeIntCalendar() throws SQLException {
+        List<Time> times = new LinkedList<Time>();
+        List<Calendar> cals = new LinkedList<Calendar>();
+        // Arrays.asList("12:35:45", "2007-10-09 14:28:02.0",
+        // "1221-09-22 10:11:55");
+
+        Calendar cal1 = new GregorianCalendar();
+        cal1.clear();
+        cal1.set(Calendar.HOUR_OF_DAY, 12);
+        cal1.set(Calendar.MINUTE, 35);
+        cal1.set(Calendar.SECOND, 45);
+        cal1.set(Calendar.MILLISECOND, 0);
+
+        long millis = cal1.getTime().getTime();
+        Time t1 = new java.sql.Time(millis);
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis2 = cal2.getTime().getTime();
+        Time t2 = new java.sql.Time(millis2);
+
+        // TIME value
+
+        int i = 16;
+
+        Time timeRes = res.getTime(i,new GregorianCalendar());
+        assertNotNull(timeRes);
+        assertEquals(t1.toString(), timeRes.toString());
+        assertEquals(t1.getTime(), timeRes.getTime());
+        assertEquals(t1, timeRes);
+
+        // TIMESTAMP value
+        i = 17;
+
+         timeRes = res.getTime(i,new GregorianCalendar());
+         assertNotNull(timeRes);
+         assertEquals(t2.toString(), timeRes.toString());
+         assertEquals(t2.getTime(), timeRes.getTime());
+         assertEquals(t2, timeRes);
+
+         res.next();
+         for (Calendar c : cals) {
+             assertNull(res.getTime(16,c));
+             i++;
+         }
+
+        try {
+            res.getTime(500,Calendar.getInstance());
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    // getTime should return a Time value for a TIMESTAMP type but returns null
+    public void testGetTimeString() throws SQLException {
+        List<Time> times = new LinkedList<Time>();
+
+        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
+        Iterator<String> it = stringTimes.iterator();
+
+        // Arrays.asList("12:35:45", "2007-10-09 14:28:02.0",
+        // "1221-09-22 10:11:55");
+
+        Calendar cal = new GregorianCalendar();
+        cal.clear();
+        cal.set(Calendar.HOUR_OF_DAY, 12);
+        cal.set(Calendar.MINUTE, 35);
+        cal.set(Calendar.SECOND, 45);
+        cal.set(Calendar.MILLISECOND, 0);
+
+        long millis = cal.getTime().getTime();
+        Time t1 = new java.sql.Time(millis);
+
+        String col = it.next();
+
+        Time timeRes = res.getTime(col);
+        assertNotNull(timeRes);
+        assertEquals(t1.toString(), timeRes.toString());
+        assertEquals(t1.getTime(), timeRes.getTime());
+        assertEquals(t1, timeRes);
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis2 = cal.getTime().getTime();
+        Time t2 = new java.sql.Time(millis2);
+
+        col = it.next();
+
+        timeRes = res.getTime(col);
+        assertNotNull(timeRes);
+        assertEquals(t2.toString(), timeRes.toString());
+        assertEquals(t2.getTime(), timeRes.getTime());
+        assertEquals(t2, timeRes);
+
+        res.next();
+        assertNull(res.getTime(col));
+
+        try {
+            res.getTime("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    // getTime on TIMESTAMP value fails: returns null
+    public void testGetTimeStringCalendar() throws SQLException {
+        List<Time> times = new LinkedList<Time>();
+
+        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
+        Iterator<String> it = stringTimes.iterator();
+        List<Calendar> cals = new LinkedList<Calendar>();
+
+        // Arrays.asList("12:35:45", "2007-10-09 14:28:02.0",
+        // "1221-09-22 10:11:55");
+
+        Calendar cal1 = new GregorianCalendar();
+        cal1.clear();
+        cal1.set(Calendar.HOUR_OF_DAY, 12);
+        cal1.set(Calendar.MINUTE, 35);
+        cal1.set(Calendar.SECOND, 45);
+        cal1.set(Calendar.MILLISECOND, 0);
+
+        long millis = cal1.getTime().getTime();
+        Time t1 = new java.sql.Time(millis);
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis2 = cal2.getTime().getTime();
+        Time t2 = new java.sql.Time(millis2);
+
+        // TIME value
+        String col = it.next();
+
+        Time timeRes = res.getTime(col, new GregorianCalendar());
+        assertNotNull(timeRes);
+        assertEquals(t1.toString(), timeRes.toString());
+        assertEquals(t1.getTime(), timeRes.getTime());
+        assertEquals(t1, res.getTime(col));
+        //TIMESTAMP value
+        col = it.next();
+
+        timeRes = res.getTime(col, new GregorianCalendar());
+        assertNotNull(timeRes);
+        assertEquals(t2.toString(), timeRes.toString());
+        assertEquals(t2.getTime(), timeRes.getTime());
+        assertEquals(t2, res.getTime(col));
+
+        res.next();
+        assertNull(res.getTime(stringTimes.get(0), new GregorianCalendar()));
+
+        try {
+            res.getTime("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    public void testGetTimestampInt() throws SQLException {
+        List<Timestamp> times = new LinkedList<Timestamp>();
+
+        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
+        Iterator<String> it = stringTimes.iterator();
+        List<Calendar> cals = new LinkedList<Calendar>();
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis = cal2.getTime().getTime();
+        Timestamp t2 = new Timestamp(millis);
+        times.add(t2);
+
+        Calendar cal3 = new GregorianCalendar();
+        cal3.set(Calendar.YEAR, 1221);
+        cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
+        cal3.set(Calendar.DATE, 22);
+        cal3.set(Calendar.HOUR_OF_DAY, 10);
+        cal3.set(Calendar.MINUTE, 11);
+        cal3.set(Calendar.SECOND, 55);
+        cal3.set(Calendar.MILLISECOND, 0);
+
+        millis = cal3.getTime().getTime();
+        Timestamp t3 = new Timestamp(millis);
+        times.add(t3);
+        // TIMESTAMP value
+        int i = 17;
+
+        Timestamp timeRes = res.getTimestamp(i);
+        assertEquals(t2.toString(), timeRes.toString());
+        assertEquals(t2.getTime(), timeRes.getTime());
+        assertEquals(t2, timeRes);
+        // DATE value
+        i = 18;
+        timeRes = res.getTimestamp(i);
+        assertEquals(t3.toString(), timeRes.toString());
+        assertEquals(t3.getTime(), timeRes.getTime());
+        assertEquals(t3, timeRes);
+
+        res.next();
+        assertNull(res.getTime(i));
+
+        try {
+            res.getTime(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    public void testGetTimestampIntCalendar() throws SQLException {
+        List<Timestamp> times = new LinkedList<Timestamp>();
+
+        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
+        Iterator<String> it = stringTimes.iterator();
+//        List<Calendar> cals = new LinkedList<Calendar>();
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis = cal2.getTime().getTime();
+        Timestamp t2 = new Timestamp(millis);
+        times.add(t2);
+        //
+         Calendar cal3 = new GregorianCalendar();
+          cal3.set(Calendar.YEAR, 1221);
+          cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
+          cal3.set(Calendar.DATE, 22);
+         cal3.set(Calendar.HOUR_OF_DAY, 10);
+         cal3.set(Calendar.MINUTE, 11);
+         cal3.set(Calendar.SECOND, 55);
+         cal3.set(Calendar.MILLISECOND, 0);
+
+         millis = cal3.getTime().getTime();
+         Timestamp t3 = new Timestamp(millis);
+         times.add(t3);
+
+//         cals.add(cal1);
+//         cals.add(cal2);
+//         cals.add(cal3);
+//
+//        ListIterator<Calendar> calIt = cals.listIterator();
+
+        int i = 17;
+
+        Timestamp timeRes = res.getTimestamp(i,new GregorianCalendar());
+        assertEquals(t2.toString(), timeRes.toString());
+        assertEquals(t2, timeRes);
+
+        i = 18;
+
+        timeRes = res.getTimestamp(i,new GregorianCalendar());
+        assertEquals(t3.toString(), timeRes.toString());
+        assertEquals(t3, timeRes);
+
+        res.next();
+        assertNull(res.getTime(17,cal2));
+        assertNull(res.getTime(18,cal3));
+
+        try {
+            res.getTime(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    public void testGetTimestampString() throws SQLException {
+        List<Timestamp> times = new LinkedList<Timestamp>();
+
+        List<String> stringTimes = Arrays.asList( "TS", "DT");
+        Iterator<String> it = stringTimes.iterator();
+//        List<Calendar> cals = new LinkedList<Calendar>();
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis = cal2.getTime().getTime();
+        Timestamp t2 = new Timestamp(millis);
+        times.add(t2);
+        //
+         Calendar cal3 = new GregorianCalendar();
+          cal3.set(Calendar.YEAR, 1221);
+          cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
+          cal3.set(Calendar.DATE, 22);
+         cal3.set(Calendar.HOUR_OF_DAY, 10);
+         cal3.set(Calendar.MINUTE, 11);
+         cal3.set(Calendar.SECOND, 55);
+         cal3.set(Calendar.MILLISECOND, 0);
+
+         millis = cal3.getTime().getTime();
+         Timestamp t3 = new Timestamp(millis);
+         times.add(t3);
+
+        String col = it.next();
+
+        Timestamp timeRes = res.getTimestamp(col);
+        assertEquals(t2.toString(), timeRes.toString());
+        assertEquals(t2.toString(), timeRes.toString());
+        assertEquals(t2.getTime(), timeRes.getTime());
+        assertEquals(t2, timeRes);
+        // DATE value
+        col = it.next();
+
+        timeRes = res.getTimestamp(col);
+        assertEquals(t3.toString(), timeRes.toString());
+        assertEquals(t3.toString(), timeRes.toString());
+        assertEquals(t3.getTime(), timeRes.getTime());
+        assertEquals(t3, timeRes);
+
+        res.next();
+        assertNull(res.getTime(stringTimes.get(0)));
+        assertNull(res.getTime(stringTimes.get(1)));
+
+        try {
+            res.getTime(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    public void testGetTimestampStringCalendar() throws SQLException {
+        List<Timestamp> times = new LinkedList<Timestamp>();
+
+        List<String> stringTimes = Arrays.asList( "TS", "DT");
+        Iterator<String> it = stringTimes.iterator();
+
+        Calendar cal2 = new GregorianCalendar();
+        cal2.set(Calendar.YEAR, 2007);
+        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
+        cal2.set(Calendar.DATE, 9);
+        cal2.set(Calendar.HOUR_OF_DAY, 14);
+        cal2.set(Calendar.MINUTE, 28);
+        cal2.set(Calendar.SECOND, 02);
+        cal2.set(Calendar.MILLISECOND, 0);
+
+        long millis = cal2.getTime().getTime();
+        Timestamp t2 = new Timestamp(millis);
+        times.add(t2);
+        //
+         Calendar cal3 = new GregorianCalendar();
+          cal3.set(Calendar.YEAR, 1221);
+          cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
+          cal3.set(Calendar.DATE, 22);
+         cal3.set(Calendar.HOUR_OF_DAY, 10);
+         cal3.set(Calendar.MINUTE, 11);
+         cal3.set(Calendar.SECOND, 55);
+         cal3.set(Calendar.MILLISECOND, 0);
+
+         millis = cal3.getTime().getTime();
+         Timestamp t3 = new Timestamp(millis);
+         times.add(t3);
+
+        Timestamp timeRes = res.getTimestamp(stringTimes.get(0),cal2);
+        assertEquals(t2.toString(), timeRes.toString());
+        assertEquals(t2.getTime(), timeRes.getTime());
+        assertEquals(t2, timeRes);
+            // DATE value
+        timeRes = res.getTimestamp(stringTimes.get(1),cal3);
+        assertEquals(t3.toString(), timeRes.toString());
+        assertEquals(t3.getTime(), timeRes.getTime());
+        assertEquals(t3, timeRes);
+
+        // calIt = cals.listIterator();
+
+        res.next();
+        assertNull(res.getTime(stringTimes.get(0),cal2));
+        assertNull(res.getTime(stringTimes.get(1),cal3));
+
+        try {
+            res.getTime(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    // res.close() does not wrap up
+    public void testGetType() throws SQLException {
+        assertEquals(ResultSet.TYPE_FORWARD_ONLY, res.getType());
+
+        try {
+            st.close();
+            res.getType();
+            fail("Exception not thrown.");
+        } catch (SQLException e) {
+            //ok
+        }
+
+    }
+
+    public void testGetURLInt() throws SQLException, MalformedURLException {
+        URL input = new URL("http://www.android.com");
+        URL validURL = res.getURL(29);
+        assertEquals(input, validURL);
+
+        try {
+            URL invalidURL = res.getURL(30);
+            assertNull(invalidURL);
+        } catch (SQLException e) {
+            // ok
+        }
+
+        res.next();
+        assertNull(res.getURL(29));
+        assertNull(res.getURL(30));
+
+        try {
+            res.getURL(500);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    public void testGetURLString() throws MalformedURLException, SQLException {
+        URL input = new URL("http://www.android.com");
+        URL validURL = res.getURL("validURL");
+        assertEquals(input, validURL);
+
+        try {
+            URL invalidURL = res.getURL("invalidURL");
+            assertNull(invalidURL);
+        } catch (SQLException e) {
+            // ok
+        }
+
+        res.next();
+        assertNull(res.getURL("validURL"));
+        assertNull(res.getURL("invalidURL"));
+
+        try {
+            res.getURL("bla");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+}
diff --git a/luni/src/test/java/tests/sql/ResultSetMetaDataTest.java b/luni/src/test/java/libcore/java/sql/OldResultSetMetaDataTest.java
similarity index 71%
rename from luni/src/test/java/tests/sql/ResultSetMetaDataTest.java
rename to luni/src/test/java/libcore/java/sql/OldResultSetMetaDataTest.java
index 429a75f..4dbcdfd 100755
--- a/luni/src/test/java/tests/sql/ResultSetMetaDataTest.java
+++ b/luni/src/test/java/libcore/java/sql/OldResultSetMetaDataTest.java
@@ -14,23 +14,15 @@
  * limitations under the License.
  */
 
-package tests.sql;
+package libcore.java.sql;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
-import java.io.IOException;
 import java.sql.ResultSet;
 import java.sql.ResultSetMetaData;
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.sql.Types;
 
-@TestTargetClass(ResultSetMetaData.class)
-public class ResultSetMetaDataTest extends SQLTest {
+public final class OldResultSetMetaDataTest extends OldSQLTest {
 
     ResultSetMetaData rsmd = null;
     Statement st = null;
@@ -53,7 +45,7 @@
     }
 
     @Override
-    public void tearDown() {
+    public void tearDown() throws SQLException {
         try {
             rs.close();
             st.close();
@@ -63,16 +55,7 @@
         super.tearDown();
     }
 
-    /**
-     * @test java.sql.ResultSetMetaData#getCatalogName(int column)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Catalog not supported.",
-        method = "getCatalogName",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
+    // not supported
     public void testGetCatalogName() throws SQLException {
         try {
             assertNotNull(rsmd.getCatalogName(1));
@@ -89,15 +72,6 @@
         }
     }
 
-    /**
-     * @test java.sql.ResultSetMetaData#getColumnClassName(int column)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getColumnClassName",
-        args = {int.class}
-    )
     public void testGetColumnClassName() {
         try {
             assertNotNull(rsmd);
@@ -123,16 +97,7 @@
         }
     }
 
-    /**
-     * @test java.sql.ResultSetMetaData#getColumnCount()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getColumnCount",
-        args = {}
-    )
-    @KnownFailure("SQLException checking test fails")
+    // SQLException checking test fails
     public void testGetColumnCount() {
         try {
             assertEquals(3, rsmd.getColumnCount());
@@ -150,16 +115,7 @@
 
     }
 
-    /**
-     * @test java.sql.ResultSetMetaData#getColumnLabel(int column)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getColumnLabel",
-        args = {int.class}
-    )
-    @KnownFailure("Column label has format TABLE.COLUMN expected: COLUMN")
+    // Column label has format TABLE.COLUMN expected: COLUMN
     public void testGetColumnLabel() {
         String[] labels = { "id", "name", "family" };
         try {
@@ -186,16 +142,7 @@
         }
     }
 
-    /**
-     * @test java.sql.ResultSetMetaData#getColumnName(int column)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getColumnName",
-        args = {int.class}
-    )
-    @KnownFailure("Column label has format TABLE.COLUMN expected: COLUMN")
+    // Column label has format TABLE.COLUMN expected: COLUMN
     public void testGetColumnName() {
         String[] labels = { "id", "name", "family" };
         try {
@@ -223,16 +170,8 @@
     }
 
     /**
-     * @test java.sql.ResultSetMetaData#getColumnType(int column)
-     *
-     * for extensive tests see: ResultSetGetterTest.testGetMetaData
+     * For extensive tests see: ResultSetGetterTest.testGetMetaData
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Not all types supported. More type checking done in ResultSetGetterTest.testGetMetaData",
-        method = "getColumnType",
-        args = {int.class}
-    )
     public void testGetColumnType() {
         int[] types = { Types.SMALLINT, Types.VARCHAR, Types.VARCHAR};
         try {
@@ -259,16 +198,8 @@
     }
 
     /**
-     * @test java.sql.ResultSetMetaData#getColumnTypeName(int column)
-     *
      * for extensive tests see: ResultSetGetterTest.testGetMetaData
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not all types supported: see ResultSetGetterTests.",
-        method = "getColumnTypeName",
-        args = {int.class}
-    )
     public void testGetColumnTypeName() {
         try {
             assertTrue("smallint".equalsIgnoreCase(rsmd.getColumnTypeName(1)));
@@ -292,17 +223,7 @@
         }
     }
 
-    /**
-     * @throws SQLException
-     * @test java.sql.ResultSetMetaData#getTableName(int column)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTableName",
-        args = {int.class}
-    )
-    @KnownFailure("For int = 0, exception expected")
+    // For int = 0, exception expected
     public void testGetTableName() throws SQLException {
         try {
             assertEquals("zoo", rsmd.getTableName(1));
@@ -348,16 +269,7 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.ResultSetMetaData#getPrecision(int column)}
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fails: always returns 0, exception tests fail ,failing statements commented out",
-        method = "getPrecision",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
+    // not supported
     public void testGetPrecision() throws SQLException {
         Statement st2 = null;
         Statement st3 = null;
@@ -424,17 +336,11 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#getScale(int column)}
+     * Always returns 0, exception tests fail no positive test case for
+     * black-box test possible: no default value indicated.
+     *
+     * Not supported
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail: always returns 0, exception tests fail"+
-        " no positive test case for black-box test possible: no default"+
-        " value indicated",
-        method = "getScale",
-        args = {int.class}
-    )
-    @KnownFailure("Not supported")
     public void testGetScale() throws SQLException {
         try {
         int scale = 3;
@@ -481,18 +387,8 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.ResultSetMetaData#getSchemaName(int column)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Tests fail: always returns null. Feature only partially implemented. Missing: positive test.",
-        method = "getSchemaName",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
+    // not supported
     public void testGetSchema() {
-
         try {
             assertNull("Functionality is now supported. Change test",rsmd.getSchemaName(2));
         } catch (SQLException e1) {
@@ -500,8 +396,6 @@
             e1.printStackTrace();
         }
 
-
-
         try {
             rsmd.getSchemaName(0);
             fail("SQLException is not thrown");
@@ -515,7 +409,6 @@
             // expected
         }
 
-
         try {
             conn.close();
             rsmd.getSchemaName(2);
@@ -527,17 +420,12 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#isAutoIncrement(int column)}
+     * Tests fail: always returns false, failing statements commented out.
+     * Feature only partially implemented.Missing: Test positive case
+     *
+     * Not supported.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Tests fail: always returns false, failing statements commented out. Feature only partially implemented.Missing: Test positive case",
-        method = "isAutoIncrement",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testisAutoIncrement() {
-
         try {
             assertFalse(rsmd.isAutoIncrement(1));
         } catch (SQLException e1) {
@@ -572,18 +460,8 @@
 
     }
 
-    /**
-     * @test {@link java.sql.ResultSetMetaData#isCaseSensitive(int column)}
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail: always returns false. Exception tests fail, failing statements commented out. Feature only partially implemented.",
-        method = "isCaseSensitive",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
+    // not supported
     public void testIsCaseSensitive() {
-
         try {
             assertFalse(rsmd.isCaseSensitive(1));
             assertFalse(rsmd.isCaseSensitive(2));
@@ -620,17 +498,13 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#isCurrency(int column)}
+     * Tests fail: always returns false. Exceptions and tests non Numeric fields
+     * fail, failing statements commented out. Feature only partially
+     * implemented. May be an optional feature.
+     *
+     * Not supported.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Tests fail: always returns false. Exceptions and tests non Numeric fields fail, failing statements commented out. Feature only partially implemented. May be an optional feature.",
-        method = "isCurrency",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testIsCurrency() {
-
         try {
             assertFalse(rsmd.isCurrency(1));
         } catch (SQLException e1) {
@@ -638,9 +512,7 @@
             e1.printStackTrace();
         }
 
-
         // Exception testing
-
         try {
             rsmd.isCurrency(0);
             fail("SQLException is not thrown");
@@ -654,7 +526,6 @@
             // expected
         }
 
-
         try {
             rs.close();
             rsmd.isCurrency(1);
@@ -664,18 +535,8 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.ResultSetMetaData#isDefinitelyWritable(int column)}
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail: always returns true. Exceptions fail, Feature only partially implemented.",
-        method = "isDefinitelyWritable",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
+    // not supported
     public void testIsDefinitlyWritable() {
-
         try {
             assertTrue(rsmd.isDefinitelyWritable(1));
         } catch (SQLException e1) {
@@ -701,17 +562,13 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#isNullable(int column)}
+     * Tests fail: always returns ResultSetMetaData.columnNullableUnknown.
+     * Exceptions fail, failing statements commented out. Feature only
+     * partially implemented. May be an optional feature.
+     *
+     * Not supported.
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail: always returns ResultSetMetaData.columnNullableUnknown. Exceptions fail, failing statements commented out. Feature only partially implemented. May be an optional feature.",
-        method = "isNullable",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testIsNullable() {
-
         try {
             assertEquals(ResultSetMetaData.columnNullable, rsmd
                     .isNullable(1));
@@ -744,17 +601,10 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#isReadOnly(int column)}
+     * Cannot know from blackbox test if readonly or writable. Exceptions fail,
+     * Feature only partially implemented.
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "Cannot know from blackbox test if readonly or writable. Exceptions fail, Feature only partially implemented.",
-        method = "isReadOnly",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testIsReadOnly() {
-
         try {
             assertFalse(rsmd.isReadOnly(1));
         } catch (SQLException e1) {
@@ -773,17 +623,10 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#isSearchable(int column)}
+     * Tests fail: always returns false. Exceptions fail, Feature only partially
+     * implemented. Missing: test for searchable field.
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail: always returns false. Exceptions fail, Feature only partially implemented. Missing: test for searchable field.",
-        method = "isSearchable",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testIsSearchable() {
-
         try {
             assertTrue(rsmd.isSearchable(1));
             assertTrue(rsmd.isSearchable(2));
@@ -804,17 +647,11 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#isSigned(int column)}
+     * Tests fail: always returns false. Exceptions and tests on non numeric
+     * fields fail, Feature only partially implemented. Missing: test positive
+     * result
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail: always returns false. Exceptions and tests on non numeric fields fail, Feature only partially implemented. Missing: test positive result.",
-        method = "isSigned",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testIsSigned() {
-
         try {
             assertFalse(rsmd.isSigned(1));
         } catch (SQLException e1) {
@@ -833,17 +670,11 @@
     }
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#isWritable(int column)}
+     * Analogous to is Readonly.  Exceptions and tests on non numeric fields
+     * fail, Failing statements commented out. Feature only partially
+     * implemented.
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "Analaguous to is Readonly.  Exceptions and tests on non numeric fields fail, failing statements commented out. Feature only partially implemented.",
-        method = "isWritable",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testIsWritable() {
-
         try {
             assertTrue(rsmd.isWritable(1));
             assertTrue(rsmd.isWritable(2));
@@ -865,16 +696,8 @@
 
 
     /**
-     * @test {@link java.sql.ResultSetMetaData#getColumnDisplaySize(int Column)}
+     * Tests fail. always returns 0. Missing case where display size greater than 0
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail. always returns 0. Missing case where display"+
-        " size greater than 0",
-        method = "getColumnDisplaySize",
-        args = {int.class}
-    )
-    @KnownFailure("not supported")
     public void testGetColumnDisplaySize() {
         try {
             for (int i = 0; i < rsmd.getColumnCount(); i++) {
diff --git a/luni/src/test/java/libcore/java/sql/OldResultSetTest.java b/luni/src/test/java/libcore/java/sql/OldResultSetTest.java
new file mode 100644
index 0000000..ea18db6
--- /dev/null
+++ b/luni/src/test/java/libcore/java/sql/OldResultSetTest.java
@@ -0,0 +1,482 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.sql;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import tests.support.DatabaseCreator;
+
+public final class OldResultSetTest extends OldSQLTest {
+
+    ResultSet target = null;
+    ResultSet emptyTarget = null;
+    ResultSet scrollableTarget = null;
+    ResultSet writableTarget = null;
+    Statement stForward = null;
+    Statement stScrollable = null;
+    Statement stWritable = null;
+    final String selectAllAnimals = "select id, name from zoo";
+    final String selectEmptyTable = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
+
+    @Override public void setUp() throws Exception {
+        super.setUp();
+
+        conn.setAutoCommit(false);
+        stForward = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
+                ResultSet.CONCUR_READ_ONLY);
+        stForward.execute(selectAllAnimals);
+        target = stForward.getResultSet();
+        assertNotNull(target);
+
+        // empty table
+        stForward = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
+                ResultSet.CONCUR_READ_ONLY);
+        stForward.execute(DatabaseCreator.CREATE_TABLE_SIMPLE1);
+        stForward.execute(selectEmptyTable);
+        emptyTarget = stForward.getResultSet();
+    }
+
+    public void tearDown() throws SQLException {
+        super.tearDown();
+        target.close();
+        stForward.close();
+    }
+
+    public void testAbsolute() throws SQLException {
+        assertTrue(target.isBeforeFirst());
+        assertFalse(target.absolute(0));
+        assertTrue(target.absolute(1));
+        assertTrue(target.isFirst());
+        assertTrue(target.absolute(-1));
+        assertTrue(target.isLast());
+        target.next();
+        assertTrue(target.isAfterLast());
+    }
+
+    // res.close() does not wrap up
+    public void testAfterLast() throws SQLException {
+        target.afterLast();
+        assertTrue(target.isAfterLast());
+        assertFalse(target.next());
+
+        emptyTarget.afterLast();
+        assertFalse(emptyTarget.isAfterLast());
+
+        try {
+            target.close();
+            target.beforeFirst();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+        }
+    }
+
+    // statement.close() does not wrap up
+    public void testBeforeFirst() throws SQLException {
+        target.beforeFirst();
+        assertTrue(target.isBeforeFirst());
+        assertTrue(target.next());
+        assertFalse(target.isBeforeFirst());
+
+        emptyTarget.beforeFirst();
+        assertFalse(emptyTarget.isBeforeFirst());
+
+        try {
+            target.close();
+            target.beforeFirst();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+        }
+    }
+
+    /**
+     * According to the JDBC spec close has to "Releases this ResultSet
+     * object's database and JDBC resources immediately", and this implies
+     * the fields should be released as well (so that garbage collection
+     *  can take place)
+     */
+    public void testClose1() {
+        try {
+            target.close();
+            target.next();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    /**
+     * Test that exception in one prepared statement does not affect second
+     * statement. (Atomicity Rule)
+     */
+    public void testClose() throws SQLException {
+        PreparedStatement ps1 = null;
+        PreparedStatement ps2 = null;
+        try {
+            Statement s = conn.createStatement();
+            s.addBatch("create table t1 (a text);");
+
+            s.addBatch("insert into t1 values('abc');");
+            s.addBatch("insert into t1 values('def');");
+            s.addBatch("insert into t1 values('ghi');");
+            s.executeBatch();
+            s.close();
+
+            conn.commit();
+            ps1 = conn.prepareStatement("select * from t1");
+            ps2 = conn.prepareStatement("select * from t1 whe a like '?000'");
+
+            ResultSet rs1 = ps1.executeQuery();
+            try {
+                ResultSet rs2 = ps2.executeQuery();
+                while (rs2.next()){
+                    // do nothing
+                }
+                fail("Should get SQLException");
+            } catch (SQLException sqle) {
+                // ok : Division by zero
+            }
+
+            // Although exception happened on ps2 rs1 should still work
+            // Isolation property if ACID rules
+
+            while (rs1.next()) {
+                // do nothing: switching of rows should be possible
+            }
+
+            conn.commit();
+
+            rs1.close();
+            ps1.close();
+            ps2.close();
+        } finally {
+            try {
+                if (ps1 != null) ps1.close();
+                if (ps2 != null) ps2.close();
+                conn.rollback();
+            } catch (SQLException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public void testFindColumn() throws SQLException {
+        assertEquals(1, target.findColumn("id"));
+        assertEquals(2, target.findColumn("name"));
+
+        try {
+            target.findColumn("bla");
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    // statement.close() does not wrap up
+    public void testtestFirst() throws SQLException {
+        assertFalse(emptyTarget.first());
+        assertTrue(target.first());
+
+        try {
+            target.close();
+            // releases all resources such that it can be finalized!
+            target.first();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+        }
+    }
+
+    // statement.close() does not wrap up
+    public void testtestIsAfterLast() throws SQLException {
+        assertFalse(target.isAfterLast());
+        target.absolute(-1); // last
+        target.next();
+        assertTrue(target.isAfterLast());
+        assertFalse(emptyTarget.isAfterLast());
+
+        try {
+            target.close();
+            // releases all resources such that it can be finalized!
+            target.isAfterLast();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+        }
+    }
+
+    // In Second code block assertion fails. statement.close() does not wrap up
+    public void testtestIsBeforeFirst() throws SQLException {
+        assertTrue(target.isBeforeFirst());
+        assertTrue(target.next());
+        assertFalse(target.isBeforeFirst());
+        assertTrue(target.isFirst());
+        assertTrue(emptyTarget.isBeforeFirst());
+
+        try {
+            target.close();
+            // releases all resources such that it can be finalized!
+            target.isBeforeFirst();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    // statement.close() does not wrap up
+    public void testtestIsFirst() throws SQLException {
+        assertFalse(target.isFirst());
+        target.first();
+        assertTrue(target.isFirst());
+        target.next();
+        assertFalse(target.isFirst());
+
+        assertFalse(emptyTarget.isFirst());
+
+        try {
+            target.close();
+            // releases all resources such that it can be finalized!
+            target.isFirst();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+        }
+    }
+
+    /**
+     * Second block first assertion fails. Is Last should evaluate true if the
+     * row on which the cursor is actually provides a result.statment.close()
+     * does not wrap up
+     */
+    public void testtestIsLast() throws SQLException {
+        assertFalse(target.isLast());
+        target.absolute(-1);
+        assertTrue(target.isLast());
+
+        //check default value no valid row
+        assertFalse(emptyTarget.isLast());
+        assertFalse(emptyTarget.next());
+        assertFalse(emptyTarget.isLast());
+
+        try {
+            target.close();
+            target.isLast();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    // statement.close() does not wrap up
+    public void testtestLast() throws SQLException {
+        assertFalse(target.isLast());
+        target.last();
+        assertTrue(target.isLast());
+
+        try {
+            target.close();
+            target.last();
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+            // ok
+        }
+    }
+
+    /**
+     * SQLException checking test fails. Clearing of warnings and closed streams
+     * not supported.
+     */
+    public void testNext() throws SQLException {
+        //before first - first
+        assertTrue(target.next());
+        //first - second
+        assertTrue(target.next());
+        //after last
+        assertFalse(target.next());
+        assertTrue(target.isAfterLast());
+        // one more
+        assertFalse(target.next());
+
+        assertFalse(emptyTarget.next());
+
+        target.close();
+        try {
+            target.next();
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    public void testPrevious() throws SQLException {
+        target.first();
+        target.previous();
+        assertTrue(target.isBeforeFirst());
+
+        target.last();
+        target.next();
+        target.previous();
+        assertFalse(target.isAfterLast());
+
+        target.close();
+        try {
+            target.previous();
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    // no exception is thrown when moving cursor backwards on forward only statement
+    public void testRelative() throws SQLException {
+
+        // forward only
+        int initialRow = target.getRow();
+        assertFalse(target.relative(0));
+        assertEquals(initialRow, target.getRow());
+
+        assertTrue(target.relative(1));
+        assertTrue(target.isFirst());
+        assertEquals(1, target.getRow());
+
+        assertTrue(target.relative(1));
+        assertFalse(target.isFirst());
+        assertEquals(2, target.getRow());
+        assertFalse(target.relative(2));
+
+        try {
+            // should not be able to scroll backwards in forward only RS
+            target.relative(-2);
+            assertEquals(2,target.getRow());
+            fail("Should get SQLException");
+        } catch (SQLException e) {
+            // ok
+        } catch (Exception e) {
+            fail("Unexpected exception: " + e.getMessage());
+        }
+
+        assertFalse(emptyTarget.relative(Integer.MAX_VALUE));
+        assertTrue(emptyTarget.isAfterLast());
+    }
+
+    // Scrollable resultSet. Not supported
+    public void testRelativeScrollableResultSet() throws SQLException {
+     // scrollable resultSet
+        int initialRow = scrollableTarget.getRow();
+        assertFalse(scrollableTarget.relative(0));
+        assertEquals(initialRow, scrollableTarget.getRow());
+
+        assertTrue(scrollableTarget.relative(1));
+        assertTrue(scrollableTarget.isFirst());
+        assertEquals(1, scrollableTarget.getRow());
+
+        assertTrue(scrollableTarget.relative(1));
+        assertFalse(scrollableTarget.isFirst());
+
+        assertEquals(2, scrollableTarget.getRow());
+        assertFalse(scrollableTarget.relative(2));
+        scrollableTarget.relative(-2);
+        assertEquals(2,scrollableTarget.getRow());
+
+        assertFalse(scrollableTarget.relative(Integer.MIN_VALUE));
+        assertTrue(scrollableTarget.isBeforeFirst());
+
+        stScrollable.close();
+        try {
+            scrollableTarget.relative(1);
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    // not supported
+    public void testUpdateObjectStringObject() throws SQLException {
+        writableTarget.next();
+        writableTarget.updateObject("family","bird");
+
+        try {
+           target.next();
+           target.updateObject("family","bird");
+           fail("SQLException was not thrown");
+        } catch (SQLException e) {
+           fail("Unexpected exception: " + e.getMessage());
+        }
+    }
+
+    /**
+     * Only exception testing. Missing testing for wrong type
+     */
+    public void testUpdateStringStringString() throws Exception {
+        writableTarget.next();
+        writableTarget.updateString("family","bird");
+
+         // non writable target.
+         try {
+            target.next();
+            target.updateString("family","bird");
+            fail("SQLException was not thrown");
+         } catch (SQLException e) {
+            //ok
+         }
+
+
+         // writable but wrong type
+        target.updateString(1,"test");
+
+        target.close();
+
+        // Exception test
+        try {
+            target.updateString("family", "test");
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+
+    /**
+     * Test method for {@link java.sql.ResultSet#wasNull()}.
+     * Spec sais: if something was read... -> if nothing was read it should be false
+     */
+    public void testWasNull() throws SQLException {
+        // Check default: select statement executed but no get on target called yet
+        // Either false or throw an exception.
+        try {
+            assertFalse(target.wasNull());
+        } catch (SQLException e) {
+            //ok
+        }
+
+        stForward.execute("insert into zoo values(8,null,null);");
+        stForward.execute(selectAllAnimals);
+        target = stForward.getResultSet();
+        assertNotNull(target);
+        assertTrue(target.last());
+        assertNull(target.getObject(2));
+        assertTrue(target.wasNull());
+        assertNotNull(target.getObject(1));
+        assertFalse(target.wasNull());
+
+        target.close();
+        try {
+            target.wasNull();
+            fail("Exception expected");
+        } catch (SQLException e) {
+            //ok
+        }
+    }
+}
diff --git a/luni/src/test/java/tests/sql/SQLTest.java b/luni/src/test/java/libcore/java/sql/OldSQLTest.java
similarity index 68%
rename from luni/src/test/java/tests/sql/SQLTest.java
rename to luni/src/test/java/libcore/java/sql/OldSQLTest.java
index 1b7d241..0a45447 100755
--- a/luni/src/test/java/tests/sql/SQLTest.java
+++ b/luni/src/test/java/libcore/java/sql/OldSQLTest.java
@@ -14,26 +14,20 @@
  * limitations under the License.
  */
 
-package tests.sql;
-
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
+package libcore.java.sql;
 
 import java.io.File;
-import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import junit.framework.TestCase;
 
-@TestTargetClass(Statement.class)
-public class SQLTest extends TestCase {
+public abstract class OldSQLTest extends TestCase {
     static Connection conn;
 
-    @Override
-    public void setUp() throws Exception {
+    @Override public void setUp() throws Exception {
         getSQLiteConnection();
         createZoo();
     }
@@ -42,7 +36,6 @@
 
     protected void getSQLiteConnection() throws Exception {
         String tmp = System.getProperty("java.io.tmpdir");
-        assertEquals(tmp, System.getProperty("java.io.tmpdir"));
         File tmpDir = new File(tmp);
         if (tmpDir.isDirectory()) {
             dbFile = File.createTempFile("sqliteTest", ".db", tmpDir);
@@ -56,16 +49,13 @@
         assertNotNull("Connection created ", conn);
     }
 
-    @Override
-    public void tearDown() {
+    @Override public void tearDown() throws SQLException {
         Statement st = null;
         try {
             if (! conn.isClosed()) {
                 st = conn.createStatement();
                 st.execute("drop table if exists zoo");
             }
-        } catch (SQLException e) {
-            fail("Couldn't drop table: " + e.getMessage());
         } finally {
             try {
                 if (st != null) {
@@ -78,8 +68,7 @@
         }
     }
 
-    public void createZoo() {
-
+    public void createZoo() throws SQLException {
         String[] queries = {
                 "create table zoo(id smallint,  name varchar(10), family varchar(10))",
                 "insert into zoo values (1, 'Kesha', 'parrot')",
@@ -91,9 +80,6 @@
             for (int i = 0; i < queries.length; i++) {
                 st.execute(queries[i]);
             }
-        } catch (SQLException e) {
-            e.printStackTrace();
-            fail("Unexpected exception: " + e.getMessage());
         } finally {
             try {
                 if (st != null) {
@@ -103,25 +89,6 @@
         }
     }
 
-    public void createProcedure() {
-        String proc = "CREATE PROCEDURE welcomeAnimal (IN parameter1 integer, IN parameter2 char(20), IN parameter3 char(20)) "
-                + " BEGIN "
-                + " INSERT INTO zoo(id, name, family) VALUES (parameter1, parameter2, parameter3); "
-                + "SELECT * FROM zoo;" + " END;";
-        Statement st = null;
-        try {
-            st = conn.createStatement();
-            st.execute("DROP PROCEDURE IF EXISTS welcomeAnimal");
-            st.execute(proc);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        } finally {
-            try {
-                st.close();
-             } catch (SQLException ee) {}
-        }
-    }
-
     public int getCount(ResultSet rs) {
         int count = 0;
         try {
diff --git a/luni/src/test/java/tests/sql/StatementTest.java b/luni/src/test/java/libcore/java/sql/OldStatementTest.java
similarity index 63%
rename from luni/src/test/java/tests/sql/StatementTest.java
rename to luni/src/test/java/libcore/java/sql/OldStatementTest.java
index d41a875..0130e3d 100755
--- a/luni/src/test/java/tests/sql/StatementTest.java
+++ b/luni/src/test/java/libcore/java/sql/OldStatementTest.java
@@ -14,13 +14,7 @@
  * limitations under the License.
  */
 
-package tests.sql;
-
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
+package libcore.java.sql;
 
 import java.sql.BatchUpdateException;
 import java.sql.PreparedStatement;
@@ -29,25 +23,12 @@
 import java.sql.SQLFeatureNotSupportedException;
 import java.sql.SQLWarning;
 import java.sql.Statement;
-import java.util.Arrays;
-import java.util.List;
 import java.util.Vector;
 import java.util.logging.Logger;
 
-@TestTargetClass(Statement.class)
-public class StatementTest extends SQLTest {
+public final class OldStatementTest extends OldSQLTest {
 
-    /**
-     * @test java.sql.Statement#addBatch(String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addBatch",
-        args = {java.lang.String.class}
-    )
     public void testAddBatch() throws SQLException {
-
         Statement st = null;
         try {
             st = conn.createStatement();
@@ -58,9 +39,6 @@
             assertEquals(2, updateCounts.length);
             assertEquals(1, updateCounts[0]);
             assertEquals(1, updateCounts[1]);
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 st.close();
@@ -96,16 +74,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#clearWarnings()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clearWarnings",
-        args = {}
-    )
-    public void testClearWarnings() {
+    public void testClearWarnings() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
@@ -123,8 +92,6 @@
             st.clearWarnings();
             SQLWarning w = st.getWarnings();
             assertNull(w);
-        } catch (Exception e) {
-            fail("Unexpected Exception: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -133,18 +100,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#getWarnings()
-     *
-     * TODO getWarnings is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported. always returns null. ",
-        method = "getWarnings",
-        args = {}
-    )
-    public void testGetWarnings() {
+    public void testGetWarnings() throws SQLException {
 
         Statement st = null;
         int errorCode1 = -1;
@@ -159,12 +115,9 @@
             errorCode1 = e.getErrorCode();
         }
 
-        try {
-            SQLWarning wrs = st.getWarnings();
-            assertNull(wrs);
-        } catch (Exception e) {
-            fail("Change test implementation: get warnings is supported now");
-        }
+        SQLWarning wrs = st.getWarnings();
+        assertNull(wrs);
+
         /*
         Statement st = null;
         int errorCode1 = -1;
@@ -207,17 +160,7 @@
 
     }
 
-    /**
-     * @test {@link java.sql.Statement#clearBatch()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clearBatch",
-        args = {}
-    )
     public void testClearBatch() throws SQLException {
-
         Statement st = null;
 
         try {
@@ -232,9 +175,6 @@
             for (int i = 0; i < updateCounts.length; i++) {
                 assertEquals(0, updateCounts[i]);
             }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 st.close();
@@ -270,19 +210,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#execute(String sql)
-     *
-     * TODO not pass on SQLite and RI.
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Return value wrong for queries below.")
+    // TODO not pass on SQLite and RI.
     public void testExecute() throws SQLException {
 
         String[] queries = {
@@ -337,16 +265,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#execute(String sql, int autoGeneratedKeys)
-     * TODO not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Missing implementation for Statement.RETURN_GENERATED_KEYS: keys not yet supported",
-        method = "execute",
-        args = {java.lang.String.class, int.class}
-    )
+    // TODO not supported
    public void testExecute_String_int() {
         String[] queries = {
                 "update zoo set name='Masha', family='cat' where id=2;",
@@ -399,23 +318,12 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#getConnection()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "getConnection",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testGetConnection() {
+    // statement.close() does not wrap up
+    public void testGetConnection() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
             assertSame(conn, st.getConnection());
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -430,27 +338,14 @@
         } catch (SQLException e) {
             //ok
         }
-
-
     }
 
-    /**
-     * @test java.sql.Statement#getFetchDirection()
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "SQLException test fails. Not all Fetch directions supported.",
-        method = "getFetchDirection",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testGetFetchDirection() {
+    // statement.close() does not wrap up
+    public void testGetFetchDirection() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
             assertEquals(ResultSet.FETCH_UNKNOWN, st.getFetchDirection());
-        } catch (SQLException e) {
-            fail("SQLException is thrown " + e.getMessage());
         }  finally {
             try {
                 st.close();
@@ -480,16 +375,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#setFetchDirection(int)
-     * TODO not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported. ",
-        method = "setFetchDirection",
-        args = {int.class}
-    )
+    // TODO not supported
     public void testSetFetchDirection() {
         Statement st = null;
         try {
@@ -507,55 +393,15 @@
             } catch (SQLException ee) {
             }
         }
-
-        /*
-        try {
-            st = conn.createStatement();
-            st.setFetchDirection(-1);
-            fail("SQLException is not thrown");
-        } catch (SQLException e) {
-            // expected
-        }  finally {
-            try {
-                st.close();
-            } catch (SQLException ee) {
-            }
-        }
-
-        try {
-            st = conn.createStatement();
-            st.setFetchDirection(100);
-            fail("SQLException is not thrown");
-        } catch (SQLException e) {
-            // expected
-        } finally {
-            try {
-                st.close();
-            } catch (SQLException ee) {
-            }
-        }
-
-        */
     }
 
-    /**
-     * @test java.sql.Statement#getFetchSize()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "getFetchSize",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testGetFetchSize() {
+    // statement.close() does not wrap up
+    public void testGetFetchSize() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
             st.execute("select * from zoo;");
             assertEquals(1, st.getFetchSize());
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 st.close();
@@ -572,17 +418,8 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#setFetchSize(int)}
-     * TODO not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported.",
-        method = "setFetchSize",
-        args = {int.class}
-    )
-    public void testSetFetchSize() {
+    // TODO not supported
+    public void testSetFetchSize() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
@@ -605,8 +442,6 @@
             }
             */
 
-        } catch (SQLException e) {
-            fail("SQLException is thrown");
         } finally {
             try {
                 st.close();
@@ -615,17 +450,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#setMaxFieldSize(int max)
-     * TODO not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "setMaxFieldSize",
-        args = {int.class}
-    )
-    public void testSetMaxFieldSize() {
+    // TODO not supported
+    public void testSetMaxFieldSize() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
@@ -636,20 +462,8 @@
                     fail("Revise test implemenation for feature impl. has changed");
                 } catch (SQLException sqle) {
                     assertEquals("not supported", sqle.getMessage());
-//                    fail("SQLException is thrown: " + sqle.getMessage());
                 }
             }
-            /*
-            try {
-                st.setMaxFieldSize(-1);
-                fail("SQLException isn't thrown");
-            } catch (SQLException sqle) {
-                // expecteds
-            }
-            */
-        } catch (SQLException e) {
-            fail("Can't create statement, SQLException is thrown: "
-                    + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -658,17 +472,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#getMaxFieldSize()
-     * TODO not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxFieldSize",
-        args = {}
-    )
-    public void testGetMaxFieldSize() {
+    // TODO not supported
+    public void testGetMaxFieldSize() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
@@ -678,12 +483,8 @@
                     fail("Revise test implemenation for feature impl. has changed");
                 } catch (SQLException sqle) {
                     assertEquals("not supported", sqle.getMessage());
- //                   fail("SQLException is thrown: " + sqle.getMessage());
                 }
             }
-        } catch (SQLException e) {
-            fail("Can't create statement, SQLException is thrown: "
-                    + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -692,29 +493,25 @@
         }
     }
 
-    public void testMaxRows() {
+    public void testMaxRows() throws SQLException {
         Statement st = null;
         try {
             st = conn.createStatement();
             for (int i = 0; i < 300; i += 50) {
-                try {
-                    st.setMaxRows(i);
-                    assertEquals(i, st.getMaxRows());
-                    ResultSet r = st.executeQuery("select * from zoo;");
-                    int rowCount = 0;
-                    while (r.next()) {
-                        ++rowCount;
-                    }
-                    if (i == 0) {
-                        // 0 means unlimited.
-                        assertTrue("rowCount=" + rowCount + " i=" + i, rowCount > i);
-                    } else {
-                        assertTrue("rowCount=" + rowCount + " i=" + i, rowCount <= i);
-                    }
-                    r.close();
-                } catch (SQLException sqle) {
-                    fail("SQLException is thrown: " + sqle.getMessage());
+                st.setMaxRows(i);
+                assertEquals(i, st.getMaxRows());
+                ResultSet r = st.executeQuery("select * from zoo;");
+                int rowCount = 0;
+                while (r.next()) {
+                    ++rowCount;
                 }
+                if (i == 0) {
+                    // 0 means unlimited.
+                    assertTrue("rowCount=" + rowCount + " i=" + i, rowCount > i);
+                } else {
+                    assertTrue("rowCount=" + rowCount + " i=" + i, rowCount <= i);
+                }
+                r.close();
             }
             try {
                 st.setMaxRows(-1);
@@ -722,9 +519,6 @@
             } catch (SQLException sqle) {
                 // expecteds
             }
-        } catch (SQLException e) {
-            fail("Can't create statement, SQLException is thrown: "
-                    + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -733,19 +527,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#close()
-     * not passed according to Java Docs: should release all resources
-     * IMMEDIATELY
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "close",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testClose() {
+    /** not passed according to spec; should release resources immediately */
+    public void testClose() throws SQLException {
         Statement st = null;
         ResultSet res = null;
         try {
@@ -762,8 +545,6 @@
             assertNotNull(res);
             assertTrue(res.next());
             st.close();
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -781,19 +562,9 @@
         } catch (SQLException e) {
             // ok
         }
-
     }
 
-    /**
-     * @test java.sql.Statement#execute(String sql, int[] columnIndexes)
-     * TODO not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "execute",
-        args = {java.lang.String.class, int[].class}
-    )
+    // TODO not supported
     public void testExecute_String_intArray() {
         Statement st = null;
         try {
@@ -830,15 +601,6 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#execute(String sql, String[] columnNames)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "execute",
-        args = {java.lang.String.class, java.lang.String[].class}
-    )
     public void testExecute_String_StringArray() {
         Statement st = null;
         try {
@@ -871,17 +633,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#executeBatch()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Test fails: dropping table hutch affects at least 2 rows.executeBatch() always returns same result: 1.",
-        method = "executeBatch",
-        args = {}
-    )
-    @KnownFailure("always returns 1 for no. of updates")
-    public void testExecuteBatch() {
+    // always returns 1 for no. of updates
+    public void testExecuteBatch() throws SQLException {
 
         String[] queries = {
                 "update zoo set name='Masha', family='cat' where id=2;",
@@ -912,8 +665,6 @@
             fail("BatchupdateException expected");
         } catch (BatchUpdateException e) {
             //ok
-        } catch (SQLException e) {
-            fail("BatchupdateException expected");
         } finally {
             try {
                 st.close();
@@ -929,8 +680,6 @@
             }
             int[] resArray = st.executeBatch();
             assertTrue(java.util.Arrays.equals(result, resArray));
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -945,8 +694,6 @@
             fail("Exception expected");
         } catch (BatchUpdateException bue) {
             // ok select returns a resultSet
-        } catch (SQLException sqle) {
-            fail("Unknown SQLException is thrown: " + sqle.getMessage());
         } finally {
             try {
                 st.close();
@@ -963,17 +710,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#executeQuery(String sql)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Not according to spec.",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Does throw an exception on non select statment.")
-    public void testExecuteQuery_String() {
+    // Does throw an exception on non select statement.
+    public void testExecuteQuery_String() throws SQLException {
 
         String[] queries1 = { "select * from zoo",
                 "select name, family from zoo where id = 1" };
@@ -999,8 +737,6 @@
                     fail("SQLException is thrown for query: " + queries1[i]);
                 }
             }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -1021,30 +757,19 @@
                     // expected
                 }
             }
-        } catch (SQLException sqle) {
-            fail("Unknown SQLException is thrown: " + sqle.getMessage());
         } finally {
             try {
                 st.close();
             } catch (Exception ee) {
             }
         }
-
     }
 
     /**
-     * @throws SQLException
-     * @test java.sql.Statement#executeUpdate(String sql)
+     * Spec is not precise enough: should be: number of rows affected. eg. to be
+     * consistent for deletes: 'delete from s1;' should be different from
+     * 'delete from s1 where c1 = 1;'
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "impl not according to spec.",
-        method = "executeUpdate",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Spec is not precise enough: should be: number of rows affected."+
-            " eg. to be consistent for deletes: 'delete from s1;' should be different from "+
-            "'delete from s1 where c1 = 1;' ")
     public void testExecuteUpdate_String() throws SQLException {
 
         String[] queries1 = {
@@ -1062,22 +787,12 @@
         try {
             st = conn.createStatement();
             for (int i = 0; i < queries1.length; i++) {
-                try {
-                    int count = st.executeUpdate(queries1[i]);
-                    assertTrue(count > 0);
-                } catch (SQLException e) {
-                    fail("SQLException is thrown: " + e.getMessage());
-                }
+                int count = st.executeUpdate(queries1[i]);
+                assertTrue(count > 0);
             }
 
-            try {
-               assertEquals(0, st.executeUpdate(queries2));
-            } catch (SQLException e) {
-               fail("SQLException is thrown: " + e.getMessage());
-            }
+            assertEquals(0, st.executeUpdate(queries2));
 
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -1098,7 +813,7 @@
         assertEquals(1,stat.executeUpdate("delete from s1 where c1 = 1;"));
         assertEquals(2, stat.executeUpdate("update s1 set c1 = 5;"));
 
-        // analogous to statemente before, delete all should return 2
+        // analogous to statement before, delete all should return 2
         assertEquals(2,stat.executeUpdate("delete from s1;"));
 
         // there are no rows in table: 0 should be returned
@@ -1115,17 +830,7 @@
         stat.close();
     }
 
-    /**
-     * @test java.sql.Statement#executeUpdate(String sql, int[] columnIndexes)
-     *
-     * TODO executeUpdate(String sql, int[] columnIndexes) is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "executeUpdate",
-        args = {java.lang.String.class, int[].class}
-    )
+    // TODO executeUpdate(String sql, int[] columnIndexes) is not supported
     public void testExecuteUpdate_String_intArray() throws SQLException {
         Statement st = null;
         try {
@@ -1163,17 +868,7 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#executeUpdate(String sql, int autoGeneratedKeys)
-     *
-     * TODO  executeUpdate(String sql, int autoGeneratedKeys) is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported",
-        method = "executeUpdate",
-        args = {java.lang.String.class, int.class}
-    )
+    // executeUpdate(String sql, int autoGeneratedKeys) is not supported
     public void testExecuteUpdate_String_int() {
         String[] queries = {
                 "update zoo set name='Masha', family='cat' where id=2;",
@@ -1220,17 +915,7 @@
             }
     }
 
-    /**
-     * @test java.sql.Statement#executeUpdate(String sql, String[] columnNames)
-     *
-     * TODO executeUpdate(String sql, String[] columnNames) is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "executeUpdate",
-        args = {java.lang.String.class, java.lang.String[].class}
-    )
+    // TODO executeUpdate(String sql, String[] columnNames) is not supported
     public void testExecuteUpdate_String_StringArray() throws SQLException {
         Statement st = null;
         try {
@@ -1271,17 +956,8 @@
         }
     }
 
-    /**
-     * @test java.sql.Statement#getUpdateCount()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "getUpdateCount",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testGetUpdateCount() {
+    // statement.close() does not wrap up
+    public void testGetUpdateCount() throws SQLException {
         Statement st = null;
         try {
             String query = "update zoo set name='Masha', family='cat' where id=2;";
@@ -1291,8 +967,6 @@
             query = "update zoo set name='Masha', family='cat' where id=5;";
             st.executeUpdate(query);
             assertEquals(0, st.getUpdateCount());
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -1308,17 +982,6 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#getGeneratedKeys()}
-     *
-     * TODO getGeneratedKeys() is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported",
-        method = "getGeneratedKeys",
-        args = {}
-    )
     public void testGeneratedKeys() throws SQLException {
         Statement st = null;
         try {
@@ -1331,17 +994,7 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#setCursorName(String)}
-     *
-     * TODO setCursorName() is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported",
-        method = "setCursorName",
-        args = {java.lang.String.class}
-    )
+    // TODO setCursorName() is not supported
     public void testSetCursorName() throws SQLException {
         Statement st = null;
         try {
@@ -1354,17 +1007,7 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#setEscapeProcessing}
-     *
-     * TODO setExcapeProcessing() is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported",
-        method = "setEscapeProcessing",
-        args = {boolean.class}
-    )
+    // TODO setEscapeProcessing() is not supported
     public void testSetEscapeProcessing() {
         Statement st = null;
         try {
@@ -1375,65 +1018,32 @@
         } catch (SQLException e) {
           assertEquals("not supported", e.getMessage());
         }
-
     }
 
-    /**
-     * @test {@link java.sql.Statement#setQueryTimeout}
-     *
-     */
-    @TestTargets({
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Error in impl. default query timeout for sqlite dbs is 0.",
-        method = "setQueryTimeout",
-        args = {int.class}
-    ),
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Error in impl. default query timeout for sqlite dbs is 0.",
-            method = "getQueryTimeout",
-            args = {}
-        )
-    })
-    public void testSetQueryTimeout() {
+    public void testSetQueryTimeout() throws SQLException {
+        Statement st = conn.createStatement();
+        st.setQueryTimeout(2);
+        assertEquals(2, st.getQueryTimeout());
+
         try {
-            Statement st = conn.createStatement();
-            st.setQueryTimeout(2);
-            assertEquals(2, st.getQueryTimeout());
+            st = conn.createStatement();
+            st.setQueryTimeout(-1);
+            fail("SQLException not thrown");
+        } catch (SQLException expected) {
+            // expected
+        }
 
-            try {
-                st = conn.createStatement();
-                st.setQueryTimeout(-1);
-                fail("SQLException not thrown");
-            } catch (SQLException expected) {
-                // expected
-            }
-
-            try {
-                st = conn.createStatement();
-                st.close();
-                st.setQueryTimeout(3);
-                fail("SQLException not thrown");
-            } catch (SQLException expected) {
-                // expected
-            }
-        } catch (SQLException e) {
-            throw new RuntimeException(e);
+        try {
+            st = conn.createStatement();
+            st.close();
+            st.setQueryTimeout(3);
+            fail("SQLException not thrown");
+        } catch (SQLException expected) {
+            // expected
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#getResultSetType()}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Tests fail. not fully supported: returns only ResultSet.TYPE_SCROLL_INSENSITIVE. Either should throw an unsupported exception or behave according to spec.",
-        method = "getResultSetType",
-        args = {}
-    )
-    @KnownFailure("not fully supported")
+    // not fully supported
     public void testGetResultSetType() {
         Statement st = null;
         // test default value
@@ -1475,17 +1085,7 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#getResultSetHoldability()}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported",
-        method = "getResultSetHoldability",
-        args = {}
-    )
-    @KnownFailure("Test for default value fails")
+    // Test for default value fails
     public void testGetResultSetHoldability() {
 
         // test default value
@@ -1500,21 +1100,16 @@
 
         // failing tests
         try {
-            st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
+            conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                     ResultSet.CONCUR_READ_ONLY,
                     ResultSet.HOLD_CURSORS_OVER_COMMIT);
             fail("Exception expected: not supported");
-            /*
-            st.getResultSetHoldability();
-            assertEquals(ResultSet.HOLD_CURSORS_OVER_COMMIT, st
-                    .getResultSetHoldability());
-            */
         } catch (SQLException e) {
             // ok: not supported
         }
 
         try {
-            st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
+            conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                     ResultSet.CONCUR_READ_ONLY,
                     ResultSet.CLOSE_CURSORS_AT_COMMIT);
             fail("Exception expected: not supported");
@@ -1523,22 +1118,11 @@
             assertEquals(ResultSet.CLOSE_CURSORS_AT_COMMIT, st
                     .getResultSetHoldability());
             */
-        } catch (SQLException e) {
-         // ok: not supported
+        } catch (SQLException expected) {
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#getResultSetConcurrency()}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Tests fail. returns only ResultSet.TYPE_SCROLL_INSENSITIVE. Either should throw an unsupported exception or behave according to spec.",
-        method = "getResultSetConcurrency",
-        args = {}
-    )
-    @KnownFailure("Not supported")
+    // Not supported
     public void testGetResultSetConcurrency() {
         Statement st = null;
 
@@ -1576,64 +1160,40 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#getResultSet()}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Error in implementation. Is not according to spec:if updateCount > 0 resultset must be null.",
-        method = "getResultSet",
-        args = {}
-    )
-    @KnownFailure("Does not return null on update count > 0 (not a select statement) ")
-    public void testGetResultSet() {
+    // Does not return null on update count > 0 (not a select statement)
+    public void testGetResultSet() throws SQLException {
         Statement st = null;
         ResultSet res = null;
 
-        try {
-            st = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
-                    ResultSet.CONCUR_READ_ONLY,
-                    ResultSet.CLOSE_CURSORS_AT_COMMIT);
-            st.execute("create table test (c1);");
-            res = st.getResultSet();
-            assertNull(res);
-        } catch (SQLException e) {
-            fail("Unexpected Exception "+e);
-        }
+        st = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
+                ResultSet.CONCUR_READ_ONLY,
+                ResultSet.CLOSE_CURSORS_AT_COMMIT);
+        st.execute("create table test (c1);");
+        res = st.getResultSet();
+        assertNull(res);
 
-        try {
-            st = conn.createStatement();
-            String select = "select * from zoo where id == 4;";
-            String insert =  "insert into zoo (id, name, family) values (4, 'Vorobuy', 'bear');";
-            st.execute(insert);
-            st.execute(select);
-            assertEquals(-1, st.getUpdateCount());
-            res = st.getResultSet();
-            assertNotNull(res);
-            res.next();
-            assertEquals(4,res.getInt(1));
-            assertEquals("Vorobuy",res.getString(2));
-            assertEquals("bear",res.getString(3));
+        st = conn.createStatement();
+        String select = "select * from zoo where id == 4;";
+        String insert =  "insert into zoo (id, name, family) values (4, 'Vorobuy', 'bear');";
+        st.execute(insert);
+        st.execute(select);
+        assertEquals(-1, st.getUpdateCount());
+        res = st.getResultSet();
+        assertNotNull(res);
+        res.next();
+        assertEquals(4,res.getInt(1));
+        assertEquals("Vorobuy",res.getString(2));
+        assertEquals("bear",res.getString(3));
 //            assertEquals(0, st.getUpdateCount()); not supported
-            assertFalse(res.next());
-        } catch (SQLException e) {
-            fail("SQLException is thrown:"+e.getMessage());
-        }
+        assertFalse(res.next());
 
-        try {
-            st = conn.createStatement();
-            String insert = "insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');";
-            st
-            .execute(insert);
-            res = st.getResultSet();
-            // statement is an update and should return null according to spec.
-            if (st.getUpdateCount() > 0)  {
-                assertNull(res);
-            }
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown:"+e.getMessage());
+        st = conn.createStatement();
+        insert = "insert into zoo (id, name, family) values (3, 'Vorobey', 'sparrow');";
+        st.execute(insert);
+        res = st.getResultSet();
+        // statement is an update and should return null according to spec.
+        if (st.getUpdateCount() > 0)  {
+            assertNull(res);
         }
 
         try {
@@ -1645,33 +1205,15 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#setQueryTimeout}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Errors in impl.An other value is returned than was set (X * 1000)Default query timeout for sqlite dbs is 0.",
-        method = "getQueryTimeout",
-        args = {}
-    )
-    @KnownFailure("An other value is returned than was set (X * 1000)")
-    public void testGetQueryTimeout() {
+    // An other value is returned than was set (X * 1000)
+    public void testGetQueryTimeout() throws SQLException {
         Statement st = null;
-        try {
-            st = conn.createStatement();
-            st.setQueryTimeout(2000);
-            assertEquals(2000, st.getQueryTimeout());
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
-        }
+        st = conn.createStatement();
+        st.setQueryTimeout(2000);
+        assertEquals(2000, st.getQueryTimeout());
 
-        try {
-            st = conn.createStatement();
-            assertEquals(0,st.getQueryTimeout());
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
-        }
+        st = conn.createStatement();
+        assertEquals(0,st.getQueryTimeout());
 
         try {
             st.close();
@@ -1682,18 +1224,8 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#getMoreResults()}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not fully supported",
-        method = "getMoreResults",
-        args = {}
-    )
-    @KnownFailure("not supported")
-    public void testGetMoreResults() {
+    // not supported
+    public void testGetMoreResults() throws SQLException {
         Statement st = null;
         ResultSet res1 = null;
         ResultSet res2 = null;
@@ -1713,8 +1245,6 @@
             } catch (SQLException e) {
                 //ok
             }
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
         } finally {
             try {
                 st.close();
@@ -1730,75 +1260,28 @@
         }
     }
 
-    /**
-     * @test {@link java.sql.Statement#getMoreResults(int)}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "Callable Statements are not supported",
-        method = "getMoreResults",
-        args = {int.class}
-    )
-    public void testGetMoreResultsInt() {
-        /*
-        } catch (BatchUpdateException e) {
-            fail("Unexpected Exception "+e.getMessage());
-        } catch (SQLException e) {
-            assertEquals("not supported",e.getMessage());
-        } finally {
-            try {
-                st.close();
-            } catch (SQLException ee) {
-            }
-        }
-
-        try {
-            st.getMoreResults(Integer.MAX_VALUE);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-        */
-    }
-
-    /**
-     * @test {@link java.sql.Statement#cancel()}
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Test fails. See also SQLite.DatabaseTest test of interrupt().",
-        method = "cancel",
-        args = {}
-    )
-    @KnownFailure("Bug in implementation of cancel: Does not fulfill spec.")
-    public void testCancel() {
+    // Bug in implementation of cancel: Does not fulfill spec.
+    public void testCancel() throws SQLException {
         Statement st = null;
+        st = conn.prepareStatement("insert into zoo values (7,'Speedy Gonzales','Mouse');");
+
+        CancelThread c = new CancelThread(st);
+        InsertThread ins = new InsertThread((PreparedStatement)st);
+
         try {
-            st = conn.prepareStatement("insert into zoo values (7,'Speedy Gonzales','Mouse');");
-
-            CancelThread c = new CancelThread(st);
-            InsertThread ins = new InsertThread((PreparedStatement)st);
-
-            try {
-                ins.t.join();
-                c.t.join();
-            } catch (InterruptedException e) {
-                fail("Error in test setup: ");
-            } catch (Exception e){
-                // Insert thread may throw an exception
-                // that it could not complete statement
-            }
-
-            // both threads have terminated and cancel should have cancelled the insert statement.
-            ResultSet res = st.executeQuery("select * from zoo where id=7");
-            assertFalse(res.next());
-
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
+            ins.t.join();
+            c.t.join();
+        } catch (InterruptedException e) {
+            fail("Error in test setup: ");
+        } catch (Exception e){
+            // Insert thread may throw an exception
+            // that it could not complete statement
         }
 
+        // both threads have terminated and cancel should have cancelled the insert statement.
+        ResultSet res = st.executeQuery("select * from zoo where id=7");
+        assertFalse(res.next());
+
         try {
             st.close();
             st.cancel();
@@ -1816,25 +1299,26 @@
            t = new Thread(this,"Cancel thread");
            t.start();
         }
+
         public void run() {
-           Logger.global.info("*Cancel* thread started");
-           try {
-             Thread.sleep(1500);
-         } catch (InterruptedException e1) {
-             fail("Error in test setup");
-             e1.printStackTrace();
-         }
-           try {
-               Logger.global.info("*Cancel* thread, about to do stmt.cancel()");
-               stmt.cancel();
-               Logger.global.info("*Cancel* thread, stmt.cancel() done");
-           } catch (SQLException e) {
-               fail("Error in test setup");
-               e.printStackTrace();
-           }
-           Logger.global.info("*Cancel* thread terminated");
+            Logger.global.info("*Cancel* thread started");
+            try {
+                Thread.sleep(1500);
+            } catch (InterruptedException e1) {
+                fail("Error in test setup");
+                e1.printStackTrace();
+            }
+            try {
+                Logger.global.info("*Cancel* thread, about to do stmt.cancel()");
+                stmt.cancel();
+                Logger.global.info("*Cancel* thread, stmt.cancel() done");
+            } catch (SQLException e) {
+                fail("Error in test setup");
+                e.printStackTrace();
+            }
+            Logger.global.info("*Cancel* thread terminated");
         }
-     }
+    }
 
     class InsertThread implements Runnable{
         Thread t;
@@ -1844,25 +1328,25 @@
            t = new Thread(this,"Insert thread");
            t.start();
         }
-        public void run() {
-          Logger.global.info("*Insert* thread started");
-           try {
-             Thread.sleep(1500);
-         } catch (InterruptedException e1) {
-             fail("Error in test setup");
-             e1.printStackTrace();
-         }
-           try {
-               Logger.global.info("*Insert* thread, about to do insertion");
-               stmt.execute();
-               stmt.execute();
-               Logger.global.info("*Insert* thread inserted");
-           } catch (SQLException e) {
-               fail("Error in test setup");
-               e.printStackTrace();
-           }
-          Logger.global.info("*Insert* thread terminated");
-        }
-     }
 
+        public void run() {
+            Logger.global.info("*Insert* thread started");
+            try {
+                Thread.sleep(1500);
+            } catch (InterruptedException e1) {
+                fail("Error in test setup");
+                e1.printStackTrace();
+            }
+            try {
+                Logger.global.info("*Insert* thread, about to do insertion");
+                stmt.execute();
+                stmt.execute();
+                Logger.global.info("*Insert* thread inserted");
+            } catch (SQLException e) {
+                fail("Error in test setup");
+                e.printStackTrace();
+            }
+            Logger.global.info("*Insert* thread terminated");
+        }
+    }
 }
diff --git a/luni/src/test/java/libcore/java/sql/OldTimestampTest.java b/luni/src/test/java/libcore/java/sql/OldTimestampTest.java
index 1bce26d..ab2034b 100644
--- a/luni/src/test/java/libcore/java/sql/OldTimestampTest.java
+++ b/luni/src/test/java/libcore/java/sql/OldTimestampTest.java
@@ -21,7 +21,7 @@
 import java.util.TimeZone;
 import junit.framework.TestCase;
 
-public class OldTimestampTest extends TestCase {
+public final class OldTimestampTest extends TestCase {
 
     public void test_toString() {
         TimeZone.setDefault(TimeZone.getTimeZone("UTC"));
diff --git a/luni/src/test/java/libcore/java/text/DateFormatSymbolsTest.java b/luni/src/test/java/libcore/java/text/DateFormatSymbolsTest.java
index febed43..319a76e 100644
--- a/luni/src/test/java/libcore/java/text/DateFormatSymbolsTest.java
+++ b/luni/src/test/java/libcore/java/text/DateFormatSymbolsTest.java
@@ -22,7 +22,9 @@
 import java.io.ObjectOutputStream;
 import java.text.DateFormatSymbols;
 import java.text.SimpleDateFormat;
+import java.util.Arrays;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.Locale;
 import java.util.TimeZone;
 
@@ -76,4 +78,49 @@
         sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
         return sdf.format(new Date(0));
     }
+
+    public void test_getZoneStrings_cloning() throws Exception {
+        // Check that corrupting our array doesn't affect other callers.
+
+        // Kill a row.
+        {
+            String[][] originalZoneStrings = DateFormatSymbols.getInstance(Locale.US).getZoneStrings();
+            assertNotNull(originalZoneStrings[0]);
+            originalZoneStrings[0] = null;
+            String[][] currentZoneStrings = DateFormatSymbols.getInstance(Locale.US).getZoneStrings();
+            assertNotNull(currentZoneStrings[0]);
+        }
+
+        // Kill an element.
+        {
+            String[][] originalZoneStrings = DateFormatSymbols.getInstance(Locale.US).getZoneStrings();
+            assertNotNull(originalZoneStrings[0][0]);
+            originalZoneStrings[0][0] = null;
+            String[][] currentZoneStrings = DateFormatSymbols.getInstance(Locale.US).getZoneStrings();
+            assertNotNull(currentZoneStrings[0][0]);
+        }
+    }
+
+    public void test_getZoneStrings_UTC() throws Exception {
+        HashMap<String, String[]> zoneStrings = new HashMap<String, String[]>();
+        for (String[] row : DateFormatSymbols.getInstance(Locale.US).getZoneStrings()) {
+            zoneStrings.put(row[0], row);
+        }
+
+        assertUtc(zoneStrings.get("Etc/UCT"));
+        assertUtc(zoneStrings.get("Etc/UTC"));
+        assertUtc(zoneStrings.get("Etc/Universal"));
+        assertUtc(zoneStrings.get("Etc/Zulu"));
+
+        assertUtc(zoneStrings.get("UCT"));
+        assertUtc(zoneStrings.get("UTC"));
+        assertUtc(zoneStrings.get("Universal"));
+        assertUtc(zoneStrings.get("Zulu"));
+    }
+    private static void assertUtc(String[] row) {
+        // Element 0 is the Olson id. The short names should be "UTC".
+        // On the RI, the long names are localized. ICU doesn't have those, so we just use UTC.
+        assertEquals(Arrays.toString(row), "UTC", row[2]);
+        assertEquals(Arrays.toString(row), "UTC", row[4]);
+    }
 }
diff --git a/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java b/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java
index 33e28b0..8b24c6d 100644
--- a/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java
+++ b/luni/src/test/java/libcore/java/text/DecimalFormatSymbolsTest.java
@@ -16,6 +16,10 @@
 
 package libcore.java.text;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.text.DecimalFormatSymbols;
 import java.util.Locale;
 
@@ -32,4 +36,22 @@
         checkLocaleIsEquivalentToRoot(new Locale("xx", "XX"));
         checkLocaleIsEquivalentToRoot(new Locale("not exist language", "not exist country"));
     }
+
+    // http://code.google.com/p/android/issues/detail?id=14495
+    public void testSerialization() throws Exception {
+        DecimalFormatSymbols originalDfs = DecimalFormatSymbols.getInstance(Locale.GERMANY);
+
+        // Serialize...
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        new ObjectOutputStream(out).writeObject(originalDfs);
+        byte[] bytes = out.toByteArray();
+
+        // Deserialize...
+        ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(bytes));
+        DecimalFormatSymbols deserializedDfs = (DecimalFormatSymbols) in.readObject();
+        assertEquals(-1, in.read());
+
+        // The two objects should claim to be equal.
+        assertEquals(originalDfs, deserializedDfs);
+    }
 }
diff --git a/luni/src/test/java/libcore/java/text/OldAttributedCharacterIteratorAttributeTest.java b/luni/src/test/java/libcore/java/text/OldAttributedCharacterIteratorAttributeTest.java
index 58fc605..f550f49 100644
--- a/luni/src/test/java/libcore/java/text/OldAttributedCharacterIteratorAttributeTest.java
+++ b/luni/src/test/java/libcore/java/text/OldAttributedCharacterIteratorAttributeTest.java
@@ -58,7 +58,7 @@
     }
 
     /**
-     * @tests java.text.AttributedCharacterIterator.Attribute#AttributedCharacterIterator.Attribute(java.lang.String)
+     * java.text.AttributedCharacterIterator.Attribute#AttributedCharacterIterator.Attribute(java.lang.String)
      *        Test of method
      *        java.text.AttributedCharacterIterator.Attribute#AttributedCharacterIterator.Attribute(java.lang.String).
      */
@@ -71,7 +71,7 @@
     }
 
     /**
-     * @tests java.text.AttributedCharacterIterator.Attribute#equals(java.lang.Object)
+     * java.text.AttributedCharacterIterator.Attribute#equals(java.lang.Object)
      *        Test of method
      *        java.text.AttributedCharacterIterator.Attribute#equals(java.lang.Object).
      */
@@ -98,7 +98,7 @@
     }
 
     /**
-     * @tests java.text.AttributedCharacterIterator.Attribute#getName() Test of
+     * java.text.AttributedCharacterIterator.Attribute#getName() Test of
      *        method java.text.AttributedCharacterIterator.Attribute#getName().
      */
     public void test_getName() {
@@ -112,7 +112,7 @@
     }
 
     /**
-     * @tests java.text.AttributedCharacterIterator.Attribute#hashCode()
+     * java.text.AttributedCharacterIterator.Attribute#hashCode()
      */
     public void test_hashCode() {
         try {
@@ -140,7 +140,7 @@
     }
 
     /**
-     * @tests java.text.AttributedCharacterIterator.Attribute#readResolve() Test
+     * java.text.AttributedCharacterIterator.Attribute#readResolve() Test
      *        of method
      *        java.text.AttributedCharacterIterator.Attribute#readResolve().
      */
@@ -192,7 +192,7 @@
     }
 
     /**
-     * @tests java.text.AttributedCharacterIterator.Attribute#toString() Test of
+     * java.text.AttributedCharacterIterator.Attribute#toString() Test of
      *        method java.text.AttributedCharacterIterator.Attribute#toString().
      */
     public void test_toString() {
diff --git a/luni/src/test/java/libcore/java/text/OldAttributedStringTest.java b/luni/src/test/java/libcore/java/text/OldAttributedStringTest.java
index d1e23b7..89f6f13 100644
--- a/luni/src/test/java/libcore/java/text/OldAttributedStringTest.java
+++ b/luni/src/test/java/libcore/java/text/OldAttributedStringTest.java
@@ -54,7 +54,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString#AttributedString(AttributedCharacterIterator,
+     * java.text.AttributedString#AttributedString(AttributedCharacterIterator,
      *        int, int) Test of method
      *        java.text.AttributedString#AttributedString(AttributedCharacterIterator,
      *        int, int). Case 1: Try to consruct AttributedString. Case 2: Try
@@ -102,7 +102,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString#AttributedString(AttributedCharacterIterator,
+     * java.text.AttributedString#AttributedString(AttributedCharacterIterator,
      *        int, int, AttributedCharacterIterator.Attribute[]) Test of method
      *        java.text.AttributedString#AttributedString(AttributedCharacterIterator,
      *        int, int, AttributedCharacterIterator.Attribute[]). Case 1: Try to
@@ -150,7 +150,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString#AttributedString(AttributedCharacterIterator,
+     * java.text.AttributedString#AttributedString(AttributedCharacterIterator,
      *        int, int, Map<? extends AttributedCharacterIterator.Attribute,?>)
      *        Test of method
      *        java.text.AttributedString#AttributedString(AttributedCharacterIterator,
@@ -321,7 +321,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString.addAttribute(AttributedCharacterIterator,
+     * java.text.AttributedString.addAttribute(AttributedCharacterIterator,
      *        Object)
      */
     public void test_addAttributeLjava_text_AttributedCharacterIterator$AttributeLjava_lang_Object() {
@@ -348,7 +348,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString#addAttributes(Map<? extends
+     * java.text.AttributedString#addAttributes(Map<? extends
      *        AttributedCharacterIterator.Attribute,?>, int, int) Tests of
      *        method java.text.AttributedString#addAttributes(Map<? extends
      *        AttributedCharacterIterator.Attribute,?>, int, int). Case 1: Try
@@ -392,7 +392,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString#getIterator() Test of method
+     * java.text.AttributedString#getIterator() Test of method
      *        java.text.AttributedString#getIterator().
      */
     public void test_getIterator() {
@@ -408,7 +408,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString#getIterator(AttributedCharacterIterator.Attribute[])
+     * java.text.AttributedString#getIterator(AttributedCharacterIterator.Attribute[])
      *        Test of method
      *        java.text.AttributedString#getIterator(AttributedCharacterIterator.Attribute[]).
      */
@@ -438,7 +438,7 @@
     }
 
     /**
-     * @tests java.text.AttributedString#getIterator(AttributedCharacterIterator.Attribute[],
+     * java.text.AttributedString#getIterator(AttributedCharacterIterator.Attribute[],
      *        int, int) Test of method
      *        java.text.AttributedString#getIterator(AttributedCharacterIterator.Attribute[],
      *        int, int).
diff --git a/luni/src/test/java/libcore/java/text/OldDateFormatTest.java b/luni/src/test/java/libcore/java/text/OldDateFormatTest.java
index 3a3540c..ad9838e 100644
--- a/luni/src/test/java/libcore/java/text/OldDateFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/OldDateFormatTest.java
@@ -51,7 +51,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#DateFormat() Test of method
+     * java.text.DateFormat#DateFormat() Test of method
      *        java.text.DateFormat#DateFormat().
      */
     public void test_Constructor() {
@@ -63,7 +63,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#equals(java.lang.Object obj) Test of
+     * java.text.DateFormat#equals(java.lang.Object obj) Test of
      *        java.text.DateFormat#equals(java.lang.Object obj).
      */
     public void test_equalsLjava_lang_Object() {
@@ -81,7 +81,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#format(java.util.Date) Test of method
+     * java.text.DateFormat#format(java.util.Date) Test of method
      *        java.text.DateFormat#format(java.util.Date).
      */
     public void test_formatLjava_util_Date() {
@@ -98,7 +98,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#format(Object, StringBuffer, FieldPosition)
+     * java.text.DateFormat#format(Object, StringBuffer, FieldPosition)
      *        Test of method java.text.DateFormat#format(Object, StringBuffer,
      *        FieldPosition)
      */
@@ -140,7 +140,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#hashCode() Test of method
+     * java.text.DateFormat#hashCode() Test of method
      *        java.text.DateFormat#hashCode().
      */
     public void test_hashCode() {
@@ -157,7 +157,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#isLenient() Test of method
+     * java.text.DateFormat#isLenient() Test of method
      *        java.text.DateFormat#isLenient().
      */
     public void test_isLenient() {
@@ -201,7 +201,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#parse(String)
+     * java.text.DateFormat#parse(String)
      */
     public void test_parseLString() {
         DateFormat format = DateFormat.getInstance();
@@ -371,7 +371,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#parseObject(String, ParsePosition) Test of
+     * java.text.DateFormat#parseObject(String, ParsePosition) Test of
      *        method java.text.DateFormat#parseObject(String, ParsePosition).
      *        Case 1: Try to parse correct data string. Case 2: Try to parse
      *        partialy correct data string. Case 3: Try to use argument
@@ -439,7 +439,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#setLenient(boolean) Test of method
+     * java.text.DateFormat#setLenient(boolean) Test of method
      *        java.text.DateFormat#setLenient(boolean).
      */
     public void test_setLenientZ() {
@@ -469,7 +469,7 @@
     }
 
     /**
-     * @tests java.text.DateFormat#setTimeZone(TimeZone) Test of method
+     * java.text.DateFormat#setTimeZone(TimeZone) Test of method
      *        java.text.DateFormat#setTimeZone(TimeZone).
      */
     public void test_setTimeZoneLjava_util_TimeZone() {
diff --git a/luni/src/test/java/libcore/java/text/OldDecimalFormatSymbolsTest.java b/luni/src/test/java/libcore/java/text/OldDecimalFormatSymbolsTest.java
index 0a6b77b..2f1a3cc 100644
--- a/luni/src/test/java/libcore/java/text/OldDecimalFormatSymbolsTest.java
+++ b/luni/src/test/java/libcore/java/text/OldDecimalFormatSymbolsTest.java
@@ -63,7 +63,7 @@
     }
 
     /**
-     * @tests java.text.DecimalFormatSymbols#DecimalFormatSymbols(java.util.Locale)
+     * java.text.DecimalFormatSymbols#DecimalFormatSymbols(java.util.Locale)
      */
     public void test_ConstructorLjava_util_Locale() {
         try {
diff --git a/luni/src/test/java/libcore/java/text/OldFormatTest.java b/luni/src/test/java/libcore/java/text/OldFormatTest.java
index 0c74749..cc6c529 100644
--- a/luni/src/test/java/libcore/java/text/OldFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/OldFormatTest.java
@@ -47,7 +47,7 @@
     }
 
     /**
-     * @tests java.text.Format#clone() Test of method java.text.Format#clone().
+     * java.text.Format#clone() Test of method java.text.Format#clone().
      *        Compare of internal variables of cloned objects.
      */
     public void test_clone() {
diff --git a/luni/src/test/java/libcore/java/text/OldMessageFormatTest.java b/luni/src/test/java/libcore/java/text/OldMessageFormatTest.java
index 82f4415..2701d0e 100644
--- a/luni/src/test/java/libcore/java/text/OldMessageFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/OldMessageFormatTest.java
@@ -111,7 +111,7 @@
     }
 
     /**
-     * @tests java.text.MessageFormat#setFormat(int, Format) Test of method
+     * java.text.MessageFormat#setFormat(int, Format) Test of method
      *        java.text.MessageFormat#setFormat(int, Format). Case 1: Compare
      *        getFormats() results after calls to setFormat(). Case 2: Try to
      *        call setFormat() using incorrect index.
@@ -383,7 +383,7 @@
     }
 
     /**
-     * @tests java.text.MessageFormat#parseObject(java.lang.String,
+     * java.text.MessageFormat#parseObject(java.lang.String,
      *        java.text.ParsePosition) Test of method
      *        java.text.MessageFormat#parseObject(java.lang.String,
      *        java.text.ParsePosition). Case 1: Parsing of correct data string.
diff --git a/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java b/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java
index fd383aa..64fd7ca 100644
--- a/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/OldNumberFormatTest.java
@@ -17,9 +17,6 @@
 package libcore.java.text;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.text.ChoiceFormat;
 import java.text.DecimalFormat;
 import java.text.FieldPosition;
@@ -31,109 +28,40 @@
 import junit.framework.TestCase;
 import tests.support.Support_Locale;
 
-@TestTargetClass(NumberFormat.class)
 public class OldNumberFormatTest extends TestCase {
 
-    /**
-     * @tests java.text.NumberFormat#getIntegerInstance(java.util.Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIntegerInstance",
-        args = {java.util.Locale.class}
-    )
-    public void test_getIntegerInstanceLjava_util_Locale()
-            throws ParseException {
-        // Test for method java.text.NumberFormat
-        // getIntegerInstance(java.util.Locale)
-        Locale usLocale = Locale.US;
-        Locale arLocale = new Locale("ar", "AE");
-        // BEGIN android-added: use de_CH too.
-        Locale chLocale = new Locale("de", "CH");
-        // END android-added
-
-        Locale[] requiredLocales = {usLocale, chLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
-
-        DecimalFormat format = (DecimalFormat) NumberFormat
-                .getIntegerInstance(usLocale);
-        assertEquals(
-                "Test1: NumberFormat.getIntegerInstance().toPattern() returned wrong pattern",
-                "#,##0", format.toPattern());
-        assertEquals(
-                "Test2: NumberFormat.getIntegerInstance().format(-35.76) returned wrong value",
-                "-36", format.format(-35.76));
-        assertEquals(
-                "Test3: NumberFormat.getIntegerInstance().parse(\"-36\") returned wrong number",
-                new Long(-36), format.parse("-36"));
-        assertEquals(
-                "Test4: NumberFormat.getIntegerInstance().parseObject(\"-36\") returned wrong number",
-                new Long(-36), format.parseObject("-36"));
-        assertEquals(
-                "Test5: NumberFormat.getIntegerInstance().getMaximumFractionDigits() returned wrong value",
-                0, format.getMaximumFractionDigits());
-        assertTrue(
-                "Test6: NumberFormat.getIntegerInstance().isParseIntegerOnly() returned wrong value",
-                format.isParseIntegerOnly());
+    public void test_getIntegerInstanceLjava_util_Locale() throws ParseException {
+        DecimalFormat format = (DecimalFormat) NumberFormat.getIntegerInstance(Locale.US);
+        assertEquals("#,##0", format.toPattern());
+        assertEquals("-36", format.format(-35.76));
+        assertEquals(new Long(-36), format.parse("-36"));
+        assertEquals(new Long(-36), format.parseObject("-36"));
+        assertEquals(0, format.getMaximumFractionDigits());
+        assertTrue(format.isParseIntegerOnly());
 
         // try with a locale that has a different integer pattern
-        // BEGIN android-added: try de_CH too
-        format = (DecimalFormat) NumberFormat.getIntegerInstance(chLocale);
-        assertEquals(
-                "Test7: NumberFormat.getIntegerInstance(new Locale(\"de\", \"CH\")).toPattern() returned wrong pattern",
-                "#,##0", format.toPattern());
-        assertEquals(
-                "Test8: NumberFormat.getIntegerInstance(new Locale(\"de\", \"CH\")).format(-35.76) returned wrong value",
-                "-36", format.format(-35.76));
-        assertEquals(
-                "Test9: NumberFormat.getIntegerInstance(new Locale(\"de\", \"CH\")).parse(\"-36-\") returned wrong number",
-                new Long(-36), format.parse("-36"));
-        assertEquals(
-                "Test10: NumberFormat.getIntegerInstance(new Locale(\"de\", \"CH\")).parseObject(\"36-\") returned wrong number",
-                new Long(-36), format.parseObject("-36"));
-
-        assertEquals(
-                "Test11: NumberFormat.getIntegerInstance(new Locale(\"de\", \"CH\")).getMaximumFractionDigits() returned wrong value",
-                0, format.getMaximumFractionDigits());
-        assertTrue(
-                "Test12: NumberFormat.getIntegerInstance(new Locale(\"de\", \"CH\")).isParseIntegerOnly() returned wrong value",
-                format.isParseIntegerOnly());
-        // END android-added
-        format = (DecimalFormat) NumberFormat.getIntegerInstance(arLocale);
-        assertEquals(
-                "Test7: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).toPattern() returned wrong pattern",
-                "#,##0;#,##0-", format.toPattern());
-        assertEquals(
-                "Test8: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).format(-35.76) returned wrong value",
-                "\u0666-", format.format(-6));
-        assertEquals(
-                "Test9: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).parse(\"-36-\") returned wrong number",
-                new Long(-36), format.parse("36-"));
-        assertEquals(
-                "Test10: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).parseObject(\"36-\") returned wrong number",
-                new Long(-36), format.parseObject("36-"));
-
-        assertEquals(
-                "Test11: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).getMaximumFractionDigits() returned wrong value",
-                0, format.getMaximumFractionDigits());
-        assertTrue(
-                "Test12: NumberFormat.getIntegerInstance(new Locale(\"ar\", \"AE\")).isParseIntegerOnly() returned wrong value",
-        format.isParseIntegerOnly());
+        Locale chLocale = new Locale("de", "CH");
+        if (Support_Locale.isLocaleAvailable(chLocale)) {
+            format = (DecimalFormat) NumberFormat.getIntegerInstance(chLocale);
+            assertEquals("#,##0", format.toPattern());
+            assertEquals("-36", format.format(-35.76));
+            assertEquals(new Long(-36), format.parse("-36"));
+            assertEquals(new Long(-36), format.parseObject("-36"));
+            assertEquals(0, format.getMaximumFractionDigits());
+            assertTrue(format.isParseIntegerOnly());
+        }
+        Locale arLocale = new Locale("ar", "AE");
+        if (Support_Locale.isLocaleAvailable(arLocale)) {
+            format = (DecimalFormat) NumberFormat.getIntegerInstance(arLocale);
+            assertEquals("#,##0;#,##0-", format.toPattern());
+            assertEquals("\u0666-", format.format(-6));
+            assertEquals(new Long(-36), format.parse("36-"));
+            assertEquals(new Long(-36), format.parseObject("36-"));
+            assertEquals(0, format.getMaximumFractionDigits());
+            assertTrue(format.isParseIntegerOnly());
+        }
     }
 
-    /**
-     * @tests java.text.NumberFormat#setMaximumIntegerDigits()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMaximumIntegerDigits",
-        args = {int.class}
-    )
     public void test_setMaximumIntegerDigits() {
         NumberFormat format = NumberFormat.getInstance();
         format.setMaximumIntegerDigits(2);
@@ -143,15 +71,6 @@
         assertEquals("Wrong result: case 2", "0", format.format(123));
     }
 
-    /**
-     * @tests java.text.NumberFormat#setCurrency(java.util.Currency)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setCurrency",
-        args = {java.util.Currency.class}
-    )
     public void test_setCurrencyLjava_util_Currency() {
         // Test for method void setCurrency(java.util.Currency)
         // a subclass that supports currency formatting
@@ -184,22 +103,7 @@
         }
     }
 
-    /**
-     * @tests java.text.NumberFormat#parseObject(java.lang.String,
-     *        java.text.ParsePosition)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parseObject",
-        args = {java.lang.String.class, java.text.ParsePosition.class}
-    )
     public void test_parseObjectLjava_lang_StringLjava_text_ParsePosition() {
-        Locale[] requiredLocales = {Locale.FRANCE};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
         // regression test for HARMONY-1003
         assertNull(NumberFormat.getInstance().parseObject("0",
                 new ParsePosition(-1)));
@@ -210,13 +114,15 @@
         parseObjectTest(NumberFormat.getInstance(), "123.123abc123",
                 new ParsePosition(3), new Double(0.123), 7, true);
 
-        parseObjectTest(NumberFormat.getInstance(Locale.FRANCE),
+        if (Support_Locale.isLocaleAvailable(Locale.FRANCE)) {
+            parseObjectTest(NumberFormat.getInstance(Locale.FRANCE),
                 "asd123,123abc123",
                 new ParsePosition(3), new Double(123.123), 10, true);
 
-        parseObjectTest(NumberFormat.getInstance(Locale.FRANCE),
+            parseObjectTest(NumberFormat.getInstance(Locale.FRANCE),
                 "test test",
                 new ParsePosition(0), null, 0, false);
+        }
 
         parseObjectTest(NumberFormat.getIntegerInstance(),
                 "asd123.123abc123",
@@ -262,15 +168,6 @@
         }
     }
 
-    /**
-     * @tests java.text.NumberFormat#clone()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
 
         int max_digits = 100;
@@ -292,15 +189,6 @@
                 nf2.getMaximumIntegerDigits() == max_digits);
     }
 
-    /**
-     * @tests java.text.NumberFormat#equals(Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equals() {
 
         NumberFormat nf1 = NumberFormat.getInstance();
@@ -322,27 +210,8 @@
         assertFalse("Object is equal null", nf1.equals(null));
     }
 
-    /**
-     * @tests java.text.NumberFormat#format(double)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "format",
-        args = {double.class}
-    )
     public void test_formatLdouble() {
-        Locale deLocale = new Locale("de", "CH");
-        Locale[] requiredLocales = {Locale.US, deLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
-        // BEGIN android-changed
         NumberFormat nf1 = NumberFormat.getInstance(Locale.US);
-        // use de_CH instead
-        // NumberFormat nf2 = NumberFormat.getInstance(new Locale("ar", "AR"));
-        NumberFormat nf2 = NumberFormat.getInstance(deLocale);
 
         String out = nf1.format(1234567890.0123456789);
         assertEquals("Wrong result for double : " + out, "1,234,567,890.012",
@@ -352,12 +221,15 @@
         assertEquals("Wrong result for double : " + out, "-1,234,567,890.012",
                 out.toString());
 
-        out = nf2.format(-1234567890.0123456789);
-        // use de_CH instead
-        // assertEquals("Wrong result for double : " + out, "1,234,567,890.012-",
-        //         out.toString());
-        assertEquals("Wrong result for double : " + out, "-1'234'567'890.012",
-                out.toString());
+        Locale deLocale = new Locale("de", "CH");
+        if (Support_Locale.isLocaleAvailable(deLocale)) {
+            NumberFormat nf2 = NumberFormat.getInstance(deLocale);
+            out = nf2.format(-1234567890.0123456789);
+            // use de_CH instead
+            // assertEquals("Wrong result for double : " + out, "1,234,567,890.012-",
+            //         out.toString());
+            assertEquals("Wrong result for double : " + out, "-1'234'567'890.012", out.toString());
+        }
 
         out = nf1.format(1.0001);
         assertEquals("Wrong result for for double: " + out, "1", out.toString());
@@ -367,27 +239,8 @@
         // END android-changed
     }
 
-    /**
-     * @tests java.text.NumberFormat#format(long)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "format",
-        args = {long.class}
-    )
     public void test_formatLlong() {
-        Locale deLocale = new Locale("de", "CH");
-        Locale[] requiredLocales = {Locale.US, deLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
-        // BEGIN android-changed
         NumberFormat nf1 = NumberFormat.getInstance(Locale.US);
-        // use de_CH instead
-        // NumberFormat nf2 = NumberFormat.getInstance(Locale.CANADA_FRENCH);
-        NumberFormat nf2 = NumberFormat.getInstance(deLocale);
 
         String out = nf1.format(Long.MAX_VALUE);
         assertEquals("Wrong result for double : " + out,
@@ -397,12 +250,15 @@
         assertEquals("Wrong result for double : " + out,
                 "-9,223,372,036,854,775,808", out.toString());
 
-        out = nf2.format(-1234567890);
-        // use de_CH instead
-        // assertEquals("Wrong result for double : " + out, "-1 234 567 890", out
-        //         .toString());
-        assertEquals("Wrong result for double : " + out, "-1'234'567'890", out
-                .toString());
+        Locale deLocale = new Locale("de", "CH");
+        if (Support_Locale.isLocaleAvailable(deLocale)) {
+            NumberFormat nf2 = NumberFormat.getInstance(deLocale);
+            out = nf2.format(-1234567890);
+            // use de_CH instead
+            // assertEquals("Wrong result for double : " + out, "-1 234 567 890", out
+            //         .toString());
+            assertEquals("Wrong result for double : " + out, "-1'234'567'890", out.toString());
+        }
 
         // the Locale data of icu uses \uc2a0
         out = nf1.format(1);
@@ -413,15 +269,6 @@
         // END android-changed
     }
 
-    /**
-     * @tests java.text.NumberFormat#getAvailableLocales()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAvailableLocales",
-        args = {}
-    )
     public void test_getAvailableLocales() {
 
         Locale[] l = NumberFormat.getAvailableLocales();
@@ -439,15 +286,6 @@
         assertTrue("there is no Locale.US", isUS);
     }
 
-    /**
-     * @tests java.text.NumberFormat#getCurrencyInstance()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCurrencyInstance",
-        args = {}
-    )
     public void test_getCurrencyInstance() {
 
         Locale.setDefault(Locale.US);
@@ -471,95 +309,34 @@
                 "$1.00", format.format(0.999));
     }
 
-    /**
-     * @tests java.text.NumberFormat#getCurrencyInstance(java.util.Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCurrencyInstance",
-        args = {java.util.Locale.class}
-    )
     public void test_getCurrencyInstanceLjava_util_Locale() {
-        // BEGIN android-changed
         Locale usLocale = Locale.US;
-        // use de_AT instead
-        // Locale mkLocale = new Locale("mk", "MK");
-        Locale atLocale = new Locale("de", "AT");
-
-        Locale[] requiredLocales = {usLocale, atLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
-
         NumberFormat format = NumberFormat.getCurrencyInstance(usLocale);
 
         assertNotSame("Instance is null", null, format);
-        assertTrue("Object is not instance of NumberFormat",
-                format instanceof NumberFormat);
+        assertTrue(format instanceof NumberFormat);
 
-        assertEquals(
-                "Test1: NumberFormat.getCurrencyInstance(Locale.US).format(35.76) returned wrong value",
-                "$35.76", format.format(35.76));
-        assertEquals(
-                "Test2: NumberFormat.getCurrencyInstance(Locale.US).format(123456.789) returned wrong value",
-                "$123,456.79", format.format(123456.789));
-        assertEquals(
-                "Test3: NumberFormat.getCurrencyInstance(Locale.US).format(0.1) returned wrong value",
-                "$0.10", format.format(0.1));
-        assertEquals(
-                "Test4: NumberFormat.getCurrencyInstance(Locale.US).format(0.999) returned wrong value",
-                "$1.00", format.format(0.999));
+        assertEquals("$35.76", format.format(35.76));
+        assertEquals("$123,456.79", format.format(123456.789));
+        assertEquals("$0.10", format.format(0.1));
+        assertEquals("$1.00", format.format(0.999));
 
-        // use de_AT instead
-        // format = NumberFormat.getCurrencyInstance(mkLocale);
-        format = NumberFormat.getCurrencyInstance(atLocale);
-        // BEGIN android-changed: ICU uses non-breaking space after the euro sign; the RI uses ' '.
-        assertEquals(
-                "Test5: NumberFormat.getCurrencyInstance(new Locale(\"de\", \"AT\")).format(35.76) returned wrong value",
-                "\u20ac\u00a035,76", format.format(35.76));
-        assertEquals(
-                "Test6: NumberFormat.getCurrencyInstance(new Locale(\"de\", \"AT\")).format(123456.789) returned wrong value",
-                "\u20ac\u00a0123.456,79", format.format(123456.789));
-        assertEquals(
-                "Test7: NumberFormat.getCurrencyInstance(new Locale(\"de\", \"AT\")).format(0.1) returned wrong value",
-                "\u20ac\u00a00,10", format.format(0.1));
-        assertEquals(
-                "Test8: NumberFormat.getCurrencyInstance(new Locale(\"de\", \"AT\")).format(0.999) returned wrong value",
-                "\u20ac\u00a01,00", format.format(0.999));
-        // END android-changed
-        // use de_AT instead
-        /*assertEquals(
-                "Test5: NumberFormat.getCurrencyInstance(new Locale(\"mk\", \"MK\")).format(35.76) returned wrong value",
-                "Den 35,76", format.format(35.76));
-        assertEquals(
-                "Test6: NumberFormat.getCurrencyInstance(new Locale(\"mk\", \"MK\")).format(123456.789) returned wrong value",
-                "Den 123.456,79", format.format(123456.789));
-        assertEquals(
-                "Test7: NumberFormat.getCurrencyInstance(new Locale(\"mk\", \"MK\")).format(0.1) returned wrong value",
-                "Den 0,1", format.format(0.1));
-        assertEquals(
-                "Test8: NumberFormat.getCurrencyInstance(new Locale(\"mk\", \"MK\")).format(0.999) returned wrong value",
-                "Den 1", format.format(0.999));*/
-        try {
-            NumberFormat.getCurrencyInstance(null);
-            fail("java.lang.NullPointerException is not thrown");
-        } catch (java.lang.NullPointerException npe) {
-            // expested
+        Locale atLocale = new Locale("de", "AT");
+        if (Support_Locale.isLocaleAvailable(atLocale)) {
+            format = NumberFormat.getCurrencyInstance(atLocale);
+            // BEGIN android-changed: ICU uses non-breaking space after the euro sign; the RI uses ' '.
+            assertEquals("\u20ac\u00a035,76", format.format(35.76));
+            assertEquals("\u20ac\u00a0123.456,79", format.format(123456.789));
+            assertEquals("\u20ac\u00a00,10", format.format(0.1));
+            assertEquals("\u20ac\u00a01,00", format.format(0.999));
+            try {
+                NumberFormat.getCurrencyInstance(null);
+                fail("java.lang.NullPointerException is not thrown");
+            } catch (java.lang.NullPointerException expected) {
+            }
         }
-        // END android-changed
     }
 
-    /**
-     * @tests java.text.NumberFormat#getInstance()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {}
-    )
     public void test_getInstance() {
         Locale.setDefault(Locale.US);
         NumberFormat format = NumberFormat.getInstance();
@@ -579,69 +356,26 @@
                 "123,456,789", format.format(123456789));
     }
 
-    /**
-     * @tests java.text.NumberFormat#getInstance(Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.util.Locale.class}
-    )
     public void test_getInstanceLjava_util_Locale() {
         Locale testLocale = new Locale("de", "CH");
-        Locale[] requiredLocales = {Locale.US, testLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
-        // BEGIN android-changed
         Locale.setDefault(Locale.US);
-        // use de_CH instead
-        // NumberFormat format = NumberFormat.getInstance(new Locale("ar", "AR"));
-        NumberFormat format = NumberFormat.getInstance(testLocale);
+        if (Support_Locale.isLocaleAvailable(testLocale)) {
+            NumberFormat format = NumberFormat.getInstance(testLocale);
 
-        assertNotSame("Instance is null", null, format);
-        assertTrue("Object is not instance of NumberFormat",
-                format instanceof NumberFormat);
+            assertNotSame(null, format);
+            assertTrue(format instanceof NumberFormat);
 
-        assertEquals(
-                "Test1: NumberFormat.getInstance().format(1234567890.0987654321) returned wrong value",
-                "1'234'567'890.099", format.format(1234567890.0987654321));
-        assertEquals(
-                "Test2: ((DecimalFormat) NumberFormat.getInstance()).toPattern returned wrong value",
-                "#,##0.###", ((DecimalFormat) format).toPattern());
-        assertEquals(
-                "Test3: NumberFormat.getInstance().format(123456789) returned wrong value",
-                "123'456'789", format.format(123456789));
-        // use de_CH instead
-        /*assertEquals(
-                "Test1: NumberFormat.getInstance().format(1234567890.0987654321) returned wrong value",
-                "1,234,567,890.099", format.format(1234567890.0987654321));
-        assertEquals(
-                "Test2: ((DecimalFormat) NumberFormat.getInstance()).toPattern returned wrong value",
-                "#,##0.###;#,##0.###-", ((DecimalFormat) format).toPattern());
-        assertEquals(
-                "Test3: NumberFormat.getInstance().format(123456789) returned wrong value",
-                "123,456,789", format.format(123456789));*/
+            assertEquals("1'234'567'890.099", format.format(1234567890.0987654321));
+            assertEquals("#,##0.###", ((DecimalFormat) format).toPattern());
+            assertEquals("123'456'789", format.format(123456789));
+        }
         try {
             NumberFormat.getInstance(null);
             fail("java.lang.NullPointerException is not thrown");
-        } catch (java.lang.NullPointerException npe) {
-            // expested
+        } catch (java.lang.NullPointerException expected) {
         }
-        // END android-changed
     }
 
-    /**
-     * @tests java.text.NumberFormat#getNumberInstance()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getNumberInstance",
-        args = {}
-    )
     public void test_getNumberInstance() {
         Locale.setDefault(Locale.US);
         NumberFormat format = NumberFormat.getNumberInstance();
@@ -661,70 +395,25 @@
                 "123,456,789", format.format(123456789));
     }
 
-    /**
-     * @tests java.text.NumberFormat#getNumberInstance(Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getNumberInstance",
-        args = {java.util.Locale.class}
-    )
     public void test_getNumberInstanceLjava_util_Locale() {
-        Locale deLocale = new Locale("de", "CH");
-        Locale[] requiredLocales = {Locale.US, deLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
-        // BEGIN android-changed
         Locale.setDefault(Locale.US);
-        // use de_CH instead
-        NumberFormat format = NumberFormat.getNumberInstance(deLocale);
-        // NumberFormat format = NumberFormat.getNumberInstance(new Locale("ar",
-        //         "AR"));
+        Locale deLocale = new Locale("de", "CH");
+        if (Support_Locale.isLocaleAvailable(deLocale)) {
+            NumberFormat format = NumberFormat.getNumberInstance(deLocale);
+            assertNotSame("Instance is null", null, format);
+            assertTrue("Object is not instance of NumberFormat", format instanceof NumberFormat);
 
-        assertNotSame("Instance is null", null, format);
-        assertTrue("Object is not instance of NumberFormat",
-                format instanceof NumberFormat);
-
-        assertEquals(
-                "Test1: NumberFormat.getNumberInstance().format(-1234567890.0987654321) returned wrong value",
-                "-1'234'567'890.099", format.format(-1234567890.0987654321));
-        assertEquals(
-                "Test2: ((DecimalFormat) NumberFormat.getNumberInstance()).toPattern returned wrong value",
-                "#,##0.###", ((DecimalFormat) format).toPattern());
-        assertEquals(
-                "Test3: NumberFormat.getNumberInstance().format(123456789) returned wrong value",
-                "123'456'789", format.format(123456789));
-        // use de_CH instead
-        /*assertEquals(
-                "Test1: NumberFormat.getNumberInstance().format(-1234567890.0987654321) returned wrong value",
-                "1,234,567,890.099-", format.format(-1234567890.0987654321));
-        assertEquals(
-                "Test2: ((DecimalFormat) NumberFormat.getNumberInstance()).toPattern returned wrong value",
-                "#,##0.###;#,##0.###-", ((DecimalFormat) format).toPattern());
-        assertEquals(
-                "Test3: NumberFormat.getNumberInstance().format(123456789) returned wrong value",
-                "123,456,789", format.format(123456789));*/
+            assertEquals("-1'234'567'890.099", format.format(-1234567890.0987654321));
+            assertEquals("#,##0.###", ((DecimalFormat) format).toPattern());
+            assertEquals("123'456'789", format.format(123456789));
+        }
         try {
             NumberFormat.getInstance(null);
             fail("java.lang.NullPointerException is not thrown");
-        } catch (java.lang.NullPointerException npe) {
-            // expested
+        } catch (java.lang.NullPointerException expected) {
         }
-        // END android-changed
     }
 
-    /**
-     * @tests java.text.NumberFormat#getPercentInstance()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPercentInstance",
-        args = {}
-    )
     public void test_getPercentInstance() {
         Locale.setDefault(Locale.US);
         NumberFormat format = NumberFormat.getPercentInstance();
@@ -744,55 +433,26 @@
                 "12,345,678,900%", format.format(123456789));
     }
 
-    /**
-     * @tests java.text.NumberFormat#getPercentInstance(Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPercentInstance",
-        args = {java.util.Locale.class}
-    )
     public void test_getPercentInstanceLjava_util_Locale() {
         Locale csLocale = new Locale("cs", "CZ");
-        Locale[] requiredLocales = {Locale.US, csLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
         Locale.setDefault(Locale.US);
-        NumberFormat format = NumberFormat.getPercentInstance(csLocale);
+        if (Support_Locale.isLocaleAvailable(csLocale)) {
+            NumberFormat format = NumberFormat.getPercentInstance(csLocale);
 
-        assertNotSame("Instance is null", null, format);
-        assertTrue("Object is not instance of NumberFormat",
-                format instanceof NumberFormat);
+            assertNotSame("Instance is null", null, format);
+            assertTrue("Object is not instance of NumberFormat", format instanceof NumberFormat);
 
-        assertEquals(
-                "Test1: NumberFormat.getPercentInstance().format(1234567890.0987654321) returned wrong value",
-                "123\u00a0456\u00a0789\u00a0010\u00a0%", format.format(1234567890.0987654321));
-        assertEquals(
-                "Test2: ((DecimalFormat) NumberFormat.getPercentInstance()).toPattern returned wrong value",
-                "#,##0\u00a0%", ((DecimalFormat) format).toPattern());
-        assertEquals(
-                "Test3: NumberFormat.getPercentInstance().format(123456789) returned wrong value",
-                "12\u00a0345\u00a0678\u00a0900\u00a0%", format.format(123456789));
+            assertEquals("123\u00a0456\u00a0789\u00a0010\u00a0%", format.format(1234567890.0987654321));
+            assertEquals("#,##0\u00a0%", ((DecimalFormat) format).toPattern());
+            assertEquals("12\u00a0345\u00a0678\u00a0900\u00a0%", format.format(123456789));
+        }
         try {
             NumberFormat.getInstance(null);
             fail("java.lang.NullPointerException is not thrown");
-        } catch (java.lang.NullPointerException npe) {
-            // expested
+        } catch (java.lang.NullPointerException expected) {
         }
     }
 
-    /**
-     * @tests java.text.NumberFormat#getMaximumFractionDigits()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaximumFractionDigits",
-        args = {}
-    )
     public void test_getMaximumFractionDigits() {
         NumberFormat nf1 = NumberFormat.getInstance();
 
@@ -813,15 +473,6 @@
                 + " instead of Integer.MAX_VALUE", result == Integer.MAX_VALUE);
     }
 
-    /**
-     * @tests java.text.NumberFormat#getMinimumFractionDigits()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMinimumFractionDigits",
-        args = {}
-    )
     public void test_getMinimumFractionDigits() {
         NumberFormat nf1 = NumberFormat.getInstance();
         nf1.setMinimumFractionDigits(Integer.MAX_VALUE);
@@ -841,15 +492,6 @@
                 + " instead of 52", result == 52);
     }
 
-    /**
-     * @tests java.text.NumberFormat#getMaximumIntegerDigits()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaximumIntegerDigits",
-        args = {}
-    )
     public void test_getMaximumIntegerDigits() {
         NumberFormat nf1 = NumberFormat.getInstance();
         nf1.setMaximumIntegerDigits(Integer.MAX_VALUE);
@@ -869,15 +511,6 @@
                 + " instead of Integer.MAX_VALUE", result == Integer.MAX_VALUE);
     }
 
-    /**
-     * @tests java.text.NumberFormat#getMinimumIntegerDigits()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMinimumIntegerDigits",
-        args = {}
-    )
     public void test_getMinimumIntegernDigits() {
         NumberFormat nf1 = NumberFormat.getInstance();
         nf1.setMinimumIntegerDigits(Integer.MAX_VALUE);
@@ -897,15 +530,6 @@
                 + " instead of 5148", result == 73780);
     }
 
-    /**
-     * @tests java.text.NumberFormat#hashCode()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
 
         NumberFormat nf1 = NumberFormat.getInstance();
@@ -935,15 +559,6 @@
                 .hashCode());
     }
 
-    /**
-     * @tests java.text.NumberFormat#isGroupingUsed()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isGroupingUsed",
-        args = {}
-    )
     public void test_isGroupingUsed() {
         NumberFormat nf1 = NumberFormat.getInstance();
         assertTrue("grouping is not used for NumberFormat.getInstance", nf1
@@ -960,22 +575,7 @@
                 nf1.isGroupingUsed());
     }
 
-    /**
-     * @tests java.text.NumberFormat#setGroupingUsed(boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setGroupingUsed",
-        args = {boolean.class}
-    )
     public void test_setGroupingUsed() {
-        Locale csLocale = new Locale("cs", "CZ");
-        Locale[] requiredLocales = {Locale.US, csLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
         NumberFormat nf1 = NumberFormat.getInstance(Locale.US);
         nf1.setGroupingUsed(false);
 
@@ -1001,47 +601,28 @@
         assertEquals("grouping is not used for -1234567890.1",
                 "-1,234,567,890.1", nf1.format(-1234567890.1));
 
-        NumberFormat nf2 = NumberFormat.getPercentInstance(csLocale);
-        nf2.setGroupingUsed(false);
+        Locale csLocale = new Locale("cs", "CZ");
+        if (Support_Locale.isLocaleAvailable(csLocale)) {
+            NumberFormat nf2 = NumberFormat.getPercentInstance(csLocale);
+            nf2.setGroupingUsed(false);
 
-        assertEquals(
-                "Locale(\"cs\", \"CZ\"): grouping is used for 1234567890.1",
-                "123456789010\u00a0%", nf2.format(1234567890.1));
+            assertEquals("123456789010\u00a0%", nf2.format(1234567890.1));
 
-        assertEquals(
-                "Locale(\"cs\", \"CZ\"): grouping is used for -1234567890.1",
-                "-123456789010\u00a0%", nf2.format(-1234567890.1));
-        assertEquals("grouping is not used for 1234567890.1",
-                "1,234,567,890.1", nf1.format(1234567890.1));
+            assertEquals("-123456789010\u00a0%", nf2.format(-1234567890.1));
+            assertEquals("1,234,567,890.1", nf1.format(1234567890.1));
 
-        nf2.setGroupingUsed(true);
-        assertEquals(
-                "Locale(\"cs\", \"CZ\"): grouping is not used for 1234567890.1",
-                "123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(1234567890.1));
+            nf2.setGroupingUsed(true);
+            assertEquals("123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(1234567890.1));
 
-        assertEquals(
-                "Locale(\"cs\", \"CZ\"): grouping is not used for -1234567890.1",
-                "-123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(-1234567890.1));
+            assertEquals("-123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(-1234567890.1));
 
-        nf2.setGroupingUsed(true);
-        assertEquals(
-                "Locale(\"cs\", \"CZ\"): grouping is not used for 1234567890.1",
-                "123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(1234567890.1));
+            nf2.setGroupingUsed(true);
+            assertEquals("123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(1234567890.1));
 
-        assertEquals(
-                "Locale(\"cs\", \"CZ\"): grouping is not used for -1234567890.1",
-                "-123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(-1234567890.1));
+            assertEquals("-123\u00a0456\u00a0789\u00a0010\u00a0%", nf2.format(-1234567890.1));
+        }
     }
 
-    /**
-     * @tests java.text.NumberFormat#isParseIntegerOnly()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isParseIntegerOnly",
-        args = {}
-    )
     public void test_isParseIntegerOnly() {
         NumberFormat nf1 = NumberFormat.getInstance();
         assertTrue("ParseIntegerOnly is not used for NumberFormat.getInstance",
@@ -1058,15 +639,6 @@
                 nf1.isParseIntegerOnly());
     }
 
-    /**
-     * @tests java.text.NumberFormat#setParseIntegerOnly(boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setParseIntegerOnly",
-        args = {boolean.class}
-    )
     public void test_setParseIntegerOnly() {
         NumberFormat nf1 = NumberFormat.getInstance(Locale.US);
         nf1.setParseIntegerOnly(true);
@@ -1088,15 +660,6 @@
                 "-1,234,567,890", nf1.format(-1234567890.));
     }
 
-    /**
-     * @tests java.text.NumberFormat#setMaximumFractionDigits(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMaximumFractionDigits",
-        args = {int.class}
-    )
     public void test_setMaximumFractionDigits() {
         NumberFormat nf1 = NumberFormat.getInstance(Locale.US);
         nf1.setMaximumFractionDigits(Integer.MAX_VALUE);
@@ -1128,15 +691,6 @@
                 "1,234,567,890", nf1.format(1234567890.0987654321));
     }
 
-    /**
-     * @tests java.text.NumberFormat#setMinimumFractionDigits(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMinimumFractionDigits",
-        args = {int.class}
-    )
     public void test_setMinimumFractionDigits() {
 
         NumberFormat nf1 = NumberFormat.getInstance(Locale.US);
@@ -1167,15 +721,6 @@
                 "1,234,567,890.098", nf1.format(1234567890.098));
     }
 
-    /**
-     * @tests java.text.NumberFormat#setMinimumIntegerDigits(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMinimumIntegerDigits",
-        args = {int.class}
-    )
     public void test_setMinimumIntegerDigits() {
 
         NumberFormat nf1 = NumberFormat.getInstance(Locale.US);
@@ -1203,15 +748,6 @@
                 + " instead of Integer.MIN_VALUE", result == 0);
     }
 
-    /**
-     * @tests java.text.NumberFormat#parse(String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = {java.lang.String.class}
-    )
     @BrokenTest("Fails in CTS, passes in CoreTestRunner")
     public void test_parseLjava_lang_String() {
         NumberFormat nf1 = NumberFormat.getInstance();
@@ -1274,15 +810,6 @@
         }
     }
 
-    /**
-     * @tests java.text.NumberFormat#NumberFormat()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NumberFormat",
-        args = {}
-    )
     public void test_constructor() {
         MyNumberFormat mf = new MyNumberFormat();
         assertFalse("Greated NumberFormat object is null", mf == null);
diff --git a/luni/src/test/java/libcore/java/text/OldSimpleDateFormatTest.java b/luni/src/test/java/libcore/java/text/OldSimpleDateFormatTest.java
index 4da54e6..01506df 100644
--- a/luni/src/test/java/libcore/java/text/OldSimpleDateFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/OldSimpleDateFormatTest.java
@@ -76,7 +76,7 @@
     }
 
     /**
-     * @tests java.text.SimpleDateFormat#SimpleDateFormat(java.lang.String,
+     * java.text.SimpleDateFormat#SimpleDateFormat(java.lang.String,
      *        java.text.DateFormatSymbols)
      */
     public void test_ConstructorLjava_lang_StringLjava_text_DateFormatSymbols() {
@@ -183,7 +183,7 @@
     }
 
     /**
-     * @tests java.text.SimpleDateFormat#applyPattern(java.lang.String)
+     * java.text.SimpleDateFormat#applyPattern(java.lang.String)
      */
     public void test_applyPatternLjava_lang_String() {
         // Test for method void
@@ -387,12 +387,24 @@
         FormatTester test = new FormatTester();
         Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 2, 15, 3, 6);
 
-        format.setTimeZone(new SimpleTimeZone(60000, "ONE MINUTE"));
+        TimeZone tz0001 = new SimpleTimeZone(60000, "ONE MINUTE");
+        TimeZone tz0130 = new SimpleTimeZone(5400000, "ONE HOUR, THIRTY");
+        TimeZone tzMinus0130 = new SimpleTimeZone(-5400000, "NEG ONE HOUR, THIRTY");
+
+        format.setTimeZone(tz0001);
+        test.test(" Z", cal, " +0001", DateFormat.TIMEZONE_FIELD);
+        test.test(" ZZZZ", cal, " +0001", DateFormat.TIMEZONE_FIELD);
+        format.setTimeZone(tz0130);
+        test.test(" Z", cal, " +0130", DateFormat.TIMEZONE_FIELD);
+        format.setTimeZone(tzMinus0130);
+        test.test(" Z", cal, " -0130", DateFormat.TIMEZONE_FIELD);
+
+        format.setTimeZone(tz0001);
         test.test(" z", cal, " GMT+00:01", DateFormat.TIMEZONE_FIELD);
         test.test(" zzzz", cal, " GMT+00:01", DateFormat.TIMEZONE_FIELD);
-        format.setTimeZone(new SimpleTimeZone(5400000, "ONE HOUR, THIRTY"));
+        format.setTimeZone(tz0130);
         test.test(" z", cal, " GMT+01:30", DateFormat.TIMEZONE_FIELD);
-        format.setTimeZone(new SimpleTimeZone(-5400000, "NEG ONE HOUR, THIRTY"));
+        format.setTimeZone(tzMinus0130);
         test.test(" z", cal, " GMT-01:30", DateFormat.TIMEZONE_FIELD);
 
         format.setTimeZone(TimeZone.getTimeZone("America/New_York"));
@@ -409,7 +421,7 @@
     }
 
     /**
-     * @tests java.text.SimpleDateFormat#format(java.util.Date)
+     * java.text.SimpleDateFormat#format(java.util.Date)
      */
     public void test_timeZoneFormatting() {
         // tests specific to formatting of timezones
diff --git a/luni/src/test/java/libcore/java/text/SimpleDateFormatTest.java b/luni/src/test/java/libcore/java/text/SimpleDateFormatTest.java
index dd1c99c..00f2003 100644
--- a/luni/src/test/java/libcore/java/text/SimpleDateFormatTest.java
+++ b/luni/src/test/java/libcore/java/text/SimpleDateFormatTest.java
@@ -103,4 +103,79 @@
         c.setTime(d);
         return c;
     }
+
+    // http://code.google.com/p/android/issues/detail?id=13420
+    public void testParsingUncommonTimeZoneAbbreviations() {
+        String fmt = "yyyy-MM-dd HH:mm:ss.SSS z";
+        String date = "2010-12-23 12:44:57.0 CET";
+        // ICU considers "CET" (Central European Time) to be common in Britain...
+        assertEquals(1293104697000L, parseDate(Locale.UK, fmt, date).getTimeInMillis());
+        // ...but not in the US. Check we can parse such a date anyway.
+        assertEquals(1293104697000L, parseDate(Locale.US, fmt, date).getTimeInMillis());
+    }
+
+    public void testFormattingUncommonTimeZoneAbbreviations() {
+        // In Honeycomb, only one Olson id was associated with CET (or any
+        // other "uncommon" abbreviation).
+        String fmt = "yyyy-MM-dd HH:mm:ss.SSS z";
+        String date = "1970-01-01 01:00:00.000 CET";
+        SimpleDateFormat sdf = new SimpleDateFormat(fmt, Locale.US);
+        sdf.setTimeZone(TimeZone.getTimeZone("Europe/Berlin"));
+        assertEquals(date, sdf.format(new Date(0)));
+        sdf = new SimpleDateFormat(fmt, Locale.US);
+        sdf.setTimeZone(TimeZone.getTimeZone("Europe/Zurich"));
+        assertEquals(date, sdf.format(new Date(0)));
+    }
+
+    // http://code.google.com/p/android/issues/detail?id=8258
+    public void testTimeZoneFormatting() throws Exception {
+        Date epoch = new Date(0);
+
+        // Create a SimpleDateFormat that defaults to America/Chicago...
+        TimeZone.setDefault(TimeZone.getTimeZone("America/Chicago"));
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
+        // We should see something appropriate to America/Chicago...
+        assertEquals("1969-12-31 18:00:00 -0600", sdf.format(epoch));
+        // We can set any TimeZone we want:
+        sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
+        assertEquals("1969-12-31 16:00:00 -0800", sdf.format(epoch));
+        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+        assertEquals("1970-01-01 00:00:00 +0000", sdf.format(epoch));
+
+        // A new SimpleDateFormat will default to America/Chicago...
+        sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z");
+        // ...and parsing an America/Los_Angeles time will *not* change that...
+        sdf.parse("2010-12-03 00:00:00 -0800");
+        // ...so our time zone here is "America/Chicago":
+        assertEquals("1969-12-31 18:00:00 -0600", sdf.format(epoch));
+        // We can set any TimeZone we want:
+        sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
+        assertEquals("1969-12-31 16:00:00 -0800", sdf.format(epoch));
+        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+        assertEquals("1970-01-01 00:00:00 +0000", sdf.format(epoch));
+
+        sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+        Date date = sdf.parse("2010-07-08 02:44:48");
+        assertEquals(1278557088000L, date.getTime());
+        sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+        sdf.setTimeZone(TimeZone.getTimeZone("America/Los_Angeles"));
+        assertEquals("2010-07-07T19:44:48-0700", sdf.format(date));
+        sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
+        assertEquals("2010-07-08T02:44:48+0000", sdf.format(date));
+    }
+
+    public void testLocales() throws Exception {
+        // Just run through them all. Handy as a poor man's benchmark, and a sanity check.
+        for (Locale l : Locale.getAvailableLocales()) {
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss zzzz", l);
+            sdf.format(new Date(0));
+        }
+    }
+
+    // http://code.google.com/p/android/issues/detail?id=14963
+    public void testParseTimezoneOnly() throws Exception {
+        new SimpleDateFormat("z", Locale.FRANCE).parse("UTC");
+        new SimpleDateFormat("z", Locale.US).parse("UTC");
+    }
 }
diff --git a/luni/src/test/java/libcore/java/util/BitSetTest.java b/luni/src/test/java/libcore/java/util/BitSetTest.java
new file mode 100644
index 0000000..4998a07
--- /dev/null
+++ b/luni/src/test/java/libcore/java/util/BitSetTest.java
@@ -0,0 +1,234 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.util;
+
+import java.nio.ByteBuffer;
+import java.nio.LongBuffer;
+import java.util.Arrays;
+import java.util.BitSet;
+
+public class BitSetTest extends junit.framework.TestCase {
+    public void test_toString() throws Exception {
+        // From the RI javadoc.
+        BitSet bs = new BitSet();
+        assertEquals("{}", bs.toString());
+        bs.set(2);
+        assertEquals("{2}", bs.toString());
+        bs.set(4);
+        bs.set(10);
+        assertEquals("{2, 4, 10}", bs.toString());
+    }
+
+    private static void assertBitSet(BitSet bs, long[] longs, String s) {
+        for (int i = 0; i < 64 * longs.length; ++i) {
+            assertEquals(bs.toString(), ((longs[i / 64] & (1L << (i % 64))) != 0), bs.get(i));
+        }
+        int cardinality = 0;
+        for (int i = 0; i < longs.length; ++i) {
+            cardinality += Long.bitCount(longs[i]);
+        }
+        if (cardinality != 0) {
+            assertFalse(bs.isEmpty());
+        } else {
+            assertTrue(bs.isEmpty());
+        }
+        assertEquals(cardinality, bs.cardinality());
+        assertEquals(64 * longs.length, bs.size());
+        assertEquals(s, bs.toString());
+    }
+
+    private static void assertBitSet(long[] longs, String s) {
+        // Test BitSet.valueOf(long[]).
+        assertBitSet(BitSet.valueOf(longs), longs, s);
+        // Test BitSet.valueOf(LongBuffer).
+        assertBitSet(BitSet.valueOf(LongBuffer.wrap(longs)), longs, s);
+        // Surround 'longs' with junk set bits but exclude them from the LongBuffer.
+        long[] paddedLongs = new long[1 + longs.length + 1];
+        paddedLongs[0] = paddedLongs[paddedLongs.length - 1] = -1L;
+        System.arraycopy(longs, 0, paddedLongs, 1, longs.length);
+        assertBitSet(BitSet.valueOf(LongBuffer.wrap(paddedLongs, 1, longs.length)), longs, s);
+
+        // Check that the long[] is copied.
+        if (longs.length > 0) {
+            BitSet original = BitSet.valueOf(longs);
+            longs[0] = ~longs[0];
+            assertFalse(BitSet.valueOf(longs).equals(original));
+        }
+    }
+
+    public void test_valueOf_long() throws Exception {
+        assertBitSet(new long[0], "{}");
+        assertBitSet(new long[] { 1L }, "{0}");
+        assertBitSet(new long[] { 0x111L }, "{0, 4, 8}");
+        assertBitSet(new long[] { 0x101L, 0x4000000000000000L }, "{0, 8, 126}");
+    }
+
+    private static void assertBitSet(BitSet bs, byte[] bytes, String s) {
+        for (int i = 0; i < 8 * bytes.length; ++i) {
+            assertEquals(bs.toString(), ((bytes[i / 8] & (1L << (i % 8))) != 0), bs.get(i));
+        }
+        int cardinality = 0;
+        for (int i = 0; i < bytes.length; ++i) {
+            cardinality += Integer.bitCount(((int) bytes[i]) & 0xff);
+        }
+        if (cardinality != 0) {
+            assertFalse(bs.isEmpty());
+        } else {
+            assertTrue(bs.isEmpty());
+        }
+        assertEquals(cardinality, bs.cardinality());
+        assertEquals(roundUp(8 * bytes.length, 64), bs.size());
+        assertEquals(s, bs.toString());
+    }
+
+    private static int roundUp(int n, int multiple) {
+        return (n == 0) ? 0 : ((n + multiple - 1) / multiple) * multiple;
+    }
+
+    private static void assertBitSet(byte[] bytes, String s) {
+        // Test BitSet.valueOf(byte[]).
+        assertBitSet(BitSet.valueOf(bytes), bytes, s);
+        // Test BitSet.valueOf(ByteBuffer).
+        assertBitSet(BitSet.valueOf(ByteBuffer.wrap(bytes)), bytes, s);
+        // Surround 'bytes' with junk set bits but exclude them from the ByteBuffer.
+        byte[] paddedBytes = new byte[1 + bytes.length + 1];
+        paddedBytes[0] = paddedBytes[paddedBytes.length - 1] = (byte) -1;
+        System.arraycopy(bytes, 0, paddedBytes, 1, bytes.length);
+        assertBitSet(BitSet.valueOf(ByteBuffer.wrap(paddedBytes, 1, bytes.length)), bytes, s);
+
+        // Check that the byte[] is copied.
+        if (bytes.length > 0) {
+            BitSet original = BitSet.valueOf(bytes);
+            bytes[0] = (byte) ~bytes[0];
+            assertFalse(BitSet.valueOf(bytes).equals(original));
+        }
+    }
+
+    public void test_valueOf_byte() throws Exception {
+        // Nothing...
+        assertBitSet(new byte[0], "{}");
+        // Less than a long...
+        assertBitSet(new byte[] { 0x01 }, "{0}");
+        assertBitSet(new byte[] { 0x01, 0x11 }, "{0, 8, 12}");
+        assertBitSet(new byte[] { 0x01, 0x01, 0x00, 0x00, 0x01 }, "{0, 8, 32}");
+        // Exactly one long....
+        assertBitSet(new byte[] { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0x80 }, "{0, 63}");
+        // One long and a byte left over...
+        assertBitSet(new byte[] { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01 }, "{0, 64}");
+        // Two longs...
+        byte[] bytes = new byte[] { 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0x80,
+                                    0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (byte) 0x80 };
+        assertBitSet(bytes, "{0, 63, 64, 127}");
+    }
+
+    public void test_toLongArray() throws Exception {
+        assertEquals("[]", Arrays.toString(BitSet.valueOf(new long[0]).toLongArray()));
+        assertEquals("[1]", Arrays.toString(BitSet.valueOf(new long[] { 1 }).toLongArray()));
+        assertEquals("[1, 2]", Arrays.toString(BitSet.valueOf(new long[] { 1, 2 }).toLongArray()));
+
+        // Check that we're not returning trailing empty space.
+        assertEquals("[]", Arrays.toString(new BitSet(128).toLongArray()));
+        BitSet bs = new BitSet();
+        bs.set(0);
+        bs.set(64, 66);
+        bs.clear(64, 66);
+        assertEquals("[1]", Arrays.toString(bs.toLongArray()));
+    }
+
+    public void test_toByteArray() throws Exception {
+        assertEquals("[]", Arrays.toString(BitSet.valueOf(new long[0]).toByteArray()));
+        assertEquals("[1]", Arrays.toString(BitSet.valueOf(new long[] { 1 }).toByteArray()));
+        assertEquals("[-17, -51, -85, -112, 120, 86, 52, 18]",
+                Arrays.toString(BitSet.valueOf(new long[] { 0x1234567890abcdefL }).toByteArray()));
+        assertEquals("[1, 0, 0, 0, 0, 0, 0, 0, 2]",
+                Arrays.toString(BitSet.valueOf(new long[] { 1, 2 }).toByteArray()));
+    }
+
+    public void test_previousSetBit() {
+        assertEquals(-1, new BitSet().previousSetBit(666));
+
+        BitSet bs;
+
+        bs = new BitSet();
+        bs.set(32);
+        assertEquals(32, bs.previousSetBit(999));
+        assertEquals(32, bs.previousSetBit(33));
+        assertEquals(32, bs.previousSetBit(32));
+        assertEquals(-1, bs.previousSetBit(31));
+
+        bs = new BitSet();
+        bs.set(0);
+        bs.set(1);
+        bs.set(32);
+        bs.set(192);
+        bs.set(666);
+
+        assertEquals(666, bs.previousSetBit(999));
+        assertEquals(666, bs.previousSetBit(667));
+        assertEquals(666, bs.previousSetBit(666));
+        assertEquals(192, bs.previousSetBit(665));
+        assertEquals(32, bs.previousSetBit(191));
+        assertEquals(1, bs.previousSetBit(31));
+        assertEquals(0, bs.previousSetBit(0));
+        assertEquals(-1, bs.previousSetBit(-1));
+    }
+
+    private static BitSet big() {
+        BitSet result = new BitSet();
+        result.set(1000);
+        return result;
+    }
+
+    private static BitSet small() {
+        BitSet result = new BitSet();
+        result.set(10);
+        return result;
+    }
+
+    public void test_differentSizes() {
+        BitSet result = big();
+        result.and(small());
+        assertEquals("{}", result.toString());
+        result = small();
+        result.and(big());
+        assertEquals("{}", result.toString());
+
+        result = big();
+        result.andNot(small());
+        assertEquals("{1000}", result.toString());
+        result = small();
+        result.andNot(big());
+        assertEquals("{10}", result.toString());
+
+        assertFalse(big().intersects(small()));
+        assertFalse(small().intersects(big()));
+
+        result = big();
+        result.or(small());
+        assertEquals("{10, 1000}", result.toString());
+        result = small();
+        result.or(big());
+        assertEquals("{10, 1000}", result.toString());
+
+        result = big();
+        result.xor(small());
+        assertEquals("{10, 1000}", result.toString());
+        result = small();
+        result.xor(big());
+        assertEquals("{10, 1000}", result.toString());
+    }
+}
diff --git a/luni/src/test/java/libcore/java/util/CollectionsTest.java b/luni/src/test/java/libcore/java/util/CollectionsTest.java
new file mode 100644
index 0000000..80c769e
--- /dev/null
+++ b/luni/src/test/java/libcore/java/util/CollectionsTest.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2011 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.util;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.ListIterator;
+import java.util.NoSuchElementException;
+import junit.framework.TestCase;
+
+public final class CollectionsTest extends TestCase {
+
+    public void testEmptyEnumeration() {
+        Enumeration<Object> e = Collections.emptyEnumeration();
+        assertFalse(e instanceof Serializable);
+        assertFalse(e.hasMoreElements());
+        try {
+            e.nextElement();
+            fail();
+        } catch (NoSuchElementException expected) {
+        }
+    }
+
+    public void testEmptyIterator() {
+        testEmptyIterator(Collections.emptyIterator());
+        testEmptyIterator(Collections.emptyList().iterator());
+        testEmptyIterator(Collections.emptySet().iterator());
+        testEmptyIterator(Collections.emptyMap().keySet().iterator());
+        testEmptyIterator(Collections.emptyMap().entrySet().iterator());
+        testEmptyIterator(Collections.emptyMap().values().iterator());
+    }
+
+    private void testEmptyIterator(Iterator<?> i) {
+        assertFalse(i instanceof Serializable);
+        assertFalse(i.hasNext());
+        try {
+            i.next();
+            fail();
+        } catch (NoSuchElementException expected) {
+        }
+        try {
+            i.remove();
+            fail();
+        } catch (IllegalStateException expected) {
+        }
+    }
+
+    public void testEmptyListIterator() {
+        testEmptyListIterator(Collections.emptyListIterator());
+        testEmptyListIterator(Collections.emptyList().listIterator());
+        testEmptyListIterator(Collections.emptyList().listIterator(0));
+    }
+
+    private void testEmptyListIterator(ListIterator<?> i) {
+        assertFalse(i instanceof Serializable);
+        assertFalse(i.hasNext());
+        assertFalse(i.hasPrevious());
+        assertEquals(0, i.nextIndex());
+        try {
+            i.next();
+            fail();
+        } catch (NoSuchElementException expected) {
+        }
+        assertEquals(-1, i.previousIndex());
+        try {
+            i.previous();
+            fail();
+        } catch (NoSuchElementException expected) {
+        }
+        try {
+            i.add(null);
+            fail();
+        } catch (UnsupportedOperationException expected) {
+        }
+        try {
+            i.remove();
+            fail();
+        } catch (IllegalStateException expected) {
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/java/util/CurrencyTest.java b/luni/src/test/java/libcore/java/util/CurrencyTest.java
index 283bd61..13e2242 100644
--- a/luni/src/test/java/libcore/java/util/CurrencyTest.java
+++ b/luni/src/test/java/libcore/java/util/CurrencyTest.java
@@ -18,6 +18,7 @@
 
 import java.util.Currency;
 import java.util.Locale;
+import java.util.Set;
 
 public class CurrencyTest extends junit.framework.TestCase {
     // Regression test to ensure that Currency.getSymbol(Locale) returns the
@@ -42,4 +43,29 @@
         } catch (IllegalArgumentException expected) {
         }
     }
+
+    public void testGetAvailableCurrencies() throws Exception {
+        Set<Currency> all = Currency.getAvailableCurrencies();
+        // Confirm that a few well-known stable currencies are present.
+        assertTrue(all.toString(), all.contains(Currency.getInstance("CHF")));
+        assertTrue(all.toString(), all.contains(Currency.getInstance("EUR")));
+        assertTrue(all.toString(), all.contains(Currency.getInstance("GBP")));
+        assertTrue(all.toString(), all.contains(Currency.getInstance("JPY")));
+        assertTrue(all.toString(), all.contains(Currency.getInstance("USD")));
+    }
+
+    public void test_getDisplayName() throws Exception {
+        assertEquals("Swiss Franc", Currency.getInstance("CHF").getDisplayName(Locale.US));
+        assertEquals("Schweizer Franken", Currency.getInstance("CHF").getDisplayName(new Locale("de", "CH")));
+        assertEquals("franc suisse", Currency.getInstance("CHF").getDisplayName(new Locale("fr", "CH")));
+        assertEquals("Franco Svizzero", Currency.getInstance("CHF").getDisplayName(new Locale("it", "CH")));
+        // Test behavior with unknown locales; should return the currency code.
+        assertEquals("CHF", Currency.getInstance("CHF").getDisplayName(new Locale("xx", "YY")));
+    }
+
+    public void test_getDefaultFractionDigits() throws Exception {
+        assertEquals(2, Currency.getInstance("USD").getDefaultFractionDigits());
+        assertEquals(0, Currency.getInstance("JPY").getDefaultFractionDigits());
+        assertEquals(-1, Currency.getInstance("XXX").getDefaultFractionDigits());
+    }
 }
diff --git a/luni/src/test/java/libcore/java/util/DateTest.java b/luni/src/test/java/libcore/java/util/DateTest.java
index 37d36d1..ddcc3e5 100644
--- a/luni/src/test/java/libcore/java/util/DateTest.java
+++ b/luni/src/test/java/libcore/java/util/DateTest.java
@@ -16,7 +16,9 @@
 
 package libcore.java.util;
 
+import java.util.Calendar;
 import java.util.Date;
+import java.util.Locale;
 import java.util.TimeZone;
 import junit.framework.TestCase;
 
@@ -28,4 +30,17 @@
         TimeZone.setDefault(TimeZone.getTimeZone("America/Chicago"));
         assertEquals("Wed Dec 31 18:00:00 CST 1969", new Date(0).toString());
     }
+
+    public void test_toGMTString() throws Exception {
+        // Based on https://issues.apache.org/jira/browse/HARMONY-501
+        TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles"));
+        Calendar c = Calendar.getInstance();
+        c.clear();
+        c.set(Calendar.YEAR, 21);
+        assertEquals("Wed Jan 01 00:00:00 PST 21", c.getTime().toString());
+        assertEquals("1 Jan 21 08:00:00 GMT", c.getTime().toGMTString());
+        c.set(Calendar.YEAR, 321);
+        assertEquals("Sun Jan 01 00:00:00 PST 321", c.getTime().toString());
+        assertEquals("1 Jan 321 08:00:00 GMT", c.getTime().toGMTString());
+    }
 }
diff --git a/luni/src/test/java/libcore/java/util/LocaleTest.java b/luni/src/test/java/libcore/java/util/LocaleTest.java
index ac5dd2d..541dd66 100644
--- a/luni/src/test/java/libcore/java/util/LocaleTest.java
+++ b/luni/src/test/java/libcore/java/util/LocaleTest.java
@@ -49,7 +49,7 @@
     // http://b/3452611; Locale.getDisplayLanguage fails for the obsolete language codes.
     public void test_getDisplayName_obsolete() throws Exception {
         // he (new) -> iw (obsolete)
-        assertObsolete("he", "iw", "\u05e2\u05d1\u05e8\u05d9\u05ea"); // "Hebrew" in Hebrew
+        assertObsolete("he", "iw", "עברית");
         // id (new) -> in (obsolete)
         assertObsolete("id", "in", "Bahasa Indonesia");
     }
diff --git a/luni/src/test/java/libcore/java/util/OldFormatterTest.java b/luni/src/test/java/libcore/java/util/OldFormatterTest.java
index b5ba3b7..53d8eb2 100644
--- a/luni/src/test/java/libcore/java/util/OldFormatterTest.java
+++ b/luni/src/test/java/libcore/java/util/OldFormatterTest.java
@@ -53,28 +53,27 @@
     }
 
     public void test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object() {
-        Locale[] requiredLocales = {Locale.GERMAN, Locale.FRANCE, Locale.US, Locale.CANADA};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
         Double val = new Double(3.14);
         Calendar cal = Calendar.getInstance();
         Formatter fLoc = null;
         Formatter fNoL = null;
         cal.set(2008, Calendar.SEPTEMBER, 23, 18, 30);
 
-        fLoc = new Formatter(Locale.GERMAN);
-        fNoL = new Formatter(Locale.GERMAN);
-        fLoc.format(Locale.US, "%f", val);
-        fNoL.format("%f", val);
-        assertFalse(fLoc.toString().equals(fNoL.toString()));
+        if (Support_Locale.isLocaleAvailable(Locale.GERMAN)) {
+            fLoc = new Formatter(Locale.GERMAN);
+            fNoL = new Formatter(Locale.GERMAN);
+            fLoc.format(Locale.US, "%f", val);
+            fNoL.format("%f", val);
+            assertFalse(fLoc.toString().equals(fNoL.toString()));
+        }
 
-        fLoc = new Formatter(Locale.FRANCE);
-        fNoL = new Formatter(Locale.FRANCE);
-        fLoc.format(Locale.US, "%f", val);
-        fNoL.format("%f", val);
-        assertFalse(fLoc.toString().equals(fNoL.toString()));
+        if (Support_Locale.isLocaleAvailable(Locale.FRANCE)) {
+            fLoc = new Formatter(Locale.FRANCE);
+            fNoL = new Formatter(Locale.FRANCE);
+            fLoc.format(Locale.US, "%f", val);
+            fNoL.format("%f", val);
+            assertFalse(fLoc.toString().equals(fNoL.toString()));
+        }
 
         fLoc = new Formatter(Locale.US);
         fNoL = new Formatter(Locale.US);
@@ -82,17 +81,21 @@
         fNoL.format("%f", val);
         assertTrue(fLoc.toString().equals(fNoL.toString()));
 
-        fLoc = new Formatter(Locale.GERMAN);
-        fNoL = new Formatter(Locale.GERMAN);
-        fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal,  cal, cal);
-        fNoL.format("%tA %tB %td %tT", cal, cal,  cal, cal);
-        assertFalse(fLoc.toString().equals(fNoL.toString()));
+        if (Support_Locale.isLocaleAvailable(Locale.GERMAN)) {
+            fLoc = new Formatter(Locale.GERMAN);
+            fNoL = new Formatter(Locale.GERMAN);
+            fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal,  cal, cal);
+            fNoL.format("%tA %tB %td %tT", cal, cal,  cal, cal);
+            assertFalse(fLoc.toString().equals(fNoL.toString()));
+        }
 
-        fLoc = new Formatter(Locale.FRANCE);
-        fNoL = new Formatter(Locale.FRANCE);
-        fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal,  cal, cal);
-        fNoL.format("%tA %tB %td %tT", cal, cal,  cal, cal);
-        assertFalse(fLoc.toString().equals(fNoL.toString()));
+        if (Support_Locale.isLocaleAvailable(Locale.FRANCE)) {
+            fLoc = new Formatter(Locale.FRANCE);
+            fNoL = new Formatter(Locale.FRANCE);
+            fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal,  cal, cal);
+            fNoL.format("%tA %tB %td %tT", cal, cal,  cal, cal);
+            assertFalse(fLoc.toString().equals(fNoL.toString()));
+        }
 
         fLoc = new Formatter(Locale.US);
         fNoL = new Formatter(Locale.US);
@@ -104,29 +107,31 @@
                 "%+ a", "%+ A", "%-03e", "%-03E", "%-03g", "%-03G", "%-03f",
                 "%-03a", "%-03A" };
         for (int i = 0; i < illFlags.length; i++) {
-            try {
-                fLoc = new Formatter(Locale.US);
-                fLoc.format(Locale.FRANCE, illFlags[i], 1.23d);
-                fail("should throw IllegalFormatFlagsException");
-            } catch (IllegalFormatFlagsException e) {
-                // expected
+            if (Support_Locale.isLocaleAvailable(Locale.FRANCE)) {
+                try {
+                    fLoc = new Formatter(Locale.US);
+                    fLoc.format(Locale.FRANCE, illFlags[i], 1.23d);
+                    fail("should throw IllegalFormatFlagsException");
+                } catch (IllegalFormatFlagsException expected) {
+                }
             }
 
-            try {
-                fLoc = new Formatter(Locale.CANADA);
-                fLoc.format(Locale.GERMAN, illFlags[i], (Double) null);
-                fail("should throw IllegalFormatFlagsException");
-            } catch (IllegalFormatFlagsException e) {
-                // expected
+            if (Support_Locale.isLocaleAvailable(Locale.CANADA)) {
+                try {
+                    fLoc = new Formatter(Locale.CANADA);
+                    fLoc.format(Locale.GERMAN, illFlags[i], (Double) null);
+                    fail("should throw IllegalFormatFlagsException");
+                } catch (IllegalFormatFlagsException expected) {
+                }
             }
         }
-
         fLoc.close();
 
-        try {
-            fLoc.format(Locale.GERMAN, "%f", val);
-        } catch (FormatterClosedException e) {
-            //expected
+        if (Support_Locale.isLocaleAvailable(Locale.GERMAN)) {
+            try {
+                fLoc.format(Locale.GERMAN, "%f", val);
+            } catch (FormatterClosedException expected) {
+            }
         }
     }
 }
diff --git a/luni/src/test/java/libcore/java/util/OldPriorityQueueTest.java b/luni/src/test/java/libcore/java/util/OldPriorityQueueTest.java
index 041a823..d8750b5 100644
--- a/luni/src/test/java/libcore/java/util/OldPriorityQueueTest.java
+++ b/luni/src/test/java/libcore/java/util/OldPriorityQueueTest.java
@@ -16,9 +16,6 @@
 
 package libcore.java.util;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.List;
@@ -26,20 +23,10 @@
 import junit.framework.TestCase;
 import tests.util.SerializationTester;
 
-@TestTargetClass(PriorityQueue.class)
 public class OldPriorityQueueTest extends TestCase {
 
     private static final String SERIALIZATION_FILE_NAME = "/serialization/tests/api/java/util/PriorityQueue.golden.ser";
 
-    /**
-     * @tests java.util.PriorityQueue#PriorityQueue(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PriorityQueue",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         PriorityQueue<Object> queue = new PriorityQueue<Object>(100);
         assertNotNull(queue);
@@ -54,16 +41,6 @@
         }
     }
 
-    /**
-     * @tests java.util.PriorityQueue#remove(Object)
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_remove_Ljava_lang_Object_using_comparator() {
         PriorityQueue<String> queue = new PriorityQueue<String>(10,
                 new MockComparatorStringByLength());
@@ -78,16 +55,6 @@
         assertTrue(queue.remove("AA"));
     }
 
-    /**
-     * @tests java.util.PriorityQueue#remove(Object)
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies ClassCastException.",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_remove_Ljava_lang_Object_not_exists() {
         Integer[] array = { 2, 45, 7, -12, 9, 23, 17, 1118, 10, 16, 39 };
         List<Integer> list = Arrays.asList(array);
@@ -97,15 +64,6 @@
         assertFalse(integerQueue.remove(""));
     }
 
-    /**
-     * @tests serialization/deserialization.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization.",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void test_Serialization() throws Exception {
         Integer[] array = { 2, 45, 7, -12, 9, 23, 17, 1118, 10, 16, 39 };
         List<Integer> list = Arrays.asList(array);
@@ -120,15 +78,6 @@
         assertEquals(0, destIntegerQueue.size());
     }
 
-    /**
-     * @tests serialization/deserialization.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization.",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void test_Serialization_casting() throws Exception {
         Integer[] array = { 2, 45, 7, -12, 9, 23, 17, 1118, 10, 16, 39 };
         List<Integer> list = Arrays.asList(array);
@@ -143,15 +92,6 @@
         assertEquals(array[0], I);
     }
 
-    /**
-     * @tests serialization/deserialization compatibility with RI.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization compatibility.",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_SerializationCompatibility_cast() throws Exception {
         Integer[] array = { 2, 45, 7, -12, 9, 23, 17, 1118, 10, 16, 39 };
         List<Integer> list = Arrays.asList(array);
diff --git a/luni/src/test/java/libcore/java/util/OldTimeZoneTest.java b/luni/src/test/java/libcore/java/util/OldTimeZoneTest.java
index 19a0bf4..240403e 100644
--- a/luni/src/test/java/libcore/java/util/OldTimeZoneTest.java
+++ b/luni/src/test/java/libcore/java/util/OldTimeZoneTest.java
@@ -18,16 +18,12 @@
 package libcore.java.util;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.util.Date;
 import java.util.Locale;
 import java.util.TimeZone;
 import junit.framework.TestCase;
 import tests.support.Support_Locale;
 
-@TestTargetClass(TimeZone.class)
 public class OldTimeZoneTest extends TestCase {
 
     class Mock_TimeZone extends TimeZone {
@@ -57,22 +53,10 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TimeZone",
-        args = {}
-    )
     public void test_constructor() {
         assertNotNull(new Mock_TimeZone());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         TimeZone tz1 = TimeZone.getDefault();
         TimeZone tz2 = (TimeZone)tz1.clone();
@@ -80,12 +64,6 @@
         assertTrue(tz1.equals(tz2));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAvailableIDs",
-        args = {}
-    )
     public void test_getAvailableIDs() {
         String[] str = TimeZone.getAvailableIDs();
         assertNotNull(str);
@@ -95,12 +73,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAvailableIDs",
-        args = {int.class}
-    )
     public void test_getAvailableIDsI() {
         String[] str = TimeZone.getAvailableIDs(0);
         assertNotNull(str);
@@ -110,12 +82,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayName",
-        args = {}
-    )
     public void test_getDisplayName() {
         TimeZone tz = TimeZone.getTimeZone("GMT-6");
         assertEquals("GMT-06:00", tz.getDisplayName());
@@ -123,30 +89,15 @@
         assertEquals("Pacific Standard Time", tz.getDisplayName());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayName",
-        args = {java.util.Locale.class}
-    )
     public void test_getDisplayNameLjava_util_Locale() {
-        Locale[] requiredLocales = {Locale.US, Locale.FRANCE};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
         TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
         assertEquals("Pacific Standard Time", tz.getDisplayName(new Locale("US")));
-        // BEGIN android-note: RI has "Heure", CLDR/ICU has "heure".
-        assertEquals("heure normale du Pacifique", tz.getDisplayName(Locale.FRANCE));
+        if (Support_Locale.isLocaleAvailable(Locale.FRANCE)) {
+            // BEGIN android-note: RI has "Heure", CLDR/ICU has "heure".
+            assertEquals("heure normale du Pacifique", tz.getDisplayName(Locale.FRANCE));
+        }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayName",
-        args = {boolean.class, int.class}
-    )
     public void test_getDisplayNameZI() {
         TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
         assertEquals("PST",                   tz.getDisplayName(false, 0));
@@ -154,36 +105,23 @@
         assertEquals("Pacific Standard Time", tz.getDisplayName(false, 1));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayName",
-        args = {boolean.class, int.class, java.util.Locale.class}
-    )
     @AndroidOnly("fail on RI. See comment below")
     public void test_getDisplayNameZILjava_util_Locale() {
-        Locale[] requiredLocales = {Locale.US, Locale.UK, Locale.FRANCE};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
         TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
         assertEquals("PST",                   tz.getDisplayName(false, 0, Locale.US));
         assertEquals("Pacific Daylight Time", tz.getDisplayName(true,  1, Locale.US));
-        assertEquals("Pacific Standard Time", tz.getDisplayName(false, 1, Locale.UK));
-        //RI fails on following line. RI always returns short time zone name as "PST"
-        assertEquals("UTC-08:00",             tz.getDisplayName(false, 0, Locale.FRANCE));
-        // BEGIN android-note: RI has "Heure", CLDR/ICU has "heure".
-        assertEquals("heure avanc\u00e9e du Pacifique", tz.getDisplayName(true,  1, Locale.FRANCE));
-        assertEquals("heure normale du Pacifique", tz.getDisplayName(false, 1, Locale.FRANCE));
+        if (Support_Locale.isLocaleAvailable(Locale.UK)) {
+            assertEquals("Pacific Standard Time", tz.getDisplayName(false, 1, Locale.UK));
+        }
+        if (Support_Locale.isLocaleAvailable(Locale.FRANCE)) {
+            //RI fails on following line. RI always returns short time zone name as "PST"
+            assertEquals("UTC-08:00",             tz.getDisplayName(false, 0, Locale.FRANCE));
+            // BEGIN android-note: RI has "Heure", CLDR/ICU has "heure".
+            assertEquals("heure avanc\u00e9e du Pacifique", tz.getDisplayName(true,  1, Locale.FRANCE));
+            assertEquals("heure normale du Pacifique", tz.getDisplayName(false, 1, Locale.FRANCE));
+        }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getID",
-        args = {}
-    )
     public void test_getID() {
         TimeZone tz = TimeZone.getTimeZone("GMT-6");
         assertEquals("GMT-06:00", tz.getID());
@@ -191,12 +129,6 @@
         assertEquals("America/Denver", tz.getID());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hasSameRules",
-        args = {java.util.TimeZone.class}
-    )
     public void test_hasSameRulesLjava_util_TimeZone() {
         TimeZone tz1 = TimeZone.getTimeZone("America/Denver");
         TimeZone tz2 = TimeZone.getTimeZone("America/Phoenix");
@@ -212,12 +144,6 @@
         assertTrue(tz1.hasSameRules(tz1));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setID",
-        args = {java.lang.String.class}
-    )
     public void test_setIDLjava_lang_String() {
         TimeZone tz = TimeZone.getTimeZone("GMT-6");
         assertEquals("GMT-06:00", tz.getID());
diff --git a/luni/src/test/java/libcore/java/util/OldTreeMapTest.java b/luni/src/test/java/libcore/java/util/OldTreeMapTest.java
index ab27cf2..def5e68 100644
--- a/luni/src/test/java/libcore/java/util/OldTreeMapTest.java
+++ b/luni/src/test/java/libcore/java/util/OldTreeMapTest.java
@@ -17,9 +17,6 @@
 
 package libcore.java.util;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.io.Serializable;
 import java.text.CollationKey;
 import java.text.Collator;
@@ -33,7 +30,6 @@
 import java.util.TreeMap;
 import tests.support.Support_MapTest2;
 
-@TestTargetClass(TreeMap.class)
 public class OldTreeMapTest extends junit.framework.TestCase {
 
     public static class ReversedComparator implements Comparator {
@@ -84,15 +80,6 @@
 
     Object objArray[] = new Object[1000];
 
-    /**
-     * @tests java.util.TreeMap#TreeMap()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TreeMap",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.TreeMap()
         new Support_MapTest2(new TreeMap()).runTest();
@@ -100,15 +87,6 @@
         assertTrue("New treeMap non-empty", new TreeMap().isEmpty());
     }
 
-    /**
-     * @tests java.util.TreeMap#TreeMap(java.util.Comparator)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TreeMap",
-        args = {java.util.Comparator.class}
-    )
     public void test_ConstructorLjava_util_Comparator() {
         // Test for method java.util.TreeMap(java.util.Comparator)
         Comparator comp = new ReversedComparator();
@@ -124,15 +102,6 @@
 
     }
 
-    /**
-     * @tests java.util.TreeMap#TreeMap(java.util.Map)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TreeMap",
-        args = {java.util.Map.class}
-    )
     public void test_ConstructorLjava_util_Map() {
         // Test for method java.util.TreeMap(java.util.Map)
         TreeMap myTreeMap = new TreeMap(new HashMap(tm));
@@ -161,15 +130,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#TreeMap(java.util.SortedMap)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TreeMap",
-        args = {java.util.SortedMap.class}
-    )
     public void test_ConstructorLjava_util_SortedMap() {
         // Test for method java.util.TreeMap(java.util.SortedMap)
         Comparator comp = new ReversedComparator();
@@ -192,15 +152,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#containsKey(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKeyLjava_lang_Object() {
         // Test for method boolean
         // java.util.TreeMap.containsKey(java.lang.Object)
@@ -222,15 +173,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#firstKey()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "firstKey",
-        args = {}
-    )
     public void test_firstKey() {
         // Test for method java.lang.Object java.util.TreeMap.firstKey()
         assertEquals("Returned incorrect first key", "0", tm.firstKey());
@@ -243,15 +185,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#get(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_getLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.TreeMap.get(java.lang.Object)
@@ -274,15 +207,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#headMap(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "headMap",
-        args = {java.lang.Object.class}
-    )
     public void test_headMapLjava_lang_Object() {
         // Test for method java.util.SortedMap
         // java.util.TreeMap.headMap(java.lang.Object)
@@ -362,15 +286,6 @@
         assertEquals(0, treemap.headMap(null).size());
     }
 
-    /**
-     * @tests java.util.TreeMap#lastKey()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastKey",
-        args = {}
-    )
     public void test_lastKey() {
         // Test for method java.lang.Object java.util.TreeMap.lastKey()
         assertTrue("Returned incorrect last key", tm.lastKey().equals(
@@ -384,15 +299,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#put(java.lang.Object, java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.TreeMap.put(java.lang.Object, java.lang.Object)
@@ -435,15 +341,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#putAll(java.util.Map)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map() {
         // Test for method void java.util.TreeMap.putAll(java.util.Map)
         TreeMap x = new TreeMap();
@@ -472,15 +369,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#remove(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.TreeMap.remove(java.lang.Object)
@@ -502,15 +390,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#subMap(java.lang.Object, java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "subMap",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_subMapLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.util.SortedMap
         // java.util.TreeMap.subMap(java.lang.Object, java.lang.Object)
@@ -569,15 +448,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeMap#tailMap(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "tailMap",
-        args = {java.lang.Object.class}
-    )
     public void test_tailMapLjava_lang_Object() {
         // Test for method java.util.SortedMap
         // java.util.TreeMap.tailMap(java.lang.Object)
diff --git a/luni/src/test/java/libcore/java/util/OldTreeSetTest.java b/luni/src/test/java/libcore/java/util/OldTreeSetTest.java
index 2e0d833..86ed9f4 100644
--- a/luni/src/test/java/libcore/java/util/OldTreeSetTest.java
+++ b/luni/src/test/java/libcore/java/util/OldTreeSetTest.java
@@ -17,9 +17,6 @@
 
 package libcore.java.util;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.HashMap;
@@ -29,22 +26,12 @@
 import java.util.SortedSet;
 import java.util.TreeSet;
 
-@TestTargetClass(TreeSet.class)
 public class OldTreeSetTest extends junit.framework.TestCase {
 
     TreeSet ts;
 
     Object objArray[] = new Object[1000];
 
-    /**
-     * @tests java.util.TreeSet#TreeSet(java.util.Collection)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TreeSet",
-        args = {java.util.Collection.class}
-    )
     public void test_ConstructorLjava_util_Collection() {
         // Test for method java.util.TreeSet(java.util.Collection)
         TreeSet myTreeSet = new TreeSet(Arrays.asList(objArray));
@@ -73,15 +60,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#TreeSet(java.util.SortedSet)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TreeSet",
-        args = {java.util.SortedSet.class}
-    )
     public void test_ConstructorLjava_util_SortedSet() {
         try {
             new TreeSet((SortedSet)null);
@@ -91,15 +69,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#add(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLjava_lang_Object() {
         // Test for method boolean java.util.TreeSet.add(java.lang.Object)
         ts.add(new Integer(-8));
@@ -119,15 +88,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#addAll(java.util.Collection)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLjava_util_Collection() {
         // Test for method boolean
         // java.util.TreeSet.addAll(java.util.Collection)
@@ -157,15 +117,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#first()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "first",
-        args = {}
-    )
     public void test_first() {
         // Test for method java.lang.Object java.util.TreeSet.first()
         assertTrue("Returned incorrect first element",
@@ -180,15 +131,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#headSet(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "headSet",
-        args = {java.lang.Object.class}
-    )
     public void test_headSetLjava_lang_Object() {
         // Test for method java.util.SortedSet
         // java.util.TreeSet.headSet(java.lang.Object)
@@ -220,15 +162,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#last()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "last",
-        args = {}
-    )
     public void test_last() {
         // Test for method java.lang.Object java.util.TreeSet.last()
         assertTrue("Returned incorrect last element",
@@ -243,15 +176,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#subSet(java.lang.Object, java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "subSet",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_subSetLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.util.SortedSet
         // java.util.TreeSet.subSet(java.lang.Object, java.lang.Object)
@@ -293,15 +217,6 @@
         }
     }
 
-    /**
-     * @tests java.util.TreeSet#tailSet(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "tailSet",
-        args = {java.lang.Object.class}
-    )
     public void test_tailSetLjava_lang_Object() {
         // Test for method java.util.SortedSet
         // java.util.TreeSet.tailSet(java.lang.Object)
diff --git a/luni/src/test/java/libcore/java/util/TimeZoneTest.java b/luni/src/test/java/libcore/java/util/TimeZoneTest.java
index dbde4ac..dde2ec8 100644
--- a/luni/src/test/java/libcore/java/util/TimeZoneTest.java
+++ b/luni/src/test/java/libcore/java/util/TimeZoneTest.java
@@ -16,7 +16,9 @@
 
 package libcore.java.util;
 
+import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.Locale;
 import java.util.TimeZone;
 import java.util.SimpleTimeZone;
 
@@ -40,4 +42,100 @@
         stz.inDaylightTime(new Date());
         stz.clone();
     }
+
+    // http://b/3049014
+    public void testCustomTimeZoneDisplayNames() {
+        TimeZone tz0001 = new SimpleTimeZone(60000, "ONE MINUTE");
+        TimeZone tz0130 = new SimpleTimeZone(5400000, "ONE HOUR, THIRTY");
+        TimeZone tzMinus0130 = new SimpleTimeZone(-5400000, "NEG ONE HOUR, THIRTY");
+        assertEquals("GMT+00:01", tz0001.getDisplayName(false, TimeZone.SHORT, Locale.US));
+        assertEquals("GMT+01:30", tz0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
+        assertEquals("GMT-01:30", tzMinus0130.getDisplayName(false, TimeZone.SHORT, Locale.US));
+    }
+
+    // http://code.google.com/p/android/issues/detail?id=14395
+    public void testPreHistoricInDaylightTime() throws Exception {
+        TimeZone tz = TimeZone.getTimeZone("America/Los_Angeles");
+        TimeZone.setDefault(tz);
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
+        Date date = sdf.parse("1902-11-01T00:00:00.000+0800");
+        assertEquals(-2119680000000L, date.getTime());
+        assertEquals(-28800000, tz.getOffset(date.getTime()));
+        assertFalse(tz.inDaylightTime(date));
+        assertEquals("Fri Oct 31 08:00:00 PST 1902", date.toString());
+        assertEquals("31 Oct 1902 16:00:00 GMT", date.toGMTString());
+        // Any time before we have transition data is considered non-daylight, even in summer.
+        date = sdf.parse("1902-06-01T00:00:00.000+0800");
+        assertEquals(-28800000, tz.getOffset(date.getTime()));
+        assertFalse(tz.inDaylightTime(date));
+    }
+
+    public void testPreHistoricOffsets() throws Exception {
+        // The "Asia/Saigon" time zone has just a few transitions, and hasn't changed in a
+        // long time, which is convenient for testing:
+        //
+        // libcore.util.ZoneInfo[Asia/Saigon,mRawOffset=25200000,mUseDst=false]
+        // 0 : time=-2005974400 Fri Jun 08 16:53:20 1906 GMT+00:00 = Fri Jun 08 23:59:40 1906 ICT isDst=0 offset=  380 gmtOffset=25580
+        // 1 : time=-1855983920 Fri Mar 10 16:54:40 1911 GMT+00:00 = Fri Mar 10 23:54:40 1911 ICT isDst=0 offset=    0 gmtOffset=25200
+        // 2 : time=-1819954800 Tue Apr 30 17:00:00 1912 GMT+00:00 = Wed May 01 01:00:00 1912 ICT isDst=0 offset= 3600 gmtOffset=28800
+        // 3 : time=-1220428800 Thu Apr 30 16:00:00 1931 GMT+00:00 = Thu Apr 30 23:00:00 1931 ICT isDst=0 offset=    0 gmtOffset=25200
+        TimeZone tz = TimeZone.getTimeZone("Asia/Saigon");
+
+        // Times before our first transition should assume we're still following that transition.
+        // Note: the RI reports 25600 here because it has more transitions than we do.
+        assertNonDaylightOffset(25580, -2005975000L, tz);
+
+        assertNonDaylightOffset(25580, -2005974400L, tz); // 0
+        assertNonDaylightOffset(25580, -2005974000L, tz);
+
+        assertNonDaylightOffset(25200, -1855983920L, tz); // 1
+        assertNonDaylightOffset(25200, -1855983900L, tz);
+
+        assertNonDaylightOffset(28800, -1819954800L, tz); // 2
+        assertNonDaylightOffset(28800, -1819954000L, tz);
+
+        assertNonDaylightOffset(25200, -1220428800L, tz); // 3
+
+        // Times after out last transition should assume we're still following that transition.
+        assertNonDaylightOffset(25200, -1220428000L, tz);
+
+        // There are plenty more examples. "Africa/Bissau" is one:
+        //
+        // libcore.util.ZoneInfo[Africa/Bissau,mRawOffset=0,mUseDst=false]
+        // 0 : time=-1849388260 Fri May 26 01:02:20 1911 GMT+00:00 = Fri May 26 00:02:20 1911 GMT isDst=0 offset=-3600 gmtOffset=-3600
+        // 1 : time=  157770000 Wed Jan 01 01:00:00 1975 GMT+00:00 = Wed Jan 01 01:00:00 1975 GMT isDst=0 offset=    0 gmtOffset=0
+        tz = TimeZone.getTimeZone("Africa/Bissau");
+        assertNonDaylightOffset(-3600, -1849388300L, tz);
+        assertNonDaylightOffset(-3600, -1849388260L, tz); // 0
+        assertNonDaylightOffset(-3600, -1849388200L, tz);
+        assertNonDaylightOffset(0, 157770000L, tz); // 1
+        assertNonDaylightOffset(0, 157780000L, tz);
+    }
+
+    private static void assertNonDaylightOffset(int expectedOffsetSeconds, long epochSeconds, TimeZone tz) {
+        assertEquals(expectedOffsetSeconds * 1000, tz.getOffset(epochSeconds * 1000));
+        assertFalse(tz.inDaylightTime(new Date(epochSeconds * 1000)));
+    }
+
+    public void testZeroTransitionZones() throws Exception {
+        // Zones with no transitions historical or future seem ideal for testing.
+        String[] ids = new String[] { "Africa/Bujumbura", "Indian/Cocos", "Pacific/Wake", "UTC" };
+        for (String id : ids) {
+            TimeZone tz = TimeZone.getTimeZone(id);
+            assertFalse(tz.useDaylightTime());
+            assertFalse(tz.inDaylightTime(new Date(Integer.MIN_VALUE)));
+            assertFalse(tz.inDaylightTime(new Date(0)));
+            assertFalse(tz.inDaylightTime(new Date(Integer.MAX_VALUE)));
+            int currentOffset = tz.getOffset(new Date(0).getTime());
+            assertEquals(currentOffset, tz.getOffset(new Date(Integer.MIN_VALUE).getTime()));
+            assertEquals(currentOffset, tz.getOffset(new Date(Integer.MAX_VALUE).getTime()));
+        }
+    }
+
+    // http://code.google.com/p/android/issues/detail?id=11918
+    public void testHasSameRules() throws Exception {
+        TimeZone denver = TimeZone.getTimeZone ("America/Denver") ;
+        TimeZone phoenix = TimeZone.getTimeZone ("America/Phoenix") ;
+        assertFalse(denver.hasSameRules(phoenix));
+    }
 }
diff --git a/luni/src/test/java/libcore/java/util/concurrent/CopyOnWriteArrayListTest.java b/luni/src/test/java/libcore/java/util/concurrent/CopyOnWriteArrayListTest.java
index 8232881..b10be33 100644
--- a/luni/src/test/java/libcore/java/util/concurrent/CopyOnWriteArrayListTest.java
+++ b/luni/src/test/java/libcore/java/util/concurrent/CopyOnWriteArrayListTest.java
@@ -267,4 +267,16 @@
 
         new SerializableTester<CopyOnWriteArrayList<String>>(list, s).test();
     }
+
+    /**
+     * Test that we don't retain the array returned by toArray() on the copy
+     * constructor. That array may not be of the required type!
+     */
+    public void testDoesNotRetainToArray() {
+        String[] strings = { "a", "b", "c" };
+        List<String> asList = Arrays.asList(strings);
+        assertEquals(String[].class, asList.toArray().getClass());
+        CopyOnWriteArrayList<Object> objects = new CopyOnWriteArrayList<Object>(asList);
+        objects.add(Boolean.TRUE);
+    }
 }
diff --git a/luni/src/test/java/libcore/java/util/jar/OldAttributesNameTest.java b/luni/src/test/java/libcore/java/util/jar/OldAttributesNameTest.java
index 0d83715..e499414 100644
--- a/luni/src/test/java/libcore/java/util/jar/OldAttributesNameTest.java
+++ b/luni/src/test/java/libcore/java/util/jar/OldAttributesNameTest.java
@@ -23,7 +23,7 @@
 public class OldAttributesNameTest extends TestCase {
 
     /**
-     * @tests java.util.jar.Attributes.Name#Name(java.lang.String)
+     * java.util.jar.Attributes.Name#Name(java.lang.String)
      */
     public void test_AttributesName_Constructor() {
         try {
diff --git a/luni/src/test/java/libcore/java/util/jar/OldJarEntryTest.java b/luni/src/test/java/libcore/java/util/jar/OldJarEntryTest.java
index ed24d8b..21444a1 100644
--- a/luni/src/test/java/libcore/java/util/jar/OldJarEntryTest.java
+++ b/luni/src/test/java/libcore/java/util/jar/OldJarEntryTest.java
@@ -50,7 +50,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.jar.JarEntry#JarEntry(java.util.jar.JarEntry)
+     * java.util.jar.JarEntry#JarEntry(java.util.jar.JarEntry)
      */
     public void test_ConstructorLjava_util_jar_JarEntry_on_null() throws IOException {
         JarEntry newJarEntry = new JarEntry(jarFile.getJarEntry(entryName));
@@ -66,7 +66,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarEntry#JarEntry(java.util.zip.ZipEntry)
+     * java.util.jar.JarEntry#JarEntry(java.util.zip.ZipEntry)
      */
     public void test_ConstructorLjava_util_zip_ZipEntry() {
         assertNotNull("Jar file is null", jarFile);
@@ -81,7 +81,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarEntry#getAttributes()
+     * java.util.jar.JarEntry#getAttributes()
      */
     public void test_getAttributes() {
         JarFile attrJar = null;
diff --git a/luni/src/test/java/libcore/java/util/jar/OldJarExceptionTest.java b/luni/src/test/java/libcore/java/util/jar/OldJarExceptionTest.java
index 397931a..f9d6c5d 100644
--- a/luni/src/test/java/libcore/java/util/jar/OldJarExceptionTest.java
+++ b/luni/src/test/java/libcore/java/util/jar/OldJarExceptionTest.java
@@ -22,7 +22,7 @@
 
 public class OldJarExceptionTest extends TestCase {
     /**
-     * @tests java.util.jar.JarException#JarException(java.lang.String)
+     * java.util.jar.JarException#JarException(java.lang.String)
      */
     public void test_Constructor() throws Exception {
         JarException ex = new JarException();
diff --git a/luni/src/test/java/libcore/java/util/jar/OldJarFileTest.java b/luni/src/test/java/libcore/java/util/jar/OldJarFileTest.java
index 0da4d0e..8345301 100644
--- a/luni/src/test/java/libcore/java/util/jar/OldJarFileTest.java
+++ b/luni/src/test/java/libcore/java/util/jar/OldJarFileTest.java
@@ -50,7 +50,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.io.File)
+     * java.util.jar.JarFile#JarFile(java.io.File)
      */
     public void test_ConstructorLjava_io_File() throws IOException {
         try {
@@ -77,7 +77,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.lang.String)
+     * java.util.jar.JarFile#JarFile(java.lang.String)
      */
     public void test_ConstructorLjava_lang_String() throws IOException {
         try {
@@ -105,7 +105,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.lang.String, boolean)
+     * java.util.jar.JarFile#JarFile(java.lang.String, boolean)
      */
     public void test_ConstructorLjava_lang_StringZ() throws IOException {
         try {
@@ -133,7 +133,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.io.File, boolean)
+     * java.util.jar.JarFile#JarFile(java.io.File, boolean)
      */
     public void test_ConstructorLjava_io_FileZ() throws IOException {
         try {
@@ -160,7 +160,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.io.File, boolean, int)
+     * java.util.jar.JarFile#JarFile(java.io.File, boolean, int)
      */
     public void test_ConstructorLjava_io_FileZI() {
         try {
@@ -220,7 +220,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry)
+     * java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry)
      */
     public void test_getInputStreamLjava_util_jar_JarEntry() throws IOException {
         File localFile = null;
diff --git a/luni/src/test/java/libcore/java/util/logging/OldLoggerTest.java b/luni/src/test/java/libcore/java/util/logging/OldLoggerTest.java
index 93c14e7..ad8ed21 100644
--- a/luni/src/test/java/libcore/java/util/logging/OldLoggerTest.java
+++ b/luni/src/test/java/libcore/java/util/logging/OldLoggerTest.java
@@ -68,8 +68,8 @@
         assertNull(Logger.global.getResourceBundleName());
         assertTrue(Logger.global.getUseParentHandlers());
         assertSame(Logger.global, Logger.getLogger("global"));
-        assertSame(Logger.global, LogManager.getLogManager()
-                .getLogger("global"));
+        assertSame(Logger.global, LogManager.getLogManager().getLogger("global"));
+        assertSame(Logger.global, Logger.getGlobal());
     }
 
     public void testConstructor_Normal() {
diff --git a/luni/src/test/java/libcore/java/util/prefs/OldNodeChangeEventTest.java b/luni/src/test/java/libcore/java/util/prefs/OldNodeChangeEventTest.java
index b3f57b8..f2d483e 100644
--- a/luni/src/test/java/libcore/java/util/prefs/OldNodeChangeEventTest.java
+++ b/luni/src/test/java/libcore/java/util/prefs/OldNodeChangeEventTest.java
@@ -130,7 +130,7 @@
         public synchronized void waitForEvent() {
             try {
                 wait(500);
-            } catch (InterruptedException ignored) {
+            } catch (InterruptedException expected) {
             }
         }
 
diff --git a/luni/src/test/java/libcore/java/util/prefs/OldPreferenceChangeEventTest.java b/luni/src/test/java/libcore/java/util/prefs/OldPreferenceChangeEventTest.java
index be559ed..acdbd69 100644
--- a/luni/src/test/java/libcore/java/util/prefs/OldPreferenceChangeEventTest.java
+++ b/luni/src/test/java/libcore/java/util/prefs/OldPreferenceChangeEventTest.java
@@ -112,7 +112,7 @@
         public synchronized void waitForEvent() {
             try {
                 wait(500);
-            } catch (InterruptedException ignored) {
+            } catch (InterruptedException expected) {
             }
         }
 
diff --git a/luni/src/test/java/libcore/java/util/prefs/OldPreferencesTest.java b/luni/src/test/java/libcore/java/util/prefs/OldPreferencesTest.java
index a12618e..17e3652 100644
--- a/luni/src/test/java/libcore/java/util/prefs/OldPreferencesTest.java
+++ b/luni/src/test/java/libcore/java/util/prefs/OldPreferencesTest.java
@@ -937,7 +937,7 @@
         public synchronized void waitForEvent() {
             try {
                 wait(500);
-            } catch (InterruptedException ignored) {
+            } catch (InterruptedException expected) {
             }
         }
 
@@ -976,7 +976,7 @@
                     synchronized (this) {
                         this.wait(500);
                     }
-                } catch (InterruptedException ignored) {
+                } catch (InterruptedException expected) {
                 }
             }
         }
diff --git a/luni/src/test/java/libcore/java/util/prefs/PreferencesTest.java b/luni/src/test/java/libcore/java/util/prefs/PreferencesTest.java
new file mode 100644
index 0000000..1560fbe
--- /dev/null
+++ b/luni/src/test/java/libcore/java/util/prefs/PreferencesTest.java
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.java.util.prefs;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileWriter;
+import java.util.prefs.Preferences;
+import junit.framework.TestCase;
+
+public final class PreferencesTest extends TestCase {
+
+    /**
+     * The preferences API is designed to be hostile towards files that exist
+     * where it wants to store its XML data. http://b/3431233
+     */
+    public void testPreferencesClobbersExistingFiles() throws Exception {
+        File userPrefs = new File(System.getProperty("user.home") + "/.java/.userPrefs/prefs.xml");
+        FileWriter writer = new FileWriter(userPrefs);
+        writer.write("lamb");
+        writer.close();
+        userPrefs.setReadable(false);
+        userPrefs.setWritable(false);
+        long oldLength = userPrefs.length();
+
+        Preferences userPreferences = Preferences.userRoot();
+        userPreferences.sync();
+        userPreferences.put("a", "lion");
+        userPreferences.flush();
+        assertTrue("Expected to exist " + userPrefs, userPrefs.exists());
+        assertTrue("Expected file to be clobbered", oldLength != userPrefs.length());
+    }
+
+    public void testHtmlEncoding() throws Exception {
+        Preferences parent = Preferences.userNodeForPackage(this.getClass());
+        Preferences p = parent.node("testHtmlEncoding");
+        p.put("key", "a<>&'\"\\b");
+        p.flush();
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        p.exportNode(baos);
+
+        String s = new String(baos.toByteArray(), "UTF-8");
+        assertTrue(s, s.contains("value=\"a&lt;&gt;&amp;'&quot;\\b\""));
+    }
+}
diff --git a/luni/src/test/java/libcore/java/util/regex/OldMatcherTest.java b/luni/src/test/java/libcore/java/util/regex/OldMatcherTest.java
index 549a9ca..450b8d9 100644
--- a/luni/src/test/java/libcore/java/util/regex/OldMatcherTest.java
+++ b/luni/src/test/java/libcore/java/util/regex/OldMatcherTest.java
@@ -17,35 +17,14 @@
 
 package libcore.java.util.regex;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import junit.framework.TestCase;
 
-@TestTargetClass(
-        value = Matcher.class,
-        untestedMethods= {
-            @TestTargetNew(
-                level = TestLevel.NOT_FEASIBLE,
-                notes = "finalize is hard to test since the implementation only calls a native function",
-                method = "finalize",
-                args = {}
-            )
-        }
-
-)
 public class OldMatcherTest extends TestCase {
     String[] groupPatterns = { "(a|b)*aabb", "((a)|b)*aabb", "((a|b)*)a(abb)",
             "(((a)|(b))*)aabb", "(((a)|(b))*)aa(b)b", "(((a)|(b))*)a(a(b)b)" };
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "appendReplacement",
-        args = {java.lang.StringBuffer.class, java.lang.String.class}
-    )
     public void testAppendReplacement() {
         Pattern pat = Pattern.compile("XX");
         Matcher m = pat.matcher("Today is XX-XX-XX ...");
@@ -78,16 +57,6 @@
         assertNotNull(t);
     }
 
-    /**
-     * @test java.util.regex.Matcher#reset(String)
-     * test reset(String) method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the reset(CharSequence input) method.",
-        method = "reset",
-        args = {java.lang.CharSequence.class}
-    )
     public void test_resetLjava_lang_String() {
         String testPattern = "(abb)";
         String testString1 = "babbabbcccabbabbabbabbabb";
@@ -102,12 +71,6 @@
         assertTrue("After reset matcher should find pattern in given input", mat.find());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "appendTail",
-        args = {java.lang.StringBuffer.class}
-    )
     public void testAppendTail() {
         Pattern p = Pattern.compile("cat");
         Matcher m = p.matcher("one-cat-two-cats-in-the-yard");
@@ -143,16 +106,6 @@
         assertNotNull(t);
     }
 
-    /**
-     * @test java.util.regex.Matcher#reset()
-     * test reset() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the reset() method. ",
-        method = "reset",
-        args = {}
-    )
     public void test_reset() {
         String testPattern = "(abb)";
         String testString = "babbabbcccabbabbabbabbabb";
@@ -164,16 +117,6 @@
         assertTrue("After reset matcher should find pattern in given input", mat.find());
     }
 
-    /**
-     * @test java.util.regex.Matcher#hasAnchoringBounds()
-     * test hasAnchoringBounds() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies that hasAnchoringBounds method returns correct value.",
-        method = "hasAnchoringBounds",
-        args = {}
-    )
     public void test_hasAnchoringBounds() {
         String testPattern = "abb";
         String testString = "abb";
@@ -192,16 +135,6 @@
                 mu.hasAnchoringBounds());
     }
 
-    /**
-     * @test java.util.regex.Matcher#hasTransparentBounds()
-     * test hasTransparentBounds() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies that hasTransparentBound method returns correct value.",
-        method = "hasTransparentBounds",
-        args = {}
-    )
     public void test_hasTransparentBounds() {
         String testPattern = "abb";
         String testString = "ab\nb";
@@ -220,16 +153,6 @@
                 mu.hasTransparentBounds());
     }
 
-    /**
-     * @test java.util.regex.Matcher#start(int)
-     * test start(int) method.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the start(int group) method.",
-        method = "start",
-        args = {int.class}
-    )
     public void test_startI() {
         String testPattern = "(((abb)a)(bb))";
         String testString = "cccabbabbabbabbabb";
@@ -252,16 +175,6 @@
         }
     }
 
-    /**
-     * @test java.util.regex.Matcher#end(int)
-     * test end(int) method.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the basic functionality of end(int group) method.",
-        method = "end",
-        args = {int.class}
-    )
     public void test_endI() {
         String testPattern = "(((abb)a)(bb))";
         String testString = "cccabbabbabbabbabb";
@@ -285,16 +198,6 @@
     }
 
 
-    /**
-     * @test java.util.regex.Matcher#lookingAt()
-     * test lookingAt() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies that lookingAt() method returns correct value.",
-        method = "lookingAt",
-        args = {}
-    )
     public void test_lookingAt() {
         String testPattern = "(((abb)a)(bb))";
         String testString1 = "babbabbcccabbabbabbabbabb";
@@ -309,16 +212,6 @@
         assertTrue("Should find given pattern in 2 string", mat2.lookingAt());
     }
 
-    /**
-     * @test java.util.regex.Matcher#find(int)
-     * test find (int) method. Created via modifying method for find
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "find",
-        args = {int.class}
-    )
     public void test_findI() {
         String testPattern = "(abb)";
         String testString = "cccabbabbabbabbabb";
@@ -368,12 +261,7 @@
         assertFalse(mat3.find(6));
         assertFalse(mat3.find(7));
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies matches() method for predefined.",
-        method = "replaceFirst",
-        args = {java.lang.String.class}
-    )
+
     public void testSEOLsymbols() {
         Pattern pat = Pattern.compile("^a\\(bb\\[$");
         Matcher mat = pat.matcher("a(bb[");
@@ -381,16 +269,6 @@
         assertTrue(mat.matches());
     }
 
-    /**
-     * @test java.util.regex.Matcher#start()
-     * test start() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the start() method.",
-        method = "start",
-        args = {}
-    )
     public void test_start() {
         String testPattern = "(abb)";
         String testString = "cccabbabbabbabbabb";
@@ -410,16 +288,6 @@
         }
     }
 
-    /**
-     * @test java.util.regex.Matcher#end()
-     * test end() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the basic functionality of end() method. ",
-        method = "end",
-        args = {}
-    )
     public void test_end() {
         String testPattern = "(abb)";
         String testString = "cccabbabbabbabbabb";
@@ -438,12 +306,7 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies groupCount() method.",
-        method = "groupCount",
-        args = {}
-    )
+
     public void testGroupCount() {
         for (int i = 0; i < groupPatterns.length; i++) {
             Pattern test = Pattern.compile(groupPatterns[i]);
@@ -454,12 +317,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "region",
-        args = {int.class, int.class}
-    )
     public void testRegion() {
         Pattern p = Pattern.compile("abba");
         Matcher m = p.matcher("Gabba gabba hey");
@@ -495,12 +352,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies matches method for input sequence specified by URL.",
-        method = "matches",
-        args = {}
-    )
     public void testMatchesURI() {
         Pattern pat = Pattern.
                 compile("^(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
@@ -511,22 +362,10 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "quoteReplacement",
-        args = {java.lang.String.class}
-    )
     public void testQuoteReplacement() {
         assertEquals("\\$dollar and slash\\\\", Matcher.quoteReplacement("$dollar and slash\\"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "matches",
-        args = {}
-    )
     public void testUnicode() {
 
         assertTrue(Pattern.compile("\\x61a").matcher("aa").matches());
@@ -535,12 +374,7 @@
         assertTrue(Pattern.compile("\\0777").matcher("?7").matches());
 
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "matches",
-        args = {}
-    )
+
     public void testUnicodeCategory() {
         assertTrue(Pattern.compile("\\p{Ll}").matcher("k").matches()); // Unicode lower case
         assertTrue(Pattern.compile("\\P{Ll}").matcher("K").matches()); // Unicode non-lower
@@ -572,13 +406,6 @@
     // BEGIN android-note
     // Test took ages, now going in steps of 16 code points to speed things up.
     // END android-note
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "The stress test for matches(String regex) method from String class.",
-        clazz = String.class,
-        method = "matches",
-        args = {java.lang.String.class}
-    )
     public void testAllCodePoints() {
         // Regression for HARMONY-3145
         int[] codePoint = new int[1];
@@ -614,16 +441,6 @@
         assertEquals(0x110000 / 0x10, cnt);
     }
 
-    /**
-     * @test java.util.regex.Matcher#regionStart()
-     * test regionStart() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the regionStart() method.",
-        method = "regionStart",
-        args = {}
-    )
     public void test_regionStart() {
         String testPattern = "(abb)";
         String testString = "cccabbabbabbabbabb";
@@ -637,16 +454,6 @@
         assertEquals("Region sould start from 0 position after reset", 0, mat.regionStart());
     }
 
-    /**
-     * @test java.util.regex.Matcher#regionEnd()
-     * test regionEnd() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the regionEnd() method.",
-        method = "regionEnd",
-        args = {}
-    )
     public void test_regionEnd() {
         String testPattern = "(abb)";
         String testString = "cccabbabbabbabbabb";
@@ -660,16 +467,6 @@
         assertEquals("Region end value should be equal to string length after reset", testString.length(), mat.regionEnd());
     }
 
-    /**
-     * @test java.util.regex.Matcher#toMatchResult()
-     * test toMatchResult() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the toMatchResult method.",
-        method = "toMatchResult",
-        args = {}
-    )
     public void test_toMatchResult() {
         String testPattern = "(((abb)a)(bb))";
         String testString = "babbabbcccabbabbabbabbabb";
@@ -687,16 +484,6 @@
         assertEquals("Total number of groups does not matched with given pattern", 4, mat.toMatchResult().groupCount());
    }
 
-    /**
-     * @test java.util.regex.Matcher#usePattern(Pattern newPattern)
-     * test usePattern(Pattern newPattern) method.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the usePattern(Pattern newPattern) method.",
-        method = "usePattern",
-        args = {java.util.regex.Pattern.class}
-    )
     public void test_usePatternLjava_util_regex_Pattern() {
         String testPattern1 = "(((abb)a)(bb))";
         String testPattern2 = "(abbabb)";
@@ -713,16 +500,6 @@
         assertFalse("matcher should not find pattern in given region", mat.matches());
    }
 
-    /**
-     * @test java.util.regex.Matcher#useAchoringBounds()
-     * test useAchoringBounds() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "useAnchoringBounds",
-        args = {boolean.class}
-    )
     public void test_anchoringBounds() {
         String testPattern = "^ro$";
         String testString = "android";
@@ -738,16 +515,6 @@
         assertFalse("Should find pattern with anchoring bounds", mat.find(0));
     }
 
-    /**
-     * @test java.util.regex.Matcher#useTransparentBounds()
-     * test useTransparentBounds() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the useTransparentBounds(boolean b) method.",
-        method = "useTransparentBounds",
-        args = {boolean.class}
-    )
     public void test_transparentBounds() {
         String testPattern = "and(?=roid)";
         String testString = "android";
@@ -774,16 +541,6 @@
         assertFalse("Shouldn't find pattern transparent bounds", mat.matches()); // ***
     }
 
-    /**
-     * @test java.util.regex.Matcher#hitEnd()
-     * test hitEnd() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies that hitEnd() method returns correct value. ",
-        method = "hitEnd",
-        args = {}
-    )
     public void test_hitEnd() {
         String testPattern = "abb";
         String testString = "babbabbcccabbabbabbabbabb";
@@ -796,16 +553,6 @@
         assertTrue("hitEnd should return true after finding last match", mat.hitEnd()); // ***
     }
 
-    /**
-     * @test java.util.regex.Matcher#requireEnd()
-     * test requireEnd() method.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the requireEnd() method.",
-        method = "requireEnd",
-        args = {}
-    )
     public void test_requireEnd() {
         String testPattern = "bba";
         String testString = "abbbbba";
@@ -827,12 +574,6 @@
     /*
      * Regression test for HARMONY-674
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Special regression test for matches() method.",
-        method = "matches",
-        args = {}
-    )
     public void testPatternMatcher() throws Exception {
         Pattern pattern = Pattern.compile("(?:\\d+)(?:pt)");
         assertTrue(pattern.matcher("14pt").matches());
diff --git a/luni/src/test/java/libcore/java/util/zip/DeflaterOutputStreamTest.java b/luni/src/test/java/libcore/java/util/zip/DeflaterOutputStreamTest.java
index ff1a408..37d1248 100644
--- a/luni/src/test/java/libcore/java/util/zip/DeflaterOutputStreamTest.java
+++ b/luni/src/test/java/libcore/java/util/zip/DeflaterOutputStreamTest.java
@@ -24,6 +24,7 @@
 import java.io.PipedInputStream;
 import java.io.PipedOutputStream;
 import java.lang.reflect.Field;
+import java.util.Arrays;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
@@ -88,7 +89,7 @@
      * Confirm that a DeflaterOutputStream constructed with Deflater
      * with flushParm == SYNC_FLUSH does not need to to be flushed.
      *
-     * http://4005091
+     * http://b/4005091
      */
     public void testSyncFlushDeflater() throws Exception {
         Deflater def = new Deflater();
@@ -107,13 +108,18 @@
         for (int i = 0; i < output.length; i++) {
             output[i] = (byte) i;
         }
-
         dos.write(output);
         byte[] compressed = baos.toByteArray();
+        // this main reason for this assert is to make sure that the
+        // compressed byte count is larger than the
+        // deflaterBufferSize. However, when the original bug exists,
+        // it will also fail because the compressed length will be
+        // exactly the length of the deflaterBufferSize.
         assertTrue("compressed=" + compressed.length
                    + " but deflaterBufferSize=" + deflaterBufferSize,
                    compressed.length > deflaterBufferSize);
 
+        // assert that we returned data matches the input exactly.
         ByteArrayInputStream bais = new ByteArrayInputStream(compressed);
         InflaterInputStream iis = new InflaterInputStream(bais);
         byte[] input = new byte[output.length];
@@ -134,5 +140,11 @@
             }
         }
         assertEquals(output.length, total);
+        assertTrue(Arrays.equals(input, output));
+
+        // ensure Deflater.finish has not been called at any point
+        // during the test, since that would lead to the results being
+        // flushed even without SYNC_FLUSH being used
+        assertFalse(def.finished());
     }
 }
diff --git a/luni/src/test/java/libcore/java/util/zip/OldZipFileTest.java b/luni/src/test/java/libcore/java/util/zip/OldZipFileTest.java
index cd28114..9f2864b 100644
--- a/luni/src/test/java/libcore/java/util/zip/OldZipFileTest.java
+++ b/luni/src/test/java/libcore/java/util/zip/OldZipFileTest.java
@@ -82,7 +82,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.zip.ZipFile#close()
+     * java.util.zip.ZipFile#close()
      */
     public void test_close() throws IOException {
         // Test for method void java.util.zip.ZipFile.close()
@@ -125,7 +125,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.zip.ZipFile#getInputStream(java.util.zip.ZipEntry)
+     * java.util.zip.ZipFile#getInputStream(java.util.zip.ZipEntry)
      */
     public void test_getInputStreamLjava_util_zip_ZipEntry() throws IOException {
         // Test for method java.io.InputStream
diff --git a/luni/src/test/java/libcore/javax/crypto/CipherTest.java b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
index 186355f..7919b35 100644
--- a/luni/src/test/java/libcore/javax/crypto/CipherTest.java
+++ b/luni/src/test/java/libcore/javax/crypto/CipherTest.java
@@ -49,9 +49,9 @@
         assertCipherInitWithKeyUsage(KeyUsage.keyAgreement | KeyUsage.decipherOnly,
                                                                 false, true, false, true);
 
-        // except when wraping a key is specifically allowed or
+        // except when wrapping a key is specifically allowed or
         assertCipherInitWithKeyUsage(KeyUsage.keyEncipherment,  false, true, true,  true);
-        // except when wraping data encryption is specifically allowed
+        // except when wrapping data encryption is specifically allowed
         assertCipherInitWithKeyUsage(KeyUsage.dataEncipherment, true,  true, false, true);
     }
 
@@ -100,16 +100,12 @@
         }
     }
 
-    private Certificate certificateWithKeyUsage(int keyUsage) {
+    private Certificate certificateWithKeyUsage(int keyUsage) throws Exception {
         // note the rare usage of non-zero keyUsage
-        return TestKeyStore.create(new String[] { "RSA" },
-                                   null,
-                                   null,
-                                   "rsa-dsa-ec",
-                                   TestKeyStore.localhost(),
-                                   keyUsage,
-                                   true,
-                                   null,
-                                   null).getPrivateKey("RSA", "RSA").getCertificate();
+        return new TestKeyStore.Builder()
+                .aliasPrefix("rsa-dsa-ec")
+                .keyUsage(keyUsage)
+                .build()
+                .getPrivateKey("RSA", "RSA").getCertificate();
     }
 }
diff --git a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java
index 241673a..578ee6b 100644
--- a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java
+++ b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParameterGeneratorTestDH.java
@@ -16,9 +16,6 @@
 package libcore.javax.crypto.spec;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import tests.security.AlgorithmParameterGeneratorTest;
 import tests.security.AlgorithmParameterKeyAgreementHelper;
 
@@ -29,23 +26,6 @@
         super("DH", new AlgorithmParameterKeyAgreementHelper("DH"));
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="init",
-                args={int.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     @BrokenTest("Suffers from DH slowness, disabling for now")
     public void testAlgorithmParameterGenerator() {
         super.testAlgorithmParameterGenerator();
diff --git a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java
index 9cf2fcd..165daa1 100644
--- a/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java
+++ b/luni/src/test/java/libcore/javax/crypto/spec/AlgorithmParametersTestDH.java
@@ -16,9 +16,6 @@
 package libcore.javax.crypto.spec;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.math.BigInteger;
 import javax.crypto.spec.DHParameterSpec;
 import tests.security.AlgorithmParameterKeyAgreementHelper;
@@ -64,23 +61,6 @@
 
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="init",
-                args={byte[].class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     @BrokenTest("Suffers from DH slowness, disabling for now")
     public void testAlgorithmParameters() {
         super.testAlgorithmParameters();
diff --git a/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java b/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java
index 6e73ba1..c4322ff 100644
--- a/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java
+++ b/luni/src/test/java/libcore/javax/crypto/spec/KeyPairGeneratorTestDH.java
@@ -16,9 +16,6 @@
 package libcore.javax.crypto.spec;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.security.NoSuchAlgorithmException;
 import tests.security.KeyAgreementHelper;
 import tests.security.KeyPairGeneratorTest;
@@ -29,23 +26,6 @@
         super("DH", new KeyAgreementHelper("DH"));
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.ADDITIONAL,
-            method = "initialize",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.ADDITIONAL,
-            method = "generateKeyPair",
-            args = {}
-        ),
-        @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="method",
-            args={}
-        )
-    })
     @BrokenTest("Takes ages due to DH computations. Disabling for now.")
     public void testKeyPairGenerator() throws NoSuchAlgorithmException {
         super.testKeyPairGenerator();
diff --git a/luni/src/test/java/libcore/javax/net/ssl/KeyManagerFactoryTest.java b/luni/src/test/java/libcore/javax/net/ssl/KeyManagerFactoryTest.java
index 2ff9567..a6bdc07 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/KeyManagerFactoryTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/KeyManagerFactoryTest.java
@@ -23,9 +23,9 @@
 import java.security.PrivateKey;
 import java.security.Provider;
 import java.security.Security;
+import java.security.cert.Certificate;
 import java.security.cert.X509Certificate;
 import java.util.Arrays;
-import java.util.HashSet;
 import java.util.Set;
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.KeyManagerFactory;
@@ -40,16 +40,18 @@
 public class KeyManagerFactoryTest extends TestCase {
 
     // note the rare usage of DSA keys here in addition to RSA
-    private static final TestKeyStore TEST_KEY_STORE
-            = TestKeyStore.create(new String[] { "RSA", "DSA", "EC", "EC_RSA" },
-                                  null,
-                                  null,
-                                  "rsa-dsa-ec",
-                                  TestKeyStore.localhost(),
-                                  0,
-                                  true,
-                                  null,
-                                  null);
+    private static final TestKeyStore TEST_KEY_STORE;
+
+    static {
+        try {
+            TEST_KEY_STORE = new TestKeyStore.Builder()
+                    .keyAlgorithms("RSA", "DSA", "EC", "EC_RSA")
+                    .aliasPrefix("rsa-dsa-ec")
+                    .build();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
 
     public void test_KeyManagerFactory_getDefaultAlgorithm() throws Exception {
         String algorithm = KeyManagerFactory.getDefaultAlgorithm();
@@ -58,7 +60,7 @@
         test_KeyManagerFactory(kmf);
     }
 
-    private static class UseslessManagerFactoryParameters implements ManagerFactoryParameters {}
+    private static class UselessManagerFactoryParameters implements ManagerFactoryParameters {}
 
     private static boolean supportsManagerFactoryParameters(String algorithm) {
         // Only the "New" one supports ManagerFactoryParameters
@@ -94,7 +96,7 @@
 
         // init with useless ManagerFactoryParameters
         try {
-            kmf.init(new UseslessManagerFactoryParameters());
+            kmf.init(new UselessManagerFactoryParameters());
             fail();
         } catch (InvalidAlgorithmParameterException expected) {
         }
@@ -123,7 +125,8 @@
         test_KeyManagerFactory_getKeyManagers(kmf, false);
     }
 
-    private void test_KeyManagerFactory_getKeyManagers(KeyManagerFactory kmf, boolean empty) {
+    private void test_KeyManagerFactory_getKeyManagers(KeyManagerFactory kmf, boolean empty)
+            throws Exception {
         KeyManager[] keyManagers = kmf.getKeyManagers();
         assertNotNull(keyManagers);
         assertTrue(keyManagers.length > 0);
@@ -153,7 +156,8 @@
         // extra null at end requires no initialization
     }
 
-    private void test_X509KeyManager(X509KeyManager km, boolean empty, String algorithm) {
+    private void test_X509KeyManager(X509KeyManager km, boolean empty, String algorithm)
+            throws Exception {
         String[] keyTypes = keyTypes(algorithm);
         for (String keyType : keyTypes) {
             String[] aliases = km.getClientAliases(keyType, null);
@@ -196,7 +200,7 @@
     }
 
     private void test_X509ExtendedKeyManager(X509ExtendedKeyManager km,
-                                             boolean empty, String algorithm) {
+                                             boolean empty, String algorithm) throws Exception {
         String[] keyTypes = keyTypes(algorithm);
         String a = km.chooseEngineClientAlias(keyTypes, null, null);
         test_X509KeyManager_alias(km, a, null, true, empty);
@@ -215,7 +219,7 @@
                                            String alias,
                                            String keyType,
                                            boolean many,
-                                           boolean empty) {
+                                           boolean empty) throws Exception {
         if (empty || (!many && (keyType == null || keyType.isEmpty()))) {
             assertNull(keyType, alias);
             assertNull(keyType, km.getCertificateChain(alias));
@@ -251,8 +255,8 @@
         PrivateKeyEntry privateKeyEntry = TEST_KEY_STORE.getPrivateKey(keyAlgName, sigAlgName);
         if (!"EC".equals(keyAlgName)) {
             assertEquals(keyType,
-                         Arrays.asList(privateKeyEntry.getCertificateChain()),
-                         Arrays.asList(certificateChain));
+                         Arrays.<Certificate>asList(privateKeyEntry.getCertificateChain()),
+                         Arrays.<Certificate>asList(certificateChain));
             assertEquals(keyType,
                          privateKeyEntry.getPrivateKey(), privateKey);
         }
diff --git a/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java b/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java
index d7e7c67..16a3359 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/SSLEngineTest.java
@@ -16,8 +16,6 @@
 
 package libcore.javax.net.ssl;
 
-import libcore.java.security.StandardNames;
-import libcore.java.security.TestKeyStore;
 import java.util.Arrays;
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLEngine;
@@ -27,6 +25,8 @@
 import javax.net.ssl.SSLParameters;
 import javax.net.ssl.SSLSession;
 import junit.framework.TestCase;
+import libcore.java.security.StandardNames;
+import libcore.java.security.TestKeyStore;
 
 public class SSLEngineTest extends TestCase {
 
@@ -69,16 +69,11 @@
 
     public void test_SSLEngine_getSupportedCipherSuites_connect() throws Exception {
         // note the rare usage of non-RSA keys
-        TestKeyStore testKeyStore
-                = TestKeyStore.create(new String[] { "RSA", "DSA", "EC", "EC_RSA" },
-                                      null,
-                                      null,
-                                      "rsa-dsa-ec",
-                                      TestKeyStore.localhost(),
-                                      0,
-                                      true,
-                                      null,
-                                      null);
+        TestKeyStore testKeyStore = new TestKeyStore.Builder()
+                .keyAlgorithms("RSA", "DSA", "EC", "EC_RSA")
+                .aliasPrefix("rsa-dsa-ec")
+                .ca(true)
+                .build();
         test_SSLEngine_getSupportedCipherSuites_connect(testKeyStore, false);
         if (StandardNames.IS_RI) {
             test_SSLEngine_getSupportedCipherSuites_connect(testKeyStore, true);
diff --git a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
index 35346a2..7ca5a63 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/SSLSocketTest.java
@@ -55,16 +55,11 @@
 
     public void test_SSLSocket_getSupportedCipherSuites_connect() throws Exception {
         // note the rare usage of non-RSA keys
-        TestKeyStore testKeyStore
-                = TestKeyStore.create(new String[] { "RSA", "DSA", "EC", "EC_RSA" },
-                                      null,
-                                      null,
-                                      "rsa-dsa-ec",
-                                      TestKeyStore.localhost(),
-                                      0,
-                                      true,
-                                      null,
-                                      null);
+        TestKeyStore testKeyStore = new TestKeyStore.Builder()
+                .keyAlgorithms("RSA", "DSA", "EC", "EC_RSA")
+                .aliasPrefix("rsa-dsa-ec")
+                .ca(true)
+                .build();
         if (StandardNames.IS_RI) {
             test_SSLSocket_getSupportedCipherSuites_connect(testKeyStore,
                                                             StandardNames.JSSE_PROVIDER_NAME,
@@ -382,9 +377,12 @@
                     if (false) {
                         System.out.println("Session=" + session);
                         System.out.println("CipherSuite=" + cipherSuite);
-                        System.out.println("LocalCertificates=" + localCertificates);
-                        System.out.println("PeerCertificates=" + peerCertificates);
-                        System.out.println("PeerCertificateChain=" + peerCertificateChain);
+                        System.out.println("LocalCertificates="
+                                + Arrays.toString(localCertificates));
+                        System.out.println("PeerCertificates="
+                                + Arrays.toString(peerCertificates));
+                        System.out.println("PeerCertificateChain="
+                                + Arrays.toString(peerCertificateChain));
                         System.out.println("PeerPrincipal=" + peerPrincipal);
                         System.out.println("LocalPrincipal=" + localPrincipal);
                         System.out.println("Socket=" + socket);
@@ -1058,7 +1056,7 @@
 
     /**
      * Not run by default by JUnit, but can be run by Vogar by
-     * specifying it explictly (or with main method below)
+     * specifying it explicitly (or with main method below)
      */
     public void stress_test_TestSSLSocketPair_create() {
         final boolean verbose = true;
@@ -1081,7 +1079,7 @@
         }
     }
 
-    public static final void main (String[] args) {
+    public static void main (String[] args) {
         new SSLSocketTest().stress_test_TestSSLSocketPair_create();
     }
 }
diff --git a/luni/src/test/java/libcore/javax/net/ssl/TrustManagerFactoryTest.java b/luni/src/test/java/libcore/javax/net/ssl/TrustManagerFactoryTest.java
index e92bf67..b82b4d2 100644
--- a/luni/src/test/java/libcore/javax/net/ssl/TrustManagerFactoryTest.java
+++ b/luni/src/test/java/libcore/javax/net/ssl/TrustManagerFactoryTest.java
@@ -17,11 +17,10 @@
 package libcore.javax.net.ssl;
 
 import java.security.InvalidAlgorithmParameterException;
-import java.security.KeyStore.PrivateKeyEntry;
 import java.security.KeyStore;
+import java.security.KeyStore.PrivateKeyEntry;
 import java.security.Provider;
 import java.security.Security;
-import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
 import java.security.cert.PKIXBuilderParameters;
 import java.security.cert.PKIXParameters;
@@ -41,16 +40,18 @@
 
     private static final String [] KEY_TYPES = new String[] { "RSA", "DSA", "EC", "EC_RSA" };
     // note the rare usage of DSA keys here in addition to RSA
-    private static final TestKeyStore TEST_KEY_STORE
-            = TestKeyStore.create(KEY_TYPES,
-                                  null,
-                                  null,
-                                  "rsa-dsa-ec",
-                                  TestKeyStore.localhost(),
-                                  0,
-                                  true,
-                                  null,
-                                  null);
+    private static final TestKeyStore TEST_KEY_STORE;
+    static {
+        try {
+            TEST_KEY_STORE = new TestKeyStore.Builder()
+                    .keyAlgorithms(KEY_TYPES)
+                    .aliasPrefix("rsa-dsa-ec")
+                    .ca(true)
+                    .build();
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
 
     public void test_TrustManagerFactory_getDefaultAlgorithm() throws Exception {
         String algorithm = TrustManagerFactory.getDefaultAlgorithm();
@@ -59,7 +60,7 @@
         test_TrustManagerFactory(tmf, StandardNames.IS_RI);
     }
 
-    private static class UseslessManagerFactoryParameters implements ManagerFactoryParameters {}
+    private static class UselessManagerFactoryParameters implements ManagerFactoryParameters {}
 
     private void test_TrustManagerFactory(TrustManagerFactory tmf,
                                           boolean supportsManagerFactoryParameters)
@@ -84,7 +85,7 @@
 
         // init with useless ManagerFactoryParameters
         try {
-            tmf.init(new UseslessManagerFactoryParameters());
+            tmf.init(new UselessManagerFactoryParameters());
             fail();
         } catch (InvalidAlgorithmParameterException expected) {
         }
@@ -141,7 +142,7 @@
             assertNotNull(issuers);
             assertTrue(issuers.length > 1);
             assertNotSame(issuers, tm.getAcceptedIssuers());
-            boolean defaultTrustmanager
+            boolean defaultTrustManager
                     // RI de-duplicates certs from TrustedCertificateEntry and PrivateKeyEntry
                     = issuers.length > (StandardNames.IS_RI ? 1 : 2) * KEY_TYPES.length;
 
@@ -149,7 +150,7 @@
             String sigAlgName = TestKeyStore.signatureAlgorithm(keyType);
             PrivateKeyEntry pke = TEST_KEY_STORE.getPrivateKey(keyAlgName, sigAlgName);
             X509Certificate[] chain = (X509Certificate[]) pke.getCertificateChain();
-            if (defaultTrustmanager) {
+            if (defaultTrustManager) {
                 try {
                     tm.checkClientTrusted(chain, keyType);
                     fail();
diff --git a/luni/src/test/java/tests/SQLite/AbstractSqlTest.java b/luni/src/test/java/libcore/sqlite/AbstractSqlTest.java
similarity index 88%
rename from luni/src/test/java/tests/SQLite/AbstractSqlTest.java
rename to luni/src/test/java/libcore/sqlite/AbstractSqlTest.java
index 937a1d3..d194548 100644
--- a/luni/src/test/java/tests/SQLite/AbstractSqlTest.java
+++ b/luni/src/test/java/libcore/sqlite/AbstractSqlTest.java
@@ -14,30 +14,21 @@
  * limitations under the License.
  */
 
+package libcore.sqlite;
 
-package tests.SQLite;
-
-import SQLite.Callback;
-import SQLite.Database;
 import SQLite.Exception;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
 import java.sql.Connection;
 import java.sql.DriverManager;
 import java.sql.ResultSet;
 import java.sql.SQLException;
 import java.sql.Statement;
+import junit.framework.TestCase;
 
 
 /**
  * This class provides SQL unit test, which can be used by subclasses eg. to
  * test JDBC drivers.
  */
-@TestTargetClass(Database.class)
 abstract class AbstractSqlTest extends TestCase {
 
     /**
@@ -93,8 +84,7 @@
      * @exception Exception may be thrown by subclasses
      */
     @Override
-    protected void setUp() throws InstantiationException,
-            IllegalAccessException, ClassNotFoundException, SQLException, Exception {
+    protected void setUp() throws java.lang.Exception {
         Class.forName(getDriverClassName()).newInstance();
         firstConnection = DriverManager.getConnection(getConnectionURL());
         firstConnection.setTransactionIsolation(getTransactionIsolation());
@@ -157,13 +147,6 @@
         assertTrue(i == ones.length);
     }
 
-    @TestTargetNew(
-      level = TestLevel.PARTIAL_COMPLETE,
-      notes = "",
-      clazz = Database.class,
-      method = "exec",
-      args = {String.class, Callback.class}
-    )
     public void testAutoCommitInsertSelect() throws SQLException{
         autoCommitInsertSelect();
     }
@@ -178,13 +161,6 @@
      *
      * @throws SQLException if there is a problem accessing the database
      */
-    @TestTargetNew(
-      level = TestLevel.PARTIAL_COMPLETE,
-      notes = "",
-      clazz = Database.class,
-      method = "exec",
-      args = {String.class, Callback.class}
-      )
     public void testUpdateSelectCommitSelect() throws SQLException {
         autoCommitInsertSelect();
         firstStmt.getConnection().setAutoCommit(false);
@@ -204,13 +180,6 @@
      *
      * @throws SQLException if there is a problem accessing the database
      */
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            clazz = Database.class,
-            method = "exec",
-            args = {String.class, Callback.class}
-    )
     public void testUpdateSelectRollbackSelect() throws SQLException {
         autoCommitInsertSelect();
         firstStmt.getConnection().setAutoCommit(false);
diff --git a/luni/src/test/java/libcore/sqlite/OldBlobTest.java b/luni/src/test/java/libcore/sqlite/OldBlobTest.java
new file mode 100644
index 0000000..3289d38
--- /dev/null
+++ b/luni/src/test/java/libcore/sqlite/OldBlobTest.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.sqlite;
+
+import SQLite.Blob;
+import SQLite.Database;
+import SQLite.Exception;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import tests.support.Support_SQL;
+
+public final class OldBlobTest extends OldSQLiteTest {
+
+    private static Blob testBlob = null;
+
+    private static Database db = null;
+
+    public void setUp() throws java.lang.Exception {
+        super.setUp();
+        testBlob = new Blob();
+
+        super.setUp();
+        Support_SQL.loadDriver();
+        db = new Database();
+        db.open(dbFile.getPath(), 0);
+
+        db.exec("create table B(id integer primary key, val blob)",null);
+        db.exec("insert into B values(1, zeroblob(128))", null);
+        db.exec("insert into B values(2, zeroblob(128))", null);
+        db.exec("insert into B values(3, zeroblob(128))", null);
+
+        // can not fill Blob with data at this point...
+        /*
+        File resources = Support_Resources.createTempFolder();
+        BufferedReader r = null;
+        try {
+            Class c = Class.forName(this.getClass().getName());
+            assertNotNull(c);
+            file = Class.forName(this.getClass().getName())
+                    .getResourceAsStream("/blob.c");
+            r = new BufferedReader(new InputStreamReader(file));
+        } catch (NullPointerException e) {
+            fail("Should not throw NullPointerException reading file"
+                    + e.getMessage());
+        }
+        OutputStream out = testBlob.getOutputStream();
+        String s = null;
+        while ((s = r.readLine()) != null) {
+            out.write(r.readLine().getBytes());
+        }
+        out.flush();
+        out.close();
+        testBlob.close();
+        */
+    }
+
+    @Override public void tearDown() throws java.lang.Exception {
+        testBlob.close();
+        super.tearDown();
+    }
+
+    /**
+     * db.open_blob is not supported.
+     */
+    public void testBlob() throws Exception, IOException {
+        byte[] b = new byte[4];
+        byte[] b128 = new byte[128];
+        for (int i = 0; i < b128.length; i++) {
+        b128[i] = (byte) i;
+        }
+        Blob blob = db.open_blob(dbFile.getPath(), "B", "val", 1, true);
+        try {
+
+        OutputStream os = blob.getOutputStream();
+        os.write(b128);
+        os.close();
+
+        InputStream is = blob.getInputStream();
+        is.skip(96);
+        assertEquals(4,is.read(b));
+        is.close();
+        } finally {
+        blob.close();
+        }
+    }
+
+    public void testGetInputStream() {
+        InputStream in = testBlob.getInputStream();
+        try {
+            in.read();
+            fail("Exception not thrown for invalid Blob.");
+        } catch (Throwable e) {
+            //ok
+        }
+    }
+
+    public void testGetOutputStream() {
+        OutputStream out = testBlob.getOutputStream();
+
+        try {
+           out.write(null);
+           fail("Write operation unsupported");
+        } catch (Throwable e) {
+            assertEquals("Write operation unsupported", e.getMessage());
+        }
+    }
+
+    public void testClose() {
+        assertNotNull(testBlob);
+
+        testBlob.close();
+        // inputStream either null or some error occurs
+        try {
+            // TODO This does look a bit weird. Revisit later.
+            assertNull(testBlob.getInputStream());
+        } catch (Throwable e) {
+            //ok
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/sqlite/OldDatabaseTest.java b/luni/src/test/java/libcore/sqlite/OldDatabaseTest.java
new file mode 100644
index 0000000..f2cbc57
--- /dev/null
+++ b/luni/src/test/java/libcore/sqlite/OldDatabaseTest.java
@@ -0,0 +1,1224 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.sqlite;
+
+import SQLite.Authorizer;
+import SQLite.Blob;
+import SQLite.BusyHandler;
+import SQLite.Callback;
+import SQLite.Constants;
+import SQLite.Database;
+import SQLite.Exception;
+import SQLite.Function;
+import SQLite.FunctionContext;
+import SQLite.ProgressHandler;
+import SQLite.Stmt;
+import SQLite.TableResult;
+import SQLite.Trace;
+import SQLite.Vm;
+import java.io.File;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URL;
+import java.sql.DatabaseMetaData;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.logging.Logger;
+import tests.support.DatabaseCreator;
+import tests.support.MockFunction;
+import tests.support.ThreadPool;
+
+public final class OldDatabaseTest extends OldSQLiteTest {
+
+    private static ErrorTracker tracker = null;
+
+    private Statement statement;
+
+    private Database db = null;
+
+    private static final int numThreads = 10;
+
+    private static final int numOfRecords = 30;
+
+    @Override public void setUp() throws java.lang.Exception {
+        super.setUp();
+        assertNotNull("Could not establish DB connection",conn);
+        tracker = new ErrorTracker();
+
+        statement = conn.createStatement();
+
+        // Cleanup tables if necessary
+
+        DatabaseMetaData meta = conn.getMetaData();
+        assertNotNull(meta);
+        ResultSet userTab = meta.getTables(null, null, null, null);
+        while (userTab.next()) {
+            String tableName = userTab.getString("TABLE_NAME");
+            this.statement.execute("drop table " + tableName);
+        }
+
+        // Create default test table
+        statement.execute(DatabaseCreator.CREATE_TABLE_SIMPLE1);
+        statement.close();
+
+        db = new Database();
+        db.open(dbFile.getPath(), 0);
+        db.busy_handler(null);
+    }
+
+    public void tearDown() throws java.lang.Exception {
+        try {
+            db.close();
+        } catch (Exception e) {
+            if (!(e.getMessage().equals("database already closed"))) {
+                System.err.println("Error closing DB " + dbFile.getPath());
+            }
+        }
+        tracker.reset();
+        super.tearDown();
+    }
+
+    public void testDatabase() throws Exception {
+        // db closed
+        Database db2 = new Database();
+        db.close();
+        db2 = new Database();
+        db2.open(dbFile.getPath(), 0);
+        db2.close();
+        db.open(dbFile.getPath(), 0);
+        //db is open
+        db2.open(dbFile.getPath(), 0);
+        db2.close();
+    }
+
+    public void testOpen() throws Exception {
+        db.close();
+        db.open(dbFile.getPath(), 0);
+        // open second db while db1 still open
+        Database db2 = new Database();
+        db2.open(dbFile.getPath(), 0);
+        db2.open(dbFile.getPath(), 0);
+        db2.close();
+        // open non db file
+        try {
+            URL file = OldDatabaseTest.class.getResource("/blob.c");
+            db2.open(file.getPath(), 0);
+            fail("Should not be able to open non db file");
+        } catch (SQLite.Exception e) {
+            assertEquals("unknown error in open", e.getMessage());
+        }
+    }
+
+    public void testOpen_aux_file() {
+        File temp = null;
+        try {
+            db.open_aux_file("");
+            fail("open should fail");
+        } catch (Exception e) {
+            assertEquals("unsupported", e.getMessage());
+        }
+
+     /*
+        try {
+            temp = File.createTempFile("openAuxMethod", ".db");
+            db.open_aux_file("");
+            db.exec("create table AUX_TABLE", null);
+            db.close();
+        } catch (Exception e) {
+            temp.delete();
+            fail("Error handling temporary file "+e.getMessage());
+            e.printStackTrace();
+        } catch (IOException e) {
+            temp.delete();
+            fail("Could not create temporary File");
+            e.printStackTrace();
+        }
+        try {
+            db.open(dbFile.getPath(),0);
+            db.exec("select * from AUX_TABLE", null);
+            fail("Statement should fail");
+        } catch (Exception e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+
+        temp.delete();
+        */
+    }
+
+    public void testClose() throws Exception {
+        try {
+            db.close();
+            db.get_table("test");
+            fail();
+        } catch (Exception e) {
+            assertTrue(e.getMessage().equals("database already closed"));
+            try {
+                db.open(dbFile.getPath(), 0);
+            } catch (Exception e1) {
+                fail("Database object could not be reopened after 'close': "
+                        + e.getMessage());
+                e1.printStackTrace();
+            }
+        }
+
+        try {
+            db.close();
+            db.close();
+            fail();
+        } catch (Exception e) {
+            assertTrue(e.getMessage().equals("database already closed"));
+            db.open(dbFile.getPath(), 0);
+        }
+    }
+
+    public void testExecStringCallback() throws Exception {
+        TableResult res = new TableResult();
+        db.exec("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " VALUES(1, 10, 20)", null);
+        db.exec("select * from " + DatabaseCreator.SIMPLE_TABLE1, res);
+        db.exec("delete from " + DatabaseCreator.SIMPLE_TABLE1 + " where 1", null);
+        String row[] = (String[]) res.rows.elementAt(0);
+        assertEquals(Integer.parseInt(row[0]), 1);
+        assertEquals(Integer.parseInt(row[1]), 10);
+        assertEquals(Integer.parseInt(row[2]), 20);
+    }
+
+    public void testExecStringCallbackStringArray() throws Exception {
+        TableResult res = new TableResult();
+        String args[] = new String[1];
+        args[0] = "table";
+        db.exec("select name from sqlite_master where type = '%q';", res, args);
+        String[] s = (String[]) res.rows.elementAt(0);
+        assertEquals(s[0], DatabaseCreator.SIMPLE_TABLE1);
+
+        try {
+            db.exec("select name from sqlite_master where type = ", res, args);
+            fail("Testmethod should fail");
+        } catch (Exception e) {
+            // Ok
+        }
+    }
+
+    public void testLast_insert_rowid() throws Exception {
+        assertEquals(0, db.last_insert_rowid());
+        db.exec("create table TEST5(id integer, firstname text, lastname text);", null);
+        db.exec("insert into TEST5 values (1,'James','Bond');", null);
+        db.exec("insert into TEST5 values (2,'Fiona','Apple');", null);
+        assertEquals(2, db.last_insert_rowid());
+        assertEquals(db.last_insert_rowid(), db.last_insert_rowid());
+
+        db.exec("drop table TEST5;", null);
+        assertEquals(2, db.last_insert_rowid());
+    }
+
+    /**
+     * Reason for failure unknown: Database should be locked. Specification
+     * of interrupt is scarce.
+     */
+    public void testInterrupt() throws Exception, SQLException {
+        ThreadPool threadPool = new ThreadPool(numThreads);
+
+        // initialization
+        ResultSet userTabs;
+        userTabs = conn.getMetaData().getTables(null, null, null, null);
+        while (userTabs.next()) {
+            String tableName = userTabs.getString("TABLE_NAME");
+            if (tableName.equals(DatabaseCreator.TEST_TABLE1)) {
+                statement.execute(DatabaseCreator.DROP_TABLE1);
+            }
+        }
+        db.exec(DatabaseCreator.CREATE_TABLE3, null);
+        db.exec(DatabaseCreator.CREATE_TABLE1, null);
+
+        int id1 = numOfRecords - 3;
+        threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
+        // should not be able to do any other insertions since task 1 holds lock
+        int id2 = numOfRecords + 3;
+        threadPool
+                .runTask(createTask2Interrupt(id2, dbFile.getPath(), tracker));
+
+        threadPool.join();
+
+        List<String> errors = tracker.getErrors();
+        System.out.println("Last error: " + db.error_message());
+        if (errors.size() > 0) {
+            assertEquals(errors.get(0), db.error_string(Constants.SQLITE_LOCKED));
+            for (String s : errors) {
+                Logger.global.info("INTERRUPT Error: " + s);
+            }
+
+        } else {
+            fail("Should have one exception: database should be locked.");
+        }
+
+        // reset
+        db.exec("delete from " + DatabaseCreator.TEST_TABLE1 + " where 1", null);
+        db.exec("delete from " + DatabaseCreator.TEST_TABLE3 + " where 1", null);
+    }
+
+    /**
+     * Returns wrong number for updates: returns value > 1 for select.
+     */
+    public void testChanges() throws Exception {
+        TableResult res = new TableResult();
+        assertTrue(db.changes() == 0);
+        db.exec("INSERT INTO " + DatabaseCreator.SIMPLE_TABLE1
+                + " VALUES(2, 5, 7);", null);
+        int rows = (int) db.changes();
+        assertEquals(1,db.changes());
+        db.exec("update " + DatabaseCreator.SIMPLE_TABLE1
+                + " set speed = 7, size= 5 where id = 2;", null);
+        assertEquals(1,db.changes());
+        db.exec("select * from " + DatabaseCreator.SIMPLE_TABLE1, res);
+        assertEquals(0,db.changes());
+        db.exec("INSERT INTO " + DatabaseCreator.SIMPLE_TABLE1
+                + " VALUES(8, 5, 7);", null);
+        db.exec("Update "+DatabaseCreator.SIMPLE_TABLE1+" set speed = 10;",null);
+        assertTrue(db.changes() > 2);
+    }
+
+    /**
+     * method test fails once in a while. Cannot be sure that exception is
+     * thrown in every test execution.
+     */
+    public void testBusy_handler() throws SQLException, Exception {
+        TestBusyHandler bh = new TestBusyHandler();
+        db.busy_handler(bh);
+        int counter = 0;
+        ThreadPool threadPool = new ThreadPool(numThreads);
+
+        // initialization
+        ResultSet userTabs;
+        userTabs = conn.getMetaData().getTables(null, null, null, null);
+        while (userTabs.next()) {
+            String tableName = userTabs.getString("TABLE_NAME");
+            if (tableName.equals(DatabaseCreator.TEST_TABLE1)) {
+                statement.execute(DatabaseCreator.DROP_TABLE1);
+            }
+        }
+        db.exec(DatabaseCreator.CREATE_TABLE3, null);
+        db.exec(DatabaseCreator.CREATE_TABLE1, null);
+
+
+        try {
+            conn.setAutoCommit(false);
+            int id1 = numOfRecords - 3;
+            threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
+            int id2 = numOfRecords + 3;
+            threadPool.runTask(createTask2(id2, dbFile.getPath(), tracker));
+            int oldID = 5;
+            int newID = 100;
+            threadPool.runTask(createTask3(oldID, dbFile.getPath(), newID,
+                    tracker));
+
+            threadPool.join();
+
+            List<String> errors = tracker.getErrors();
+            if (errors.size() > 0) {
+//                 assertEquals(errors.get(0),
+//                 db.error_string(Constants.SQLITE_LOCKED));
+                for (String s: errors) {
+                  System.out.println("Round 2 Error: "+s);
+              }
+            } else {
+                fail("No error happened");
+            }
+
+            // reset
+
+
+            db.exec("delete from " + DatabaseCreator.TEST_TABLE1 + " where 1",
+                    null);
+            db.exec("delete from " + DatabaseCreator.TEST_TABLE3 + " where 1",
+                            null);
+//
+//            // increase timeout for retry
+//            db.busy_timeout(1000);
+//            db.busy_handler(bh);
+//            tracker.reset();
+
+//            threadPool = new ThreadPool(numThreads);
+//
+//            threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
+//            threadPool.runTask(createTask2(id2, dbFile.getPath(), tracker));
+//
+//            threadPool.join();
+//
+//            errors = tracker.getErrors();
+//            if (errors.size() > 0) {
+//                // assertEquals(errors.get(0),
+//                // db.error_string(Constants.SQLITE_LOCKED));
+//                for (String s: errors) {
+//                    System.out.println("Round 2 Error"+s);
+//                }
+//            } else {
+//                // ok
+//                System.out.println("BUSY: No Error!");
+//            }
+//
+//
+        } finally {
+            conn.setAutoCommit(true);
+            db.exec(DatabaseCreator.DROP_TABLE1, null);
+            db.exec(DatabaseCreator.DROP_TABLE3, null);
+        }
+    }
+
+    /**
+     * test fails. Cannot be sure that exception is thrown every time.
+     * Database does not lock values.
+     */
+    public void testBusy_timeout() throws Exception, SQLException {
+        int counter = 0;
+        ThreadPool threadPool = new ThreadPool(numThreads);
+
+        // initialization
+        ResultSet userTabs = conn.getMetaData().getTables(null, null, null, null);
+        while (userTabs.next()) {
+            String tableName = userTabs.getString("TABLE_NAME");
+            if (tableName.equals(DatabaseCreator.TEST_TABLE1)) {
+                statement.execute(DatabaseCreator.DROP_TABLE1);
+            }
+        }
+        db.exec(DatabaseCreator.CREATE_TABLE3, null);
+        db.exec(DatabaseCreator.CREATE_TABLE1, null);
+
+        // test run
+        try {
+            conn.setAutoCommit(false);
+
+//            DatabaseCreator.fillTestTable1(conn, numOfRecords);
+            // set to fail immediately if table is locked.
+            db.busy_handler(null);
+            db.busy_timeout(0);
+            int id1 = numOfRecords - 3;
+
+            threadPool.runTask(createTask2(id1, dbFile.getPath(), tracker));
+            int id2 = numOfRecords + 3;
+            threadPool.runTask(createTask1(id2, dbFile.getPath(), tracker));
+            int oldID = 5;
+            int newID = 100;
+            threadPool.runTask(createTask3(oldID, dbFile.getPath(), newID,
+                    tracker));
+
+            threadPool.join();
+
+            List<String> errors = tracker.getErrors();
+            assertTrue("No error occurred on DB but should have",errors.size() > 0);
+
+            assertEquals(errors.get(0),
+            db.error_string(Constants.SQLITE_LOCKED));
+            assertEquals(errors.get(0), "database is locked");
+
+            // reset
+
+            db.exec("delete from " + DatabaseCreator.TEST_TABLE1 + " where 1",
+                    null);
+            db.exec("delete from " + DatabaseCreator.TEST_TABLE3 + " where 1",
+                            null);
+
+            // increase timeout for retry
+            db.busy_timeout(10000);
+            db.busy_handler(null);
+            tracker.reset();
+            threadPool = new ThreadPool(numThreads);
+
+            threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
+            threadPool.runTask(createTask2(id2, dbFile.getPath(), tracker));
+
+            threadPool.join();
+
+            errors = tracker.getErrors();
+            if (errors.size() > 0) {
+                fail("busy timeout should prevent from lock exception!");
+                for (String s: errors) {
+                    System.out.println("Round 2 Error"+s);
+                }
+            } else {
+                // ok
+            }
+        } finally {
+            conn.setAutoCommit(true);
+            // cleanup
+            db.exec(DatabaseCreator.DROP_TABLE1, null);
+            db.exec(DatabaseCreator.DROP_TABLE3, null);
+        }
+    }
+
+    public void testGet_tableString() throws Exception {
+        TableResult emptyTable = new TableResult();
+        //select from empty table
+        TableResult res = db.get_table("select * from " + DatabaseCreator.SIMPLE_TABLE1);
+        assertEquals(res.toString(), emptyTable.toString());
+        //fill table-> t
+//        DatabaseCreator.fillSimpleTable1(conn);
+//        res = db.get_table("select * from "
+//                + DatabaseCreator.SIMPLE_TABLE1);
+//        assertFalse(emptyTable.toString().equals(res.toString()));
+
+        db.exec("insert into " + DatabaseCreator.SIMPLE_TABLE1 + " VALUES(1, 10, 20)", null);
+        res = db.get_table("select * from " + DatabaseCreator.SIMPLE_TABLE1);
+        db.exec("delete from " + DatabaseCreator.SIMPLE_TABLE1
+                + " where 1", null);
+        String row[] = (String[]) res.rows.elementAt(0);
+        assertEquals(Integer.parseInt(row[0]), 1);
+        assertEquals(Integer.parseInt(row[1]), 10);
+        assertEquals(Integer.parseInt(row[2]), 20);
+    }
+
+    public void testGet_tableStringStringArray() throws Exception {
+        String args[] = new String[1];
+        args[0] = "table";
+        String argsFail[] = new String[1];
+        try {
+            db.get_table("select name from sqlite_master where type = ", argsFail);
+            fail("Testmethod should fail");
+        } catch (Exception e) {
+        }
+
+        TableResult res = db.get_table(
+                "select name from sqlite_master where type = '%q'",
+                args);
+        String[] s = (String[]) res.rows.elementAt(0);
+        assertEquals(s[0], DatabaseCreator.SIMPLE_TABLE1);
+    }
+
+    public void testGet_tableStringStringArrayTableResult() throws Exception {
+        String args[] = new String[1];
+        String argsFail[] = new String[1];
+        TableResult res = new TableResult();
+        TableResult defaultTableRes = new TableResult();
+        args[0] = "table";
+
+        try {
+            db.get_table("select name from sqlite_master where type = '%q'", argsFail, res);
+            assertEquals(defaultTableRes.toString(), res.toString());
+        } catch (Exception e) {
+            db.get_table("select name from sqlite_master where type = '%q'", args, res);
+            String[] s = (String[]) res.rows.elementAt(0);
+            assertEquals(s[0], DatabaseCreator.SIMPLE_TABLE1);
+            System.out.println("DatabaseTest.testGet_tableStringStringArrayTableResult() "
+                    + Arrays.toString(res.types));
+        }
+    }
+
+    public void testComplete() {
+        assertFalse(db.complete("create"));
+        assertTrue(db.complete("create table TEST (res double);"));
+    }
+
+    public void testVersion() {
+        String version = db.version();
+        if (version != null) {
+            assertTrue(Integer.parseInt(db.version().substring(0, 1)) > 0);
+            assertEquals(db.version(), db.version());
+        } else {
+            fail("DB version info missing");
+        }
+    }
+
+    public void testDbversion() throws Exception {
+        String verNo = "";
+        try {
+            verNo = db.dbversion();
+            db.close();
+            assertEquals(db.dbversion(),"unknown");
+            db.open(dbFile.getPath(), 0);
+            assertEquals(verNo, db.dbversion());
+        } catch (Exception e) {
+            db.open(dbFile.getPath(), 0);
+        }
+
+        assertTrue(Integer.parseInt(verNo.substring(0, 1))>= 3 );
+
+    }
+
+    public void testCreate_function() throws Exception {
+        double input = 1.0;
+        db.exec("create table TEST (res double)", null);
+        db.exec("insert into TEST values (" + Double.toString(input) + ")",
+                null);
+        TableResult res = new TableResult();
+        Function sinFunc = (Function) new SinFunc();
+        db.create_function("sin", 1, sinFunc);
+        db.exec("select sin(res) from TEST WHERE res = "
+                + Double.toString(input), res);
+        String row[] = (String[]) res.rows.elementAt(0);
+        String val = row[0];
+        double sinusVal = Double.parseDouble(val);
+        double funcVal = Math.sin(input);
+
+        assertTrue(Math.round(funcVal) == Math.round(sinusVal));
+    }
+
+    /**
+     * Aggregation function not called.
+     */
+    public void testCreate_aggregate() throws Exception {
+        TestTrace t = new TestTrace();
+        MockFunction aggFunction = new MockFunction();
+        db.exec("create table TEST(id integer, firstname text, lastname text)", null);
+        db.exec("insert into TEST values(3, 'James', 'Bond'); ", null);
+        db.exec("insert into TEST values(4, 'Fiona', 'Apple'); ", null);
+        db.trace((Trace) t);
+        db.create_aggregate("myaggfunc", 1, aggFunction);
+        db.function_type("myaggfunc", Constants.SQLITE3_TEXT);
+        db.exec("PRAGMA show_datatypes = on", null);
+
+        assertFalse(aggFunction.functionCalled);
+        assertFalse(aggFunction.stepCalled);
+        assertFalse(aggFunction.lastStepCalled);
+        db.exec("select myaggfunc(TEST.firstname) from TEST", t);
+        assertTrue(aggFunction.stepCalled);
+        assertTrue(aggFunction.lastStepCalled);
+        assertTrue(aggFunction.functionCalled);
+
+        assertEquals("James Fiona ",aggFunction.getAggValue());
+        db.exec("drop table TEST", null);
+
+        try {
+            db.create_aggregate("myaggfunc", 0, null);
+        } catch (Throwable e) {
+            assertEquals("null SQLite.Function not allowed",e.getMessage());
+        }
+
+          try {
+            db.create_aggregate("myaggfunc", 0, aggFunction);
+        } catch (Throwable e) {
+            assertEquals("wrong number of arguments to function myaggfunc()",e.getMessage());
+        }
+    }
+
+    public void testFunction_type() throws Exception {
+        double input = 1.0;
+        TableResult res = new TableResult();
+        Function sinFunc = (Function) new SinFunc();
+
+        db.exec("PRAGMA show_datatypes = on", null);
+        db.exec("create table TEST (res double)", null);
+        db.exec("insert into TEST values (" + Double.toString(input) + ")",
+                null);
+
+        db.create_function("sin", 1, sinFunc);
+        db.function_type("sin", Constants.SQLITE_FLOAT);
+        res = db.get_table("select sin(res) from TEST WHERE res = "
+                + Double.toString(input));
+
+        String row[] = (String[]) res.rows.elementAt(0);
+        String val = row[0];
+        assertTrue("double".equalsIgnoreCase(res.types[0]));
+        assertSame(Math.round(Math.sin(input)), Math.round(Double.parseDouble(val)));
+
+        // function determines return type: test that Double type is returned.
+        db.function_type("sin", Constants.SQLITE_BLOB);
+        Stmt s = db.prepare("select sin(res) from TEST WHERE res = ?");
+        s.bind(1, input);
+        s.step();
+
+        res = db.get_table("select sin(res) from TEST WHERE res = "
+                + Double.toString(input));
+        assertTrue("double".equalsIgnoreCase(res.types[0]));
+        row = (String[]) res.rows.elementAt(0);
+        val = row[0];
+        assertSame(Math.round(Math.sin(input)), Math.round(Double.parseDouble(val)));
+    }
+
+    public void testLast_error() {
+        assertEquals(db.last_error(), Constants.SQLITE_OK);
+        try {
+            db.exec("create table TEST (res double)",null);
+            db.exec("create table TEST (res double)",null);
+            fail("Error should have happened");
+        } catch (Exception e) {
+            assertEquals(db.last_error(),db.last_error());
+            assertEquals(db.last_error(),Constants.SQLITE_ERROR);
+        }
+    }
+
+    public void testSet_last_error() {
+       assertEquals(db.last_error(), Constants.SQLITE_OK);
+       try {
+           db.exec("sel from test;", null);
+       } catch (Exception e) {
+           assertEquals(Constants.SQLITE_ERROR,db.last_error());
+       }
+    }
+
+    public void testError_message() {
+        String statement = "create table TEST (res double)";
+        try {
+            db.exec(statement,null);
+            db.exec(statement,null);
+            fail("DB Error expected");
+        } catch (Exception e) {
+            String dbError = db.error_message();
+            assertTrue(e.getMessage().equals(dbError));
+
+        }
+    }
+
+    public void testError_string() {
+        TestTrace t = new TestTrace();
+        assertEquals(db.last_error(), Constants.SQLITE_OK);
+        String errorString = db.error_string(Constants.SQLITE_ERROR);
+        try {
+            db.trace((Trace) t);
+            db.exec("create table TEST (res double)", t);
+            db.exec("create table TEST (res double)", t);
+        } catch (Exception e) {
+            assertEquals(db.last_error(), Constants.SQLITE_ERROR);
+            if (db.is3()) {
+                assertEquals("Unsupported Method (sqlite 3): error_string", db
+                        .error_string(db.last_error()), errorString);
+            }
+        }
+    }
+
+    /**
+     * ASCII encoding does not work: a UTF encoded val is returned. Spec is not
+     * sufficient. Might be that test impl is wrong or String constructor for
+     * the ASCII encoding.
+     */
+    public void testSet_encoding() throws UnsupportedEncodingException, Exception {
+        String input = "\u00bfMa\u00f1ana\u003f"; // ?Manana?
+        TableResult res = new TableResult();
+        String refOutput = null;
+        Stmt stat = null;
+
+        // DB setup
+        db.exec("create table encodingTest (encoded text DEFAULT NULL);",
+                null);
+        stat = db
+                .prepare("insert into encodingTest(encoded) values(:one);");
+        stat.bind(1, input);
+        stat.step();
+        // stat.close();
+        db.exec("select * from encodingTest;", res);
+        String[] encInput = (String[]) res.rows.elementAt(0);
+        String output = encInput[0];
+        assertEquals(input, output);
+        // db.exec("delete from encodingTest where 1", null);
+
+     // tests for different encoding schemes
+        String[] charsetNames = {"UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE"};
+        for (int i = 0; i < charsetNames.length; i++) {
+            byte[] encInputBytes = input.getBytes(charsetNames[i]);
+            db.set_encoding(charsetNames[i]);
+            db.exec("select * from encodingTest;", res);
+            String[] encOutput = (String[]) res.rows.elementAt(0);
+            String inputAsString = new String(encInputBytes,charsetNames[i]);
+            assertEquals(inputAsString, encOutput[0]);
+        }
+
+        // Default tests
+        db.set_encoding("UTF-16");
+        db.exec("select * from encodingTest;", res);
+        String[] encOutput1 = (String[]) res.rows.elementAt(0);
+        assertEquals("Got "+encOutput1[0]+" as UTF-16",input,encOutput1[0]);
+
+        db.set_encoding("US-ASCII");
+        db.exec("select * from encodingTest;", res);
+        String[] encOutput2 = (String[]) res.rows.elementAt(0);
+        assertEquals(new String(input.getBytes(),"US-ASCII"),encOutput2[0]);
+
+        // DB teardown
+        stat.close();
+        db.exec("delete from encodingTest", null);
+
+        // Default tests
+        try {
+            db.set_encoding("");
+            fail("invalid input should fail");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    /**
+     * Callback never made for authorization. Results of private table are
+     * returned withouth furhter checks.
+     *
+     * Test fails -> implemented correctly?
+     */
+    public void testSet_authorizer() throws Exception {
+        TableResult resPriv = null;
+        TableResult resPub = null;
+        TableResult emptyTable = new TableResult();
+        String insertPublic = "insert into public_table values(1,2)";
+        String insertPrivate = "insert into private_table values(1,2)";
+        // prepare, authorizer is not activated yet
+        db.exec("create table public_table(c1 integer, c2 integer);", null);
+        db.exec("create table private_table(c1 integer, c2 integer);", null);
+        // inserts
+        db.exec(insertPublic, null);
+        db.exec(insertPrivate, null);
+        // selects
+        resPriv = db.get_table("select * from private_table");
+        resPub = db.get_table("select * from public_table");
+
+//        db.exec("delete from public_table where 1", null);
+//        TableResult emptyPubTable = db.exec("select * from public");
+
+        // set Authorizer (positive case): denies private table
+        AuthorizerCallback cb = new AuthorizerCallback();
+        db.set_authorizer(cb);
+        //select
+
+        db.exec("select * from private_table", cb);
+        assertTrue(cb.wasCalled());
+
+       /*
+        TableResult res = db.get_table("select * from private_table");
+        assertEquals(emptyTable.toString(),res.toString());
+        assertFalse(emptyTable.equals(resPriv));
+
+        res = db.get_table("select * from public_table");
+        assertEquals(resPub,res);
+        */
+
+        // Try insert
+        try {
+            db.exec(insertPublic, null);
+            fail("authorization failed");
+        } catch (Exception e) {
+        }
+
+        try {
+            db.exec(insertPrivate, null);
+            fail("authorization failed");
+        } catch (Exception e1) {
+            // ok
+        }
+    }
+
+    public void testTrace() throws Exception {
+        String stmt = "create table TEST (res double);";
+        TestTrace t = new TestTrace();
+        assertFalse(t.traceCalled);
+        assertEquals(db.last_error(),Constants.SQLITE_OK);
+        db.trace((Trace) t);
+        db.exec(stmt,t);
+        assertTrue(t.traceCalled);
+        assertEquals(t.getTrace(),stmt);
+
+        try {
+            db.close();
+            db.exec(stmt,t);
+            fail("Exception Expected");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testCompileString() throws Exception {
+        db.compile("select name from sqlite_master;");
+        try {
+            db.compile("test");
+            fail("Compiling of inaccurate statement does not fail.");
+        } catch (Exception e) {
+        }
+    }
+
+    public void testCompileStringStringArray() throws Exception {
+        String args[] = new String[1];
+        args[0] = "table";
+        db.compile("select name from sqlite_master where type = '%q';",args);
+
+        try {
+            db.compile("test",null);
+            fail("Compiling of inaccurate statement does not fail.");
+        } catch (Exception e) {
+        }
+    }
+
+    public void testPrepare() throws Exception {
+        Stmt st = null;
+        Stmt st2 = null;
+        // test empty statement
+        try {
+            st = db.prepare("");
+            assertEquals(0, st.bind_parameter_count());
+            st.step();
+            fail("stmt should not be prepared");
+        } catch (Exception e) {
+            assertEquals("stmt already closed", e.getMessage());
+        }
+
+        // test statement with unbound arguments
+        try {
+            st2 = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                    + " values (:one,:two,:three)");
+            assertEquals(3, st2.bind_parameter_count());
+            assertEquals(3, st2.bind_parameter_index(":three"));
+            assertEquals(":two", st2.bind_parameter_name(2));
+        } finally {
+            st2.close();
+        }
+
+        try {
+            db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                    + " values(:one,:two,:three,:four);");
+        } catch (Exception e) {
+            assertEquals("table " + DatabaseCreator.SIMPLE_TABLE1
+                    + " has 3 columns but 4 values were supplied", e
+                    .getMessage());
+        }
+
+        try {
+            db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                    + " values(5, '10, 20);");
+        } catch (Exception e) {
+            assertEquals("unrecognized token: \"'10, 20);\"", e.getMessage());
+        }
+
+        try {
+            db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                    + " values(5, 10 20);");
+        } catch (Exception e) {
+            assertEquals("near \"20\": syntax error", e.getMessage());
+        }
+
+    }
+
+    /**
+     * Not supported.
+     */
+    public void testOpen_blob() throws Exception, java.lang.Exception {
+        Stmt statement2;
+        Blob blobInput = new Blob();
+
+        // Create test input Blob
+        InputStream inStream = null;
+        byte[] in = {(byte) 1, (byte) 2, (byte) 3, (byte) 4};
+
+        // setup test input
+        db.exec("create table TEST (res blob)",null);
+        inStream = Class.forName(this.getClass().getName()).getResourceAsStream("/blob.c");
+        assertNotNull(inStream);
+
+        // insert byte array in db
+        statement2 = db.prepare("insert into TEST(res) values (?)");
+        statement2.bind(1, in);
+        statement2.step();
+        statement2.close();
+
+        // read from db
+        Blob blob = db.open_blob(dbFile.getPath(), "TEST", "res", 1, true);
+        if (blob == null) {
+            fail("Blob could not be retrieved");
+        }
+        //read from blob and compare values (positive case)
+        InputStream is = blob.getInputStream();
+
+        int i = 0;
+        int outByte = 0;
+        byte[] out = new byte[4];
+        while ((outByte = is.read()) > -1) {
+            out[i] = (byte) outByte;
+            i++;
+        }
+        is.close();
+
+        blob.close();
+
+        assertTrue(Arrays.equals(in, out));
+
+        //read from blob and compare values (default blob)
+        db.exec("insert into TEST values(zeroblob(128))", null);
+        Blob blob2 = db.open_blob(dbFile.getPath(), "TEST", "res", 2, true);
+        is = blob2.getInputStream();
+        for (i = 0; i < 128; i++)  {
+           assertEquals(0, is.read());
+        }
+        is.close();
+    }
+
+    public void testIs3() {
+        int ver = Integer.parseInt(db.version().substring(0,1));
+        if (db.is3()) {
+            assertTrue( ver == 3);
+        } else {
+            assertTrue(ver != 3);
+        }
+    }
+
+    public void testProgress_handler() throws Exception {
+        int inputVal = 3;
+        TestProgressHandler prog = new TestProgressHandler();
+        db.exec("create table TEST5(id integer, firstname text, lastname text)",null);
+        Vm vm = db.compile("select * from TEST5; "
+                + "insert into TEST5 values(3, 'James', 'Bond'); "
+                + "delete from TEST5 where id = 3; "
+                + "select * from TEST5");
+        int stmt = 0;
+        do {
+            ++stmt;
+            if (stmt > inputVal) {
+                db.progress_handler(inputVal, prog);
+            } else {
+                assertEquals(0, prog.getCounts());
+            }
+            while (vm.step(prog)) {
+            }
+        } while (vm.compile());
+        assertEquals(inputVal,prog.getCounts());
+
+        // Boundary value test
+        inputVal = 0;
+        TestProgressHandler progBoundary = new TestProgressHandler();
+        db.progress_handler(inputVal, progBoundary);
+        Vm vm2 = db.compile("select * from TEST5; "
+                + "insert into TEST5 values(3, 'James', 'Bond'); "
+                + "delete from TEST5 where id = 3; "
+                + "select * from TEST5");
+        do {
+            vm2.step(progBoundary);
+        } while (vm2.compile());
+        assertEquals(inputVal, progBoundary.getCounts());
+
+        try {
+            db.exec("drop table TEST5",null);
+        } catch (Exception e) {
+            System.out.println(e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+    class SinFunc implements Function {
+        public void function(FunctionContext fc, String args[]) {
+            Double d = new Double(args[0]);
+            fc.set_result(Math.sin(d.doubleValue()));
+        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
+    }
+
+    class TestTrace implements Trace,Callback {
+
+        private StringBuffer buf = new StringBuffer();
+
+        public boolean traceCalled = false;
+
+        public String getTrace() {
+            return buf.toString();
+        }
+
+        public void trace(String stmt) {
+            traceCalled = true;
+            buf.append(stmt);
+        }
+
+        public void columns(String[] coldata) {}
+
+        public boolean newrow(String[] rowdata) {
+            return false;
+        }
+
+        public void types(String[] types) {}
+    }
+
+    class AuthorizerCallback implements Authorizer, Callback {
+
+        private boolean isAuthorizing = false;
+
+        public boolean wasCalled() {
+            return isAuthorizing;
+        }
+
+        public int authorize(int action, String arg1, String arg2, String arg3,
+                String arg4) {
+            Logger.global.info("DB authorization callback " + action + " " + arg1 + " " + arg2 + " "
+                    + arg3 + " " + arg4 + " ");
+            this.isAuthorizing = true;
+            if (action != Constants.SQLITE_SELECT || arg1.contains("private_table")) {
+                return Constants.SQLITE_DENY;
+            } else {
+                return Constants.SQLITE_OK;
+            }
+        }
+
+        public void columns(String[] coldata) {}
+
+        public boolean newrow(String[] rowdata) {
+            return false;
+        }
+
+        public void types(String[] types) {}
+
+    }
+
+    class TestBusyHandler implements BusyHandler, Callback {
+
+        public boolean busy(String table, int count) {
+            return true;
+        }
+
+        public void columns(String[] coldata) {}
+
+        public boolean newrow(String[] rowdata) {
+            return false;
+        }
+
+        public void types(String[] types) {}
+    }
+
+    class TestProgressHandler implements ProgressHandler, Callback {
+
+        private boolean progressed = false;
+
+        private int counter = 0;
+
+        public int getCounts() {
+            return counter;
+        }
+
+        public boolean progress() {
+            this.progressed = true;
+            counter++;
+            return true;
+        }
+
+        public void columns(String[] coldata) {}
+
+        public boolean newrow(String[] rowdata) {
+            return false;
+        }
+
+        public void types(String[] types) {}
+    }
+
+    /**
+     * This method creates a Runnable that executes insert operation for the first table
+     */
+    private static Runnable createTask2Interrupt(final int id,
+            final String dbName, final ErrorTracker errorTracker) {
+        return new Runnable() {
+            public void run() {
+                Database db = new Database();
+                try {
+                    String value = DatabaseCreator.defaultString + id;
+
+                    db.open(dbName, 0);
+                    String insertQuery = "INSERT INTO "
+                            + DatabaseCreator.TEST_TABLE1
+                            + " (id, field1, field2, field3) VALUES(" + id
+                            + ", '" + value + "', " + id + ", " + id + ")";
+                    db.exec(insertQuery, null);
+                } catch (Exception e) {
+                    errorTracker.registerException(this, e);
+                    try {
+                        db.interrupt();
+                        db.exec("DELETE FROM " + DatabaseCreator.SIMPLE_TABLE1
+                                + " WHERE id=" + id, null);
+                    } catch (Exception e1) {
+                        errorTracker.registerException(this, e1);
+                    }
+                }
+            }
+        };
+    }
+
+    /**
+     * This method creates a Runnable that executes delete operation for the first table
+     */
+    private static Runnable createTask1(final int id, final String dbName,
+            final ErrorTracker errorTracker) {
+        return new Runnable() {
+            public void run() {
+                try {
+                    Database db = new Database();
+                    db.open(dbName, 0);
+                    db.exec("DELETE FROM "
+                            + DatabaseCreator.SIMPLE_TABLE1 + " WHERE id=" + id, null);
+                } catch (Exception e) {
+                    errorTracker.registerException(this, e);
+                }
+            }
+        };
+    }
+
+    /**
+     * This method creates a Runnable that executes insert operation for the first table
+     */
+    private static Runnable createTask2(final int id, final String dbName,
+            final ErrorTracker errorTracker) {
+        return new Runnable() {
+            public void run() {
+                try {
+                    String value = DatabaseCreator.defaultString + id;
+                    Database db = new Database();
+                    db.open(dbName, 0);
+                    String insertQuery = "INSERT INTO "
+                            + DatabaseCreator.TEST_TABLE1
+                            + " (id, field1, field2, field3) VALUES(" + id
+                            + ", '" + value + "', " + id + ", " + id + ")";
+                    db.exec(insertQuery, null);
+                } catch (Exception e) {
+                    errorTracker.registerException(this, e);
+
+                }
+            }
+        };
+    }
+
+    /**
+     * This method creates a Runnable that executes update operation for the one record of the first
+     * table
+     */
+    private static Runnable createTask3(final int oldID, final String dbName,
+            final int newID, final ErrorTracker errorTracker) {
+        return new Runnable() {
+            public void run() {
+                Database db = new Database();
+                try {
+                    db.open(dbName, 0);
+                    String value = DatabaseCreator.defaultString + newID;
+                    String updateQuery = "UPDATE "
+                            + DatabaseCreator.TEST_TABLE1 + " SET id=" + newID
+                            + ", field1='" + value + "', field2=" + newID
+                            + ", field3=" + newID + " WHERE id=" + oldID;
+                    db.exec(updateQuery, null);
+                } catch (Exception e) {
+                    errorTracker.registerException(this, e);
+                }
+            }
+        };
+    }
+
+    private class ErrorTracker {
+
+        private List<String> errors = new ArrayList<String>();
+
+        public void registerException(Runnable runnable, Exception e) {
+            System.out.println("Registered: " + e.getMessage());
+            errors.add(e.getMessage());
+        }
+
+        public List<String> getErrors() {
+            return errors;
+        }
+
+        public void reset() {
+            errors.clear();
+        }
+    }
+}
diff --git a/luni/src/test/java/tests/SQLite/ExceptionTest.java b/luni/src/test/java/libcore/sqlite/OldExceptionTest.java
similarity index 60%
rename from luni/src/test/java/tests/SQLite/ExceptionTest.java
rename to luni/src/test/java/libcore/sqlite/OldExceptionTest.java
index fa11422..dddfd6b 100644
--- a/luni/src/test/java/tests/SQLite/ExceptionTest.java
+++ b/luni/src/test/java/libcore/sqlite/OldExceptionTest.java
@@ -14,40 +14,20 @@
  * limitations under the License.
  */
 
-package tests.SQLite;
+package libcore.sqlite;
 
 import SQLite.Database;
 import SQLite.Exception;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 
-import junit.framework.TestCase;
-
-@TestTargetClass(SQLite.Exception.class)
-public class ExceptionTest extends SQLiteTest {
+public final class OldExceptionTest extends OldSQLiteTest {
 
     private Database db = null;
 
-    public void setUp() throws java.lang.Exception {
+    @Override public void setUp() throws java.lang.Exception {
         super.setUp();
         db = new Database();
     }
 
-    public void tearDown() {
-        super.tearDown();
-    }
-
-    /**
-     * @tests {@link Exception#Exception(String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "constructor test",
-        method = "Exception",
-        args = {java.lang.String.class}
-    )
     public void testException() {
         try {
             db.open(dbFile.getName(), 0);
@@ -56,5 +36,4 @@
             assertNotNull(e.getMessage());
         }
     }
-
 }
diff --git a/luni/src/test/java/tests/SQLite/FunctionContextTest.java b/luni/src/test/java/libcore/sqlite/OldFunctionContextTest.java
similarity index 67%
rename from luni/src/test/java/tests/SQLite/FunctionContextTest.java
rename to luni/src/test/java/libcore/sqlite/OldFunctionContextTest.java
index b63b802..0924317 100644
--- a/luni/src/test/java/tests/SQLite/FunctionContextTest.java
+++ b/luni/src/test/java/libcore/sqlite/OldFunctionContextTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package tests.SQLite;
+package libcore.sqlite;
 
 import SQLite.Database;
 import SQLite.Exception;
@@ -22,54 +22,25 @@
 import SQLite.FunctionContext;
 import SQLite.Stmt;
 import SQLite.TableResult;
-import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
 import java.io.UnsupportedEncodingException;
 import java.sql.SQLException;
 import java.sql.Statement;
-
 import tests.support.DatabaseCreator;
 
-@TestTargetClass(FunctionContext.class)
-public class FunctionContextTest extends SQLiteTest {
+public final class OldFunctionContextTest extends OldSQLiteTest {
 
     private Database db = null;
 
-    public void setUp() throws java.lang.Exception {
-        Statement st = null;
+    @Override public void setUp() throws java.lang.Exception {
         super.setUp();
         db = new Database();
         db.open(dbFile.getPath(), 0);
-        st = conn.createStatement();
+        Statement st = conn.createStatement();
         st.execute(DatabaseCreator.CREATE_TABLE2);
         st.execute(DatabaseCreator.CREATE_TABLE_SIMPLE1);
         st.close();
     }
 
-    /* (non-Javadoc)
-     * @see junit.framework.TestCase#tearDown()
-     */
-    public void tearDown() {
-        super.tearDown();
-    }
-
-    /**
-     * Test method for {@link SQLite.FunctionContext#set_result(java.lang.String)}.
-     * @throws Exception
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "indirectly tested invoking function",
-        method = "set_result",
-        args = {java.lang.String.class}
-    )
     public void testSet_resultString() throws Exception {
         TestFCString testString = new TestFCString();
         db.exec("insert into " + DatabaseCreator.TEST_TABLE2
@@ -83,16 +54,6 @@
         assertEquals("TestInput", val);
     }
 
-    /**
-     * Test method for {@link SQLite.FunctionContext#set_result(int)}.
-     * @throws Exception
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "method test",
-        method = "set_result",
-        args = {int.class}
-    )
     public void testSet_resultInt() throws Exception {
         TestFCInt testInt = new TestFCInt();
         db.exec("insert into " + DatabaseCreator.SIMPLE_TABLE1
@@ -106,16 +67,6 @@
         assertEquals(testInt.intVal, Integer.parseInt(val));
     }
 
-    /**
-     * Test method for {@link SQLite.FunctionContext#set_result(double)}.
-     * @throws Exception
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "indirectly tested",
-        method = "set_result",
-        args = {double.class}
-    )
     public void testSet_resultDouble() throws Exception {
         SinFunc testD = new SinFunc();
         db.exec("insert into " + DatabaseCreator.TEST_TABLE2
@@ -131,16 +82,6 @@
         assertTrue(testD.functionCalled);
     }
 
-    /**
-     * Test method for {@link SQLite.FunctionContext#set_error(java.lang.String)}.
-     * @throws Exception
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "set_error",
-        args = {java.lang.String.class}
-    )
     public void testSet_error() throws Exception {
         TestFCError testError = new TestFCError();
         SinFunc testD = new SinFunc();
@@ -159,17 +100,6 @@
         assertFalse(testD.functionCalled);
     }
 
-    /**
-     * Test method for {@link SQLite.FunctionContext#set_result(byte[])}.
-     * @throws Exception
-     * @throws UnsupportedEncodingException
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "set_result",
-        args = {byte[].class}
-    )
     public void testSet_resultByteArray() throws Exception, UnsupportedEncodingException {
         Stmt st = null;
         TestFCByteArray testBinArrayFnc = new TestFCByteArray();
@@ -203,17 +133,8 @@
     }
 
     /**
-     * Test method for {@link SQLite.FunctionContext#set_result_zeroblob(int)}.
-     * @throws Exception
-     * @throws UnsupportedEncodingException
+     * ZeroBlob not supported
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "set_result_zeroblob",
-        args = {int.class}
-    )
-    @KnownFailure("ZeroBlob not supported")
     public void testSet_result_zeroblob() throws Exception,
             UnsupportedEncodingException {
         Stmt st = null;
@@ -251,17 +172,8 @@
     }
 
     /**
-     * Test method for {@link SQLite.FunctionContext#count()}.
-     * @throws SQLException
-     * @throws Exception
+     * Test Method results in a segmentation fault
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "count",
-        args = {}
-    )
-    @AndroidOnly("Test Method results in a segmentation fault.")
     public void testCount() throws SQLException, Exception {
         TestFCCount countTest = new TestFCCount();
         int inputCount = 10;
@@ -293,15 +205,8 @@
             fc.set_error(errorMsg);
         }
 
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
     }
 
     class TestFCCount implements Function {
@@ -314,15 +219,8 @@
             fc.set_result(noOfRows);
         }
 
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
     }
 
     class TestFCZeroBlob implements Function {
@@ -334,15 +232,8 @@
             fc.set_result_zeroblob(numBytes);
         }
 
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
     }
 
     class TestFCString implements Function {
@@ -355,15 +246,8 @@
             fc.set_result(args[0]);
         }
 
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
     }
 
     class TestFCInt implements Function {
@@ -376,15 +260,8 @@
             fc.set_result(Integer.parseInt(args[0]));
         }
 
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
     }
 
     class TestFCByteArray implements Function {
@@ -397,19 +274,11 @@
             fc.set_result(args[0].getBytes());
         }
 
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
     }
 
-        class SinFunc implements Function {
-
+    class SinFunc implements Function {
         public Double testDouble = 3.0;
         public boolean functionCalled = false;
 
@@ -419,15 +288,8 @@
             fc.set_result(d.doubleValue());
         }
 
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
+        public void last_step(FunctionContext fc) {}
+        public void step(FunctionContext fc, String[] args) {}
     }
 
     static final byte[] HEX_CHAR_TABLE = {
@@ -437,7 +299,7 @@
             (byte)'c', (byte)'d', (byte)'e', (byte)'f'
           };
 
-     public static String getHexString(byte[] raw)
+    public static String getHexString(byte[] raw)
             throws UnsupportedEncodingException {
         byte[] hex = new byte[2 * raw.length];
         int index = 0;
@@ -449,5 +311,4 @@
         }
         return new String(hex, "ASCII");
     }
-
 }
diff --git a/luni/src/test/java/libcore/sqlite/OldJDBCDriverFunctionalTest.java b/luni/src/test/java/libcore/sqlite/OldJDBCDriverFunctionalTest.java
new file mode 100644
index 0000000..48eeab1
--- /dev/null
+++ b/luni/src/test/java/libcore/sqlite/OldJDBCDriverFunctionalTest.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2007 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.sqlite;
+
+import java.io.File;
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+/**
+ * Tests the SQLite.JDBCDriver.
+ */
+public class OldJDBCDriverFunctionalTest extends AbstractSqlTest {
+    private  File dbFile = null;
+    private String connectionURL = "empty";
+
+    @Override protected void tearDown() throws SQLException {
+        super.tearDown();
+        dbFile.delete();
+    }
+
+    @Override protected String getConnectionURL() {
+        if (connectionURL.equals("empty")) {
+            String tmp = System.getProperty("java.io.tmpdir");
+            File tmpDir = new File(tmp);
+            if (tmpDir.isDirectory()) {
+                try {
+                    dbFile = File.createTempFile("JDBCDriverFunctionalTest", ".db", tmpDir);
+                } catch (IOException e) {
+                    System.err.println("error creating temporary DB file.");
+                }
+                dbFile.deleteOnExit();
+            } else {
+                System.err.println("java.io.tmpdir does not exist");
+            }
+
+            connectionURL = "jdbc:sqlite:/" + dbFile.getPath();
+        }
+
+        return connectionURL;
+    }
+
+    @Override protected String getDriverClassName() {
+        return "SQLite.JDBCDriver";
+    }
+
+    @Override protected int getTransactionIsolation() {
+        return Connection.TRANSACTION_SERIALIZABLE;
+    }
+}
diff --git a/luni/src/test/java/libcore/sqlite/OldJDBCDriverTest.java b/luni/src/test/java/libcore/sqlite/OldJDBCDriverTest.java
new file mode 100644
index 0000000..ae06dc6
--- /dev/null
+++ b/luni/src/test/java/libcore/sqlite/OldJDBCDriverTest.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.sqlite;
+
+import SQLite.JDBCDriver;
+import java.sql.Connection;
+import java.sql.Driver;
+import java.sql.DriverManager;
+import java.sql.DriverPropertyInfo;
+import java.sql.SQLException;
+
+
+public final class OldJDBCDriverTest extends OldJDBCDriverFunctionalTest {
+
+    /**
+     * The SQLite db file.
+     */
+    private JDBCDriver jDriver;
+
+    private Driver returnedDriver;
+
+    @Override public void setUp() throws java.lang.Exception {
+        super.setUp();
+        returnedDriver = DriverManager.getDriver(getConnectionURL());
+        if (returnedDriver instanceof JDBCDriver) {
+            this.jDriver = (JDBCDriver) returnedDriver;
+        }
+    }
+
+    public void testJDBCDriver() {
+        assertTrue(returnedDriver instanceof JDBCDriver);
+    }
+
+    public void testAcceptsURL() {
+        try {
+            if (this.jDriver != null) {
+                assertTrue(jDriver.acceptsURL(getConnectionURL()));
+            } else {
+                fail("no Driver available");
+            }
+        } catch (SQLException e) {
+            fail("Driver does not accept URL");
+            e.printStackTrace();
+        }
+    }
+
+    public void testConnect() {
+        try {
+            if (this.jDriver != null) {
+                Connection c = jDriver.connect(getConnectionURL(), null);
+                assertFalse(c.isClosed());
+                DriverManager.getConnection(getConnectionURL());
+            } else {
+                fail("no Driver available");
+            }
+        } catch (SQLException e) {
+            fail("Driver does not connect");
+            e.printStackTrace();
+        }
+    }
+
+    public void testGetMajorVersion() {
+        if (this.jDriver != null) {
+            assertTrue(jDriver.getMajorVersion() > 0);
+        } else {
+            fail("no Driver available");
+        }
+    }
+
+   public void testGetMinorVersion() {
+        if (this.jDriver != null) {
+            assertTrue(jDriver.getMinorVersion() > 0);
+        } else {
+            fail("no version information available");
+        }
+    }
+
+   public void testGetPropertyInfo() throws SQLException {
+        DriverPropertyInfo[] info = null;
+       if (this.jDriver != null) {
+           info = jDriver.getPropertyInfo(getConnectionURL(), null);
+           assertNotNull(info);
+           assertTrue(info.length > 0);
+       } else {
+           fail("no Driver available");
+       }
+
+        assertNotNull(info);
+
+    }
+
+    public void testJdbcCompliant() {
+        if (this.jDriver != null) {
+            assertFalse(jDriver.jdbcCompliant());
+        } else {
+            fail("no version information available");
+        }
+    }
+}
diff --git a/luni/src/test/java/tests/SQLite/SQLiteTest.java b/luni/src/test/java/libcore/sqlite/OldSQLiteTest.java
similarity index 64%
rename from luni/src/test/java/tests/SQLite/SQLiteTest.java
rename to luni/src/test/java/libcore/sqlite/OldSQLiteTest.java
index 7b64173..e6b7f22 100644
--- a/luni/src/test/java/tests/SQLite/SQLiteTest.java
+++ b/luni/src/test/java/libcore/sqlite/OldSQLiteTest.java
@@ -14,22 +14,22 @@
  * limitations under the License.
  */
 
-package tests.SQLite;
-
-import junit.framework.TestCase;
+package libcore.sqlite;
 
 import java.io.File;
 import java.io.IOException;
 import java.sql.Connection;
 import java.sql.DriverManager;
-import java.sql.SQLException;
 import java.util.logging.Logger;
+import junit.framework.TestCase;
 
-public class SQLiteTest extends TestCase {
+public abstract class OldSQLiteTest extends TestCase {
+
     public static Connection conn;
+
     public static File dbFile = null;
 
-    public void setUp() throws Exception {
+    @Override public void setUp() throws Exception {
         String tmp = System.getProperty("java.io.tmpdir");
         File tmpDir = new File(tmp);
         try {
@@ -43,32 +43,20 @@
             Class.forName("SQLite.JDBCDriver").newInstance();
 
             if (!dbFile.exists()) {
-              Logger.global.severe("DB file could not be created. Tests can not be executed.");
+                Logger.global.severe("DB file could not be created. Tests can not be executed.");
             } else {
-            conn = DriverManager.getConnection("jdbc:sqlite:/"
-                    + dbFile.getPath());
+                conn = DriverManager.getConnection("jdbc:sqlite:/" + dbFile.getPath());
             }
-            assertNotNull("Error creating connection",conn);
+            assertNotNull("Error creating connection", conn);
         } catch (IOException e) {
             System.out.println("Problem creating test file in " + tmp);
-        } catch (SQLException e) {
-            // TODO Auto-generated catch block
-            fail("Exception: " + e.toString());
-        } catch (java.lang.Exception e) {
-            fail("Exception: " + e.toString());
         }
-
     }
 
-    public void tearDown() {
-        try {
-            if (!conn.isClosed()) {
-                conn.close();
-            }
-        } catch (SQLException e) {
-            fail("Couldn't close Connection: " + e.getMessage());
+    @Override public void tearDown() throws java.lang.Exception {
+        if (!conn.isClosed()) {
+            conn.close();
         }
-
+        super.tearDown();
     }
-
 }
diff --git a/luni/src/test/java/libcore/sqlite/OldStmtTest.java b/luni/src/test/java/libcore/sqlite/OldStmtTest.java
new file mode 100644
index 0000000..88ade34
--- /dev/null
+++ b/luni/src/test/java/libcore/sqlite/OldStmtTest.java
@@ -0,0 +1,856 @@
+/*
+ * Copyright (C) 2008 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package libcore.sqlite;
+
+import SQLite.Constants;
+import SQLite.Database;
+import SQLite.Exception;
+import SQLite.Stmt;
+import SQLite.TableResult;
+import java.sql.Connection;
+import tests.support.DatabaseCreator;
+import tests.support.Support_SQL;
+
+public class OldStmtTest extends OldSQLiteTest {
+
+    private static Database db = null;
+    private static Stmt st = null;
+
+    private static final String createAllTypes = "create table type (" +
+
+    " BoolVal BOOLEAN," + " IntVal INT," + " LongVal LONG,"
+            + " Bint BIGINT," + " Tint TINYINT," + " Sint SMALLINT,"
+            + " Mint MEDIUMINT, " +
+
+            " IntegerVal INTEGER, " + " RealVal REAL, "
+            + " DoubleVal DOUBLE, " + " FloatVal FLOAT, "
+            + " DecVal DECIMAL, " +
+
+            " NumVal NUMERIC, " + " charStr CHAR(20), "
+            + " dateVal DATE, " + " timeVal TIME, " + " TS TIMESTAMP, "
+            +
+
+            " DT DATETIME, " + " TBlob TINYBLOB, " + " BlobVal BLOB, "
+            + " MBlob MEDIUMBLOB, " + " LBlob LONGBLOB, " +
+
+            " TText TINYTEXT, " + " TextVal TEXT, "
+            + " MText MEDIUMTEXT, " + " LText LONGTEXT, " +
+
+            " MaxLongVal BIGINT, MinLongVal BIGINT, "+
+
+            " validURL URL, invalidURL URL "+
+
+            ");";
+
+    static final String insertAllTypes =
+        "insert into type (BoolVal, IntVal, LongVal, Bint, Tint, Sint, Mint,"
+        + "IntegerVal, RealVal, DoubleVal, FloatVal, DecVal,"
+        + "NumVal, charStr, dateVal, timeVal, TS,"
+        + "DT, TBlob, BlobVal, MBlob, LBlob,"
+        + "TText, TextVal, MText, LText, MaxLongVal, MinLongVal,"
+        + " validURL, invalidURL"
+        + ") "
+        + "values (1, -1, 22, 2, 33,"
+        + "3, 1, 2, 3.9, 23.2, 33.3, 44,"
+        + "5, 'test string', '1799-05-26', '12:35:45', '2007-10-09 14:28:02.0',"
+        + "'1221-09-22 10:11:55', 1, 2, 3, 4,"
+        + "'Test text message tiny', 'Test text',"
+        + " 'Test text message medium', 'Test text message long', "
+        + Long.MAX_VALUE+", "+Long.MIN_VALUE+", "
+        + "null, null "+
+        ");";
+
+    static final String allTypesTable = "type";
+
+    @Override public void setUp() throws java.lang.Exception {
+        super.setUp();
+        Support_SQL.loadDriver();
+        db = new Database();
+        db.open(dbFile.getPath(), 0);
+        db.exec(DatabaseCreator.CREATE_TABLE_SIMPLE1, null);
+        DatabaseCreator.fillSimpleTable1(conn);
+
+    }
+
+    @Override public void tearDown() throws java.lang.Exception {
+        if (st != null) {
+            try {
+                st.close();
+            } catch (Exception e) {
+            }
+        }
+        db.close();
+        Connection con = Support_SQL.getConnection();
+        con.close();
+        super.tearDown();
+    }
+
+    public void testStmt() throws Exception {
+        Stmt st = new Stmt();
+        assertNotNull(st);
+        Stmt actual = db.prepare("");
+        assertNotNull(st);
+
+        try {
+            st.step();
+            fail("Cannot execute non prepared Stmt");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testPrepare() throws Exception {
+        try {
+            st = db.prepare("");
+            st.prepare();
+            fail("statement is closed");
+        } catch (Exception e) {
+            assertEquals("stmt already closed", e.getMessage());
+        }
+
+        st = new Stmt();
+        st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
+        assertFalse(st.prepare());
+        st = new Stmt();
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (:one,:two,:three)");
+        assertFalse(st.prepare());
+        st = new Stmt();
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (:one,:two,:three)");
+        st.bind(1, 1);
+        st.bind(2, 10);
+        st.bind(3, 30);
+        assertFalse(st.prepare());
+        st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1
+                + "; " + "delete from " + DatabaseCreator.SIMPLE_TABLE1
+                + " where id = 5; " + "insert into "
+                + DatabaseCreator.SIMPLE_TABLE1 + " values(5, 10, 20); "
+                + "select * from " + DatabaseCreator.SIMPLE_TABLE1 + ";");
+        assertTrue(st.prepare());
+        assertTrue(st.prepare());
+        assertTrue(st.prepare());
+        assertFalse(st.prepare());
+    }
+
+    public void testStep() throws Exception {
+        try {
+            st.step();
+            fail("Exception expected");
+        } catch (Exception e) {
+            assertEquals("stmt already closed", e.getMessage());
+        }
+
+        st = new Stmt();
+        st = db.prepare("select name from sqlite_master where type = 'table'");
+        st.step();
+    }
+
+    public void testClose() throws Exception {
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (:one,:two,:three)");
+        st.close();
+
+        try {
+            st.step();
+            fail("Test fails");
+        } catch (Exception e) {
+            assertEquals("stmt already closed", e.getMessage());
+        }
+    }
+
+    public void testReset() throws Exception {
+        db.exec("create table TEST (res integer not null)", null);
+
+        st = db.prepare("insert into TEST values (:one);");
+        st.bind(1, 1);
+        st.step();
+
+        // verify that parameter is still bound
+        st.reset();
+        assertEquals(1,st.bind_parameter_count());
+        st.step();
+
+        TableResult count = db.get_table("select count(*) from TEST where res=1", null);
+
+        String[] row0 = (String[]) count.rows.elementAt(0);
+        assertEquals(2, Integer.parseInt(row0[0]));
+    }
+
+    public void testClear_bindings() {
+        try {
+            st.clear_bindings();
+        } catch (Exception e) {
+            assertEquals("unsupported", e.getMessage());
+        }
+    }
+
+    public void testBindIntInt() throws Exception {
+        int input = 0;
+        int maxVal = Integer.MAX_VALUE;
+        int minVal = Integer.MIN_VALUE;
+
+        db.exec("create table TEST (res integer)", null);
+        st = db.prepare("insert into TEST values (:one);");
+        st.bind(1, input);
+        st.step();
+
+        st.reset();
+        st.bind(1,maxVal);
+        st.step();
+
+        st.reset();
+        st.bind(1,minVal);
+        st.step();
+
+        TableResult r = db.get_table("select * from TEST");
+
+        String[] row0 = (String[]) r.rows.elementAt(0);
+        assertEquals(input,Integer.parseInt(row0[0]));
+
+        String[] row1 = (String[]) r.rows.elementAt(1);
+        assertEquals(maxVal,Integer.parseInt(row1[0]));
+
+        String[] row2 = (String[]) r.rows.elementAt(2);
+        assertEquals(minVal,Integer.parseInt(row2[0]));
+
+        try {
+            st.close();
+            st.bind(1,Integer.MIN_VALUE);
+            fail("Exception expected");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testBindIntLong() throws Exception {
+        long input = 0;
+        long maxVal = Long.MAX_VALUE;
+        long minVal = Long.MIN_VALUE;
+
+        db.exec("create table TEST (res long)", null);
+        st = db.prepare("insert into TEST values (:one);");
+        st.bind(1, input);
+        st.step();
+
+        st.reset();
+        st.bind(1,maxVal);
+        st.step();
+
+        st.reset();
+        st.bind(1,minVal);
+        st.step();
+
+        TableResult r = db.get_table("select * from TEST");
+
+        String[] row0 = (String[]) r.rows.elementAt(0);
+        assertEquals(input,Long.parseLong(row0[0]));
+
+        String[] row1 = (String[]) r.rows.elementAt(1);
+        assertEquals(maxVal,Long.parseLong(row1[0]));
+
+        String[] row2 = (String[]) r.rows.elementAt(2);
+        assertEquals(minVal,Long.parseLong(row2[0]));
+
+        try {
+            st.close();
+            st.bind(1,Long.MIN_VALUE);
+            fail("Exception expected");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testBindIntDouble() throws Exception {
+        double input = 0.0;
+        double maxVal = Double.MAX_VALUE;
+        double minVal = Double.MIN_VALUE;
+        double negInf = Double.NEGATIVE_INFINITY;
+        double posInf = Double.POSITIVE_INFINITY;
+        double nan = Double.NaN;
+
+        db.exec("create table TEST (res double)", null);
+        st = db.prepare("insert into TEST values (:one);");
+        st.bind(1, input);
+        st.step();
+
+        st.reset();
+        st.bind(1, maxVal);
+        st.step();
+
+        st.reset();
+        st.bind(1, minVal);
+        st.step();
+
+        st.reset();
+        st.bind(1, negInf);
+        st.step();
+
+        st.reset();
+        st.bind(1, posInf);
+        st.step();
+
+        st.reset();
+        st.bind(1, nan);
+        st.step();
+
+
+        TableResult r = db.get_table("select * from TEST");
+
+        String[] row0 = (String[]) r.rows.elementAt(0);
+        assertTrue(Double.compare(input, Double.parseDouble(row0[0])) == 0);
+
+        String[] row1 = (String[]) r.rows.elementAt(1);
+        assertFalse(Double.compare(maxVal, Double.parseDouble(row1[0])) == 0);
+        assertTrue(Double.compare(maxVal, Double.parseDouble(row1[0])) < 0);
+        assertTrue(Double.isInfinite(Double.parseDouble(row1[0])));
+
+        String[] row2 = (String[]) r.rows.elementAt(2);
+        assertTrue(Double.compare(minVal, Double.parseDouble(row2[0])) == 0);
+
+        String[] row3 = (String[]) r.rows.elementAt(3);
+        assertEquals("Double.NEGATIVE_INFINITY SQLite representation",
+                "-Inf", row3[0]);
+
+        String[] row4 = (String[]) r.rows.elementAt(4);
+        assertEquals("Double.POSITIVE_INFINITY SQLite representation",
+                "Inf", row4[0]);
+
+        String[] row5 = (String[]) r.rows.elementAt(4);
+        assertEquals("Double.Nan SQLite representation", "Inf", row5[0]);
+
+        try {
+            st.close();
+            st.bind(1,0.0);
+            fail("Exception expected");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testBindIntByteArray() throws Exception {
+        String name = "Hello World";
+        byte[] b = name.getBytes();
+        String stringInHex = "";
+
+        db.exec(DatabaseCreator.CREATE_TABLE_PARENT, null);
+        st = db.prepare("insert into " + DatabaseCreator.PARENT_TABLE
+                + " values (:one, :two);");
+        st.bind(1, 2);
+        st.bind(2, b);
+        st.step();
+
+        //compare what was stored with input based on Hex representation
+        // since type of column is CHAR
+        TableResult r = db.get_table("select * from "
+                + DatabaseCreator.PARENT_TABLE);
+        String[] row = (String[]) r.rows.elementAt(0);
+
+        for (byte aByte : b) {
+            stringInHex += Integer.toHexString(aByte);
+        }
+        stringInHex = "X'" + stringInHex + "'";
+        assertTrue(stringInHex.equalsIgnoreCase(row[1]));
+
+        try {
+            st.close();
+            st.bind(1,name.getBytes());
+            fail("Exception expected");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testBindIntString() throws Exception {
+        String name = "Hello World";
+        db.exec(DatabaseCreator.CREATE_TABLE_PARENT, null);
+        st = db.prepare("insert into " + DatabaseCreator.PARENT_TABLE
+                + " values (:one, :two);");
+        st.bind(1, 2);
+        st.bind(2, name);
+        st.step();
+
+        TableResult r = db.get_table("select * from "
+                + DatabaseCreator.PARENT_TABLE);
+        String[] row = (String[]) r.rows.elementAt(0);
+        assertEquals(name,row[1]);
+
+        try {
+            st.close();
+            st.bind(1,name);
+            fail("Exception expected");
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testBindInt() throws Exception {
+        try {
+            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                    + " values (:one,:two,:three)");
+            st.bind(4);
+            st.bind(1, 4);
+            st.bind(2, 10);
+            st.bind(3, 30);
+            st.step();
+            fail("Test failes");
+        } catch (Exception e) {
+            // What happens if null is bound to non existing variable position
+            assertEquals("parameter position out of bounds" , e.getMessage());
+        }
+
+        // functional tests
+
+        try {
+            st.reset();
+            st.bind(1);
+            st.bind(2, 10);
+            st.bind(3, 30);
+            st.step();
+            fail("Test failes");
+        } catch (Exception e) {
+            // What happens if null is bound to NON NULL field
+            assertEquals("SQL logic error or missing database", e.getMessage());
+        }
+
+        st.reset();
+        st.bind(1, 3);
+        st.bind(2);
+        st.bind(3, 30);
+        st.step();
+    }
+
+    public void testBind_zeroblob() {
+        try {
+            st.bind_zeroblob(1, 128);
+        } catch (Exception e) {
+            assertEquals("unsupported", e.getMessage());
+        }
+    }
+
+    public void testBind_parameter_count() throws Exception {
+        try {
+            st.bind_parameter_count();
+        } catch (Exception e) {
+            assertEquals("stmt already closed", e.getMessage());
+        }
+
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (:one,:two,:three)");
+        assertEquals(3, st.bind_parameter_count());
+
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (?, ?, ?)");
+        assertEquals(3, st.bind_parameter_count());
+
+        st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
+        assertEquals(0, st.bind_parameter_count());
+
+        try {
+            st.close();
+            st.bind_parameter_count();
+            fail("Exception expected");
+        } catch (Exception e) {
+            //ok
+        }
+
+    }
+
+    public void testBind_parameter_name() {
+        try {
+            st.bind_parameter_name(1);
+            fail("Exception expected");
+        } catch (Exception e) {
+            assertEquals("stmt already closed", e.getMessage());
+        }
+
+        try {
+            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                    + " values (:one,:two,:three)");
+            assertEquals(":one", st.bind_parameter_name(1));
+            assertEquals(":two", st.bind_parameter_name(2));
+            assertEquals(":three", st.bind_parameter_name(3));
+            st.bind_parameter_name(4);
+            fail();
+        } catch (Exception e) {
+            assertEquals("parameter position out of bounds",e.getMessage());
+        }
+    }
+
+    public void testBind_parameter_index() throws Exception {
+        try {
+            st.bind_parameter_index("");
+            fail("Exception expected");
+        } catch (Exception e) {
+            assertEquals("stmt already closed", e.getMessage());
+        }
+
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (:one,:two,:three)");
+        assertEquals(3, st.bind_parameter_index(":three"));
+
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (:one,:two,:three)");
+        assertEquals(0, st.bind_parameter_index(":t"));
+
+        st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                + " values (?, ?, ?)");
+        assertEquals(0, st.bind_parameter_index("?"));
+    }
+
+    public void testColumn_int() throws Exception {
+        db.exec(createAllTypes, null);
+        db.exec(insertAllTypes, null);
+
+        int columnObjectCastFromLong;
+        Object columnObject  = null;
+        int intColumn = 0;
+        String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
+
+        st = db.prepare(selectStmt);
+        st.step();
+        // select 'speed' value
+        columnObject = st.column(1);
+        intColumn = st.column_int(1);
+        assertNotNull(intColumn);
+
+        assertTrue("Integer".equalsIgnoreCase(st.column_decltype(1)));
+        int stSpeed = Integer.parseInt(columnObject.toString());
+        assertNotNull(stSpeed);
+        assertEquals( intColumn, stSpeed);
+        assertEquals(10,stSpeed);
+
+        selectStmt = "select TextVal from "+allTypesTable;
+
+        st = db.prepare(selectStmt);
+        st.step();
+        // select double value
+        try {
+            st.column_int(0);
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testColumn_long() throws Exception {
+        Object columnObject  = null;
+        int columnObjectCastFromLong;
+        long longColumn = 0;
+        String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
+        st = db.prepare(selectStmt);
+        st.step();
+        columnObject = st.column(1);
+        longColumn = st.column_long(1);
+        assertNotNull(longColumn);
+        // column declared as integer
+        assertTrue("Integer".equalsIgnoreCase(st.column_decltype(1)));
+        int stSpeed = Integer.parseInt(columnObject.toString());
+        assertNotNull(stSpeed);
+        assertEquals( longColumn, stSpeed);
+
+        try {
+            st.column_long(4);
+            fail("Exception expected");
+        } catch (Exception e) {
+            assertEquals( "column out of bounds" , e.getMessage());
+        }
+
+        try {
+            st.column_long(-1);
+            fail("Exception expected");
+        } catch (Exception e) {
+            assertEquals( "column out of bounds" , e.getMessage());
+        }
+    }
+
+    public void testColumn_double() throws Exception {
+        db.exec(createAllTypes, null);
+        db.exec(insertAllTypes, null);
+
+        Object columnObject  = null;
+        double doubleColumn = 0;
+        double actualVal = 23.2;
+        String selectStmt = "select DoubleVal from "+allTypesTable;
+
+        st = db.prepare(selectStmt);
+        st.step();
+        // select double value
+        doubleColumn = st.column_double(0);
+        assertNotNull(doubleColumn);
+
+        assertTrue("DOUBLE".equalsIgnoreCase(st.column_decltype(0)));
+        assertNotNull(doubleColumn);
+        assertEquals( actualVal, doubleColumn);
+
+        // Exception test
+        selectStmt = "select dateVal from "+allTypesTable;
+
+        st = db.prepare(selectStmt);
+        st.step();
+        // select double value
+        try {
+            st.column_double(0);
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testColumn_bytes() throws Exception {
+        db.exec("create table B(id integer primary key, val blob)",null);
+        db.exec("insert into B values(1, zeroblob(128))", null);
+        st = db.prepare("select val from B where id = 1");
+        assertTrue(st.step());
+        try {
+            st.column_bytes(0);
+        } catch (Exception e) {
+            assertEquals("unsupported", e.getMessage());
+        }
+    }
+
+    public void testColumn_string() throws Exception {
+        db.exec(createAllTypes, null);
+        db.exec(insertAllTypes, null);
+
+        Object columnObject  = null;
+        String stringColumn = "";
+        String actualVal = "test string";
+        String selectStmt = "select charStr from "+allTypesTable;
+
+        st = db.prepare(selectStmt);
+        st.step();
+        // select string value
+        stringColumn = st.column_string(0);
+        assertNotNull(stringColumn);
+
+        assertTrue("CHAR(20)".equalsIgnoreCase(st.column_decltype(0)));
+        assertNotNull(stringColumn);
+        assertEquals( actualVal, stringColumn);
+
+        // Exception test
+        selectStmt = "select DoubleVal from "+allTypesTable;
+
+        st = db.prepare(selectStmt);
+        st.step();
+        // select double value
+        try {
+            st.column_string(0);
+        } catch (Exception e) {
+            //ok
+        }
+    }
+
+    public void testColumn_type() throws Exception {
+        db.exec(createAllTypes, null);
+        db.exec(insertAllTypes, null);
+        st = db.prepare("select * from " + allTypesTable);
+        st.step();
+
+        // Exception test
+        try {
+            st.column_type(100);
+        } catch (Exception e) {
+            // ok
+        }
+
+        /*
+        Dictionary
+
+        public static final int SQLITE_INTEGER = 1;
+        public static final int SQLITE_FLOAT = 2;
+        public static final int SQLITE_BLOB = 4;
+        public static final int SQLITE_NULL = 5;
+        public static final int SQLITE3_TEXT = 3;
+        public static final int SQLITE_NUMERIC = -1;
+        */
+
+        assertEquals(Constants.SQLITE3_TEXT, st.column_type(23)); // ok TEXT
+        assertEquals(Constants.SQLITE3_TEXT, st.column_type(13)); // CHAR(20)
+
+        assertEquals(Constants.SQLITE_FLOAT, st.column_type(8));
+        assertEquals(Constants.SQLITE_FLOAT, st.column_type(9));
+        assertEquals(Constants.SQLITE_FLOAT, st.column_type(10)); // FLOAT
+
+        for (int i = 0; i < 8; i++) {
+            assertEquals("Expected Integer at position " + i,
+                    Constants.SQLITE_INTEGER, st.column_type(i));
+        }
+
+        assertEquals(Constants.SQLITE_NULL, st.column_type(28));
+        assertEquals(Constants.SQLITE_NULL, st.column_type(29));
+
+        // Failing tests
+        assertTrue("INTEGER".equalsIgnoreCase(st.column_decltype(12)));
+        assertEquals(Constants.SQLITE_INTEGER, st.column_type(12));
+
+        assertTrue("FLOAT".equalsIgnoreCase(st.column_decltype(11)));
+        assertEquals(Constants.SQLITE_FLOAT, st.column_type(11)); // FLOAT ->
+                                                                  // got INTEGER
+        assertTrue("BLOB".equalsIgnoreCase(st.column_decltype(19)));
+        assertEquals(Constants.SQLITE_BLOB, st.column_type(19)); // Blob got
+                                                                 // INTEGER
+
+    }
+
+    /**
+     * Wrong value is returned in case of a prepared statement to which a '*' bound
+     */
+    public void testColumn_count() throws Exception {
+        String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
+        st = db.prepare(selectStmt);
+
+        assertEquals(3, st.column_count());
+
+        st.step();
+        int columnCount = st.column_count();
+        assertNotNull(columnCount);
+        assertEquals( 3, columnCount);
+
+        // actual prepared statement
+        selectStmt = "select ? from "+DatabaseCreator.SIMPLE_TABLE1;
+        st = db.prepare(selectStmt);
+
+        assertEquals(3, st.column_count());
+
+        st.bind(1, "*");
+        st.step();
+        columnCount = st.column_count();
+        assertNotNull(columnCount);
+        assertEquals( 3, columnCount);
+    }
+
+    public void testColumn() throws Exception {
+        Object columnObject  = null;
+        int columnObjectCastFromLong;
+        int intColumn = 0;
+        String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
+        TableResult res = db.get_table(selectStmt);
+        st = db.prepare(selectStmt);
+        st.step();
+        columnObject = st.column(1);
+        intColumn = st.column_int(1);
+        assertNotNull(intColumn);
+        assertTrue("Integer".equalsIgnoreCase(st.column_decltype(1)));
+        int stSpeed = Integer.parseInt(columnObject.toString());
+        assertNotNull(stSpeed);
+        assertEquals( intColumn, stSpeed);
+
+        try {
+            assertNotNull(columnObject);
+            int dummy = ((Integer) columnObject).intValue();
+            fail("Cast to Integer should fail");
+        } catch (ClassCastException e) {
+        }
+
+        try {
+            st.column(4);
+            fail("Exception expected");
+        } catch (Exception e) {
+            assertEquals( "column out of bounds" , e.getMessage());
+        }
+
+        try {
+            st.column(-1);
+            fail("Exception expected");
+        } catch (Exception e) {
+            assertEquals( "column out of bounds" , e.getMessage());
+        }
+    }
+
+    public void testColumn_table_name() {
+        try {
+            st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
+            st.column_table_name(1);
+            fail("Function is now supported.");
+        } catch (Exception e) {
+            assertEquals("unsupported", e.getMessage());
+        }
+    }
+
+    public void testColumn_database_name() {
+        try {
+            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
+                    + " values (:one,:two,:three)");
+            st.column_database_name(1);
+            fail("Function is now supported.");
+        } catch (Exception e) {
+            assertEquals("unsupported", e.getMessage());
+        }
+    }
+
+    public void testColumn_decltype() throws Exception {
+        db.exec(createAllTypes, null);
+        db.exec(insertAllTypes, null);
+        st = db.prepare("select * from " + allTypesTable);
+        st.step();
+
+        // Exception test
+        try {
+            st.column_decltype(100);
+        } catch (Exception e) {
+            // ok
+        }
+
+        assertTrue(st.column_decltype(0), "BOOLEAN".equalsIgnoreCase(st
+                .column_decltype(0)));
+        assertTrue(st.column_decltype(1), "INT".equalsIgnoreCase(st
+                .column_decltype(1)));
+        assertTrue(st.column_decltype(2), "LONG".equalsIgnoreCase(st
+                .column_decltype(2)));
+        assertTrue(st.column_decltype(3), "BIGINT".equalsIgnoreCase(st
+                .column_decltype(3)));
+        assertTrue(st.column_decltype(4), "TINYINT".equalsIgnoreCase(st
+                .column_decltype(4)));
+        assertTrue(st.column_decltype(5), "SMALLINT".equalsIgnoreCase(st
+                .column_decltype(5)));
+        assertTrue(st.column_decltype(6), "MEDIUMINT".equalsIgnoreCase(st
+                .column_decltype(6)));
+        assertTrue(st.column_decltype(7), "INTEGER".equalsIgnoreCase(st
+                .column_decltype(7)));
+        assertTrue(st.column_decltype(8), "REAL".equalsIgnoreCase(st
+                .column_decltype(8)));
+        assertTrue(st.column_decltype(9), "DOUBLE".equalsIgnoreCase(st
+                .column_decltype(9)));
+        assertTrue(st.column_decltype(10), "FLOAT".equalsIgnoreCase(st
+                .column_decltype(10)));
+        assertTrue(st.column_decltype(11), "DECIMAL".equalsIgnoreCase(st
+                .column_decltype(11)));
+        assertTrue(st.column_decltype(12), "NUMERIC".equalsIgnoreCase(st
+                .column_decltype(12)));
+        assertTrue(st.column_decltype(13), "CHAR(20)".equalsIgnoreCase(st
+                .column_decltype(13)));
+
+        assertTrue(st.column_decltype(19), "BLOB".equalsIgnoreCase(st
+                .column_decltype(19)));
+
+        assertTrue(st.column_decltype(23), "TEXT".equalsIgnoreCase(st
+                .column_decltype(23)));
+        assertTrue(st.column_decltype(28), "URL".equalsIgnoreCase(st
+                .column_decltype(28)));
+        assertTrue(st.column_decltype(29), "URL".equalsIgnoreCase(st
+                .column_decltype(29)));
+    }
+
+    public void testColumn_origin_name() {
+        try {
+            st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
+            st.column_origin_name(1);
+            fail("Function is now supported.");
+        } catch (Exception e) {
+            assertEquals("unsupported", e.getMessage());
+        }
+    }
+}
diff --git a/luni/src/test/java/libcore/util/CollectionUtilsTest.java b/luni/src/test/java/libcore/util/CollectionUtilsTest.java
index 7349752..fc7091b 100644
--- a/luni/src/test/java/libcore/util/CollectionUtilsTest.java
+++ b/luni/src/test/java/libcore/util/CollectionUtilsTest.java
@@ -20,6 +20,7 @@
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import junit.framework.TestCase;
@@ -71,6 +72,31 @@
         return result;
     }
 
+    public void testRemoveDuplicatesOnEmptyCollection() {
+        List<String> list = new ArrayList<String>();
+        CollectionUtils.removeDuplicates(list, String.CASE_INSENSITIVE_ORDER);
+        assertTrue(list.isEmpty());
+    }
+
+    public void testRemoveDuplicatesOnSingletonCollection() {
+        List<String> list = Arrays.asList("A");
+        CollectionUtils.removeDuplicates(list, String.CASE_INSENSITIVE_ORDER);
+        assertEquals(Collections.singletonList("A"), list);
+    }
+
+    public void testRemoveDuplicates() {
+        List<String> list = new ArrayList<String>();
+        list.add("A");
+        list.add("A");
+        list.add("A");
+        list.add("B");
+        list.add("C");
+        list.add("C");
+        list.add("C");
+        CollectionUtils.removeDuplicates(list, String.CASE_INSENSITIVE_ORDER);
+        assertEquals(Arrays.asList("A", "B", "C"), list);
+    }
+
     /**
      * A reference that must be manually cleared.
      */
diff --git a/luni/src/test/java/tests/xml/DeclarationTest.java b/luni/src/test/java/libcore/xml/DeclarationTest.java
similarity index 99%
rename from luni/src/test/java/tests/xml/DeclarationTest.java
rename to luni/src/test/java/libcore/xml/DeclarationTest.java
index 9fc42fe..24cb32c 100644
--- a/luni/src/test/java/tests/xml/DeclarationTest.java
+++ b/luni/src/test/java/libcore/xml/DeclarationTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package tests.xml;
+package libcore.xml;
 
 import dalvik.annotation.KnownFailure;
 import junit.framework.TestCase;
diff --git a/luni/src/test/java/tests/xml/DomTest.java b/luni/src/test/java/libcore/xml/DomTest.java
similarity index 99%
rename from luni/src/test/java/tests/xml/DomTest.java
rename to luni/src/test/java/libcore/xml/DomTest.java
index 3761138..4b97c06 100644
--- a/luni/src/test/java/tests/xml/DomTest.java
+++ b/luni/src/test/java/libcore/xml/DomTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package tests.xml;
+package libcore.xml;
 
 import dalvik.annotation.KnownFailure;
 import java.io.File;
diff --git a/luni/src/test/java/libcore/xml/ExpatPullParserDtdTest.java b/luni/src/test/java/libcore/xml/ExpatPullParserDtdTest.java
deleted file mode 100644
index 5e62310..0000000
--- a/luni/src/test/java/libcore/xml/ExpatPullParserDtdTest.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright (C) 2010 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package libcore.xml;
-
-import org.apache.harmony.xml.ExpatPullParser;
-import org.xmlpull.v1.XmlPullParser;
-
-public class ExpatPullParserDtdTest extends PullParserDtdTest {
-    @Override XmlPullParser newPullParser() {
-        return new ExpatPullParser();
-    }
-}
diff --git a/luni/src/test/java/tests/xml/NodeTest.java b/luni/src/test/java/libcore/xml/NodeTest.java
similarity index 97%
rename from luni/src/test/java/tests/xml/NodeTest.java
rename to luni/src/test/java/libcore/xml/NodeTest.java
index 6bf4d94..7e38673 100644
--- a/luni/src/test/java/tests/xml/NodeTest.java
+++ b/luni/src/test/java/libcore/xml/NodeTest.java
@@ -14,9 +14,8 @@
  * limitations under the License.
  */
 
-package tests.xml;
+package libcore.xml;
 
-import dalvik.annotation.TestTargetClass;
 import junit.framework.TestCase;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -31,7 +30,6 @@
 import java.util.ArrayList;
 import java.util.List;
 
-@TestTargetClass(Node.class)
 public class NodeTest extends TestCase {
 
     /**
diff --git a/luni/src/test/java/tests/xml/NormalizeTest.java b/luni/src/test/java/libcore/xml/NormalizeTest.java
similarity index 99%
rename from luni/src/test/java/tests/xml/NormalizeTest.java
rename to luni/src/test/java/libcore/xml/NormalizeTest.java
index 5d2bb0be..5e539f7 100644
--- a/luni/src/test/java/tests/xml/NormalizeTest.java
+++ b/luni/src/test/java/libcore/xml/NormalizeTest.java
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package tests.xml;
+package libcore.xml;
 
 import dalvik.annotation.KnownFailure;
 import junit.framework.TestCase;
diff --git a/luni/src/test/java/tests/xml/SaxTest.java b/luni/src/test/java/libcore/xml/SaxTest.java
similarity index 64%
rename from luni/src/test/java/tests/xml/SaxTest.java
rename to luni/src/test/java/libcore/xml/SaxTest.java
index dc59b2d..108104d 100644
--- a/luni/src/test/java/tests/xml/SaxTest.java
+++ b/luni/src/test/java/libcore/xml/SaxTest.java
@@ -14,26 +14,27 @@
  * limitations under the License.
  */
 
-package tests.xml;
+package libcore.xml;
 
 import dalvik.annotation.KnownFailure;
+import java.io.StringReader;
+import java.util.Arrays;
+import java.util.List;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
 import org.xml.sax.InputSource;
+import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.helpers.DefaultHandler;
 
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import java.io.StringReader;
-import java.util.Arrays;
-import java.util.List;
-
 /**
  * Initiate and observe a SAX parse session.
  */
-public class SaxTest extends TestCase {
+public final class SaxTest extends TestCase {
 
     public void testNoPrefixesNoNamespaces() throws Exception {
         parse(false, false, "<foo bar=\"baz\"/>", new DefaultHandler() {
@@ -155,6 +156,52 @@
         });
     }
 
+    /**
+     * Test that the external-general-entities feature can be disabled.
+     * http://code.google.com/p/android/issues/detail?id=9493
+     */
+    public void testDisableExternalGeneralEntities() throws Exception {
+        String xml = "<!DOCTYPE foo ["
+                + "  <!ENTITY bar SYSTEM \"/no-such-document.xml\">"
+                + "]>"
+                + "<foo>&bar;</foo>";
+        testDisableExternalEntities("http://xml.org/sax/features/external-general-entities", xml);
+    }
+
+    /**
+     * Test that the external-parameter-entities feature can be disabled.
+     * http://code.google.com/p/android/issues/detail?id=9493
+     */
+    public void testDisableExternalParameterEntities() throws Exception {
+        String xml = "<!DOCTYPE foo ["
+                + "  <!ENTITY % bar SYSTEM \"/no-such-document.xml\">"
+                + "  %bar;"
+                + "]>"
+                + "<foo/>";
+        testDisableExternalEntities("http://xml.org/sax/features/external-parameter-entities", xml);
+    }
+
+    /**
+     * Disables the named feature and then parses the supplied XML. The content
+     * is expected to be equivalent to "<foo/>".
+     */
+    private void testDisableExternalEntities(String feature, String xml) throws Exception {
+        SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
+        XMLReader reader = parser.getXMLReader();
+        reader.setFeature(feature, false);
+        assertFalse(reader.getFeature(feature));
+        reader.setContentHandler(new ThrowingHandler() {
+            @Override public void startElement(
+                    String uri, String localName, String qName, Attributes attributes) {
+                assertEquals("foo", qName);
+            }
+            @Override public void endElement(String uri, String localName, String qName) {
+                assertEquals("foo", qName);
+            }
+        });
+        reader.parse(new InputSource(new StringReader(xml)));
+    }
+
     private void parse(boolean prefixes, boolean namespaces, String xml,
             ContentHandler handler) throws Exception {
         SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
@@ -174,4 +221,56 @@
         assertTrue("Expected one of " + optionsList + " but was " + actual,
                 optionsList.contains(actual));
     }
+
+    /**
+     * This SAX handler throws on everything but startDocument, endDocument,
+     * and setDocumentLocator(). Override the methods that are expected to be
+     * called.
+     */
+    static class ThrowingHandler extends DefaultHandler {
+        @Override public InputSource resolveEntity(String publicId, String systemId) {
+            throw new AssertionFailedError();
+        }
+        @Override public void notationDecl(String name, String publicId, String systemId) {
+            throw new AssertionFailedError();
+        }
+        @Override public void unparsedEntityDecl(
+                String name, String publicId, String systemId, String notationName) {
+            throw new AssertionFailedError();
+        }
+        @Override public void startPrefixMapping(String prefix, String uri) {
+            throw new AssertionFailedError();
+        }
+        @Override public void endPrefixMapping(String prefix) {
+            throw new AssertionFailedError();
+        }
+        @Override public void startElement(
+                String uri, String localName, String qName, Attributes attributes) {
+            throw new AssertionFailedError();
+        }
+        @Override public void endElement(String uri, String localName, String qName) {
+            throw new AssertionFailedError();
+        }
+        @Override public void characters(char[] ch, int start, int length) {
+            throw new AssertionFailedError();
+        }
+        @Override public void ignorableWhitespace(char[] ch, int start, int length) {
+            throw new AssertionFailedError();
+        }
+        @Override public void processingInstruction(String target, String data) {
+            throw new AssertionFailedError();
+        }
+        @Override public void skippedEntity(String name) {
+            throw new AssertionFailedError();
+        }
+        @Override public void warning(SAXParseException e) {
+            throw new AssertionFailedError();
+        }
+        @Override public void error(SAXParseException e) {
+            throw new AssertionFailedError();
+        }
+        @Override public void fatalError(SAXParseException e) {
+            throw new AssertionFailedError();
+        }
+    }
 }
diff --git a/luni/src/test/java/tests/xml/SimpleBuilderTest.java b/luni/src/test/java/libcore/xml/SimpleBuilderTest.java
similarity index 88%
rename from luni/src/test/java/tests/xml/SimpleBuilderTest.java
rename to luni/src/test/java/libcore/xml/SimpleBuilderTest.java
index a6c6a1d..db4d1af 100644
--- a/luni/src/test/java/tests/xml/SimpleBuilderTest.java
+++ b/luni/src/test/java/libcore/xml/SimpleBuilderTest.java
@@ -14,11 +14,8 @@
  * limitations under the License.
  */
 
-package tests.xml;
+package libcore.xml;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import junit.framework.TestCase;
@@ -30,7 +27,6 @@
 import org.w3c.dom.ProcessingInstruction;
 import org.w3c.dom.Text;
 
-@TestTargetClass(DocumentBuilder.class)
 public class SimpleBuilderTest extends TestCase {
 
     private DocumentBuilder builder;
@@ -58,12 +54,6 @@
 
         return result;
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test.",
-        method = "parse",
-        args = {java.io.InputStream.class}
-    )
     public void testGoodFile1() throws Exception {
         Document document = builder.parse(getClass().getResourceAsStream(
                 "/SimpleBuilderTest.xml"));
@@ -117,11 +107,6 @@
         assertEquals(" Fragile!  Handle me with care! ", comment);
     }
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        method = "!todo parse",
-        args = {java.io.InputStream.class}
-    )
     public void testGoodFile2() throws Exception {
         Document document = builder.parse(getClass().getResourceAsStream(
                 "/staffNS.xml"));
diff --git a/luni/src/test/java/tests/xml/SimpleParserTest.java b/luni/src/test/java/libcore/xml/SimpleParserTest.java
similarity index 67%
rename from luni/src/test/java/tests/xml/SimpleParserTest.java
rename to luni/src/test/java/libcore/xml/SimpleParserTest.java
index 663c863..fa49640 100644
--- a/luni/src/test/java/tests/xml/SimpleParserTest.java
+++ b/luni/src/test/java/libcore/xml/SimpleParserTest.java
@@ -14,12 +14,7 @@
  * limitations under the License.
  */
 
-package tests.xml;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
+package libcore.xml;
 
 import junit.framework.TestCase;
 
@@ -39,8 +34,7 @@
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
-@TestTargetClass(SAXParser.class)
-public class SimpleParserTest extends TestCase implements ContentHandler {
+public class SimpleParserTest extends TestCase {
 
     private SAXParser parser;
 
@@ -64,7 +58,7 @@
         factory.setNamespaceAware(true);
 
         parser = factory.newSAXParser();
-        parser.getXMLReader().setContentHandler(this);
+        parser.getXMLReader().setContentHandler(contentHandler);
 
         instructions = new StringBuffer();
         namespaces1 = new HashMap<String, String>();
@@ -89,96 +83,74 @@
         text = null;
     }
 
-    public void characters(char[] ch, int start, int length) {
+    private final ContentHandler contentHandler = new ContentHandler() {
+        public void characters(char[] ch, int start, int length) {
+            String s = new String(ch, start, length).trim();
+            if (!s.isEmpty()) {
+                if (text.length() != 0) {
+                    text.append(",");
+                }
+                text.append(s);
+            }
+        }
 
-        String s = new String(ch, start, length).trim();
-        if (s.length() != 0) {
-            if (text.length() != 0) {
-                text.append(",");
+        public void processingInstruction(String target, String data) {
+            String s = target + ":" + data;
+            if (instructions.length() != 0) {
+                instructions.append(",");
+            }
+            instructions.append(s);
+        }
+
+
+        public void startElement(String uri, String localName, String qName, Attributes atts) {
+
+            if (elements1.length() != 0) {
+                elements1.append(",");
             }
 
-            text.append(s);
-        }
-    }
+            elements1.append(localName);
 
-    public void endDocument() {
-    }
+            if (!"".equals(uri)) {
+                namespaces1.put(localName, uri);
+            }
 
-    public void endElement(String uri, String localName, String qName) {
-    }
+            for (int i = 0; i < atts.getLength(); i++) {
+                attributes1.put(atts.getLocalName(i), atts.getValue(i));
+            }
 
-    public void endPrefixMapping(String prefix) {
-    }
+            if (elements2.length() != 0) {
+                elements2.append(",");
+            }
 
-    public void ignorableWhitespace(char[] ch, int start, int length) {
-    }
+            elements2.append(qName);
 
-    public void processingInstruction(String target, String data) {
-        String s = target + ":" + data;
+            if (!"".equals(uri)) {
+                namespaces2.put(qName, uri);
+            }
 
-        if (instructions.length() != 0) {
-            instructions.append(",");
+            for (int i = 0; i < atts.getLength(); i++) {
+                attributes2.put(atts.getQName(i), atts.getValue(i));
+            }
         }
 
-        instructions.append(s);
-    }
+        public void endDocument() {}
+        public void endElement(String uri, String localName, String qName) {}
+        public void endPrefixMapping(String prefix) {}
+        public void ignorableWhitespace(char[] ch, int start, int length) {}
+        public void setDocumentLocator(Locator locator) {}
+        public void skippedEntity(String name) {}
+        public void startDocument() {}
+        public void startPrefixMapping(String prefix, String uri) {}
+    };
 
-    public void setDocumentLocator(Locator locator) {
-    }
-
-    public void skippedEntity(String name) {
-    }
-
-    public void startDocument() {
-    }
-
-    public void startElement(String uri, String localName, String qName,
-            Attributes atts) {
-
-        if (elements1.length() != 0) {
-            elements1.append(",");
-        }
-
-        elements1.append(localName);
-
-        if (!"".equals(uri)) {
-            namespaces1.put(localName, uri);
-        }
-
-        for (int i = 0; i < atts.getLength(); i++) {
-            attributes1.put(atts.getLocalName(i), atts.getValue(i));
-        }
-
-        if (elements2.length() != 0) {
-            elements2.append(",");
-        }
-
-        elements2.append(qName);
-
-        if (!"".equals(uri)) {
-            namespaces2.put(qName, uri);
-        }
-
-        for (int i = 0; i < atts.getLength(); i++) {
-            attributes2.put(atts.getQName(i), atts.getValue(i));
-        }
-    }
-
-    public void startPrefixMapping(String prefix, String uri) {
-    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void testWorkingFile1() throws Exception {
         SAXParserFactory factory = SAXParserFactory.newInstance();
         factory.setValidating(false);
         factory.setNamespaceAware(true);
 
         SAXParser parser = factory.newSAXParser();
-        parser.getXMLReader().setContentHandler(this);
+        parser.getXMLReader().setContentHandler(contentHandler);
 
         parser.parse(getClass().getResourceAsStream("/SimpleParserTest.xml"),
                 (DefaultHandler) null);
@@ -196,12 +168,6 @@
 
         assertEquals("http://www.foobar.org", namespaces1.get("stuff"));
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void testWorkingFile2() throws Exception {
         SAXParserFactory factory = SAXParserFactory.newInstance();
 
@@ -211,7 +177,7 @@
                 true);
 
         SAXParser parser = factory.newSAXParser();
-        parser.getXMLReader().setContentHandler(this);
+        parser.getXMLReader().setContentHandler(contentHandler);
         parser.parse(getClass().getResourceAsStream("/SimpleParserTest.xml"),
                 (DefaultHandler) null);
 
@@ -230,12 +196,6 @@
 
         assertEquals(0, namespaces2.size());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify exceptions.",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void testEntityResolver() throws Exception {
         final StringBuilder text = new StringBuilder();
         DefaultHandler handler = new DefaultHandler() {
@@ -265,12 +225,6 @@
                 "resolved external entity must be in parser character stream",
                 text.toString().contains("test"));
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify exceptions.",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void testGetValue() throws Exception{
         parser.parse(getClass().getResourceAsStream("/staffNS.xml"),
                 new DefaultHandler() {
diff --git a/luni/src/test/java/libcore/xml/XsltXPathConformanceTestSuite.java b/luni/src/test/java/libcore/xml/XsltXPathConformanceTestSuite.java
index 7bf1980..cfc46b3 100644
--- a/luni/src/test/java/libcore/xml/XsltXPathConformanceTestSuite.java
+++ b/luni/src/test/java/libcore/xml/XsltXPathConformanceTestSuite.java
@@ -607,6 +607,7 @@
         while ((count = reader.read(buffer)) != -1) {
             out.write(buffer, 0, count);
         }
+        in.close();
         return out.toString();
     }
 
diff --git a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AllTests.java b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AllTests.java
deleted file mode 100644
index 5a141c9..0000000
--- a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AllTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite for java.nio.charset package.
- */
-public class AllTests {
-
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Test for java.lang.annotation");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AnnotationTest.class);
-        suite.addTestSuite(AnnotationFormatErrorTest.class);
-        suite.addTestSuite(AnnotationTypeMismatchExceptionTest.class);
-        suite.addTestSuite(ElementTypeTest.class);
-        suite.addTestSuite(IncompleteAnnotationExceptionTest.class);
-        suite.addTestSuite(RetentionPolicyTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java
index b80f3a9..330937f 100644
--- a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java
+++ b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationFormatErrorTest.java
@@ -21,32 +21,18 @@
 
 import junit.framework.TestCase;
 
-/**
- * Test case of java.lang.annotation.AnnotationFormatError
- */
 public class AnnotationFormatErrorTest extends TestCase {
-    /**
-     * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String)
-     */
-    @SuppressWarnings("nls")
     public void test_constructorLjava_lang_String() {
         AnnotationFormatError e = new AnnotationFormatError("some message");
         assertEquals("some message", e.getMessage());
     }
 
-    /**
-     * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(Throwable)
-     */
     public void test_constructorLjava_lang_Throwable() {
         IllegalArgumentException iae = new IllegalArgumentException();
         AnnotationFormatError e = new AnnotationFormatError(iae);
         assertSame(iae, e.getCause());
     }
 
-    /**
-     * @tests java.lang.annotation.AnnotationFormatError#AnnotationFormatError(String,Throwable)
-     */
-    @SuppressWarnings("nls")
     public void test_constructorLjava_lang_StringLjava_lang_Throwable() {
         IllegalArgumentException iae = new IllegalArgumentException();
         AnnotationFormatError e = new AnnotationFormatError("some message", iae);
diff --git a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java
deleted file mode 100644
index 5a07bd5..0000000
--- a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/AnnotationTypeMismatchExceptionTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.annotation.tests.java.lang.annotation;
-
-import java.lang.annotation.AnnotationTypeMismatchException;
-import java.lang.reflect.Method;
-
-import junit.framework.TestCase;
-
-/**
- * Test case of java.lang.annotation.AnnotationTypeMismatchException
- */
-public class AnnotationTypeMismatchExceptionTest extends TestCase {
-
-    /**
-     * @throws ClassNotFoundException
-     * @throws SecurityException
-     * @tests java.lang.annotation.AnnotationTypeMismatchException#AnnotationTypeMismatchException(Method,
-     *        String)
-     */
-    @SuppressWarnings("nls")
-    public void test_constructorLjava_lang_reflect_MethodLjava_lang_String() throws SecurityException, ClassNotFoundException {
-        Method[] methods = Class.forName("java.lang.String").getMethods();
-        Method m = methods[0];
-        AnnotationTypeMismatchException e = new AnnotationTypeMismatchException(
-                m, "some type");
-        assertNotNull("can not instantiate AnnotationTypeMismatchException", e);
-        assertSame("wrong method name", m, e.element());
-        assertEquals("wrong found type", "some type", e.foundType());
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java
index d81cabd..6c99f74 100644
--- a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java
+++ b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/ElementTypeTest.java
@@ -22,23 +22,13 @@
 
 import junit.framework.TestCase;
 
-/**
- * Test case of java.lang.annotation.ElementType
- */
 public class ElementTypeTest extends TestCase {
 
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.ElementType#valueOf(String)
-     */
-    @SuppressWarnings("nls")
     public void test_valueOfLjava_lang_String() throws Exception {
-        assertSame(ElementType.ANNOTATION_TYPE, ElementType
-                .valueOf("ANNOTATION_TYPE"));
+        assertSame(ElementType.ANNOTATION_TYPE, ElementType.valueOf("ANNOTATION_TYPE"));
         assertSame(ElementType.CONSTRUCTOR, ElementType.valueOf("CONSTRUCTOR"));
         assertSame(ElementType.FIELD, ElementType.valueOf("FIELD"));
-        assertSame(ElementType.LOCAL_VARIABLE, ElementType
-                .valueOf("LOCAL_VARIABLE"));
+        assertSame(ElementType.LOCAL_VARIABLE, ElementType.valueOf("LOCAL_VARIABLE"));
         assertSame(ElementType.METHOD, ElementType.valueOf("METHOD"));
         assertSame(ElementType.PACKAGE, ElementType.valueOf("PACKAGE"));
         assertSame(ElementType.PARAMETER, ElementType.valueOf("PARAMETER"));
@@ -51,11 +41,6 @@
         }
     }
 
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.ElementType#values()
-     */
-    @SuppressWarnings("nls")
     public void test_values() throws Exception {
         ElementType[] values = ElementType.values();
         assertTrue(values.length > 1);
diff --git a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java
index cf6ba36..8e1ca80 100644
--- a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/IncompleteAnnotationExceptionTest.java
@@ -21,13 +21,8 @@
 
 import junit.framework.TestCase;
 
-/**
- *
- */
 public class IncompleteAnnotationExceptionTest extends TestCase {
-
     /*
-     * Class under test for void IncompleteAnnotationException(String)
      * Regression for HARMONY-2477
      */
     public void testNullType() {
@@ -39,18 +34,10 @@
         }
     }
 
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.IncompleteAnnotationException#IncompleteAnnotationException(Class,
-     *        String)
-     */
-    @SuppressWarnings("nls")
-    public void test_constructorLjava_lang_Class_Ljava_lang_String()
-            throws Exception {
+    public void test_constructorLjava_lang_Class_Ljava_lang_String() throws Exception {
         Class clazz = String.class;
         String elementName = "some element";
-        IncompleteAnnotationException e = new IncompleteAnnotationException(
-                clazz, elementName);
+        IncompleteAnnotationException e = new IncompleteAnnotationException(clazz, elementName);
         assertNotNull("can not instantiate IncompleteAnnotationException", e);
         assertSame("wrong annotation type", clazz, e.annotationType());
         assertSame("wrong element name", elementName, e.elementName());
diff --git a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java
index c4f7c03..b1c2565 100644
--- a/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java
+++ b/luni/src/test/java/org/apache/harmony/annotation/tests/java/lang/annotation/RetentionPolicyTest.java
@@ -22,22 +22,11 @@
 
 import junit.framework.TestCase;
 
-/**
- * Test case of java.lang.annotation.RetentionPolicy
- */
 public class RetentionPolicyTest extends TestCase {
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.RetentionPolicy#valueOf(String)
-     */
-    @SuppressWarnings("nls")
     public void test_valueOfLjava_lang_String() throws Exception {
-        assertSame(RetentionPolicy.CLASS, RetentionPolicy
-                .valueOf("CLASS"));
-        assertSame(RetentionPolicy.RUNTIME, RetentionPolicy
-                .valueOf("RUNTIME"));
-        assertSame(RetentionPolicy.SOURCE, RetentionPolicy
-                .valueOf("SOURCE"));
+        assertSame(RetentionPolicy.CLASS, RetentionPolicy.valueOf("CLASS"));
+        assertSame(RetentionPolicy.RUNTIME, RetentionPolicy.valueOf("RUNTIME"));
+        assertSame(RetentionPolicy.SOURCE, RetentionPolicy.valueOf("SOURCE"));
         try {
             RetentionPolicy.valueOf("OTHER");
             fail("Should throw an IllegalArgumentException");
@@ -46,11 +35,6 @@
         }
     }
 
-    /**
-     * @throws Exception
-     * @tests java.lang.annotation.RetentionPolicy#values()
-     */
-    @SuppressWarnings("nls")
     public void test_values() throws Exception {
         RetentionPolicy[] values = RetentionPolicy.values();
         assertTrue(values.length > 1);
diff --git a/luni/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java b/luni/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
index 9ef33f9..226ea66 100644
--- a/luni/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
+++ b/luni/src/test/java/org/apache/harmony/archive/tests/java/util/jar/JarFileTest.java
@@ -104,7 +104,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.io.File)
+     * java.util.jar.JarFile#JarFile(java.io.File)
      */
     public void test_ConstructorLjava_io_File() {
         try {
@@ -123,7 +123,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.lang.String)
+     * java.util.jar.JarFile#JarFile(java.lang.String)
      */
     public void test_ConstructorLjava_lang_String() {
         try {
@@ -143,7 +143,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.lang.String, boolean)
+     * java.util.jar.JarFile#JarFile(java.lang.String, boolean)
      */
     public void test_ConstructorLjava_lang_StringZ() {
         try {
@@ -163,7 +163,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.io.File, boolean)
+     * java.util.jar.JarFile#JarFile(java.io.File, boolean)
      */
     public void test_ConstructorLjava_io_FileZ() {
         try {
@@ -182,7 +182,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#JarFile(java.io.File, boolean, int)
+     * java.util.jar.JarFile#JarFile(java.io.File, boolean, int)
      */
     public void test_ConstructorLjava_io_FileZI() {
         try {
@@ -216,8 +216,8 @@
     /**
      * Constructs JarFile object.
      *
-     * @tests java.util.jar.JarFile#JarFile(java.io.File)
-     * @tests java.util.jar.JarFile#JarFile(java.lang.String)
+     * java.util.jar.JarFile#JarFile(java.io.File)
+     * java.util.jar.JarFile#JarFile(java.lang.String)
      */
     public void testConstructor_file() throws IOException {
         File f = new File(resources, jarName);
@@ -229,7 +229,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#entries()
+     * java.util.jar.JarFile#entries()
      */
     public void test_entries() throws Exception {
         /*
@@ -271,7 +271,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.jar.JarFile#getJarEntry(java.lang.String)
+     * java.util.jar.JarFile#getJarEntry(java.lang.String)
      */
     public void test_getEntryLjava_lang_String() throws IOException {
         try {
@@ -308,7 +308,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.jar.JarFile#getJarEntry(java.lang.String)
+     * java.util.jar.JarFile#getJarEntry(java.lang.String)
      */
     public void test_getJarEntryLjava_lang_String() throws IOException {
         try {
@@ -345,7 +345,7 @@
 
 
     /**
-     * @tests java.util.jar.JarFile#getJarEntry(java.lang.String)
+     * java.util.jar.JarFile#getJarEntry(java.lang.String)
      */
     public void testGetJarEntry() throws Exception {
         Support_Resources.copyFile(resources, null, jarName);
@@ -424,7 +424,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#getManifest()
+     * java.util.jar.JarFile#getManifest()
      */
     public void test_getManifest() {
         // Test for method java.util.jar.Manifest
@@ -515,7 +515,7 @@
     }
 
     /**
-     * @tests java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry)
+     * java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry)
      */
     // This test doesn't pass on RI. If entry size is set up incorrectly,
     // SecurityException is thrown. But SecurityException is thrown on RI only
@@ -788,7 +788,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry)
+     * java.util.jar.JarFile#getInputStream(java.util.zip.ZipEntry)
      */
     public void test_getInputStreamLjava_util_jar_JarEntry() throws IOException {
         File localFile = null;
diff --git a/luni/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java b/luni/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java
index d1bbbe6..17d251b 100644
--- a/luni/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java
+++ b/luni/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ZipFileTest.java
@@ -69,7 +69,7 @@
     };
 
     /**
-     * @tests java.util.zip.ZipFile#ZipFile(java.io.File)
+     * java.util.zip.ZipFile#ZipFile(java.io.File)
      */
     public void test_ConstructorLjava_io_File() {
         // Test for method java.util.zip.ZipFile(java.io.File)
@@ -77,7 +77,7 @@
     }
 
     /**
-     * @tests java.util.zip.ZipFile#ZipFile(java.io.File, int)
+     * java.util.zip.ZipFile#ZipFile(java.io.File, int)
      */
     public void test_ConstructorLjava_io_FileI() throws IOException {
         zfile.close(); // about to reopen the same temp file
@@ -104,7 +104,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.zip.ZipFile#ZipFile(java.lang.String)
+     * java.util.zip.ZipFile#ZipFile(java.lang.String)
      */
     public void test_ConstructorLjava_lang_String() throws IOException {
         System.setProperty("user.dir", System.getProperty("java.io.tmpdir"));
@@ -131,7 +131,7 @@
     }
 
     /**
-     * @tests java.util.zip.ZipFile#finalize()
+     * java.util.zip.ZipFile#finalize()
      */
     public void test_finalize() throws IOException {
         InputStream in = Support_Resources.getStream("hyts_ZipFile.zip");
@@ -161,7 +161,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.zip.ZipFile#close()
+     * java.util.zip.ZipFile#close()
      */
     public void test_close() throws IOException {
         // Test for method void java.util.zip.ZipFile.close()
@@ -191,7 +191,7 @@
     }
 
     /**
-     * @tests java.util.zip.ZipFile#entries()
+     * java.util.zip.ZipFile#entries()
      */
     public void test_entries() throws Exception {
         // Test for method java.util.Enumeration java.util.zip.ZipFile.entries()
@@ -225,7 +225,7 @@
     }
 
     /**
-     * @tests java.util.zip.ZipFile#getEntry(java.lang.String)
+     * java.util.zip.ZipFile#getEntry(java.lang.String)
      */
     public void test_getEntryLjava_lang_String() throws IOException {
         // Test for method java.util.zip.ZipEntry
@@ -290,7 +290,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.zip.ZipFile#getInputStream(java.util.zip.ZipEntry)
+     * java.util.zip.ZipFile#getInputStream(java.util.zip.ZipEntry)
      */
     public void test_getInputStreamLjava_util_zip_ZipEntry() throws IOException {
         // Test for method java.io.InputStream
@@ -328,7 +328,7 @@
     }
 
     /**
-     * @tests java.util.zip.ZipFile#getName()
+     * java.util.zip.ZipFile#getName()
      */
     public void test_getName() {
         // Test for method java.lang.String java.util.zip.ZipFile.getName()
@@ -338,7 +338,7 @@
 
     /**
      * @throws IOException
-     * @tests java.util.zip.ZipFile#size()
+     * java.util.zip.ZipFile#size()
      */
     public void test_size() throws IOException {
         assertEquals(6, zfile.size());
@@ -351,7 +351,7 @@
     }
 
     /**
-     * @tests java.io.InputStream#reset()
+     * java.io.InputStream#reset()
      */
     public void test_reset() throws IOException {
         // read an uncompressed entry
@@ -397,7 +397,7 @@
     }
 
     /**
-     * @tests java.io.InputStream#reset()
+     * java.io.InputStream#reset()
      */
     public void test_reset_subtest0() throws IOException {
         // read an uncompressed entry
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/BadPaddingExceptionTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/BadPaddingExceptionTest.java
index bb6c6d2..eaa4563 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/BadPaddingExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/BadPaddingExceptionTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.crypto.BadPaddingException;
 
 import junit.framework.TestCase;
@@ -36,7 +31,6 @@
  * Tests for <code>BadPaddingException</code> class constructors and methods.
  *
  */
-@TestTargetClass(BadPaddingException.class)
 public class BadPaddingExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -50,12 +44,6 @@
      * Test for <code>BadPaddingException()</code> constructor Assertion:
      * constructs BadPaddingException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "BadPaddingException",
-        args = {}
-    )
     public void testBadPaddingException01() {
         BadPaddingException tE = new BadPaddingException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -67,12 +55,6 @@
      * Assertion: constructs BadPaddingException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "BadPaddingException",
-        args = {java.lang.String.class}
-    )
     public void testBadPaddingException02() {
         BadPaddingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +69,6 @@
      * Test for <code>BadPaddingException(String)</code> constructor
      * Assertion: constructs BadPaddingException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "BadPaddingException",
-        args = {java.lang.String.class}
-    )
     public void testBadPaddingException03() {
         String msg = null;
         BadPaddingException tE = new BadPaddingException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStream1Test.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStream1Test.java
index 30fdab4..4fc9b3d 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStream1Test.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStream1Test.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.ByteArrayInputStream;
 import java.security.InvalidKeyException;
 import java.security.Key;
@@ -41,10 +36,8 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(CipherInputStream.class)
 /**
  */
-
 public class CipherInputStream1Test extends TestCase {
 
     private static class TestInputStream extends ByteArrayInputStream {
@@ -68,12 +61,6 @@
      * CipherInputStream uses NullCipher if Cipher is not specified
      * in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CipherInputStream",
-        args = {java.io.InputStream.class}
-    )
     public void testCipherInputStream() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestInputStream tis = new TestInputStream(data);
@@ -94,12 +81,6 @@
      * read() method testing. Tests that method returns the correct value
      * (related to the InputStream) and that it returns -1 at the end of stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "read",
-        args = {}
-    )
     public void testRead1() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestInputStream tis = new TestInputStream(data);
@@ -121,12 +102,6 @@
      * value (related to the InputStream) and that it returns -1 at the end of
      * stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "read",
-        args = {byte[].class}
-    )
     public void testRead2() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestInputStream tis = new TestInputStream(data);
@@ -165,12 +140,6 @@
      * bytes in the case of null buffer, and that it returns -1 at the end of
      * stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "read",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testRead3() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestInputStream tis = new TestInputStream(data);
@@ -209,12 +178,6 @@
      * skip(long n) method testing. Tests that the method correctly skips the
      * bytes.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "skip",
-        args = {long.class}
-    )
     public void testSkip() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestInputStream tis = new TestInputStream(data);
@@ -253,12 +216,6 @@
     /**
      * available() method testing. Tests that the method always return 0.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "available",
-        args = {}
-    )
     public void testAvailable() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestInputStream tis = new TestInputStream(data);
@@ -271,12 +228,6 @@
      * close() method testing. Tests that the method calls the close()
      * method of the underlying input stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "close",
-        args = {}
-    )
     public void testClose() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestInputStream tis = new TestInputStream(data);
@@ -289,12 +240,6 @@
     /**
      * markSupported() method testing. Tests that mark is not supported.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "markSupported",
-        args = {}
-    )
     public void testMarkSupported() {
         byte[] data = new byte[] {-127, -100, -50, -10, -1, 0, 1, 10, 50, 127};
         TestInputStream tis = new TestInputStream(data);
@@ -303,12 +248,6 @@
                 + "should be false.", cis.markSupported());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CipherInputStream",
-        args = {java.io.InputStream.class, javax.crypto.Cipher.class}
-    )
     public void test_ConstructorLjava_io_InputStreamLjavax_crypto_Cipher () throws
     NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[100]);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStreamTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStreamTest.java
index 64562bb..e40ceac 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStreamTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherInputStreamTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -32,18 +27,11 @@
 import javax.crypto.CipherInputStream;
 import javax.crypto.NullCipher;
 
-@TestTargetClass(CipherInputStream.class)
 public class CipherInputStreamTest extends TestCase {
 
     /**
-     * @tests javax.crypto.CipherInputStream#read(byte[] b, int off, int len)
+     * javax.crypto.CipherInputStream#read(byte[] b, int off, int len)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test. Checks NullPointerException",
-        method = "read",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testReadBII() throws Exception {
         // Regression for HARMONY-1080
         CipherInputStream stream = new CipherInputStream(null, new NullCipher());
@@ -56,14 +44,8 @@
     }
 
     /**
-     * @tests javax.crypto.CipherInputStream#close()
+     * javax.crypto.CipherInputStream#close()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test. Checks IllegalStateException",
-        method = "close",
-        args = {}
-    )
     public void testClose() throws Exception {
         // Regression for HARMONY-1087
         try {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStream1Test.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStream1Test.java
index e042a91..359ac66 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStream1Test.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStream1Test.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -45,10 +40,8 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(CipherOutputStream.class)
 /**
  */
-
 public class CipherOutputStream1Test extends TestCase {
 
     private static class TestOutputStream extends ByteArrayOutputStream {
@@ -68,12 +61,6 @@
      * CipherOutputStream uses NullCipher if Cipher is not specified
      * in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CipherOutputStream",
-        args = {java.io.OutputStream.class}
-    )
     public void testCipherOutputStream() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestOutputStream tos = new TestOutputStream();
@@ -90,12 +77,6 @@
      * write(int b) method testing. Tests that method writes correct values to
      * the underlying output stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "write",
-        args = {int.class}
-    )
     public void testWrite1() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestOutputStream tos = new TestOutputStream();
@@ -114,12 +95,6 @@
      * write(byte[] b) method testing. Tests that method writes correct values
      * to the underlying output stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "write",
-        args = {byte[].class}
-    )
     public void testWrite2() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestOutputStream tos = new TestOutputStream();
@@ -142,12 +117,6 @@
     /**
      * write(byte[] b, int off, int len) method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "write",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testWrite3() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestOutputStream tos = new TestOutputStream();
@@ -163,14 +132,8 @@
     }
 
     /**
-     * @tests write(byte[] b, int off, int len)
+     * write(byte[] b, int off, int len)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test. IllegalArgumentException checked.",
-        method = "write",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testWrite4() throws Exception {
         //Regression for HARMONY-758
         try {
@@ -180,14 +143,8 @@
     }
 
     /**
-     * @tests write(byte[] b, int off, int len)
+     * write(byte[] b, int off, int len)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "write",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testWrite5() throws Exception {
         //Regression for HARMONY-758
         Cipher cf = Cipher.getInstance("DES/CBC/PKCS5Padding");
@@ -203,12 +160,6 @@
      * flush() method testing. Tests that method flushes the data to the
      * underlying output stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "flush",
-        args = {}
-    )
     public void testFlush() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestOutputStream tos = new TestOutputStream();
@@ -225,12 +176,6 @@
      * close() method testing. Tests that the method calls the close() method of
      * the underlying input stream.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Can not check IOException.",
-        method = "close",
-        args = {}
-    )
     public void testClose() throws Exception {
         byte[] data = new byte[] { -127, -100, -50, -10, -1, 0, 1, 10, 50, 127 };
         TestOutputStream tos = new TestOutputStream();
@@ -245,12 +190,6 @@
                 + "of its underlying output stream.", tos.wasClosed());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CipherOutputStream",
-        args = {java.io.OutputStream.class, javax.crypto.Cipher.class}
-    )
     public void test_ConstructorLjava_io_OutputStreamLjavax_crypto_Cipher() throws
     NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStreamTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStreamTest.java
index aadad1a..329fc1b 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStreamTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherOutputStreamTest.java
@@ -17,27 +17,15 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.OutputStream;
 import javax.crypto.Cipher;
 import javax.crypto.CipherOutputStream;
 
-@TestTargetClass(CipherOutputStream.class)
 public class CipherOutputStreamTest extends junit.framework.TestCase {
 
     /**
-     * @tests javax.crypto.CipherOutputStream#close()
+     * javax.crypto.CipherOutputStream#close()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test. Checks IllegalStateException.",
-        method = "close",
-        args = {}
-    )
     public void test_close() throws Exception {
         // regression test for HARMONY-1139
         try {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherSpiTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherSpiTest.java
index e7640d5..e240f6f 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherSpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.spec.AlgorithmParameterSpec;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
@@ -44,7 +39,6 @@
 import junit.framework.TestCase;
 
 
-@TestTargetClass(CipherSpi.class)
 /**
  * Tests for <code>CipherSpi</code> class constructors and methods.
  *
@@ -145,12 +139,6 @@
      * Test for <code>CipherSpi</code> constructor
      * Assertion: constructs CipherSpi
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CipherSpi",
-        args = {}
-    )
     public void testCipherSpiTests01() throws IllegalBlockSizeException,
             BadPaddingException, ShortBufferException {
 
@@ -180,11 +168,6 @@
      * Test for <code>engineGetKeySize(Key)</code> method
      * Assertion: It throws UnsupportedOperationException if it is not overridden
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "engineGetKeySize",
-        args = {java.security.Key.class}
-    )
     public void testCipherSpi02() throws Exception {
         Mock_CipherSpi cSpi = new Mock_CipherSpi();
         try {
@@ -198,12 +181,6 @@
      * Test for <code>engineWrap(Key)</code> method
      * Assertion: It throws UnsupportedOperationException if it is not overridden
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Functionality not tested.",
-        method = "engineWrap",
-        args = {java.security.Key.class}
-    )
     public void testCipherSpi03() throws Exception {
         Mock_CipherSpi cSpi = new Mock_CipherSpi();
         try {
@@ -217,12 +194,6 @@
      * Test for <code>engineUnwrap(byte[], String, int)</code> method
      * Assertion: It throws UnsupportedOperationException if it is not overridden
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Functionality not tested.",
-        method = "engineUnwrap",
-        args = {byte[].class, java.lang.String.class, int.class}
-    )
     public void testCipherSpi04() throws Exception {
         Mock_CipherSpi cSpi = new Mock_CipherSpi();
         try {
@@ -238,12 +209,6 @@
      * throws NullPointerException if one of these buffers is null;
      * throws ShortBufferException is there is no space in output to hold result
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineUpdate",
-        args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}
-    )
     public void testCipherSpi05() throws ShortBufferException {
         Mock_CipherSpi cSpi = new Mock_CipherSpi();
         byte[] bb = { (byte) 0, (byte) 1, (byte) 2, (byte) 3, (byte) 4,
@@ -296,12 +261,6 @@
      * throws NullPointerException if one of these buffers is null;
      * throws ShortBufferException is there is no space in output to hold result
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "BadPaddingException & IllegalBlockSizeException checking missed.",
-        method = "engineDoFinal",
-        args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}
-    )
     public void testCipherSpi06() throws BadPaddingException,
             ShortBufferException, IllegalBlockSizeException {
         Mock_CipherSpi cSpi = new Mock_CipherSpi();
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherTest.java
index f5a99c7..0507147 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/CipherTest.java
@@ -17,15 +17,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-import org.apache.harmony.crypto.tests.support.MyCipher;
-
-import tests.support.resource.Support_Resources;
-
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
@@ -50,7 +41,6 @@
 import java.security.spec.AlgorithmParameterSpec;
 import java.security.spec.RSAKeyGenParameterSpec;
 import java.util.Arrays;
-
 import javax.crypto.BadPaddingException;
 import javax.crypto.Cipher;
 import javax.crypto.CipherSpi;
@@ -61,8 +51,9 @@
 import javax.crypto.ShortBufferException;
 import javax.crypto.spec.DESedeKeySpec;
 import javax.crypto.spec.IvParameterSpec;
+import org.apache.harmony.crypto.tests.support.MyCipher;
+import tests.support.resource.Support_Resources;
 
-@TestTargetClass(Cipher.class)
 public class CipherTest extends junit.framework.TestCase {
 
     static Key cipherKey;
@@ -92,69 +83,23 @@
     }
 
     /**
-     * @tests javax.crypto.Cipher#getInstance(java.lang.String)
+     * javax.crypto.Cipher#getInstance(java.lang.String)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getInstance",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineSetMode",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineSetPadding",
-            args = {java.lang.String.class}
-        )
-    })
     public void test_getInstanceLjava_lang_String() throws Exception {
         Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");
         assertNotNull("Received a null Cipher instance", cipher);
 
         try {
             Cipher.getInstance("WrongAlgorithmName");
-            fail("NoSuchAlgorithmException expected");
-        } catch (NoSuchAlgorithmException e) {
-            //expected
+            fail();
+        } catch (NoSuchAlgorithmException expected) {
         }
-//        RI throws  NoSuchAlgorithmException for wrong padding.
     }
 
     /**
-     * @tests javax.crypto.Cipher#getInstance(java.lang.String,
+     * javax.crypto.Cipher#getInstance(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getInstance",
-            args = {java.lang.String.class, java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineSetMode",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineSetPadding",
-            args = {java.lang.String.class}
-        )
-    })
     public void test_getInstanceLjava_lang_StringLjava_lang_String()
             throws Exception {
 
@@ -166,61 +111,31 @@
             Cipher cipher = Cipher.getInstance("DES", providers[i].getName());
             assertNotNull("Cipher.getInstance() returned a null value", cipher);
 
-            // Exception case
             try {
                 cipher = Cipher.getInstance("DoBeDoBeDo", providers[i]);
-                fail("Should have thrown an NoSuchAlgorithmException");
-            } catch (NoSuchAlgorithmException e) {
-                // Expected
+                fail();
+            } catch (NoSuchAlgorithmException expected) {
             }
         }
 
-        // Exception case
         try {
             Cipher.getInstance("DES", (String) null);
-            fail("Should have thrown an IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // Expected
+            fail();
+        } catch (IllegalArgumentException expected) {
         }
 
-        // Exception case
         try {
             Cipher.getInstance("DES", "IHaveNotBeenConfigured");
-            fail("Should have thrown an NoSuchProviderException");
-        } catch (NoSuchProviderException e) {
-            // Expected
+            fail();
+        } catch (NoSuchProviderException expected) {
         }
-//      RI throws  NoSuchAlgorithmException for wrong padding.
     }
 
     /**
-     * @tests javax.crypto.Cipher#getInstance(java.lang.String,
+     * javax.crypto.Cipher#getInstance(java.lang.String,
      *        java.security.Provider)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getInstance",
-            args = {java.lang.String.class, java.security.Provider.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineSetMode",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineSetPadding",
-            args = {java.lang.String.class}
-        )
-    })
-    public void test_getInstanceLjava_lang_StringLjava_security_Provider()
-            throws Exception {
+    public void test_getInstanceLjava_lang_StringLjava_security_Provider() throws Exception {
 
         Provider[] providers = Security.getProviders("Cipher.DES");
 
@@ -231,33 +146,22 @@
             assertNotNull("Cipher.getInstance() returned a null value", cipher);
         }
 
-        // Exception case
         try {
             Cipher.getInstance("DES", (Provider) null);
-            fail("Should have thrown an IllegalArgumentException");
-        } catch (IllegalArgumentException e) {
-            // Expected
+            fail();
+        } catch (IllegalArgumentException expected) {
         }
 
-        // Exception case
         try {
             Cipher.getInstance("WrongAlg", providers[0]);
-            fail("NoSuchAlgorithmException expected");
-        } catch (NoSuchAlgorithmException e) {
-            // Expected
+            fail();
+        } catch (NoSuchAlgorithmException expected) {
         }
-//      RI throws  NoSuchAlgorithmException for wrong padding.
     }
 
     /**
-     * @tests javax.crypto.Cipher#getProvider()
+     * javax.crypto.Cipher#getProvider()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws Exception {
 
         Provider[] providers = Security.getProviders("Cipher.AES");
@@ -275,14 +179,8 @@
     }
 
     /**
-     * @tests javax.crypto.Cipher#getAlgorithm()
+     * javax.crypto.Cipher#getAlgorithm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws Exception {
         final String algorithm = "DESede/CBC/PKCS5Padding";
 
@@ -292,23 +190,8 @@
     }
 
     /**
-     * @tests javax.crypto.Cipher#getBlockSize()
+     * javax.crypto.Cipher#getBlockSize()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getBlockSize",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineGetBlockSize",
-            args = {}
-        )
-    })
     public void test_getBlockSize() throws Exception {
         final String algorithm = "DESede/CBC/PKCS5Padding";
 
@@ -317,23 +200,8 @@
     }
 
     /**
-     * @tests javax.crypto.Cipher#getOutputSize(int)
+     * javax.crypto.Cipher#getOutputSize(int)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getOutputSize",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineGetOutputSize",
-            args = {int.class}
-        )
-    })
     public void test_getOutputSizeI() throws Exception {
 
         SecureRandom sr = new SecureRandom();
@@ -341,9 +209,8 @@
 
         try {
             cipher.getOutputSize(25);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         cipher.init(Cipher.ENCRYPT_MODE, cipherKey, sr);
@@ -358,15 +225,9 @@
     }
 
     /**
-     * @tests javax.crypto.Cipher#init(int, java.security.Key)
+     * javax.crypto.Cipher#init(int, java.security.Key)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {int.class, java.security.Key.class}
-    )
-    public void test_initILjava_security_Key() throws Exception {
+    public void test_initWithKey() throws Exception {
         Cipher cipher = Cipher.getInstance(algorithm + "/ECB/PKCS5Padding");
         cipher.init(Cipher.ENCRYPT_MODE, cipherKey);
 
@@ -374,33 +235,16 @@
         cipher = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             cipher.init(Cipher.ENCRYPT_MODE, cipherKey);
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
     }
 
     /**
-     * @tests javax.crypto.Cipher#init(int, java.security.Key,
+     * javax.crypto.Cipher#init(int, java.security.Key,
      *        java.security.SecureRandom)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {int.class, java.security.Key.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineInit",
-            args = {int.class, java.security.Key.class, java.security.SecureRandom.class}
-        )
-    })
-    public void test_initILjava_security_KeyLjava_security_SecureRandom()
-            throws Exception {
+    public void test_initWithSecureRandom() throws Exception {
         SecureRandom sr = new SecureRandom();
         Cipher cipher = Cipher.getInstance(algorithm + "/ECB/PKCS5Padding");
         cipher.init(Cipher.ENCRYPT_MODE, cipherKey, sr);
@@ -408,24 +252,16 @@
         cipher = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             cipher.init(Cipher.ENCRYPT_MODE, cipherKey, sr);
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
     }
 
     /**
-     * @tests javax.crypto.Cipher#init(int, java.security.Key,
+     * javax.crypto.Cipher#init(int, java.security.Key,
      *        java.security.spec.AlgorithmParameterSpec)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {int.class, java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-    )
-    public void test_initILjava_security_KeyLjava_security_spec_AlgorithmParameterSpec()
-            throws Exception {
+    public void test_initWithAlgorithmParameterSpec() throws Exception {
         SecureRandom sr = new SecureRandom();
         Cipher cipher = null;
 
@@ -447,9 +283,8 @@
         cipher = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             cipher.init(Cipher.ENCRYPT_MODE, cipherKey, ap);
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
 
         cipher = Cipher.getInstance("DES/CBC/NoPadding");
@@ -457,34 +292,17 @@
 
         try {
             cipher.init(Cipher.ENCRYPT_MODE, cipherKeyDES, ap);
-            fail("InvalidAlgorithmParameterException expected");
-        } catch (InvalidAlgorithmParameterException e) {
-            //expected
+            fail();
+        } catch (InvalidAlgorithmParameterException expected) {
         }
     }
 
     /**
-     * @tests javax.crypto.Cipher#init(int, java.security.Key,
+     * javax.crypto.Cipher#init(int, java.security.Key,
      *        java.security.spec.AlgorithmParameterSpec,
      *        java.security.SecureRandom)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {int.class, java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineInit",
-            args = {int.class, java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        )
-    })
-    public void test_initILjava_security_KeyLjava_security_spec_AlgorithmParameterSpecLjava_security_SecureRandom()
-            throws Exception {
+    public void test_initWithKeyAlgorithmParameterSpecSecureRandom() throws Exception {
         SecureRandom sr = new SecureRandom();
         Cipher cipher = null;
 
@@ -505,9 +323,8 @@
         cipher = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             cipher.init(Cipher.ENCRYPT_MODE, cipherKey, ap, sr);
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
 
         cipher = Cipher.getInstance("DES/CBC/NoPadding");
@@ -515,30 +332,14 @@
 
         try {
             cipher.init(Cipher.ENCRYPT_MODE, cipherKeyDES, ap, sr);
-            fail("InvalidAlgorithmParameterException expected");
-        } catch (InvalidAlgorithmParameterException e) {
-            //expected
+            fail();
+        } catch (InvalidAlgorithmParameterException expected) {
         }
     }
 
     /**
-     * @tests javax.crypto.Cipher#update(byte[], int, int)
+     * javax.crypto.Cipher#update(byte[], int, int)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "update",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        )
-    })
     public void test_update$BII() throws Exception {
         for (int index = 1; index < 4; index++) {
             Cipher c = Cipher.getInstance("DESEDE/CBC/PKCS5Padding");
@@ -584,26 +385,19 @@
                     + index + ".plaintext");
             assertTrue("Operation produced incorrect results", Arrays.equals(
                     plaintextBytes, decipheredCipherText));
-        }// end for
+        }
 
         Cipher cipher = Cipher.getInstance("DESEDE/CBC/PKCS5Padding");
         try {
             cipher.update(new byte[64], 0, 32);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
     }
 
     /**
-     * @tests javax.crypto.Cipher#doFinal()
+     * javax.crypto.Cipher#doFinal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doFinal",
-        args = {}
-    )
     public void test_doFinal() throws Exception {
         for (int index = 1; index < 4; index++) {
             Cipher c = Cipher.getInstance("DESEDE/CBC/PKCS5Padding");
@@ -647,7 +441,7 @@
                     + ".ciphertext");
             assertTrue("Operation produced incorrect results", Arrays.equals(
                     encryptedPlaintext, cipherText));
-        }// end for
+        }
 
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         byte[] b1 = new byte[30];
@@ -657,17 +451,15 @@
         c.update(b, 0, 10, b1, 5);
         try {
             c.doFinal();
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.doFinal();
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -685,46 +477,26 @@
         c.update(b1, 0, 24, b, 0);
         try {
             c.doFinal();
-            fail("BadPaddingException expected");
-        } catch (BadPaddingException e) {
-            //expected
+            fail();
+        } catch (BadPaddingException expected) {
         }
     }
 
-    private byte[] loadBytes(String resPath) {
-        try {
-            File resources = Support_Resources.createTempFolder();
-            Support_Resources.copyFile(resources, null, resPath);
-            InputStream is = Support_Resources.getStream(resPath);
+    private byte[] loadBytes(String resPath) throws Exception {
+        File resources = Support_Resources.createTempFolder();
+        Support_Resources.copyFile(resources, null, resPath);
+        InputStream is = Support_Resources.getStream(resPath);
 
-            ByteArrayOutputStream out = new ByteArrayOutputStream();
-            byte[] buff = new byte[1024];
-            int readlen;
-            while ((readlen = is.read(buff)) > 0) {
-                out.write(buff, 0, readlen);
-            }
-            is.close();
-            return out.toByteArray();
-        } catch (IOException e) {
-            return null;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        byte[] buff = new byte[1024];
+        int readlen;
+        while ((readlen = is.read(buff)) > 0) {
+            out.write(buff, 0, readlen);
         }
+        is.close();
+        return out.toByteArray();
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineGetParameters",
-            args = {}
-        )
-    })
     public void testGetParameters() throws Exception {
         Cipher c = Cipher.getInstance("DES");
         assertNull(c.getParameters());
@@ -733,21 +505,6 @@
     /*
      * Class under test for int update(byte[], int, int, byte[], int)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "update",
-            args = {byte[].class, int.class, int.class, byte[].class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class, byte[].class, int.class}
-        )
-    })
     public void testUpdatebyteArrayintintbyteArrayint() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10};
         byte[] b1 = new byte[6];
@@ -755,17 +512,15 @@
 
         try {
             c.update(b, 0, 10, b1, 5);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c.init(Cipher.ENCRYPT_MODE, cipherKey);
         try {
             c.update(b, 0, 10, b1, 5);
-            fail("ShortBufferException expected");
-        } catch (ShortBufferException e) {
-            //expected
+            fail();
+        } catch (ShortBufferException expected) {
         }
 
         b1 = new byte[30];
@@ -775,21 +530,6 @@
     /*
      * Class under test for int doFinal(byte[], int, int, byte[], int)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "doFinal",
-            args = {byte[].class, int.class, int.class, byte[].class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineDoFinal",
-            args = {byte[].class, int.class, int.class, byte[].class, int.class}
-        )
-    })
     public void testDoFinalbyteArrayintintbyteArrayint() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         byte[] b1 = new byte[30];
@@ -798,17 +538,15 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKeyDES);
         try {
             c.doFinal(b, 0, 10, b1, 5);
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.doFinal(b, 0, 10, b1, 5);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -825,9 +563,8 @@
 
         try {
             c.doFinal(b1, 0, 24, new byte[42], 0);
-            fail("BadPaddingException expected");
-        } catch (BadPaddingException e) {
-            //expected
+            fail();
+        } catch (BadPaddingException expected) {
         }
 
         b1 = new byte[6];
@@ -835,117 +572,80 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKey);
         try {
             c.doFinal(b, 3, 6, b1, 5);
-            fail("No expected ShortBufferException");
-        } catch (ShortBufferException e) {
-            //expected
+            fail();
+        } catch (ShortBufferException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxAllowedKeyLength",
-        args = {java.lang.String.class}
-    )
-    public void testGetMaxAllowedKeyLength() throws NoSuchAlgorithmException {
+    public void testGetMaxAllowedKeyLength() throws Exception {
         try {
             Cipher.getMaxAllowedKeyLength(null);
-            fail("No expected NullPointerException");
-        } catch (NullPointerException e) {
+            fail();
+        } catch (NullPointerException expected) {
+        }
+        try {
+            Cipher.getMaxAllowedKeyLength("");
+        } catch (NoSuchAlgorithmException expected) {
         }
         try {
             Cipher.getMaxAllowedKeyLength("//CBC/PKCS5Paddin");
-            fail("No expected NoSuchAlgorithmException");
-        } catch (NoSuchAlgorithmException e) {
+            fail();
+        } catch (NoSuchAlgorithmException expected) {
         }
         try {
             Cipher.getMaxAllowedKeyLength("/DES/CBC/PKCS5Paddin/1");
-            fail("No expected NoSuchAlgorithmException");
-        } catch (NoSuchAlgorithmException e) {
+            fail();
+        } catch (NoSuchAlgorithmException expected) {
         }
         assertTrue(Cipher.getMaxAllowedKeyLength("/DES/CBC/PKCS5Paddin") > 0);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxAllowedParameterSpec",
-        args = {java.lang.String.class}
-    )
-    public void testGetMaxAllowedParameterSpec()
-            throws NoSuchAlgorithmException, Exception {
+    public void testGetMaxAllowedParameterSpec() throws Exception {
         try {
             Cipher.getMaxAllowedParameterSpec(null);
-            fail("No expected NullPointerException");
-        } catch (NullPointerException e) {
+            fail();
+        } catch (NullPointerException expected) {
         }
         try {
             Cipher.getMaxAllowedParameterSpec("/DES//PKCS5Paddin");
-            fail("No expected NoSuchAlgorithmException");
-        } catch (NoSuchAlgorithmException e) {
+            fail();
+        } catch (NoSuchAlgorithmException expected) {
         }
         try {
             Cipher.getMaxAllowedParameterSpec("/DES/CBC/ /1");
-            fail("No expected NoSuchAlgorithmException");
-        } catch (NoSuchAlgorithmException e) {
+            fail();
+        } catch (NoSuchAlgorithmException expected) {
         }
         Cipher.getMaxAllowedParameterSpec("DES/CBC/PKCS5Paddin");
         Cipher.getMaxAllowedParameterSpec("RSA");
     }
 
     /**
-     * @tests javax.crypto.Cipher#Cipher(CipherSpi cipherSpi, Provider provider,
+     * javax.crypto.Cipher#Cipher(CipherSpi cipherSpi, Provider provider,
      *        String transformation)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Cipher",
-        args = {javax.crypto.CipherSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void test_Ctor() throws Exception {
         // Regression for Harmony-1184
         try {
             new testCipher(null, null, "s");
-            fail("NullPointerException expected");
-        } catch (NullPointerException e) {
-            // expected
+            fail();
+        } catch (NullPointerException expected) {
         }
 
         try {
             new testCipher(new MyCipher(), null, "s");
             fail("NullPointerException expected for 'null' provider");
-        } catch (NullPointerException e) {
-            // expected
+        } catch (NullPointerException expected) {
         }
 
         try {
             new testCipher(null, new Provider("qwerty", 1.0, "qwerty") {}, "s");
             fail("NullPointerException expected for 'null' cipherSpi");
-        } catch (NullPointerException e) {
-            // expected
+        } catch (NullPointerException expected) {
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "doFinal",
-            args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineDoFinal",
-            args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}
-        )
-    })
-    public void test_doFinalLjava_nio_ByteBufferLjava_nio_ByteBuffer ()
-    throws NoSuchAlgorithmException, NoSuchPaddingException,
-    InvalidKeyException, ShortBufferException, BadPaddingException,
-    IllegalBlockSizeException, InvalidAlgorithmParameterException {
+    public void test_doFinalLjava_nio_ByteBufferLjava_nio_ByteBuffer() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         ByteBuffer bInput = ByteBuffer.allocate(64);
         ByteBuffer bOutput = ByteBuffer.allocate(64);
@@ -955,17 +655,15 @@
         bInput.put(b, 0, 10);
         try {
             c.doFinal(bInput, bOutput);
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.doFinal(bInput, bOutput);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -985,9 +683,8 @@
 
         try {
             c.doFinal(bOutput, bInput);
-            fail("BadPaddingException expected");
-        } catch (BadPaddingException e) {
-            //expected
+            fail();
+        } catch (BadPaddingException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -995,9 +692,8 @@
         bInput.put(b, 0, 16);
         try {
             c.doFinal(bInput, bInput);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException e) {
-            //expected
+            fail();
+        } catch (IllegalArgumentException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1005,9 +701,8 @@
         bInput.put(b, 0, 16);
         try {
             c.doFinal(bInput, bOutput.asReadOnlyBuffer());
-            fail("ReadOnlyBufferException expected");
-        } catch (ReadOnlyBufferException e) {
-            //expected
+            fail();
+        } catch (ReadOnlyBufferException expected) {
         }
 
         bInput.rewind();
@@ -1017,21 +712,12 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKey);
         try {
             c.doFinal(bInput, bOutput);
-            fail("No expected ShortBufferException");
-        } catch (ShortBufferException e) {
-            //expected
+            fail();
+        } catch (ShortBufferException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {int.class, java.security.Key.class, java.security.AlgorithmParameters.class}
-    )
-    public void test_initILjava_security_KeyLjava_security_AlgorithmParameters ()
-    throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException,
-    InvalidAlgorithmParameterException {
+    public void test_initWithKeyAlgorithmParameters() throws Exception {
         SecureRandom sr = new SecureRandom();
         byte[] iv = new byte[8];
         sr.nextBytes(iv);
@@ -1043,37 +729,18 @@
 
         try {
             c.init(Cipher.DECRYPT_MODE, cipherKey, ap);
-            fail("InvalidKeyException e");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
 
         try {
             c.init(Cipher.DECRYPT_MODE, cipherKeyDES, (AlgorithmParameters)null);
-            fail("InvalidAlgorithmParameterException e");
-        } catch (InvalidAlgorithmParameterException e) {
-            //expected
+            fail();
+        } catch (InvalidAlgorithmParameterException expected) {
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {int.class, java.security.Key.class, java.security.AlgorithmParameters.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineInit",
-            args = {int.class, java.security.Key.class, java.security.AlgorithmParameters.class, java.security.SecureRandom.class}
-        )
-    })
-    public void test_initILjava_security_KeyLjava_security_AlgorithmParametersLjava_security_SecureRandom ()
-    throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException,
-    InvalidAlgorithmParameterException {
+    public void test_initWithKeyAlgorithmParametersSecureRandom() throws Exception {
         SecureRandom sr = new SecureRandom();
         byte[] iv = new byte[8];
         sr.nextBytes(iv);
@@ -1085,31 +752,21 @@
 
         try {
             c.init(Cipher.DECRYPT_MODE, cipherKey, ap, new SecureRandom());
-            fail("InvalidKeyException e");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
 
         try {
             c.init(Cipher.DECRYPT_MODE, cipherKeyDES, (AlgorithmParameters)null, sr);
-            fail("InvalidAlgorithmParameterException e");
-        } catch (InvalidAlgorithmParameterException e) {
-            //expected
+            fail();
+        } catch (InvalidAlgorithmParameterException expected) {
         }
 
         c.init(Cipher.DECRYPT_MODE, cipherKeyDES, ap, (SecureRandom)null);
         assertNotNull(c.getParameters());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {int.class, java.security.cert.Certificate.class}
-    )
-    public void test_initILjava_security_cert_Certificate ()
-    throws MalformedURLException, IOException, CertificateException,
-    NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {
+    public void test_initWithCertificate() throws Exception {
 
     /* Certificate creation notes: certificate should be valid 37273 starting
      * from 13 Nov 2008
@@ -1126,6 +783,7 @@
         CertificateFactory cf = CertificateFactory.getInstance("X.509");
 
         Certificate cert = cf.generateCertificate(is);
+        is.close();
 
         Cipher c = Cipher.getInstance("RSA");
 
@@ -1133,21 +791,12 @@
         c = Cipher.getInstance("DES/CBC/PKCS5Padding");
         try {
             c.init(Cipher.ENCRYPT_MODE, cert);
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {int.class, java.security.cert.Certificate.class, java.security.SecureRandom.class}
-    )
-    public void test_initILjava_security_cert_Certificate_java_security_SecureRandom ()
-    throws MalformedURLException, IOException, CertificateException,
-    NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException {
+    public void test_initWithCertificateSecureRandom() throws Exception {
 
     /* Certificate creation notes: certificate should be valid 37273 starting
      * from 13 Nov 2008
@@ -1164,6 +813,7 @@
         CertificateFactory cf = CertificateFactory.getInstance("X.509");
 
         Certificate cert = cf.generateCertificate(is);
+        is.close();
 
         Cipher c = Cipher.getInstance("RSA");
 
@@ -1171,30 +821,12 @@
         c = Cipher.getInstance("DES/CBC/PKCS5Padding");
         try {
             c.init(Cipher.ENCRYPT_MODE, cert, new SecureRandom());
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "unwrap",
-            args = {byte[].class, java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "",
-                clazz = CipherSpi.class,
-                method = "engineUnwrap",
-                args = {byte[].class, java.lang.String.class, int.class}
-        )
-    })
-    public void test_unwrap$BLjava_lang_StringI () throws NoSuchAlgorithmException,
-    NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException,
-    IllegalBlockSizeException {
+    public void test_unwrap$BLjava_lang_StringI() throws Exception {
         SecureRandom sr = new SecureRandom();
         byte[] iv = new byte[8];
         sr.nextBytes(iv);
@@ -1208,9 +840,8 @@
 
         try {
             c.unwrap(arDES, "DES", Cipher.SECRET_KEY);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c.init(Cipher.UNWRAP_MODE, cipherKeyDES, ap, sr);
@@ -1219,39 +850,20 @@
 
         try {
             c.unwrap(arDES, "RSA38", Cipher.PUBLIC_KEY);
-            fail("NoSuchAlgorithmException expected");
-        } catch (NoSuchAlgorithmException e) {
-            //expected
+            fail();
+        } catch (NoSuchAlgorithmException expected) {
         }
 
         c = Cipher.getInstance("DESede/CBC/PKCS5Padding");
         c.init(Cipher.UNWRAP_MODE, cipherKey, ap, sr);
         try {
             c.unwrap(arDES, "DESede", Cipher.SECRET_KEY);
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "update",
-            args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "",
-                clazz = CipherSpi.class,
-                method = "engineUpdate",
-                args = {java.nio.ByteBuffer.class, java.nio.ByteBuffer.class}
-        )
-    })
-    public void test_updateLjava_nio_ByteBufferLjava_nio_ByteBuffer () throws
-    NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException,
-    ShortBufferException, InvalidAlgorithmParameterException {
+    public void test_updateLjava_nio_ByteBufferLjava_nio_ByteBuffer() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         ByteBuffer bInput = ByteBuffer.allocate(256);
         ByteBuffer bOutput = ByteBuffer.allocate(256);
@@ -1266,9 +878,8 @@
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.update(bInput, bOutput);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1294,9 +905,8 @@
         bInput.rewind();
         try {
             c.update(bInput, bInput);
-            fail("IllegalArgumentException expected");
-        } catch (IllegalArgumentException e) {
-            //expected
+            fail();
+        } catch (IllegalArgumentException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1306,9 +916,8 @@
         bOutput.rewind();
         try {
             c.update(bInput, bOutput.asReadOnlyBuffer());
-            fail("ReadOnlyBufferException expected");
-        } catch (ReadOnlyBufferException e) {
-            //expected
+            fail();
+        } catch (ReadOnlyBufferException expected) {
         }
 
         bInput.rewind();
@@ -1319,9 +928,8 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKey);
         try {
             c.update(bInput, bOutput);
-            fail("No expected ShortBufferException");
-        } catch (ShortBufferException e) {
-            //expected
+            fail();
+        } catch (ShortBufferException expected) {
         }
     }
 
@@ -1340,25 +948,7 @@
 
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "wrap",
-            args = {java.security.Key.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "",
-                clazz = CipherSpi.class,
-                method = "engineWrap",
-                args = {java.security.Key.class}
-        )
-    })
-    public void test_wrap_java_security_Key () throws NoSuchAlgorithmException,
-    NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException,
-    InvalidAlgorithmParameterException, MalformedURLException, IOException,
-    CertificateException {
+    public void test_wrap_java_security_Key() throws Exception {
         SecureRandom sr = new SecureRandom();
         byte[] iv = new byte[8];
         sr.nextBytes(iv);
@@ -1380,35 +970,26 @@
         c.init(Cipher.WRAP_MODE, cipherKeyDES, ap, sr);
         try {
             assertNotNull(c.wrap(cert.getPublicKey()));
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c.init(Cipher.DECRYPT_MODE, cipherKeyDES, ap, sr);
 
         try {
             c.wrap(cipherKeyDES);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c.init(Cipher.WRAP_MODE, cipherKeyDES, ap, sr);
         try {
             c.wrap(new Mock_Key());
-            fail("InvalidKeyException expected");
-        } catch (InvalidKeyException e) {
-            //expected
+            fail();
+        } catch (InvalidKeyException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doFinal",
-        args = {byte[].class, int.class}
-    )
     public void test_doFinal$BI() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         byte[] b1 = new byte[30];
@@ -1418,17 +999,15 @@
         c.update(b, 0, 10);
         try {
             c.doFinal(b1, 5);
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.doFinal(b1, 5);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1447,9 +1026,8 @@
         c.update(b1, 0, 24);
         try {
             c.doFinal(b, 0);
-            fail("BadPaddingException expected");
-        } catch (BadPaddingException e) {
-            //expected
+            fail();
+        } catch (BadPaddingException expected) {
         }
 
         b1 = new byte[6];
@@ -1458,18 +1036,11 @@
         c.update(b, 3, 6);
         try {
             c.doFinal(b1, 5);
-            fail("No expected ShortBufferException");
-        } catch (ShortBufferException e) {
-            //expected
+            fail();
+        } catch (ShortBufferException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doFinal",
-        args = {byte[].class}
-    )
     public void test_doFinal$B() throws Exception {
         byte[] b1 = new byte[32];
         byte[] bI1 = {1,2,3,4,5,6,7,8,9,10};
@@ -1481,17 +1052,15 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKeyDES);
         try {
             c.doFinal(bI1);
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.doFinal(bI1);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1510,27 +1079,11 @@
 
         try {
             c.doFinal(b1);
-            fail("BadPaddingException expected");
-        } catch (BadPaddingException e) {
-            //expected
+            fail();
+        } catch (BadPaddingException expected) {
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "doFinal",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = CipherSpi.class,
-            method = "engineDoFinal",
-            args = {byte[].class, int.class, int.class}
-        )
-    })
     public void test_doFinal$BII() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         byte[] b1 = new byte[30];
@@ -1539,17 +1092,15 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKeyDES);
         try {
             c.doFinal(b, 0, 10);
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.doFinal(b, 0, 10);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1568,18 +1119,11 @@
 
         try {
             c.doFinal(b1, 0, 24);
-            fail("BadPaddingException expected");
-        } catch (BadPaddingException e) {
-            //expected
+            fail();
+        } catch (BadPaddingException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class, byte[].class}
-    )
     public void test_doFinal$BII$B() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         byte[] b1 = new byte[30];
@@ -1588,17 +1132,15 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKeyDES);
         try {
             c.doFinal(b, 0, 10, b1);
-            fail("IllegalBlockSizeException expected");
-        } catch (IllegalBlockSizeException e) {
-            //expected
+            fail();
+        } catch (IllegalBlockSizeException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
         try {
             c.doFinal(b, 0, 10, b1);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1615,9 +1157,8 @@
 
         try {
             c.doFinal(b1, 0, 24, new byte[42]);
-            fail("BadPaddingException expected");
-        } catch (BadPaddingException e) {
-            //expected
+            fail();
+        } catch (BadPaddingException expected) {
         }
 
         b1 = new byte[6];
@@ -1625,34 +1166,20 @@
         c.init(Cipher.ENCRYPT_MODE, cipherKey);
         try {
             c.doFinal(b, 3, 6, b1);
-            fail("No expected ShortBufferException");
-        } catch (ShortBufferException e) {
-            //expected
+            fail();
+        } catch (ShortBufferException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Checks exception",
-        method = "update",
-        args = {byte[].class}
-    )
     public void test_update$B() throws Exception {
         Cipher cipher = Cipher.getInstance("DESEDE/CBC/PKCS5Padding");
         try {
             cipher.update(new byte[64]);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "update",
-        args = {byte[].class, int.class, int.class, byte[].class}
-    )
     public void test_() throws Exception {
         byte[] b = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20};
         byte[] b1 = new byte[30];
@@ -1661,9 +1188,8 @@
 
         try {
             c.update(b, 0, 10, b1);
-            fail("IllegalStateException expected");
-        } catch (IllegalStateException e) {
-            //expected
+            fail();
+        } catch (IllegalStateException expected) {
         }
 
         c = Cipher.getInstance("DES/CBC/NoPadding");
@@ -1674,9 +1200,8 @@
 
         try {
             c.update(b, 3, 15, b1);
-            fail("No expected ShortBufferException");
-        } catch (ShortBufferException e) {
-            //expected
+            fail();
+        } catch (ShortBufferException expected) {
         }
     }
 
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/EncryptedPrivateKeyInfoTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/EncryptedPrivateKeyInfoTest.java
index 8e277b3..63e5600 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/EncryptedPrivateKeyInfoTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/EncryptedPrivateKeyInfoTest.java
@@ -22,10 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.security.AlgorithmParameters;
 import java.security.AlgorithmParametersSpi;
@@ -57,7 +53,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(EncryptedPrivateKeyInfo.class)
 /**
  * Test for EncryptedPrivateKeyInfo class.
  *
@@ -199,12 +194,6 @@
         super.setUp();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgName",
-        args = {}
-    )
     public void test_getAlgName () {
         boolean performed = false;
         for (int i = 0; i < algName.length; i++) {
@@ -244,12 +233,6 @@
      * @throws IOException
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfobyteArray1() throws Exception {
         new EncryptedPrivateKeyInfo(EncryptedPrivateKeyInfoData
                 .getValidEncryptedPrivateKeyInfoEncoding("DH"));
@@ -265,12 +248,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfobyteArray2()
             throws IOException {
         try {
@@ -287,12 +264,6 @@
      * Test preconditions: wrong encoding passed as a parameter <br>
      * Expected: <code>IOException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfobyteArray3() {
         try {
             new EncryptedPrivateKeyInfo(new byte[0]);
@@ -308,12 +279,6 @@
      * Test preconditions: wrong encoding passed as a parameter <br>
      * Expected: <code>IOException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfobyteArray4() {
         try {
             new EncryptedPrivateKeyInfo(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9,
@@ -330,12 +295,6 @@
      * Test preconditions: wrong encoding passed as a parameter <br>
      * Expected: <code>IOException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfobyteArray5() throws Exception {
         byte[] enc = null;
         try {
@@ -427,12 +386,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfobyteArray6() throws Exception {
         byte[] encoded = EncryptedPrivateKeyInfoData
                 .getValidEncryptedPrivateKeyInfoEncoding("DSA");
@@ -452,12 +405,6 @@
      * Test preconditions: valid parameters passed <br>
      * Expected: must pass without any exceptions
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(String, byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.lang.String.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoStringbyteArray1() {
         boolean performed = false;
 
@@ -482,12 +429,6 @@
      * Test preconditions: pass nonexistent algorithm name <br>
      * Expected: <code>NoSuchAlgorithmException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(String, byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.lang.String.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoStringbyteArray2() {
         try {
             new EncryptedPrivateKeyInfo("bla-bla",
@@ -515,12 +456,6 @@
      *
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(String, byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.lang.String.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoStringbyteArray3()
             throws NoSuchAlgorithmException {
         // pass null as name
@@ -547,12 +482,6 @@
      * Test preconditions: pass empty encrypted data <br>
      * Expected: <code>IllegalArgumentException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(String, byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.lang.String.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoStringbyteArray4()
             throws Exception {
         try {
@@ -572,12 +501,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(String, byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.lang.String.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoStringbyteArray5()
             throws Exception {
         byte[] encryptedDataCopy = EncryptedPrivateKeyInfoData.encryptedData
@@ -593,15 +516,9 @@
     }
 
     /**
-     * @tests javax/crypto/EncryptedPrivateKeyInfo(String, byte[])
+     * javax/crypto/EncryptedPrivateKeyInfo(String, byte[])
      * Checks exception order
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for EncryptedPrivateKeyInfo(String, byte[]) constructor.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.lang.String.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoStringbyteArray6() {
         //Regression for HARMONY-768
         try {
@@ -630,12 +547,6 @@
      * @throws IOException
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality checked. NoSuchAlgorithmException should be tested for complete tests subset.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.security.AlgorithmParameters.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoAlgorithmParametersbyteArray1()
             throws IOException, NoSuchAlgorithmException {
         AlgorithmParameters ap = null;
@@ -683,12 +594,6 @@
      * @throws NoSuchAlgorithmException
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "NullPointerException checked.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.security.AlgorithmParameters.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoAlgorithmParametersbyteArray2()
             throws NoSuchAlgorithmException, IOException {
         // 1: pass null as AlgorithmParameters
@@ -723,12 +628,6 @@
      * @throws NoSuchAlgorithmException
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "IllegalArgumentException checked.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.security.AlgorithmParameters.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoAlgorithmParametersbyteArray3()
             throws Exception {
         try {
@@ -755,12 +654,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality checked.",
-        method = "EncryptedPrivateKeyInfo",
-        args = {java.security.AlgorithmParameters.class, byte[].class}
-    )
     public final void testEncryptedPrivateKeyInfoAlgorithmParametersbyteArray4()
             throws Exception {
         AlgorithmParameters ap = AlgorithmParameters.getInstance("DSA");
@@ -790,12 +683,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getAlgParameters method.",
-        method = "getAlgParameters",
-        args = {}
-    )
     public final void testGetAlgParameters01() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -824,12 +711,6 @@
         assertTrue("Test not performed", performed);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getAlgParameters method.",
-        method = "getAlgParameters",
-        args = {}
-    )
     public final void testGetAlgParameters01_01() throws Exception {
         byte[] validEncodingWithUnknownAlgOID = EncryptedPrivateKeyInfoData
                 .getValidEncryptedPrivateKeyInfoEncoding("DH");
@@ -851,12 +732,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getAlgParameters method.",
-        method = "getAlgParameters",
-        args = {}
-    )
     public final void testGetAlgParameters02() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -890,12 +765,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getAlgParameters method.",
-        method = "getAlgParameters",
-        args = {}
-    )
     public final void testGetAlgParameters03() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -925,12 +794,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getAlgParameters method.",
-        method = "getAlgParameters",
-        args = {}
-    )
     public final void testGetAlgParameters04() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -967,12 +830,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getEncryptedData method.",
-        method = "getEncryptedData",
-        args = {}
-    )
     public final void testGetEncryptedData01() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1002,12 +859,6 @@
      * name and encrypted data as a parameters <br>
      * Expected: the equivalent encrypted data must be returned
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getEncryptedData method.",
-        method = "getEncryptedData",
-        args = {}
-    )
     public final void testGetEncryptedData02() {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1038,12 +889,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getEncryptedData method.",
-        method = "getEncryptedData",
-        args = {}
-    )
     public final void testGetEncryptedData03() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1078,12 +923,6 @@
      * Expected: refs to encrypted data byte array passed to the ctor and
      * returned by the method under test must be different
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getEncryptedData method.",
-        method = "getEncryptedData",
-        args = {}
-    )
     public final void testGetEncryptedData04() {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1116,12 +955,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check IOException",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded01() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1151,12 +984,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check IOException",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded02() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1192,12 +1019,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check IOException",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded03() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1236,12 +1057,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check IOException",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded04() throws IOException {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1266,12 +1081,6 @@
         assertTrue("Test not performed", performed);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getKeySpec method.",
-        method = "getKeySpec",
-        args = {javax.crypto.Cipher.class}
-    )
     public final void testGetKeySpecCipher01() {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1301,12 +1110,6 @@
     /**
      * Encrypted data contains valid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getKeySpec method.",
-        method = "getKeySpec",
-        args = {javax.crypto.Cipher.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecCipher01() {
         boolean performed = false;
 
@@ -1347,12 +1150,6 @@
     /**
      * Encrypted data contains invalid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getKeySpec method.",
-        method = "getKeySpec",
-        args = {javax.crypto.Cipher.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecCipher02() {
         boolean performed = false;
         for (int i = 0; i < algName.length; i++) {
@@ -1387,12 +1184,6 @@
         assertTrue("Test not performed", performed);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check NoSuchAlgorithmException",
-        method = "getKeySpec",
-        args = {java.security.Key.class}
-    )
     public final void testGetKeySpecKey01() {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1422,12 +1213,6 @@
     /**
      * Encrypted data contains valid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check NoSuchAlgorithmException",
-        method = "getKeySpec",
-        args = {java.security.Key.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecKey01() {
         boolean performed = false;
         for (int i = 0; i < algName.length; i++) {
@@ -1466,12 +1251,6 @@
     /**
      * Encrypted data contains invalid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check NoSuchAlgorithmException",
-        method = "getKeySpec",
-        args = {java.security.Key.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecKey02() {
         boolean performed = false;
         for (int i = 0; i < algName.length; i++) {
@@ -1502,12 +1281,6 @@
         assertTrue("Test not performed", performed);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "NoSuchAlgorithmException can not be checking",
-        method = "getKeySpec",
-        args = {java.security.Key.class, java.lang.String.class}
-    )
     public final void testGetKeySpecKeyString01() throws Exception {
         boolean performed = false;
         for (int i = 0; i < EncryptedPrivateKeyInfoData.algName0.length; i++) {
@@ -1575,12 +1348,6 @@
     /**
      * Encrypted data contains valid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "In subset missed NoSuchProviderException & NoSuchAlgorithmException checking",
-        method = "getKeySpec",
-        args = {java.security.Key.class, java.lang.String.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecKeyString01() throws Exception {
         boolean performed = false;
         for (int i = 0; i < algName.length; i++) {
@@ -1630,12 +1397,6 @@
     /**
      * Encrypted data contains invalid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "In subset missed NoSuchProviderException & NoSuchAlgorithmException checking",
-        method = "getKeySpec",
-        args = {java.security.Key.class, java.lang.String.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecKeyString02() throws Exception {
         boolean performed = false;
         for (int i = 0; i < algName.length; i++) {
@@ -1680,12 +1441,6 @@
         assertTrue("Test not performed", performed);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check NoSuchAlgorithmException",
-        method = "getKeySpec",
-        args = {java.security.Key.class, java.security.Provider.class}
-    )
     public final void testGetKeySpecKeyProvider01() throws Exception {
         boolean performed = false;
 
@@ -1734,12 +1489,6 @@
     /**
      * Encrypted data contains valid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check NoSuchAlgorithmException",
-        method = "getKeySpec",
-        args = {java.security.Key.class, java.security.Provider.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecKeyProvider01() {
         boolean performed = false;
 
@@ -1789,12 +1538,6 @@
     /**
      * Encrypted data contains invalid PKCS8 key info encoding
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Can not check NoSuchAlgorithmException",
-        method = "getKeySpec",
-        args = {java.security.Key.class, java.security.Provider.class}
-    )
     public final void test_ROUNDTRIP_GetKeySpecKeyProvider02() {
         boolean performed = false;
 
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismExceptionTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismExceptionTest.java
index b1fbc5b..866ac96 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismExceptionTest.java
@@ -22,17 +22,10 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.crypto.ExemptionMechanismException;
 
 import junit.framework.TestCase;
 
-
-@TestTargetClass(ExemptionMechanismException.class)
 /**
  * Tests for <code>ExemptionMechanismException</code> class constructors and
  * methods.
@@ -56,12 +49,6 @@
      * Test for <code>ExemptionMechanismException()</code> constructor
      * Assertion: constructs ExemptionMechanismException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ExemptionMechanismException",
-        args = {}
-    )
     public void testExemptionMechanismException01() {
         ExemptionMechanismException tE = new ExemptionMechanismException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -78,12 +65,6 @@
      * Assertion: constructs ExemptionMechanismException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ExemptionMechanismException",
-        args = {java.lang.String.class}
-    )
     public void testExemptionMechanismException02() {
         ExemptionMechanismException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -104,12 +85,6 @@
      * Assertion: constructs ExemptionMechanismException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ExemptionMechanismException",
-        args = {java.lang.String.class}
-    )
     public void testExemptionMechanismException03() {
         String msg = null;
         ExemptionMechanismException tE = new ExemptionMechanismException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismSpiTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismSpiTest.java
index f0ca626..b363e91 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismSpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigInteger;
 import java.security.AlgorithmParameters;
 import java.security.InvalidAlgorithmParameterException;
@@ -44,7 +39,6 @@
 import junit.framework.TestCase;
 
 
-@TestTargetClass(ExemptionMechanismSpi.class)
 /**
  * Tests for <code>ExemptionMechanismSpi</code> class constructors and
  * methods.
@@ -93,12 +87,6 @@
      * constructs ExemptionMechanismSpi
      * @throws Exception
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ExemptionMechanismSpi",
-        args = {}
-    )
     public void testExemptionMechanismSpi01() throws Exception {
         Mock_ExemptionMechanismSpi emSpi = new Mock_ExemptionMechanismSpi(){};
         int len = MyExemptionMechanismSpi.getLength();
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java
index 0aadd59..f617adb 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ExemptionMechanismTest.java
@@ -17,10 +17,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 import dalvik.annotation.SideEffect;
 
 import java.math.BigInteger;
@@ -48,12 +44,10 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(ExemptionMechanism.class)
 /**
  * Tests for <code>ExemptionMechanism</code> class constructors and methods
  *
  */
-
 public class ExemptionMechanismTest extends TestCase {
 
     private static final String srvExemptionMechanism = "ExemptionMechanism";
@@ -66,12 +60,6 @@
      * Test for <code>ExemptionMechanism</code> constructor
      * Assertion: creates new object using provider and mechanism name
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ExemptionMechanism",
-        args = {javax.crypto.ExemptionMechanismSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testExemptionMechanism() throws Exception {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
                 "Provider for ExemptionMechanism testing",
@@ -108,15 +96,9 @@
     }
 
     /**
-     * @tests javax/crypto/ExemptionMechanism#getInstance(String algorithm, String provider)
+     * javax/crypto/ExemptionMechanism#getInstance(String algorithm, String provider)
      * Checks exception order
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstance() throws Exception {
         //Regression for HARMONY-762
         try {
@@ -136,12 +118,6 @@
     /**
      * Test for <code>isCryptoAllowed(Key key)</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isCryptoAllowed",
-        args = {java.security.Key.class}
-    )
     public void testIsCryptoAllowed() throws Exception {
 
         //Regression for HARMONY-1029
@@ -175,12 +151,6 @@
     /**
      * Test for <code>genExemptionBlob((byte[] output, int outputOffset)</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test",
-        method = "genExemptionBlob",
-        args = {byte[].class, int.class}
-    )
     public void testGenExemptionBlob() throws Exception {
         //Regression for HARMONY-1029
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
@@ -216,12 +186,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "finalize",
-        args = {}
-    )
     @SideEffect("Causes OutOfMemoryError to test finalization")
     public void test_finalize () {
         Mock_ExemptionMechanism mem = new Mock_ExemptionMechanism(null, null, "Name");
@@ -268,21 +232,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "genExemptionBlob",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = ExemptionMechanismSpi.class,
-            method = "engineGenExemptionBlob",
-            args = {}
-        )
-    })
     public void test_genExemptionBlob() throws InvalidKeyException,
     ExemptionMechanismException {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
@@ -321,12 +270,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "genExemptionBlob",
-        args = {byte[].class}
-    )
     public void test_genExemptionBlob$B() throws InvalidKeyException,
     ExemptionMechanismException, ShortBufferException {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
@@ -367,21 +310,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "genExemptionBlob",
-            args = {byte[].class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = ExemptionMechanismSpi.class,
-            method = "engineGenExemptionBlob",
-            args = {byte[].class, int.class}
-        )
-    })
     public void test_genExemptionBlob$BI() throws InvalidKeyException,
     ExemptionMechanismException, ShortBufferException {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
@@ -422,12 +350,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Tests Exceptions",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() throws Exception {
         try {
             ExemptionMechanism.getInstance((String) null);
@@ -453,12 +375,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Tests Exceptions",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider()
     throws Exception {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
@@ -492,12 +408,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() throws Exception {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
                 "Provider for ExemptionMechanism testing",
@@ -513,21 +423,6 @@
         assertEquals(defaultAlg, em.getName());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getOutputSize",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = ExemptionMechanismSpi.class,
-            method = "engineGetOutputSize",
-            args = {int.class}
-        )
-    })
     public void test_getOutputSizeI() throws Exception {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
                 "Provider for ExemptionMechanism testing",
@@ -551,12 +446,6 @@
         assertEquals(10, em.getOutputSize(10));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws Exception {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
                 "Provider for ExemptionMechanism testing",
@@ -572,21 +461,6 @@
         assertEquals(mProv, em.getProvider());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {java.security.Key.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = ExemptionMechanismSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class}
-        )
-    })
     public void test_initLjava_security_Key() throws Exception {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
                 "Provider for ExemptionMechanism testing",
@@ -620,21 +494,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {java.security.Key.class, java.security.AlgorithmParameters.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = ExemptionMechanismSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.AlgorithmParameters.class}
-        )
-    })
     public void test_initLjava_security_KeyLjava_security_AlgorithmParameters()
             throws Exception {
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
@@ -676,21 +535,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = ExemptionMechanismSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-        )
-    })
     public void test_initLjava_security_KeyLjava_security_spec_AlgorithmParameterSpec()
             throws Exception{
         Provider mProv = (new SpiEngUtils()).new MyProvider("MyExMechProvider",
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/IllegalBlockSizeExceptionTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/IllegalBlockSizeExceptionTest.java
index 8887077..4b4ae12 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/IllegalBlockSizeExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/IllegalBlockSizeExceptionTest.java
@@ -22,17 +22,11 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.crypto.IllegalBlockSizeException;
 
 import junit.framework.TestCase;
 
 
-@TestTargetClass(IllegalBlockSizeException.class)
 /**
  * Tests for <code>IllegalBlockSizeException</code> class constructors and
  * methods.
@@ -51,12 +45,6 @@
      * Test for <code>IllegalBlockSizeException()</code> constructor
      * Assertion: constructs IllegalBlockSizeException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IllegalBlockSizeException",
-        args = {}
-    )
     public void testIllegalBlockSizeException01() {
         IllegalBlockSizeException tE = new IllegalBlockSizeException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * Assertion: constructs IllegalBlockSizeException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IllegalBlockSizeException",
-        args = {java.lang.String.class}
-    )
     public void testIllegalBlockSizeException02() {
         IllegalBlockSizeException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * Assertion: constructs IllegalBlockSizeException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IllegalBlockSizeException",
-        args = {java.lang.String.class}
-    )
     public void testIllegalBlockSizeException03() {
         String msg = null;
         IllegalBlockSizeException tE = new IllegalBlockSizeException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementSpiTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementSpiTest.java
index 7c0313d..83d6ed7 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementSpiTest.java
@@ -37,16 +37,10 @@
 
 import org.apache.harmony.crypto.tests.support.MyKeyAgreementSpi;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-@TestTargetClass(KeyAgreementSpi.class)
 /**
  * Tests for <code>KeyAgreementSpi</code> class constructors and methods.
  *
  */
-
 public class KeyAgreementSpiTest extends TestCase {
     class Mock_KeyAgreementSpi extends MyKeyAgreementSpi {
 
@@ -90,12 +84,6 @@
      * Test for <code>KeyAgreementSpi</code> constructor Assertion: constructs
      * KeyAgreementSpi
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyAgreementSpi",
-        args = {}
-    )
     public void testKeyAgreementSpi01() throws InvalidKeyException,
             ShortBufferException, NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementTest.java
index b79faa5..99d127a 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyAgreementTest.java
@@ -22,12 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigInteger;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
@@ -54,12 +48,10 @@
 import junit.framework.TestCase;
 
 
-@TestTargetClass(KeyAgreement.class)
 /**
  * Tests for KeyAgreement constructor and methods
  *
  */
-
 public class KeyAgreementTest extends TestCase {
 
     public static final String srvKeyAgreement = "KeyAgreement";
@@ -124,12 +116,6 @@
      * throws NullPointerException when algorithm is null throws
      * NoSuchAlgorithmException when algorithm isnot available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstanceString01() throws NoSuchAlgorithmException {
         try {
             KeyAgreement.getInstance(null);
@@ -150,12 +136,6 @@
      * Test for <code> getInstance(String algorithm) </code> method Assertions:
      * returns KeyAgreement object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstanceString02() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -174,12 +154,6 @@
      * method Assertions: throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstanceStringString01()
             throws NoSuchAlgorithmException, IllegalArgumentException,
             NoSuchProviderException {
@@ -208,12 +182,6 @@
      * or empty throws NoSuchProviderException when provider has not be
      * configured
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstanceStringString02()
             throws IllegalArgumentException, NoSuchAlgorithmException,
             NoSuchProviderException {
@@ -249,12 +217,6 @@
      * Test for <code> getInstance(String algorithm, String provider)</code>
      * method Assertions: returns KeyAgreement object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstanceStringString03()
             throws IllegalArgumentException, NoSuchAlgorithmException,
             NoSuchProviderException {
@@ -278,12 +240,6 @@
      * method Assertions: throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm isnot available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstanceStringProvider01()
             throws NoSuchAlgorithmException, IllegalArgumentException {
         if (!DEFSupported) {
@@ -309,12 +265,6 @@
      * Test for <code> getInstance(String algorithm, Provider provider)</code>
      * method Assertions: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstanceStringProvider02()
             throws NoSuchAlgorithmException, IllegalArgumentException {
         if (!DEFSupported) {
@@ -335,12 +285,6 @@
      * Test for <code> getInstance(String algorithm, Provider provider)</code>
      * method Assertions: returns KeyAgreement object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstanceStringProvider03()
             throws IllegalArgumentException, NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -366,53 +310,6 @@
      * sharedsecret in buffer and return numbers of bytes; returns SecretKey
      * object
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality only.",
-            method = "init",
-            args = {java.security.Key.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality only.",
-            method = "generateSecret",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality only.",
-            method = "generateSecret",
-            args = {byte[].class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality only.",
-            method = "generateSecret",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality only.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineGenerateSecret",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality only.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineGenerateSecret",
-            args = {byte[].class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality only.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineGenerateSecret",
-            args = {java.lang.String.class}
-        )
-    })
     public void testGenerateSecret03() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -441,21 +338,6 @@
      * Test for <code>doPhase(Key key, boolean lastPhase)</code> method
      * Assertion: throws InvalidKeyException if key is not appropriate
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "doPhase",
-            args = {java.security.Key.class, boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = KeyAgreementSpi.class,
-            method = "engineDoPhase",
-            args = {java.security.Key.class, boolean.class}
-        )
-    })
     public void testDoPhase() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -503,34 +385,6 @@
      * <code>init(Key key, AlgorithmParameterSpec params, SecureRandom random)</code>
      * Assertion: throws InvalidKeyException when key is inappropriate
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks InvalidKeyException.",
-            method = "init",
-            args = {java.security.Key.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks InvalidKeyException.",
-            method = "init",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks InvalidKeyException.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks InvalidKeyException.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.SecureRandom.class}
-        )
-    })
     public void testInit01() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -584,21 +438,6 @@
      * Assertion: throws AlgorithmParameterException when params are
      * inappropriate
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks InvalidAlgorithmParameterException.This is a complete subset of tests for exceptions checking for init methods group",
-            method = "init",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks InvalidAlgorithmParameterException.This is a complete subset of tests for exceptions checking for init methods group",
-            clazz = KeyAgreementSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        )
-    })
     public void testInit02() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -638,47 +477,6 @@
      * <code>generateSecret()</code>
      * Assertions: initializes KeyAgreement and returns byte array
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "init",
-            args = {java.security.Key.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "init",
-            args = {java.security.Key.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "generateSecret",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineGenerateSecret",
-            args = {}
-        )
-    })
     public void testInit03() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -724,47 +522,6 @@
      * <code>generateSecret()</code>
      * Assertions: initializes KeyAgreement and returns byte array
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks functionality.",
-            method = "init",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks functionality.",
-            method = "init",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks functionality.",
-            method = "generateSecret",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks functionality.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks functionality.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Checks functionality.",
-            clazz = KeyAgreementSpi.class,
-            method = "engineGenerateSecret",
-            args = {}
-        )
-    })
     public void testInit04() throws Exception,
             InvalidAlgorithmParameterException {
         if (!DEFSupported) {
@@ -826,22 +583,10 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyAgreement",
-        args = {javax.crypto.KeyAgreementSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void test_constructor() {
         assertNotNull(new Mock_KeyAgreement(null, null, null));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws NoSuchAlgorithmException {
         Mock_KeyAgreement mka = new Mock_KeyAgreement(null, null, null);
         assertNull(mka.getAlgorithm());
@@ -854,12 +599,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws NoSuchAlgorithmException {
         KeyAgreement keyA;
         for (int i = 0; i < validValues.length; i++) {
@@ -868,20 +607,6 @@
         }
     }
 
-@TestTargets({
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "generateSecret",
-        args = {byte[].class, int.class}
-    ),
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        clazz = KeyAgreementSpi.class,
-        method = "engineGenerateSecret",
-        args = {byte[].class, int.class}
-    )})
     public void test_generateSecret$BI() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -908,20 +633,6 @@
         }
     }
 
-@TestTargets({
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "generateSecret",
-            args = {java.lang.String.class}
-        ),
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        clazz = KeyAgreementSpi.class,
-        method = "engineGenerateSecret",
-        args = {java.lang.String.class}
-    )})
     public void test_generateSecretLjava_lang_String() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -948,12 +659,6 @@
         }
     }
 
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {java.security.Key.class, java.security.SecureRandom.class}
-        )
     public void test_initLjava_security_KeyLjava_security_SecureRandom() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorSpiTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorSpiTest.java
index ff0fd86..7add99e 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorSpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidAlgorithmParameterException;
 import java.security.SecureRandom;
 import java.security.spec.AlgorithmParameterSpec;
@@ -37,12 +32,10 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(KeyGeneratorSpi.class)
 /**
  * Tests for <code>KeyGeneratorSpi</code> class constructors and methods.
  *
  */
-
 public class KeyGeneratorSpiTest extends TestCase {
     class Mock_KeyGeneratorSpi extends MyKeyGeneratorSpi {
 
@@ -73,7 +66,6 @@
      * Test for <code>KeyGeneratorSpi</code> constructor Assertion: constructs
      * KeyGeneratorSpi
      */
-    @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "KeyGeneratorSpi", args = {})
     public void testKeyGeneratorSpi01() throws InvalidAlgorithmParameterException {
         Mock_KeyGeneratorSpi kgSpi = new Mock_KeyGeneratorSpi();
         assertNull("Not null result", kgSpi.engineGenerateKey());
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorTest.java
index a8ce653..e6b50e1 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/KeyGeneratorTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigInteger;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidParameterException;
@@ -50,12 +45,10 @@
 import junit.framework.TestCase;
 
 
-@TestTargetClass(KeyGenerator.class)
 /**
  * Tests for KeyGenerator constructor and methods
  *
  */
-
 public class KeyGeneratorTest extends TestCase {
 
     public static final String srvKeyGenerator = "KeyGenerator";
@@ -115,12 +108,6 @@
      * Test for <code>KeyGenerator</code> constructor Assertion: returns
      * KeyGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyGenerator",
-        args = {javax.crypto.KeyGeneratorSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testKeyGenerator() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         if (!DEFSupported) {
@@ -167,12 +154,6 @@
      * throws NullPointerException when algorithm is null throws
      * NoSuchAlgorithmException when algorithm isnot available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstanceString01() throws NoSuchAlgorithmException {
         try {
             KeyGenerator.getInstance(null);
@@ -193,12 +174,6 @@
      * Test for <code> getInstance(String algorithm) </code> method
      * Assertions: returns KeyGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstanceString02() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -217,12 +192,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm isnot available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstanceStringString01() throws
             NoSuchAlgorithmException, IllegalArgumentException,
             NoSuchProviderException {
@@ -251,12 +220,6 @@
      * throws IllegalArgumentException when provider is null or empty
      * throws NoSuchProviderException when provider has not be configured
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstanceStringString02() throws IllegalArgumentException,
             NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) {
@@ -291,12 +254,6 @@
      * Test for <code> getInstance(String algorithm, String provider)</code> method
      * Assertions: returns KeyGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstanceStringString03() throws IllegalArgumentException,
             NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) {
@@ -317,12 +274,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm isnot available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstanceStringProvider01() throws NoSuchAlgorithmException,
             IllegalArgumentException {
         if (!DEFSupported) {
@@ -348,12 +299,6 @@
      * Assertions:
      * throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstanceStringProvider02() throws NoSuchAlgorithmException,
             IllegalArgumentException {
         if (!DEFSupported) {
@@ -374,12 +319,6 @@
      * Test for <code> getInstance(String algorithm, Provider provider)</code> method
      * Assertions: returns KeyGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstanceStringProvider03() throws IllegalArgumentException,
             NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -400,18 +339,6 @@
      * Assertion: throws InvalidParameterException if keysize is wrong
      *
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "init",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "init",
-            args = {int.class, java.security.SecureRandom.class}
-        )
-    })
     public void testInitKey() throws Exception {
         byte flag = 0xF;
         if (!DEFSupported) {
@@ -451,27 +378,6 @@
      * <code>init(AlgorithmParameterSpec params, SecureRandom random)</code> methods
      * Assertion: throws InvalidAlgorithmParameterException when params is null
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks exceptions only",
-            method = "init",
-            args = {java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks exceptions only",
-            method = "init",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks exceptions only",
-            clazz = KeyGeneratorSpi.class,
-            method = "engineInit",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        )
-    })
     public void testInitParams() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -506,21 +412,6 @@
      * returns SecretKey object
      *
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "generateKey",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = KeyGeneratorSpi.class,
-            method = "engineGenerateKey",
-            args = {}
-        )
-    })
     public void testGenerateKey() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -550,12 +441,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws NoSuchAlgorithmException {
         KeyGenerator kg = null;
 
@@ -568,12 +453,6 @@
         assertNull(kg.getAlgorithm());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider () throws NoSuchAlgorithmException {
         KeyGenerator kg = null;
 
@@ -586,21 +465,6 @@
         assertNull(kg.getProvider());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {int.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = KeyGeneratorSpi.class,
-            method = "engineInit",
-            args = {int.class, java.security.SecureRandom.class}
-        )
-    })
     public void test_initILjava_security_SecureRandom() throws NoSuchAlgorithmException {
         SecureRandom random = null;
         KeyGenerator kg = null;
@@ -622,21 +486,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "init",
-            args = {java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = KeyGeneratorSpi.class,
-            method = "engineInit",
-            args = {java.security.SecureRandom.class}
-        )
-    })
     public void test_Ljava_security_SecureRandom() throws NoSuchAlgorithmException {
         SecureRandom random = null;
         KeyGenerator kg = null;
@@ -649,12 +498,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {java.security.spec.AlgorithmParameterSpec.class}
-    )
     public void test_initLjava_security_spec_AlgorithmParameterSpec ()
             throws Exception {
         KeyGenerator kg = null;
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacSpiTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacSpiTest.java
index 48c69d0..550b27b 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacSpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.nio.ByteBuffer;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidKeyException;
@@ -41,12 +36,10 @@
 import junit.framework.TestCase;
 
 
-@TestTargetClass(MacSpi.class)
 /**
  * Tests for <code>MacSpi</code> class constructors and methods.
  *
  */
-
 public class MacSpiTest extends TestCase {
 class Mock_MacSpi extends MyMacSpi {
 
@@ -164,26 +157,6 @@
      * Test for <code>MacSpi</code> constructor
      * Assertion: constructs MacSpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All others methods are abstract.",
-            method = "MacSpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All others methods are abstract.",
-            method = "engineUpdate",
-            args = {java.nio.ByteBuffer.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All others methods are abstract.",
-            method = "clone",
-            args = {}
-        )
-    })
     public void testMacSpiTests01() throws Exception {
         Mock_MacSpi mSpi = new Mock_MacSpi();
 
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java
index 5950072..e808bc1 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/MacTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigInteger;
 import java.nio.ByteBuffer;
 import java.security.InvalidAlgorithmParameterException;
@@ -52,12 +47,10 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-@TestTargetClass(Mac.class)
 /**
  * Tests for Mac class constructors and methods
  *
  */
-
 public class MacTest extends TestCase {
 
     public static final String srvMac = "Mac";
@@ -118,12 +111,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testMac01() {
         try {
             Mac.getInstance(null);
@@ -145,12 +132,6 @@
      * Test for <code>getInstance(String algorithm)</code> method
      * Assertion: returns Mac object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testMac02() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -168,12 +149,6 @@
      * throws IllegalArgumentException when provider is null or empty
      * throws NoSuchProviderException when provider is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testMac03() throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -209,12 +184,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testMac04() throws NoSuchAlgorithmException,
             IllegalArgumentException, NoSuchProviderException {
         if (!DEFSupported) {
@@ -240,12 +209,6 @@
      * Test for <code>getInstance(String algorithm, String provider)</code> method
      * Assertion: returns Mac object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testMac05() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException {
         if (!DEFSupported) {
@@ -265,12 +228,6 @@
      * Test for <code>getInstance(String algorithm, Provider provider)</code> method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testMac06() throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -291,12 +248,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testMac07() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException {
         if (!DEFSupported) {
@@ -323,12 +274,6 @@
      * Test for <code>getInstance(String algorithm, Provider provider)</code> method
      * Assertion: returns Mac object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testMac08() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException {
         if (!DEFSupported) {
@@ -347,71 +292,6 @@
      * Assertion: throws IllegalStateException when Mac is not initialized
      * @throws Exception
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            method = "doFinal",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineDoFinal",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            method = "doFinal",
-            args = {byte[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            method = "doFinal",
-            args = {byte[].class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            method = "update",
-            args = {byte.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineUpdate",
-            args = {byte.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            method = "update",
-            args = {byte[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            method = "update",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            method = "update",
-            args = {java.nio.ByteBuffer.class}
-        )
-    })
     public void testMac09() throws Exception {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -475,12 +355,6 @@
      * throws ShotBufferException when outOffset  is negative or
      * outOffset >= output.length  or when given buffer is small
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Checks ShortBufferException",
-        method = "doFinal",
-        args = {byte[].class, int.class}
-    )
     public void testMac10() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException,
             IllegalStateException, InvalidKeyException {
@@ -529,27 +403,6 @@
      * <code>doFinal()</code> methods Assertion: Mac result is stored in
      * output buffer
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "doFinal",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineDoFinal",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "doFinal",
-            args = {byte[].class, int.class}
-        )
-    })
     public void testMac11() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException, IllegalStateException,
             InvalidKeyException, ShortBufferException {
@@ -576,27 +429,6 @@
      * Test for <code>doFinal(byte[] input)</code> method
      * Assertion: update Mac and returns result
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "doFinal",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineDoFinal",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "doFinal",
-            args = {byte[].class}
-        )
-    })
     public void testMac12() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException, IllegalStateException,
             InvalidKeyException  {
@@ -632,21 +464,6 @@
      * Assertion: throws IllegalArgumentException when offset or len is negative,
      * offset + len >= input.length
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalArgumentException",
-            method = "update",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        )
-    })
     public void testMac13() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException, IllegalStateException,
             InvalidKeyException {
@@ -688,34 +505,6 @@
      * methods
      * Assertion: updates Mac
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "update",
-            args = {byte.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineUpdate",
-            args = {byte.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality.",
-            method = "update",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        )
-    })
     public void testMac14() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException, IllegalStateException,
             InvalidKeyException {
@@ -758,12 +547,6 @@
      * Test for <code>clone()</code> method
      * Assertion: returns Mac object or throws CloneNotSupportedException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void testMacClone() throws NoSuchAlgorithmException, CloneNotSupportedException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -789,27 +572,6 @@
      * Assertion: throws InvalidKeyException and InvalidAlgorithmParameterException
      * when parameters are not appropriate
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks exceptions",
-            method = "init",
-            args = {java.security.Key.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks exceptions",
-            method = "init",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks exceptions",
-            clazz = MacSpi.class,
-            method = "engineInit",
-            args = {java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-        )
-    })
     public void testInit() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException, IllegalStateException, InvalidAlgorithmParameterException,
             InvalidKeyException {
@@ -859,27 +621,6 @@
      * methods
      * Assertion: processes Mac; if input is null then do nothing
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality",
-            method = "update",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality",
-            method = "update",
-            args = {java.nio.ByteBuffer.class}
-        )
-    })
     public void testUpdateByteBuffer01() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException, IllegalStateException, InvalidAlgorithmParameterException,
             InvalidKeyException {
@@ -923,27 +664,6 @@
      * methods
      * Assertion: processes Mac
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality",
-            method = "update",
-            args = {java.nio.ByteBuffer.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks functionality",
-            method = "update",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks IllegalStateException only but for all methods. Not enough for doFinal(byte[] output, int outOffset) - it can throw ShortBufferException",
-            clazz = MacSpi.class,
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        )
-    })
     public void testUpdateByteBuffer02() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException, IllegalStateException, InvalidAlgorithmParameterException,
             InvalidKeyException {
@@ -979,12 +699,6 @@
      * Test for <code>clone()</code> method
      * Assertion: clone if provider is clo
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void testClone()  {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -1006,21 +720,6 @@
      * Test for <code>getMacLength()</code> method
      * Assertion: return Mac length
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getMacLength",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = MacSpi.class,
-            method = "engineGetMacLength",
-            args = {}
-        )
-    })
     public void testGetMacLength() {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -1037,21 +736,6 @@
      * Test for <code>reset()</code> method
      * Assertion: return Mac length
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "reset",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = MacSpi.class,
-            method = "engineReset",
-            args = {}
-        )
-    })
     public void testReset() throws InvalidKeyException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -1089,12 +773,6 @@
      * Test for <code>Mac</code> constructor
      * Assertion: returns Mac object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Mac",
-        args = {javax.crypto.MacSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testMacConstructor() throws NoSuchAlgorithmException,
             InvalidKeyException, InvalidAlgorithmParameterException {
         if (!DEFSupported) {
@@ -1128,12 +806,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws NoSuchAlgorithmException {
         Mac mac;
         for (int i = 0; i < validValues.length; i++) {
@@ -1145,12 +817,6 @@
         assertNull(mac.getAlgorithm());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws NoSuchAlgorithmException {
         Mac mac;
         for (int i = 0; i < validValues.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NoSuchPaddingExceptionTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NoSuchPaddingExceptionTest.java
index 34d705c..148b985 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NoSuchPaddingExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NoSuchPaddingExceptionTest.java
@@ -22,17 +22,11 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.crypto.NoSuchPaddingException;
 
 import junit.framework.TestCase;
 
 
-@TestTargetClass(NoSuchPaddingException.class)
 /**
  * Tests for <code>NoSuchPaddingException</code> class constructors and
  * methods.
@@ -51,12 +45,6 @@
      * Test for <code>NoSuchPaddingException()</code> constructor Assertion:
      * constructs NoSuchPaddingException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NoSuchPaddingException",
-        args = {}
-    )
     public void testNoSuchPaddingException01() {
         NoSuchPaddingException tE = new NoSuchPaddingException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * Assertion: constructs NoSuchPaddingException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NoSuchPaddingException",
-        args = {java.lang.String.class}
-    )
     public void testNoSuchPaddingException02() {
         NoSuchPaddingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * Assertion: constructs NoSuchPaddingException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NoSuchPaddingException",
-        args = {java.lang.String.class}
-    )
     public void testNoSuchPaddingException03() {
         String msg = null;
         NoSuchPaddingException tE = new NoSuchPaddingException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NullCipherTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NullCipherTest.java
index 9fe729e..683fa07 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NullCipherTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/NullCipherTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.SecureRandom;
 import java.util.Arrays;
 
@@ -37,7 +32,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(NullCipher.class)
 /**
  *
  * Tests for NullCipher
@@ -51,79 +45,26 @@
         c = new NullCipher();
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Class checks inherited methods.",
-            method = "getAlgorithm",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Class checks inherited methods.",
-            method = "NullCipher",
-            args = {}
-        )
-    })
     public void testGetAlgorithm() {
         c.getAlgorithm();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks inherited method from Cipher.",
-        method = "getBlockSize",
-        args = {}
-    )
     public void testGetBlockSize() {
         assertEquals("Incorrect BlockSize", 1, c.getBlockSize());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "IllegalStateException checking missed. Checks inherited method from Cipher.",
-        method = "getOutputSize",
-        args = {int.class}
-    )
     public void testGetOutputSize() {
         assertEquals("Incorrect OutputSize", 111, c.getOutputSize(111));
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks inherited method from Cipher.",
-            method = "getIV",
-            args = {}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "Checks inherited method from Cipher.",
-                clazz = CipherSpi.class,
-                method = "engineGetIV",
-                args = {}
-        )
-    })
     public void testGetIV() {
         assertTrue("Incorrect IV", Arrays.equals(c.getIV(), new byte[8]));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks inherited method from Cipher.",
-        method = "getParameters",
-        args = {}
-    )
     public void testGetParameters() {
         assertNull("Incorrect Parameters", c.getParameters());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks inherited method from Cipher.",
-        method = "getExemptionMechanism",
-        args = {}
-    )
     public void testGetExemptionMechanism() {
         assertNull("Incorrect ExemptionMechanism", c.getExemptionMechanism());
     }
@@ -131,12 +72,6 @@
     /*
      * Class under test for void init(int, Key)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidKeyException checking missed. Checks inherited method from Cipher.",
-        method = "init",
-        args = {int.class, java.security.Key.class}
-    )
     public void testInitintKey() throws Exception {
         c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[1], "algorithm"));
 
@@ -145,12 +80,6 @@
     /*
      * Class under test for void init(int, Key, SecureRandom)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidKeyException checking missed. Checks inherited method from Cipher.",
-        method = "init",
-        args = {int.class, java.security.Key.class, java.security.SecureRandom.class}
-    )
     public void testInitintKeySecureRandom() throws Exception {
         c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[1],
                 "algorithm"), new SecureRandom());
@@ -159,12 +88,6 @@
     /*
      * Class under test for void init(int, Key, AlgorithmParameterSpec)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "init",
-        args = {int.class, java.security.Key.class, java.security.spec.AlgorithmParameterSpec.class}
-    )
     public void testInitintKeyAlgorithmParameterSpec() throws Exception {
         class myAlgorithmParameterSpec implements java.security.spec.AlgorithmParameterSpec {}
         c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[1],
@@ -174,12 +97,6 @@
     /*
      * Class under test for byte[] update(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "IllegalStateException checking missed. Checks inherited method from Cipher.",
-        method = "update",
-        args = {byte[].class}
-    )
     public void testUpdatebyteArray() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = c.update(b);
@@ -190,12 +107,6 @@
     /*
      * Class under test for byte[] update(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "IllegalStateException checking missed. Checks inherited method from Cipher.",
-        method = "update",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testUpdatebyteArrayintint() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = c.update(b, 0, 5);
@@ -212,12 +123,6 @@
     /*
      * Class under test for int update(byte[], int, int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "update",
-        args = {byte[].class, int.class, int.class, byte[].class}
-    )
     public void testUpdatebyteArrayintintbyteArray() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = new byte[5];
@@ -228,12 +133,6 @@
     /*
      * Class under test for int update(byte[], int, int, byte[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "update",
-        args = {byte[].class, int.class, int.class, byte[].class, int.class}
-    )
     public void testUpdatebyteArrayintintbyteArrayint() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = new byte[5];
@@ -244,12 +143,6 @@
     /*
      * Class under test for byte[] doFinal()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {}
-    )
     public void testDoFinal() throws Exception {
         assertNull("doFinal failed", c.doFinal());
     }
@@ -257,12 +150,6 @@
     /*
      * Class under test for int doFinal(byte[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class}
-    )
     public void testDoFinalbyteArrayint() throws Exception {
         byte [] r = new byte[5];
         assertEquals("doFinal failed", 0, c.doFinal(r, 0));
@@ -271,12 +158,6 @@
     /*
      * Class under test for byte[] doFinal(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class}
-    )
     public void testDoFinalbyteArray() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = null;
@@ -288,12 +169,6 @@
     /*
      * Class under test for byte[] doFinal(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testDoFinalbyteArrayintint() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = null;
@@ -311,12 +186,6 @@
     /*
      * Class under test for byte[] update(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "update",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testUpdatebyteArrayintint2() {
         //Regression for HARMONY-758
         try {
@@ -329,12 +198,6 @@
     /*
      * Class under test for int doFinal(byte[], int, int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class, byte[].class}
-    )
     public void testDoFinalbyteArrayintintbyteArray() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = new byte[5];
@@ -345,12 +208,6 @@
     /*
      * Class under test for int doFinal(byte[], int, int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class, byte[].class}
-    )
     public void testDoFinalbyteArrayintintbyteArray2() throws Exception {
         //Regression for HARMONY-758
         try {
@@ -364,12 +221,6 @@
     /*
      * Class under test for int doFinal(byte[], int, int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class, byte[].class}
-    )
     public void testDoFinalbyteArrayintintbyteArray3() throws Exception {
         //Regression for HARMONY-758
         try {
@@ -382,12 +233,6 @@
     /*
      * Class under test for int doFinal(byte[], int, int, byte[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class, byte[].class, int.class}
-    )
     public void testDoFinalbyteArrayintintbyteArrayint() throws Exception {
         byte [] b = {1, 2, 3, 4, 5};
         byte [] r = new byte[5];
@@ -398,12 +243,6 @@
     /*
      * Class under test for int doFinal(byte[], int, int, byte[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class, byte[].class, int.class}
-    )
     public void testDoFinalbyteArrayintintbyteArrayint2() throws Exception {
         //Regression for HARMONY-758
         try {
@@ -417,12 +256,6 @@
     /*
      * Class under test for int doFinal(byte[], int, int, byte[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checking missed. Checks inherited method from Cipher.",
-        method = "doFinal",
-        args = {byte[].class, int.class, int.class, byte[].class, int.class}
-    )
     public void testDoFinalbyteArrayintintbyteArrayint3() throws Exception {
         //Regression for HARMONY-758
         try {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SealedObjectTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SealedObjectTest.java
index 924dee3..b3b2931 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SealedObjectTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SealedObjectTest.java
@@ -22,10 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import java.io.ByteArrayInputStream;
@@ -47,7 +43,6 @@
 import javax.crypto.spec.IvParameterSpec;
 import javax.crypto.spec.SecretKeySpec;
 
-@TestTargetClass(SealedObject.class)
 /**
  */
 public class SealedObjectTest extends TestCase {
@@ -69,12 +64,6 @@
      * deserialized, the content od deserialized object equals to the content of
      * initial object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "!Serialization",
-        args = {}
-    )
     public void testReadObject() throws Exception {
         String secret = "secret string";
         SealedObject so = new SealedObject(secret, new NullCipher());
@@ -99,11 +88,6 @@
      * SealedObject(Serializable object, Cipher c) method testing. Tests if the
      * NullPointerException is thrown in the case of null cipher.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SealedObject",
-        args = {java.io.Serializable.class, javax.crypto.Cipher.class}
-    )
     public void testSealedObject1() throws Exception {
         String secret = "secret string";
         try {
@@ -139,12 +123,6 @@
      * SealedObject(SealedObject so) method testing. Tests if the
      * NullPointerException is thrown in the case of null SealedObject.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SealedObject",
-        args = {javax.crypto.SealedObject.class}
-    )
     public void testSealedObject2() throws Exception {
         try {
             new SealedObject(null) {};
@@ -170,12 +148,6 @@
      * getAlgorithm() method testing. Tests if the returned value equals to the
      * corresponding value of Cipher object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void testGetAlgorithm() throws Exception {
         String secret = "secret string";
         String algorithm = "DES";
@@ -195,12 +167,6 @@
      * encryption algorithm and specified parameters can be retrieved by
      * specifying the cryptographic key.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Not all exceptions can be checked.",
-        method = "getObject",
-        args = {java.security.Key.class}
-    )
     public void testGetObject1() throws Exception {
         KeyGenerator kg = KeyGenerator.getInstance("DES");
         Key key = kg.generateKey();
@@ -237,12 +203,6 @@
      * with encryption algorithm and specified parameters can be retrieved by
      * specifying the initialized Cipher object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Not all exceptions can be checked.",
-        method = "getObject",
-        args = {javax.crypto.Cipher.class}
-    )
     public void testGetObject2() throws Exception {
         try {
             new SealedObject("secret string", new NullCipher())
@@ -282,12 +242,6 @@
      * object sealed with encryption algorithm can be retrieved by specifying
      * the cryptographic key and provider name.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Not all exceptions can be checked.",
-        method = "getObject",
-        args = {java.security.Key.class, java.lang.String.class}
-    )
     public void testGetObject3() throws Exception {
         try {
             new SealedObject("secret string", new NullCipher()).getObject(
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactorySpiTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactorySpiTest.java
index bcc05a2..de68dc8 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactorySpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactorySpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidKeyException;
 import java.security.spec.InvalidKeySpecException;
 import java.security.spec.KeySpec;
@@ -39,8 +34,6 @@
 /**
  * Tests for <code>SecretKeyFactorySpi</code> class constructors and methods.
  */
-
-@TestTargetClass(SecretKeyFactorySpi.class)
 public class SecretKeyFactorySpiTest extends TestCase {
     class Mock_SecretKeyFactorySpi extends MySecretKeyFactorySpi {
 
@@ -66,7 +59,6 @@
      * Test for <code>SecretKeyFactorySpi</code> constructor Assertion:
      * constructs SecretKeyFactorySpi
      */
-    @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "SecretKeyFactorySpi", args = {})
     public void testSecretKeyFactorySpi01() throws InvalidKeyException, InvalidKeySpecException {
         Mock_SecretKeyFactorySpi skfSpi = new Mock_SecretKeyFactorySpi();
         SecretKey sk = null;
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
index d73959c..7d2bcf9 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyFactoryTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidKeyException;
 import java.security.Key;
 import java.security.NoSuchAlgorithmException;
@@ -49,12 +44,10 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(SecretKeyFactory.class)
 /**
  * Tests for <code>SecretKeyFactory</code> class constructors and methods.
  *
  */
-
 public class SecretKeyFactoryTest extends TestCase {
 
     public static final String srvSecretKeyFactory = "SecretKeyFactory";
@@ -124,12 +117,6 @@
      * Test for <code>SecretKeyFactory</code> constructor
      * Assertion: returns SecretKeyFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SecretKeyFactory",
-        args = {javax.crypto.SecretKeyFactorySpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testSecretKeyFactory01() throws NoSuchAlgorithmException,
             InvalidKeySpecException, InvalidKeyException {
         if (!DEFSupported) {
@@ -161,12 +148,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm has invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testSecretKeyFactory02() throws NoSuchAlgorithmException {
         try {
             SecretKeyFactory.getInstance(null);
@@ -187,12 +168,6 @@
      * Test for <code>getInstance(String algorithm)</code> method
      * Assertion: returns SecretKeyObject
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testSecretKeyFactory03() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -213,12 +188,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is invalid
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testSecretKeyFactory04() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!DEFSupported) {
@@ -249,12 +218,6 @@
      * throws IllegalArgumentException when provider is null or empty;
      * throws NoSuchProviderException when provider has invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testSecretKeyFactory05() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!DEFSupported) {
@@ -293,12 +256,6 @@
      * method
      * Assertion: returns SecretKeyFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testSecretKeyFactory06() throws NoSuchProviderException,
             NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -321,12 +278,6 @@
      * Assertion: throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is invalid
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testSecretKeyFactory07() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -353,12 +304,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testSecretKeyFactory08() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -380,12 +325,6 @@
      * method
      * Assertion: returns SecretKeyFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is a complete subset of tests for getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testSecretKeyFactory09() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -408,34 +347,6 @@
      * Assertion:
      * throw InvalidKeySpecException if parameter is inappropriate
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Tis test is checking two methods.",
-            method = "generateSecret",
-            args = {java.security.spec.KeySpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Tis test is checking two methods.",
-            clazz = SecretKeyFactorySpi.class,
-            method = "engineGenerateSecret",
-            args = {java.security.spec.KeySpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Tis test is checking two methods.",
-            method = "getKeySpec",
-            args = {javax.crypto.SecretKey.class, java.lang.Class.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Tis test is checking two methods.",
-            clazz = SecretKeyFactorySpi.class,
-            method = "engineGetKeySpec",
-            args = {javax.crypto.SecretKey.class, java.lang.Class.class}
-        )
-    })
     public void testSecretKeyFactory10() throws InvalidKeyException,
             InvalidKeySpecException {
         if (!DEFSupported) {
@@ -508,12 +419,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws NoSuchAlgorithmException {
         for (int i = 0; i < validValues.length; i++) {
             SecretKeyFactory secKF = SecretKeyFactory
@@ -532,12 +437,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws NoSuchAlgorithmException {
         for (int i = 0; i < validValues.length; i++) {
             SecretKeyFactory secKF = SecretKeyFactory
@@ -549,21 +448,6 @@
         assertNull(msf.getProvider());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "translateKey",
-            args = {javax.crypto.SecretKey.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = SecretKeyFactorySpi.class,
-            method = "engineTranslateKey",
-            args = {javax.crypto.SecretKey.class}
-        )
-    })
     public void test_translateKeyLjavax_crypto_SecretKey()
             throws NoSuchAlgorithmException, InvalidKeyException {
         KeyGenerator kg = null;
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyTest.java
index 6d0b242..a27083c 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/SecretKeyTest.java
@@ -22,17 +22,11 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.crypto.SecretKey;
 
 import junit.framework.TestCase;
 
 
-@TestTargetClass(SecretKey.class)
 /**
  * Tests for <code>SecretKey</code> class field
  *
@@ -42,12 +36,6 @@
     /**
      * Test for <code>serialVersionUID</code> field
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "!Constants",
-        args = {}
-    )
     public void testField() {
         checkSecretKey sk = new checkSecretKey();
         assertEquals("Incorrect serialVersionUID",
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ShortBufferExceptionTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ShortBufferExceptionTest.java
index c29567e..52fa969 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ShortBufferExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ShortBufferExceptionTest.java
@@ -22,16 +22,10 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.crypto.ShortBufferException;
 
 import junit.framework.TestCase;
 
-@TestTargetClass(ShortBufferException.class)
 /**
  * Tests for <code>ShortBufferException</code> class constructors and methods.
  *
@@ -49,12 +43,6 @@
      * Test for <code>ShortBufferException()</code> constructor Assertion:
      * constructs ShortBufferException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ShortBufferException",
-        args = {}
-    )
     public void testShortBufferException01() {
         ShortBufferException tE = new ShortBufferException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +54,6 @@
      * Assertion: constructs ShortBufferException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ShortBufferException",
-        args = {java.lang.String.class}
-    )
     public void testShortBufferException02() {
         ShortBufferException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +69,6 @@
      * Assertion: constructs ShortBufferException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ShortBufferException",
-        args = {java.lang.String.class}
-    )
     public void testShortBufferException03() {
         String msg = null;
         ShortBufferException tE = new ShortBufferException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesTest.java
index 2e4d7e7..0b8f017 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesTest.java
@@ -15,20 +15,10 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 public class CipherAesTest extends TestCase {
 // 216 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_AesNoISO() {
         CipherSymmetricKeyThread aesNoISO = new CipherSymmetricKeyThread("AES",
                 new int[] {128, 192, 256}, // Keysize must be 128, 192, 256.
@@ -48,12 +38,6 @@
     }
 
 // 108 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_AesISO() {
         CipherSymmetricKeyThread aesISO = new CipherSymmetricKeyThread("AES",
                 new int[] {128, 192, 256}, // Keysize must be 128, 192, 256.
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesWrapTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesWrapTest.java
index 7a9ceaf..ed86fdd 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesWrapTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherAesWrapTest.java
@@ -15,9 +15,6 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 public class CipherAesWrapTest extends TestCase {
@@ -27,12 +24,6 @@
     }
 
     // 3 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_AesWrap() {
         CipherWrapThread aesWrap = new CipherWrapThread("AESWrap", new int[] {
                 128, 192, 256}, // Keysize must be 128, 192, 256.
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeTest.java
index 54ca325..d8565f1 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeTest.java
@@ -15,20 +15,10 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 public class CipherDESedeTest extends TestCase {
 // 80 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_DESedeNoISO() {
         CipherSymmetricKeyThread DESedeNoISO = new CipherSymmetricKeyThread(
                 "DESede", new int[] {112, 168},// Keysize must be 112 or 168.
@@ -45,12 +35,6 @@
     }
 
 // 40 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_DESedeISO() {
         CipherSymmetricKeyThread DESedeISO = new CipherSymmetricKeyThread(
                 "DESede", new int[] {112, 168},// Keysize must be 112 or 168.
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeWrapTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeWrapTest.java
index da71684..07ab945 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeWrapTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDESedeWrapTest.java
@@ -15,20 +15,10 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 public class CipherDESedeWrapTest extends TestCase {
 //  2 cases checked.
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_DESedeWrap() {
         CipherWrapThread DESedeWrap = new CipherWrapThread("DESedeWrap",
                 new int[] {112, 168}, // Keysize must be 112 or 168.
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDesTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDesTest.java
index 6ae5e6f..0c46ad0 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDesTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherDesTest.java
@@ -15,20 +15,10 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 public class CipherDesTest extends TestCase {
 // 40 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_DesNoISO() {
         CipherSymmetricKeyThread desNoISO = new CipherSymmetricKeyThread("DES",
                 new int[] {56},// Keysize must be 56.
@@ -45,12 +35,6 @@
     }
 
 // 20 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_DesISO() {
         CipherSymmetricKeyThread desISO = new CipherSymmetricKeyThread("DES",
                 new int[] {56},// Keysize must be 56.
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherPBETest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherPBETest.java
index d02bf91..f21374f 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherPBETest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherPBETest.java
@@ -16,20 +16,11 @@
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
 import junit.framework.TestCase;
 
 public class CipherPBETest extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_PBEWithMD5AndDES() throws Exception {
         CipherPBEThread PBEWithMD5AndDES = new CipherPBEThread(
                 "PBEWithMD5AndDES", new int[] {56}, new String[] {"CBC"},
@@ -41,12 +32,6 @@
                 .getTotalFailuresNumber());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     @AndroidOnly("Not supported by RI (maybe with a different name)")
     public void test_PBEWithSHAand3KeyTripleDES() throws Exception {
         CipherPBEThread PBEWITHSHAAND3KEYTRIPLEDESCBC = new CipherPBEThread(
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherRSATest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherRSATest.java
index cdc8c9a..d25d958 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherRSATest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/CipherRSATest.java
@@ -16,20 +16,11 @@
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
 import junit.framework.TestCase;
 
 public class CipherRSATest extends TestCase {
 // 3 cases checked
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     public void test_RSAShortKey() {
         CipherRSAThread rsa = new CipherRSAThread("RSA", new int[] {512},
                 new String[] {"ECB"}, new String[] {
@@ -64,12 +55,6 @@
         assertEquals(rsa.getFailureMessages(), 0, rsa.getTotalFailuresNumber());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "method",
-        args = {}
-    )
     @AndroidOnly("Fails on RI but succeeds on Android.")
     public void test_RSANoPadding() {
         CipherRSAThread rsa = new CipherRSAThread("RSA", new int[] {1024},
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyAgreementFunctionalTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyAgreementFunctionalTest.java
index fbf897c..acb06ae 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyAgreementFunctionalTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyAgreementFunctionalTest.java
@@ -16,9 +16,6 @@
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
 import junit.framework.TestCase;
 
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyGeneratorFunctionalTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyGeneratorFunctionalTest.java
index 4d0d700..ee9a198 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyGeneratorFunctionalTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/KeyGeneratorFunctionalTest.java
@@ -15,10 +15,6 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 public class KeyGeneratorFunctionalTest extends TestCase {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/MacFunctionalTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/MacFunctionalTest.java
index 6edc2db..8c05111 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/MacFunctionalTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/MacFunctionalTest.java
@@ -15,10 +15,6 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 public class MacFunctionalTest extends TestCase {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/SecretKeyFactoryFunctionalTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/SecretKeyFactoryFunctionalTest.java
index 2add9b0..8c2e2af 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/SecretKeyFactoryFunctionalTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/SecretKeyFactoryFunctionalTest.java
@@ -15,11 +15,6 @@
  */
 package org.apache.harmony.crypto.tests.javax.crypto.func;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 public class SecretKeyFactoryFunctionalTest extends TestCase {
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPrivateKeyTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPrivateKeyTest.java
index 4624ae9..eedb14c 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPrivateKeyTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPrivateKeyTest.java
@@ -31,28 +31,16 @@
 import javax.crypto.spec.DHParameterSpec;
 
 import junit.framework.TestCase;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.BrokenTest;
-
 
 /**
  * Tests for <code>DHPrivateKey</code> class field
  *
  */
-@TestTargetClass(DHPrivateKey.class)
 public class DHPrivateKeyTest extends TestCase {
 
     /**
      * Test for <code>serialVersionUID</code> field
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "tests serialVersionUID for a fixed value",
-        method = "!field:serialVersionUID"
-    )
     public void testField() {
         checkDHPrivateKey key = new checkDHPrivateKey();
         assertEquals("Incorrect serialVersionUID",
@@ -60,23 +48,9 @@
                 2211791113380396553L);
     }
 
-@TestTargets({
-    @TestTargetNew(
-          level = TestLevel.COMPLETE,
-          method = "getX",
-          args = {}
-        ),
-    @TestTargetNew(
-          level = TestLevel.COMPLETE,
-          clazz = DHKey.class,
-          method = "getParams",
-          args = {}
-        )
-    })
-    @BrokenTest("Too slow - disabling for now")
     public void test_getParams() throws Exception {
         KeyPairGenerator kg = KeyPairGenerator.getInstance("DH");
-        kg.initialize(1024);
+        kg.initialize(192);
         KeyPair kp1 = kg.genKeyPair();
         KeyPair kp2 = kg.genKeyPair();
         DHPrivateKey pk1 = (DHPrivateKey) kp1.getPrivate();
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPublicKeyTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPublicKeyTest.java
index 2c3e339..471d670 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPublicKeyTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/DHPublicKeyTest.java
@@ -23,10 +23,6 @@
 package org.apache.harmony.crypto.tests.javax.crypto.interfaces;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
 import junit.framework.TestCase;
 
@@ -43,17 +39,11 @@
  * Tests for <code>DHPublicKey</code> class field
  *
  */
-@TestTargetClass(DHPublicKey.class)
 public class DHPublicKeyTest extends TestCase {
 
     /**
      * Test for <code>serialVersionUID</code> field
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "tests serialVersionUID for a fixed value",
-        method = "!field:serialVersionUID"
-    )
     public void testField() {
         checkDHPublicKey key = new checkDHPublicKey();
         assertEquals("Incorrect serialVersionUID",
@@ -61,19 +51,6 @@
                 -6628103563352519193L);
     }
 
-@TestTargets({
-    @TestTargetNew(
-          level = TestLevel.COMPLETE,
-          method = "getY",
-          args = {}
-        ),
-    @TestTargetNew(
-          level = TestLevel.COMPLETE,
-          clazz = DHKey.class,
-          method = "getParams",
-          args = {}
-        )
-    })
     @BrokenTest("Too slow - disabling for now")
     public void test_getParams() throws Exception {
         KeyPairGenerator kg = KeyPairGenerator.getInstance("DH");
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/PBEKeyTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/PBEKeyTest.java
index 5e77044..b941dc5 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/PBEKeyTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/interfaces/PBEKeyTest.java
@@ -22,10 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.interfaces;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -37,18 +33,12 @@
  * Tests for <code>PBEKey</code> class field
  *
  */
-@TestTargetClass(PBEKey.class)
 public class PBEKeyTest extends TestCase {
 
 
     /**
      * Test for <code>serialVersionUID</code> field
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "tests serialVersionUID for a fixed value",
-        method = "!field:serialVersionUID"
-    )
     public void testField() {
         checkPBEKey key = new checkPBEKey();
         assertEquals("Incorrect serialVersionUID",
@@ -56,33 +46,18 @@
                 -1430015993304333921L);
     }
 
-@TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getIterationCount",
-        args = {}
-      )
     public void test_getIterationCount() throws Exception {
         checkPBEKey key = new checkPBEKey();
 
         key.getIterationCount();
     }
 
-@TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getPassword",
-        args = {}
-      )
     public void test_getPassword() throws Exception {
         checkPBEKey key = new checkPBEKey();
 
         key.getPassword();
     }
 
-@TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getSalt",
-        args = {}
-      )
     public void test_getSalt() throws Exception {
         checkPBEKey key = new checkPBEKey();
 
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESKeySpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESKeySpecTest.java
index f3ade0a..38ecc9d 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESKeySpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESKeySpecTest.java
@@ -21,11 +21,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.lang.NullPointerException;
 import java.security.InvalidKeyException;
 import java.util.Arrays;
@@ -36,10 +31,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(DESKeySpec.class)
 /**
  */
-
 public class DESKeySpecTest extends TestCase {
 
     // DES weak and semi-weak keys
@@ -110,20 +103,6 @@
      * Constructors testing. Tests behavior of each of two constructors
      * in the cases of: null array, short array, normal array.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks both constructors.",
-            method = "DESKeySpec",
-            args = {byte[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks both constructors.",
-            method = "DESKeySpec",
-            args = {byte[].class, int.class}
-        )
-    })
     public void testDESKeySpec() {
         try {
             new DESKeySpec((byte []) null);
@@ -179,12 +158,6 @@
      * the key with the key specified in the constructor. The object under
      * the test is created by different constructors.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKey",
-        args = {}
-    )
     public void testGetKey() {
         byte[] key = {1, 2, 3, 4, 5, 6, 7, 8};
         DESKeySpec ks;
@@ -223,12 +196,6 @@
      * it returns false on the key which is not parity adjusted, and if
      * it returns true on parity adjusted key.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isParityAdjusted",
-        args = {byte[].class, int.class}
-    )
     public void testIsParityAdjusted() {
         try {
             DESKeySpec.isParityAdjusted(null, 1);
@@ -277,12 +244,6 @@
      * it returns true on weak or semi-weak keys, and if it returns
      * false on other keys.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isWeak",
-        args = {byte[].class, int.class}
-    )
     public void testIsWeak() {
         try {
             DESKeySpec.isWeak(null, 1);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESedeKeySpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESedeKeySpecTest.java
index 1a6dd5f..e66a7b6 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESedeKeySpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DESedeKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.lang.NullPointerException;
 import java.security.InvalidKeyException;
 import java.util.Arrays;
@@ -37,30 +32,14 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(DESedeKeySpec.class)
 /**
  */
-
 public class DESedeKeySpecTest extends TestCase {
 
     /**
      * Constructors testing. Tests behavior of each of two constructors
      * in the cases of: null array, short array, normal array.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks both constructors.",
-            method = "DESedeKeySpec",
-            args = {byte[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Checks both constructors.",
-            method = "DESedeKeySpec",
-            args = {byte[].class, int.class}
-        )
-    })
     public void testDESedeKeySpec() {
         try {
             new DESedeKeySpec((byte []) null);
@@ -122,12 +101,6 @@
      * the key with the key specified in the constructor. The object under
      * the test is created by different constructors.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKey",
-        args = {}
-    )
     public void testGetKey() {
         byte[] key = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2,
                       1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2};
@@ -168,12 +141,6 @@
      * it returns false on the key which is not parity adjusted, and if
      * it returns true on parity adjusted key.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isParityAdjusted",
-        args = {byte[].class, int.class}
-    )
     public void testIsParityAdjusted() {
         try {
             DESedeKeySpec.isParityAdjusted(null, 1);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHGenParameterSpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHGenParameterSpecTest.java
index aef1286..3c372da 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHGenParameterSpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHGenParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.lang.Integer;
 
 import javax.crypto.spec.DHGenParameterSpec;
@@ -35,10 +30,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(DHGenParameterSpec.class)
 /**
  */
-
 public class DHGenParameterSpecTest extends TestCase {
 
     /**
@@ -46,26 +39,6 @@
      * parameters specified in the constructor with the values returned
      * by getters.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "DHGenParameterSpec",
-            args = {int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getExponentSize",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getPrimeSize",
-            args = {}
-        )
-    })
     public void testDHGenParameterSpec() {
         int[] primes = {Integer.MIN_VALUE, -1, 0, 1, Integer.MAX_VALUE};
         int[] exponents = {Integer.MIN_VALUE, -1, 0, 1, Integer.MAX_VALUE};
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHParameterSpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHParameterSpecTest.java
index 65d1a17..9887f7d 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHParameterSpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.lang.Integer;
 import java.math.BigInteger;
 
@@ -36,10 +31,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(DHParameterSpec.class)
 /**
  */
-
 public class DHParameterSpecTest extends TestCase {
 
     /**
@@ -47,38 +40,6 @@
      * specified in the constructor with the values returned by getters.
      * The tested object is created by different constructors.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "DHParameterSpec",
-            args = {java.math.BigInteger.class, java.math.BigInteger.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "DHParameterSpec",
-            args = {java.math.BigInteger.class, java.math.BigInteger.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getG",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getL",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getP",
-            args = {}
-        )
-    })
     public void testDHParameterSpec() {
         BigInteger[] ps = {new BigInteger("-1000000000000"), BigInteger.ZERO,
                             BigInteger.ONE, new BigInteger("1000000000000")};
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPrivateKeySpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPrivateKeySpecTest.java
index 327004a..c857387 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPrivateKeySpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPrivateKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigInteger;
 
 import javax.crypto.spec.DHPrivateKeySpec;
@@ -35,42 +30,14 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(DHPrivateKeySpec.class)
 /**
  */
-
 public class DHPrivateKeySpecTest extends TestCase {
 
     /**
      * DHPrivateKeySpec class testing. Tests the equivalence of parameters
      * specified in the constructor with the values returned by getters.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "DHPrivateKeySpec",
-            args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getG",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getP",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getX",
-            args = {}
-        )
-    })
     public void testDHPrivateKeySpec() {
         BigInteger[] xs = {new BigInteger("-1000000000000"), BigInteger.ZERO,
                             BigInteger.ONE, new BigInteger("1000000000000")};
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPublicKeySpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPublicKeySpecTest.java
index 905d8cd..937afe5 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPublicKeySpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/DHPublicKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigInteger;
 
 import javax.crypto.spec.DHPublicKeySpec;
@@ -35,42 +30,14 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(DHPublicKeySpec.class)
 /**
  */
-
 public class DHPublicKeySpecTest extends TestCase {
 
     /**
      * DHPublicKeySpec class testing. Tests the equivalence of parameters
      * specified in the constructor with the values returned by getters.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "DHPublicKeySpec",
-            args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getG",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getP",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "All functionality tested in one method. Probably it should be divided into several tests.",
-            method = "getY",
-            args = {}
-        )
-    })
     public void testDHPrivateKeySpec() {
         BigInteger[] ys = {new BigInteger("-1000000000000"), BigInteger.ZERO,
                             BigInteger.ONE, new BigInteger("1000000000000")};
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/IvParameterSpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/IvParameterSpecTest.java
index 1c27f68..2c2ef66 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/IvParameterSpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/IvParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.lang.NullPointerException;
 import java.lang.IllegalArgumentException;
 import java.lang.ArrayIndexOutOfBoundsException;
@@ -37,10 +32,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(IvParameterSpec.class)
 /**
  */
-
 public class IvParameterSpecTest extends TestCase {
 
     /**
@@ -48,12 +41,6 @@
      * NullPointerException is thrown in the case of null input
      * array and that input array is copied during initialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IvParameterSpec",
-        args = {byte[].class}
-    )
     public void testIvParameterSpec1() {
         try {
             new IvParameterSpec(null);
@@ -74,12 +61,6 @@
      * NullPointerException is thrown in the case of null input
      * array and that input array is copied during initialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IvParameterSpec",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testIvParameterSpec2() {
         try {
             new IvParameterSpec(null, 1, 1);
@@ -142,12 +123,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIV",
-        args = {}
-    )
     public void testGetIV() {
         byte[] iv = new byte[] {1, 2, 3, 4, 5};
         IvParameterSpec ivps = new IvParameterSpec(iv);
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/OAEPParameterSpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/OAEPParameterSpecTest.java
index 3fa2d72..ce0ea2e 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/OAEPParameterSpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/OAEPParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.spec.MGF1ParameterSpec;
 import java.security.spec.AlgorithmParameterSpec;
 
@@ -37,10 +32,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(OAEPParameterSpec.class)
 /**
  */
-
 public class OAEPParameterSpecTest extends TestCase {
 
     /**
@@ -49,12 +42,6 @@
      * is thrown in the case of inappropriate constructor parameters and checks
      * the value of DEFAULT field.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "OAEPParameterSpec",
-        args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, javax.crypto.spec.PSource.class}
-    )
     public void testOAEPParameterSpec() {
         // using init values for OAEPParameterSpec.DEFAULT
         String mdName = "SHA-1";
@@ -106,12 +93,6 @@
     /**
      * getDigestAlgorithm() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDigestAlgorithm",
-        args = {}
-    )
     public void testGetDigestAlgorithm() {
         String mdName = "SHA-1";
         String mgfName = "MGF1";
@@ -128,12 +109,6 @@
     /**
      * getMGFAlgorithm() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMGFAlgorithm",
-        args = {}
-    )
     public void testGetMGFAlgorithm() {
         String mdName = "SHA-1";
         String mgfName = "MGF1";
@@ -150,12 +125,6 @@
     /**
      * getMGFParameters() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMGFParameters",
-        args = {}
-    )
     public void testGetMGFParameters() {
         String mdName = "SHA-1";
         String mgfName = "MGF1";
@@ -172,12 +141,6 @@
     /**
      * getPSource() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPSource",
-        args = {}
-    )
     public void testGetPSource() {
         String mdName = "SHA-1";
         String mgfName = "MGF1";
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEKeySpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEKeySpecTest.java
index bbce868..85e429a 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEKeySpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.util.Arrays;
 
 import javax.crypto.spec.PBEKeySpec;
@@ -35,10 +30,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(PBEKeySpec.class)
 /**
  */
-
 public class PBEKeySpecTest extends TestCase {
 
     /**
@@ -46,12 +39,6 @@
      * the method in the case of null input char array and tests that input
      * array is copied during the object initialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PBEKeySpec",
-        args = {char[].class}
-    )
     public void testPBEKeySpec1() {
         try {
             PBEKeySpec pbeks = new PBEKeySpec(null);
@@ -75,12 +62,6 @@
      * of inappropriate parameters and checks that array objects specified as
      * a parameters are copied during the object initialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PBEKeySpec",
-        args = {char[].class, byte[].class, int.class, int.class}
-    )
     public void testPBEKeySpec2() {
         char[] password = new char[] {'1', '2', '3', '4', '5'};
         byte[] salt = new byte[] {1, 2, 3, 4, 5};
@@ -160,12 +141,6 @@
      * of inappropriate parameters and checks that array objects specified as
      * a parameters are copied during the object initialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PBEKeySpec",
-        args = {char[].class, byte[].class, int.class}
-    )
     public void testPBEKeySpec3() {
         char[] password = new char[] {'1', '2', '3', '4', '5'};
         byte[] salt = new byte[] {1, 2, 3, 4, 5};
@@ -227,12 +202,6 @@
      * clearPassword() method testing. Tests that internal copy of password
      * is cleared after the method call.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clearPassword",
-        args = {}
-    )
     public void testClearPassword() {
         char[] password = new char[] {'1', '2', '3', '4', '5'};
         PBEKeySpec pbeks = new PBEKeySpec(password);
@@ -250,12 +219,6 @@
      * to the password specified in the constructor and that the change of
      * returned array does not cause the change of internal array.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Exception was checked in testClearPassword() method.",
-        method = "getPassword",
-        args = {}
-    )
     public void testGetPassword() {
         char[] password = new char[] {'1', '2', '3', '4', '5'};
         PBEKeySpec pbeks = new PBEKeySpec(password);
@@ -277,12 +240,6 @@
      * Also it checks that the method returns null if salt is not
      * specified.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSalt",
-        args = {}
-    )
     public void testGetSalt() {
         char[] password = new char[] {'1', '2', '3', '4', '5'};
         byte[] salt = new byte[] {1, 2, 3, 4, 5};
@@ -308,12 +265,6 @@
      * Also it checks that the method returns 0 if iterationCount is not
      * specified.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIterationCount",
-        args = {}
-    )
     public void testGetIterationCount() {
         char[] password = new char[] {'1', '2', '3', '4', '5'};
         byte[] salt = new byte[] {1, 2, 3, 4, 5};
@@ -331,12 +282,6 @@
     /**
      * getKeyLength() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKeyLength",
-        args = {}
-    )
     public void testGetKeyLength() {
         char[] password = new char[] {'1', '2', '3', '4', '5'};
         byte[] salt = new byte[] {1, 2, 3, 4, 5};
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEParameterSpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEParameterSpecTest.java
index 6bca15c..6639099 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEParameterSpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PBEParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.util.Arrays;
 
 import javax.crypto.spec.PBEParameterSpec;
@@ -35,10 +30,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(PBEParameterSpec.class)
 /**
  */
-
 public class PBEParameterSpecTest extends TestCase {
 
     /**
@@ -46,12 +39,6 @@
      * Tests the behavior of the method in the case of null input array
      * and tests that input array is copied during the object initialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PBEParameterSpec",
-        args = {byte[].class, int.class}
-    )
     public void testPBEParameterSpec() {
         byte[] salt = {1, 2, 3, 4, 5};
         int iterationCount = 10;
@@ -75,12 +62,6 @@
      * to the salt specified in the constructor and that the change of
      * returned array does not cause the change of internal array.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSalt",
-        args = {}
-    )
     public void testGetSalt() {
         byte[] salt = new byte[] {1, 2, 3, 4, 5};
         int iterationCount = 10;
@@ -100,12 +81,6 @@
      * getIterationCount() method testing. Tests that returned value is equal
      * to the value specified in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIterationCount",
-        args = {}
-    )
     public void testGetIterationCount() {
         byte[] salt = new byte[] {1, 2, 3, 4, 5};
         int iterationCount = 10;
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PSourceTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PSourceTest.java
index ac3c5e5..bead58c 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PSourceTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/PSourceTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.util.Arrays;
 import javax.crypto.spec.PSource;
 
@@ -34,7 +29,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(PSource.class)
 /**
  */
 public class PSourceTest extends TestCase {
@@ -45,13 +39,6 @@
      * DEFAULT field, and that input p array is copied to protect against
      * subsequent modification.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Nested class.",
-        clazz = PSource.PSpecified.class,
-        method = "PSpecified",
-        args = { byte[].class }
-    )
     public void testPSpecified() {
         try {
             new PSource.PSpecified(null);
@@ -76,22 +63,6 @@
      * array specified in the constructor. Checks that modification
      * of returned array does not affect the internal array.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = PSource.PSpecified.class,
-            method = "PSpecified",
-            args = {byte[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = PSource.PSpecified.class,
-            method = "getValue",
-            args = {}
-        )
-    })
     public void testGetValue() {
         byte[] p = new byte[] {1, 2, 3, 4, 5};
 
@@ -112,12 +83,6 @@
      * PSource(String pSrcName) method testing. Tests that returned value is
      * equal to the value specified in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Checks NullPointerException",
-        method = "PSource",
-        args = {java.lang.String.class}
-    )
     public void testPSource() {
         try {
             new PSource(null) {};
@@ -131,20 +96,6 @@
      * getAlgorithm() method testing. Tests that returned value is
      * equal to the value specified in the constructor.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getAlgorithm",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "PSource",
-            args = {java.lang.String.class}
-        )
-    })
     public void testGetAlgorithm() {
         String pSrcName = "pSrcName";
         PSource ps = new PSource(pSrcName) {};
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC2ParameterSpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC2ParameterSpecTest.java
index 2ddb8f8..f4b2894 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC2ParameterSpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC2ParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.lang.IllegalArgumentException;
 import java.util.Arrays;
 
@@ -36,10 +31,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(RC2ParameterSpec.class)
 /**
  */
-
 public class RC2ParameterSpecTest extends TestCase {
 
     /**
@@ -48,12 +41,6 @@
      * inappropriate constructor parameters and that input iv array is
      * copied to protect against subsequent modification.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "RC2ParameterSpec",
-        args = {int.class, byte[].class}
-    )
     public void testRC2ParameterSpec1() {
         int effectiveKeyBits = 10;
         byte[] iv = {1, 2, 3, 4, 5, 6, 7, 8};
@@ -85,12 +72,6 @@
      * inappropriate constructor parameters and that input iv array is
      * copied to protect against subsequent modification.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "RC2ParameterSpec",
-        args = {int.class, byte[].class, int.class}
-    )
     public void testRC2ParameterSpec2() {
         int effectiveKeyBits = 10;
         byte[] iv = {1, 2, 3, 4, 5, 6, 7, 8, 9, 0};
@@ -121,12 +102,6 @@
      * getEffectiveKeyBits() method testing. Tests that returned value is
      * equal to the value specified in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEffectiveKeyBits",
-        args = {}
-    )
     public void testGetEffectiveKeyBits() {
         int effectiveKeyBits = 10;
         byte[] iv = {1, 2, 3, 4, 5, 6, 7, 8};
@@ -143,12 +118,6 @@
      * of returned array does not affect the internal array. Also it checks
      * that getIV() method returns null if iv is not specified.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIV",
-        args = {}
-    )
     public void testGetIV() {
         int effectiveKeyBits = 10;
         byte[] iv = new byte[] {1, 2, 3, 4, 5, 6, 7, 8};
@@ -173,12 +142,6 @@
      * operation: it should be reflexive, symmetric, transitive, consistent
      * and should be false on null object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         int effectiveKeyBits = 10;
         byte[] iv = new byte[] {1, 2, 3, 4, 5, 6, 7, 8};
@@ -219,12 +182,6 @@
      * hashCode() method testing. Tests that for equal objects hash codes
      * are equal.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         int effectiveKeyBits = 0;
         byte[] iv = new byte[] {1, 2, 3, 4, 5, 6, 7, 8};
@@ -236,12 +193,6 @@
                                             ps1.hashCode() == ps2.hashCode());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "RC2ParameterSpec",
-        args = {int.class}
-    )
     public void test_constructorI() {
         int effectiveKeyBits = 0;
 
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC5ParameterSpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC5ParameterSpecTest.java
index 0d235fe..9e92152 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC5ParameterSpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/RC5ParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.util.Arrays;
 
 import javax.crypto.spec.RC5ParameterSpec;
@@ -35,10 +30,8 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(RC5ParameterSpec.class)
 /**
  */
-
 public class RC5ParameterSpecTest extends TestCase {
 
     /**
@@ -47,12 +40,6 @@
      * inappropriate constructor parameters and that input iv array is
      * copied to protect against subsequent modification.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "RC5ParameterSpec",
-        args = {int.class, int.class, int.class, byte[].class}
-    )
     public void testRC5ParameterSpec1() {
         int version = 1;
         int rounds = 5;
@@ -94,12 +81,6 @@
      * the case of inappropriate constructor parameters and that input iv array
      * is copied to protect against subsequent modification.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "RC5ParameterSpec",
-        args = {int.class, int.class, int.class, byte[].class, int.class}
-    )
     public void testRC5ParameterSpec2() {
         int version = 1;
         int rounds = 5;
@@ -156,12 +137,6 @@
      * getVersion() method testing. Tests that returned value is
      * equal to the value specified in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getVersion",
-        args = {}
-    )
     public void testGetVersion() {
         int version = 1;
         int rounds = 5;
@@ -177,12 +152,6 @@
      * getRounds() method testing. Tests that returned value is
      * equal to the value specified in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getRounds",
-        args = {}
-    )
     public void testGetRounds() {
         int version = 1;
         int rounds = 5;
@@ -198,12 +167,6 @@
      * getWordSize() method testing. Tests that returned value is
      * equal to the value specified in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getWordSize",
-        args = {}
-    )
     public void testGetWordSize() {
         int version = 1;
         int rounds = 5;
@@ -221,12 +184,6 @@
      * of returned array does not affect the internal array. Also it checks
      * that getIV() method returns null if iv is not specified.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIV",
-        args = {}
-    )
     public void testGetIV() {
         int version = 1;
         int rounds = 5;
@@ -254,12 +211,6 @@
      * operation: it should be reflexive, symmetric, transitive, consistent
      * and should be false on null object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         int version = 1;
         int rounds = 5;
@@ -310,12 +261,6 @@
      * hashCode() method testing. Tests that for equal objects hash codes
      * are equal.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         int version = 1;
         int rounds = 5;
@@ -330,11 +275,6 @@
                                             ps1.hashCode() == ps2.hashCode());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "RC5ParameterSpec",
-        args = {int.class, int.class, int.class}
-    )
     public void test_constructorIII() {
         int version = 1;
         int rounds = 5;
diff --git a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java
index a411762..f48213c 100644
--- a/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java
+++ b/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/spec/SecretKeySpecTest.java
@@ -22,10 +22,6 @@
 
 package org.apache.harmony.crypto.tests.javax.crypto.spec;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -34,10 +30,8 @@
 
 import javax.crypto.spec.SecretKeySpec;
 
-@TestTargetClass(SecretKeySpec.class)
 /**
  */
-
 public class SecretKeySpecTest extends TestCase {
 
     /**
@@ -46,12 +40,6 @@
      * constructor parameters and that input iv array is
      * copied to protect against subsequent modification.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SecretKeySpec",
-        args = {byte[].class, java.lang.String.class}
-    )
     public void testSecretKeySpec1() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         String algorithm = "Algorithm";
@@ -90,12 +78,6 @@
      * the case of inappropriate constructor parameters and that input iv array
      * is copied to protect against subsequent modification.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SecretKeySpec",
-        args = {byte[].class, int.class, int.class, java.lang.String.class}
-    )
     public void testSecretKeySpec2() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         int offset = 1;
@@ -154,12 +136,6 @@
         }
     }
 
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "SecretKeySpec",
-            args = {byte[].class, int.class, int.class, java.lang.String.class}
-        )
     public void testSecretKeySpec3() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         int offset = 1;
@@ -180,12 +156,6 @@
      * getAlgorithm() method testing. Tests that returned value is
      * equal to the value specified in the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void testGetAlgorithm() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         String algorithm = "Algorithm";
@@ -199,12 +169,6 @@
     /**
      * getFormat() method testing. Tests that returned value is "RAW".
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFormat",
-        args = {}
-    )
     public void testGetFormat() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         String algorithm = "Algorithm";
@@ -219,12 +183,6 @@
      * array specified in the constructor. Checks that modification
      * of returned array does not affect the internal array.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public void testGetEncoded() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         String algorithm = "Algorithm";
@@ -251,12 +209,6 @@
      * hashCode() method testing. Tests that for equal objects hash codes
      * are equal.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         String algorithm = "Algorithm";
@@ -272,12 +224,6 @@
      * operation: it should be reflexive, symmetric, transitive, consistent
      * and should be false on null object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         byte[] key = new byte[] {1, 2, 3, 4, 5};
         String algorithm = "Algorithm";
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/AllTests.java b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/AllTests.java
deleted file mode 100644
index 89faac1..0000000
--- a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/AllTests.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.luni.tests.internal.net.www.protocol.http;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.javax.net.ssl;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for HttpURLConnecton, HttpsURLConnection.");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(HttpURLConnectionTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
index d7a693c..dcd50bb 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/http/HttpURLConnectionTest.java
@@ -18,12 +18,6 @@
 package org.apache.harmony.luni.tests.internal.net.www.protocol.http;
 
 import dalvik.annotation.SideEffect;
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 
 import java.io.IOException;
 import java.net.Authenticator;
@@ -47,7 +41,6 @@
  * Tests for <code>HTTPURLConnection</code> class constructors and methods.
  *
  */
-@TestTargetClass(HttpURLConnection.class)
 public class HttpURLConnectionTest extends TestCase {
 
     private final static Object bound = new Object();
@@ -165,14 +158,8 @@
     }
 
     /**
-     * @tests org.apache.harmony.luni.internal.net.www.http.getOutputStream()
+     * org.apache.harmony.luni.internal.net.www.http.getOutputStream()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test.",
-        method = "getOutputStream",
-        args = {}
-    )
     public void testGetOutputStream() throws Exception {
         // Regression for HARMONY-482
         MockServer httpServer =
@@ -198,12 +185,6 @@
      * Test checks if the proxy specified in openConnection
      * method will be used for connection to the server
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies if the proxy specified in openConnection method will be used for connection to the server.",
-        method = "usingProxy",
-        args = {}
-    )
     public void testUsingProxy() throws Exception {
         // Regression for HARMONY-570
         MockServer server = new MockServer("server");
@@ -244,12 +225,6 @@
      * Test checks if the proxy provided by proxy selector
      * will be used for connection to the server
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies if the proxy provided by proxy selector will be used for connection to the server.",
-        method = "usingProxy",
-        args = {}
-    )
     public void testUsingProxySelector() throws Exception {
         // Regression for HARMONY-570
         MockServer server = new MockServer("server");
@@ -291,20 +266,6 @@
             ProxySelector.setDefault(defPS);
         }
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Regression test.",
-            method = "getResponseCode",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Regression test.",
-            method = "connect",
-            args = {}
-        )
-    })
     @SideEffect("Suffers from side effect of other, currently unknown test")
     public void testProxyAuthorization() throws Exception {
         // Set up test Authenticator
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/AllTests.java b/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/AllTests.java
deleted file mode 100644
index e03633d..0000000
--- a/luni/src/test/java/org/apache/harmony/luni/tests/internal/net/www/protocol/https/AllTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.luni.tests.internal.net.www.protocol.https;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.javax.net.ssl;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for HttpURLConnecton, HttpsURLConnection.");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(HttpsURLConnectionTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
index 7120dd6..12406f3 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/io/ObjectInputStreamTest.java
@@ -128,7 +128,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readObject()
+     * java.io.ObjectInputStream#readObject()
      */
     public void test_readObjectMissingClasses() throws Exception {
         SerializationTest.verifySelf(new A1(), new SerializableAssert() {
@@ -140,7 +140,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#ObjectInputStream(java.io.InputStream)
+     * java.io.ObjectInputStream#ObjectInputStream(java.io.InputStream)
      */
     public void test_ConstructorLjava_io_InputStream() throws IOException {
         oos.writeDouble(Double.MAX_VALUE);
@@ -158,7 +158,7 @@
     }
 
     /**
-     * @tests {@link java.io.ObjectInputStream#resolveProxyClass(String[])}
+     * {@link java.io.ObjectInputStream#resolveProxyClass(String[])}
      */
     public void test_resolveProxyClass() throws IOException,
             ClassNotFoundException {
@@ -208,7 +208,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#available()
+     * java.io.ObjectInputStream#available()
      */
     public void test_available() throws IOException {
         oos.writeBytes("HelloWorld");
@@ -219,7 +219,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#close()
+     * java.io.ObjectInputStream#close()
      */
     public void test_close() throws IOException {
         oos.writeBytes("HelloWorld");
@@ -229,7 +229,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#defaultReadObject()
+     * java.io.ObjectInputStream#defaultReadObject()
      */
     public void test_defaultReadObject() throws Exception {
         // SM. This method may as well be private, as if called directly it
@@ -249,7 +249,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#read()
+     * java.io.ObjectInputStream#read()
      */
     public void test_read() throws IOException {
         oos.write('T');
@@ -260,7 +260,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#read(byte[], int, int)
+     * java.io.ObjectInputStream#read(byte[], int, int)
      */
     public void test_read$BII() throws IOException {
         byte[] buf = new byte[10];
@@ -274,7 +274,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readBoolean()
+     * java.io.ObjectInputStream#readBoolean()
      */
     public void test_readBoolean() throws IOException {
         oos.writeBoolean(true);
@@ -285,7 +285,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readByte()
+     * java.io.ObjectInputStream#readByte()
      */
     public void test_readByte() throws IOException {
         oos.writeByte(127);
@@ -296,7 +296,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readChar()
+     * java.io.ObjectInputStream#readChar()
      */
     public void test_readChar() throws IOException {
         oos.writeChar('T');
@@ -307,7 +307,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readDouble()
+     * java.io.ObjectInputStream#readDouble()
      */
     public void test_readDouble() throws IOException {
         oos.writeDouble(Double.MAX_VALUE);
@@ -319,7 +319,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readFields()
+     * java.io.ObjectInputStream#readFields()
      */
     public void test_readFields() throws Exception {
 
@@ -344,7 +344,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readFloat()
+     * java.io.ObjectInputStream#readFloat()
      */
     public void test_readFloat() throws IOException {
         oos.writeFloat(Float.MAX_VALUE);
@@ -356,7 +356,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readFully(byte[])
+     * java.io.ObjectInputStream#readFully(byte[])
      */
     public void test_readFully$B() throws IOException {
         byte[] buf = new byte[10];
@@ -370,7 +370,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readFully(byte[], int, int)
+     * java.io.ObjectInputStream#readFully(byte[], int, int)
      */
     public void test_readFully$BII() throws IOException {
         byte[] buf = new byte[10];
@@ -384,7 +384,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readInt()
+     * java.io.ObjectInputStream#readInt()
      */
     public void test_readInt() throws IOException {
         oos.writeInt(Integer.MAX_VALUE);
@@ -396,7 +396,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readLine()
+     * java.io.ObjectInputStream#readLine()
      */
     @SuppressWarnings("deprecation")
     public void test_readLine() throws IOException {
@@ -410,7 +410,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readLong()
+     * java.io.ObjectInputStream#readLong()
      */
     public void test_readLong() throws IOException {
         oos.writeLong(Long.MAX_VALUE);
@@ -422,7 +422,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readObject()
+     * java.io.ObjectInputStream#readObject()
      */
     public void test_readObject() throws Exception {
         String s = "HelloWorld";
@@ -510,7 +510,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readObjectOverride()
+     * java.io.ObjectInputStream#readObjectOverride()
      */
     public void test_readObjectOverride() throws Exception {
         // Regression for HARMONY-846
@@ -540,7 +540,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readObject()
+     * java.io.ObjectInputStream#readObject()
      */
     public void test_readObjectCorrupt() throws IOException, ClassNotFoundException {
         byte[] bytes = { 00, 00, 00, 0x64, 0x43, 0x48, (byte) 0xFD, 0x71, 00,
@@ -556,7 +556,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readShort()
+     * java.io.ObjectInputStream#readShort()
      */
     public void test_readShort() throws IOException {
         oos.writeShort(Short.MAX_VALUE);
@@ -568,7 +568,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readUnsignedByte()
+     * java.io.ObjectInputStream#readUnsignedByte()
      */
     public void test_readUnsignedByte() throws IOException {
         oos.writeByte(-1);
@@ -580,7 +580,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readUnsignedShort()
+     * java.io.ObjectInputStream#readUnsignedShort()
      */
     public void test_readUnsignedShort() throws IOException {
         oos.writeShort(-1);
@@ -592,7 +592,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#readUTF()
+     * java.io.ObjectInputStream#readUTF()
      */
     public void test_readUTF() throws IOException {
         oos.writeUTF("HelloWorld");
@@ -603,7 +603,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#skipBytes(int)
+     * java.io.ObjectInputStream#skipBytes(int)
      */
     public void test_skipBytesI() throws IOException {
         byte[] buf = new byte[10];
@@ -777,7 +777,7 @@
     }
 
     /**
-     * @tests java.io.ObjectInputStream#resolveObject(Object)
+     * java.io.ObjectInputStream#resolveObject(Object)
      */
     public void test_resolveObjectLjava_lang_Object() throws Exception {
         // Write an Integer object into memory
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/AllTests.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/AllTests.java
deleted file mode 100644
index d75c317..0000000
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/AllTests.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.luni.tests.java.net;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Listing of all the tests that are to be run.
- */
-public class AllTests {
-
-    public static void run() {
-        TestRunner.main(new String[] { AllTests.class.getName() });
-    }
-
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.net");
-
-        // add net testsuites here
-        suite.addTestSuite(ContentHandlerTest.class);
-        suite.addTestSuite(ContentHandlerFactoryTest.class);
-        suite.addTestSuite(HttpRetryExceptionTest.class);
-        suite.addTestSuite(Inet4AddressTest.class);
-        suite.addTestSuite(Inet6AddressTest.class);
-        suite.addTestSuite(InetAddressTest.class);
-        suite.addTestSuite(InetSocketAddressTest.class);
-        suite.addTestSuite(URITest.class);
-        suite.addTestSuite(URLConnectionTest.class);
-        suite.addTestSuite(URLEncoderTest.class);
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java
index 8fa5615..74b2276 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerFactoryTest.java
@@ -1,10 +1,6 @@
 package org.apache.harmony.luni.tests.java.net;
 
 import dalvik.annotation.SideEffect;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -18,7 +14,6 @@
 import java.net.URL;
 import java.net.URLConnection;
 
-@TestTargetClass(ContentHandlerFactory.class)
 public class ContentHandlerFactoryTest extends TestCase {
 
     ContentHandlerFactory oldFactory = null;
@@ -29,21 +24,6 @@
     boolean isGetContentCalled = false;
     boolean isCreateContentHandlerCalled = false;
 
-    @TestTargets ({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "createContentHandler",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies positive case, and java.lang.Error.",
-            clazz = URLConnection.class,
-            method = "setContentHandlerFactory",
-            args = { ContentHandlerFactory.class }
-        )
-    })
     @SideEffect("This test affects tests that are run after this one." +
             " The reason are side effects due to caching in URLConnection." +
             " Maybe this test needs to be run in isolation.")
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerTest.java
index 638d024..6760d41 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/ContentHandlerTest.java
@@ -27,7 +27,7 @@
 public class ContentHandlerTest extends TestCase {
 
     /**
-     * @tests java.net.ContentHandler#getContent(java.net.URLConnection,
+     * java.net.ContentHandler#getContent(java.net.URLConnection,
      *        java.lang.Class[])
      */
     public void test_getContent() throws IOException {
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java
index 32a7eda..16b5886 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/HttpRetryExceptionTest.java
@@ -46,7 +46,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
         SerializationTest.verifySelf(new HttpRetryException(DETAIL, 100,
@@ -54,7 +54,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
         SerializationTest.verifyGolden(this, new HttpRetryException(DETAIL,
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet4AddressTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet4AddressTest.java
index d2c0c6c..9759f18 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet4AddressTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet4AddressTest.java
@@ -17,16 +17,12 @@
 
 package org.apache.harmony.luni.tests.java.net;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.io.Serializable;
 import java.net.Inet4Address;
 import java.net.InetAddress;
 import org.apache.harmony.testframework.serialization.SerializationTest;
 import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
-@TestTargetClass(Inet4Address.class)
 public class Inet4AddressTest extends junit.framework.TestCase {
 
     private Inet4Address ipv4Localhost;
@@ -40,14 +36,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isMulticastAddress()
+     * java.net.Inet4Address#isMulticastAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMulticastAddress",
-        args = {}
-    )
     public void test_isMulticastAddress() {
 
         // Create 2 IP v4 addresses and call "isMulticastAddress()"
@@ -78,14 +68,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isAnyLocalAddress()
+     * java.net.Inet4Address#isAnyLocalAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isAnyLocalAddress",
-        args = {}
-    )
     public void test_isAnyLocalAddress() {
         String addrName = "";
         try {
@@ -99,14 +83,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isLoopbackAddress()
+     * java.net.Inet4Address#isLoopbackAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isLoopbackAddress",
-        args = {}
-    )
     public void test_isLoopbackAddress() {
         // Create some IP V4 addresses and test if they are local...
 
@@ -137,14 +115,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isLinkLocalAddress()
+     * java.net.Inet4Address#isLinkLocalAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isLinkLocalAddress",
-        args = {}
-    )
     public void test_isLinkLocalAddress() {
 
         String addrName = "";
@@ -163,14 +135,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isSiteLocalAddress()
+     * java.net.Inet4Address#isSiteLocalAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isSiteLocalAddress",
-        args = {}
-    )
     public void test_isSiteLocalAddress() {
         String addrName = "";
         try {
@@ -188,14 +154,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isMCGlobal()
+     * java.net.Inet4Address#isMCGlobal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCGlobal",
-        args = {}
-    )
     public void test_isMCGlobal() {
 
         // Create an IPv4 mulitcast address. It should return
@@ -246,14 +206,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isMCNodeLocal()
+     * java.net.Inet4Address#isMCNodeLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCNodeLocal",
-        args = {}
-    )
     public void test_isMCNodeLocal() {
         // Create an IPv4 mulitcast address. It should return
         // false for node-local mutlicast. There are no valid IPv4
@@ -283,14 +237,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isMCLinkLocal()
+     * java.net.Inet4Address#isMCLinkLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCLinkLocal",
-        args = {}
-    )
     public void test_isMCLinkLocal() {
         // Create an IPv4 mulitcast address. It should return
         // false for link-local mutlicast. There are no valid IPv4
@@ -332,14 +280,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isMCSiteLocal()
+     * java.net.Inet4Address#isMCSiteLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCSiteLocal",
-        args = {}
-    )
     public void test_isMCSiteLocal() {
         // Create an IPv4 mulitcast address. It should return
         // false for site-local mutlicast. There are no valid IPv4
@@ -387,14 +329,8 @@
     }
 
     /**
-     * @tests java.net.Inet4Address#isMCOrgLocal()
+     * java.net.Inet4Address#isMCOrgLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCOrgLocal",
-        args = {}
-    )
     public void test_isMCOrgLocal() {
         // Create an IPv4 mulitcast address. It should return
         // false for organization-local mutlicast. There are no valid IPv4
@@ -455,37 +391,19 @@
     };
 
     /**
-     * @tests serialization/deserialization compatibility.
+     * serialization/deserialization compatibility.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void testSerializationSelf() throws Exception {
         SerializationTest.verifySelf(ipv4LoopbackIp, COMPARATOR);
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void testSerializationCompatibility() throws Exception {
         SerializationTest.verifyGolden(this, ipv4Localhost, COMPARATOR);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equals() throws Exception {
         InetAddress addr = InetAddress.getByName("239.191.255.255");
         assertTrue(addr.equals(addr));
@@ -496,12 +414,6 @@
         assertFalse(ipv4LoopbackIp.equals(addr3));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHostAddress",
-        args = {}
-    )
     public void test_getHostAddress() throws Exception {
         assertEquals("127.0.0.1", ipv4Localhost.getHostAddress());
         assertEquals("127.0.0.1", ipv4LoopbackIp.getHostAddress());
@@ -519,12 +431,6 @@
         assertEquals("1.1.0.1", addr.getHostAddress());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
         InetAddress addr1 = InetAddress.getByName("1.1");
         InetAddress addr2 = InetAddress.getByName("1.1.1");
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet6AddressTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet6AddressTest.java
index eab7192..791f857 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet6AddressTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/Inet6AddressTest.java
@@ -17,10 +17,6 @@
 
 package org.apache.harmony.luni.tests.java.net;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.Serializable;
 import java.net.Inet4Address;
 import java.net.Inet6Address;
@@ -34,7 +30,6 @@
 import org.apache.harmony.testframework.serialization.SerializationTest;
 import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
-@TestTargetClass(Inet6Address.class)
 public class Inet6AddressTest extends junit.framework.TestCase {
 
     private Inet6Address ipv6Localhost;
@@ -47,14 +42,8 @@
         ipv6Localhost = (Inet6Address) InetAddress.getByAddress("localhost", ipv6Loopback);
     }
     /**
-     * @tests java.net.Inet6Address#isMulticastAddress()
+     * java.net.Inet6Address#isMulticastAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMulticastAddress",
-        args = {}
-    )
     public void test_isMulticastAddress() {
 
         String addrName = "";
@@ -121,14 +110,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isAnyLocalAddress()
+     * java.net.Inet6Address#isAnyLocalAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isAnyLocalAddress",
-        args = {}
-    )
     public void test_isAnyLocalAddress() {
 
         String addrName = "";
@@ -163,14 +146,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isLoopbackAddress()
+     * java.net.Inet6Address#isLoopbackAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isLoopbackAddress",
-        args = {}
-    )
     public void test_isLoopbackAddress() {
 
         String addrName = "";
@@ -256,14 +233,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isLinkLocalAddress()
+     * java.net.Inet6Address#isLinkLocalAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isLinkLocalAddress",
-        args = {}
-    )
     public void test_isLinkLocalAddress() {
 
         String addrName = "";
@@ -309,14 +280,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isSiteLocalAddress()
+     * java.net.Inet6Address#isSiteLocalAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isSiteLocalAddress",
-        args = {}
-    )
     public void test_isSiteLocalAddress() {
         String addrName = "";
         try {
@@ -355,14 +320,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isMCGlobal()
+     * java.net.Inet6Address#isMCGlobal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCGlobal",
-        args = {}
-    )
     public void test_isMCGlobal() {
         String addrName = "";
         try {
@@ -443,14 +402,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isMCNodeLocal()
+     * java.net.Inet6Address#isMCNodeLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCNodeLocal",
-        args = {}
-    )
     public void test_isMCNodeLocal() {
         String addrName = "";
         try {
@@ -518,14 +471,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isMCLinkLocal()
+     * java.net.Inet6Address#isMCLinkLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCLinkLocal",
-        args = {}
-    )
     public void test_isMCLinkLocal() {
         String addrName = "";
         try {
@@ -615,14 +562,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isMCSiteLocal()
+     * java.net.Inet6Address#isMCSiteLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCSiteLocal",
-        args = {}
-    )
     public void test_isMCSiteLocal() {
         String addrName = "";
         try {
@@ -711,14 +652,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isMCOrgLocal()
+     * java.net.Inet6Address#isMCOrgLocal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCOrgLocal",
-        args = {}
-    )
     public void test_isMCOrgLocal() {
         String addrName = "";
         try {
@@ -809,14 +744,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#isIPv4CompatibleAddress()
+     * java.net.Inet6Address#isIPv4CompatibleAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isIPv4CompatibleAddress",
-        args = {}
-    )
     public void test_isIPv4CompatibleAddress() {
         String addrName = "";
         Inet6Address addr = null;
@@ -856,14 +785,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#getByName(java.lang.String)
+     * java.net.Inet6Address#getByName(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getByName",
-        args = {java.lang.String.class}
-    )
     public void test_getByNameLjava_lang_String() throws Exception {
         // ones to add "::255.255.255.255", "::FFFF:0.0.0.0",
         // "0.0.0.0.0.0::255.255.255.255", "F:F:F:F:F:F:F:F",
@@ -908,14 +831,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#getByAddress(String, byte[], int)
+     * java.net.Inet6Address#getByAddress(String, byte[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getByAddress",
-        args = {java.lang.String.class, byte[].class, int.class}
-    )
     public void test_getByAddressLString$BI() throws UnknownHostException{
         try {
             Inet6Address.getByAddress("123", null, 0);
@@ -942,15 +859,9 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#getByAddress(String, byte[],
+     * java.net.Inet6Address#getByAddress(String, byte[],
      *        NetworkInterface)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getByAddress",
-        args = {java.lang.String.class, byte[].class, java.net.NetworkInterface.class}
-    )
     public void test_getByAddressLString$BLNetworkInterface()
             throws UnknownHostException {
         NetworkInterface nif = null;
@@ -977,14 +888,8 @@
 
     /**
      * @throws UnknownHostException
-     * @tests java.net.Inet6Address#getScopeID()
+     * java.net.Inet6Address#getScopeID()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getScopeId",
-        args = {}
-    )
     public void test_getScopeID() throws UnknownHostException {
         Inet6Address v6ia;
         byte[] addr = { (byte) 0xFE, (byte) 0x80, 0, 0, 0, 0, 0, 0, 0x02, 0x11,
@@ -1002,14 +907,8 @@
     }
 
     /**
-     * @tests java.net.Inet6Address#getScopedInterface()
+     * java.net.Inet6Address#getScopedInterface()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getScopedInterface",
-        args = {}
-    )
     public void test_getScopedInterface() throws UnknownHostException {
         byte[] addr = { (byte) 0xFE, (byte) 0x80, (byte) 0x09, (byte) 0xb5,
                 (byte) 0x6b, (byte) 0xa4, 0, 0, 0, 0, 0, 0, (byte) 0x09,
@@ -1091,14 +990,8 @@
     };
 
     /**
-     * @tests serialization/deserialization compatibility.
+     * serialization/deserialization compatibility.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void testSerializationSelf() throws Exception {
 
         byte[] localv6 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
@@ -1108,14 +1001,8 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void testSerializationCompatibility() throws Exception {
 
         byte[] localv6 = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 };
@@ -1128,12 +1015,6 @@
         SerializationTest.verifyGolden(this, addresses, COMPARATOR);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equals() throws Exception {
         InetAddress addr = InetAddress.getByName("239.191.255.255");
         assertTrue(addr.equals(addr));
@@ -1144,12 +1025,6 @@
         assertFalse(ipv6LoopbackIp.equals(addr3));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHostAddress",
-        args = {}
-    )
     public void test_getHostAddress() throws Exception {
         assertEquals("::1", ipv6Localhost.getHostAddress());
         assertEquals("::1", InetAddress.getByName("::1").getHostAddress());
@@ -1205,12 +1080,6 @@
         assertEquals("10:2030:4050:6070:8090:a0b0:c0d0:e0f0", aAddr.getHostAddress());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
         InetAddress addr1 = InetAddress.getByName("1.1");
         InetAddress addr2 = InetAddress.getByName("1.1.1");
@@ -1222,12 +1091,6 @@
         assertTrue(ipv6LoopbackIp.hashCode() == ipv6Localhost.hashCode());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
         String validIPAddresses[] = { "::1.2.3.4", "::", "::", "1::0", "1::",
                 "::1", "0", /* jdk1.5 accepts 0 as valid */
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
index 4a47db3..5284749 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetAddressTest.java
@@ -18,9 +18,6 @@
 package org.apache.harmony.luni.tests.java.net;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 
 import java.io.IOException;
 import java.io.Serializable;
@@ -39,7 +36,6 @@
 
 import tests.support.Support_Configuration;
 
-@TestTargetClass(InetAddress.class)
 public class InetAddressTest extends junit.framework.TestCase {
 
     private static boolean someoneDone[] = new boolean[2];
@@ -152,28 +148,16 @@
     }
 
     /**
-     * @tests java.net.InetAddress#equals(java.lang.Object)
+     * java.net.InetAddress#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean java.net.InetAddress.equals(java.lang.Object)
         assertTrue(ipv4Localhost.equals(ipv4LoopbackIp));
     }
 
     /**
-     * @tests java.net.InetAddress#getAddress()
+     * java.net.InetAddress#getAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAddress",
-        args = {}
-    )
     public void test_getAddress() {
         // Test for method byte [] java.net.InetAddress.getAddress()
         try {
@@ -192,14 +176,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#getAllByName(java.lang.String)
+     * java.net.InetAddress#getAllByName(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAllByName",
-        args = {java.lang.String.class}
-    )
     public void test_getAllByNameLjava_lang_String() throws Exception {
         // Test for method java.net.InetAddress []
         // java.net.InetAddress.getAllByName(java.lang.String)
@@ -233,14 +211,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#getByName(java.lang.String)
+     * java.net.InetAddress#getByName(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getByName",
-        args = {java.lang.String.class}
-    )
     public void test_getByNameLjava_lang_String() throws Exception {
         // Test for method java.net.InetAddress
         // java.net.InetAddress.getByName(java.lang.String)
@@ -298,27 +270,15 @@
     }
 
     /**
-     * @tests java.net.InetAddress#getHostAddress()
+     * java.net.InetAddress#getHostAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHostAddress",
-        args = {}
-    )
     public void test_getHostAddress() {
         assertTrue(ipv4Localhost.getHostAddress().equals("127.0.0.1"));
     }
 
     /**
-     * @tests java.net.InetAddress#getHostName()
+     * java.net.InetAddress#getHostName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHostName",
-        args = {}
-    )
     public void test_getHostName() throws Exception {
         // Test for method java.lang.String java.net.InetAddress.getHostName()
         InetAddress ia = InetAddress
@@ -368,14 +328,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#getLocalHost()
+     * java.net.InetAddress#getLocalHost()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "UnknownHostException should be thrown if no IP address for the host could be found.",
-        method = "getLocalHost",
-        args = {}
-    )
     public void test_getLocalHost() {
         // Test for method java.net.InetAddress
         // java.net.InetAddress.getLocalHost()
@@ -392,14 +346,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#hashCode()
+     * java.net.InetAddress#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     int getHashCode(String literal) {
         InetAddress host = null;
         try {
@@ -422,14 +370,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#isMulticastAddress()
+     * java.net.InetAddress#isMulticastAddress()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMulticastAddress",
-        args = {}
-    )
     public void test_isMulticastAddress() {
         // Test for method boolean java.net.InetAddress.isMulticastAddress()
         try {
@@ -451,14 +393,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#toString()
+     * java.net.InetAddress#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
         // Test for method java.lang.String java.net.InetAddress.toString()
         InetAddress ia2 = InetAddress.getByName(Support_Configuration.InetTestIP);
@@ -469,14 +405,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#getByAddress(java.lang.String, byte[])
+     * java.net.InetAddress#getByAddress(java.lang.String, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getByAddress",
-        args = {java.lang.String.class, byte[].class}
-    )
     public void test_getByAddressLjava_lang_String$B() {
         // Check an IPv4 address with an IPv6 hostname
         byte ipAddress[] = { 127, 0, 0, 1 };
@@ -510,14 +440,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#getCanonicalHostName()
+     * java.net.InetAddress#getCanonicalHostName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCanonicalHostName",
-        args = {}
-    )
     public void test_getCanonicalHostName() throws Exception {
         assertTrue("getCanonicalHostName returned a zero length string ",
                 ipv4Localhost.getCanonicalHostName().length() != 0);
@@ -539,14 +463,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#isReachableI
+     * java.net.InetAddress#isReachableI
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "IOException checking missed (if network error occurs).",
-        method = "isReachable",
-        args = {int.class}
-    )
     public void test_isReachableI() throws Exception {
         assertTrue(ipv4LoopbackIp.isReachable(10000));
         try {
@@ -558,14 +476,8 @@
     }
 
     /**
-     * @tests java.net.InetAddress#isReachableLjava_net_NetworkInterfaceII
+     * java.net.InetAddress#isReachableLjava_net_NetworkInterfaceII
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "IOException checking missed (if network error occurs).",
-        method = "isReachable",
-        args = {java.net.NetworkInterface.class, int.class, int.class}
-    )
     @BrokenTest("Depends on external network address and shows different" +
             "behavior with WLAN and 3G networks")
     public void test_isReachableLjava_net_NetworkInterfaceII() throws Exception {
@@ -622,12 +534,6 @@
     };
 
     // Regression Test for Harmony-2290
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "Regeression test. Functional test.",
-        method = "isReachable",
-        args = {java.net.NetworkInterface.class, int.class, int.class}
-    )
     public void test_isReachableLjava_net_NetworkInterfaceII_loopbackInterface() throws IOException {
         final int TTL = 20;
         final int TIME_OUT = 3000;
@@ -663,40 +569,22 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility.
+     * serialization/deserialization compatibility.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization.",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void testSerializationSelf() throws Exception {
         SerializationTest.verifySelf(ipv4Localhost, COMPARATOR);
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization.",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void testSerializationCompatibility() throws Exception {
         SerializationTest.verifyGolden(this, ipv4Localhost, COMPARATOR);
     }
 
     /**
-     * @tests java.net.InetAddress#getByAddress(byte[])
+     * java.net.InetAddress#getByAddress(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getByAddress",
-        args = {byte[].class}
-    )
     public void test_getByAddress() {
         byte ipAddress[] = { 127, 0, 0, 1 };
         try {
@@ -732,12 +620,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isAnyLocalAddress",
-        args = {}
-    )
     public void test_isAnyLocalAddress() throws Exception {
         byte [] ipAddress1 = { 127, 42, 42, 42 };
         InetAddress ia1 = InetAddress.getByAddress(ipAddress1);
@@ -748,12 +630,6 @@
         assertTrue(ia2.isAnyLocalAddress());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isLinkLocalAddress",
-        args = {}
-    )
     public void test_isLinkLocalAddress() throws Exception {
         String addrName = "FE80::0";
         InetAddress addr = InetAddress.getByName(addrName);
@@ -780,12 +656,6 @@
                 .isLinkLocalAddress());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isLoopbackAddress",
-        args = {}
-    )
     public void test_isLoopbackAddress() throws Exception {
         String addrName = "127.0.0.0";
         assertTrue("Loopback address " + addrName + " not detected.",
@@ -815,12 +685,6 @@
                 .isLoopbackAddress());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCGlobal",
-        args = {}
-    )
     public void test_isMCGlobal() throws Exception {
         String addrName = "224.0.0.255";
         InetAddress addr = InetAddress.getByName(addrName);
@@ -846,12 +710,6 @@
                 .isMCGlobal());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCLinkLocal",
-        args = {}
-    )
     public void test_isMCLinkLocal() throws Exception {
         String addrName = "224.0.0.255";
         InetAddress addr = InetAddress.getByName(addrName);
@@ -883,12 +741,6 @@
                 !addr.isMCLinkLocal());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCNodeLocal",
-        args = {}
-    )
     public void test_isMCNodeLocal() throws Exception {
         String addrName = "224.42.42.42";
         InetAddress addr = InetAddress.getByName(addrName);
@@ -911,12 +763,6 @@
                 .isMCNodeLocal());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCOrgLocal",
-        args = {}
-    )
     public void test_isMCOrgLocal() throws Exception {
         String addrName = "239.252.0.0"; // a multicast addr 1110
         InetAddress addr = InetAddress.getByName(addrName);
@@ -946,12 +792,6 @@
                 !addr.isMCOrgLocal());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isMCSiteLocal",
-        args = {}
-    )
     public void test_isMCSiteLocal() throws Exception {
         String addrName = "FFF5:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF";
         InetAddress addr = InetAddress.getByName(addrName);
@@ -984,12 +824,6 @@
                 addr.isMCSiteLocal());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isSiteLocalAddress",
-        args = {}
-    )
     public void test_isSiteLocalAddress() throws Exception {
         String addrName = "42.42.42.42";
         InetAddress addr = InetAddress.getByName(addrName);
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java
index 724b8c0..f1dba00 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/InetSocketAddressTest.java
@@ -15,12 +15,6 @@
  */
 package org.apache.harmony.luni.tests.java.net;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.Serializable;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
@@ -33,27 +27,11 @@
 import org.apache.harmony.testframework.serialization.SerializationTest;
 import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
-@TestTargetClass(InetSocketAddress.class)
 public class InetSocketAddressTest extends TestCase {
 
     /**
-     * @tests java.net.InetSocketAddress#InetSocketAddress(String, int)
+     * java.net.InetSocketAddress#InetSocketAddress(String, int)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "InetSocketAddress",
-            args = {java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = SocketAddress.class,
-            method = "SocketAddress",
-            args = {}
-        )
-    })
     public void test_ConstructorLjava_lang_StringI() throws Exception {
         // regression test for Harmony-1042
         InetSocketAddress address = new InetSocketAddress("127.0.0.1", 0);
@@ -74,33 +52,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "InetSocketAddress",
-            args = {java.net.InetAddress.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getHostName",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPort",
-            args = {}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "",
-                clazz = SocketAddress.class,
-                method = "SocketAddress",
-                args = {}
-        )
-    })
     public void test_ConstructorLInetAddressI() {
         String validIPAddresses[] = { "::1.2.3.4", "::", "::", "1::0", "1::",
                 "::1", "0",
@@ -155,21 +106,6 @@
             fail("UnknownHostException was thrown.");
         }
     }
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "",
-                method = "InetSocketAddress",
-                args = {int.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "",
-                clazz = SocketAddress.class,
-                method = "SocketAddress",
-                args = {}
-        )
-    })
     public void test_ConstructorI() {
 
         InetSocketAddress isa = new  InetSocketAddress(65535);
@@ -192,14 +128,8 @@
     }
 
     /**
-     * @tests java.net.InetSocketAddress#createUnresolved(String, int)
+     * java.net.InetSocketAddress#createUnresolved(String, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is the complete subset of tests for createUnresolved method.",
-        method = "createUnresolved",
-        args = {java.lang.String.class, int.class}
-    )
     public void test_createUnresolvedLjava_lang_StringI() {
         HostPortPair[] legalHostPortPairs = { new HostPortPair("127.0.0.1", 1234),
                 new HostPortPair("192.168.0.1", 10000), new HostPortPair("127.0.0", 0),
@@ -216,14 +146,8 @@
     }
 
     /**
-     * @tests java.net.InetSocketAddress#createUnresolved(String, int)
+     * java.net.InetSocketAddress#createUnresolved(String, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "This is the complete subset of tests for createUnresolved method.",
-        method = "createUnresolved",
-        args = {java.lang.String.class, int.class}
-    )
     public void test_createUnresolvedLjava_lang_StringI_IllegalArgumentException() {
         HostPortPair[] illegalHostPortPairs = { new HostPortPair(null, 1),
                 new HostPortPair("host", -1), new HostPortPair("host", 65536) };
@@ -270,14 +194,8 @@
     };
 
     /**
-     * @tests serialization/deserialization compatibility.
+     * serialization/deserialization compatibility.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void testSerializationSelf() throws Exception {
 
         Object[] testCases = {
@@ -288,14 +206,8 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks serialization",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void testSerializationCompatibility() throws Exception {
         InetAddress localhost = InetAddress.getByAddress("Localhost", new byte[]{127, 0, 0, 1});
         Object[] testCases = {
@@ -305,12 +217,6 @@
         SerializationTest.verifyGolden(this, testCases, COMPARATOR);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equals() throws Exception {
         InetSocketAddress isa1 = new InetSocketAddress(1);
         InetSocketAddress isa2 = new InetSocketAddress(2);
@@ -324,12 +230,6 @@
         assertTrue(isa1.equals(isa2));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAddress",
-        args = {}
-    )
     public void test_getAddress() {
 
         String validIPAddresses[] = { "::1.2.3.4", "::", "::", "1::0", "1::",
@@ -353,12 +253,6 @@
         assertNotNull(isa.getAddress());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
         InetAddress localhost = InetAddress.getByName("localhost");
         InetSocketAddress isa1 = new InetSocketAddress(localhost.getHostName(), 8080);
@@ -369,12 +263,6 @@
         assertFalse(isa1.hashCode() == isa3.hashCode());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isUnresolved",
-        args = {}
-    )
     public void test_isUnresolved() {
         InetSocketAddress isa1 = new InetSocketAddress("localhost", 80);
         assertFalse(isa1.isUnresolved());
@@ -383,14 +271,21 @@
         assertTrue(sockAddr.isUnresolved());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         InetSocketAddress isa = new InetSocketAddress("localhost", 80);
         assertNotNull(isa.toString());
     }
+
+    public void test_getHostString() throws Exception {
+        // When we have a hostname, we'll get it back because that doesn't cost a DNS lookup...
+        InetSocketAddress hasHostname = InetSocketAddress.createUnresolved("some host", 1234);
+        assertEquals("some host", hasHostname.getHostString());
+        assertEquals("some host", hasHostname.getHostName());
+        // When we don't have a hostname, whether or not we do the reverse lookup is the difference
+        // between getHostString and getHostName...
+        InetAddress address = InetAddress.getByAddress(new byte[] { 127, 0, 0, 1 });
+        InetSocketAddress noHostname = new InetSocketAddress(address, 1234);
+        assertEquals("127.0.0.1", noHostname.getHostString());
+        assertEquals("localhost", noHostname.getHostName());
+    }
 }
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java
index 054ab40..35eed90 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URITest.java
@@ -84,7 +84,7 @@
     }
 
     /**
-     * @tests java.net.URI#URI(java.lang.String)
+     * java.net.URI#URI(java.lang.String)
      */
     public void test_ConstructorLjava_lang_String() throws URISyntaxException {
         // tests for public URI(String uri) throws URISyntaxException
@@ -252,7 +252,7 @@
     }
 
     /**
-     * @tests java.net.URI#URI(java.lang.String)
+     * java.net.URI#URI(java.lang.String)
      */
     public void test_URI_String() {
         try {
@@ -281,7 +281,7 @@
     }
 
     /**
-     * @tests java.net.URI#URI(java.lang.String, java.lang.String,
+     * java.net.URI#URI(java.lang.String, java.lang.String,
      *        java.lang.String)
      */
     public void test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_String()
@@ -323,7 +323,7 @@
     }
 
     /**
-     * @tests java.net.URI#URI(java.lang.String, java.lang.String,
+     * java.net.URI#URI(java.lang.String, java.lang.String,
      *        java.lang.String, int, java.lang.String, java.lang.String,
      *        java.lang.String)
      */
@@ -414,7 +414,7 @@
 
     /**
      * @throws URISyntaxException
-     * @tests java.net.URI#URI(java.lang.String, java.lang.String,
+     * java.net.URI#URI(java.lang.String, java.lang.String,
      *        java.lang.String, java.lang.String)
      */
     public void test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String()
@@ -460,7 +460,7 @@
 
     /**
      * @throws URISyntaxException
-     * @tests java.net.URI#URI(java.lang.String, java.lang.String,
+     * java.net.URI#URI(java.lang.String, java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String)
      */
     public void test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String()
@@ -507,7 +507,7 @@
 
     /**
      * @throws URISyntaxException
-     * @tests java.net.URI#URI(java.lang.String, java.lang.String,
+     * java.net.URI#URI(java.lang.String, java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String)
      */
     public void test_fiveArgConstructor() throws URISyntaxException {
@@ -535,7 +535,7 @@
     }
 
     /**
-     * @tests java.net.URI#compareTo(java.lang.Object)
+     * java.net.URI#compareTo(java.lang.Object)
      */
     public void test_compareToLjava_lang_Object() throws Exception {
         // compareTo tests
@@ -611,7 +611,7 @@
 
     /**
      * @throws URISyntaxException
-     * @tests java.net.URI#compareTo(java.lang.Object)
+     * java.net.URI#compareTo(java.lang.Object)
      */
     public void test_compareTo2() throws URISyntaxException {
         URI uri, uri2;
@@ -636,7 +636,7 @@
     }
 
     /**
-     * @tests java.net.URI#create(java.lang.String)
+     * java.net.URI#create(java.lang.String)
      */
     public void test_createLjava_lang_String() {
         try {
@@ -648,7 +648,7 @@
     }
 
     /**
-     * @tests java.net.URI#equals(java.lang.Object)
+     * java.net.URI#equals(java.lang.Object)
      */
     public void test_equalsLjava_lang_Object() throws Exception {
         String[][] equalsData = new String[][] {
@@ -722,7 +722,7 @@
 
     /**
      * @throws URISyntaxException
-     * @tests java.net.URI#equals(java.lang.Object)
+     * java.net.URI#equals(java.lang.Object)
      */
     public void test_equals2() throws URISyntaxException {
         // test URIs with empty string authority
@@ -745,7 +745,7 @@
     }
 
     /**
-     * @tests java.net.URI#getAuthority()
+     * java.net.URI#getAuthority()
      */
     public void test_getAuthority() throws Exception {
         URI[] uris = getUris();
@@ -778,7 +778,7 @@
     }
 
     /**
-     * @tests java.net.URI#getAuthority()
+     * java.net.URI#getAuthority()
      */
     public void test_getAuthority2() throws Exception {
         // tests for URIs with empty string authority component
@@ -823,7 +823,7 @@
     }
 
     /**
-     * @tests java.net.URI#getFragment()
+     * java.net.URI#getFragment()
      */
     public void test_getFragment() throws Exception {
         URI[] uris = getUris();
@@ -847,7 +847,7 @@
     }
 
     /**
-     * @tests java.net.URI#getHost()
+     * java.net.URI#getHost()
      */
     public void test_getHost() throws Exception {
         URI[] uris = getUris();
@@ -868,7 +868,7 @@
     }
 
     /**
-     * @tests java.net.URI#getPath()
+     * java.net.URI#getPath()
      */
     public void test_getPath() throws Exception {
         URI[] uris = getUris();
@@ -893,7 +893,7 @@
     }
 
     /**
-     * @tests java.net.URI#getPort()
+     * java.net.URI#getPort()
      */
     public void test_getPort() throws Exception {
         URI[] uris = getUris();
@@ -910,7 +910,7 @@
     }
 
     /**
-     * @tests java.net.URI#getPort()
+     * java.net.URI#getPort()
      */
     public void test_getPort2() throws Exception {
         // if port value is negative, the authority should be
@@ -938,7 +938,7 @@
     }
 
     /**
-     * @tests java.net.URI#getQuery()
+     * java.net.URI#getQuery()
      */
     public void test_getQuery() throws Exception {
         URI[] uris = getUris();
@@ -962,7 +962,7 @@
     }
 
     /**
-     * @tests java.net.URI#getRawAuthority()
+     * java.net.URI#getRawAuthority()
      */
     public void test_getRawAuthority() throws Exception {
         URI[] uris = getUris();
@@ -991,7 +991,7 @@
     }
 
     /**
-     * @tests java.net.URI#getRawFragment()
+     * java.net.URI#getRawFragment()
      */
     public void test_getRawFragment() throws Exception {
         URI[] uris = getUris();
@@ -1017,7 +1017,7 @@
     }
 
     /**
-     * @tests java.net.URI#getRawPath()
+     * java.net.URI#getRawPath()
      */
     public void test_getRawPath() throws Exception {
         URI[] uris = getUris();
@@ -1043,7 +1043,7 @@
     }
 
     /**
-     * @tests java.net.URI#getRawQuery()
+     * java.net.URI#getRawQuery()
      */
     public void test_getRawQuery() throws Exception {
         URI[] uris = getUris();
@@ -1071,7 +1071,7 @@
     }
 
     /**
-     * @tests java.net.URI#getRawSchemeSpecificPart()
+     * java.net.URI#getRawSchemeSpecificPart()
      */
     public void test_getRawSchemeSpecificPart() throws Exception {
         URI[] uris = getUris();
@@ -1102,7 +1102,7 @@
     }
 
     /**
-     * @tests java.net.URI#getRawUserInfo()
+     * java.net.URI#getRawUserInfo()
      */
     public void test_getRawUserInfo() throws URISyntaxException {
         URI[] uris = getUris();
@@ -1129,7 +1129,7 @@
     }
 
     /**
-     * @tests java.net.URI#getScheme()
+     * java.net.URI#getScheme()
      */
     public void test_getScheme() throws Exception {
         URI[] uris = getUris();
@@ -1150,7 +1150,7 @@
     }
 
     /**
-     * @tests java.net.URI#getSchemeSpecificPart()
+     * java.net.URI#getSchemeSpecificPart()
      */
     public void test_getSchemeSpecificPart() throws Exception {
         URI[] uris = getUris();
@@ -1183,7 +1183,7 @@
     }
 
     /**
-     * @tests java.net.URI#getUserInfo()
+     * java.net.URI#getUserInfo()
      */
     public void test_getUserInfo() throws Exception {
         URI[] uris = getUris();
@@ -1211,7 +1211,7 @@
     }
 
     /**
-     * @tests java.net.URI#hashCode()
+     * java.net.URI#hashCode()
      */
     public void test_hashCode() throws Exception {
         String[][] hashCodeData = new String[][] {
@@ -1281,7 +1281,7 @@
     }
 
     /**
-     * @tests java.net.URI#isAbsolute()
+     * java.net.URI#isAbsolute()
      */
     public void test_isAbsolute() throws URISyntaxException {
         String[] isAbsoluteData = new String[] { "mailto:user@ca.ibm.com",
@@ -1302,7 +1302,7 @@
     }
 
     /**
-     * @tests java.net.URI#isOpaque()
+     * java.net.URI#isOpaque()
      */
     public void test_isOpaque() throws URISyntaxException {
         String[] isOpaqueData = new String[] { "mailto:user@ca.ibm.com",
@@ -1323,7 +1323,7 @@
     }
 
     /**
-     * @tests java.net.URI#normalize()
+     * java.net.URI#normalize()
      */
     public void test_normalize() throws Exception {
 
@@ -1384,7 +1384,7 @@
     }
 
     /**
-     * @tests java.net.URI#normalize()
+     * java.net.URI#normalize()
      */
     public void test_normalize2() throws URISyntaxException {
         URI uri1 = null, uri2 = null;
@@ -1400,7 +1400,7 @@
     }
 
     /**
-     * @tests java.net.URI#normalize()
+     * java.net.URI#normalize()
      */
     public void test_normalize3() throws URISyntaxException {
         // return same URI if it has a normalized path already
@@ -1416,7 +1416,7 @@
     }
 
     /**
-     * @tests java.net.URI#parseServerAuthority()
+     * java.net.URI#parseServerAuthority()
      */
     public void test_parseServerAuthority() throws URISyntaxException {
         // registry based uris
@@ -1538,7 +1538,7 @@
     }
 
     /**
-     * @tests java.net.URI#relativize(java.net.URI)
+     * java.net.URI#relativize(java.net.URI)
      */
     public void test_relativizeLjava_net_URI() throws URISyntaxException {
         // relativization tests
@@ -1624,7 +1624,7 @@
     }
 
     /**
-     * @tests java.net.URI#relativize(java.net.URI)
+     * java.net.URI#relativize(java.net.URI)
      */
     public void test_relativize2() throws URISyntaxException {
         URI a = new URI("http://host/dir");
@@ -1663,7 +1663,7 @@
     }
 
     /**
-     * @tests java.net.URI#resolve(java.net.URI)
+     * java.net.URI#resolve(java.net.URI)
      */
     public void test_resolve() throws URISyntaxException {
         URI uri1 = null, uri2 = null;
@@ -1679,7 +1679,7 @@
     }
 
     /**
-     * @tests java.net.URI#resolve(java.net.URI)
+     * java.net.URI#resolve(java.net.URI)
      */
     public void test_resolveLjava_net_URI() {
         // resolution tests
@@ -1735,7 +1735,7 @@
     }
 
     /**
-     * @tests java.net.URI#toASCIIString()
+     * java.net.URI#toASCIIString()
      */
     public void test_toASCIIString() throws Exception {
         URI[] uris = getUris();
@@ -1786,7 +1786,7 @@
     }
 
     /**
-     * @tests java.net.URI#toString()
+     * java.net.URI#toString()
      */
     public void test_toString() throws Exception {
         URI[] uris = getUris();
@@ -1818,7 +1818,7 @@
     }
 
     /**
-     * @tests java.net.URI#toURL()
+     * java.net.URI#toURL()
      */
     public void test_toURL() throws Exception {
         String absoluteuris[] = new String[] { "mailto:noreply@apache.org",
@@ -1849,7 +1849,7 @@
     }
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
         URI uri = new URI("http://harmony.apache.org/");
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
index 8a36419..dd6a0f0 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLConnectionTest.java
@@ -17,10 +17,6 @@
 package org.apache.harmony.luni.tests.java.net;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import junit.framework.TestCase;
 import tests.support.Support_Configuration;
 import tests.support.Support_PortManager;
@@ -65,23 +61,6 @@
 import java.util.Map;
 import java.util.TimeZone;
 
-@TestTargetClass(
-   value = URLConnection.class,
-   untestedMethods = {
-       @TestTargetNew(
-           level = TestLevel.NOT_NECESSARY,
-           notes = "Default implementation returns always null according to spec.",
-           method = "getHeaderField",
-           args = {int.class}
-       ),
-       @TestTargetNew(
-           level = TestLevel.NOT_NECESSARY,
-           notes = "Default implementation returns always null according to spec.",
-           method = "getHeaderFieldKey",
-           args = {int.class}
-       )
-   }
-)
 public class URLConnectionTest extends TestCase {
 
     private static final String testString = "Hello World";
@@ -111,14 +90,8 @@
     public boolean isAbortCalled;
 
     /**
-     * @tests {@link java.net.URLConnection#addRequestProperty(String, String)}
+     * {@link java.net.URLConnection#addRequestProperty(String, String)}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Exceptions checked only. Cannot test positive test since getter method is not supported.",
-        method = "addRequestProperty",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_addRequestProperty() throws MalformedURLException,
             IOException {
 
@@ -147,14 +120,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#setRequestProperty(String, String)}
+     * {@link java.net.URLConnection#setRequestProperty(String, String)}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Exceptions checked only -> only partially implemented.",
-        method = "setRequestProperty",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_setRequestProperty() throws MalformedURLException,
             IOException {
 
@@ -186,14 +153,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#setUseCaches(boolean)}
+     * {@link java.net.URLConnection#setUseCaches(boolean)}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Complete together with getUseCaches test.",
-        method = "setUseCaches",
-        args = {boolean.class}
-    )
     public void test_setUseCachesZ() throws MalformedURLException, IOException {
 
         // Regression for HARMONY-71
@@ -209,14 +170,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#setAllowUserInteraction(boolean)}
+     * {@link java.net.URLConnection#setAllowUserInteraction(boolean)}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Exceptions checked only.",
-        method = "setAllowUserInteraction",
-        args = {boolean.class}
-    )
     public void test_setAllowUserInteractionZ() throws MalformedURLException,
             IOException {
 
@@ -414,14 +369,8 @@
     /**
      * @throws URISyntaxException
      * @throws ClassNotFoundException
-     * @tests {@link java.net.URLConnection#addRequestProperty(java.lang.String,java.lang.String)}
+     * {@link java.net.URLConnection#addRequestProperty(java.lang.String,java.lang.String)}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch.",
-        method = "addRequestProperty",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_addRequestPropertyLjava_lang_StringLjava_lang_String()
             throws IOException, ClassNotFoundException, URISyntaxException {
         uc.setRequestProperty("prop", "yo");
@@ -483,22 +432,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getAllowUserInteraction()}
+     * {@link java.net.URLConnection#getAllowUserInteraction()}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "getAllowUserInteraction",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "From harmony branch.",
-            method = "setAllowUserInteraction",
-            args = {boolean.class}
-        )
-    })
     public void test_getAllowUserInteraction() throws IOException {
         uc.setAllowUserInteraction(false);
         assertFalse("getAllowUserInteraction should have returned false", uc
@@ -559,14 +494,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#connect()}
+     * {@link java.net.URLConnection#connect()}
      */
-    @TestTargetNew(
-      level = TestLevel.COMPLETE,
-      notes = "",
-      method = "connect",
-      args = {}
-    )
     public void test_connect() throws IOException {
 
         uc.connect();
@@ -581,14 +510,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getContent()}
+     * {@link java.net.URLConnection#getContent()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch.",
-        method = "getContent",
-        args = {}
-    )
     public void test_getContent() throws IOException {
         byte[] ba = new byte[testString.getBytes().length];
         String buf = null;
@@ -627,14 +550,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getContent(Class[])}
+     * {@link java.net.URLConnection#getContent(Class[])}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch.",
-        method = "getContent",
-        args = {java.lang.Class[].class}
-    )
     public void test_getContent_LjavalangClass() throws IOException {
         byte[] ba = new byte[600];
 
@@ -683,14 +600,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getContentEncoding()}
+     * {@link java.net.URLConnection#getContentEncoding()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getContentEncoding",
-        args = {}
-    )
     @BrokenTest("Fails in CTS, passes in CoreTestRunner")
     public void test_getContentEncoding() throws IOException {
         // faulty setup
@@ -721,14 +632,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getContentLength()}
+     * {@link java.net.URLConnection#getContentLength()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getContentLength",
-        args = {}
-    )
     public void test_getContentLength() {
         assertEquals(testString.getBytes().length,
                 fileURLCon.getContentLength());
@@ -740,14 +645,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getContentType()}
+     * {@link java.net.URLConnection#getContentType()}
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "only default encoding may be tested",
-        method = "getContentType",
-        args = {}
-    )
     public void test_getContentType() throws IOException, MalformedURLException {
 
         assertTrue("getContentType failed: " + fileURLCon.getContentType(),
@@ -775,16 +674,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getDate()}
+     * {@link java.net.URLConnection#getDate()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch. URLConnection.getDate crashes in cases " +
-                "where the returned expiration date doesn't seems to be " +
-                "parsable. The RI just returns 0.",
-        method = "getDate",
-        args = {}
-    )
     public void test_getDate() {
         // should be greater than 930000000000L which represents the past
         assertTrue("getDate gave wrong date: " + uc.getDate(),
@@ -793,22 +684,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getDefaultAllowUserInteraction()}
+     * {@link java.net.URLConnection#getDefaultAllowUserInteraction()}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "getDefaultAllowUserInteraction",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "setDefaultAllowUserInteraction",
-            args = {boolean.class}
-        )
-    })
     public void test_getDefaultAllowUserInteraction() throws IOException {
         boolean oldSetting = URLConnection.getDefaultAllowUserInteraction();
 
@@ -825,22 +702,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getDefaultRequestProperty(String)}
+     * {@link java.net.URLConnection#getDefaultRequestProperty(String)}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "getDefaultRequestProperty",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "setDefaultRequestProperty",
-            args = {java.lang.String.class, java.lang.String.class}
-        )
-    })
     @SuppressWarnings("deprecation")
     public void test_getDefaultRequestPropertyLjava_lang_String() {
         URLConnection.setDefaultRequestProperty("Shmoo", "Blah");
@@ -859,22 +722,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link  java.net.URLConnection#getDefaultUseCaches()}
+     * {@link  java.net.URLConnection#getDefaultUseCaches()}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "getDefaultUseCaches",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "setDefaultUseCaches",
-            args = {boolean.class}
-        )
-    })
     public void test_getDefaultUseCaches_CachedRC() throws IOException {
         boolean oldSetting = uc.getDefaultUseCaches();
 
@@ -932,22 +781,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getDoInput()}
+     * {@link java.net.URLConnection#getDoInput()}
      */
-    @TestTargets({
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch.",
-        method = "getDoInput",
-        args = {}
-    ),
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "setDoInput",
-            args = {boolean.class}
-        )
-    })
     public void test_getDoInput() throws IOException {
         assertTrue("Should be set to true by default", uc.getDoInput());
 
@@ -971,22 +806,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getDoOutput()}
+     * {@link java.net.URLConnection#getDoOutput()}
      */
-    @TestTargets({
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch.",
-        method = "getDoOutput",
-        args = {}
-    ),
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "From harmony branch.",
-            method = "setDoOutput",
-            args = {boolean.class}
-        )
-    })
     public void test_getDoOutput() throws IOException {
         assertFalse("Should be set to false by default", uc.getDoOutput());
 
@@ -1009,16 +830,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getExpiration()}
+     * {@link java.net.URLConnection#getExpiration()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch. URLConnection.getExpiration crashes in " +
-                "cases where the returned expiration date doesn't seems to " +
-                "be parsable. The RI just returns 0.",
-        method = "getExpiration",
-        args = {}
-    )
     public void test_getExpiration() throws IOException {
 
         uc.connect();
@@ -1032,14 +845,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getFileNameMap()}
+     * {@link java.net.URLConnection#getFileNameMap()}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "From harmony branch.",
-        method = "getFileNameMap",
-        args = {}
-    )
     public void test_getFileNameMap() {
         // Tests for the standard MIME types -- users may override these
         // in their JRE
@@ -1079,14 +886,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getHeaderFieldDate(java.lang.String, long)}
+     * {@link java.net.URLConnection#getHeaderFieldDate(java.lang.String, long)}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHeaderFieldDate",
-        args = {java.lang.String.class, long.class}
-    )
     public void test_getHeaderFieldDateLjava_lang_StringJ() {
         Support_TestWebData params = Support_TestWebData.testParams[0];
 
@@ -1115,14 +916,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getHeaderField(int)}
+     * {@link java.net.URLConnection#getHeaderField(int)}
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_NECESSARY,
-        notes = "not supported. Always returns null.From harmony branch.",
-        method = "getHeaderField",
-        args = {int.class}
-    )
     public void DISABLED_test_getHeaderFieldI() {
         int i = 0;
         String hf;
@@ -1149,14 +944,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getHeaderFieldKey(int)}
+     * {@link java.net.URLConnection#getHeaderFieldKey(int)}
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_NECESSARY,
-        notes = "Not supported. Current implementation returns always null according to spec.",
-        method = "getHeaderFieldKey",
-        args = {int.class}
-    )
     public void DISABLED_test_getHeaderFieldKeyI() {
         String hf;
         boolean foundResponse = false;
@@ -1174,14 +963,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getHeaderFieldInt(String, int)}
+     * {@link java.net.URLConnection#getHeaderFieldInt(String, int)}
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "",
-        method = "getHeaderFieldInt",
-        args = {java.lang.String.class, int.class}
-    )
     public void test_getHeaderFieldInt() throws IOException, ParseException {
         Support_TestWebData params = Support_TestWebData.testParams[1];
 
@@ -1208,14 +991,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getHeaderField(java.lang.String)}
+     * {@link java.net.URLConnection#getHeaderField(java.lang.String)}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHeaderField",
-        args = {java.lang.String.class}
-    )
     public void test_getHeaderFieldLjava_lang_String() {
         Support_TestWebData params = Support_TestWebData.testParams[0];
 
@@ -1246,14 +1023,8 @@
     /**
      * @throws URISyntaxException
      * @throws ClassNotFoundException
-     * @tests {@link java.net.URLConnection#getHeaderFields()}
+     * {@link java.net.URLConnection#getHeaderFields()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHeaderFields",
-        args = {}
-    )
     public void test_getHeaderFields() throws IOException, ClassNotFoundException, URISyntaxException {
         Support_TestWebData params = Support_TestWebData.testParams[1];
 
@@ -1297,14 +1068,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getLastModified()}
+     * {@link java.net.URLConnection#getLastModified()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "From harmony branch.",
-        method = "getLastModified",
-        args = {}
-    )
     public void test_getLastModified() throws IOException {
 
         URL url4 = new URL(Support_Configuration.hTTPURLwLastModified);
@@ -1329,12 +1094,6 @@
         ((HttpURLConnection) uc).disconnect();
     }
 
-    @TestTargetNew(
-      level = TestLevel.COMPLETE,
-      notes = "",
-      method = "getOutputStream",
-      args = {}
-    )
     public void test_getOutputStream() throws IOException {
         String posted = "this is a test";
         URLConnection uc3 = new URL(Support_Configuration.hTTPURLgoogle)
@@ -1376,14 +1135,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getPermission()}
+     * {@link java.net.URLConnection#getPermission()}
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "From harmony branch.",
-        method = "getPermission",
-        args = {}
-    )
     public void test_getPermission() throws Exception {
         java.security.Permission p = uc.getPermission();
         assertTrue("Permission of wrong type: " + p.toString(),
@@ -1434,14 +1187,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getRequestProperties()}
+     * {@link java.net.URLConnection#getRequestProperties()}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "implementation test.From harmony branch.",
-        method = "getRequestProperties",
-        args = {}
-    )
     public void test_getRequestProperties() {
         uc.setRequestProperty("whatever", "you like");
         Map headers = uc.getRequestProperties();
@@ -1470,14 +1217,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getRequestProperties()}
+     * {@link java.net.URLConnection#getRequestProperties()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Exceptions checked only.From harmony branch.",
-        method = "getRequestProperties",
-        args = {}
-    )
     public void test_getRequestProperties_Exception() throws IOException {
         URL url = new URL("http", "test", 80, "index.html", new NewHandler());
         URLConnection urlCon = url.openConnection();
@@ -1493,14 +1234,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getRequestProperty(java.lang.String)}
+     * {@link java.net.URLConnection#getRequestProperty(java.lang.String)}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Exceptions checked only.From harmony branch.",
-        method = "getRequestProperty",
-        args = { String.class }
-    )
     public void test_getRequestProperty_LString_Exception() throws IOException {
         URL url = new URL("http", "test", 80, "index.html", new NewHandler());
         URLConnection urlCon = url.openConnection();
@@ -1517,14 +1252,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getRequestProperty(java.lang.String)}
+     * {@link java.net.URLConnection#getRequestProperty(java.lang.String)}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "From harmony branch.",
-        method = "getRequestProperty",
-        args = {java.lang.String.class}
-    )
     public void test_getRequestPropertyLjava_lang_String() {
         uc.setRequestProperty("Yo", "yo");
         assertTrue("Wrong property returned: " + uc.getRequestProperty("Yo"),
@@ -1534,36 +1263,16 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#getURL()}
+     * {@link java.net.URLConnection#getURL()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Exceptions checked only -> only partially implemented. From harmony branch.",
-        method = "getURL",
-        args = {}
-    )
     public void test_getURL() {
         assertTrue("Incorrect URL returned", uc.getURL().equals(url));
     }
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#getUseCaches()}
+     * {@link java.net.URLConnection#getUseCaches()}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Exceptions checked in setUseCaches. From harmony branch.",
-            method = "getUseCaches",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Exceptions checked in setUseCaches. From harmony branch.",
-            method = "setUseCaches",
-            args = {boolean.class}
-        )
-    })
     public void test_getUseCaches() throws IOException {
         uc2.setUseCaches(false);
         assertTrue("getUseCaches should have returned false", !uc2
@@ -1586,14 +1295,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#guessContentTypeFromName(String)}
+     * {@link java.net.URLConnection#guessContentTypeFromName(String)}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "guessContentTypeFromName",
-        args = {java.lang.String.class}
-    )
     public void test_guessContentTypeFromName()
             throws IOException {
 
@@ -1620,14 +1323,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#guessContentTypeFromStream(java.io.InputStream)}
+     * {@link java.net.URLConnection#guessContentTypeFromStream(java.io.InputStream)}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "guessContentTypeFromStream",
-        args = {java.io.InputStream.class}
-    )
     public void test_guessContentTypeFromStreamLjava_io_InputStream()
             throws IOException {
         assertContentTypeEquals("ASCII", "text/html", "<html>");
@@ -1678,22 +1375,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#setConnectTimeout(int)}
+     * {@link java.net.URLConnection#setConnectTimeout(int)}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setConnectTimeout",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getConnectTimeout",
-            args = {}
-        )
-    })
     public void test_setConnectTimeoutI() throws Exception {
         URLConnection uc = new URL("http://localhost").openConnection();
         assertEquals(0, uc.getConnectTimeout());
@@ -1728,22 +1411,8 @@
 
     /**
      * @throws IOException
-     * @tests {@link java.net.URLConnection#setFileNameMap(java.net.FileNameMap)}
+     * {@link java.net.URLConnection#setFileNameMap(java.net.FileNameMap)}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setFileNameMap",
-            args = {java.net.FileNameMap.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getFileNameMap",
-            args = {}
-        )
-    })
     public void test_setFileNameMapLjava_net_FileNameMap() throws IOException {
         FileNameMap mapOld = URLConnection.getFileNameMap();
         // nothing happens if set null
@@ -1784,22 +1453,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#setIfModifiedSince(long)}
+     * {@link java.net.URLConnection#setIfModifiedSince(long)}
      */
-    @TestTargets ( {
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIfModifiedSince",
-        args = {long.class}
-    ),
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "From harmony branch.",
-        method = "getIfModifiedSince",
-        args = {}
-        )
-    })
     public void test_setIfModifiedSinceJ() throws IOException {
         URL url = new URL("http://localhost:8080/");
         URLConnection connection = url.openConnection();
@@ -1832,12 +1487,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "test that page was not renewed in time indicated -> page returned event though it should not.",
-        method = "getIfModifiedSince",
-        args = {}
-    )
     public void test_getIfModifiedSinceJ() throws IOException {
 
         uc2.setIfModifiedSince(Calendar.getInstance().getTimeInMillis());
@@ -1849,22 +1498,8 @@
 
 
     /**
-     * @tests {@link java.net.URLConnection#setReadTimeout(int)}
+     * {@link java.net.URLConnection#setReadTimeout(int)}
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Test for SocketTimeoutException fails: instead undocumented UnknownServiceException is thrown.",
-            method = "setReadTimeout",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "Test for SocketTimeoutException fails: instead undocumented UnknownServiceException is thrown.",
-                method = "getReadTimeout",
-                args = {}
-            )
-    })
     public void test_setReadTimeoutI() throws Exception {
         assertEquals(0, uc.getReadTimeout());
         uc.setReadTimeout(0);
@@ -1902,14 +1537,8 @@
     }
 
     /**
-     * @tests {@link java.net.URLConnection#toString()}
+     * {@link java.net.URLConnection#toString()}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
 
         assertTrue("Wrong toString: " + uc.toString(), uc.toString().indexOf(
@@ -1918,23 +1547,11 @@
                 uc.getURL().toString()) > 0);
     }
 
-    @TestTargetNew(
-      level = TestLevel.SUFFICIENT,
-      notes = "protected constructor",
-      method = "URLConnection",
-      args = {java.net.URL.class}
-    )
     public void test_URLConnection() {
         String url = uc2.getURL().toString();
         assertEquals(url2.toString(), url);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInputStream",
-        args = {}
-      )
     public void testGetInputStream() throws IOException {
         fileURLCon.setDoInput(true);
         fileURLCon.connect();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java
index 67a81cf..1c86303 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/net/URLEncoderTest.java
@@ -20,14 +20,14 @@
 import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import java.net.URLEncoder;
-
+import java.nio.charset.UnsupportedCharsetException;
 import junit.framework.TestCase;
 import tests.support.Support_Configuration;
 
 public class URLEncoderTest extends TestCase {
 
     /**
-     * @tests java.net.URLEncoder#encode(java.lang.String)
+     * java.net.URLEncoder#encode(java.lang.String)
      */
     @SuppressWarnings("deprecation")
     public void test_encodeLjava_lang_String() {
@@ -44,7 +44,7 @@
     }
 
     /**
-     * @tests URLEncoder#encode(String, String)
+     * URLEncoder#encode(String, String)
      */
     public void test_encodeLjava_lang_StringLjava_lang_String()
             throws Exception {
@@ -53,6 +53,7 @@
             URLEncoder.encode("str", "unknown_enc");
             fail("Assert 0: Should throw UEE for invalid encoding");
         } catch (UnsupportedEncodingException e) {
+        } catch (UnsupportedCharsetException e) {
             // expected
         }
 
@@ -60,8 +61,8 @@
         try {
             URLEncoder.encode(null, "harmony");
             fail("NullPointerException expected");
-        } catch (NullPointerException e) {
-            // expected
+        } catch (NullPointerException expected) {
+        } catch (UnsupportedCharsetException expected) {
         }
     }
 }
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractCollectionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractCollectionTest.java
index 6191178..348a83c 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractCollectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractCollectionTest.java
@@ -26,7 +26,7 @@
 public class AbstractCollectionTest extends TestCase {
 
     /**
-     * @tests java.util.AbstractCollection#add(java.lang.Object)
+     * java.util.AbstractCollection#add(java.lang.Object)
      */
     public void test_addLjava_lang_Object() {
         AbstractCollection<Object> ac = new AbstractCollection<Object>() {
@@ -51,7 +51,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#addAll(java.util.Collection)
+     * java.util.AbstractCollection#addAll(java.util.Collection)
      */
     public void test_addAllLjava_util_Collection() {
         final Collection<String> fixtures = Arrays.asList("0", "1", "2");
@@ -80,7 +80,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#containsAll(java.util.Collection)
+     * java.util.AbstractCollection#containsAll(java.util.Collection)
      */
     public void test_containsAllLjava_util_Collection() {
         final Collection<String> fixtures = Arrays.asList("0", "1", "2");
@@ -109,7 +109,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#isEmpty()
+     * java.util.AbstractCollection#isEmpty()
      */
     public void test_isEmpty() {
         final boolean[] sizeCalled = new boolean[1];
@@ -130,7 +130,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#removeAll(java.util.Collection)
+     * java.util.AbstractCollection#removeAll(java.util.Collection)
      */
     public void test_removeAllLjava_util_Collection() {
         final String[] removed = new String[3];
@@ -172,7 +172,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#retainAll(java.util.Collection)
+     * java.util.AbstractCollection#retainAll(java.util.Collection)
      */
     public void test_retainAllLjava_util_Collection() {
         final String[] removed = new String[1];
@@ -210,7 +210,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#toArray()
+     * java.util.AbstractCollection#toArray()
      */
     public void test_toArray() {
         AbstractCollection<String> ac = new AbstractCollection<String>() {
@@ -250,7 +250,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#toArray(java.lang.Object[])
+     * java.util.AbstractCollection#toArray(java.lang.Object[])
      */
     public void test_toArray$Ljava_lang_Object() {
         AbstractCollection<String> ac = new AbstractCollection<String>() {
@@ -309,7 +309,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#toString()
+     * java.util.AbstractCollection#toString()
      */
     public void test_toString() {
         // see HARMONY-1522
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java
index 2ca15cb..fafc415 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractMapTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractMap;
 import java.util.AbstractSet;
 import java.util.Collections;
@@ -38,7 +33,6 @@
 import java.util.Vector;
 import java.util.WeakHashMap;
 
-@TestTargetClass(java.util.AbstractMap.class)
 public class AbstractMapTest extends junit.framework.TestCase {
 
     static final String specialKey = "specialKey".intern();
@@ -76,14 +70,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#keySet()
+     * java.util.AbstractMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         AbstractMap map1 = new HashMap(0);
         assertSame("HashMap(0)", map1.keySet(), map1.keySet());
@@ -108,14 +96,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#remove(java.lang.Object)
+     * java.util.AbstractMap#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         Object key = new Object();
         Object value = new Object();
@@ -152,14 +134,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#values()
+     * java.util.AbstractMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         AbstractMap map1 = new HashMap(0);
         assertSame("HashMap(0)", map1.values(), map1.values());
@@ -184,14 +160,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#clone()
+     * java.util.AbstractMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         class MyMap extends AbstractMap implements Cloneable {
             private Map map = new HashMap();
@@ -240,12 +210,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // normal clear()
         AbstractMap map = new HashMap();
@@ -264,14 +228,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#containsKey(Object)
+     * java.util.AbstractMap#containsKey(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKey() {
         AbstractMap map = new AMT();
 
@@ -289,14 +247,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#containsValue(Object)
+     * java.util.AbstractMap#containsValue(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     public void test_containValue() {
         AbstractMap map = new AMT();
 
@@ -313,14 +265,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#get(Object)
+     * java.util.AbstractMap#get(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_get() {
         AbstractMap map = new AMT();
         assertNull(map.get("key"));
@@ -396,14 +342,8 @@
     }
 
     /**
-     * @tests {@link java.util.AbstractMap#putAll(Map)}
+     * {@link java.util.AbstractMap#putAll(Map)}
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLMap() {
         Hashtable ht = new Hashtable();
         AbstractMap amt = new AMT();
@@ -412,23 +352,11 @@
         assertEquals("Should be equal", amt, ht);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "AbstractMap",
-        args = {}
-    )
     public void test_Constructor() {
         AMT amt = new AMT();
         assertNotNull(amt);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         AbstractMap amt1 = new AMT();
         AbstractMap amt2 = new AMT();
@@ -447,12 +375,6 @@
         assertFalse("assert 5", amt1.equals(this));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         AMT amt1 = new AMT();
         AMT amt2 = new AMT();
@@ -461,12 +383,6 @@
         assertNotSame(amt1.hashCode(), amt2.hashCode());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         AMT amt = new AMT();
         assertTrue(amt.isEmpty());
@@ -474,12 +390,6 @@
         assertFalse(amt.isEmpty());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_put() {
         AMT amt = new AMT();
         assertEquals(0, amt.size());
@@ -491,12 +401,6 @@
         assertEquals(3, amt.size());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         AMT amt = new AMT();
         assertEquals(0, amt.size());
@@ -508,12 +412,6 @@
         assertEquals(3, amt.size());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract. Functionality tested in subclasses for example in java.util.HashMap.",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         AMT amt = new AMT();
         assertEquals("{}", amt.toString());
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractSetTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractSetTest.java
index 952025f..f990b33 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractSetTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AbstractSetTest.java
@@ -16,11 +16,6 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.util.AbstractSequentialList;
@@ -29,7 +24,6 @@
 import java.util.Iterator;
 import java.util.Vector;
 
-@TestTargetClass(AbstractSet.class)
 public class AbstractSetTest extends TestCase {
 
     class Mock_AbstractSet extends AbstractSet{
@@ -56,31 +50,11 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         AbstractSet as = new Mock_AbstractSet();
         assertNotNull(as.hashCode());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "equals",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AbstractSet",
-            args = {}
-        )
-    })
     public void testEquals() {
         AbstractSet as1 = new Mock_AbstractSet();
         AbstractSet as2 = new Mock_AbstractSet();
@@ -88,12 +62,6 @@
         assertTrue(as1.equals(as2));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeAll",
-        args = {java.util.Collection.class}
-    )
     public void testRemoveAll() {
         AbstractSet as = new AbstractSet(){
             @Override
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AllTests.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AllTests.java
deleted file mode 100644
index 9966809..0000000
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/AllTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.luni.tests.java.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Listing of all the tests that are to be run.
- */
-public class AllTests {
-
-    public static void run() {
-        TestRunner.main(new String[] { AllTests.class.getName() });
-    }
-
-    public static final Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.util");
-
-        suite.addTestSuite(AbstractCollectionTest.class);
-        suite.addTestSuite(AbstractMapTest.class);
-        suite.addTestSuite(AbstractSetTest.class);
-        suite.addTestSuite(ArraysTest.class);
-        suite.addTestSuite(BitSetTest.class);
-        suite.addTestSuite(CollectionsTest.class);
-        suite.addTestSuite(DictionaryTest.class);
-        suite.addTestSuite(DuplicateFormatFlagsExceptionTest.class);
-        suite.addTestSuite(EventListenerProxyTest.class);
-        suite.addTestSuite(FormatFlagsConversionMismatchExceptionTest.class);
-        suite.addTestSuite(FormattableTest.class);
-        suite.addTestSuite(FormatterClosedExceptionTest.class);
-        suite.addTestSuite(HashMapTest.class);
-        suite.addTestSuite(IdentityHashMapTest.class);
-        suite.addTestSuite(IllegalFormatCodePointExceptionTest.class);
-        suite.addTestSuite(IllegalFormatConversionExceptionTest.class);
-        suite.addTestSuite(IllegalFormatFlagsExceptionTest.class);
-        suite.addTestSuite(IllegalFormatPrecisionExceptionTest.class);
-        suite.addTestSuite(IllegalFormatWidthExceptionTest.class);
-        suite.addTestSuite(InputMismatchExceptionTest.class);
-        suite.addTestSuite(InvalidPropertiesFormatExceptionTest.class);
-        suite.addTestSuite(LinkedHashMapTest.class);
-        suite.addTestSuite(ListIteratorTest.class);
-        suite.addTestSuite(MapEntryTest.class);
-        suite.addTestSuite(MissingFormatArgumentExceptionTest.class);
-        suite.addTestSuite(MissingFormatWidthExceptionTest.class);
-        suite.addTestSuite(ObserverTest.class);
-        suite.addTestSuite(UnknownFormatFlagsExceptionTest.class);
-        suite.addTestSuite(UUIDTest.class);
-        suite.addTestSuite(VectorTest.class);
-        suite.addTestSuite(WeakHashMapTest.class);
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArrayListTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArrayListTest.java
index 75154fa..8d328e7 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArrayListTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArrayListTest.java
@@ -40,7 +40,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#ArrayList()
+     * java.util.ArrayList#ArrayList()
      */
     public void test_Constructor() {
         // Test for method java.util.ArrayList()
@@ -53,7 +53,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#ArrayList(int)
+     * java.util.ArrayList#ArrayList(int)
      */
     public void test_ConstructorI() {
         // Test for method java.util.ArrayList(int)
@@ -72,7 +72,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#ArrayList(java.util.Collection)
+     * java.util.ArrayList#ArrayList(java.util.Collection)
      */
     public void test_ConstructorLjava_util_Collection() {
         // Test for method java.util.ArrayList(java.util.Collection)
@@ -93,7 +93,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#add(int, java.lang.Object)
+     * java.util.ArrayList#add(int, java.lang.Object)
      */
     public void test_addILjava_lang_Object() {
         // Test for method void java.util.ArrayList.add(int, java.lang.Object)
@@ -154,7 +154,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#add(int, java.lang.Object)
+     * java.util.ArrayList#add(int, java.lang.Object)
      */
     public void test_addILjava_lang_Object_2() {
         Object o = new Object();
@@ -174,7 +174,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#add(java.lang.Object)
+     * java.util.ArrayList#add(java.lang.Object)
      */
     public void test_addLjava_lang_Object() {
         // Test for method boolean java.util.ArrayList.add(java.lang.Object)
@@ -186,7 +186,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#addAll(int, java.util.Collection)
+     * java.util.ArrayList#addAll(int, java.util.Collection)
      */
     public void test_addAllILjava_util_Collection() {
         // Test for method boolean java.util.ArrayList.addAll(int,
@@ -223,7 +223,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#addAll(int, java.util.Collection)
+     * java.util.ArrayList#addAll(int, java.util.Collection)
      */
     @SuppressWarnings("unchecked")
     public void test_addAllILjava_util_Collection_2() {
@@ -292,7 +292,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#addAll(int, java.util.Collection)
+     * java.util.ArrayList#addAll(int, java.util.Collection)
      */
     public void test_addAllILjava_util_Collection_3() {
         ArrayList obj = new ArrayList();
@@ -355,7 +355,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#addAll(java.util.Collection)
+     * java.util.ArrayList#addAll(java.util.Collection)
      */
     public void test_addAllLjava_util_Collection() {
         // Test for method boolean
@@ -459,7 +459,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#clear()
+     * java.util.ArrayList#clear()
      */
     public void test_clear() {
         // Test for method void java.util.ArrayList.clear()
@@ -479,7 +479,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#clone()
+     * java.util.ArrayList#clone()
      */
     public void test_clone() {
         // Test for method java.lang.Object java.util.ArrayList.clone()
@@ -501,7 +501,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#contains(java.lang.Object)
+     * java.util.ArrayList#contains(java.lang.Object)
      */
     public void test_containsLjava_lang_Object() {
         // Test for method boolean
@@ -520,7 +520,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#ensureCapacity(int)
+     * java.util.ArrayList#ensureCapacity(int)
      */
     public void test_ensureCapacityI() {
         // Test for method void java.util.ArrayList.ensureCapacity(int)
@@ -549,7 +549,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#get(int)
+     * java.util.ArrayList#get(int)
      */
     public void test_getI() {
         // Test for method java.lang.Object java.util.ArrayList.get(int)
@@ -564,7 +564,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#indexOf(java.lang.Object)
+     * java.util.ArrayList#indexOf(java.lang.Object)
      */
     public void test_indexOfLjava_lang_Object() {
         // Test for method int java.util.ArrayList.indexOf(java.lang.Object)
@@ -579,7 +579,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#isEmpty()
+     * java.util.ArrayList#isEmpty()
      */
     public void test_isEmpty() {
         // Test for method boolean java.util.ArrayList.isEmpty()
@@ -590,7 +590,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#lastIndexOf(java.lang.Object)
+     * java.util.ArrayList#lastIndexOf(java.lang.Object)
      */
     public void test_lastIndexOfLjava_lang_Object() {
         // Test for method int java.util.ArrayList.lastIndexOf(java.lang.Object)
@@ -606,7 +606,7 @@
     }
 
     /**
-     * @tests {@link java.util.ArrayList#removeRange(int, int)}
+     * {@link java.util.ArrayList#removeRange(int, int)}
      */
     public void test_removeRange() {
         MockArrayList mylist = new MockArrayList();
@@ -663,7 +663,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#remove(int)
+     * java.util.ArrayList#remove(int)
      */
     public void test_removeI() {
         // Test for method java.lang.Object java.util.ArrayList.remove(int)
@@ -716,7 +716,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#set(int, java.lang.Object)
+     * java.util.ArrayList#set(int, java.lang.Object)
      */
     public void test_setILjava_lang_Object() {
         // Test for method java.lang.Object java.util.ArrayList.set(int,
@@ -767,7 +767,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#size()
+     * java.util.ArrayList#size()
      */
     public void test_size() {
         // Test for method int java.util.ArrayList.size()
@@ -778,7 +778,7 @@
     }
 
     /**
-     * @tests java.util.AbstractCollection#toString()
+     * java.util.AbstractCollection#toString()
      */
     public void test_toString() {
         ArrayList l = new ArrayList(1);
@@ -788,7 +788,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#toArray()
+     * java.util.ArrayList#toArray()
      */
     public void test_toArray() {
         // Test for method java.lang.Object [] java.util.ArrayList.toArray()
@@ -810,7 +810,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#toArray(java.lang.Object[])
+     * java.util.ArrayList#toArray(java.lang.Object[])
      */
     public void test_toArray$Ljava_lang_Object() {
         // Test for method java.lang.Object []
@@ -835,7 +835,7 @@
     }
 
     /**
-     * @tests java.util.ArrayList#trimToSize()
+     * java.util.ArrayList#trimToSize()
      */
     public void test_trimToSize() {
         // Test for method void java.util.ArrayList.trimToSize()
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArraysTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArraysTest.java
index 6642229..7e73bcf 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArraysTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ArraysTest.java
@@ -71,7 +71,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#asList(java.lang.Object[])
+	 * java.util.Arrays#asList(java.lang.Object[])
 	 */
 	public void test_asList$Ljava_lang_Object() {
 		// Test for method java.util.List
@@ -107,7 +107,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(byte[], byte)
+	 * java.util.Arrays#binarySearch(byte[], byte)
 	 */
 	public void test_binarySearch$BB() {
 		// Test for method int java.util.Arrays.binarySearch(byte [], byte)
@@ -128,7 +128,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(char[], char)
+	 * java.util.Arrays#binarySearch(char[], char)
 	 */
 	public void test_binarySearch$CC() {
 		// Test for method int java.util.Arrays.binarySearch(char [], char)
@@ -144,7 +144,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(double[], double)
+	 * java.util.Arrays#binarySearch(double[], double)
 	 */
 	public void test_binarySearch$DD() {
 		// Test for method int java.util.Arrays.binarySearch(double [], double)
@@ -178,7 +178,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(float[], float)
+	 * java.util.Arrays#binarySearch(float[], float)
 	 */
 	public void test_binarySearch$FF() {
 		// Test for method int java.util.Arrays.binarySearch(float [], float)
@@ -211,7 +211,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(int[], int)
+	 * java.util.Arrays#binarySearch(int[], int)
 	 */
 	public void test_binarySearch$II() {
 		// Test for method int java.util.Arrays.binarySearch(int [], int)
@@ -231,7 +231,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(long[], long)
+	 * java.util.Arrays#binarySearch(long[], long)
 	 */
 	public void test_binarySearch$JJ() {
 		// Test for method int java.util.Arrays.binarySearch(long [], long)
@@ -252,7 +252,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(java.lang.Object[],
+	 * java.util.Arrays#binarySearch(java.lang.Object[],
 	 *        java.lang.Object)
 	 */
 	public void test_binarySearch$Ljava_lang_ObjectLjava_lang_Object() {
@@ -288,7 +288,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(java.lang.Object[],
+	 * java.util.Arrays#binarySearch(java.lang.Object[],
 	 *        java.lang.Object, java.util.Comparator)
 	 */
 	public void test_binarySearch$Ljava_lang_ObjectLjava_lang_ObjectLjava_util_Comparator() {
@@ -310,7 +310,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#binarySearch(short[], short)
+	 * java.util.Arrays#binarySearch(short[], short)
 	 */
 	public void test_binarySearch$SS() {
 		// Test for method int java.util.Arrays.binarySearch(short [], short)
@@ -331,7 +331,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(byte[], byte)
+	 * java.util.Arrays#fill(byte[], byte)
 	 */
 	public void test_fill$BB() {
 		// Test for method void java.util.Arrays.fill(byte [], byte)
@@ -344,7 +344,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(byte[], int, int, byte)
+	 * java.util.Arrays#fill(byte[], int, int, byte)
 	 */
 	public void test_fill$BIIB() {
 		// Test for method void java.util.Arrays.fill(byte [], int, int, byte)
@@ -387,7 +387,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(short[], short)
+	 * java.util.Arrays#fill(short[], short)
 	 */
 	public void test_fill$SS() {
 		// Test for method void java.util.Arrays.fill(short [], short)
@@ -400,7 +400,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(short[], int, int, short)
+	 * java.util.Arrays#fill(short[], int, int, short)
 	 */
 	public void test_fill$SIIS() {
 		// Test for method void java.util.Arrays.fill(short [], int, int, short)
@@ -414,7 +414,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(char[], char)
+	 * java.util.Arrays#fill(char[], char)
 	 */
 	public void test_fill$CC() {
 		// Test for method void java.util.Arrays.fill(char [], char)
@@ -426,7 +426,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(char[], int, int, char)
+	 * java.util.Arrays#fill(char[], int, int, char)
 	 */
 	public void test_fill$CIIC() {
 		// Test for method void java.util.Arrays.fill(char [], int, int, char)
@@ -440,7 +440,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(int[], int)
+	 * java.util.Arrays#fill(int[], int)
 	 */
 	public void test_fill$II() {
 		// Test for method void java.util.Arrays.fill(int [], int)
@@ -453,7 +453,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(int[], int, int, int)
+	 * java.util.Arrays#fill(int[], int, int, int)
 	 */
 	public void test_fill$IIII() {
 		// Test for method void java.util.Arrays.fill(int [], int, int, int)
@@ -467,7 +467,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(long[], long)
+	 * java.util.Arrays#fill(long[], long)
 	 */
 	public void test_fill$JJ() {
 		// Test for method void java.util.Arrays.fill(long [], long)
@@ -480,7 +480,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(long[], int, int, long)
+	 * java.util.Arrays#fill(long[], int, int, long)
 	 */
 	public void test_fill$JIIJ() {
 		// Test for method void java.util.Arrays.fill(long [], int, int, long)
@@ -494,7 +494,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(float[], float)
+	 * java.util.Arrays#fill(float[], float)
 	 */
 	public void test_fill$FF() {
 		// Test for method void java.util.Arrays.fill(float [], float)
@@ -506,7 +506,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(float[], int, int, float)
+	 * java.util.Arrays#fill(float[], int, int, float)
 	 */
 	public void test_fill$FIIF() {
 		// Test for method void java.util.Arrays.fill(float [], int, int, float)
@@ -520,7 +520,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(double[], double)
+	 * java.util.Arrays#fill(double[], double)
 	 */
 	public void test_fill$DD() {
 		// Test for method void java.util.Arrays.fill(double [], double)
@@ -533,7 +533,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(double[], int, int, double)
+	 * java.util.Arrays#fill(double[], int, int, double)
 	 */
 	public void test_fill$DIID() {
 		// Test for method void java.util.Arrays.fill(double [], int, int,
@@ -548,7 +548,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(boolean[], boolean)
+	 * java.util.Arrays#fill(boolean[], boolean)
 	 */
 	public void test_fill$ZZ() {
 		// Test for method void java.util.Arrays.fill(boolean [], boolean)
@@ -560,7 +560,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(boolean[], int, int, boolean)
+	 * java.util.Arrays#fill(boolean[], int, int, boolean)
 	 */
 	public void test_fill$ZIIZ() {
 		// Test for method void java.util.Arrays.fill(boolean [], int, int,
@@ -575,7 +575,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(java.lang.Object[], java.lang.Object)
+	 * java.util.Arrays#fill(java.lang.Object[], java.lang.Object)
 	 */
 	public void test_fill$Ljava_lang_ObjectLjava_lang_Object() {
 		// Test for method void java.util.Arrays.fill(java.lang.Object [],
@@ -588,7 +588,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#fill(java.lang.Object[], int, int,
+	 * java.util.Arrays#fill(java.lang.Object[], int, int,
 	 *        java.lang.Object)
 	 */
 	public void test_fill$Ljava_lang_ObjectIILjava_lang_Object() {
@@ -609,7 +609,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(byte[], byte[])
+	 * java.util.Arrays#equals(byte[], byte[])
 	 */
 	public void test_equals$B$B() {
 		// Test for method boolean java.util.Arrays.equals(byte [], byte [])
@@ -623,7 +623,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(short[], short[])
+	 * java.util.Arrays#equals(short[], short[])
 	 */
 	public void test_equals$S$S() {
 		// Test for method boolean java.util.Arrays.equals(short [], short [])
@@ -637,7 +637,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(char[], char[])
+	 * java.util.Arrays#equals(char[], char[])
 	 */
 	public void test_equals$C$C() {
 		// Test for method boolean java.util.Arrays.equals(char [], char [])
@@ -652,7 +652,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(int[], int[])
+	 * java.util.Arrays#equals(int[], int[])
 	 */
 	public void test_equals$I$I() {
 		// Test for method boolean java.util.Arrays.equals(int [], int [])
@@ -671,7 +671,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(long[], long[])
+	 * java.util.Arrays#equals(long[], long[])
 	 */
 	public void test_equals$J$J() {
 		// Test for method boolean java.util.Arrays.equals(long [], long [])
@@ -689,7 +689,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(float[], float[])
+	 * java.util.Arrays#equals(float[], float[])
 	 */
 	public void test_equals$F$F() {
 		// Test for method boolean java.util.Arrays.equals(float [], float [])
@@ -708,7 +708,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(double[], double[])
+	 * java.util.Arrays#equals(double[], double[])
 	 */
 	public void test_equals$D$D() {
 		// Test for method boolean java.util.Arrays.equals(double [], double [])
@@ -730,7 +730,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(boolean[], boolean[])
+	 * java.util.Arrays#equals(boolean[], boolean[])
 	 */
 	public void test_equals$Z$Z() {
 		// Test for method boolean java.util.Arrays.equals(boolean [], boolean
@@ -745,7 +745,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#equals(java.lang.Object[], java.lang.Object[])
+	 * java.util.Arrays#equals(java.lang.Object[], java.lang.Object[])
 	 */
 	public void test_equals$Ljava_lang_Object$Ljava_lang_Object() {
 		// Test for method boolean java.util.Arrays.equals(java.lang.Object [],
@@ -763,7 +763,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(byte[])
+	 * java.util.Arrays#sort(byte[])
 	 */
 	public void test_sort$B() {
 		// Test for method void java.util.Arrays.sort(byte [])
@@ -777,7 +777,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(byte[], int, int)
+	 * java.util.Arrays#sort(byte[], int, int)
 	 */
 	public void test_sort$BII() {
 		// Test for method void java.util.Arrays.sort(byte [], int, int)
@@ -828,7 +828,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(char[])
+	 * java.util.Arrays#sort(char[])
 	 */
 	public void test_sort$C() {
 		// Test for method void java.util.Arrays.sort(char [])
@@ -843,7 +843,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(char[], int, int)
+	 * java.util.Arrays#sort(char[], int, int)
 	 */
 	public void test_sort$CII() {
 		// Test for method void java.util.Arrays.sort(char [], int, int)
@@ -894,7 +894,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(double[])
+	 * java.util.Arrays#sort(double[])
 	 */
 	public void test_sort$D() {
 		// Test for method void java.util.Arrays.sort(double [])
@@ -943,7 +943,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(double[], int, int)
+	 * java.util.Arrays#sort(double[], int, int)
 	 */
 	public void test_sort$DII() {
 		// Test for method void java.util.Arrays.sort(double [], int, int)
@@ -994,7 +994,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(float[])
+	 * java.util.Arrays#sort(float[])
 	 */
 	public void test_sort$F() {
 		// Test for method void java.util.Arrays.sort(float [])
@@ -1032,7 +1032,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(float[], int, int)
+	 * java.util.Arrays#sort(float[], int, int)
 	 */
 	public void test_sort$FII() {
 		// Test for method void java.util.Arrays.sort(float [], int, int)
@@ -1083,7 +1083,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(int[])
+	 * java.util.Arrays#sort(int[])
 	 */
 	public void test_sort$I() {
 		// Test for method void java.util.Arrays.sort(int [])
@@ -1097,7 +1097,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(int[], int, int)
+	 * java.util.Arrays#sort(int[], int, int)
 	 */
 	public void test_sort$III() {
 		// Test for method void java.util.Arrays.sort(int [], int, int)
@@ -1148,7 +1148,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(long[])
+	 * java.util.Arrays#sort(long[])
 	 */
 	public void test_sort$J() {
 		// Test for method void java.util.Arrays.sort(long [])
@@ -1163,7 +1163,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(long[], int, int)
+	 * java.util.Arrays#sort(long[], int, int)
 	 */
 	public void test_sort$JII() {
 		// Test for method void java.util.Arrays.sort(long [], int, int)
@@ -1214,7 +1214,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(java.lang.Object[])
+	 * java.util.Arrays#sort(java.lang.Object[])
 	 */
 	public void test_sort$Ljava_lang_Object() {
 		// Test for method void java.util.Arrays.sort(java.lang.Object [])
@@ -1228,7 +1228,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(java.lang.Object[], int, int)
+	 * java.util.Arrays#sort(java.lang.Object[], int, int)
 	 */
 	public void test_sort$Ljava_lang_ObjectII() {
 		// Test for method void java.util.Arrays.sort(java.lang.Object [], int,
@@ -1281,7 +1281,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(java.lang.Object[], int, int,
+	 * java.util.Arrays#sort(java.lang.Object[], int, int,
 	 *        java.util.Comparator)
 	 */
 	public void test_sort$Ljava_lang_ObjectIILjava_util_Comparator() {
@@ -1306,7 +1306,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(java.lang.Object[], java.util.Comparator)
+	 * java.util.Arrays#sort(java.lang.Object[], java.util.Comparator)
 	 */
 	public void test_sort$Ljava_lang_ObjectLjava_util_Comparator() {
 		// Test for method void java.util.Arrays.sort(java.lang.Object [],
@@ -1365,7 +1365,7 @@
     }
 
 	/**
-	 * @tests java.util.Arrays#sort(short[])
+	 * java.util.Arrays#sort(short[])
 	 */
 	public void test_sort$S() {
 		// Test for method void java.util.Arrays.sort(short [])
@@ -1379,7 +1379,7 @@
 	}
 
 	/**
-	 * @tests java.util.Arrays#sort(short[], int, int)
+	 * java.util.Arrays#sort(short[], int, int)
 	 */
 	public void test_sort$SII() {
 		// Test for method void java.util.Arrays.sort(short [], int, int)
@@ -1430,7 +1430,7 @@
 	}
 
     /**
-     * @tests java.util.Arrays#sort(byte[], int, int)
+     * java.util.Arrays#sort(byte[], int, int)
      */
     public void test_java_util_Arrays_sort_byte_array_NPE() {
         byte[] byte_array_null = null;
@@ -1450,7 +1450,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(char[], int, int)
+     * java.util.Arrays#sort(char[], int, int)
      */
     public void test_java_util_Arrays_sort_char_array_NPE() {
         char[] char_array_null = null;
@@ -1470,7 +1470,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(double[], int, int)
+     * java.util.Arrays#sort(double[], int, int)
      */
     public void test_java_util_Arrays_sort_double_array_NPE() {
         double[] double_array_null = null;
@@ -1490,7 +1490,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(float[], int, int)
+     * java.util.Arrays#sort(float[], int, int)
      */
     public void test_java_util_Arrays_sort_float_array_NPE() {
         float[] float_array_null = null;
@@ -1510,7 +1510,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(int[], int, int)
+     * java.util.Arrays#sort(int[], int, int)
      */
     public void test_java_util_Arrays_sort_int_array_NPE() {
         int[] int_array_null = null;
@@ -1530,7 +1530,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(Object[], int, int)
+     * java.util.Arrays#sort(Object[], int, int)
      */
     public void test_java_util_Arrays_sort_object_array_NPE() {
         Object[] object_array_null = null;
@@ -1557,7 +1557,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(long[], int, int)
+     * java.util.Arrays#sort(long[], int, int)
      */
     public void test_java_util_Arrays_sort_long_array_NPE() {
         long[] long_array_null = null;
@@ -1577,7 +1577,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(short[], int, int)
+     * java.util.Arrays#sort(short[], int, int)
      */
     public void test_java_util_Arrays_sort_short_array_NPE() {
         short[] short_array_null = null;
@@ -1597,7 +1597,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#deepEquals(Object[], Object[])
+     * java.util.Arrays#deepEquals(Object[], Object[])
      */
     public void test_deepEquals$Ljava_lang_ObjectLjava_lang_Object() {
        int [] a1 = {1, 2, 3};
@@ -1621,7 +1621,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#deepHashCode(Object[])
+     * java.util.Arrays#deepHashCode(Object[])
      */
     public void test_deepHashCode$Ljava_lang_Object() {
         int [] a1 = {1, 2, 3};
@@ -1642,7 +1642,7 @@
      }
 
     /**
-     * @tests java.util.Arrays#hashCode(boolean[] a)
+     * java.util.Arrays#hashCode(boolean[] a)
      */
     public void test_hashCode$LZ() {
         int listHashCode;
@@ -1659,7 +1659,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(int[] a)
+     * java.util.Arrays#hashCode(int[] a)
      */
     public void test_hashCode$LI() {
         int listHashCode;
@@ -1680,7 +1680,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(char[] a)
+     * java.util.Arrays#hashCode(char[] a)
      */
     public void test_hashCode$LC() {
         int listHashCode;
@@ -1697,7 +1697,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(byte[] a)
+     * java.util.Arrays#hashCode(byte[] a)
      */
     public void test_hashCode$LB() {
         int listHashCode;
@@ -1714,7 +1714,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(long[] a)
+     * java.util.Arrays#hashCode(long[] a)
      */
     public void test_hashCode$LJ() {
         int listHashCode;
@@ -1732,7 +1732,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(float[] a)
+     * java.util.Arrays#hashCode(float[] a)
      */
     public void test_hashCode$LF() {
         int listHashCode;
@@ -1752,7 +1752,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(double[] a)
+     * java.util.Arrays#hashCode(double[] a)
      */
     public void test_hashCode$LD() {
         int listHashCode;
@@ -1769,7 +1769,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(short[] a)
+     * java.util.Arrays#hashCode(short[] a)
      */
     public void test_hashCode$LS() {
         int listHashCode;
@@ -1786,7 +1786,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(Object[] a)
+     * java.util.Arrays#hashCode(Object[] a)
      */
     public void test_hashCode$Ljava_lang_Object() {
         int listHashCode;
@@ -1834,7 +1834,7 @@
 	}
 	
     /**
-     * @tests java.util.Arrays#binarySearch(byte[],int,int, byte)
+     * java.util.Arrays#binarySearch(byte[],int,int, byte)
      */
     public void test_binarySearch$BIIB() {
         for (byte counter = 0; counter < arraySize; counter++) {
@@ -1910,7 +1910,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(char[], char)
+     * java.util.Arrays#binarySearch(char[], char)
      */
     public void test_binarySearch$CIIC() {
         for (char counter = 0; counter < arraySize; counter++) {
@@ -1977,7 +1977,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(double[], double)
+     * java.util.Arrays#binarySearch(double[], double)
      */
     public void test_binarySearch$DIID() {
         for (int counter = 0; counter < arraySize; counter++) {
@@ -2062,7 +2062,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(float[], float)
+     * java.util.Arrays#binarySearch(float[], float)
      */
     public void test_binarySearch$FIIF() {
         for (int counter = 0; counter < arraySize; counter++) {
@@ -2152,7 +2152,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(int[], int)
+     * java.util.Arrays#binarySearch(int[], int)
      */
     public void test_binarySearch$IIII() {
         for (int counter = 0; counter < arraySize; counter++) {
@@ -2227,7 +2227,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(long[], long)
+     * java.util.Arrays#binarySearch(long[], long)
      */
     public void test_binarySearch$JIIJ() {
         for (long counter = 0; counter < arraySize; counter++){
@@ -2301,7 +2301,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(java.lang.Object[],
+     * java.util.Arrays#binarySearch(java.lang.Object[],
      *        java.lang.Object)
      */
     public void test_binarySearch$Ljava_lang_ObjectIILjava_lang_Object() {
@@ -2375,7 +2375,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(java.lang.Object[],
+     * java.util.Arrays#binarySearch(java.lang.Object[],
      *        java.lang.Object, java.util.Comparator)
      */
     public void test_binarySearch$Ljava_lang_ObjectIILjava_lang_ObjectLjava_util_Comparator() {
@@ -2458,7 +2458,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(short[], short)
+     * java.util.Arrays#binarySearch(short[], short)
      */
     public void test_binarySearch$SIIS() {
         for (short counter = 0; counter < arraySize; counter++){
@@ -2534,7 +2534,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(byte[],int)
+     * {@link java.util.Arrays#copyOf(byte[],int)
      */
     public void test_copyOf_$BI() throws Exception {
         byte[] result = Arrays.copyOf(byteArray, arraySize*2);
@@ -2571,7 +2571,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(short[],int)
+     * {@link java.util.Arrays#copyOf(short[],int)
      */
     public void test_copyOf_$SI() throws Exception {
         short[] result = Arrays.copyOf(shortArray, arraySize*2);
@@ -2608,7 +2608,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(int[],int)
+     * {@link java.util.Arrays#copyOf(int[],int)
      */
     public void test_copyOf_$II() throws Exception {
         int[] result = Arrays.copyOf(intArray, arraySize*2);
@@ -2645,7 +2645,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(boolean[],int)
+     * {@link java.util.Arrays#copyOf(boolean[],int)
      */
     public void test_copyOf_$ZI() throws Exception {
         boolean[] result = Arrays.copyOf(booleanArray, arraySize*2);
@@ -2682,7 +2682,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(char[],int)
+     * {@link java.util.Arrays#copyOf(char[],int)
      */
     public void test_copyOf_$CI() throws Exception {
         char[] result = Arrays.copyOf(charArray, arraySize*2);
@@ -2719,7 +2719,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(float[],int)
+     * {@link java.util.Arrays#copyOf(float[],int)
      */
     public void test_copyOf_$FI() throws Exception {
         float[] result = Arrays.copyOf(floatArray, arraySize*2);
@@ -2756,7 +2756,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(double[],int)
+     * {@link java.util.Arrays#copyOf(double[],int)
      */
     public void test_copyOf_$DI() throws Exception {
         double[] result = Arrays.copyOf(doubleArray, arraySize*2);
@@ -2793,7 +2793,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(long[],int)
+     * {@link java.util.Arrays#copyOf(long[],int)
      */
     public void test_copyOf_$JI() throws Exception {
         long[] result = Arrays.copyOf(longArray, arraySize*2);
@@ -2830,7 +2830,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(T[],int)
+     * {@link java.util.Arrays#copyOf(T[],int)
      */
     public void test_copyOf_$TI() throws Exception {
         Object[] result = Arrays.copyOf(objArray, arraySize*2);
@@ -2876,7 +2876,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOf(T[],int,Class<? extends Object[]>))
+     * {@link java.util.Arrays#copyOf(T[],int,Class<? extends Object[]>))
      */
     public void test_copyOf_$TILClass() throws Exception {
         Object[] result = Arrays.copyOf(objArray, arraySize*2,Object[].class);
@@ -2943,7 +2943,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(byte[],int,int)
+     * {@link java.util.Arrays#copyOfRange(byte[],int,int)
      */
     public void test_copyOfRange_$BII() throws Exception {
         byte[] result = Arrays.copyOfRange(byteArray, 0,arraySize*2);
@@ -2996,7 +2996,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(short[],int,int)
+     * {@link java.util.Arrays#copyOfRange(short[],int,int)
      */
     public void test_copyOfRange_$SII() throws Exception {
         short[] result = Arrays.copyOfRange(shortArray, 0,arraySize*2);
@@ -3049,7 +3049,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(int[],int,int)
+     * {@link java.util.Arrays#copyOfRange(int[],int,int)
      */
     public void test_copyOfRange_$III() throws Exception {
         int[] result = Arrays.copyOfRange(intArray, 0,arraySize*2);
@@ -3102,7 +3102,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(long[],int,int)
+     * {@link java.util.Arrays#copyOfRange(long[],int,int)
      */
     public void test_copyOfRange_$JII() throws Exception {
         long[] result = Arrays.copyOfRange(longArray, 0,arraySize*2);
@@ -3155,7 +3155,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(char[],int,int)
+     * {@link java.util.Arrays#copyOfRange(char[],int,int)
      */
     public void test_copyOfRange_$CII() throws Exception {
         char[] result = Arrays.copyOfRange(charArray, 0,arraySize*2);
@@ -3208,7 +3208,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(float[],int,int)
+     * {@link java.util.Arrays#copyOfRange(float[],int,int)
      */
     public void test_copyOfRange_$FII() throws Exception {
         float[] result = Arrays.copyOfRange(floatArray, 0,arraySize*2);
@@ -3261,7 +3261,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(double[],int,int)
+     * {@link java.util.Arrays#copyOfRange(double[],int,int)
      */
     public void test_copyOfRange_$DII() throws Exception {
         double[] result = Arrays.copyOfRange(doubleArray, 0,arraySize*2);
@@ -3314,7 +3314,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(boolean[],int,int)
+     * {@link java.util.Arrays#copyOfRange(boolean[],int,int)
      */
     public void test_copyOfRange_$ZII() throws Exception {
         boolean[] result = Arrays.copyOfRange(booleanArray, 0,arraySize*2);
@@ -3367,7 +3367,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(Object[],int,int)
+     * {@link java.util.Arrays#copyOfRange(Object[],int,int)
      */
     public void test_copyOfRange_$TII() throws Exception {
         Object[] result = Arrays.copyOfRange(objArray, 0,arraySize*2);
@@ -3420,7 +3420,7 @@
     }
 
     /**
-     * @tests {@link java.util.Arrays#copyOfRange(Object[], int, int, Class)
+     * {@link java.util.Arrays#copyOfRange(Object[], int, int, Class)
      */
     public void test_copyOfRange_$TIILClass() throws Exception {
         Object[] result = Arrays.copyOfRange(objArray, 0,arraySize*2,Integer[].class);
@@ -3498,7 +3498,7 @@
     }
 
     /**
-     * @tests java.util.Arrays#swap(int, int, Object[])
+     * java.util.Arrays#swap(int, int, Object[])
      */
     /* BEGIN android-removed: tests private implementation detail we don't share.
     public void test_swap_I_I_$Ljava_lang_Object() throws Exception {
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/BitSetTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/BitSetTest.java
deleted file mode 100644
index f8be96d..0000000
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/BitSetTest.java
+++ /dev/null
@@ -1,1402 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-
-package org.apache.harmony.luni.tests.java.util;
-
-import java.util.BitSet;
-
-import junit.framework.TestCase;
-
-public class BitSetTest extends TestCase {
-
-    BitSet eightbs;
-
-    /**
-     * @tests java.util.BitSet#BitSet()
-     */
-    public void test_Constructor() {
-        BitSet bs = new BitSet();
-        assertEquals("Create BitSet of incorrect size", 64, bs.size());
-        assertEquals("New BitSet had invalid string representation", "{}",
-                     bs.toString());
-    }
-
-    /**
-     * @tests java.util.BitSet#BitSet(int)
-     */
-    public void test_ConstructorI() {
-        BitSet bs = new BitSet(128);
-        assertEquals("Create BitSet of incorrect size", 128, bs.size());
-        assertEquals("New BitSet had invalid string representation: "
-                + bs.toString(), "{}", bs.toString());
-        // All BitSets are created with elements of multiples of 64
-        bs = new BitSet(89);
-        assertEquals("Failed to round BitSet element size", 128, bs.size());
-
-        try {
-            bs = new BitSet(-9);
-            fail("Failed to throw exception when creating a new BitSet with negative element value");
-        } catch (NegativeArraySizeException e) {
-            // Correct behaviour
-        }
-    }
-
-    /**
-     * tests java.util.BitSet#clone()
-     */
-    public void test_clone() {
-        BitSet bs;
-        bs = (BitSet) eightbs.clone();
-        assertEquals("clone failed to return equal BitSet", bs, eightbs);
-    }
-
-    /**
-     * @tests java.util.BitSet#equals(java.lang.Object)
-     */
-    public void test_equalsLjava_lang_Object() {
-        BitSet bs;
-        bs = (BitSet) eightbs.clone();
-        assertEquals("Same BitSet returned false", eightbs, eightbs);
-        assertEquals("Identical BitSet returned false", bs, eightbs);
-        bs.clear(6);
-        assertFalse("Different BitSets returned true", eightbs.equals(bs));
-
-        bs = (BitSet) eightbs.clone();
-        bs.set(128);
-        assertFalse("Different sized BitSet with higher bit set returned true",
-                eightbs.equals(bs));
-        bs.clear(128);
-        assertTrue(
-                "Different sized BitSet with higher bits not set returned false",
-                eightbs.equals(bs));
-    }
-
-    /**
-     * @tests java.util.BitSet#hashCode()
-     */
-    public void test_hashCode() {
-        // Test for method int java.util.BitSet.hashCode()
-        BitSet bs = (BitSet) eightbs.clone();
-        bs.clear(2);
-        bs.clear(6);
-        assertEquals("BitSet returns wrong hash value", 1129, bs.hashCode());
-        bs.set(10);
-        bs.clear(3);
-        assertEquals("BitSet returns wrong hash value", 97, bs.hashCode());
-    }
-
-    /**
-     * @tests java.util.BitSet#clear()
-     */
-    public void test_clear() {
-        eightbs.clear();
-        for (int i = 0; i < 8; i++) {
-            assertFalse("Clear didn't clear bit " + i, eightbs.get(i));
-        }
-        assertEquals("Test1: Wrong length", 0, eightbs.length());
-
-        BitSet bs = new BitSet(3400);
-        bs.set(0, bs.size() - 1); // ensure all bits are 1's
-        bs.set(bs.size() - 1);
-        bs.clear();
-        assertEquals("Test2: Wrong length", 0, bs.length());
-        assertTrue("Test2: isEmpty() returned incorrect value", bs.isEmpty());
-        assertEquals("Test2: cardinality() returned incorrect value", 0, bs
-                .cardinality());
-    }
-
-    /**
-     * @tests java.util.BitSet#clear(int)
-     */
-    public void test_clearI() {
-        // Test for method void java.util.BitSet.clear(int)
-
-        eightbs.clear(7);
-        assertFalse("Failed to clear bit", eightbs.get(7));
-
-        // Check to see all other bits are still set
-        for (int i = 0; i < 7; i++)
-            assertTrue("Clear cleared incorrect bits", eightbs.get(i));
-
-        eightbs.clear(165);
-        assertFalse("Failed to clear bit", eightbs.get(165));
-        // Try out of range
-        try {
-            eightbs.clear(-1);
-            fail("Failed to throw out of bounds exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
-        }
-
-        BitSet bs = new BitSet(0);
-        assertEquals("Test1: Wrong length,", 0, bs.length());
-        assertEquals("Test1: Wrong size,", 0, bs.size());
-
-        bs.clear(0);
-        assertEquals("Test2: Wrong length,", 0, bs.length());
-        assertEquals("Test2: Wrong size,", 0, bs.size());
-
-        bs.clear(60);
-        assertEquals("Test3: Wrong length,", 0, bs.length());
-        assertEquals("Test3: Wrong size,", 0, bs.size());
-
-        bs.clear(120);
-        assertEquals("Test4: Wrong size,", 0, bs.size());
-        assertEquals("Test4: Wrong length,", 0, bs.length());
-
-        bs.set(25);
-        assertEquals("Test5: Wrong size,", 64, bs.size());
-        assertEquals("Test5: Wrong length,", 26, bs.length());
-
-        bs.clear(80);
-        assertEquals("Test6: Wrong size,", 64, bs.size());
-        assertEquals("Test6: Wrong length,", 26, bs.length());
-
-        bs.clear(25);
-        assertEquals("Test7: Wrong size,", 64, bs.size());
-        assertEquals("Test7: Wrong length,", 0, bs.length());
-    }
-
-    /**
-     * @tests java.util.BitSet#clear(int, int)
-     */
-    public void test_clearII() throws IndexOutOfBoundsException {
-        // Regression for HARMONY-98
-        BitSet bitset = new BitSet();
-        for (int i = 0; i < 20; i++) {
-            bitset.set(i);
-        }
-        bitset.clear(10, 10);
-
-        // Test for method void java.util.BitSet.clear(int, int)
-        // pos1 and pos2 are in the same bitset element
-        BitSet bs = new BitSet(16);
-        int initialSize = bs.size();
-        bs.set(0, initialSize);
-        bs.clear(5);
-        bs.clear(15);
-        bs.clear(7, 11);
-        for (int i = 0; i < 7; i++) {
-            if (i == 5)
-                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        }
-        for (int i = 7; i < 11; i++)
-            assertFalse("Failed to clear bit " + i, bs.get(i));
-
-        for (int i = 11; i < initialSize; i++) {
-            if (i == 15)
-                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        }
-
-        for (int i = initialSize; i < bs.size(); i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-
-        // pos1 and pos2 is in the same bitset element, boundry testing
-        bs = new BitSet(16);
-        initialSize = bs.size();
-        bs.set(0, initialSize);
-        bs.clear(7, 64);
-        assertEquals("Failed to grow BitSet", 64, bs.size());
-        for (int i = 0; i < 7; i++)
-            assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        for (int i = 7; i < 64; i++)
-            assertFalse("Failed to clear bit " + i, bs.get(i));
-        for (int i = 64; i < bs.size(); i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-        }
-        // more boundary testing
-        bs = new BitSet(32);
-        initialSize = bs.size();
-        bs.set(0, initialSize);
-        bs.clear(0, 64);
-        for (int i = 0; i < 64; i++)
-            assertFalse("Failed to clear bit " + i, bs.get(i));
-        for (int i = 64; i < bs.size(); i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-
-        bs = new BitSet(32);
-        initialSize = bs.size();
-        bs.set(0, initialSize);
-        bs.clear(0, 65);
-        for (int i = 0; i < 65; i++)
-            assertFalse("Failed to clear bit " + i, bs.get(i));
-        for (int i = 65; i < bs.size(); i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-
-        // pos1 and pos2 are in two sequential bitset elements
-        bs = new BitSet(128);
-        initialSize = bs.size();
-        bs.set(0, initialSize);
-        bs.clear(7);
-        bs.clear(110);
-        bs.clear(9, 74);
-        for (int i = 0; i < 9; i++) {
-            if (i == 7)
-                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        }
-        for (int i = 9; i < 74; i++)
-            assertFalse("Failed to clear bit " + i, bs.get(i));
-        for (int i = 74; i < initialSize; i++) {
-            if (i == 110)
-                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        }
-        for (int i = initialSize; i < bs.size(); i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-
-        // pos1 and pos2 are in two non-sequential bitset elements
-        bs = new BitSet(256);
-        bs.set(0, 256);
-        bs.clear(7);
-        bs.clear(255);
-        bs.clear(9, 219);
-        for (int i = 0; i < 9; i++) {
-            if (i == 7)
-                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        }
-
-        for (int i = 9; i < 219; i++)
-            assertFalse("failed to clear bit " + i, bs.get(i));
-
-        for (int i = 219; i < 255; i++)
-            assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-
-        for (int i = 255; i < bs.size(); i++)
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-
-        // test illegal args
-        bs = new BitSet(10);
-        try {
-            bs.clear(-1, 3);
-            fail("Test1: Attempt to flip with  negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // excepted
-        }
-
-        try {
-            bs.clear(2, -1);
-            fail("Test2: Attempt to flip with negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // excepted
-        }
-
-        bs.set(2, 4);
-        bs.clear(2, 2);
-        assertTrue("Bit got cleared incorrectly ", bs.get(2));
-
-        try {
-            bs.clear(4, 2);
-            fail("Test4: Attempt to flip with illegal args failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // excepted
-        }
-
-        bs = new BitSet(0);
-        assertEquals("Test1: Wrong length,", 0, bs.length());
-        assertEquals("Test1: Wrong size,", 0, bs.size());
-
-        bs.clear(0, 2);
-        assertEquals("Test2: Wrong length,", 0, bs.length());
-        assertEquals("Test2: Wrong size,", 0, bs.size());
-
-        bs.clear(60, 64);
-        assertEquals("Test3: Wrong length,", 0, bs.length());
-        assertEquals("Test3: Wrong size,", 0, bs.size());
-
-        bs.clear(64, 120);
-        assertEquals("Test4: Wrong length,", 0, bs.length());
-        assertEquals("Test4: Wrong size,", 0, bs.size());
-
-        bs.set(25);
-        assertEquals("Test5: Wrong length,", 26, bs.length());
-        assertEquals("Test5: Wrong size,", 64, bs.size());
-
-        bs.clear(60, 64);
-        assertEquals("Test6: Wrong length,", 26, bs.length());
-        assertEquals("Test6: Wrong size,", 64, bs.size());
-
-        bs.clear(64, 120);
-        assertEquals("Test7: Wrong size,", 64, bs.size());
-        assertEquals("Test7: Wrong length,", 26, bs.length());
-
-        bs.clear(80);
-        assertEquals("Test8: Wrong size,", 64, bs.size());
-        assertEquals("Test8: Wrong length,", 26, bs.length());
-
-        bs.clear(25);
-        assertEquals("Test9: Wrong size,", 64, bs.size());
-        assertEquals("Test9: Wrong length,", 0, bs.length());
-    }
-
-    /**
-     * @tests java.util.BitSet#get(int)
-     */
-    public void test_getI() {
-        // Test for method boolean java.util.BitSet.get(int)
-
-        BitSet bs = new BitSet();
-        bs.set(8);
-        assertFalse("Get returned true for index out of range", eightbs.get(99));
-        assertTrue("Get returned false for set value", eightbs.get(3));
-        assertFalse("Get returned true for a non set value", bs.get(0));
-
-        try {
-            bs.get(-1);
-            fail("Attempt to get at negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
-        }
-
-        bs = new BitSet(1);
-        assertFalse("Access greater than size", bs.get(64));
-
-        bs = new BitSet();
-        bs.set(63);
-        assertTrue("Test highest bit", bs.get(63));
-
-        bs = new BitSet(0);
-        assertEquals("Test1: Wrong length,", 0, bs.length());
-        assertEquals("Test1: Wrong size,", 0, bs.size());
-
-        bs.get(2);
-        assertEquals("Test2: Wrong length,", 0, bs.length());
-        assertEquals("Test2: Wrong size,", 0, bs.size());
-
-        bs.get(70);
-        assertEquals("Test3: Wrong length,", 0, bs.length());
-        assertEquals("Test3: Wrong size,", 0, bs.size());
-
-    }
-
-    /**
-     * @tests java.util.BitSet#get(int, int)
-     */
-    public void test_getII() {
-        BitSet bitset = new BitSet(30);
-        bitset.get(3, 3);
-
-        // Test for method boolean java.util.BitSet.get(int, int)
-        BitSet bs, resultbs, correctbs;
-        bs = new BitSet(512);
-        bs.set(3, 9);
-        bs.set(10, 20);
-        bs.set(60, 75);
-        bs.set(121);
-        bs.set(130, 140);
-
-        // pos1 and pos2 are in the same bitset element, at index0
-        resultbs = bs.get(3, 6);
-        correctbs = new BitSet(3);
-        correctbs.set(0, 3);
-        assertEquals("Test1: Returned incorrect BitSet", correctbs, resultbs);
-
-        // pos1 and pos2 are in the same bitset element, at index 1
-        resultbs = bs.get(100, 125);
-        correctbs = new BitSet(25);
-        correctbs.set(21);
-        assertEquals("Test2: Returned incorrect BitSet", correctbs, resultbs);
-
-        // pos1 in bitset element at index 0, and pos2 in bitset element at
-        // index 1
-        resultbs = bs.get(15, 125);
-        correctbs = new BitSet(25);
-        correctbs.set(0, 5);
-        correctbs.set(45, 60);
-        correctbs.set(121 - 15);
-        assertEquals("Test3: Returned incorrect BitSet", correctbs, resultbs);
-
-        // pos1 in bitset element at index 1, and pos2 in bitset element at
-        // index 2
-        resultbs = bs.get(70, 145);
-        correctbs = new BitSet(75);
-        correctbs.set(0, 5);
-        correctbs.set(51);
-        correctbs.set(60, 70);
-        assertEquals("Test4: Returned incorrect BitSet", correctbs, resultbs);
-
-        // pos1 in bitset element at index 0, and pos2 in bitset element at
-        // index 2
-        resultbs = bs.get(5, 145);
-        correctbs = new BitSet(140);
-        correctbs.set(0, 4);
-        correctbs.set(5, 15);
-        correctbs.set(55, 70);
-        correctbs.set(116);
-        correctbs.set(125, 135);
-        assertEquals("Test5: Returned incorrect BitSet", correctbs, resultbs);
-
-        // pos1 in bitset element at index 0, and pos2 in bitset element at
-        // index 3
-        resultbs = bs.get(5, 250);
-        correctbs = new BitSet(200);
-        correctbs.set(0, 4);
-        correctbs.set(5, 15);
-        correctbs.set(55, 70);
-        correctbs.set(116);
-        correctbs.set(125, 135);
-        assertEquals("Test6: Returned incorrect BitSet", correctbs, resultbs);
-
-        assertEquals("equality principle 1 ", bs.get(0, bs.size()), bs);
-
-        // more tests
-        BitSet bs2 = new BitSet(129);
-        bs2.set(0, 20);
-        bs2.set(62, 65);
-        bs2.set(121, 123);
-        resultbs = bs2.get(1, 124);
-        correctbs = new BitSet(129);
-        correctbs.set(0, 19);
-        correctbs.set(61, 64);
-        correctbs.set(120, 122);
-        assertEquals("Test7: Returned incorrect BitSet", correctbs, resultbs);
-
-        // equality principle with some boundary conditions
-        bs2 = new BitSet(128);
-        bs2.set(2, 20);
-        bs2.set(62);
-        bs2.set(121, 123);
-        bs2.set(127);
-        resultbs = bs2.get(0, bs2.size());
-        assertEquals("equality principle 2 ", resultbs, bs2);
-
-        bs2 = new BitSet(128);
-        bs2.set(2, 20);
-        bs2.set(62);
-        bs2.set(121, 123);
-        bs2.set(127);
-        bs2.flip(0, 128);
-        resultbs = bs2.get(0, bs.size());
-        assertEquals("equality principle 3 ", resultbs, bs2);
-
-        bs = new BitSet(0);
-        assertEquals("Test1: Wrong length,", 0, bs.length());
-        assertEquals("Test1: Wrong size,", 0, bs.size());
-
-        bs.get(0, 2);
-        assertEquals("Test2: Wrong length,", 0, bs.length());
-        assertEquals("Test2: Wrong size,", 0, bs.size());
-
-        bs.get(60, 64);
-        assertEquals("Test3: Wrong length,", 0, bs.length());
-        assertEquals("Test3: Wrong size,", 0, bs.size());
-
-        bs.get(64, 120);
-        assertEquals("Test4: Wrong length,", 0, bs.length());
-        assertEquals("Test4: Wrong size,", 0, bs.size());
-
-        bs.set(25);
-        assertEquals("Test5: Wrong length,", 26, bs.length());
-        assertEquals("Test5: Wrong size,", 64, bs.size());
-
-        bs.get(60, 64);
-        assertEquals("Test6: Wrong length,", 26, bs.length());
-        assertEquals("Test6: Wrong size,", 64, bs.size());
-
-        bs.get(64, 120);
-        assertEquals("Test7: Wrong size,", 64, bs.size());
-        assertEquals("Test7: Wrong length,", 26, bs.length());
-
-        bs.get(80);
-        assertEquals("Test8: Wrong size,", 64, bs.size());
-        assertEquals("Test8: Wrong length,", 26, bs.length());
-
-        bs.get(25);
-        assertEquals("Test9: Wrong size,", 64, bs.size());
-        assertEquals("Test9: Wrong length,", 26, bs.length());
-
-    }
-
-    /**
-     * @tests java.util.BitSet#flip(int)
-     */
-    public void test_flipI() {
-        // Test for method void java.util.BitSet.flip(int)
-        BitSet bs = new BitSet();
-        bs.clear(8);
-        bs.clear(9);
-        bs.set(10);
-        bs.flip(9);
-        assertFalse("Failed to flip bit", bs.get(8));
-        assertTrue("Failed to flip bit", bs.get(9));
-        assertTrue("Failed to flip bit", bs.get(10));
-
-        bs.set(8);
-        bs.set(9);
-        bs.clear(10);
-        bs.flip(9);
-        assertTrue("Failed to flip bit", bs.get(8));
-        assertFalse("Failed to flip bit", bs.get(9));
-        assertFalse("Failed to flip bit", bs.get(10));
-
-        try {
-            bs.flip(-1);
-            fail("Attempt to flip at negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
-        }
-
-        // Try setting a bit on a 64 boundary
-        bs.flip(128);
-        assertEquals("Failed to grow BitSet", 192, bs.size());
-        assertTrue("Failed to flip bit", bs.get(128));
-
-        bs = new BitSet(64);
-        for (int i = bs.size(); --i >= 0;) {
-            bs.flip(i);
-            assertTrue("Test1: Incorrectly flipped bit" + i, bs.get(i));
-            assertEquals("Incorrect length", i+1, bs.length());
-            for (int j = bs.size(); --j > i;) {
-                assertTrue("Test2: Incorrectly flipped bit" + j, !bs.get(j));
-            }
-            for (int j = i; --j >= 0;) {
-                assertTrue("Test3: Incorrectly flipped bit" + j, !bs.get(j));
-            }
-            bs.flip(i);
-        }
-
-        BitSet bs0 = new BitSet(0);
-        assertEquals("Test1: Wrong size", 0, bs0.size());
-        assertEquals("Test1: Wrong length", 0, bs0.length());
-
-        bs0.flip(0);
-        assertEquals("Test2: Wrong size", 64, bs0.size());
-        assertEquals("Test2: Wrong length", 1, bs0.length());
-
-        bs0.flip(63);
-        assertEquals("Test3: Wrong size", 64, bs0.size());
-        assertEquals("Test3: Wrong length", 64, bs0.length());
-
-        eightbs.flip(7);
-        assertTrue("Failed to flip bit 7", !eightbs.get(7));
-
-        // Check to see all other bits are still set
-        for (int i = 0; i < 7; i++)
-            assertTrue("Flip flipped incorrect bits", eightbs.get(i));
-
-        eightbs.flip(127);
-        assertTrue("Failed to flip bit 127", eightbs.get(127));
-
-        eightbs.flip(127);
-        assertTrue("Failed to flip bit 127", !eightbs.get(127));
-    }
-
-    /**
-     * @tests java.util.BitSet#clear(int, int)
-     */
-    public void test_flipII() {
-        BitSet bitset = new BitSet();
-        for (int i = 0; i < 20; i++) {
-            bitset.set(i);
-        }
-        bitset.flip(10, 10);
-
-        // Test for method void java.util.BitSet.flip(int, int)
-        // pos1 and pos2 are in the same bitset element
-        BitSet bs = new BitSet(16);
-        bs.set(7);
-        bs.set(10);
-        bs.flip(7, 11);
-        for (int i = 0; i < 7; i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-        }
-        assertFalse("Failed to flip bit 7", bs.get(7));
-        assertTrue("Failed to flip bit 8", bs.get(8));
-        assertTrue("Failed to flip bit 9", bs.get(9));
-        assertFalse("Failed to flip bit 10", bs.get(10));
-        for (int i = 11; i < bs.size(); i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-        }
-
-        // pos1 and pos2 is in the same bitset element, boundry testing
-        bs = new BitSet(16);
-        bs.set(7);
-        bs.set(10);
-        bs.flip(7, 64);
-        assertEquals("Failed to grow BitSet", 64, bs.size());
-        for (int i = 0; i < 7; i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-        }
-        assertFalse("Failed to flip bit 7", bs.get(7));
-        assertTrue("Failed to flip bit 8", bs.get(8));
-        assertTrue("Failed to flip bit 9", bs.get(9));
-        assertFalse("Failed to flip bit 10", bs.get(10));
-        for (int i = 11; i < 64; i++) {
-            assertTrue("failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Shouldn't have flipped bit 64", bs.get(64));
-
-        // more boundary testing
-        bs = new BitSet(32);
-        bs.flip(0, 64);
-        for (int i = 0; i < 64; i++) {
-            assertTrue("Failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Shouldn't have flipped bit 64", bs.get(64));
-
-        bs = new BitSet(32);
-        bs.flip(0, 65);
-        for (int i = 0; i < 65; i++) {
-            assertTrue("Failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Shouldn't have flipped bit 65", bs.get(65));
-
-        // pos1 and pos2 are in two sequential bitset elements
-        bs = new BitSet(128);
-        bs.set(7);
-        bs.set(10);
-        bs.set(72);
-        bs.set(110);
-        bs.flip(9, 74);
-        for (int i = 0; i < 7; i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-        assertTrue("Shouldn't have flipped bit 7", bs.get(7));
-        assertFalse("Shouldn't have flipped bit 8", bs.get(8));
-        assertTrue("Failed to flip bit 9", bs.get(9));
-        assertFalse("Failed to flip bit 10", bs.get(10));
-        for (int i = 11; i < 72; i++) {
-            assertTrue("failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Failed to flip bit 72", bs.get(72));
-        assertTrue("Failed to flip bit 73", bs.get(73));
-        for (int i = 74; i < 110; i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-        assertTrue("Shouldn't have flipped bit 110", bs.get(110));
-        for (int i = 111; i < bs.size(); i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-
-        // pos1 and pos2 are in two non-sequential bitset elements
-        bs = new BitSet(256);
-        bs.set(7);
-        bs.set(10);
-        bs.set(72);
-        bs.set(110);
-        bs.set(181);
-        bs.set(220);
-        bs.flip(9, 219);
-        for (int i = 0; i < 7; i++) {
-            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
-        }
-        assertTrue("Shouldn't have flipped bit 7", bs.get(7));
-        assertFalse("Shouldn't have flipped bit 8", bs.get(8));
-        assertTrue("Failed to flip bit 9", bs.get(9));
-        assertFalse("Failed to flip bit 10", bs.get(10));
-        for (int i = 11; i < 72; i++) {
-            assertTrue("failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Failed to flip bit 72", bs.get(72));
-        for (int i = 73; i < 110; i++) {
-            assertTrue("failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Failed to flip bit 110", bs.get(110));
-        for (int i = 111; i < 181; i++) {
-            assertTrue("failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Failed to flip bit 181", bs.get(181));
-        for (int i = 182; i < 219; i++) {
-            assertTrue("failed to flip bit " + i, bs.get(i));
-        }
-        assertFalse("Shouldn't have flipped bit 219", bs.get(219));
-        assertTrue("Shouldn't have flipped bit 220", bs.get(220));
-        for (int i = 221; i < bs.size(); i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-        }
-
-        // test illegal args
-        bs = new BitSet(10);
-        try {
-            bs.flip(-1, 3);
-            fail("Test1: Attempt to flip with  negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // correct behavior
-        }
-
-        try {
-            bs.flip(2, -1);
-            fail("Test2: Attempt to flip with negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // correct behavior
-        }
-
-        try {
-            bs.flip(4, 2);
-            fail("Test4: Attempt to flip with illegal args failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // correct behavior
-        }
-    }
-
-    /**
-     * @tests java.util.BitSet#set(int)
-     */
-    public void test_setI() {
-        // Test for method void java.util.BitSet.set(int)
-
-        BitSet bs = new BitSet();
-        bs.set(8);
-        assertTrue("Failed to set bit", bs.get(8));
-
-        try {
-            bs.set(-1);
-            fail("Attempt to set at negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
-        }
-
-        // Try setting a bit on a 64 boundary
-        bs.set(128);
-        assertEquals("Failed to grow BitSet", 192, bs.size());
-        assertTrue("Failed to set bit", bs.get(128));
-
-        bs = new BitSet(64);
-        for (int i = bs.size(); --i >= 0;) {
-            bs.set(i);
-            assertTrue("Incorrectly set", bs.get(i));
-            assertEquals("Incorrect length", i+1, bs.length());
-            for (int j = bs.size(); --j > i;)
-                assertFalse("Incorrectly set bit " + j, bs.get(j));
-            for (int j = i; --j >= 0;)
-                assertFalse("Incorrectly set bit " + j, bs.get(j));
-            bs.clear(i);
-        }
-
-        bs = new BitSet(0);
-        assertEquals("Test1: Wrong length", 0, bs.length());
-        bs.set(0);
-        assertEquals("Test2: Wrong length", 1, bs.length());
-    }
-
-    /**
-     * @tests java.util.BitSet#set(int, boolean)
-     */
-    public void test_setIZ() {
-        // Test for method void java.util.BitSet.set(int, boolean)
-        eightbs.set(5, false);
-        assertFalse("Should have set bit 5 to true", eightbs.get(5));
-
-        eightbs.set(5, true);
-        assertTrue("Should have set bit 5 to false", eightbs.get(5));
-    }
-
-    /**
-     * @tests java.util.BitSet#set(int, int)
-     */
-    public void test_setII() throws IndexOutOfBoundsException {
-        BitSet bitset = new BitSet(30);
-        bitset.set(29, 29);
-
-        // Test for method void java.util.BitSet.set(int, int)
-        // pos1 and pos2 are in the same bitset element
-        BitSet bs = new BitSet(16);
-        bs.set(5);
-        bs.set(15);
-        bs.set(7, 11);
-        for (int i = 0; i < 7; i++) {
-            if (i == 5)
-                assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertFalse("Shouldn't have set bit " + i, bs.get(i));
-        }
-        for (int i = 7; i < 11; i++)
-            assertTrue("Failed to set bit " + i, bs.get(i));
-        for (int i = 11; i < bs.size(); i++) {
-            if (i == 15)
-                assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertFalse("Shouldn't have set bit " + i, bs.get(i));
-        }
-
-        // pos1 and pos2 is in the same bitset element, boundry testing
-        bs = new BitSet(16);
-        bs.set(7, 64);
-        assertEquals("Failed to grow BitSet", 64, bs.size());
-        for (int i = 0; i < 7; i++) {
-            assertFalse("Shouldn't have set bit " + i, bs.get(i));
-        }
-        for (int i = 7; i < 64; i++) {
-            assertTrue("Failed to set bit " + i, bs.get(i));
-        }
-        assertFalse("Shouldn't have set bit 64", bs.get(64));
-
-        // more boundary testing
-        bs = new BitSet(32);
-        bs.set(0, 64);
-        for (int i = 0; i < 64; i++) {
-            assertTrue("Failed to set bit " + i, bs.get(i));
-        }
-        assertFalse("Shouldn't have set bit 64", bs.get(64));
-
-        bs = new BitSet(32);
-        bs.set(0, 65);
-        for (int i = 0; i < 65; i++) {
-            assertTrue("Failed to set bit " + i, bs.get(i));
-        }
-        assertFalse("Shouldn't have set bit 65", bs.get(65));
-
-        // pos1 and pos2 are in two sequential bitset elements
-        bs = new BitSet(128);
-        bs.set(7);
-        bs.set(110);
-        bs.set(9, 74);
-        for (int i = 0; i < 9; i++) {
-            if (i == 7)
-                assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertFalse("Shouldn't have set bit " + i, bs.get(i));
-        }
-        for (int i = 9; i < 74; i++) {
-            assertTrue("Failed to set bit " + i, bs.get(i));
-        }
-        for (int i = 74; i < bs.size(); i++) {
-            if (i == 110)
-                assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertFalse("Shouldn't have set bit " + i, bs.get(i));
-        }
-
-        // pos1 and pos2 are in two non-sequential bitset elements
-        bs = new BitSet(256);
-        bs.set(7);
-        bs.set(255);
-        bs.set(9, 219);
-        for (int i = 0; i < 9; i++) {
-            if (i == 7)
-                assertTrue("Shouldn't have set flipped " + i, bs.get(i));
-            else
-                assertFalse("Shouldn't have set bit " + i, bs.get(i));
-        }
-
-        for (int i = 9; i < 219; i++) {
-            assertTrue("failed to set bit " + i, bs.get(i));
-        }
-
-        for (int i = 219; i < 255; i++) {
-            assertFalse("Shouldn't have set bit " + i, bs.get(i));
-        }
-
-        assertTrue("Shouldn't have flipped bit 255", bs.get(255));
-
-        // test illegal args
-        bs = new BitSet(10);
-        try {
-            bs.set(-1, 3);
-            fail("Test1: Attempt to flip with  negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behavior
-        }
-
-        try {
-            bs.set(2, -1);
-            fail("Test2: Attempt to flip with negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behavior
-        }
-
-        bs.set(2, 2);
-        assertFalse("Bit got set incorrectly ", bs.get(2));
-
-        try {
-            bs.set(4, 2);
-            fail("Test4: Attempt to flip with illegal args failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behavior
-        }
-    }
-
-    /**
-     * @tests java.util.BitSet#set(int, int, boolean)
-     */
-    public void test_setIIZ() {
-        // Test for method void java.util.BitSet.set(int, int, boolean)
-        eightbs.set(3, 6, false);
-        assertTrue("Should have set bits 3, 4, and 5 to false", !eightbs.get(3)
-                && !eightbs.get(4) && !eightbs.get(5));
-
-        eightbs.set(3, 6, true);
-        assertTrue("Should have set bits 3, 4, and 5 to true", eightbs.get(3)
-                && eightbs.get(4) && eightbs.get(5));
-
-    }
-
-    /**
-     * @tests java.util.BitSet#intersects(java.util.BitSet)
-     */
-    public void test_intersectsLjava_util_BitSet() {
-        // Test for method boolean java.util.BitSet.intersects(java.util.BitSet)
-        BitSet bs = new BitSet(500);
-        bs.set(5);
-        bs.set(63);
-        bs.set(64);
-        bs.set(71, 110);
-        bs.set(127, 130);
-        bs.set(192);
-        bs.set(450);
-
-        BitSet bs2 = new BitSet(8);
-        assertFalse("Test1: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertFalse("Test1: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.set(4);
-        assertFalse("Test2: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertFalse("Test2: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.clear();
-        bs2.set(5);
-        assertTrue("Test3: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test3: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.clear();
-        bs2.set(63);
-        assertTrue("Test4: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test4: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.clear();
-        bs2.set(80);
-        assertTrue("Test5: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test5: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.clear();
-        bs2.set(127);
-        assertTrue("Test6: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test6: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.clear();
-        bs2.set(192);
-        assertTrue("Test7: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test7: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.clear();
-        bs2.set(450);
-        assertTrue("Test8: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test8: intersects() returned incorrect value", bs2
-                .intersects(bs));
-
-        bs2.clear();
-        bs2.set(500);
-        assertFalse("Test9: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertFalse("Test9: intersects() returned incorrect value", bs2
-                .intersects(bs));
-    }
-
-    /**
-     * @tests java.util.BitSet#and(java.util.BitSet)
-     */
-    public void test_andLjava_util_BitSet() {
-        // Test for method void java.util.BitSet.and(java.util.BitSet)
-        BitSet bs = new BitSet(128);
-        // Initialize the bottom half of the BitSet
-
-        for (int i = 64; i < 128; i++)
-            bs.set(i);
-        eightbs.and(bs);
-        assertFalse("AND failed to clear bits", eightbs.equals(bs));
-        eightbs.set(3);
-        bs.set(3);
-        eightbs.and(bs);
-        assertTrue("AND failed to maintain set bits", bs.get(3));
-        bs.and(eightbs);
-        for (int i = 64; i < 128; i++) {
-            assertFalse("Failed to clear extra bits in the receiver BitSet", bs
-                    .get(i));
-        }
-    }
-
-    /**
-     * @tests java.util.BitSet#andNot(java.util.BitSet)
-     */
-    public void test_andNotLjava_util_BitSet() {
-        BitSet bs = (BitSet) eightbs.clone();
-        bs.clear(5);
-        BitSet bs2 = new BitSet();
-        bs2.set(2);
-        bs2.set(3);
-        bs.andNot(bs2);
-        assertEquals("Incorrect bitset after andNot",
-                     "{0, 1, 4, 6, 7}", bs.toString());
-
-        bs = new BitSet(0);
-        bs.andNot(bs2);
-        assertEquals("Incorrect size", 0, bs.size());
-    }
-
-    /**
-     * @tests java.util.BitSet#or(java.util.BitSet)
-     */
-    public void test_orLjava_util_BitSet() {
-        // Test for method void java.util.BitSet.or(java.util.BitSet)
-        BitSet bs = new BitSet(128);
-        bs.or(eightbs);
-        for (int i = 0; i < 8; i++) {
-            assertTrue("OR failed to set bits", bs.get(i));
-        }
-
-        bs = new BitSet(0);
-        bs.or(eightbs);
-        for (int i = 0; i < 8; i++) {
-            assertTrue("OR(0) failed to set bits", bs.get(i));
-        }
-
-        eightbs.clear(5);
-        bs = new BitSet(128);
-        bs.or(eightbs);
-        assertFalse("OR set a bit which should be off", bs.get(5));
-    }
-
-    /**
-     * @tests java.util.BitSet#xor(java.util.BitSet)
-     */
-    public void test_xorLjava_util_BitSet() {
-        // Test for method void java.util.BitSet.xor(java.util.BitSet)
-
-        BitSet bs = (BitSet) eightbs.clone();
-        bs.xor(eightbs);
-        for (int i = 0; i < 8; i++) {
-            assertFalse("XOR failed to clear bits", bs.get(i));
-        }
-
-        bs.xor(eightbs);
-        for (int i = 0; i < 8; i++) {
-            assertTrue("XOR failed to set bits", bs.get(i));
-        }
-
-        bs = new BitSet(0);
-        bs.xor(eightbs);
-        for (int i = 0; i < 8; i++) {
-            assertTrue("XOR(0) failed to set bits", bs.get(i));
-        }
-
-        bs = new BitSet();
-        bs.set(63);
-        assertEquals("Test highest bit", "{63}", bs.toString());
-    }
-
-    /**
-     * @tests java.util.BitSet#size()
-     */
-    public void test_size() {
-        // Test for method int java.util.BitSet.size()
-        assertEquals("Returned incorrect size", 64, eightbs.size());
-        eightbs.set(129);
-        assertTrue("Returned incorrect size", eightbs.size() >= 129);
-
-    }
-
-    /**
-     * @tests java.util.BitSet#toString()
-     */
-    public void test_toString() {
-        // Test for method java.lang.String java.util.BitSet.toString()
-        assertEquals("Returned incorrect string representation",
-                     "{0, 1, 2, 3, 4, 5, 6, 7}", eightbs.toString());
-        eightbs.clear(2);
-        assertEquals("Returned incorrect string representation",
-                     "{0, 1, 3, 4, 5, 6, 7}", eightbs.toString());
-    }
-
-    /**
-     * @tests java.util.BitSet#length()
-     */
-    public void test_length() {
-        BitSet bs = new BitSet();
-        assertEquals("BitSet returned wrong length", 0, bs.length());
-        bs.set(5);
-        assertEquals("BitSet returned wrong length", 6, bs.length());
-        bs.set(10);
-        assertEquals("BitSet returned wrong length", 11, bs.length());
-        bs.set(432);
-        assertEquals("BitSet returned wrong length", 433, bs.length());
-        bs.set(300);
-        assertEquals("BitSet returned wrong length", 433, bs.length());
-    }
-
-    /**
-     * @tests java.util.BitSet#nextSetBit(int)
-     */
-    public void test_nextSetBitI() {
-        // Test for method int java.util.BitSet.nextSetBit()
-        BitSet bs = new BitSet(500);
-        bs.set(5);
-        bs.set(32);
-        bs.set(63);
-        bs.set(64);
-        bs.set(71, 110);
-        bs.set(127, 130);
-        bs.set(193);
-        bs.set(450);
-        try {
-            bs.nextSetBit(-1);
-            fail("Expected IndexOutOfBoundsException for negative index");
-        } catch (IndexOutOfBoundsException e) {
-            // correct behavior
-        }
-        assertEquals("nextSetBit() returned the wrong value", 5, bs
-                .nextSetBit(0));
-        assertEquals("nextSetBit() returned the wrong value", 5, bs
-                .nextSetBit(5));
-        assertEquals("nextSetBit() returned the wrong value", 32, bs
-                .nextSetBit(6));
-        assertEquals("nextSetBit() returned the wrong value", 32, bs
-                .nextSetBit(32));
-        assertEquals("nextSetBit() returned the wrong value", 63, bs
-                .nextSetBit(33));
-
-        // boundary tests
-        assertEquals("nextSetBit() returned the wrong value", 63, bs
-                .nextSetBit(63));
-        assertEquals("nextSetBit() returned the wrong value", 64, bs
-                .nextSetBit(64));
-
-        // at bitset element 1
-        assertEquals("nextSetBit() returned the wrong value", 71, bs
-                .nextSetBit(65));
-        assertEquals("nextSetBit() returned the wrong value", 71, bs
-                .nextSetBit(71));
-        assertEquals("nextSetBit() returned the wrong value", 72, bs
-                .nextSetBit(72));
-        assertEquals("nextSetBit() returned the wrong value", 127, bs
-                .nextSetBit(110));
-
-        // boundary tests
-        assertEquals("nextSetBit() returned the wrong value", 127, bs
-                .nextSetBit(127));
-        assertEquals("nextSetBit() returned the wrong value", 128, bs
-                .nextSetBit(128));
-
-        // at bitset element 2
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(130));
-
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(191));
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(192));
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(193));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(194));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(255));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(256));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(450));
-
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(451));
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(511));
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(512));
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(800));
-    }
-
-    /**
-     * @tests java.util.BitSet#nextClearBit(int)
-     */
-    public void test_nextClearBitI() {
-        // Test for method int java.util.BitSet.nextSetBit()
-        BitSet bs = new BitSet(500);
-        bs.set(0, bs.size() - 1); // ensure all the bits from 0 to bs.size()
-                                    // -1
-        bs.set(bs.size() - 1); // are set to true
-        bs.clear(5);
-        bs.clear(32);
-        bs.clear(63);
-        bs.clear(64);
-        bs.clear(71, 110);
-        bs.clear(127, 130);
-        bs.clear(193);
-        bs.clear(450);
-        try {
-            bs.nextClearBit(-1);
-            fail("Expected IndexOutOfBoundsException for negative index");
-        } catch (IndexOutOfBoundsException e) {
-            // correct behavior
-        }
-        assertEquals("nextClearBit() returned the wrong value", 5, bs
-                .nextClearBit(0));
-        assertEquals("nextClearBit() returned the wrong value", 5, bs
-                .nextClearBit(5));
-        assertEquals("nextClearBit() returned the wrong value", 32, bs
-                .nextClearBit(6));
-        assertEquals("nextClearBit() returned the wrong value", 32, bs
-                .nextClearBit(32));
-        assertEquals("nextClearBit() returned the wrong value", 63, bs
-                .nextClearBit(33));
-
-        // boundary tests
-        assertEquals("nextClearBit() returned the wrong value", 63, bs
-                .nextClearBit(63));
-        assertEquals("nextClearBit() returned the wrong value", 64, bs
-                .nextClearBit(64));
-
-        // at bitset element 1
-        assertEquals("nextClearBit() returned the wrong value", 71, bs
-                .nextClearBit(65));
-        assertEquals("nextClearBit() returned the wrong value", 71, bs
-                .nextClearBit(71));
-        assertEquals("nextClearBit() returned the wrong value", 72, bs
-                .nextClearBit(72));
-        assertEquals("nextClearBit() returned the wrong value", 127, bs
-                .nextClearBit(110));
-
-        // boundary tests
-        assertEquals("nextClearBit() returned the wrong value", 127, bs
-                .nextClearBit(127));
-        assertEquals("nextClearBit() returned the wrong value", 128, bs
-                .nextClearBit(128));
-
-        // at bitset element 2
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(130));
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(191));
-
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(192));
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(193));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(194));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(255));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(256));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(450));
-
-        // bitset has 1 still the end of bs.size() -1, but calling nextClearBit
-        // with any index value
-        // after the last true bit should return bs.size(),
-        assertEquals("nextClearBit() returned the wrong value", 512, bs
-                .nextClearBit(451));
-        assertEquals("nextClearBit() returned the wrong value", 512, bs
-                .nextClearBit(511));
-        assertEquals("nextClearBit() returned the wrong value", 512, bs
-                .nextClearBit(512));
-
-        // if the index is larger than bs.size(), nextClearBit should return
-        // index;
-        assertEquals("nextClearBit() returned the wrong value", 513, bs
-                .nextClearBit(513));
-        assertEquals("nextClearBit() returned the wrong value", 800, bs
-                .nextClearBit(800));
-    }
-
-    /**
-     * @tests java.util.BitSet#isEmpty()
-     */
-    public void test_isEmpty() {
-        BitSet bs = new BitSet(500);
-        assertTrue("Test: isEmpty() returned wrong value", bs.isEmpty());
-
-        // at bitset element 0
-        bs.set(3);
-        assertFalse("Test0: isEmpty() returned wrong value", bs.isEmpty());
-
-        // at bitset element 1
-        bs.clear();
-        bs.set(12);
-        assertFalse("Test1: isEmpty() returned wrong value", bs.isEmpty());
-
-        // at bitset element 2
-        bs.clear();
-        bs.set(128);
-        assertFalse("Test2: isEmpty() returned wrong value", bs.isEmpty());
-
-        // boundary testing
-        bs.clear();
-        bs.set(459);
-        assertFalse("Test3: isEmpty() returned wrong value", bs.isEmpty());
-
-        bs.clear();
-        bs.set(511);
-        assertFalse("Test4: isEmpty() returned wrong value", bs.isEmpty());
-    }
-
-    /**
-     * @tests java.util.BitSet#cardinality()
-     */
-    public void test_cardinality() {
-        // test for method int java.util.BitSet.cardinality()
-        BitSet bs = new BitSet(500);
-        bs.set(5);
-        bs.set(32);
-        bs.set(63);
-        bs.set(64);
-        bs.set(71, 110);
-        bs.set(127, 130);
-        bs.set(193);
-        bs.set(450);
-        assertEquals("cardinality() returned wrong value", 48, bs.cardinality());
-
-        bs.flip(0, 500);
-        assertEquals("cardinality() returned wrong value", 452, bs
-                .cardinality());
-
-        bs.clear();
-        assertEquals("cardinality() returned wrong value", 0, bs.cardinality());
-
-        bs.set(0, 500);
-        assertEquals("cardinality() returned wrong value", 500, bs
-                .cardinality());
-    }
-
-    protected void setUp() {
-
-        eightbs = new BitSet();
-
-        for (int i = 0; i < 8; i++)
-            eightbs.set(i);
-    }
-
-    protected void tearDown() {
-    }
-
-}
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/CollectionsTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/CollectionsTest.java
index 8e40752..84d498d 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/CollectionsTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/CollectionsTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.io.Serializable;
@@ -49,7 +44,6 @@
 
 import tests.util.SerializationTester;
 
-@TestTargetClass(Collections.class)
 public class CollectionsTest extends TestCase {
 
     private static final SerializableAssert comparator = new SerializableAssert() {
@@ -59,15 +53,9 @@
     };
 
     /**
-     * @tests java.util.Collections#binarySearch(java.util.List,
+     * java.util.Collections#binarySearch(java.util.List,
      *        java.lang.Object, java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {java.util.List.class, java.lang.Object.class, java.util.Comparator.class}
-    )
     public void test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator() {
         // Regression for HARMONY-94
         LinkedList<Integer> lst = new LinkedList<Integer>();
@@ -93,15 +81,9 @@
     }
 
     /**
-     * @tests java.util.Collections#binarySearch(java.util.List,
+     * java.util.Collections#binarySearch(java.util.List,
      *        java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {java.util.List.class, java.lang.Object.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_binarySearchLjava_util_ListLjava_lang_Object() {
         // regression for Harmony-1367
@@ -132,14 +114,8 @@
     }
 
     /**
-     * @tests java.util.Collections#rotate(java.util.List, int)
+     * java.util.Collections#rotate(java.util.List, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "UnsupportedOperationException is not tested.",
-        method = "rotate",
-        args = {java.util.List.class, int.class}
-    )
     public void test_rotateLjava_util_ListI() {
         // Regression for HARMONY-19 Rotate an *empty* list
         Collections.rotate(new ArrayList<Object>(), 25);
@@ -166,14 +142,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedCollection(java.util.Collection)
+     * java.util.Collections#synchronizedCollection(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "synchronizedCollection",
-        args = {java.util.Collection.class}
-    )
     public void test_synchronizedCollectionLjava_util_Collection() {
         try {
             // Regression for HARMONY-93
@@ -185,14 +155,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedSortedMap(java.util.SortedMap)
+     * java.util.Collections#synchronizedSortedMap(java.util.SortedMap)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "synchronizedSortedMap",
-        args = {java.util.SortedMap.class}
-    )
     public void test_synchronizedSortedMapLjava_util_SortedMap() {
         try {
             // Regression for HARMONY-93
@@ -204,14 +168,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedMap(java.util.Map)
+     * java.util.Collections#synchronizedMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "synchronizedMap",
-        args = {java.util.Map.class}
-    )
     public void test_synchronizedMapLjava_util_Map() {
         try {
             // Regression for HARMONY-93
@@ -223,14 +181,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedSet(java.util.Set)
+     * java.util.Collections#synchronizedSet(java.util.Set)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "synchronizedSet",
-        args = {java.util.Set.class}
-    )
     public void test_synchronizedSetLjava_util_Set() {
         try {
             // Regression for HARMONY-93
@@ -242,14 +194,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedSortedSet(java.util.SortedSet)
+     * java.util.Collections#synchronizedSortedSet(java.util.SortedSet)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "synchronizedSortedSet",
-        args = {java.util.SortedSet.class}
-    )
     public void test_synchronizedSortedSetLjava_util_SortedSet() {
         try {
             // Regression for HARMONY-93
@@ -261,14 +207,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableCollection(java.util.Collection)
+     * java.util.Collections#unmodifiableCollection(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "unmodifiableCollection",
-        args = {java.util.Collection.class}
-    )
     public void test_unmodifiableCollectionLjava_util_Collection() {
         try {
             // Regression for HARMONY-93
@@ -280,14 +220,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableMap(java.util.Map)
+     * java.util.Collections#unmodifiableMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "unmodifiableMap",
-        args = {java.util.Map.class}
-    )
     public void test_unmodifiableMapLjava_util_Map() {
         try {
             // Regression for HARMONY-93
@@ -299,14 +233,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableSet(java.util.Set)
+     * java.util.Collections#unmodifiableSet(java.util.Set)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "unmodifiableSet",
-        args = {java.util.Set.class}
-    )
     public void test_unmodifiableSetLjava_util_Set() {
         try {
             // Regression for HARMONY-93
@@ -318,14 +246,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableSortedMap(java.util.SortedMap)
+     * java.util.Collections#unmodifiableSortedMap(java.util.SortedMap)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "unmodifiableSortedMap",
-        args = {java.util.SortedMap.class}
-    )
     public void test_unmodifiableSortedMapLjava_util_SortedMap() {
         try {
             // Regression for HARMONY-93
@@ -337,14 +259,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableSortedSet(java.util.SortedSet)
+     * java.util.Collections#unmodifiableSortedSet(java.util.SortedSet)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "unmodifiableSortedSet",
-        args = {java.util.SortedSet.class}
-    )
     public void test_unmodifiableSortedSetLjava_util_SortedSet() {
         try {
             // Regression for HARMONY-93
@@ -356,14 +272,8 @@
     }
 
     /**
-     * @tests java.util.Collections#frequency(java.util.Collection,Object)
+     * java.util.Collections#frequency(java.util.Collection,Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "frequency",
-        args = {java.util.Collection.class, java.lang.Object.class}
-    )
     public void test_frequencyLjava_util_CollectionLint() {
         try {
             Collections.frequency(null, null);
@@ -398,14 +308,8 @@
     }
 
     /**
-     * @tests java.util.Collections#reverseOrder()
+     * java.util.Collections#reverseOrder()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "reverseOrder",
-        args = {}
-    )
     public void test_reverseOrder() {
         Comparator<String> roc = Collections.reverseOrder();
         assertNotNull("Assert 0: comparator must not be null", roc);
@@ -421,14 +325,8 @@
     }
 
     /**
-     * @tests java.util.Collections#reverseOrder(java.util.Comparator)
+     * java.util.Collections#reverseOrder(java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "reverseOrder",
-        args = {java.util.Comparator.class}
-    )
     public void test_reverseOrderLjava_util_Comparator() {
         Comparator<String> roc = Collections
                 .reverseOrder(String.CASE_INSENSITIVE_ORDER);
@@ -564,12 +462,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {java.util.Collection.class, java.lang.Object[].class}
-    )
     public void test_AddAll() {
         List<Object> l = new ArrayList<Object>();
         assertFalse(Collections.addAll(l, new Object[] {}));
@@ -618,12 +510,6 @@
         Collections.addAll(c, new String[] { "String",
                 "", "Correct element" });
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "disjoint",
-        args = {java.util.Collection.class, java.util.Collection.class}
-    )
     public void test_Disjoint() {
         Object[] arr1 = new Object[10];
         for (int i = 0; i < arr1.length; i++) {
@@ -697,132 +583,66 @@
     }
 
     /**
-     * @tests java.util.Collections.EmptyList#readResolve()
+     * java.util.Collections.EmptyList#readResolve()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void test_EmptyList_readResolve() throws Exception {
         SerializationTest.verifySelf(Collections.EMPTY_LIST, comparator);
     }
 
     /**
-     * @tests java.util.Collections.EmptyMap#readResolve()
+     * java.util.Collections.EmptyMap#readResolve()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void test_EmptyMap_readResolve() throws Exception {
         SerializationTest.verifySelf(Collections.EMPTY_MAP, comparator);
     }
 
     /**
-     * @tests java.util.Collections.EmptySet#readResolve()
+     * java.util.Collections.EmptySet#readResolve()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void test_EmptySet_readResolve() throws Exception {
         SerializationTest.verifySelf(Collections.EMPTY_SET, comparator);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_checkedCollectionSerializationCompatability() throws Exception {
         Collection<String> c = Collections.emptySet();
         c = Collections.checkedCollection(c, String.class);
         SerializationTester.assertCompabilityEquals(c, "/serialization/org/apache/harmony/luni/tests/java/util/Collections_CheckedCollection.golden.ser");
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_checkedListRandomAccessSerializationCompatability() throws Exception {
         List<String> c = new ArrayList<String>();
         assertTrue(c instanceof RandomAccess);
         c = Collections.checkedList(c, String.class);
         SerializationTester.assertCompabilityEquals(c, "/serialization/org/apache/harmony/luni/tests/java/util/Collections_CheckedListRandomAccess.golden.ser");
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_checkedListSerializationCompatability() throws Exception {
         List<String> c = new LinkedList<String>();
         assertFalse(c instanceof RandomAccess);
         c = Collections.checkedList(c, String.class);
         SerializationTester.assertCompabilityEquals(c, "/serialization/org/apache/harmony/luni/tests/java/util/Collections_CheckedList.golden.ser");
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_checkedSetSerializationCompatability() throws Exception {
         Set<String> c = new HashSet<String>();
         assertFalse(c instanceof SortedSet);
         c = Collections.checkedSet(c, String.class);
         SerializationTester.assertCompabilityEquals(c, "/serialization/org/apache/harmony/luni/tests/java/util/Collections_CheckedSet.golden.ser");
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_checkedMapSerializationCompatability() throws Exception {
         Map<String, String> c = new HashMap<String, String>();
         assertFalse(c instanceof SortedMap);
         c = Collections.checkedMap(c, String.class, String.class);
         SerializationTester.assertCompabilityEquals(c, "/serialization/org/apache/harmony/luni/tests/java/util/Collections_CheckedMap.golden.ser");
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_checkedSortedSetSerializationCompatability() throws Exception {
         SortedSet<String> c = new TreeSet<String>();
         c = Collections.checkedSortedSet(c, String.class);
         SerializationTester.assertCompabilityEquals(c, "/serialization/org/apache/harmony/luni/tests/java/util/Collections_CheckedSortedSet.golden.ser");
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void test_checkedSortedMapSerializationCompatability() throws Exception {
         SortedMap<String, String> c = new TreeMap<String, String>();
         c = Collections.checkedSortedMap(c, String.class, String.class);
         SerializationTester.assertCompabilityEquals(c, "/serialization/org/apache/harmony/luni/tests/java/util/Collections_CheckedSortedMap.golden.ser");
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "checkedCollection",
-        args = {java.util.Collection.class, java.lang.Class.class}
-    )
     public void test_checkedCollectionLjava_util_CollectionLjava_lang_Class() {
         ArrayList al = new ArrayList<Integer>();
 
@@ -838,12 +658,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "checkedList",
-        args = {java.util.List.class, java.lang.Class.class}
-    )
     public void test_checkedListLjava_util_ListLjava_lang_Class() {
         ArrayList al = new ArrayList<Integer>();
 
@@ -859,12 +673,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "checkedMap",
-        args = {java.util.Map.class, java.lang.Class.class, java.lang.Class.class}
-    )
     public void test_checkedMapLjava_util_MapLjava_lang_ClassLjava_lang_Class() {
         HashMap hm = new HashMap<Integer, String>();
 
@@ -888,12 +696,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "checkedSet",
-        args = {java.util.Set.class, java.lang.Class.class}
-    )
     public void test_checkedSetLjava_util_SetLjava_lang_Class() {
         HashSet hs = new HashSet<Integer>();
 
@@ -909,12 +711,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "checkedSortedMap",
-        args = {java.util.SortedMap.class, java.lang.Class.class, java.lang.Class.class}
-    )
     public void test_checkedSortedMapLjava_util_SortedMapLjava_lang_ClassLjava_lang_Class() {
         TreeMap tm = new TreeMap<Integer, String>();
 
@@ -938,12 +734,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "checkedSortedSet",
-        args = {java.util.SortedSet.class, java.lang.Class.class}
-    )
     public void test_checkedSortedSetLjava_util_SortedSetLjava_lang_Class() {
         TreeSet ts = new TreeSet<Integer>();
 
@@ -959,12 +749,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "emptyList",
-        args = {}
-    )
     public void test_emptyList() {
         List<String> ls = Collections.emptyList();
         List<Integer> li = Collections.emptyList();
@@ -973,12 +757,6 @@
         assertTrue(li.equals(Collections.EMPTY_LIST));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "emptyMap",
-        args = {}
-    )
     public void test_emptyMap() {
         Map<Integer, String> mis = Collections.emptyMap();
         Map<String, Integer> msi = Collections.emptyMap();
@@ -987,12 +765,6 @@
         assertTrue(msi.equals(Collections.EMPTY_MAP));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "emptySet",
-        args = {}
-    )
     public void test_emptySet() {
         Set<String> ss = Collections.emptySet();
         Set<Integer> si = Collections.emptySet();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DictionaryTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DictionaryTest.java
index 19cf8c0..2aaab58 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DictionaryTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DictionaryTest.java
@@ -16,18 +16,12 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.util.Date;
 import java.util.Dictionary;
 import java.util.Enumeration;
 
-@TestTargetClass(Dictionary.class)
 public class DictionaryTest extends TestCase {
 
     class Mock_Dictionary extends Dictionary {
@@ -68,12 +62,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Dictionary",
-        args = {}
-    )
     public void testDictionary() {
         Dictionary md = new Mock_Dictionary();
         assertNotNull(md);
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DuplicateFormatFlagsExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DuplicateFormatFlagsExceptionTest.java
index 7170f5b..1c4df4f 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DuplicateFormatFlagsExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/DuplicateFormatFlagsExceptionTest.java
@@ -27,7 +27,7 @@
 public class DuplicateFormatFlagsExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.DuplicateFormatFlagsException#DuplicateFormatFlagsException(String)
+     * java.util.DuplicateFormatFlagsException#DuplicateFormatFlagsException(String)
      */
     public void test_duplicateFormatFlagsException() {
         try {
@@ -39,7 +39,7 @@
     }
 
     /**
-     * @tests java.util.DuplicateFormatFlagsException#getFlags()
+     * java.util.DuplicateFormatFlagsException#getFlags()
      */
     public void test_getFlags() {
         String strFlags = "MYTESTFLAGS";
@@ -49,7 +49,7 @@
     }
 
     /**
-     * @tests java.util.DuplicateFormatFlagsException#getMessage()
+     * java.util.DuplicateFormatFlagsException#getMessage()
      */
     public void test_getMessage() {
         String strFlags = "MYTESTFLAGS";
@@ -75,7 +75,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -84,7 +84,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/EventListenerProxyTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/EventListenerProxyTest.java
index e6c0ac7..11e8c26 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/EventListenerProxyTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/EventListenerProxyTest.java
@@ -16,17 +16,11 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.util.EventListener;
 import java.util.EventListenerProxy;
 
-@TestTargetClass(EventListenerProxy.class)
 public class EventListenerProxyTest extends TestCase {
 
     class Mock_EventListener implements EventListener {
@@ -41,23 +35,11 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "EventListenerProxy",
-        args = {java.util.EventListener.class}
-    )
     public void testEventListenerProxy() {
         assertNotNull(new Mock_EventListenerProxy(null));
         assertNotNull(new Mock_EventListenerProxy(new Mock_EventListener()));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getListener",
-        args = {}
-    )
     public void testGetListener() {
         EventListener el = new Mock_EventListener();
         EventListenerProxy elp = new Mock_EventListenerProxy(el);
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatFlagsConversionMismatchExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatFlagsConversionMismatchExceptionTest.java
index ffe3e53..fd2a545 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatFlagsConversionMismatchExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatFlagsConversionMismatchExceptionTest.java
@@ -27,7 +27,7 @@
 public class FormatFlagsConversionMismatchExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.FormatFlagsConversionMismatchException#FormatFlagsConversionMismatchException(String,
+     * java.util.FormatFlagsConversionMismatchException#FormatFlagsConversionMismatchException(String,
      *        char)
      */
     public void test_formatFlagsConversionMismatchException() {
@@ -41,7 +41,7 @@
     }
 
     /**
-     * @tests java.util.FormatFlagsConversionMismatchException#getFlags()
+     * java.util.FormatFlagsConversionMismatchException#getFlags()
      */
     public void test_getFlags() {
         String flags = "MYTESTFLAGS";
@@ -52,7 +52,7 @@
     }
 
     /**
-     * @tests java.util.FormatFlagsConversionMismatchException#getConversion()
+     * java.util.FormatFlagsConversionMismatchException#getConversion()
      */
     public void test_getConversion() {
         String flags = "MYTESTFLAGS";
@@ -65,7 +65,7 @@
     }
 
     /**
-     * @tests java.util.FormatFlagsConversionMismatchException#getMessage()
+     * java.util.FormatFlagsConversionMismatchException#getMessage()
      */
     public void test_getMessage() {
         String flags = "MYTESTFLAGS";
@@ -94,7 +94,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -104,7 +104,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormattableTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormattableTest.java
index 19d7cdb..e972bdd 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormattableTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormattableTest.java
@@ -16,17 +16,11 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.util.Formattable;
 import java.util.Formatter;
 
-@TestTargetClass(Formattable.class)
 public class FormattableTest extends TestCase {
 
     class Mock_Formattable implements Formattable {
@@ -51,12 +45,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "formatTo",
-        args = {java.util.Formatter.class, int.class, int.class, int.class}
-    )
     public void testFormatTo() {
         Formatter fmt = new Formatter();
         Mock_Formattable mf = new Mock_Formattable();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java
index e3c8327..273aee8 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/FormatterClosedExceptionTest.java
@@ -25,7 +25,7 @@
 public class FormatterClosedExceptionTest extends TestCase {
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -33,7 +33,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/HashMapTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/HashMapTest.java
index 8be1578..aca5bac 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/HashMapTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/HashMapTest.java
@@ -110,7 +110,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#HashMap()
+	 * java.util.HashMap#HashMap()
 	 */
 	public void test_Constructor() {
 		// Test for method java.util.HashMap()
@@ -121,7 +121,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#HashMap(int)
+	 * java.util.HashMap#HashMap(int)
 	 */
 	public void test_ConstructorI() {
 		// Test for method java.util.HashMap(int)
@@ -142,7 +142,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#HashMap(int, float)
+	 * java.util.HashMap#HashMap(int, float)
 	 */
 	public void test_ConstructorIF() {
 		// Test for method java.util.HashMap(int, float)
@@ -163,7 +163,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#HashMap(java.util.Map)
+	 * java.util.HashMap#HashMap(java.util.Map)
 	 */
 	public void test_ConstructorLjava_util_Map() {
 		// Test for method java.util.HashMap(java.util.Map)
@@ -191,7 +191,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#clear()
+	 * java.util.HashMap#clear()
 	 */
 	public void test_clear() {
 		hm.clear();
@@ -213,7 +213,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#clone()
+	 * java.util.HashMap#clone()
 	 */
 	public void test_clone() {
 		// Test for method java.lang.Object java.util.HashMap.clone()
@@ -259,7 +259,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#containsKey(java.lang.Object)
+	 * java.util.HashMap#containsKey(java.lang.Object)
 	 */
 	public void test_containsKeyLjava_lang_Object() {
 		// Test for method boolean
@@ -276,7 +276,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#containsValue(java.lang.Object)
+	 * java.util.HashMap#containsValue(java.lang.Object)
 	 */
 	public void test_containsValueLjava_lang_Object() {
 		// Test for method boolean
@@ -288,7 +288,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#entrySet()
+	 * java.util.HashMap#entrySet()
 	 */
 	public void test_entrySet() {
 		// Test for method java.util.Set java.util.HashMap.entrySet()
@@ -308,7 +308,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#get(java.lang.Object)
+	 * java.util.HashMap#get(java.lang.Object)
 	 */
 	public void test_getLjava_lang_Object() {
 		// Test for method java.lang.Object
@@ -380,7 +380,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#isEmpty()
+	 * java.util.HashMap#isEmpty()
 	 */
 	public void test_isEmpty() {
 		// Test for method boolean java.util.HashMap.isEmpty()
@@ -389,7 +389,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#keySet()
+	 * java.util.HashMap#keySet()
 	 */
 	public void test_keySet() {
 		// Test for method java.util.Set java.util.HashMap.keySet()
@@ -442,7 +442,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#put(java.lang.Object, java.lang.Object)
+	 * java.util.HashMap#put(java.lang.Object, java.lang.Object)
 	 */
 	public void test_putLjava_lang_ObjectLjava_lang_Object() {
         hm.put("KEY", "VALUE");
@@ -512,7 +512,7 @@
         }
     }
 	/**
-	 * @tests java.util.HashMap#putAll(java.util.Map)
+	 * java.util.HashMap#putAll(java.util.Map)
 	 */
 	public void test_putAllLjava_util_Map() {
 		// Test for method void java.util.HashMap.putAll(java.util.Map)
@@ -529,7 +529,7 @@
 	}
 
     /**
-     * @tests java.util.HashMap#putAll(java.util.Map)
+     * java.util.HashMap#putAll(java.util.Map)
      */
     public void test_putAllLjava_util_Map_Null() {
         HashMap hashMap = new HashMap();
@@ -549,7 +549,7 @@
     }
 
 	/**
-	 * @tests java.util.HashMap#remove(java.lang.Object)
+	 * java.util.HashMap#remove(java.lang.Object)
 	 */
 	public void test_removeLjava_lang_Object() {
 		int size = hm.size();
@@ -593,7 +593,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#size()
+	 * java.util.HashMap#size()
 	 */
 	public void test_size() {
 		// Test for method int java.util.HashMap.size()
@@ -602,7 +602,7 @@
 	}
 
 	/**
-	 * @tests java.util.HashMap#values()
+	 * java.util.HashMap#values()
 	 */
 	public void test_values() {
 		// Test for method java.util.Collection java.util.HashMap.values()
@@ -628,7 +628,7 @@
 	}
 
     /**
-     * @tests java.util.AbstractMap#toString()
+     * java.util.AbstractMap#toString()
      */
     public void test_toString() {
 
@@ -747,7 +747,7 @@
     }
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
         HashMap<String, String> hm = new HashMap<String, String>();
@@ -761,7 +761,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
         HashMap<String, String> hm = new HashMap<String, String>();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IdentityHashMapTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IdentityHashMapTest.java
index 09742d7..fba97ef 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IdentityHashMapTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IdentityHashMapTest.java
@@ -32,10 +32,10 @@
 public class IdentityHashMapTest extends junit.framework.TestCase {
 
 	/**
-	 * @tests java.util.IdentityHashMap#containsKey(java.lang.Object)
-	 * @tests java.util.IdentityHashMap#containsValue(java.lang.Object)
-	 * @tests java.util.IdentityHashMap#put(java.lang.Object, java.lang.Object)
-	 * @tests java.util.IdentityHashMap#get(java.lang.Object)
+	 * java.util.IdentityHashMap#containsKey(java.lang.Object)
+	 * java.util.IdentityHashMap#containsValue(java.lang.Object)
+	 * java.util.IdentityHashMap#put(java.lang.Object, java.lang.Object)
+	 * java.util.IdentityHashMap#get(java.lang.Object)
 	 */
 	public void test_null_Keys_and_Values() {
 		// tests with null keys and values
@@ -90,7 +90,7 @@
 	}
 
     /**
-     * @tests java.util.IdentityHashMap#put(java.lang.Object, java.lang.Object)
+     * java.util.IdentityHashMap#put(java.lang.Object, java.lang.Object)
      */
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         IdentityHashMap<Object, Object> map = new IdentityHashMap<Object, Object>();
@@ -107,8 +107,8 @@
     }
 
 	/**
-	 * @tests java.util.IdentityHashMap#remove(java.lang.Object)
-	 * @tests java.util.IdentityHashMap#keySet()
+	 * java.util.IdentityHashMap#remove(java.lang.Object)
+	 * java.util.IdentityHashMap#keySet()
 	 */
 	public void test_remove() {
 		IdentityHashMap map = new IdentityHashMap();
@@ -127,7 +127,7 @@
 	}
 
     /**
-     * @tests java.util.IdentityHashMapTest#remove(java.lang.Object)
+     * java.util.IdentityHashMapTest#remove(java.lang.Object)
      */
     public void test_removeLjava_lang_Object() {
         // Regression for HARMONY-37
@@ -146,9 +146,9 @@
     }
 
 	/**
-	 * @tests java.util.IdentityHashMap#entrySet()
-	 * @tests java.util.IdentityHashMap#keySet()
-	 * @tests java.util.IdentityHashMap#values()
+	 * java.util.IdentityHashMap#entrySet()
+	 * java.util.IdentityHashMap#keySet()
+	 * java.util.IdentityHashMap#values()
 	 */
 	public void test_sets() {
 		// tests with null keys and values
@@ -182,8 +182,8 @@
 	}
 
 	/**
-	 * @tests java.util.IdentityHashMap#entrySet()
-	 * @tests java.util.IdentityHashMap#remove(java.lang.Object)
+	 * java.util.IdentityHashMap#entrySet()
+	 * java.util.IdentityHashMap#remove(java.lang.Object)
 	 */
 	public void test_entrySet_removeAll() {
 		IdentityHashMap map = new IdentityHashMap();
@@ -201,8 +201,8 @@
 	}
 
 	/**
-	 * @tests java.util.IdentityHashMap#keySet()
-	 * @tests java.util.IdentityHashMap#clear()
+	 * java.util.IdentityHashMap#keySet()
+	 * java.util.IdentityHashMap#clear()
 	 */
 	public void test_keySet_clear() {
 		IdentityHashMap map = new IdentityHashMap();
@@ -220,7 +220,7 @@
 	}
 
 	/**
-	 * @tests java.util.IdentityHashMap#values()
+	 * java.util.IdentityHashMap#values()
 	 */
 	public void test_values() {
 
@@ -270,8 +270,8 @@
 	}
 
 	/**
-	 * @tests java.util.IdentityHashMap#keySet()
-	 * @tests java.util.IdentityHashMap#remove(java.lang.Object)
+	 * java.util.IdentityHashMap#keySet()
+	 * java.util.IdentityHashMap#remove(java.lang.Object)
 	 */
 	public void test_keySet_removeAll() {
 		IdentityHashMap map = new IdentityHashMap();
@@ -289,7 +289,7 @@
 	}
 
 	/**
-	 * @tests java.util.IdentityHashMap#keySet()
+	 * java.util.IdentityHashMap#keySet()
 	 */
 	public void test_keySet_retainAll() {
 		IdentityHashMap map = new IdentityHashMap();
@@ -314,8 +314,8 @@
 	}
 
 	/**
-	 * @tests java.util.IdentityHashMap#keySet()
-	 * @tests java.util.IdentityHashMap#remove(java.lang.Object)
+	 * java.util.IdentityHashMap#keySet()
+	 * java.util.IdentityHashMap#remove(java.lang.Object)
 	 */
 	public void test_keyset_remove() {
 		IdentityHashMap map = new IdentityHashMap();
@@ -423,7 +423,7 @@
     };
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
         IdentityHashMap<String, String> identityHashMap = new IdentityHashMap<String, String>();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatCodePointExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatCodePointExceptionTest.java
index 3d0286a..4592ab9 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatCodePointExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatCodePointExceptionTest.java
@@ -27,7 +27,7 @@
 public class IllegalFormatCodePointExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.IllegalFormatCodePointException.IllegalFormatCodePointException(int)
+     * java.util.IllegalFormatCodePointException.IllegalFormatCodePointException(int)
      */
     public void test_illegalFormatCodePointException() {
         IllegalFormatCodePointException illegalFormatCodePointException = new IllegalFormatCodePointException(
@@ -36,7 +36,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatCodePointException.getCodePoint()
+     * java.util.IllegalFormatCodePointException.getCodePoint()
      */
     public void test_getCodePoint() {
         int codePoint = 12345;
@@ -46,7 +46,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatCodePointException.getMessage()
+     * java.util.IllegalFormatCodePointException.getMessage()
      */
     public void test_getMessage() {
         int codePoint = 12345;
@@ -72,7 +72,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -81,7 +81,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatConversionExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatConversionExceptionTest.java
index e934805..94cf1e4 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatConversionExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatConversionExceptionTest.java
@@ -27,7 +27,7 @@
 public class IllegalFormatConversionExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.IllegalFormatConversionException#IllegalFormatConversionException(char,
+     * java.util.IllegalFormatConversionException#IllegalFormatConversionException(char,
      *        Class)
      */
     public void test_illegalFormatConversionException() {
@@ -40,7 +40,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatConversionException#getArgumentClass()
+     * java.util.IllegalFormatConversionException#getArgumentClass()
      */
     public void test_getArgumentClass() {
         char c = '*';
@@ -53,7 +53,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatConversionException#getConversion()
+     * java.util.IllegalFormatConversionException#getConversion()
      */
     public void test_getConversion() {
         char c = '*';
@@ -65,7 +65,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatConversionException#getMessage()
+     * java.util.IllegalFormatConversionException#getMessage()
      */
     public void test_getMessage() {
         char c = '*';
@@ -95,7 +95,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -104,7 +104,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatFlagsExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatFlagsExceptionTest.java
index 6ccc97a..6816d16 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatFlagsExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatFlagsExceptionTest.java
@@ -27,7 +27,7 @@
 public class IllegalFormatFlagsExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.IllegalFormatFlagsException#IllegalFormatFlagsException(String)
+     * java.util.IllegalFormatFlagsException#IllegalFormatFlagsException(String)
      */
     public void test_illegalFormatFlagsException() {
         try {
@@ -39,7 +39,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatFlagsException.getFlags()
+     * java.util.IllegalFormatFlagsException.getFlags()
      */
     public void test_getFlags() {
         String flags = "TESTFLAGS";
@@ -49,7 +49,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatFlagsException.getMessage()
+     * java.util.IllegalFormatFlagsException.getMessage()
      */
     public void test_getMessage() {
         String flags = "TESTFLAGS";
@@ -75,7 +75,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -84,7 +84,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatPrecisionExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatPrecisionExceptionTest.java
index 8d148bc..84d06c4c 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatPrecisionExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatPrecisionExceptionTest.java
@@ -26,7 +26,7 @@
 public class IllegalFormatPrecisionExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.IllegalFormatPrecisionException#IllegalFormatPrecisionException(int)
+     * java.util.IllegalFormatPrecisionException#IllegalFormatPrecisionException(int)
      */
     public void test_illegalFormatPrecisionException() {
         IllegalFormatPrecisionException illegalFormatPrecisionException = new IllegalFormatPrecisionException(
@@ -36,7 +36,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatPrecisionException#getPrecision()
+     * java.util.IllegalFormatPrecisionException#getPrecision()
      */
     public void test_getPrecision() {
         int precision = 12345;
@@ -46,7 +46,7 @@
     }
 
     /**
-     * @tests method for 'java.util.IllegalFormatPrecisionException#getMessage()
+     * method for 'java.util.IllegalFormatPrecisionException#getMessage()
      */
     public void test_getMessage() {
         int precision = 12345;
@@ -73,7 +73,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -82,7 +82,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatWidthExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatWidthExceptionTest.java
index 032f01a..312635b 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatWidthExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/IllegalFormatWidthExceptionTest.java
@@ -26,7 +26,7 @@
 public class IllegalFormatWidthExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.IllegalFormatWidthException#IllegalFormatWidthException(int)
+     * java.util.IllegalFormatWidthException#IllegalFormatWidthException(int)
      */
     public void test_illegalFormatWidthException() {
         int width = Integer.MAX_VALUE;
@@ -37,7 +37,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatWidthException#getWidth()
+     * java.util.IllegalFormatWidthException#getWidth()
      */
     public void test_getWidth() {
         int width = 12345;
@@ -48,7 +48,7 @@
     }
 
     /**
-     * @tests java.util.IllegalFormatWidthException#getMessage()
+     * java.util.IllegalFormatWidthException#getMessage()
      */
     public void test_getMessage() {
         int width = 12345;
@@ -74,7 +74,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -83,7 +83,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java
index 08687fb..fb8fc0d 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InputMismatchExceptionTest.java
@@ -28,7 +28,7 @@
     private static final String ERROR_MESSAGE = "for serialization test";
 
     /**
-     * @tests java.util.InputMismatchException#InputMismatchException()
+     * java.util.InputMismatchException#InputMismatchException()
      */
     @SuppressWarnings("cast")
     public void test_Constructor() {
@@ -39,7 +39,7 @@
     }
 
     /**
-     * @tests java.util.InputMismatchException#InputMismatchException(String)
+     * java.util.InputMismatchException#InputMismatchException(String)
      */
     public void test_ConstructorLjava_lang_String() {
         InputMismatchException exception = new InputMismatchException(
@@ -49,7 +49,7 @@
     }
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -57,7 +57,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InvalidPropertiesFormatExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InvalidPropertiesFormatExceptionTest.java
index e00ac0e..8b7bfce 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InvalidPropertiesFormatExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/InvalidPropertiesFormatExceptionTest.java
@@ -24,7 +24,7 @@
         junit.framework.TestCase {
 
     /**
-     * @tests java.util.InvalidPropertiesFormatException#SerializationTest()
+     * java.util.InvalidPropertiesFormatException#SerializationTest()
      */
     public void test_Serialization() throws Exception {
         InvalidPropertiesFormatException ipfe = new InvalidPropertiesFormatException(
@@ -37,7 +37,7 @@
     }
 
     /**
-     * @tests {@link java.util.InvalidPropertiesFormatException#InvalidPropertiesFormatException(Throwable)}
+     * {@link java.util.InvalidPropertiesFormatException#InvalidPropertiesFormatException(Throwable)}
      */
     public void test_Constructor_Ljava_lang_Throwable() {
         Throwable throwable = new Throwable();
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LinkedHashMapTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LinkedHashMapTest.java
index 3bbe7cf..37f21da 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LinkedHashMapTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/LinkedHashMapTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -37,9 +32,8 @@
 import tests.support.Support_UnmodifiableCollectionTest;
 
 /**
- * @tests java.util.LinkedHashMap
+ * java.util.LinkedHashMap
  */
-@TestTargetClass(LinkedHashMap.class)
 public class LinkedHashMapTest extends junit.framework.TestCase {
 
     LinkedHashMap hm;
@@ -77,14 +71,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap()
+     * java.util.LinkedHashMap#LinkedHashMap()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashMap",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.LinkedHashMap()
         new Support_MapTest2(new LinkedHashMap()).runTest();
@@ -94,14 +82,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap(int)
+     * java.util.LinkedHashMap#LinkedHashMap(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashMap",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.LinkedHashMap(int)
         LinkedHashMap hm2 = new LinkedHashMap(5);
@@ -120,14 +102,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap(int, float)
+     * java.util.LinkedHashMap#LinkedHashMap(int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashMap",
-        args = {int.class, float.class}
-    )
     public void test_ConstructorIF() {
         // Test for method java.util.LinkedHashMap(int, float)
         LinkedHashMap hm2 = new LinkedHashMap(5, (float) 0.5);
@@ -146,14 +122,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap(java.util.Map)
+     * java.util.LinkedHashMap#LinkedHashMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashMap",
-        args = {java.util.Map.class}
-    )
     public void test_ConstructorLjava_util_Map() {
         // Test for method java.util.LinkedHashMap(java.util.Map)
         Map myMap = new TreeMap();
@@ -173,14 +143,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#get(java.lang.Object)
+     * java.util.LinkedHashMap#get(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_getLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.LinkedHashMap.get(java.lang.Object)
@@ -198,14 +162,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#put(java.lang.Object, java.lang.Object)
+     * java.util.LinkedHashMap#put(java.lang.Object, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.LinkedHashMap.put(java.lang.Object, java.lang.Object)
@@ -224,14 +182,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#putAll(java.util.Map)
+     * java.util.LinkedHashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies only positive functionality.",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map() {
         // Test for method void java.util.LinkedHashMap.putAll(java.util.Map)
         LinkedHashMap hm2 = new LinkedHashMap();
@@ -242,14 +194,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#putAll(java.util.Map)
+     * java.util.LinkedHashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAll_Ljava_util_Map_Null() {
         LinkedHashMap linkedHashMap = new LinkedHashMap();
         try {
@@ -268,14 +214,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#entrySet()
+     * java.util.LinkedHashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySet() {
         // Test for method java.util.Set java.util.LinkedHashMap.entrySet()
         Set s = hm.entrySet();
@@ -290,14 +230,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#keySet()
+     * java.util.LinkedHashMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         // Test for method java.util.Set java.util.LinkedHashMap.keySet()
         Set s = hm.keySet();
@@ -349,14 +283,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#values()
+     * java.util.LinkedHashMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         // Test for method java.util.Collection java.util.LinkedHashMap.values()
         Collection c = hm.values();
@@ -381,14 +309,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#remove(java.lang.Object)
+     * java.util.LinkedHashMap#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.LinkedHashMap.remove(java.lang.Object)
@@ -409,14 +331,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#clear()
+     * java.util.LinkedHashMap#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.LinkedHashMap.clear()
         hm.clear();
@@ -428,14 +344,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#clone()
+     * java.util.LinkedHashMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.LinkedHashMap.clone()
         LinkedHashMap hm2 = (LinkedHashMap) hm.clone();
@@ -470,14 +380,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#containsKey(java.lang.Object)
+     * java.util.LinkedHashMap#containsKey(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKeyLjava_lang_Object() {
         // Test for method boolean
         // java.util.LinkedHashMap.containsKey(java.lang.Object)
@@ -493,14 +397,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#containsValue(java.lang.Object)
+     * java.util.LinkedHashMap#containsValue(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     public void test_containsValueLjava_lang_Object() {
         // Test for method boolean
         // java.util.LinkedHashMap.containsValue(java.lang.Object)
@@ -511,14 +409,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#isEmpty()
+     * java.util.LinkedHashMap#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.LinkedHashMap.isEmpty()
         assertTrue("Returned false for new map", new LinkedHashMap().isEmpty());
@@ -526,14 +418,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#size()
+     * java.util.LinkedHashMap#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.LinkedHashMap.size()
         assertTrue("Returned incorrect size",
@@ -541,14 +427,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#entrySet()
+     * java.util.LinkedHashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_ordered_entrySet() {
         int i;
         int sz = 100;
@@ -609,14 +489,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#keySet()
+     * java.util.LinkedHashMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_ordered_keySet() {
         int i;
         int sz = 100;
@@ -671,14 +545,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#values()
+     * java.util.LinkedHashMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_ordered_values() {
         int i;
         int sz = 100;
@@ -733,14 +601,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#removeEldestEntry(java.util.Map$Entry)
+     * java.util.LinkedHashMap#removeEldestEntry(java.util.Map$Entry)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify null as a parameter.",
-        method = "removeEldestEntry",
-        args = {java.util.Map.Entry.class}
-    )
     public void test_remove_eldest() {
         int i;
         int sz = 10;
@@ -760,20 +622,6 @@
         assertTrue("Entries left in map", !it1.hasNext());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "LinkedHashMap",
-            args = {int.class, float.class, boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "put",
-            args = {java.lang.Object.class, java.lang.Object.class}
-        )
-    })
     // BEGIN android-added
     public void testLinkedHashMap() {
         // we want to test the LinkedHashMap in access ordering mode.
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ListIteratorTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ListIteratorTest.java
index d84034f..3a1ca8d 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ListIteratorTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ListIteratorTest.java
@@ -16,18 +16,12 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.util.LinkedList;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
 
-@TestTargetClass(ListIterator.class)
 public class ListIteratorTest extends TestCase {
 
     ListIterator<Integer> l = null;
@@ -39,12 +33,6 @@
             objArray[i] = new Integer(i);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hasNext",
-        args = {}
-    )
     public void testHasNext() {
         for (int i = 0; i < objArray.length; i++) {
             assertTrue(l.hasNext());
@@ -53,12 +41,6 @@
         assertFalse(l.hasNext());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "next",
-        args = {}
-    )
     public void testNext() {
         for (int i = 0; i < objArray.length; i++) {
             assertTrue(objArray[i].equals(l.next()));
@@ -114,12 +96,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {}
-    )
     public void testRemove() {
         try {
             l.remove();
@@ -149,12 +125,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hasPrevious",
-        args = {}
-    )
     public void testHasPrevious() {
         assertFalse(l.hasPrevious());
         for (int i = 0; i < objArray.length; i++) {
@@ -163,12 +133,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "previous",
-        args = {}
-    )
     public void testPrevious() {
         try {
             l.previous();
@@ -192,12 +156,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextIndex",
-        args = {}
-    )
     public void testNextIndex() {
         for (int i = 0; i < objArray.length; i++) {
             assertTrue(objArray[i].equals(l.nextIndex()));
@@ -205,12 +163,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "previousIndex",
-        args = {}
-    )
     public void testPreviousIndex() {
         for (int i = 0; i < objArray.length; i++) {
             assertTrue(objArray[i].equals(l.previousIndex() + 1));
@@ -218,12 +170,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {java.lang.Object.class}
-    )
     public void testSet() {
         try {
             l.set(new Integer(1));
@@ -269,12 +215,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void testAdd() {
         l.add(new Integer(33));
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MapEntryTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MapEntryTest.java
index 42498e2..c3e7a9c 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MapEntryTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MapEntryTest.java
@@ -16,11 +16,6 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.util.Collection;
@@ -29,18 +24,11 @@
 import java.util.Map;
 import java.util.Set;
 
-@TestTargetClass(Map.Entry.class)
 public class MapEntryTest extends TestCase {
     Map.Entry me = null;
     HashMap   hm = null;
     Iterator  i  = null;
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKey",
-        args = {}
-    )
     public void testGetKey() {
         assertTrue(hm.containsKey(me.getKey()));
         hm.clear();
@@ -52,12 +40,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getValue",
-        args = {}
-    )
     public void testGetValue() {
         assertTrue(hm.containsValue(me.getValue()));
         hm.clear();
@@ -83,12 +65,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "RI does not throw following exceptions: UnsupportedOperationException,ClassCastException, IllegalArgumentException and NullPointerException",
-        method = "setValue",
-        args = {java.lang.Object.class}
-    )
     public void testSetValue() {
         Mock_HashMap mhm = new Mock_HashMap();
 
@@ -109,12 +85,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         Map.Entry me1 = (Map.Entry)i.next();
         assertFalse(me.equals(me1));
@@ -123,12 +93,6 @@
         assertTrue(me.equals(me1));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         Map.Entry me1 = (Map.Entry)i.next();
         assertTrue(me.hashCode() != me1.hashCode());
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatArgumentExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatArgumentExceptionTest.java
index e84c619..3334fed 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatArgumentExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatArgumentExceptionTest.java
@@ -27,7 +27,7 @@
 public class MissingFormatArgumentExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.MissingFormatArgumentException#MissingFormatArgumentException(String)
+     * java.util.MissingFormatArgumentException#MissingFormatArgumentException(String)
      */
     public void test_missingFormatArgumentException() {
 
@@ -40,7 +40,7 @@
     }
 
     /**
-     * @tests java.util.MissingFormatArgumentException#getFormatSpecifier()
+     * java.util.MissingFormatArgumentException#getFormatSpecifier()
      */
     public void test_getFormatSpecifier() {
         String s = "MYTESTSTRING";
@@ -50,7 +50,7 @@
     }
 
     /**
-     * @tests java.util.MissingFormatArgumentException#getMessage()
+     * java.util.MissingFormatArgumentException#getMessage()
      */
     public void test_getMessage() {
         String s = "MYTESTSTRING";
@@ -77,7 +77,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -86,7 +86,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatWidthExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatWidthExceptionTest.java
index 33472a4..38c3bdb 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatWidthExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/MissingFormatWidthExceptionTest.java
@@ -26,7 +26,7 @@
 public class MissingFormatWidthExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.MissingFormatWidthException#MissingFormatWidthException(String)
+     * java.util.MissingFormatWidthException#MissingFormatWidthException(String)
      */
     public void test_missingFormatWidthException() {
         try {
@@ -38,7 +38,7 @@
     }
 
     /**
-     * @tests java.util.MissingFormatWidthException#getFormatSpecifier()
+     * java.util.MissingFormatWidthException#getFormatSpecifier()
      */
     public void test_getFormatSpecifier() {
         String s = "MYTESTSTRING";
@@ -49,7 +49,7 @@
     }
 
     /**
-     * @tests java.util.MissingFormatWidthException#getMessage()
+     * java.util.MissingFormatWidthException#getMessage()
      */
     public void test_getMessage() {
         String s = "MYTESTSTRING";
@@ -76,7 +76,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -85,7 +85,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ObserverTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ObserverTest.java
index cb36136..acba163 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ObserverTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/ObserverTest.java
@@ -16,17 +16,11 @@
 
 package org.apache.harmony.luni.tests.java.util;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.util.Observable;
 import java.util.Observer;
 
-@TestTargetClass(Observer.class)
 public class ObserverTest extends TestCase {
 
     class Mock_Observer implements Observer {
@@ -51,12 +45,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "update",
-        args = {java.util.Observable.class, java.lang.Object.class}
-    )
     public void testUpdate() {
         TestObservable observable = new TestObservable();
         Mock_Observer observer = null;
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UUIDTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UUIDTest.java
index 3216bd9..e70cd78 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UUIDTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UUIDTest.java
@@ -247,7 +247,7 @@
     }
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
         SerializationTest.verifySelf(new UUID(0xf81d4fae7dec11d0L,
@@ -255,7 +255,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
         SerializationTest.verifyGolden(this, new UUID(0xf81d4fae7dec11d0L,
@@ -357,7 +357,7 @@
     }
 
 	/**
-	 * @tests java.util.UUID#fromString(String)
+	 * java.util.UUID#fromString(String)
 	 */
 	public void test_fromString_LString_Exception() {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UnknownFormatFlagsExceptionTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UnknownFormatFlagsExceptionTest.java
index 1073326..01e02be 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UnknownFormatFlagsExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/UnknownFormatFlagsExceptionTest.java
@@ -27,7 +27,7 @@
 public class UnknownFormatFlagsExceptionTest extends TestCase {
 
     /**
-     * @tests java.util.UnknownFormatFlagsException#UnknownFormatFlagsException(String)
+     * java.util.UnknownFormatFlagsException#UnknownFormatFlagsException(String)
      */
     public void test_unknownFormatFlagsException() {
 
@@ -40,7 +40,7 @@
     }
 
     /**
-     * @tests java.util.UnknownFormatFlagsException#getFlags()
+     * java.util.UnknownFormatFlagsException#getFlags()
      */
     public void test_getFlags() {
         String s = "MYTESTSTRING";
@@ -50,7 +50,7 @@
     }
 
     /**
-     * @tests java.util.UnknownFormatFlagsException#getMessage()
+     * java.util.UnknownFormatFlagsException#getMessage()
      */
     public void test_getMessage() {
         String s = "MYTESTSTRING";
@@ -75,7 +75,7 @@
     };
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
 
@@ -84,7 +84,7 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
     public void testSerializationCompatibility() throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/VectorTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/VectorTest.java
index e330310..928c5a9 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/VectorTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/VectorTest.java
@@ -37,7 +37,7 @@
 	private String vString = "[Test 0, Test 1, Test 2, Test 3, Test 4, Test 5, Test 6, Test 7, Test 8, Test 9, Test 10, Test 11, Test 12, Test 13, Test 14, Test 15, Test 16, Test 17, Test 18, Test 19, Test 20, Test 21, Test 22, Test 23, Test 24, Test 25, Test 26, Test 27, Test 28, Test 29, Test 30, Test 31, Test 32, Test 33, Test 34, Test 35, Test 36, Test 37, Test 38, Test 39, Test 40, Test 41, Test 42, Test 43, Test 44, Test 45, Test 46, Test 47, Test 48, Test 49, Test 50, Test 51, Test 52, Test 53, Test 54, Test 55, Test 56, Test 57, Test 58, Test 59, Test 60, Test 61, Test 62, Test 63, Test 64, Test 65, Test 66, Test 67, Test 68, Test 69, Test 70, Test 71, Test 72, Test 73, Test 74, Test 75, Test 76, Test 77, Test 78, Test 79, Test 80, Test 81, Test 82, Test 83, Test 84, Test 85, Test 86, Test 87, Test 88, Test 89, Test 90, Test 91, Test 92, Test 93, Test 94, Test 95, Test 96, Test 97, Test 98, Test 99]";
 
 	/**
-	 * @tests java.util.Vector#Vector()
+	 * java.util.Vector#Vector()
 	 */
 	public void test_Constructor() {
 		// Test for method java.util.Vector()
@@ -58,7 +58,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#Vector(int)
+	 * java.util.Vector#Vector(int)
 	 */
 	public void test_ConstructorI() {
 		// Test for method java.util.Vector(int)
@@ -69,7 +69,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#Vector(int, int)
+	 * java.util.Vector#Vector(int, int)
 	 */
 	public void test_ConstructorII() {
 		// Test for method java.util.Vector(int, int)
@@ -106,7 +106,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#Vector(java.util.Collection)
+	 * java.util.Vector#Vector(java.util.Collection)
 	 */
 	public void test_ConstructorLjava_util_Collection() {
 		// Test for method java.util.Vector(java.util.Collection)
@@ -122,7 +122,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#add(int, java.lang.Object)
+	 * java.util.Vector#add(int, java.lang.Object)
 	 */
 	public void test_addILjava_lang_Object() {
 		// Test for method void java.util.Vector.add(int, java.lang.Object)
@@ -142,7 +142,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#add(java.lang.Object)
+	 * java.util.Vector#add(java.lang.Object)
 	 */
 	public void test_addLjava_lang_Object() {
 		// Test for method boolean java.util.Vector.add(java.lang.Object)
@@ -157,7 +157,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#addAll(int, java.util.Collection)
+	 * java.util.Vector#addAll(int, java.util.Collection)
 	 */
 	public void test_addAllILjava_util_Collection() {
 		// Test for method boolean java.util.Vector.addAll(int,
@@ -209,7 +209,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#addAll(java.util.Collection)
+	 * java.util.Vector#addAll(java.util.Collection)
 	 */
 	public void test_addAllLjava_util_Collection() {
 		// Test for method boolean java.util.Vector.addAll(java.util.Collection)
@@ -247,7 +247,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#addElement(java.lang.Object)
+	 * java.util.Vector#addElement(java.lang.Object)
 	 */
 	public void test_addElementLjava_lang_Object() {
 		// Test for method void java.util.Vector.addElement(java.lang.Object)
@@ -262,7 +262,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#addElement(java.lang.Object)
+	 * java.util.Vector#addElement(java.lang.Object)
 	 */
 	public void test_addElementLjava_lang_Object_subtest0() {
 		// Test for method void java.util.Vector.addElement(java.lang.Object)
@@ -277,7 +277,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#capacity()
+	 * java.util.Vector#capacity()
 	 */
 	public void test_capacity() {
 		// Test for method int java.util.Vector.capacity()
@@ -287,7 +287,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#clear()
+	 * java.util.Vector#clear()
 	 */
 	public void test_clear() {
 		// Test for method void java.util.Vector.clear()
@@ -309,7 +309,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#clone()
+	 * java.util.Vector#clone()
 	 */
 	public void test_clone() {
 		// Test for method java.lang.Object java.util.Vector.clone()
@@ -329,7 +329,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#contains(java.lang.Object)
+	 * java.util.Vector#contains(java.lang.Object)
 	 */
 	public void test_containsLjava_lang_Object() {
 		// Test for method boolean java.util.Vector.contains(java.lang.Object)
@@ -345,7 +345,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#containsAll(java.util.Collection)
+	 * java.util.Vector#containsAll(java.util.Collection)
 	 */
 	public void test_containsAllLjava_util_Collection() {
 		// Test for method boolean
@@ -369,7 +369,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#copyInto(java.lang.Object[])
+	 * java.util.Vector#copyInto(java.lang.Object[])
 	 */
 	public void test_copyInto$Ljava_lang_Object() {
 		// Test for method void java.util.Vector.copyInto(java.lang.Object [])
@@ -383,7 +383,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#elementAt(int)
+	 * java.util.Vector#elementAt(int)
 	 */
 	public void test_elementAtI() {
 		// Test for method java.lang.Object java.util.Vector.elementAt(int)
@@ -396,7 +396,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#elements()
+	 * java.util.Vector#elements()
 	 */
 	public void test_elements() {
 		// Test for method java.util.Enumeration java.util.Vector.elements()
@@ -412,7 +412,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#elements()
+	 * java.util.Vector#elements()
 	 */
 	public void test_elements_subtest0() {
 		final int iterations = 10000;
@@ -443,7 +443,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#ensureCapacity(int)
+	 * java.util.Vector#ensureCapacity(int)
 	 */
 	public void test_ensureCapacityI() {
 		// Test for method void java.util.Vector.ensureCapacity(int)
@@ -484,7 +484,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#equals(java.lang.Object)
+	 * java.util.Vector#equals(java.lang.Object)
 	 */
 	public void test_equalsLjava_lang_Object() {
 		// Test for method boolean java.util.Vector.equals(java.lang.Object)
@@ -505,7 +505,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#firstElement()
+	 * java.util.Vector#firstElement()
 	 */
 	public void test_firstElement() {
 		// Test for method java.lang.Object java.util.Vector.firstElement()
@@ -525,7 +525,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#get(int)
+	 * java.util.Vector#get(int)
 	 */
 	public void test_getI() {
 		// Test for method java.lang.Object java.util.Vector.get(int)
@@ -537,7 +537,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#hashCode()
+	 * java.util.Vector#hashCode()
 	 */
 	public void test_hashCode() {
 		// Test for method int java.util.Vector.hashCode()
@@ -552,7 +552,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#indexOf(java.lang.Object)
+	 * java.util.Vector#indexOf(java.lang.Object)
 	 */
 	public void test_indexOfLjava_lang_Object() {
 		// Test for method int java.util.Vector.indexOf(java.lang.Object)
@@ -566,7 +566,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#indexOf(java.lang.Object, int)
+	 * java.util.Vector#indexOf(java.lang.Object, int)
 	 */
 	public void test_indexOfLjava_lang_ObjectI() {
 		// Test for method int java.util.Vector.indexOf(java.lang.Object, int)
@@ -600,7 +600,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#insertElementAt(java.lang.Object, int)
+	 * java.util.Vector#insertElementAt(java.lang.Object, int)
 	 */
 	public void test_insertElementAtLjava_lang_ObjectI() {
 		// Test for method void
@@ -645,7 +645,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#isEmpty()
+	 * java.util.Vector#isEmpty()
 	 */
 	public void test_isEmpty() {
 		// Test for method boolean java.util.Vector.isEmpty()Vector
@@ -656,7 +656,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#isEmpty()
+	 * java.util.Vector#isEmpty()
 	 */
 	public void test_isEmpty_subtest0() {
 		final Vector v = new Vector();
@@ -687,7 +687,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#lastElement()
+	 * java.util.Vector#lastElement()
 	 */
 	public void test_lastElement() {
 		// Test for method java.lang.Object java.util.Vector.lastElement()
@@ -707,7 +707,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#lastIndexOf(java.lang.Object)
+	 * java.util.Vector#lastIndexOf(java.lang.Object)
 	 */
 	public void test_lastIndexOfLjava_lang_Object() {
 		// Test for method int java.util.Vector.lastIndexOf(java.lang.Object)
@@ -723,7 +723,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#lastIndexOf(java.lang.Object, int)
+	 * java.util.Vector#lastIndexOf(java.lang.Object, int)
 	 */
 	public void test_lastIndexOfLjava_lang_ObjectI() {
 		// Test for method int java.util.Vector.lastIndexOf(java.lang.Object,
@@ -767,7 +767,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#remove(int)
+	 * java.util.Vector#remove(int)
 	 */
 	public void test_removeI() {
 		// Test for method java.lang.Object java.util.Vector.remove(int)
@@ -809,7 +809,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#remove(java.lang.Object)
+	 * java.util.Vector#remove(java.lang.Object)
 	 */
 	public void test_removeLjava_lang_Object() {
 		// Test for method boolean java.util.Vector.remove(java.lang.Object)
@@ -826,7 +826,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#removeAll(java.util.Collection)
+	 * java.util.Vector#removeAll(java.util.Collection)
 	 */
 	public void test_removeAllLjava_util_Collection() {
 		// Test for method boolean
@@ -858,7 +858,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#removeAllElements()
+	 * java.util.Vector#removeAllElements()
 	 */
 	public void test_removeAllElements() {
 		// Test for method void java.util.Vector.removeAllElements()
@@ -868,7 +868,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#removeElement(java.lang.Object)
+	 * java.util.Vector#removeElement(java.lang.Object)
 	 */
 	public void test_removeElementLjava_lang_Object() {
 		// Test for method boolean
@@ -886,7 +886,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#removeElementAt(int)
+	 * java.util.Vector#removeElementAt(int)
 	 */
 	public void test_removeElementAtI() {
 		// Test for method void java.util.Vector.removeElementAt(int)
@@ -921,7 +921,7 @@
 	}
 
     /**
-     * @tests {@link java.util.Vector#removeRange(int, int)}
+     * {@link java.util.Vector#removeRange(int, int)}
      */
     public void test_removeRange() {
         MockVector myVector = new MockVector();
@@ -973,7 +973,7 @@
     }
 
 	/**
-	 * @tests java.util.Vector#retainAll(java.util.Collection)
+	 * java.util.Vector#retainAll(java.util.Collection)
 	 */
 	public void test_retainAllLjava_util_Collection() {
 		// Test for method boolean
@@ -989,7 +989,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#set(int, java.lang.Object)
+	 * java.util.Vector#set(int, java.lang.Object)
 	 */
 	public void test_setILjava_lang_Object() {
 		// Test for method java.lang.Object java.util.Vector.set(int,
@@ -1039,7 +1039,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#setElementAt(java.lang.Object, int)
+	 * java.util.Vector#setElementAt(java.lang.Object, int)
 	 */
 	public void test_setElementAtLjava_lang_ObjectI() {
 		// Test for method void java.util.Vector.setElementAt(java.lang.Object,
@@ -1082,7 +1082,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#setSize(int)
+	 * java.util.Vector#setSize(int)
 	 */
 	public void test_setSizeI() {
 		// Test for method void java.util.Vector.setSize(int)
@@ -1116,7 +1116,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#size()
+	 * java.util.Vector#size()
 	 */
 	public void test_size() {
 		// Test for method int java.util.Vector.size()
@@ -1150,7 +1150,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#subList(int, int)
+	 * java.util.Vector#subList(int, int)
 	 */
 	public void test_subListII() {
 		// Test for method java.util.List java.util.Vector.subList(int, int)
@@ -1166,7 +1166,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#toArray()
+	 * java.util.Vector#toArray()
 	 */
 	public void test_toArray() {
 		// Test for method java.lang.Object [] java.util.Vector.toArray()
@@ -1175,7 +1175,7 @@
 	}
 
 	/**
-	 * @tests java.util.Vector#toArray(java.lang.Object[])
+	 * java.util.Vector#toArray(java.lang.Object[])
 	 */
 	public void test_toArray$Ljava_lang_Object() {
 		// Test for method java.lang.Object []
@@ -1209,10 +1209,6 @@
             super.add(obj);
         }
 
-        /**
-         * @tests java.util.Vector#add(Object)
-         */
-        @SuppressWarnings("nls")
         public void test_add() {
             SubVector<String> subvector = new SubVector<String>();
             subvector.add("foo");
@@ -1223,7 +1219,7 @@
     }
 
     /**
-     * @tests java.util.Vector#toString()
+     * java.util.Vector#toString()
      */
     public void test_toString() {
         // Ensure toString works with self-referencing elements.
@@ -1264,7 +1260,7 @@
     }
 
 	/**
-	 * @tests java.util.Vector#trimToSize()
+	 * java.util.Vector#trimToSize()
 	 */
 	public void test_trimToSize() {
 		// Test for method void java.util.Vector.trimToSize()
diff --git a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/WeakHashMapTest.java b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/WeakHashMapTest.java
index 433adf2..c17e7a5 100644
--- a/luni/src/test/java/org/apache/harmony/luni/tests/java/util/WeakHashMapTest.java
+++ b/luni/src/test/java/org/apache/harmony/luni/tests/java/util/WeakHashMapTest.java
@@ -49,7 +49,7 @@
     Object[] VALUE_ARRAY;
 
 	/**
-	 * @tests java.util.WeakHashMap#WeakHashMap()
+	 * java.util.WeakHashMap#WeakHashMap()
 	 */
 	public void test_Constructor() {
 		// Test for method java.util.WeakHashMap()
@@ -65,7 +65,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#WeakHashMap(int)
+	 * java.util.WeakHashMap#WeakHashMap(int)
 	 */
 	public void test_ConstructorI() {
 		// Test for method java.util.WeakHashMap(int)
@@ -83,7 +83,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#WeakHashMap(int, float)
+	 * java.util.WeakHashMap#WeakHashMap(int, float)
 	 */
 	public void test_ConstructorIF() {
 		// Test for method java.util.WeakHashMap(int, float)
@@ -101,7 +101,7 @@
 	}
 	
 	/**
-	 * @tests java.util.WeakHashMap#WeakHashMap(java.util.Map)
+	 * java.util.WeakHashMap#WeakHashMap(java.util.Map)
 	 */
 	public void test_ConstructorLjava_util_Map() {
         Map mockMap = new MockMap();
@@ -110,7 +110,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#clear()
+	 * java.util.WeakHashMap#clear()
 	 */
 	public void test_clear() {
 		// Test for method boolean java.util.WeakHashMap.clear()
@@ -126,7 +126,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#containsKey(java.lang.Object)
+	 * java.util.WeakHashMap#containsKey(java.lang.Object)
 	 */
 	public void test_containsKeyLjava_lang_Object() {
 		// Test for method boolean java.util.WeakHashMap.containsKey()
@@ -141,7 +141,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#containsValue(java.lang.Object)
+	 * java.util.WeakHashMap#containsValue(java.lang.Object)
 	 */
 	public void test_containsValueLjava_lang_Object() {
 		// Test for method boolean java.util.WeakHashMap.containsValue()
@@ -156,7 +156,7 @@
 	}
 
     /**
-     * @tests java.util.WeakHashMap#entrySet()
+     * java.util.WeakHashMap#entrySet()
      */
     public void test_entrySet() {
         WeakHashMap<Object, Object> weakMap = new WeakHashMap<Object, Object>();
@@ -245,7 +245,7 @@
     }
 
 	/**
-	 * @tests java.util.WeakHashMap#entrySet()
+	 * java.util.WeakHashMap#entrySet()
 	 */
 	public void test_entrySet_2() {
 		// Test for method java.util.Set java.util.WeakHashMap.entrySet()
@@ -283,7 +283,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#get(java.lang.Object)
+	 * java.util.WeakHashMap#get(java.lang.Object)
 	 */
 	public void test_getLjava_lang_Object() {
 		// Test for method java.lang.Object
@@ -292,7 +292,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#isEmpty()
+	 * java.util.WeakHashMap#isEmpty()
 	 */
 	public void test_isEmpty() {
 		// Test for method boolean java.util.WeakHashMap.isEmpty()
@@ -306,7 +306,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#put(java.lang.Object, java.lang.Object)
+	 * java.util.WeakHashMap#put(java.lang.Object, java.lang.Object)
 	 */
 	public void test_putLjava_lang_ObjectLjava_lang_Object() {
 		// Test for method java.lang.Object
@@ -320,7 +320,7 @@
 	}
 
     /**
-     * @tests java.util.WeakHashMap#putAll(java.util.Map)
+     * java.util.WeakHashMap#putAll(java.util.Map)
      */
     public void test_putAllLjava_util_Map() {
         Map mockMap=new MockMap();
@@ -330,7 +330,7 @@
     }
 
 	/**
-	 * @tests java.util.WeakHashMap#remove(java.lang.Object)
+	 * java.util.WeakHashMap#remove(java.lang.Object)
 	 */
 	public void test_removeLjava_lang_Object() {
 		// Test for method java.lang.Object
@@ -347,7 +347,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#size()
+	 * java.util.WeakHashMap#size()
 	 */
 	public void test_size() {
 		// Test for method int java.util.WeakHashMap.size()
@@ -355,7 +355,7 @@
 	}
 
 	/**
-	 * @tests java.util.WeakHashMap#keySet()
+	 * java.util.WeakHashMap#keySet()
 	 */
 	public void test_keySet() {
 		// Test for method java.util.Set java.util.WeakHashMap.keySet()
@@ -392,7 +392,7 @@
 
     /**
      * Regression test for HARMONY-3883
-     * @tests java.util.WeakHashMap#keySet()
+     * java.util.WeakHashMap#keySet()
      */
     public void test_keySet_hasNext() {
         WeakHashMap map = new WeakHashMap();
@@ -425,7 +425,7 @@
 
 
 	/**
-	 * @tests java.util.WeakHashMap#values()
+	 * java.util.WeakHashMap#values()
 	 */
 	public void test_values() {
 		// Test for method java.util.Set java.util.WeakHashMap.values()
diff --git a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/spi/SelectorProviderTest.java b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/spi/SelectorProviderTest.java
index 138ac68..71edf82 100644
--- a/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/spi/SelectorProviderTest.java
+++ b/luni/src/test/java/org/apache/harmony/nio/tests/java/nio/channels/spi/SelectorProviderTest.java
@@ -16,74 +16,19 @@
 
 package org.apache.harmony.nio.tests.java.nio.channels.spi;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.nio.channels.spi.SelectorProvider;
 
 import junit.framework.TestCase;
-@TestTargetClass(SelectorProvider.class)
+
 public class SelectorProviderTest extends TestCase {
 
     /**
-     * @tests SelectorProvider#openDatagramChannel()
-     * @tests SelectorProvider#openPipe()
-     * @tests SelectorProvider#openServerSocketChannel()
-     * @tests SelectorProvider#openSocketChannel()
-     * @tests SelectorProvider#openSelector()
+     * SelectorProvider#openDatagramChannel()
+     * SelectorProvider#openPipe()
+     * SelectorProvider#openServerSocketChannel()
+     * SelectorProvider#openSocketChannel()
+     * SelectorProvider#openSelector()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "SelectorProvider",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "provider",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "inheritedChannel",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "openDatagramChannel",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "openPipe",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "openServerSocketChannel",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "openSocketChannel",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "openSelector",
-            args = {}
-        )
-    })
     public void test_open_methods() throws Exception {
         // calling #provider to see if it returns without Exception.
         assertNotNull(SelectorProvider.provider());
@@ -97,4 +42,4 @@
         assertNotNull(SelectorProvider.provider().openSocketChannel());
         assertNotNull(SelectorProvider.provider().openSelector());
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/AllTests.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/AllTests.java
deleted file mode 100644
index 80bebd4..0000000
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/AllTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package org.apache.harmony.regex.tests.java.util.regex;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Provides a test suite for java.util.regex package.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.util.regex");
-        //$JUnit-BEGIN$
-
-        suite.addTestSuite(Matcher2Test.class);
-        suite.addTestSuite(ModeTest.class);
-        suite.addTestSuite(Pattern2Test.class);
-        suite.addTestSuite(PatternErrorTest.class);
-        suite.addTestSuite(PatternSyntaxExceptionTest.class);
-        suite.addTestSuite(PatternTest.class);
-        suite.addTestSuite(ReplaceTest.class);
-        suite.addTestSuite(SplitTest.class);
-
-        //$JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Matcher2Test.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Matcher2Test.java
index 47e3500..0a64dce 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Matcher2Test.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Matcher2Test.java
@@ -16,11 +16,6 @@
 
 package org.apache.harmony.regex.tests.java.util.regex;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-
 import junit.framework.TestCase;
 import java.util.regex.*;
 
@@ -28,65 +23,14 @@
  * Tests Matcher methods
  *
  */
-@TestTargetClass(java.util.regex.Matcher.class)
 public class Matcher2Test extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies the basic functionality of toString() method.",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         Pattern p = Pattern.compile("foo");
         Matcher m = p.matcher("bar");
         assertNotNull(m.toString());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies start, end, group, usePattern methods with wrong conditions, IllegalStateException should be thrown",
-            method = "start",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies start, end, group, usePattern methods with wrong conditions, IllegalStateException should be thrown",
-            method = "end",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies start, end, group, usePattern methods with wrong conditions, IllegalStateException should be thrown",
-            method = "group",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies start, end, group, usePattern methods with wrong conditions, IllegalStateException should be thrown",
-            method = "start",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies start, end, group, usePattern methods with wrong conditions, IllegalStateException should be thrown",
-            method = "end",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies start, end, group, usePattern methods with wrong conditions, IllegalStateException should be thrown",
-            method = "group",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies start, end, group, usePattern methods with wrong conditions, IllegalStateException should be thrown",
-            method = "usePattern",
-            args = {java.util.regex.Pattern.class}
-        )
-    })
     public void testErrorConditions() throws PatternSyntaxException {
         // Test match cursors in absence of a match
         Pattern p = Pattern.compile("foo");
@@ -138,38 +82,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies end, start, group methods with wrong conditions, IndexOutOfBoundsException, IllegalStateException should be thrown",
-            method = "start",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies end, start, group methods with wrong conditions, IndexOutOfBoundsException, IllegalStateException should be thrown",
-            method = "end",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies end, start, group methods with wrong conditions, IndexOutOfBoundsException, IllegalStateException should be thrown",
-            method = "start",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies end, start, group methods with wrong conditions, IndexOutOfBoundsException, IllegalStateException should be thrown",
-            method = "end",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies end, start, group methods with wrong conditions, IndexOutOfBoundsException, IllegalStateException should be thrown",
-            method = "group",
-            args = {int.class}
-        )
-    })
     public void testErrorConditions2() throws PatternSyntaxException {
         // Test match cursors in absence of a match
         Pattern p = Pattern.compile("(foo[0-9])(bar[a-z])");
@@ -305,12 +217,6 @@
     /*
      * Regression test for HARMONY-997
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that IndexOutOfBoundsException exception is thrown while calling of replaceAll method with incorrect string.",
-        method = "replaceAll",
-        args = {java.lang.String.class}
-    )
     public void testReplacementBackSlash() {
         String str = "replace me";
         String replacedString = "me";
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ModeTest.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ModeTest.java
index a24e46c..569d3e6 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ModeTest.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ModeTest.java
@@ -16,11 +16,6 @@
 
 package org.apache.harmony.regex.tests.java.util.regex;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-
 import junit.framework.TestCase;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
@@ -30,23 +25,8 @@
  * Tests Pattern compilation modes and modes triggered in pattern strings
  *
  */
-@TestTargetClass(Pattern.class)
 public class ModeTest extends TestCase {
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies compile(String regex) and compile(String regex, int flags) methods with Pattern.CASE_INSENSITIVE mode.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies compile(String regex) and compile(String regex, int flags) methods with Pattern.CASE_INSENSITIVE mode.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        )
-    })
     public void testCase() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -75,20 +55,6 @@
         assertEquals("doG", m.group(1));
         assertFalse(m.find());
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies compile(String regex) and compile(String regex, int flags) methods with Pattern.MULTILINE mode.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies compile(String regex) and compile(String regex, int flags) methods with Pattern.MULTILINE mode.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        )
-    })
     public void testMultiline() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Pattern2Test.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Pattern2Test.java
index 48d918f..064a9c6 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Pattern2Test.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/Pattern2Test.java
@@ -16,30 +16,18 @@
 
 package org.apache.harmony.regex.tests.java.util.regex;
 
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 import java.util.regex.PatternSyntaxException;
 
 import junit.framework.TestCase;
-@TestTargetClass(Pattern.class)
+
 /**
  * Tests simple Pattern compilation and Matcher methods
  *
  */
 public class Pattern2Test extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies matches(String regex, CharSequence input) method.",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
     public void testSimpleMatch() throws PatternSyntaxException {
         Pattern p = Pattern.compile("foo.*");
 
@@ -60,20 +48,6 @@
 
         assertTrue(Pattern.matches("", ""));
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testCursors() {
         Pattern p;
         Matcher m;
@@ -128,20 +102,6 @@
             fail();
         }
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testGroups() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -195,20 +155,6 @@
         assertFalse(m.find());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testReplace() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -256,20 +202,6 @@
                 "I want <b> cheese </b>. <b> Please </b>."));
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testEscapes() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -466,20 +398,6 @@
 //        } catch (PatternSyntaxException e) {
 //        }
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies patterns with different ranges of characters.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies patterns with different ranges of characters.",
-            method = "matcher",
-            args = {CharSequence.class}
-        )
-    })
     public void testCharacterClasses() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -746,20 +664,6 @@
         // Test x|y pattern
         // TODO
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for patterns with POSIX characters.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for patterns with POSIX characters.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testPOSIXGroups() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -902,12 +806,6 @@
         // Test \p{Cntrl}
         // TODO
     }
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "",
-        method = "!",
-        args = {}
-    )
     public void testUnicodeCategories() throws PatternSyntaxException {
         // Test Unicode categories using \p and \P
         // One letter codes: L, M, N, P, S, Z, C
@@ -1008,12 +906,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies matcher(CharSequence input) method for input specified by Unicode blocks.",
-        method = "matcher",
-        args = {java.lang.CharSequence.class}
-    )
     public void testUnicodeBlocks() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -1083,12 +975,6 @@
 // END android-changed
         }
     }
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "these tests are still partial, see TODO in the code",
-        method = "!",
-        args = {}
-    )
     public void testCapturingGroups() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -1142,12 +1028,6 @@
         }
 
     }
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "",
-        method = "!",
-        args = {}
-    )
     public void testRepeats() {
         Pattern p;
         Matcher m;
@@ -1216,12 +1096,6 @@
         // Test {<n1>,<n2>}, with n1 < n2, n1 = n2 and n1 > n2 (illegal?)
         // TODO
     }
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "",
-        method = "!",
-        args = {}
-    )
     public void testAnchors() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -1268,20 +1142,6 @@
         // Test negative lookbehind using (?<!...)
         // TODO
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) method and matcher for created pattern.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testMisc() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -1341,24 +1201,12 @@
         // Test #<comment text>
         // TODO
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies compile(String regex) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testCompile1() throws PatternSyntaxException {
         Pattern pattern = Pattern
                 .compile("[0-9A-Za-z][0-9A-Za-z\\x2e\\x3a\\x2d\\x5f]*");
         String name = "iso-8859-1";
         assertTrue(pattern.matcher(name).matches());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies compile(String regex, int flag) method.",
-        method = "compile",
-        args = {java.lang.String.class, int.class}
-    )
     public void testCompile2() throws PatternSyntaxException {
         String findString = "\\Qimport\\E";
 
@@ -1368,20 +1216,6 @@
 
         assertTrue(matcher.find(0));
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) and compile(String regex, int flag) method for specific patterns.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) and compile(String regex, int flag) method for specific patterns.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        )
-    })
     public void testCompile3() throws PatternSyntaxException {
         Pattern p;
         Matcher m;
@@ -1463,12 +1297,6 @@
         assertTrue(m.group().equals(""));
         assertFalse(m.find());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies compile(String regex, int flag) method for specific string.",
-        method = "compile",
-        args = {java.lang.String.class, int.class}
-    )
     public void testCompile4() throws PatternSyntaxException {
         String findString = "\\Qpublic\\E";
         StringBuffer text = new StringBuffer("    public class Class {\n"
@@ -1490,12 +1318,6 @@
         found = matcher.find();
         assertFalse(found);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies compile(String regex) methodfor specific string.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testCompile5() throws PatternSyntaxException {
         Pattern p = Pattern.compile("^[0-9]");
         String s[] = p.split("12", -1);
@@ -1752,4 +1574,4 @@
             new UBInfo(0xFFF0, 0xFFFF, "Specials") // Character.UnicodeBlock.SPECIALS
 // END android-changed
     };
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternErrorTest.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternErrorTest.java
index a63f0de..fd2c3ae 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternErrorTest.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternErrorTest.java
@@ -16,34 +16,14 @@
 
 package org.apache.harmony.regex.tests.java.util.regex;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-
 import java.util.regex.Pattern;
 import junit.framework.TestCase;
 
-@TestTargetClass(Pattern.class)
 /**
  * Test boundary and error conditions in java.util.regex.Pattern
  *
  */
 public class PatternErrorTest extends TestCase {
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) and compile(String regex, int flag) method with invalid parameters. Doesn't verify IllegalArgumentException, PatternSyntaxException.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies compile(String regex) and compile(String regex, int flag) method with invalid parameters. Doesn't verify IllegalArgumentException, PatternSyntaxException.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        )
-    })
     public void testCompileErrors() throws Exception {
         // null regex string - should get NullPointerException
         try {
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternSyntaxExceptionTest.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternSyntaxExceptionTest.java
index 6ccea3a..d2d3596 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternSyntaxExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternSyntaxExceptionTest.java
@@ -19,46 +19,9 @@
 import java.util.regex.PatternSyntaxException;
 
 import junit.framework.TestCase;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
-@TestTargetClass(PatternSyntaxException.class)
 public class PatternSyntaxExceptionTest extends TestCase {
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "PatternSyntaxException",
-            args = {java.lang.String.class, java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getDescription",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPattern",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getIndex",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getMessage",
-            args = {}
-        )
-    })
     public void testPatternSyntaxException() {
         // Normal case
         PatternSyntaxException e = new PatternSyntaxException("Foo", "Bar", 0);
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternTest.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternTest.java
index 9dafd23..ffbdf9e 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternTest.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/PatternTest.java
@@ -27,22 +27,6 @@
 import org.apache.harmony.testframework.serialization.SerializationTest;
 import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-@TestTargetClass(
-        value = Pattern.class,
-        untestedMethods= {
-            @TestTargetNew(
-                level = TestLevel.NOT_FEASIBLE,
-                notes = "finalize is hard to test since the implementation only calls a native function",
-                method = "finalize",
-                args = {}
-            )
-        }
-)
 public class PatternTest extends TestCase {
     String[] testPatterns = {
             "(a|b)*abb",
@@ -85,12 +69,6 @@
 
     final static int DEFAULT_FLAGS = 0;
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "",
-        method = "!",
-        args = {}
-    )
     public void testMatcher() {
         // some very simple test
         Pattern p = Pattern.compile("a");
@@ -98,15 +76,6 @@
         assertNotSame(p.matcher("a"), p.matcher("a"));
     }
 
-    /*
-     * Class under test for String[] split(CharSequence, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of splitsplit(java.lang.String, int) method.",
-        method = "split",
-        args = {CharSequence.class, int.class}
-    )
     public void testSplitCharSequenceint() {
         // splitting CharSequence which ends with pattern
         // bug6193
@@ -181,15 +150,6 @@
         assertEquals(s.length, 5);
     }
 
-    /*
-     * Class under test for String[] split(CharSequence)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of splitsplit(java.lang.String) method.",
-        method = "split",
-        args = {CharSequence.class}
-    )
     public void testSplitCharSequence() {
         String s[];
         Pattern pat = Pattern.compile("b");
@@ -209,12 +169,6 @@
         // bug6544
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies the functionality of pattern() method.",
-        method = "pattern",
-        args = {}
-    )
     public void testPattern() {
         /* Positive assertion test. */
         for (String aPattern : testPatterns) {
@@ -227,12 +181,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testCompile() {
         /* Positive assertion test. */
         for (String aPattern : testPatterns) {
@@ -265,12 +213,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method for different flags.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testFlags() {
         String baseString;
         String testString;
@@ -443,13 +385,6 @@
      * Check default flags when they are not specified in pattern. Based on RI
      * since could not find that info
      */
-
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of flags() method for default flags.",
-        method = "flags",
-        args = {}
-    )
     public void testFlagsCompileDefault() {
         for (String pat : testPatternsAlt) {
             try {
@@ -466,21 +401,6 @@
      * simple implementation that does not use flags combinations. Need to
      * improve.
      */
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & flags() methods. Checks that compilation was corect.",
-            method = "flags",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & flags() methods. Checks that compilation was corect.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        )
-    })
     public void testFlagsCompileValid() {
         for (String pat : testPatternsAlt) {
             for (int flags : flagsSet) {
@@ -494,16 +414,6 @@
         }
     }
 
-    /*
-     * Class under test for Pattern compile(String, int)
-     */
-
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.Checks that correct exceptions were thrown.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testCompileStringint() {
         /*
          * these tests are needed to verify that appropriate exceptions are
@@ -559,12 +469,6 @@
     /*
      * Class under test for Pattern compile(String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.Checks that correct exceptions were thrown.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testQuantCompileNeg() {
         String[] patterns = { "5{,2}", "{5asd", "{hgdhg", "{5,hjkh", "{,5hdsh",
                 "{5,3shdfkjh}" };
@@ -587,12 +491,6 @@
         assertNotNull(Pattern.compile(pattern));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testQuantCompilePos() {
         String[] patterns = {/* "(abc){1,3}", */"abc{2,}", "abc{5}" };
         for (String element : patterns) {
@@ -600,12 +498,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile() method. Also tested methods from matcher: matches(), start(int), group(int)",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testQuantComposition() {
         String pattern = "(a{1,3})aab";
         java.util.regex.Pattern pat = java.util.regex.Pattern.compile(pattern);
@@ -615,12 +507,6 @@
         mat.group(1);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
     public void testMatches() {
         String[][] posSeq = {
                 { "abb", "ababb", "abababbababb", "abababbababbabababbbbbabb" },
@@ -649,12 +535,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies exception",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
     public void testMatchesException() {
         /* Negative assertion test. */
         for (String aPattern : wrongTestPatterns) {
@@ -669,12 +549,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "The test verifies the functionality of matches(java.lang.String,java.lang.CharSequence) method.",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
     public void testTimeZoneIssue() {
         Pattern p = Pattern.compile("GMT(\\+|\\-)(\\d+)(:(\\d+))?");
         Matcher m = p.matcher("GMT-9:45");
@@ -687,12 +561,6 @@
 
 // BEGIN android-changed
 // Removed one pattern that is buggy on the JDK. We don't want to duplicate that.
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of matches(java.lang.String,java.lang.CharSequence) method.",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
     public void testCompileRanges() {
         String[] correctTestPatterns = { "[^]*abb]*", /* "[^a-d[^m-p]]*abb", */
                 "[a-d\\d]*abb", "[abc]*abb", "[a-e&&[de]]*abb", "[^abc]*abb",
@@ -726,12 +594,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of matches(java.lang.String,java.lang.CharSequence) method for ranged patterns.",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
     public void testRangesSpecialCases() {
         String neg_patterns[] = { "[a-&&[b-c]]", "[a-\\w]", "[b-a]", "[]" };
 
@@ -755,22 +617,10 @@
     }
  // END android-changed
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "The test verifies the functionality of matches(java.lang.String,java.lang.CharSequence) method.",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
-public void testZeroSymbols() {
+    public void testZeroSymbols() {
         assertTrue(Pattern.matches("[\0]*abb", "\0\0\0\0\0\0abb"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of matcher(java.lang.String) method.",
-        method = "matcher",
-        args = {CharSequence.class}
-    )
     public void testEscapes() {
         Pattern pat = Pattern.compile("\\Q{]()*?");
         Matcher mat = pat.matcher("{]()*?");
@@ -778,22 +628,10 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testBug181() {
         Pattern.compile("[\\t-\\r]");
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testOrphanQuantifiers() {
         try {
             Pattern.compile("+++++");
@@ -802,12 +640,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testOrphanQuantifiers2() {
         try {
             Pattern pat = Pattern.compile("\\d+*");
@@ -816,21 +648,6 @@
         }
     }
 
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) method.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) method.",
-            method = "compile",
-            args = {java.lang.String.class}
-        )
-    })
     public void testBug197() {
         Object[] vals = { ":", new Integer(2),
                 new String[] { "boo", "and:foo" }, ":", new Integer(5),
@@ -856,13 +673,6 @@
         }
     }
 
-
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "The test verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testURIPatterns() {
         String URI_REGEXP_STR = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?";
         String SCHEME_REGEXP_STR = "^[a-zA-Z]{1}[\\w+-.]+$";
@@ -881,12 +691,6 @@
         Pattern HOSTNAME_REGEXP = Pattern.compile(HOSTNAME_REGEXP_STR);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testFindBoundaryCases1() {
         Pattern pat = Pattern.compile(".*\n");
         Matcher mat = pat.matcher("a\n");
@@ -895,12 +699,6 @@
         assertEquals("a\n", mat.group());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testFindBoundaryCases2() {
         Pattern pat = Pattern.compile(".*A");
         Matcher mat = pat.matcher("aAa");
@@ -909,12 +707,6 @@
         assertEquals("aA", mat.group());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testFindBoundaryCases3() {
         Pattern pat = Pattern.compile(".*A");
         Matcher mat = pat.matcher("a\naA\n");
@@ -923,12 +715,6 @@
         assertEquals("aA", mat.group());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testFindBoundaryCases4() {
         Pattern pat = Pattern.compile("A.*");
         Matcher mat = pat.matcher("A\n");
@@ -937,12 +723,6 @@
         assertEquals("A", mat.group());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testFindBoundaryCases5() {
         Pattern pat = Pattern.compile(".*A.*");
         Matcher mat = pat.matcher("\nA\naaa\nA\naaAaa\naaaA\n");
@@ -954,12 +734,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testFindBoundaryCases6() {
         String[] res = { "", "a", "", "" };
         Pattern pat = Pattern.compile(".*");
@@ -971,20 +745,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testBackReferences() {
         Pattern pat = Pattern.compile("(\\((\\w*):(.*):(\\2)\\))");
         Matcher mat = pat
@@ -1002,20 +762,6 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testNewLine() {
         Pattern pat = Pattern.compile("(^$)*\n", Pattern.MULTILINE);
         Matcher mat = pat.matcher("\r\n\n");
@@ -1026,40 +772,13 @@
         assertEquals(2, counter);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testFindGreedy() {
         Pattern pat = Pattern.compile(".*aaa", Pattern.DOTALL);
         Matcher mat = pat.matcher("aaaa\naaa\naaaaaa");
         mat.matches();
         assertEquals(15, mat.end());
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies serialization/deserialization.",
-            method = "!SerializationSelf",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies serialization/deserialization.",
-            method = "!SerializationGolden",
-            args = {}
-        )
-    })
+
     public void testSerialization() throws Exception {
         Pattern pat = Pattern.compile("a*bc");
         SerializableAssert comparator = new SerializableAssert() {
@@ -1073,20 +792,6 @@
         SerializationTest.verifySelf(pat, comparator);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testSOLQuant() {
         Pattern pat = Pattern.compile("$*", Pattern.MULTILINE);
         Matcher mat = pat.matcher("\n\n");
@@ -1098,12 +803,6 @@
         assertEquals(3, counter);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testIllegalEscape() {
         try {
             Pattern.compile("\\y");
@@ -1112,31 +811,11 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testEmptyFamily() {
         Pattern.compile("\\p{Lower}");
         String a = "*";
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testNonCaptConstr() {
         // Flags
         Pattern pat = Pattern.compile("(?i)b*(?-i)a*");
@@ -1206,12 +885,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testCorrectReplacementBackreferencedJointSet() {
         Pattern pat = Pattern.compile("ab(a)*\\1");
         pat = Pattern.compile("abc(cd)fg");
@@ -1230,40 +903,12 @@
         pat = Pattern.compile("ab(a){1,3}?(c)d");
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testCompilePatternWithTerminatorMark() {
         Pattern pat = Pattern.compile("a\u0000\u0000cd");
         Matcher mat = pat.matcher("a\u0000\u0000cd");
         assertTrue(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testAlternations() {
         String baseString = "|a|bc";
         Pattern pat = Pattern.compile(baseString);
@@ -1332,20 +977,6 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testMatchWithGroups() {
         String baseString = "jwkerhjwehrkwjehrkwjhrwkjehrjwkehrjkwhrkwehrkwhrkwrhwkhrwkjehr";
         String pattern = ".*(..).*\\1.*";
@@ -1357,32 +988,12 @@
         assertTrue(Pattern.compile(pattern).matcher(baseString).find());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies split method for empty string.",
-        method = "split",
-        args = {java.lang.CharSequence.class}
-    )
     public void testSplitEmptyCharSequence() {
         String s1 = "";
         String[] arr = s1.split(":");
         assertEquals(arr.length, 1);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies the functionality of compile(java.lang.String) & split(java.lang.CharSequence, int) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies the functionality of compile(java.lang.String) & split(java.lang.CharSequence, int) methods.",
-            method = "split",
-            args = {java.lang.CharSequence.class, int.class}
-        )
-    })
     public void testSplitEndsWithPattern() {
         assertEquals(",,".split(",", 3).length, 3);
         assertEquals(",,".split(",", 4).length, 3);
@@ -1391,30 +1002,10 @@
         assertEquals(Pattern.compile("b").split("ab", -1).length, 2);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "The test verifies the functionality of matches(java.lang.String), java.lang.CharSequence) method for case insensitive flags.",
-        method = "matches",
-        args = {java.lang.String.class, java.lang.CharSequence.class}
-    )
     public void testCaseInsensitiveFlag() {
         assertTrue(Pattern.matches("(?i-:AbC)", "ABC"));
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testEmptyGroups() {
         Pattern pat = Pattern.compile("ab(?>)cda");
         Matcher mat = pat.matcher("abcda");
@@ -1429,20 +1020,6 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & compile(java.lang.String, int) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & compile(java.lang.String, int) methods.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        )
-    })
     public void testCompileNonCaptGroup() {
         boolean isCompiled = false;
 
@@ -1461,20 +1038,6 @@
         assertTrue(isCompiled);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testEmbeddedFlags() {
         String baseString = "(?i)((?s)a)";
         String testString = "A";
@@ -1507,12 +1070,6 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testAltWithFlags() {
         boolean isCompiled = false;
 
@@ -1525,21 +1082,7 @@
         assertTrue(isCompiled);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
-public void testRestoreFlagsAfterGroup() {
+    public void testRestoreFlagsAfterGroup() {
         String baseString = "abc((?x)d)   a";
         String testString = "abcd   a";
         Pattern pat = Pattern.compile(baseString);
@@ -1552,12 +1095,6 @@
      * Verify if the Pattern support the following character classes:
      * \p{javaLowerCase} \p{javaUpperCase} \p{javaWhitespace} \p{javaMirrored}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of compile(java.lang.String) method.",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
     public void testCompileCharacterClass() {
         // Regression for HARMONY-606, 696
         Pattern pattern = Pattern.compile("\\p{javaLowerCase}");
@@ -1879,20 +1416,6 @@
 //         */}
 // END android-removed
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testRangesWithSurrogatesSupplementary() {
         String patString = "[abc\uD8D2]";
         String testString = "\uD8D2";
@@ -1959,20 +1482,6 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testSequencesWithSurrogatesSupplementary() {
         String patString = "abcd\uD8D3";
         String testString = "abcd\uD8D3\uDFFC";
@@ -2011,24 +1520,6 @@
         assertTrue(mat.find());
     }
 
-    /**
-     * s original test was fixed to pass on RI
-     */
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testPredefinedClassesWithSurrogatesSupplementary() {
         String patString = "[123\\D]";
         String testString = "a";
@@ -2130,26 +1621,6 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) &  compile(java.lang.String, int) matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) &  compile(java.lang.String, int) matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) &  compile(java.lang.String, int) matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testDotConstructionWithSurrogatesSupplementary() {
         String patString = ".";
         String testString = "\uD9A0\uDE81";
@@ -2186,15 +1657,6 @@
         assertTrue(mat.matches());
     }
 
-    /**
-     * s java.util.regex.Pattern.quote(String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "quote",
-        args = {java.lang.String.class}
-    )
     public void test_quoteLjava_lang_String() {
         for (String aPattern : testPatterns) {
             Pattern p = Pattern.compile(aPattern);
@@ -2211,25 +1673,6 @@
         }
     }
 
-    /**
-     * s java.util.regex.Pattern.matcher(String, CharSequence)
-     * coped from test for matches method
-     */
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void test_matcherLjava_lang_StringLjava_lang_CharSequence() {
         String[][] posSeq = {
                 { "abb", "ababb", "abababbababb", "abababbababbabababbbbbabb" },
@@ -2258,20 +1701,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testQuantifiersWithSurrogatesSupplementary() {
         String patString = "\uD9A0\uDE81*abc";
         String testString = "\uD9A0\uDE81\uD9A0\uDE81abc";
@@ -2284,20 +1713,6 @@
         assertTrue(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testAlternationsWithSurrogatesSupplementary() {
         String patString = "\uDE81|\uD9A0\uDE81|\uD9A0";
         String testString = "\uD9A0";
@@ -2318,26 +1733,6 @@
         assertFalse(mat.matches());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of compile(java.lang.String) & compile(java.lang.String, int) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testGroupsWithSurrogatesSupplementary() {
 
         //this pattern matches nothing
@@ -2357,32 +1752,12 @@
     /*
      * Regression test for HARMONY-688
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "The test verifies the functionality of compile(java.lang.String) & matcher(java.lang.CharSequence) methods.",
-            method = "matcher",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testUnicodeCategoryWithSurrogatesSupplementary() {
         Pattern p = Pattern.compile("\\p{javaLowerCase}");
         Matcher matcher = p.matcher("\uD801\uDC28");
         assertTrue(matcher.find());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "The test doesn't verify Matcher and should be moved to PatterTest.",
-        method = "split",
-        args = {java.lang.CharSequence.class, int.class}
-    )
     public void testSplitEmpty() {
 
         Pattern pat = Pattern.compile("");
@@ -2392,12 +1767,6 @@
         assertEquals("", s[0]);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         for (int i = 0; i < testPatterns.length; i++) {
             Pattern p = Pattern.compile(testPatterns[i]);
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ReplaceTest.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ReplaceTest.java
index 4ecb336..e609bb2 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ReplaceTest.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/ReplaceTest.java
@@ -16,32 +16,12 @@
 
 package org.apache.harmony.regex.tests.java.util.regex;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-
 import junit.framework.TestCase;
 import java.util.regex.Pattern;
 import java.util.regex.Matcher;
 import java.util.regex.PatternSyntaxException;
 
-@TestTargetClass(Matcher.class)
 public class ReplaceTest extends TestCase {
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the basic functionality of replaceFirst(java.lang.String) & replaceAll(java.lang.String) methods.",
-            method = "replaceFirst",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the basic functionality of replaceFirst(java.lang.String) & replaceAll(java.lang.String) methods.",
-            method = "replaceAll",
-            args = {java.lang.String.class}
-        )
-    })
     public void testSimpleReplace() throws PatternSyntaxException {
         String target, pattern, repl;
 
@@ -56,20 +36,6 @@
         assertEquals("foobarxxxarfooxxxbarxxxt", m.replaceAll(repl));
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of replaceFirst(java.lang.String) & replaceAll(java.lang.String) methods.",
-            method = "replaceFirst",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of replaceFirst(java.lang.String) & replaceAll(java.lang.String) methods.",
-            method = "replaceAll",
-            args = {java.lang.String.class}
-        )
-    })
     public void testCaptureReplace() {
         String target, pattern, repl, s;
         Pattern p = null;
@@ -101,12 +67,6 @@
                 );
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of replaceAll(java.lang.String) method with backslash chars.",
-        method = "replaceAll",
-        args = {java.lang.String.class}
-    )
     public void testEscapeReplace() {
         String target, pattern, repl, s;
 
diff --git a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/SplitTest.java b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/SplitTest.java
index 952da05..16ca126 100644
--- a/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/SplitTest.java
+++ b/luni/src/test/java/org/apache/harmony/regex/tests/java/util/regex/SplitTest.java
@@ -1,33 +1,13 @@
 package org.apache.harmony.regex.tests.java.util.regex;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-
 import junit.framework.TestCase;
 import java.util.regex.*;
 
-@TestTargetClass(java.util.regex.Pattern.class)
 /**
  * TODO Type description
  *
  */
 public class SplitTest extends TestCase {
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the basic functionality of split(java.lang.CharSequence) & compile(java.lang.String)methods.",
-            method = "split",
-            args = {java.lang.CharSequence.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the basic functionality of split(java.lang.CharSequence) & compile(java.lang.String)methods.",
-            method = "compile",
-            args = {java.lang.String.class}
-        )
-    })
     public void testSimple() {
         Pattern p = Pattern.compile("/");
         String[] results = p.split("have/you/done/it/right");
@@ -35,14 +15,6 @@
         assertArraysEqual(expected, results);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the basic functionality of split with empty matches.",
-            method = "split",
-            args = {java.lang.CharSequence.class}
-        )
-    })
     public void testEmptySplits() {
         // Trailing empty matches are removed.
         assertArraysEqual(new String[0], "hello".split("."));
@@ -88,12 +60,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of split(java.lang.CharSequence). Test uses not empty pattern.",
-        method = "split",
-        args = {java.lang.CharSequence.class, int.class}
-    )
     public void testSplit1() throws PatternSyntaxException {
         Pattern p = Pattern.compile(" ");
 
@@ -185,12 +151,6 @@
         assertEquals("dle z", tokens[2]);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the functionality of split(java.lang.CharSequence). Test uses empty pattern.",
-        method = "split",
-        args = {java.lang.CharSequence.class, int.class}
-    )
     public void testSplit2() {
         Pattern p = Pattern.compile("");
         String s[];
@@ -218,20 +178,6 @@
     }
 
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of split(java.lang.CharSequence) & compile(java.lang.String, int) methods. Test uses empty pattern and supplementary chars.",
-            method = "split",
-            args = {java.lang.CharSequence.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies the functionality of split(java.lang.CharSequence) & compile(java.lang.String, int) methods. Test uses empty pattern and supplementary chars.",
-            method = "compile",
-            args = {java.lang.String.class}
-        )
-    })
     public void testSplitSupplementaryWithEmptyString() {
 
         /*
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlException2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlException2Test.java
index 238d87d..d118d4e 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlException2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlException2Test.java
@@ -17,15 +17,9 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.io.FilePermission;
 import java.security.AccessControlException;
 
-@TestTargetClass(AccessControlException.class)
 public class AccessControlException2Test extends junit.framework.TestCase {
     FilePermission filePermission;
 
@@ -34,14 +28,8 @@
     AccessControlException acException1;
 
     /**
-     * @tests java.security.AccessControlException#AccessControlException(java.lang.String)
+     * java.security.AccessControlException#AccessControlException(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "AccessControlException",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method
         // java.security.AccessControlException(java.lang.String)
@@ -52,15 +40,9 @@
     }
 
     /**
-     * @tests java.security.AccessControlException#AccessControlException(java.lang.String,
+     * java.security.AccessControlException#AccessControlException(java.lang.String,
      *        java.security.Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "AccessControlException",
-        args = {java.lang.String.class, java.security.Permission.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_security_Permission() {
         // Test for method
         // java.security.AccessControlException(java.lang.String,
@@ -73,14 +55,8 @@
     }
 
     /**
-     * @tests java.security.AccessControlException#getPermission()
+     * java.security.AccessControlException#getPermission()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPermission",
-        args = {}
-    )
     public void test_getPermission() {
         // Test for method java.security.Permission
         // java.security.AccessControlException.getPermission()
@@ -103,4 +79,4 @@
         acException1 = new AccessControlException("test message",
                 filePermission);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlExceptionTest.java
index fb71bed..35f2b25 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessControlExceptionTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AccessControlException;
 import java.security.AllPermission;
 import java.security.Permission;
@@ -37,18 +32,11 @@
 /**
  * Unit test for AccessControlException.
  */
-@TestTargetClass(AccessControlException.class)
 public class AccessControlExceptionTest extends TestCase {
 
     /**
      * Tests AccessControlException(String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "AccessControlException",
-        args = {java.lang.String.class}
-    )
     public void testAccessControlExceptionString() {
         new AccessControlException(null);
         new AccessControlException("Failure");
@@ -57,12 +45,6 @@
     /**
      * Tests AccessControlException(String, Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "AccessControlException",
-        args = {java.lang.String.class, java.security.Permission.class}
-    )
     public void testAccessControlExceptionStringPermission() {
         Permission perm = new AllPermission();
         AccessControlException controlException = new AccessControlException("001", perm);
@@ -74,12 +56,6 @@
      *
      * Tests AccessControlException.getPermission()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPermission",
-        args = {}
-    )
     public void testGetPermission() {
         Permission perm = new UnresolvedPermission("unresolvedType",
                 "unresolvedName", "unresolvedActions", null);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessController2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessController2Test.java
index 235441a..be2903b 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessController2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AccessController2Test.java
@@ -27,11 +27,7 @@
 import java.security.PrivilegedExceptionAction;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
-@TestTargetClass(AccessController.class)
 public class AccessController2Test extends junit.framework.TestCase {
 
     PrivilegedAction<Boolean> privAction = new PrivilegedAction<Boolean>() {
@@ -58,14 +54,9 @@
     };
 
     /**
-     * @tests java.security.AccessController#doPrivileged(java.security.PrivilegedAction,
+     * java.security.AccessController#doPrivileged(java.security.PrivilegedAction,
      *        java.security.AccessControlContext))
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "doPrivileged",
-        args = {java.security.PrivilegedAction.class, java.security.AccessControlContext.class}
-    )
     @KnownFailure("Fails (probably) because no protection domain is set.")
     public void test_doPrivilegedLjava_security_PrivilegedActionLjava_security_AccessControlContext() {
         Boolean pass;
@@ -90,13 +81,8 @@
     }
 
     /**
-     * @tests java.security.AccessController#doPrivileged(java.security.PrivilegedAction))
+     * java.security.AccessController#doPrivileged(java.security.PrivilegedAction))
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "doPrivileged",
-        args = {java.security.PrivilegedAction.class}
-    )
     @KnownFailure("Fails (probably) because no protection domain is set.")
     public void test_doPrivilegedLjava_security_PrivilegedAction() {
         Boolean pass;
@@ -114,14 +100,9 @@
     }
 
     /**
-     * @tests java.security.AccessController#doPrivileged(java.security.PrivilegedExceptionAction,
+     * java.security.AccessController#doPrivileged(java.security.PrivilegedExceptionAction,
      *        java.security.AccessControlContext))
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "doPrivileged",
-        args = {java.security.PrivilegedExceptionAction.class, java.security.AccessControlContext.class}
-    )
     @KnownFailure("Fails (probably) because no protection domain is set.")
     public void test_doPrivilegedLjava_security_PrivilegedExceptionActionLjava_security_AccessControlContext() {
         Boolean pass;
@@ -159,13 +140,8 @@
     }
 
     /**
-     * @tests java.security.AccessController#doPrivileged(java.security.PrivilegedExceptionAction))
+     * java.security.AccessController#doPrivileged(java.security.PrivilegedExceptionAction))
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "doPrivileged",
-        args = {java.security.PrivilegedExceptionAction.class}
-    )
     @KnownFailure("Fails (probably) because no protection domain is set.")
     public void test_doPrivilegedLjava_security_PrivilegedExceptionAction() {
         Boolean pass;
@@ -190,14 +166,8 @@
     }
 
     /**
-     * @tests java.security.AccessController#checkPermission(Permission perm)
+     * java.security.AccessController#checkPermission(Permission perm)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkPermission",
-        args = {java.security.Permission.class}
-    )
     public void test_checkPermission_NullParameter() {
         //Null parameter
         try {
@@ -209,14 +179,8 @@
     }
 
     /**
-     * @tests java.security.AccessController#checkPermission(Permission perm)
+     * java.security.AccessController#checkPermission(Permission perm)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkPermission",
-        args = {java.security.Permission.class}
-    )
     @KnownFailure("Fails (probably) because no protection domain is set.")
     public void test_checkPermission_InvalidPermission() {
         String[] perm_invalid = {null, "1", "", "invalid", "bla-bla", "testCtor123^%$#&^ &^$"};
@@ -246,14 +210,8 @@
     }
 
     /**
-     * @tests java.security.AccessController#getContext()
+     * java.security.AccessController#getContext()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getContext",
-        args = {}
-    )
     public void test_getContext() {
         try {
             AccessControlContext acc = AccessController.getContext();
@@ -289,4 +247,4 @@
             return false;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator1Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator1Test.java
index 856262d..82ae58e 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator1Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator1Test.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AlgorithmParameterGenerator;
 import java.security.AlgorithmParameterGeneratorSpi;
 import java.security.AlgorithmParameters;
@@ -41,13 +36,12 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
-@TestTargetClass(AlgorithmParameterGenerator.class)
+
 /**
  * Tests for <code>AlgorithmParameterGenerator</code> class constructors and
  * methods.
  *
  */
-
 public class AlgorithmParameterGenerator1Test extends TestCase {
 
     private static String[] invalidValues = SpiEngUtils.invalidValues;
@@ -98,12 +92,6 @@
      * throws NoSuchAlgorithmException must be thrown if algorithm is not available
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testAlgorithmParameterGenerator01()
             throws NoSuchAlgorithmException {
         try {
@@ -126,12 +114,6 @@
      * Assertion: returns AlgorithmParameterGenerator instance
      * when algorithm is DSA
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testAlgorithmParameterGenerator02()
             throws NoSuchAlgorithmException {
         if (!DSASupported) {
@@ -151,12 +133,6 @@
      * Assertion:
      * throws IllegalArgumentException if provider is null or empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testAlgorithmParameterGenerator03()
             throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DSASupported) {
@@ -184,12 +160,6 @@
      * Assertion: throws NoSuchProviderException if provider is not
      * available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testAlgorithmParameterGenerator04()
             throws NoSuchAlgorithmException {
         if (!DSASupported) {
@@ -216,12 +186,6 @@
      * throws NullPointerException must be thrown is null
      * throws NoSuchAlgorithmException must be thrown if algorithm is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testAlgorithmParameterGenerator05()
             throws NoSuchProviderException {
         if (!DSASupported) {
@@ -250,12 +214,6 @@
      * method
      * Assertion: return AlgorithmParameterGenerator
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testAlgorithmParameterGenerator06()
             throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DSASupported) {
@@ -277,12 +235,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testAlgorithmParameterGenerator07()
             throws NoSuchAlgorithmException {
         if (!DSASupported) {
@@ -306,12 +258,6 @@
      * throws NullPointerException must be thrown is null
      * throws NoSuchAlgorithmException must be thrown if algorithm is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testAlgorithmParameterGenerator08() {
         if (!DSASupported) {
             fail(validAlgName + " algorithm is not supported");
@@ -339,12 +285,6 @@
      * method
      * Assertion: returns AlgorithmParameterGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testAlgorithmParameterGenerator09()
             throws NoSuchAlgorithmException {
         if (!DSASupported) {
@@ -364,12 +304,6 @@
      * Test for <code>generateParameters()</code> method
      * Assertion: returns AlgorithmParameters object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "generateParameters",
-        args = {}
-    )
     public void testAlgorithmParameterGenerator10()
             throws NoSuchAlgorithmException {
         if (!DSASupported) {
@@ -390,24 +324,6 @@
      * methods
      * Assertion: throws InvalidAlgorithmParameterException when param is null
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Only invalid argument cases are verified. This is " +
-            "sufficient since the effects of calling init with valid " +
-            "parameters can not be observed.",
-            method = "init",
-            args = {java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Only invalid argument cases are verified. This is " +
-            "sufficient since the effects of calling init with valid " +
-            "parameters can not be observed.",
-            method = "init",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        )
-    })
     public void testAlgorithmParameterGenerator12() {
         if (!DSASupported) {
             fail(validAlgName + " algorithm is not supported");
@@ -439,20 +355,6 @@
      * Test for <code>AlgorithmParameterGenerator</code> constructor
      * Assertion: returns AlgorithmParameterGenerator object
      */
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "Validity of arguments is not checked in the constructor; " +
-                "this is done during init.",
-                method = "AlgorithmParameterGenerator",
-                args = {java.security.AlgorithmParameterGeneratorSpi.class, java.security.Provider.class, java.lang.String.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "init",
-                args = {int.class, SecureRandom.class}
-        )
-    })
     public void testConstructor() throws NoSuchAlgorithmException {
         if (!DSASupported) {
             fail(validAlgName + " algorithm is not supported");
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator2Test.java
index 5ca1ee3..5eb5efc 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParameterGenerator2Test.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AlgorithmParameterGenerator;
 import java.security.AlgorithmParameters;
 import java.security.InvalidAlgorithmParameterException;
@@ -40,12 +35,11 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
-@TestTargetClass(AlgorithmParameterGenerator.class)
+
 /**
  * Tests for <code>AlgorithmParameterGenerator</code> class constructors and
  * methods.
  */
-
 public class AlgorithmParameterGenerator2Test extends TestCase {
 
     private static final String AlgorithmParameterGeneratorProviderClass = "org.apache.harmony.security.tests.support.MyAlgorithmParameterGeneratorSpi";
@@ -120,12 +114,6 @@
      * throws NoSuchAlgorithmException must be thrown if algorithm is not available
      * returns AlgorithmParameterGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance01() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         try {
@@ -162,12 +150,6 @@
      * throws NoSuchProviderException when provider is available;
      * returns AlgorithmParameterGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstance02() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException,
             InvalidAlgorithmParameterException {
@@ -228,12 +210,6 @@
      * throws IllegalArgumentException when provider is null;
      * returns AlgorithmParameterGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance03() throws NoSuchAlgorithmException,
             IllegalArgumentException,
             InvalidAlgorithmParameterException {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersSpiTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersSpiTest.java
index d1bfc3f..2e9a941 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersSpiTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AlgorithmParametersSpi;
 import java.security.spec.AlgorithmParameterSpec;
 
@@ -32,7 +27,6 @@
  * and methods.
  *
  */
-@TestTargetClass(AlgorithmParametersSpi.class)
 public class AlgorithmParametersSpiTest extends TestCase {
 
 
@@ -40,56 +34,6 @@
      * Test for <code>AlgorithmParametersSpi</code> constructor
      * Assertion: constructs AlgorithmParametersSpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AlgorithmParametersSpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetEncoded",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetEncoded",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetParameterSpec",
-            args = {java.lang.Class.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineInit",
-            args = {java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineInit",
-            args = {byte[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineInit",
-            args = {byte[].class, java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineToString",
-            args = {}
-        )
-    })
     public void testAlgorithmParametersSpi() {
         byte[] bt = new byte[10];
         MyAlgorithmParametersSpi algParSpi = new MyAlgorithmParametersSpi();
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
index b7ff35a..2315492 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AlgorithmParametersTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.math.BigInteger;
 import java.security.AlgorithmParameters;
@@ -43,7 +38,7 @@
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.MyAlgorithmParameterGeneratorSpi;
-@TestTargetClass(AlgorithmParameters.class)
+
 /**
  * Tests for <code>AlgorithmParameters</code> class constructors and
  * methods.
@@ -74,14 +69,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getAlgorithm()
+     * java.security.AlgorithmParameters#getAlgorithm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws Exception {
 
         // test: null value
@@ -94,14 +83,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getEncoded()
+     * java.security.AlgorithmParameters#getEncoded()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public void test_getEncoded() throws Exception {
 
         final byte[] enc = new byte[] { 0x02, 0x01, 0x03 };
@@ -133,14 +116,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getEncoded(String)
+     * java.security.AlgorithmParameters#getEncoded(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {java.lang.String.class}
-    )
     public void test_getEncodedLjava_lang_String() throws Exception {
 
         final byte[] enc = new byte[] { 0x02, 0x01, 0x03 };
@@ -190,14 +167,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getInstance(String)
+     * java.security.AlgorithmParameters#getInstance(String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() {
         String[] str = {"", "qwertyu", "!@#$%^&*()"};
         try {
@@ -220,14 +191,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getInstance(String, String)
+     * java.security.AlgorithmParameters#getInstance(String, String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String() {
         String[] alg = {"", "qwertyu", "!@#$%^&*()"};
         String[] prv = {"", null};
@@ -276,14 +241,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getParameterSpec(Class)
+     * java.security.AlgorithmParameters#getParameterSpec(Class)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameterSpec",
-        args = {java.lang.Class.class}
-    )
     public void test_getParameterSpecLjava_lang_Class() throws Exception {
 
         final MyAlgorithmParameterSpec myParamSpec = new MyAlgorithmParameterSpec();
@@ -340,14 +299,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getInstance(String, Provider)
+     * java.security.AlgorithmParameters#getInstance(String, Provider)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider() {
         String[] alg = {"", "qwertyu", "!@#$%^&*()"};
         Provider pp = null;
@@ -383,14 +336,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#getProvider()
+     * java.security.AlgorithmParameters#getProvider()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws Exception {
         // test: null value
         AlgorithmParameters ap = new DummyAlgorithmParameters(null, null, "AAA");
@@ -402,14 +349,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#init(java.security.spec.AlgorithmParameterSpec)
+     * java.security.AlgorithmParameters#init(java.security.spec.AlgorithmParameterSpec)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {java.security.spec.AlgorithmParameterSpec.class}
-    )
     public void test_initLjava_security_spec_AlgorithmParameterSpec()
             throws Exception {
 
@@ -478,14 +419,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#init(byte[])
+     * java.security.AlgorithmParameters#init(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {byte[].class}
-    )
     public void test_init$B() throws Exception {
 
         //
@@ -551,14 +486,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#init(byte[],String)
+     * java.security.AlgorithmParameters#init(byte[],String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {byte[].class, java.lang.String.class}
-    )
     public void test_init$BLjava_lang_String() throws Exception {
 
         //
@@ -634,14 +563,8 @@
     }
 
     /**
-     * @tests java.security.AlgorithmParameters#toString()
+     * java.security.AlgorithmParameters#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
 
         final String str = "AlgorithmParameters";
@@ -665,12 +588,6 @@
     /**
      * Tests DSA AlgorithmParameters provider
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Just DSA parameter checked",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testDSAProvider() throws Exception {
         AlgorithmParameters params = AlgorithmParameters.getInstance("DSA");
 
@@ -718,12 +635,6 @@
     /**
      * Tests OAEP AlgorithmParameters provider
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Just OAEP parameter tested",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testOAEPProvider() throws Exception {
         AlgorithmParameters params = AlgorithmParameters.getInstance("OAEP");
 
@@ -734,14 +645,6 @@
      * Test for <code>AlgorithmParameters</code> constructor
      * Assertion: returns AlgorithmParameters object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "There are no tests with invalid arguments. This is " +
-        "ok since the effects of calling the constructor with " +
-        "invalid parameters can not be observed.",
-        method = "AlgorithmParameters",
-        args = {java.security.AlgorithmParametersSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testAlgorithmParametersConst() throws Exception {
         AlgorithmParametersSpi spi = new MyAlgorithmParameters();
         AlgorithmParameters ap = new myAlgP(spi, p, "ABC");
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AllPermission2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AllPermission2Test.java
index 8832829..b52a81b 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AllPermission2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AllPermission2Test.java
@@ -17,29 +17,17 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AllPermission;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.SecurityPermission;
 import java.util.Enumeration;
 
-@TestTargetClass(AllPermission.class)
 public class AllPermission2Test extends junit.framework.TestCase {
 
     /**
-     * @tests java.security.AllPermission#AllPermission()
+     * java.security.AllPermission#AllPermission()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AllPermission",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.security.AllPermission()
         AllPermission ap = new AllPermission();
@@ -48,15 +36,9 @@
     }
 
     /**
-     * @tests java.security.AllPermission#AllPermission(java.lang.String,
+     * java.security.AllPermission#AllPermission(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Null/empty parameters checking missed",
-        method = "AllPermission",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         // Test for method java.security.AllPermission(java.lang.String,
         // java.lang.String)
@@ -70,14 +52,8 @@
     }
 
     /**
-     * @tests java.security.AllPermission#equals(java.lang.Object)
+     * java.security.AllPermission#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Update comment for first assertTrue method.Because: Two AllPermission objects are always equal",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean
         // java.security.AllPermission.equals(java.lang.Object)
@@ -88,14 +64,8 @@
     }
 
     /**
-     * @tests java.security.AllPermission#getActions()
+     * java.security.AllPermission#getActions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getActions",
-        args = {}
-    )
     public void test_getActions() {
         AllPermission ap = new AllPermission();
         // Test for method java.lang.String
@@ -105,14 +75,8 @@
     }
 
     /**
-     * @tests java.security.AllPermission#hashCode()
+     * java.security.AllPermission#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         final int ALLPERMISSION_HASH = 1;
         // Test for method int java.security.AllPermission.hashCode()
@@ -124,14 +88,8 @@
     }
 
     /**
-     * @tests java.security.AllPermission#implies(java.security.Permission)
+     * java.security.AllPermission#implies(java.security.Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void test_impliesLjava_security_Permission() {
         // Test for method boolean
         // java.security.AllPermission.implies(java.security.Permission)
@@ -145,14 +103,8 @@
     }
 
     /**
-     * @tests java.security.AllPermission#newPermissionCollection()
+     * java.security.AllPermission#newPermissionCollection()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void test_newPermissionCollection() {
         AllPermission ap1 = new AllPermission();
         AllPermission ap2 = new AllPermission("Don't remember this stupid name",
@@ -191,4 +143,4 @@
         assertTrue(perm2.hasMoreElements());
     }
 
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AllTests.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AllTests.java
deleted file mode 100644
index 97f58d0..0000000
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AllTests.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.security.tests.java.security;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package org.apache.harmony.security.tests.java.security;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package org.apache.harmony.security.tests.java.security;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AccessControlException2Test.class);
-        suite.addTestSuite(AccessControlExceptionTest.class);
-        suite.addTestSuite(AccessController2Test.class);
-        suite.addTestSuite(AlgorithmParameterGenerator1Test.class);
-        suite.addTestSuite(AlgorithmParameterGenerator2Test.class);
-        suite.addTestSuite(AlgorithmParametersSpiTest.class);
-        suite.addTestSuite(AlgorithmParametersTest.class);
-        suite.addTestSuite(AllPermission2Test.class);
-        suite.addTestSuite(AuthProviderTest.class);
-        suite.addTestSuite(BasicPermission2Test.class);
-        suite.addTestSuite(CodeSignerTest.class);
-        suite.addTestSuite(CodeSource2Test.class);
-        suite.addTestSuite(CodeSourceTest.class);
-        suite.addTestSuite(DigestExceptionTest.class);
-        suite.addTestSuite(DigestInputStream2Test.class);
-        suite.addTestSuite(DigestInputStreamTest.class);
-        suite.addTestSuite(DigestOutputStreamTest.class);
-        suite.addTestSuite(GeneralSecurityExceptionTest.class);
-        suite.addTestSuite(GuardedObjectTest.class);
-        suite.addTestSuite(Identity2Test.class);
-        suite.addTestSuite(IdentityScope2Test.class);
-        suite.addTestSuite(IdentityScopeTest.class);
-        suite.addTestSuite(InvalidAlgorithmParameterExceptionTest.class);
-        suite.addTestSuite(InvalidKeyExceptionTest.class);
-        suite.addTestSuite(InvalidParameterExceptionTest.class);
-        suite.addTestSuite(KSCallbackHandlerProtectionTest.class);
-        suite.addTestSuite(KSPasswordProtectionTest.class);
-        suite.addTestSuite(KSPrivateKeyEntryTest.class);
-        suite.addTestSuite(KSSecretKeyEntryTest.class);
-        suite.addTestSuite(KSTrustedCertificateEntryTest.class);
-        suite.addTestSuite(KeyExceptionTest.class);
-        suite.addTestSuite(KeyFactory2Test.class);
-        suite.addTestSuite(KeyFactorySpiTest.class);
-        suite.addTestSuite(KeyManagementExceptionTest.class);
-        suite.addTestSuite(KeyPairGenerator1Test.class);
-        suite.addTestSuite(KeyPairGenerator2Test.class);
-        suite.addTestSuite(KeyPairGenerator3Test.class);
-        suite.addTestSuite(KeyPairGenerator4Test.class);
-        suite.addTestSuite(KeyPairGeneratorSpiTest.class);
-        suite.addTestSuite(KeyPairTest.class);
-        suite.addTestSuite(KeyRepTest.class);
-        suite.addTestSuite(KeyRepTypeTest.class);
-        suite.addTestSuite(KeyStore2Test.class);
-        suite.addTestSuite(KeyStore3Test.class);
-        suite.addTestSuite(KeyStoreBuilderTest.class);
-        suite.addTestSuite(KeyStoreExceptionTest.class);
-        suite.addTestSuite(KeyStoreSpiTest.class);
-        suite.addTestSuite(KeyStoreTest.class);
-        suite.addTestSuite(KeyTest.class);
-        suite.addTestSuite(MessageDigest1Test.class);
-        suite.addTestSuite(MessageDigest2Test.class);
-        suite.addTestSuite(MessageDigestSpiTest.class);
-        suite.addTestSuite(NoSuchAlgorithmExceptionTest.class);
-        suite.addTestSuite(NoSuchProviderExceptionTest.class);
-        suite.addTestSuite(Permission2Test.class);
-        suite.addTestSuite(PermissionCollectionTest.class);
-        suite.addTestSuite(PermissionTest.class);
-        suite.addTestSuite(Permissions2Test.class);
-        suite.addTestSuite(PermissionsTest.class);
-        suite.addTestSuite(PolicyTest.class);
-        suite.addTestSuite(PrivateKeyTest.class);
-        suite.addTestSuite(PrivilegedActionException2Test.class);
-        suite.addTestSuite(PrivilegedActionExceptionTest.class);
-        suite.addTestSuite(ProtectionDomainTest.class);
-        suite.addTestSuite(Provider2Test.class);
-        suite.addTestSuite(ProviderExceptionTest.class);
-        suite.addTestSuite(ProviderServiceTest.class);
-        suite.addTestSuite(ProviderTest.class);
-        suite.addTestSuite(PublicKeyTest.class);
-        suite.addTestSuite(SecureRandom2Test.class);
-        suite.addTestSuite(SecureRandomSpiTest.class);
-        suite.addTestSuite(Security2Test.class);
-        suite.addTestSuite(SecurityPermission2Test.class);
-        suite.addTestSuite(SecurityPermissionTest.class);
-        suite.addTestSuite(SecurityTest.class);
-        suite.addTestSuite(Signature2Test.class);
-        suite.addTestSuite(SignatureExceptionTest.class);
-        suite.addTestSuite(SignatureSpiTest.class);
-        suite.addTestSuite(SignatureTest.class);
-        suite.addTestSuite(SignedObjectTest.class);
-        suite.addTestSuite(SignerTest.class);
-        suite.addTestSuite(TimestampTest.class);
-        suite.addTestSuite(UnrecoverableEntryExceptionTest.class);
-        suite.addTestSuite(UnrecoverableKeyExceptionTest.class);
-        suite.addTestSuite(UnresolvedPermissionTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AuthProviderTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AuthProviderTest.java
index d5a428f..0819583 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/AuthProviderTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/AuthProviderTest.java
@@ -16,18 +16,13 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AuthProvider;
 
 import javax.security.auth.Subject;
 import javax.security.auth.callback.CallbackHandler;
 
 import junit.framework.TestCase;
-@TestTargetClass(AuthProvider.class)
+
 public class AuthProviderTest extends TestCase {
 
     protected void setUp() throws Exception {
@@ -39,34 +34,8 @@
     }
 
     /**
-     * @tests java.security.AuthProvider#AuthProvider(String, double, String)
+     * java.security.AuthProvider#AuthProvider(String, double, String)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AuthProvider",
-            args = {java.lang.String.class, double.class, java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "login",
-            args = {javax.security.auth.Subject.class, javax.security.auth.callback.CallbackHandler.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "logout",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setCallbackHandler",
-            args = {javax.security.auth.callback.CallbackHandler.class}
-        )
-    })
     public void testConstructor01() {
         AuthProviderStub ap = new AuthProviderStub("name", 1.0, "info");
         CallbackHandler handler = null;
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/BasicPermission2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/BasicPermission2Test.java
index 1a96647..e398bc4 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/BasicPermission2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/BasicPermission2Test.java
@@ -17,15 +17,9 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.BasicPermission;
 import java.security.PermissionCollection;
 
-@TestTargetClass(BasicPermission.class)
 public class BasicPermission2Test extends junit.framework.TestCase {
 
     public static class BasicPermissionSubclass extends BasicPermission {
@@ -49,29 +43,17 @@
     BasicPermission bp5 = new BasicPermissionSubclass("this.*");
 
     /**
-     * @tests java.security.BasicPermission#BasicPermission(java.lang.String)
+     * java.security.BasicPermission#BasicPermission(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Test cases, where parameter name is null (expect NullPointerException) and parameter name is empty (expect IllegalArgumentException) are absent",
-        method = "BasicPermission",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.security.BasicPermission(java.lang.String)
         assertEquals("Incorrect name returned", "aName", bp.getName());
     }
 
     /**
-     * @tests java.security.BasicPermission#BasicPermission(java.lang.String,
+     * java.security.BasicPermission#BasicPermission(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Test cases, where parameter name is null (expect NullPointerException) and parameter name is empty (expect IllegalArgumentException) are absent",
-        method = "BasicPermission",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         // Test for method java.security.BasicPermission(java.lang.String,
         // java.lang.String)
@@ -79,14 +61,8 @@
     }
 
     /**
-     * @tests java.security.BasicPermission#equals(java.lang.Object)
+     * java.security.BasicPermission#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean
         // java.security.BasicPermission.equals(java.lang.Object)
@@ -97,14 +73,8 @@
     }
 
     /**
-     * @tests java.security.BasicPermission#getActions()
+     * java.security.BasicPermission#getActions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getActions",
-        args = {}
-    )
     public void test_getActions() {
         // Test for method java.lang.String
         // java.security.BasicPermission.getActions()
@@ -115,14 +85,8 @@
     }
 
     /**
-     * @tests java.security.BasicPermission#hashCode()
+     * java.security.BasicPermission#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         // Test for method int java.security.BasicPermission.hashCode()
         assertTrue("Equal objects should return same hash",
@@ -130,14 +94,8 @@
     }
 
     /**
-     * @tests java.security.BasicPermission#implies(java.security.Permission)
+     * java.security.BasicPermission#implies(java.security.Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void test_impliesLjava_security_Permission() {
         // Test for method boolean
         // java.security.BasicPermission.implies(java.security.Permission)
@@ -150,14 +108,8 @@
     }
 
     /**
-     * @tests java.security.BasicPermission#newPermissionCollection()
+     * java.security.BasicPermission#newPermissionCollection()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void test_newPermissionCollection() {
         // Test for method java.security.PermissionCollection
         // java.security.BasicPermission.newPermissionCollection()
@@ -167,4 +119,4 @@
         assertTrue("Should imply", bpc.implies(bp4));
         assertTrue("Should not imply", !bpc.implies(bp3));
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSignerTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSignerTest.java
index d139b6b..54d906c 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSignerTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSignerTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.CodeSigner;
 import java.security.Timestamp;
 import java.security.cert.CertPath;
@@ -35,11 +30,10 @@
 import org.apache.harmony.security.tests.support.TestCertUtils;
 
 import junit.framework.TestCase;
-@TestTargetClass(CodeSigner.class)
+
 /**
  * Unit test for CodeSigner.
  */
-
 public class CodeSignerTest extends TestCase {
     private CertPath cpath = TestCertUtils.genCertPath(3, 0);
     private Date now = new Date();
@@ -49,12 +43,6 @@
     /**
      * must throw NPE if signerCertPath is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "NPE case",
-        method = "CodeSigner",
-        args = {java.security.cert.CertPath.class, java.security.Timestamp.class}
-    )
     public void testCodeSigner_00() {
         try {
             new CodeSigner(null, ts);
@@ -67,12 +55,6 @@
     /**
      * timestamp can be null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Null parameter timestamp checking",
-        method = "CodeSigner",
-        args = {java.security.cert.CertPath.class, java.security.Timestamp.class}
-    )
     public final void testCodeSigner_01() {
         try {
             CodeSigner cs = new CodeSigner(cpath, null);
@@ -85,12 +67,6 @@
     /**
      * Not null parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CodeSigner",
-        args = {java.security.cert.CertPath.class, java.security.Timestamp.class}
-    )
     public final void testCodeSigner_02() {
         try {
             CodeSigner cs = new CodeSigner(cpath, ts);
@@ -103,12 +79,6 @@
     /**
      * Test various assertions about equals()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject() {
 
         CodeSigner one = new CodeSigner(cpath, ts);
@@ -134,12 +104,6 @@
     /**
      * Tests CodeSigner.getSignerCertPath()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSignerCertPath",
-        args = {}
-    )
     public void testGetSignerCertPath() {
         assertSame(new CodeSigner(cpath, null).getSignerCertPath(), cpath);
     }
@@ -147,12 +111,6 @@
     /**
      * Tests CodeSigner.getTimeStamp()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTimestamp",
-        args = {}
-    )
     public void testGetTimestamp() {
         assertNull(new CodeSigner(cpath, null).getTimestamp());
         assertSame(new CodeSigner(cpath, ts).getTimestamp(), ts);
@@ -161,12 +119,6 @@
     /**
      * Tests CodeSigner.toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         assertTrue(new CodeSigner(cpath, null).toString().contains(""));
         assertTrue(new CodeSigner(cpath, ts).toString().contains(""));
@@ -178,12 +130,6 @@
     /**
      * Tests CodeSigner.hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         CodeSigner cs1 = new CodeSigner(cpath, ts);
         CodeSigner cs2 = new CodeSigner(cpath, ts);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSource2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSource2Test.java
index 95d98e9..34549df 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSource2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSource2Test.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.net.URL;
 import java.security.CodeSigner;
 import java.security.CodeSource;
@@ -34,20 +29,13 @@
 import org.apache.harmony.security.tests.support.TestCertUtils;
 
 
-@TestTargetClass(CodeSource.class)
 public class CodeSource2Test extends junit.framework.TestCase {
 
     /**
      * @throws Exception
-     * @tests java.security.CodeSource#CodeSource(java.net.URL,
+     * java.security.CodeSource#CodeSource(java.net.URL,
      *        java.security.cert.Certificate[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies constructor with valid URL and null certificate array",
-        method = "CodeSource",
-        args = {java.net.URL.class, java.security.cert.Certificate[].class}
-    )
     public void test_ConstructorLjava_net_URL$Ljava_security_cert_Certificate()
             throws Exception {
         // Test for method java.security.CodeSource(java.net.URL,
@@ -57,15 +45,9 @@
 
     /**
      * @throws Exception
-     * @tests java.security.CodeSource#CodeSource(java.net.URL,
+     * java.security.CodeSource#CodeSource(java.net.URL,
      *        java.security.CodeSigner[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CodeSource",
-        args = {java.net.URL.class, java.security.CodeSigner[].class}
-    )
     public void test_ConstructorLjava_net_URL$Ljava_security_CodeSigner() {
         // Test for method java.security.CodeSource(java.net.URL,
         // java.security.cert.CodeSigner [])
@@ -98,14 +80,8 @@
     }
 
     /**
-     * @tests java.security.CodeSource#equals(java.lang.Object)
+     * java.security.CodeSource#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "CodeSource object was created with CodeSource(URL url, Certificate[] certs) only",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() throws Exception {
         // Test for method boolean
         // java.security.CodeSource.equals(java.lang.Object)
@@ -117,14 +93,8 @@
     }
 
     /**
-     * @tests java.security.CodeSource#hashCode()
+     * java.security.CodeSource#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
         URL url = new java.net.URL("file:///test");
         CodeSource cs = new CodeSource(url, (Certificate[]) null);
@@ -133,14 +103,8 @@
     }
 
     /**
-     * @tests java.security.CodeSource#getCertificates()
+     * java.security.CodeSource#getCertificates()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies case for null certificates only",
-        method = "getCertificates",
-        args = {}
-    )
     public void test_getCertificates() throws Exception {
         CodeSource cs = new CodeSource(new java.net.URL("file:///test"),
                 (Certificate[]) null);
@@ -149,14 +113,8 @@
     }
 
     /**
-     * @tests java.security.CodeSource#getLocation()
+     * java.security.CodeSource#getLocation()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLocation",
-        args = {}
-    )
     public void test_getLocation() throws Exception {
         // Test for method java.net.URL java.security.CodeSource.getLocation()
         CodeSource cs = new CodeSource(new java.net.URL("file:///test"),
@@ -167,14 +125,8 @@
     }
 
     /**
-     * @tests java.security.CodeSource#implies(java.security.CodeSource)
+     * java.security.CodeSource#implies(java.security.CodeSource)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void test_impliesLjava_security_CodeSource() throws Exception {
         // Test for method boolean
         // java.security.CodeSource.implies(java.security.CodeSource)
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java
index 7cf12b5..3b41943 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/CodeSourceTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.File;
 import java.net.URL;
 import java.net.InetAddress;
@@ -41,12 +36,10 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(CodeSource.class)
 /**
  * Unit test for CodeSource.
  *
  */
-
 public class CodeSourceTest extends TestCase {
     private java.security.cert.Certificate[] chain = null;
 
@@ -127,12 +120,6 @@
      * Tests hashCode().<br>
      * javadoc says nothing, so test DRL-specific implementation.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         // when nothing is specified, then hashCode obviously must be 0.
         assertTrue(new CodeSource(null, (Certificate[]) null).hashCode() == 0);
@@ -147,12 +134,6 @@
     /**
      * Tests CodeSource(URL, Certificate[]).
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CodeSource",
-        args = {java.net.URL.class, java.security.cert.Certificate[].class}
-    )
     public void testCodeSourceURLCertificateArray() {
         new CodeSource(null, (Certificate[]) null);
         new CodeSource(urlSite, (Certificate[]) null);
@@ -163,12 +144,6 @@
     /**
      * Tests CodeSource(URL, CodeSigner[]).
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with null parameters only",
-        method = "CodeSource",
-        args = {java.net.URL.class, java.security.CodeSigner[].class}
-    )
     public void testCodeSourceURLCodeSignerArray() {
         if (!has_15_features()) {
             return;
@@ -180,12 +155,6 @@
     /**
      * equals(Object) must return <code>false</code> for null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Null parameter checked",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEqualsObject_00() {
         CodeSource thiz = new CodeSource(urlSite, (Certificate[]) null);
         assertFalse(thiz.equals(null));
@@ -195,12 +164,6 @@
     /**
      * equals(Object) must return <code>true</code> for the same object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Same objects checked",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEqualsObject_01() {
         CodeSource thiz = new CodeSource(urlSite, (Certificate[]) null);
         assertTrue(thiz.equals(thiz));
@@ -211,12 +174,6 @@
      * The signer certificate chain must contain the same set of certificates, but
      * the order of the certificates is not taken into account.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEqualsObject_02() {
         Certificate cert0 = new TestCertUtils.TestCertificate();
         Certificate cert1 = new TestCertUtils.TestCertificate();
@@ -231,12 +188,6 @@
      * Test for equals(Object)<br>
      * Checks that both 'null' and not-null URLs are taken into account - properly.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEqualsObject_04() {
         CodeSource thiz = new CodeSource(urlSite, (Certificate[]) null);
         CodeSource that = new CodeSource(null, (Certificate[]) null);
@@ -251,12 +202,6 @@
     /**
      * Tests CodeSource.getCertificates().
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getCertificates",
-        args = {}
-    )
     public void testGetCertificates_00() {
         assertNull(new CodeSource(null, (Certificate[]) null).getCertificates());
         java.security.cert.Certificate[] got = new CodeSource(null, chain)
@@ -271,12 +216,6 @@
      * Tests whether the getCertificates() returns certificates obtained from
      * the signers.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getCertificates",
-        args = {}
-    )
     public void testGetCertificates_01() {
         if (!has_15_features()) {
             return;
@@ -375,12 +314,6 @@
     /**
      * Tests CodeSource.getCodeSigners().
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getCodeSigners",
-        args = {}
-    )
     public void testGetCodeSigners_00() {
         if (!has_15_features()) {
             return;
@@ -408,12 +341,6 @@
     /**
      * Tests CodeSource.getCodeSigners() for null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getCodeSigners",
-        args = {}
-    )
     public void testGetCoderSignersNull() throws Exception{
         assertNull(new CodeSource(new URL("http://url"), (Certificate[])null).getCodeSigners());
     }
@@ -421,12 +348,6 @@
     /**
      * Tests CodeSource.getLocation()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLocation",
-        args = {}
-    )
     public void testGetLocation() {
         assertTrue(new CodeSource(urlSite, (Certificate[]) null).getLocation() == urlSite);
         assertTrue(new CodeSource(urlSite, chain).getLocation() == urlSite);
@@ -437,12 +358,6 @@
     /**
      * Tests CodeSource.toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         // Javadoc keeps silence about String's format,
         // just make sure it can be invoked.
@@ -473,12 +388,6 @@
     /**
      * must not imply null CodeSource
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_00() {
         CodeSource cs0 = new CodeSource(null, (Certificate[]) null);
         assertFalse(cs0.implies(null));
@@ -488,12 +397,6 @@
      * CodeSource with location=null && Certificate[] == null implies any other
      * CodeSource
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_01() throws Exception {
         CodeSource thizCS = new CodeSource(urlSite, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(null, (Certificate[]) null);
@@ -503,12 +406,6 @@
         assertFalse(thizCS.implies(thatCS));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_02() throws Exception {
         CodeSource thizCS = new CodeSource(urlSite, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(thizCS.getLocation(),
@@ -529,12 +426,6 @@
      assertFalse(thatCS.implies(thizCS));
      }
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_03_tmp() throws Exception {
         CodeSource thizCS = new CodeSource(urlDir, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(urlDir_FileProtocol,
@@ -543,12 +434,6 @@
         assertFalse(thatCS.implies(thizCS));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_04() throws Exception {
         CodeSource thizCS = new CodeSource(urlDir, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(urlDirIP, (Certificate[]) null);
@@ -574,12 +459,6 @@
         assertFalse(thatCS.implies(thizCS));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_05() throws Exception {
         CodeSource thizCS = new CodeSource(urlDir_port80, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(urlDir, (Certificate[]) null);
@@ -601,24 +480,12 @@
         assertFalse(thizCS.implies(thatCS));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_06() throws Exception {
         CodeSource thizCS = new CodeSource(urlFile, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(urlFile, (Certificate[]) null);
         assertTrue(thizCS.implies(thatCS));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_07() throws Exception {
         CodeSource thiz = new CodeSource(urlFileDirMinus, (Certificate[]) null);
         CodeSource that = new CodeSource(urlFile, (Certificate[]) null);
@@ -631,12 +498,6 @@
         assertFalse(thiz.implies(that));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_08() throws Exception {
         CodeSource thiz = new CodeSource(urlFileDirStar, (Certificate[]) null);
         CodeSource that = new CodeSource(urlFile, (Certificate[]) null);
@@ -652,12 +513,6 @@
         assertFalse(thiz.implies(that));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_09() throws Exception {
         CodeSource thizCS = new CodeSource(urlDir, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(urlDirWithSlash,
@@ -666,12 +521,6 @@
         assertFalse(thatCS.implies(thizCS));
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_0A() throws Exception {
         CodeSource thizCS = new CodeSource(urlRef1, (Certificate[]) null);
         CodeSource thatCS = new CodeSource(urlRef1, (Certificate[]) null);
@@ -687,12 +536,6 @@
      * If this certificates are not null, then all of this certificates should
      * be presented in certificates of that codesource.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_0B() {
 
         Certificate c0 = new TestCertUtils.TestCertificate("00");
@@ -719,12 +562,6 @@
      * These special URLs have a special processing in implies(),
      * so they need to be covered and performance need to be checked
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_0C() throws Exception {
         URL url0 = new URL("http://localhost/someDir");
         URL url1 = new URL("http://localhost/someOtherDir");
@@ -740,12 +577,6 @@
      * These special URLs have a special processing in implies(),
      * so they need to be covered and performance need to be checked
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.CodeSource.class}
-    )
     public void testImplies_0D() throws Exception {
         URL url0 = new URL("file:///" + System.getProperty("java.io.tmpdir")
                 + File.separator + "someDir");
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestExceptionTest.java
index f266498..99dcc6f 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.DigestException;
 
 import junit.framework.TestCase;
-@TestTargetClass(DigestException.class)
+
 /**
  * Tests for <code>DigestException</code> class constructors and methods.
  *
@@ -48,12 +43,6 @@
      * Test for <code>DigestException()</code> constructor Assertion:
      * constructs DigestException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "DigestException",
-        args = {}
-    )
     public void testDigestException01() {
         DigestException tE = new DigestException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -65,12 +54,6 @@
      * constructs DigestException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies case with differents parameters (parameter is not null)",
-        method = "DigestException",
-        args = {java.lang.String.class}
-    )
     public void testDigestException02() {
         DigestException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -85,12 +68,6 @@
      * Test for <code>DigestException(String)</code> constructor Assertion:
      * constructs DigestException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies case with null parameter",
-        method = "DigestException",
-        args = {java.lang.String.class}
-    )
     public void testDigestException03() {
         String msg = null;
         DigestException tE = new DigestException(msg);
@@ -102,12 +79,6 @@
      * Test for <code>DigestException(Throwable)</code> constructor Assertion:
      * constructs DigestException when <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies case with null parameter",
-        method = "DigestException",
-        args = {java.lang.Throwable.class}
-    )
     public void testDigestException04() {
         Throwable cause = null;
         DigestException tE = new DigestException(cause);
@@ -119,12 +90,6 @@
      * Test for <code>DigestException(Throwable)</code> constructor Assertion:
      * constructs DigestException when <code>cause</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies case with not null parameter",
-        method = "DigestException",
-        args = {java.lang.Throwable.class}
-    )
     public void testDigestException05() {
         DigestException tE = new DigestException(tCause);
         if (tE.getMessage() != null) {
@@ -143,12 +108,6 @@
      * Assertion: constructs DigestException when <code>cause</code> is null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "DigestException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testDigestException06() {
         DigestException tE = new DigestException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -160,12 +119,6 @@
      * Assertion: constructs DigestException when <code>cause</code> is null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "DigestException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testDigestException07() {
         DigestException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -181,12 +134,6 @@
      * Assertion: constructs DigestException when <code>cause</code> is not
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "DigestException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testDigestException08() {
         DigestException tE = new DigestException(null, tCause);
         if (tE.getMessage() != null) {
@@ -205,12 +152,6 @@
      * Assertion: constructs DigestException when <code>cause</code> is not
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "DigestException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testDigestException09() {
         DigestException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestInputStreamTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestInputStreamTest.java
index e01adcb..228462a 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestInputStreamTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/DigestInputStreamTest.java
@@ -34,11 +34,6 @@
 
 import org.apache.harmony.security.tests.support.MDGoldenData;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-@TestTargetClass(DigestInputStream.class)
 /**
  * Tests for fields and methods of class <code>DigestInputStream</code>
  *
@@ -82,12 +77,6 @@
      *
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies both non null parameters",
-        method = "DigestInputStream",
-        args = {java.io.InputStream.class, java.security.MessageDigest.class}
-    )
     public final void testDigestInputStream01()  {
         for (int i=0; i<algorithmName.length; i++) {
             try {
@@ -109,12 +98,6 @@
      * Assertion: creates new <code>DigestInputStream</code> instance
      * using valid parameters (both <code>null</code>)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies both null parameters. Need cases where just one parameter null",
-        method = "DigestInputStream",
-        args = {java.io.InputStream.class, java.security.MessageDigest.class}
-    )
     public final void testDigestInputStream02() {
         InputStream dis = new DigestInputStream(null, null);
         assertTrue(dis instanceof DigestInputStream);
@@ -126,12 +109,6 @@
      * Assertion: returns the byte read<br>
      * Assertion: updates associated digest<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {}
-    )
     public final void testRead01()
         throws IOException {
         for (int ii=0; ii<algorithmName.length; ii++) {
@@ -165,12 +142,6 @@
      * Assertion: must not update digest if EOS had been
      * reached but not read before method call<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {}
-    )
     public final void testRead02()
         throws IOException {
         for (int ii=0; ii<algorithmName.length; ii++) {
@@ -206,12 +177,6 @@
      * (if <code>true</code> passed as a parameter) or off (if <code>false</code>
      *  passed)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {}
-    )
     public final void testRead03()
         throws IOException {
         for (int ii=0; ii<algorithmName.length; ii++) {
@@ -245,12 +210,6 @@
      * <code>InputStream</code> not set. <code>read()</code> must
      * not work
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "IOException is not tested",
-        method = "read",
-        args = {}
-    )
     public final void testRead04() throws IOException {
         for (int ii=0; ii<algorithmName.length; ii++) {
             try {
@@ -283,12 +242,6 @@
      * <code>read()</code> must not work when digest
      * functionality is on
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "IOException is not tested",
-        method = "read",
-        args = {}
-    )
     public final void testRead05() {
         InputStream is = new ByteArrayInputStream(myMessage);
         DigestInputStream dis = new DigestInputStream(is, null);
@@ -313,12 +266,6 @@
      * <code>read()</code> must work when digest
      * functionality is off
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "read",
-        args = {}
-    )
     public final void testRead06()
         throws IOException {
         InputStream is = new ByteArrayInputStream(myMessage);
@@ -341,11 +288,6 @@
      *
      * Assertion: updates associated digest<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "read",
-        args = {byte[].class, int.class, int.class}
-    )
     public final void testReadbyteArrayintint01()
         throws IOException {
         for (int ii=0; ii<algorithmName.length; ii++) {
@@ -380,11 +322,6 @@
      *
      * Assertion: updates associated digest<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "read",
-        args = {byte[].class, int.class, int.class}
-    )
     public final void testReadbyteArrayintint02()
         throws IOException {
         // check precondition
@@ -425,11 +362,6 @@
      *
      * Assertion: updates associated digest<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "read",
-        args = {byte[].class, int.class, int.class}
-    )
     public final void testReadbyteArrayintint03()
         throws IOException {
         // check precondition
@@ -477,11 +409,6 @@
      *
      * Assertion: updates associated digest<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "read",
-        args = {byte[].class, int.class, int.class}
-    )
     public final void testReadbyteArrayintint04()
         throws IOException {
         for (int ii=0; ii<algorithmName.length; ii++) {
@@ -518,11 +445,6 @@
      * Assertion: does not update associated digest if
      * digest functionality is off<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "read",
-        args = {byte[].class, int.class, int.class}
-    )
     public final void testReadbyteArrayintint05()
         throws IOException {
         // check precondition
@@ -557,12 +479,6 @@
      *
      * Assertion: returns associated message digest<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMessageDigest",
-        args = {}
-    )
     public final void testGetMessageDigest() {
         for (int ii=0; ii<algorithmName.length; ii++) {
             try {
@@ -584,12 +500,6 @@
      *
      * Assertion: set associated message digest<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Method setMessageDigest is not tested with null parameter",
-        method = "setMessageDigest",
-        args = {java.security.MessageDigest.class}
-    )
     public final void testSetMessageDigest() {
         for (int ii=0; ii<algorithmName.length; ii++) {
             try {
@@ -610,12 +520,6 @@
      * Test for <code>on()</code> method<br>
      * Assertion: turns digest functionality on or off
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "on",
-        args = {boolean.class}
-    )
     public final void testOn() throws IOException {
         for (int ii=0; ii<algorithmName.length; ii++) {
             try {
@@ -655,12 +559,6 @@
      * Test for <code>toString()</code> method<br>
      * Assertion: returns <code>String</code> representation of this object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() {
         for (int ii=0; ii<algorithmName.length; ii++) {
             try {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/GeneralSecurityExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/GeneralSecurityExceptionTest.java
index 218b4fe..0073432 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/GeneralSecurityExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/GeneralSecurityExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.GeneralSecurityException;
 
 import junit.framework.TestCase;
-@TestTargetClass(GeneralSecurityException.class)
+
 /**
  * Tests for <code>GeneralSecurityException</code> class constructors and
  * methods.
@@ -49,12 +44,6 @@
      * Test for <code>GeneralSecurityException()</code> constructor Assertion:
      * constructs GeneralSecurityException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {}
-    )
     public void testGeneralSecurityException01() {
         GeneralSecurityException tE = new GeneralSecurityException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +55,6 @@
      * Assertion: constructs GeneralSecurityException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.String.class}
-    )
     public void testGeneralSecurityException02() {
         GeneralSecurityException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +70,6 @@
      * Assertion: constructs GeneralSecurityException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.String.class}
-    )
     public void testGeneralSecurityException03() {
         String msg = null;
         GeneralSecurityException tE = new GeneralSecurityException(msg);
@@ -105,12 +82,6 @@
      * Assertion: constructs GeneralSecurityException when <code>cause</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.Throwable.class}
-    )
     public void testGeneralSecurityException04() {
         Throwable cause = null;
         GeneralSecurityException tE = new GeneralSecurityException(cause);
@@ -123,12 +94,6 @@
      * Assertion: constructs GeneralSecurityException when <code>cause</code>
      * is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.Throwable.class}
-    )
     public void testGeneralSecurityException05() {
         GeneralSecurityException tE = new GeneralSecurityException(tCause);
         if (tE.getMessage() != null) {
@@ -147,12 +112,6 @@
      * constructor Assertion: constructs GeneralSecurityException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testGeneralSecurityException06() {
         GeneralSecurityException tE = new GeneralSecurityException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -164,12 +123,6 @@
      * constructor Assertion: constructs GeneralSecurityException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testGeneralSecurityException07() {
         GeneralSecurityException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -185,12 +138,6 @@
      * constructor Assertion: constructs GeneralSecurityException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testGeneralSecurityException08() {
         GeneralSecurityException tE = new GeneralSecurityException(null, tCause);
         if (tE.getMessage() != null) {
@@ -209,12 +156,6 @@
      * constructor Assertion: constructs GeneralSecurityException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GeneralSecurityException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testGeneralSecurityException09() {
         GeneralSecurityException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/GuardedObjectTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/GuardedObjectTest.java
index b30f292..498ca77 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/GuardedObjectTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/GuardedObjectTest.java
@@ -22,38 +22,18 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.Guard;
 import java.security.GuardedObject;
 
 import junit.framework.TestCase;
-@TestTargetClass(GuardedObject.class)
+
 /**
  * Tests for <code>GuardedObject</code>
  *
  */
-
 public class GuardedObjectTest extends TestCase {
 
     /** Null guard imposes no restriction. */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "GuardedObject",
-            args = {java.lang.Object.class, java.security.Guard.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getObject",
-            args = {}
-        )
-    })
     public void testNoGuard() {
         Object obj = null;
         GuardedObject go = new GuardedObject(obj, null);
@@ -65,20 +45,6 @@
     }
 
     /** Test real guard can both allow and deny access. */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "GuardedObject",
-            args = {java.lang.Object.class, java.security.Guard.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getObject",
-            args = {}
-        )
-    })
     public void testGuard() {
         final String message = "test message";
         final StringBuffer objBuffer = new StringBuffer("235345 t");
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Identity2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Identity2Test.java
index 6ae5424..c1a7ac4 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Identity2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Identity2Test.java
@@ -34,64 +34,8 @@
 import org.apache.harmony.security.tests.java.security.IdentityScope2Test.IdentityScopeSubclass;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
 @SuppressWarnings("deprecation")
-@TestTargetClass(value=Identity.class,
-        untestedMethods={
-            @TestTargetNew(
-                    level=TestLevel.NOT_NECESSARY,
-                    clazz=Certificate.class,
-                    method="getGuarantor",
-                    args={},
-                    notes="no implementation"
-            ),
-            @TestTargetNew(
-                    level=TestLevel.NOT_NECESSARY,
-                    clazz=Certificate.class,
-                    method="encode",
-                    args={OutputStream.class},
-                    notes="no implementation"
-            ),
-            @TestTargetNew(
-                    level=TestLevel.NOT_NECESSARY,
-                    clazz=Certificate.class,
-                    method="decode",
-                    args={InputStream.class},
-                    notes="no implementation"
-            ),
-            @TestTargetNew(
-                    level=TestLevel.NOT_NECESSARY,
-                    clazz=Certificate.class,
-                    method="toString",
-                    args={boolean.class},
-                    notes="no implementation"
-            ),
-            @TestTargetNew(
-                    level=TestLevel.NOT_NECESSARY,
-                    clazz=Certificate.class,
-                    method="getFormat",
-                    args={},
-                    notes="no implementation"
-            ),
-            @TestTargetNew(
-                    level=TestLevel.NOT_NECESSARY,
-                    clazz=Certificate.class,
-                    method="getPrincipal",
-                    args={},
-                    notes="no implementation"
-            ),
-            @TestTargetNew(
-                    level=TestLevel.NOT_NECESSARY,
-                    clazz=Certificate.class,
-                    method="getPublicKey",
-                    args={},
-                    notes="no implementation"
-            )
-})
 public class Identity2Test extends junit.framework.TestCase {
 
     static PublicKey pubKey;
@@ -199,27 +143,15 @@
     }
 
     /**
-     * @tests java.security.Identity#Identity()
+     * java.security.Identity#Identity()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Identity",
-        args = {}
-    )
     public void test_Constructor() {
         new IdentitySubclass();
     }
 
     /**
-     * @tests java.security.Identity#Identity(java.lang.String)
+     * java.security.Identity#Identity(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Identity",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         String[] str = {"test", "", null};
         IdentitySubclass is;
@@ -235,15 +167,9 @@
     }
 
     /**
-     * @tests java.security.Identity#Identity(java.lang.String,
+     * java.security.Identity#Identity(java.lang.String,
      *        java.security.IdentityScope)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Identity",
-        args = {java.lang.String.class, java.security.IdentityScope.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() {
         String nameNull = null;
         String[] str = {"test", "", "!@#$%^&*()", "identity name"};
@@ -280,14 +206,8 @@
     }
 
     /**
-     * @tests java.security.Identity#getScope()
+     * java.security.Identity#getScope()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getScope",
-        args = {}
-    )
     public void test_getScope() throws Exception {
                IdentityScope scope = new IdentityScopeSubclass();
                IdentitySubclass sub = new IdentitySubclass("test", scope);
@@ -296,14 +216,8 @@
     }
 
     /**
-     * @tests java.security.Identity#getPublicKey()
+     * java.security.Identity#getPublicKey()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicKey",
-        args = {}
-    )
     public void test_getPublicKey() throws Exception {
                IdentitySubclass sub = new IdentitySubclass("test",
                        new IdentityScopeSubclass());
@@ -313,14 +227,8 @@
     }
 
     /**
-     * @tests java.security.Identity#getName()
+     * java.security.Identity#getName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() throws Exception {
                String name = "test";
                IdentitySubclass sub = new IdentitySubclass(name,
@@ -329,14 +237,8 @@
     }
 
     /**
-     * @tests java.security.Identity#getInfo()
+     * java.security.Identity#getInfo()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInfo",
-        args = {}
-    )
     public void test_getInfo() throws Exception {
                String info = "This is the general information.";
                IdentitySubclass sub = new IdentitySubclass("test",
@@ -346,14 +248,8 @@
     }
 
     /**
-     * @tests java.security.Identity#certificates()
+     * java.security.Identity#certificates()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "certificates",
-        args = {}
-    )
     public void test_certificates() throws Exception {
                IdentitySubclass sub = new IdentitySubclass("test",
                        new IdentityScopeSubclass());
@@ -369,20 +265,8 @@
     }
 
     /**
-     * @tests java.security.Identity#removeCertificate(java.security.Certificate)
+     * java.security.Identity#removeCertificate(java.security.Certificate)
      */
-    @TestTargets({
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "addCertificate",
-                args = {java.security.Certificate.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "removeCertificate",
-                args = {java.security.Certificate.class}
-        )
-    })
     @AndroidOnly("Spec says: Removing unknown certificates throw an exception. "
             + "The RI ignores unknown certificates.")
     public void test_removeCertificateLjava_security_Certificate() throws Exception {
@@ -419,14 +303,8 @@
     }
 
     /**
-     * @tests java.security.Identity#equals(java.lang.Object)
+     * java.security.Identity#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() throws Exception {
                IdentitySubclass sub = new IdentitySubclass("test",
                        new IdentityScopeSubclass());
@@ -448,14 +326,8 @@
     }
 
     /**
-     * @tests java.security.Identity#identityEquals(java.security.Identity)
+     * java.security.Identity#identityEquals(java.security.Identity)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Method identityEquals(java.security.Identity) is not tested",
-        method = "identityEquals",
-        args = {java.security.Identity.class}
-    )
     public void test_identityEqualsLjava_security_Identity() throws Exception {
                IdentitySubclass sub = new IdentitySubclass("test", null);
                CertificateFactory cf = CertificateFactory.getInstance("X.509");
@@ -471,14 +343,8 @@
     }
 
     /**
-     * @tests java.security.Identity#toString()
+     * java.security.Identity#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
                IdentitySubclass sub = new IdentitySubclass("test", null);
                assertNotNull(sub.toString());
@@ -489,14 +355,8 @@
     }
 
     /**
-     * @tests java.security.Identity#toString(boolean)
+     * java.security.Identity#toString(boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {boolean.class}
-    )
     public void test_toStringZ() throws Exception {
                IdentitySubclass sub = new IdentitySubclass("test", null);
                assertNotNull(sub.toString(true));
@@ -505,14 +365,8 @@
     }
 
     /**
-     * @tests java.security.Identity#hashCode()
+     * java.security.Identity#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
                IdentitySubclass sub = new IdentitySubclass("test", null);
                IdentitySubclass sub2 = new IdentitySubclass("test", null);
@@ -521,14 +375,8 @@
     }
 
     /**
-     * @tests java.security.Identity#setInfo(String)
+     * java.security.Identity#setInfo(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setInfo",
-        args = {java.lang.String.class}
-    )
     public void testSetInfo() throws Exception{
         String[] info = {"This is the general information.", "test", "", null};
         IdentitySubclass sub = new IdentitySubclass("test", new IdentityScopeSubclass());
@@ -545,14 +393,8 @@
     }
 
     /**
-     * @tests java.security.Identity#setPublicKey(PublicKey key)
+     * java.security.Identity#setPublicKey(PublicKey key)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "SecurityException is not checked",
-        method = "setPublicKey",
-        args = {java.security.PublicKey.class}
-    )
     public void testSetPublicKey() throws Exception{
         IdentitySubclass sub = new IdentitySubclass("test",
                    new IdentityScopeSubclass());
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java
index 639f074..3562dce 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScope2Test.java
@@ -27,11 +27,7 @@
 
 import org.apache.harmony.security.tests.java.security.Identity2Test.IdentitySubclass;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 @SuppressWarnings("deprecation")
-@TestTargetClass(IdentityScope.class)
 public class IdentityScope2Test extends junit.framework.TestCase {
 
     static PublicKey pubKey;
@@ -119,27 +115,15 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#IdentityScope()
+     * java.security.IdentityScope#IdentityScope()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IdentityScope",
-        args = {}
-    )
     public void test_Constructor() {
         new IdentityScopeSubclass();
     }
 
     /**
-     * @tests java.security.IdentityScope#IdentityScope(java.lang.String)
+     * java.security.IdentityScope#IdentityScope(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IdentityScope",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         String[] str = {"test", "", null};
         IdentityScopeSubclass iss;
@@ -156,15 +140,9 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#IdentityScope(java.lang.String,
+     * java.security.IdentityScope#IdentityScope(java.lang.String,
      *        java.security.IdentityScope)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IdentityScope",
-        args = {java.lang.String.class, java.security.IdentityScope.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_security_IdentityScope() {
         String nameNull = null;
         String[] str = {"test", "", "!@#$%^&*()", "identity name"};
@@ -200,14 +178,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#addIdentity(java.security.Identity)
+     * java.security.IdentityScope#addIdentity(java.security.Identity)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addIdentity",
-        args = {java.security.Identity.class}
-    )
     public void test_addIdentityLjava_security_Identity() throws Exception {
                IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
                        new IdentityScopeSubclass());
@@ -225,14 +197,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#removeIdentity(java.security.Identity)
+     * java.security.IdentityScope#removeIdentity(java.security.Identity)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeIdentity",
-        args = {java.security.Identity.class}
-    )
     public void test_removeIdentityLjava_security_Identity() throws Exception {
                IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
                        new IdentityScopeSubclass());
@@ -249,14 +215,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#identities()
+     * java.security.IdentityScope#identities()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "identities",
-        args = {}
-    )
     public void test_identities() throws Exception {
                IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
                        new IdentityScopeSubclass());
@@ -270,13 +230,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#getIdentity(java.security.Principal)
+     * java.security.IdentityScope#getIdentity(java.security.Principal)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getIdentity",
-        args = {java.security.Principal.class}
-    )
     public void test_getIdentityLjava_security_Principal() throws Exception {
         Identity id = new IdentitySubclass("principal name");
         id.setPublicKey(pubKey);
@@ -311,13 +266,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#getIdentity(java.security.PublicKey)
+     * java.security.IdentityScope#getIdentity(java.security.PublicKey)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getIdentity",
-        args = {java.security.PublicKey.class}
-    )
     public void test_getIdentityLjava_security_PublicKey() throws Exception {
         IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
                 new IdentityScopeSubclass());
@@ -337,14 +287,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#getIdentity(java.lang.String)
+     * java.security.IdentityScope#getIdentity(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getIdentity",
-        args = {java.lang.String.class}
-    )
     public void test_getIdentityLjava_lang_String() throws Exception {
                IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
                        new IdentityScopeSubclass());
@@ -357,14 +301,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#size()
+     * java.security.IdentityScope#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() throws Exception {
                IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
                        new IdentityScopeSubclass());
@@ -375,14 +313,8 @@
     }
 
     /**
-     * @tests java.security.IdentityScope#toString()
+     * java.security.IdentityScope#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
             IdentityScopeSubclass sub = new IdentityScopeSubclass("test",
                     new IdentityScopeSubclass());
@@ -393,12 +325,6 @@
             assertTrue("Not a valid String ", sub.toString().length() > 0);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test",
-        method = "getIdentity",
-        args = {java.lang.String.class}
-    )
     public void test_getIdentity() throws Exception {
         //Regression for HARMONY-1173
         IdentityScope scope = IdentityScope.getSystemScope();
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScopeTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScopeTest.java
index 4c7aaa4..6d97caa 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScopeTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/IdentityScopeTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.IdentityScope;
 import java.security.Permission;
 import java.security.Permissions;
@@ -36,7 +31,7 @@
 import org.apache.harmony.security.tests.support.IdentityScopeStub;
 
 import junit.framework.TestCase;
-@TestTargetClass(IdentityScope.class)
+
 /**
  * Tests for <code>IdentityScope</code>
  *
@@ -56,12 +51,6 @@
     /**
      * Class under test for String toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() {
         assertNotNull(new IdentityScopeStub("Aleksei Semenov").toString());
     }
@@ -69,12 +58,6 @@
     /**
      * test default constructor void IdentityScope()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IdentityScope",
-        args = {}
-    )
     public final void testIdentityScope() {
         assertNotNull(new IdentityScopeStub());
     }
@@ -82,12 +65,6 @@
     /**
      * check that void IdentityScope(String) creates instance with given name
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies just positive case with non null parameter",
-        method = "IdentityScope",
-        args = {java.lang.String.class}
-    )
     public final void testIdentityScopeString() {
         is = new IdentityScopeStub("Aleksei Semenov");
         assertNotNull(is);
@@ -97,12 +74,6 @@
     /**
      * check that void IdentityScope(String, IdentityScope) creates instance with given name and within given scope
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies just positive test with both non null parameters",
-        method = "IdentityScope",
-        args = {java.lang.String.class, java.security.IdentityScope.class}
-    )
     public final void testIdentityScopeStringIdentityScope() throws Exception {
         IdentityScope scope = new IdentityScopeStub("my scope");
         is = new IdentityScopeStub("Aleksei Semenov", scope);
@@ -114,12 +85,6 @@
     /**
      * just call IdentityScope.getSystemScope()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSystemScope",
-        args = {}
-    )
     public final void testGetSystemScope() {
         String name = Security.getProperty("system.scope");
         assertNotNull(name);
@@ -133,20 +98,6 @@
      * if permission is denied than SecurityException is thrown
      *
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setSystemScope",
-            args = {java.security.IdentityScope.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSystemScope",
-            args = {}
-        )
-    })
     public final void testSetSystemScope() {
 //      default implementation is specified by security property system.scope
         IdentityScope systemScope = IdentityScope.getSystemScope();
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterExceptionTest.java
index 5612e30..890419e 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidAlgorithmParameterExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidAlgorithmParameterException;
 
 import junit.framework.TestCase;
-@TestTargetClass(InvalidAlgorithmParameterException.class)
+
 /**
  * Tests for <code>InvalidAlgorithmParameterException</code> class
  * constructors and methods.
@@ -50,12 +45,6 @@
      * Assertion: constructs InvalidAlgorithmParameterException with no detail
      * message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {}
-    )
     public void testInvalidAlgorithmParameterException01() {
         InvalidAlgorithmParameterException tE = new InvalidAlgorithmParameterException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -67,12 +56,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException with
      * detail message msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidAlgorithmParameterException02() {
         InvalidAlgorithmParameterException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -88,12 +71,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException when
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidAlgorithmParameterException03() {
         String msg = null;
         InvalidAlgorithmParameterException tE = new InvalidAlgorithmParameterException(
@@ -107,12 +84,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException when
      * <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.Throwable.class}
-    )
     public void testInvalidAlgorithmParameterException04() {
         Throwable cause = null;
         InvalidAlgorithmParameterException tE = new InvalidAlgorithmParameterException(
@@ -126,12 +97,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException when
      * <code>cause</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.Throwable.class}
-    )
     public void testInvalidAlgorithmParameterException05() {
         InvalidAlgorithmParameterException tE = new InvalidAlgorithmParameterException(
                 tCause);
@@ -152,12 +117,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidAlgorithmParameterException06() {
         InvalidAlgorithmParameterException tE = new InvalidAlgorithmParameterException(
                 null, null);
@@ -171,12 +130,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidAlgorithmParameterException07() {
         InvalidAlgorithmParameterException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -193,12 +146,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidAlgorithmParameterException08() {
         InvalidAlgorithmParameterException tE = new InvalidAlgorithmParameterException(
                 null, tCause);
@@ -219,12 +166,6 @@
      * constructor Assertion: constructs InvalidAlgorithmParameterException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidAlgorithmParameterException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidAlgorithmParameterException09() {
         InvalidAlgorithmParameterException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidKeyExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidKeyExceptionTest.java
index 2bc6f7e..fa855cf 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidKeyExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidKeyExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidKeyException;
 
 import junit.framework.TestCase;
-@TestTargetClass(InvalidKeyException.class)
+
 /**
  * Tests for <code>InvalidKeyException</code> class constructors and methods.
  *
@@ -48,12 +43,6 @@
      * Test for <code>InvalidKeyException()</code> constructor Assertion:
      * constructs InvalidKeyException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {}
-    )
     public void testInvalidKeyException01() {
         InvalidKeyException tE = new InvalidKeyException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -65,12 +54,6 @@
      * Assertion: constructs InvalidKeyException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidKeyException02() {
         InvalidKeyException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -85,12 +68,6 @@
      * Test for <code>InvalidKeyException(String)</code> constructor
      * Assertion: constructs InvalidKeyException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidKeyException03() {
         String msg = null;
         InvalidKeyException tE = new InvalidKeyException(msg);
@@ -103,12 +80,6 @@
      * Assertion: constructs InvalidKeyException when <code>cause</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.Throwable.class}
-    )
     public void testInvalidKeyException04() {
         Throwable cause = null;
         InvalidKeyException tE = new InvalidKeyException(cause);
@@ -121,12 +92,6 @@
      * Assertion: constructs InvalidKeyException when <code>cause</code> is
      * not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.Throwable.class}
-    )
     public void testInvalidKeyException05() {
         InvalidKeyException tE = new InvalidKeyException(tCause);
         if (tE.getMessage() != null) {
@@ -145,12 +110,6 @@
      * constructor Assertion: constructs InvalidKeyException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeyException06() {
         InvalidKeyException tE = new InvalidKeyException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -162,12 +121,6 @@
      * constructor Assertion: constructs InvalidKeyException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeyException07() {
         InvalidKeyException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -183,12 +136,6 @@
      * constructor Assertion: constructs InvalidKeyException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeyException08() {
         InvalidKeyException tE = new InvalidKeyException(null, tCause);
         if (tE.getMessage() != null) {
@@ -207,12 +154,6 @@
      * constructor Assertion: constructs InvalidKeyException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeyException09() {
         InvalidKeyException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidParameterExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidParameterExceptionTest.java
index 0359102..1d9b9cc 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidParameterExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/InvalidParameterExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidParameterException;
 
 import junit.framework.TestCase;
-@TestTargetClass(InvalidParameterException.class)
+
 /**
  * Tests for <code>InvalidParameterException</code> class constructors and
  * methods.
@@ -49,12 +44,6 @@
      * Test for <code>InvalidParameterException()</code> constructor
      * Assertion: constructs InvalidParameterException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvalidParameterException",
-        args = {}
-    )
     public void testInvalidParameterException01() {
         InvalidParameterException tE = new InvalidParameterException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +55,6 @@
      * Assertion: constructs InvalidParameterException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidParameterException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidParameterException02() {
         InvalidParameterException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +70,6 @@
      * Assertion: constructs InvalidParameterException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidParameterException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidParameterException03() {
         String msg = null;
         InvalidParameterException tE = new InvalidParameterException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSCallbackHandlerProtectionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSCallbackHandlerProtectionTest.java
index 7ce831c..467444e 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSCallbackHandlerProtectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSCallbackHandlerProtectionTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.security.KeyStore;
 
@@ -37,12 +32,11 @@
 import org.apache.harmony.security.tests.support.tmpCallbackHandler;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyStore.CallbackHandlerProtection.class)
+
 /**
  * Tests for <code>KeyStore.CallbackHandlerProtection> class constructor and methods
  *
  */
-
 public class KSCallbackHandlerProtectionTest extends TestCase {
 
     /**
@@ -50,12 +44,6 @@
      * constructor
      * Assertion: throws NullPointerException when handler is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CallbackHandlerProtection",
-        args = {javax.security.auth.callback.CallbackHandler.class}
-    )
     public void testCallbackHandlerProtection() {
         try {
             new KeyStore.CallbackHandlerProtection(null);
@@ -84,20 +72,6 @@
      * Test for <code>getCallbackHandler()</code> method
      * Assertion: returns CallbackHandler
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "CallbackHandlerProtection",
-            args = {javax.security.auth.callback.CallbackHandler.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getCallbackHandler",
-            args = {}
-        )
-    })
     public void testGetCallBackHandler() {
         CallbackHandler cbh = new tmpCallbackHandler();
         KeyStore.CallbackHandlerProtection ksCBH = new KeyStore.CallbackHandlerProtection(cbh);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPasswordProtectionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPasswordProtectionTest.java
index 5db4e2f..af811b0 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPasswordProtectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPasswordProtectionTest.java
@@ -22,22 +22,16 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyStore;
 
 import javax.security.auth.DestroyFailedException;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyStore.PasswordProtection.class)
+
 /**
  * Tests for <code>KeyStore.PasswordProtection</code> class constructor and methods
  *
  */
-
 public class KSPasswordProtectionTest extends TestCase {
 
     /**
@@ -50,32 +44,6 @@
      * getPassword() returns password or throws IllegalArgumentException
      * if PasswordProtection is destroyed
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "PasswordProtection",
-            args = {char[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPassword",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isDestroyed",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "",
-            method = "destroy",
-            args = {}
-        )
-    })
     public void testGetPassword() throws DestroyFailedException {
         char [] pass = {'a', 'b', 'c'};
         KeyStore.PasswordProtection ksPWP = new KeyStore.PasswordProtection(pass);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPrivateKeyEntryTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPrivateKeyEntryTest.java
index 8c50763..53956ef 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPrivateKeyEntryTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSPrivateKeyEntryTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyStore;
 import java.security.PrivateKey;
 import java.security.cert.Certificate;
@@ -38,12 +33,10 @@
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
-@TestTargetClass(KeyStore.PrivateKeyEntry.class)
 /**
  * Tests for <code>KeyStore.PrivateKeyEntry</code>  class constructor and methods
  *
  */
-
 public class KSPrivateKeyEntryTest extends TestCase {
 
     private PrivateKey testPrivateKey;
@@ -66,12 +59,6 @@
      * constructor
      * Assertion: throws NullPointerException when privateKey is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "PrivateKeyEntry",
-        args = {java.security.PrivateKey.class, java.security.cert.Certificate[].class}
-    )
     public void testPrivateKeyEntry01() {
         Certificate[] certs = new MyCertificate[1];//new Certificate[1];
         PrivateKey pk = null;
@@ -88,12 +75,6 @@
      * Assertion: throws NullPointerException when chain is null
      * and throws IllegalArgumentException when chain length is 0
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "PrivateKeyEntry",
-        args = {java.security.PrivateKey.class, java.security.cert.Certificate[].class}
-    )
     public void testPrivateKeyEntry02() {
         Certificate[] chain = null;
         PrivateKey pk = new tmpPrivateKey();
@@ -115,12 +96,6 @@
      * Assertion: throws IllegalArgumentException when chain contains certificates
      * of different types
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "PrivateKeyEntry",
-        args = {java.security.PrivateKey.class, java.security.cert.Certificate[].class}
-    )
     public void testPrivateKeyEntry03() {
         createParams(true, false);
         try {
@@ -136,12 +111,6 @@
      * Assertion: throws IllegalArgumentException when algorithm of privateKey
      * does not match the algorithm of PublicKey in the end certificate (with 0 index)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "PrivateKeyEntry",
-        args = {java.security.PrivateKey.class, java.security.cert.Certificate[].class}
-    )
     public void testPrivateKeyEntry04() {
         createParams(false, true);
         try {
@@ -155,12 +124,6 @@
      * Test for <code>getPrivateKey()</code> method
      * Assertion: returns PrivateKey object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrivateKey",
-        args = {}
-    )
     public void testGetPrivateKey() {
         createParams(false, false);
         KeyStore.PrivateKeyEntry ksPKE = new KeyStore.PrivateKeyEntry(
@@ -173,12 +136,6 @@
      * Test for <code>getCertificateChain()</code> method Assertion: returns
      * array of the Certificates corresponding to chain
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertificateChain",
-        args = {}
-    )
     public void testGetCertificateChain() {
         createParams(false, false);
         KeyStore.PrivateKeyEntry ksPKE = new KeyStore.PrivateKeyEntry(
@@ -195,12 +152,6 @@
      * Test for <code>getCertificate()</code> method
      * Assertion: returns end Certificate (with 0 index in chain)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertificate",
-        args = {}
-    )
     public void testGetCertificate() {
         createParams(false, false);
         KeyStore.PrivateKeyEntry ksPKE = new KeyStore.PrivateKeyEntry(
@@ -213,12 +164,6 @@
      * Test for <code>toString()</code> method
      * Assertion: returns non null String
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         createParams(false, false);
         KeyStore.PrivateKeyEntry ksPKE = new KeyStore.PrivateKeyEntry(
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSSecretKeyEntryTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSSecretKeyEntryTest.java
index ed8b60d..f85593e 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSSecretKeyEntryTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSSecretKeyEntryTest.java
@@ -22,34 +22,22 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyStore;
 
 import javax.crypto.SecretKey;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyStore.SecretKeyEntry.class)
+
 /**
  * Tests for <code>KeyStore.SecretKeyEntry</code> class constructor and methods
  *
  */
-
 public class KSSecretKeyEntryTest extends TestCase {
 
     /**
      * Test for <code>SecretKeyEntry(SecretKey secretKey)</code> constructor
      * Assertion: throws NullPointerException when secretKey is null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SecretKeyEntry",
-        args = {javax.crypto.SecretKey.class}
-    )
     public void testSecretKeyEntry() {
         SecretKey sk = null;
         try {
@@ -73,12 +61,6 @@
      * Test for <code>getSecretKey()</code> method
      * Assertion: returns SecretKey from the given entry
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSecretKey",
-        args = {}
-    )
     public void testGetSecretKey() {
         SecretKey sk = new tmpSecretKey();
         KeyStore.SecretKeyEntry ske = new KeyStore.SecretKeyEntry(sk);
@@ -89,12 +71,6 @@
      * Test for <code>toString()</code> method
      * Assertion: returns non null string
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         SecretKey sk = new tmpSecretKey();
         KeyStore.SecretKeyEntry ske = new KeyStore.SecretKeyEntry(sk);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSTrustedCertificateEntryTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSTrustedCertificateEntryTest.java
index 64e4544..5350542 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSTrustedCertificateEntryTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KSTrustedCertificateEntryTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyStore;
 import java.security.cert.Certificate;
 
@@ -34,7 +29,7 @@
 
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyStore.TrustedCertificateEntry.class)
+
 /**
  * Tests for <code>KeyStore.TrustedCertificateEntry</code> class constructor and methods
  *
@@ -47,12 +42,6 @@
      * constructor
      * Assertion: throws NullPointerException when trustCert is null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TrustedCertificateEntry",
-        args = {java.security.cert.Certificate.class}
-    )
     public void testTrustedCertificateEntry() {
         Certificate cert = null;
         try {
@@ -75,12 +64,6 @@
      * Test for <codfe>getTrustedCertificate()</code> method
      * Assertion: returns trusted Certificate from goven entry
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTrustedCertificate",
-        args = {}
-    )
     public void testGetTrustedCertificate() {
         Certificate cert = new MyCertificate("TEST", new byte[10]);
         KeyStore.TrustedCertificateEntry ksTCE =
@@ -92,12 +75,6 @@
      * Test for <codfe>toString()</code> method
      * Assertion: returns non null string
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         Certificate cert = new MyCertificate("TEST", new byte[10]);
         KeyStore.TrustedCertificateEntry ksTCE =
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyExceptionTest.java
index aff89c6..a6e9183 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyException;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyException.class)
+
 /**
  * Tests for <code>KeyException</code> class constructors and methods.
  *
@@ -48,12 +43,6 @@
      * Test for <code>KeyException()</code> constructor Assertion: constructs
      * KeyException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {}
-    )
     public void testKeyException01() {
         KeyException tE = new KeyException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -65,12 +54,6 @@
      * constructs KeyException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.String.class}
-    )
     public void testKeyException02() {
         KeyException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -85,12 +68,6 @@
      * Test for <code>KeyException(String)</code> constructor Assertion:
      * constructs KeyException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.String.class}
-    )
     public void testKeyException03() {
         String msg = null;
         KeyException tE = new KeyException(msg);
@@ -102,12 +79,6 @@
      * Test for <code>KeyException(Throwable)</code> constructor Assertion:
      * constructs KeyException when <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.Throwable.class}
-    )
     public void testKeyException04() {
         Throwable cause = null;
         KeyException tE = new KeyException(cause);
@@ -119,12 +90,6 @@
      * Test for <code>KeyException(Throwable)</code> constructor Assertion:
      * constructs KeyException when <code>cause</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.Throwable.class}
-    )
     public void testKeyException05() {
         KeyException tE = new KeyException(tCause);
         if (tE.getMessage() != null) {
@@ -143,12 +108,6 @@
      * Assertion: constructs KeyException when <code>cause</code> is null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyException06() {
         KeyException tE = new KeyException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -160,12 +119,6 @@
      * Assertion: constructs KeyException when <code>cause</code> is null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyException07() {
         KeyException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -181,12 +134,6 @@
      * Assertion: constructs KeyException when <code>cause</code> is not null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyException08() {
         KeyException tE = new KeyException(null, tCause);
         if (tE.getMessage() != null) {
@@ -205,12 +152,6 @@
      * Assertion: constructs KeyException when <code>cause</code> is not null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyException09() {
         KeyException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactory2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactory2Test.java
index 1ed5909..1be7fa6 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactory2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactory2Test.java
@@ -17,10 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidKeyException;
 import java.security.Key;
 import java.security.KeyFactory;
@@ -41,8 +37,8 @@
 import java.util.Arrays;
 import java.util.Enumeration;
 import java.util.Vector;
+import libcore.java.security.StandardNames;
 
-@TestTargetClass(KeyFactory.class)
 public class KeyFactory2Test extends junit.framework.TestCase {
 
     private static final String KEYFACTORY_ID = "KeyFactory.";
@@ -90,16 +86,6 @@
         return null;
     }
 
-    /**
-     * @tests java.security.KeyFactory#KeyFactory(java.security.KeyFactorySpi,
-     *        java.security.Provider, java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyFactory",
-        args = {java.security.KeyFactorySpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void test_constructor() {
         KeyFactorySpi kfs = new KeyFactorySpiStub();
 
@@ -122,15 +108,6 @@
         }
     }
 
-    /**
-     * @tests java.security.KeyFactory#generatePrivate(java.security.spec.KeySpec)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "generatePrivate",
-        args = {java.security.spec.KeySpec.class}
-    )
     public void test_generatePrivateLjava_security_spec_KeySpec() {
         // Test for method java.security.PrivateKey
         // java.security.KeyFactory.generatePrivate(java.security.spec.KeySpec)
@@ -142,7 +119,7 @@
                         .getInstance(keyfactAlgs[i]);
                 SecureRandom random = new SecureRandom(); // We don't use
                 // getInstance
-                keyGen.initialize(1024, random);
+                keyGen.initialize(StandardNames.getMinimumKeySize(keyfactAlgs[i]), random);
                 KeepAlive keepalive = createKeepAlive(keyfactAlgs[i]);
                 KeyPair keys = keyGen.generateKeyPair();
                 if (keepalive != null) {
@@ -150,7 +127,7 @@
                 }
 
                 KeySpec privateKeySpec = fact.getKeySpec(keys.getPrivate(),
-                        getPrivateKeySpecClass(keyfactAlgs[i]));
+                        StandardNames.getPrivateKeySpecClass(keyfactAlgs[i]));
                 PrivateKey privateKey = fact.generatePrivate(privateKeySpec);
                 boolean samePrivate = Arrays.equals(keys.getPrivate()
                         .getEncoded(), privateKey.getEncoded());
@@ -170,15 +147,6 @@
         }
     }
 
-    /**
-     * @tests java.security.KeyFactory#generatePublic(java.security.spec.KeySpec)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidKeySpecException checking missed",
-        method = "generatePublic",
-        args = {java.security.spec.KeySpec.class}
-    )
     public void test_generatePublicLjava_security_spec_KeySpec() {
         // Test for method java.security.PublicKey
         // java.security.KeyFactory.generatePublic(java.security.spec.KeySpec)
@@ -190,14 +158,14 @@
                         .getInstance(keyfactAlgs[i]);
                 // We don't use getInstance
                 SecureRandom random = new SecureRandom();
-                keyGen.initialize(1024, random);
+                keyGen.initialize(StandardNames.getMinimumKeySize(keyfactAlgs[i]), random);
                 KeepAlive keepalive = createKeepAlive(keyfactAlgs[i]);
                 KeyPair keys = keyGen.generateKeyPair();
                 if (keepalive != null) {
                     keepalive.interrupt();
                 }
                 KeySpec publicKeySpec = fact.getKeySpec(keys.getPublic(),
-                        getPublicKeySpecClass(keyfactAlgs[i]));
+                        StandardNames.getPublicKeySpecClass(keyfactAlgs[i]));
                 PublicKey publicKey = fact.generatePublic(publicKeySpec);
                 boolean samePublic = Arrays.equals(keys.getPublic()
                         .getEncoded(), publicKey.getEncoded());
@@ -214,15 +182,6 @@
         }
     }
 
-    /**
-     * @tests java.security.KeyFactory#getAlgorithm()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() {
         // Test for method java.lang.String
         // java.security.KeyFactory.getAlgorithm()
@@ -240,15 +199,6 @@
         }// end for
     }
 
-    /**
-     * @tests java.security.KeyFactory#getInstance(java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "NoSuchAlgorithmException checking missed",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() {
         // Test for method java.security.KeyFactory
         // java.security.KeyFactory.getInstance(java.lang.String)
@@ -261,18 +211,7 @@
         }// end for
     }
 
-    /**
-     * @tests java.security.KeyFactory#getInstance(java.lang.String,
-     *        java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "NoSuchAlgorithmException, NoSuchProviderException checking missed",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String() {
-
         // Test1: Test for method java.security.KeyFactory
         // java.security.KeyFactory.getInstance(java.lang.String,
         // java.lang.String)
@@ -302,17 +241,7 @@
         }
     }
 
-    /**
-     * @tests java.security.KeyFactory#getInstance(java.lang.String, Provider)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "NoSuchAlgorithmException checking missed",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider() {
-
         // Test1: Test for method java.security.KeyFactory
         // java.security.KeyFactory.getInstance(java.lang.String,
         // java.security.Provider)
@@ -342,16 +271,6 @@
         }
     }
 
-    /**
-     * @tests java.security.KeyFactory#getKeySpec(java.security.Key,
-     *        java.lang.Class)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidKeySpecException checking missed",
-        method = "getKeySpec",
-        args = {java.security.Key.class, java.lang.Class.class}
-    )
     public void test_getKeySpecLjava_security_KeyLjava_lang_Class() {
         // Test for method java.security.spec.KeySpec
         // java.security.KeyFactory.getKeySpec(java.security.Key,
@@ -365,16 +284,16 @@
 
                 // We don't use getInstance
                 SecureRandom random = new SecureRandom();
-                keyGen.initialize(1024, random);
+                keyGen.initialize(StandardNames.getMinimumKeySize(keyfactAlgs[i]), random);
                 KeepAlive keepalive = createKeepAlive(keyfactAlgs[i]);
                 KeyPair keys = keyGen.generateKeyPair();
                 if (keepalive != null) {
                     keepalive.interrupt();
                 }
                 KeySpec privateKeySpec = fact.getKeySpec(keys.getPrivate(),
-                        getPrivateKeySpecClass(keyfactAlgs[i]));
+                        StandardNames.getPrivateKeySpecClass(keyfactAlgs[i]));
                 KeySpec publicKeySpec = fact.getKeySpec(keys.getPublic(),
-                        getPublicKeySpecClass(keyfactAlgs[i]));
+                        StandardNames.getPublicKeySpecClass(keyfactAlgs[i]));
                 PrivateKey privateKey = fact.generatePrivate(privateKeySpec);
                 PublicKey publicKey = fact.generatePublic(publicKeySpec);
                 boolean samePublic = Arrays.equals(keys.getPublic()
@@ -406,15 +325,6 @@
         }
     }
 
-    /**
-     * @tests java.security.KeyFactory#getProvider()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() {
         // Test for method java.security.Provider
         // java.security.KeyFactory.getProvider()
@@ -430,15 +340,6 @@
         }// end for
     }
 
-    /**
-     * @tests java.security.KeyFactory#translateKey(java.security.Key)
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidKeyException checking missed",
-        method = "translateKey",
-        args = {java.security.Key.class}
-    )
     public void test_translateKeyLjava_security_Key() {
         // Test for method java.security.Key
         // java.security.KeyFactory.translateKey(java.security.Key)
@@ -451,7 +352,7 @@
 
                 // We don't use getInstance
                 SecureRandom random = new SecureRandom();
-                keyGen.initialize(1024, random);
+                keyGen.initialize(StandardNames.getMinimumKeySize(keyfactAlgs[i]), random);
                 KeepAlive keepalive = createKeepAlive(keyfactAlgs[i]);
                 KeyPair keys = keyGen.generateKeyPair();
                 if (keepalive != null) {
@@ -504,34 +405,6 @@
         return algs.toArray(new String[algs.size()]);
     }
 
-    /**
-     * Returns the public key spec class for a given algorithm, or null if it is
-     * not known.
-     */
-    private Class<? extends KeySpec> getPrivateKeySpecClass(String algName) {
-        if (algName.equals("RSA")) {
-            return java.security.spec.RSAPrivateCrtKeySpec.class;
-        }
-        if (algName.equals("DSA")) {
-            return java.security.spec.DSAPrivateKeySpec.class;
-        }
-        return null;
-    }
-
-    /**
-     * Returns the private key spec class for a given algorithm, or null if it
-     * is not known.
-     */
-    private Class<? extends KeySpec> getPublicKeySpecClass(String algName) {
-        if (algName.equals("RSA")) {
-            return java.security.spec.RSAPublicKeySpec.class;
-        }
-        if (algName.equals("DSA")) {
-            return java.security.spec.DSAPublicKeySpec.class;
-        }
-        return null;
-    }
-
     public class KeyFactoryStub extends KeyFactory {
         public KeyFactoryStub(KeyFactorySpi keyFacSpi, Provider provider,
                 String algorithm) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactorySpiTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactorySpiTest.java
index faced3c..39a367f 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactorySpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactorySpiTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyFactorySpi;
 import java.security.PrivateKey;
 import java.security.spec.KeySpec;
@@ -35,45 +30,12 @@
  * and methods.
  *
  */
-@TestTargetClass(KeyFactorySpi.class)
 public class KeyFactorySpiTest extends TestCase {
 
     /**
      * Test for <code>KeyFactorySpi</code> constructor
      * Assertion: constructs KeyFactorySpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "KeyFactorySpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGeneratePrivate",
-            args = {java.security.spec.KeySpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGeneratePublic",
-            args = {java.security.spec.KeySpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineTranslateKey",
-            args = {java.security.Key.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetKeySpec",
-            args = {java.security.Key.class, java.lang.Class.class}
-        )
-    })
     public void testKeyFactorySpi() {
         MyKeyFactorySpi keyFSpi = new MyKeyFactorySpi();
         assertTrue(keyFSpi instanceof KeyFactorySpi);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactoryTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactoryTest.java
index 67dab34..75617e1 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactoryTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyFactoryTest.java
@@ -1,9 +1,5 @@
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import java.lang.reflect.Constructor;
@@ -23,7 +19,6 @@
 import java.security.spec.KeySpec;
 import java.util.Arrays;
 
-@TestTargetClass(KeyFactory.class)
 public class KeyFactoryTest extends TestCase {
 
     Provider provider;
@@ -54,11 +49,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class}
-    )
     public void testGetInstanceString() {
         try {
             KeyFactory factory = KeyFactory.getInstance(TEST_KEYFACTORY_NAME);
@@ -93,11 +83,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class, String.class}
-    )
     public void testGetInstanceStringString() {
         try {
             KeyFactory factory = KeyFactory.getInstance(TEST_KEYFACTORY_NAME, TEST_PROVIDER_NAME);
@@ -141,11 +126,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class, Provider.class}
-    )
     public void testGetInstanceStringProvider() {
         try {
             KeyFactory factory = KeyFactory.getInstance(TEST_KEYFACTORY_NAME, provider);
@@ -195,11 +175,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="generatePublic",
-            args={KeySpec.class}
-    )
     public void testGeneratePublic() {
         KeyFactory factory = null;
         try {
@@ -249,11 +224,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="generatePrivate",
-            args={KeySpec.class}
-    )
     public void testGeneratePrivate() {
         KeyFactory factory = null;
         try {
@@ -302,11 +272,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getKeySpec",
-            args={Key.class, Class.class}
-    )
     public void testGetKeySpec() {
         KeyFactory factory = null;
         try {
@@ -389,11 +354,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="translateKey",
-            args={Key.class}
-    )
     public void testTranslateKey() {
         KeyFactory factory = null;
         try {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyManagementExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyManagementExceptionTest.java
index b84e940..fb81062 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyManagementExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyManagementExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyManagementException;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyManagementException.class)
+
 /**
  * Tests for <code>KeyManagementException</code> class constructors and
  * methods.
@@ -49,12 +44,6 @@
      * Test for <code>KeyManagementException()</code> constructor Assertion:
      * constructs KeyManagementException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {}
-    )
     public void testKeyManagementException01() {
         KeyManagementException tE = new KeyManagementException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +55,6 @@
      * Assertion: constructs KeyManagementException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.String.class}
-    )
     public void testKeyManagementException02() {
         KeyManagementException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +70,6 @@
      * Assertion: constructs KeyManagementException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.String.class}
-    )
     public void testKeyManagementException03() {
         String msg = null;
         KeyManagementException tE = new KeyManagementException(msg);
@@ -105,12 +82,6 @@
      * Assertion: constructs KeyManagementException when <code>cause</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.Throwable.class}
-    )
     public void testKeyManagementException04() {
         Throwable cause = null;
         KeyManagementException tE = new KeyManagementException(cause);
@@ -123,12 +94,6 @@
      * Assertion: constructs KeyManagementException when <code>cause</code> is
      * not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.Throwable.class}
-    )
     public void testKeyManagementException05() {
         KeyManagementException tE = new KeyManagementException(tCause);
         if (tE.getMessage() != null) {
@@ -147,12 +112,6 @@
      * constructor Assertion: constructs KeyManagementException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyManagementException06() {
         KeyManagementException tE = new KeyManagementException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -164,12 +123,6 @@
      * constructor Assertion: constructs KeyManagementException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyManagementException07() {
         KeyManagementException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -185,12 +138,6 @@
      * constructor Assertion: constructs KeyManagementException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyManagementException08() {
         KeyManagementException tE = new KeyManagementException(null, tCause);
         if (tE.getMessage() != null) {
@@ -209,12 +156,6 @@
      * constructor Assertion: constructs KeyManagementException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyManagementException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyManagementException09() {
         KeyManagementException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator1Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator1Test.java
index b59069e..f706623 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator1Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator1Test.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigInteger;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidParameterException;
@@ -43,12 +38,11 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyPairGenerator.class)
+
 /**
  * Tests for <code>KeyPairGenerator</code> class constructors and methods.
  *
  */
-
 public class KeyPairGenerator1Test extends TestCase {
 
     private static String[] invalidValues = SpiEngUtils.invalidValues;
@@ -102,12 +96,6 @@
      * throws NullPointerException  when algorithm is null
      * throws NoSuchAlgorithmException when algorithm is incorrect;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testKeyPairGenerator01() throws NoSuchAlgorithmException {
         try {
             KeyPairGenerator.getInstance(null);
@@ -129,12 +117,6 @@
      * Test for <code>getInstance(String algorithm)</code> method
      * Assertion: returns KeyPairGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testKeyPairGenerator02() throws NoSuchAlgorithmException {
         if (!DSASupported) {
             fail(NotSupportMsg);
@@ -153,12 +135,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null or empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testKeyPairGenerator03() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!DSASupported) {
@@ -186,12 +162,6 @@
      * Assertion:
      * throws NoSuchProviderException when provider is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testKeyPairGenerator04() throws NoSuchAlgorithmException,
             IllegalArgumentException {
         if (!DSASupported) {
@@ -219,12 +189,6 @@
      * throws NullPointerException  when algorithm is null
      * throws NoSuchAlgorithmException when algorithm is incorrect;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testKeyPairGenerator05() throws NoSuchProviderException,
             IllegalArgumentException {
         if (!DSASupported) {
@@ -254,12 +218,6 @@
      * method
      * Assertion: returns KeyPairGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testKeyPairGenerator06() throws NoSuchProviderException,
             NoSuchAlgorithmException, IllegalArgumentException {
         if (!DSASupported) {
@@ -281,12 +239,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testKeyPairGenerator07() throws NoSuchAlgorithmException {
         if (!DSASupported) {
             fail(NotSupportMsg);
@@ -309,12 +261,6 @@
      * throws NullPointerException  when algorithm is null
      * throws NoSuchAlgorithmException when algorithm is incorrect;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testKeyPairGenerator08() throws IllegalArgumentException {
         if (!DSASupported) {
             fail(NotSupportMsg);
@@ -342,12 +288,6 @@
      * method
      * Assertion: returns KeyPairGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testKeyPairGenerator09() throws NoSuchAlgorithmException,
             IllegalArgumentException {
         if (!DSASupported) {
@@ -369,20 +309,6 @@
      * Assertion: KeyPairGenerator was initialized before the invocation
      * of these methods
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "generateKeyPair",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "genKeyPair",
-            args = {}
-        )
-    })
     public void testKeyPairGenerator10() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException {
             if (!DSASupported) {
@@ -414,32 +340,6 @@
      * InvalidAlgorithmParameterException when parameters keysize or param are
      * incorrect
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {int.class, java.security.SecureRandom.class}
-        )
-    })
     public void testKeyPairGenerator11() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!DSASupported) {
@@ -482,32 +382,6 @@
      * incorrect Assertion: generateKeyPair() and genKeyPair() return null
      * KeyPair Additional class MyKeyPairGenerator1 is used
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {int.class, java.security.SecureRandom.class}
-        )
-    })
     public void testKeyPairGenerator12() {
         int[] keys = { -1, -250, 1, 64, 512, 1024 };
         SecureRandom random = new SecureRandom();
@@ -584,32 +458,6 @@
      * genKeyPair() return not null KeyPair Additional class MyKeyPairGenerator2
      * is used
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "",
-            method = "initialize",
-            args = {java.security.spec.AlgorithmParameterSpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "",
-            method = "initialize",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "",
-            method = "initialize",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "",
-            method = "initialize",
-            args = {int.class, java.security.SecureRandom.class}
-        )
-    })
     public void testKeyPairGenerator13() {
         int[] keys = { -1, -250, 1, 63, -512, -1024 };
         SecureRandom random = new SecureRandom();
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator2Test.java
index 6319e47..1c88a08 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator2Test.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidParameterException;
 import java.security.KeyPairGenerator;
@@ -42,12 +37,11 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyPairGenerator.class)
+
 /**
  * Tests for <code>KeyPairGenerator</code> class constructors and methods.
  *
  */
-
 public class KeyPairGenerator2Test extends TestCase {
     private String KeyPairGeneratorProviderClass = "";
 
@@ -322,12 +316,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance01() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass1;
@@ -337,12 +325,6 @@
         GetInstance01(1);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstance02() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException,
             InvalidAlgorithmParameterException {
@@ -353,12 +335,6 @@
         GetInstance02(1);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance03() throws NoSuchAlgorithmException,
             IllegalArgumentException, InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass1;
@@ -368,12 +344,6 @@
         GetInstance03(1);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance04() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass2;
@@ -383,12 +353,6 @@
         GetInstance01(2);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstance05() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException,
             InvalidAlgorithmParameterException {
@@ -399,12 +363,6 @@
         GetInstance02(2);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance06() throws NoSuchAlgorithmException,
             IllegalArgumentException, InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass2;
@@ -414,12 +372,6 @@
         GetInstance03(2);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance07() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass3;
@@ -429,12 +381,6 @@
         GetInstance01(3);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstance08() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException,
             InvalidAlgorithmParameterException {
@@ -445,12 +391,6 @@
         GetInstance02(3);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance09() throws NoSuchAlgorithmException,
             IllegalArgumentException, InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass3;
@@ -460,12 +400,6 @@
         GetInstance03(3);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance10() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass4;
@@ -475,12 +409,6 @@
         GetInstance01(4);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstance11() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException,
             InvalidAlgorithmParameterException {
@@ -491,12 +419,6 @@
         GetInstance02(4);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance12() throws NoSuchAlgorithmException,
             IllegalArgumentException, InvalidAlgorithmParameterException {
         KeyPairGeneratorProviderClass = KeyPairGeneratorProviderClass4;
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator3Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator3Test.java
index a48ea43..b4e451d 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator3Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator3Test.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AlgorithmParameters;
 import java.security.AlgorithmParametersSpi;
 import java.security.KeyPair;
@@ -41,12 +36,11 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyPairGenerator.class)
+
 /**
  * Tests for KeyPairGenerator class
  *
  */
-
 public class KeyPairGenerator3Test extends TestCase {
 
     private static String validProviderName = null;
@@ -93,20 +87,6 @@
      * Assertion: KeyPairGenerator was initialized before the invocation
      * of these methods
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "generateKeyPair",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "genKeyPair",
-            args = {}
-        )
-    })
     public void testGenKeyPair01() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException {
         if (!DSASupported) {
@@ -133,20 +113,6 @@
      * methods
      * Assertion: these methods are used without previously initialization
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "generateKeyPair",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "genKeyPair",
-            args = {}
-        )
-    })
     public void testGenKeyPair02() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException {
         if (!DSASupported) {
@@ -170,12 +136,6 @@
      * Test for <code>KeyPairGenerator</code> constructor
      * Assertion: returns KeyPairGenerator object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyPairGenerator",
-        args = {java.lang.String.class}
-    )
     public void testKeyPairGeneratorConst() {
         String[] alg = {null, "", "AsDfGh!#$*", "DSA", "RSA"};
         MykeyPGen kpg;
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator4Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator4Test.java
index 4f237b5..2093d66 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator4Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGenerator4Test.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyPairGenerator;
 import java.security.Provider;
 import java.security.SecureRandom;
@@ -30,18 +25,11 @@
 import java.security.interfaces.DSAPublicKey;
 import java.security.interfaces.DSAParams;
 
-@TestTargetClass(KeyPairGenerator.class)
 public class KeyPairGenerator4Test extends junit.framework.TestCase {
 
     /**
-     * @tests java.security.KeyPairGenerator#genKeyPair()
+     * java.security.KeyPairGenerator#genKeyPair()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "genKeyPair",
-        args = {}
-    )
     public void test_genKeyPair() throws Exception {
         KeyPairGenerator gen = KeyPairGenerator.getInstance("DSA");
         gen.initialize(1024);
@@ -49,42 +37,24 @@
     }
 
     /**
-     * @tests java.security.KeyPairGenerator#getAlgorithm()
+     * java.security.KeyPairGenerator#getAlgorithm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws Exception {
         String alg = KeyPairGenerator.getInstance("DSA").getAlgorithm();
         assertEquals("getAlgorithm returned unexpected value", "DSA", alg);
     }
 
     /**
-     * @tests java.security.KeyPairGenerator#getInstance(java.lang.String)
+     * java.security.KeyPairGenerator#getInstance(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verification of other string parameters and exception cases missed",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() throws Exception {
         KeyPairGenerator.getInstance("DSA");
     }
 
     /**
-     * @tests java.security.KeyPairGenerator#getInstance(java.lang.String,
+     * java.security.KeyPairGenerator#getInstance(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "NoSuchAlgorithmException, NoSuchProviderException checking missed",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String()
             throws Exception {
 
@@ -106,43 +76,25 @@
     }
 
     /**
-     * @tests java.security.KeyPairGenerator#getProvider()
+     * java.security.KeyPairGenerator#getProvider()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws Exception {
         Provider p = KeyPairGenerator.getInstance("DSA").getProvider();
         assertNotNull("provider is null", p);
     }
 
     /**
-     * @tests java.security.KeyPairGenerator#initialize(int)
+     * java.security.KeyPairGenerator#initialize(int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidParameterException checking missed",
-        method = "initialize",
-        args = {int.class}
-    )
     public void test_initializeI() throws Exception {
         KeyPairGenerator keyPair = KeyPairGenerator.getInstance("DSA");
         keyPair.initialize(1024);
     }
 
     /**
-     * @tests java.security.KeyPairGenerator#initialize(int,
+     * java.security.KeyPairGenerator#initialize(int,
      *        java.security.SecureRandom)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidParameterException checking missed",
-        method = "initialize",
-        args = {int.class, java.security.SecureRandom.class}
-    )
     public void test_initializeILjava_security_SecureRandom() throws Exception {
         KeyPairGenerator keyPair = KeyPairGenerator.getInstance("DSA");
         keyPair.initialize(1024, new SecureRandom());
@@ -150,14 +102,8 @@
 
 
     /**
-     * @tests java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec)
+     * java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidAlgorithmParameterException checking missed",
-        method = "initialize",
-        args = {java.security.spec.AlgorithmParameterSpec.class}
-    )
     public void test_initializeLjava_security_spec_AlgorithmParameterSpec()
             throws Exception {
         // create DSAParams
@@ -173,15 +119,9 @@
     }
 
     /**
-     * @tests java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec,
+     * java.security.KeyPairGenerator#initialize(java.security.spec.AlgorithmParameterSpec,
      *        java.security.SecureRandom)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidAlgorithmParameterException checking missed",
-        method = "initialize",
-        args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-    )
     public void test_initializeLjava_security_spec_AlgorithmParameterSpecLjava_security_SecureRandom()
             throws Exception {
         // create DSAParams
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGeneratorSpiTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGeneratorSpiTest.java
index 0517430..910da99 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGeneratorSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairGeneratorSpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidAlgorithmParameterException;
 import java.security.InvalidParameterException;
 import java.security.KeyPair;
@@ -37,44 +32,17 @@
 import org.apache.harmony.security.tests.support.MyKeyPairGeneratorSpi;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyPairGeneratorSpi.class)
+
 /**
  * Tests for <code>KeyPairGeneratorSpi</code> class constructors and methods.
  *
  */
-
 public class KeyPairGeneratorSpiTest extends TestCase {
 
     /**
      * Test for <code>KeyPairGeneratorSpi</code> constructor
      * Assertion: constructs KeyPairGeneratorSpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "KeyPairGeneratorSpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "generateKeyPair",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "initialize",
-            args = {int.class, java.security.SecureRandom.class}
-        )
-    })
     public void testKeyPairGeneratorSpi01()
             throws InvalidAlgorithmParameterException,
             InvalidParameterException {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairTest.java
index f4c68f3..afde0fa 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyPairTest.java
@@ -22,18 +22,13 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyPair;
 import java.security.PrivateKey;
 import java.security.PublicKey;
 import java.security.spec.InvalidKeySpecException;
 
 import junit.framework.TestCase;
-@TestTargetClass( KeyPair.class)
+
 /**
  * Tests for fields and methods of class <code>KeyPair</code>
  *
@@ -75,12 +70,6 @@
      * Assertion: creates new <code>KeyPair</code> instance using valid
      * parameters (both <code>null</code>)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verification when parameter is null",
-        method = "KeyPair",
-        args = {java.security.PublicKey.class, java.security.PrivateKey.class}
-    )
     public final void testKeyPair01() {
         Object kp = new KeyPair(null, null);
         assertTrue(kp instanceof KeyPair);
@@ -97,12 +86,6 @@
      * parameters (both valid keys)
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verification when parameter is not null",
-        method = "KeyPair",
-        args = {java.security.PublicKey.class, java.security.PrivateKey.class}
-    )
     public final void testKeyPair02() throws InvalidKeySpecException {
         Object kp = new KeyPair(TestKeyPair.getPublic(), TestKeyPair.getPrivate());
         assertTrue(kp instanceof KeyPair);
@@ -112,12 +95,6 @@
      * Test #1 for <code>getPrivate()</code> method<br>
      * Assertion: returns private key (<code>null</code> in this case)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getPrivate",
-        args = {}
-    )
     public final void testGetPrivate01() {
         KeyPair kp = new KeyPair(null, null);
         assertNull(kp.getPrivate());
@@ -128,12 +105,6 @@
      * Assertion: returns private key (valid private key in this case)
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getPrivate",
-        args = {}
-    )
     public final void testGetPrivate02() throws InvalidKeySpecException {
         PrivateKey pk = TestKeyPair.getPrivate();
         KeyPair kp = new KeyPair(null, pk);
@@ -144,12 +115,6 @@
      * Test #1 for <code>getPublic()</code> method<br>
      * Assertion: returns public key (<code>null</code> in this case)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getPublic",
-        args = {}
-    )
     public final void testGetPublic01() {
         KeyPair kp = new KeyPair(null, null);
         assertNull(kp.getPublic());
@@ -160,12 +125,6 @@
      * Assertion: returns public key (valid public key in this case)
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getPublic",
-        args = {}
-    )
     public final void testGetPublic02() throws InvalidKeySpecException {
         PublicKey pk = TestKeyPair.getPublic();
         KeyPair kp = new KeyPair(pk, null);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTest.java
index 65e6755..0dad827 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.NotSerializableException;
 import java.io.ObjectStreamException;
 import java.security.KeyRep;
@@ -35,7 +30,7 @@
 import java.util.Set;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyRep.class)
+
 /**
  *
  *
@@ -47,12 +42,6 @@
         keyFactoryAlgorithm = Security.getAlgorithms("KeyFactory");
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyRep",
-        args = {java.security.KeyRep.Type.class, java.lang.String.class, java.lang.String.class, byte[].class}
-    )
     public final void testKeyRep01() {
         try {
             assertNotNull(new KeyRep(KeyRep.Type.SECRET, "", "", new byte[] {}));
@@ -73,12 +62,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyRep",
-        args = {java.security.KeyRep.Type.class, java.lang.String.class, java.lang.String.class, byte[].class}
-    )
     public final void testKeyRep02() {
         try {
             new KeyRep(null, "", "", new byte[] {});
@@ -106,12 +89,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "readResolve",
-        args = {}
-    )
     public final void testReadResolve01() throws ObjectStreamException {
         KeyRepChild kr = new KeyRepChild(KeyRep.Type.SECRET, "", "",
                 new byte[] {});
@@ -139,12 +116,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "readResolve",
-        args = {}
-    )
     public final void testReadResolve02() throws ObjectStreamException {
         KeyRepChild kr = new KeyRepChild(KeyRep.Type.PUBLIC, "", "",
                 new byte[] {});
@@ -173,12 +144,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "readResolve",
-        args = {}
-    )
     public final void testReadResolve03() throws ObjectStreamException {
         KeyRepChild kr = new KeyRepChild(KeyRep.Type.PRIVATE, "", "",
                 new byte[] {});
@@ -207,12 +172,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "readResolve",
-        args = {}
-    )
     public final void testReadResolve04() throws ObjectStreamException {
         if (keyFactoryAlgorithm.isEmpty()) {
             System.err.println(getName()
@@ -232,12 +191,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "readResolve",
-        args = {}
-    )
     public final void testReadResolve05() throws ObjectStreamException {
         if (keyFactoryAlgorithm.isEmpty()) {
             System.err.println(getName()
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTypeTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTypeTest.java
index 0bfbe1f..0609ef4 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTypeTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyRepTypeTest.java
@@ -16,16 +16,11 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyRep;
 import java.util.Arrays;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyRep.Type.class)
+
 public class KeyRepTypeTest extends TestCase {
 
     protected void setUp() throws Exception {
@@ -37,14 +32,8 @@
     }
 
     /**
-     * @tests java.security.KeyRep.Type#valueOf(String)
+     * java.security.KeyRep.Type#valueOf(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "valueOf",
-        args = {java.lang.String.class}
-    )
     public void testValueOf() {
         try {
             KeyRep.Type.valueOf("type");
@@ -67,14 +56,8 @@
     }
 
     /**
-     * @tests java.security.KeyRep.Type#values()
+     * java.security.KeyRep.Type#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void testValues() {
         KeyRep.Type[] types = new KeyRep.Type[] { KeyRep.Type.SECRET,
                 KeyRep.Type.PUBLIC, KeyRep.Type.PRIVATE };
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
index 801050d..77bf62f 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
@@ -17,10 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.java.security.AlgorithmParametersTest.MyAlgorithmParameters;
@@ -44,7 +40,6 @@
 import java.util.Date;
 import java.util.Enumeration;
 
-@TestTargetClass(KeyStore.class)
 public class KeyStore3Test extends TestCase {
 
     private KeyStore mockKeyStore;
@@ -79,23 +74,11 @@
         certificate = cf.generateCertificate(certArray);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with null parameter only.",
-        method = "load",
-        args = {java.security.KeyStore.LoadStoreParameter.class}
-    )
     public void test_load() throws Exception {
         // No exception should be thrown out.
         mockKeyStore.load(null);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with null parameter only",
-        method = "store",
-        args = {java.security.KeyStore.LoadStoreParameter.class}
-    )
     public void test_store() throws Exception {
         try {
             mockKeyStore.store(null);
@@ -109,36 +92,18 @@
         mockKeyStore.store(null);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with all null parameters only",
-        method = "setKeyEntry",
-        args = {java.lang.String.class, java.security.Key.class, char[].class, java.security.cert.Certificate[].class}
-    )
     public void test_setKeyEntry_null() throws Exception {
         mockKeyStore.load(null, null);
         // No exception should be thrown out.
         mockKeyStore.setKeyEntry(null, null, null, null);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with null parameters only",
-        method = "setKeyEntry",
-        args = {java.lang.String.class, java.security.Key.class, char[].class, java.security.cert.Certificate[].class}
-    )
     public void test_setKeyEntry_key_is_null() throws Exception {
         mockKeyStore.load(null, null);
         // No exception should be thrown out.
         mockKeyStore.setKeyEntry("Alias", null, null, new Certificate[]{certificate});
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with null parameters",
-        method = "setKeyEntry",
-        args = {java.lang.String.class, java.security.Key.class, char[].class, java.security.cert.Certificate[].class}
-    )
     public void test_setKeyEntry_key_is_private() throws Exception {
         mockKeyStore.load(null, null);
         Key key = keyPair.getPrivate();
@@ -160,12 +125,6 @@
         mockKeyStore.setKeyEntry("Alias", key, null, new Certificate[]{certificate});
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with null parameters",
-        method = "setKeyEntry",
-        args = {java.lang.String.class, java.security.Key.class, char[].class, java.security.cert.Certificate[].class}
-    )
     public void test_setKeyEntry_key_is_public() throws Exception
     {
         mockKeyStore.load(null, null);
@@ -176,12 +135,6 @@
         mockKeyStore.setKeyEntry("Alias3", key, null, new Certificate[]{certificate});
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies method with null parameters",
-        method = "setCertificateEntry",
-        args = {java.lang.String.class, java.security.cert.Certificate.class}
-    )
     public void test_setCertificateEntry_null() throws Exception {
         mockKeyStore.load(null, null);
 
@@ -193,12 +146,6 @@
     }
 
     @SuppressWarnings("cast")
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyStore",
-        args = {java.security.KeyStoreSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void test_KeyStore() {
         Provider p = new MyProvider();
         try {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore4Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore4Test.java
index 77e4314..4178db0 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore4Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore4Test.java
@@ -1,9 +1,5 @@
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.MyProvider;
@@ -29,7 +25,6 @@
 import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
 
-@TestTargetClass(KeyStore.class)
 public class KeyStore4Test extends TestCase {
 
     Provider provider = new MyProvider();
@@ -66,11 +61,6 @@
         Security.removeProvider(provider.getName());
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class}
-    )
     public void testGetInstanceString() {
         try {
             KeyStore ks = KeyStore.getInstance("TestKeyStore");
@@ -97,11 +87,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class, String.class}
-    )
     public void testGetInstanceStringString() {
         try {
             KeyStore ks = KeyStore.getInstance("TestKeyStore", provider.getName());
@@ -165,11 +150,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class, Provider.class}
-    )
     public void testGetInstanceStringProvider() {
         try {
             KeyStore ks = KeyStore.getInstance("TestKeyStore", provider);
@@ -206,11 +186,6 @@
     }
 
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getKey",
-            args={String.class, char[].class}
-    )
     public void testGetKey() {
         try {
             Key key = keyStore.getKey("keyalias", null);
@@ -270,11 +245,6 @@
     }
 
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getCertificateAlias",
-            args={Certificate.class}
-    )
     public void testGetCertificateAlias() {
         try {
             String alias = keyStore.getCertificateAlias(TestKeyStoreSpi.CERT);
@@ -308,11 +278,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="store",
-            args={OutputStream.class, char[].class}
-    )
     public void testStoreOutputStreamCharArray() {
         OutputStream os = new ByteArrayOutputStream();
         char[] password = "PASSWORD".toCharArray();
@@ -386,11 +351,6 @@
 
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="store",
-            args={KeyStore.LoadStoreParameter.class}
-    )
     public void testStoreLoadStoreParameter() {
         try {
             keyStore.store(new KeyStore.LoadStoreParameter() {
@@ -486,11 +446,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="load",
-            args={InputStream.class, char[].class}
-    )
     public void testLoadInputStreamCharArray() {
         InputStream is = new ByteArrayInputStream("DATA".getBytes());
         char[] password = "PASSWORD".toCharArray();
@@ -541,11 +496,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="load",
-            args={KeyStore.LoadStoreParameter.class}
-    )
     public void testLoadLoadStoreParameter() {
         try {
             keyStore.load(null);
@@ -609,11 +559,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.SUFFICIENT,
-            method="getEntry",
-            args={String.class, KeyStore.ProtectionParameter.class}
-    )
     public void testGetEntry() {
         try {
             Entry entry = keyStore.getEntry("certalias", null);
@@ -681,18 +626,10 @@
 
 
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getType"
-    )
     public void testGetType() {
         assertEquals(KEY_STORE_TYPE, keyStore.getType());
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getProvider"
-    )
     public void testGetProvider() {
         assertNotNull(keyStore.getProvider());
         assertEquals("not equal", provider, keyStore.getProvider());
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java
index 421f02b..d14cf23 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreBuilderTest.java
@@ -16,12 +16,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.KeyStoreTestSupport;
@@ -37,7 +31,7 @@
 import java.security.Security;
 import java.security.cert.CertificateException;
 import java.util.Enumeration;
-@TestTargetClass(KeyStore.Builder.class)
+
 public class KeyStoreBuilderTest extends TestCase {
 
     protected void setUp() throws Exception {
@@ -76,26 +70,6 @@
     /*
      * test for constructor KeyStoreBuilder
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "Builder",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getKeyStore",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getProtectionParameter",
-            args = {java.lang.String.class}
-        )
-    })
     public void testConstructor() {
         KeyStoreBuilder ksb;
         try {
@@ -112,12 +86,6 @@
     /*
      * test for method newInstance(KeyStore, KeyStore.ProtectionParameter)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {java.security.KeyStore.class, java.security.KeyStore.ProtectionParameter.class}
-    )
     public void testNewInstanceKeyStoreProtectionParameter()
             throws KeyStoreException, NoSuchAlgorithmException, IOException,
             CertificateException {
@@ -234,12 +202,6 @@
      * ProtectionParameter which is used in newInstance(...)
      *
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {java.lang.String.class, java.security.Provider.class, java.io.File.class, java.security.KeyStore.ProtectionParameter.class}
-    )
     public void testNewInstanceStringProviderFileProtectionParameter()
             throws Exception {
 
@@ -418,12 +380,6 @@
      * when alias is not available
      *
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {java.lang.String.class, java.security.Provider.class, java.security.KeyStore.ProtectionParameter.class}
-    )
     public void testNewInstanceStringProviderProtectionParameter()
             throws KeyStoreException {
 
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreExceptionTest.java
index aa6dc45..64c3a90 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.KeyStoreException;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyStoreException.class)
+
 /**
  * Tests for <code>KeyStoreException</code> class constructors and methods.
  *
@@ -48,12 +43,6 @@
      * Test for <code>KeyStoreException()</code> constructor Assertion:
      * constructs KeyStoreException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {}
-    )
     public void testKeyStoreException01() {
         KeyStoreException tE = new KeyStoreException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -65,12 +54,6 @@
      * constructs KeyStoreException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.String.class}
-    )
     public void testKeyStoreException02() {
         KeyStoreException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -85,12 +68,6 @@
      * Test for <code>KeyStoreException(String)</code> constructor Assertion:
      * constructs KeyStoreException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.String.class}
-    )
     public void testKeyStoreException03() {
         String msg = null;
         KeyStoreException tE = new KeyStoreException(msg);
@@ -102,12 +79,6 @@
      * Test for <code>KeyStoreException(Throwable)</code> constructor
      * Assertion: constructs KeyStoreException when <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.Throwable.class}
-    )
     public void testKeyStoreException04() {
         Throwable cause = null;
         KeyStoreException tE = new KeyStoreException(cause);
@@ -120,12 +91,6 @@
      * Assertion: constructs KeyStoreException when <code>cause</code> is not
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.Throwable.class}
-    )
     public void testKeyStoreException05() {
         KeyStoreException tE = new KeyStoreException(tCause);
         if (tE.getMessage() != null) {
@@ -144,12 +109,6 @@
      * Assertion: constructs KeyStoreException when <code>cause</code> is null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyStoreException06() {
         KeyStoreException tE = new KeyStoreException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -161,12 +120,6 @@
      * Assertion: constructs KeyStoreException when <code>cause</code> is null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyStoreException07() {
         KeyStoreException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -182,12 +135,6 @@
      * Assertion: constructs KeyStoreException when <code>cause</code> is not
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyStoreException08() {
         KeyStoreException tE = new KeyStoreException(null, tCause);
         if (tE.getMessage() != null) {
@@ -206,12 +153,6 @@
      * Assertion: constructs KeyStoreException when <code>cause</code> is not
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "KeyStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testKeyStoreException09() {
         KeyStoreException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreSpiTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreSpiTest.java
index c291ee4..4fdddbb 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreSpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.MyKeyStoreSpi;
@@ -50,124 +45,13 @@
 import java.security.cert.CertificateException;
 import java.util.Date;
 
-@TestTargetClass(value=KeyStoreSpi.class,
-        untestedMethods={
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineAliases",
-                args = {}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineContainsAlias",
-                args = {java.lang.String.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineDeleteEntry",
-                args = {java.lang.String.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineGetCertificate",
-                args = {java.lang.String.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineGetCertificateAlias",
-                args = {java.security.cert.Certificate.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineGetCertificateChain",
-                args = {java.lang.String.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineGetCreationDate",
-                args = {java.lang.String.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineGetKey",
-                args = {java.lang.String.class, char[].class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineIsCertificateEntry",
-                args = {java.lang.String.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineIsKeyEntry",
-                args = {java.lang.String.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineLoad",
-                args = {java.io.InputStream.class, char[].class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineSetCertificateEntry",
-                args = {
-                java.lang.String.class, java.security.cert.Certificate.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineSetKeyEntry",
-                args = {
-                java.lang.String.class, byte[].class,
-                java.security.cert.Certificate[].class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineSetKeyEntry",
-                args = {
-                java.lang.String.class, java.security.Key.class, char[].class,
-                java.security.cert.Certificate[].class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineSize",
-                args = {}
-            ),
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "",
-                method = "engineStore",
-                args = {java.io.OutputStream.class, char[].class}
-            )}
-        )
 /**
  * Tests for <code>KeyStoreSpi</code> constructor and methods
  *
  */
-
 public class KeyStoreSpiTest extends TestCase {
 
     @SuppressWarnings("cast")
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyStoreSpi",
-        args = {}
-    )
     public void test_KeyStoreSpi() {
 
         try {
@@ -180,15 +64,9 @@
     }
 
     /*
-     * @tests java.security.KeyStore.engineEntryInstanceOf(String, Class<?
+     * java.security.KeyStore.engineEntryInstanceOf(String, Class<?
      * extends Entry>)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineEntryInstanceOf",
-        args = {java.lang.String.class, java.lang.Class.class}
-    )
     public void test_engineEntryInstanceOf() throws Exception {
 
         KeyStoreSpi ksSpi = new MyKeyStoreSpi();
@@ -222,36 +100,6 @@
 
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineLoad",
-            args = {java.security.KeyStore.LoadStoreParameter.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineStore",
-            args = {java.security.KeyStore.LoadStoreParameter.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetEntry",
-            args = {
-                    java.lang.String.class,
-                    java.security.KeyStore.ProtectionParameter.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineSetEntry",
-            args = {
-                    java.lang.String.class, java.security.KeyStore.Entry.class,
-                    java.security.KeyStore.ProtectionParameter.class}
-        )
-    })
     public void testKeyStoteSpi01() throws IOException,
             NoSuchAlgorithmException, CertificateException,
             UnrecoverableEntryException, KeyStoreException {
@@ -293,43 +141,6 @@
      * Test for <code>KeyStoreSpi()</code> constructor and abstract engine
      * methods. Assertion: creates new KeyStoreSpi object.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineSetKeyEntry",
-            args = {
-                    java.lang.String.class, java.security.Key.class,
-                    char[].class, java.security.cert.Certificate[].class}),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineSetKeyEntry",
-            args = {
-                    java.lang.String.class, byte[].class,
-                    java.security.cert.Certificate[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineSetCertificateEntry",
-            args = {
-                    java.lang.String.class,
-                    java.security.cert.Certificate.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineDeleteEntry",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineStore",
-            args = {java.io.OutputStream.class, char[].class}
-        )
-    })
     public void testKeyStoteSpi02() throws NoSuchAlgorithmException,
             UnrecoverableKeyException, CertificateException {
         KeyStoreSpi ksSpi = new MyKeyStoreSpi();
@@ -374,22 +185,8 @@
     }
 
     /**
-     * @tests java.security.KeyStoreSpi#engineLoad(KeyStore.LoadStoreParameter)
+     * java.security.KeyStoreSpi#engineLoad(KeyStore.LoadStoreParameter)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "IllegalArgumentException, NoSuchAlgorithmException, "
-                    + "CertificateException checking missed",
-            method = "engineLoad",
-            args = {java.security.KeyStore.LoadStoreParameter.class}
-        ),
-        @TestTargetNew(
-            level=TestLevel.NOT_NECESSARY,
-            clazz=LoadStoreParameter.class,
-            method="getProtectionParameter"
-        )
-    })
     public void test_engineLoadLjava_security_KeyStore_LoadStoreParameter()
             throws Exception {
 
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreTest.java
index b26357f..a158c83 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStoreTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -55,12 +50,11 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 
 import junit.framework.TestCase;
-@TestTargetClass(KeyStore.class)
+
 /**
  * Tests for <code>KeyStore</code> constructor and methods
  *
  */
-
 public class KeyStoreTest extends TestCase {
 
     private static final String KeyStoreProviderClass = "org.apache.harmony.security.tests.support.MyKeyStore";
@@ -113,12 +107,6 @@
      * methods
      * Assertions: throw IllegalArgumentException if param is null;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "NoSuchAlgorithmException, CertificateException checking missed",
-        method = "load",
-        args = {java.security.KeyStore.LoadStoreParameter.class}
-    )
     public void testLoadStore02() throws Exception {
         assertTrue(NotSupportMsg, KSSupported);
 
@@ -155,12 +143,6 @@
      * method
      * Assertion: stores KeyEntry.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setKeyEntry",
-        args = {java.lang.String.class, byte[].class, java.security.cert.Certificate[].class}
-    )
     public void testSetKeyEntry() throws Exception {
         assertTrue(NotSupportMsg, KSSupported);
 
@@ -201,12 +183,6 @@
      * Test for <code>getDefaultType()</code> method Assertion: returns
      * default security key store type or "jks" string
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultType",
-        args = {}
-    )
     public void testKeyStore01() {
         String propName = "keystore.type";
         String defKSType = Security.getProperty(propName);
@@ -235,12 +211,6 @@
      * throws KeyStoreException when type is not available
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verification with valid parameter missed",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testKeyStore02() throws KeyStoreException {
         String[] invalidValues =  SpiEngUtils.invalidValues;
         try {
@@ -261,13 +231,6 @@
     /**
      * @test java.security.KeyStore.PasswordProtection.getPassword()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "IllegalStateException checking missed",
-        clazz = KeyStore.PasswordProtection.class,
-        method = "getPassword",
-        args = {}
-    )
     public void testKeyStorePPGetPassword() {
         // Regression for HARMONY-1539
         // no exception expected
@@ -281,7 +244,7 @@
 
 
     /*
-     * @tests java.security.KeyStoreSpi.engineEntryInstanceOf(String, Class<? extends Entry>)
+     * java.security.KeyStoreSpi.engineEntryInstanceOf(String, Class<? extends Entry>)
      */
     public void testEngineEntryInstanceOf() throws Exception {
         //Regression for HARMONY-615
@@ -309,15 +272,8 @@
     }
 
     /**
-     * @tests java.security.KeyStore.TrustedCertificateEntry.toString()
+     * java.security.KeyStore.TrustedCertificateEntry.toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "IllegalStateException checking missed",
-        clazz = KeyStore.TrustedCertificateEntry.class,
-        method = "toString",
-        args = {}
-    )
     public void testKeyStoreTCToString() {
            // Regression for HARMONY-1542
            // no exception expected
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyTest.java
index 159030e..65355a1 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyTest.java
@@ -22,31 +22,19 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.Key;
 
 import junit.framework.TestCase;
-@TestTargetClass(Key.class)
+
 /**
  * Tests for <code>Key</code> class field
  *
  */
-
 public class KeyTest extends TestCase {
 
     /**
      * Test for <code>serialVersionUID</code> field
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Field testing",
-        method = "!serialVersionUID",
-        args = {}
-    )
     public void testField() {
         checkKey mk = new checkKey();
         assertEquals("Incorrect serialVersionUID", mk.getSerVerUID(), //Key.serialVersionUID,
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
index 70835e3..8be5563 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/MessageDigestSpiTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.nio.ByteBuffer;
 import java.security.DigestException;
 import java.security.MessageDigest;
@@ -34,7 +29,7 @@
 import java.security.NoSuchAlgorithmException;
 
 import junit.framework.TestCase;
-@TestTargetClass(MessageDigestSpi.class)
+
 /**
  * Tests for <code>MessageDigestSpi</code> constructor and methods
  */
@@ -44,38 +39,6 @@
     * java.security.MessageDigestSpi#MessageDigestSpi()
     */
     @SuppressWarnings("cast")
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "MessageDigestSpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineDigest",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineReset",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineUpdate",
-            args = {byte.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        )
-    })
    public void test_constructor() {
         MyMessageDigest mds;
         try {
@@ -101,12 +64,6 @@
     /**
      * java.security.MessageDigestSpi#engineDigest(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineDigest",
-        args = {byte[].class, int.class, int.class}
-    )
     public void test_engineDigestLB$LILI() throws Exception {
 
         final int DIGEST_LENGTH = 2;
@@ -169,12 +126,6 @@
     /**
      * java.security.MessageDigestSpi#engineGetDigestLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineGetDigestLength",
-        args = {}
-    )
     public void test_engineGetDigestLength() {
         MyMessageDigest md = new MyMessageDigest();
         assertEquals(0, md.engineGetDigestLength());
@@ -191,12 +142,6 @@
     /**
      * java.security.MessageDigestSpi#engineUpdate(ByteBuffer)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineUpdate",
-        args = {java.nio.ByteBuffer.class}
-    )
     public void test_engineUpdateLjava_nio_ByteBuffer() {
         MyMessageDigest md = new MyMessageDigest();
         byte[] b = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
@@ -218,14 +163,8 @@
     }
 
     /**
-     * @tests java.security.MessageDigestSpi#clone()
+     * java.security.MessageDigestSpi#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() throws CloneNotSupportedException {
         MyMessageDigest md = new MyMessageDigest();
         try {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchAlgorithmExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchAlgorithmExceptionTest.java
index 65eb9c0..1897dd4 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchAlgorithmExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchAlgorithmExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.NoSuchAlgorithmException;
 
 import junit.framework.TestCase;
-@TestTargetClass(NoSuchAlgorithmException.class)
+
 /**
  * Tests for <code>NoSuchAlgorithmException</code> class constructors and
  * methods.
@@ -49,12 +44,6 @@
      * Test for <code>NoSuchAlgorithmException()</code> constructor Assertion:
      * constructs NoSuchAlgorithmException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {}
-    )
     public void testNoSuchAlgorithmException01() {
         NoSuchAlgorithmException tE = new NoSuchAlgorithmException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +55,6 @@
      * Assertion: constructs NoSuchAlgorithmException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.String.class}
-    )
     public void testNoSuchAlgorithmException02() {
         NoSuchAlgorithmException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +70,6 @@
      * Assertion: constructs NoSuchAlgorithmException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.String.class}
-    )
     public void testNoSuchAlgorithmException03() {
         String msg = null;
         NoSuchAlgorithmException tE = new NoSuchAlgorithmException(msg);
@@ -105,12 +82,6 @@
      * Assertion: constructs NoSuchAlgorithmException when <code>cause</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.Throwable.class}
-    )
     public void testNoSuchAlgorithmException04() {
         Throwable cause = null;
         NoSuchAlgorithmException tE = new NoSuchAlgorithmException(cause);
@@ -123,12 +94,6 @@
      * Assertion: constructs NoSuchAlgorithmException when <code>cause</code>
      * is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.Throwable.class}
-    )
     public void testNoSuchAlgorithmException05() {
         NoSuchAlgorithmException tE = new NoSuchAlgorithmException(tCause);
         if (tE.getMessage() != null) {
@@ -147,12 +112,6 @@
      * constructor Assertion: constructs NoSuchAlgorithmException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testNoSuchAlgorithmException06() {
         NoSuchAlgorithmException tE = new NoSuchAlgorithmException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -164,12 +123,6 @@
      * constructor Assertion: constructs NoSuchAlgorithmException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testNoSuchAlgorithmException07() {
         NoSuchAlgorithmException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -185,12 +138,6 @@
      * constructor Assertion: constructs NoSuchAlgorithmException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testNoSuchAlgorithmException08() {
         NoSuchAlgorithmException tE = new NoSuchAlgorithmException(null, tCause);
         if (tE.getMessage() != null) {
@@ -209,12 +156,6 @@
      * constructor Assertion: constructs NoSuchAlgorithmException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchAlgorithmException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testNoSuchAlgorithmException09() {
         NoSuchAlgorithmException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchProviderExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchProviderExceptionTest.java
index f0f0f42..98324f6 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchProviderExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/NoSuchProviderExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.NoSuchProviderException;
 
 import junit.framework.TestCase;
-@TestTargetClass(NoSuchProviderException.class)
+
 /**
  * Tests for <code>NoSuchProviderException</code> class constructors and
  * methods.
@@ -49,12 +44,6 @@
      * Test for <code>NoSuchProviderException()</code> constructor Assertion:
      * constructs NoSuchProviderException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NoSuchProviderException",
-        args = {}
-    )
     public void testNoSuchProviderException01() {
         NoSuchProviderException tE = new NoSuchProviderException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +55,6 @@
      * Assertion: constructs NoSuchProviderException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchProviderException",
-        args = {java.lang.String.class}
-    )
     public void testNoSuchProviderException02() {
         NoSuchProviderException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +70,6 @@
      * Assertion: constructs NoSuchProviderException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "NoSuchProviderException",
-        args = {java.lang.String.class}
-    )
     public void testNoSuchProviderException03() {
         String msg = null;
         NoSuchProviderException tE = new NoSuchProviderException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permission2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permission2Test.java
index cf5d85d..12952e5 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permission2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permission2Test.java
@@ -17,16 +17,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.SecurityPermission;
 
-@TestTargetClass(Permission.class)
 public class Permission2Test extends junit.framework.TestCase {
     static class ConcretePermission extends Permission {
         public ConcretePermission() {
@@ -51,14 +45,8 @@
     }
 
     /**
-     * @tests java.security.Permission#Permission(java.lang.String)
+     * java.security.Permission#Permission(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Permission",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // test method java.security.permission.Permission(string)
         try {
@@ -87,14 +75,8 @@
     }
 
     /**
-     * @tests java.security.Permission#checkGuard(java.lang.Object)
+     * java.security.Permission#checkGuard(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkGuard",
-        args = {java.lang.Object.class}
-    )
     public void test_checkGuardLjava_lang_Object() {
         // test method java.security.permission.checkGuard(object)
         SecurityPermission permi = new SecurityPermission(
@@ -108,14 +90,8 @@
     }
 
     /**
-     * @tests java.security.Permission#getName()
+     * java.security.Permission#getName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() {
         // test method java.security.permission.getName()
         SecurityPermission permi = new SecurityPermission("testing getName()");
@@ -129,14 +105,8 @@
     }
 
     /**
-     * @tests java.security.Permission#newPermissionCollection()
+     * java.security.Permission#newPermissionCollection()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void test_newPermissionCollection() {
         // test method java.security.permission.newPermissionCollection
         Permission permi = new ConcretePermission();
@@ -147,14 +117,8 @@
     }
 
     /**
-     * @tests java.security.Permission#toString()
+     * java.security.Permission#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // test method java.security.permission.toString
         // test for permission with no action
@@ -163,4 +127,4 @@
         assertNotNull("toString should have returned a string of elements",
                 toString);
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionCollectionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionCollectionTest.java
index 113a264..86b1705 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionCollectionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionCollectionTest.java
@@ -22,22 +22,16 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.util.*;
 
 import junit.framework.TestCase;
-@TestTargetClass(PermissionCollection.class)
+
 /**
  * Tests for <code>PermissionCollection</code>
  *
  */
-
 public class PermissionCollectionTest extends TestCase {
 
     // Bare extension to instantiate abstract PermissionCollection class
@@ -69,20 +63,6 @@
     }
 
     /** Test read-only flag. Should be false by default and can be set once forever. */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isReadOnly",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setReadOnly",
-            args = {}
-        )
-    })
     public void testReadOnly()
     {
         PermissionCollection pc = new RealPermissionCollection(null);
@@ -93,12 +73,6 @@
         assertTrue("more calls to setReadOnly() should not harm", pc.isReadOnly());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         Set<Permission> perm = new HashSet<Permission>();
         Permission p = new RealPermission("TestPermission");
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionTest.java
index 973e711..e0f280a 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionTest.java
@@ -26,15 +26,10 @@
 import java.security.SecurityPermission;
 
 import junit.framework.TestCase;
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-@TestTargetClass(Permission.class)
+
 /**
  * Tests for <code>Permission</code>
  */
-
 public class PermissionTest extends TestCase {
     // Bare extension to instantiate abstract Permission class
     static final class RealPermission extends Permission {
@@ -64,12 +59,6 @@
      * Test that a permission object is created with the specified name and is
      * properly converted to String
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Non null string parameter verified",
-        method = "Permission",
-        args = {java.lang.String.class}
-    )
     public void testCtor() {
         String name = "testCtor123^%$#&^ &^$";
         Permission test = new RealPermission(name);
@@ -79,12 +68,6 @@
     }
 
     /** newPermissionCollection() should return null */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Returned parameter was tested.",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void testCollection() {
         assertNull(new RealPermission("123").newPermissionCollection());
     }
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permissions2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permissions2Test.java
index 87051a5..2f04ab2 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permissions2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Permissions2Test.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.File;
 import java.io.FilePermission;
 import java.security.AllPermission;
@@ -29,7 +24,6 @@
 import java.security.Permissions;
 import java.util.Enumeration;
 
-@TestTargetClass(Permissions.class)
 public class Permissions2Test extends junit.framework.TestCase {
     FilePermission readAllFiles = new FilePermission("<<ALL FILES>>", "read");
 
@@ -44,28 +38,16 @@
     FilePermission readInFile = new FilePermission("aFile.file", "read");
 
     /**
-     * @tests java.security.Permissions#Permissions()
+     * java.security.Permissions#Permissions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Permissions",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.security.Permissions()
         new Permissions();
 	}
 
     /**
-     * @tests java.security.Permissions#add(java.security.Permission)
+     * java.security.Permissions#add(java.security.Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.security.Permission.class}
-    )
     public void test_addLjava_security_Permission() {
         // Test for method void
         // java.security.Permissions.add(java.security.Permission)
@@ -107,14 +89,8 @@
     }
 
     /**
-     * @tests java.security.Permissions#elements()
+     * java.security.Permissions#elements()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "elements",
-        args = {}
-    )
     public void test_elements() {
         // Test for method java.util.Enumeration
         // java.security.Permissions.elements()
@@ -146,14 +122,8 @@
     }
 
     /**
-     * @tests java.security.Permissions#implies(java.security.Permission)
+     * java.security.Permissions#implies(java.security.Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void test_impliesLjava_security_Permission() {
         // Test for method boolean
         // java.security.Permissions.implies(java.security.Permission)
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionsTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionsTest.java
index bc5e9c9..f086b6b 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionsTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PermissionsTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AllPermission;
 import java.security.BasicPermission;
 import java.security.Permission;
@@ -42,22 +37,15 @@
 
 
 import junit.framework.TestCase;
-@TestTargetClass(Permissions.class)
+
 /**
  * Tests for <code>Permissions</code>
  *
  */
-
 public class PermissionsTest extends TestCase {
     /**
      * Can add any type of permissions. Cannot add if collection is read-only.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.security.Permission.class}
-    )
     public void testAdd() {
         Permissions ps = new Permissions();
         Permission ap = new AllPermission();
@@ -93,12 +81,6 @@
      * non-empty collection, should always return enumeration over unique
      * elements.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "elements",
-        args = {}
-    )
     public void testElements() {
         Permissions ps = new Permissions();
         Permission ap = new AllPermission();
@@ -147,14 +129,6 @@
     /**
      * input parameter is null
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "implies",
-            args = {java.security.Permission.class}
-        )
-    })
     public void testNull(){
         Permissions ps = new Permissions();
         try {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PolicyTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
index 28dd2da..a708ddb 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PolicyTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.SecurityChecker;
@@ -48,7 +43,7 @@
 import java.util.Collection;
 import java.util.Enumeration;
 import java.util.HashSet;
-@TestTargetClass(Policy.class)
+
 /**
  * Tests for <code>Policy</code>
  */
@@ -61,29 +56,9 @@
     }
 
     /**
-     * @tests constructor Policy()
+     * constructor Policy()
      */
     @SuppressWarnings("cast")
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "Policy",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPermissions",
-            args = {java.security.CodeSource.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "refresh",
-            args = {}
-        )
-    })
     public void test_constructor() {
         TestProvider tp;
         CodeSource cs = new CodeSource(null, (Certificate[]) null);
@@ -119,12 +94,6 @@
     /**
      * Tests that getPermissions() does proper permission evaluation.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPermissions",
-        args = {java.security.ProtectionDomain.class}
-    )
     public void testGetPermissions() {
         SecurityPermission sp = new SecurityPermission("abc");
         SecurityPermission sp2 = new SecurityPermission("fbdf");
@@ -170,23 +139,9 @@
     }
 
     /**
-     * @tests java.security.Policy#getPolicy()
-     * @tests java.security.Policy#setPolicy()
+     * java.security.Policy#getPolicy()
+     * java.security.Policy#setPolicy()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "setPolicy",
-            args = {java.security.Policy.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getPolicy",
-            args = {}
-        )
-    })
     public void testResetingPolicyToDefault() {
 
         Policy oldPolicy = Policy.getPolicy();
@@ -209,14 +164,8 @@
     }
 
     /**
-     * @tests java.security.Policy#implies(ProtectionDomain, Permission)
+     * java.security.Policy#implies(ProtectionDomain, Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.ProtectionDomain.class, java.security.Permission.class}
-    )
     public void test_implies() {
         Policy policy = Policy.getPolicy();
         char s = File.separatorChar;
@@ -292,20 +241,6 @@
     /**
      * Test property expansion in policy files
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "setPolicy",
-            args = {java.security.Policy.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getPolicy",
-            args = {}
-        )
-    })
     public void testPropertyExpansion() throws Exception {
 
         // Regression for HARMONY-1963 and HARMONY-2910
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivateKeyTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivateKeyTest.java
index eefa460..a951934 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivateKeyTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivateKeyTest.java
@@ -22,30 +22,19 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 import java.security.PrivateKey;
 
 import junit.framework.TestCase;
-@TestTargetClass(PrivateKey.class)
+
 /**
  * Tests for <code>PrivateKey</code> class field
  *
  */
-
 public class PrivateKeyTest extends TestCase {
 
     /**
      * Test for <code>serialVersionUID</code> field
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Field testing",
-        method = "!serialVersionUID",
-        args = {}
-    )
     public void testField() {
         checkPrivateKey cPrKey = new checkPrivateKey();
         assertEquals("Incorrect serialVersionUID", cPrKey.getSerVerUID(), //PrivateKey.serialVersionUID,
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionException2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionException2Test.java
index 8d46f1a..c931777 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionException2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionException2Test.java
@@ -17,28 +17,16 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.security.PrivilegedActionException;
 
-@TestTargetClass(PrivilegedActionException.class)
 public class PrivilegedActionException2Test extends junit.framework.TestCase {
 
     private static Throwable tCause = new Throwable("Test cause");
 
     /**
-     * @tests java.security.PrivilegedActionException#PrivilegedActionException(java.lang.Exception)
+     * java.security.PrivilegedActionException#PrivilegedActionException(java.lang.Exception)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PrivilegedActionException",
-        args = {java.lang.Exception.class}
-    )
     public void test_ConstructorLjava_lang_Exception() {
         Exception e = new Exception("test exception");
         PrivilegedActionException pe = new PrivilegedActionException(e);
@@ -52,14 +40,8 @@
     }
 
     /**
-     * @tests java.security.PrivilegedActionException#getException()
+     * java.security.PrivilegedActionException#getException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getException",
-        args = {}
-    )
     public void test_getException() {
         Exception e = new IOException("test IOException");
         PrivilegedActionException pe = new PrivilegedActionException(e);
@@ -68,14 +50,8 @@
     }
 
     /**
-     * @tests java.security.PrivilegedActionException#getCause()
+     * java.security.PrivilegedActionException#getCause()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCause",
-        args = {}
-    )
     public void test_getCause() {
         Exception ex = new Exception("Test message", tCause);
         PrivilegedActionException pe = new PrivilegedActionException(ex);
@@ -89,4 +65,4 @@
             fail("Unexpected exception");
         }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionExceptionTest.java
index d3e165d..67bef5f 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionExceptionTest.java
@@ -22,30 +22,18 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.PrivilegedActionException;
 
 import junit.framework.TestCase;
-@TestTargetClass(PrivilegedActionException.class)
+
 /**
  * Unit test for java.security.PrivilegedActionException.
  *
  */
-
 public class PrivilegedActionExceptionTest extends TestCase {
     /**
      * Tests PrivilegedActionException(Exception)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PrivilegedActionException",
-        args = {java.lang.Exception.class}
-    )
     public void testPrivilegedActionException() {
         new PrivilegedActionException(null);
         Exception ex = new Exception();
@@ -55,12 +43,6 @@
     /**
      * Tests PrivilegedActionException.getException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getException",
-        args = {}
-    )
     public void testGetException() {
         assertNull(new PrivilegedActionException(null).getException());
         Exception ex = new Exception();
@@ -70,12 +52,6 @@
     /**
      * Tests PrivilegedActionException.toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         assertNotNull(new PrivilegedActionException(null).toString());
         assertNotNull(new PrivilegedActionException(new Exception()).toString());
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionTest.java
index fa69236..134d34a 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedActionTest.java
@@ -1,15 +1,10 @@
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-@TestTargetClass(PrivilegedAction.class)
 public class PrivilegedActionTest extends TestCase {
 
     protected void setUp() throws Exception {
@@ -35,10 +30,6 @@
 
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="run"
-    )
     public void testRun() {
         MyPrivilegedAction action = new MyPrivilegedAction();
         String result = AccessController.doPrivileged(action);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedExceptionActionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedExceptionActionTest.java
index c9f7425..597ee47 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedExceptionActionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PrivilegedExceptionActionTest.java
@@ -1,9 +1,5 @@
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import java.io.IOException;
@@ -11,7 +7,6 @@
 import java.security.PrivilegedActionException;
 import java.security.PrivilegedExceptionAction;
 
-@TestTargetClass(PrivilegedExceptionAction.class)
 public class PrivilegedExceptionActionTest extends TestCase {
 
     protected void setUp() throws Exception {
@@ -48,10 +43,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="run"
-    )
     public void testRun() {
         MyPrivilegedExceptionAction action1 = new MyPrivilegedExceptionAction();
         try {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProtectionDomainTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProtectionDomainTest.java
index a69f072..cdea5c5 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProtectionDomainTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProtectionDomainTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.net.URL;
 import java.net.MalformedURLException;
 import java.net.URLClassLoader;
@@ -40,12 +35,11 @@
 import java.security.ProtectionDomain;
 
 import junit.framework.TestCase;
-@TestTargetClass(ProtectionDomain.class)
+
 /**
  * Unit tests for java.security.ProtectionDomain.
  *
  */
-
 public class ProtectionDomainTest extends TestCase {
 
     private final AllPermission allperm = new AllPermission();
@@ -83,12 +77,6 @@
      * Class under test for void ProtectionDomain(CodeSource,
      * PermissionCollection)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProtectionDomain",
-        args = {java.security.CodeSource.class, java.security.PermissionCollection.class}
-    )
     public void testProtectionDomainCodeSourcePermissionCollection_00() {
         new ProtectionDomain(null, null);
         new ProtectionDomain(cs, null);
@@ -99,12 +87,6 @@
     /**
      * the ctor must set the PermissionCollection read-only
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProtectionDomain",
-        args = {java.security.CodeSource.class, java.security.PermissionCollection.class}
-    )
     public void testProtectionDomainCodeSourcePermissionCollection_01() {
         assertFalse(perms.isReadOnly());
         new ProtectionDomain(null, perms);
@@ -114,12 +96,6 @@
     /**
      * Test for ProtectionDomain(CodeSource, PermissionCollection, ClassLoader, Principal[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ProtectionDomain",
-        args = {java.security.CodeSource.class, java.security.PermissionCollection.class, java.lang.ClassLoader.class, java.security.Principal[].class}
-    )
     public void testProtectionDomainCodeSourcePermissionCollectionClassLoaderPrincipalArray() {
         new ProtectionDomain(null, null, null, null);
 
@@ -134,12 +110,6 @@
     /**
      * Tests for ProtectionDomain.getClassLoader()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getClassLoader",
-        args = {}
-    )
     public void testGetClassLoader() {
         assertNull(new ProtectionDomain(null, null).getClassLoader());
         assertSame(new ProtectionDomain(null, null, classldr, null)
@@ -149,12 +119,6 @@
     /**
      * Tests for ProtectionDomain.getCodeSource()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCodeSource",
-        args = {}
-    )
     public void testGetCodeSource() {
         assertNull(new ProtectionDomain(null, null).getCodeSource());
         assertSame(new ProtectionDomain(cs, null).getCodeSource(), cs);
@@ -163,12 +127,6 @@
     /**
      * Tests for ProtectionDomain.getPermissions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPermissions",
-        args = {}
-    )
     public void testGetPermissions() {
         assertNull(new ProtectionDomain(null, null).getPermissions());
         assertSame(new ProtectionDomain(null, perms).getPermissions(), perms);
@@ -177,12 +135,6 @@
     /**
      * getPrincipals() always returns non null array
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getPrincipals",
-        args = {}
-    )
     public void testGetPrincipals_00() {
         assertNotNull(new ProtectionDomain(null, null).getPrincipals());
     }
@@ -190,12 +142,6 @@
     /**
      * getPrincipals() returns new array each time it's called
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getPrincipals",
-        args = {}
-    )
     public void testGetPrincipals_01() {
         ProtectionDomain pd = new ProtectionDomain(null, null, null, principals);
         Principal[] got = pd.getPrincipals();
@@ -208,12 +154,6 @@
     /**
      * ProtectionDomain with null Permissions must not imply() permissions.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void testImplies_00() {
         assertFalse(new ProtectionDomain(null, null).implies(allperm));
     }
@@ -222,12 +162,6 @@
      * ProtectionDomain with PermissionCollection which contains AllPermission
      * must imply() AllPermission.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void testImplies_01() {
         assertTrue(new ProtectionDomain(null, perms).implies(allperm));
     }
@@ -236,12 +170,6 @@
      * ProtectionDomain created with a static set of permissions must not query
      * policy.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void testImplies_02() {
         TestPolicy policy = new TestPolicy();
         // null set of permissions [must] force the PD to use Policy - for
@@ -261,12 +189,6 @@
      * ProtectionDomain created with dynamic set of permissions must query
      * policy.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void testImplies_03() {
         TestPolicy policy = new TestPolicy();
         ProtectionDomain pd = new ProtectionDomain(cs, null, ClassLoader
@@ -284,12 +206,6 @@
     /**
      * Simply checks that it's working somehow
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         String res;
         res = new ProtectionDomain(null, null).toString();
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Provider2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Provider2Test.java
index 6fec8da..7f8c723 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Provider2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Provider2Test.java
@@ -17,17 +17,11 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.Provider;
 import java.security.Security;
 
-@TestTargetClass(Provider.class)
 public class Provider2Test extends junit.framework.TestCase {
 
     class TestProvider extends Provider {
@@ -55,14 +49,8 @@
 
 
     /**
-     * @tests java.security.Provider#entrySet()
+     * java.security.Provider#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "UnsupportedOperationException verification",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySet() {
         // test method of java.security.provider.entrySet
         provTest.put("test.prop", "this is a test property");
@@ -76,14 +64,8 @@
     }
 
     /**
-     * @tests java.security.Provider#getInfo()
+     * java.security.Provider#getInfo()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInfo",
-        args = {}
-    )
     public void test_getInfo() {
         // test method of java.security.provider.getInfo
         assertEquals("the information of the provider is not stored properly",
@@ -92,14 +74,8 @@
     }
 
     /**
-     * @tests java.security.Provider#getName()
+     * java.security.Provider#getName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() {
         // test method of java.security.provider.getName
         assertEquals("the name of the provider is not stored properly",
@@ -107,14 +83,8 @@
     }
 
     /**
-     * @tests java.security.Provider#getVersion()
+     * java.security.Provider#getVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getVersion",
-        args = {}
-    )
     public void test_getVersion() {
         // test method of java.security.provider.getVersion
         assertEquals("the version of the provider is not stored properly",
@@ -122,14 +92,8 @@
     }
 
     /**
-     * @tests java.security.Provider#keySet()
+     * java.security.Provider#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "UnsupportedOperationException verification",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         // test method of java.security.provider.keySet
         provTest.put("test.prop", "this is a test property");
@@ -142,14 +106,8 @@
     }
 
     /**
-     * @tests java.security.Provider#values()
+     * java.security.Provider#values()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "UnsupportedOperationException verification",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         // test method of java.security.provider.values
         provTest.put("test.prop", "this is a test property");
@@ -163,14 +121,8 @@
 
 
     /**
-     * @tests java.security.Provider#toString()
+     * java.security.Provider#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Regression test",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Regression for HARMONY-3734
         assertEquals("provTest version 1.2", provTest.toString());
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderExceptionTest.java
index d3db218..03a86e7 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.ProviderException;
 
 import junit.framework.TestCase;
-@TestTargetClass(ProviderException.class)
+
 /**
  * Tests for <code>ProviderException</code> class constructors and methods.
  *
@@ -48,12 +43,6 @@
      * Test for <code>ProviderException()</code> constructor Assertion:
      * constructs ProviderException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {}
-    )
     public void testProviderException01() {
         ProviderException tE = new ProviderException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -65,12 +54,6 @@
      * constructs ProviderException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.String.class}
-    )
     public void testProviderException02() {
         ProviderException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -85,12 +68,6 @@
      * Test for <code>ProviderException(String)</code> constructor Assertion:
      * constructs ProviderException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.String.class}
-    )
     public void testProviderException03() {
         String msg = null;
         ProviderException tE = new ProviderException(msg);
@@ -102,12 +79,6 @@
      * Test for <code>ProviderException(Throwable)</code> constructor
      * Assertion: constructs ProviderException when <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.Throwable.class}
-    )
     public void testProviderException04() {
         Throwable cause = null;
         ProviderException tE = new ProviderException(cause);
@@ -120,12 +91,6 @@
      * Assertion: constructs ProviderException when <code>cause</code> is not
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.Throwable.class}
-    )
     public void testProviderException05() {
         ProviderException tE = new ProviderException(tCause);
         if (tE.getMessage() != null) {
@@ -144,12 +109,6 @@
      * Assertion: constructs ProviderException when <code>cause</code> is null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testProviderException06() {
         ProviderException tE = new ProviderException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -161,12 +120,6 @@
      * Assertion: constructs ProviderException when <code>cause</code> is null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testProviderException07() {
         ProviderException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -182,12 +135,6 @@
      * Assertion: constructs ProviderException when <code>cause</code> is not
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testProviderException08() {
         ProviderException tE = new ProviderException(null, tCause);
         if (tE.getMessage() != null) {
@@ -206,12 +153,6 @@
      * Assertion: constructs ProviderException when <code>cause</code> is not
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ProviderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testProviderException09() {
         ProviderException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderServiceTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderServiceTest.java
index d426b20..bef27ba 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderServiceTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderServiceTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidParameterException;
 import java.security.Provider;
 import java.security.Provider.Service;
@@ -38,19 +33,13 @@
 import org.apache.harmony.security.tests.support.RandomImpl;
 
 import junit.framework.TestCase;
-@TestTargetClass(Service.class)
+
 /**
  * Tests for <code>Provider.Service</code> constructor and methods
  *
  */
 public class ProviderServiceTest extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Service",
-        args = {java.security.Provider.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.util.List.class, java.util.Map.class}
-    )
     public void testService() {
         Provider p = new MyProvider();
         try {
@@ -95,12 +84,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAttribute",
-        args = {java.lang.String.class}
-    )
     public void testGetAttribute() {
         Provider p = new MyProvider();
         Provider.Service s = new Provider.Service(p, "type", "algorithm",
@@ -132,12 +115,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {java.lang.Object.class}
-    )
     public void testNewInstance() throws Exception {
         Provider p = new MyProvider();
         Provider.Service s = new Provider.Service(p, "SecureRandom",
@@ -156,12 +133,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void testGetAlgorithm() {
         Provider p = new MyProvider();
         Provider.Service s1 = new Provider.Service(p, "type", "algorithm",
@@ -174,12 +145,6 @@
         assertTrue(s2.getAlgorithm().equals("algorithm"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getClassName",
-        args = {}
-    )
     public void testGetClassName() {
         Provider p = new MyProvider();
         Provider.Service s1 = new Provider.Service(p, "type", "algorithm",
@@ -192,12 +157,6 @@
         assertTrue(s2.getClassName().equals("tests.java.security.support.RandomImpl"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void testGetProvider() {
         Provider p = new MyProvider();
         Provider.Service s1 = new Provider.Service(p, "type", "algorithm",
@@ -210,12 +169,6 @@
         assertTrue(s2.getProvider() == p);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getType",
-        args = {}
-    )
     public void testGetType() {
         Provider p = new MyProvider();
         Provider.Service s1 = new Provider.Service(p, "type", "algorithm",
@@ -228,12 +181,6 @@
         assertTrue(s2.getType().equals("SecureRandom"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "supportsParameter",
-        args = {java.lang.Object.class}
-    )
     public void testSupportsParameter() {
         Provider p = new MyProvider();
         Provider.Service s1 = new Provider.Service(p, "type", "algorithm",
@@ -242,12 +189,6 @@
         assertTrue(s1.supportsParameter(new Object()));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         Provider p = new MyProvider();
         Provider.Service s1 = new Provider.Service(p, "type", "algorithm",
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
index b85dad0..9a90424 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/ProviderTest.java
@@ -36,17 +36,12 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.util.Map;
+import java.util.Locale;
 import java.util.Set;
 import java.util.Map.Entry;
 
 import junit.framework.TestCase;
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
-@TestTargetClass(Provider.class)
 /**
  * Tests for <code>Provider</code> constructor and methods
  *
@@ -94,12 +89,6 @@
     /*
      * Class under test for void Provider()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies provider object",
-        method = "Provider",
-        args = {java.lang.String.class, double.class, java.lang.String.class}
-    )
     public final void testProvider() {
         if (!p.getProperty("Provider.id name").equals(
                 String.valueOf(p.getName()))) {
@@ -119,12 +108,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public final void testClear() {
         p.clear();
         assertNull(p.getProperty("MessageDigest.SHA-1"));
@@ -133,12 +116,6 @@
     /*
      * Class under test for void Provider(String, double, String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with non null parameters",
-        method = "Provider",
-        args = {java.lang.String.class, double.class, java.lang.String.class}
-    )
     public final void testProviderStringdoubleString() {
         Provider p = new MyProvider("Provider name", 123.456, "Provider info");
         assertEquals("Provider name", p.getName());
@@ -150,22 +127,10 @@
         assertEquals("MyProvider", p.getName());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getVersion",
-        args = {}
-    )
     public final void testGetVersion() {
         assertEquals(1.0, p.getVersion(), 0L);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInfo",
-        args = {}
-    )
     public final void testGetInfo() {
         assertEquals("Provider for testing", p.getInfo());
     }
@@ -173,12 +138,6 @@
     /*
      * Class under test for void putAll(Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public final void testPutAllMap() {
         HashMap hm = new HashMap();
         hm.put("MessageDigest.SHA-1", "aaa.bbb.ccc.ddd");
@@ -197,12 +156,6 @@
     /*
      * Class under test for Set entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public final void testEntrySet() {
         p.put("MessageDigest.SHA-256", "aaa.bbb.ccc.ddd");
 
@@ -250,12 +203,6 @@
     /*
      * Class under test for Set keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public final void testKeySet() {
         p.put("MessageDigest.SHA-256", "aaa.bbb.ccc.ddd");
 
@@ -283,12 +230,6 @@
     /*
      * Class under test for Collection values()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public final void testValues() {
         p.put("MessageDigest.ASH-256", "aaa.bbb.ccc.ddd");
 
@@ -315,12 +256,6 @@
     /*
      * Class under test for Object put(Object, Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public final void testPutObjectObject() {
         p.put("MessageDigest.SHA-1", "aaa.bbb.ccc.ddd");
         p.put("Type.Algorithm", "className");
@@ -354,12 +289,6 @@
     /*
      * Class under test for Object remove(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public final void testRemoveObject() {
         Object o = p.remove("MessageDigest.SHA-1");
 
@@ -371,17 +300,25 @@
     public final void testService1() {
         p.put("MessageDigest.SHA-1", "AnotherClassName");
         Provider.Service s = p.getService("MessageDigest", "SHA-1");
-
         assertEquals("AnotherClassName", s.getClassName());
     }
 
+    public final void testGetServiceCaseSensitivity() {
+        p.put("i.I", "foo");
+
+        Locale defaultLocale = Locale.getDefault();
+        Locale.setDefault(new Locale("tr", "TR"));
+        try {
+            assertEquals("foo", p.getService("i", "i").getClassName());
+            assertEquals("foo", p.getService("i", "I").getClassName());
+            assertNull(p.getService("\u0130", "\u0130")); // Turkish dotless i and dotted I
+            assertNull(p.getService("\u0131", "\u0131"));
+        } finally {
+            Locale.setDefault(defaultLocale);
+        }
+    }
+
     // Regression for HARMONY-2760.
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test: verifies constructor with two null parameters.",
-        method = "Provider",
-        args = {java.lang.String.class, double.class, java.lang.String.class}
-    )
     public void testConstructor() {
         MyProvider myProvider = new MyProvider(null, 1, null);
         assertNull(myProvider.getName());
@@ -422,12 +359,6 @@
     }
 
     // BEGIN android-added
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getService",
-            args = {java.lang.String.class, java.lang.String.class}
-        )
     public final void testService2() {
         Provider[] pp = Security.getProviders("MessageDigest.ASH-1");
         if (pp == null) {
@@ -449,12 +380,6 @@
     // END android-added
 
     // BEGIN android-added
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getServices",
-        args = {}
-    )
     public final void testGetServices() {
         MyProvider myProvider = new MyProvider(null, 1, null);
         Set<Provider.Service> services = myProvider.getServices();
@@ -495,12 +420,6 @@
     // END android-added
 
     // BEGIN android-added
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putService",
-        args = {java.security.Provider.Service.class}
-    )
     public final void testPutService() {
         MyProvider myProvider = new MyProvider(null, 1, null);
         Provider.Service s[] = new Provider.Service[3];
@@ -552,12 +471,6 @@
     // END android-added
 
     // BEGIN android-added
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeService",
-        args = {java.security.Provider.Service.class}
-    )
     public final void testRemoveService() {
         MyProvider myProvider = new MyProvider(null, 1, null);
         try {
@@ -626,12 +539,6 @@
     // END android-added
 
     // BEGIN android-added
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "load",
-        args = {java.io.InputStream.class}
-    )
     public final void testLoad() throws IOException {
         InputStream is = new ByteArrayInputStream(writeProperties());
         MyProvider myProvider = new MyProvider("name", 1, "info");
@@ -657,12 +564,6 @@
     // END android-added
 
     // BEGIN android-added
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "load",
-            args = {java.io.InputStream.class}
-        )
     public final void testLoad2() {
         class TestInputStream extends InputStream {
             @Override
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PublicKeyTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PublicKeyTest.java
index fe6e1e7..46d003d 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/PublicKeyTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/PublicKeyTest.java
@@ -25,26 +25,16 @@
 import java.security.PublicKey;
 
 import junit.framework.TestCase;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-@TestTargetClass(PublicKey.class)
+
 /**
  * Tests for <code>PublicKey</code> class field
  *
  */
-
 public class PublicKeyTest extends TestCase {
 
     /**
      * Test for <code>serialVersionUID</code> field
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Field testing",
-        method = "!serialVersionUID",
-        args = {}
-    )
     public void testField() {
         checkPublicKey cPK = new checkPublicKey();
         assertEquals("Incorrect serialVersionUID", cPK.getSerVerUID(), //PublicKey.serialVersionUID,
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java
index 75eeceb..d9f4dd7 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Security2Test.java
@@ -17,9 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import java.security.InvalidParameterException;
 import java.security.Provider;
 import java.security.Security;
@@ -30,18 +27,11 @@
 import tests.support.Support_ProviderTrust;
 import tests.support.Support_TestProvider;
 
-@TestTargetClass(Security.class)
 public class Security2Test extends junit.framework.TestCase {
 
     /**
-     * @tests java.security.Security#getProviders(java.lang.String)
+     * java.security.Security#getProviders(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "NullPointerException checking missed",
-        method = "getProviders",
-        args = {java.lang.String.class}
-    )
     public void test_getProvidersLjava_lang_String() {
         // Test for method void
         // java.security.Security.getProviders(java.lang.String)
@@ -215,14 +205,8 @@
     }
 
     /**
-     * @tests java.security.Security#getProviders(java.util.Map)
+     * java.security.Security#getProviders(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "NullPointerException checking missed",
-        method = "getProviders",
-        args = {java.util.Map.class}
-    )
     public void test_getProvidersLjava_util_Map() {
         // Test for method void
         // java.security.Security.getProviders(java.util.Map)
@@ -306,14 +290,8 @@
     }
 
     /**
-     * @tests java.security.Security#removeProvider(java.lang.String)
+     * java.security.Security#removeProvider(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "SecurityException checking missed",
-        method = "removeProvider",
-        args = {java.lang.String.class}
-    )
     public void test_removeProviderLjava_lang_String() {
         // Test for method void
         // java.security.Security.removeProvider(java.lang.String)
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermission2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermission2Test.java
index 9194193..f47e2d4 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermission2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermission2Test.java
@@ -17,25 +17,13 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.SecurityPermission;
 
-@TestTargetClass(SecurityPermission.class)
 public class SecurityPermission2Test extends junit.framework.TestCase {
 
     /**
-     * @tests java.security.SecurityPermission#SecurityPermission(java.lang.String)
+     * java.security.SecurityPermission#SecurityPermission(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verification with valid parameter only",
-        method = "SecurityPermission",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.security.SecurityPermission(java.lang.String)
         assertEquals("create securityPermission constructor(string) failed",
@@ -45,15 +33,9 @@
     }
 
     /**
-     * @tests java.security.SecurityPermission#SecurityPermission(java.lang.String,
+     * java.security.SecurityPermission#SecurityPermission(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verification with valid parameters only",
-        method = "SecurityPermission",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         // Test for method java.security.SecurityPermission(java.lang.String,
         // java.lang.String)
@@ -62,4 +44,4 @@
                 "security.file", sp.getName());
 
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermissionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermissionTest.java
index 6eedf88..99bf0ac 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermissionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityPermissionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.SecurityPermission;
 
 import junit.framework.TestCase;
-@TestTargetClass(SecurityPermission.class)
+
 /**
  * Tests for <code>SecurityPermission</code>
  *
@@ -42,20 +37,6 @@
      * If  name is empty then IAE should be thrown.
      * Action is ignored.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "SecurityPermission",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "SecurityPermission",
-            args = {java.lang.String.class, java.lang.String.class}
-        )
-    })
     public void testCtor()
     {
         String name = "basic123*$%#";
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityTest.java
index ba96158..f50318f 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SecurityTest.java
@@ -22,38 +22,22 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.InvalidParameterException;
 import java.security.Provider;
 import java.security.Security;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
-
-
-
 import junit.framework.TestCase;
-@TestTargetClass(Security.class)
-/**
- * Tests for <code>Security</code> constructor and methods
- */
+
+
 public class SecurityTest extends TestCase {
 
     /**
-     * @tests java.security.Security#insertProviderAt(Provider, int)
+     * java.security.Security#insertProviderAt(Provider, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "SecurityException checking missed",
-        method = "insertProviderAt",
-        args = {java.security.Provider.class, int.class}
-    )
     public final void test_insertProviderAtLjava_security_ProviderLI() {
 
         try {
@@ -96,14 +80,8 @@
     }
 
     /**
-     * @tests java.security.Security#addProvider(Provider)
+     * java.security.Security#addProvider(Provider)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "SecurityException checking missed",
-        method = "addProvider",
-        args = {java.security.Provider.class}
-    )
     public final void test_addProviderLjava_security_Provider() {
 
         try {
@@ -129,17 +107,11 @@
     }
 
     /**
-     * @tests java.security.Security#getAlgorithmProperty(String algName, String
+     * java.security.Security#getAlgorithmProperty(String algName, String
      *        propName)
      * @disabled because Security.getAlgorithmProperty looks for
      *           "propName.algName" instead of "Alg.propName.algName"
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithmProperty",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     @SuppressWarnings("deprecation")
     public final void testGetAlgorithmPropertyLjava_lang_String_java_lang_String() {
 
@@ -162,14 +134,8 @@
     }
 
     /**
-     * @tests java.security.Security#getAlgorithms(String serviceName)
+     * java.security.Security#getAlgorithms(String serviceName)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithms",
-        args = {java.lang.String.class}
-    )
     public final void testGetAlgorithmsLjava_lang_String() {
         String[] servicesNames = { "Signature", "MessageDigest", "Cipher",
                 "Mac", "KeyStore" };
@@ -187,12 +153,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "removeProvider",
-        args = {java.lang.String.class}
-    )
     public final void testRemoveProvider() {
         Provider[] providers;
         Provider[] providers1;
@@ -218,22 +178,8 @@
     }
 
     /**
-     * @tests java.security.Security#getProvider(String)
+     * java.security.Security#getProvider(String)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getProvider",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getProviders",
-            args = {}
-        )
-    })
     public final void test_getProviderLjava_lang_String() {
 
         // Returns null if no provider with the specified name is installed
@@ -263,16 +209,9 @@
     }
 
     /**
-     * @tests java.security.Security#getProviders(String)
+     * java.security.Security#getProviders(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProviders",
-        args = {java.lang.String.class}
-    )
     public void test_getProvidersLjava_lang_String() {
-
         try {
             Security.getProviders("");
             fail("No expected InvalidParameterException");
@@ -285,6 +224,17 @@
         } catch (NullPointerException e) {
         }
 
+        testGetProviders(Locale.US);
+        testGetProviders(new Locale("tr", "TR"));
+    }
+
+    /**
+     * Test that Security.getProviders does case sensitive operations
+     * independent of its locale.
+     */
+    private void testGetProviders(Locale locale) {
+        Locale defaultLocale = Locale.getDefault();
+        Locale.setDefault(locale);
         Provider p = new MyProvider();
         try {
             Security.addProvider(p);
@@ -307,6 +257,9 @@
             filter = "MyService.MyAlgorithm ATTribute:attributeVALUE";
             assertTrue(filter, Arrays.equals(new Provider[] { p }, Security
                     .getProviders(filter)));
+            filter = "MyService.MyAlgorithm \u0130mPLemented\u0131n:softWARE"; // Turkish dotless i
+            assertTrue(filter, Arrays.equals(new Provider[] { p }, Security
+                    .getProviders(filter)));
 
             // Regression for HARMONY-2761
             filter = "MyService.NoKeySize KeySize:512";
@@ -319,18 +272,13 @@
             assertNull(filter, Security.getProviders(filter));
         } finally { // clean up
             Security.removeProvider(p.getName());
+            Locale.setDefault(defaultLocale);
         }
     }
 
     /**
-     * @tests java.security.Security#getProviders(java.util.Map)
+     * java.security.Security#getProviders(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProviders",
-        args = {java.util.Map.class}
-    )
     public void test_getProvidersLjava_util_Map() {
 
         Map<String, String> m = new HashMap<String, String>();
@@ -401,14 +349,8 @@
     }
 
     /**
-     * @tests java.security.Security#getProviders()
+     * java.security.Security#getProviders()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProviders",
-        args = {}
-    )
     public void test_getProviders() {
         Provider[] prv;
 
@@ -436,14 +378,8 @@
     }
 
     /**
-     * @tests java.security.Security#getProperty(String)
+     * java.security.Security#getProperty(String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verification of null parameter only.",
-        method = "getProperty",
-        args = {java.lang.String.class}
-    )
     public void test_getPropertyLjava_lang_String() {
 
         try {
@@ -457,14 +393,8 @@
     }
 
     /**
-     * @tests java.security.Security#setProperty(String,String)
+     * java.security.Security#setProperty(String,String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "SecurityException checking missed",
-        method = "setProperty",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_setPropertyLjava_lang_StringLjava_lang_String() {
 
         try {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java
index 6355bee..44e956a 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/Signature2Test.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.math.BigInteger;
 import java.nio.ByteBuffer;
 import java.security.AlgorithmParameters;
@@ -44,7 +39,6 @@
 import java.security.NoSuchAlgorithmException;
 import java.security.NoSuchProviderException;
 
-@TestTargetClass(Signature.class)
 public class Signature2Test extends junit.framework.TestCase {
 
     private static final String MESSAGE = "abc";
@@ -66,14 +60,8 @@
     }
 
     /**
-     * @tests java.security.Signature#clone()
+     * java.security.Signature#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "CloneNotSupportedException checking was tested",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() throws Exception {
         Signature s = Signature.getInstance("DSA");
         try {
@@ -85,14 +73,8 @@
     }
 
     /**
-     * @tests java.security.Signature#getAlgorithm()
+     * java.security.Signature#getAlgorithm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm() throws Exception {
         String alg = Signature.getInstance("DSA").getAlgorithm();
         assertTrue("getAlgorithm did not get DSA (" + alg + ")", alg
@@ -100,14 +82,8 @@
     }
 
     /**
-     * @tests java.security.Signature#getInstance(java.lang.String)
+     * java.security.Signature#getInstance(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() {
         try {
             Signature.getInstance("DSA");
@@ -124,15 +100,9 @@
     }
 
     /**
-     * @tests java.security.Signature#getInstance(java.lang.String,
+     * java.security.Signature#getInstance(java.lang.String,
      *        java.security.Provider)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String_java_security_Provider()
             throws Exception {
         Provider[] providers = Security.getProviders("Signature.DSA");
@@ -173,15 +143,9 @@
     }
 
     /**
-     * @tests java.security.Signature#getInstance(java.lang.String,
+     * java.security.Signature#getInstance(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String()
             throws Exception {
         Provider[] providers = Security.getProviders("Signature.DSA");
@@ -219,14 +183,8 @@
     }
 
     /**
-     * @tests java.security.Signature#getParameters()
+     * java.security.Signature#getParameters()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameters",
-        args = {}
-    )
     public void test_getParameters() throws Exception {
         Signature sig = Signature.getInstance("DSA");
         try {
@@ -252,14 +210,8 @@
     }
 
     /**
-     * @tests java.security.Signature#getParameter(java.lang.String)
+     * java.security.Signature#getParameter(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Just exception case was tested",
-        method = "getParameter",
-        args = {java.lang.String.class}
-    )
     @SuppressWarnings("deprecation")
     public void test_getParameterLjava_lang_String() throws Exception {
         Signature sig = Signature.getInstance("DSA");
@@ -272,28 +224,16 @@
     }
 
     /**
-     * @tests java.security.Signature#getProvider()
+     * java.security.Signature#getProvider()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws Exception {
         Provider p = Signature.getInstance("DSA").getProvider();
         assertNotNull("provider is null", p);
     }
 
     /**
-     * @tests java.security.Signature#initSign(java.security.PrivateKey)
+     * java.security.Signature#initSign(java.security.PrivateKey)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "initSign",
-        args = {java.security.PrivateKey.class}
-    )
     public void test_initSignLjava_security_PrivateKey() throws Exception {
         try {
             Signature.getInstance("DSA").initSign(dsaKeys.getPrivate());
@@ -309,11 +249,6 @@
         }
     }
 
-    @TestTargetNew (
-            level=TestLevel.COMPLETE,
-            method="initSign",
-            args={PrivateKey.class, SecureRandom.class}
-    )
     public void test_initSignLjava_security_PrivateKeyLjava_security_SecureRandom() {
 
         try {
@@ -337,14 +272,8 @@
     }
 
     /**
-     * @tests java.security.Signature#initVerify(java.security.PublicKey)
+     * java.security.Signature#initVerify(java.security.PublicKey)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "initVerify",
-        args = {java.security.PublicKey.class}
-    )
     public void test_initVerifyLjava_security_PublicKey() throws Exception {
         Signature.getInstance("DSA").initVerify(dsaKeys.getPublic());
 
@@ -358,14 +287,8 @@
     }
 
     /**
-     * @tests java.security.Signature#initVerify(java.security.cert.Certificate)
+     * java.security.Signature#initVerify(java.security.cert.Certificate)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidKeyException checking missed",
-        method = "initVerify",
-        args = {java.security.cert.Certificate.class}
-    )
     public void test_initVerifyLjava_security_Certificate() throws Exception {
         Provider p = new MyProvider();
         p.put("DSA", "tests.java.security.support.cert.MyCertificate$1");
@@ -391,15 +314,9 @@
     }
 
     /**
-     * @tests java.security.Signature#setParameter(java.lang.String,
+     * java.security.Signature#setParameter(java.lang.String,
      *        java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Just exception case was tested",
-        method = "setParameter",
-        args = {java.lang.String.class, java.lang.Object.class}
-    )
     @SuppressWarnings("deprecation")
     public void test_setParameterLjava_lang_StringLjava_lang_Object()
             throws Exception {
@@ -416,14 +333,8 @@
     }
 
     /**
-     * @tests java.security.Signature#setParameter(java.security.spec.AlgorithmParameterSpec)
+     * java.security.Signature#setParameter(java.security.spec.AlgorithmParameterSpec)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Just exception case was tested",
-        method = "setParameter",
-        args = {java.security.spec.AlgorithmParameterSpec.class}
-    )
     public void test_setParameterLjava_security_spec_AlgorithmParameterSpec()
             throws Exception {
         Signature sig = Signature.getInstance("DSA");
@@ -440,14 +351,8 @@
     }
 
     /**
-     * @tests java.security.Signature#sign()
+     * java.security.Signature#sign()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Verification of returned value missed. SignatureException checking missed.",
-        method = "sign",
-        args = {}
-    )
     public void test_sign() throws Exception {
         Signature sig = Signature.getInstance("DSA");
         sig.initSign(dsaKeys.getPrivate());
@@ -456,28 +361,16 @@
     }
 
     /**
-     * @tests java.security.Signature#toString()
+     * java.security.Signature#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
         String str = Signature.getInstance("DSA").toString();
         assertNotNull("toString is null", str);
     }
 
     /**
-     * @tests java.security.Signature#update(byte[])
+     * java.security.Signature#update(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SignatureException checking missed",
-        method = "update",
-        args = {byte[].class}
-    )
     public void test_update$B() throws Exception {
         Signature sig = Signature.getInstance("DSA");
         sig.initSign(dsaKeys.getPrivate());
@@ -495,14 +388,8 @@
     }
 
     /**
-     * @tests java.security.Signature#update(byte[], int, int)
+     * java.security.Signature#update(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "SignatureException checking missed. Verification of different values off and len missed.",
-        method = "update",
-        args = {byte[].class, int.class, int.class}
-    )
     public void test_update$BII() throws Exception {
         Signature sig = Signature.getInstance("DSA");
         byte[] bytes = MESSAGE.getBytes();
@@ -537,14 +424,8 @@
     }
 
     /**
-     * @tests java.security.Signature#update(byte)
+     * java.security.Signature#update(byte)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "SignatureException checking missed",
-        method = "update",
-        args = {byte.class}
-    )
     public void test_updateB() throws Exception {
         Signature sig = Signature.getInstance("DSA");
         sig.initSign(dsaKeys.getPrivate());
@@ -554,14 +435,8 @@
     }
 
     /**
-     * @tests java.security.Signature#update(ByteBuffer data)
+     * java.security.Signature#update(ByteBuffer data)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "update",
-        args = {java.nio.ByteBuffer.class}
-    )
     public void test_updateLjava_nio_ByteBuffer() throws Exception {
         Signature sig = Signature.getInstance("DSA");
         ByteBuffer buffer = ByteBuffer.allocate(10);
@@ -582,14 +457,8 @@
     }
 
     /**
-     * @tests java.security.Signature#verify(byte[])
+     * java.security.Signature#verify(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "verify",
-        args = {byte[].class}
-    )
     public void test_verify$B() throws Exception {
         Signature sig = Signature.getInstance("DSA");
 
@@ -610,14 +479,8 @@
     }
 
     /**
-     * @tests java.security.Signature#verify(byte[], int, int)
+     * java.security.Signature#verify(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "verify",
-        args = {byte[].class, int.class, int.class}
-    )
     public void test_verify$BII() throws Exception {
         Signature sig = Signature.getInstance("DSA");
         sig.initSign(dsaKeys.getPrivate());
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureExceptionTest.java
index 40d3d1f..87a9384 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.SignatureException;
 
 import junit.framework.TestCase;
-@TestTargetClass(SignatureException.class)
+
 /**
  * Tests for <code>SignatureException</code> class constructors and methods.
  *
@@ -48,12 +43,6 @@
      * Test for <code>SignatureException()</code> constructor Assertion:
      * constructs SignatureException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {}
-    )
     public void testSignatureException01() {
         SignatureException tE = new SignatureException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -65,12 +54,6 @@
      * constructs SignatureException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.String.class}
-    )
     public void testSignatureException02() {
         SignatureException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -85,12 +68,6 @@
      * Test for <code>SignatureException(String)</code> constructor Assertion:
      * constructs SignatureException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.String.class}
-    )
     public void testSignatureException03() {
         String msg = null;
         SignatureException tE = new SignatureException(msg);
@@ -103,12 +80,6 @@
      * Assertion: constructs SignatureException when <code>cause</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.Throwable.class}
-    )
     public void testSignatureException04() {
         Throwable cause = null;
         SignatureException tE = new SignatureException(cause);
@@ -121,12 +92,6 @@
      * Assertion: constructs SignatureException when <code>cause</code> is not
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.Throwable.class}
-    )
     public void testSignatureException05() {
         SignatureException tE = new SignatureException(tCause);
         if (tE.getMessage() != null) {
@@ -145,12 +110,6 @@
      * Assertion: constructs SignatureException when <code>cause</code> is
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSignatureException06() {
         SignatureException tE = new SignatureException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -162,12 +121,6 @@
      * Assertion: constructs SignatureException when <code>cause</code> is
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSignatureException07() {
         SignatureException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -183,12 +136,6 @@
      * Assertion: constructs SignatureException when <code>cause</code> is not
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSignatureException08() {
         SignatureException tE = new SignatureException(null, tCause);
         if (tE.getMessage() != null) {
@@ -207,12 +154,6 @@
      * Assertion: constructs SignatureException when <code>cause</code> is not
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SignatureException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSignatureException09() {
         SignatureException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureSpiTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureSpiTest.java
index 2b421e3..ea0bd7f 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureSpiTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureSpiTest.java
@@ -1,10 +1,5 @@
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import java.nio.ByteBuffer;
@@ -21,7 +16,7 @@
 import java.security.spec.AlgorithmParameterSpec;
 import java.util.HashSet;
 import java.util.Set;
-@TestTargetClass(SignatureSpi.class)
+
 public class SignatureSpiTest extends TestCase {
 
     protected void setUp() throws Exception {
@@ -33,12 +28,6 @@
     }
 
     @SuppressWarnings("cast")
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SignatureSpi",
-        args = {}
-    )
     public void testSignatureSpi() {
         try {
             MySignatureSpi1 ss1 = new MySignatureSpi1();
@@ -49,12 +38,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void testClone() {
         MySignatureSpi1 ss1 = new MySignatureSpi1();
         try {
@@ -73,56 +56,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetParameter",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineInitSign",
-            args = {java.security.PrivateKey.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineInitVerify",
-            args = {java.security.PublicKey.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineSetParameter",
-            args = {java.lang.String.class, java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineSign",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineUpdate",
-            args = {byte.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineUpdate",
-            args = {byte[].class, int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineVerify",
-            args = {byte[].class}
-        )
-    })
     public void testAbstractMethods() {
         MySignatureSpi1 ss1 = new MySignatureSpi1();
         byte[] b = {0, 1, 2, 3, 4, 5};
@@ -143,12 +76,6 @@
     private boolean engineGetParametersCalled = false;
     private boolean engineGetParametersExceptionOcurred = false;
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineGetParameters",
-        args = {}
-    )
     public void testEngineGetParameters() {
         // or rather test that no UnsupportedOperationException is thrown?
 
@@ -382,11 +309,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="engineInitSign",
-            args={PrivateKey.class, SecureRandom.class}
-    )
     public void testEngineInitSign_PrivateKey_SecureRandom() {
         MySignature signature = new MySignature("dummy");
 
@@ -399,11 +321,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="engineSetParameter",
-            args={AlgorithmParameterSpec.class}
-    )
     public void testEngineSetParameter()
     {
         MySignature signature = new MySignature("dummy");
@@ -419,11 +336,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="engineSign",
-            args={byte[].class,int.class, int.class}
-    )
     public void testEngineSign_BII() {
         MySignature signature = new MySignature("dummy");
         try {
@@ -454,11 +366,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="engineUpdate",
-            args={ByteBuffer.class}
-    )
     public void testEngineUpdate_ByteBuffer() {
         MySignature signature = new MySignature("dummy");
         try {
@@ -489,11 +396,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="engineVerify",
-            args={byte[].class,int.class,int.class}
-    )
     public void testEngineVerify_BII() {
         MySignature signature = new MySignature("dummy");
 
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureTest.java
index fdaaa90..d00e18a 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignatureTest.java
@@ -23,10 +23,6 @@
 package org.apache.harmony.security.tests.java.security;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
 
 import java.security.InvalidParameterException;
 import java.security.NoSuchAlgorithmException;
@@ -46,7 +42,7 @@
 import org.apache.harmony.security.tests.support.MySignature1;
 
 import junit.framework.TestCase;
-@TestTargetClass(Signature.class)
+
 /**
  * Tests for <code>Signature</code> constructor and methods
  *
@@ -56,12 +52,6 @@
     /*
      * Class under test for Signature(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Signature",
-        args = {java.lang.String.class}
-    )
     public void testConstructor() {
         String [] algorithms = { "SHA256WITHRSA", "NONEWITHDSA", "SHA384WITHRSA",
             "MD5ANDSHA1WITHRSA", "SHA512WITHRSA",
@@ -87,12 +77,6 @@
     /*
      * Class under test for Object clone()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Just exception case was tested",
-        method = "clone",
-        args = {}
-    )
     public void testClone() {
         MySignature1 s = new MySignature1("ABC");
         try {
@@ -110,12 +94,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void testGetProvider() {
         MySignature1 s = new MySignature1("ABC");
 
@@ -123,12 +101,6 @@
         assertNull("provider", s.getProvider());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void testGetAlgorithm() {
         MySignature1 s = new MySignature1("ABC");
 
@@ -139,12 +111,6 @@
     /*
      * Class under test for void initVerify(PublicKey)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "InvalidKeyException checking missed",
-        method = "initVerify",
-        args = {java.security.PublicKey.class}
-    )
     public void testInitVerifyPublicKey() throws InvalidKeyException {
         MySignature1 s = new MySignature1("ABC");
 
@@ -165,12 +131,6 @@
     /*
      * Class under test for void initVerify(Certificate)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "initVerify",
-        args = {java.security.cert.Certificate.class}
-    )
     public void testInitVerifyCertificate() throws InvalidKeyException {
         MySignature1 s = new MySignature1("ABC");
 
@@ -192,12 +152,6 @@
     /*
      * Class under test for void initSign(PrivateKey)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "initSign",
-        args = {java.security.PrivateKey.class}
-    )
     public void testInitSignPrivateKey() throws InvalidKeyException {
         MySignature1 s = new MySignature1("ABC");
 
@@ -232,12 +186,6 @@
     /*
      * Class under test for void initSign(PrivateKey, SecureRandom)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "InvalidKeyException checking missed",
-        method = "initSign",
-        args = {java.security.PrivateKey.class, java.security.SecureRandom.class}
-    )
     public void testInitSignPrivateKeySecureRandom() throws InvalidKeyException {
         MySignature1 s = new MySignature1("ABC");
 
@@ -259,12 +207,6 @@
     /*
      * Class under test for byte[] sign()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Verification of returned value missed",
-        method = "sign",
-        args = {}
-    )
     public void testSign() throws Exception {
         MySignature1 s = new MySignature1("ABC");
         try {
@@ -290,12 +232,6 @@
     /*
      * Class under test for sign(byte[], offset, len)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sign",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testSignbyteintint() throws Exception {
         MySignature1 s = new MySignature1("ABC");
         byte[] outbuf = new byte [10];
@@ -340,12 +276,6 @@
     /*
      * Class under test for boolean verify(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verification of returned value missed",
-        method = "verify",
-        args = {byte[].class}
-    )
     public void testVerifybyteArray() throws Exception {
         MySignature1 s = new MySignature1("ABC");
         byte[] b = {1, 2, 3, 4};
@@ -371,12 +301,6 @@
     /*
      * Class under test for boolean verify(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verification of returned value missed. Verification of different parameters offset and length missed.",
-        method = "verify",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testVerifybyteArrayintint() throws Exception {
         MySignature1 s = new MySignature1("ABC");
         byte[] b = {1, 2, 3, 4};
@@ -410,12 +334,6 @@
     /*
      * Class under test for void update(byte)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "update",
-        args = {byte.class}
-    )
     public void testUpdatebyte() throws Exception {
         MySignature1 s = new MySignature1("ABC");
         try {
@@ -444,12 +362,6 @@
     /*
      * Class under test for void update(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "update",
-        args = {byte[].class}
-    )
     public void testUpdatebyteArray() throws Exception {
         MySignature1 s = new MySignature1("ABC");
         byte[] b = {1, 2, 3, 4};
@@ -489,12 +401,6 @@
     /*
      * Class under test for void update(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "update",
-        args = {byte[].class, int.class, int.class}
-    )
     public void testUpdatebyteArrayintint() throws Exception {
         MySignature1 s = new MySignature1("ABC");
         byte[] b = {1, 2, 3, 4};
@@ -538,12 +444,6 @@
     /*
      * Class under test for void update(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "update",
-        args = {byte[].class, int.class, int.class}
-    )
     @KnownFailure("Android throws IllegalArgumentException, RI throws NullpointerException")
     public void testUpdatebyteArrayintint2() throws Exception {
         MySignature1 s = new MySignature1("ABC");
@@ -569,12 +469,6 @@
     /*
      * Class under test for void setParameter(String, Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setParameter",
-        args = {java.lang.String.class, java.lang.Object.class}
-    )
     @SuppressWarnings("deprecation")
     public void testSetParameterStringObject() {
         MySignature1 s = new MySignature1("ABC");
@@ -594,12 +488,6 @@
     /*
      * Class under test for void setParameter(AlgorithmParameterSpec)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setParameter",
-        args = {java.security.spec.AlgorithmParameterSpec.class}
-    )
     public void testSetParameterAlgorithmParameterSpec() throws InvalidAlgorithmParameterException {
         MySignature1 s = new MySignature1("ABC");
         try {
@@ -618,12 +506,6 @@
         }
     }
 
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getParameter",
-            args = {java.lang.String.class}
-    )
     @SuppressWarnings("deprecation")
     public void testGetParameter() {
         MySignature1 s = new MySignature1("ABC");
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignedObjectTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignedObjectTest.java
index 89d872e..5b98be3 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignedObjectTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignedObjectTest.java
@@ -17,11 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import java.security.NoSuchAlgorithmException;
 import java.security.Signature;
 import java.security.SignedObject;
@@ -44,44 +39,12 @@
 import java.security.SignedObject;
 import java.security.spec.InvalidKeySpecException;
 import java.util.Properties;
-@TestTargetClass(SignedObject.class)
+
 /**
  * Tests for <code>SignedObject</code> constructor and methods
  */
 public class SignedObjectTest extends TestCase {
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "SignedObject",
-            args = {java.io.Serializable.class, java.security.PrivateKey.class, java.security.Signature.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getAlgorithm",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getObject",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSignature",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "verify",
-            args = {java.security.PublicKey.class, java.security.Signature.class}
-        )
-    })
     public void testSignedObject() throws Exception {
         TestKeyPair tkp = null;
         Properties prop;
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignerTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignerTest.java
index f9eea58..018c2c4 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignerTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/SignerTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.IdentityScope;
 import java.security.InvalidParameterException;
 import java.security.KeyManagementException;
@@ -48,7 +43,6 @@
  *
  */
 @SuppressWarnings("deprecation")
-@TestTargetClass(Signer.class)
 public class SignerTest extends TestCase {
 
     public static class MySecurityManager extends SecurityManager {
@@ -59,14 +53,8 @@
     }
 
     /**
-     * @tests java.security.Signer#toString()
+     * java.security.Signer#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
         Signer s1 = new SignerStub("testToString1");
         assertEquals("[Signer]testToString1", s1.toString());
@@ -86,12 +74,6 @@
     /**
      * verify Signer() creates instance
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Signer",
-        args = {}
-    )
     public void testSigner() {
         Signer s = new SignerStub();
         assertNotNull(s);
@@ -102,12 +84,6 @@
     /**
      * verify Signer(String) creates instance
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Signer",
-        args = {java.lang.String.class}
-    )
     public void testSignerString() throws Exception {
         Signer s = new SignerStub("sss3");
         assertNotNull(s);
@@ -122,12 +98,6 @@
     /**
      * verify  Signer(String, IdentityScope) creates instance
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Signer",
-        args = {java.lang.String.class, java.security.IdentityScope.class}
-    )
     public void testSignerStringIdentityScope() throws Exception {
         Signer s = new SignerStub("sss4", IdentityScope.getSystemScope());
         assertNotNull(s);
@@ -152,12 +122,6 @@
     /**
      * verify Signer.getPrivateKey() returns null or private key
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getPrivateKey",
-        args = {}
-    )
     public void testGetPrivateKey() throws Exception {
         byte [] privateKeyData = { 1, 2, 3, 4, 5};
         PrivateKeyStub privateKey = new PrivateKeyStub("private", "fff", privateKeyData);
@@ -173,14 +137,8 @@
     }
 
     /**
-     * @tests java.security.Signer#setKeyPair(java.security.KeyPair)
+     * java.security.Signer#setKeyPair(java.security.KeyPair)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "KeyException checking missed",
-        method = "setKeyPair",
-        args = {java.security.KeyPair.class}
-    )
     public void test_setKeyPairLjava_security_KeyPair() throws Exception {
 
         // Regression for HARMONY-2408
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/TimestampTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/TimestampTest.java
index 82d4b2a..2ba7a64 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/TimestampTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/TimestampTest.java
@@ -22,11 +22,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.Timestamp;
 import java.security.cert.CertPath;
 import java.util.Date;
@@ -34,7 +29,7 @@
 import org.apache.harmony.security.tests.support.cert.MyCertPath;
 
 import junit.framework.TestCase;
-@TestTargetClass(Timestamp.class)
+
 /**
  * Tests for <code>Timestamp</code> class fields and methods
  *
@@ -47,12 +42,6 @@
 
     private CertPath cpath = new MyCertPath(encoding);
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Timestamp",
-        args = {java.util.Date.class, java.security.cert.CertPath.class}
-    )
     public void testTimestamp() {
         try {
             new Timestamp(null, cpath);
@@ -75,12 +64,6 @@
     /*
      * Class under test for boolean equals(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEqualsObject() {
         Timestamp one = new Timestamp(now, cpath);
         Timestamp two = new Timestamp(now, cpath);
@@ -96,22 +79,10 @@
         assertTrue(two1.equals(two1));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSignerCertPath",
-        args = {}
-    )
     public void testGetSignerCertPath() {
         assertSame(new Timestamp(now, cpath).getSignerCertPath(), cpath);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTimestamp",
-        args = {}
-    )
     public void testGetTimestamp() {
     	Timestamp t = new Timestamp(now, cpath);
         assertEquals(now, t.getTimestamp());
@@ -121,12 +92,6 @@
     /*
      * Class under test for String toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         try {
             String tt = new Timestamp(now, cpath).toString();
@@ -138,12 +103,6 @@
     /*
      * Class under test for String hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         Timestamp one = new Timestamp(now, cpath);
         Timestamp two = new Timestamp(now, cpath);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableEntryExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableEntryExceptionTest.java
index 69b2437..888b3a0 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableEntryExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableEntryExceptionTest.java
@@ -22,20 +22,14 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.UnrecoverableEntryException;
 
 import junit.framework.TestCase;
-@TestTargetClass( UnrecoverableEntryException.class)
+
 /**
  * Tests for <code>UnrecoverableEntryException</code> class
  *
  */
-
 public class UnrecoverableEntryExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -48,12 +42,6 @@
     /*
      * Class under test for void UnrecoverableEntryException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "UnrecoverableEntryException",
-        args = {}
-    )
     public void testUnrecoverableEntryException() {
         UnrecoverableEntryException tE = new UnrecoverableEntryException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -63,12 +51,6 @@
     /*
      * Class under test for void UnrecoverableEntryException(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "UnrecoverableEntryException",
-        args = {java.lang.String.class}
-    )
     public void testUnrecoverableEntryExceptionString() {
         UnrecoverableEntryException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableKeyExceptionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableKeyExceptionTest.java
index 127e4e0..3fb028f 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableKeyExceptionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnrecoverableKeyExceptionTest.java
@@ -22,15 +22,10 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-
 import java.security.UnrecoverableKeyException;
 
 import junit.framework.TestCase;
-@TestTargetClass(UnrecoverableKeyException.class)
+
 /**
  * Tests for <code>UnrecoverableKeyException</code> class constructors and
  * methods.
@@ -49,12 +44,6 @@
      * Test for <code>UnrecoverableKeyException()</code> constructor
      * Assertion: constructs UnrecoverableKeyException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "UnrecoverableKeyException",
-        args = {}
-    )
     public void testUnrecoverableKeyException01() {
         UnrecoverableKeyException tE = new UnrecoverableKeyException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +55,6 @@
      * Assertion: constructs UnrecoverableKeyException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "UnrecoverableKeyException",
-        args = {java.lang.String.class}
-    )
     public void testUnrecoverableKeyException02() {
         UnrecoverableKeyException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +70,6 @@
      * Assertion: constructs UnrecoverableKeyException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "UnrecoverableKeyException",
-        args = {java.lang.String.class}
-    )
     public void testUnrecoverableKeyException03() {
         String msg = null;
         UnrecoverableKeyException tE = new UnrecoverableKeyException(msg);
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnresolvedPermissionTest.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnresolvedPermissionTest.java
index 5c7b253..df1c8e4 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnresolvedPermissionTest.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/UnresolvedPermissionTest.java
@@ -17,10 +17,6 @@
 
 package org.apache.harmony.security.tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-
 import java.io.Serializable;
 import java.security.AllPermission;
 import java.security.InvalidKeyException;
@@ -49,24 +45,16 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(UnresolvedPermission.class)
 /**
  * Tests for <code>UnresolvedPermission</code> class fields and methods
  *
  */
-
 public class UnresolvedPermissionTest extends TestCase {
 
     /**
      * Creates an Object with given name, type, action, certificates. Empty or
      * null type is not allowed - exception should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "UnresolvedPermission",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.security.cert.Certificate[].class}
-    )
     public void testCtor() {
         String type = "laskjhlsdk 2345346";
         String name = "^%#UHVKU^%V  887y";
@@ -103,12 +91,6 @@
     /**
      * UnresolvedPermission never implies any other permission.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void testImplies() {
         UnresolvedPermission up = new UnresolvedPermission(
                 "java.security.SecurityPermission", "a.b.c", null, null);
@@ -116,12 +98,6 @@
         assertFalse(up.implies(new AllPermission()));
         assertFalse(up.implies(new SecurityPermission("a.b.c")));
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void testSerialization() throws Exception {
         UnresolvedPermission up = new UnresolvedPermission(
                 "java.security.SecurityPermission", "a.b.c", "actions", null);
@@ -138,12 +114,6 @@
         assertEquals("actions", deserializedUp.getUnresolvedActions());
         assertNull(deserializedUp.getUnresolvedCerts());
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "!SerializationGolden",
-        args = {}
-    )
     public void testSerialization_Compatibility() throws Exception {
         UnresolvedPermission up = new UnresolvedPermission(
                 "java.security.SecurityPermission", "a.b.c", "actions", null);
@@ -163,12 +133,6 @@
             }
         });
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1", "name1",
                 "action1", null);
@@ -205,12 +169,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getActions",
-        args = {}
-    )
     public void testGetActions() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1", "name1",
                 "action1", null);
@@ -225,12 +183,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getUnresolvedActions",
-        args = {}
-    )
     public void testGetUnresolvedActions() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1", "name1",
                 "action1 @#$%^&*", null);
@@ -245,12 +197,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getUnresolvedCerts",
-        args = {}
-    )
     public void testGetUnresolvedCerts() {
         Certificate[] certificate = new java.security.cert.Certificate[] {
                 new Certificate(null) {
@@ -311,12 +257,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getUnresolvedName",
-        args = {}
-    )
     public void testGetUnresolvedName() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1", "name1!@#$%^&&* )(",
                 "action1 @#$%^&*", null);
@@ -331,12 +271,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getUnresolvedType",
-        args = {}
-    )
     public void testGetUnresolvedType() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1@#$%^&* )(", "name1",
                 "action1", null);
@@ -351,12 +285,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1", "name1",
                 "action1", null);
@@ -379,12 +307,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void testNewPermissionCollection() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1", "name1",
                 "action1", null);
@@ -411,12 +333,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         UnresolvedPermission up1 = new UnresolvedPermission("type1", "name1",
                 "action1", null);
diff --git a/luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java b/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java
similarity index 76%
rename from luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java
rename to luni/src/test/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java
index 54ac0b7..3378a9c 100644
--- a/luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java
+++ b/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java
@@ -16,20 +16,20 @@
 
 package org.apache.harmony.xnet.provider.jsse;
 
-import junit.framework.TestCase;
-
-import javax.net.ssl.SSLSession;
 import java.util.Enumeration;
-import java.util.Set;
 import java.util.HashSet;
+import java.util.Set;
+import javax.net.ssl.SSLSession;
+import junit.framework.TestCase;
+import libcore.javax.net.ssl.FakeSSLSession;
 
-public class ClientSessionContextTest extends TestCase {
+public final class ClientSessionContextTest extends TestCase {
 
     public void testGetSessionById() {
-        ClientSessionContext context = new ClientSessionContext(null, null);
+        ClientSessionContext context = new ClientSessionContext();
 
-        SSLSession a = new FakeSession("a");
-        SSLSession b = new FakeSession("b");
+        SSLSession a = new ValidSSLSession("a");
+        SSLSession b = new ValidSSLSession("b");
 
         context.putSession(a);
         context.putSession(b);
@@ -40,7 +40,7 @@
         assertSame(a, context.getSession("a", 443));
         assertSame(b, context.getSession("b", 443));
 
-        assertEquals(2, context.sessions.size());
+        assertEquals(2, context.size());
 
         Set<SSLSession> sessions = new HashSet<SSLSession>();
         Enumeration ids = context.getIds();
@@ -56,12 +56,12 @@
     }
 
     public void testTrimToSize() {
-        ClientSessionContext context = new ClientSessionContext(null, null);
+        ClientSessionContext context = new ClientSessionContext();
 
-        FakeSession a = new FakeSession("a");
-        FakeSession b = new FakeSession("b");
-        FakeSession c = new FakeSession("c");
-        FakeSession d = new FakeSession("d");
+        ValidSSLSession a = new ValidSSLSession("a");
+        ValidSSLSession b = new ValidSSLSession("b");
+        ValidSSLSession c = new ValidSSLSession("c");
+        ValidSSLSession d = new ValidSSLSession("d");
 
         context.putSession(a);
         context.putSession(b);
@@ -83,4 +83,12 @@
         assertEquals(expected, sessions);
     }
 
+    static class ValidSSLSession extends FakeSSLSession {
+        ValidSSLSession(String host) {
+            super(host);
+        }
+        @Override public boolean isValid() {
+            return true;
+        }
+    }
 }
diff --git a/luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java b/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java
similarity index 86%
rename from luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java
rename to luni/src/test/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java
index ee50863a..9714cc3 100644
--- a/luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java
+++ b/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java
@@ -16,10 +16,10 @@
 
 package org.apache.harmony.xnet.provider.jsse;
 
-import junit.framework.TestCase;
-
 import java.io.File;
 import java.io.IOException;
+import junit.framework.TestCase;
+import libcore.javax.net.ssl.FakeSSLSession;
 
 public class FileClientSessionCacheTest extends TestCase {
 
@@ -40,17 +40,16 @@
                 @Override
                 public void run() {
                     for (int i = 0; i < iterations; i++) {
-                        cache.putSessionData(new FakeSession(id + "." + i),
-                                new byte[10]);
+                        cache.putSessionData(new FakeSSLSession(id + "" + i), new byte[10]);
                     }
                 }
             };
         }
-        for (int i = 0; i < threads.length; i++) {
-            threads[i].start();
+        for (Thread thread : threads) {
+            thread.start();
         }
-        for (int i = 0; i < threads.length; i++) {
-            threads[i].join();
+        for (Thread thread : threads) {
+            thread.join();
         }
         assertEquals(FileClientSessionCache.MAX_SIZE, cacheDir.list().length);
     }
diff --git a/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/NativeCryptoTest.java b/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/NativeCryptoTest.java
index b40c6c8..20c8314 100644
--- a/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/NativeCryptoTest.java
+++ b/luni/src/test/java/org/apache/harmony/xnet/provider/jsse/NativeCryptoTest.java
@@ -107,25 +107,28 @@
         NativeCrypto.SSL_CTX_free(c);
     }
 
-    private static final PrivateKeyEntry SERVER_PRIVATE_KEY_ENTRY
-            = TestKeyStore.getServer().getPrivateKey("RSA", "RSA");
-    private static final byte[] SERVER_PRIVATE_KEY
-            = SERVER_PRIVATE_KEY_ENTRY.getPrivateKey().getEncoded();
+    private static final PrivateKeyEntry SERVER_PRIVATE_KEY_ENTRY;
+    private static final byte[] SERVER_PRIVATE_KEY;
     private static final byte[][] SERVER_CERTIFICATES;
-
-    private static final PrivateKeyEntry CLIENT_PRIVATE_KEY_ENTRY
-            = TestKeyStore.getClientCertificate().getPrivateKey("RSA", "RSA");
-    private static final byte[] CLIENT_PRIVATE_KEY
-            = CLIENT_PRIVATE_KEY_ENTRY.getPrivateKey().getEncoded();
+    private static final PrivateKeyEntry CLIENT_PRIVATE_KEY_ENTRY;
+    private static final byte[] CLIENT_PRIVATE_KEY;
     private static final byte[][] CLIENT_CERTIFICATES;
 
     static {
         try {
-            CLIENT_CERTIFICATES = NativeCrypto.encodeCertificates(
-                    CLIENT_PRIVATE_KEY_ENTRY.getCertificateChain());
+            SERVER_PRIVATE_KEY_ENTRY
+                    = TestKeyStore.getServer().getPrivateKey("RSA", "RSA");
+            SERVER_PRIVATE_KEY
+                    = SERVER_PRIVATE_KEY_ENTRY.getPrivateKey().getEncoded();
             SERVER_CERTIFICATES = NativeCrypto.encodeCertificates(
                     SERVER_PRIVATE_KEY_ENTRY.getCertificateChain());
-        } catch (CertificateEncodingException e) {
+            CLIENT_PRIVATE_KEY_ENTRY
+                    = TestKeyStore.getClientCertificate().getPrivateKey("RSA", "RSA");
+            CLIENT_PRIVATE_KEY
+                    = CLIENT_PRIVATE_KEY_ENTRY.getPrivateKey().getEncoded();
+            CLIENT_CERTIFICATES = NativeCrypto.encodeCertificates(
+                    CLIENT_PRIVATE_KEY_ENTRY.getCertificateChain());
+        } catch (Exception e) {
             throw new RuntimeException(e);
         }
     }
diff --git a/luni/src/test/java/sun/misc/AllTests.java b/luni/src/test/java/sun/misc/AllTests.java
deleted file mode 100644
index f2c4277..0000000
--- a/luni/src/test/java/sun/misc/AllTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package sun.misc;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Test for sun.misc");
-
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(UnsafeTest.class);
-
-        // $JUnit-END$
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/AllTests.java b/luni/src/test/java/tests/AllTests.java
deleted file mode 100644
index fb4d0e3..0000000
--- a/luni/src/test/java/tests/AllTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Listing of all the tests that are to be run.
- */
-public class AllTests
-{
-    public static void run() {
-        TestRunner.main(new String[] { AllTests.class.getName() });
-    }
-
-    public static Test suite() {
-        TestSuite suite = new TestSuite();
-
-        // Harmony-written test suites (often with Android tests added in).
-        suite.addTest(tests.annotation.AllTests.suite());
-        suite.addTest(tests.concurrent.AllTests.suite());
-        suite.addTest(tests.dom.AllTests.suite());
-        suite.addTest(tests.luni.AllTestsIo.suite());
-        suite.addTest(tests.luni.AllTestsLang.suite());
-        suite.addTest(tests.luni.AllTestsNet.suite());
-        suite.addTest(tests.luni.AllTestsUtil.suite());
-        suite.addTest(tests.math.AllTests.suite());
-        suite.addTest(tests.regex.AllTests.suite());
-        suite.addTest(tests.security.AllTests.suite());
-        suite.addTest(tests.sql.AllTests.suite());
-        suite.addTest(tests.SQLite.AllTests.suite());
-        suite.addTest(tests.suncompat.AllTests.suite());
-        suite.addTest(tests.xml.AllTests.suite());
-        suite.addTest(tests.api.org.apache.harmony.kernel.dalvik.AllTests.suite());
-
-        // Android-written test suites.
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/SQLite/AllTests.java b/luni/src/test/java/tests/SQLite/AllTests.java
deleted file mode 100644
index ea8b841..0000000
--- a/luni/src/test/java/tests/SQLite/AllTests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.SQLite;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
-    //All tests executed with sqlite3 only
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for SQLite");
-        //$JUnit-BEGIN$
-        suite.addTestSuite(DatabaseTest.class);
-        suite.addTestSuite(JDBCDriverFunctionalTest.class);
-        suite.addTestSuite(JDBCDriverTest.class);
-        suite.addTestSuite(BlobTest.class);
-        suite.addTestSuite(StmtTest.class);
-        suite.addTestSuite(ExceptionTest.class);
-        suite.addTestSuite(FunctionContextTest.class);
-        //$JUnit-END$
-        return suite;
-    }
-
-}
diff --git a/luni/src/test/java/tests/SQLite/BlobTest.java b/luni/src/test/java/tests/SQLite/BlobTest.java
deleted file mode 100644
index 353916f..0000000
--- a/luni/src/test/java/tests/SQLite/BlobTest.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.SQLite;
-
-import SQLite.Blob;
-import SQLite.Database;
-import SQLite.Exception;
-import SQLite.Stmt;
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-import junit.framework.TestCase;
-
-import tests.support.DatabaseCreator;
-import tests.support.Support_SQL;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-@TestTargetClass(Blob.class)
-public class BlobTest extends SQLiteTest {
-
-    private static Blob testBlob = null;
-
-    private byte[] blobInput= null;
-
-    private static InputStream file = null;
-
-    private static Database db = null;
-
-    private static Stmt st = null;
-
-    public class MockBlob extends Blob {
-        public void finalize() {
-            try {
-                super.finalize();
-            } catch (Throwable exception) {
-                fail("Test activity faild!");
-            }
-        }
-    }
-
-    public void setUp() throws java.lang.Exception {
-        super.setUp();
-        testBlob = new Blob();
-
-        super.setUp();
-        Support_SQL.loadDriver();
-        db = new Database();
-        db.open(dbFile.getPath(), 0);
-
-        db.exec("create table B(id integer primary key, val blob)",null);
-        db.exec("insert into B values(1, zeroblob(128))", null);
-        db.exec("insert into B values(2, zeroblob(128))", null);
-        db.exec("insert into B values(3, zeroblob(128))", null);
-
-        // can not fill Blob with data at this point...
-        /*
-        File resources = Support_Resources.createTempFolder();
-        BufferedReader r = null;
-        try {
-            Class c = Class.forName(this.getClass().getName());
-            assertNotNull(c);
-            file = Class.forName(this.getClass().getName())
-                    .getResourceAsStream("/blob.c");
-            r = new BufferedReader(new InputStreamReader(file));
-        } catch (NullPointerException e) {
-            fail("Should not throw NullPointerException reading file"
-                    + e.getMessage());
-        }
-        OutputStream out = testBlob.getOutputStream();
-        String s = null;
-        while ((s = r.readLine()) != null) {
-            out.write(r.readLine().getBytes());
-        }
-        out.flush();
-        out.close();
-        testBlob.close();
-        */
-    }
-
-    public void tearDown() {
-
-        testBlob.close();
-        super.tearDown();
-    }
-
-    /**
-     * @throws Exception
-     * @throws IOException
-     * @tests Blob#Blob()
-     */
-    @TestTargets ( {
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "db.open_blob is not supported also for Stmt, therefore cannot test Blobs",
-        method = "Blob",
-        args = {}
-    ),
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "functional test",
-        method = "getOutputStream",
-        args = {}
-    ),
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "functional test",
-        method = "getInputStream",
-        args = {}
-    )
-    })
-    @KnownFailure("db.open_blob is not supported.")
-    public void testBlob() throws Exception, IOException {
-        byte[] b = new byte[4];
-        byte[] b128 = new byte[128];
-        for (int i = 0; i < b128.length; i++) {
-        b128[i] = (byte) i;
-        }
-        Blob blob = db.open_blob(dbFile.getPath(), "B", "val", 1, true);
-        try {
-
-        OutputStream os = blob.getOutputStream();
-        os.write(b128);
-        os.close();
-
-        InputStream is = blob.getInputStream();
-        is.skip(96);
-        assertEquals(4,is.read(b));
-        is.close();
-        } finally {
-        blob.close();
-        }
-    }
-
-    /**
-     * @tests Blob#finalize()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "Can not be checked. Should be tested in DX test package.",
-        method = "finalize",
-        args = {}
-    )
-    public void testFinalize() {
-
-    }
-
-    /**
-     * @tests Blob.getInputStream()
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Exception test",
-        method = "getInputStream",
-        args = {}
-    )
-    public void testGetInputStream() {
-        InputStream in = testBlob.getInputStream();
-
-        try {
-            in.read();
-            fail("Exception not thrown for invalid Blob.");
-        } catch (Throwable e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests Blob#getOutputStream()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Exception test",
-        method = "getOutputStream",
-        args = {}
-    )
-    public void testGetOutputStream() {
-        OutputStream out = testBlob.getOutputStream();
-
-        try {
-           out.write(null);
-           fail("Write operation unsupported");
-        } catch (Throwable e) {
-            assertEquals("Write operation unsupported", e.getMessage());
-        }
-    }
-
-    /**
-     * @tests Blob#close()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not clear from spec what should happen when Blob is closed.",
-        method = "close",
-        args = {}
-    )
-//    @KnownFailure("Blob does not clean up inputStream.")
-    public void testClose() {
-    assertNotNull(testBlob);
-
-    testBlob.close();
-    // inputStream either null or some error occurs
-    try {
-        // TODO This does look a bit weird. Revisit later.
-        assertNull(testBlob.getInputStream());
-    } catch (Throwable e) {
-        //ok
-    }
-    }
-}
diff --git a/luni/src/test/java/tests/SQLite/DatabaseTest.java b/luni/src/test/java/tests/SQLite/DatabaseTest.java
deleted file mode 100644
index f04266b..0000000
--- a/luni/src/test/java/tests/SQLite/DatabaseTest.java
+++ /dev/null
@@ -1,2038 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.SQLite;
-
-import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import tests.support.DatabaseCreator;
-import tests.support.MockFunction;
-import tests.support.ThreadPool;
-import tests.support.resource.Support_Resources;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import SQLite.Authorizer;
-import SQLite.Blob;
-import SQLite.BusyHandler;
-import SQLite.Callback;
-import SQLite.Constants;
-import SQLite.Database;
-import SQLite.Exception;
-import SQLite.Function;
-import SQLite.FunctionContext;
-import SQLite.ProgressHandler;
-import SQLite.Stmt;
-import SQLite.TableResult;
-import SQLite.Trace;
-import SQLite.Vm;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import java.util.logging.Logger;
-
-@TestTargetClass(Database.class)
-public class DatabaseTest extends SQLiteTest {
-
-    /**
-     * The SQLite db file.
-     */
-//    protected final File dbFile = new File("sqliteTest.db");
-//
-//    private final String connectionURL = "jdbc:sqlite:/" + dbFile.getPath();
-//
-//    private final String classname = "SQLite.JDBCDriver";
-//
-//    private static Connection conn = null;
-
-    private static ErrorTracker tracker = null;
-
-    private Statement statement;
-
-    private Database db = null;
-
-    private static final int numThreads = 10;
-
-    private static final int numOfRecords = 30;
-
-    public void setUp() throws java.lang.Exception {
-        try {
-            super.setUp();
-            assertNotNull("Could not establish DB connection",conn);
-            tracker = new ErrorTracker();
-
-            statement = conn.createStatement();
-
-          //Cleanup tables if necessary
-
-            DatabaseMetaData meta = conn.getMetaData();
-            assertNotNull(meta);
-            if (meta != null) {
-            ResultSet userTab = meta.getTables(null, null, null, null);
-            while (userTab.next()) {
-            String tableName = userTab.getString("TABLE_NAME");
-               this.statement.execute("drop table "+tableName);
-            }
-            }
-
-            // Create default test table
-//            statement = conn.createStatement();
-            statement.execute(DatabaseCreator.CREATE_TABLE_SIMPLE1);
-            statement.close();
-
-            try {
-            db = new Database();
-            db.open(dbFile.getPath(), 0);
-            db.busy_handler(null);
-            } catch (Exception e) {
-                System.out.println("2: Error opening File: Dir "+dbFile.getPath()+" Name: "+dbFile.getPath());
-            } catch (java.lang.Exception e) {
-                System.err.println("Non SQLException "+e.getMessage());
-            }
-        } catch (Exception e) {
-            System.out.println("Database setup fails: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-    }
-
-    public void tearDown() {
-
-        try {
-            db.close();
-        }catch (Exception e) {
-            if (! (e.getMessage().equals("database already closed"))) {
-                System.err.println("Error closing DB "+dbFile.getPath());
-            }
-        }
-//        conn.close();
-//        dbFile.delete();
-        tracker.reset();
-        super.tearDown();
-    }
-
-    /**
-     * @tests Database#Database()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "constructor test",
-        method = "Database",
-        args = {}
-    )
-    public void testDatabase() {
-        // db closed
-        Database db2 = new Database();
-        try {
-            db.close();
-            db2 = new Database();
-            db2.open(dbFile.getPath(), 0);
-            db2.close();
-            db.open(dbFile.getPath(), 0);
-        } catch (Exception e) {
-            fail("Database object could not be created "+e.getMessage());
-            e.printStackTrace();
-        }
-        //db is open
-        try {
-            db2.open(dbFile.getPath(), 0);
-            db2.close();
-        } catch (Exception e) {
-            fail("Second Database object could not be created "+e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @tests Database#finalize()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "method test",
-        method = "finalize",
-        args = {}
-    )
-    public void testFinalize() {
-    }
-
-    /**
-     * @tests {@link Database#open(String, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test. Test fails.",
-        method = "open",
-        args = {java.lang.String.class, int.class}
-    )
-    public void testOpen() {
-        try {
-            db.close();
-            db.open(dbFile.getPath(), 0);
-        } catch (Exception e) {
-            fail("Database object could not be opened: " + e.getMessage());
-            e.printStackTrace();
-        }
-        // open second db while db1 still open
-        Database db2 = new Database();
-        try {
-            db2.open(dbFile.getPath(), 0);
-            db2.open(dbFile.getPath(), 0);
-            db2.close();
-        } catch (Exception e) {
-            fail("Database object could not be opened: " + e.getMessage());
-            e.printStackTrace();
-        }
-        // open non db file
-        File tempDir = Support_Resources.createTempFolder();
-        final String resourceName = "blob.c";
-        try {
-            URL file = Class.forName(this.getClass().getName())
-            .getResource("/blob.c");
-            db2.open(file.getPath(), 0);
-           fail("Should not be able to open non db file");
-        } catch (Exception e) {
-            assertEquals("unknown error in open", e.getMessage());
-        } catch (java.lang.Exception e) {
-            fail("Error in setup " + e.getMessage());
-            e.printStackTrace();
-        }
-
-    }
-
-    /**
-     * @tests Database#open_aux_file(String)
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported",
-        method = "open_aux_file",
-        args = {java.lang.String.class}
-    )
-    public void testOpen_aux_file() {
-        File temp = null;
-        try {
-            db.open_aux_file("");
-            fail("open should fail");
-        } catch (Exception e) {
-            assertEquals("unsupported", e.getMessage());
-        }
-
-     /*
-        try {
-            temp = File.createTempFile("openAuxMethod", ".db");
-            db.open_aux_file("");
-            db.exec("create table AUX_TABLE", null);
-            db.close();
-        } catch (Exception e) {
-            temp.delete();
-            fail("Error handling temporary file "+e.getMessage());
-            e.printStackTrace();
-        } catch (IOException e) {
-            temp.delete();
-            fail("Could not create temporary File");
-            e.printStackTrace();
-        }
-        try {
-            db.open(dbFile.getPath(),0);
-            db.exec("select * from AUX_TABLE", null);
-            fail("Statement should fail");
-        } catch (Exception e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-
-        temp.delete();
-        */
-    }
-
-    /**
-     * @tests Database#close()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "close",
-        args = {}
-    )
-    public void testClose() {
-        try {
-            db.close();
-            db.get_table("test");
-        } catch (Exception e) {
-            assertTrue(e.getMessage().equals("database already closed"));
-            try {
-                db.open(dbFile.getPath(), 0);
-            } catch (Exception e1) {
-                fail("Database object could not be reopened after 'close': "
-                        + e.getMessage());
-                e1.printStackTrace();
-            }
-        }
-
-        try {
-            db.close();
-            db.close();
-        } catch (Exception e) {
-            assertTrue(e.getMessage().equals("database already closed"));
-            try {
-                db.open(dbFile.getPath(), 0);
-            } catch (Exception e1) {
-                fail("Database object could not be reopened after 'close': "
-                        + e.getMessage());
-                e1.printStackTrace();
-            }
-        }
-    }
-
-    /**
-     * @tests Database#exec(String, Callback)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "exec",
-        args = {java.lang.String.class, Callback.class}
-    )
-    public void testExecStringCallback() {
-        TableResult res = new TableResult();
-        try {
-            db.exec("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " VALUES(1, 10, 20)", null);
-            db.exec("select * from " + DatabaseCreator.SIMPLE_TABLE1, res);
-            db
-                    .exec("delete from " + DatabaseCreator.SIMPLE_TABLE1
-                            + " where 1", null);
-        } catch (Exception e) {
-            fail("Database error");
-            e.printStackTrace();
-        }
-        String row[] = (String[]) res.rows.elementAt(0);
-        assertEquals(Integer.parseInt(row[0]), 1);
-        assertEquals(Integer.parseInt(row[1]), 10);
-        assertEquals(Integer.parseInt(row[2]), 20);
-    }
-
-    /**
-     * @tests Database#exec(String, Callback, String[])
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "exec",
-        args = {java.lang.String.class, Callback.class, java.lang.String[].class}
-    )
-    public void testExecStringCallbackStringArray() {
-        TableResult res = new TableResult();
-        String args[] = new String[1];
-        args[0] = "table";
-        try {
-            db.exec("select name from sqlite_master where type = '%q';", res,
-                    args);
-            String[] s = (String[]) res.rows.elementAt(0);
-            assertEquals(s[0], DatabaseCreator.SIMPLE_TABLE1);
-        } catch (Exception e) {
-            fail("DB Error occurred");
-            e.printStackTrace();
-        }
-
-        try {
-            db.exec("select name from sqlite_master where type = ", res, args);
-            fail("Testmethod should fail");
-        } catch (Exception e) {
-            // Ok
-        }
-    }
-
-    /**
-     * @tests {@link Database#last_insert_rowid()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "last_insert_rowid",
-        args = {}
-    )
-    public void testLast_insert_rowid() {
-        assertEquals(0, db.last_insert_rowid());
-        try {
-            db
-                    .exec(
-                            "create table TEST5(id integer, firstname text, lastname text);",
-                            null);
-            db.exec("insert into TEST5 values (1,'James','Bond');", null);
-            db.exec("insert into TEST5 values (2,'Fiona','Apple');", null);
-        } catch (Exception e) {
-            fail("Error in test setup: " + e.getMessage());
-            e.printStackTrace();
-        }
-        assertEquals(2, db.last_insert_rowid());
-        assertEquals(db.last_insert_rowid(), db.last_insert_rowid());
-
-        try {
-            db.exec("drop table TEST5;", null);
-        } catch (Exception e) {
-            fail("Error in test setup: " + e.getMessage());
-            e.printStackTrace();
-        }
-        assertEquals(2, db.last_insert_rowid());
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Database#interrupt()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "interrupt",
-        args = {}
-    )
-    @KnownFailure("Reason for failure unknown: Database should be locked. " +
-                   "Specification of interrupt is scarce.")
-    public void testInterrupt() throws Exception {
-        ThreadPool threadPool = new ThreadPool(numThreads);
-
-        // initialization
-        ResultSet userTabs;
-        try {
-            userTabs = conn.getMetaData().getTables(null, null, null, null);
-            while (userTabs.next()) {
-                String tableName = userTabs.getString("TABLE_NAME");
-                if (tableName.equals(DatabaseCreator.TEST_TABLE1)) {
-                    statement.execute(DatabaseCreator.DROP_TABLE1);
-                }
-            }
-            db.exec(DatabaseCreator.CREATE_TABLE3, null);
-            db.exec(DatabaseCreator.CREATE_TABLE1, null);
-        } catch (SQLException e1) {
-            fail("Error initializing test " + e1.toString());
-            e1.printStackTrace();
-        } catch (Exception e) {
-            fail("Error initializing test " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        int id1 = numOfRecords - 3;
-        threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
-        // should not be able to do any other insertions since task 1 holds lock
-        int id2 = numOfRecords + 3;
-        threadPool
-                .runTask(createTask2Interrupt(id2, dbFile.getPath(), tracker));
-
-        threadPool.join();
-
-        List<String> errors = tracker.getErrors();
-        System.out.println("Last error: " + db.error_message());
-        if (errors.size() > 0) {
-            assertEquals(errors.get(0), db
-                    .error_string(Constants.SQLITE_LOCKED));
-            for (String s : errors) {
-                Logger.global.info("INTERRUPT Error: " + s);
-            }
-
-        } else {
-            fail("Should have one exception: database should be locked.");
-        }
-
-        // reset
-
-        db
-                .exec(
-                        "delete from " + DatabaseCreator.TEST_TABLE1
-                                + " where 1", null);
-        db
-                .exec(
-                        "delete from " + DatabaseCreator.TEST_TABLE3
-                                + " where 1", null);
-
-    }
-
-    /**
-     * @tests {@link Database#changes()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "test fails",
-        method = "changes",
-        args = {}
-    )
-    @KnownFailure("Returns wrong number for updates: returns value > 1 for select.")
-    public void testChanges() {
-        TableResult res = new TableResult();
-        try {
-            assertTrue(db.changes() == 0);
-            db.exec("INSERT INTO " + DatabaseCreator.SIMPLE_TABLE1
-                    + " VALUES(2, 5, 7);", null);
-            int rows = (int) db.changes();
-            assertEquals(1,db.changes());
-            db.exec("update " + DatabaseCreator.SIMPLE_TABLE1
-                    + " set speed = 7, size= 5 where id = 2;", null);
-            assertEquals(1,db.changes());
-            db.exec("select * from " + DatabaseCreator.SIMPLE_TABLE1, res);
-            assertEquals(0,db.changes());
-            db.exec("INSERT INTO " + DatabaseCreator.SIMPLE_TABLE1
-                    + " VALUES(8, 5, 7);", null);
-            db.exec("Update "+DatabaseCreator.SIMPLE_TABLE1+" set speed = 10;",null);
-           assertTrue(db.changes() > 2);
-        } catch (Exception e) {
-            fail("Could not get changes: " + e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @throws SQLException
-     * @throws Exception
-     * @tests {@link Database#busy_handler(BusyHandler)}
-     */
-    @TestTargets({
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "method test fails once in a while. Cannot be sure that exception is thrown every time.",
-        method = "busy_handler",
-        args = {BusyHandler.class}
-    ),
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "method test fails once in a while. Cannot be sure that exception is thrown every time.",
-            method = "busy",
-            clazz = BusyHandler.class,
-            args = {java.lang.String.class, int.class}
-        )
-    })
-    @KnownFailure("method test fails once in a while. "+
-            "Cannot be sure that exception is thrown in every test execution.")
-    public void testBusy_handler() throws SQLException, Exception {
-        TestBusyHandler bh = new TestBusyHandler();
-        db.busy_handler(bh);
-        int counter = 0;
-        ThreadPool threadPool = new ThreadPool(numThreads);
-
-        // initialization
-        ResultSet userTabs;
-        try {
-            userTabs = conn.getMetaData().getTables(null, null, null, null);
-            while (userTabs.next()) {
-                String tableName = userTabs.getString("TABLE_NAME");
-                if (tableName.equals(DatabaseCreator.TEST_TABLE1)) {
-                    statement.execute(DatabaseCreator.DROP_TABLE1);
-                }
-            }
-            db.exec(DatabaseCreator.CREATE_TABLE3, null);
-            db.exec(DatabaseCreator.CREATE_TABLE1, null);
-        } catch (SQLException e1) {
-            fail("Error initializing test " + e1.toString());
-            e1.printStackTrace();
-        } catch (Exception e) {
-            fail("Error initializing test " + e.getMessage());
-            e.printStackTrace();
-        }
-
-
-//        try {
-//            DatabaseCreator.fillTestTable1(conn, numOfRecords);
-            // set to fail immediately if table is locked.
-//            db.busy_handler(bh);
-//            db.busy_timeout(0);
-        try {
-            conn.setAutoCommit(false);
-            int id1 = numOfRecords - 3;
-            threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
-            int id2 = numOfRecords + 3;
-            threadPool.runTask(createTask2(id2, dbFile.getPath(), tracker));
-            int oldID = 5;
-            int newID = 100;
-            threadPool.runTask(createTask3(oldID, dbFile.getPath(), newID,
-                    tracker));
-
-            threadPool.join();
-
-            List<String> errors = tracker.getErrors();
-            if (errors.size() > 0) {
-//                 assertEquals(errors.get(0),
-//                 db.error_string(Constants.SQLITE_LOCKED));
-                for (String s: errors) {
-                  System.out.println("Round 2 Error: "+s);
-              }
-            } else {
-                fail("No error happened");
-            }
-
-            // reset
-
-
-            db.exec("delete from " + DatabaseCreator.TEST_TABLE1 + " where 1",
-                    null);
-            db.exec("delete from " + DatabaseCreator.TEST_TABLE3 + " where 1",
-                            null);
-//
-//            // increase timeout for retry
-//            db.busy_timeout(1000);
-//            db.busy_handler(bh);
-//            tracker.reset();
-
-//            threadPool = new ThreadPool(numThreads);
-//
-//            threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
-//            threadPool.runTask(createTask2(id2, dbFile.getPath(), tracker));
-//
-//            threadPool.join();
-//
-//            errors = tracker.getErrors();
-//            if (errors.size() > 0) {
-//                // assertEquals(errors.get(0),
-//                // db.error_string(Constants.SQLITE_LOCKED));
-//                for (String s: errors) {
-//                    System.out.println("Round 2 Error"+s);
-//                }
-//            } else {
-//                // ok
-//                System.out.println("BUSY: No Error!");
-//            }
-//
-//
-        } catch (Exception e) {
-            fail("Error in test setup " + e.getMessage());
-            try {
-                db.get_table("select * from " + DatabaseCreator.TEST_TABLE1,
-                        null).toString();
-            } catch (Exception e1) {
-
-                e1.printStackTrace();
-            }
-            e.printStackTrace();
-//             } catch (SQLException e2) {
-//             System.out.println("Error in test setup "+e2.toString());
-//             try {
-//             db.get_table("select * from "+DatabaseCreator.TEST_TABLE1,null).
-//             toString();
-//             } catch (Exception e1) {
-//             e2.printStackTrace();
-//             }
-        } finally {
-            conn.setAutoCommit(true);
-            db.exec(DatabaseCreator.DROP_TABLE1, null);
-            db.exec(DatabaseCreator.DROP_TABLE3, null);
-        }
-    }
-
-    /**
-     * @throws Exception
-     * @throws SQLException
-     * @tests {@link Database#busy_timeout(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "test fails. Cannot be sure that exception is thrown every time.",
-        method = "busy_timeout",
-        args = {int.class}
-    )
-    @KnownFailure("Database does not lock values")
-    public void testBusy_timeout() throws Exception, SQLException {
-        int counter = 0;
-        ThreadPool threadPool = new ThreadPool(numThreads);
-
-        // initialization
-        ResultSet userTabs;
-        try {
-            userTabs = conn.getMetaData().getTables(null, null, null, null);
-            while (userTabs.next()) {
-                String tableName = userTabs.getString("TABLE_NAME");
-                if (tableName.equals(DatabaseCreator.TEST_TABLE1)) {
-                    statement.execute(DatabaseCreator.DROP_TABLE1);
-                }
-            }
-            db.exec(DatabaseCreator.CREATE_TABLE3, null);
-            db.exec(DatabaseCreator.CREATE_TABLE1, null);
-        } catch (SQLException e1) {
-            fail("Error initializing test " + e1.toString());
-            e1.printStackTrace();
-        } catch (Exception e) {
-            fail("Error initializing test " + e.getMessage());
-            e.printStackTrace();
-        }
-
-
-        // test run
-        try {
-            conn.setAutoCommit(false);
-
-//            DatabaseCreator.fillTestTable1(conn, numOfRecords);
-            // set to fail immediately if table is locked.
-            db.busy_handler(null);
-            db.busy_timeout(0);
-            int id1 = numOfRecords - 3;
-
-            threadPool.runTask(createTask2(id1, dbFile.getPath(), tracker));
-            int id2 = numOfRecords + 3;
-            threadPool.runTask(createTask1(id2, dbFile.getPath(), tracker));
-            int oldID = 5;
-            int newID = 100;
-            threadPool.runTask(createTask3(oldID, dbFile.getPath(), newID,
-                    tracker));
-
-            threadPool.join();
-
-            List<String> errors = tracker.getErrors();
-            assertTrue("No error occurred on DB but should have",errors.size() > 0);
-
-            assertEquals(errors.get(0),
-            db.error_string(Constants.SQLITE_LOCKED));
-            assertEquals(errors.get(0), "database is locked");
-
-            // reset
-
-            db.exec("delete from " + DatabaseCreator.TEST_TABLE1 + " where 1",
-                    null);
-            db.exec("delete from " + DatabaseCreator.TEST_TABLE3 + " where 1",
-                            null);
-
-            // increase timeout for retry
-            db.busy_timeout(10000);
-            db.busy_handler(null);
-            tracker.reset();
-            threadPool = new ThreadPool(numThreads);
-
-            threadPool.runTask(createTask1(id1, dbFile.getPath(), tracker));
-            threadPool.runTask(createTask2(id2, dbFile.getPath(), tracker));
-
-            threadPool.join();
-
-            errors = tracker.getErrors();
-            if (errors.size() > 0) {
-                fail("busy timeout should prevent from lock exception!");
-                for (String s: errors) {
-                    System.out.println("Round 2 Error"+s);
-                }
-            } else {
-                // ok
-            }
-
-
-        } catch (Exception e) {
-            fail("Error in test setup " + e.getMessage());
-            try {
-                db.get_table("select * from " + DatabaseCreator.TEST_TABLE1,
-                        null).toString();
-            } catch (Exception e1) {
-
-                e1.printStackTrace();
-            }
-            e.printStackTrace();
-        } finally {
-            conn.setAutoCommit(true);
-            // cleanup
-            db.exec(DatabaseCreator.DROP_TABLE1, null);
-            db.exec(DatabaseCreator.DROP_TABLE3, null);
-        }
-    }
-
-    /**
-     * @tests {@link Database#get_table(String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "get_table",
-        args = {java.lang.String.class}
-    )
-    public void testGet_tableString() {
-        TableResult emptyTable = new TableResult();
-        try {
-            //select from empty table
-            TableResult res = db.get_table("select * from "
-                    + DatabaseCreator.SIMPLE_TABLE1);
-            assertEquals(res.toString(), emptyTable.toString());
-            //fill table-> t
-//            DatabaseCreator.fillSimpleTable1(conn);
-//            res = db.get_table("select * from "
-//                    + DatabaseCreator.SIMPLE_TABLE1);
-//            assertFalse(emptyTable.toString().equals(res.toString()));
-
-            try {
-                db.exec("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                        + " VALUES(1, 10, 20)", null);
-                res = db.get_table("select * from " + DatabaseCreator.SIMPLE_TABLE1);
-                db
-                        .exec("delete from " + DatabaseCreator.SIMPLE_TABLE1
-                                + " where 1", null);
-            } catch (Exception e) {
-                fail("Database error");
-                e.printStackTrace();
-            }
-            String row[] = (String[]) res.rows.elementAt(0);
-            assertEquals(Integer.parseInt(row[0]), 1);
-            assertEquals(Integer.parseInt(row[1]), 10);
-            assertEquals(Integer.parseInt(row[2]), 20);
-        } catch (Exception e) {
-            fail("Error getting table " + e.getMessage());
-            e.printStackTrace();
-//        } catch (SQLException e) {
-//            fail("Error initialising table " + e.getMessage());
-//            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @tests {@link Database#get_table(String, String[])}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "get_table",
-        args = {java.lang.String.class, java.lang.String[].class}
-    )
-    public void testGet_tableStringStringArray() {
-        String args[] = new String[1];
-        args[0] = "table";
-        String argsFail[] = new String[1];
-        try {
-            TableResult res = db.get_table(
-                    "select name from sqlite_master where type = ", argsFail);
-            fail("Testmethod should fail");
-        } catch (Exception e) {
-            try {
-                TableResult res = db.get_table(
-                        "select name from sqlite_master where type = '%q'",
-                        args);
-                String[] s = (String[]) res.rows.elementAt(0);
-                assertEquals(s[0], DatabaseCreator.SIMPLE_TABLE1);
-            } catch (Exception e2) {
-                fail("Testmethod failed: " + e2.getMessage());
-                e.printStackTrace();
-            }
-        }
-
-    }
-
-    /**
-     * @tests {@link Database#get_table(String, String[], TableResult)}
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            method = "get_table",
-            args = {java.lang.String.class, java.lang.String[].class, TableResult.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "method test",
-                method = "toString",
-                clazz = TableResult.class,
-                args = {}
-            ),
-       @TestTargetNew(
-                    level = TestLevel.COMPLETE,
-                    notes = "method test",
-                    method = "types",
-                    clazz = TableResult.class,
-                    args = {String[].class}
-            ),
-       @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "method test",
-                method = "TableResult",
-                clazz = TableResult.class,
-                args = {}
-           ),
-       @TestTargetNew(
-               level = TestLevel.NOT_NECESSARY,
-               notes = "method test",
-               method = "columns",
-               clazz = TableResult.class,
-               args = {String[].class}
-          ),
-      @TestTargetNew(
-              level = TestLevel.NOT_NECESSARY,
-              notes = "method test",
-              method = "newrow",
-              clazz = TableResult.class,
-              args = {String[].class}
-         ),
-     @TestTargetNew(
-         level = TestLevel.NOT_NECESSARY,
-         notes = "method test",
-         method = "clear",
-         clazz = TableResult.class,
-         args = {}
-        )
-
-    })
-    public void testGet_tableStringStringArrayTableResult() {
-        String args[] = new String[1];
-        String argsFail[] = new String[1];
-        TableResult res = new TableResult();
-        TableResult defaultTableRes = new TableResult();
-        args[0] = "table";
-
-        try {
-            db.get_table("select name from sqlite_master where type = '%q'",
-                    argsFail, res);
-            assertEquals(defaultTableRes.toString(), res.toString());
-        } catch (Exception e) {
-            try {
-                db.get_table(
-                        "select name from sqlite_master where type = '%q'",
-                        args, res);
-                String[] s = (String[]) res.rows.elementAt(0);
-                assertEquals(s[0], DatabaseCreator.SIMPLE_TABLE1);
-                String[] types = res.types;
-                System.out
-                        .println("DatabaseTest.testGet_tableStringStringArrayTableResult() "+types.toString());
-            } catch (Exception e2) {
-                fail("Testmethod failed: " + e2.getMessage());
-                e.printStackTrace();
-            }
-        }
-    }
-
-
-    /**
-     * @tests {@link Database#complete(String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "complete",
-        args = {java.lang.String.class}
-    )
-    public void testComplete() {
-        assertFalse(db.complete("create"));
-        assertTrue(db.complete("create table TEST (res double);"));
-    }
-
-    /**
-     * @tests {@link Database#version()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "version",
-        args = {}
-    )
-    public void testVersion() {
-        String version = db.version();
-        if (version != null) {
-        assertTrue(Integer.parseInt(db.version().substring(0,1)) > 0);
-        assertEquals(db.version(), db.version());
-        } else {
-            fail("DB version info missing");
-        }
-
-    }
-
-    /**
-     * @tests {@link Database#dbversion()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "dbversion",
-        args = {}
-    )
-    public void testDbversion() {
-        String verNo = "";
-        try {
-            verNo = db.dbversion();
-            db.close();
-            assertEquals(db.dbversion(),"unknown");
-            db.open(dbFile.getPath(), 0);
-            assertEquals(verNo,db.dbversion());
-        } catch (Exception e) {
-            try {
-                db.open(dbFile.getPath(), 0);
-            } catch (Exception e1) {
-                fail("error in db setup "+e.getMessage());
-                e.printStackTrace();
-            }
-            fail("error in db setup "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        assertTrue(Integer.parseInt(verNo.substring(0, 1))>= 3 );
-
-    }
-
-    /**
-     * @tests {@link Database#create_function(String, int, Function)}
-     */
-    @TestTargets({
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "create_function",
-        args = {java.lang.String.class, int.class, Function.class}
-    ),
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "create_function",
-        args = {java.lang.String.class, int.class, Function.class}
-        )
-    })
-    public void testCreate_function() {
-        try {
-            double input = 1.0;
-            db.exec("create table TEST (res double)", null);
-            db.exec("insert into TEST values (" + Double.toString(input) + ")",
-                    null);
-            TableResult res = new TableResult();
-            Function sinFunc = (Function) new SinFunc();
-            db.create_function("sin", 1, sinFunc);
-            db.exec("select sin(res) from TEST WHERE res = "
-                    + Double.toString(input), res);
-            String row[] = (String[]) res.rows.elementAt(0);
-            String val = row[0];
-            double sinusVal = Double.parseDouble(val);
-            double funcVal = Math.sin(input);
-
-            assertTrue(Math.round(funcVal) == Math.round(sinusVal));
-        } catch (Exception e) {
-            fail("Error happened creating function:" + e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @tests {@link Database#create_aggregate(String, int, Function)}
-     */
-    @TestTargets({
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "create_aggregate",
-        args = {java.lang.String.class, int.class, Function.class}
-    ),
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "step",
-        clazz = Function.class,
-        args = {FunctionContext.class, String[].class}
-            ),
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "last_step",
-        clazz = Function.class,
-        args = {FunctionContext.class}
-                ),
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "function",
-        clazz = Function.class,
-        args = {FunctionContext.class, String[].class}
-                    )
-    })
-    @KnownFailure("Aggregation function not called")
-    public void testCreate_aggregate() {
-        TestTrace t = new TestTrace();
-
-        MockFunction aggFunction = new MockFunction();
-
-        try {
-            db
-                    .exec(
-                            "create table TEST(id integer, firstname text, lastname text)",
-                            null);
-            db.exec("insert into TEST values(3, 'James', 'Bond'); ", null);
-            db.exec("insert into TEST values(4, 'Fiona', 'Apple'); ", null);
-            db.trace((Trace) t);
-            db.create_aggregate("myaggfunc", 1, aggFunction);
-            db.function_type("myaggfunc", Constants.SQLITE3_TEXT);
-            db.exec("PRAGMA show_datatypes = on", null);
-
-            assertFalse(aggFunction.functionCalled);
-            assertFalse(aggFunction.stepCalled);
-            assertFalse(aggFunction.lastStepCalled);
-            db.exec("select myaggfunc(TEST.firstname) from TEST", t);
-            assertTrue(aggFunction.stepCalled);
-            assertTrue(aggFunction.lastStepCalled);
-            assertTrue(aggFunction.functionCalled);
-
-            assertEquals("James Fiona ",aggFunction.getAggValue());
-            db.exec("drop table TEST", null);
-        } catch (Exception e) {
-            System.out.println(t.getTrace());
-            fail("Error in test setup: " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            db.create_aggregate("myaggfunc", 0, null);
-        } catch (Throwable e) {
-            assertEquals("null SQLite.Function not allowed",e.getMessage());
-        }
-
-          try {
-            db.create_aggregate("myaggfunc", 0, aggFunction);
-        } catch (Throwable e) {
-            assertEquals("wrong number of arguments to function myaggfunc()",e.getMessage());
-        }
-
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Database#function_type(String, int)}
-     * This method does not make sense
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Method does not make sense: for functions, return type is already set.",
-        method = "function_type",
-        args = {java.lang.String.class, int.class}
-    )
-    public void testFunction_type() throws Exception {
-
-        double input = 1.0;
-        TableResult res = new TableResult();
-        Function sinFunc = (Function) new SinFunc();
-
-        db.exec("PRAGMA show_datatypes = on", null);
-        db.exec("create table TEST (res double)", null);
-        db.exec("insert into TEST values (" + Double.toString(input) + ")",
-                null);
-
-        db.create_function("sin", 1, sinFunc);
-        db.function_type("sin", Constants.SQLITE_FLOAT);
-        res = db.get_table("select sin(res) from TEST WHERE res = "
-                + Double.toString(input));
-
-        String row[] = (String[]) res.rows.elementAt(0);
-        String val = row[0];
-        assertTrue("double".equalsIgnoreCase(res.types[0]));
-        assertSame(Math.round(Math.sin(input)), Math.round(Double.parseDouble(val)));
-
-        // function determines return type: test that Double type is returned.
-        db.function_type("sin", Constants.SQLITE_BLOB);
-        Stmt s = db.prepare("select sin(res) from TEST WHERE res = ?");
-        s.bind(1,input);
-        s.step();
-
-        res = db.get_table("select sin(res) from TEST WHERE res = "
-                + Double.toString(input));
-        assertTrue("double".equalsIgnoreCase(res.types[0]));
-        row = (String[]) res.rows.elementAt(0);
-        val = row[0];
-        assertSame(Math.round(Math.sin(input)), Math.round(Double.parseDouble(val)));
-
-
-
-
-    }
-
-    /**
-     * @tests {@link Database#last_error()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "last_error",
-        args = {}
-    )
-    public void testLast_error() {
-        assertEquals(db.last_error(), Constants.SQLITE_OK);
-        try {
-            db.exec("create table TEST (res double)",null);
-            db.exec("create table TEST (res double)",null);
-            fail("Error should have happened");
-        } catch (Exception e) {
-            assertEquals(db.last_error(),db.last_error());
-            assertEquals(db.last_error(),Constants.SQLITE_ERROR);
-        }
-
-    }
-
-    /**
-     * @tests {@link Database#set_last_error(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "don't now which other errors may occur from black-box approach.",
-        method = "set_last_error",
-        args = {int.class}
-    )
-    public void testSet_last_error() {
-       assertEquals(db.last_error(), Constants.SQLITE_OK);
-
-       try {
-           db.exec("sel from test;", null);
-       } catch (Exception e) {
-           assertEquals(Constants.SQLITE_ERROR,db.last_error());
-       }
-    }
-
-    /**
-     * @tests {@link Database#error_message()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "error_message",
-        args = {}
-    )
-    public void testError_message() {
-        String statement = "create table TEST (res double)";
-        try {
-            db.exec(statement,null);
-            db.exec(statement,null);
-            fail("DB Error expected");
-        } catch (Exception e) {
-            String dbError = db.error_message();
-            assertTrue(e.getMessage().equals(dbError));
-
-        }
-    }
-
-    /**
-     * @tests {@link Database#error_string(int)}
-     */
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "error_string",
-        args = {int.class}
-    )
-    public void testError_string() {
-        TestTrace t = new TestTrace();
-        assertEquals(db.last_error(), Constants.SQLITE_OK);
-        String errorString = db.error_string(Constants.SQLITE_ERROR);
-        try {
-            db.trace((Trace) t);
-            db.exec("create table TEST (res double)", t);
-            db.exec("create table TEST (res double)", t);
-        } catch (Exception e) {
-            assertEquals(db.last_error(), Constants.SQLITE_ERROR);
-            if (db.is3()) {
-                assertEquals("Unsupported Method (sqlite 3): error_string", db
-                        .error_string(db.last_error()), errorString);
-            }
-        }
-    }
-
-    /**
-     * @throws UnsupportedEncodingException
-     * @tests {@link Database#set_encoding(String)}
-     * Method unsupported? -> tests fail
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test fails.",
-        method = "set_encoding",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("ASCII encoding does not work: a UTF encoded val is returned. Spec is not sufficient. "
-            + "Might be that test impl is wrong or String constructor for the ASCII encoding.")
-    public void testSet_encoding() throws UnsupportedEncodingException {
-        String input = "\u00bfMa\u00f1ana\u003f"; // ?Manana?
-        TableResult res = new TableResult();
-        String refOutput = null;
-        Stmt stat = null;
-
-        // DB setup
-        try {
-            db.exec("create table encodingTest (encoded text DEFAULT NULL);",
-                    null);
-            stat = db
-                    .prepare("insert into encodingTest(encoded) values(:one);");
-            stat.bind(1, input);
-            stat.step();
-            // stat.close();
-            db.exec("select * from encodingTest;", res);
-            String[] encInput = (String[]) res.rows.elementAt(0);
-            String output = encInput[0];
-            assertEquals(input, output);
-            // db.exec("delete from encodingTest where 1", null);
-        } catch (Exception e1) {
-            fail("Error in test setup: " + e1.getMessage());
-            e1.printStackTrace();
-        }
-
-     // tests for different encoding schemes
-        String[] charsetNames = {"UTF-8", "UTF-16", "UTF-16BE", "UTF-16LE"};
-        for (int i = 0; i < charsetNames.length; i++) {
-            try {
-                byte[] encInput = input.getBytes(charsetNames[i]);
-                db.set_encoding(charsetNames[i]);
-                db.exec("select * from encodingTest;", res);
-                String[] encOutput = (String[]) res.rows.elementAt(0);
-                String inputAsString = new String(encInput,charsetNames[i]);
-                assertEquals(inputAsString, encOutput[0]);
-            } catch (Exception e4) {
-                fail("Error setting the encoding." + e4.getMessage());
-                e4.printStackTrace();
-            } catch (UnsupportedEncodingException e2) {
-                fail(e2.getMessage());
-                e2.printStackTrace();
-            }
-        }
-
-        // Default tests
-        try {
-            db.set_encoding("UTF-16");
-            db.exec("select * from encodingTest;", res);
-            String[] encOutput1 = (String[]) res.rows.elementAt(0);
-            assertEquals("Got "+encOutput1[0]+" as UTF-16",input,encOutput1[0]);
-
-            db.set_encoding("US-ASCII");
-            db.exec("select * from encodingTest;", res);
-            String[] encOutput2 = (String[]) res.rows.elementAt(0);
-            assertEquals(new String(input.getBytes(),"US-ASCII"),encOutput2[0]);
-        } catch (Exception e) {
-            fail("Error setting the encoding." + e.getMessage());
-            e.printStackTrace();
-        }
-
-
-        // DB teardown
-        try {
-            stat.close();
-            db.exec("delete from encodingTest", null);
-            // reset encoding
-        } catch (Exception e3) {
-            fail("Error in teardown of encoding environment");
-            e3.printStackTrace();
-        }
-
-        // Default tests
-        try {
-            db.set_encoding("");
-            fail("invalid input should fail");
-        } catch (Exception e) {
-            //ok
-        }
-
-    }
-
-    /**
-     * Test fails -> implemented correctly?
-     * @tests {@link Database#set_authorizer(Authorizer)}
-     */
-    @TestTargets({
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test fails.",
-        method = "set_authorizer",
-        args = {Authorizer.class}
-    ),
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test fails.",
-            method = "authorize",
-            clazz = Authorizer.class,
-            args = {int.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-        )
-    })
-    @KnownFailure("Callback never made for authorization. "+
-            "Results of private table are returned withouth furhter checks.")
-    public void testSet_authorizer() {
-
-        TableResult resPriv = null;
-        TableResult resPub = null;
-        TableResult emptyTable = new TableResult();
-        String insertPublic = "insert into public_table values(1,2)";
-        String insertPrivate = "insert into private_table values(1,2)";
-        try {
-            // prepare, authorizer is not activated yet
-            db.exec("create table public_table(c1 integer, c2 integer);", null);
-            db.exec("create table private_table(c1 integer, c2 integer);", null);
-            // inserts
-            db.exec(insertPublic, null);
-            db.exec(insertPrivate, null);
-            // selects
-            resPriv = db.get_table("select * from private_table");
-            resPub = db.get_table("select * from public_table");
-
-//            db.exec("delete from public_table where 1", null);
-//            TableResult emptyPubTable = db.exec("select * from public");
-
-            // set Authorizer (positive case): denies private table
-            AuthorizerCallback cb = new AuthorizerCallback();
-            db.set_authorizer(cb);
-            //select
-
-            db.exec("select * from private_table", cb);
-            assertTrue(cb.wasCalled());
-
-           /*
-            TableResult res = db.get_table("select * from private_table");
-            assertEquals(emptyTable.toString(),res.toString());
-            assertFalse(emptyTable.equals(resPriv));
-
-            res = db.get_table("select * from public_table");
-            assertEquals(resPub,res);
-            */
-        } catch (Exception e) {
-            fail("Error testing authorization: "+e.getMessage());
-        }
-
-        // Try insert
-        try {
-            db.exec(insertPublic, null);
-            fail("authorization failed");
-        } catch (Exception e) {
-            try {
-                db.exec(insertPrivate, null);
-                fail("authorization failed");
-            } catch (Exception e1) {
-                // ok
-            }
-        }
-
-    }
-
-    /**
-     * @tests {@link Database#trace(Trace)}
-     */
-
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "trace",
-        args = {Trace.class}
-    )
-    public void testTrace() {
-        String stmt = "create table TEST (res double);";
-        TestTrace t = new TestTrace();
-        assertFalse(t.traceCalled);
-        assertEquals(db.last_error(),Constants.SQLITE_OK);
-        try {
-            db.trace((Trace) t);
-            db.exec(stmt,t);
-            assertTrue(t.traceCalled);
-            assertEquals(t.getTrace(),stmt);
-        } catch (Exception e) {
-            fail("Error testing traces: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            db.close();
-            db.exec(stmt,t);
-            fail("Exception Expected");
-        } catch (Exception e) {
-            //ok
-        }
-
-
-    }
-
-    /**
-     * @tests {@link Database#compile(String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "compile",
-        args = {java.lang.String.class}
-    )
-    public void testCompileString() {
-        try {
-            db.compile("select name from sqlite_master;");
-        } catch (Exception e) {
-            fail("Error compiling sql statement " + e.getMessage());
-            e.printStackTrace();
-        }
-        try {
-            db.compile("test");
-            fail("Compiling of inaccurate statement does not fail.");
-        } catch (Exception e) {
-
-        }
-    }
-
-    /**
-     * @tests {@link Database#compile(String, String[])}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "compile",
-        args = {java.lang.String.class, java.lang.String[].class}
-    )
-    public void testCompileStringStringArray() {
-        String args[] = new String[1];
-        args[0] = "table";
-        try {
-            db.compile("select name from sqlite_master where type = '%q';",args);
-        } catch (Exception e) {
-            fail("Error compiling sql statement " + e.getMessage());
-            e.printStackTrace();
-        }
-        try {
-            db.compile("test",null);
-            fail("Compiling of inaccurate statement does not fail.");
-        } catch (Exception e) {
-
-        }
-    }
-
-    /**
-     * @tests {@link Database#prepare(String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "prepare",
-        args = {java.lang.String.class}
-    )
-    public void testPrepare() {
-        Stmt st = null;
-        Stmt st2 = null;
-        // test empty statement
-        try {
-            st = db.prepare("");
-            assertEquals(0, st.bind_parameter_count());
-            st.step();
-            fail("stmt should not be prepared");
-        } catch (Exception e) {
-            assertEquals("stmt already closed", e.getMessage());
-        }
-
-        // test statement with unbound arguments
-        try {
-            st2 = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            assertEquals(3, st2.bind_parameter_count());
-            assertEquals(3, st2.bind_parameter_index(":three"));
-            assertEquals(":two", st2.bind_parameter_name(2));
-        } catch (Exception e) {
-            fail("error in prepare method: " + e.getMessage());
-            e.printStackTrace();
-        } finally {
-            try {
-                st2.close();
-            } catch (Exception e) {
-                fail("error in prepare method cleanup: " + e.getMessage());
-                e.printStackTrace();
-            }
-        }
-
-        try {
-            db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values(:one,:two,:three,:four);");
-        } catch (Exception e) {
-            assertEquals("table " + DatabaseCreator.SIMPLE_TABLE1
-                    + " has 3 columns but 4 values were supplied", e
-                    .getMessage());
-        }
-
-        try {
-            db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values(5, '10, 20);");
-        } catch (Exception e) {
-            assertEquals("unrecognized token: \"'10, 20);\"", e.getMessage());
-        }
-
-        try {
-            db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values(5, 10 20);");
-        } catch (Exception e) {
-            assertEquals("near \"20\": syntax error", e.getMessage());
-        }
-
-    }
-
-    /**
-     * @throws Exception
-     * @throws java.lang.Exception
-     * @tests {@link Database#open_blob(String, String, String, long, boolean)}
-     * unsupported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "open_blob",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, long.class, boolean.class}
-    )
-    @KnownFailure("not supported")
-    public void testOpen_blob() throws Exception, java.lang.Exception {
-        Stmt statement2;
-        Blob blobInput = new Blob();
-
-
-        // Create test input Blob
-        InputStream inStream = null;
-        byte[] in = {(byte) 1, (byte) 2, (byte) 3, (byte) 4};
-
-        // setup test input
-        db.exec("create table TEST (res blob)",null);
-        inStream = Class.forName(this.getClass().getName()).getResourceAsStream("/blob.c");
-        assertNotNull(inStream);
-
-
-        // insert byte array in db
-        try {
-            statement2 = db.prepare("insert into TEST(res) values (?)");
-            statement2.bind(1, in);
-            statement2.step();
-            statement2.close();
-        } catch (Exception e) {
-            fail("Error happened inserting blob" + e.getMessage());
-            e.printStackTrace();
-        }
-
-        // read from db
-        byte[] output = null;
-        Blob blob;
-
-            blob = db.open_blob(dbFile.getPath(), "TEST", "res", 1, true);
-            if (blob == null) {
-                fail("Blob could not be retrieved");
-            }
-            //read from blob and compare values (positive case)
-            InputStream is = blob.getInputStream();
-
-            int i = 0;
-            int outByte = 0;
-            byte[] out = new byte[4];
-            while ((outByte = is.read()) > -1) {
-                out[i] = (byte) outByte;
-                i++;
-            }
-            is.close();
-
-            blob.close();
-
-            assertTrue(Arrays.equals(in, out));
-
-            //read from blob and compare values (default blob)
-            db.exec("insert into TEST values(zeroblob(128))", null);
-            Blob blob2 = db.open_blob(dbFile.getPath(), "TEST", "res", 2, true);
-            is = blob2.getInputStream();
-            for (i = 0; i < 128; i++)  {
-               assertEquals(0, is.read());
-            }
-            is.close();
-    }
-
-    /**
-     * @tests {@link Database#is3()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "is3",
-        args = {}
-    )
-    public void testIs3() {
-        int ver = Integer.parseInt(db.version().substring(0,1));
-        if (db.is3()) {
-            assertTrue( ver == 3);
-        } else {
-            assertTrue(ver != 3);
-        }
-    }
-
-    /**
-     * @tests {@link Database#progress_handler(int, ProgressHandler)}
-     */
-    @TestTargets ({
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "progress_handler",
-        args = {int.class, ProgressHandler.class}
-    ),
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            method = "progress",
-            clazz = ProgressHandler.class,
-            args = {}
-        )
-    })
-    public void testProgress_handler() {
-        int inputVal = 3;
-        TestProgressHandler prog = new TestProgressHandler();
-        try {
-            db.exec("create table TEST5(id integer, firstname text, lastname text)",null);
-            Vm vm = db.compile("select * from TEST5; "
-                    + "insert into TEST5 values(3, 'James', 'Bond'); "
-                    + "delete from TEST5 where id = 3; "
-                    + "select * from TEST5");
-            int stmt = 0;
-            do {
-                ++stmt;
-                if (stmt > inputVal) {
-                    db.progress_handler(inputVal, prog);
-                } else {
-                    assertEquals(0, prog.getCounts());
-                }
-                while (vm.step(prog)) {
-                }
-            } while (vm.compile());
-            assertEquals(inputVal,prog.getCounts());
-        } catch (Exception e) {
-            fail("Error in test setup: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        // Boundary value test
-        inputVal = 0;
-        TestProgressHandler progBoundary = new TestProgressHandler();
-        db.progress_handler(inputVal, progBoundary);
-        try {
-        Vm vm2 = db.compile("select * from TEST5; "
-                + "insert into TEST5 values(3, 'James', 'Bond'); "
-                + "delete from TEST5 where id = 3; "
-                + "select * from TEST5");
-        do {
-            vm2.step(progBoundary);
-        } while (vm2.compile());
-        assertEquals(inputVal, progBoundary.getCounts());
-        }catch (Exception e) {
-            fail("Error in test setup: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            db.exec("drop table TEST5",null);
-        } catch (Exception e) {
-            System.out.println(e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-
-
-    class SinFunc implements Function {
-
-
-        public void function(FunctionContext fc, String args[]) {
-            Double d = new Double(args[0]);
-            fc.set_result(Math.sin(d.doubleValue()));
-        }
-
-        public void last_step(FunctionContext fc) {
-            // TODO Auto-generated method stub
-
-        }
-
-        public void step(FunctionContext fc, String[] args) {
-            // TODO Auto-generated method stub
-
-        }
-    }
-
-   @TestTargetClass(Trace.class)
-    class TestTrace implements Trace,Callback {
-
-    private StringBuffer buf = new StringBuffer();
-
-    public boolean traceCalled = false;
-
-    public String getTrace() {
-        return buf.toString();
-    }
-
-    public void trace(String stmt) {
-        traceCalled = true;
-        buf.append(stmt);
-    }
-
-    public void columns(String[] coldata) {
-        // TODO Auto-generated method stub
-
-    }
-
-    public boolean newrow(String[] rowdata) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public void types(String[] types) {
-        // TODO Auto-generated method stub
-
-    }
-   }
-
-   @TestTargetClass(Authorizer.class)
-   class AuthorizerCallback implements Authorizer,Callback {
-       private boolean isAuthorizing = false;
-
-       public boolean wasCalled() {
-           return isAuthorizing;
-       }
-
-    public int authorize(int action, String arg1, String arg2, String arg3,
-            String arg4) {
-        Logger.global.info("DB authorization callback "+action+" "+arg1+" "+arg2+" "+arg3+" "+arg4+" ");
-        this.isAuthorizing = true;
-        if (action != Constants.SQLITE_SELECT || arg1.contains("private_table")) {
-        return Constants.SQLITE_DENY;
-        } else {
-        return Constants.SQLITE_OK;
-        }
-    }
-
-    public void columns(String[] coldata) {
-        // TODO Auto-generated method stub
-
-    }
-
-    public boolean newrow(String[] rowdata) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public void types(String[] types) {
-        // TODO Auto-generated method stub
-
-    }
-
-   }
-
-   class TestBusyHandler implements BusyHandler, Callback {
-
-    public boolean busy(String table, int count) {
-        System.out.println("BUSY!");
-        return true;
-    }
-
-    public void columns(String[] coldata) {
-        // TODO Auto-generated method stub
-
-    }
-
-    public boolean newrow(String[] rowdata) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public void types(String[] types) {
-        // TODO Auto-generated method stub
-
-    }
-
-   }
-
-   class TestProgressHandler implements ProgressHandler,Callback {
-
-    private boolean progressed = false;
-
-    private int counter = 0;
-
-    public boolean isProgressed() {
-        return progressed;
-    }
-
-    public int getCounts() {
-        return counter;
-    }
-
-    public boolean progress() {
-        this.progressed = true;
-        counter++;
-        return true;
-    }
-
-    public void columns(String[] coldata) {
-        // TODO Auto-generated method stub
-
-    }
-
-    public boolean newrow(String[] rowdata) {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public void types(String[] types) {
-        // TODO Auto-generated method stub
-
-    }
-
-   }
-
-//   class dbBusyThread implements Runnable {
-//
-//       String dbName = "sqliteTest.db";
-//
-//       Thread runner;
-//       public dbBusyThread() {
-//       }
-//       public dbBusyThread(String threadName) {
-//           runner = new Thread(this, threadName); // (1) Create a new thread.
-//           System.out.println(runner.getName());
-//           runner.start(); // (2) Start the thread.
-//       }
-//       public void run() {
-//            insert(3000);
-//        }
-//
-//       public void runNoDelay() {
-//           insert(0);
-//       }
-//
-//       synchronized private void insert(long delay) {
-//           Database db2 = new Database();
-//           try {
-//               db2.open(dbName, 0);
-//               db2.exec("insert into TEST5 values (4,'Anglina','Jolie');",
-//                       null);
-//               wait(delay);
-//           } catch (Exception e) {
-//               System.out.println("Error in Thread " + e.getMessage());
-//               e.printStackTrace();
-//           } catch (InterruptedException e2) {
-//               System.out.println("Error in Thread " + e2.getMessage());
-//               e2.printStackTrace();
-//           } finally {
-//              try {
-//               db2.close();
-//           } catch (Exception e) {
-//               // We do not handle this case
-//           }
-//           }
-//       }
-//   }
-
-   /**
-    * This method creates a Runnable that executes insert operation for the
-    * first table
-    */
-   private static Runnable createTask2Interrupt(final int id,
-            final String dbName, final ErrorTracker errorTracker) {
-        return new Runnable() {
-            public void run() {
-                Database db = new Database();
-                try {
-                    String value = DatabaseCreator.defaultString + id;
-
-                    db.open(dbName, 0);
-                    String insertQuery = "INSERT INTO "
-                            + DatabaseCreator.TEST_TABLE1
-                            + " (id, field1, field2, field3) VALUES(" + id
-                            + ", '" + value + "', " + id + ", " + id + ")";
-                    db.exec(insertQuery, null);
-                } catch (Exception e) {
-                    errorTracker.registerException(this, e);
-                    try {
-                        db.interrupt();
-                        db.exec("DELETE FROM " + DatabaseCreator.SIMPLE_TABLE1
-                                + " WHERE id=" + id, null);
-                    } catch (Exception e1) {
-                        errorTracker.registerException(this, e1);
-                    }
-                }
-            }
-        };
-   }
-
-   /**
-    * This method creates a Runnable that executes delete operation for the
-    * first table
-    */
-   private static Runnable createTask1(final int id,final String dbName, final ErrorTracker errorTracker) {
-       return new Runnable() {
-           public void run() {
-               try {
-                   Database db = new Database();
-                   db.open(dbName, 0);
-                   db.exec("DELETE FROM "
-                           + DatabaseCreator.SIMPLE_TABLE1 + " WHERE id=" + id,null);
-               } catch (Exception e) {
-                   errorTracker.registerException(this, e);
-               }
-           }
-       };
-   }
-
-   /**
-    * This method creates a Runnable that executes insert operation for the
-    * first table
-    */
-   private static Runnable createTask2(final int id, final String dbName, final ErrorTracker errorTracker ) {
-       return new Runnable() {
-           public void run() {
-               try {
-                   String value = DatabaseCreator.defaultString + id;
-                   Database db = new Database();
-                   db.open(dbName, 0);
-                   String insertQuery = "INSERT INTO "
-                           + DatabaseCreator.TEST_TABLE1
-                           + " (id, field1, field2, field3) VALUES(" + id
-                           + ", '" + value + "', " + id + ", " + id + ")";
-                   db.exec(insertQuery,null);
-               } catch (Exception e) {
-                   errorTracker.registerException(this, e);
-
-               }
-           }
-       };
-   }
-
-   /**
-    * This method creates a Runnable that executes update operation for the one
-    * record of the first table
-    */
-   private static Runnable createTask3(final int oldID, final String dbName,
-            final int newID, final ErrorTracker errorTracker) {
-        return new Runnable() {
-            public void run() {
-                Database db = new Database();
-                try {
-                    db.open(dbName, 0);
-                    String value = DatabaseCreator.defaultString + newID;
-                    String updateQuery = "UPDATE "
-                            + DatabaseCreator.TEST_TABLE1 + " SET id=" + newID
-                            + ", field1='" + value + "', field2=" + newID
-                            + ", field3=" + newID + " WHERE id=" + oldID;
-                    db.exec(updateQuery, null);
-                } catch (Exception e) {
-                    errorTracker.registerException(this, e);
-                }
-            }
-        };
-    }
-
-   private class ErrorTracker {
-        private List<String> errors = new ArrayList<String>();
-
-        public void registerException(Runnable runnable, Exception e) {
-            System.out.println("Registered: "+e.getMessage());
-            errors.add(e.getMessage());
-        }
-
-        public List<String> getErrors() {
-            return errors;
-        }
-
-        public void reset() {
-            errors.clear();
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/SQLite/JDBCDriverFunctionalTest.java b/luni/src/test/java/tests/SQLite/JDBCDriverFunctionalTest.java
deleted file mode 100644
index 89fb77b..0000000
--- a/luni/src/test/java/tests/SQLite/JDBCDriverFunctionalTest.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.SQLite;
-
-import SQLite.Exception;
-import SQLite.JDBCDriver;
-import dalvik.annotation.TestTargetClass;
-
-import java.io.File;
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.SQLException;
-
-
-/**
- * Tests the SQLite.JDBCDriver.
- */
-@TestTargetClass(JDBCDriver.class)
-public class JDBCDriverFunctionalTest extends AbstractSqlTest {
-
-
-
-    /**
-     * The SQLite db file.
-     */
-    private  File dbFile = null;
-
-    private String connectionURL = "empty";
-
-    /**
-     * Sets up an unit test by loading the SQLite.JDBCDriver, getting two
-     * connections and calling the setUp method of the super class.
-     * @throws Exception
-     * @throws IllegalAccessException
-     * @throws InstantiationException
-     * @throws Exception
-     * @throws Exception
-     * @throws Exception
-     * @throws Exception
-     * @throws Exception
-     */
-    @Override
-    public void setUp() throws ClassNotFoundException, SQLException, InstantiationException, IllegalAccessException, Exception { // the Exception class needs to be fully
-        // qualified since there is an Exception
-        // class in the SQLite package.
-
-        super.setUp();
-    }
-
-    /**
-     * Tears down an unit test by calling the tearDown method of the super class
-     * and deleting the SQLite test db file.
-     */
-    @Override
-    protected void tearDown() throws SQLException {
-        super.tearDown();
-        dbFile.delete();
-    }
-
-
-    @Override
-    protected String getConnectionURL() {
-        if (connectionURL.equals("empty")) {
-            String tmp = System.getProperty("java.io.tmpdir");
-            File tmpDir = new File(tmp);
-            if (tmpDir.isDirectory()) {
-                try {
-                    dbFile = File.createTempFile("JDBCDriverFunctionalTest",
-                            ".db", tmpDir);
-                } catch (IOException e) {
-                    System.err.println("error creating temporary DB file.");
-                }
-                dbFile.deleteOnExit();
-            } else {
-                System.err.println("java.io.tmpdir does not exist");
-            }
-
-            connectionURL = "jdbc:sqlite:/" + dbFile.getPath();
-
-        }
-
-        return connectionURL;
-    }
-
-    @Override
-    protected String getDriverClassName() {
-        return "SQLite.JDBCDriver";
-    }
-
-    @Override
-    protected int getTransactionIsolation() {
-        return Connection.TRANSACTION_SERIALIZABLE;
-    }
-
-
-}
diff --git a/luni/src/test/java/tests/SQLite/JDBCDriverTest.java b/luni/src/test/java/tests/SQLite/JDBCDriverTest.java
deleted file mode 100644
index aac8f16..0000000
--- a/luni/src/test/java/tests/SQLite/JDBCDriverTest.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.SQLite;
-
-import SQLite.Exception;
-import SQLite.JDBCDriver;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-import java.sql.Connection;
-import java.sql.Driver;
-import java.sql.DriverManager;
-import java.sql.DriverPropertyInfo;
-import java.sql.SQLException;
-
-
-@TestTargetClass(JDBCDriver.class)
-public class JDBCDriverTest extends JDBCDriverFunctionalTest {
-
-    /**
-     * The SQLite db file.
-     */
-    private JDBCDriver jDriver;
-
-    private Driver returnedDriver;
-
-    public void setUp() throws ClassNotFoundException, SQLException, InstantiationException, IllegalAccessException, Exception  {
-
-        try {
-            super.setUp();
-            returnedDriver = DriverManager.getDriver(getConnectionURL());
-            if (returnedDriver instanceof JDBCDriver) {
-                this.jDriver = (JDBCDriver) returnedDriver;
-            }
-        } catch (SQLException e) {
-          System.out.println("Cannot get driver");
-            e.printStackTrace();
-        } catch (Exception e) {
-            System.out.println("DB Setup failed");
-            e.printStackTrace();
-        }
-   }
-
-    /**
-     * @tests JDBCDriver#JDBCDriver()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "constructor test",
-        method = "JDBCDriver",
-        args = {}
-    )
-    public void testJDBCDriver() {
-        assertTrue(returnedDriver instanceof JDBCDriver);
-    }
-
-    /**
-     * @tests JDBCDriver#acceptsURL(String)
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "constructor test",
-            method = "acceptsURL",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "constructor test",
-            // we have to list the Driver target explicitly, since SQLite
-            // is not part of the target packages
-            clazz = Driver.class,
-            method = "acceptsURL",
-            args = {java.lang.String.class}
-        )
-    })
-    public void testAcceptsURL() {
-        try {
-            if (this.jDriver != null) {
-                assertTrue(jDriver.acceptsURL(getConnectionURL()));
-            } else {
-                fail("no Driver available");
-            }
-        } catch (SQLException e) {
-            fail("Driver does not accept URL");
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @tests JDBCDriver#connect(String, java.util.Properties)
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            method = "connect",
-            args = {java.lang.String.class, java.util.Properties.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            // we have to list the Driver target explicitly, since SQLite
-            // is not part of the target packages
-            clazz = Driver.class,
-            notes = "method test",
-            method = "connect",
-            args = {java.lang.String.class, java.util.Properties.class}
-        )
-    })
-    public void testConnect() {
-        try {
-            if (this.jDriver != null) {
-                Connection c = jDriver.connect(getConnectionURL(), null);
-                assertFalse(c.isClosed());
-                DriverManager.getConnection(getConnectionURL());
-            } else {
-                fail("no Driver available");
-            }
-        } catch (SQLException e) {
-            fail("Driver does not connect");
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @tests JDBCDriver#getMajorVersion()
-     */
-   @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            method = "getMajorVersion",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            // we have to list the Driver target explicitly, since SQLite
-            // is not part of the target packages
-            clazz = Driver.class,
-            notes = "method test",
-            method = "getMajorVersion",
-            args = {}
-        )
-    })
-    public void testGetMajorVersion() {
-        if (this.jDriver != null) {
-            assertTrue(jDriver.getMajorVersion() > 0);
-        } else {
-            fail("no Driver available");
-        }
-    }
-
-    /**
-     * @tests JDBCDriver#getMinorVersion()
-     */
-   @TestTargets({
-       @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            method = "getMinorVersion",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            // we have to list the Driver target explicitly, since SQLite
-            // is not part of the target packages
-            clazz = Driver.class,
-            method = "getMinorVersion",
-            args = {}
-        )
-   })
-   public void testGetMinorVersion() {
-        if (this.jDriver != null) {
-            assertTrue(jDriver.getMinorVersion() > 0);
-        } else {
-            fail("no version information available");
-        }
-    }
-
-    /**
-     * @tests JDBCDriver#getPropertyInfo(String, java.util.Properties)
-     */
-   @TestTargets({
-       @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            method = "getPropertyInfo",
-            args = {java.lang.String.class, java.util.Properties.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            // we have to list the Driver target explicitly, since SQLite
-            // is not part of the target packages
-            clazz = Driver.class,
-            method = "getPropertyInfo",
-            args = {java.lang.String.class, java.util.Properties.class}
-        )
-   })
-   public void testGetPropertyInfo() {
-        DriverPropertyInfo[] info = null;
-        try {
-            if (this.jDriver != null) {
-                info = jDriver.getPropertyInfo(getConnectionURL(), null);
-                assertNotNull(info);
-                assertTrue(info.length > 0);
-            } else {
-                fail("no Driver available");
-            }
-        } catch (SQLException e) {
-            fail("Driver property details not available");
-            e.printStackTrace();
-        }
-
-        assertNotNull(info);
-
-    }
-
-    /**
-     * @tests JDBCDriver#jdbcCompliant()
-     */
-   @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "method test",
-            method = "jdbcCompliant",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            // we have to list the Driver target explicitly, since SQLite
-            // is not part of the target packages
-            clazz = Driver.class,
-            notes = "method test",
-            method = "jdbcCompliant",
-            args = {}
-        )
-    })
-    public void testJdbcCompliant() {
-        if (this.jDriver != null) {
-            assertFalse(jDriver.jdbcCompliant());
-        } else {
-            fail("no version information available");
-        }
-    }
-    /**
-     * Tears down an unit test by calling the tearDown method of the super class
-     * and deleting the SQLite test db file.
-     */
-    @Override
-    protected void tearDown() throws SQLException {
-        super.tearDown();
-    }
-
-}
diff --git a/luni/src/test/java/tests/SQLite/ShellTest.java b/luni/src/test/java/tests/SQLite/ShellTest.java
deleted file mode 100644
index f0f4f7c..0000000
--- a/luni/src/test/java/tests/SQLite/ShellTest.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.SQLite;
-
-import SQLite.Shell;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.io.PrintStream;
-import java.io.PrintWriter;
-
-@TestTargetClass(Shell.class)
-public class ShellTest extends TestCase {
-
-    /**
-     * Test method for {@link SQLite.Shell#Shell(java.io.PrintWriter, java.io.PrintWriter)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "Shell",
-      args = {PrintWriter.class, PrintWriter.class}
-    )
-    public void testShellPrintWriterPrintWriter() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link SQLite.Shell#Shell(java.io.PrintStream, java.io.PrintStream)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "Shell",
-      args = {PrintStream.class, PrintStream.class}
-    )
-    public void testShellPrintStreamPrintStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link SQLite.Shell#clone()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "clone",
-      args = {}
-    )
-    public void testClone() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link SQLite.Shell#sql_quote_dbl(java.lang.String)}.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-                method = "sql_quote_dbl",
-                args = {String.class}
-          )
-    public void testSql_quote_dbl() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link SQLite.Shell#sql_quote(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "sql_quote",
-          args = {String.class}
-    )
-    public void testSql_quote() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * Test method for {@link SQLite.Shell#columns(java.lang.String[])}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "columns",
-      args = {String[].class}
-    )
-    public void testColumns() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link SQLite.Shell#types(java.lang.String[])}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "types",
-      args = {String[].class}
-    )
-    public void testTypes() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link SQLite.Shell#newrow(java.lang.String[])}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "newrow",
-      args = {String[].class}
-    )
-    public void testNewrow() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "main",
-      args = {String[].class}
-    )
-    public void testMain() {
-
-    }
-
-}
diff --git a/luni/src/test/java/tests/SQLite/StmtTest.java b/luni/src/test/java/tests/SQLite/StmtTest.java
deleted file mode 100644
index 1dc8552..0000000
--- a/luni/src/test/java/tests/SQLite/StmtTest.java
+++ /dev/null
@@ -1,1250 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.SQLite;
-
-import SQLite.Constants;
-import SQLite.Database;
-import SQLite.Exception;
-import SQLite.Stmt;
-import SQLite.TableResult;
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-
-import tests.support.DatabaseCreator;
-import tests.support.Support_SQL;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-@TestTargetClass(Stmt.class)
-public class StmtTest extends SQLiteTest {
-
-    private static Database db = null;
-
-    private static Stmt st = null;
-
-    private static final String createAllTypes =
-    "create table type (" +
-
-    " BoolVal BOOLEAN," + " IntVal INT," + " LongVal LONG,"
-            + " Bint BIGINT," + " Tint TINYINT," + " Sint SMALLINT,"
-            + " Mint MEDIUMINT, " +
-
-            " IntegerVal INTEGER, " + " RealVal REAL, "
-            + " DoubleVal DOUBLE, " + " FloatVal FLOAT, "
-            + " DecVal DECIMAL, " +
-
-            " NumVal NUMERIC, " + " charStr CHAR(20), "
-            + " dateVal DATE, " + " timeVal TIME, " + " TS TIMESTAMP, "
-            +
-
-            " DT DATETIME, " + " TBlob TINYBLOB, " + " BlobVal BLOB, "
-            + " MBlob MEDIUMBLOB, " + " LBlob LONGBLOB, " +
-
-            " TText TINYTEXT, " + " TextVal TEXT, "
-            + " MText MEDIUMTEXT, " + " LText LONGTEXT, " +
-
-            " MaxLongVal BIGINT, MinLongVal BIGINT, "+
-
-            " validURL URL, invalidURL URL "+
-
-            ");";
-
-    static final String insertAllTypes =
-        "insert into type (BoolVal, IntVal, LongVal, Bint, Tint, Sint, Mint,"
-        + "IntegerVal, RealVal, DoubleVal, FloatVal, DecVal,"
-        + "NumVal, charStr, dateVal, timeVal, TS,"
-        + "DT, TBlob, BlobVal, MBlob, LBlob,"
-        + "TText, TextVal, MText, LText, MaxLongVal, MinLongVal,"
-        + " validURL, invalidURL"
-        + ") "
-        + "values (1, -1, 22, 2, 33,"
-        + "3, 1, 2, 3.9, 23.2, 33.3, 44,"
-        + "5, 'test string', '1799-05-26', '12:35:45', '2007-10-09 14:28:02.0',"
-        + "'1221-09-22 10:11:55', 1, 2, 3, 4,"
-        + "'Test text message tiny', 'Test text',"
-        + " 'Test text message medium', 'Test text message long', "
-        + Long.MAX_VALUE+", "+Long.MIN_VALUE+", "
-        + "null, null "+
-        ");";
-
-    static final String allTypesTable = "type";
-
-    public void setUp() throws java.lang.Exception {
-        super.setUp();
-        Support_SQL.loadDriver();
-        db = new Database();
-        db.open(dbFile.getPath(), 0);
-        db.exec(DatabaseCreator.CREATE_TABLE_SIMPLE1, null);
-        DatabaseCreator.fillSimpleTable1(conn);
-
-    }
-
-    public void tearDown() {
-        if (st != null) {
-            try {
-            st.close();
-            } catch (Exception e) {
-
-            }
-        }
-        try {
-            db.close();
-            Connection con = Support_SQL.getConnection();
-            con.close();
-//            dbFile.delete();
-        } catch (Exception e) {
-            fail("Exception in tearDown: "+e.getMessage());
-        } catch (SQLException e) {
-            fail("SQLException in tearDown: "+e.getMessage());
-        }
-        super.tearDown();
-    }
-
-    /**
-     * @tests {@link Stmt#Stmt()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "constructor test",
-        method = "Stmt",
-        args = {}
-    )
-    public void testStmt() {
-        Stmt st = new Stmt();
-        assertNotNull(st);
-        try {
-            Stmt actual = db.prepare("");
-            assertNotNull(st);
-            // no black box test assertEquals(actual.error_code,st.error_code);
-        } catch (Exception e) {
-            fail("Statement setup fails: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-               st.step();
-               fail("Cannot execute non prepared Stmt");
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#finalize()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "method test",
-        method = "finalize",
-        args = {}
-    )
-    public void testFinalize() {
-
-    }
-
-    /**
-     * @tests {@link Stmt#prepare()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "prepare",
-        args = {}
-    )
-    public void testPrepare() {
-        try {
-            st = db.prepare("");
-            st.prepare();
-            fail("statement is closed");
-        } catch (Exception e) {
-            assertEquals("stmt already closed", e.getMessage());
-        }
-
-        try {
-            st = new Stmt();
-            st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
-            assertFalse(st.prepare());
-            st = new Stmt();
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            assertFalse(st.prepare());
-            st = new Stmt();
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            st.bind(1, 1);
-            st.bind(2, 10);
-            st.bind(3, 30);
-            assertFalse(st.prepare());
-            st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1
-                    + "; " + "delete from " + DatabaseCreator.SIMPLE_TABLE1
-                    + " where id = 5; " + "insert into "
-                    + DatabaseCreator.SIMPLE_TABLE1 + " values(5, 10, 20); "
-                    + "select * from " + DatabaseCreator.SIMPLE_TABLE1 + ";");
-            assertTrue(st.prepare());
-            assertTrue(st.prepare());
-            assertTrue(st.prepare());
-            assertFalse(st.prepare());
-        } catch (Exception e) {
-            fail("statement should be ready for execution: "
-                    + e.getMessage());
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#step()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "step",
-        args = {}
-    )
-    public void testStep() {
-        try {
-            st.step();
-            fail("Exception expected");
-        } catch (Exception e) {
-            assertEquals("stmt already closed", e.getMessage());
-        }
-
-        try {
-            st = new Stmt();
-            st = db.prepare("select name from sqlite_master where type = 'table'");
-            st.step();
-        } catch (Exception e) {
-           fail("test fails");
-        }
-
-    }
-
-    /**
-     * @tests {@link Stmt#close()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "close",
-        args = {}
-    )
-    public void testClose() {
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            st.close();
-        } catch (Exception e) {
-            fail("Test fails");
-            e.printStackTrace();
-        }
-
-        try {
-            st.step();
-            fail("Test fails");
-        } catch (Exception e) {
-            assertEquals("stmt already closed", e.getMessage());
-        }
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#reset()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "reset",
-        args = {}
-    )
-    public void testReset() throws Exception {
-        db.exec("create table TEST (res integer not null)", null);
-
-        st = db.prepare("insert into TEST values (:one);");
-        st.bind(1, 1);
-        st.step();
-
-        // verify that parameter is still bound
-        st.reset();
-        assertEquals(1,st.bind_parameter_count());
-        st.step();
-
-        TableResult count = db.get_table("select count(*) from TEST where res=1", null);
-
-        String[] row0 = (String[]) count.rows.elementAt(0);
-        assertEquals(2, Integer.parseInt(row0[0]));
-    }
-
-    /**
-     * @tests {@link Stmt#clear_bindings()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "clear_bindings",
-        args = {}
-    )
-    public void testClear_bindings() {
-        try {
-            st.clear_bindings();
-        } catch (Exception e) {
-            assertEquals("unsupported", e.getMessage());
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind(int, int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind",
-        args = {int.class, int.class}
-    )
-    public void testBindIntInt() {
-        try {
-            int input = 0;
-            int maxVal = Integer.MAX_VALUE;
-            int minVal = Integer.MIN_VALUE;
-
-            db.exec("create table TEST (res integer)", null);
-            st = db.prepare("insert into TEST values (:one);");
-            st.bind(1, input);
-            st.step();
-
-            st.reset();
-            st.bind(1,maxVal);
-            st.step();
-
-            st.reset();
-            st.bind(1,minVal);
-            st.step();
-
-            TableResult r = db.get_table("select * from TEST");
-
-            String[] row0 = (String[]) r.rows.elementAt(0);
-            assertEquals(input,Integer.parseInt(row0[0]));
-
-            String[] row1 = (String[]) r.rows.elementAt(1);
-            assertEquals(maxVal,Integer.parseInt(row1[0]));
-
-            String[] row2 = (String[]) r.rows.elementAt(2);
-            assertEquals(minVal,Integer.parseInt(row2[0]));
-
-        } catch (Exception e) {
-            fail("Error in test setup: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st.close();
-            st.bind(1,Integer.MIN_VALUE);
-            fail("Exception expected");
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind(int, long)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind",
-        args = {int.class, long.class}
-    )
-    public void testBindIntLong() {
-        try {
-            long input = 0;
-            long maxVal = Long.MAX_VALUE;
-            long minVal = Long.MIN_VALUE;
-
-            db.exec("create table TEST (res long)", null);
-            st = db.prepare("insert into TEST values (:one);");
-            st.bind(1, input);
-            st.step();
-
-            st.reset();
-            st.bind(1,maxVal);
-            st.step();
-
-            st.reset();
-            st.bind(1,minVal);
-            st.step();
-
-            TableResult r = db.get_table("select * from TEST");
-
-            String[] row0 = (String[]) r.rows.elementAt(0);
-            assertEquals(input,Long.parseLong(row0[0]));
-
-            String[] row1 = (String[]) r.rows.elementAt(1);
-            assertEquals(maxVal,Long.parseLong(row1[0]));
-
-            String[] row2 = (String[]) r.rows.elementAt(2);
-            assertEquals(minVal,Long.parseLong(row2[0]));
-
-        } catch (Exception e) {
-            fail("Error in test setup: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st.close();
-            st.bind(1,Long.MIN_VALUE);
-            fail("Exception expected");
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind(int, double)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind",
-        args = {int.class, double.class}
-    )
-    public void testBindIntDouble() {
-        try {
-            double input = 0.0;
-            double maxVal = Double.MAX_VALUE;
-            double minVal = Double.MIN_VALUE;
-            double negInf = Double.NEGATIVE_INFINITY;
-            double posInf = Double.POSITIVE_INFINITY;
-            double nan = Double.NaN;
-
-            db.exec("create table TEST (res double)", null);
-            st = db.prepare("insert into TEST values (:one);");
-            st.bind(1, input);
-            st.step();
-
-            st.reset();
-            st.bind(1, maxVal);
-            st.step();
-
-            st.reset();
-            st.bind(1, minVal);
-            st.step();
-
-            st.reset();
-            st.bind(1, negInf);
-            st.step();
-
-            st.reset();
-            st.bind(1, posInf);
-            st.step();
-
-            st.reset();
-            st.bind(1, nan);
-            st.step();
-
-
-            TableResult r = db.get_table("select * from TEST");
-
-            String[] row0 = (String[]) r.rows.elementAt(0);
-            assertTrue(Double.compare(input, Double.parseDouble(row0[0])) == 0);
-
-            String[] row1 = (String[]) r.rows.elementAt(1);
-            assertFalse(Double.compare(maxVal, Double.parseDouble(row1[0])) == 0);
-            assertTrue(Double.compare(maxVal, Double.parseDouble(row1[0])) < 0);
-            assertTrue(Double.isInfinite(Double.parseDouble(row1[0])));
-
-            String[] row2 = (String[]) r.rows.elementAt(2);
-            assertTrue(Double.compare(minVal, Double.parseDouble(row2[0])) == 0);
-
-            String[] row3 = (String[]) r.rows.elementAt(3);
-            assertEquals("Double.NEGATIVE_INFINITY SQLite representation",
-                    "-Inf", row3[0]);
-
-            String[] row4 = (String[]) r.rows.elementAt(4);
-            assertEquals("Double.POSITIVE_INFINITY SQLite representation",
-                    "Inf", row4[0]);
-
-            String[] row5 = (String[]) r.rows.elementAt(4);
-            assertEquals("Double.Nan SQLite representation", "Inf", row5[0]);
-
-        } catch (Exception e) {
-            fail("Error in test setup: " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st.close();
-            st.bind(1,0.0);
-            fail("Exception expected");
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind(int, byte[])}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "bind",
-        args = {int.class, byte[].class}
-    )
-    public void testBindIntByteArray() {
-
-        String name = "Hello World";
-
-        try {
-            byte[] b = new byte[name.getBytes().length];
-            b = name.getBytes();
-            String stringInHex = "";
-
-            db.exec(DatabaseCreator.CREATE_TABLE_PARENT, null);
-            st = db.prepare("insert into " + DatabaseCreator.PARENT_TABLE
-                    + " values (:one, :two);");
-            st.bind(1, 2);
-            st.bind(2, b);
-            st.step();
-
-            //compare what was stored with input based on Hex representation
-            // since type of column is CHAR
-            TableResult r = db.get_table("select * from "
-                    + DatabaseCreator.PARENT_TABLE);
-            String[] row = (String[]) r.rows.elementAt(0);
-
-            for (byte aByte : b) {
-                stringInHex += Integer.toHexString(aByte);
-            }
-            stringInHex = "X'" + stringInHex + "'";
-            assertTrue(stringInHex.equalsIgnoreCase(row[1]));
-
-        } catch (Exception e) {
-            fail("Error in test setup: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st.close();
-            st.bind(1,name.getBytes());
-            fail("Exception expected");
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind(int, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testBindIntString() {
-        String name = "Hello World";
-
-        try {
-
-            db.exec(DatabaseCreator.CREATE_TABLE_PARENT, null);
-            st = db.prepare("insert into " + DatabaseCreator.PARENT_TABLE
-                    + " values (:one, :two);");
-            st.bind(1, 2);
-            st.bind(2, name);
-            st.step();
-
-            TableResult r = db.get_table("select * from "
-                    + DatabaseCreator.PARENT_TABLE);
-            String[] row = (String[]) r.rows.elementAt(0);
-            assertEquals(name,row[1]);
-
-        } catch (Exception e) {
-            fail("Error in test setup: "+e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st.close();
-            st.bind(1,name);
-            fail("Exception expected");
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind",
-        args = {int.class}
-    )
-    public void testBindInt() {
-
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            st.bind(4);
-            st.bind(1, 4);
-            st.bind(2, 10);
-            st.bind(3, 30);
-            st.step();
-            fail("Test failes");
-        } catch (Exception e) {
-            // What happens if null is bound to non existing variable position
-            assertEquals("parameter position out of bounds" , e.getMessage());
-        }
-
-        // functional tests
-
-        try {
-            st.reset();
-            st.bind(1);
-            st.bind(2, 10);
-            st.bind(3, 30);
-            st.step();
-            fail("Test failes");
-        } catch (Exception e) {
-            // What happens if null is bound to NON NULL field
-            assertEquals("SQL logic error or missing database", e.getMessage());
-        }
-
-        try {
-            st.reset();
-            st.bind(1, 3);
-            st.bind(2);
-            st.bind(3, 30);
-            st.step();
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-        }
-
-    }
-
-    /**
-     * @tests {@link Stmt#bind_zeroblob(int, int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "bind_zeroblob",
-        args = {int.class, int.class}
-    )
-    public void testBind_zeroblob() {
-        try {
-            st.bind_zeroblob(1, 128);
-        } catch (Exception e) {
-            assertEquals("unsupported", e.getMessage());
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind_parameter_count()}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind_parameter_count",
-        args = {}
-    )
-    public void testBind_parameter_count() {
-        try {
-            st.bind_parameter_count();
-        } catch (Exception e) {
-            assertEquals("stmt already closed", e.getMessage());
-        }
-
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            assertEquals(3, st.bind_parameter_count());
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (?, ?, ?)");
-            assertEquals(3, st.bind_parameter_count());
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
-            assertEquals(0, st.bind_parameter_count());
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st.close();
-            st.bind_parameter_count();
-            fail("Exception expected");
-        } catch (Exception e) {
-            //ok
-        }
-
-    }
-
-    /**
-     * @tests {@link Stmt#bind_parameter_name(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind_parameter_name",
-        args = {int.class}
-    )
-    public void testBind_parameter_name() {
-        try {
-            st.bind_parameter_name(1);
-            fail("Exception expected");
-        } catch (Exception e) {
-            assertEquals("stmt already closed", e.getMessage());
-        }
-
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            assertEquals(":one", st.bind_parameter_name(1));
-            assertEquals(":two", st.bind_parameter_name(2));
-            assertEquals(":three", st.bind_parameter_name(3));
-            String name = st.bind_parameter_name(4);
-        } catch (Exception e) {
-            assertEquals("parameter position out of bounds",e.getMessage());
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#bind_parameter_index(String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "bind_parameter_index",
-        args = {java.lang.String.class}
-    )
-    public void testBind_parameter_index() {
-
-        try {
-            st.bind_parameter_index("");
-            fail("Exception expected");
-        } catch (Exception e) {
-            assertEquals("stmt already closed", e.getMessage());
-        }
-
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            assertEquals(3, st.bind_parameter_index(":three"));
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            assertEquals(0, st.bind_parameter_index(":t"));
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (?, ?, ?)");
-            assertEquals(0, st.bind_parameter_index("?"));
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#column_int(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "column_int",
-        args = {int.class}
-    )
-    public void testColumn_int() throws Exception {
-        db.exec(createAllTypes, null);
-        db.exec(insertAllTypes, null);
-
-        int columnObjectCastFromLong;
-        Object columnObject  = null;
-        int intColumn = 0;
-        String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
-
-        st = db.prepare(selectStmt);
-        st.step();
-        // select 'speed' value
-        columnObject = st.column(1);
-        intColumn = st.column_int(1);
-        assertNotNull(intColumn);
-
-        assertTrue("Integer".equalsIgnoreCase(st.column_decltype(1)));
-        int stSpeed = Integer.parseInt(columnObject.toString());
-        assertNotNull(stSpeed);
-        assertEquals( intColumn, stSpeed);
-        assertEquals(10,stSpeed);
-
-        selectStmt = "select TextVal from "+allTypesTable;
-
-        st = db.prepare(selectStmt);
-        st.step();
-        // select double value
-        try {
-            st.column_int(0);
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#column_long(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "column_long",
-        args = {int.class}
-    )
-    public void testColumn_long() {
-        Object columnObject  = null;
-        int columnObjectCastFromLong;
-        long longColumn = 0;
-        try {
-            String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
-            st = db.prepare(selectStmt);
-            st.step();
-            columnObject = st.column(1);
-            longColumn = st.column_long(1);
-            assertNotNull(longColumn);
-            // column declared as integer
-            assertTrue("Integer".equalsIgnoreCase(st.column_decltype(1)));
-            int stSpeed = Integer.parseInt(columnObject.toString());
-            assertNotNull(stSpeed);
-            assertEquals( longColumn, stSpeed);
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            st.column_long(4);
-            fail("Exception expected");
-        } catch (Exception e) {
-            assertEquals( "column out of bounds" , e.getMessage());
-        }
-
-        try {
-            st.column_long(-1);
-            fail("Exception expected");
-        } catch (Exception e) {
-            assertEquals( "column out of bounds" , e.getMessage());
-        }
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#column_double(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "column_double",
-        args = {int.class}
-    )
-    public void testColumn_double() throws Exception {
-        db.exec(createAllTypes, null);
-        db.exec(insertAllTypes, null);
-
-        Object columnObject  = null;
-        double doubleColumn = 0;
-        double actualVal = 23.2;
-        String selectStmt = "select DoubleVal from "+allTypesTable;
-
-        st = db.prepare(selectStmt);
-        st.step();
-        // select double value
-        doubleColumn = st.column_double(0);
-        assertNotNull(doubleColumn);
-
-        assertTrue("DOUBLE".equalsIgnoreCase(st.column_decltype(0)));
-        assertNotNull(doubleColumn);
-        assertEquals( actualVal, doubleColumn);
-
-        // Exception test
-        selectStmt = "select dateVal from "+allTypesTable;
-
-        st = db.prepare(selectStmt);
-        st.step();
-        // select double value
-        try {
-        st.column_double(0);
-        } catch (Exception e) {
-            //ok
-        }
-
-
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#column_bytes(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "column_bytes",
-        args = {int.class}
-    )
-    public void testColumn_bytes() throws Exception {
-
-        db.exec("create table B(id integer primary key, val blob)",null);
-        db.exec("insert into B values(1, zeroblob(128))", null);
-        st = db.prepare("select val from B where id = 1");
-        assertTrue(st.step());
-        try {
-            st.column_bytes(0);
-        } catch (Exception e) {
-            assertEquals("unsupported", e.getMessage());
-        }
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#column_string(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "column_string",
-        args = {int.class}
-    )
-    public void testColumn_string() throws Exception {
-        db.exec(createAllTypes, null);
-        db.exec(insertAllTypes, null);
-
-        Object columnObject  = null;
-        String stringColumn = "";
-        String actualVal = "test string";
-        String selectStmt = "select charStr from "+allTypesTable;
-
-        st = db.prepare(selectStmt);
-        st.step();
-        // select string value
-        stringColumn = st.column_string(0);
-        assertNotNull(stringColumn);
-
-        assertTrue("CHAR(20)".equalsIgnoreCase(st.column_decltype(0)));
-        assertNotNull(stringColumn);
-        assertEquals( actualVal, stringColumn);
-
-        // Exception test
-        selectStmt = "select DoubleVal from "+allTypesTable;
-
-        st = db.prepare(selectStmt);
-        st.step();
-        // select double value
-        try {
-        st.column_string(0);
-        } catch (Exception e) {
-            //ok
-        }
-    }
-
-    public void testColumn_type() throws Exception {
-        db.exec(createAllTypes, null);
-        db.exec(insertAllTypes, null);
-        st = db.prepare("select * from " + allTypesTable);
-        st.step();
-
-        // Exception test
-        try {
-            st.column_type(100);
-        } catch (Exception e) {
-            // ok
-        }
-
-        /*
-        Dictionary
-
-        public static final int SQLITE_INTEGER = 1;
-        public static final int SQLITE_FLOAT = 2;
-        public static final int SQLITE_BLOB = 4;
-        public static final int SQLITE_NULL = 5;
-        public static final int SQLITE3_TEXT = 3;
-        public static final int SQLITE_NUMERIC = -1;
-        */
-
-        assertEquals(Constants.SQLITE3_TEXT, st.column_type(23)); // ok TEXT
-        assertEquals(Constants.SQLITE3_TEXT, st.column_type(13)); // CHAR(20)
-
-        assertEquals(Constants.SQLITE_FLOAT, st.column_type(8));
-        assertEquals(Constants.SQLITE_FLOAT, st.column_type(9));
-        assertEquals(Constants.SQLITE_FLOAT, st.column_type(10)); // FLOAT
-
-        for (int i = 0; i < 8; i++) {
-            assertEquals("Expected Integer at position " + i,
-                    Constants.SQLITE_INTEGER, st.column_type(i));
-        }
-
-        assertEquals(Constants.SQLITE_NULL, st.column_type(28));
-        assertEquals(Constants.SQLITE_NULL, st.column_type(29));
-
-        // Failing tests
-        assertTrue("INTEGER".equalsIgnoreCase(st.column_decltype(12)));
-        assertEquals(Constants.SQLITE_INTEGER, st.column_type(12));
-
-        assertTrue("FLOAT".equalsIgnoreCase(st.column_decltype(11)));
-        assertEquals(Constants.SQLITE_FLOAT, st.column_type(11)); // FLOAT ->
-                                                                  // got INTEGER
-        assertTrue("BLOB".equalsIgnoreCase(st.column_decltype(19)));
-        assertEquals(Constants.SQLITE_BLOB, st.column_type(19)); // Blob got
-                                                                 // INTEGER
-
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#column_count() )}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "column_count",
-        args = {}
-    )
-    @KnownFailure("Wrong value is returned in case of a prepared statment to "+
-            "which a '*' bound ")
-    public void testColumn_count() throws Exception {
-
-        String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
-        st = db.prepare(selectStmt);
-
-        assertEquals(3, st.column_count());
-
-        st.step();
-        int columnCount = st.column_count();
-        assertNotNull(columnCount);
-        assertEquals( 3, columnCount);
-
-        // actual prepared statement
-        selectStmt = "select ? from "+DatabaseCreator.SIMPLE_TABLE1;
-        st = db.prepare(selectStmt);
-
-        assertEquals(3, st.column_count());
-
-        st.bind(1, "*");
-        st.step();
-        columnCount = st.column_count();
-        assertNotNull(columnCount);
-        assertEquals( 3, columnCount);
-
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#column(int) )}
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "method test",
-        method = "column",
-        args = {int.class}
-    )
-    public void testColumn() throws Exception {
-        Object columnObject  = null;
-        int columnObjectCastFromLong;
-        int intColumn = 0;
-        try {
-            String selectStmt = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
-            TableResult res = db.get_table(selectStmt);
-            st = db.prepare(selectStmt);
-            st.step();
-            columnObject = st.column(1);
-            intColumn = st.column_int(1);
-            assertNotNull(intColumn);
-            assertTrue("Integer".equalsIgnoreCase(st.column_decltype(1)));
-            int stSpeed = Integer.parseInt(columnObject.toString());
-            assertNotNull(stSpeed);
-            assertEquals( intColumn, stSpeed);
-        } catch (Exception e) {
-            fail("Error in test setup : " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        try {
-            assertNotNull(columnObject);
-            int dummy = ((Integer) columnObject).intValue();
-            fail("Cast to Integer should fail");
-        } catch (ClassCastException e) {
-            assertEquals("java.lang.Long", e.getMessage());
-        }
-
-        try {
-            st.column(4);
-            fail("Exception expected");
-        } catch (Exception e) {
-            assertEquals( "column out of bounds" , e.getMessage());
-        }
-
-        try {
-            st.column(-1);
-            fail("Exception expected");
-        } catch (Exception e) {
-            assertEquals( "column out of bounds" , e.getMessage());
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#column_table_name(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "column_table_name",
-        args = {int.class}
-    )
-    public void testColumn_table_name() {
-        try {
-            st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
-            String name = st.column_table_name(1);
-           fail("Function is now supported.");
-        } catch (Exception e) {
-            assertEquals("unsupported", e.getMessage());
-        }
-    }
-
-    /**
-     * @tests {@link Stmt#column_database_name(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "column_database_name",
-        args = {int.class}
-    )
-    public void testColumn_database_name() {
-        try {
-            st = db.prepare("insert into " + DatabaseCreator.SIMPLE_TABLE1
-                    + " values (:one,:two,:three)");
-            String name = st.column_database_name(1);
-           fail("Function is now supported.");
-        } catch (Exception e) {
-            assertEquals("unsupported", e.getMessage());
-        }
-
-    }
-
-    /**
-     * @throws Exception
-     * @tests {@link Stmt#column_decltype(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "method test",
-        method = "column_decltype",
-        args = {int.class}
-    )
-    public void testColumn_decltype() throws Exception {
-        db.exec(createAllTypes, null);
-        db.exec(insertAllTypes, null);
-        st = db.prepare("select * from " + allTypesTable);
-        st.step();
-
-        // Exception test
-        try {
-            st.column_decltype(100);
-        } catch (Exception e) {
-            // ok
-        }
-
-        assertTrue(st.column_decltype(0), "BOOLEAN".equalsIgnoreCase(st
-                .column_decltype(0)));
-        assertTrue(st.column_decltype(1), "INT".equalsIgnoreCase(st
-                .column_decltype(1)));
-        assertTrue(st.column_decltype(2), "LONG".equalsIgnoreCase(st
-                .column_decltype(2)));
-        assertTrue(st.column_decltype(3), "BIGINT".equalsIgnoreCase(st
-                .column_decltype(3)));
-        assertTrue(st.column_decltype(4), "TINYINT".equalsIgnoreCase(st
-                .column_decltype(4)));
-        assertTrue(st.column_decltype(5), "SMALLINT".equalsIgnoreCase(st
-                .column_decltype(5)));
-        assertTrue(st.column_decltype(6), "MEDIUMINT".equalsIgnoreCase(st
-                .column_decltype(6)));
-        assertTrue(st.column_decltype(7), "INTEGER".equalsIgnoreCase(st
-                .column_decltype(7)));
-        assertTrue(st.column_decltype(8), "REAL".equalsIgnoreCase(st
-                .column_decltype(8)));
-        assertTrue(st.column_decltype(9), "DOUBLE".equalsIgnoreCase(st
-                .column_decltype(9)));
-        assertTrue(st.column_decltype(10), "FLOAT".equalsIgnoreCase(st
-                .column_decltype(10)));
-        assertTrue(st.column_decltype(11), "DECIMAL".equalsIgnoreCase(st
-                .column_decltype(11)));
-        assertTrue(st.column_decltype(12), "NUMERIC".equalsIgnoreCase(st
-                .column_decltype(12)));
-        assertTrue(st.column_decltype(13), "CHAR(20)".equalsIgnoreCase(st
-                .column_decltype(13)));
-
-        assertTrue(st.column_decltype(19), "BLOB".equalsIgnoreCase(st
-                .column_decltype(19)));
-
-        assertTrue(st.column_decltype(23), "TEXT".equalsIgnoreCase(st
-                .column_decltype(23)));
-        assertTrue(st.column_decltype(28), "URL".equalsIgnoreCase(st
-                .column_decltype(28)));
-        assertTrue(st.column_decltype(29), "URL".equalsIgnoreCase(st
-                .column_decltype(29)));
-    }
-
-    /**
-     * @tests {@link Stmt#column_origin_name(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "column_origin_name",
-        args = {int.class}
-    )
-    public void testColumn_origin_name() {
-        try {
-            st = db.prepare("select * from " + DatabaseCreator.SIMPLE_TABLE1);
-            String name = st.column_origin_name(1);
-           fail("Function is now supported.");
-        } catch (Exception e) {
-            assertEquals("unsupported", e.getMessage());
-        }
-    }
-}
diff --git a/luni/src/test/java/tests/annotation/AllTests.java b/luni/src/test/java/tests/annotation/AllTests.java
deleted file mode 100644
index f5b6595..0000000
--- a/luni/src/test/java/tests/annotation/AllTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.annotation;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the NIO_Char project.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All Annotation test suites");
-        // $JUnit-BEGIN$
-        suite.addTest(org.apache.harmony.annotation.tests.java.lang.annotation.AllTests.suite());
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/io/AllTests.java b/luni/src/test/java/tests/api/java/io/AllTests.java
deleted file mode 100644
index d75d2c9..0000000
--- a/luni/src/test/java/tests/api/java/io/AllTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.java.io;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.java.io;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.api.java.io;");
-        suite.addTestSuite(ObjectInputStreamTest.class);
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/io/ComputeSerialVersionUIDTest.java b/luni/src/test/java/tests/api/java/io/ComputeSerialVersionUIDTest.java
index 3288b62..458c27f 100644
--- a/luni/src/test/java/tests/api/java/io/ComputeSerialVersionUIDTest.java
+++ b/luni/src/test/java/tests/api/java/io/ComputeSerialVersionUIDTest.java
@@ -2,23 +2,11 @@
 
 import java.io.ObjectInputStream;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-@TestTargetClass(ObjectInputStream.class)
 public class ComputeSerialVersionUIDTest extends junit.framework.TestCase {
 
 
     private String path = "/serialization/tests/api/java/io/";
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization.",
-        method = "!Serialization",
-        args = {}
-    )
     public void testComputeSUIDClass() throws Exception {
         ObjectInputStream ois = new ObjectInputStream(getClass()
                 .getResourceAsStream(path + "testComputeSUIDClass.ser"));
@@ -37,12 +25,6 @@
         ois.close();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization.",
-        method = "!Serialization",
-        args = {}
-    )
     public void testComputeSUIDInterfaces() throws Exception {
         ObjectInputStream ois = new ObjectInputStream(getClass()
                 .getResourceAsStream(path + "testComputeSUIDInterfaces.ser"));
@@ -75,12 +57,6 @@
         ois.close();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization.",
-        method = "!Serialization",
-        args = {}
-    )
     public void testComputeSUIDFields() throws Exception {
         ObjectInputStream ois = new ObjectInputStream(getClass()
                 .getResourceAsStream(path + "testComputeSUIDFields.ser"));
@@ -119,12 +95,6 @@
         ois.close();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization.",
-        method = "!Serialization",
-        args = {}
-    )
     public void testComputeSUIDConstructors() throws Exception {
         ObjectInputStream ois = new ObjectInputStream(getClass()
                 .getResourceAsStream(path + "testComputeSUIDConstructors.ser"));
@@ -147,12 +117,6 @@
         ois.close();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization.",
-        method = "!Serialization",
-        args = {}
-    )
     public void testComputeSUIDMethods() throws Exception {
         ObjectInputStream ois = new ObjectInputStream(getClass()
                 .getResourceAsStream(path + "testComputeSUIDMethods.ser"));
diff --git a/luni/src/test/java/tests/api/java/lang/AllTests.java b/luni/src/test/java/tests/api/java/lang/AllTests.java
deleted file mode 100644
index edaa021..0000000
--- a/luni/src/test/java/tests/api/java/lang/AllTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package tests.api.java.lang;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * TODO Type description
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Test for java.lang");
-
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(Process2Test.class);
-        suite.addTestSuite(ProcessTest.class);
-        suite.addTestSuite(ProcessManagerTest.class);
-        suite.addTestSuite(BooleanTest.class);
-        suite.addTestSuite(StringTest.class);
-
-        // $JUnit-END$
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/lang/BooleanTest.java b/luni/src/test/java/tests/api/java/lang/BooleanTest.java
deleted file mode 100644
index 80927cd..0000000
--- a/luni/src/test/java/tests/api/java/lang/BooleanTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.java.lang;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for the class {@link Boolean}.
- */
-@TestTargetClass(Boolean.class)
-public class BooleanTest
-    extends TestCase
-{
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Checks that booleanValue() returns true.",
-        method = "booleanValue",
-        args = {}
-    )
-    public void test_TRUE() {
-        assertTrue(Boolean.TRUE.booleanValue() == true);
-    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Checks that booleanValue() returns false.",
-        method = "booleanValue",
-        args = {}
-    )
-    public void test_FALSE() {
-        assertTrue(Boolean.FALSE.booleanValue() == false);
-    }
-
-    // TODO(danfuzz): Add tests for the rest of Boolean here.
-}
diff --git a/luni/src/test/java/tests/api/java/lang/Process2Test.java b/luni/src/test/java/tests/api/java/lang/Process2Test.java
index 3aed751..5d18d61 100644
--- a/luni/src/test/java/tests/api/java/lang/Process2Test.java
+++ b/luni/src/test/java/tests/api/java/lang/Process2Test.java
@@ -18,10 +18,6 @@
 package tests.api.java.lang;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import java.io.BufferedInputStream;
 import java.io.BufferedOutputStream;
@@ -32,34 +28,13 @@
 import tests.support.Support_Exec;
 import static tests.support.Support_Exec.javaProcessBuilder;
 
-@TestTargetClass(Process.class)
 public class Process2Test extends junit.framework.TestCase {
     /**
-     * @tests java.lang.Process#getInputStream(),
+     * java.lang.Process#getInputStream(),
      *        java.lang.Process#getErrorStream()
      *        java.lang.Process#getOutputStream()
      * Tests if these methods return buffered streams.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getErrorStream",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getInputStream",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getOutputStream",
-            args = {}
-        )
-    })
     @AndroidOnly("dalvikvm specific")
     public void test_streams()
             throws IOException, InterruptedException {
@@ -69,12 +44,6 @@
         assertNotNull(p.getOutputStream());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getErrorStream",
-        args = {}
-    )
     public void test_getErrorStream() {
         String[] commands = {"ls"};
         Process process = null;
diff --git a/luni/src/test/java/tests/api/java/lang/ProcessManagerTest.java b/luni/src/test/java/tests/api/java/lang/ProcessManagerTest.java
index 1f24ff7..99e1df3 100644
--- a/luni/src/test/java/tests/api/java/lang/ProcessManagerTest.java
+++ b/luni/src/test/java/tests/api/java/lang/ProcessManagerTest.java
@@ -17,9 +17,6 @@
 package tests.api.java.lang;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -31,19 +28,12 @@
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 
-@TestTargetClass(Process.class)
 public class ProcessManagerTest extends TestCase {
 
     Thread thread = null;
     Process process = null;
     boolean isThrown = false;
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getOutputStream",
-        args = {}
-    )
     public void testCat() throws IOException, InterruptedException {
         String[] commands = { "cat" };
         Process process = Runtime.getRuntime().exec(commands, null, null);
@@ -57,12 +47,6 @@
         assertEquals(greeting, readLine(process));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "waitFor",
-        args = {}
-    )
     @BrokenTest("Sporadic failures in CTS, but not in CoreTestRunner")
     public void testSleep() throws IOException {
         String[] commands = { "sleep", "1" };
@@ -127,12 +111,6 @@
         assertTrue(isThrown);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInputStream",
-        args = {}
-    )
     public void testPwd() throws IOException, InterruptedException {
         String[] commands = { "sh", "-c", "pwd" };
         Process process = Runtime.getRuntime().exec(
@@ -141,12 +119,6 @@
         assertEquals("/", readLine(process));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInputStream",
-        args = {}
-    )
     public void testEnvironment() throws IOException, InterruptedException {
         String[] commands = { "sh", "-c", "echo $FOO" };
 
@@ -184,12 +156,6 @@
         thread.start();
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Stress test.",
-        method = "waitFor",
-        args = {}
-    )
     public void testHeavyLoad() {
         int i;
         for (i = 0; i < 100; i++)
@@ -212,13 +178,6 @@
 
     InputStream in;
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "Check non standard fd behavior",
-        clazz = Runtime.class,
-        method = "exec",
-        args = {String[].class, String[].class, java.io.File.class}
-    )
     public void testCloseNonStandardFds()
             throws IOException, InterruptedException {
         String[] commands = { "ls", "/proc/self/fd" };
@@ -254,13 +213,6 @@
         return count;
     }
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        notes = "Check non standard fd behavior",
-        clazz = Runtime.class,
-        method = "exec",
-        args = {String[].class, String[].class, java.io.File.class}
-    )
     public void testInvalidCommand()
             throws IOException, InterruptedException {
         try {
diff --git a/luni/src/test/java/tests/api/java/lang/ProcessTest.java b/luni/src/test/java/tests/api/java/lang/ProcessTest.java
index cb10c34..f875dc0 100644
--- a/luni/src/test/java/tests/api/java/lang/ProcessTest.java
+++ b/luni/src/test/java/tests/api/java/lang/ProcessTest.java
@@ -18,26 +18,16 @@
 package tests.api.java.lang;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
 
-@TestTargetClass(Process.class)
 public class ProcessTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.lang.Process#getInputStream()
+     * java.lang.Process#getInputStream()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInputStream",
-        args = {}
-    )
     public void test_getInputStream() {
         try {
             // Test for:
@@ -78,14 +68,8 @@
     }
 
     /**
-     * @tests java.lang.Process#getOutputStream()
+     * java.lang.Process#getOutputStream()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getOutputStream",
-        args = {}
-    )
     public void test_getOutputStream() {
         try {
             String[] commands = { "sleep", "1"};
@@ -126,12 +110,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "exitValue",
-        args = {}
-    )
     public void test_exitValue() {
         try {
             String[] commands = { "ls" };
@@ -163,23 +141,11 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Process",
-        args = {}
-    )
     public void test_Constructor() {
         ProcessClass pc = new ProcessClass();
         assertTrue(pc.exitValue() == 0);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "destroy",
-        args = {}
-    )
     @BrokenTest("Sporadic timeouts in CTS, but not in CoreTestRunner")
     public void test_destroy() {
         String[] commands = { "ls"};
diff --git a/luni/src/test/java/tests/api/java/lang/StringTest.java b/luni/src/test/java/tests/api/java/lang/StringTest.java
index eac3aa0..1e9933d 100644
--- a/luni/src/test/java/tests/api/java/lang/StringTest.java
+++ b/luni/src/test/java/tests/api/java/lang/StringTest.java
@@ -16,66 +16,30 @@
 
 package tests.api.java.lang;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 /**
  * Tests for the class {@link String}.
  */
-@TestTargetClass(String.class)
 public class StringTest extends TestCase {
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "NullPointerException is not verified.",
-        method = "contains",
-        args = {java.lang.CharSequence.class}
-    )
     public void test_contains() {
         assertTrue("aabc".contains("abc"));
         assertTrue("abcd".contains("abc"));
         assertFalse("abcd".contains("cba"));
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "IndexOutOfBoundsException is not verified.",
-        method = "charAt",
-        args = {int.class}
-    )
     public void test_charAt() {
         assertTrue("abcd".charAt(0) == 'a');
         assertTrue("abcd".charAt(3) == 'd');
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't check empty string, null as a parameter.",
-        method = "startsWith",
-        args = {java.lang.String.class}
-    )
     public void test_StartsWith() {
         assertTrue("abcd".startsWith("abc"));
         assertFalse("abcd".startsWith("aabc"));
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't check empty string, null as a parameter.",
-        method = "endsWith",
-        args = {java.lang.String.class}
-    )
     public void test_EndsWith() {
         assertTrue("abcd".endsWith("bcd"));
         assertFalse("abcd".endsWith("bcde"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "!Constants",
-        args = {}
-    )
     public void test_CASE_INSENSITIVE_ORDER() {
         String  s1 = "ABCDEFG";
         String  s2 = "abcdefg";
diff --git a/luni/src/test/java/tests/api/java/lang/ref/AllTests.java b/luni/src/test/java/tests/api/java/lang/ref/AllTests.java
deleted file mode 100644
index 31f478e..0000000
--- a/luni/src/test/java/tests/api/java/lang/ref/AllTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package tests.api.java.lang.ref;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * TODO Type description
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Test for java.lang.ref");
-
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(PhantomReferenceTest.class);
-        suite.addTestSuite(ReferenceQueueTest.class);
-        suite.addTestSuite(ReferenceTest.class);
-        suite.addTestSuite(SoftReferenceTest.class);
-        suite.addTestSuite(WeakReferenceTest.class);
-
-        // $JUnit-END$
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/lang/ref/PhantomReferenceTest.java b/luni/src/test/java/tests/api/java/lang/ref/PhantomReferenceTest.java
index d3fcbb3..06221c9 100644
--- a/luni/src/test/java/tests/api/java/lang/ref/PhantomReferenceTest.java
+++ b/luni/src/test/java/tests/api/java/lang/ref/PhantomReferenceTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.lang.ref;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.ref.PhantomReference;
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
@@ -29,7 +24,6 @@
 //TODO: write a test to verify that the referent's finalize() happens
 //      before the PhantomReference is enqueued.
 
-@TestTargetClass(PhantomReference.class)
 public class PhantomReferenceTest extends junit.framework.TestCase {
     static Boolean bool;
     public boolean isCalled = false;
@@ -38,14 +32,8 @@
     }
 
     /**
-     * @tests java.lang.ref.PhantomReference#get()
+     * java.lang.ref.PhantomReference#get()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {}
-    )
     public void test_get() {
         ReferenceQueue rq = new ReferenceQueue();
         bool = new Boolean(false);
@@ -58,14 +46,8 @@
     }
 
     /**
-     * @tests java.lang.Runtime#gc()
+     * java.lang.Runtime#gc()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Interaction test with Runtime.getRuntime().gc().",
-        method = "get",
-        args = {}
-    )
     public void test_gcInteraction() {
         class TestPhantomReference<T> extends PhantomReference<T> {
             public TestPhantomReference(T referent,
@@ -124,15 +106,9 @@
     }
 
     /**
-     * @tests java.lang.ref.PhantomReference#PhantomReference(java.lang.Object,
+     * java.lang.ref.PhantomReference#PhantomReference(java.lang.Object,
      *        java.lang.ref.ReferenceQueue)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PhantomReference",
-        args = {java.lang.Object.class, java.lang.ref.ReferenceQueue.class}
-    )
     public void test_ConstructorLjava_lang_ObjectLjava_lang_ref_ReferenceQueue() {
         ReferenceQueue rq = new ReferenceQueue();
         bool = new Boolean(true);
diff --git a/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java b/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java
index ea0b1aa..dc7e738 100644
--- a/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java
+++ b/luni/src/test/java/tests/api/java/lang/ref/ReferenceQueueTest.java
@@ -17,18 +17,12 @@
 
 package tests.api.java.lang.ref;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.ref.PhantomReference;
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
 
-@TestTargetClass(ReferenceQueue.class)
 public class ReferenceQueueTest extends junit.framework.TestCase {
     static Boolean b;
 
@@ -63,14 +57,8 @@
     ReferenceQueue rq;
 
     /**
-     * @tests java.lang.ref.ReferenceQueue#poll()
+     * java.lang.ref.ReferenceQueue#poll()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "poll",
-        args = {}
-    )
     public void test_poll() {
         // store in a static so it won't be gc'ed because the jit
         // optimized it out
@@ -116,14 +104,8 @@
     }
 
     /**
-     * @tests java.lang.ref.ReferenceQueue#remove()
+     * java.lang.ref.ReferenceQueue#remove()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {}
-    )
     public void test_remove() {
         // store in a static so it won't be gc'ed because the jit
         // optimized it out
@@ -169,14 +151,8 @@
     }
 
     /**
-     * @tests java.lang.ref.ReferenceQueue#remove(long)
+     * java.lang.ref.ReferenceQueue#remove(long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {long.class}
-    )
     public void test_removeJ() {
         try {
             assertNull("Queue should be empty. (poll)", rq.poll());
@@ -256,14 +232,8 @@
     }
 
     /**
-     * @tests java.lang.ref.ReferenceQueue#ReferenceQueue()
+     * java.lang.ref.ReferenceQueue#ReferenceQueue()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ReferenceQueue",
-        args = {}
-    )
     public void test_Constructor() {
         ReferenceQueue rq = new ReferenceQueue();
         assertNull(rq.poll());
diff --git a/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java b/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java
index cd9b72e..a1a7a8c 100644
--- a/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java
+++ b/luni/src/test/java/tests/api/java/lang/ref/ReferenceTest.java
@@ -16,21 +16,13 @@
  */
 package tests.api.java.lang.ref;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.AssertionFailedError;
-
 import java.lang.ref.PhantomReference;
 import java.lang.ref.Reference;
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
-import java.util.Vector;
+import junit.framework.AssertionFailedError;
 
-@TestTargetClass(Reference.class)
 public class ReferenceTest extends junit.framework.TestCase {
     Object tmpA, tmpB, tmpC, obj;
 
@@ -90,14 +82,8 @@
     }
 
     /**
-     * @tests java.lang.ref.Reference#clear()
+     * java.lang.ref.Reference#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         tmpA = new Object();
         tmpB = new Object();
@@ -119,22 +105,8 @@
     }
 
     /**
-     * @tests java.lang.ref.Reference#enqueue()
+     * java.lang.ref.Reference#enqueue()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "enqueue",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isEnqueued",
-            args = {}
-        )
-    })
     public void test_enqueue() {
         ReferenceQueue rq = new ReferenceQueue();
         obj = new Object();
@@ -169,104 +141,42 @@
                 && (rq.poll() == null));
     }
 
-    /**
-     * @tests java.lang.ref.Reference#enqueue()
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality for WeakReference.",
-        method = "get",
-        args = {}
-    )
-    public void test_get_WeakReference() {
+    public void test_get_WeakReference() throws Exception {
         // Test the general/overall functionality of Reference.
+        ReferenceQueue<Object> queue = new ReferenceQueue<Object>();
 
-        class TestObject {
-            public boolean finalized;
+        r = newWeakReference(queue);
+        System.gc();
+        System.runFinalization();
+        Reference ref = queue.remove();
+        assertNotNull("Object not enqueued.", ref);
+        assertSame("Unexpected ref1", ref, r);
+        assertNull("Object could not be reclaimed1.", r.get());
 
-            public TestObject() {
-                finalized = false;
-            }
+        r = newWeakReference(queue);
+        System.gc();
+        System.runFinalization();
 
-            protected void finalize() {
-                finalized = true;
-            }
-        }
+        // wait for the reference queue thread to enqueue the newly-finalized object
+        Thread.yield();
+        Thread.sleep(200);
 
-        final ReferenceQueue rq = new ReferenceQueue();
-
-        class TestThread extends Thread {
-
-            public void run() {
-                // Create the object in a separate thread to ensure it will be
-                // gc'ed
-                Object testObj = new TestObject();
-                r = new WeakReference(testObj, rq);
-                testObj = null;
-            }
-        }
-
-        Reference ref;
-
-        try {
-            TestThread t = new TestThread();
-            t.start();
-            t.join();
-            System.gc();
-            System.runFinalization();
-            ref = rq.remove();
-            assertNotNull("Object not garbage collected1.", ref);
-            assertTrue("Unexpected ref1", ref == r);
-            assertNull("Object could not be reclaimed1.", r.get());
-        } catch (InterruptedException e) {
-            fail("InterruptedException : " + e.getMessage());
-        }
-
-        try {
-            TestThread t = new TestThread();
-            t.start();
-            t.join();
-            System.gc();
-            System.runFinalization();
-            ref = rq.poll();
-            assertNotNull("Object not garbage collected.", ref);
-            assertTrue("Unexpected ref2", ref == r);
-            assertNull("Object could not be reclaimed.", ref.get());
-            // Reference wr so it does not get collected
-            assertNull("Object could not be reclaimed.", r.get());
-        } catch (Exception e) {
-            fail("Exception : " + e.getMessage());
-        }
+        ref = queue.poll();
+        assertNotNull("Object not enqueued.", ref);
+        assertSame("Unexpected ref2", ref, r);
+        assertNull("Object could not be reclaimed.", ref.get());
+        assertNull("Object could not be reclaimed.", r.get());
     }
 
-
     /**
      * Makes sure that overridden versions of clear() and enqueue()
      * get called, and that clear/enqueue/finalize happen in the
      * right order for WeakReferences.
      *
-     * @tests java.lang.ref.Reference#clear()
-     * @tests java.lang.ref.Reference#enqueue()
-     * @tests java.lang.Object#finalize()
+     * java.lang.ref.Reference#clear()
+     * java.lang.ref.Reference#enqueue()
+     * java.lang.Object#finalize()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Makes sure that overridden versions of clear() and enqueue()  " +
-                    "get called, and that clear/enqueue/finalize happen in the  " +
-                    "right order for WeakReferences.",
-            method = "clear",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Makes sure that overridden versions of clear() and enqueue()  " +
-                    "get called, and that clear/enqueue/finalize happen in the  " +
-                    "right order for WeakReferences.",
-            method = "enqueue",
-            args = {}
-        )
-    })
     public void test_subclass() {
         error = null;
         testObjectFinalized = false;
@@ -323,49 +233,36 @@
     }
 
     /**
-     * @tests java.lang.ref.Reference#get()
+     * java.lang.ref.Reference#get()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't check that get() can return null.",
-        method = "get",
-        args = {}
-    )
     public void test_get() {
-
-        Vector<StringBuffer> vec = new Vector<StringBuffer>();
-        WeakReference ref = new WeakReference(vec, new ReferenceQueue());
-        assertTrue("Get succeeded.", ref.get() == vec);
-
-        Runtime rt =  Runtime.getRuntime();
-
-        long beforeTest = rt.freeMemory();
-        while(rt.freeMemory() < beforeTest * 2/3) {
-            vec.add(new StringBuffer(1000));
-        }
-        vec = null;
+        WeakReference ref = newWeakReference(null);
 
         System.gc();
         System.runFinalization();
-        assertNull("get() doesn't return null after gc for WeakReference",
-                    ref.get());
+        assertNull("get() doesn't return null after gc for WeakReference", ref.get());
 
         obj = new Object();
-        ref = new WeakReference(obj, new ReferenceQueue());
+        ref = new WeakReference<Object>(obj, new ReferenceQueue<Object>());
         ref.clear();
-        assertNull("get() doesn't return null after clear for WeakReference",
-                ref.get());
+        assertNull("get() doesn't return null after clear for WeakReference", ref.get());
     }
 
     /**
-     * @tests java.lang.ref.Reference#isEnqueued()
+     * Helper method to prevent live-precise bugs from interfering with analysis
+     * of what is reachable. Do not inline this method; otherwise tests may fail
+     * on VMs that are not live-precise. http://b/4191345
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEnqueued",
-        args = {}
-    )
+    private WeakReference<Object> newWeakReference(ReferenceQueue<Object> queue) {
+        Object o = new Object();
+        WeakReference<Object> ref = new WeakReference<Object>(o, queue);
+        assertSame(o, ref.get());
+        return ref;
+    }
+
+    /**
+     * java.lang.ref.Reference#isEnqueued()
+     */
     public void test_isEnqueued() {
         ReferenceQueue rq = new ReferenceQueue();
         obj = new Object();
@@ -385,15 +282,6 @@
      * Checks to make sure that the referent of the WeakReference
      * is still pointing to a valid object.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Contrives a situation where the only reference to a string  " +
-                "is a WeakReference from an object that is being finalized.  " +
-                "Checks to make sure that the referent of the WeakReference  " +
-                "is still pointing to a valid object.",
-        method = "get",
-        args = {}
-    )
     public void test_finalizeReferenceInteraction() {
         error = null;
         testObjectFinalized = false;
diff --git a/luni/src/test/java/tests/api/java/lang/ref/SoftReferenceTest.java b/luni/src/test/java/tests/api/java/lang/ref/SoftReferenceTest.java
index c126e3d..77c6536 100644
--- a/luni/src/test/java/tests/api/java/lang/ref/SoftReferenceTest.java
+++ b/luni/src/test/java/tests/api/java/lang/ref/SoftReferenceTest.java
@@ -16,11 +16,6 @@
  */
 package tests.api.java.lang.ref;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.BrokenTest;
 import dalvik.annotation.SideEffect;
 
 import java.lang.ref.Reference;
@@ -28,7 +23,6 @@
 import java.lang.ref.SoftReference;
 import java.util.Vector;
 
-@TestTargetClass(SoftReference.class)
 public class SoftReferenceTest extends junit.framework.TestCase {
     static Boolean bool;
     SoftReference r;
@@ -38,15 +32,9 @@
     }
 
     /**
-     * @tests java.lang.ref.SoftReference#SoftReference(java.lang.Object,
+     * java.lang.ref.SoftReference#SoftReference(java.lang.Object,
      *        java.lang.ref.ReferenceQueue)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SoftReference",
-        args = {java.lang.Object.class, java.lang.ref.ReferenceQueue.class}
-    )
     public void test_ConstructorLjava_lang_ObjectLjava_lang_ref_ReferenceQueue() {
         ReferenceQueue rq = new ReferenceQueue();
         bool = new Boolean(true);
@@ -68,14 +56,8 @@
     }
 
     /**
-     * @tests java.lang.ref.SoftReference#SoftReference(java.lang.Object)
+     * java.lang.ref.SoftReference#SoftReference(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SoftReference",
-        args = {java.lang.Object.class}
-    )
     public void test_ConstructorLjava_lang_Object() {
         bool = new Boolean(true);
         try {
@@ -88,26 +70,14 @@
     }
 
     /**
-     * @tests java.lang.ref.SoftReference#get()
+     * java.lang.ref.SoftReference#get()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verified that get() can return null.",
-        method = "get",
-        args = {}
-    )
     public void test_get() {
         bool = new Boolean(false);
         SoftReference sr = new SoftReference(bool);
         assertTrue("Same object not returned.", bool == sr.get());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {}
-    )
     @SideEffect("Causes OutOfMemoryError to test finalization")
     public void test_get_SoftReference() {
 
diff --git a/luni/src/test/java/tests/api/java/lang/ref/WeakReferenceTest.java b/luni/src/test/java/tests/api/java/lang/ref/WeakReferenceTest.java
index bafa090..2bddc1b 100644
--- a/luni/src/test/java/tests/api/java/lang/ref/WeakReferenceTest.java
+++ b/luni/src/test/java/tests/api/java/lang/ref/WeakReferenceTest.java
@@ -17,15 +17,9 @@
 
 package tests.api.java.lang.ref;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.ref.ReferenceQueue;
 import java.lang.ref.WeakReference;
 
-@TestTargetClass(WeakReference.class)
 public class WeakReferenceTest extends junit.framework.TestCase {
     static Boolean bool;
 
@@ -34,15 +28,9 @@
     }
 
     /**
-     * @tests java.lang.ref.WeakReference#WeakReference(java.lang.Object,
+     * java.lang.ref.WeakReference#WeakReference(java.lang.Object,
      *        java.lang.ref.ReferenceQueue)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "WeakReference",
-        args = {java.lang.Object.class, java.lang.ref.ReferenceQueue.class}
-    )
     public void test_ConstructorLjava_lang_ObjectLjava_lang_ref_ReferenceQueue() {
         ReferenceQueue rq = new ReferenceQueue();
         bool = new Boolean(true);
@@ -67,14 +55,8 @@
     }
 
     /**
-     * @tests java.lang.ref.WeakReference#WeakReference(java.lang.Object)
+     * java.lang.ref.WeakReference#WeakReference(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "WeakReference",
-        args = {java.lang.Object.class}
-    )
     public void test_ConstructorLjava_lang_Object() {
         bool = new Boolean(true);
         try {
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/AccessibleObjectTest.java b/luni/src/test/java/tests/api/java/lang/reflect/AccessibleObjectTest.java
index 3a433c1..41c9798 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/AccessibleObjectTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/AccessibleObjectTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Inherited;
@@ -33,7 +28,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-@TestTargetClass(AccessibleObject.class)
 public class AccessibleObjectTest extends junit.framework.TestCase {
 
     public class TestClass {
@@ -86,27 +80,15 @@
     }
 
     /**
-     * @tests java.lang.reflect.AccessibleObject#AccessibleObject()
+     * java.lang.reflect.AccessibleObject#AccessibleObject()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "The only thing I can do",
-        method = "AccessibleObject",
-        args = {}
-    )
     public void test_Constructor() {
         assertNotNull(new MyAccessibleObject());
     }
 
     /**
-     * @tests java.lang.reflect.AccessibleObject#isAccessible()
+     * java.lang.reflect.AccessibleObject#isAccessible()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isAccessible",
-        args = {}
-    )
     public void test_isAccessible() {
         // Test for method boolean
         // java.lang.reflect.AccessibleObject.isAccessible()
@@ -122,15 +104,9 @@
     }
 
     /**
-     * @tests java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObject[],
+     * java.lang.reflect.AccessibleObject#setAccessible(java.lang.reflect.AccessibleObject[],
      *        boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SecurityExeption is tested in tests.security.permissions.JavaLangReflectAccessibleObjectTest",
-        method = "setAccessible",
-        args = {java.lang.reflect.AccessibleObject[].class, boolean.class}
-    )
     public void test_setAccessible$Ljava_lang_reflect_AccessibleObjectZ() {
         try {
             AccessibleObject ao = TestClass.class.getField("aField");
@@ -145,14 +121,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.AccessibleObject#setAccessible(boolean)
+     * java.lang.reflect.AccessibleObject#setAccessible(boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SecurityExeption is tested in tests.security.permissions.JavaLangReflectAccessibleObjectTest",
-        method = "setAccessible",
-        args = {boolean.class}
-    )
     public void test_setAccessible() throws Exception {
         AccessibleObject ao = TestClass.class.getField("aField");
         ao.setAccessible(true);
@@ -161,12 +131,6 @@
         assertFalse("Returned true to isAccessible", ao.isAccessible());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAnnotation",
-        args = {java.lang.Class.class}
-    )
     public void test_getAnnotation() throws Exception{
         AccessibleObject ao = SubTestClass.class.getMethod("annotatedMethod");
         //test error case
@@ -188,12 +152,6 @@
         assertNotNull("AnnotationRuntime0 instance expected", rt0);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAnnotations",
-        args = {}
-    )
      public void test_getAnnotations() throws Exception {
         AccessibleObject ao = SubTestClass.class.getMethod("annotatedMethod");
         Annotation[] annotations = ao.getAnnotations();
@@ -209,12 +167,6 @@
                 ignoreOrder.contains(AnnotationRuntime1.class));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaredAnnotations",
-        args = {}
-    )
      public void test_getDeclaredAnnotations() throws Exception {
         AccessibleObject ao = SubTestClass.class.getMethod("annotatedMethod");
         Annotation[] annotations = ao.getDeclaredAnnotations();
@@ -230,12 +182,6 @@
                 ignoreOrder.contains(AnnotationRuntime1.class));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isAnnotationPresent",
-        args = {java.lang.Class.class}
-    )
     public void test_isAnnotationPresent() throws Exception {
         AccessibleObject ao = SubTestClass.class.getMethod("annotatedMethod");
         assertTrue("Missing @AnnotationRuntime0",
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/AllTests.java b/luni/src/test/java/tests/api/java/lang/reflect/AllTests.java
deleted file mode 100644
index 9a5505f..0000000
--- a/luni/src/test/java/tests/api/java/lang/reflect/AllTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package tests.api.java.lang.reflect;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * TODO Type description
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Test for java.lang.reflect");
-
-        // $JUnit-BEGIN$
-        suite.addTestSuite(AccessibleObjectTest.class);
-        suite.addTestSuite(ArrayTest.class);
-        suite.addTestSuite(ConstructorTest.class);
-        suite.addTestSuite(FieldTest.class);
-        suite.addTestSuite(InvocationTargetExceptionTest.class);
-        suite.addTestSuite(MalformedParameterizedTypeExceptionTests.class);
-        suite.addTestSuite(UndeclaredThrowableExceptionTests.class);
-        suite.addTestSuite(MethodTest.class);
-        suite.addTestSuite(ModifierTest.class);
-        suite.addTestSuite(ProxyTest.class);
-        suite.addTestSuite(ReflectPermissionTest.class);
-        suite.addTestSuite(GenericArrayTypeTest.class);
-        suite.addTestSuite(TypeVariableTest.class);
-        suite.addTestSuite(ParameterizedTypeTest.class);
-        suite.addTestSuite(BoundedGenericMethodsTests.class);
-        suite.addTestSuite(GenericMethodsTests.class);
-        suite.addTestSuite(WildcardTypeTest.class);
-        suite.addTestSuite(GenericSignatureFormatErrorTest.class);
-        // $JUnit-END$
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/ArrayTest.java b/luni/src/test/java/tests/api/java/lang/reflect/ArrayTest.java
index 5d810e0..d9e05fb 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/ArrayTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/ArrayTest.java
@@ -17,25 +17,13 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.Array;
 
-@TestTargetClass(Array.class)
 public class ArrayTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.lang.reflect.Array#get(java.lang.Object, int)
+     * java.lang.reflect.Array#get(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getLjava_lang_ObjectI() {
         // Test for method java.lang.Object
         // java.lang.reflect.Array.get(java.lang.Object, int)
@@ -103,14 +91,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getBoolean(java.lang.Object, int)
+     * java.lang.reflect.Array#getBoolean(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getBoolean",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getBooleanLjava_lang_ObjectI() {
         // Test for method boolean
         // java.lang.reflect.Array.getBoolean(java.lang.Object, int)
@@ -155,14 +137,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getByte(java.lang.Object, int)
+     * java.lang.reflect.Array#getByte(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getByte",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getByteLjava_lang_ObjectI() {
         // Test for method byte
         // java.lang.reflect.Array.getByte(java.lang.Object, int)
@@ -207,14 +183,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getChar(java.lang.Object, int)
+     * java.lang.reflect.Array#getChar(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getChar",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getCharLjava_lang_ObjectI() {
         // Test for method char
         // java.lang.reflect.Array.getChar(java.lang.Object, int)
@@ -259,14 +229,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getDouble(java.lang.Object, int)
+     * java.lang.reflect.Array#getDouble(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDouble",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getDoubleLjava_lang_ObjectI() {
         // Test for method double
         // java.lang.reflect.Array.getDouble(java.lang.Object, int)
@@ -312,14 +276,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getFloat(java.lang.Object, int)
+     * java.lang.reflect.Array#getFloat(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFloat",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getFloatLjava_lang_ObjectI() {
         // Test for method float
         // java.lang.reflect.Array.getFloat(java.lang.Object, int)
@@ -364,14 +322,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getInt(java.lang.Object, int)
+     * java.lang.reflect.Array#getInt(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInt",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getIntLjava_lang_ObjectI() {
         // Test for method int java.lang.reflect.Array.getInt(java.lang.Object,
         // int)
@@ -416,14 +368,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getLength(java.lang.Object)
+     * java.lang.reflect.Array#getLength(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLength",
-        args = {java.lang.Object.class}
-    )
     public void test_getLengthLjava_lang_Object() {
         // Test for method int
         // java.lang.reflect.Array.getLength(java.lang.Object)
@@ -442,14 +388,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getLong(java.lang.Object, int)
+     * java.lang.reflect.Array#getLong(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLong",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getLongLjava_lang_ObjectI() {
         // Test for method long
         // java.lang.reflect.Array.getLong(java.lang.Object, int)
@@ -494,14 +434,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#getShort(java.lang.Object, int)
+     * java.lang.reflect.Array#getShort(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getShort",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_getShortLjava_lang_ObjectI() {
         // Test for method short
         // java.lang.reflect.Array.getShort(java.lang.Object, int)
@@ -546,14 +480,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#newInstance(java.lang.Class, int[])
+     * java.lang.reflect.Array#newInstance(java.lang.Class, int[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {java.lang.Class.class, int[].class}
-    )
     public void test_newInstanceLjava_lang_Class$I() {
         // Test for method java.lang.Object
         // java.lang.reflect.Array.newInstance(java.lang.Class, int [])
@@ -598,14 +526,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#newInstance(java.lang.Class, int)
+     * java.lang.reflect.Array#newInstance(java.lang.Class, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {java.lang.Class.class, int.class}
-    )
     public void test_newInstanceLjava_lang_ClassI() {
         // Test for method java.lang.Object
         // java.lang.reflect.Array.newInstance(java.lang.Class, int)
@@ -638,15 +560,9 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#set(java.lang.Object, int,
+     * java.lang.reflect.Array#set(java.lang.Object, int,
      *        java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {java.lang.Object.class, int.class, java.lang.Object.class}
-    )
     public void test_setLjava_lang_ObjectILjava_lang_Object() {
         // Test for method void java.lang.reflect.Array.set(java.lang.Object,
         // int, java.lang.Object)
@@ -702,14 +618,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setBoolean(java.lang.Object, int, boolean)
+     * java.lang.reflect.Array#setBoolean(java.lang.Object, int, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setBoolean",
-        args = {java.lang.Object.class, int.class, boolean.class}
-    )
     public void test_setBooleanLjava_lang_ObjectIZ() {
         // Test for method void
         // java.lang.reflect.Array.setBoolean(java.lang.Object, int, boolean)
@@ -754,14 +664,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setByte(java.lang.Object, int, byte)
+     * java.lang.reflect.Array#setByte(java.lang.Object, int, byte)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setByte",
-        args = {java.lang.Object.class, int.class, byte.class}
-    )
     public void test_setByteLjava_lang_ObjectIB() {
         // Test for method void
         // java.lang.reflect.Array.setByte(java.lang.Object, int, byte)
@@ -806,14 +710,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setChar(java.lang.Object, int, char)
+     * java.lang.reflect.Array#setChar(java.lang.Object, int, char)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setChar",
-        args = {java.lang.Object.class, int.class, char.class}
-    )
     public void test_setCharLjava_lang_ObjectIC() {
         // Test for method void
         // java.lang.reflect.Array.setChar(java.lang.Object, int, char)
@@ -858,14 +756,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setDouble(java.lang.Object, int, double)
+     * java.lang.reflect.Array#setDouble(java.lang.Object, int, double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDouble",
-        args = {java.lang.Object.class, int.class, double.class}
-    )
     public void test_setDoubleLjava_lang_ObjectID() {
         // Test for method void
         // java.lang.reflect.Array.setDouble(java.lang.Object, int, double)
@@ -910,14 +802,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setFloat(java.lang.Object, int, float)
+     * java.lang.reflect.Array#setFloat(java.lang.Object, int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setFloat",
-        args = {java.lang.Object.class, int.class, float.class}
-    )
     public void test_setFloatLjava_lang_ObjectIF() {
         // Test for method void
         // java.lang.reflect.Array.setFloat(java.lang.Object, int, float)
@@ -962,14 +848,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setInt(java.lang.Object, int, int)
+     * java.lang.reflect.Array#setInt(java.lang.Object, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setInt",
-        args = {java.lang.Object.class, int.class, int.class}
-    )
     public void test_setIntLjava_lang_ObjectII() {
         // Test for method void java.lang.reflect.Array.setInt(java.lang.Object,
         // int, int)
@@ -1014,14 +894,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setLong(java.lang.Object, int, long)
+     * java.lang.reflect.Array#setLong(java.lang.Object, int, long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setLong",
-        args = {java.lang.Object.class, int.class, long.class}
-    )
     public void test_setLongLjava_lang_ObjectIJ() {
         // Test for method void
         // java.lang.reflect.Array.setLong(java.lang.Object, int, long)
@@ -1066,14 +940,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Array#setShort(java.lang.Object, int, short)
+     * java.lang.reflect.Array#setShort(java.lang.Object, int, short)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setShort",
-        args = {java.lang.Object.class, int.class, short.class}
-    )
     public void test_setShortLjava_lang_ObjectIS() {
         // Test for method void
         // java.lang.reflect.Array.setShort(java.lang.Object, int, short)
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/BoundedGenericMethodsTests.java b/luni/src/test/java/tests/api/java/lang/reflect/BoundedGenericMethodsTests.java
index 9e9bfa3..7949a30 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/BoundedGenericMethodsTests.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/BoundedGenericMethodsTests.java
@@ -16,11 +16,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
@@ -28,7 +23,6 @@
 /**
  * Tests bounded type parameters declared on methods.
  */
-@TestTargetClass(Method.class)
 public class BoundedGenericMethodsTests extends GenericReflectionTestsBase {
     @SuppressWarnings("unchecked")
     static class BoundedGenericMethods<S> {
@@ -107,54 +101,24 @@
     /**
      * Tests that there are is one Type Parameter on the Class itself.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check GenericSignatureFormatError.",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testBoundedGenericMethods() {
         assertLenghtOne(clazz.getTypeParameters());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check GenericSignatureFormatError.",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testNoParamNoReturn() throws SecurityException, NoSuchMethodException {
         Method method = clazz.getMethod("noParamNoReturn");
         checkBoundedTypeParameter(method);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check GenericSignatureFormatError.",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testUnboundedParamNoReturn() throws SecurityException, NoSuchMethodException {
         Method method = clazz.getMethod("paramNoReturn", BoundedGenericMethods.class);
         checkBoundedTypeParameter(method);
         parameterType(method);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check GenericSignatureFormatError.",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testNoParamReturn() throws SecurityException, NoSuchMethodException {
         Method method = clazz.getMethod("noParamReturn");
         checkBoundedTypeParameter(method);
         assertLenghtZero(method.getGenericParameterTypes());
         checkReturnType(method);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check GenericSignatureFormatError.",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testUnboundedParamReturn() throws SecurityException, NoSuchMethodException {
         Method method = clazz.getMethod("paramReturn", BoundedGenericMethods.class);
         checkBoundedTypeParameter(method);
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/ConstructorTest.java b/luni/src/test/java/tests/api/java/lang/reflect/ConstructorTest.java
index 35cb92d..932315c 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/ConstructorTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/ConstructorTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.annotation.Annotation;
 import java.lang.annotation.ElementType;
 import java.lang.annotation.Retention;
@@ -34,17 +30,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-@TestTargetClass(
-        value = Constructor.class,
-        untestedMethods = {
-            @TestTargetNew(
-               level = TestLevel.NOT_FEASIBLE,
-               method = "isSynthetic",
-               args = {},
-               notes =  "Since code which relies on synthetic members is not " +
-               "portable, this should not be tested"
-            )
-        })
 public class ConstructorTest extends junit.framework.TestCase {
 
 
@@ -118,15 +103,6 @@
 //        }
 //    }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getDeclaredAnnotations()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameterAnnotations",
-        args = {}
-    )
     public void test_getParameterAnnotations() throws Exception {
         Constructor<ConstructorTestHelper> ctor1 = ConstructorTestHelper.class
                 .getConstructor(Object.class);
@@ -147,15 +123,6 @@
     }
 
 
-    /**
-     * @tests java.lang.reflect.Constructor#getDeclaredAnnotations()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaredAnnotations",
-        args = {}
-    )
     public void test_getDeclaredAnnotations() throws Exception {
         Constructor<ConstructorTestHelper> ctor1 = null;
         ctor1 = ConstructorTestHelper.class.getConstructor(new Class[0]);
@@ -172,15 +139,6 @@
                 .contains(ConstructorTestAnnotationRuntime1.class));
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#isVarargs()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isVarArgs",
-        args = {}
-    )
     public void test_isVarArgs() throws Exception {
         Constructor<ConstructorTestHelper> varArgCtor = ConstructorTestHelper.class
                 .getConstructor(String[].class);
@@ -192,15 +150,6 @@
                 nonVarArgCtor.isVarArgs());
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#hashCode()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
         Constructor<ConstructorTestHelper> constructor = ConstructorTestHelper.class
                 .getConstructor();
@@ -210,16 +159,7 @@
                         .hashCode());
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#toGenericString()
-     */
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toGenericString",
-        args = {}
-    )
     public void test_toGenericString() throws Exception {
         Constructor<GenericConstructorTestHelper> genericCtor = GenericConstructorTestHelper.class
                 .getConstructor(Object.class, Object.class);
@@ -235,15 +175,6 @@
                 ctor.toGenericString());
     }
 
- /**
-     * @tests java.lang.reflect.Constructor#equals(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         Constructor<ConstructorTestHelper> ctor1 = null, ctor2 = null;
         try {
@@ -256,15 +187,6 @@
         assertTrue("Different Contructors returned equal", !ctor1.equals(ctor2));
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getDeclaringClass()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaringClass",
-        args = {}
-    )
     public void test_getDeclaringClass() {
         boolean val = false;
         try {
@@ -277,15 +199,6 @@
         assertTrue("Returned incorrect declaring class", val);
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getExceptionTypes()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getExceptionTypes",
-        args = {}
-    )
     public void test_getExceptionTypes() {
         // Test for method java.lang.Class []
         // java.lang.reflect.Constructor.getExceptionTypes()
@@ -304,15 +217,6 @@
         assertTrue("Returned incorrect exception", exceptions[0].equals(ex));
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getModifiers()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModifiers",
-        args = {}
-    )
     public void test_getModifiers() {
         // Test for method int java.lang.reflect.Constructor.getModifiers()
         int mod = 0;
@@ -350,15 +254,6 @@
         }
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getName()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() {
         // Test for method java.lang.String
         // java.lang.reflect.Constructor.getName()
@@ -376,15 +271,6 @@
         }
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getParameterTypes()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameterTypes",
-        args = {}
-    )
     public void test_getParameterTypes() {
         // Test for method java.lang.Class []
         // java.lang.reflect.Constructor.getParameterTypes()
@@ -413,15 +299,6 @@
         assertTrue("Incorrect parameter returned", types[0].equals(parms[0]));
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getGenericParameterTypes()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getGenericParameterTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void test_getGenericParameterTypes() {
         Type[] types = null;
@@ -463,15 +340,6 @@
                 ((TypeVariable)types[1]).getName());
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getGenericParameterTypes()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getGenericExceptionTypes",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public void test_getGenericExceptionTypes() {
         Type[] types = null;
@@ -504,16 +372,6 @@
     }
 
 
-
-    /**
-     * @tests java.lang.reflect.Constructor#newInstance(java.lang.Object[])
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {java.lang.Object[].class}
-    )
     public void test_newInstance$Ljava_lang_Object() {
         // Test for method java.lang.Object
         // java.lang.reflect.Constructor.newInstance(java.lang.Object [])
@@ -529,15 +387,6 @@
         assertEquals("improper instance created", 99, test.check());
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#toString()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String
         // java.lang.reflect.Constructor.toString()
@@ -559,15 +408,6 @@
                                 "public tests.api.java.lang.reflect.ConstructorTest$ConstructorTestHelper(java.lang.Object)"));
     }
 
-    /**
-     * @tests java.lang.reflect.Constructor#getConstructor((Class[]) null)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getConstructor",
-        args = {}
-    )
     public void test_getConstructor() throws Exception {
         // Passing new Class[0] should be equivalent to (Class[]) null.
         Class<ConstructorTestHelper> c2 = ConstructorTestHelper.class;
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/FieldTest.java b/luni/src/test/java/tests/api/java/lang/reflect/FieldTest.java
index 7f38a41..a1ca151 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/FieldTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/FieldTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 import tests.support.Support_Field;
 
 import java.lang.annotation.Annotation;
@@ -36,7 +32,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-@TestTargetClass(Field.class)
 public class FieldTest extends junit.framework.TestCase {
 
     // BEGIN android-note
@@ -159,14 +154,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#equals(java.lang.Object)
+     * java.lang.reflect.Field#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean
         // java.lang.reflect.Field.equals(java.lang.Object)
@@ -189,14 +178,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#get(java.lang.Object)
+     * java.lang.reflect.Field#get(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_getLjava_lang_Object() throws Throwable {
         // Test for method java.lang.Object
         // java.lang.reflect.Field.get(java.lang.Object)
@@ -367,129 +350,25 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#get(java.lang.Object)
-     * @tests java.lang.reflect.Field#getByte(java.lang.Object)
-     * @tests java.lang.reflect.Field#getBoolean(java.lang.Object)
-     * @tests java.lang.reflect.Field#getShort(java.lang.Object)
-     * @tests java.lang.reflect.Field#getInt(java.lang.Object)
-     * @tests java.lang.reflect.Field#getLong(java.lang.Object)
-     * @tests java.lang.reflect.Field#getFloat(java.lang.Object)
-     * @tests java.lang.reflect.Field#getDouble(java.lang.Object)
-     * @tests java.lang.reflect.Field#getChar(java.lang.Object)
-     * @tests java.lang.reflect.Field#set(java.lang.Object, java.lang.Object)
-     * @tests java.lang.reflect.Field#setByte(java.lang.Object, byte)
-     * @tests java.lang.reflect.Field#setBoolean(java.lang.Object, boolean)
-     * @tests java.lang.reflect.Field#setShort(java.lang.Object, short)
-     * @tests java.lang.reflect.Field#setInt(java.lang.Object, int)
-     * @tests java.lang.reflect.Field#setLong(java.lang.Object, long)
-     * @tests java.lang.reflect.Field#setFloat(java.lang.Object, float)
-     * @tests java.lang.reflect.Field#setDouble(java.lang.Object, double)
-     * @tests java.lang.reflect.Field#setChar(java.lang.Object, char)
+     * java.lang.reflect.Field#get(java.lang.Object)
+     * java.lang.reflect.Field#getByte(java.lang.Object)
+     * java.lang.reflect.Field#getBoolean(java.lang.Object)
+     * java.lang.reflect.Field#getShort(java.lang.Object)
+     * java.lang.reflect.Field#getInt(java.lang.Object)
+     * java.lang.reflect.Field#getLong(java.lang.Object)
+     * java.lang.reflect.Field#getFloat(java.lang.Object)
+     * java.lang.reflect.Field#getDouble(java.lang.Object)
+     * java.lang.reflect.Field#getChar(java.lang.Object)
+     * java.lang.reflect.Field#set(java.lang.Object, java.lang.Object)
+     * java.lang.reflect.Field#setByte(java.lang.Object, byte)
+     * java.lang.reflect.Field#setBoolean(java.lang.Object, boolean)
+     * java.lang.reflect.Field#setShort(java.lang.Object, short)
+     * java.lang.reflect.Field#setInt(java.lang.Object, int)
+     * java.lang.reflect.Field#setLong(java.lang.Object, long)
+     * java.lang.reflect.Field#setFloat(java.lang.Object, float)
+     * java.lang.reflect.Field#setDouble(java.lang.Object, double)
+     * java.lang.reflect.Field#setChar(java.lang.Object, char)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "get",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getByte",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getBoolean",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getShort",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getInt",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getFloat",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getDouble",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "getChar",
-            args = {java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "set",
-            args = {java.lang.Object.class, java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setBoolean",
-            args = {java.lang.Object.class, boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setByte",
-            args = {java.lang.Object.class, byte.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setShort",
-            args = {java.lang.Object.class, short.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setInt",
-            args = {java.lang.Object.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setLong",
-            args = {java.lang.Object.class, long.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setFloat",
-            args = {java.lang.Object.class, float.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setDouble",
-            args = {java.lang.Object.class, double.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Stress test.",
-            method = "setChar",
-            args = {java.lang.Object.class, char.class}
-        )
-    })
     public void testProtectedFieldAccess() {
         Class fieldClass = new Support_Field().getClass();
         String fieldName = null;
@@ -690,14 +569,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getBoolean(java.lang.Object)
+     * java.lang.reflect.Field#getBoolean(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getBoolean",
-        args = {java.lang.Object.class}
-    )
     public void test_getBooleanLjava_lang_Object() {
         TestField x = new TestField();
         Field f = null;
@@ -761,14 +634,8 @@
 
 
     /**
-     * @tests java.lang.reflect.Field#getByte(java.lang.Object)
+     * java.lang.reflect.Field#getByte(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getByte",
-        args = {java.lang.Object.class}
-    )
     public void test_getByteLjava_lang_Object() {
         // Test for method byte
         // java.lang.reflect.Field.getByte(java.lang.Object)
@@ -833,14 +700,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getChar(java.lang.Object)
+     * java.lang.reflect.Field#getChar(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getChar",
-        args = {java.lang.Object.class}
-    )
     public void test_getCharLjava_lang_Object() {
         // Test for method char
         // java.lang.reflect.Field.getChar(java.lang.Object)
@@ -905,14 +766,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getDeclaringClass()
+     * java.lang.reflect.Field#getDeclaringClass()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaringClass",
-        args = {}
-    )
     public void test_getDeclaringClass() {
         // Test for method java.lang.Class
         // java.lang.reflect.Field.getDeclaringClass()
@@ -934,14 +789,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getDouble(java.lang.Object)
+     * java.lang.reflect.Field#getDouble(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDouble",
-        args = {java.lang.Object.class}
-    )
     public void test_getDoubleLjava_lang_Object() {
         // Test for method double
         // java.lang.reflect.Field.getDouble(java.lang.Object)
@@ -1008,14 +857,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getFloat(java.lang.Object)
+     * java.lang.reflect.Field#getFloat(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFloat",
-        args = {java.lang.Object.class}
-    )
     public void test_getFloatLjava_lang_Object() {
         // Test for method float
         // java.lang.reflect.Field.getFloat(java.lang.Object)
@@ -1082,14 +925,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getInt(java.lang.Object)
+     * java.lang.reflect.Field#getInt(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInt",
-        args = {java.lang.Object.class}
-    )
     public void test_getIntLjava_lang_Object() {
         // Test for method int java.lang.reflect.Field.getInt(java.lang.Object)
         TestField x = new TestField();
@@ -1156,14 +993,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getLong(java.lang.Object)
+     * java.lang.reflect.Field#getLong(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLong",
-        args = {java.lang.Object.class}
-    )
     public void test_getLongLjava_lang_Object() {
         // Test for method long
         // java.lang.reflect.Field.getLong(java.lang.Object)
@@ -1228,14 +1059,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getModifiers()
+     * java.lang.reflect.Field#getModifiers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModifiers",
-        args = {}
-    )
     public void test_getModifiers() {
         // Test for method int java.lang.reflect.Field.getModifiers()
         TestField x = new TestField();
@@ -1254,14 +1079,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getName()
+     * java.lang.reflect.Field#getName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() {
         // Test for method java.lang.String java.lang.reflect.Field.getName()
         TestField x = new TestField();
@@ -1276,14 +1095,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getShort(java.lang.Object)
+     * java.lang.reflect.Field#getShort(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getShort",
-        args = {java.lang.Object.class}
-    )
     public void test_getShortLjava_lang_Object() {
         // Test for method short
         // java.lang.reflect.Field.getShort(java.lang.Object)
@@ -1351,14 +1164,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#getType()
+     * java.lang.reflect.Field#getType()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getType",
-        args = {}
-    )
     public void test_getType() {
         // Test for method java.lang.Class java.lang.reflect.Field.getType()
         TestField x = new TestField();
@@ -1373,14 +1180,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#set(java.lang.Object, java.lang.Object)
+     * java.lang.reflect.Field#set(java.lang.Object, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_setLjava_lang_ObjectLjava_lang_Object() throws Exception{
         // Test for method void java.lang.reflect.Field.set(java.lang.Object,
         // java.lang.Object)
@@ -1440,14 +1241,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setBoolean(java.lang.Object, boolean)
+     * java.lang.reflect.Field#setBoolean(java.lang.Object, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setBoolean",
-        args = {java.lang.Object.class, boolean.class}
-    )
     public void test_setBooleanLjava_lang_ObjectZ() throws Exception{
         // Test for method void
         // java.lang.reflect.Field.setBoolean(java.lang.Object, boolean)
@@ -1507,14 +1302,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setByte(java.lang.Object, byte)
+     * java.lang.reflect.Field#setByte(java.lang.Object, byte)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setByte",
-        args = {java.lang.Object.class, byte.class}
-    )
     public void test_setByteLjava_lang_ObjectB() throws Exception{
         // Test for method void
         // java.lang.reflect.Field.setByte(java.lang.Object, byte)
@@ -1575,14 +1364,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setChar(java.lang.Object, char)
+     * java.lang.reflect.Field#setChar(java.lang.Object, char)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setChar",
-        args = {java.lang.Object.class, char.class}
-    )
     public void test_setCharLjava_lang_ObjectC() throws Exception{
         // Test for method void
         // java.lang.reflect.Field.setChar(java.lang.Object, char)
@@ -1643,14 +1426,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setDouble(java.lang.Object, double)
+     * java.lang.reflect.Field#setDouble(java.lang.Object, double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDouble",
-        args = {java.lang.Object.class, double.class}
-    )
     public void test_setDoubleLjava_lang_ObjectD() throws Exception{
         // Test for method void
         // java.lang.reflect.Field.setDouble(java.lang.Object, double)
@@ -1712,14 +1489,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setFloat(java.lang.Object, float)
+     * java.lang.reflect.Field#setFloat(java.lang.Object, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setFloat",
-        args = {java.lang.Object.class, float.class}
-    )
     public void test_setFloatLjava_lang_ObjectF() throws Exception{
         // Test for method void
         // java.lang.reflect.Field.setFloat(java.lang.Object, float)
@@ -1781,14 +1552,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setInt(java.lang.Object, int)
+     * java.lang.reflect.Field#setInt(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setInt",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_setIntLjava_lang_ObjectI() throws Exception{
         // Test for method void java.lang.reflect.Field.setInt(java.lang.Object,
         // int)
@@ -1850,14 +1615,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setLong(java.lang.Object, long)
+     * java.lang.reflect.Field#setLong(java.lang.Object, long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setLong",
-        args = {java.lang.Object.class, long.class}
-    )
     public void test_setLongLjava_lang_ObjectJ() throws Exception{
         // Test for method void
         // java.lang.reflect.Field.setLong(java.lang.Object, long)
@@ -1918,14 +1677,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#setShort(java.lang.Object, short)
+     * java.lang.reflect.Field#setShort(java.lang.Object, short)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setShort",
-        args = {java.lang.Object.class, short.class}
-    )
     public void test_setShortLjava_lang_ObjectS() throws Exception{
         // Test for method void
         // java.lang.reflect.Field.setShort(java.lang.Object, short)
@@ -1987,14 +1740,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Field#toString()
+     * java.lang.reflect.Field#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.lang.reflect.Field.toString()
         Field f = null;
@@ -2009,12 +1756,6 @@
                         f.toString());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaredAnnotations",
-        args = {}
-    )
     public void test_getDeclaredAnnotations() throws Exception {
         Field field = TestClass.class.getField("annotatedField");
         Annotation[] annotations = field.getDeclaredAnnotations();
@@ -2030,12 +1771,6 @@
                 .contains(AnnotationRuntime1.class));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEnumConstant",
-        args = {}
-    )
     public void test_isEnumConstant() throws Exception {
         Field field = TestEnum.class.getDeclaredField("A");
         assertTrue("Enum constant not recognized", field.isEnumConstant());
@@ -2049,12 +1784,6 @@
                 .isEnumConstant());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isSynthetic",
-        args = {}
-    )
     public void test_isSynthetic() throws Exception {
         Field[] fields = TestClass.Inner.class.getDeclaredFields();
         assertEquals("Not exactly one field returned", 1, fields.length);
@@ -2071,12 +1800,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getGenericType",
-        args = {}
-    )
     public void test_getGenericType() throws Exception {
         Field field = GenericField.class.getDeclaredField("field");
         Type type = field.getGenericType();
@@ -2096,12 +1819,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toGenericString",
-        args = {}
-    )
     public void test_toGenericString() throws Exception {
         Field field = GenericField.class.getDeclaredField("field");
         assertEquals("Wrong generic string returned",
@@ -2123,12 +1840,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
         Field field = TestClass.class.getDeclaredField("annotatedField");
         assertEquals("Wrong hashCode returned", field.getName().hashCode()
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/GenericArrayTypeTest.java b/luni/src/test/java/tests/api/java/lang/reflect/GenericArrayTypeTest.java
index b1751e0..e48e584 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/GenericArrayTypeTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/GenericArrayTypeTest.java
@@ -16,11 +16,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.Field;
 import java.lang.reflect.GenericArrayType;
 import java.lang.reflect.ParameterizedType;
@@ -30,18 +25,11 @@
 /**
  * Tests generic reflection on arrays with generic or parameterized component types.
  */
-@TestTargetClass(GenericArrayType.class)
 public class GenericArrayTypeTest extends GenericReflectionTestsBase {
 
     static class A<T> {
         T[] array;
     }
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for TypeNotPresentException, MalformedParameterizedTypeException",
-        method = "getGenericComponentType",
-        args = {}
-    )
     public void testGetGenericComponentType() throws Exception {
         @SuppressWarnings("unchecked")
         Class<? extends A> clazz = GenericArrayTypeTest.A.class;
@@ -59,12 +47,6 @@
     static class B<T> {
         B<T>[] array;
     }
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for TypeNotPresentException, MalformedParameterizedTypeException",
-        method = "getGenericComponentType",
-        args = {}
-    )
     public void testParameterizedComponentType() throws Exception {
         @SuppressWarnings("unchecked")
         Class<? extends B> clazz = GenericArrayTypeTest.B.class;
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/GenericMethodsTests.java b/luni/src/test/java/tests/api/java/lang/reflect/GenericMethodsTests.java
index cd75eef..0bfc188 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/GenericMethodsTests.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/GenericMethodsTests.java
@@ -17,11 +17,6 @@
 package tests.api.java.lang.reflect;
 
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.Method;
 import java.lang.reflect.Type;
 import java.lang.reflect.TypeVariable;
@@ -30,7 +25,6 @@
 /**
  * Tests unbounded type parameters declared on methods.
  */
-@TestTargetClass(Method.class)
 public class GenericMethodsTests extends GenericReflectionTestsBase{
 
     static class GenericMethods {
@@ -50,12 +44,6 @@
     /**
      * Tests that there are no Type Parameters on the Class itself.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testGenericMethods() {
         assertLenghtZero(clazz.getTypeParameters());
     }
@@ -95,95 +83,29 @@
         assertInstanceOf(TypeVariable.class, genericReturnType);
         assertEquals(method, ((TypeVariable<?>) genericReturnType).getGenericDeclaration());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testNoParamNoReturn() throws Exception {
         Method method = clazz.getMethod("noParamNoReturn");
         checkTypeParameter(method);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getTypeParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getGenericParameterTypes",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getParameterTypes",
-            args = {}
-        )
-    })
     public void testParamNoReturn() throws Exception {
         Method method = clazz.getMethod("paramNoReturn", Object.class);
         checkTypeParameter(method);
         checkParameterType(method);
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getGenericParameterTypes",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getGenericReturnType",
-            args = {}
-        )
-    })
     public void testNoParamReturn() throws Exception {
         Method method = clazz.getMethod("noParamReturn");
         checkTypeParameter(method);
         assertLenghtZero(method.getGenericParameterTypes());
         checkReturnType(method);
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getTypeParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getParameterTypes",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getGenericReturnType",
-            args = {}
-        )
-    })
     public void testParamReturn() throws Exception {
         Method method = clazz.getMethod("paramReturn", Object.class);
         checkTypeParameter(method);
         checkParameterType(method);
         checkReturnType(method);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "getTypeParameters",
-        args = {}
-    )
     public void testIndependencyOfMethodTypeParameters() throws Exception {
         Method method0 = clazz.getMethod("paramNoReturn", Object.class);
         TypeVariable<Method> typeParameter0 = method0.getTypeParameters()[0];
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/GenericSignatureFormatErrorTest.java b/luni/src/test/java/tests/api/java/lang/reflect/GenericSignatureFormatErrorTest.java
index 53a005c..954073c 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/GenericSignatureFormatErrorTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/GenericSignatureFormatErrorTest.java
@@ -2,9 +2,6 @@
 
 import dalvik.annotation.AndroidOnly;
 import dalvik.annotation.SideEffect;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import dalvik.system.DexFile;
 
 import junit.framework.TestCase;
@@ -19,25 +16,12 @@
 
 import tests.support.Support_ClassLoader;
 
-@TestTargetClass(GenericSignatureFormatError.class)
 public class GenericSignatureFormatErrorTest extends TestCase{
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GenericSignatureFormatError",
-        args = {}
-    )
     public void test_Constructor() {
         assertNotNull(new GenericSignatureFormatError());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GenericSignatureFormatError",
-        args = {}
-    )
     public void test_readResource() throws Exception {
         File tf = File.createTempFile("classes", ".dex");
         // System.out.println("GenericSignatureFormatErrorTest:"
@@ -48,12 +32,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "GenericSignatureFormatError",
-        args = {}
-    )
     @AndroidOnly("Uses Android specific class dalvik.system.DexFile " +
             "for loading classes.")
     @SideEffect("strange issue (exception: 'could not open dex file', " +
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/InvocationTargetExceptionTest.java b/luni/src/test/java/tests/api/java/lang/reflect/InvocationTargetExceptionTest.java
index 057083d..5e699a9 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/InvocationTargetExceptionTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/InvocationTargetExceptionTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.io.ByteArrayOutputStream;
 import java.io.CharArrayWriter;
 import java.io.PrintStream;
@@ -31,7 +26,6 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 
-@TestTargetClass(InvocationTargetException.class)
 public class InvocationTargetExceptionTest extends junit.framework.TestCase {
 
     static class TestMethod {
@@ -118,14 +112,8 @@
     class SubInvocationTargetException extends InvocationTargetException {}
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#InvocationTargetException()
+     * java.lang.reflect.InvocationTargetException#InvocationTargetException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvocationTargetException",
-        args = {}
-    )
     public void test_Constructor() throws Exception {
         Constructor<InvocationTargetException> ctor = InvocationTargetException.class
                 .getDeclaredConstructor();
@@ -137,14 +125,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#InvocationTargetException(java.lang.Throwable)
+     * java.lang.reflect.InvocationTargetException#InvocationTargetException(java.lang.Throwable)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvocationTargetException",
-        args = {java.lang.Throwable.class}
-    )
     public void test_ConstructorLjava_lang_Throwable() {
         // Test for method
         // java.lang.reflect.InvocationTargetException(java.lang.Throwable)
@@ -163,15 +145,9 @@
     }
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#InvocationTargetException(java.lang.Throwable,
+     * java.lang.reflect.InvocationTargetException#InvocationTargetException(java.lang.Throwable,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvocationTargetException",
-        args = {java.lang.Throwable.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_ThrowableLjava_lang_String() {
         // Test for method
         // java.lang.reflect.InvocationTargetException(java.lang.Throwable,
@@ -192,14 +168,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#getTargetException()
+     * java.lang.reflect.InvocationTargetException#getTargetException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTargetException",
-        args = {}
-    )
     public void test_getTargetException() {
         // Test for method java.lang.Throwable
         // java.lang.reflect.InvocationTargetException.getTargetException()
@@ -220,14 +190,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#getCause()
+     * java.lang.reflect.InvocationTargetException#getCause()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCause",
-        args = {}
-    )
     public void test_getCause() {
         // java.lang.reflect.InvocationTargetException.getCause()
         try {
@@ -248,14 +212,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#printStackTrace()
+     * java.lang.reflect.InvocationTargetException#printStackTrace()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "printStackTrace",
-        args = {}
-    )
     public void test_printStackTrace() {
         // Test for method void
         // java.lang.reflect.InvocationTargetException.printStackTrace()
@@ -278,14 +236,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#printStackTrace(java.io.PrintStream)
+     * java.lang.reflect.InvocationTargetException#printStackTrace(java.io.PrintStream)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "printStackTrace",
-        args = {java.io.PrintStream.class}
-    )
     public void test_printStackTraceLjava_io_PrintStream() {
         // Test for method void
         // java.lang.reflect.InvocationTargetException.printStackTrace(java.io.PrintStream)
@@ -301,14 +253,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.InvocationTargetException#printStackTrace(java.io.PrintWriter)
+     * java.lang.reflect.InvocationTargetException#printStackTrace(java.io.PrintWriter)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "printStackTrace",
-        args = {java.io.PrintWriter.class}
-    )
     public void test_printStackTraceLjava_io_PrintWriter() {
         // Test for method void
         // java.lang.reflect.InvocationTargetException.printStackTrace(java.io.PrintWriter)
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/MalformedParameterizedTypeExceptionTests.java b/luni/src/test/java/tests/api/java/lang/reflect/MalformedParameterizedTypeExceptionTests.java
index 4a05c07..f86403d 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/MalformedParameterizedTypeExceptionTests.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/MalformedParameterizedTypeExceptionTests.java
@@ -1,26 +1,14 @@
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.Constructor;
 import java.lang.reflect.MalformedParameterizedTypeException;
 import java.lang.reflect.Modifier;
 
-@TestTargetClass(MalformedParameterizedTypeException.class)
 public class MalformedParameterizedTypeExceptionTests  extends junit.framework.TestCase {
 
     /**
-     * @tests java.lang.reflect.MalformedParameterizedTypeException#MalformedParameterizedTypeException()
+     * java.lang.reflect.MalformedParameterizedTypeException#MalformedParameterizedTypeException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Since this constructor is never invoked, this test only verifies its existence.",
-        method = "MalformedParameterizedTypeException",
-        args = {}
-    )
     public void test_Constructor() throws Exception {
         Constructor<MalformedParameterizedTypeException> ctor = MalformedParameterizedTypeException.class
                 .getDeclaredConstructor();
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/MethodTest.java b/luni/src/test/java/tests/api/java/lang/reflect/MethodTest.java
index 8e1bf82..e8288d6 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/MethodTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/MethodTest.java
@@ -30,11 +30,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-@TestTargetClass(Method.class)
 public class MethodTest extends junit.framework.TestCase {
 
     static class TestMethod {
@@ -195,14 +190,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#equals(java.lang.Object)
+     * java.lang.reflect.Method#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean
         // java.lang.reflect.Method.equals(java.lang.Object)
@@ -228,15 +217,8 @@
     }
 
     /**
-     * @tests java.lang.Class#getMethod(java.lang.String, java.lang.Class[])
+     * java.lang.Class#getMethod(java.lang.String, java.lang.Class[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMethod",
-        args = {java.lang.String.class, java.lang.Class[].class},
-        clazz = java.lang.Class.class
-    )
     public void test_getMethod() throws NoSuchMethodException, SecurityException {
         // Check that getMethod treats null parameterTypes the same as an empty array.
         Method m1 = TestMethod.class.getMethod("invokeInstanceTest", new Class[0]);
@@ -245,15 +227,8 @@
     }
 
     /**
-     * @tests java.lang.Class#getDeclaredMethod(java.lang.String, java.lang.Class[])
+     * java.lang.Class#getDeclaredMethod(java.lang.String, java.lang.Class[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaredMethod",
-        args = {java.lang.String.class, java.lang.Class[].class},
-        clazz = java.lang.Class.class
-    )
     public void test_getDeclaredMethod() throws NoSuchMethodException, SecurityException {
         // Check that getDeclaredMethod treats null parameterTypes the same as an empty array.
         Method m1 = TestMethod.class.getDeclaredMethod("invokeInstanceTest", new Class[0]);
@@ -262,14 +237,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getDeclaringClass()
+     * java.lang.reflect.Method#getDeclaringClass()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaringClass",
-        args = {}
-    )
     public void test_getDeclaringClass() {
         // Test for method java.lang.Class
         // java.lang.reflect.Method.getDeclaringClass()
@@ -288,14 +257,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getExceptionTypes()
+     * java.lang.reflect.Method#getExceptionTypes()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getExceptionTypes",
-        args = {}
-    )
     public void test_getExceptionTypes() {
         // Test for method java.lang.Class []
         // java.lang.reflect.Method.getExceptionTypes()
@@ -318,14 +281,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getModifiers()
+     * java.lang.reflect.Method#getModifiers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModifiers",
-        args = {}
-    )
     public void test_getModifiers() {
         // Test for method int java.lang.reflect.Method.getModifiers()
 
@@ -378,14 +335,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getName()
+     * java.lang.reflect.Method#getName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() {
         // Test for method java.lang.String java.lang.reflect.Method.getName()
         Method mth = null;
@@ -399,14 +350,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#isVarArgs()
+     * java.lang.reflect.Method#isVarArgs()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isVarArgs",
-        args = {}
-    )
     public void test_isVarArgs() throws Exception {
         Method mth = TestMethod.class.getMethod("publicVoidVarargs",
                 Object[].class);
@@ -418,14 +363,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#isBridge()
+     * java.lang.reflect.Method#isBridge()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isBridge",
-        args = {}
-    )
     public void test_isBridge() throws Exception {
         Method[] declaredMethods = BrigeTest.class.getDeclaredMethods();
         assertEquals("Bridge method not generated.", 2, declaredMethods.length);
@@ -441,14 +380,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#isSynthetic()
+     * java.lang.reflect.Method#isSynthetic()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isSynthetic",
-        args = {}
-    )
     public void test_isSynthetic() throws Exception {
         Method[] declaredMethods = BrigeTest.class.getDeclaredMethods();
         assertEquals("Synthetic method not generated.", 2,
@@ -464,14 +397,8 @@
         assertTrue("Synthetic method not found.", foundSyntheticMethod);
     }
     /**
-     * @tests java.lang.reflect.Method#getParameterAnnotations()
+     * java.lang.reflect.Method#getParameterAnnotations()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameterAnnotations",
-        args = {}
-    )
     public void test_getParameterAnnotations() throws Exception {
         Method method = TestMethod.class.getDeclaredMethod(
                 "annotatedParameter", new Class[] {
@@ -502,14 +429,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getDeclaredAnnotations()
+     * java.lang.reflect.Method#getDeclaredAnnotations()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDeclaredAnnotations",
-        args = {}
-    )
     public void test_getDeclaredAnnotations() throws Exception {
         Method method = TestMethod.class.getDeclaredMethod("annotatedMethod");
         Annotation[] declaredAnnotations = method.getDeclaredAnnotations();
@@ -525,14 +446,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getDefaultValue()
+     * java.lang.reflect.Method#getDefaultValue()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for TypeNotPresentException",
-        method = "getDefaultValue",
-        args = {}
-    )
     public void test_getDefaultValue() throws Exception {
         Method method = TestAnno.class.getDeclaredMethod("value");
         assertEquals("Wrong default value returned", TestAnno.DEFAULT_VALUE,
@@ -540,14 +455,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getDefaultValue()
+     * java.lang.reflect.Method#getDefaultValue()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for GenericSignatureFormatError,TypeNotPresentException, MalformedParameterizedTypeException",
-        method = "getGenericExceptionTypes",
-        args = {}
-    )
     public void test_getGenericExceptionTypes() throws Exception {
         Method method = ExceptionTest.class.getDeclaredMethod("exceptionTest");
         Type[] genericExceptionTypes = method.getGenericExceptionTypes();
@@ -560,14 +469,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getGenericReturnType()
+     * java.lang.reflect.Method#getGenericReturnType()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for GenericSignatureFormatError,TypeNotPresentException, MalformedParameterizedTypeException",
-        method = "getGenericReturnType",
-        args = {}
-    )
     public void test_getGenericReturnType() throws Exception {
         Method method = GenericReturnType.class
                 .getDeclaredMethod("returnGeneric");
@@ -582,14 +485,8 @@
 
 
     /**
-     * @tests java.lang.reflect.Method#toGenericString()
+     * java.lang.reflect.Method#toGenericString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toGenericString",
-        args = {}
-    )
     public void test_toGenericString() throws Exception {
         Method method = GenericString.class.getDeclaredMethod("genericString",
                 Object.class);
@@ -603,14 +500,8 @@
 
 
     /**
-     * @tests java.lang.reflect.Method#hashCode()
+     * java.lang.reflect.Method#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() throws Exception {
         Method mth0 = TestMethod.class.getMethod("hashCodeTest", String.class);
         Method mth1 = TestMethod.class.getDeclaredMethod("hashCodeTest",
@@ -620,14 +511,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getParameterTypes()
+     * java.lang.reflect.Method#getParameterTypes()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameterTypes",
-        args = {}
-    )
     public void test_getParameterTypes() {
         // Test for method java.lang.Class []
         // java.lang.reflect.Method.getParameterTypes()
@@ -680,14 +565,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#getReturnType()
+     * java.lang.reflect.Method#getReturnType()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getReturnType",
-        args = {}
-    )
     public void test_getReturnType() {
         // Test for method java.lang.Class
         // java.lang.reflect.Method.getReturnType()
@@ -760,15 +639,9 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#invoke(java.lang.Object,
+     * java.lang.reflect.Method#invoke(java.lang.Object,
      *        java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "invoke",
-        args = {java.lang.Object.class, java.lang.Object[].class}
-    )
     public void test_invokeLjava_lang_Object$Ljava_lang_Object() throws Exception{
         // Test for method java.lang.Object
         // java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object
@@ -969,14 +842,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Method#toString()
+     * java.lang.reflect.Method#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.lang.reflect.Method.toString()
         Method mth = null;
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/ModifierTest.java b/luni/src/test/java/tests/api/java/lang/reflect/ModifierTest.java
deleted file mode 100644
index 8995139..0000000
--- a/luni/src/test/java/tests/api/java/lang/reflect/ModifierTest.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package tests.api.java.lang.reflect;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import java.lang.reflect.Modifier;
-
-@TestTargetClass(Modifier.class)
-public class ModifierTest extends junit.framework.TestCase {
-
-    private static final int ALL_FLAGS = 0x7FF;
-
-    /**
-     * @tests java.lang.reflect.Modifier#Modifier()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "The only thing I can do",
-        method = "Modifier",
-        args = {}
-    )
-    public void test_Constructor() {
-        assertNotNull(new Modifier());
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isAbstract(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isAbstract",
-        args = {int.class}
-    )
-    public void test_isAbstractI() {
-        // Test for method boolean java.lang.reflect.Modifier.isAbstract(int)
-        assertTrue("ABSTRACT returned false", Modifier.isAbstract(ALL_FLAGS));
-        assertTrue("ABSTRACT returned false", Modifier
-                .isAbstract(Modifier.ABSTRACT));
-        assertTrue("Non-ABSTRACT returned true", !Modifier
-                .isAbstract(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isFinal(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isFinal",
-        args = {int.class}
-    )
-    public void test_isFinalI() {
-        // Test for method boolean java.lang.reflect.Modifier.isFinal(int)
-        assertTrue("FINAL returned false", Modifier.isFinal(ALL_FLAGS));
-        assertTrue("FINAL returned false", Modifier.isFinal(Modifier.FINAL));
-        assertTrue("Non-FINAL returned true", !Modifier
-                .isFinal(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isInterface(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isInterface",
-        args = {int.class}
-    )
-    public void test_isInterfaceI() {
-        // Test for method boolean java.lang.reflect.Modifier.isInterface(int)
-        assertTrue("INTERFACE returned false", Modifier.isInterface(ALL_FLAGS));
-        assertTrue("INTERFACE returned false", Modifier
-                .isInterface(Modifier.INTERFACE));
-        assertTrue("Non-INTERFACE returned true", !Modifier
-                .isInterface(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isNative(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isNative",
-        args = {int.class}
-    )
-    public void test_isNativeI() {
-        // Test for method boolean java.lang.reflect.Modifier.isNative(int)
-        assertTrue("NATIVE returned false", Modifier.isNative(ALL_FLAGS));
-        assertTrue("NATIVE returned false", Modifier.isNative(Modifier.NATIVE));
-        assertTrue("Non-NATIVE returned true", !Modifier
-                .isNative(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isPrivate(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isPrivate",
-        args = {int.class}
-    )
-    public void test_isPrivateI() {
-        // Test for method boolean java.lang.reflect.Modifier.isPrivate(int)
-        assertTrue("PRIVATE returned false", Modifier.isPrivate(ALL_FLAGS));
-        assertTrue("PRIVATE returned false", Modifier
-                .isPrivate(Modifier.PRIVATE));
-        assertTrue("Non-PRIVATE returned true", !Modifier
-                .isPrivate(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isProtected(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isProtected",
-        args = {int.class}
-    )
-    public void test_isProtectedI() {
-        // Test for method boolean java.lang.reflect.Modifier.isProtected(int)
-        assertTrue("PROTECTED returned false", Modifier.isProtected(ALL_FLAGS));
-        assertTrue("PROTECTED returned false", Modifier
-                .isProtected(Modifier.PROTECTED));
-        assertTrue("Non-PROTECTED returned true", !Modifier
-                .isProtected(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isPublic(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isPublic",
-        args = {int.class}
-    )
-    public void test_isPublicI() {
-        // Test for method boolean java.lang.reflect.Modifier.isPublic(int)
-        assertTrue("PUBLIC returned false", Modifier.isPublic(ALL_FLAGS));
-        assertTrue("PUBLIC returned false", Modifier.isPublic(Modifier.PUBLIC));
-        assertTrue("Non-PUBLIC returned true", !Modifier
-                .isPublic(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isStatic(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isStatic",
-        args = {int.class}
-    )
-    public void test_isStaticI() {
-        // Test for method boolean java.lang.reflect.Modifier.isStatic(int)
-        assertTrue("STATIC returned false", Modifier.isStatic(ALL_FLAGS));
-        assertTrue("STATIC returned false", Modifier.isStatic(Modifier.STATIC));
-        assertTrue("Non-STATIC returned true", !Modifier
-                .isStatic(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isStrict(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isStrict",
-        args = {int.class}
-    )
-    public void test_isStrictI() {
-        // Test for method boolean java.lang.reflect.Modifier.isStrict(int)
-        assertTrue("STRICT returned false", Modifier.isStrict(Modifier.STRICT));
-        assertTrue("Non-STRICT returned true", !Modifier
-                .isStrict(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isSynchronized(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isSynchronized",
-        args = {int.class}
-    )
-    public void test_isSynchronizedI() {
-        // Test for method boolean
-        // java.lang.reflect.Modifier.isSynchronized(int)
-        assertTrue("Synchronized returned false", Modifier
-                .isSynchronized(ALL_FLAGS));
-        assertTrue("Non-Synchronized returned true", !Modifier
-                .isSynchronized(Modifier.VOLATILE));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isTransient(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isTransient",
-        args = {int.class}
-    )
-    public void test_isTransientI() {
-        // Test for method boolean java.lang.reflect.Modifier.isTransient(int)
-        assertTrue("Transient returned false", Modifier.isTransient(ALL_FLAGS));
-        assertTrue("Transient returned false", Modifier
-                .isTransient(Modifier.TRANSIENT));
-        assertTrue("Non-Transient returned true", !Modifier
-                .isTransient(Modifier.VOLATILE));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#isVolatile(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isVolatile",
-        args = {int.class}
-    )
-    public void test_isVolatileI() {
-        // Test for method boolean java.lang.reflect.Modifier.isVolatile(int)
-        assertTrue("Volatile returned false", Modifier.isVolatile(ALL_FLAGS));
-        assertTrue("Volatile returned false", Modifier
-                .isVolatile(Modifier.VOLATILE));
-        assertTrue("Non-Volatile returned true", !Modifier
-                .isVolatile(Modifier.TRANSIENT));
-    }
-
-    /**
-     * @tests java.lang.reflect.Modifier#toString(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {int.class}
-    )
-    public void test_toStringI() {
-        // Test for method java.lang.String
-        // java.lang.reflect.Modifier.toString(int)
-        assertTrue("Returned incorrect string value: "
-                + Modifier.toString(java.lang.reflect.Modifier.PUBLIC
-                        + java.lang.reflect.Modifier.ABSTRACT), Modifier
-                .toString(
-                        java.lang.reflect.Modifier.PUBLIC
-                                + java.lang.reflect.Modifier.ABSTRACT).equals(
-                        "public abstract"));
-    }
-
-    /**
-     * Sets up the fixture, for example, open a network connection. This method
-     * is called before a test is executed.
-     */
-    protected void setUp() {
-    }
-
-    /**
-     * Tears down the fixture, for example, close a network connection. This
-     * method is called after a test is executed.
-     */
-    protected void tearDown() {
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/ParameterizedTypeTest.java b/luni/src/test/java/tests/api/java/lang/reflect/ParameterizedTypeTest.java
index db771e5..fcb9042 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/ParameterizedTypeTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/ParameterizedTypeTest.java
@@ -16,12 +16,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.Field;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -29,32 +23,11 @@
 /**
  * Tests parameterized types and their properties.
  */
-@TestTargetClass(ParameterizedType.class)
 public class ParameterizedTypeTest extends GenericReflectionTestsBase {
 
     static class A<T>{}
     static class B extends A<String>{}
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getActualTypeArguments",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getOwnerType",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getRawType",
-            args = {}
-        )
-    })
     public void testStringParameterizedSuperClass() {
         Class<? extends B> clazz = B.class;
         Type genericSuperclass = clazz.getGenericSuperclass();
@@ -71,26 +44,6 @@
     static class C<T>{}
     static class D<T> extends C<T>{}
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getActualTypeArguments",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getOwnerType",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getRawType",
-            args = {}
-        )
-    })
     public void testTypeParameterizedSuperClass() {
         Class<? extends D> clazz = D.class;
         Type genericSuperclass = clazz.getGenericSuperclass();
@@ -109,26 +62,6 @@
         E<T> e;
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getActualTypeArguments",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getOwnerType",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-            method = "getRawType",
-            args = {}
-        )
-    })
     public void testParameterizedMemeber() throws Exception{
         Class<? extends F> clazz = F.class;
         Field field = clazz.getDeclaredField("e");
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/ProxyTest.java b/luni/src/test/java/tests/api/java/lang/reflect/ProxyTest.java
index 23d2c10..dd496b1 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/ProxyTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/ProxyTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
@@ -31,19 +27,6 @@
 import tests.support.Support_Proxy_ParentException;
 import tests.support.Support_Proxy_SubException;
 
-@TestTargetClass(
-        value = Proxy.class,
-        untestedMethods= {
-            @TestTargetNew(
-                level = TestLevel.NOT_NECESSARY,
-                notes = "Interface without implementation. Whether method is " +
-                        "called from proxy is tested by ProxyTest.",
-                clazz = InvocationHandler.class,
-                method = "invoke",
-                args = { Object.class, Method.class, Object[].class }
-            )
-        }
-)
 public class ProxyTest extends junit.framework.TestCase {
 
     /*
@@ -79,15 +62,9 @@
     }
 
     /**
-     * @tests java.lang.reflect.Proxy#getProxyClass(java.lang.ClassLoader,
+     * java.lang.reflect.Proxy#getProxyClass(java.lang.ClassLoader,
      *        java.lang.Class[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProxyClass",
-        args = {java.lang.ClassLoader.class, java.lang.Class[].class}
-    )
     public void test_getProxyClassLjava_lang_ClassLoader$Ljava_lang_Class() {
         Class proxy = Proxy.getProxyClass(Support_Proxy_I1.class
                 .getClassLoader(), new Class[] { Support_Proxy_I1.class });
@@ -117,14 +94,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Proxy#Proxy(java.lang.reflect.InvocationHandler)
+     * java.lang.reflect.Proxy#Proxy(java.lang.reflect.InvocationHandler)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Proxy",
-        args = {java.lang.reflect.InvocationHandler.class}
-    )
     public void test_ProxyLjava_lang_reflect_InvocationHandler() {
         assertNotNull(new ProxyCoonstructorTest(new InvocationHandler() {
             public Object invoke(Object proxy, Method method, Object[] args)
@@ -137,15 +108,9 @@
 
 
     /**
-     * @tests java.lang.reflect.Proxy#newProxyInstance(java.lang.ClassLoader,
+     * java.lang.reflect.Proxy#newProxyInstance(java.lang.ClassLoader,
      *        java.lang.Class[], java.lang.reflect.InvocationHandler)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newProxyInstance",
-        args = {java.lang.ClassLoader.class, java.lang.Class[].class, java.lang.reflect.InvocationHandler.class}
-    )
     public void test_newProxyInstanceLjava_lang_ClassLoader$Ljava_lang_ClassLjava_lang_reflect_InvocationHandler() {
         Object p = Proxy.newProxyInstance(Support_Proxy_I1.class
                 .getClassLoader(), new Class[] { Support_Proxy_I1.class,
@@ -227,14 +192,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Proxy#isProxyClass(java.lang.Class)
+     * java.lang.reflect.Proxy#isProxyClass(java.lang.Class)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isProxyClass",
-        args = {java.lang.Class.class}
-    )
     public void test_isProxyClassLjava_lang_Class() {
         Class proxy = Proxy.getProxyClass(Support_Proxy_I1.class
                 .getClassLoader(), new Class[] { Support_Proxy_I1.class });
@@ -269,14 +228,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.Proxy#getInvocationHandler(java.lang.Object)
+     * java.lang.reflect.Proxy#getInvocationHandler(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInvocationHandler",
-        args = {java.lang.Object.class}
-    )
     public void test_getInvocationHandlerLjava_lang_Object() {
         InvocationHandler handler = new InvocationHandler() {
             public Object invoke(Object proxy, Method method, Object[] args)
@@ -301,12 +254,6 @@
     }
 
     //Regression Test for HARMONY-2355
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test. Exceptions are not verified.",
-        method = "newProxyInstance",
-        args = {java.lang.ClassLoader.class, java.lang.Class[].class, java.lang.reflect.InvocationHandler.class}
-    )
     public void test_newProxyInstance_withCompatibleReturnTypes() {
         Object o = Proxy
                 .newProxyInstance(this.getClass().getClassLoader(),
@@ -316,12 +263,6 @@
         assertNotNull(o);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "IllegalArgumentException is verified.",
-        method = "newProxyInstance",
-        args = {java.lang.ClassLoader.class, java.lang.Class[].class, java.lang.reflect.InvocationHandler.class}
-    )
     public void test_newProxyInstance_withNonCompatibleReturnTypes() {
         try {
             Proxy.newProxyInstance(this.getClass().getClassLoader(),
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/ReflectPermissionTest.java b/luni/src/test/java/tests/api/java/lang/reflect/ReflectPermissionTest.java
index 7724ab7..c5f7f7f 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/ReflectPermissionTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/ReflectPermissionTest.java
@@ -17,25 +17,13 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.reflect.ReflectPermission;
 
-@TestTargetClass(ReflectPermission.class)
 public class ReflectPermissionTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.lang.reflect.ReflectPermission#ReflectPermission(java.lang.String)
+     * java.lang.reflect.ReflectPermission#ReflectPermission(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ReflectPermission",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.lang.reflect.ReflectPermission(java.lang.String)
         String permString = new ReflectPermission("Blah").toString();
@@ -44,15 +32,9 @@
     }
 
     /**
-     * @tests java.lang.reflect.ReflectPermission#ReflectPermission(java.lang.String,
+     * java.lang.reflect.ReflectPermission#ReflectPermission(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ReflectPermission",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         // Test for method java.lang.reflect.ReflectPermission(java.lang.String,
         // java.lang.String)
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/TypeVariableTest.java b/luni/src/test/java/tests/api/java/lang/reflect/TypeVariableTest.java
index a8e21f7..cc22852 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/TypeVariableTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/TypeVariableTest.java
@@ -16,11 +16,6 @@
 
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Method;
@@ -30,16 +25,9 @@
 /**
  * Tests type variables and their properties.
  */
-@TestTargetClass(TypeVariable.class)
 public class TypeVariableTest extends GenericReflectionTestsBase {
 
     static class A<T>{}
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Tests getGenericDeclaration of a type variable on a class.",
-        method = "getGenericDeclaration",
-        args = {}
-    )
     public void testSimpleTypeVariableOnClass(){
         Class<? extends A> clazz = A.class;
         TypeVariable[] typeParameters = clazz.getTypeParameters();
@@ -55,12 +43,6 @@
     static class B{
         <T> void b(){};
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Tests getGenericDeclaration of a type variable on a method.",
-        method = "getGenericDeclaration",
-        args = {}
-    )
     public void testSimpleTypeVariableOnMethod() throws Exception{
         Class<? extends B> clazz = B.class;
         Method method = clazz.getDeclaredMethod("b");
@@ -77,26 +59,6 @@
     static class C {
         <T>C(){}
     }
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Interaction test.",
-            method = "getGenericDeclaration",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Interaction test.",
-            method = "getBounds",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Interaction test.",
-            method = "getName",
-            args = {}
-        )
-    })
     public void testSimpleTypeVariableOnConstructor() throws Exception{
         Class<? extends C> clazz = C.class;
         Constructor<?> constructor = clazz.getDeclaredConstructor();
@@ -111,12 +73,6 @@
     }
 
     static class D<Q,R,S>{}
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Interaction test.",
-        method = "getGenericDeclaration",
-        args = {}
-    )
     public void testMultipleTypeVariablesOnClass() throws Exception {
         Class<? extends D> clazz = D.class;
         TypeVariable<?>[] typeParameters = clazz.getTypeParameters();
@@ -135,12 +91,6 @@
     static class E {
         <Q,R,S> void e(){}
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void testMultipleTypeVariablesOnMethod() throws Exception {
         Class<? extends E> clazz = E.class;
         Method method = clazz.getDeclaredMethod("e");
@@ -160,12 +110,6 @@
     static class F {
         <Q,R,S> F(){}
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void testMultipleTypeVariablesOnConstructor() throws Exception {
         Class<? extends F> clazz = F.class;
         Constructor<?> constructor = clazz.getDeclaredConstructor();
@@ -184,12 +128,6 @@
 
     static class G <T extends Number>{}
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Interaction test, Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-        method = "getBounds",
-        args = {}
-    )
     public void testSingleBound() throws Exception {
         Class<? extends G> clazz = G.class;
         TypeVariable[] typeParameters = clazz.getTypeParameters();
@@ -200,12 +138,6 @@
     }
 
     static class H <T extends Number & Serializable >{}
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Interaction test., Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-        method = "getBounds",
-        args = {}
-    )
     public void testMultipleBound() throws Exception {
         Class<? extends H> clazz = H.class;
         TypeVariable[] typeParameters = clazz.getTypeParameters();
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/UndeclaredThrowableExceptionTests.java b/luni/src/test/java/tests/api/java/lang/reflect/UndeclaredThrowableExceptionTests.java
index 90509fd..8fd2ff3 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/UndeclaredThrowableExceptionTests.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/UndeclaredThrowableExceptionTests.java
@@ -1,29 +1,17 @@
 package tests.api.java.lang.reflect;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.io.EOFException;
 import java.lang.reflect.UndeclaredThrowableException;
 
-@TestTargetClass(UndeclaredThrowableException.class)
 public class UndeclaredThrowableExceptionTests extends TestCase {
 
     private static EOFException throwable = new EOFException();
     private static String msg = "TEST_MSG";
     /**
-     * @tests java.lang.reflect.UndeclaredThrowableException#getCause()
+     * java.lang.reflect.UndeclaredThrowableException#getCause()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCause",
-        args = {}
-    )
     public void test_getCause() throws Exception {
         UndeclaredThrowableException ute = new UndeclaredThrowableException(
                 throwable);
@@ -31,14 +19,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.UndeclaredThrowableException#getUndeclaredThrowable()
+     * java.lang.reflect.UndeclaredThrowableException#getUndeclaredThrowable()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getUndeclaredThrowable",
-        args = {}
-    )
     public void test_getUndeclaredThrowable() throws Exception {
         UndeclaredThrowableException ute = new UndeclaredThrowableException(
                 throwable);
@@ -47,14 +29,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.UndeclaredThrowableException#UndeclaredThrowableException(java.lang.Throwable)
+     * java.lang.reflect.UndeclaredThrowableException#UndeclaredThrowableException(java.lang.Throwable)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "UndeclaredThrowableException",
-        args = {java.lang.Throwable.class}
-    )
     public void test_Constructor_Throwable() throws Exception {
         UndeclaredThrowableException e = new UndeclaredThrowableException(
                 throwable);
@@ -64,14 +40,8 @@
     }
 
     /**
-     * @tests java.lang.reflect.UndeclaredThrowableException#UndeclaredThrowableException(java.lang.Throwable, java.lang.String)
+     * java.lang.reflect.UndeclaredThrowableException#UndeclaredThrowableException(java.lang.Throwable, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "UndeclaredThrowableException",
-        args = {java.lang.Throwable.class, java.lang.String.class}
-    )
     public void test_Constructor_Throwable_String() throws Exception {
        UndeclaredThrowableException e = new UndeclaredThrowableException(
                 throwable, msg);
diff --git a/luni/src/test/java/tests/api/java/lang/reflect/WildcardTypeTest.java b/luni/src/test/java/tests/api/java/lang/reflect/WildcardTypeTest.java
index d1abb7a..9f8baeb 100644
--- a/luni/src/test/java/tests/api/java/lang/reflect/WildcardTypeTest.java
+++ b/luni/src/test/java/tests/api/java/lang/reflect/WildcardTypeTest.java
@@ -23,14 +23,9 @@
 import java.lang.reflect.TypeVariable;
 import java.lang.reflect.WildcardType;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 /**
  * Tests bounded type parameters declared on methods and bounded wildcards.
  */
-@TestTargetClass(WildcardType.class)
 public class WildcardTypeTest extends GenericReflectionTestsBase {
     @SuppressWarnings({"unchecked", "hiding"})
     static class BoundedWildcardsGenericMethods<T> {
@@ -47,25 +42,9 @@
     @SuppressWarnings("unchecked")
     private static Class<? extends BoundedWildcardsGenericMethods> clazz = BoundedWildcardsGenericMethods.class;
 
-//    /**
-//     * Tests that there are is one Type Parameter on the Class itself.
-//     */
-//    @TestInfo(
-//      level = TestLevel.PARTIAL,
-//      purpose = "Doesn't check GenericSignatureFormatError.",
-//      targets = {
-//        @TestTarget(
-//          methodName = "getTypeParameters",
-//          methodArgs = {}
-//        )
-//    })
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        clazz = Class.class,
-        method = "getTypeParameters",
-        args = {}
-    )
+    /**
+     * Tests that there are is one Type Parameter on the Class itself.
+     */
     public void testBoundedGenericMethods() {
         assertLenghtOne(clazz.getTypeParameters());
     }
@@ -142,24 +121,12 @@
         assertEquals(BoundedWildcardsGenericMethods.class, bound);
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-        method = "getUpperBounds",
-        args = {}
-    )
     public void testUpperBoundedParamNoReturn() throws Exception {
         Method method = clazz.getMethod("upperBoundedParamNoReturn", BoundedWildcardsGenericMethods.class);
         checkBoundedTypeParameter(method);
         checkUpperBoundedParameter(method);
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-        method = "getLowerBounds",
-        args = {}
-    )
     public void testLowerBoundedParamReturn() throws Exception {
         Method method = clazz.getMethod("lowerBoundedParamReturn", BoundedWildcardsGenericMethods.class);
         checkBoundedTypeParameter(method);
@@ -167,12 +134,6 @@
         checkReturnType(method);
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-        method = "getUpperBounds",
-        args = {}
-    )
     public void testUpperBoundedParamReturn() throws Exception {
         Method method = clazz.getMethod("upperBoundedParamReturn", BoundedWildcardsGenericMethods.class);
         checkBoundedTypeParameter(method);
@@ -180,12 +141,6 @@
         checkReturnType(method);
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Missing tests for TypeNotPresentException, MalformedParametrizedTypeException",
-        method = "getLowerBounds",
-        args = {}
-    )
     public void testLowerBoundedParamNoReturn() throws Exception {
         Method method = clazz.getMethod("lowerBoundedParamNoReturn", BoundedWildcardsGenericMethods.class);
         checkBoundedTypeParameter(method);
diff --git a/luni/src/test/java/tests/api/java/math/AllTests.java b/luni/src/test/java/tests/api/java/math/AllTests.java
deleted file mode 100644
index 4c25231..0000000
--- a/luni/src/test/java/tests/api/java/math/AllTests.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.java.math;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the Math project.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.math");
-        // $JUnit-BEGIN$
-        suite.addTestSuite(BigIntegerTest.class);
-        suite.addTestSuite(RoundingModeTest.class);
-        suite.addTestSuite(MathContextTest.class);
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/math/BigIntegerTest.java b/luni/src/test/java/tests/api/java/math/BigIntegerTest.java
index f82e4da..2c2c25b 100644
--- a/luni/src/test/java/tests/api/java/math/BigIntegerTest.java
+++ b/luni/src/test/java/tests/api/java/math/BigIntegerTest.java
@@ -78,7 +78,7 @@
     BigInteger[][] booleanPairs;
 
     /**
-     * @tests java.math.BigInteger#BigInteger(int, java.util.Random)
+     * java.math.BigInteger#BigInteger(int, java.util.Random)
      */
     public void test_ConstructorILjava_util_Random() {
         // regression test for HARMONY-1047
@@ -108,7 +108,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(int, int, java.util.Random)
+     * java.math.BigInteger#BigInteger(int, int, java.util.Random)
      */
     // BIGNUM returns no Primes smaller than 16 bits.
     public void test_ConstructorIILjava_util_Random() {
@@ -148,7 +148,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(byte[])
+     * java.math.BigInteger#BigInteger(byte[])
      */
     public void test_Constructor$B() {
         byte[] myByteArray;
@@ -162,7 +162,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(int, byte[])
+     * java.math.BigInteger#BigInteger(int, byte[])
      */
     public void test_ConstructorI$B() {
         byte[] myByteArray;
@@ -186,7 +186,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_constructor_String_empty() {
         try {
@@ -197,7 +197,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#toByteArray()
+     * java.math.BigInteger#toByteArray()
      */
     public void test_toByteArray() {
         byte[] myByteArray, anotherByteArray;
@@ -230,7 +230,7 @@
 //    }
 
     /**
-     * @tests java.math.BigInteger#isProbablePrime(int)
+     * java.math.BigInteger#isProbablePrime(int)
      */
     public void test_isProbablePrimeI() {
         int fails = 0;
@@ -297,7 +297,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#nextProbablePrime()
+     * java.math.BigInteger#nextProbablePrime()
      */
     public void test_nextProbablePrime() {
         largePrimesProduct(
@@ -328,7 +328,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#probablePrime(int, java.util.Random)
+     * java.math.BigInteger#probablePrime(int, java.util.Random)
      */
     public void test_probablePrime() {
         for (int bitLength = 50; bitLength <= 1050; bitLength += 100) {
@@ -400,7 +400,7 @@
 
 
     /**
-     * @tests java.math.BigInteger#equals(java.lang.Object)
+     * java.math.BigInteger#equals(java.lang.Object)
      */
     public void test_equalsLjava_lang_Object() {
         assertTrue("0=0", zero.equals(BigInteger.valueOf(0)));
@@ -415,7 +415,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#compareTo(java.math.BigInteger)
+     * java.math.BigInteger#compareTo(java.math.BigInteger)
      */
     public void test_compareToLjava_math_BigInteger() {
         assertTrue("Smaller number returned >= 0", one.compareTo(two) < 0);
@@ -426,7 +426,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#intValue()
+     * java.math.BigInteger#intValue()
      */
     public void test_intValue() {
         assertTrue("Incorrect intValue for 2**70",
@@ -435,7 +435,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#longValue()
+     * java.math.BigInteger#longValue()
      */
     public void test_longValue() {
         assertTrue("Incorrect longValue for 2**70",
@@ -444,7 +444,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#valueOf(long)
+     * java.math.BigInteger#valueOf(long)
      */
     public void test_valueOfJ() {
         assertTrue("Incurred number returned for 2", BigInteger.valueOf(2L)
@@ -454,7 +454,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#add(java.math.BigInteger)
+     * java.math.BigInteger#add(java.math.BigInteger)
      */
     public void test_addLjava_math_BigInteger() {
         assertTrue("Incorrect sum--wanted a zillion", aZillion.add(aZillion)
@@ -495,7 +495,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#negate()
+     * java.math.BigInteger#negate()
      */
     public void test_negate() {
         assertTrue("Single negation of zero did not result in zero", zero
@@ -523,7 +523,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#signum()
+     * java.math.BigInteger#signum()
      */
     public void test_signum() {
         assertTrue("Wrong positive signum", two.signum() == 1);
@@ -533,7 +533,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#abs()
+     * java.math.BigInteger#abs()
      */
     public void test_abs() {
         assertTrue("Invalid number returned for zillion", aZillion.negate()
@@ -546,7 +546,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#pow(int)
+     * java.math.BigInteger#pow(int)
      */
     public void test_powI() {
         assertTrue("Incorrect exponent returned for 2**10", two.pow(10).equals(
@@ -558,7 +558,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#modInverse(java.math.BigInteger)
+     * java.math.BigInteger#modInverse(java.math.BigInteger)
      */
     public void test_modInverseLjava_math_BigInteger() {
         BigInteger a = zero, mod, inv;
@@ -607,7 +607,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#shiftRight(int)
+     * java.math.BigInteger#shiftRight(int)
      */
     public void test_shiftRightI() {
         assertTrue("1 >> 0", BigInteger.valueOf(1).shiftRight(0).equals(
@@ -664,7 +664,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#shiftLeft(int)
+     * java.math.BigInteger#shiftLeft(int)
      */
     public void test_shiftLeftI() {
         assertTrue("1 << 0", one.shiftLeft(0).equals(one));
@@ -705,7 +705,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#multiply(java.math.BigInteger)
+     * java.math.BigInteger#multiply(java.math.BigInteger)
      */
     public void test_multiplyLjava_math_BigInteger() {
         assertTrue("Incorrect sum--wanted three zillion", aZillion
@@ -731,7 +731,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#divide(java.math.BigInteger)
+     * java.math.BigInteger#divide(java.math.BigInteger)
      */
     public void test_divideLjava_math_BigInteger() {
         testAllDivs(bi33, bi3);
@@ -789,7 +789,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#remainder(java.math.BigInteger)
+     * java.math.BigInteger#remainder(java.math.BigInteger)
      */
     public void test_remainderLjava_math_BigInteger() {
         try {
@@ -818,7 +818,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#mod(java.math.BigInteger)
+     * java.math.BigInteger#mod(java.math.BigInteger)
      */
     public void test_modLjava_math_BigInteger() {
         try {
@@ -847,7 +847,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#divideAndRemainder(java.math.BigInteger)
+     * java.math.BigInteger#divideAndRemainder(java.math.BigInteger)
      */
     public void test_divideAndRemainderLjava_math_BigInteger() {
         try {
@@ -876,7 +876,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String)
+     * java.math.BigInteger#BigInteger(java.lang.String)
      */
     public void test_ConstructorLjava_lang_String() {
         assertTrue("new(0)", new BigInteger("0").equals(BigInteger.valueOf(0)));
@@ -890,7 +890,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#BigInteger(java.lang.String, int)
+     * java.math.BigInteger#BigInteger(java.lang.String, int)
      */
     public void test_ConstructorLjava_lang_StringI() {
         assertTrue("new(0,16)", new BigInteger("0", 16).equals(BigInteger
@@ -914,7 +914,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#toString()
+     * java.math.BigInteger#toString()
      */
     public void test_toString() {
         assertTrue("0.toString", "0".equals(BigInteger.valueOf(0).toString()));
@@ -928,7 +928,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#toString(int)
+     * java.math.BigInteger#toString(int)
      */
     public void test_toStringI() {
         assertTrue("0.toString(16)", "0".equals(BigInteger.valueOf(0).toString(
@@ -946,7 +946,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#and(java.math.BigInteger)
+     * java.math.BigInteger#and(java.math.BigInteger)
      */
     public void test_andLjava_math_BigInteger() {
         for (BigInteger[] element : booleanPairs) {
@@ -962,7 +962,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#or(java.math.BigInteger)
+     * java.math.BigInteger#or(java.math.BigInteger)
      */
     public void test_orLjava_math_BigInteger() {
         for (BigInteger[] element : booleanPairs) {
@@ -978,7 +978,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#xor(java.math.BigInteger)
+     * java.math.BigInteger#xor(java.math.BigInteger)
      */
     public void test_xorLjava_math_BigInteger() {
         for (BigInteger[] element : booleanPairs) {
@@ -994,7 +994,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#not()
+     * java.math.BigInteger#not()
      */
     public void test_not() {
         for (BigInteger[] element : booleanPairs) {
@@ -1008,7 +1008,7 @@
     }
 
     /**
-     * @tests java.math.BigInteger#andNot(java.math.BigInteger)
+     * java.math.BigInteger#andNot(java.math.BigInteger)
      */
     public void test_andNotLjava_math_BigInteger() {
         for (BigInteger[] element : booleanPairs) {
diff --git a/luni/src/test/java/tests/api/java/math/MathContextTest.java b/luni/src/test/java/tests/api/java/math/MathContextTest.java
index dadfd12..9e04342 100644
--- a/luni/src/test/java/tests/api/java/math/MathContextTest.java
+++ b/luni/src/test/java/tests/api/java/math/MathContextTest.java
@@ -24,7 +24,7 @@
 public class MathContextTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.math.MathContext#MathContext(...)
+     * java.math.MathContext#MathContext(...)
      */
     public void test_MathContextConstruction() {
         String a = "-12380945E+61";
diff --git a/luni/src/test/java/tests/api/java/math/RoundingModeTest.java b/luni/src/test/java/tests/api/java/math/RoundingModeTest.java
index 1549301..50a77df 100644
--- a/luni/src/test/java/tests/api/java/math/RoundingModeTest.java
+++ b/luni/src/test/java/tests/api/java/math/RoundingModeTest.java
@@ -23,7 +23,7 @@
 public class RoundingModeTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.math.RoundingMode#valueOf(int)
+     * java.math.RoundingMode#valueOf(int)
      */
     public void test_valueOfI() {
         assertEquals("valueOf failed for ROUND_CEILING", RoundingMode.valueOf(BigDecimal.ROUND_CEILING), RoundingMode.CEILING);
diff --git a/luni/src/test/java/tests/api/java/security/AccessControlContextTest.java b/luni/src/test/java/tests/api/java/security/AccessControlContextTest.java
index d16dbf4..c6b6a8b 100644
--- a/luni/src/test/java/tests/api/java/security/AccessControlContextTest.java
+++ b/luni/src/test/java/tests/api/java/security/AccessControlContextTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.java.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.File;
 import java.io.FilePermission;
 import java.security.AccessControlContext;
@@ -38,7 +34,6 @@
 import javax.security.auth.Subject;
 import javax.security.auth.SubjectDomainCombiner;
 
-@TestTargetClass(AccessControlContext.class)
 public class AccessControlContextTest extends junit.framework.TestCase {
 
     private class TestSecurityManager extends SecurityManager {
@@ -62,14 +57,8 @@
     }
 
     /**
-     * @tests java.security.AccessControlContext#AccessControlContext(java.security.ProtectionDomain[])
+     * java.security.AccessControlContext#AccessControlContext(java.security.ProtectionDomain[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AccessControlContext",
-        args = {java.security.ProtectionDomain[].class}
-    )
     public void test_Constructor$Ljava_security_ProtectionDomain() {
         // Test for method
         // java.security.AccessControlContext(java.security.ProtectionDomain [])
@@ -118,14 +107,9 @@
     }
 
     /**
-     * @tests java.security.AccessControlContext#AccessControlContext(java.security.AccessControlContext,
+     * java.security.AccessControlContext#AccessControlContext(java.security.AccessControlContext,
      *        java.security.DomainCombiner)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "AccessControlContext",
-        args = {java.security.AccessControlContext.class, java.security.DomainCombiner.class}
-    )
     public void test_ConstructorLjava_security_AccessControlContextLjava_security_DomainCombiner() {
         AccessControlContext context = AccessController.getContext();
         try {
@@ -143,14 +127,8 @@
     }
 
     /**
-     * @tests java.security.AccessControlException#checkPermission(Permission)
+     * java.security.AccessControlException#checkPermission(Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "checkPermission",
-        args = {java.security.Permission.class}
-    )
     public void test_checkPermission() {
         char s = File.separatorChar;
         FilePermission perm[] = new FilePermission[7];
@@ -218,14 +196,8 @@
     }
 
     /**
-     * @tests java.security.AccessControlException#equals()
+     * java.security.AccessControlException#equals()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equals() {
         final Permission perm1 = new PropertyPermission("java.class.path",
                 "read");
@@ -275,13 +247,8 @@
     }
 
     /**
-     * @tests java.security.AccessControlException#getDomainCombiner()
+     * java.security.AccessControlException#getDomainCombiner()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getDomainCombiner",
-        args = {}
-    )
     public void test_getDomainCombiner() {
         AccessControlContext context = AccessController.getContext();
 
@@ -305,14 +272,8 @@
     }
 
     /**
-     * @tests java.security.AccessControlException#hashCode()
+     * java.security.AccessControlException#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         final Permission perm1 = new PropertyPermission("java.class.path",
                 "read");
@@ -358,4 +319,4 @@
         assertTrue(acc5.hashCode() == acc6.hashCode());
         assertTrue(acc6.hashCode() == acc4.hashCode());
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/java/security/AllTests.java b/luni/src/test/java/tests/api/java/security/AllTests.java
deleted file mode 100644
index 2d7fdd4..0000000
--- a/luni/src/test/java/tests/api/java/security/AllTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.java.security;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.java.security;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.api.java.security;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AccessControlContextTest.class);
-        suite.addTestSuite(PermissionCollectionTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/security/PermissionCollectionTest.java b/luni/src/test/java/tests/api/java/security/PermissionCollectionTest.java
index 49f100c..edbc2f5 100644
--- a/luni/src/test/java/tests/api/java/security/PermissionCollectionTest.java
+++ b/luni/src/test/java/tests/api/java/security/PermissionCollectionTest.java
@@ -33,11 +33,7 @@
 import tests.support.Support_GetLocal;
 import tests.support.resource.Support_Resources;
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
-@TestTargetClass(PermissionCollection.class)
 public class PermissionCollectionTest extends junit.framework.TestCase {
 
     // The below test is known to fail. Haven't got to the bottom of
@@ -60,14 +56,8 @@
     // * the cause of that NPE has still not been determined. Could it be
     // related to Harmony's current stub implementation of BigInteger ?
     /**
-     * @tests java.security.PermissionCollection#implies(java.security.Permission)
+     * java.security.PermissionCollection#implies(java.security.Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     @KnownFailure("Android doesn't support protection domains.")
     public void test_impliesLjava_security_Permission() throws Exception{
 
@@ -191,14 +181,8 @@
     }
 
     /**
-     * @tests java.security.PermissionCollection#PermissionCollection()
+     * java.security.PermissionCollection#PermissionCollection()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PermissionCollection",
-        args = {}
-    )
     public void test_Constructor() {
         // test java.security.permissionCollection.PermissionCollection()
         SecurityPermission permi = new SecurityPermission(
@@ -209,14 +193,8 @@
     }
 
     /**
-     * @tests java.security.PermissionCollection#isReadOnly()
+     * java.security.PermissionCollection#isReadOnly()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isReadOnly",
-        args = {}
-    )
     public void test_isReadOnly() {
         // test java.security.permissionCollection.isReadOnly()
         SecurityPermission permi = new SecurityPermission(
@@ -230,14 +208,8 @@
     }
 
     /**
-     * @tests java.security.PermissionCollection#setReadOnly()
+     * java.security.PermissionCollection#setReadOnly()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setReadOnly",
-        args = {}
-    )
     public void test_setReadOnly() {
         // test java.security.permissionCollection.setReadOnly()
         SecurityPermission permi = new SecurityPermission(
@@ -251,14 +223,8 @@
     }
 
     /**
-     * @tests java.security.PermissionCollection#toString()
+     * java.security.PermissionCollection#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // test java.security.permissionCollection.toString()
         SecurityPermission permi = new SecurityPermission(
@@ -279,4 +245,4 @@
 
         return url;
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/java/util/AbstractListTest.java b/luni/src/test/java/tests/api/java/util/AbstractListTest.java
index f69af8d..3cda30f 100644
--- a/luni/src/test/java/tests/api/java/util/AbstractListTest.java
+++ b/luni/src/test/java/tests/api/java/util/AbstractListTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractList;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -31,7 +26,6 @@
 import java.util.ListIterator;
 import java.util.RandomAccess;
 
-@TestTargetClass(AbstractList.class)
 public class AbstractListTest extends junit.framework.TestCase {
 
     static class SimpleList extends AbstractList {
@@ -59,14 +53,8 @@
     }
 
     /**
-     * @tests java.util.AbstractList#hashCode()
+     * java.util.AbstractList#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
 
         List list = new ArrayList();
@@ -86,14 +74,8 @@
     }
 
     /**
-     * @tests java.util.AbstractList#iterator()
+     * java.util.AbstractList#iterator()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "iterator",
-        args = {}
-    )
     public void test_iterator() {
         SimpleList list = new SimpleList();
         list.add(new Object());
@@ -105,14 +87,8 @@
     }
 
     /**
-     * @tests java.util.AbstractList#listIterator()
+     * java.util.AbstractList#listIterator()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "listIterator",
-        args = {}
-    )
     public void test_listIterator() {
         Integer tempValue;
         List list = new ArrayList();
@@ -137,14 +113,8 @@
     }
 
     /**
-     * @tests java.util.AbstractList#subList(int, int)
+     * java.util.AbstractList#subList(int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies each of the SubList operations to ensure a ConcurrentModificationException does not occur on an AbstractList which does not update modCount.",
-        method = "subList",
-        args = {int.class, int.class}
-    )
     public void test_subListII() {
         // Test each of the SubList operations to ensure a
         // ConcurrentModificationException does not occur on an AbstractList
@@ -197,14 +167,8 @@
         }
 
     /**
-     * @tests java.util.AbstractList#subList(int, int)
+     * java.util.AbstractList#subList(int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException.",
-        method = "subList",
-        args = {int.class, int.class}
-    )
     public void test_subList_empty() {
         // Regression for HARMONY-389
         List al = new ArrayList();
@@ -234,14 +198,8 @@
     }
 
     /**
-     * @tests java.util.AbstractList#subList(int, int)
+     * java.util.AbstractList#subList(int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify IndexOutOfBoundsException, IllegalArgumentException.",
-        method = "subList",
-        args = {int.class, int.class}
-    )
     public void test_subList_addAll() {
         // Regression for HARMONY-390
         List mainList = new ArrayList();
@@ -268,12 +226,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "indexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_indexOfLjava_lang_Object() {
         AbstractList al = new ArrayList();
         al.add(0);
@@ -286,12 +238,6 @@
         assertEquals(2, al.indexOf(2));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastIndexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_lastIndexOfLjava_lang_Object() {
         AbstractList al = new ArrayList();
         al.add(0);
@@ -308,12 +254,6 @@
         assertEquals(6, al.lastIndexOf(2));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "listIterator",
-        args = {int.class}
-    )
     public void test_listIteratorI() {
         AbstractList al1 = new ArrayList();
         AbstractList al2 = new ArrayList();
diff --git a/luni/src/test/java/tests/api/java/util/AbstractMapTest.java b/luni/src/test/java/tests/api/java/util/AbstractMapTest.java
index e431dd0..c8f9ce2 100644
--- a/luni/src/test/java/tests/api/java/util/AbstractMapTest.java
+++ b/luni/src/test/java/tests/api/java/util/AbstractMapTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractMap;
 import java.util.AbstractSet;
 import java.util.Collection;
@@ -38,7 +34,6 @@
 import java.util.Vector;
 import java.util.WeakHashMap;
 
-@TestTargetClass(AbstractMap.class)
 public class AbstractMapTest extends junit.framework.TestCase {
 
     static final String specialKey = "specialKey".intern();
@@ -76,14 +71,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#keySet()
+     * java.util.AbstractMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify returned set of keys.",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         AbstractMap map1 = new HashMap(0);
         assertSame("HashMap(0)", map1.keySet(), map1.keySet());
@@ -108,14 +97,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#remove(java.lang.Object)
+     * java.util.AbstractMap#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify UnsupportedOperationException.",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         Object key = new Object();
         Object value = new Object();
@@ -152,14 +135,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#values()
+     * java.util.AbstractMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify returned Collection.",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         AbstractMap map1 = new HashMap(0);
         assertSame("HashMap(0)", map1.values(), map1.values());
@@ -184,14 +161,8 @@
     }
 
     /**
-     * @tests java.util.AbstractMap#clone()
+     * java.util.AbstractMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CloneNotSupportedException.",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         class MyMap extends AbstractMap implements Cloneable {
             private Map map = new HashMap();
@@ -286,14 +257,8 @@
     }
 
     /**
-     * @tests {@link java.util.AbstractMap#putAll(Map)}
+     * {@link java.util.AbstractMap#putAll(Map)}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify exceptions.",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLMap() {
         Hashtable ht  = new Hashtable();
         AMT amt = new AMT();
diff --git a/luni/src/test/java/tests/api/java/util/AbstractQueueTest.java b/luni/src/test/java/tests/api/java/util/AbstractQueueTest.java
index a274fae..5ae490c 100644
--- a/luni/src/test/java/tests/api/java/util/AbstractQueueTest.java
+++ b/luni/src/test/java/tests/api/java/util/AbstractQueueTest.java
@@ -15,11 +15,6 @@
  */
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractQueue;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -31,7 +26,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(AbstractQueue.class)
 public class AbstractQueueTest extends TestCase {
 
     private MockAbstractQueue<Object> queue;
@@ -112,14 +106,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue.add(E)
+     * java.util.AbstractQueue.add(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLE_null() {
         try {
             queue.add(null);
@@ -130,14 +118,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue.add(E)
+     * java.util.AbstractQueue.add(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalStateException.",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLE_Full() {
         Object o = new Object();
 
@@ -154,14 +136,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#add(E)
+     * java.util.AbstractQueue#add(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify NullPointerException, IllegalStateException.",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLE() {
         Object o = new Object();
         final int LAST_INDEX = 4;
@@ -179,14 +155,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#addAll(E)
+     * java.util.AbstractQueue#addAll(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLE_null() {
         try {
             queue.addAll(null);
@@ -197,14 +167,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#addAll(E)
+     * java.util.AbstractQueue#addAll(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLE_with_null() {
         List list = Arrays.asList("MYTESTSTRING", null, new Float(123.456));
         try {
@@ -216,14 +180,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#addAll(E)
+     * java.util.AbstractQueue#addAll(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalStateException.",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLE_full() {
         List list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
         try {
@@ -235,14 +193,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#addAll(E)
+     * java.util.AbstractQueue#addAll(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test. Doesn't verify returned true value.",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLE_empty() {
         // Regression test for HARMONY-1178
         List list = new ArrayList<Object>(0);
@@ -250,14 +202,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#addAll(E)
+     * java.util.AbstractQueue#addAll(E)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLE_this() {
         try {
             queue.addAll(queue);
@@ -267,12 +213,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Checks functionality",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLjava_lang_Object() {
         Collection c = new Vector();
 
@@ -288,14 +228,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#clear()
+     * java.util.AbstractQueue#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies clear method for empty queue.",
-        method = "clear",
-        args = {}
-    )
     public void test_clear_empty() {
         queue.clear();
         assertTrue(queue.isEmpty());
@@ -303,14 +237,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#clear()
+     * java.util.AbstractQueue#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         List list = Arrays.asList(123.456, "MYTESTSTRING", new Object(), 'c');
         queue.addAll(list);
@@ -320,28 +248,16 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#AbstractQueue()
+     * java.util.AbstractQueue#AbstractQueue()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AbstractQueue",
-        args = {}
-    )
     public void test_Constructor() {
         MockAbstractQueue queue = new MockAbstractQueue();
         assertNotNull(queue);
     }
 
     /**
-     * @tests java.util.AbstractQueue#remove()
+     * java.util.AbstractQueue#remove()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NoSuchElementException.",
-        method = "remove",
-        args = {}
-    )
     public void test_remove_null() {
         try {
             queue.remove();
@@ -353,14 +269,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#remove()
+     * java.util.AbstractQueue#remove()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies positive functionality, NoSuchElementException.",
-        method = "remove",
-        args = {}
-    )
     public void test_remove() {
         char c = 'a';
         queue.add(c);
@@ -377,14 +287,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#element()
+     * java.util.AbstractQueue#element()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NoSuchElementException.",
-        method = "element",
-        args = {}
-    )
     public void test_element_empty() {
         try {
             queue.element();
@@ -395,14 +299,8 @@
     }
 
     /**
-     * @tests java.util.AbstractQueue#element()
+     * java.util.AbstractQueue#element()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify NoSuchElementException.",
-        method = "element",
-        args = {}
-    )
     public void test_element() {
         String s = "MYTESTSTRING_ONE";
         queue.add(s);
diff --git a/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java b/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java
index 3d6a841..2068f1b 100644
--- a/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java
+++ b/luni/src/test/java/tests/api/java/util/AbstractSequentialListTest.java
@@ -16,11 +16,6 @@
  */
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractSequentialList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -31,7 +26,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(AbstractSequentialList.class)
 public class AbstractSequentialListTest extends TestCase {
 
     @Override
@@ -60,14 +54,8 @@
     }
 
     /**
-     * @tests {@link java.util.AbstractSequentialList#addAll(int, java.util.Collection)}
+     * {@link java.util.AbstractSequentialList#addAll(int, java.util.Collection)}
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify all exceptions according to the specification.",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAll_ILCollection() {
         AbstractSequentialList<String> al = new ASLT<String>();
         String[] someList = { "Aardvark"  ,
@@ -154,12 +142,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAllILjava_util_Collection() {
         AbstractSequentialList asl = new AbstractSequentialList() {
 
@@ -244,12 +226,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_addILjava_lang_Object() {
         AbstractSequentialList asl = new AbstractSequentialList() {
 
@@ -321,12 +297,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {int.class}
-    )
     public void test_getI() {
         final String buff[] = {"0", "1", "2", "3", "4", "5"};
         AbstractSequentialList asl = new AbstractSequentialList() {
@@ -396,20 +366,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "iterator",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AbstractSequentialList",
-            args = {}
-        )
-    })
     public void test_iterrator() {
         AbstractSequentialList asl = new AbstractSequentialList() {
 
@@ -456,12 +412,6 @@
         assertNull(asl.iterator());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {int.class}
-    )
     public void test_removeI() {
         AbstractSequentialList asl = new AbstractSequentialList() {
             String buff[] = {"0", "1", "2", "3", "4", "5"};
@@ -534,12 +484,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_setILjava_lang_Object() {
         AbstractSequentialList asl = new AbstractSequentialList() {
             String buff[] = {"0", "1", "2", "3", "4", "5"};
diff --git a/luni/src/test/java/tests/api/java/util/AllTests.java b/luni/src/test/java/tests/api/java/util/AllTests.java
deleted file mode 100644
index fe1c93d..0000000
--- a/luni/src/test/java/tests/api/java/util/AllTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package tests.api.java.util;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * TODO Type description
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Test for java.util");
-
-        // $JUnit-BEGIN$
-        suite.addTestSuite(AbstractListTest.class);
-        suite.addTestSuite(AbstractMapTest.class);
-        suite.addTestSuite(AbstractQueueTest.class);
-        suite.addTestSuite(AbstractSequentialListTest.class);
-        suite.addTestSuite(ArrayListTest.class);
-        suite.addTestSuite(ArraysTest.class);
-        suite.addTestSuite(BitSetTest.class);
-        suite.addTestSuite(CalendarTest.class);
-        suite.addTestSuite(CollectionsTest.class);
-        suite.addTestSuite(ConcurrentModificationExceptionTest.class);
-        suite.addTestSuite(ConcurrentModTest.class);
-        suite.addTestSuite(CurrencyTest.class);
-        suite.addTestSuite(DateTest.class);
-        suite.addTestSuite(EmptyStackExceptionTest.class);
-        suite.addTestSuite(EnumMapTest.class);
-        suite.addTestSuite(EnumSetTest.class);
-        suite.addTestSuite(EventObjectTest.class);
-        suite.addTestSuite(FormattableFlagsTest.class);
-        suite.addTestSuite(GregorianCalendarTest.class);
-        suite.addTestSuite(HashMapTest.class);
-        suite.addTestSuite(HashSetTest.class);
-        suite.addTestSuite(HashtableTest.class);
-        suite.addTestSuite(IdentityHashMapTest.class);
-        suite.addTestSuite(InvalidPropertiesFormatExceptionTest.class);
-        suite.addTestSuite(LinkedHashMapTest.class);
-        suite.addTestSuite(LinkedHashSetTest.class);
-        suite.addTestSuite(LinkedListTest.class);
-        suite.addTestSuite(ListResourceBundleTest.class);
-        suite.addTestSuite(LocaleTest.class);
-        suite.addTestSuite(MissingResourceExceptionTest.class);
-        suite.addTestSuite(NoSuchElementExceptionTest.class);
-        suite.addTestSuite(ObservableTest.class);
-        suite.addTestSuite(PropertyPermissionTest.class);
-        suite.addTestSuite(PropertyResourceBundleTest.class);
-        suite.addTestSuite(RandomTest.class);
-        suite.addTestSuite(ResourceBundleTest.class);
-        suite.addTestSuite(SimpleTimeZoneTest.class);
-        suite.addTestSuite(StackTest.class);
-        suite.addTestSuite(StringTokenizerTest.class);
-        suite.addTestSuite(TimerTaskTest.class);
-        suite.addTestSuite(TimerTest.class);
-        suite.addTestSuite(TooManyListenersExceptionTest.class);
-        suite.addTestSuite(VectorTest.class);
-        suite.addTestSuite(WeakHashMapTest.class);
-        // $JUnit-END$
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/util/ArrayListTest.java b/luni/src/test/java/tests/api/java/util/ArrayListTest.java
index 0356731..50d9aa3 100644
--- a/luni/src/test/java/tests/api/java/util/ArrayListTest.java
+++ b/luni/src/test/java/tests/api/java/util/ArrayListTest.java
@@ -16,11 +16,6 @@
  */
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -33,7 +28,6 @@
 
 import tests.support.Support_ListTest;
 
-@TestTargetClass(ArrayList.class)
 public class ArrayListTest extends junit.framework.TestCase {
 
     List alist;
@@ -41,14 +35,8 @@
     Object[] objArray;
 
     /**
-     * @tests java.util.ArrayList#ArrayList()
+     * java.util.ArrayList#ArrayList()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ArrayList",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.ArrayList()
         new Support_ListTest("", alist).runTest();
@@ -60,14 +48,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#ArrayList(int)
+     * java.util.ArrayList#ArrayList(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ArrayList",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.ArrayList(int)
         ArrayList al = new ArrayList(5);
@@ -82,14 +64,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#ArrayList(java.util.Collection)
+     * java.util.ArrayList#ArrayList(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Doesn't verify NullPointerException.",
-        method = "ArrayList",
-        args = {java.util.Collection.class}
-    )
     public void test_ConstructorLjava_util_Collection() {
         // Test for method java.util.ArrayList(java.util.Collection)
         ArrayList al = new ArrayList(Arrays.asList(objArray));
@@ -109,14 +85,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#add(int, java.lang.Object)
+     * java.util.ArrayList#add(int, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_addILjava_lang_Object() {
         // Test for method void java.util.ArrayList.add(int, java.lang.Object)
         Object o;
@@ -147,14 +117,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#add(java.lang.Object)
+     * java.util.ArrayList#add(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLjava_lang_Object() {
         // Test for method boolean java.util.ArrayList.add(java.lang.Object)
         Object o = new Object();
@@ -165,14 +129,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#addAll(int, java.util.Collection)
+     * java.util.ArrayList#addAll(int, java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAllILjava_util_Collection() {
         // Test for method boolean java.util.ArrayList.addAll(int,
         // java.util.Collection)
@@ -233,14 +191,8 @@
 // preference to NullPointerException when the caller desserves both.
 //
 //    /**
-//     * @tests java.util.ArrayList#addAll(int, java.util.Collection)
+//     * java.util.ArrayList#addAll(int, java.util.Collection)
 //     */
-//    @TestTargetNew(
-//        level = TestLevel.PARTIAL_COMPLETE,
-//        notes = "Verifies IndexOutOfBoundsException.",
-//        method = "addAll",
-//        args = {int.class, java.util.Collection.class}
-//    )
 //    public void test_addAllILjava_util_Collection_2() {
 //        // Regression for HARMONY-467
 //        ArrayList obj = new ArrayList();
@@ -253,14 +205,8 @@
 // END android-removed
 
     /**
-     * @tests java.util.ArrayList#addAll(java.util.Collection)
+     * java.util.ArrayList#addAll(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Doesn't verify NullPointerException.",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLjava_util_Collection() {
         // Test for method boolean
         // java.util.ArrayList.addAll(java.util.Collection)
@@ -319,14 +265,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#clear()
+     * java.util.ArrayList#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.ArrayList.clear()
         alist.clear();
@@ -345,14 +285,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#clone()
+     * java.util.ArrayList#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.ArrayList.clone()
         ArrayList x = (ArrayList) (((ArrayList) (alist)).clone());
@@ -373,14 +307,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#contains(java.lang.Object)
+     * java.util.ArrayList#contains(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "contains",
-        args = {java.lang.Object.class}
-    )
     public void test_containsLjava_lang_Object() {
         // Test for method boolean
         // java.util.ArrayList.contains(java.lang.Object)
@@ -398,14 +326,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#ensureCapacity(int)
+     * java.util.ArrayList#ensureCapacity(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ensureCapacity",
-        args = {int.class}
-    )
     public void test_ensureCapacityI() {
         // Test for method void java.util.ArrayList.ensureCapacity(int)
         // TODO : There is no good way to test this as it only really impacts on
@@ -437,14 +359,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#get(int)
+     * java.util.ArrayList#get(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {int.class}
-    )
     public void test_getI() {
         // Test for method java.lang.Object java.util.ArrayList.get(int)
         assertTrue("Returned incorrect element", alist.get(22) == objArray[22]);
@@ -456,14 +372,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#indexOf(java.lang.Object)
+     * java.util.ArrayList#indexOf(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "indexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_indexOfLjava_lang_Object() {
         // Test for method int java.util.ArrayList.indexOf(java.lang.Object)
         assertEquals("Returned incorrect index",
@@ -477,14 +387,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#isEmpty()
+     * java.util.ArrayList#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.ArrayList.isEmpty()
         assertTrue("isEmpty returned false for new list", new ArrayList()
@@ -494,14 +398,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#lastIndexOf(java.lang.Object)
+     * java.util.ArrayList#lastIndexOf(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastIndexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_lastIndexOfLjava_lang_Object() {
         // Test for method int java.util.ArrayList.lastIndexOf(java.lang.Object)
         alist.add(new Integer(99));
@@ -516,14 +414,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#remove(int)
+     * java.util.ArrayList#remove(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {int.class}
-    )
     public void test_removeI() {
         // Test for method java.lang.Object java.util.ArrayList.remove(int)
         alist.remove(10);
@@ -569,14 +461,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#set(int, java.lang.Object)
+     * java.util.ArrayList#set(int, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_setILjava_lang_Object() {
         // Test for method java.lang.Object java.util.ArrayList.set(int,
         // java.lang.Object)
@@ -604,14 +490,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#size()
+     * java.util.ArrayList#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.ArrayList.size()
         assertEquals("Returned incorrect size for exiting list",
@@ -621,14 +501,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#toArray()
+     * java.util.ArrayList#toArray()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {}
-    )
     public void test_toArray() {
         // Test for method java.lang.Object [] java.util.ArrayList.toArray()
         alist.set(25, null);
@@ -649,14 +523,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#toArray(java.lang.Object[])
+     * java.util.ArrayList#toArray(java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {java.lang.Object[].class}
-    )
     public void test_toArray$Ljava_lang_Object() {
         // Test for method java.lang.Object []
         // java.util.ArrayList.toArray(java.lang.Object [])
@@ -688,14 +556,8 @@
     }
 
     /**
-     * @tests java.util.ArrayList#trimToSize()
+     * java.util.ArrayList#trimToSize()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "trimToSize",
-        args = {}
-    )
     public void test_trimToSize_01() {
         // Test for method void java.util.ArrayList.trimToSize()
         for (int i = 99; i > 24; i--)
@@ -720,12 +582,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "trimToSize",
-        args = {}
-    )
     public void test_trimToSize_02() {
         ArrayList list = new ArrayList(Arrays.asList(new String[] { "a", "b", "c",
                 "d", "e", "f", "g" }));
@@ -737,12 +593,6 @@
     /**
      * @test java.util.ArrayList#addAll(int, Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify NullPointerException.",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAll() {
         ArrayList list = new ArrayList();
         list.add("one");
@@ -781,12 +631,6 @@
         assertEquals(14, list.size());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         List list = new ArrayList(Arrays.asList(new String[] { "a", "b", "c",
                 "d", "e", "f", "g" }));
@@ -807,12 +651,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeRange",
-        args = {int.class, int.class}
-    )
     public void test_removeRangeII() {
         Mock_ArrayList mal = new Mock_ArrayList();
         mal.add("a");
diff --git a/luni/src/test/java/tests/api/java/util/ArraysTest.java b/luni/src/test/java/tests/api/java/util/ArraysTest.java
index 1b22dba..81a5fc2 100644
--- a/luni/src/test/java/tests/api/java/util/ArraysTest.java
+++ b/luni/src/test/java/tests/api/java/util/ArraysTest.java
@@ -16,10 +16,6 @@
  */
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Arrays;
 import java.util.Comparator;
 import java.util.LinkedList;
@@ -28,7 +24,6 @@
 
 import tests.support.Support_UnmodifiableCollectionTest;
 
-@TestTargetClass(Arrays.class)
 public class ArraysTest extends junit.framework.TestCase {
 
     public static class ReversedIntegerComparator implements Comparator {
@@ -64,14 +59,8 @@
     short[] shortArray;
 
     /**
-     * @tests java.util.Arrays#asList(java.lang.Object[])
+     * java.util.Arrays#asList(java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "asList",
-        args = {java.lang.Object[].class}
-    )
     public void test_asList$Ljava_lang_Object() {
         // Test for method java.util.List
         // java.util.Arrays.asList(java.lang.Object [])
@@ -106,14 +95,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(byte[], byte)
+     * java.util.Arrays#binarySearch(byte[], byte)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {byte[].class, byte.class}
-    )
     public void test_binarySearch$BB() {
         // Test for method int java.util.Arrays.binarySearch(byte [], byte)
         for (byte counter = 0; counter < arraySize; counter++)
@@ -133,14 +116,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(char[], char)
+     * java.util.Arrays#binarySearch(char[], char)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {char[].class, char.class}
-    )
     public void test_binarySearch$CC() {
         // Test for method int java.util.Arrays.binarySearch(char [], char)
         for (char counter = 0; counter < arraySize; counter++)
@@ -155,14 +132,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(double[], double)
+     * java.util.Arrays#binarySearch(double[], double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {double[].class, double.class}
-    )
     public void test_binarySearch$DD() {
         // Test for method int java.util.Arrays.binarySearch(double [], double)
         for (int counter = 0; counter < arraySize; counter++)
@@ -195,14 +166,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(float[], float)
+     * java.util.Arrays#binarySearch(float[], float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {float[].class, float.class}
-    )
     public void test_binarySearch$FF() {
         // Test for method int java.util.Arrays.binarySearch(float [], float)
         for (int counter = 0; counter < arraySize; counter++)
@@ -234,14 +199,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(int[], int)
+     * java.util.Arrays#binarySearch(int[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {int[].class, int.class}
-    )
     public void test_binarySearch$II() {
         // Test for method int java.util.Arrays.binarySearch(int [], int)
         for (int counter = 0; counter < arraySize; counter++)
@@ -260,14 +219,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(long[], long)
+     * java.util.Arrays#binarySearch(long[], long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {long[].class, long.class}
-    )
     public void test_binarySearch$JJ() {
         // Test for method int java.util.Arrays.binarySearch(long [], long)
         for (long counter = 0; counter < arraySize; counter++)
@@ -287,15 +240,9 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(java.lang.Object[],
+     * java.util.Arrays#binarySearch(java.lang.Object[],
      *        java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {java.lang.Object[].class, java.lang.Object.class}
-    )
     public void test_binarySearch$Ljava_lang_ObjectLjava_lang_Object() {
         // Test for method int java.util.Arrays.binarySearch(java.lang.Object
         // [], java.lang.Object)
@@ -327,15 +274,9 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(java.lang.Object[],
+     * java.util.Arrays#binarySearch(java.lang.Object[],
      *        java.lang.Object, java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException.",
-        method = "binarySearch",
-        args = {java.lang.Object[].class, java.lang.Object.class, java.util.Comparator.class}
-    )
     public void test_binarySearch$Ljava_lang_ObjectLjava_lang_ObjectLjava_util_Comparator() {
         // Test for method int java.util.Arrays.binarySearch(java.lang.Object
         // [], java.lang.Object, java.util.Comparator)
@@ -355,14 +296,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#binarySearch(short[], short)
+     * java.util.Arrays#binarySearch(short[], short)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "binarySearch",
-        args = {short[].class, short.class}
-    )
     public void test_binarySearch$SS() {
         // Test for method int java.util.Arrays.binarySearch(short [], short)
         for (short counter = 0; counter < arraySize; counter++)
@@ -382,14 +317,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(byte[], byte)
+     * java.util.Arrays#fill(byte[], byte)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {byte[].class, byte.class}
-    )
     public void test_fill$BB() {
         // Test for method void java.util.Arrays.fill(byte [], byte)
 
@@ -401,14 +330,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(byte[], int, int, byte)
+     * java.util.Arrays#fill(byte[], int, int, byte)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {byte[].class, int.class, int.class, byte.class}
-    )
     public void test_fill$BIIB() {
         // Test for method void java.util.Arrays.fill(byte [], int, int, byte)
         byte val = Byte.MAX_VALUE;
@@ -450,14 +373,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(short[], short)
+     * java.util.Arrays#fill(short[], short)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {short[].class, short.class}
-    )
     public void test_fill$SS() {
         // Test for method void java.util.Arrays.fill(short [], short)
 
@@ -469,14 +386,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(short[], int, int, short)
+     * java.util.Arrays#fill(short[], int, int, short)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {short[].class, int.class, int.class, short.class}
-    )
     public void test_fill$SIIS() {
         // Test for method void java.util.Arrays.fill(short [], int, int, short)
         short val = Short.MAX_VALUE;
@@ -510,14 +421,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(char[], char)
+     * java.util.Arrays#fill(char[], char)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {char[].class, char.class}
-    )
     public void test_fill$CC() {
         // Test for method void java.util.Arrays.fill(char [], char)
 
@@ -528,14 +433,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(char[], int, int, char)
+     * java.util.Arrays#fill(char[], int, int, char)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {char[].class, int.class, int.class, char.class}
-    )
     public void test_fill$CIIC() {
         // Test for method void java.util.Arrays.fill(char [], int, int, char)
         char val = 'T';
@@ -569,14 +468,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(int[], int)
+     * java.util.Arrays#fill(int[], int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {int[].class, int.class}
-    )
     public void test_fill$II() {
         // Test for method void java.util.Arrays.fill(int [], int)
 
@@ -588,14 +481,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(int[], int, int, int)
+     * java.util.Arrays#fill(int[], int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {int[].class, int.class, int.class, int.class}
-    )
     public void test_fill$IIII() {
         // Test for method void java.util.Arrays.fill(int [], int, int, int)
         int val = Integer.MAX_VALUE;
@@ -629,14 +516,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(long[], long)
+     * java.util.Arrays#fill(long[], long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {long[].class, long.class}
-    )
     public void test_fill$JJ() {
         // Test for method void java.util.Arrays.fill(long [], long)
 
@@ -648,14 +529,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(long[], int, int, long)
+     * java.util.Arrays#fill(long[], int, int, long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {long[].class, int.class, int.class, long.class}
-    )
     public void test_fill$JIIJ() {
         // Test for method void java.util.Arrays.fill(long [], int, int, long)
         long d[] = new long[1000];
@@ -689,14 +564,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(float[], float)
+     * java.util.Arrays#fill(float[], float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {float[].class, float.class}
-    )
     public void test_fill$FF() {
         // Test for method void java.util.Arrays.fill(float [], float)
         float d[] = new float[1000];
@@ -707,14 +576,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(float[], int, int, float)
+     * java.util.Arrays#fill(float[], int, int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {float[].class, int.class, int.class, float.class}
-    )
     public void test_fill$FIIF() {
         // Test for method void java.util.Arrays.fill(float [], int, int, float)
         float val = Float.MAX_VALUE;
@@ -748,14 +611,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(double[], double)
+     * java.util.Arrays#fill(double[], double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {double[].class, double.class}
-    )
     public void test_fill$DD() {
         // Test for method void java.util.Arrays.fill(double [], double)
 
@@ -767,14 +624,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(double[], int, int, double)
+     * java.util.Arrays#fill(double[], int, int, double)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {double[].class, int.class, int.class, double.class}
-    )
     public void test_fill$DIID() {
         // Test for method void java.util.Arrays.fill(double [], int, int,
         // double)
@@ -809,14 +660,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(boolean[], boolean)
+     * java.util.Arrays#fill(boolean[], boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {boolean[].class, boolean.class}
-    )
     public void test_fill$ZZ() {
         // Test for method void java.util.Arrays.fill(boolean [], boolean)
 
@@ -827,14 +672,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(boolean[], int, int, boolean)
+     * java.util.Arrays#fill(boolean[], int, int, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {boolean[].class, int.class, int.class, boolean.class}
-    )
     public void test_fill$ZIIZ() {
         // Test for method void java.util.Arrays.fill(boolean [], int, int,
         // boolean)
@@ -869,14 +708,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(java.lang.Object[], java.lang.Object)
+     * java.util.Arrays#fill(java.lang.Object[], java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {java.lang.Object[].class, java.lang.Object.class}
-    )
     public void test_fill$Ljava_lang_ObjectLjava_lang_Object() {
         // Test for method void java.util.Arrays.fill(java.lang.Object [],
         // java.lang.Object)
@@ -888,15 +721,9 @@
     }
 
     /**
-     * @tests java.util.Arrays#fill(java.lang.Object[], int, int,
+     * java.util.Arrays#fill(java.lang.Object[], int, int,
      *        java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {java.lang.Object[].class, int.class, int.class, java.lang.Object.class}
-    )
     public void test_fill$Ljava_lang_ObjectIILjava_lang_Object() {
         // Test for method void java.util.Arrays.fill(java.lang.Object [], int,
         // int, java.lang.Object)
@@ -936,14 +763,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(byte[], byte[])
+     * java.util.Arrays#equals(byte[], byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {byte[].class, byte[].class}
-    )
     public void test_equals$B$B() {
         // Test for method boolean java.util.Arrays.equals(byte [], byte [])
         byte d[] = new byte[1000];
@@ -956,14 +777,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(short[], short[])
+     * java.util.Arrays#equals(short[], short[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {short[].class, short[].class}
-    )
     public void test_equals$S$S() {
         // Test for method boolean java.util.Arrays.equals(short [], short [])
         short d[] = new short[1000];
@@ -976,14 +791,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(char[], char[])
+     * java.util.Arrays#equals(char[], char[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {char[].class, char[].class}
-    )
     public void test_equals$C$C() {
         // Test for method boolean java.util.Arrays.equals(char [], char [])
         char d[] = new char[1000];
@@ -997,14 +806,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(int[], int[])
+     * java.util.Arrays#equals(int[], int[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {int[].class, int[].class}
-    )
     public void test_equals$I$I() {
         // Test for method boolean java.util.Arrays.equals(int [], int [])
         int d[] = new int[1000];
@@ -1022,14 +825,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(long[], long[])
+     * java.util.Arrays#equals(long[], long[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {long[].class, long[].class}
-    )
     public void test_equals$J$J() {
         // Test for method boolean java.util.Arrays.equals(long [], long [])
         long d[] = new long[1000];
@@ -1046,14 +843,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(float[], float[])
+     * java.util.Arrays#equals(float[], float[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {float[].class, float[].class}
-    )
     public void test_equals$F$F() {
         // Test for method boolean java.util.Arrays.equals(float [], float [])
         float d[] = new float[1000];
@@ -1071,14 +862,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(double[], double[])
+     * java.util.Arrays#equals(double[], double[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {double[].class, double[].class}
-    )
     public void test_equals$D$D() {
         // Test for method boolean java.util.Arrays.equals(double [], double [])
         double d[] = new double[1000];
@@ -1099,14 +884,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(boolean[], boolean[])
+     * java.util.Arrays#equals(boolean[], boolean[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {boolean[].class, boolean[].class}
-    )
     public void test_equals$Z$Z() {
         // Test for method boolean java.util.Arrays.equals(boolean [], boolean
         // [])
@@ -1120,14 +899,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#equals(java.lang.Object[], java.lang.Object[])
+     * java.util.Arrays#equals(java.lang.Object[], java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object[].class, java.lang.Object[].class}
-    )
     public void test_equals$Ljava_lang_Object$Ljava_lang_Object() {
         // Test for method boolean java.util.Arrays.equals(java.lang.Object [],
         // java.lang.Object [])
@@ -1144,14 +917,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(byte[])
+     * java.util.Arrays#sort(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {byte[].class}
-    )
     public void test_sort$B() {
         // Test for method void java.util.Arrays.sort(byte [])
         byte[] reversedArray = new byte[arraySize];
@@ -1164,14 +931,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(byte[], int, int)
+     * java.util.Arrays#sort(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {byte[].class, int.class, int.class}
-    )
     public void test_sort$BII() {
         // Test for method void java.util.Arrays.sort(byte [], int, int)
         int startIndex = arraySize / 4;
@@ -1221,14 +982,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(char[])
+     * java.util.Arrays#sort(char[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {char[].class}
-    )
     public void test_sort$C() {
         // Test for method void java.util.Arrays.sort(char [])
         char[] reversedArray = new char[arraySize];
@@ -1242,14 +997,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(char[], int, int)
+     * java.util.Arrays#sort(char[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {char[].class, int.class, int.class}
-    )
     public void test_sort$CII() {
         // Test for method void java.util.Arrays.sort(char [], int, int)
         int startIndex = arraySize / 4;
@@ -1299,14 +1048,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(double[])
+     * java.util.Arrays#sort(double[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {double[].class}
-    )
     public void test_sort$D() {
         // Test for method void java.util.Arrays.sort(double [])
         double[] reversedArray = new double[arraySize];
@@ -1343,14 +1086,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(double[], int, int)
+     * java.util.Arrays#sort(double[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {double[].class, int.class, int.class}
-    )
     public void test_sort$DII() {
         // Test for method void java.util.Arrays.sort(double [], int, int)
         int startIndex = arraySize / 4;
@@ -1400,14 +1137,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(float[])
+     * java.util.Arrays#sort(float[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {float[].class}
-    )
     public void test_sort$F() {
         // Test for method void java.util.Arrays.sort(float [])
         float[] reversedArray = new float[arraySize];
@@ -1444,14 +1175,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(float[], int, int)
+     * java.util.Arrays#sort(float[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {float[].class, int.class, int.class}
-    )
     public void test_sort$FII() {
         // Test for method void java.util.Arrays.sort(float [], int, int)
         int startIndex = arraySize / 4;
@@ -1501,14 +1226,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(int[])
+     * java.util.Arrays#sort(int[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {int[].class}
-    )
     public void test_sort$I() {
         // Test for method void java.util.Arrays.sort(int [])
         int[] reversedArray = new int[arraySize];
@@ -1521,14 +1240,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(int[], int, int)
+     * java.util.Arrays#sort(int[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {int[].class, int.class, int.class}
-    )
     public void test_sort$III() {
         // Test for method void java.util.Arrays.sort(int [], int, int)
         int startIndex = arraySize / 4;
@@ -1578,14 +1291,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(long[])
+     * java.util.Arrays#sort(long[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {long[].class}
-    )
     public void test_sort$J() {
         // Test for method void java.util.Arrays.sort(long [])
         long[] reversedArray = new long[arraySize];
@@ -1599,14 +1306,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(long[], int, int)
+     * java.util.Arrays#sort(long[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {long[].class, int.class, int.class}
-    )
     public void test_sort$JII() {
         // Test for method void java.util.Arrays.sort(long [], int, int)
         int startIndex = arraySize / 4;
@@ -1656,14 +1357,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(java.lang.Object[])
+     * java.util.Arrays#sort(java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {java.lang.Object[].class}
-    )
     public void test_sort$Ljava_lang_Object() {
         // Test for method void java.util.Arrays.sort(java.lang.Object [])
         Object[] reversedArray = new Object[arraySize];
@@ -1686,14 +1381,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(java.lang.Object[], int, int)
+     * java.util.Arrays#sort(java.lang.Object[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {java.lang.Object[].class, int.class, int.class}
-    )
     public void test_sort$Ljava_lang_ObjectII() {
         // Test for method void java.util.Arrays.sort(java.lang.Object [], int,
         // int)
@@ -1758,15 +1447,9 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(java.lang.Object[], int, int,
+     * java.util.Arrays#sort(java.lang.Object[], int, int,
      *        java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {java.lang.Object[].class, int.class, int.class, java.util.Comparator.class}
-    )
     public void test_sort$Ljava_lang_ObjectIILjava_util_Comparator() {
         // Test for method void java.util.Arrays.sort(java.lang.Object [], int,
         // int, java.util.Comparator)
@@ -1822,14 +1505,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(java.lang.Object[], java.util.Comparator)
+     * java.util.Arrays#sort(java.lang.Object[], java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {java.lang.Object[].class, java.util.Comparator.class}
-    )
     public void test_sort$Ljava_lang_ObjectLjava_util_Comparator() {
         // Test for method void java.util.Arrays.sort(java.lang.Object [],
         // java.util.Comparator)
@@ -1853,14 +1530,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(short[])
+     * java.util.Arrays#sort(short[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {short[].class}
-    )
     public void test_sort$S() {
         // Test for method void java.util.Arrays.sort(short [])
         short[] reversedArray = new short[arraySize];
@@ -1873,14 +1544,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(short[], int, int)
+     * java.util.Arrays#sort(short[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {short[].class, int.class, int.class}
-    )
     public void test_sort$SII() {
         // Test for method void java.util.Arrays.sort(short [], int, int)
         int startIndex = arraySize / 4;
@@ -1930,14 +1595,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(byte[], int, int)
+     * java.util.Arrays#sort(byte[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {byte[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_byte_array_NPE() {
         byte[] byte_array_null = null;
         try {
@@ -1956,14 +1615,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(char[], int, int)
+     * java.util.Arrays#sort(char[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {char[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_char_array_NPE() {
         char[] char_array_null = null;
         try {
@@ -1982,14 +1635,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(double[], int, int)
+     * java.util.Arrays#sort(double[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {double[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_double_array_NPE() {
         double[] double_array_null = null;
         try {
@@ -2008,14 +1655,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(float[], int, int)
+     * java.util.Arrays#sort(float[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {float[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_float_array_NPE() {
         float[] float_array_null = null;
         try {
@@ -2034,14 +1675,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(int[], int, int)
+     * java.util.Arrays#sort(int[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {int[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_int_array_NPE() {
         int[] int_array_null = null;
         try {
@@ -2060,14 +1695,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(Object[], int, int)
+     * java.util.Arrays#sort(Object[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {java.lang.Object[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_object_array_NPE() {
         Object[] object_array_null = null;
         try {
@@ -2093,14 +1722,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(long[], int, int)
+     * java.util.Arrays#sort(long[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {long[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_long_array_NPE() {
         long[] long_array_null = null;
         try {
@@ -2119,14 +1742,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#sort(short[], int, int)
+     * java.util.Arrays#sort(short[], int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "sort",
-        args = {short[].class, int.class, int.class}
-    )
     public void test_java_util_Arrays_sort_short_array_NPE() {
         short[] short_array_null = null;
         try {
@@ -2148,13 +1765,8 @@
     private static final int[] LENGTHS = { 0, 1, 2, 3, 5, 8, 13, 21, 34, 55, 100, 1000, 10000 };
 
     /**
-     * @tests java.util.Arrays#sort()
+     * java.util.Arrays#sort()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Agressive test of the sort methods for *all* primitive array types",
-        method = "sort"
-    )
     public void test_sort() {
         for (int len : LENGTHS) {
             PrimitiveTypeArrayBuilder.reset();
@@ -2588,14 +2200,8 @@
 
 
     /**
-     * @tests java.util.Arrays#deepEquals(Object[], Object[])
+     * java.util.Arrays#deepEquals(Object[], Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "deepEquals",
-        args = {java.lang.Object[].class, java.lang.Object[].class}
-    )
     public void test_deepEquals$Ljava_lang_ObjectLjava_lang_Object() {
        int [] a1 = {1, 2, 3};
        short [] a2 = {0, 1};
@@ -2618,14 +2224,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#deepHashCode(Object[])
+     * java.util.Arrays#deepHashCode(Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "deepHashCode",
-        args = {java.lang.Object[].class}
-    )
     public void test_deepHashCode$Ljava_lang_Object() {
         int [] a1 = {1, 2, 3};
         short [] a2 = {0, 1};
@@ -2645,14 +2245,8 @@
      }
 
     /**
-     * @tests java.util.Arrays#hashCode(boolean[] a)
+     * java.util.Arrays#hashCode(boolean[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {boolean[].class}
-    )
     public void test_hashCode$LZ() {
         int listHashCode;
         int arrayHashCode;
@@ -2668,14 +2262,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(int[] a)
+     * java.util.Arrays#hashCode(int[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {int[].class}
-    )
     public void test_hashCode$LI() {
         int listHashCode;
         int arrayHashCode;
@@ -2695,14 +2283,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(char[] a)
+     * java.util.Arrays#hashCode(char[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {char[].class}
-    )
     public void test_hashCode$LC() {
         int listHashCode;
         int arrayHashCode;
@@ -2718,14 +2300,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(byte[] a)
+     * java.util.Arrays#hashCode(byte[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {byte[].class}
-    )
     public void test_hashCode$LB() {
         int listHashCode;
         int arrayHashCode;
@@ -2741,14 +2317,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(long[] a)
+     * java.util.Arrays#hashCode(long[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {long[].class}
-    )
     public void test_hashCode$LJ() {
         int listHashCode;
         int arrayHashCode;
@@ -2765,14 +2335,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(float[] a)
+     * java.util.Arrays#hashCode(float[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {float[].class}
-    )
     public void test_hashCode$LF() {
         int listHashCode;
         int arrayHashCode;
@@ -2791,14 +2355,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(double[] a)
+     * java.util.Arrays#hashCode(double[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {double[].class}
-    )
     public void test_hashCode$LD() {
         int listHashCode;
         int arrayHashCode;
@@ -2814,14 +2372,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(short[] a)
+     * java.util.Arrays#hashCode(short[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {short[].class}
-    )
     public void test_hashCode$LS() {
         int listHashCode;
         int arrayHashCode;
@@ -2837,14 +2389,8 @@
     }
 
     /**
-     * @tests java.util.Arrays#hashCode(Object[] a)
+     * java.util.Arrays#hashCode(Object[] a)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {java.lang.Object[].class}
-    )
     public void test_hashCode$Ljava_lang_Object() {
         int listHashCode;
         int arrayHashCode;
diff --git a/luni/src/test/java/tests/api/java/util/BitSetTest.java b/luni/src/test/java/tests/api/java/util/BitSetTest.java
index 6dcd738..172c6d1 100644
--- a/luni/src/test/java/tests/api/java/util/BitSetTest.java
+++ b/luni/src/test/java/tests/api/java/util/BitSetTest.java
@@ -17,48 +17,20 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.BitSet;
 
-@TestTargetClass(BitSet.class)
 public class BitSetTest extends junit.framework.TestCase {
 
     BitSet eightbs;
 
-    /**
-     * @tests java.util.BitSet#BitSet()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "BitSet",
-        args = {}
-    )
     public void test_Constructor() {
-        // Test for method java.util.BitSet()
         BitSet bs = new BitSet();
         // Default size for a BitSet should be 64 elements;
-
         assertEquals("Created BitSet of incorrect size", 64, bs.size());
-        assertEquals("New BitSet had invalid string representation", "{}", bs
-                .toString());
+        assertEquals("New BitSet had invalid string representation", "{}", bs.toString());
     }
 
-    /**
-     * @tests java.util.BitSet#BitSet(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "BitSet",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
-        // Test for method java.util.BitSet(int)
         BitSet bs = new BitSet(128);
         // Default size for a BitSet should be 64 elements;
 
@@ -73,41 +45,18 @@
 
         try {
             bs = new BitSet(-9);
-            fail(
-                    "Failed to throw exception when creating a new BitSet with negative elements value");
-        } catch (NegativeArraySizeException e) {
-            // Correct behaviour
+            fail();
+        } catch (NegativeArraySizeException expected) {
         }
     }
 
-    /**
-     * @tests java.util.BitSet#clone()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
-        // Test for method java.lang.Object java.util.BitSet.clone()
-        BitSet bs;
-        bs = (BitSet) eightbs.clone();
+        BitSet bs = (BitSet) eightbs.clone();
         assertTrue("Clone failed to return equal BitSet", eightbs.equals(bs));
 
     }
 
-    /**
-     * @tests java.util.BitSet#equals(java.lang.Object)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
-        // Test for method boolean java.util.BitSet.equals(java.lang.Object)
         BitSet bs;
 
         bs = (BitSet) eightbs.clone();
@@ -118,145 +67,118 @@
         // Grow the BitSet
         bs = (BitSet) eightbs.clone();
         bs.set(128);
-        assertTrue("Different sized BitSet with higher bit set returned true",
-                !eightbs.equals(bs));
+        assertFalse(eightbs.equals(bs));
         bs.clear(128);
-        assertTrue(
-                "Different sized BitSet with higher bits not set returned false",
-                eightbs.equals(bs));
+        assertTrue(eightbs.equals(bs));
     }
 
-    /**
-     * @tests java.util.BitSet#hashCode()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
-        // Test for method int java.util.BitSet.hashCode()
         BitSet bs = (BitSet) eightbs.clone();
         bs.clear(2);
         bs.clear(6);
-        assertTrue("BitSet returns wrong hash value: " + bs.hashCode(), bs
-                .hashCode() == 1129);
+        assertEquals("BitSet returns wrong hash value", 1129, bs.hashCode());
         bs.set(10);
         bs.clear(3);
-        assertTrue("BitSet returns wrong hash value: " + bs.hashCode(), bs
-                .hashCode() == 97);
+        assertEquals("BitSet returns wrong hash value", 97, bs.hashCode());
     }
 
-    /**
-     * @tests java.util.BitSet#clear()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         eightbs.clear();
-        for (int i = 0; i < 8; i++)
+        for (int i = 0; i < 8; i++) {
             assertTrue("Clear didn't clear bit " + i, !eightbs.get(i));
+        }
         assertEquals("Test1: Wrong length", 0, eightbs.length());
 
         BitSet bs = new BitSet(3400);
         bs.set(0, bs.size() - 1); // ensure all bits are 1's
         bs.set(bs.size() - 1);
         bs.clear();
-        assertEquals("Test2: Wrong length", 0, bs.length());
-        assertTrue("Test2: isEmpty() returned incorrect value", bs
-                .isEmpty());
-        assertEquals("Test2: cardinality() returned incorrect value", 0, bs
-                .cardinality());
+        assertEquals(0, bs.length());
+        assertTrue(bs.isEmpty());
+        assertEquals(0, bs.cardinality());
     }
 
-    /**
-     * @tests java.util.BitSet#clear(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {int.class}
-    )
     public void test_clearI() {
-        // Test for method void java.util.BitSet.clear(int)
-
         eightbs.clear(7);
-        assertTrue("Failed to clear bit", !eightbs.get(7));
+        assertFalse("Failed to clear bit", eightbs.get(7));
 
         // Check to see all other bits are still set
         for (int i = 0; i < 7; i++)
-            assertTrue("Clear cleared incorrect bits", eightbs.get(i));
+        assertTrue("Clear cleared incorrect bits", eightbs.get(i));
 
         eightbs.clear(165);
-        assertTrue("Failed to clear bit", !eightbs.get(165));
+        assertFalse("Failed to clear bit", eightbs.get(165));
         // Try out of range
         try {
             eightbs.clear(-1);
-            fail("Failed to throw expected out of bounds exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         BitSet bs = new BitSet(0);
-        assertTrue("Test1: Wrong length, " + bs.size(), bs.length() == 0);
+        assertEquals("Test1: Wrong length,", 0, bs.length());
+        assertEquals("Test1: Wrong size,", 0, bs.size());
+
         bs.clear(0);
-        assertTrue("Test2: Wrong length" + bs.size(), bs.length() == 0);
+        assertEquals("Test2: Wrong length,", 0, bs.length());
+        assertEquals("Test2: Wrong size,", 0, bs.size());
+
+        bs.clear(60);
+        assertEquals("Test3: Wrong length,", 0, bs.length());
+        assertEquals("Test3: Wrong size,", 0, bs.size());
+
+        bs.clear(120);
+        assertEquals("Test4: Wrong size,", 0, bs.size());
+        assertEquals("Test4: Wrong length,", 0, bs.length());
+
+        bs.set(25);
+        assertEquals("Test5: Wrong size,", 64, bs.size());
+        assertEquals("Test5: Wrong length,", 26, bs.length());
+
+        bs.clear(80);
+        assertEquals("Test6: Wrong size,", 64, bs.size());
+        assertEquals("Test6: Wrong length,", 26, bs.length());
+
+        bs.clear(25);
+        assertEquals("Test7: Wrong size,", 64, bs.size());
+        assertEquals("Test7: Wrong length,", 0, bs.length());
     }
 
-    /**
-     * @tests java.util.BitSet#clear(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {int.class, int.class}
-    )
     public void test_clearII() {
-        // Test for method void java.util.BitSet.clear(int, int)
+        // Regression for HARMONY-98
+        BitSet bitset = new BitSet();
+        for (int i = 0; i < 20; i++) {
+            bitset.set(i);
+        }
+        bitset.clear(10, 10);
+
         // pos1 and pos2 are in the same bitset element
         BitSet bs = new BitSet(16);
         int initialSize = bs.size();
+        assertEquals(64, initialSize);
         bs.set(0, initialSize);
         bs.clear(5);
         bs.clear(15);
         bs.clear(7, 11);
-        for (int i = 0; i < 7; i++) {
-            if (i == 5)
-                assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-            else
-                assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        }
-        for (int i = 7; i < 11; i++)
-            assertTrue("Failed to clear bit " + i, !bs.get(i));
-
-        for (int i = 11; i < initialSize; i++) {
-            if (i == 15)
-                assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-            else
-                assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        }
-
+        assertEquals("{0, 1, 2, 3, 4, 6, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, " +
+                "26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, " +
+                "46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}", bs.toString());
         for (int i = initialSize; i < bs.size(); i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
         }
 
-        // pos1 and pos2 is in the same bitset element, boundary testing
+        // pos1 and pos2 is in the same bitset element, boundry testing
         bs = new BitSet(16);
         initialSize = bs.size();
         bs.set(0, initialSize);
         bs.clear(7, 64);
         assertEquals("Failed to grow BitSet", 64, bs.size());
-        for (int i = 0; i < 7; i++)
+        for (int i = 0; i < 7; i++) {
             assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-        for (int i = 7; i < 64; i++)
-            assertTrue("Failed to clear bit " + i, !bs.get(i));
+        }
+        for (int i = 7; i < 64; i++) {
+            assertFalse("Failed to clear bit " + i, bs.get(i));
+        }
         for (int i = 64; i < bs.size(); i++) {
             assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
         }
@@ -265,20 +187,22 @@
         initialSize = bs.size();
         bs.set(0, initialSize);
         bs.clear(0, 64);
-        for (int i = 0; i < 64; i++)
-            assertTrue("Failed to clear bit " + i, !bs.get(i));
+        for (int i = 0; i < 64; i++) {
+            assertFalse("Failed to clear bit " + i, bs.get(i));
+        }
         for (int i = 64; i < bs.size(); i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
         }
 
         bs = new BitSet(32);
         initialSize = bs.size();
         bs.set(0, initialSize);
         bs.clear(0, 65);
-        for (int i = 0; i < 65; i++)
-            assertTrue("Failed to clear bit " + i, !bs.get(i));
+        for (int i = 0; i < 65; i++) {
+            assertFalse("Failed to clear bit " + i, bs.get(i));
+        }
         for (int i = 65; i < bs.size(); i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
         }
 
         // pos1 and pos2 are in two sequential bitset elements
@@ -289,21 +213,24 @@
         bs.clear(110);
         bs.clear(9, 74);
         for (int i = 0; i < 9; i++) {
-            if (i == 7)
-                assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-            else
+            if (i == 7) {
+                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+            } else {
                 assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
+            }
         }
-        for (int i = 9; i < 74; i++)
-            assertTrue("Failed to clear bit " + i, !bs.get(i));
+        for (int i = 9; i < 74; i++) {
+            assertFalse("Failed to clear bit " + i, bs.get(i));
+        }
         for (int i = 74; i < initialSize; i++) {
-            if (i == 110)
-                assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-            else
+            if (i == 110) {
+                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+            } else {
                 assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
+            }
         }
         for (int i = initialSize; i < bs.size(); i++) {
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
         }
 
         // pos1 and pos2 are in two non-sequential bitset elements
@@ -313,90 +240,122 @@
         bs.clear(255);
         bs.clear(9, 219);
         for (int i = 0; i < 9; i++) {
-            if (i == 7)
-                assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-            else
+            if (i == 7) {
+                assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+            } else {
                 assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
+            }
         }
 
-        for (int i = 9; i < 219; i++)
-            assertTrue("failed to clear bit " + i, !bs.get(i));
-
-        for (int i = 219; i < 255; i++)
+        for (int i = 9; i < 219; i++) {
+            assertFalse("failed to clear bit " + i, bs.get(i));
+        }
+        for (int i = 219; i < 255; i++) {
             assertTrue("Shouldn't have cleared bit " + i, bs.get(i));
-
-        for (int i = 255; i < bs.size(); i++)
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+        }
+        for (int i = 255; i < bs.size(); i++) {
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+        }
 
         // test illegal args
         bs = new BitSet(10);
         try {
             bs.clear(-1, 3);
-            fail(
-                    "Test1: Attempt to flip with  negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             bs.clear(2, -1);
-            fail(
-                    "Test2: Attempt to flip with negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
+        bs.set(2, 4);
+        bs.clear(2, 2);
+        assertTrue("Bit got cleared incorrectly ", bs.get(2));
+
         try {
             bs.clear(4, 2);
-            fail(
-                    "Test4: Attempt to flip with illegal args failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
+
+        bs = new BitSet(0);
+        assertEquals("Test1: Wrong length,", 0, bs.length());
+        assertEquals("Test1: Wrong size,", 0, bs.size());
+
+        bs.clear(0, 2);
+        assertEquals("Test2: Wrong length,", 0, bs.length());
+        assertEquals("Test2: Wrong size,", 0, bs.size());
+
+        bs.clear(60, 64);
+        assertEquals("Test3: Wrong length,", 0, bs.length());
+        assertEquals("Test3: Wrong size,", 0, bs.size());
+
+        bs.clear(64, 120);
+        assertEquals("Test4: Wrong length,", 0, bs.length());
+        assertEquals("Test4: Wrong size,", 0, bs.size());
+
+        bs.set(25);
+        assertEquals("Test5: Wrong length,", 26, bs.length());
+        assertEquals("Test5: Wrong size,", 64, bs.size());
+
+        bs.clear(60, 64);
+        assertEquals("Test6: Wrong length,", 26, bs.length());
+        assertEquals("Test6: Wrong size,", 64, bs.size());
+
+        bs.clear(64, 120);
+        assertEquals("Test7: Wrong size,", 64, bs.size());
+        assertEquals("Test7: Wrong length,", 26, bs.length());
+
+        bs.clear(80);
+        assertEquals("Test8: Wrong size,", 64, bs.size());
+        assertEquals("Test8: Wrong length,", 26, bs.length());
+
+        bs.clear(25);
+        assertEquals("Test9: Wrong size,", 64, bs.size());
+        assertEquals("Test9: Wrong length,", 0, bs.length());
     }
 
-    /**
-     * @tests java.util.BitSet#get(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {int.class}
-    )
     public void test_getI() {
-        // Test for method boolean java.util.BitSet.get(int)
-
         BitSet bs = new BitSet();
         bs.set(8);
-        assertTrue("Get returned true for index out of range", !eightbs.get(99));
+        assertFalse("Get returned true for index out of range", eightbs.get(99));
         assertTrue("Get returned false for set value", eightbs.get(3));
-        assertTrue("Get returned true for a non set value", !bs.get(0));
+        assertFalse("Get returned true for a non set value", bs.get(0));
 
         try {
             bs.get(-1);
-            fail(
-                    "Attempt to get at negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         bs = new BitSet(1);
-        assertTrue("Access greater than size", !bs.get(64));
+        assertFalse("Access greater than size", bs.get(64));
 
         bs = new BitSet();
         bs.set(63);
         assertTrue("Test highest bit", bs.get(63));
+
+        bs = new BitSet(0);
+        assertEquals("Test1: Wrong length,", 0, bs.length());
+        assertEquals("Test1: Wrong size,", 0, bs.size());
+
+        bs.get(2);
+        assertEquals("Test2: Wrong length,", 0, bs.length());
+        assertEquals("Test2: Wrong size,", 0, bs.size());
+
+        bs.get(70);
+        assertEquals("Test3: Wrong length,", 0, bs.length());
+        assertEquals("Test3: Wrong size,", 0, bs.size());
+
     }
 
-    /**
-     * @tests java.util.BitSet#get(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {int.class, int.class}
-    )
     public void test_getII() {
-        // Test for method boolean java.util.BitSet.get(int, int)
+        BitSet bitset = new BitSet(30);
+        bitset.get(3, 3);
+
         BitSet bs, resultbs, correctbs;
         bs = new BitSet(512);
         bs.set(3, 9);
@@ -409,15 +368,13 @@
         resultbs = bs.get(3, 6);
         correctbs = new BitSet(3);
         correctbs.set(0, 3);
-        assertTrue("Test1: Returned incorrect BitSet", resultbs
-                .equals(correctbs));
+        assertEquals("Test1: Returned incorrect BitSet", correctbs, resultbs);
 
         // pos1 and pos2 are in the same bitset element, at index 1
         resultbs = bs.get(100, 125);
         correctbs = new BitSet(25);
         correctbs.set(21);
-        assertTrue("Test2: Returned incorrect BitSet", resultbs
-                .equals(correctbs));
+        assertEquals("Test2: Returned incorrect BitSet", correctbs, resultbs);
 
         // pos1 in bitset element at index 0, and pos2 in bitset element at
         // index 1
@@ -426,8 +383,7 @@
         correctbs.set(0, 5);
         correctbs.set(45, 60);
         correctbs.set(121 - 15);
-        assertTrue("Test3: Returned incorrect BitSet", resultbs
-                .equals(correctbs));
+        assertEquals("Test3: Returned incorrect BitSet", correctbs, resultbs);
 
         // pos1 in bitset element at index 1, and pos2 in bitset element at
         // index 2
@@ -436,8 +392,7 @@
         correctbs.set(0, 5);
         correctbs.set(51);
         correctbs.set(60, 70);
-        assertTrue("Test4: Returned incorrect BitSet", resultbs
-                .equals(correctbs));
+        assertEquals("Test4: Returned incorrect BitSet", correctbs, resultbs);
 
         // pos1 in bitset element at index 0, and pos2 in bitset element at
         // index 2
@@ -448,8 +403,7 @@
         correctbs.set(55, 70);
         correctbs.set(116);
         correctbs.set(125, 135);
-        assertTrue("Test5: Returned incorrect BitSet", resultbs
-                .equals(correctbs));
+        assertEquals("Test5: Returned incorrect BitSet", correctbs, resultbs);
 
         // pos1 in bitset element at index 0, and pos2 in bitset element at
         // index 3
@@ -460,10 +414,9 @@
         correctbs.set(55, 70);
         correctbs.set(116);
         correctbs.set(125, 135);
-        assertTrue("Test6: Returned incorrect BitSet", resultbs
-                .equals(correctbs));
+        assertEquals("Test6: Returned incorrect BitSet", correctbs, resultbs);
 
-        assertTrue("equality principle", bs.equals(bs.get(0, bs.size())));
+        assertEquals("equality principle 1 ", bs.get(0, bs.size()), bs);
 
         // more tests
         BitSet bs2 = new BitSet(129);
@@ -475,8 +428,7 @@
         correctbs.set(0, 19);
         correctbs.set(61, 64);
         correctbs.set(120, 122);
-        assertTrue("Test6: Returned incorrect BitSet", resultbs
-                .equals(correctbs));
+        assertEquals("Test7: Returned incorrect BitSet", correctbs, resultbs);
 
         // equality principle with some boundary conditions
         bs2 = new BitSet(128);
@@ -485,7 +437,7 @@
         bs2.set(121, 123);
         bs2.set(127);
         resultbs = bs2.get(0, bs2.size());
-        assertTrue("equality principle", bs2.equals(resultbs));
+        assertEquals("equality principle 2 ", resultbs, bs2);
 
         bs2 = new BitSet(128);
         bs2.set(2, 20);
@@ -494,52 +446,72 @@
         bs2.set(127);
         bs2.flip(0, 128);
         resultbs = bs2.get(0, bs.size());
-        assertTrue("equality principle", bs2.equals(resultbs));
+        assertEquals("equality principle 3 ", resultbs, bs2);
+
+        bs = new BitSet(0);
+        assertEquals("Test1: Wrong length,", 0, bs.length());
+        assertEquals("Test1: Wrong size,", 0, bs.size());
+
+        bs.get(0, 2);
+        assertEquals("Test2: Wrong length,", 0, bs.length());
+        assertEquals("Test2: Wrong size,", 0, bs.size());
+
+        bs.get(60, 64);
+        assertEquals("Test3: Wrong length,", 0, bs.length());
+        assertEquals("Test3: Wrong size,", 0, bs.size());
+
+        bs.get(64, 120);
+        assertEquals("Test4: Wrong length,", 0, bs.length());
+        assertEquals("Test4: Wrong size,", 0, bs.size());
+
+        bs.set(25);
+        assertEquals("Test5: Wrong length,", 26, bs.length());
+        assertEquals("Test5: Wrong size,", 64, bs.size());
+
+        bs.get(60, 64);
+        assertEquals("Test6: Wrong length,", 26, bs.length());
+        assertEquals("Test6: Wrong size,", 64, bs.size());
+
+        bs.get(64, 120);
+        assertEquals("Test7: Wrong size,", 64, bs.size());
+        assertEquals("Test7: Wrong length,", 26, bs.length());
+
+        bs.get(80);
+        assertEquals("Test8: Wrong size,", 64, bs.size());
+        assertEquals("Test8: Wrong length,", 26, bs.length());
+
+        bs.get(25);
+        assertEquals("Test9: Wrong size,", 64, bs.size());
+        assertEquals("Test9: Wrong length,", 26, bs.length());
 
         try {
             bs2.get(-1, 0);
-            fail("IndexOutOfBoundsException expected");
-        } catch (IndexOutOfBoundsException e) {
-            //expected
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             bs2.get(bs2.size()/2, 0);
-            fail("IndexOutOfBoundsException expected");
-        } catch (IndexOutOfBoundsException e) {
-            //expected
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             bs2.get(bs2.size()/2, -1);
-            fail("IndexOutOfBoundsException expected");
-        } catch (IndexOutOfBoundsException e) {
-            //expected
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
     }
 
-    /**
-     * @tests java.util.BitSet#set(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class}
-    )
     public void test_setI() {
-        // Test for method void java.util.BitSet.set(int)
-
         BitSet bs = new BitSet();
         bs.set(8);
         assertTrue("Failed to set bit", bs.get(8));
 
         try {
             bs.set(-1);
-            fail(
-                    "Attempt to set at negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         // Try setting a bit on a 64 boundary
@@ -565,17 +537,7 @@
         assertTrue("Test2: Wrong length" + bs.size(), bs.length() == 1);
     }
 
-    /**
-     * @tests java.util.BitSet#set(int, boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, boolean.class}
-    )
     public void test_setIZ() {
-        // Test for method void java.util.BitSet.set(int, boolean)
         eightbs.set(5, false);
         assertTrue("Should have set bit 5 to true", !eightbs.get(5));
 
@@ -584,65 +546,51 @@
 
         try {
             eightbs.set(-5, false);
-            fail("IndexOutOfBoundsException expected");
-        } catch (IndexOutOfBoundsException e) {
-            //expected
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
     }
 
-    /**
-     * @tests java.util.BitSet#set(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, int.class}
-    )
     public void test_setII() {
-        // Test for method void java.util.BitSet.set(int, int)
+        BitSet bitset = new BitSet(30);
+        bitset.set(29, 29);
+
         // pos1 and pos2 are in the same bitset element
         BitSet bs = new BitSet(16);
         bs.set(5);
         bs.set(15);
         bs.set(7, 11);
-        for (int i = 0; i < 7; i++) {
-            if (i == 5)
-                assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have set bit " + i, !bs.get(i));
-        }
-        for (int i = 7; i < 11; i++)
-            assertTrue("Failed to set bit " + i, bs.get(i));
-        for (int i = 11; i < bs.size(); i++) {
-            if (i == 15)
-                assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have set bit " + i, !bs.get(i));
+        assertEquals("{5, 7, 8, 9, 10, 15}", bs.toString());
+        for (int i = 16; i < bs.size(); i++) {
+            assertFalse("Shouldn't have set bit " + i, bs.get(i));
         }
 
-        // pos1 and pos2 is in the same bitset element, boundary testing
+        // pos1 and pos2 is in the same bitset element, boundry testing
         bs = new BitSet(16);
         bs.set(7, 64);
         assertEquals("Failed to grow BitSet", 64, bs.size());
-        for (int i = 0; i < 7; i++)
-            assertTrue("Shouldn't have set bit " + i, !bs.get(i));
-        for (int i = 7; i < 64; i++)
+        for (int i = 0; i < 7; i++) {
+            assertFalse("Shouldn't have set bit " + i, bs.get(i));
+        }
+        for (int i = 7; i < 64; i++) {
             assertTrue("Failed to set bit " + i, bs.get(i));
-        assertTrue("Shouldn't have set bit 64", !bs.get(64));
+        }
+        assertFalse("Shouldn't have set bit 64", bs.get(64));
 
         // more boundary testing
         bs = new BitSet(32);
         bs.set(0, 64);
-        for (int i = 0; i < 64; i++)
+        for (int i = 0; i < 64; i++) {
             assertTrue("Failed to set bit " + i, bs.get(i));
-        assertTrue("Shouldn't have set bit 64", !bs.get(64));
+        }
+        assertFalse("Shouldn't have set bit 64", bs.get(64));
 
         bs = new BitSet(32);
         bs.set(0, 65);
-        for (int i = 0; i < 65; i++)
+        for (int i = 0; i < 65; i++) {
             assertTrue("Failed to set bit " + i, bs.get(i));
-        assertTrue("Shouldn't have set bit 65", !bs.get(65));
+        }
+        assertFalse("Shouldn't have set bit 65", bs.get(65));
 
         // pos1 and pos2 are in two sequential bitset elements
         bs = new BitSet(128);
@@ -650,18 +598,21 @@
         bs.set(110);
         bs.set(9, 74);
         for (int i = 0; i < 9; i++) {
-            if (i == 7)
+            if (i == 7) {
                 assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have set bit " + i, !bs.get(i));
+            } else {
+                assertFalse("Shouldn't have set bit " + i, bs.get(i));
+            }
         }
-        for (int i = 9; i < 74; i++)
+        for (int i = 9; i < 74; i++) {
             assertTrue("Failed to set bit " + i, bs.get(i));
+        }
         for (int i = 74; i < bs.size(); i++) {
-            if (i == 110)
+            if (i == 110) {
                 assertTrue("Shouldn't have flipped bit " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have set bit " + i, !bs.get(i));
+            } else {
+                assertFalse("Shouldn't have set bit " + i, bs.get(i));
+            }
         }
 
         // pos1 and pos2 are in two non-sequential bitset elements
@@ -670,17 +621,20 @@
         bs.set(255);
         bs.set(9, 219);
         for (int i = 0; i < 9; i++) {
-            if (i == 7)
+            if (i == 7) {
                 assertTrue("Shouldn't have set flipped " + i, bs.get(i));
-            else
-                assertTrue("Shouldn't have set bit " + i, !bs.get(i));
+            } else {
+                assertFalse("Shouldn't have set bit " + i, bs.get(i));
+            }
         }
 
-        for (int i = 9; i < 219; i++)
+        for (int i = 9; i < 219; i++) {
             assertTrue("failed to set bit " + i, bs.get(i));
+        }
 
-        for (int i = 219; i < 255; i++)
-            assertTrue("Shouldn't have set bit " + i, !bs.get(i));
+        for (int i = 219; i < 255; i++) {
+            assertFalse("Shouldn't have set bit " + i, bs.get(i));
+        }
 
         assertTrue("Shouldn't have flipped bit 255", bs.get(255));
 
@@ -688,37 +642,27 @@
         bs = new BitSet(10);
         try {
             bs.set(-1, 3);
-            fail(
-                    "Test1: Attempt to flip with  negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             bs.set(2, -1);
-            fail(
-                    "Test2: Attempt to flip with negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
+        bs.set(2, 2);
+        assertFalse("Bit got set incorrectly ", bs.get(2));
+
         try {
             bs.set(4, 2);
-            fail(
-                    "Test4: Attempt to flip with illegal args failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
     }
 
-    /**
-     * @tests java.util.BitSet#set(int, int, boolean)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, int.class, boolean.class}
-    )
     public void test_setIIZ() {
-        // Test for method void java.util.BitSet.set(int, int, boolean)
         eightbs.set(3, 6, false);
         assertTrue("Should have set bits 3, 4, and 5 to false", !eightbs.get(3)
                 && !eightbs.get(4) && !eightbs.get(5));
@@ -729,43 +673,30 @@
 
         try {
             eightbs.set(-3, 6, false);
-            fail("IndexOutOfBoundsException expected");
-        } catch (IndexOutOfBoundsException e) {
-            //expected
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             eightbs.set(3, -6, false);
-            fail("IndexOutOfBoundsException expected");
-        } catch (IndexOutOfBoundsException e) {
-            //expected
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             eightbs.set(6, 3, false);
-            fail("IndexOutOfBoundsException expected");
-        } catch (IndexOutOfBoundsException e) {
-            //expected
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
     }
 
-    /**
-     * @tests java.util.BitSet#flip(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "flip",
-        args = {int.class}
-    )
     public void test_flipI() {
-        // Test for method void java.util.BitSet.flip(int)
         BitSet bs = new BitSet();
         bs.clear(8);
         bs.clear(9);
         bs.set(10);
         bs.flip(9);
-        assertTrue("Failed to flip bit", !bs.get(8));
+        assertFalse("Failed to flip bit", bs.get(8));
         assertTrue("Failed to flip bit", bs.get(9));
         assertTrue("Failed to flip bit", bs.get(10));
 
@@ -774,15 +705,13 @@
         bs.clear(10);
         bs.flip(9);
         assertTrue("Failed to flip bit", bs.get(8));
-        assertTrue("Failed to flip bit", !bs.get(9));
-        assertTrue("Failed to flip bit", !bs.get(10));
+        assertFalse("Failed to flip bit", bs.get(9));
+        assertFalse("Failed to flip bit", bs.get(10));
 
         try {
             bs.flip(-1);
-            fail(
-                    "Attempt to flip at negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
-            // Correct behaviour
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         // Try setting a bit on a 64 boundary
@@ -794,11 +723,13 @@
         for (int i = bs.size(); --i >= 0;) {
             bs.flip(i);
             assertTrue("Test1: Incorrectly flipped bit" + i, bs.get(i));
-            assertTrue("Incorrect length", bs.length() == (i + 1));
-            for (int j = bs.size(); --j > i;)
+            assertEquals("Incorrect length", i+1, bs.length());
+            for (int j = bs.size(); --j > i;) {
                 assertTrue("Test2: Incorrectly flipped bit" + j, !bs.get(j));
-            for (int j = i; --j >= 0;)
+            }
+            for (int j = i; --j >= 0;) {
                 assertTrue("Test3: Incorrectly flipped bit" + j, !bs.get(j));
+            }
             bs.flip(i);
         }
 
@@ -818,8 +749,9 @@
         assertTrue("Failed to flip bit 7", !eightbs.get(7));
 
         // Check to see all other bits are still set
-        for (int i = 0; i < 7; i++)
+        for (int i = 0; i < 7; i++) {
             assertTrue("Flip flipped incorrect bits", eightbs.get(i));
+        }
 
         eightbs.flip(127);
         assertTrue("Failed to flip bit 127", eightbs.get(127));
@@ -828,59 +760,61 @@
         assertTrue("Failed to flip bit 127", !eightbs.get(127));
     }
 
-    /**
-     * @tests java.util.BitSet#flip(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "flip",
-        args = {int.class, int.class}
-    )
     public void test_flipII() {
-        // Test for method void java.util.BitSet.flip(int, int)
+        BitSet bitset = new BitSet();
+        for (int i = 0; i < 20; i++) {
+            bitset.set(i);
+        }
+        bitset.flip(10, 10);
+
         // pos1 and pos2 are in the same bitset element
         BitSet bs = new BitSet(16);
         bs.set(7);
         bs.set(10);
         bs.flip(7, 11);
-        for (int i = 0; i < 7; i++)
+        for (int i = 0; i < 7; i++) {
             assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-        assertTrue("Failed to flip bit 7", !bs.get(7));
+        }
+        assertFalse("Failed to flip bit 7", bs.get(7));
         assertTrue("Failed to flip bit 8", bs.get(8));
         assertTrue("Failed to flip bit 9", bs.get(9));
-        assertTrue("Failed to flip bit 10", !bs.get(10));
-        for (int i = 11; i < bs.size(); i++)
+        assertFalse("Failed to flip bit 10", bs.get(10));
+        for (int i = 11; i < bs.size(); i++) {
             assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+        }
 
-        // pos1 and pos2 is in the same bitset element, boundary testing
+        // pos1 and pos2 is in the same bitset element, boundry testing
         bs = new BitSet(16);
         bs.set(7);
         bs.set(10);
         bs.flip(7, 64);
         assertEquals("Failed to grow BitSet", 64, bs.size());
-        for (int i = 0; i < 7; i++)
+        for (int i = 0; i < 7; i++) {
             assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
-        assertTrue("Failed to flip bit 7", !bs.get(7));
+        }
+        assertFalse("Failed to flip bit 7", bs.get(7));
         assertTrue("Failed to flip bit 8", bs.get(8));
         assertTrue("Failed to flip bit 9", bs.get(9));
-        assertTrue("Failed to flip bit 10", !bs.get(10));
-        for (int i = 11; i < 64; i++)
+        assertFalse("Failed to flip bit 10", bs.get(10));
+        for (int i = 11; i < 64; i++) {
             assertTrue("failed to flip bit " + i, bs.get(i));
-        assertTrue("Shouldn't have flipped bit 64", !bs.get(64));
+        }
+        assertFalse("Shouldn't have flipped bit 64", bs.get(64));
 
         // more boundary testing
         bs = new BitSet(32);
         bs.flip(0, 64);
-        for (int i = 0; i < 64; i++)
+        for (int i = 0; i < 64; i++) {
             assertTrue("Failed to flip bit " + i, bs.get(i));
-        assertTrue("Shouldn't have flipped bit 64", !bs.get(64));
+        }
+        assertFalse("Shouldn't have flipped bit 64", bs.get(64));
 
         bs = new BitSet(32);
         bs.flip(0, 65);
-        for (int i = 0; i < 65; i++)
+        for (int i = 0; i < 65; i++) {
             assertTrue("Failed to flip bit " + i, bs.get(i));
-        assertTrue("Shouldn't have flipped bit 65", !bs.get(65));
+        }
+        assertFalse("Shouldn't have flipped bit 65", bs.get(65));
 
         // pos1 and pos2 are in two sequential bitset elements
         bs = new BitSet(128);
@@ -889,21 +823,25 @@
         bs.set(72);
         bs.set(110);
         bs.flip(9, 74);
-        for (int i = 0; i < 7; i++)
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+        for (int i = 0; i < 7; i++) {
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+        }
         assertTrue("Shouldn't have flipped bit 7", bs.get(7));
-        assertTrue("Shouldn't have flipped bit 8", !bs.get(8));
+        assertFalse("Shouldn't have flipped bit 8", bs.get(8));
         assertTrue("Failed to flip bit 9", bs.get(9));
-        assertTrue("Failed to flip bit 10", !bs.get(10));
-        for (int i = 11; i < 72; i++)
+        assertFalse("Failed to flip bit 10", bs.get(10));
+        for (int i = 11; i < 72; i++) {
             assertTrue("failed to flip bit " + i, bs.get(i));
-        assertTrue("Failed to flip bit 72", !bs.get(72));
+        }
+        assertFalse("Failed to flip bit 72", bs.get(72));
         assertTrue("Failed to flip bit 73", bs.get(73));
-        for (int i = 74; i < 110; i++)
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+        for (int i = 74; i < 110; i++) {
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+        }
         assertTrue("Shouldn't have flipped bit 110", bs.get(110));
-        for (int i = 111; i < bs.size(); i++)
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+        for (int i = 111; i < bs.size(); i++) {
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+        }
 
         // pos1 and pos2 are in two non-sequential bitset elements
         bs = new BitSet(256);
@@ -914,118 +852,73 @@
         bs.set(181);
         bs.set(220);
         bs.flip(9, 219);
-        for (int i = 0; i < 7; i++)
-            assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+        for (int i = 0; i < 7; i++) {
+            assertFalse("Shouldn't have flipped bit " + i, bs.get(i));
+        }
         assertTrue("Shouldn't have flipped bit 7", bs.get(7));
-        assertTrue("Shouldn't have flipped bit 8", !bs.get(8));
+        assertFalse("Shouldn't have flipped bit 8", bs.get(8));
         assertTrue("Failed to flip bit 9", bs.get(9));
-        assertTrue("Failed to flip bit 10", !bs.get(10));
-        for (int i = 11; i < 72; i++)
+        assertFalse("Failed to flip bit 10", bs.get(10));
+        for (int i = 11; i < 72; i++) {
             assertTrue("failed to flip bit " + i, bs.get(i));
-        assertTrue("Failed to flip bit 72", !bs.get(72));
-        for (int i = 73; i < 110; i++)
+        }
+        assertFalse("Failed to flip bit 72", bs.get(72));
+        for (int i = 73; i < 110; i++) {
             assertTrue("failed to flip bit " + i, bs.get(i));
-        assertTrue("Failed to flip bit 110", !bs.get(110));
-        for (int i = 111; i < 181; i++)
+        }
+        assertFalse("Failed to flip bit 110", bs.get(110));
+        for (int i = 111; i < 181; i++) {
             assertTrue("failed to flip bit " + i, bs.get(i));
-        assertTrue("Failed to flip bit 181", !bs.get(181));
-        for (int i = 182; i < 219; i++)
+        }
+        assertFalse("Failed to flip bit 181", bs.get(181));
+        for (int i = 182; i < 219; i++) {
             assertTrue("failed to flip bit " + i, bs.get(i));
-        assertTrue("Shouldn't have flipped bit 219", !bs.get(219));
+        }
+        assertFalse("Shouldn't have flipped bit 219", bs.get(219));
         assertTrue("Shouldn't have flipped bit 220", bs.get(220));
-        for (int i = 221; i < bs.size(); i++)
+        for (int i = 221; i < bs.size(); i++) {
             assertTrue("Shouldn't have flipped bit " + i, !bs.get(i));
+        }
 
         // test illegal args
         bs = new BitSet(10);
         try {
             bs.flip(-1, 3);
-            fail(
-                    "Test1: Attempt to flip with  negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             bs.flip(2, -1);
-            fail(
-                    "Test2: Attempt to flip with negative index failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
 
         try {
             bs.flip(4, 2);
-            fail(
-                    "Test4: Attempt to flip with illegal args failed to generate exception");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
     }
 
-    /**
-     * @tests java.util.BitSet#set(int, int)
-     * @tests java.util.BitSet#cardinality()
-     * @tests java.util.BitSet#get(int)
-     * @tests java.util.BitSet#flip(int, int)
-     * @tests java.util.BitSet#clear(int,int)
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "flip",
-            args = {int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "get",
-            args = {int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "set",
-            args = {int.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "clear",
-            args = {int.class, int.class}
-        )
-    })
-    public void test_111478() {
+    public void test_111478() throws Exception {
         // BitSet shouldn't be modified by any of the operations below,
         // since the affected bits for these methods are defined as inclusive of
         // pos1, exclusive of pos2.
-        try {
-            eightbs.flip(0, 0);
-            assertTrue("Bit got flipped incorrectly ", eightbs.get(0));
+        eightbs.flip(0, 0);
+        assertTrue("Bit got flipped incorrectly ", eightbs.get(0));
 
-            BitSet bsnew = eightbs.get(2, 2);
-            assertEquals("BitSet retrieved incorrectly ",
-                    0, bsnew.cardinality());
+        BitSet bsnew = eightbs.get(2, 2);
+        assertEquals(0, bsnew.cardinality());
 
-            eightbs.set(10, 10);
-            assertTrue("Bit got set incorrectly ", !eightbs.get(10));
+        eightbs.set(10, 10);
+        assertTrue("Bit got set incorrectly ", !eightbs.get(10));
 
-            eightbs.clear(3, 3);
-            assertTrue("Bit cleared incorrectly ", eightbs.get(3));
-        } catch (IndexOutOfBoundsException e) {
-            fail("Unexpected IndexOutOfBoundsException when pos1 ==pos2");
-        }
+        eightbs.clear(3, 3);
+        assertTrue("Bit cleared incorrectly ", eightbs.get(3));
     }
 
-    /**
-     * @tests java.util.BitSet#intersects(java.util.BitSet)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "intersects",
-        args = {java.util.BitSet.class}
-    )
     public void test_intersectsLjava_util_BitSet() {
-        // Test for method boolean java.util.BitSet.intersects(java.util.BitSet)
         BitSet bs = new BitSet(500);
         bs.set(5);
         bs.set(63);
@@ -1036,83 +929,55 @@
         bs.set(450);
 
         BitSet bs2 = new BitSet(8);
-        assertFalse("Test1: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertFalse("Test1: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertFalse("Test1: intersects() returned incorrect value", bs.intersects(bs2));
+        assertFalse("Test1: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.set(4);
-        assertFalse("Test2: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertFalse("Test2: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertFalse("Test2: intersects() returned incorrect value", bs.intersects(bs2));
+        assertFalse("Test2: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.clear();
         bs2.set(5);
-        assertTrue("Test3: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test3: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertTrue("Test3: intersects() returned incorrect value", bs.intersects(bs2));
+        assertTrue("Test3: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.clear();
         bs2.set(63);
-        assertTrue("Test4: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test4: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertTrue("Test4: intersects() returned incorrect value", bs.intersects(bs2));
+        assertTrue("Test4: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.clear();
         bs2.set(80);
-        assertTrue("Test5: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test5: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertTrue("Test5: intersects() returned incorrect value", bs.intersects(bs2));
+        assertTrue("Test5: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.clear();
         bs2.set(127);
-        assertTrue("Test6: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test6: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertTrue("Test6: intersects() returned incorrect value", bs.intersects(bs2));
+        assertTrue("Test6: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.clear();
         bs2.set(192);
-        assertTrue("Test7: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test7: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertTrue("Test7: intersects() returned incorrect value", bs.intersects(bs2));
+        assertTrue("Test7: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.clear();
         bs2.set(450);
-        assertTrue("Test8: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertTrue("Test8: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertTrue("Test8: intersects() returned incorrect value", bs.intersects(bs2));
+        assertTrue("Test8: intersects() returned incorrect value", bs2.intersects(bs));
 
         bs2.clear();
         bs2.set(500);
-        assertFalse("Test9: intersects() returned incorrect value", bs
-                .intersects(bs2));
-        assertFalse("Test9: intersects() returned incorrect value", bs2
-                .intersects(bs));
+        assertFalse("Test9: intersects() returned incorrect value", bs.intersects(bs2));
+        assertFalse("Test9: intersects() returned incorrect value", bs2.intersects(bs));
     }
 
-    /**
-     * @tests java.util.BitSet#and(java.util.BitSet)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "and",
-        args = {java.util.BitSet.class}
-    )
     public void test_andLjava_util_BitSet() {
-        // Test for method void java.util.BitSet.and(java.util.BitSet)
         BitSet bs = new BitSet(128);
         // Initialize the bottom half of the BitSet
-
-        for (int i = 64; i < 128; i++)
+        for (int i = 64; i < 128; i++) {
             bs.set(i);
+        }
         eightbs.and(bs);
         assertTrue("AND failed to clear bits", !eightbs.equals(bs));
         eightbs.set(3);
@@ -1120,20 +985,11 @@
         eightbs.and(bs);
         assertTrue("AND failed to maintain set bits", bs.get(3));
         bs.and(eightbs);
-        for (int i = 64; i < 128; i++)
-            assertTrue("Failed to clear extra bits in the receiver BitSet", !bs
-                    .get(i));
+        for (int i = 64; i < 128; i++) {
+            assertTrue("Failed to clear extra bits in the receiver BitSet", !bs.get(i));
+        }
     }
 
-    /**
-     * @tests java.util.BitSet#andNot(java.util.BitSet)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "andNot",
-        args = {java.util.BitSet.class}
-    )
     public void test_andNotLjava_util_BitSet() {
         BitSet bs = (BitSet) eightbs.clone();
         bs.clear(5);
@@ -1149,137 +1005,70 @@
         assertEquals("Incorrect size", 0, bs.size());
     }
 
-    /**
-     * @tests java.util.BitSet#or(java.util.BitSet)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "or",
-        args = {java.util.BitSet.class}
-    )
     public void test_orLjava_util_BitSet() {
-        // Test for method void java.util.BitSet.or(java.util.BitSet)
         BitSet bs = new BitSet(128);
         bs.or(eightbs);
-        for (int i = 0; i < 8; i++)
+        for (int i = 0; i < 8; i++) {
             assertTrue("OR failed to set bits", bs.get(i));
-
+        }
         bs = new BitSet(0);
         bs.or(eightbs);
-        for (int i = 0; i < 8; i++)
+        for (int i = 0; i < 8; i++) {
             assertTrue("OR(0) failed to set bits", bs.get(i));
-
+        }
         eightbs.clear(5);
         bs = new BitSet(128);
         bs.or(eightbs);
         assertTrue("OR set a bit which should be off", !bs.get(5));
     }
 
-    /**
-     * @tests java.util.BitSet#xor(java.util.BitSet)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "xor",
-        args = {java.util.BitSet.class}
-    )
     public void test_xorLjava_util_BitSet() {
-        // Test for method void java.util.BitSet.xor(java.util.BitSet)
-
         BitSet bs = (BitSet) eightbs.clone();
         bs.xor(eightbs);
-        for (int i = 0; i < 8; i++)
-            assertTrue("XOR failed to clear bits", !bs.get(i));
-
+        for (int i = 0; i < 8; i++) {
+            assertTrue("XOR failed to clear bit " + i + bs, !bs.get(i));
+        }
         bs.xor(eightbs);
-        for (int i = 0; i < 8; i++)
-            assertTrue("XOR failed to set bits", bs.get(i));
-
+        for (int i = 0; i < 8; i++) {
+            assertTrue("XOR failed to set bit " + i + bs, bs.get(i));
+        }
         bs = new BitSet(0);
         bs.xor(eightbs);
-        for (int i = 0; i < 8; i++)
-            assertTrue("XOR(0) failed to set bits", bs.get(i));
-
+        for (int i = 0; i < 8; i++) {
+            assertTrue("XOR(0) failed to set bit " + i + bs, bs.get(i));
+        }
         bs = new BitSet();
         bs.set(63);
-        assertEquals("Test highest bit", "{63}", bs.toString());
+        assertEquals("{63}", bs.toString());
     }
 
-    /**
-     * @tests java.util.BitSet#size()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
-        // Test for method int java.util.BitSet.size()
         assertEquals("Returned incorrect size", 64, eightbs.size());
         eightbs.set(129);
         assertTrue("Returned incorrect size", eightbs.size() >= 129);
 
     }
 
-    /**
-     * @tests java.util.BitSet#toString()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
-        // Test for method java.lang.String java.util.BitSet.toString()
-        assertEquals("Returned incorrect string representation", "{0, 1, 2, 3, 4, 5, 6, 7}", eightbs
-                .toString());
+        assertEquals("Returned incorrect string representation", "{0, 1, 2, 3, 4, 5, 6, 7}", eightbs.toString());
         eightbs.clear(2);
-        assertEquals("Returned incorrect string representation", "{0, 1, 3, 4, 5, 6, 7}", eightbs
-                .toString());
+        assertEquals("Returned incorrect string representation", "{0, 1, 3, 4, 5, 6, 7}", eightbs.toString());
     }
 
-    /**
-     * @tests java.util.BitSet#length()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "length",
-        args = {}
-    )
     public void test_length() {
         BitSet bs = new BitSet();
-        assertTrue("BitSet returned wrong length--wanted 0, got: "
-                + bs.length(), bs.length() == 0);
+        assertEquals(bs.toString(), 0, bs.length());
         bs.set(5);
-        assertTrue("BitSet returned wrong length--wanted 6, got: "
-                + bs.length(), bs.length() == 6);
+        assertEquals(bs.toString(), 6, bs.length());
         bs.set(10);
-        assertTrue("BitSet returned wrong length--wanted 11, got: "
-                + bs.length(), bs.length() == 11);
+        assertEquals(bs.toString(), 11, bs.length());
         bs.set(432);
-        assertTrue("BitSet returned wrong length--wanted 433, got: "
-                + bs.length(), bs.length() == 433);
+        assertEquals(bs.toString(), 433, bs.length());
         bs.set(300);
-        assertTrue("BitSet returned wrong length--wanted 433 (again), got: "
-                + bs.length(), bs.length() == 433);
+        assertEquals(bs.toString(), 433, bs.length());
     }
 
-    /**
-     * @tests java.util.BitSet#nextSetBit(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextSetBit",
-        args = {int.class}
-    )
     public void test_nextSetBitI() {
-        // Test for method int java.util.BitSet.nextSetBit()
         BitSet bs = new BitSet(500);
         bs.set(5);
         bs.set(32);
@@ -1291,82 +1080,47 @@
         bs.set(450);
         try {
             bs.nextSetBit(-1);
-            fail("Expected IndexOutOfBoundsException for negative index");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
-        assertEquals("nextSetBit() returned the wrong value", 5, bs
-                .nextSetBit(0));
-        assertEquals("nextSetBit() returned the wrong value", 5, bs
-                .nextSetBit(5));
-        assertEquals("nextSetBit() returned the wrong value", 32, bs
-                .nextSetBit(6));
-        assertEquals("nextSetBit() returned the wrong value", 32, bs
-                .nextSetBit(32));
-        assertEquals("nextSetBit() returned the wrong value", 63, bs
-                .nextSetBit(33));
+        assertEquals(5, bs.nextSetBit(0));
+        assertEquals(5, bs.nextSetBit(5));
+        assertEquals(32, bs.nextSetBit(6));
+        assertEquals(32, bs.nextSetBit(32));
+        assertEquals(63, bs.nextSetBit(33));
 
         // boundary tests
-        assertEquals("nextSetBit() returned the wrong value", 63, bs
-                .nextSetBit(63));
-        assertEquals("nextSetBit() returned the wrong value", 64, bs
-                .nextSetBit(64));
+        assertEquals(63, bs.nextSetBit(63));
+        assertEquals(64, bs.nextSetBit(64));
 
         // at bitset element 1
-        assertEquals("nextSetBit() returned the wrong value", 71, bs
-                .nextSetBit(65));
-        assertEquals("nextSetBit() returned the wrong value", 71, bs
-                .nextSetBit(71));
-        assertEquals("nextSetBit() returned the wrong value", 72, bs
-                .nextSetBit(72));
-        assertEquals("nextSetBit() returned the wrong value", 127, bs
-                .nextSetBit(110));
+        assertEquals(71, bs.nextSetBit(65));
+        assertEquals(71, bs.nextSetBit(71));
+        assertEquals(72, bs.nextSetBit(72));
+        assertEquals(127, bs.nextSetBit(110));
 
         // boundary tests
-        assertEquals("nextSetBit() returned the wrong value", 127, bs
-                .nextSetBit(127));
-        assertEquals("nextSetBit() returned the wrong value", 128, bs
-                .nextSetBit(128));
+        assertEquals(127, bs.nextSetBit(127));
+        assertEquals(128, bs.nextSetBit(128));
 
         // at bitset element 2
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(130));
+        assertEquals(193, bs.nextSetBit(130));
 
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(191));
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(192));
-        assertEquals("nextSetBit() returned the wrong value", 193, bs
-                .nextSetBit(193));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(194));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(255));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(256));
-        assertEquals("nextSetBit() returned the wrong value", 450, bs
-                .nextSetBit(450));
+        assertEquals(193, bs.nextSetBit(191));
+        assertEquals(193, bs.nextSetBit(192));
+        assertEquals(193, bs.nextSetBit(193));
+        assertEquals(450, bs.nextSetBit(194));
+        assertEquals(450, bs.nextSetBit(255));
+        assertEquals(450, bs.nextSetBit(256));
+        assertEquals(450, bs.nextSetBit(450));
 
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(451));
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(511));
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(512));
-        assertEquals("nextSetBit() returned the wrong value", -1, bs
-                .nextSetBit(800));
+        assertEquals(-1, bs.nextSetBit(451));
+        assertEquals(-1, bs.nextSetBit(511));
+        assertEquals(-1, bs.nextSetBit(512));
+        assertEquals(-1, bs.nextSetBit(800));
     }
 
-    /**
-     * @tests java.util.BitSet#nextClearBit(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextClearBit",
-        args = {int.class}
-    )
     public void test_nextClearBitI() {
-        // Test for method int java.util.BitSet.nextSetBit()
         BitSet bs = new BitSet(500);
         // ensure all the bits from 0 to bs.size() - 1 are set to true
         bs.set(0, bs.size() - 1);
@@ -1381,141 +1135,91 @@
         bs.clear(450);
         try {
             bs.nextClearBit(-1);
-            fail("Expected IndexOutOfBoundsException for negative index");
-        } catch (IndexOutOfBoundsException e) {
+            fail();
+        } catch (IndexOutOfBoundsException expected) {
         }
-        assertEquals("nextClearBit() returned the wrong value", 5, bs
-                .nextClearBit(0));
-        assertEquals("nextClearBit() returned the wrong value", 5, bs
-                .nextClearBit(5));
-        assertEquals("nextClearBit() returned the wrong value", 32, bs
-                .nextClearBit(6));
-        assertEquals("nextClearBit() returned the wrong value", 32, bs
-                .nextClearBit(32));
-        assertEquals("nextClearBit() returned the wrong value", 63, bs
-                .nextClearBit(33));
+        assertEquals(5, bs.nextClearBit(0));
+        assertEquals(5, bs.nextClearBit(5));
+        assertEquals(32, bs.nextClearBit(6));
+        assertEquals(32, bs.nextClearBit(32));
+        assertEquals(63, bs.nextClearBit(33));
 
         // boundary tests
-        assertEquals("nextClearBit() returned the wrong value", 63, bs
-                .nextClearBit(63));
-        assertEquals("nextClearBit() returned the wrong value", 64, bs
-                .nextClearBit(64));
+        assertEquals(63, bs.nextClearBit(63));
+        assertEquals(64, bs.nextClearBit(64));
 
         // at bitset element 1
-        assertEquals("nextClearBit() returned the wrong value", 71, bs
-                .nextClearBit(65));
-        assertEquals("nextClearBit() returned the wrong value", 71, bs
-                .nextClearBit(71));
-        assertEquals("nextClearBit() returned the wrong value", 72, bs
-                .nextClearBit(72));
-        assertEquals("nextClearBit() returned the wrong value", 127, bs
-                .nextClearBit(110));
+        assertEquals(71, bs.nextClearBit(65));
+        assertEquals(71, bs.nextClearBit(71));
+        assertEquals(72, bs.nextClearBit(72));
+        assertEquals(127, bs.nextClearBit(110));
 
         // boundary tests
-        assertEquals("nextClearBit() returned the wrong value", 127, bs
-                .nextClearBit(127));
-        assertEquals("nextClearBit() returned the wrong value", 128, bs
-                .nextClearBit(128));
+        assertEquals(127, bs.nextClearBit(127));
+        assertEquals(128, bs.nextClearBit(128));
 
         // at bitset element 2
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(130));
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(191));
+        assertEquals(193, bs.nextClearBit(130));
+        assertEquals(193, bs.nextClearBit(191));
 
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(192));
-        assertEquals("nextClearBit() returned the wrong value", 193, bs
-                .nextClearBit(193));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(194));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(255));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(256));
-        assertEquals("nextClearBit() returned the wrong value", 450, bs
-                .nextClearBit(450));
+        assertEquals(193, bs.nextClearBit(192));
+        assertEquals(193, bs.nextClearBit(193));
+        assertEquals(450, bs.nextClearBit(194));
+        assertEquals(450, bs.nextClearBit(255));
+        assertEquals(450, bs.nextClearBit(256));
+        assertEquals(450, bs.nextClearBit(450));
 
         // bitset has 1 still the end of bs.size() -1, but calling nextClearBit
         // with any index value after the last true bit should return bs.size()
-        assertEquals("nextClearBit() returned the wrong value", 512, bs
-                .nextClearBit(451));
-        assertEquals("nextClearBit() returned the wrong value", 512, bs
-                .nextClearBit(511));
-        assertEquals("nextClearBit() returned the wrong value", 512, bs
-                .nextClearBit(512));
+        assertEquals(512, bs.nextClearBit(451));
+        assertEquals(512, bs.nextClearBit(511));
+        assertEquals(512, bs.nextClearBit(512));
 
-        // if the index is larger than bs.size(), nextClearBit should return
-        // index
-        assertEquals("nextClearBit() returned the wrong value", 513, bs
-                .nextClearBit(513));
-        assertEquals("nextClearBit() returned the wrong value", 800, bs
-                .nextClearBit(800));
+        // if the index is larger than bs.size(), nextClearBit should return index
+        assertEquals(513, bs.nextClearBit(513));
+        assertEquals(800, bs.nextClearBit(800));
     }
 
-    /**
-     * @tests java.util.BitSet#isEmpty()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         BitSet bs = new BitSet(500);
         assertTrue("Test: isEmpty() returned wrong value", bs.isEmpty());
 
         // at bitset element 0
         bs.set(3);
-        assertFalse("Test0: isEmpty() returned wrong value", bs
-                .isEmpty());
+        assertFalse("Test0: isEmpty() returned wrong value", bs.isEmpty());
 
         // at bitset element 1
         bs.clear();
         bs.set(12);
-        assertFalse("Test1: isEmpty() returned wrong value", bs
-                .isEmpty());
+        assertFalse("Test1: isEmpty() returned wrong value", bs.isEmpty());
 
         // at bitset element 2
         bs.clear();
         bs.set(128);
-        assertFalse("Test2: isEmpty() returned wrong value", bs
-                .isEmpty());
+        assertFalse("Test2: isEmpty() returned wrong value", bs.isEmpty());
 
         // boundary testing
         bs.clear();
         bs.set(459);
-        assertFalse("Test3: isEmpty() returned wrong value", bs
-                .isEmpty());
+        assertFalse("Test3: isEmpty() returned wrong value", bs.isEmpty());
 
         bs.clear();
         bs.set(511);
-        assertFalse("Test4: isEmpty() returned wrong value", bs
-                .isEmpty());
+        assertFalse("Test4: isEmpty() returned wrong value", bs.isEmpty());
     }
 
-    /**
-     * @tests java.util.BitSet#cardinality()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cardinality",
-        args = {}
-    )
     public void test_cardinality() {
-        // test for method int java.util.BitSet.cardinality()
         BitSet bs = new BitSet(500);
         bs.set(5);
         bs.set(32);
         bs.set(63);
         bs.set(64);
+        assertEquals(bs.toString(), 4, bs.cardinality());
         bs.set(71, 110);
         bs.set(127, 130);
         bs.set(193);
         bs.set(450);
-        assertEquals("cardinality() returned wrong value", 48, bs.cardinality());
+        assertEquals(bs.toString(), 48, bs.cardinality());
 
         bs.flip(0, 500);
         assertEquals("cardinality() returned wrong value", 452, bs
@@ -1529,10 +1233,6 @@
                 .cardinality());
     }
 
-    /**
-     * helper method to display the contents of a bitset
-     *
-     */
     private static void printBitset(BitSet bs) {
         System.out.println();
         for (int i = bs.size() - 1; i >= 0; i--) {
@@ -1543,22 +1243,10 @@
         }
     }
 
-    /**
-     * Sets up the fixture, for example, open a network connection. This method
-     * is called before a test is executed.
-     */
     protected void setUp() {
-
         eightbs = new BitSet();
-
-        for (int i = 0; i < 8; i++)
+        for (int i = 0; i < 8; i++) {
             eightbs.set(i);
-    }
-
-    /**
-     * Tears down the fixture, for example, close a network connection. This
-     * method is called after a test is executed.
-     */
-    protected void tearDown() {
+        }
     }
 }
diff --git a/luni/src/test/java/tests/api/java/util/CalendarTest.java b/luni/src/test/java/tests/api/java/util/CalendarTest.java
index bca091f..ce31216 100644
--- a/luni/src/test/java/tests/api/java/util/CalendarTest.java
+++ b/luni/src/test/java/tests/api/java/util/CalendarTest.java
@@ -34,7 +34,7 @@
 	Locale defaultLocale;
 
 	/**
-	 * @tests java.util.Calendar#set(int, int)
+	 * java.util.Calendar#set(int, int)
 	 */
 	public void test_setII() {
 		// Test for correct result defined by the last set field
@@ -394,7 +394,7 @@
 	}
 
 	/**
-	 * @tests java.util.Calendar#setTime(java.util.Date)
+	 * java.util.Calendar#setTime(java.util.Date)
 	 */
 	public void test_setTimeLjava_util_Date() {
 		Calendar cal = Calendar.getInstance();
@@ -409,7 +409,7 @@
 	}
 
 	/**
-	 * @tests java.util.Calendar#compareTo(Calendar)
+	 * java.util.Calendar#compareTo(Calendar)
 	 */
 	public void test_compareToLjava_util_Calendar_null() {
 		Calendar cal = Calendar.getInstance();
@@ -422,7 +422,7 @@
 	}
 
 	/**
-	 * @tests java.util.Calendar#compareTo(Calendar)
+	 * java.util.Calendar#compareTo(Calendar)
 	 */
 	public void test_compareToLjava_util_Calendar() {
         Calendar cal = Calendar.getInstance();
@@ -446,7 +446,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#clone()
+     * java.util.Calendar#clone()
      */
     public void test_clone() {
         // Regression for HARMONY-475
@@ -459,7 +459,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#getTimeInMillis()
+     * java.util.Calendar#getTimeInMillis()
      */
     public void test_getTimeInMillis() {
         Calendar cal = Calendar.getInstance();
@@ -483,8 +483,8 @@
 			Locale.CHINA, Locale.CANADA, Locale.FRANCE };
 
     /**
-     * @tests java.util.Calendar#before(Object)
-     * @tests java.util.Calendar#after(Object)
+     * java.util.Calendar#before(Object)
+     * java.util.Calendar#after(Object)
      */
     public void test_before_after() {
         Calendar early = Calendar.getInstance();
@@ -563,8 +563,8 @@
     }
 
     /**
-     * @tests java.util.Calendar#clear()
-     * @tests java.util.Calendar#clear(int)
+     * java.util.Calendar#clear()
+     * java.util.Calendar#clear(int)
      */
     public void test_clear() {
         Calendar calendar = Calendar.getInstance();
@@ -621,7 +621,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#isSet(int)
+     * java.util.Calendar#isSet(int)
      */
     public void test_isSet() {
         Calendar calendar = Calendar.getInstance();
@@ -632,7 +632,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#getAvailableLocales()
+     * java.util.Calendar#getAvailableLocales()
      */
     public void test_getAvailableLocales() {
         Locale[] locales = Calendar.getAvailableLocales();
@@ -648,8 +648,8 @@
     }
 
     /**
-     * @tests java.util.Calendar#getInstance(Locale)
-     * @tests java.util.Calendar#getInstance(TimeZone, Locale)
+     * java.util.Calendar#getInstance(Locale)
+     * java.util.Calendar#getInstance(TimeZone, Locale)
      */
     public void test_getInstance() {
         // test getInstance(Locale)
@@ -672,7 +672,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#internalGet(int)
+     * java.util.Calendar#internalGet(int)
      */
     public void test_internalGet() {
         MockGregorianCalendar c = new MockGregorianCalendar();
@@ -681,7 +681,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#hashCode()
+     * java.util.Calendar#hashCode()
      */
     public void test_hashcode() {
         Calendar calendar = Calendar.getInstance(Locale.JAPAN);
@@ -689,7 +689,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#roll(int, int)
+     * java.util.Calendar#roll(int, int)
      */
     public void test_roll() {
         Calendar calendar = Calendar.getInstance();
@@ -715,7 +715,7 @@
     }
 
     /**
-     * @tests java.util.Calendar#toString()
+     * java.util.Calendar#toString()
      */
     public void test_toString() {
         Calendar calendar = Calendar.getInstance();
@@ -728,7 +728,7 @@
     }
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
     public void testSerializationSelf() throws Exception {
         Calendar calendar = Calendar.getInstance();
@@ -788,7 +788,7 @@
     }
 
 	/**
-	 * @tests {@link java.util.Calendar#getDisplayName(int, int, Locale)}
+	 * {@link java.util.Calendar#getDisplayName(int, int, Locale)}
 	 * @since 1.6
 	 */
 	public void test_getDisplayNameIILjava_util_Locale() {
@@ -941,7 +941,7 @@
 	}
 
 	/**
-	 * @tests {@link java.util.Calendar#getDisplayNames(int, int, Locale)}
+	 * {@link java.util.Calendar#getDisplayNames(int, int, Locale)}
 	 * @since 1.6
 	 */
 	public void test_getDisplayNamesIILjava_util_Locale() {
@@ -1073,7 +1073,7 @@
 	}
 
 	/**
-	 * @tests {@link java.util.Calendar#getActualMaximum(int)}
+	 * {@link java.util.Calendar#getActualMaximum(int)}
 	 */
 	public void test_getActualMaximum_I() {
 		Calendar c = new MockCalendar();
@@ -1081,7 +1081,7 @@
 	}
 
 	/**
-	 * @tests {@link java.util.Calendar#getActualMinimum(int)}
+	 * {@link java.util.Calendar#getActualMinimum(int)}
 	 */
 	public void test_getActualMinimum_I() {
 		Calendar c = new MockCalendar();
diff --git a/luni/src/test/java/tests/api/java/util/CollectionsTest.java b/luni/src/test/java/tests/api/java/util/CollectionsTest.java
index ad0d11e..c308cf9 100644
--- a/luni/src/test/java/tests/api/java/util/CollectionsTest.java
+++ b/luni/src/test/java/tests/api/java/util/CollectionsTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -49,7 +44,6 @@
 import tests.support.Support_UnmodifiableCollectionTest;
 import tests.support.Support_UnmodifiableMapTest;
 
-@TestTargetClass(Collections.class)
 public class CollectionsTest extends junit.framework.TestCase {
 
     private LinkedList ll;
@@ -268,15 +262,9 @@
     }
 
     /**
-     * @tests java.util.Collections#binarySearch(java.util.List,
+     * java.util.Collections#binarySearch(java.util.List,
      *        java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException.",
-        method = "binarySearch",
-        args = {java.util.List.class, java.lang.Object.class}
-    )
     public void test_binarySearchLjava_util_ListLjava_lang_Object() {
         // Test for method int
         // java.util.Collections.binarySearch(java.util.List, java.lang.Object)
@@ -296,15 +284,9 @@
     }
 
     /**
-     * @tests java.util.Collections#binarySearch(java.util.List,
+     * java.util.Collections#binarySearch(java.util.List,
      *        java.lang.Object, java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException.",
-        method = "binarySearch",
-        args = {java.util.List.class, java.lang.Object.class, java.util.Comparator.class}
-    )
     public void test_binarySearchLjava_util_ListLjava_lang_ObjectLjava_util_Comparator() {
         // Test for method int
         // java.util.Collections.binarySearch(java.util.List, java.lang.Object,
@@ -338,14 +320,8 @@
     }
 
     /**
-     * @tests java.util.Collections#copy(java.util.List, java.util.List)
+     * java.util.Collections#copy(java.util.List, java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "copy",
-        args = {java.util.List.class, java.util.List.class}
-    )
     public void test_copyLjava_util_ListLjava_util_List() {
         // Test for method void java.util.Collections.copy(java.util.List,
         // java.util.List)
@@ -414,14 +390,8 @@
     }
 
     /**
-     * @tests java.util.Collections#copy(java.util.List, java.util.List)
+     * java.util.Collections#copy(java.util.List, java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException. Doesn't verify UnsupportedOperationException.",
-        method = "copy",
-        args = {java.util.List.class, java.util.List.class}
-    )
     public void test_copy_check_index() {
         ArrayList a1 = new ArrayList();
         a1.add("one");
@@ -440,14 +410,8 @@
     }
 
     /**
-     * @tests java.util.Collections#enumeration(java.util.Collection)
+     * java.util.Collections#enumeration(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "enumeration",
-        args = {java.util.Collection.class}
-    )
     public void test_enumerationLjava_util_Collection() {
         // Test for method java.util.Enumeration
         // java.util.Collections.enumeration(java.util.Collection)
@@ -463,14 +427,8 @@
     }
 
     /**
-     * @tests java.util.Collections#fill(java.util.List, java.lang.Object)
+     * java.util.Collections#fill(java.util.List, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "fill",
-        args = {java.util.List.class, java.lang.Object.class}
-    )
     public void test_fillLjava_util_ListLjava_lang_Object() {
         // Test for method void java.util.Collections.fill(java.util.List,
         // java.lang.Object)
@@ -506,14 +464,8 @@
     }
 
     /**
-     * @tests java.util.Collections#max(java.util.Collection)
+     * java.util.Collections#max(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {java.util.Collection.class}
-    )
     public void test_maxLjava_util_Collection() {
         // Test for method java.lang.Object
         // java.util.Collections.max(java.util.Collection)
@@ -543,15 +495,9 @@
     }
 
     /**
-     * @tests java.util.Collections#max(java.util.Collection,
+     * java.util.Collections#max(java.util.Collection,
      *        java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "max",
-        args = {java.util.Collection.class, java.util.Comparator.class}
-    )
     public void test_maxLjava_util_CollectionLjava_util_Comparator() {
         // Test for method java.lang.Object
         // java.util.Collections.max(java.util.Collection, java.util.Comparator)
@@ -586,14 +532,8 @@
     }
 
     /**
-     * @tests java.util.Collections#min(java.util.Collection)
+     * java.util.Collections#min(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {java.util.Collection.class}
-    )
     public void test_minLjava_util_Collection() {
         // Test for method java.lang.Object
         // java.util.Collections.min(java.util.Collection)
@@ -622,15 +562,9 @@
     }
 
     /**
-     * @tests java.util.Collections#min(java.util.Collection,
+     * java.util.Collections#min(java.util.Collection,
      *        java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "min",
-        args = {java.util.Collection.class, java.util.Comparator.class}
-    )
     public void test_minLjava_util_CollectionLjava_util_Comparator() {
         // Test for method java.lang.Object
         // java.util.Collections.min(java.util.Collection, java.util.Comparator)
@@ -666,14 +600,8 @@
     }
 
     /**
-     * @tests java.util.Collections#nCopies(int, java.lang.Object)
+     * java.util.Collections#nCopies(int, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nCopies",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_nCopiesILjava_lang_Object() {
         // Test for method java.util.List java.util.Collections.nCopies(int,
         // java.lang.Object)
@@ -711,14 +639,8 @@
     }
 
     /**
-     * @tests java.util.Collections#reverse(java.util.List)
+     * java.util.Collections#reverse(java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "reverse",
-        args = {java.util.List.class}
-    )
     public void test_reverseLjava_util_List() {
         // Test for method void java.util.Collections.reverse(java.util.List)
         try {
@@ -757,14 +679,8 @@
     }
 
     /**
-     * @tests java.util.Collections#reverseOrder()
+     * java.util.Collections#reverseOrder()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "reverseOrder",
-        args = {}
-    )
     public void test_reverseOrder() {
         // Test for method java.util.Comparator
         // java.util.Collections.reverseOrder()
@@ -779,14 +695,8 @@
     }
 
     /**
-     * @tests java.util.Collections#shuffle(java.util.List)
+     * java.util.Collections#shuffle(java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "shuffle",
-        args = {java.util.List.class}
-    )
     public void test_shuffleLjava_util_List() {
         // Test for method void java.util.Collections.shuffle(java.util.List)
         // Assumes ll is sorted and has no duplicate keys and is large ( > 20
@@ -849,14 +759,8 @@
     }
 
     /**
-     * @tests java.util.Collections#shuffle(java.util.List, java.util.Random)
+     * java.util.Collections#shuffle(java.util.List, java.util.Random)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "shuffle",
-        args = {java.util.List.class, java.util.Random.class}
-    )
     public void test_shuffleLjava_util_ListLjava_util_Random() {
         // Test for method void java.util.Collections.shuffle(java.util.List,
         // java.util.Random)
@@ -893,14 +797,8 @@
 }
 
     /**
-     * @tests java.util.Collections#singleton(java.lang.Object)
+     * java.util.Collections#singleton(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "singleton",
-        args = {java.lang.Object.class}
-    )
     public void test_singletonLjava_lang_Object() {
         // Test for method java.util.Set
         // java.util.Collections.singleton(java.lang.Object)
@@ -923,14 +821,8 @@
     }
 
     /**
-     * @tests java.util.Collections#sort(java.util.List)
+     * java.util.Collections#sort(java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {java.util.List.class}
-    )
     public void test_sortLjava_util_List() {
         // Test for method void java.util.Collections.sort(java.util.List)
         // assumes no duplicate keys in ll
@@ -983,14 +875,8 @@
    }
 
     /**
-     * @tests java.util.Collections#sort(java.util.List, java.util.Comparator)
+     * java.util.Collections#sort(java.util.List, java.util.Comparator)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "sort",
-        args = {java.util.List.class, java.util.Comparator.class}
-    )
     public void test_sortLjava_util_ListLjava_util_Comparator() {
         // Test for method void java.util.Collections.sort(java.util.List,
         // java.util.Comparator)
@@ -1038,14 +924,8 @@
     }
 
     /**
-     * @tests java.util.Collections#swap(java.util.List, int, int)
+     * java.util.Collections#swap(java.util.List, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "swap",
-        args = {java.util.List.class, int.class, int.class}
-    )
     public void test_swapLjava_util_ListII() {
         // Test for method swap(java.util.List, int, int)
 
@@ -1102,15 +982,9 @@
     }
 
     /**
-     * @tests java.util.Collections#replaceAll(java.util.List, java.lang.Object,
+     * java.util.Collections#replaceAll(java.util.List, java.lang.Object,
      *        java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "replaceAll",
-        args = {java.util.List.class, java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_replaceAllLjava_util_ListLjava_lang_ObjectLjava_lang_Object() {
         // Test for method replaceAll(java.util.List, java.lang.Object,
         // java.lang.Object)
@@ -1208,14 +1082,8 @@
     }
 
     /**
-     * @tests java.util.Collections#rotate(java.util.List, int)
+     * java.util.Collections#rotate(java.util.List, int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies functionality, and UnsupportedOperationException.",
-        method = "rotate",
-        args = {java.util.List.class, int.class}
-    )
     public void test_rotateLjava_util_ListI() {
         // Test for method rotate(java.util.List, int)
 
@@ -1296,14 +1164,8 @@
     }
 
     /**
-     * @tests java.util.Collections#rotate(java.util.List, int)
+     * java.util.Collections#rotate(java.util.List, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "rotate",
-        args = {java.util.List.class, int.class}
-    )
     public void test_rotate2() {
         List list = new ArrayList();
         try {
@@ -1333,15 +1195,9 @@
     }
 
     /**
-     * @tests java.util.Collections#indexOfSubList(java.util.List,
+     * java.util.Collections#indexOfSubList(java.util.List,
      *        java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies boundary conditions, and NullPointerException.",
-        method = "indexOfSubList",
-        args = {java.util.List.class, java.util.List.class}
-    )
     public void test_indexOfSubListLjava_util_ListLjava_util_List() {
         // Test for method int indexOfSubList(java.util.List, java.util.List)
         List list = new ArrayList();
@@ -1371,15 +1227,9 @@
     }
 
     /**
-     * @tests java.util.Collections#indexOfSubList(java.util.List,
+     * java.util.Collections#indexOfSubList(java.util.List,
      *        java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "indexOfSubList",
-        args = {java.util.List.class, java.util.List.class}
-    )
     public void test_indexOfSubList2() {
         ArrayList sub = new ArrayList();
         sub.add(new Integer(1));
@@ -1460,15 +1310,9 @@
     }
 
     /**
-     * @tests java.util.Collections#lastIndexOfSubList(java.util.List,
+     * java.util.Collections#lastIndexOfSubList(java.util.List,
      *        java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException, and boundary conditions.",
-        method = "lastIndexOfSubList",
-        args = {java.util.List.class, java.util.List.class}
-    )
     public void test_lastIndexOfSubListLjava_util_ListLjava_util_List() {
         // Test for method int lastIndexOfSubList(java.util.List,
         // java.util.List)
@@ -1499,15 +1343,9 @@
     }
 
     /**
-     * @tests java.util.Collections#lastIndexOfSubList(java.util.List,
+     * java.util.Collections#lastIndexOfSubList(java.util.List,
      *        java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastIndexOfSubList",
-        args = {java.util.List.class, java.util.List.class}
-    )
     public void test_lastIndexOfSubList2() {
         ArrayList sub = new ArrayList();
         sub.add(new Integer(1));
@@ -1578,14 +1416,8 @@
     }
 
     /**
-     * @tests java.util.Collections#list(java.util.Enumeration)
+     * java.util.Collections#list(java.util.Enumeration)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "list",
-        args = {java.util.Enumeration.class}
-    )
     public void test_listLjava_util_Enumeration() {
         // Test for method java.util.ArrayList list(java.util.Enumeration)
 
@@ -1602,14 +1434,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedCollection(java.util.Collection)
+     * java.util.Collections#synchronizedCollection(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "synchronizedCollection",
-        args = {java.util.Collection.class}
-    )
     public void test_synchronizedCollectionLjava_util_Collection() {
         // Test for method java.util.Collection
         // java.util.Collections.synchronizedCollection(java.util.Collection)
@@ -1663,14 +1489,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedList(java.util.List)
+     * java.util.Collections#synchronizedList(java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "synchronizedList",
-        args = {java.util.List.class}
-    )
     public void test_synchronizedListLjava_util_List() {
         try {
             Collections.synchronizedList(null);
@@ -1752,14 +1572,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedMap(java.util.Map)
+     * java.util.Collections#synchronizedMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "synchronizedMap",
-        args = {java.util.Map.class}
-    )
     public void test_synchronizedMapLjava_util_Map() {
         // Test for method java.util.Map
         // java.util.Collections.synchronizedMap(java.util.Map)
@@ -1823,14 +1637,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedSet(java.util.Set)
+     * java.util.Collections#synchronizedSet(java.util.Set)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "synchronizedSet",
-        args = {java.util.Set.class}
-    )
     public void test_synchronizedSetLjava_util_Set() {
         // Test for method java.util.Set
         // java.util.Collections.synchronizedSet(java.util.Set)
@@ -1883,14 +1691,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedSortedMap(java.util.SortedMap)
+     * java.util.Collections#synchronizedSortedMap(java.util.SortedMap)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "synchronizedSortedMap",
-        args = {java.util.SortedMap.class}
-    )
     public void test_synchronizedSortedMapLjava_util_SortedMap() {
         // Test for method java.util.SortedMap
         // java.util.Collections.synchronizedSortedMap(java.util.SortedMap)
@@ -1946,14 +1748,8 @@
     }
 
     /**
-     * @tests java.util.Collections#synchronizedSortedSet(java.util.SortedSet)
+     * java.util.Collections#synchronizedSortedSet(java.util.SortedSet)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "synchronizedSortedSet",
-        args = {java.util.SortedSet.class}
-    )
     public void test_synchronizedSortedSetLjava_util_SortedSet() {
         // Test for method java.util.SortedSet
         // java.util.Collections.synchronizedSortedSet(java.util.SortedSet)
@@ -1995,14 +1791,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableCollection(java.util.Collection)
+     * java.util.Collections#unmodifiableCollection(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "unmodifiableCollection",
-        args = {java.util.Collection.class}
-    )
     public void test_unmodifiableCollectionLjava_util_Collection() {
         // Test for method java.util.Collection
         // java.util.Collections.unmodifiableCollection(java.util.Collection)
@@ -2047,14 +1837,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableList(java.util.List)
+     * java.util.Collections#unmodifiableList(java.util.List)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "unmodifiableList",
-        args = {java.util.List.class}
-    )
     public void test_unmodifiableListLjava_util_List() {
         // Test for method java.util.List
         // java.util.Collections.unmodifiableList(java.util.List)
@@ -2126,14 +1910,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableMap(java.util.Map)
+     * java.util.Collections#unmodifiableMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "unmodifiableMap",
-        args = {java.util.Map.class}
-    )
     public void test_unmodifiableMapLjava_util_Map() {
         // Test for method java.util.Map
         // java.util.Collections.unmodifiableMap(java.util.Map)
@@ -2215,14 +1993,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableSet(java.util.Set)
+     * java.util.Collections#unmodifiableSet(java.util.Set)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "unmodifiableSet",
-        args = {java.util.Set.class}
-    )
     public void test_unmodifiableSetLjava_util_Set() {
         // Test for method java.util.Set
         // java.util.Collections.unmodifiableSet(java.util.Set)
@@ -2262,14 +2034,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableSortedMap(java.util.SortedMap)
+     * java.util.Collections#unmodifiableSortedMap(java.util.SortedMap)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "unmodifiableSortedMap",
-        args = {java.util.SortedMap.class}
-    )
     public void test_unmodifiableSortedMapLjava_util_SortedMap() {
         // Test for method java.util.SortedMap
         // java.util.Collections.unmodifiableSortedMap(java.util.SortedMap)
@@ -2304,14 +2070,8 @@
     }
 
     /**
-     * @tests java.util.Collections#unmodifiableSortedSet(java.util.SortedSet)
+     * java.util.Collections#unmodifiableSortedSet(java.util.SortedSet)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "unmodifiableSortedSet",
-        args = {java.util.SortedSet.class}
-    )
     public void test_unmodifiableSortedSetLjava_util_SortedSet() {
         // Test for method java.util.SortedSet
         // java.util.Collections.unmodifiableSortedSet(java.util.SortedSet)
@@ -2344,26 +2104,6 @@
     /**
      * Test unmodifiable objects toString methods
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "toString",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "unmodifiableCollection",
-            args = {java.util.Collection.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "unmodifiableMap",
-            args = {java.util.Map.class}
-        )
-    })
     public void test_unmodifiable_toString_methods() {
         // Regression for HARMONY-552
         ArrayList al = new ArrayList();
@@ -2380,12 +2120,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "singletonList",
-        args = {java.lang.Object.class}
-    )
     public void test_singletonListLjava_lang_Object() {
         // Test for method java.util.Set
         // java.util.Collections.singleton(java.lang.Object)
@@ -2406,12 +2140,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "singletonMap",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_singletonMapLjava_lang_Object() {
         // Test for method java.util.Set
         // java.util.Collections.singleton(java.lang.Object)
diff --git a/luni/src/test/java/tests/api/java/util/ConcurrentModTest.java b/luni/src/test/java/tests/api/java/util/ConcurrentModTest.java
index ae55c7c..3750e81 100644
--- a/luni/src/test/java/tests/api/java/util/ConcurrentModTest.java
+++ b/luni/src/test/java/tests/api/java/util/ConcurrentModTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractList;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -31,18 +26,11 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(AbstractList.class)
 public class ConcurrentModTest extends TestCase {
 
     /*
      * Test method for 'java.util.AbstractList.subList(int, int)'
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Doesn't verify IndexOutOfBoundsException.",
-        method = "get",
-        args = {int.class}
-    )
     public void testGet() {
         AbstractList al = new ArrayList();
         Double one = new Double(1.0);
@@ -87,12 +75,6 @@
     /*
      * Test method for 'java.util.AbstractList.subList(int, int)'
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify UnsupportedOperationException, ClassCastException, IllegalArgumentException, IndexOutOfBoundsException.",
-        method = "set",
-        args = {int.class, java.lang.Object.class}
-    )
     public void testSet() {
         AbstractList al = new ArrayList();
         Double one = new Double(1.0);
@@ -123,12 +105,6 @@
     /*
      * Test method for 'java.util.AbstractList.subList(int, int)'
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify UnsupportedOperationException, ClassCastException, IllegalArgumentException, IndexOutOfBoundsException.",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void testAdd() {
         AbstractList al = new ArrayList();
         Double one = new Double(1.0);
@@ -159,12 +135,6 @@
     /*
      * Test method for 'java.util.AbstractList.subList(int, int)'
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {int.class}
-    )
     public void testRemove() {
         AbstractList al = new ArrayList();
         Double one = new Double(1.0);
@@ -231,12 +201,6 @@
     /*
      * Test method for 'java.util.AbstractList.subList(int, int)'
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify UnsupportedOperationException, ClassCastException, IllegalArgumentException,  NullPointerException.",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void testAddAll() {
         AbstractList al = new ArrayList();
         Double one = new Double(1.0);
@@ -267,12 +231,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Class is abstract - test testing simplest implementation.",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLjava_lang_Object() {
         AbstractList abstr = new AbstractList() {
 
@@ -348,20 +306,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "add",
-            args = {int.class, java.lang.Object.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AbstractList",
-            args = {}
-        )
-    })
     public void test_addILjava_lang_Object() {
         AbstractList abstr = new AbstractList() {
 
@@ -456,12 +400,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAllILjava_util_Collection() {
         Collection c = new Vector();
         c.add(new Double(33));
@@ -571,12 +509,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         AbstractList abstr = new ArrayList();
 
@@ -590,12 +522,6 @@
         assertEquals(0, abstr.size());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         Collection c = new Vector();
         c.add(new Double(33));
@@ -614,12 +540,6 @@
         assertTrue(abstr.equals(abstr1));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_setILjava_lang_Object() {
         Collection c = new Vector();
         c.add(new Double(33));
@@ -729,12 +649,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeRange",
-        args = {int.class, int.class}
-    )
     public void test_removeRangeII() {
         Mock_ArrayList al1 = new Mock_ArrayList();
         al1.add(1);
diff --git a/luni/src/test/java/tests/api/java/util/ConcurrentModificationExceptionTest.java b/luni/src/test/java/tests/api/java/util/ConcurrentModificationExceptionTest.java
index 1a655d4..0cd4076 100644
--- a/luni/src/test/java/tests/api/java/util/ConcurrentModificationExceptionTest.java
+++ b/luni/src/test/java/tests/api/java/util/ConcurrentModificationExceptionTest.java
@@ -17,17 +17,11 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Collection;
 import java.util.ConcurrentModificationException;
 import java.util.Iterator;
 import java.util.LinkedList;
 
-@TestTargetClass(ConcurrentModificationException.class)
 public class ConcurrentModificationExceptionTest extends
         junit.framework.TestCase {
 
@@ -54,14 +48,8 @@
     }
 
     /**
-     * @tests java.util.ConcurrentModificationException#ConcurrentModificationException()
+     * java.util.ConcurrentModificationException#ConcurrentModificationException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ConcurrentModificationException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.ConcurrentModificationException()
         Collection myCollection = new LinkedList();
@@ -85,14 +73,8 @@
     }
 
     /**
-     * @tests java.util.ConcurrentModificationException#ConcurrentModificationException(java.lang.String)
+     * java.util.ConcurrentModificationException#ConcurrentModificationException(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ConcurrentModificationException",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method
         // java.util.ConcurrentModificationException(java.lang.String)
diff --git a/luni/src/test/java/tests/api/java/util/CurrencyTest.java b/luni/src/test/java/tests/api/java/util/CurrencyTest.java
index 7d7069f..9571b73 100644
--- a/luni/src/test/java/tests/api/java/util/CurrencyTest.java
+++ b/luni/src/test/java/tests/api/java/util/CurrencyTest.java
@@ -18,44 +18,30 @@
 package tests.api.java.util;
 
 import tests.support.Support_Locale;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.AndroidOnly;
 
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Currency;
+import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Locale;
+import java.util.Set;
 
-@TestTargetClass(Currency.class)
 public class CurrencyTest extends junit.framework.TestCase {
 
     private static Locale defaultLocale = Locale.getDefault();
 
     /**
-     * @tests java.util.Currency#getInstance(java.lang.String)
+     * java.util.Currency#getInstance(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "getInstance(String) method is tested in test_getInstanceLjava_util_Locale() test.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() {
         // see test_getInstanceLjava_util_Locale() tests
     }
 
     /**
-     * @tests java.util.Currency#getInstance(java.util.Locale)
+     * java.util.Currency#getInstance(java.util.Locale)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.util.Locale.class}
-    )
     public void test_getInstanceLjava_util_Locale() {
         /*
          * the behaviour in all these three cases should be the same since this
@@ -139,20 +125,9 @@
     }
 
     /**
-     * @tests java.util.Currency#getSymbol()
+     * java.util.Currency#getSymbol()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSymbol",
-        args = {}
-    )
-    @AndroidOnly("icu and the RI have different data. Because Android"
-            + "only defines a few locales as a must have, it was not possible"
-            + "to find a set of combinations where no differences between"
-            + "the RI and Android exist.")
     public void test_getSymbol() {
-
         Currency currK = Currency.getInstance("KRW");
         Currency currI = Currency.getInstance("IEP");
         Currency currUS = Currency.getInstance("USD");
@@ -185,21 +160,14 @@
     }
 
     /**
-     * @tests java.util.Currency#getSymbol(java.util.Locale)
+     * java.util.Currency#getSymbol(java.util.Locale)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSymbol",
-        args = {java.util.Locale.class}
-    )
-    @AndroidOnly("specification doesn't include strong requirements for returnig symbol. On android platform used wrong character for yen sign: \u00a5 instead of \uffe5. Both of them give correct image though")
     public void test_getSymbolLjava_util_Locale() {
         //Tests was simplified because java specification not
         // includes strong requirements for returnig symbol.
         // on android platform used wrong character for yen
         // sign: \u00a5 instead of \uffe5
-        Locale[] loc1 = new Locale[]{
+        Locale[] desiredLocales = new Locale[]{
                 Locale.JAPAN,  Locale.JAPANESE,
                 Locale.FRANCE, Locale.FRENCH,
                 Locale.US,     Locale.UK,
@@ -226,11 +194,18 @@
 
                 new Locale("da", ""), new Locale("ja", ""),
                 new Locale("en", "")};
-        if (!Support_Locale.areLocalesAvailable(loc1)) {
-            // locale dependent test, bug 1943269
-            return;
+
+        Set<Locale> availableLocales = new HashSet<Locale>(Arrays.asList(Locale.getAvailableLocales()));
+
+        ArrayList<Locale> locales = new ArrayList<Locale>();
+        for (Locale desiredLocale : desiredLocales) {
+            if (availableLocales.contains(desiredLocale)) {
+                locales.add(desiredLocale);
+            }
         }
 
+        Locale[] loc1 = locales.toArray(new Locale[locales.size()]);
+
         String[] euro    = new String[] {"EUR", "\u20ac"};
         // \u00a5 and \uffe5 are actually the same symbol, just different code points.
         // But the RI returns the \uffe5 and Android returns those with \u00a5
@@ -321,14 +296,8 @@
     }
 
     /**
-     * @tests java.util.Currency#getDefaultFractionDigits()
+     * java.util.Currency#getDefaultFractionDigits()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultFractionDigits",
-        args = {}
-    )
     public void test_getDefaultFractionDigits() {
 
         Currency c1 = Currency.getInstance("TND");
@@ -357,17 +326,11 @@
     }
 
     /**
-     * @tests java.util.Currency#getCurrencyCode() Note: lines under remarks
+     * java.util.Currency#getCurrencyCode() Note: lines under remarks
      *        (Locale.CHINESE, Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN,
      *        Locale.ITALIAN, Locale.JAPANESE, Locale.KOREAN) raises exception
      *        on SUN VM
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCurrencyCode",
-        args = {}
-    )
     public void test_getCurrencyCode() {
         final Collection<Locale> locVal = Arrays.asList(
                 Locale.CANADA,
@@ -398,17 +361,11 @@
     }
 
     /**
-     * @tests java.util.Currency#toString() Note: lines under remarks
+     * java.util.Currency#toString() Note: lines under remarks
      *        (Locale.CHINESE, Locale.ENGLISH, Locale.FRENCH, Locale.GERMAN,
      *        Locale.ITALIAN, Locale.JAPANESE, Locale.KOREAN) raises exception
      *        on SUN VM
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         final Collection<Locale> locVal = Arrays.asList(
                 Locale.CANADA,
diff --git a/luni/src/test/java/tests/api/java/util/DateTest.java b/luni/src/test/java/tests/api/java/util/DateTest.java
index a6e7718..6100527 100644
--- a/luni/src/test/java/tests/api/java/util/DateTest.java
+++ b/luni/src/test/java/tests/api/java/util/DateTest.java
@@ -17,29 +17,17 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.Locale;
 import java.util.TimeZone;
 
-@TestTargetClass(Date.class)
 public class DateTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.Date#Date()
+     * java.util.Date#Date()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Date",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.Date()
         GregorianCalendar gc = new GregorianCalendar(1998, Calendar.OCTOBER,
@@ -51,14 +39,8 @@
     }
 
     /**
-     * @tests java.util.Date#Date(int, int, int)
+     * java.util.Date#Date(int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Date",
-        args = {int.class, int.class, int.class}
-    )
     public void test_ConstructorIII() {
         // Test for method java.util.Date(int, int, int)
         Date d1 = new Date(70, 0, 1); // the epoch + local time
@@ -74,14 +56,8 @@
     }
 
     /**
-     * @tests java.util.Date#Date(int, int, int, int, int)
+     * java.util.Date#Date(int, int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Date",
-        args = {int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_ConstructorIIIII() {
         // Test for method java.util.Date(int, int, int, int, int)
 
@@ -96,14 +72,8 @@
     }
 
     /**
-     * @tests java.util.Date#Date(int, int, int, int, int, int)
+     * java.util.Date#Date(int, int, int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Date",
-        args = {int.class, int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_ConstructorIIIIII() {
         // Test for method java.util.Date(int, int, int, int, int, int)
 
@@ -118,28 +88,16 @@
     }
 
     /**
-     * @tests java.util.Date#Date(long)
+     * java.util.Date#Date(long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Date",
-        args = {long.class}
-    )
     public void test_ConstructorJ() {
         // Test for method java.util.Date(long)
         assertTrue("Used to test", true);
     }
 
     /**
-     * @tests java.util.Date#Date(java.lang.String)
+     * java.util.Date#Date(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Date",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.util.Date(java.lang.String)
         Date d1 = new Date("January 1, 1970, 00:00:00 GMT"); // the epoch
@@ -157,14 +115,8 @@
     }
 
     /**
-     * @tests java.util.Date#after(java.util.Date)
+     * java.util.Date#after(java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "after",
-        args = {java.util.Date.class}
-    )
     public void test_afterLjava_util_Date() {
         // Test for method boolean java.util.Date.after(java.util.Date)
         Date d1 = new Date(0);
@@ -181,14 +133,8 @@
     }
 
     /**
-     * @tests java.util.Date#before(java.util.Date)
+     * java.util.Date#before(java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "before",
-        args = {java.util.Date.class}
-    )
     public void test_beforeLjava_util_Date() {
         // Test for method boolean java.util.Date.before(java.util.Date)
         Date d1 = new Date(0);
@@ -205,14 +151,8 @@
     }
 
     /**
-     * @tests java.util.Date#clone()
+     * java.util.Date#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.Date.clone()
         Date d1 = new Date(100000);
@@ -224,14 +164,8 @@
     }
 
     /**
-     * @tests java.util.Date#compareTo(java.util.Date)
+     * java.util.Date#compareTo(java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "compareTo",
-        args = {java.util.Date.class}
-    )
     public void test_compareToLjava_util_Date() {
         // Test for method int java.util.Date.compareTo(java.util.Date)
         final int someNumber = 10000;
@@ -257,14 +191,8 @@
     }
 
     /**
-     * @tests java.util.Date#equals(java.lang.Object)
+     * java.util.Date#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean java.util.Date.equals(java.lang.Object)
         Date d1 = new Date(0);
@@ -275,14 +203,8 @@
     }
 
     /**
-     * @tests java.util.Date#getDate()
+     * java.util.Date#getDate()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDate",
-        args = {}
-    )
     public void test_getDate() {
         // Test for method int java.util.Date.getDate()
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -291,14 +213,8 @@
     }
 
     /**
-     * @tests java.util.Date#getDay()
+     * java.util.Date#getDay()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDay",
-        args = {}
-    )
     public void test_getDay() {
         // Test for method int java.util.Date.getDay()
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -307,14 +223,8 @@
     }
 
     /**
-     * @tests java.util.Date#getHours()
+     * java.util.Date#getHours()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHours",
-        args = {}
-    )
     public void test_getHours() {
         // Test for method int java.util.Date.getHours()
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -323,14 +233,8 @@
     }
 
     /**
-     * @tests java.util.Date#getMinutes()
+     * java.util.Date#getMinutes()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMinutes",
-        args = {}
-    )
     public void test_getMinutes() {
         // Test for method int java.util.Date.getMinutes()
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -339,14 +243,8 @@
     }
 
     /**
-     * @tests java.util.Date#getMonth()
+     * java.util.Date#getMonth()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMonth",
-        args = {}
-    )
     public void test_getMonth() {
         // Test for method int java.util.Date.getMonth()
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -355,14 +253,8 @@
     }
 
     /**
-     * @tests java.util.Date#getSeconds()
+     * java.util.Date#getSeconds()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSeconds",
-        args = {}
-    )
     public void test_getSeconds() {
         // Test for method int java.util.Date.getSeconds()
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -371,14 +263,8 @@
     }
 
     /**
-     * @tests java.util.Date#getTime()
+     * java.util.Date#getTime()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTime",
-        args = {}
-    )
     public void test_getTime() {
         // Test for method long java.util.Date.getTime()
         Date d1 = new Date(0);
@@ -388,14 +274,8 @@
     }
 
     /**
-     * @tests java.util.Date#getTimezoneOffset()
+     * java.util.Date#getTimezoneOffset()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTimezoneOffset",
-        args = {}
-    )
     public void test_getTimezoneOffset() {
         // Test for method int java.util.Date.getTimezoneOffset()
         assertTrue("Used to test", true);
@@ -404,14 +284,8 @@
     }
 
     /**
-     * @tests java.util.Date#getYear()
+     * java.util.Date#getYear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getYear",
-        args = {}
-    )
     public void test_getYear() {
         // Test for method int java.util.Date.getYear()
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -420,14 +294,8 @@
     }
 
     /**
-     * @tests java.util.Date#hashCode()
+     * java.util.Date#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         // Test for method int java.util.Date.hashCode()
         Date d1 = new Date(0);
@@ -437,14 +305,8 @@
     }
 
     /**
-     * @tests java.util.Date#parse(java.lang.String)
+     * java.util.Date#parse(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = {java.lang.String.class}
-    )
     public void test_parseLjava_lang_String() {
         // Test for method long java.util.Date.parse(java.lang.String)
         Date d = new Date(Date.parse("13 October 1998"));
@@ -486,14 +348,8 @@
     }
 
     /**
-     * @tests java.util.Date#setDate(int)
+     * java.util.Date#setDate(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDate",
-        args = {int.class}
-    )
     public void test_setDateI() {
         // Test for method void java.util.Date.setDate(int)
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -503,14 +359,8 @@
     }
 
     /**
-     * @tests java.util.Date#setHours(int)
+     * java.util.Date#setHours(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setHours",
-        args = {int.class}
-    )
     public void test_setHoursI() {
         // Test for method void java.util.Date.setHours(int)
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -520,14 +370,8 @@
     }
 
     /**
-     * @tests java.util.Date#setMinutes(int)
+     * java.util.Date#setMinutes(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMinutes",
-        args = {int.class}
-    )
     public void test_setMinutesI() {
         // Test for method void java.util.Date.setMinutes(int)
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -537,14 +381,8 @@
     }
 
     /**
-     * @tests java.util.Date#setMonth(int)
+     * java.util.Date#setMonth(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMonth",
-        args = {int.class}
-    )
     public void test_setMonthI() {
         // Test for method void java.util.Date.setMonth(int)
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -554,14 +392,8 @@
     }
 
     /**
-     * @tests java.util.Date#setSeconds(int)
+     * java.util.Date#setSeconds(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSeconds",
-        args = {int.class}
-    )
     public void test_setSecondsI() {
         // Test for method void java.util.Date.setSeconds(int)
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -571,14 +403,8 @@
     }
 
     /**
-     * @tests java.util.Date#setTime(long)
+     * java.util.Date#setTime(long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setTime",
-        args = {long.class}
-    )
     public void test_setTimeJ() {
         // Test for method void java.util.Date.setTime(long)
         Date d1 = new Date(0);
@@ -590,14 +416,8 @@
     }
 
     /**
-     * @tests java.util.Date#setYear(int)
+     * java.util.Date#setYear(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setYear",
-        args = {int.class}
-    )
     public void test_setYearI() {
         // Test for method void java.util.Date.setYear(int)
         Date d = new GregorianCalendar(1998, Calendar.OCTOBER, 13, 19, 9)
@@ -607,14 +427,8 @@
     }
 
     /**
-     * @tests java.util.Date#toGMTString()
+     * java.util.Date#toGMTString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toGMTString",
-        args = {}
-    )
     public void test_toGMTString() {
         // Test for method java.lang.String java.util.Date.toGMTString()
         assertEquals("Did not convert epoch to GMT string correctly", "1 Jan 1970 00:00:00 GMT", new Date(0)
@@ -625,14 +439,8 @@
     }
 
     /**
-     * @tests java.util.Date#toString()
+     * java.util.Date#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.util.Date.toString()
         Calendar cal = Calendar.getInstance();
@@ -660,14 +468,8 @@
     }
 
     /**
-     * @tests java.util.Date#UTC(int, int, int, int, int, int)
+     * java.util.Date#UTC(int, int, int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "UTC",
-        args = {int.class, int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_UTCIIIIII() {
         // Test for method long java.util.Date.UTC(int, int, int, int, int, int)
         assertTrue("Returned incorrect UTC value for epoch", Date.UTC(70, 0, 1,
@@ -676,15 +478,9 @@
                 0, 1, 0, 0, 0) == (long) 365 * 24 * 60 * 60 * 1000);
     }
     /**
-     * @tests java.util.Date#toLocaleString() Test for method java.lang.String
+     * java.util.Date#toLocaleString() Test for method java.lang.String
      *        java.util.Date.toGMTString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toLocaleString",
-        args = {}
-    )
     public void test_toLocaleString() {
         Locale loc = Locale.getDefault();
         Locale.setDefault(Locale.US);
diff --git a/luni/src/test/java/tests/api/java/util/EmptyStackExceptionTest.java b/luni/src/test/java/tests/api/java/util/EmptyStackExceptionTest.java
index 9f8b3bd..31ee1e2 100644
--- a/luni/src/test/java/tests/api/java/util/EmptyStackExceptionTest.java
+++ b/luni/src/test/java/tests/api/java/util/EmptyStackExceptionTest.java
@@ -17,29 +17,17 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.EmptyStackException;
 import java.util.Stack;
 
-@TestTargetClass(EmptyStackException.class)
 public class EmptyStackExceptionTest extends junit.framework.TestCase {
 
     Object[] objArray = new Object[10];
     Stack s;
 
     /**
-     * @tests java.util.EmptyStackException#EmptyStackException()
+     * java.util.EmptyStackException#EmptyStackException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "EmptyStackException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.EmptyStackException()
         try {
diff --git a/luni/src/test/java/tests/api/java/util/EnumMapTest.java b/luni/src/test/java/tests/api/java/util/EnumMapTest.java
index 27ad10d..05826d1 100644
--- a/luni/src/test/java/tests/api/java/util/EnumMapTest.java
+++ b/luni/src/test/java/tests/api/java/util/EnumMapTest.java
@@ -16,10 +16,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
 import dalvik.annotation.AndroidOnly;
 
 import java.util.ArrayList;
@@ -35,7 +31,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(EnumMap.class)
 public class EnumMapTest extends TestCase {
     enum Size {
         Small, Middle, Big {};
@@ -81,14 +76,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#EnumMap(Class)
+     * java.util.EnumMap#EnumMap(Class)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "EnumMap",
-        args = {java.lang.Class.class}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_ConstructorLjava_lang_Class() {
         try {
@@ -153,14 +142,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#EnumMap(EnumMap)
+     * java.util.EnumMap#EnumMap(EnumMap)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "EnumMap",
-        args = {java.util.EnumMap.class}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_ConstructorLjava_util_EnumMap() {
         EnumMap enumMap;
@@ -193,14 +176,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#EnumMap(Map)
+     * java.util.EnumMap#EnumMap(Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "EnumMap",
-        args = {java.util.Map.class}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_ConstructorLjava_util_Map() {
         EnumMap enumMap;
@@ -257,14 +234,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#clear()
+     * java.util.EnumMap#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_clear() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -274,14 +245,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#containsKey(Object)
+     * java.util.EnumMap#containsKey(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_containsKeyLjava_lang_Object() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -304,14 +269,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#clone()
+     * java.util.EnumMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_clone() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -332,14 +291,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#containsValue(Object)
+     * java.util.EnumMap#containsValue(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_containsValueLjava_lang_Object() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -367,14 +320,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#entrySet()
+     * java.util.EnumMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     @AndroidOnly("Map.Entry is indirectly modified on RI when Iterator.next() is invoked")
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_entrySet() {
@@ -603,14 +550,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#equals(Object)
+     * java.util.EnumMap#equals(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_equalsLjava_lang_Object() {
         EnumMap enumMap = new EnumMap(Size.class);
@@ -649,14 +590,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#keySet()
+     * java.util.EnumMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_keySet() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -812,14 +747,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#get(Object)
+     * java.util.EnumMap#get(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_getLjava_lang_Object() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -862,14 +791,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#put(Object,Object)
+     * java.util.EnumMap#put(Object,Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "put",
-        args = {Enum.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
         try {
@@ -912,14 +835,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#putAll(Map)
+     * java.util.EnumMap#putAll(Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_putAllLjava_util_Map() {
         EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class);
@@ -985,14 +902,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#remove(Object)
+     * java.util.EnumMap#remove(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_removeLjava_lang_Object() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -1032,14 +943,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#size()
+     * java.util.EnumMap#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void test_size() {
         EnumMap enumSizeMap = new EnumMap(Size.class);
@@ -1076,14 +981,8 @@
     }
 
     /**
-     * @tests java.util.EnumMap#values()
+     * java.util.EnumMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_values() {
         EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class);
@@ -1238,14 +1137,8 @@
     }
 
     /**
-     * @tests serialization/deserialization.
+     * serialization/deserialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization compatibility.",
-        method = "!SerializationSelf",
-        args = {}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void testSerializationSelf() throws Exception {
         EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class);
@@ -1254,14 +1147,8 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization compatibility.",
-        method = "!SerializationGolden",
-        args = {}
-    )
     @SuppressWarnings({ "unchecked", "boxing" })
     public void testSerializationCompatibility() throws Exception {
         EnumMap enumColorMap = new EnumMap<Color, Double>(Color.class);
diff --git a/luni/src/test/java/tests/api/java/util/EnumSetTest.java b/luni/src/test/java/tests/api/java/util/EnumSetTest.java
index d082569..2b33877 100644
--- a/luni/src/test/java/tests/api/java/util/EnumSetTest.java
+++ b/luni/src/test/java/tests/api/java/util/EnumSetTest.java
@@ -16,11 +16,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.EnumSet;
@@ -32,7 +27,6 @@
 
 import org.apache.harmony.testframework.serialization.SerializationTest;
 
-@TestTargetClass(EnumSet.class)
 public class EnumSetTest extends TestCase {
     static final boolean disableRIBugs = true;
 
@@ -73,14 +67,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#noneOf(java.lang.Class)
+     * java.util.EnumSet#noneOf(java.lang.Class)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "noneOf",
-        args = {java.lang.Class.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_NoneOf_LClass() {
         try {
@@ -126,7 +114,7 @@
     }
 
     /**
-     * @tests java.util.HugeEnumSet#iterator()
+     * java.util.HugeEnumSet#iterator()
      */
     public void test_iterator_HugeEnumSet() {
         EnumSet<HugeEnumCount> set;
@@ -169,14 +157,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#allOf(java.lang.Class)
+     * java.util.EnumSet#allOf(java.lang.Class)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "allOf",
-        args = {java.lang.Class.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_AllOf_LClass() {
         try {
@@ -228,14 +210,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#add(E)
+     * java.util.EnumSet#add(E)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_add_E() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
@@ -338,14 +314,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#addAll(Collection)
+     * java.util.EnumSet#addAll(Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_addAll_LCollection() {
 
@@ -502,14 +472,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#remove(Object)
+     * java.util.EnumSet#remove(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify exceptions.",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_remove_LOject() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
         Enum[] elements = EnumFoo.class.getEnumConstants();
@@ -552,14 +516,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#equals(Object)
+     * java.util.EnumSet#equals(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equals_LObject() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
         Enum[] elements = EnumFoo.class.getEnumConstants();
@@ -617,14 +575,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#clear()
+     * java.util.EnumSet#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
         set.add(EnumFoo.a);
@@ -649,14 +601,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#size()
+     * java.util.EnumSet#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
         set.add(EnumFoo.a);
@@ -671,14 +617,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#complementOf(java.util.EnumSet)
+     * java.util.EnumSet#complementOf(java.util.EnumSet)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "complementOf",
-        args = {java.util.EnumSet.class}
-    )
     public void test_ComplementOf_LEnumSet() {
 
         try {
@@ -727,14 +667,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#contains(Object)
+     * java.util.EnumSet#contains(Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException, and NullPointerException.",
-        method = "contains",
-        args = {java.lang.Object.class}
-    )
     public void test_contains_LObject() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
         Enum[] elements = EnumFoo.class.getEnumConstants();
@@ -804,14 +738,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#containsAll(Collection)
+     * java.util.EnumSet#containsAll(Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsAll",
-        args = {java.util.Collection.class}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void test_containsAll_LCollection() {
         EnumSet<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
@@ -961,14 +889,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#copyOf(java.util.Collection)
+     * java.util.EnumSet#copyOf(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "copyOf",
-        args = {java.util.Collection.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_CopyOf_LCollection() {
         try {
@@ -1054,14 +976,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#copyOf(java.util.EnumSet)
+     * java.util.EnumSet#copyOf(java.util.EnumSet)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "copyOf",
-        args = {java.util.EnumSet.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_CopyOf_LEnumSet() {
         EnumSet<EnumWithInnerClass> enumSet = EnumSet
@@ -1107,14 +1023,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#removeAll(Collection)
+     * java.util.EnumSet#removeAll(Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify UnsupportedOperationException, ClassCastException.",
-        method = "removeAll",
-        args = {java.util.Collection.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_removeAll_LCollection() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
@@ -1287,14 +1197,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#retainAll(Collection)
+     * java.util.EnumSet#retainAll(Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify UnsupportedOperationException, ClassCastException.",
-        method = "retainAll",
-        args = {java.util.Collection.class}
-    )
     @SuppressWarnings("unchecked")
     public void test_retainAll_LCollection() {
         Set<EnumFoo> set = EnumSet.allOf(EnumFoo.class);
@@ -1482,14 +1386,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#iterator()
+     * java.util.EnumSet#iterator()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "iterator",
-        args = {}
-    )
     public void test_iterator() {
         Set<EnumFoo> set = EnumSet.noneOf(EnumFoo.class);
         set.add(EnumFoo.a);
@@ -1709,14 +1607,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#of(E)
+     * java.util.EnumSet#of(E)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "of",
-        args = {java.lang.Enum.class}
-    )
     public void test_Of_E() {
         EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a);
         assertEquals("enumSet should have length 1:", 1, enumSet.size());
@@ -1739,14 +1631,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#of(E, E)
+     * java.util.EnumSet#of(E, E)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "of",
-        args = {java.lang.Enum.class, java.lang.Enum.class}
-    )
     public void test_Of_EE() {
         EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a,
                 EnumWithInnerClass.b);
@@ -1816,14 +1702,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#of(E, E, E)
+     * java.util.EnumSet#of(E, E, E)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "of",
-        args = {java.lang.Enum.class, java.lang.Enum.class, java.lang.Enum.class}
-    )
     public void test_Of_EEE() {
         EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a,
                 EnumWithInnerClass.b, EnumWithInnerClass.c);
@@ -1865,14 +1745,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#of(E, E, E, E)
+     * java.util.EnumSet#of(E, E, E, E)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "of",
-        args = {java.lang.Enum.class, java.lang.Enum.class, java.lang.Enum.class, java.lang.Enum.class}
-    )
     public void test_Of_EEEE() {
         EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a,
                 EnumWithInnerClass.b, EnumWithInnerClass.c,
@@ -1909,14 +1783,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#of(E, E, E, E, E)
+     * java.util.EnumSet#of(E, E, E, E, E)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "of",
-        args = {java.lang.Enum.class, java.lang.Enum.class, java.lang.Enum.class, java.lang.Enum.class, java.lang.Enum.class}
-    )
     public void test_Of_EEEEE() {
         EnumSet<EnumWithInnerClass> enumSet = EnumSet.of(EnumWithInnerClass.a,
                 EnumWithInnerClass.b, EnumWithInnerClass.c,
@@ -1951,14 +1819,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#of(E, E...)
+     * java.util.EnumSet#of(E, E...)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "of",
-        args = {java.lang.Enum.class, java.lang.Enum[].class}
-    )
     public void test_Of_EEArray() {
         EnumWithInnerClass[] enumArray = new EnumWithInnerClass[] {
                 EnumWithInnerClass.b, EnumWithInnerClass.c };
@@ -2009,14 +1871,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#range(E, E)
+     * java.util.EnumSet#range(E, E)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "range",
-        args = {java.lang.Enum.class, java.lang.Enum.class}
-    )
     public void test_Range_EE() {
         try {
             EnumSet.range(EnumWithInnerClass.c, null);
@@ -2101,14 +1957,8 @@
     }
 
     /**
-     * @tests java.util.EnumSet#clone()
+     * java.util.EnumSet#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_Clone() {
         EnumSet<EnumFoo> enumSet = EnumSet.allOf(EnumFoo.class);
         EnumSet<EnumFoo> clonedEnumSet = enumSet.clone();
@@ -2135,28 +1985,16 @@
     }
 
     /**
-     * @tests java.util.EnumSet#Serialization()
+     * java.util.EnumSet#Serialization()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization compatibility.",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void test_serialization() throws Exception {
         EnumSet<EnumFoo> set = EnumSet.allOf(EnumFoo.class);
         SerializationTest.verifySelf(set);
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization compatibility.",
-        method = "!SerializationGolden",
-        args = {}
-    )
     @SuppressWarnings( { "unchecked", "boxing" })
     public void testSerializationCompatibility() throws Exception {
         EnumSet<EnumFoo> set = EnumSet.allOf(EnumFoo.class);
diff --git a/luni/src/test/java/tests/api/java/util/EventObjectTest.java b/luni/src/test/java/tests/api/java/util/EventObjectTest.java
index e70f1fa..201d9f3 100644
--- a/luni/src/test/java/tests/api/java/util/EventObjectTest.java
+++ b/luni/src/test/java/tests/api/java/util/EventObjectTest.java
@@ -17,14 +17,8 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.EventObject;
 
-@TestTargetClass(EventObject.class)
 public class EventObjectTest extends junit.framework.TestCase {
 
     Object myObject;
@@ -32,14 +26,8 @@
     EventObject myEventObject;
 
     /**
-     * @tests java.util.EventObject#EventObject(java.lang.Object)
+     * java.util.EventObject#EventObject(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "See setUp method.",
-        method = "EventObject",
-        args = {java.lang.Object.class}
-    )
     public void test_ConstructorLjava_lang_Object() {
         try {
             new EventObject(null);
@@ -50,14 +38,8 @@
     }
 
     /**
-     * @tests java.util.EventObject#getSource()
+     * java.util.EventObject#getSource()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSource",
-        args = {}
-    )
     public void test_getSource() {
         // Test for method java.lang.Object java.util.EventObject.getSource()
         assertTrue("Wrong source returned",
@@ -65,14 +47,8 @@
     }
 
     /**
-     * @tests java.util.EventObject#toString()
+     * java.util.EventObject#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.util.EventObject.toString()
         assertTrue("Incorrect toString returned: " + myEventObject.toString(),
diff --git a/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java b/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java
index a7de317..2aa4954 100644
--- a/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java
+++ b/luni/src/test/java/tests/api/java/util/FormattableFlagsTest.java
@@ -15,26 +15,14 @@
  */
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.FormattableFlags;
 import junit.framework.TestCase;
 
-@TestTargetClass(FormattableFlags.class)
 public class FormattableFlagsTest extends TestCase {
 
     /**
      * @test java.util.FormattableFlags ConstantFieldValues
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies fields.",
-        method = "!Constants",
-        args = {}
-    )
     public void test_ConstantFieldValues() {
         assertEquals(1, FormattableFlags.LEFT_JUSTIFY);
         assertEquals(2, FormattableFlags.UPPERCASE);
diff --git a/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java b/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java
index 1b360f7..553a0b903 100644
--- a/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java
+++ b/luni/src/test/java/tests/api/java/util/GregorianCalendarTest.java
@@ -18,10 +18,6 @@
 package tests.api.java.util;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.KnownFailure;
 import tests.support.Support_Locale;
 
 import java.util.BitSet;
@@ -34,18 +30,11 @@
 import java.util.Vector;
 
 
-@TestTargetClass(GregorianCalendar.class)
 public class GregorianCalendarTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.GregorianCalendar#GregorianCalendar()
+     * java.util.GregorianCalendar#GregorianCalendar()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GregorianCalendar",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.GregorianCalendar()
         assertTrue("Constructed incorrect calendar", (new GregorianCalendar()
@@ -53,14 +42,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#GregorianCalendar(int, int, int)
+     * java.util.GregorianCalendar#GregorianCalendar(int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GregorianCalendar",
-        args = {int.class, int.class, int.class}
-    )
     public void test_ConstructorIII() {
         // Test for method java.util.GregorianCalendar(int, int, int)
         GregorianCalendar gc = new GregorianCalendar(1972, Calendar.OCTOBER, 13);
@@ -75,15 +58,9 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#GregorianCalendar(int, int, int, int,
+     * java.util.GregorianCalendar#GregorianCalendar(int, int, int, int,
      *        int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GregorianCalendar",
-        args = {int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_ConstructorIIIII() {
         // Test for method java.util.GregorianCalendar(int, int, int, int, int)
         GregorianCalendar gc = new GregorianCalendar(1972, Calendar.OCTOBER,
@@ -109,15 +86,9 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#GregorianCalendar(int, int, int, int,
+     * java.util.GregorianCalendar#GregorianCalendar(int, int, int, int,
      *        int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GregorianCalendar",
-        args = {int.class, int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_ConstructorIIIIII() {
         // Test for method java.util.GregorianCalendar(int, int, int, int, int,
         // int)
@@ -141,41 +112,26 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#GregorianCalendar(java.util.Locale)
+     * java.util.GregorianCalendar#GregorianCalendar(java.util.Locale)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GregorianCalendar",
-        args = {java.util.Locale.class}
-    )
     public void test_ConstructorLjava_util_Locale() {
-        Locale[] requiredLocales = {Locale.US, Locale.FRANCE};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
-        }
-        // Test for method java.util.GregorianCalendar(java.util.Locale)
         Date date = new Date();
         GregorianCalendar gcUS = new GregorianCalendar(Locale.US);
         gcUS.setTime(date);
         GregorianCalendar gcUS2 = new GregorianCalendar(Locale.US);
         gcUS2.setTime(date);
-        GregorianCalendar gcFrance = new GregorianCalendar(Locale.FRANCE);
-        gcFrance.setTime(date);
         assertTrue("Locales not created correctly", gcUS.equals(gcUS2));
-        assertFalse("Locales not created correctly", gcUS.equals(gcFrance));
+
+        if (Support_Locale.isLocaleAvailable(Locale.FRANCE)) {
+            GregorianCalendar gcFrance = new GregorianCalendar(Locale.FRANCE);
+            gcFrance.setTime(date);
+            assertFalse("Locales not created correctly", gcUS.equals(gcFrance));
+        }
     }
 
     /**
-     * @tests java.util.GregorianCalendar#GregorianCalendar(java.util.TimeZone)
+     * java.util.GregorianCalendar#GregorianCalendar(java.util.TimeZone)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GregorianCalendar",
-        args = {java.util.TimeZone.class}
-    )
     public void test_ConstructorLjava_util_TimeZone() {
         // Test for method java.util.GregorianCalendar(java.util.TimeZone)
         Date date = new Date();
@@ -205,15 +161,9 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#GregorianCalendar(java.util.TimeZone,
+     * java.util.GregorianCalendar#GregorianCalendar(java.util.TimeZone,
      *        java.util.Locale)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "GregorianCalendar",
-        args = {java.util.TimeZone.class, java.util.Locale.class}
-    )
     public void test_ConstructorLjava_util_TimeZoneLjava_util_Locale() {
         // Test for method java.util.GregorianCalendar(java.util.TimeZone,
         // java.util.Locale)
@@ -245,14 +195,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#add(int, int)
+     * java.util.GregorianCalendar#add(int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {int.class, int.class}
-    )
     @AndroidOnly("This test fails on the RI with version 1.5 but succeeds"
             + "on the RI with version 1.6")
     public void test_addII() {
@@ -337,14 +281,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#equals(java.lang.Object)
+     * java.util.GregorianCalendar#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean
         // java.util.GregorianCalendar.equals(java.lang.Object)
@@ -358,14 +296,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getActualMaximum(int)
+     * java.util.GregorianCalendar#getActualMaximum(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getActualMaximum",
-        args = {int.class}
-    )
     public void test_getActualMaximumI() {
         // Test for method int java.util.GregorianCalendar.getActualMaximum(int)
         GregorianCalendar gc1 = new GregorianCalendar(1900, 1, 1);
@@ -419,14 +351,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getActualMinimum(int)
+     * java.util.GregorianCalendar#getActualMinimum(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getActualMinimum",
-        args = {int.class}
-    )
     public void test_getActualMinimumI() {
         // Test for method int java.util.GregorianCalendar.getActualMinimum(int)
         GregorianCalendar gc1 = new GregorianCalendar(1900, 1, 1);
@@ -448,14 +374,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getGreatestMinimum(int)
+     * java.util.GregorianCalendar#getGreatestMinimum(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getGreatestMinimum",
-        args = {int.class}
-    )
     public void test_getGreatestMinimumI() {
         // Test for method int
         // java.util.GregorianCalendar.getGreatestMinimum(int)
@@ -480,14 +400,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getGregorianChange()
+     * java.util.GregorianCalendar#getGregorianChange()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getGregorianChange",
-        args = {}
-    )
     public void test_getGregorianChange() {
         // Test for method java.util.Date
         // java.util.GregorianCalendar.getGregorianChange()
@@ -504,14 +418,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getLeastMaximum(int)
+     * java.util.GregorianCalendar#getLeastMaximum(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLeastMaximum",
-        args = {int.class}
-    )
     public void test_getLeastMaximumI() {
         // Test for method int java.util.GregorianCalendar.getLeastMaximum(int)
         GregorianCalendar gc = new GregorianCalendar();
@@ -547,14 +455,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getMaximum(int)
+     * java.util.GregorianCalendar#getMaximum(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaximum",
-        args = {int.class}
-    )
     public void test_getMaximumI() {
         // Test for method int java.util.GregorianCalendar.getMaximum(int)
         GregorianCalendar gc = new GregorianCalendar();
@@ -582,14 +484,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getMinimum(int)
+     * java.util.GregorianCalendar#getMinimum(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMinimum",
-        args = {int.class}
-    )
     public void test_getMinimumI() {
         // Test for method int java.util.GregorianCalendar.getMinimum(int)
         GregorianCalendar gc = new GregorianCalendar();
@@ -613,14 +509,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#isLeapYear(int)
+     * java.util.GregorianCalendar#isLeapYear(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isLeapYear",
-        args = {int.class}
-    )
     public void test_isLeapYearI() {
         // Test for method boolean java.util.GregorianCalendar.isLeapYear(int)
         GregorianCalendar gc = new GregorianCalendar(1998, 11, 6);
@@ -632,14 +522,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#roll(int, int)
+     * java.util.GregorianCalendar#roll(int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "roll",
-        args = {int.class, int.class}
-    )
     public void test_rollII() {
         // Test for method void java.util.GregorianCalendar.roll(int, int)
         GregorianCalendar gc = new GregorianCalendar(1972, Calendar.OCTOBER, 8,
@@ -661,14 +545,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#roll(int, boolean)
+     * java.util.GregorianCalendar#roll(int, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "roll",
-        args = {int.class, boolean.class}
-    )
     public void test_rollIZ() {
         // Test for method void java.util.GregorianCalendar.roll(int, boolean)
         GregorianCalendar gc = new GregorianCalendar(1972, Calendar.OCTOBER,
@@ -715,14 +593,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#setGregorianChange(java.util.Date)
+     * java.util.GregorianCalendar#setGregorianChange(java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setGregorianChange",
-        args = {java.util.Date.class}
-    )
     public void test_setGregorianChangeLjava_util_Date() {
         // Test for method void
         // java.util.GregorianCalendar.setGregorianChange(java.util.Date)
@@ -736,14 +608,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#clone()
+     * java.util.GregorianCalendar#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
 
         // Regression for HARMONY-498
@@ -762,14 +628,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#getMinimalDaysInFirstWeek()
+     * java.util.GregorianCalendar#getMinimalDaysInFirstWeek()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMinimalDaysInFirstWeek",
-        args = {}
-    )
     public void test_getMinimalDaysInFirstWeek() {
         // Regression for Harmony-1037
         GregorianCalendar g = new GregorianCalendar(TimeZone
@@ -789,14 +649,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#computeTime()
+     * java.util.GregorianCalendar#computeTime()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks computeTime indirectly.",
-        method = "computeTime",
-        args = {}
-    )
     public void test_computeTime() {
 
         // Regression for Harmony-493
@@ -832,12 +686,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Checks computeFields indirectly.",
-        method = "computeFields",
-        args = {}
-    )
     public void test_computeFields() {
         GregorianCalendar g = new GregorianCalendar(
             TimeZone.getTimeZone("Europe/London"),
@@ -854,14 +702,8 @@
     }
 
     /**
-     * @tests java.util.GregorianCalendar#get(int)
+     * java.util.GregorianCalendar#get(int)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ArrayIndexOutOfBoundsException.",
-        method = "get",
-        args = {int.class}
-    )
     @SuppressWarnings("deprecation")
     public void test_getI() {
         // Regression test for HARMONY-2959
@@ -880,12 +722,6 @@
         assertEquals(11, gc.get(Calendar.MONTH));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         GregorianCalendar g = new GregorianCalendar(
                 TimeZone.getTimeZone("Europe/London"),
@@ -901,12 +737,6 @@
             assertNotSame(g.hashCode(), g1.hashCode());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setFirstDayOfWeek",
-        args = {int.class}
-    )
     public void test_setFirstDayOfWeekI() {
         GregorianCalendar g = new GregorianCalendar(
                 TimeZone.getTimeZone("Europe/London"),
@@ -921,12 +751,6 @@
         g.setFirstDayOfWeek(-10);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMinimalDaysInFirstWeek",
-        args = {int.class}
-    )
     public void test_setMinimalDaysInFirstWeekI() {
         GregorianCalendar g = new GregorianCalendar(
                 TimeZone.getTimeZone("Europe/London"),
diff --git a/luni/src/test/java/tests/api/java/util/HashMapTest.java b/luni/src/test/java/tests/api/java/util/HashMapTest.java
index 7d1e1f4..b37e813 100644
--- a/luni/src/test/java/tests/api/java/util/HashMapTest.java
+++ b/luni/src/test/java/tests/api/java/util/HashMapTest.java
@@ -17,17 +17,11 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.*;
 
 import tests.support.Support_MapTest2;
 import tests.support.Support_UnmodifiableCollectionTest;
 
-@TestTargetClass(HashMap.class)
 public class HashMapTest extends junit.framework.TestCase {
     class MockMap extends AbstractMap {
         public Set entrySet() {
@@ -57,14 +51,8 @@
     Object[] objArray2;
 
     /**
-     * @tests java.util.HashMap#HashMap()
+     * java.util.HashMap#HashMap()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashMap",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.HashMap()
         new Support_MapTest2(new HashMap()).runTest();
@@ -74,14 +62,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#HashMap(int)
+     * java.util.HashMap#HashMap(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashMap",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.HashMap(int)
         HashMap hm2 = new HashMap(5);
@@ -100,14 +82,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#HashMap(int, float)
+     * java.util.HashMap#HashMap(int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashMap",
-        args = {int.class, float.class}
-    )
     public void test_ConstructorIF() {
         // Test for method java.util.HashMap(int, float)
         HashMap hm2 = new HashMap(5, (float) 0.5);
@@ -126,14 +102,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#HashMap(java.util.Map)
+     * java.util.HashMap#HashMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashMap",
-        args = {java.util.Map.class}
-    )
     public void test_ConstructorLjava_util_Map() {
         // Test for method java.util.HashMap(java.util.Map)
         Map myMap = new TreeMap();
@@ -150,14 +120,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#clear()
+     * java.util.HashMap#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.HashMap.clear()
         hm.clear();
@@ -169,14 +133,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#clone()
+     * java.util.HashMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.HashMap.clone()
         HashMap hm2 = (HashMap) hm.clone();
@@ -221,14 +179,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#containsKey(java.lang.Object)
+     * java.util.HashMap#containsKey(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKeyLjava_lang_Object() {
         // Test for method boolean
         // java.util.HashMap.containsKey(java.lang.Object)
@@ -244,14 +196,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#containsValue(java.lang.Object)
+     * java.util.HashMap#containsValue(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     public void test_containsValueLjava_lang_Object() {
         // Test for method boolean
         // java.util.HashMap.containsValue(java.lang.Object)
@@ -262,14 +208,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#entrySet()
+     * java.util.HashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySet() {
         // Test for method java.util.Set java.util.HashMap.entrySet()
         Set s = hm.entrySet();
@@ -284,14 +224,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#entrySet()
+     * java.util.HashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySetEquals() {
         Set s1 = hm.entrySet();
         Set s2 = new HashMap(hm).entrySet();
@@ -299,14 +233,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#entrySet()
+     * java.util.HashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_removeFromViews() {
         hm.put("A", null);
         hm.put("B", null);
@@ -318,14 +246,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#get(java.lang.Object)
+     * java.util.HashMap#get(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_getLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.HashMap.get(java.lang.Object)
@@ -355,14 +277,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#isEmpty()
+     * java.util.HashMap#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.HashMap.isEmpty()
         assertTrue("Returned false for new map", new HashMap().isEmpty());
@@ -370,14 +286,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#keySet()
+     * java.util.HashMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         // Test for method java.util.Set java.util.HashMap.keySet()
         Set s = hm.keySet();
@@ -429,14 +339,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#put(java.lang.Object, java.lang.Object)
+     * java.util.HashMap#put(java.lang.Object, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.HashMap.put(java.lang.Object, java.lang.Object)
@@ -455,14 +359,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#putAll(java.util.Map)
+     * java.util.HashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify NullPointerException.",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map() {
         // Test for method void java.util.HashMap.putAll(java.util.Map)
         HashMap hm2 = new HashMap();
@@ -478,14 +376,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#putAll(java.util.Map)
+     * java.util.HashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map_Null() {
         HashMap hashMap = new HashMap();
         try {
@@ -503,12 +395,6 @@
         }
     }
 
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Checks putAll that causes map to resize",
-            method = "putAll",
-            args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map_Resize() {
         Random rnd = new Random(666);
 
@@ -536,14 +422,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#remove(java.lang.Object)
+     * java.util.HashMap#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.HashMap.remove(java.lang.Object)
@@ -564,14 +444,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#size()
+     * java.util.HashMap#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.HashMap.size()
         assertTrue("Returned incorrect size",
@@ -579,14 +453,8 @@
     }
 
     /**
-     * @tests java.util.HashMap#values()
+     * java.util.HashMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         // Test for method java.util.Collection java.util.HashMap.values()
         Collection c = hm.values();
@@ -631,12 +499,6 @@
             return key == ((ReusableKey) o).key;
         }
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_Map_Entry_hashCode() {
         //Related to HARMONY-403
         HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(10);
diff --git a/luni/src/test/java/tests/api/java/util/HashSetTest.java b/luni/src/test/java/tests/api/java/util/HashSetTest.java
index 493dc9c..e4a65b7 100644
--- a/luni/src/test/java/tests/api/java/util/HashSetTest.java
+++ b/luni/src/test/java/tests/api/java/util/HashSetTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -35,7 +30,6 @@
 
 import org.apache.harmony.testframework.serialization.SerializationTest;
 
-@TestTargetClass(HashSet.class)
 public class HashSetTest extends junit.framework.TestCase {
 
     HashSet hs;
@@ -43,14 +37,8 @@
     Object[] objArray;
 
     /**
-     * @tests java.util.HashSet#HashSet()
+     * java.util.HashSet#HashSet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashSet",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.HashSet()
         HashSet hs2 = new HashSet();
@@ -58,14 +46,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#HashSet(int)
+     * java.util.HashSet#HashSet(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashSet",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.HashSet(int)
         HashSet hs2 = new HashSet(5);
@@ -80,14 +62,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#HashSet(int, float)
+     * java.util.HashSet#HashSet(int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashSet",
-        args = {int.class, float.class}
-    )
     public void test_ConstructorIF() {
         // Test for method java.util.HashSet(int, float)
         HashSet hs2 = new HashSet(5, (float) 0.5);
@@ -102,14 +78,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#HashSet(java.util.Collection)
+     * java.util.HashSet#HashSet(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HashSet",
-        args = {java.util.Collection.class}
-    )
     public void test_ConstructorLjava_util_Collection() {
         // Test for method java.util.HashSet(java.util.Collection)
         HashSet hs2 = new HashSet(Arrays.asList(objArray));
@@ -128,14 +98,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#add(java.lang.Object)
+     * java.util.HashSet#add(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLjava_lang_Object() {
         // Test for method boolean java.util.HashSet.add(java.lang.Object)
         int size = hs.size();
@@ -148,14 +112,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#clear()
+     * java.util.HashSet#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.HashSet.clear()
         Set orgSet = (Set) hs.clone();
@@ -167,14 +125,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#clone()
+     * java.util.HashSet#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.HashSet.clone()
         HashSet hs2 = (HashSet) hs.clone();
@@ -183,14 +135,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#contains(java.lang.Object)
+     * java.util.HashSet#contains(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "contains",
-        args = {java.lang.Object.class}
-    )
     public void test_containsLjava_lang_Object() {
         // Test for method boolean java.util.HashSet.contains(java.lang.Object)
         assertTrue("Returned false for valid object", hs.contains(objArray[90]));
@@ -203,14 +149,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#isEmpty()
+     * java.util.HashSet#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.HashSet.isEmpty()
         assertTrue("Empty set returned false", new HashSet().isEmpty());
@@ -218,14 +158,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#iterator()
+     * java.util.HashSet#iterator()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "iterator",
-        args = {}
-    )
     public void test_iterator() {
         // Test for method java.util.Iterator java.util.HashSet.iterator()
         Iterator i = hs.iterator();
@@ -243,14 +177,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#remove(java.lang.Object)
+     * java.util.HashSet#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method boolean java.util.HashSet.remove(java.lang.Object)
         int size = hs.size();
@@ -265,14 +193,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#size()
+     * java.util.HashSet#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.HashSet.size()
         assertTrue("Returned incorrect size", hs.size() == (objArray.length + 1));
@@ -281,22 +203,8 @@
     }
 
     /**
-     * @tests java.util.HashSet#SerializationTest
+     * java.util.HashSet#SerializationTest
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization compatibility.",
-            method = "!SerializationSelf",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization compatibility.",
-            method = "!SerializationGolden",
-            args = {}
-        )
-    })
     public void test_Serialization() throws Exception{
         HashSet<String> hs = new HashSet<String>();
         hs.add("hello");
diff --git a/luni/src/test/java/tests/api/java/util/HashtableTest.java b/luni/src/test/java/tests/api/java/util/HashtableTest.java
index 5cd9db8..9c97c7b 100644
--- a/luni/src/test/java/tests/api/java/util/HashtableTest.java
+++ b/luni/src/test/java/tests/api/java/util/HashtableTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -41,7 +36,6 @@
 import tests.support.Support_MapTest2;
 import tests.support.Support_UnmodifiableCollectionTest;
 
-@TestTargetClass(Hashtable.class)
 public class HashtableTest extends junit.framework.TestCase {
 
     private Hashtable ht10;
@@ -57,14 +51,8 @@
     private String h10sVal;
 
     /**
-     * @tests java.util.Hashtable#Hashtable()
+     * java.util.Hashtable#Hashtable()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Hashtable",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.Hashtable()
         new Support_MapTest2(new Hashtable()).runTest();
@@ -75,14 +63,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#Hashtable(int)
+     * java.util.Hashtable#Hashtable(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Hashtable",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.Hashtable(int)
         Hashtable h = new Hashtable(9);
@@ -103,14 +85,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#Hashtable(int, float)
+     * java.util.Hashtable#Hashtable(int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Hashtable",
-        args = {int.class, float.class}
-    )
     public void test_ConstructorIF() {
         // Test for method java.util.Hashtable(int, float)
         Hashtable h = new java.util.Hashtable(10, 0.5f);
@@ -137,14 +113,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#Hashtable(java.util.Map)
+     * java.util.Hashtable#Hashtable(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Hashtable",
-        args = {java.util.Map.class}
-    )
     public void test_ConstructorLjava_util_Map() {
         // Test for method java.util.Hashtable(java.util.Map)
         Map map = new TreeMap();
@@ -167,14 +137,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#Hashtable(java.util.Map)
+     * java.util.Hashtable#Hashtable(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Hashtable",
-        args = {java.util.Map.class}
-    )
     public void test_ConversionConstructorNullValue() {
         Map<String, Void> map = Collections.singletonMap("Dog", null);
         try {
@@ -185,14 +149,8 @@
         }
     }
     /**
-     * @tests java.util.Hashtable#clear()
+     * java.util.Hashtable#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.Hashtable.clear()
         Hashtable h = hashtableClone(htfull);
@@ -205,14 +163,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#clone()
+     * java.util.Hashtable#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.Hashtable.clone()
 
@@ -234,14 +186,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#contains(java.lang.Object)
+     * java.util.Hashtable#contains(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "contains",
-        args = {java.lang.Object.class}
-    )
     public void test_containsLjava_lang_Object() {
         // Test for method boolean
         // java.util.Hashtable.contains(java.lang.Object)
@@ -257,14 +203,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#containsKey(java.lang.Object)
+     * java.util.Hashtable#containsKey(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKeyLjava_lang_Object() {
         // Test for method boolean
         // java.util.Hashtable.containsKey(java.lang.Object)
@@ -281,14 +221,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#containsValue(java.lang.Object)
+     * java.util.Hashtable#containsValue(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     public void test_containsValueLjava_lang_Object() {
         // Test for method boolean
         // java.util.Hashtable.containsValue(java.lang.Object)
@@ -308,14 +242,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#elements()
+     * java.util.Hashtable#elements()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "elements",
-        args = {}
-    )
     public void test_elements() {
         // Test for method java.util.Enumeration java.util.Hashtable.elements()
         Enumeration elms = ht10.elements();
@@ -332,14 +260,8 @@
 // BEGIN android-removed
 // implementation dependent
 //    /**
-//     * @tests java.util.Hashtable#elements()
+//     * java.util.Hashtable#elements()
 //     */
-//    @TestTargetNew(
-//        level = TestLevel.COMPLETE,
-//        notes = "",
-//        method = "elements",
-//        args = {}
-//    )
 //    public void test_elements_subtest0() {
 //        // this is the reference implementation behavior
 //        final Hashtable ht = new Hashtable(7);
@@ -374,14 +296,8 @@
 // END android-removed
 
     /**
-     * @tests java.util.Hashtable#entrySet()
+     * java.util.Hashtable#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySet() {
         // Test for method java.util.Set java.util.Hashtable.entrySet()
         Set s = ht10.entrySet();
@@ -411,14 +327,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#equals(java.lang.Object)
+     * java.util.Hashtable#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean java.util.Hashtable.equals(java.lang.Object)
         Hashtable h = hashtableClone(ht10);
@@ -427,14 +337,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#get(java.lang.Object)
+     * java.util.Hashtable#get(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_getLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.Hashtable.get(java.lang.Object)
@@ -466,14 +370,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#hashCode()
+     * java.util.Hashtable#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         // Test for method int java.util.Hashtable.hashCode()
         Set entrySet = ht10.entrySet();
@@ -487,14 +385,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#isEmpty()
+     * java.util.Hashtable#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.Hashtable.isEmpty()
 
@@ -530,14 +422,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#keys()
+     * java.util.Hashtable#keys()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keys",
-        args = {}
-    )
     public void test_keys() {
         // Test for method java.util.Enumeration java.util.Hashtable.keys()
 
@@ -553,14 +439,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#keys()
+     * java.util.Hashtable#keys()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "keys",
-        args = {}
-    )
     public void test_keys_subtest0() {
         // this is the reference implementation behavior
         final Hashtable ht = new Hashtable(3);
@@ -579,14 +459,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#keySet()
+     * java.util.Hashtable#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         // Test for method java.util.Set java.util.Hashtable.keySet()
         Set s = ht10.keySet();
@@ -638,14 +512,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#keySet()
+     * java.util.Hashtable#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet_subtest0() {
         Set s1 = ht10.keySet();
         assertTrue("should contain key", s1.remove("Key 0"));
@@ -683,14 +551,8 @@
 // BEGIN android-removed
 // implementation dependent
 //    /**
-//     * @tests java.util.Hashtable#keySet()
+//     * java.util.Hashtable#keySet()
 //     */
-//    @TestTargetNew(
-//        level = TestLevel.PARTIAL_COMPLETE,
-//        notes = "",
-//        method = "keySet",
-//        args = {}
-//    )
 //    public void test_keySet_subtest1() {
 //        // this is the reference implementation behavior
 //        final Hashtable ht = new Hashtable(7);
@@ -733,14 +595,8 @@
 // END android-removed
 
     /**
-     * @tests java.util.Hashtable#put(java.lang.Object, java.lang.Object)
+     * java.util.Hashtable#put(java.lang.Object, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.Hashtable.put(java.lang.Object, java.lang.Object)
@@ -771,14 +627,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#putAll(java.util.Map)
+     * java.util.Hashtable#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map() {
         // Test for method void java.util.Hashtable.putAll(java.util.Map)
         Hashtable h = new Hashtable();
@@ -799,14 +649,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#remove(java.lang.Object)
+     * java.util.Hashtable#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.Hashtable.remove(java.lang.Object)
@@ -824,14 +668,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#size()
+     * java.util.Hashtable#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.Hashtable.size()
         assertTrue("Returned invalid size", ht10.size() == 10
@@ -865,14 +703,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#toString()
+     * java.util.Hashtable#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.util.Hashtable.toString()
         Hashtable h = new Hashtable();
@@ -888,14 +720,8 @@
     }
 
     /**
-     * @tests java.util.Hashtable#values()
+     * java.util.Hashtable#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         // Test for method java.util.Collection java.util.Hashtable.values()
         Collection c = ht10.values();
@@ -925,20 +751,6 @@
     /**
      * Regression Test for JIRA 2181
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "entrySet",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "remove",
-            args = {java.lang.Object.class}
-        )
-    })
     public void test_entrySet_remove()
     {
         Hashtable<String,String> hashtable = new Hashtable<String,String>();
@@ -976,12 +788,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "rehash",
-        args = {}
-    )
     public void test_rehash() {
         Mock_Hashtable mht = new Mock_Hashtable(5);
 
diff --git a/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java b/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java
index f17e55d..3bf1257 100644
--- a/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java
+++ b/luni/src/test/java/tests/api/java/util/IdentityHashMapTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.io.Serializable;
 import java.util.AbstractMap;
 import java.util.ArrayList;
@@ -38,7 +33,6 @@
 
 import org.apache.harmony.testframework.serialization.SerializationTest;
 
-@TestTargetClass(IdentityHashMap.class)
 public class IdentityHashMapTest extends junit.framework.TestCase {
     private static final String ID = "hello";
 
@@ -64,14 +58,8 @@
     Object[] objArray2;
 
     /**
-     * @tests java.util.IdentityHashMap#IdentityHashMap()
+     * java.util.IdentityHashMap#IdentityHashMap()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IdentityHashMap",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.IdentityHashMap()
         new Support_MapTest2(new IdentityHashMap()).runTest();
@@ -81,14 +69,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#IdentityHashMap(int)
+     * java.util.IdentityHashMap#IdentityHashMap(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IdentityHashMap",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.IdentityHashMap(int)
         IdentityHashMap hm2 = new IdentityHashMap(5);
@@ -107,14 +89,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#IdentityHashMap(java.util.Map)
+     * java.util.IdentityHashMap#IdentityHashMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "IdentityHashMap",
-        args = {java.util.Map.class}
-    )
     public void test_ConstructorLjava_util_Map() {
         // Test for method java.util.IdentityHashMap(java.util.Map)
         Map myMap = new TreeMap();
@@ -138,14 +114,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#clear()
+     * java.util.IdentityHashMap#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.IdentityHashMap.clear()
         hm.clear();
@@ -157,14 +127,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#clone()
+     * java.util.IdentityHashMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.IdentityHashMap.clone()
         IdentityHashMap hm2 = (IdentityHashMap) hm.clone();
@@ -198,14 +162,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#containsKey(java.lang.Object)
+     * java.util.IdentityHashMap#containsKey(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKeyLjava_lang_Object() {
         // Test for method boolean
         // java.util.IdentityHashMap.containsKey(java.lang.Object)
@@ -223,14 +181,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#containsValue(java.lang.Object)
+     * java.util.IdentityHashMap#containsValue(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     public void test_containsValueLjava_lang_Object() {
         // Test for method boolean
         // java.util.IdentityHashMap.containsValue(java.lang.Object)
@@ -241,14 +193,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#entrySet()
+     * java.util.IdentityHashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySet() {
         // Test for method java.util.Set java.util.IdentityHashMap.entrySet()
         Set s = hm.entrySet();
@@ -263,14 +209,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#get(java.lang.Object)
+     * java.util.IdentityHashMap#get(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_getLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.IdentityHashMap.get(java.lang.Object)
@@ -288,14 +228,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#isEmpty()
+     * java.util.IdentityHashMap#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.IdentityHashMap.isEmpty()
         assertTrue("Returned false for new map", new IdentityHashMap()
@@ -304,14 +238,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#keySet()
+     * java.util.IdentityHashMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         // Test for method java.util.Set java.util.IdentityHashMap.keySet()
         Set s = hm.keySet();
@@ -364,14 +292,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#put(java.lang.Object, java.lang.Object)
+     * java.util.IdentityHashMap#put(java.lang.Object, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.IdentityHashMap.put(java.lang.Object, java.lang.Object)
@@ -392,14 +314,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#putAll(java.util.Map)
+     * java.util.IdentityHashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map() {
         // Test for method void java.util.IdentityHashMap.putAll(java.util.Map)
         IdentityHashMap hm2 = new IdentityHashMap();
@@ -422,14 +338,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#remove(java.lang.Object)
+     * java.util.IdentityHashMap#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.IdentityHashMap.remove(java.lang.Object)
@@ -449,14 +359,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#size()
+     * java.util.IdentityHashMap#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.IdentityHashMap.size()
         assertEquals("Returned incorrect size, ", (objArray.length + 2), hm
@@ -464,14 +368,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#equals(java.lang.Object)
+     * java.util.IdentityHashMap#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         IdentityHashMap mapOne = new IdentityHashMap();
         IdentityHashMap mapTwo = new IdentityHashMap();
@@ -514,14 +412,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#values()
+     * java.util.IdentityHashMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         // Test for method java.util.Collection
         // java.util.IdentityHashMap.values()
@@ -544,22 +436,8 @@
     }
 
     /**
-     * @tests java.util.IdentityHashMap#Serialization()
+     * java.util.IdentityHashMap#Serialization()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization compatibility.",
-            method = "!SerializationSelf",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization compatibility.",
-            method = "!SerializationGolden",
-            args = {}
-        )
-    })
     public void test_Serialization() throws Exception {
         IdentityHashMap<String, String> map = new IdentityHashMap<String, String>();
         map.put(ID, "world");
diff --git a/luni/src/test/java/tests/api/java/util/InvalidPropertiesFormatExceptionTest.java b/luni/src/test/java/tests/api/java/util/InvalidPropertiesFormatExceptionTest.java
index cf484ed..0b144a4 100644
--- a/luni/src/test/java/tests/api/java/util/InvalidPropertiesFormatExceptionTest.java
+++ b/luni/src/test/java/tests/api/java/util/InvalidPropertiesFormatExceptionTest.java
@@ -15,29 +15,17 @@
  */
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.io.NotSerializableException;
 import java.util.InvalidPropertiesFormatException;
 
 import org.apache.harmony.testframework.serialization.SerializationTest;
 
-@TestTargetClass(InvalidPropertiesFormatException.class)
 public class InvalidPropertiesFormatExceptionTest extends
         junit.framework.TestCase {
 
     /**
-     * @tests java.util.InvalidPropertiesFormatException#SerializationTest()
+     * java.util.InvalidPropertiesFormatException#SerializationTest()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies serialization/deserialization compatibility.",
-        method = "!SerializationSelf",
-        args = {}
-    )
     public void test_Serialization() throws Exception {
         InvalidPropertiesFormatException ipfe = new InvalidPropertiesFormatException(
                 "Hey, this is InvalidPropertiesFormatException");
diff --git a/luni/src/test/java/tests/api/java/util/LinkedHashMapTest.java b/luni/src/test/java/tests/api/java/util/LinkedHashMapTest.java
index d5223fe..eff9493 100644
--- a/luni/src/test/java/tests/api/java/util/LinkedHashMapTest.java
+++ b/luni/src/test/java/tests/api/java/util/LinkedHashMapTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractMap;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -36,9 +31,8 @@
 import tests.support.Support_UnmodifiableCollectionTest;
 
 /**
- * @tests java.util.LinkedHashMap
+ * java.util.LinkedHashMap
  */
-@TestTargetClass(LinkedHashMap.class)
 public class LinkedHashMapTest extends junit.framework.TestCase {
 
     LinkedHashMap hm;
@@ -68,14 +62,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap()
+     * java.util.LinkedHashMap#LinkedHashMap()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashMap",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.LinkedHashMap()
         new Support_MapTest2(new LinkedHashMap()).runTest();
@@ -85,14 +73,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap(int)
+     * java.util.LinkedHashMap#LinkedHashMap(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Need to improve code.",
-        method = "LinkedHashMap",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.LinkedHashMap(int)
         LinkedHashMap hm2 = new LinkedHashMap(5);
@@ -112,14 +94,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap(int, float)
+     * java.util.LinkedHashMap#LinkedHashMap(int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Need to improve code.",
-        method = "LinkedHashMap",
-        args = {int.class, float.class}
-    )
     public void test_ConstructorIF() {
         // Test for method java.util.LinkedHashMap(int, float)
         LinkedHashMap hm2 = new LinkedHashMap(5, (float) 0.5);
@@ -139,14 +115,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#LinkedHashMap(java.util.Map)
+     * java.util.LinkedHashMap#LinkedHashMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify IllegalArgumentException.",
-        method = "LinkedHashMap",
-        args = {java.util.Map.class}
-    )
     public void test_ConstructorLjava_util_Map() {
         // Test for method java.util.LinkedHashMap(java.util.Map)
         Map myMap = new TreeMap();
@@ -159,14 +129,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#get(java.lang.Object)
+     * java.util.LinkedHashMap#get(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException, NullPointerException.",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_getLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.LinkedHashMap.get(java.lang.Object)
@@ -184,14 +148,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#put(java.lang.Object, java.lang.Object)
+     * java.util.LinkedHashMap#put(java.lang.Object, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify that put returns null if there was no mapping for key, or associated null with the specified key.",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.LinkedHashMap.put(java.lang.Object, java.lang.Object)
@@ -210,12 +168,6 @@
     }
 
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "test that put on an already present key causes entry to move to tail.",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putPresent() {
         Map<String, String> m = new LinkedHashMap<String, String>(8, .75f, true);
         m.put("KEY", "VALUE");
@@ -230,14 +182,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#putAll(java.util.Map)
+     * java.util.LinkedHashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map() {
         // Test for method void java.util.LinkedHashMap.putAll(java.util.Map)
         LinkedHashMap hm2 = new LinkedHashMap();
@@ -248,14 +194,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#putAll(java.util.Map)
+     * java.util.LinkedHashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAll_Ljava_util_Map_Null() {
         LinkedHashMap linkedHashMap = new LinkedHashMap();
         try {
@@ -274,14 +214,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#entrySet()
+     * java.util.LinkedHashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySet() {
         // Test for method java.util.Set java.util.LinkedHashMap.entrySet()
         Set s = hm.entrySet();
@@ -295,12 +229,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Test that remove removes the entry from the linked list",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySetRemove() {
         entrySetRemoveHelper("military", "intelligence");
         entrySetRemoveHelper(null, "hypothesis");
@@ -316,14 +244,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#keySet()
+     * java.util.LinkedHashMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_keySet() {
         // Test for method java.util.Set java.util.LinkedHashMap.keySet()
         Set s = hm.keySet();
@@ -375,14 +297,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#values()
+     * java.util.LinkedHashMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_values() {
         // Test for method java.util.Collection java.util.LinkedHashMap.values()
         Collection c = hm.values();
@@ -407,14 +323,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#remove(java.lang.Object)
+     * java.util.LinkedHashMap#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.LinkedHashMap.remove(java.lang.Object)
@@ -435,14 +345,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#clear()
+     * java.util.LinkedHashMap#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.LinkedHashMap.clear()
         hm.clear();
@@ -454,14 +358,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#clone()
+     * java.util.LinkedHashMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.LinkedHashMap.clone()
         LinkedHashMap hm2 = (LinkedHashMap) hm.clone();
@@ -496,14 +394,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#clone()
+     * java.util.LinkedHashMap#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone_ordered() {
         // Test for method java.lang.Object java.util.LinkedHashMap.clone()
         LinkedHashMap<String, String> hm1 = new LinkedHashMap<String, String>(10, 0.75f, true);
@@ -526,12 +418,6 @@
         assertEquals("c", iterator.next().getKey());
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test.",
-        method = "clone",
-        args = {}
-    )
     // regresion test for HARMONY-4603
     public void test_clone_Mock() {
         LinkedHashMap hashMap = new MockMap();
@@ -560,15 +446,9 @@
     }
 
     /**
-     * @tests put/get interaction in access-order map where removeEldest
+     * put/get interaction in access-order map where removeEldest
      * returns true.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression for bug Google Bug 2121546",
-        method = "get",
-        args = {java.lang.Object.class}
-    )
     public void test_removeEldestFromSameBucketAsNewEntry() {
         LinkedHashMap<String, String> map
                 = new LinkedHashMap<String, String>(6, 0.75F, true) {
@@ -583,14 +463,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#containsKey(java.lang.Object)
+     * java.util.LinkedHashMap#containsKey(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException, NullPointerException.",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKeyLjava_lang_Object() {
         // Test for method boolean
         // java.util.LinkedHashMap.containsKey(java.lang.Object)
@@ -606,14 +480,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#containsValue(java.lang.Object)
+     * java.util.LinkedHashMap#containsValue(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException, NullPointerException.",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     public void test_containsValueLjava_lang_Object() {
         // Test for method boolean
         // java.util.LinkedHashMap.containsValue(java.lang.Object)
@@ -624,14 +492,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#isEmpty()
+     * java.util.LinkedHashMap#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.LinkedHashMap.isEmpty()
         assertTrue("Returned false for new map", new LinkedHashMap().isEmpty());
@@ -639,14 +501,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#size()
+     * java.util.LinkedHashMap#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.LinkedHashMap.size()
         assertTrue("Returned incorrect size",
@@ -654,14 +510,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#entrySet()
+     * java.util.LinkedHashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_ordered_entrySet() {
         int i;
         int sz = 100;
@@ -722,14 +572,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#keySet()
+     * java.util.LinkedHashMap#keySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "keySet",
-        args = {}
-    )
     public void test_ordered_keySet() {
         int i;
         int sz = 100;
@@ -784,14 +628,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#values()
+     * java.util.LinkedHashMap#values()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_ordered_values() {
         int i;
         int sz = 100;
@@ -846,14 +684,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashMap#removeEldestEntry(java.util.Map$Entry)
+     * java.util.LinkedHashMap#removeEldestEntry(java.util.Map$Entry)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeEldestEntry",
-        args = {java.util.Map.Entry.class}
-    )
     public void test_remove_eldest() {
         int i;
         int sz = 10;
diff --git a/luni/src/test/java/tests/api/java/util/LinkedHashSetTest.java b/luni/src/test/java/tests/api/java/util/LinkedHashSetTest.java
index 3826ca5..f54d01d 100644
--- a/luni/src/test/java/tests/api/java/util/LinkedHashSetTest.java
+++ b/luni/src/test/java/tests/api/java/util/LinkedHashSetTest.java
@@ -16,11 +16,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Iterator;
@@ -29,10 +24,9 @@
 import java.util.Vector;
 
 /**
- * @tests java.util.LinkedHashSet
+ * java.util.LinkedHashSet
  */
 
-@TestTargetClass(java.util.LinkedHashSet.class)
 public class LinkedHashSetTest extends junit.framework.TestCase {
 
     LinkedHashSet hs;
@@ -40,14 +34,8 @@
     Object[] objArray;
 
     /**
-     * @tests java.util.LinkedHashSet#LinkedHashSet()
+     * java.util.LinkedHashSet#LinkedHashSet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashSet",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.LinkedHashSet()
         LinkedHashSet hs2 = new LinkedHashSet();
@@ -55,14 +43,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#LinkedHashSet(int)
+     * java.util.LinkedHashSet#LinkedHashSet(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashSet",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.LinkedHashSet(int)
         LinkedHashSet hs2 = new LinkedHashSet(5);
@@ -76,14 +58,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#LinkedHashSet(int, float)
+     * java.util.LinkedHashSet#LinkedHashSet(int, float)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashSet",
-        args = {int.class, float.class}
-    )
     public void test_ConstructorIF() {
         // Test for method java.util.LinkedHashSet(int, float)
         LinkedHashSet hs2 = new LinkedHashSet(5, (float) 0.5);
@@ -112,14 +88,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#LinkedHashSet(java.util.Collection)
+     * java.util.LinkedHashSet#LinkedHashSet(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedHashSet",
-        args = {java.util.Collection.class}
-    )
     public void test_ConstructorLjava_util_Collection() {
         // Test for method java.util.LinkedHashSet(java.util.Collection)
         LinkedHashSet hs2 = new LinkedHashSet(Arrays.asList(objArray));
@@ -138,14 +108,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#add(java.lang.Object)
+     * java.util.LinkedHashSet#add(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLjava_lang_Object() {
         // Test for method boolean java.util.LinkedHashSet.add(java.lang.Object)
         int size = hs.size();
@@ -158,14 +122,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#clear()
+     * java.util.LinkedHashSet#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.LinkedHashSet.clear()
         Set orgSet = (Set) hs.clone();
@@ -177,14 +135,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#clone()
+     * java.util.LinkedHashSet#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.LinkedHashSet.clone()
         LinkedHashSet hs2 = (LinkedHashSet) hs.clone();
@@ -194,14 +146,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#contains(java.lang.Object)
+     * java.util.LinkedHashSet#contains(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "contains",
-        args = {java.lang.Object.class}
-    )
     public void test_containsLjava_lang_Object() {
         // Test for method boolean
         // java.util.LinkedHashSet.contains(java.lang.Object)
@@ -215,14 +161,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#isEmpty()
+     * java.util.LinkedHashSet#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.LinkedHashSet.isEmpty()
         assertTrue("Empty set returned false", new LinkedHashSet().isEmpty());
@@ -230,14 +170,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#iterator()
+     * java.util.LinkedHashSet#iterator()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "iterator",
-        args = {}
-    )
     public void test_iterator() {
         // Test for method java.util.Iterator java.util.LinkedHashSet.iterator()
         Iterator i = hs.iterator();
@@ -261,14 +195,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#remove(java.lang.Object)
+     * java.util.LinkedHashSet#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ClassCastException, NullPointerException, UnsupportedOperationException.",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method boolean
         // java.util.LinkedHashSet.remove(java.lang.Object)
@@ -283,14 +211,8 @@
     }
 
     /**
-     * @tests java.util.LinkedHashSet#size()
+     * java.util.LinkedHashSet#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.LinkedHashSet.size()
         assertTrue("Returned incorrect size", hs.size() == (objArray.length + 1));
@@ -305,12 +227,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "retainAll",
-        args = {java.util.Collection.class}
-    )
     public void test_retainAllLjava_util_Collection() {
         LinkedHashSet<Integer> lhs = new LinkedHashSet<Integer>();
         Vector v = new Vector<Float>();
@@ -356,12 +272,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {}
-    )
     public void test_toArray() {
         LinkedHashSet<Integer> lhs = new LinkedHashSet<Integer>();
         lhs.add(new Integer(1));
@@ -381,12 +291,6 @@
         assertEquals(lhs.size(), o.length);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {java.lang.Object[].class}
-    )
     public void test_toArray$Ljava_lang_Object() {
         LinkedHashSet<Integer> lhs = new LinkedHashSet<Integer>();
         lhs.add(new Integer(1));
diff --git a/luni/src/test/java/tests/api/java/util/LinkedListTest.java b/luni/src/test/java/tests/api/java/util/LinkedListTest.java
index ad3c212..c0cec45 100644
--- a/luni/src/test/java/tests/api/java/util/LinkedListTest.java
+++ b/luni/src/test/java/tests/api/java/util/LinkedListTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -34,7 +29,6 @@
 
 import tests.support.Support_ListTest;
 
-@TestTargetClass(LinkedList.class)
 public class LinkedListTest extends junit.framework.TestCase {
 
     LinkedList ll;
@@ -42,14 +36,8 @@
     Object[] objArray;
 
     /**
-     * @tests java.util.LinkedList#LinkedList()
+     * java.util.LinkedList#LinkedList()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedList",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.LinkedList()
         new Support_ListTest("", ll).runTest();
@@ -61,14 +49,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#LinkedList(java.util.Collection)
+     * java.util.LinkedList#LinkedList(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LinkedList",
-        args = {java.util.Collection.class}
-    )
     public void test_ConstructorLjava_util_Collection() {
         // Test for method java.util.LinkedList(java.util.Collection)
         assertTrue("Incorrect LinkedList constructed", new LinkedList(ll)
@@ -83,14 +65,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#add(int, java.lang.Object)
+     * java.util.LinkedList#add(int, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_addILjava_lang_Object() {
         // Test for method void java.util.LinkedList.add(int, java.lang.Object)
         Object o;
@@ -104,14 +80,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#add(java.lang.Object)
+     * java.util.LinkedList#add(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLjava_lang_Object() {
         // Test for method boolean java.util.LinkedList.add(java.lang.Object)
         Object o;
@@ -122,14 +92,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#addAll(int, java.util.Collection)
+     * java.util.LinkedList#addAll(int, java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAllILjava_util_Collection() {
         // Test for method boolean java.util.LinkedList.addAll(int,
         // java.util.Collection)
@@ -182,14 +146,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#addAll(int, java.util.Collection)
+     * java.util.LinkedList#addAll(int, java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException.",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAllILjava_util_Collection_2() {
         // Regression for HARMONY-467
         LinkedList obj = new LinkedList();
@@ -201,14 +159,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#addAll(java.util.Collection)
+     * java.util.LinkedList#addAll(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLjava_util_Collection() {
         // Test for method boolean
         // java.util.LinkedList.addAll(java.util.Collection)
@@ -250,14 +202,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#addFirst(java.lang.Object)
+     * java.util.LinkedList#addFirst(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addFirst",
-        args = {java.lang.Object.class}
-    )
     public void test_addFirstLjava_lang_Object() {
         // Test for method void java.util.LinkedList.addFirst(java.lang.Object)
         Object o;
@@ -268,14 +214,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#addLast(java.lang.Object)
+     * java.util.LinkedList#addLast(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addLast",
-        args = {java.lang.Object.class}
-    )
     public void test_addLastLjava_lang_Object() {
         // Test for method void java.util.LinkedList.addLast(java.lang.Object)
         Object o;
@@ -286,14 +226,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#clear()
+     * java.util.LinkedList#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.LinkedList.clear()
         ll.clear();
@@ -302,14 +236,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#clone()
+     * java.util.LinkedList#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.LinkedList.clone()
         Object x = ll.clone();
@@ -323,14 +251,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#contains(java.lang.Object)
+     * java.util.LinkedList#contains(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "contains",
-        args = {java.lang.Object.class}
-    )
     public void test_containsLjava_lang_Object() {
         // Test for method boolean
         // java.util.LinkedList.contains(java.lang.Object)
@@ -346,14 +268,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#get(int)
+     * java.util.LinkedList#get(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {int.class}
-    )
     public void test_getI() {
         // Test for method java.lang.Object java.util.LinkedList.get(int)
         assertTrue("Returned incorrect element", ll.get(22) == objArray[22]);
@@ -365,14 +281,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#getFirst()
+     * java.util.LinkedList#getFirst()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFirst",
-        args = {}
-    )
     public void test_getFirst() {
         // Test for method java.lang.Object java.util.LinkedList.getFirst()
         assertTrue("Returned incorrect first element", ll.getFirst().equals(
@@ -388,14 +298,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#getLast()
+     * java.util.LinkedList#getLast()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLast",
-        args = {}
-    )
     public void test_getLast() {
         // Test for method java.lang.Object java.util.LinkedList.getLast()
         assertTrue("Returned incorrect first element", ll.getLast().equals(
@@ -411,14 +315,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#indexOf(java.lang.Object)
+     * java.util.LinkedList#indexOf(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "indexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_indexOfLjava_lang_Object() {
         // Test for method int java.util.LinkedList.indexOf(java.lang.Object)
         assertEquals("Returned incorrect index", 87, ll.indexOf(objArray[87]));
@@ -431,14 +329,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#lastIndexOf(java.lang.Object)
+     * java.util.LinkedList#lastIndexOf(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastIndexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_lastIndexOfLjava_lang_Object() {
         // Test for method int
         // java.util.LinkedList.lastIndexOf(java.lang.Object)
@@ -454,14 +346,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#listIterator(int)
+     * java.util.LinkedList#listIterator(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "listIterator",
-        args = {int.class}
-    )
     public void test_listIteratorI() {
         // Test for method java.util.ListIterator
         // java.util.LinkedList.listIterator(int)
@@ -531,14 +417,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#remove(int)
+     * java.util.LinkedList#remove(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {int.class}
-    )
     public void test_removeI() {
         // Test for method java.lang.Object java.util.LinkedList.remove(int)
         ll.remove(10);
@@ -556,14 +436,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#remove(java.lang.Object)
+     * java.util.LinkedList#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method boolean java.util.LinkedList.remove(java.lang.Object)
         assertTrue("Failed to remove valid Object", ll.remove(objArray[87]));
@@ -575,14 +449,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#removeFirst()
+     * java.util.LinkedList#removeFirst()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeFirst",
-        args = {}
-    )
     public void test_removeFirst() {
         // Test for method java.lang.Object java.util.LinkedList.removeFirst()
         ll.removeFirst();
@@ -599,14 +467,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#removeLast()
+     * java.util.LinkedList#removeLast()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeLast",
-        args = {}
-    )
     public void test_removeLast() {
         // Test for method java.lang.Object java.util.LinkedList.removeLast()
         ll.removeLast();
@@ -623,14 +485,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#set(int, java.lang.Object)
+     * java.util.LinkedList#set(int, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_setILjava_lang_Object() {
         // Test for method java.lang.Object java.util.LinkedList.set(int,
         // java.lang.Object)
@@ -654,14 +510,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#size()
+     * java.util.LinkedList#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.LinkedList.size()
         assertTrue("Returned incorrect size", ll.size() == objArray.length);
@@ -670,14 +520,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#toArray()
+     * java.util.LinkedList#toArray()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {}
-    )
     public void test_toArray() {
         // Test for method java.lang.Object [] java.util.LinkedList.toArray()
         ll.add(null);
@@ -691,14 +535,8 @@
     }
 
     /**
-     * @tests java.util.LinkedList#toArray(java.lang.Object[])
+     * java.util.LinkedList#toArray(java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {java.lang.Object[].class}
-    )
     public void test_toArray$Ljava_lang_Object() {
         // Test for method java.lang.Object []
         // java.util.LinkedList.toArray(java.lang.Object [])
@@ -748,23 +586,11 @@
             //expected
         }
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "offer",
-        args = {java.lang.Object.class}
-    )
     public void test_offer() {
         int origSize = ll.size();
         assertTrue("offer() should return true'", ll.offer(objArray[0]));
         assertEquals("offer() should add an element as the last one", origSize, ll.lastIndexOf(objArray[0]));
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "poll",
-        args = {}
-    )
     public void test_poll() {
         for (int i = 0; i < objArray.length; i++) {
             assertEquals("should remove the head", objArray[i], ll.poll());
@@ -772,12 +598,6 @@
         assertEquals("should be empty", 0, ll.size());
         assertNull("should return 'null' if list is empty", ll.poll());
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {}
-    )
     public void test_remove() {
         for (int i = 0; i < objArray.length; i++) {
             assertEquals("should remove the head", objArray[i], ll.remove());
@@ -790,12 +610,6 @@
             //-- expected
         }
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "element",
-        args = {}
-    )
     public void test_element() {
         assertEquals("should return the head", objArray[0], ll.element());
         assertEquals("element() should remove nothing", objArray.length, ll.size());
@@ -807,12 +621,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "peek",
-        args = {}
-    )
     public void test_peek() {
         assertEquals("should remove the head", objArray[0], ll.peek());
         assertEquals("should remove the head", objArray[0], ll.peek());
diff --git a/luni/src/test/java/tests/api/java/util/ListResourceBundleTest.java b/luni/src/test/java/tests/api/java/util/ListResourceBundleTest.java
index 396b097..8be04db 100644
--- a/luni/src/test/java/tests/api/java/util/ListResourceBundleTest.java
+++ b/luni/src/test/java/tests/api/java/util/ListResourceBundleTest.java
@@ -17,43 +17,17 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Enumeration;
 import java.util.ListResourceBundle;
 import java.util.Locale;
 import java.util.ResourceBundle;
 import java.util.Vector;
 
-@TestTargetClass(java.util.ListResourceBundle.class)
 public class ListResourceBundleTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.ListResourceBundle#getKeys()
+     * java.util.ListResourceBundle#getKeys()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getKeys",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "ListResourceBundle",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getContents",
-            args = {}
-        )
-    })
     public void test_getKeys() {
         ResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
@@ -74,26 +48,6 @@
     }
 
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "handleGetObject",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "ListResourceBundle",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getContents",
-            args = {}
-        )
-    })
     public void test_handleGetObjectLjava_lang_String() {
         ListResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
diff --git a/luni/src/test/java/tests/api/java/util/LocaleTest.java b/luni/src/test/java/tests/api/java/util/LocaleTest.java
index 384ecf8..e5255e4 100644
--- a/luni/src/test/java/tests/api/java/util/LocaleTest.java
+++ b/luni/src/test/java/tests/api/java/util/LocaleTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
 import dalvik.annotation.AndroidOnly;
 import tests.support.Support_Locale;
 
@@ -32,7 +28,6 @@
 import java.util.MissingResourceException;
 import java.util.Set;
 
-@TestTargetClass(Locale.class)
 public class LocaleTest extends junit.framework.TestCase {
 
     Locale testLocale;
@@ -42,14 +37,8 @@
     Locale defaultLocale;
 
     /**
-     * @tests java.util.Locale#Locale(java.lang.String, java.lang.String)
+     * java.util.Locale#Locale(java.lang.String, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Locale",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.util.Locale(java.lang.String)
         Locale x = new Locale("xx");
@@ -64,14 +53,8 @@
     }
 
     /**
-     * @tests java.util.Locale#Locale(java.lang.String, java.lang.String)
+     * java.util.Locale#Locale(java.lang.String, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Locale",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         // Test for method java.util.Locale(java.lang.String, java.lang.String)
         Locale x = new Locale("xx", "CV");
@@ -94,15 +77,9 @@
     }
 
     /**
-     * @tests java.util.Locale#Locale(java.lang.String, java.lang.String,
+     * java.util.Locale#Locale(java.lang.String, java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Locale",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_String() {
         // Test for method java.util.Locale(java.lang.String, java.lang.String,
         // java.lang.String)
@@ -129,28 +106,16 @@
     }
 
     /**
-     * @tests java.util.Locale#clone()
+     * java.util.Locale#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.Locale.clone()
         assertTrue("Clone failed", l.clone().equals(l));
     }
 
     /**
-     * @tests java.util.Locale#equals(java.lang.Object)
+     * java.util.Locale#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean java.util.Locale.equals(java.lang.Object)
         Locale l2 = new Locale("en", "CA", "WIN32");
@@ -161,14 +126,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getAvailableLocales()
+     * java.util.Locale#getAvailableLocales()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAvailableLocales",
-        args = {}
-    )
     public void test_getAvailableLocales() {
 // BEGIN android-changed
         // Test for method java.util.Locale []
@@ -189,14 +148,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getCountry()
+     * java.util.Locale#getCountry()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCountry",
-        args = {}
-    )
     public void test_getCountry() {
         // Test for method java.lang.String java.util.Locale.getCountry()
         assertTrue("Returned incorrect country: " + testLocale.getCountry(),
@@ -204,14 +157,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getDefault()
+     * java.util.Locale#getDefault()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefault",
-        args = {}
-    )
     public void test_getDefault() {
         // Test for method java.util.Locale java.util.Locale.getDefault()
         assertTrue("returns copy", Locale.getDefault() == Locale.getDefault());
@@ -223,14 +170,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getDisplayCountry()
+     * java.util.Locale#getDisplayCountry()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayCountry",
-        args = {}
-    )
     @AndroidOnly("ICU has different display name for countries")
     public void test_getDisplayCountry() {
         // Test for method java.lang.String java.util.Locale.getDisplayCountry()
@@ -249,36 +190,15 @@
 // END android-changed
     }
 
-    /**
-     * @tests java.util.Locale#getDisplayCountry(java.util.Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayCountry",
-        args = {java.util.Locale.class}
-    )
     public void test_getDisplayCountryLjava_util_Locale() {
-        Locale[] requiredLocales = {Locale.ITALY};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
+        if (Support_Locale.isLocaleAvailable(Locale.ITALY)) {
+            assertEquals("Returned incorrect country", "Italie", Locale.ITALY.getDisplayCountry(l));
         }
-        // Test for method java.lang.String
-        // java.util.Locale.getDisplayCountry(java.util.Locale)
-        assertEquals("Returned incorrect country", "Italie", Locale.ITALY
-                .getDisplayCountry(l));
     }
 
     /**
-     * @tests java.util.Locale#getDisplayLanguage()
+     * java.util.Locale#getDisplayLanguage()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayLanguage",
-        args = {}
-    )
     public void test_getDisplayLanguage() {
         // Test for method java.lang.String
         // java.util.Locale.getDisplayLanguage()
@@ -291,73 +211,25 @@
         assertEquals("Avestan", l_languageAE.getDisplayLanguage());
     }
 
-    /**
-     * @tests java.util.Locale#getDisplayLanguage(java.util.Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayLanguage",
-        args = {java.util.Locale.class}
-    )
     public void test_getDisplayLanguageLjava_util_Locale() {
-        Locale[] requiredLocales = {testLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
+        if (Support_Locale.isLocaleAvailable(testLocale)) {
+            assertEquals("anglais", testLocale.getDisplayLanguage(l));
         }
-        // Test for method java.lang.String
-        // java.util.Locale.getDisplayLanguage(java.util.Locale)
-        assertTrue("Returned incorrect language: "
-                + testLocale.getDisplayLanguage(l), testLocale
-                .getDisplayLanguage(l).equals("anglais"));
     }
 
-    /**
-     * @tests java.util.Locale#getDisplayName()
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayName",
-        args = {}
-    )
     public void test_getDisplayName() {
-        // Test for method java.lang.String java.util.Locale.getDisplayName()
-        assertTrue("Returned incorrect name: " + testLocale.getDisplayName(),
-                testLocale.getDisplayName().equals("English (Canada,WIN32)"));
+        assertEquals("English (Canada,WIN32)", testLocale.getDisplayName());
     }
 
-    /**
-     * @tests java.util.Locale#getDisplayName(java.util.Locale)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayName",
-        args = {java.util.Locale.class}
-    )
     public void test_getDisplayNameLjava_util_Locale() {
-        Locale[] requiredLocales = {testLocale};
-        if (!Support_Locale.areLocalesAvailable(requiredLocales)) {
-            // locale dependent test, bug 1943269
-            return;
+        if (Support_Locale.isLocaleAvailable(testLocale)) {
+            assertEquals("anglais (Canada,WIN32)", testLocale.getDisplayName(l));
         }
-        // Test for method java.lang.String
-        // java.util.Locale.getDisplayName(java.util.Locale)
-        assertTrue("Returned incorrect name: " + testLocale.getDisplayName(l),
-                testLocale.getDisplayName(l).equals("anglais (Canada,WIN32)"));
     }
 
     /**
-     * @tests java.util.Locale#getDisplayVariant()
+     * java.util.Locale#getDisplayVariant()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayVariant",
-        args = {}
-    )
     public void test_getDisplayVariant() {
         // Test for method java.lang.String java.util.Locale.getDisplayVariant()
         assertTrue("Returned incorrect variant: "
@@ -366,14 +238,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getDisplayVariant(java.util.Locale)
+     * java.util.Locale#getDisplayVariant(java.util.Locale)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDisplayVariant",
-        args = {java.util.Locale.class}
-    )
     public void test_getDisplayVariantLjava_util_Locale() {
         // Test for method java.lang.String
         // java.util.Locale.getDisplayVariant(java.util.Locale)
@@ -383,14 +249,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getISO3Country()
+     * java.util.Locale#getISO3Country()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getISO3Country",
-        args = {}
-    )
     public void test_getISO3Country() {
         // Test for method java.lang.String java.util.Locale.getISO3Country()
         assertTrue("Returned incorrect ISO3 country: "
@@ -409,14 +269,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getISO3Language()
+     * java.util.Locale#getISO3Language()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getISO3Language",
-        args = {}
-    )
     public void test_getISO3Language() {
         // Test for method java.lang.String java.util.Locale.getISO3Language()
         assertTrue("Returned incorrect ISO3 language: "
@@ -443,14 +297,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getISOCountries()
+     * java.util.Locale#getISOCountries()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getISOCountries",
-        args = {}
-    )
     public void test_getISOCountries() {
         // Test for method java.lang.String []
         // java.util.Locale.getISOCountries()
@@ -472,14 +320,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getISOLanguages()
+     * java.util.Locale#getISOLanguages()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getISOLanguages",
-        args = {}
-    )
     public void test_getISOLanguages() {
         // Test for method java.lang.String []
         // java.util.Locale.getISOLanguages()
@@ -500,14 +342,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getLanguage()
+     * java.util.Locale#getLanguage()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLanguage",
-        args = {}
-    )
     public void test_getLanguage() {
         // Test for method java.lang.String java.util.Locale.getLanguage()
         assertTrue("Returned incorrect language: " + testLocale.getLanguage(),
@@ -515,14 +351,8 @@
     }
 
     /**
-     * @tests java.util.Locale#getVariant()
+     * java.util.Locale#getVariant()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getVariant",
-        args = {}
-    )
     public void test_getVariant() {
         // Test for method java.lang.String java.util.Locale.getVariant()
         assertTrue("Returned incorrect variant: " + testLocale.getVariant(),
@@ -539,14 +369,8 @@
         }
     };
     /**
-     * @tests java.util.Locale#setDefault(java.util.Locale)
+     * java.util.Locale#setDefault(java.util.Locale)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDefault",
-        args = {java.util.Locale.class}
-    )
     public void test_setDefaultLjava_util_Locale() {
         // Test for method void java.util.Locale.setDefault(java.util.Locale)
 
@@ -572,14 +396,8 @@
     }
 
     /**
-     * @tests java.util.Locale#toString()
+     * java.util.Locale#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.util.Locale.toString()
         assertEquals("Returned incorrect string representation", "en_CA_WIN32", testLocale
@@ -603,12 +421,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         Locale l1 = new Locale("en", "US");
         Locale l2 = new Locale("fr", "CA");
diff --git a/luni/src/test/java/tests/api/java/util/MissingResourceExceptionTest.java b/luni/src/test/java/tests/api/java/util/MissingResourceExceptionTest.java
index 2e132fc..fc7189e 100644
--- a/luni/src/test/java/tests/api/java/util/MissingResourceExceptionTest.java
+++ b/luni/src/test/java/tests/api/java/util/MissingResourceExceptionTest.java
@@ -17,28 +17,16 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Locale;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
-@TestTargetClass(MissingResourceException.class)
 public class MissingResourceExceptionTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.MissingResourceException#MissingResourceException(java.lang.String,
+     * java.util.MissingResourceException#MissingResourceException(java.lang.String,
      *        java.lang.String, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "MissingResourceException",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_StringLjava_lang_String() {
         // Test for method java.util.MissingResourceException(java.lang.String,
         // java.lang.String, java.lang.String)
@@ -55,14 +43,8 @@
     }
 
     /**
-     * @tests java.util.MissingResourceException#getClassName()
+     * java.util.MissingResourceException#getClassName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getClassName",
-        args = {}
-    )
     public void test_getClassName() {
         // Test for method java.lang.String
         // java.util.MissingResourceException.getClassName()
@@ -75,14 +57,8 @@
     }
 
     /**
-     * @tests java.util.MissingResourceException#getKey()
+     * java.util.MissingResourceException#getKey()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKey",
-        args = {}
-    )
     public void test_getKey() {
         // Test for method java.lang.String
         // java.util.MissingResourceException.getKey()
diff --git a/luni/src/test/java/tests/api/java/util/NoSuchElementExceptionTest.java b/luni/src/test/java/tests/api/java/util/NoSuchElementExceptionTest.java
index ba2b4d2..cfda941 100644
--- a/luni/src/test/java/tests/api/java/util/NoSuchElementExceptionTest.java
+++ b/luni/src/test/java/tests/api/java/util/NoSuchElementExceptionTest.java
@@ -17,26 +17,14 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.NoSuchElementException;
 import java.util.Vector;
 
-@TestTargetClass(NoSuchElementException.class)
 public class NoSuchElementExceptionTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.NoSuchElementException#NoSuchElementException()
+     * java.util.NoSuchElementException#NoSuchElementException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NoSuchElementException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.NoSuchElementException()
 
@@ -52,14 +40,8 @@
     }
 
     /**
-     * @tests java.util.NoSuchElementException#NoSuchElementException(java.lang.String)
+     * java.util.NoSuchElementException#NoSuchElementException(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NoSuchElementException",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.util.NoSuchElementException(java.lang.String)
 
diff --git a/luni/src/test/java/tests/api/java/util/ObservableTest.java b/luni/src/test/java/tests/api/java/util/ObservableTest.java
index a4dd43e..3a0d31c 100644
--- a/luni/src/test/java/tests/api/java/util/ObservableTest.java
+++ b/luni/src/test/java/tests/api/java/util/ObservableTest.java
@@ -17,16 +17,10 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Observable;
 import java.util.Observer;
 import java.util.Vector;
 
-@TestTargetClass(Observable.class)
 public class ObservableTest extends junit.framework.TestCase {
 
     static class TestObserver implements Observer {
@@ -83,14 +77,8 @@
     TestObservable observable;
 
     /**
-     * @tests java.util.Observable#Observable()
+     * java.util.Observable#Observable()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Observable",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.Observable()
         try {
@@ -103,14 +91,8 @@
     }
 
     /**
-     * @tests java.util.Observable#addObserver(java.util.Observer)
+     * java.util.Observable#addObserver(java.util.Observer)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addObserver",
-        args = {java.util.Observer.class}
-    )
     public void test_addObserverLjava_util_Observer() {
         // Test for method void
         // java.util.Observable.addObserver(java.util.Observer)
@@ -133,14 +115,8 @@
     }
 
     /**
-     * @tests java.util.Observable#countObservers()
+     * java.util.Observable#countObservers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "countObservers",
-        args = {}
-    )
     public void test_countObservers() {
         // Test for method int java.util.Observable.countObservers()
         assertEquals("New observable had > 0 observers", 0, observable
@@ -151,14 +127,8 @@
     }
 
     /**
-     * @tests java.util.Observable#deleteObserver(java.util.Observer)
+     * java.util.Observable#deleteObserver(java.util.Observer)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "deleteObserver",
-        args = {java.util.Observer.class}
-    )
     public void test_deleteObserverLjava_util_Observer() {
         // Test for method void
         // java.util.Observable.deleteObserver(java.util.Observer)
@@ -171,14 +141,8 @@
     }
 
     /**
-     * @tests java.util.Observable#deleteObservers()
+     * java.util.Observable#deleteObservers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "deleteObservers",
-        args = {}
-    )
     public void test_deleteObservers() {
         // Test for method void java.util.Observable.deleteObservers()
         observable.addObserver(new TestObserver());
@@ -195,22 +159,8 @@
     }
 
     /**
-     * @tests java.util.Observable#hasChanged()
+     * java.util.Observable#hasChanged()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "hasChanged",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setChanged",
-            args = {}
-        )
-    })
     public void test_hasChanged() {
         assertFalse(observable.hasChanged());
         observable.addObserver(observer = new TestObserver());
@@ -218,20 +168,6 @@
         assertTrue(observable.hasChanged());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setChanged",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "clearChanged",
-            args = {}
-        )
-    })
     public void test_clearChanged() {
         assertFalse(observable.hasChanged());
         observable.addObserver(observer = new TestObserver());
@@ -242,14 +178,8 @@
     }
 
     /**
-     * @tests java.util.Observable#notifyObservers()
+     * java.util.Observable#notifyObservers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "notifyObservers",
-        args = {}
-    )
     public void test_notifyObservers() {
         // Test for method void java.util.Observable.notifyObservers()
         observable.addObserver(observer = new TestObserver());
@@ -281,14 +211,8 @@
     }
 
     /**
-     * @tests java.util.Observable#notifyObservers(java.lang.Object)
+     * java.util.Observable#notifyObservers(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "notifyObservers",
-        args = {java.lang.Object.class}
-    )
     public void test_notifyObserversLjava_lang_Object() {
         // Test for method void
         // java.util.Observable.notifyObservers(java.lang.Object)
diff --git a/luni/src/test/java/tests/api/java/util/PropertyPermissionTest.java b/luni/src/test/java/tests/api/java/util/PropertyPermissionTest.java
index aa9426e..64b8529 100644
--- a/luni/src/test/java/tests/api/java/util/PropertyPermissionTest.java
+++ b/luni/src/test/java/tests/api/java/util/PropertyPermissionTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.io.Serializable;
 import java.util.Enumeration;
 import java.util.PropertyPermission;
@@ -29,7 +24,6 @@
 import org.apache.harmony.testframework.serialization.SerializationTest;
 import org.apache.harmony.testframework.serialization.SerializationTest.SerializableAssert;
 
-@TestTargetClass(PropertyPermission.class)
 public class PropertyPermissionTest extends junit.framework.TestCase {
 
     static PropertyPermission javaPP = new PropertyPermission("java.*", "read");
@@ -38,15 +32,9 @@
             "read,write");
 
     /**
-     * @tests java.util.PropertyPermission#PropertyPermission(java.lang.String,
+     * java.util.PropertyPermission#PropertyPermission(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PropertyPermission",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         // Test for method java.util.PropertyPermission(java.lang.String,
         // java.lang.String)
@@ -54,14 +42,8 @@
     }
 
     /**
-     * @tests java.util.PropertyPermission#equals(java.lang.Object)
+     * java.util.PropertyPermission#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean
         // java.util.PropertyPermission.equals(java.lang.Object)
@@ -82,14 +64,8 @@
     }
 
     /**
-     * @tests java.util.PropertyPermission#getActions()
+     * java.util.PropertyPermission#getActions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getActions",
-        args = {}
-    )
     public void test_getActions() {
         // Test for method java.lang.String
         // java.util.PropertyPermission.getActions()
@@ -100,14 +76,8 @@
     }
 
     /**
-     * @tests java.util.PropertyPermission#hashCode()
+     * java.util.PropertyPermission#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         // Test for method int java.util.PropertyPermission.hashCode()
         assertTrue("javaPP returned wrong hashCode",
@@ -117,14 +87,8 @@
     }
 
     /**
-     * @tests java.util.PropertyPermission#implies(java.security.Permission)
+     * java.util.PropertyPermission#implies(java.security.Permission)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void test_impliesLjava_security_Permission() {
         // Test for method boolean
         // java.util.PropertyPermission.implies(java.security.Permission)
@@ -147,14 +111,8 @@
     }
 
     /**
-     * @tests java.util.PropertyPermission#newPermissionCollection()
+     * java.util.PropertyPermission#newPermissionCollection()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void test_newPermissionCollection() {
         // Test for method java.security.PermissionCollection
         // java.util.PropertyPermission.newPermissionCollection()
@@ -167,23 +125,9 @@
     }
 
     /**
-     * @tests java.util.PropertyPermission#readObject(ObjectInputStream)
-     * @tests java.util.PropertyPermission#writeObject(ObjectOutputStream)
+     * java.util.PropertyPermission#readObject(ObjectInputStream)
+     * java.util.PropertyPermission#writeObject(ObjectOutputStream)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization.",
-            method = "!SerializationSelf",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization.",
-            method = "!SerializationGolden",
-            args = {}
-        )
-    })
     public void test_serialization() throws Exception{
         PropertyPermission pp = new PropertyPermission("test", "read");
         SerializationTest.verifySelf(pp, comparator);
diff --git a/luni/src/test/java/tests/api/java/util/PropertyResourceBundleTest.java b/luni/src/test/java/tests/api/java/util/PropertyResourceBundleTest.java
index f7f59c0..bc6a4fe 100644
--- a/luni/src/test/java/tests/api/java/util/PropertyResourceBundleTest.java
+++ b/luni/src/test/java/tests/api/java/util/PropertyResourceBundleTest.java
@@ -17,44 +17,26 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Enumeration;
 import java.util.MissingResourceException;
 import java.util.PropertyResourceBundle;
 import java.util.Vector;
 
-@TestTargetClass(PropertyResourceBundle.class)
 public class PropertyResourceBundleTest extends junit.framework.TestCase {
 
     static PropertyResourceBundle prb;
 
     /**
-     * @tests java.util.PropertyResourceBundle#PropertyResourceBundle(java.io.InputStream)
+     * java.util.PropertyResourceBundle#PropertyResourceBundle(java.io.InputStream)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PropertyResourceBundle",
-        args = {java.io.InputStream.class}
-    )
     public void test_ConstructorLjava_io_InputStream() {
         // Test for method java.util.PropertyResourceBundle(java.io.InputStream)
         assertTrue("Used to test", true);
     }
 
     /**
-     * @tests java.util.PropertyResourceBundle#getKeys()
+     * java.util.PropertyResourceBundle#getKeys()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKeys",
-        args = {}
-    )
     public void test_getKeys() {
         Enumeration keyEnum = prb.getKeys();
         Vector test = new Vector();
@@ -70,14 +52,8 @@
     }
 
     /**
-     * @tests java.util.PropertyResourceBundle#handleGetObject(java.lang.String)
+     * java.util.PropertyResourceBundle#handleGetObject(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "handleGetObject",
-        args = {java.lang.String.class}
-    )
     public void test_handleGetObjectLjava_lang_String() {
         // Test for method java.lang.Object
         // java.util.PropertyResourceBundle.handleGetObject(java.lang.String)
diff --git a/luni/src/test/java/tests/api/java/util/RandomTest.java b/luni/src/test/java/tests/api/java/util/RandomTest.java
index a759c3f..bb72191 100644
--- a/luni/src/test/java/tests/api/java/util/RandomTest.java
+++ b/luni/src/test/java/tests/api/java/util/RandomTest.java
@@ -17,41 +17,23 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Random;
 
-@TestTargetClass(Random.class)
 public class RandomTest extends junit.framework.TestCase {
 
     Random r;
 
     /**
-     * @tests java.util.Random#Random()
+     * java.util.Random#Random()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Random",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.Random()
         assertTrue("Used to test", true);
     }
 
     /**
-     * @tests java.util.Random#Random(long)
+     * java.util.Random#Random(long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Random",
-        args = {long.class}
-    )
     public void test_ConstructorJ() {
         Random r = new Random(8409238L);
         Random r2 = new Random(8409238L);
@@ -61,14 +43,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextBoolean()
+     * java.util.Random#nextBoolean()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextBoolean",
-        args = {}
-    )
     public void test_nextBoolean() {
         // Test for method boolean java.util.Random.nextBoolean()
         boolean falseAppeared = false, trueAppeared = false;
@@ -84,14 +60,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextBytes(byte[])
+     * java.util.Random#nextBytes(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextBytes",
-        args = {byte[].class}
-    )
     public void test_nextBytes$B() {
         // Test for method void java.util.Random.nextBytes(byte [])
         boolean someDifferent = false;
@@ -107,14 +77,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextDouble()
+     * java.util.Random#nextDouble()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextDouble",
-        args = {}
-    )
     public void test_nextDouble() {
         // Test for method double java.util.Random.nextDouble()
         double lastNum = r.nextDouble();
@@ -137,14 +101,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextFloat()
+     * java.util.Random#nextFloat()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextFloat",
-        args = {}
-    )
     public void test_nextFloat() {
         // Test for method float java.util.Random.nextFloat()
         float lastNum = r.nextFloat();
@@ -166,14 +124,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextGaussian()
+     * java.util.Random#nextGaussian()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextGaussian",
-        args = {}
-    )
     public void test_nextGaussian() {
         // Test for method double java.util.Random.nextGaussian()
         double lastNum = r.nextGaussian();
@@ -196,14 +148,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextInt()
+     * java.util.Random#nextInt()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextInt",
-        args = {}
-    )
     public void test_nextInt() {
         // Test for method int java.util.Random.nextInt()
         int lastNum = r.nextInt();
@@ -220,14 +166,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextInt(int)
+     * java.util.Random#nextInt(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextInt",
-        args = {int.class}
-    )
     public void test_nextIntI() {
         // Test for method int java.util.Random.nextInt(int)
         final int range = 10;
@@ -252,14 +192,8 @@
     }
 
     /**
-     * @tests java.util.Random#nextLong()
+     * java.util.Random#nextLong()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextLong",
-        args = {}
-    )
     public void test_nextLong() {
         // Test for method long java.util.Random.nextLong()
         long lastNum = r.nextLong();
@@ -276,14 +210,8 @@
     }
 
     /**
-     * @tests java.util.Random#setSeed(long)
+     * java.util.Random#setSeed(long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSeed",
-        args = {long.class}
-    )
     public void test_setSeedJ() {
         // Test for method void java.util.Random.setSeed(long)
         long[] randomArray = new long[100];
@@ -332,12 +260,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "next",
-        args = {int.class}
-    )
     public void test_next() {
         Mock_Random mr = new Mock_Random();
         assertFalse(mr.getFlag());
diff --git a/luni/src/test/java/tests/api/java/util/ResourceBundleTest.java b/luni/src/test/java/tests/api/java/util/ResourceBundleTest.java
index a9f5082..f1fd484 100644
--- a/luni/src/test/java/tests/api/java/util/ResourceBundleTest.java
+++ b/luni/src/test/java/tests/api/java/util/ResourceBundleTest.java
@@ -18,10 +18,6 @@
 package tests.api.java.util;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.io.File;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -35,19 +31,12 @@
 import tests.api.java.util.support.B;
 import tests.support.resource.Support_Resources;
 
-@TestTargetClass(ResourceBundle.class)
 public class ResourceBundleTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.ResourceBundle#getBundle(java.lang.String,
+     * java.util.ResourceBundle#getBundle(java.lang.String,
      *        java.util.Locale)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getBundle",
-        args = {java.lang.String.class, java.util.Locale.class}
-    )
     public void test_getBundleLjava_lang_StringLjava_util_Locale() {
         ResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
@@ -96,15 +85,9 @@
     }
 
     /**
-     * @tests java.util.ResourceBundle#getBundle(java.lang.String,
+     * java.util.ResourceBundle#getBundle(java.lang.String,
      *        java.util.Locale, java.lang.ClassLoader)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getBundle",
-        args = {java.lang.String.class, java.util.Locale.class, java.lang.ClassLoader.class}
-    )
     @KnownFailure("It's not allowed to pass null as parent class loader to"
             + " a new ClassLoader anymore. Maybe we need to change"
             + " URLClassLoader to allow this? It's not specified.")
@@ -175,14 +158,8 @@
     }
 
     /**
-     * @tests java.util.ResourceBundle#getString(java.lang.String)
+     * java.util.ResourceBundle#getString(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getString",
-        args = {java.lang.String.class}
-    )
     public void test_getStringLjava_lang_String() {
         ResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
@@ -224,12 +201,6 @@
             //expected
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test. Doesn't verify NullPointerException.",
-        method = "getBundle",
-        args = {java.lang.String.class}
-    )
     public void test_getBundle_getClassName() {
         // Regression test for Harmony-1759
         Locale locale = Locale.GERMAN;
@@ -270,22 +241,10 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ResourceBundle",
-        args = {}
-    )
     public void test_constructor() {
         assertNotNull(new Mock_ResourceBundle());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLocale",
-        args = {}
-    )
     public void test_getLocale() {
         ResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
@@ -313,12 +272,6 @@
         Locale.setDefault(loc);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getObject",
-        args = {java.lang.String.class}
-    )
     public void test_getObjectLjava_lang_String() {
         ResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
@@ -356,20 +309,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getStringArray",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setParent",
-            args = {java.util.ResourceBundle.class}
-        )
-    })
     public void test_getStringArrayLjava_lang_String() {
         ResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
@@ -403,12 +342,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getBundle",
-        args = {java.lang.String.class}
-    )
     public void test_getBundleLjava_lang_String() {
         ResourceBundle bundle;
         String name = "tests.support.Support_TestResource";
diff --git a/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java b/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java
index e9cda6e..e27ec0d 100644
--- a/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java
+++ b/luni/src/test/java/tests/api/java/util/SimpleTimeZoneTest.java
@@ -17,18 +17,12 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 import java.util.SimpleTimeZone;
 import java.util.TimeZone;
 
-@TestTargetClass(SimpleTimeZone.class)
 public class SimpleTimeZoneTest extends junit.framework.TestCase {
 
     SimpleTimeZone st1;
@@ -36,14 +30,8 @@
     SimpleTimeZone st2;
 
     /**
-     * @tests java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String)
+     * java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SimpleTimeZone",
-        args = {int.class, java.lang.String.class}
-    )
     public void test_ConstructorILjava_lang_String() {
         // Test for method java.util.SimpleTimeZone(int, java.lang.String)
 
@@ -56,15 +44,9 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
+     * java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
      *        int, int, int, int, int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SimpleTimeZone",
-        args = {int.class, java.lang.String.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_ConstructorILjava_lang_StringIIIIIIII() {
         // Test for method java.util.SimpleTimeZone(int, java.lang.String, int,
         // int, int, int, int, int, int, int)
@@ -119,15 +101,9 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
+     * java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
      *        int, int, int, int, int, int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SimpleTimeZone",
-        args = {int.class, java.lang.String.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_ConstructorILjava_lang_StringIIIIIIIII() {
         // Test for method java.util.SimpleTimeZone(int, java.lang.String, int,
         // int, int, int, int, int, int, int, int)
@@ -184,15 +160,9 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
+     * java.util.SimpleTimeZone#SimpleTimeZone(int, java.lang.String,
      *        int, int, int, int, int, int, int, int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SimpleTimeZone",
-        args = {int.class, java.lang.String.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_ConstructorILjava_lang_StringIIIIIIIIIII() {
         // Test for method java.util.SimpleTimeZone(int, java.lang.String, int,
         // int, int, int, int, int, int, int, int, int, int)
@@ -267,14 +237,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#clone()
+     * java.util.SimpleTimeZone#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.SimpleTimeZone.clone()
         SimpleTimeZone st1 = new SimpleTimeZone(1000, "TEST",
@@ -290,14 +254,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#equals(java.lang.Object)
+     * java.util.SimpleTimeZone#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean
         // java.util.SimpleTimeZone.equals(java.lang.Object)
@@ -310,14 +268,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#getDSTSavings()
+     * java.util.SimpleTimeZone#getDSTSavings()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDSTSavings",
-        args = {}
-    )
     public void test_getDSTSavings() {
         // Test for method int java.util.SimpleTimeZone.getDSTSavings()
         st1 = new SimpleTimeZone(0, "TEST");
@@ -338,14 +290,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#getOffset(int, int, int, int, int, int)
+     * java.util.SimpleTimeZone#getOffset(int, int, int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getOffset",
-        args = {int.class, int.class, int.class, int.class, int.class, int.class}
-    )
     public void test_getOffsetIIIIII() {
         // Test for method int java.util.SimpleTimeZone.getOffset(int, int, int,
         // int, int, int)
@@ -403,14 +349,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#getRawOffset()
+     * java.util.SimpleTimeZone#getRawOffset()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getRawOffset",
-        args = {}
-    )
     public void test_getRawOffset() {
         // Test for method int java.util.SimpleTimeZone.getRawOffset()
         st1 = new SimpleTimeZone(TimeZone.getTimeZone("EST").getRawOffset(), "EST");
@@ -420,14 +360,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#hashCode()
+     * java.util.SimpleTimeZone#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         // Test for method int java.util.SimpleTimeZone.hashCode()
         // For lack of a better test.
@@ -439,14 +373,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#hasSameRules(java.util.TimeZone)
+     * java.util.SimpleTimeZone#hasSameRules(java.util.TimeZone)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hasSameRules",
-        args = {java.util.TimeZone.class}
-    )
     public void test_hasSameRulesLjava_util_TimeZone() {
         // Test for method boolean
         // java.util.SimpleTimeZone.hasSameRules(java.util.TimeZone)
@@ -466,14 +394,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#inDaylightTime(java.util.Date)
+     * java.util.SimpleTimeZone#inDaylightTime(java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "inDaylightTime",
-        args = {java.util.Date.class}
-    )
     public void test_inDaylightTimeLjava_util_Date() {
         // Test for method boolean
         // java.util.SimpleTimeZone.inDaylightTime(java.util.Date)
@@ -512,14 +434,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setDSTSavings(int)
+     * java.util.SimpleTimeZone#setDSTSavings(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDSTSavings",
-        args = {int.class}
-    )
     public void test_setDSTSavingsI() {
         // Test for method void java.util.SimpleTimeZone.setDSTSavings(int)
         SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
@@ -530,14 +446,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setEndRule(int, int, int)
+     * java.util.SimpleTimeZone#setEndRule(int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setEndRule",
-        args = {int.class, int.class, int.class}
-    )
     public void test_setEndRuleIII() {
         SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
         st.setStartRule(Calendar.NOVEMBER, 1, 0);
@@ -573,14 +483,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setEndRule(int, int, int, int)
+     * java.util.SimpleTimeZone#setEndRule(int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setEndRule",
-        args = {int.class, int.class, int.class, int.class}
-    )
     public void test_setEndRuleIIII() {
         // Test for method void java.util.SimpleTimeZone.setEndRule(int, int,
         // int, int)
@@ -627,14 +531,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setEndRule(int, int, int, int, boolean)
+     * java.util.SimpleTimeZone#setEndRule(int, int, int, int, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setEndRule",
-        args = {int.class, int.class, int.class, int.class, boolean.class}
-    )
     public void test_setEndRuleIIIIZ() {
         // Test for method void java.util.SimpleTimeZone.setEndRule(int, int,
         // int, int, boolean)
@@ -687,14 +585,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setRawOffset(int)
+     * java.util.SimpleTimeZone#setRawOffset(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setRawOffset",
-        args = {int.class}
-    )
     public void test_setRawOffsetI() {
         // Test for method void java.util.SimpleTimeZone.setRawOffset(int)
 
@@ -707,14 +599,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setStartRule(int, int, int)
+     * java.util.SimpleTimeZone#setStartRule(int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setStartRule",
-        args = {int.class, int.class, int.class}
-    )
     public void test_setStartRuleIII() {
         // Test for method void java.util.SimpleTimeZone.setStartRule(int, int,
         // int)
@@ -754,14 +640,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setStartRule(int, int, int, int)
+     * java.util.SimpleTimeZone#setStartRule(int, int, int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setStartRule",
-        args = {int.class, int.class, int.class, int.class}
-    )
     public void test_setStartRuleIIII() {
         // Test for method void java.util.SimpleTimeZone.setStartRule(int, int,
         // int, int)
@@ -808,14 +688,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setStartRule(int, int, int, int, boolean)
+     * java.util.SimpleTimeZone#setStartRule(int, int, int, int, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setStartRule",
-        args = {int.class, int.class, int.class, int.class, boolean.class}
-    )
     public void test_setStartRuleIIIIZ() {
         // Test for method void java.util.SimpleTimeZone.setStartRule(int, int,
         // int, int, boolean)
@@ -868,14 +742,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#setStartYear(int)
+     * java.util.SimpleTimeZone#setStartYear(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setStartYear",
-        args = {int.class}
-    )
     public void test_setStartYearI() {
         // Test for method void java.util.SimpleTimeZone.setStartYear(int)
         SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
@@ -894,14 +762,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#toString()
+     * java.util.SimpleTimeZone#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.util.SimpleTimeZone.toString()
         String string = TimeZone.getTimeZone("EST").toString();
@@ -910,14 +772,8 @@
     }
 
     /**
-     * @tests java.util.SimpleTimeZone#useDaylightTime()
+     * java.util.SimpleTimeZone#useDaylightTime()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "useDaylightTime",
-        args = {}
-    )
     public void test_useDaylightTime() {
         // Test for method boolean java.util.SimpleTimeZone.useDaylightTime()
         SimpleTimeZone st = new SimpleTimeZone(1000, "Test_TZ");
@@ -931,12 +787,6 @@
                 .useDaylightTime());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getOffset",
-        args = {long.class}
-    )
     public void test_getOffsetJ() {
         Calendar cal = Calendar.getInstance();
         cal.set(1998, Calendar.NOVEMBER, 11, 0, 0);
diff --git a/luni/src/test/java/tests/api/java/util/StackTest.java b/luni/src/test/java/tests/api/java/util/StackTest.java
index 01d2f9e..465df13 100644
--- a/luni/src/test/java/tests/api/java/util/StackTest.java
+++ b/luni/src/test/java/tests/api/java/util/StackTest.java
@@ -17,42 +17,24 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.EmptyStackException;
 import java.util.Stack;
 
-@TestTargetClass(Stack.class)
 public class StackTest extends junit.framework.TestCase {
 
     Stack s;
 
     /**
-     * @tests java.util.Stack#Stack()
+     * java.util.Stack#Stack()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Stack",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.Stack()
         assertEquals("Stack creation failed", 0, s.size());
     }
 
     /**
-     * @tests java.util.Stack#empty()
+     * java.util.Stack#empty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "empty",
-        args = {}
-    )
     public void test_empty() {
         // Test for method boolean java.util.Stack.empty()
         assertTrue("New stack answers non-empty", s.empty());
@@ -66,14 +48,8 @@
     }
 
     /**
-     * @tests java.util.Stack#peek()
+     * java.util.Stack#peek()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "peek",
-        args = {}
-    )
     public void test_peek() {
         // Test for method java.lang.Object java.util.Stack.peek()
         String item1 = "Ichi";
@@ -102,14 +78,8 @@
     }
 
     /**
-     * @tests java.util.Stack#pop()
+     * java.util.Stack#pop()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "pop",
-        args = {}
-    )
     public void test_pop() {
         // Test for method java.lang.Object java.util.Stack.pop()
         String item1 = "Ichi";
@@ -154,14 +124,8 @@
     }
 
     /**
-     * @tests java.util.Stack#push(java.lang.Object)
+     * java.util.Stack#push(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "push",
-        args = {java.lang.Object.class}
-    )
     public void test_pushLjava_lang_Object() {
         Object [] array = {new Integer(0), new Object(),
                            new Float(0), new String()};
@@ -176,14 +140,8 @@
     }
 
     /**
-     * @tests java.util.Stack#search(java.lang.Object)
+     * java.util.Stack#search(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "search",
-        args = {java.lang.Object.class}
-    )
     public void test_searchLjava_lang_Object() {
         // Test for method int java.util.Stack.search(java.lang.Object)
         String item1 = "Ichi";
diff --git a/luni/src/test/java/tests/api/java/util/StringTokenizerTest.java b/luni/src/test/java/tests/api/java/util/StringTokenizerTest.java
index b2261f9..809ed99 100644
--- a/luni/src/test/java/tests/api/java/util/StringTokenizerTest.java
+++ b/luni/src/test/java/tests/api/java/util/StringTokenizerTest.java
@@ -17,26 +17,14 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.NoSuchElementException;
 import java.util.StringTokenizer;
 
-@TestTargetClass(StringTokenizer.class)
 public class StringTokenizerTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.StringTokenizer#StringTokenizer(java.lang.String)
+     * java.util.StringTokenizer#StringTokenizer(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "StringTokenizer",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.util.StringTokenizer(java.lang.String)
         try {
@@ -48,15 +36,9 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#StringTokenizer(java.lang.String,
+     * java.util.StringTokenizer#StringTokenizer(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "StringTokenizer",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         // Test for method java.util.StringTokenizer(java.lang.String,
         // java.lang.String)
@@ -74,15 +56,9 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#StringTokenizer(java.lang.String,
+     * java.util.StringTokenizer#StringTokenizer(java.lang.String,
      *        java.lang.String, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "StringTokenizer",
-        args = {java.lang.String.class, java.lang.String.class, boolean.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_StringZ() {
         // Test for method java.util.StringTokenizer(java.lang.String,
         // java.lang.String, boolean)
@@ -103,14 +79,8 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#countTokens()
+     * java.util.StringTokenizer#countTokens()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "countTokens",
-        args = {}
-    )
     public void test_countTokens() {
         // Test for method int java.util.StringTokenizer.countTokens()
         StringTokenizer st = new StringTokenizer("This is a test String");
@@ -119,14 +89,8 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#hasMoreElements()
+     * java.util.StringTokenizer#hasMoreElements()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hasMoreElements",
-        args = {}
-    )
     public void test_hasMoreElements() {
         // Test for method boolean java.util.StringTokenizer.hasMoreElements()
 
@@ -143,14 +107,8 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#hasMoreTokens()
+     * java.util.StringTokenizer#hasMoreTokens()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hasMoreTokens",
-        args = {}
-    )
     public void test_hasMoreTokens() {
         // Test for method boolean java.util.StringTokenizer.hasMoreTokens()
         StringTokenizer st = new StringTokenizer("This is a test String");
@@ -165,14 +123,8 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#nextElement()
+     * java.util.StringTokenizer#nextElement()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextElement",
-        args = {}
-    )
     public void test_nextElement() {
         // Test for method java.lang.Object
         // java.util.StringTokenizer.nextElement()
@@ -197,14 +149,8 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#nextToken()
+     * java.util.StringTokenizer#nextToken()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextToken",
-        args = {}
-    )
     public void test_nextToken() {
         // Test for method java.lang.String
         // java.util.StringTokenizer.nextToken()
@@ -229,14 +175,8 @@
     }
 
     /**
-     * @tests java.util.StringTokenizer#nextToken(java.lang.String)
+     * java.util.StringTokenizer#nextToken(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "nextToken",
-        args = {java.lang.String.class}
-    )
     public void test_nextTokenLjava_lang_String() {
         // Test for method java.lang.String
         // java.util.StringTokenizer.nextToken(java.lang.String)
diff --git a/luni/src/test/java/tests/api/java/util/TimerTaskTest.java b/luni/src/test/java/tests/api/java/util/TimerTaskTest.java
index b91b742..97ff8ea 100644
--- a/luni/src/test/java/tests/api/java/util/TimerTaskTest.java
+++ b/luni/src/test/java/tests/api/java/util/TimerTaskTest.java
@@ -17,15 +17,9 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Timer;
 import java.util.TimerTask;
 
-@TestTargetClass(TimerTask.class)
 public class TimerTaskTest extends junit.framework.TestCase {
     /**
      * Warning: These tests have the possibility to leave a VM hanging if the
@@ -71,28 +65,16 @@
     }
 
     /**
-     * @tests java.util.TimerTask#TimerTask()
+     * java.util.TimerTask#TimerTask()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TimerTask",
-        args = {}
-    )
     public void test_Constructor() {
         // Ensure the constructor does not fail
         new TimerTestTask();
     }
 
     /**
-     * @tests java.util.TimerTask#cancel()
+     * java.util.TimerTask#cancel()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cancel",
-        args = {}
-    )
     public void test_cancel() {
         Timer t = null;
         try {
@@ -186,14 +168,8 @@
     }
 
     /**
-     * @tests java.util.TimerTask#scheduledExecutionTime()
+     * java.util.TimerTask#scheduledExecutionTime()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "scheduledExecutionTime",
-        args = {}
-    )
     public void test_scheduledExecutionTime() {
         Timer t = null;
         try {
@@ -237,14 +213,8 @@
     }
 
     /**
-     * @tests java.util.TimerTask#run()
+     * java.util.TimerTask#run()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "run",
-        args = {}
-    )
     public void test_run() {
         Timer t = null;
         try {
diff --git a/luni/src/test/java/tests/api/java/util/TimerTest.java b/luni/src/test/java/tests/api/java/util/TimerTest.java
index 844c3ca..26d88ba 100644
--- a/luni/src/test/java/tests/api/java/util/TimerTest.java
+++ b/luni/src/test/java/tests/api/java/util/TimerTest.java
@@ -17,17 +17,12 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.lang.Thread.UncaughtExceptionHandler;
 import java.util.Date;
 import java.util.Timer;
 import java.util.TimerTask;
 import java.util.concurrent.atomic.AtomicReference;
 
-@TestTargetClass(Timer.class)
 public class TimerTest extends junit.framework.TestCase {
 
     int timerCounter = 0;
@@ -97,14 +92,8 @@
     }
 
     /**
-     * @tests java.util.Timer#Timer(boolean)
+     * java.util.Timer#Timer(boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Timer",
-        args = {boolean.class}
-    )
     public void test_ConstructorZ() {
         Timer t = null;
         try {
@@ -129,14 +118,8 @@
     }
 
     /**
-     * @tests java.util.Timer#Timer()
+     * java.util.Timer#Timer()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Timer",
-        args = {}
-    )
     public void test_Constructor() {
         Timer t = null;
         try {
@@ -161,14 +144,8 @@
     }
 
     /**
-     * @tests java.util.Timer#Timer(String, boolean)
+     * java.util.Timer#Timer(String, boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Timer",
-        args = {java.lang.String.class, boolean.class}
-    )
     public void test_ConstructorSZ() {
         Timer t = null;
         try {
@@ -205,14 +182,8 @@
     }
 
     /**
-     * @tests java.util.Timer#Timer(String)
+     * java.util.Timer#Timer(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Timer",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorS() {
         Timer t = null;
         try {
@@ -242,14 +213,8 @@
     }
 
     /**
-     * @tests java.util.Timer#cancel()
+     * java.util.Timer#cancel()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "cancel",
-        args = {}
-    )
     public void test_cancel() {
         Timer t = null;
         try {
@@ -346,14 +311,8 @@
     }
 
     /**
-     * @tests java.util.Timer#purge()
+     * java.util.Timer#purge()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "purge",
-        args = {}
-    )
     public void test_purge() throws Exception {
         Timer t = null;
         try {
@@ -386,14 +345,8 @@
     }
 
     /**
-     * @tests java.util.Timer#schedule(java.util.TimerTask, java.util.Date)
+     * java.util.Timer#schedule(java.util.TimerTask, java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "schedule",
-        args = {java.util.TimerTask.class, java.util.Date.class}
-    )
     public void test_scheduleLjava_util_TimerTaskLjava_util_Date() {
         Timer t = null;
         try {
@@ -534,14 +487,8 @@
     }
 
     /**
-     * @tests java.util.Timer#schedule(java.util.TimerTask, long)
+     * java.util.Timer#schedule(java.util.TimerTask, long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "schedule",
-        args = {java.util.TimerTask.class, long.class}
-    )
     public void test_scheduleLjava_util_TimerTaskJ() {
         Timer t = null;
         try {
@@ -658,14 +605,8 @@
     }
 
     /**
-     * @tests java.util.Timer#schedule(java.util.TimerTask, long, long)
+     * java.util.Timer#schedule(java.util.TimerTask, long, long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "schedule",
-        args = {java.util.TimerTask.class, long.class, long.class}
-    )
     public void test_scheduleLjava_util_TimerTaskJJ() {
         Timer t = null;
         try {
@@ -813,15 +754,9 @@
     }
 
     /**
-     * @tests java.util.Timer#schedule(java.util.TimerTask, java.util.Date,
+     * java.util.Timer#schedule(java.util.TimerTask, java.util.Date,
      *        long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "schedule",
-        args = {java.util.TimerTask.class, java.util.Date.class, long.class}
-    )
     public void test_scheduleLjava_util_TimerTaskLjava_util_DateJ() {
         Timer t = null;
         try {
@@ -979,15 +914,9 @@
     }
 
     /**
-     * @tests java.util.Timer#scheduleAtFixedRate(java.util.TimerTask, long,
+     * java.util.Timer#scheduleAtFixedRate(java.util.TimerTask, long,
      *        long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "scheduleAtFixedRate",
-        args = {java.util.TimerTask.class, long.class, long.class}
-    )
     public void test_scheduleAtFixedRateLjava_util_TimerTaskJJ() {
         Timer t = null;
         try {
@@ -1099,15 +1028,9 @@
     }
 
     /**
-     * @tests java.util.Timer#scheduleAtFixedRate(java.util.TimerTask,
+     * java.util.Timer#scheduleAtFixedRate(java.util.TimerTask,
      *        java.util.Date, long)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "scheduleAtFixedRate",
-        args = {java.util.TimerTask.class, java.util.Date.class, long.class}
-    )
     public void test_scheduleAtFixedRateLjava_util_TimerTaskLjava_util_DateJ() {
         Timer t = null;
         try {
diff --git a/luni/src/test/java/tests/api/java/util/TooManyListenersExceptionTest.java b/luni/src/test/java/tests/api/java/util/TooManyListenersExceptionTest.java
index 0479f29..48df5fd 100644
--- a/luni/src/test/java/tests/api/java/util/TooManyListenersExceptionTest.java
+++ b/luni/src/test/java/tests/api/java/util/TooManyListenersExceptionTest.java
@@ -17,25 +17,13 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.TooManyListenersException;
 
-@TestTargetClass(TooManyListenersException.class)
 public class TooManyListenersExceptionTest extends junit.framework.TestCase {
 
     /**
-     * @tests java.util.TooManyListenersException#TooManyListenersException()
+     * java.util.TooManyListenersException#TooManyListenersException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TooManyListenersException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.TooManyListenersException()
         try {
@@ -48,14 +36,8 @@
     }
 
     /**
-     * @tests java.util.TooManyListenersException#TooManyListenersException(java.lang.String)
+     * java.util.TooManyListenersException#TooManyListenersException(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TooManyListenersException",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method java.util.TooManyListenersException(java.lang.String)
         try {
diff --git a/luni/src/test/java/tests/api/java/util/VectorTest.java b/luni/src/test/java/tests/api/java/util/VectorTest.java
index dceb203..6228cb3 100644
--- a/luni/src/test/java/tests/api/java/util/VectorTest.java
+++ b/luni/src/test/java/tests/api/java/util/VectorTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Enumeration;
@@ -34,7 +29,6 @@
 
 import tests.support.Support_ListTest;
 
-@TestTargetClass(Vector.class)
 public class VectorTest extends junit.framework.TestCase {
 
     private Vector tVector = new Vector();
@@ -44,14 +38,8 @@
     private String vString = "[Test 0, Test 1, Test 2, Test 3, Test 4, Test 5, Test 6, Test 7, Test 8, Test 9, Test 10, Test 11, Test 12, Test 13, Test 14, Test 15, Test 16, Test 17, Test 18, Test 19, Test 20, Test 21, Test 22, Test 23, Test 24, Test 25, Test 26, Test 27, Test 28, Test 29, Test 30, Test 31, Test 32, Test 33, Test 34, Test 35, Test 36, Test 37, Test 38, Test 39, Test 40, Test 41, Test 42, Test 43, Test 44, Test 45, Test 46, Test 47, Test 48, Test 49, Test 50, Test 51, Test 52, Test 53, Test 54, Test 55, Test 56, Test 57, Test 58, Test 59, Test 60, Test 61, Test 62, Test 63, Test 64, Test 65, Test 66, Test 67, Test 68, Test 69, Test 70, Test 71, Test 72, Test 73, Test 74, Test 75, Test 76, Test 77, Test 78, Test 79, Test 80, Test 81, Test 82, Test 83, Test 84, Test 85, Test 86, Test 87, Test 88, Test 89, Test 90, Test 91, Test 92, Test 93, Test 94, Test 95, Test 96, Test 97, Test 98, Test 99]";
 
     /**
-     * @tests java.util.Vector#Vector()
+     * java.util.Vector#Vector()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Vector",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.util.Vector()
 
@@ -71,14 +59,8 @@
     }
 
     /**
-     * @tests java.util.Vector#Vector(int)
+     * java.util.Vector#Vector(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Vector",
-        args = {int.class}
-    )
     public void test_ConstructorI() {
         // Test for method java.util.Vector(int)
 
@@ -95,14 +77,8 @@
     }
 
     /**
-     * @tests java.util.Vector#Vector(int, int)
+     * java.util.Vector#Vector(int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Vector",
-        args = {int.class, int.class}
-    )
     public void test_ConstructorII() {
         // Test for method java.util.Vector(int, int)
 
@@ -131,14 +107,8 @@
     }
 
     /**
-     * @tests java.util.Vector#Vector(java.util.Collection)
+     * java.util.Vector#Vector(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Vector",
-        args = {java.util.Collection.class}
-    )
     public void test_ConstructorLjava_util_Collection() {
         // Test for method java.util.Vector(java.util.Collection)
         Collection l = new LinkedList();
@@ -160,14 +130,8 @@
     }
 
     /**
-     * @tests java.util.Vector#add(int, java.lang.Object)
+     * java.util.Vector#add(int, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_addILjava_lang_Object() {
         // Test for method void java.util.Vector.add(int, java.lang.Object)
         Object o = new Object();
@@ -200,14 +164,8 @@
     }
 
     /**
-     * @tests java.util.Vector#add(java.lang.Object)
+     * java.util.Vector#add(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "add",
-        args = {java.lang.Object.class}
-    )
     public void test_addLjava_lang_Object() {
         // Test for method boolean java.util.Vector.add(java.lang.Object)
         Object o = new Object();
@@ -221,14 +179,8 @@
     }
 
     /**
-     * @tests java.util.Vector#addAll(int, java.util.Collection)
+     * java.util.Vector#addAll(int, java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {int.class, java.util.Collection.class}
-    )
     public void test_addAllILjava_util_Collection() {
         // Test for method boolean java.util.Vector.addAll(int,
         // java.util.Collection)
@@ -286,14 +238,8 @@
     }
 
     /**
-     * @tests java.util.Vector#addAll(java.util.Collection)
+     * java.util.Vector#addAll(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addAll",
-        args = {java.util.Collection.class}
-    )
     public void test_addAllLjava_util_Collection() {
         // Test for method boolean java.util.Vector.addAll(java.util.Collection)
         Vector v = new Vector();
@@ -330,14 +276,8 @@
     }
 
     /**
-     * @tests java.util.Vector#addElement(java.lang.Object)
+     * java.util.Vector#addElement(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addElement",
-        args = {java.lang.Object.class}
-    )
     public void test_addElementLjava_lang_Object() {
         // Test for method void java.util.Vector.addElement(java.lang.Object)
         Vector v = vectorClone(tVector);
@@ -351,14 +291,8 @@
     }
 
     /**
-     * @tests java.util.Vector#addElement(java.lang.Object)
+     * java.util.Vector#addElement(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addElement",
-        args = {java.lang.Object.class}
-    )
     public void test_addElementLjava_lang_Object_subtest0() {
         // Test for method void java.util.Vector.addElement(java.lang.Object)
         Vector v = vectorClone(tVector);
@@ -372,14 +306,8 @@
     }
 
     /**
-     * @tests java.util.Vector#capacity()
+     * java.util.Vector#capacity()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "capacity",
-        args = {}
-    )
     public void test_capacity() {
         // Test for method int java.util.Vector.capacity()
 
@@ -388,14 +316,8 @@
     }
 
     /**
-     * @tests java.util.Vector#clear()
+     * java.util.Vector#clear()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clear",
-        args = {}
-    )
     public void test_clear() {
         // Test for method void java.util.Vector.clear()
         Vector orgVector = vectorClone(tVector);
@@ -416,14 +338,8 @@
     }
 
     /**
-     * @tests java.util.Vector#clone()
+     * java.util.Vector#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() {
         // Test for method java.lang.Object java.util.Vector.clone()
         tVector.add(25, null);
@@ -442,14 +358,8 @@
     }
 
     /**
-     * @tests java.util.Vector#contains(java.lang.Object)
+     * java.util.Vector#contains(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "contains",
-        args = {java.lang.Object.class}
-    )
     public void test_containsLjava_lang_Object() {
         // Test for method boolean java.util.Vector.contains(java.lang.Object)
         assertTrue("Did not find element", tVector.contains("Test 42"));
@@ -464,14 +374,8 @@
     }
 
     /**
-     * @tests java.util.Vector#containsAll(java.util.Collection)
+     * java.util.Vector#containsAll(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsAll",
-        args = {java.util.Collection.class}
-    )
     public void test_containsAllLjava_util_Collection() {
         // Test for method boolean
         // java.util.Vector.containsAll(java.util.Collection)
@@ -501,14 +405,8 @@
     }
 
     /**
-     * @tests java.util.Vector#copyInto(java.lang.Object[])
+     * java.util.Vector#copyInto(java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "copyInto",
-        args = {java.lang.Object[].class}
-    )
     public void test_copyInto$Ljava_lang_Object() {
         // Test for method void java.util.Vector.copyInto(java.lang.Object [])
 
@@ -528,14 +426,8 @@
     }
 
     /**
-     * @tests java.util.Vector#elementAt(int)
+     * java.util.Vector#elementAt(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "elementAt",
-        args = {int.class}
-    )
     public void test_elementAtI() {
         // Test for method java.lang.Object java.util.Vector.elementAt(int)
         assertEquals("Incorrect element returned", "Test 18", ((String) tVector
@@ -560,14 +452,8 @@
     }
 
     /**
-     * @tests java.util.Vector#elements()
+     * java.util.Vector#elements()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "elements",
-        args = {}
-    )
     public void test_elements() {
         // Test for method java.util.Enumeration java.util.Vector.elements()
         tVector.insertElementAt(null, 20);
@@ -582,14 +468,8 @@
     }
 
     /**
-     * @tests java.util.Vector#elements()
+     * java.util.Vector#elements()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "elements",
-        args = {}
-    )
     public void test_elements_subtest0() {
         final int iterations = 10000;
         final Vector v = new Vector();
@@ -619,14 +499,8 @@
     }
 
     /**
-     * @tests java.util.Vector#ensureCapacity(int)
+     * java.util.Vector#ensureCapacity(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ensureCapacity",
-        args = {int.class}
-    )
     public void test_ensureCapacityI() {
         // Test for method void java.util.Vector.ensureCapacity(int)
 
@@ -639,14 +513,8 @@
     }
 
     /**
-     * @tests java.util.Vector#equals(java.lang.Object)
+     * java.util.Vector#equals(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void test_equalsLjava_lang_Object() {
         // Test for method boolean java.util.Vector.equals(java.lang.Object)
         Vector v = new Vector();
@@ -662,14 +530,8 @@
     }
 
     /**
-     * @tests java.util.Vector#firstElement()
+     * java.util.Vector#firstElement()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "firstElement",
-        args = {}
-    )
     public void test_firstElement() {
         // Test for method java.lang.Object java.util.Vector.firstElement()
         assertEquals("Returned incorrect firstElement", "Test 0", tVector.firstElement()
@@ -689,14 +551,8 @@
     }
 
     /**
-     * @tests java.util.Vector#get(int)
+     * java.util.Vector#get(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "get",
-        args = {int.class}
-    )
     public void test_getI() {
         // Test for method java.lang.Object java.util.Vector.get(int)
         assertEquals("Get returned incorrect object",
@@ -721,14 +577,8 @@
     }
 
     /**
-     * @tests java.util.Vector#hashCode()
+     * java.util.Vector#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         // Test for method int java.util.Vector.hashCode()
         int hashCode = 1; // one
@@ -742,14 +592,8 @@
     }
 
     /**
-     * @tests java.util.Vector#indexOf(java.lang.Object)
+     * java.util.Vector#indexOf(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "indexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_indexOfLjava_lang_Object() {
         // Test for method int java.util.Vector.indexOf(java.lang.Object)
         assertEquals("Incorrect index returned", 10, tVector.indexOf("Test 10"));
@@ -762,14 +606,8 @@
     }
 
     /**
-     * @tests java.util.Vector#indexOf(java.lang.Object, int)
+     * java.util.Vector#indexOf(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "indexOf",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_indexOfLjava_lang_ObjectI() {
         // Test for method int java.util.Vector.indexOf(java.lang.Object, int)
         assertTrue("Failed to find correct index", (tVector.indexOf("Test 98",
@@ -793,14 +631,8 @@
     }
 
     /**
-     * @tests java.util.Vector#insertElementAt(java.lang.Object, int)
+     * java.util.Vector#insertElementAt(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "insertElementAt",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_insertElementAtLjava_lang_ObjectI() {
         // Test for method void
         // java.util.Vector.insertElementAt(java.lang.Object, int)
@@ -830,14 +662,8 @@
     }
 
     /**
-     * @tests java.util.Vector#isEmpty()
+     * java.util.Vector#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.Vector.isEmpty()Vector
         Vector v = new java.util.Vector();
@@ -847,14 +673,8 @@
     }
 
     /**
-     * @tests java.util.Vector#isEmpty()
+     * java.util.Vector#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty_subtest0() {
         final Vector v = new Vector();
         v.addElement("initial");
@@ -884,14 +704,8 @@
     }
 
     /**
-     * @tests java.util.Vector#lastElement()
+     * java.util.Vector#lastElement()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastElement",
-        args = {}
-    )
     public void test_lastElement() {
         // Test for method java.lang.Object java.util.Vector.lastElement()
         assertEquals("Incorrect last element returned", "Test 99", tVector.lastElement()
@@ -911,14 +725,8 @@
     }
 
     /**
-     * @tests java.util.Vector#lastIndexOf(java.lang.Object)
+     * java.util.Vector#lastIndexOf(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastIndexOf",
-        args = {java.lang.Object.class}
-    )
     public void test_lastIndexOfLjava_lang_Object() {
         // Test for method int java.util.Vector.lastIndexOf(java.lang.Object)
         Vector v = new Vector(9);
@@ -933,14 +741,8 @@
     }
 
     /**
-     * @tests java.util.Vector#lastIndexOf(java.lang.Object, int)
+     * java.util.Vector#lastIndexOf(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "lastIndexOf",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_lastIndexOfLjava_lang_ObjectI() {
         // Test for method int java.util.Vector.lastIndexOf(java.lang.Object,
         // int)
@@ -967,14 +769,8 @@
     }
 
     /**
-     * @tests java.util.Vector#remove(int)
+     * java.util.Vector#remove(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {int.class}
-    )
     public void test_removeI() {
         // Test for method java.lang.Object java.util.Vector.remove(int)
         tVector.remove(36);
@@ -1006,14 +802,8 @@
     }
 
     /**
-     * @tests java.util.Vector#remove(java.lang.Object)
+     * java.util.Vector#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method boolean java.util.Vector.remove(java.lang.Object)
         tVector.remove("Test 0");
@@ -1029,14 +819,8 @@
     }
 
     /**
-     * @tests java.util.Vector#removeAll(java.util.Collection)
+     * java.util.Vector#removeAll(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeAll",
-        args = {java.util.Collection.class}
-    )
     public void test_removeAllLjava_util_Collection() {
         // Test for method boolean
         // java.util.Vector.removeAll(java.util.Collection)
@@ -1074,14 +858,8 @@
     }
 
     /**
-     * @tests java.util.Vector#removeAllElements()
+     * java.util.Vector#removeAllElements()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeAllElements",
-        args = {}
-    )
     public void test_removeAllElements() {
         // Test for method void java.util.Vector.removeAllElements()
         Vector v = vectorClone(tVector);
@@ -1090,14 +868,8 @@
     }
 
     /**
-     * @tests java.util.Vector#removeElement(java.lang.Object)
+     * java.util.Vector#removeElement(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Doesn't check negative case.",
-        method = "removeElement",
-        args = {java.lang.Object.class}
-    )
     public void test_removeElementLjava_lang_Object() {
         // Test for method boolean
         // java.util.Vector.removeElement(java.lang.Object)
@@ -1114,14 +886,8 @@
     }
 
     /**
-     * @tests java.util.Vector#removeElementAt(int)
+     * java.util.Vector#removeElementAt(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeElementAt",
-        args = {int.class}
-    )
     public void test_removeElementAtI() {
         // Test for method void java.util.Vector.removeElementAt(int)
         Vector v = vectorClone(tVector);
@@ -1148,14 +914,8 @@
     }
 
     /**
-     * @tests java.util.Vector#retainAll(java.util.Collection)
+     * java.util.Vector#retainAll(java.util.Collection)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "retainAll",
-        args = {java.util.Collection.class}
-    )
     public void test_retainAllLjava_util_Collection() {
         // Test for method boolean
         // java.util.Vector.retainAll(java.util.Collection)
@@ -1183,14 +943,8 @@
     }
 
     /**
-     * @tests java.util.Vector#set(int, java.lang.Object)
+     * java.util.Vector#set(int, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "set",
-        args = {int.class, java.lang.Object.class}
-    )
     public void test_setILjava_lang_Object() {
         // Test for method java.lang.Object java.util.Vector.set(int,
         // java.lang.Object)
@@ -1214,14 +968,8 @@
     }
 
     /**
-     * @tests java.util.Vector#setElementAt(java.lang.Object, int)
+     * java.util.Vector#setElementAt(java.lang.Object, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setElementAt",
-        args = {java.lang.Object.class, int.class}
-    )
     public void test_setElementAtLjava_lang_ObjectI() {
         // Test for method void java.util.Vector.setElementAt(java.lang.Object,
         // int)
@@ -1246,14 +994,8 @@
     }
 
     /**
-     * @tests java.util.Vector#setSize(int)
+     * java.util.Vector#setSize(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSize",
-        args = {int.class}
-    )
     public void test_setSizeI() {
         // Test for method void java.util.Vector.setSize(int)
         Vector v = vectorClone(tVector);
@@ -1269,14 +1011,8 @@
     }
 
     /**
-     * @tests java.util.Vector#size()
+     * java.util.Vector#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         // Test for method int java.util.Vector.size()
         assertEquals("Returned incorrect size", 100, tVector.size());
@@ -1309,14 +1045,8 @@
     }
 
     /**
-     * @tests java.util.Vector#subList(int, int)
+     * java.util.Vector#subList(int, int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "subList",
-        args = {int.class, int.class}
-    )
     public void test_subListII() {
         // Test for method java.util.List java.util.Vector.subList(int, int)
         List sl = tVector.subList(10, 25);
@@ -1351,14 +1081,8 @@
     }
 
     /**
-     * @tests java.util.Vector#toArray()
+     * java.util.Vector#toArray()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {}
-    )
     public void test_toArray() {
         // Test for method java.lang.Object [] java.util.Vector.toArray()
         assertTrue("Returned incorrect array", Arrays.equals(objArray, tVector
@@ -1366,14 +1090,8 @@
     }
 
     /**
-     * @tests java.util.Vector#toArray(java.lang.Object[])
+     * java.util.Vector#toArray(java.lang.Object[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toArray",
-        args = {java.lang.Object[].class}
-    )
     public void test_toArray$Ljava_lang_Object() {
         // Test for method java.lang.Object []
         // java.util.Vector.toArray(java.lang.Object [])
@@ -1405,14 +1123,8 @@
     }
 
     /**
-     * @tests java.util.Vector#toString()
+     * java.util.Vector#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         // Test for method java.lang.String java.util.Vector.toString()
         assertTrue("Incorrect String returned", tVector.toString().equals(
@@ -1429,14 +1141,8 @@
     }
 
     /**
-     * @tests java.util.Vector#trimToSize()
+     * java.util.Vector#trimToSize()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "trimToSize",
-        args = {}
-    )
     public void test_trimToSize() {
         // Test for method void java.util.Vector.trimToSize()
         Vector v = new Vector(10);
@@ -1452,12 +1158,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeRange",
-        args = {int.class, int.class}
-    )
     public void test_removeRangeII() {
         Mock_Vector mv = new Mock_Vector();
         mv.add("First");
diff --git a/luni/src/test/java/tests/api/java/util/WeakHashMapTest.java b/luni/src/test/java/tests/api/java/util/WeakHashMapTest.java
index 2ed2318..0e43bf6 100644
--- a/luni/src/test/java/tests/api/java/util/WeakHashMapTest.java
+++ b/luni/src/test/java/tests/api/java/util/WeakHashMapTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.java.util;
 
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.AbstractMap;
 import java.util.Arrays;
 import java.util.Collection;
@@ -33,7 +28,6 @@
 
 import tests.support.Support_MapTest2;
 
-@TestTargetClass(WeakHashMap.class)
 public class WeakHashMapTest extends junit.framework.TestCase {
     class MockMap extends AbstractMap {
         public Set entrySet() {
@@ -51,22 +45,8 @@
     WeakHashMap whm;
 
     /**
-     * @tests java.util.WeakHashMap#WeakHashMap()
+     * java.util.WeakHashMap#WeakHashMap()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "WeakHashMap",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "get",
-            args = {java.lang.Object.class}
-        )
-    })
     public void test_Constructor() {
         // Test for method java.util.WeakHashMap()
         new Support_MapTest2(new WeakHashMap()).runTest();
@@ -81,22 +61,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#WeakHashMap(int)
+     * java.util.WeakHashMap#WeakHashMap(int)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "WeakHashMap",
-            args = {int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "get",
-            args = {java.lang.Object.class}
-        )
-    })
     public void test_ConstructorI() {
         // Test for method java.util.WeakHashMap(int)
         whm = new WeakHashMap(50);
@@ -120,22 +86,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#WeakHashMap(int, float)
+     * java.util.WeakHashMap#WeakHashMap(int, float)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "WeakHashMap",
-            args = {int.class, float.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "get",
-            args = {java.lang.Object.class}
-        )
-    })
     public void test_ConstructorIF() {
         // Test for method java.util.WeakHashMap(int, float)
         whm = new WeakHashMap(50, 0.5f);
@@ -166,14 +118,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#WeakHashMap(java.util.Map)
+     * java.util.WeakHashMap#WeakHashMap(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "WeakHashMap",
-        args = {java.util.Map.class}
-    )
     public void test_ConstructorLjava_util_Map() {
         Map mockMap = new MockMap();
         WeakHashMap map = new WeakHashMap(mockMap);
@@ -188,22 +134,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#clear()
+     * java.util.WeakHashMap#clear()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "clear",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "get",
-            args = {java.lang.Object.class}
-        )
-    })
     public void test_clear() {
         // Test for method boolean java.util.WeakHashMap.clear()
         whm = new WeakHashMap();
@@ -218,14 +150,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#containsKey(java.lang.Object)
+     * java.util.WeakHashMap#containsKey(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsKey",
-        args = {java.lang.Object.class}
-    )
     public void test_containsKeyLjava_lang_Object() {
         // Test for method boolean java.util.WeakHashMap.containsKey()
         whm = new WeakHashMap();
@@ -239,14 +165,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#containsValue(java.lang.Object)
+     * java.util.WeakHashMap#containsValue(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "containsValue",
-        args = {java.lang.Object.class}
-    )
     public void test_containsValueLjava_lang_Object() {
         // Test for method boolean java.util.WeakHashMap.containsValue()
         whm = new WeakHashMap();
@@ -260,14 +180,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#entrySet()
+     * java.util.WeakHashMap#entrySet()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "entrySet",
-        args = {}
-    )
     public void test_entrySet() {
         // Test for method java.util.Set java.util.WeakHashMap.entrySet()
         whm = new WeakHashMap();
@@ -304,14 +218,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#isEmpty()
+     * java.util.WeakHashMap#isEmpty()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isEmpty",
-        args = {}
-    )
     public void test_isEmpty() {
         // Test for method boolean java.util.WeakHashMap.isEmpty()
         whm = new WeakHashMap();
@@ -324,14 +232,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#put(java.lang.Object, java.lang.Object)
+     * java.util.WeakHashMap#put(java.lang.Object, java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "put",
-        args = {java.lang.Object.class, java.lang.Object.class}
-    )
     public void test_putLjava_lang_ObjectLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.WeakHashMap.put(java.lang.Object, java.lang.Object)
@@ -344,14 +246,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#putAll(java.util.Map)
+     * java.util.WeakHashMap#putAll(java.util.Map)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "putAll",
-        args = {java.util.Map.class}
-    )
     public void test_putAllLjava_util_Map() {
         Map mockMap=new MockMap();
         WeakHashMap map = new WeakHashMap();
@@ -367,14 +263,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#remove(java.lang.Object)
+     * java.util.WeakHashMap#remove(java.lang.Object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "remove",
-        args = {java.lang.Object.class}
-    )
     public void test_removeLjava_lang_Object() {
         // Test for method java.lang.Object
         // java.util.WeakHashMap.remove(java.lang.Object)
@@ -390,36 +280,16 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#size()
+     * java.util.WeakHashMap#size()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "size",
-        args = {}
-    )
     public void test_size() {
         whm = new WeakHashMap();
         assertEquals(0, whm.size());
     }
 
     /**
-     * @tests java.util.WeakHashMap#keySet()
+     * java.util.WeakHashMap#keySet()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "keySet",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "size",
-            args = {}
-        )
-    })
     public void test_keySet() {
         // Test for method java.util.Set java.util.WeakHashMap.keySet()
         whm = new WeakHashMap();
@@ -454,22 +324,8 @@
     }
 
     /**
-     * @tests java.util.WeakHashMap#values()
+     * java.util.WeakHashMap#values()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "values",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "size",
-            args = {}
-        )
-    })
     public void test_values() {
         // Test for method java.util.Set java.util.WeakHashMap.values()
         whm = new WeakHashMap();
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AbstractExecutorServiceTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AbstractExecutorServiceTest.java
deleted file mode 100644
index a8db7ad..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AbstractExecutorServiceTest.java
+++ /dev/null
@@ -1,666 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.math.BigInteger;
-import java.security.*;
-
-public class AbstractExecutorServiceTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AbstractExecutorServiceTest.class);
-    }
-
-    /**
-     * A no-frills implementation of AbstractExecutorService, designed
-     * to test the submit methods only.
-     */
-    static class DirectExecutorService extends AbstractExecutorService {
-        public void execute(Runnable r) { r.run(); }
-        public void shutdown() { shutdown = true; }
-        public List<Runnable> shutdownNow() { shutdown = true; return Collections.EMPTY_LIST; }
-        public boolean isShutdown() { return shutdown; }
-        public boolean isTerminated() { return isShutdown(); }
-        public boolean awaitTermination(long timeout, TimeUnit unit) { return isShutdown(); }
-        private volatile boolean shutdown = false;
-    }
-
-    /**
-     * execute(runnable) runs it to completion
-     */
-    public void testExecuteRunnable() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        TrackedShortRunnable task = new TrackedShortRunnable();
-        assertFalse(task.done);
-        Future<?> future = e.submit(task);
-        future.get();
-        assertTrue(task.done);
-    }
-
-
-    /**
-     * Completed submit(callable) returns result
-     */
-    public void testSubmitCallable() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        Future<String> future = e.submit(new StringTask());
-        String result = future.get();
-        assertSame(TEST_STRING, result);
-    }
-
-    /**
-     * Completed submit(runnable) returns successfully
-     */
-    public void testSubmitRunnable() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        Future<?> future = e.submit(new NoOpRunnable());
-        future.get();
-        assertTrue(future.isDone());
-    }
-
-    /**
-     * Completed submit(runnable, result) returns result
-     */
-    public void testSubmitRunnable2() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
-        String result = future.get();
-        assertSame(TEST_STRING, result);
-    }
-
-
-    /**
-     * A submitted privileged action runs to completion
-     */
-    public void testSubmitPrivilegedAction() throws Exception {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                ExecutorService e = new DirectExecutorService();
-                Future future = e.submit(Executors.callable(new PrivilegedAction() {
-                    public Object run() {
-                        return TEST_STRING;
-                    }}));
-
-                assertSame(TEST_STRING, future.get());
-            }};
-
-        runWithPermissions(r,
-                           new RuntimePermission("getClassLoader"),
-                           new RuntimePermission("setContextClassLoader"),
-                           new RuntimePermission("modifyThread"));
-    }
-
-    /**
-     * A submitted privileged exception action runs to completion
-     */
-    public void testSubmitPrivilegedExceptionAction() throws Exception {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                ExecutorService e = new DirectExecutorService();
-                Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
-                    public Object run() {
-                        return TEST_STRING;
-                    }}));
-
-                assertSame(TEST_STRING, future.get());
-            }};
-
-        runWithPermissions(r);
-    }
-
-    /**
-     * A submitted failed privileged exception action reports exception
-     */
-    public void testSubmitFailedPrivilegedExceptionAction() throws Exception {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                ExecutorService e = new DirectExecutorService();
-                Future future = e.submit(Executors.callable(new PrivilegedExceptionAction() {
-                    public Object run() throws Exception {
-                        throw new IndexOutOfBoundsException();
-                    }}));
-
-                try {
-                    future.get();
-                    shouldThrow();
-                } catch (ExecutionException success) {
-                    assertTrue(success.getCause() instanceof IndexOutOfBoundsException);
-                }}};
-
-        runWithPermissions(r);
-    }
-
-    /**
-     * execute(null runnable) throws NPE
-     */
-    public void testExecuteNullRunnable() {
-        try {
-            ExecutorService e = new DirectExecutorService();
-            e.submit((Runnable) null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * submit(null callable) throws NPE
-     */
-    public void testSubmitNullCallable() {
-        try {
-            ExecutorService e = new DirectExecutorService();
-            e.submit((Callable) null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * submit(runnable) throws RejectedExecutionException if
-     * executor is saturated.
-     */
-    public void testExecute1() {
-        ThreadPoolExecutor p =
-            new ThreadPoolExecutor(1, 1,
-                                   60, TimeUnit.SECONDS,
-                                   new ArrayBlockingQueue<Runnable>(1));
-        try {
-            for (int i = 0; i < 2; ++i)
-                p.submit(new MediumRunnable());
-            for (int i = 0; i < 2; ++i) {
-                try {
-                    p.submit(new MediumRunnable());
-                    shouldThrow();
-                } catch (RejectedExecutionException success) {}
-            }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     * submit(callable) throws RejectedExecutionException
-     * if executor is saturated.
-     */
-    public void testExecute2() {
-        ThreadPoolExecutor p =
-            new ThreadPoolExecutor(1, 1,
-                                   60, TimeUnit.SECONDS,
-                                   new ArrayBlockingQueue<Runnable>(1));
-        try {
-            for (int i = 0; i < 2; ++i)
-                p.submit(new MediumRunnable());
-            for (int i = 0; i < 2; ++i) {
-                try {
-                    p.submit(new SmallCallable());
-                    shouldThrow();
-                } catch (RejectedExecutionException success) {}
-            }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-
-    /**
-     *  Blocking on submit(callable) throws InterruptedException if
-     *  caller interrupted.
-     */
-    public void testInterruptedSubmit() throws InterruptedException {
-        final ThreadPoolExecutor p = new ThreadPoolExecutor(1,1,60, TimeUnit.SECONDS, new ArrayBlockingQueue<Runnable>(10));
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws Exception {
-                p.submit(new CheckedCallable<Object>() {
-                             public Object realCall()
-                                 throws InterruptedException {
-                                 Thread.sleep(SMALL_DELAY_MS);
-                                 return null;
-                             }}).get();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        joinPool(p);
-    }
-
-    /**
-     *  get of submitted callable throws InterruptedException if callable
-     *  interrupted
-     */
-    public void testSubmitIE() throws InterruptedException {
-        final ThreadPoolExecutor p =
-            new ThreadPoolExecutor(1, 1,
-                                   60, TimeUnit.SECONDS,
-                                   new ArrayBlockingQueue<Runnable>(10));
-
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws Exception {
-                p.submit(new SmallCallable()).get();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        joinPool(p);
-    }
-
-    /**
-     *  get of submit(callable) throws ExecutionException if callable
-     *  throws exception
-     */
-    public void testSubmitEE() throws InterruptedException {
-        ThreadPoolExecutor p =
-            new ThreadPoolExecutor(1, 1,
-                                   60, TimeUnit.SECONDS,
-                                   new ArrayBlockingQueue<Runnable>(10));
-
-        Callable c = new Callable() {
-            public Object call() { return 5/0; }};
-
-        try {
-            p.submit(c).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof ArithmeticException);
-        }
-        joinPool(p);
-    }
-
-    /**
-     * invokeAny(null) throws NPE
-     */
-    public void testInvokeAny1()
-        throws InterruptedException, ExecutionException {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            e.invokeAny(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(empty collection) throws IAE
-     */
-    public void testInvokeAny2()
-        throws InterruptedException, ExecutionException {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws NPE if c has null elements
-     */
-    public void testInvokeAny3() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<Integer>> l = new ArrayList<Callable<Integer>>();
-        l.add(new Callable<Integer>() {
-                  public Integer call() { return 5/0; }});
-        l.add(null);
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws ExecutionException if no task in c completes
-     */
-    public void testInvokeAny4() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) returns result of some task in c if at least one completes
-     */
-    public void testInvokeAny5() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(null) throws NPE
-     */
-    public void testInvokeAll1() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            e.invokeAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(empty collection) returns empty collection
-     */
-    public void testInvokeAll2() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) throws NPE if c has null elements
-     */
-    public void testInvokeAll3() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of returned element of invokeAll(c) throws exception on failed task
-     */
-    public void testInvokeAll4() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new NPETask());
-            List<Future<String>> futures = e.invokeAll(l);
-            assertEquals(1, futures.size());
-            try {
-                futures.get(0).get();
-                shouldThrow();
-            } catch (ExecutionException success) {
-                assertTrue(success.getCause() instanceof NullPointerException);
-            }
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) returns results of all completed tasks in c
-     */
-    public void testInvokeAll5() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures = e.invokeAll(l);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-
-    /**
-     * timed invokeAny(null) throws NPE
-     */
-    public void testTimedInvokeAny1() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(null time unit) throws NPE
-     */
-    public void testTimedInvokeAnyNullTimeUnit() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(empty collection) throws IAE
-     */
-    public void testTimedInvokeAny2() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAny3() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<Integer>> l = new ArrayList<Callable<Integer>>();
-        l.add(new Callable<Integer>() {
-                  public Integer call() { return 5/0; }});
-        l.add(null);
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testTimedInvokeAny4() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) returns result of some task in c
-     */
-    public void testTimedInvokeAny5() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(null) throws NPE
-     */
-    public void testTimedInvokeAll1() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(null time unit) throws NPE
-     */
-    public void testTimedInvokeAllNullTimeUnit() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(empty collection) returns empty collection
-     */
-    public void testTimedInvokeAll2() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAll3() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of returned element of invokeAll(c) throws exception on failed task
-     */
-    public void testTimedInvokeAll4() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new NPETask());
-            List<Future<String>> futures =
-                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertEquals(1, futures.size());
-            try {
-                futures.get(0).get();
-                shouldThrow();
-            } catch (ExecutionException success) {
-                assertTrue(success.getCause() instanceof NullPointerException);
-            }
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) returns results of all completed tasks in c
-     */
-    public void testTimedInvokeAll5() throws Exception {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll cancels tasks not completed by timeout
-     */
-    public void testTimedInvokeAll6() throws InterruptedException {
-        ExecutorService e = new DirectExecutorService();
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, SMALL_DELAY_MS, MILLISECONDS);
-            assertEquals(3, futures.size());
-            Iterator<Future<String>> it = futures.iterator();
-            Future<String> f1 = it.next();
-            Future<String> f2 = it.next();
-            Future<String> f3 = it.next();
-            assertTrue(f1.isDone());
-            assertFalse(f1.isCancelled());
-            assertTrue(f2.isDone());
-            assertTrue(f3.isDone());
-            assertTrue(f3.isCancelled());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueueTest.java
deleted file mode 100644
index 9bb206b..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueueTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.locks.*;
-import java.io.*;
-
-public class AbstractQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AbstractQueueTest.class);
-    }
-
-    static class Succeed extends AbstractQueue<Integer> {
-        public boolean offer(Integer x) {
-            if (x == null) throw new NullPointerException();
-            return true;
-        }
-        public Integer peek() { return one; }
-        public Integer poll() { return one; }
-        public int size() { return 0; }
-        public Iterator iterator() { return null; } // not needed
-    }
-
-    static class Fail extends AbstractQueue<Integer> {
-        public boolean offer(Integer x) {
-            if (x == null) throw new NullPointerException();
-            return false;
-        }
-        public Integer peek() { return null; }
-        public Integer poll() { return null; }
-        public int size() { return 0; }
-        public Iterator iterator() { return null; } // not needed
-    }
-
-    /**
-     * add returns true if offer succeeds
-     */
-    public void testAddS() {
-        Succeed q = new Succeed();
-        assertTrue(q.add(two));
-    }
-
-    /**
-     * add throws ISE true if offer fails
-     */
-    public void testAddF() {
-        Fail q = new Fail();
-        try {
-            q.add(one);
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     * add throws NPE if offer does
-     */
-    public void testAddNPE() {
-        Succeed q = new Succeed();
-        try {
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove returns normally if poll succeeds
-     */
-    public void testRemoveS() {
-        Succeed q = new Succeed();
-        q.remove();
-    }
-
-    /**
-     * remove throws NSEE if poll returns null
-     */
-    public void testRemoveF() {
-        Fail q = new Fail();
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-
-    /**
-     * element returns normally if peek succeeds
-     */
-    public void testElementS() {
-        Succeed q = new Succeed();
-        q.element();
-    }
-
-    /**
-     * element throws NSEE if peek returns null
-     */
-    public void testElementF() {
-        Fail q = new Fail();
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     *  addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            Succeed q = new Succeed();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            Succeed q = new Succeed();
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-
-    /**
-     *  addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            Succeed q = new Succeed();
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            Succeed q = new Succeed();
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll throws ISE if an add fails
-     */
-    public void testAddAll4() {
-        try {
-            Fail q = new Fail();
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueuedLongSynchronizerTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueuedLongSynchronizerTest.java
deleted file mode 100644
index 43a4bd1..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueuedLongSynchronizerTest.java
+++ /dev/null
@@ -1,1025 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.locks.*;
-import java.io.*;
-
-public class AbstractQueuedLongSynchronizerTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AbstractQueuedLongSynchronizerTest.class);
-    }
-
-    /**
-     * A simple mutex class, adapted from the
-     * AbstractQueuedLongSynchronizer javadoc.  Exclusive acquire tests
-     * exercise this as a sample user extension.  Other
-     * methods/features of AbstractQueuedLongSynchronizerTest are tested
-     * via other test classes, including those for ReentrantLock,
-     * ReentrantReadWriteLock, and Semaphore
-     */
-    static class Mutex extends AbstractQueuedLongSynchronizer {
-        // Use value > 32 bits for locked state
-        static final long LOCKED = 1 << 48;
-        public boolean isHeldExclusively() {
-            return getState() == LOCKED;
-        }
-
-        public boolean tryAcquire(long acquires) {
-            return compareAndSetState(0, LOCKED);
-        }
-
-        public boolean tryRelease(long releases) {
-            if (getState() == 0) throw new IllegalMonitorStateException();
-            setState(0);
-            return true;
-        }
-
-        public AbstractQueuedLongSynchronizer.ConditionObject newCondition() { return new AbstractQueuedLongSynchronizer.ConditionObject(); }
-
-    }
-
-
-    /**
-     * A simple latch class, to test shared mode.
-     */
-    static class BooleanLatch extends AbstractQueuedLongSynchronizer {
-        public boolean isSignalled() { return getState() != 0; }
-
-        public long tryAcquireShared(long ignore) {
-            return isSignalled()? 1 : -1;
-        }
-
-        public boolean tryReleaseShared(long ignore) {
-            setState(1 << 62);
-            return true;
-        }
-    }
-
-    /**
-     * A runnable calling acquireInterruptibly that does not expect to
-     * be interrupted.
-     */
-    class InterruptibleSyncRunnable extends CheckedRunnable {
-        final Mutex sync;
-        InterruptibleSyncRunnable(Mutex l) { sync = l; }
-        public void realRun() throws InterruptedException {
-            sync.acquireInterruptibly(1);
-        }
-    }
-
-
-    /**
-     * A runnable calling acquireInterruptibly that expects to be
-     * interrupted.
-     */
-    class InterruptedSyncRunnable extends CheckedInterruptedRunnable {
-        final Mutex sync;
-        InterruptedSyncRunnable(Mutex l) { sync = l; }
-        public void realRun() throws InterruptedException {
-            sync.acquireInterruptibly(1);
-        }
-    }
-
-    /**
-     * isHeldExclusively is false upon construction
-     */
-    public void testIsHeldExclusively() {
-        Mutex rl = new Mutex();
-        assertFalse(rl.isHeldExclusively());
-    }
-
-    /**
-     * acquiring released sync succeeds
-     */
-    public void testAcquire() {
-        Mutex rl = new Mutex();
-        rl.acquire(1);
-        assertTrue(rl.isHeldExclusively());
-        rl.release(1);
-        assertFalse(rl.isHeldExclusively());
-    }
-
-    /**
-     * tryAcquire on an released sync succeeds
-     */
-    public void testTryAcquire() {
-        Mutex rl = new Mutex();
-        assertTrue(rl.tryAcquire(1));
-        assertTrue(rl.isHeldExclusively());
-        rl.release(1);
-    }
-
-    /**
-     * hasQueuedThreads reports whether there are waiting threads
-     */
-    public void testhasQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertFalse(sync.hasQueuedThreads());
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThreads());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThreads());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThreads());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThreads());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * isQueued(null) throws NPE
-     */
-    public void testIsQueuedNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.isQueued(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * isQueued reports whether a thread is queued.
-     */
-    public void testIsQueued() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertFalse(sync.isQueued(t1));
-        assertFalse(sync.isQueued(t2));
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.isQueued(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.isQueued(t1));
-        assertTrue(sync.isQueued(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.isQueued(t1));
-        assertTrue(sync.isQueued(t2));
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.isQueued(t1));
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.isQueued(t2));
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getFirstQueuedThread returns first waiting thread or null if none
-     */
-    public void testGetFirstQueuedThread() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertNull(sync.getFirstQueuedThread());
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(t1, sync.getFirstQueuedThread());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(t1, sync.getFirstQueuedThread());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(t2, sync.getFirstQueuedThread());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertNull(sync.getFirstQueuedThread());
-        t1.join();
-        t2.join();
-    }
-
-
-    /**
-     * hasContended reports false if no thread has ever blocked, else true
-     */
-    public void testHasContended() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertFalse(sync.hasContended());
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getQueuedThreads includes waiting threads
-     */
-    public void testGetQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertTrue(sync.getQueuedThreads().isEmpty());
-        sync.acquire(1);
-        assertTrue(sync.getQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getQueuedThreads().contains(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getQueuedThreads().contains(t1));
-        assertTrue(sync.getQueuedThreads().contains(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.getQueuedThreads().contains(t1));
-        assertTrue(sync.getQueuedThreads().contains(t2));
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getExclusiveQueuedThreads includes waiting threads
-     */
-    public void testGetExclusiveQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
-        sync.acquire(1);
-        assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t1));
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.getExclusiveQueuedThreads().contains(t1));
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t2));
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getSharedQueuedThreads does not include exclusively waiting threads
-     */
-    public void testGetSharedQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        sync.acquire(1);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * tryAcquireNanos is interruptible.
-     */
-    public void testInterruptedException2() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.tryAcquireNanos(1, MILLISECONDS.toNanos(MEDIUM_DELAY_MS));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * TryAcquire on exclusively held sync fails
-     */
-    public void testTryAcquireWhenSynced() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertFalse(sync.tryAcquire(1));
-            }});
-
-        t.start();
-        t.join();
-        sync.release(1);
-    }
-
-    /**
-     * tryAcquireNanos on an exclusively held sync times out
-     */
-    public void testAcquireNanos_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                long nanos = MILLISECONDS.toNanos(SHORT_DELAY_MS);
-                assertFalse(sync.tryAcquireNanos(1, nanos));
-            }});
-
-        t.start();
-        t.join();
-        sync.release(1);
-    }
-
-
-    /**
-     * getState is true when acquired and false when not
-     */
-    public void testGetState() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        assertTrue(sync.isHeldExclusively());
-        sync.release(1);
-        assertFalse(sync.isHeldExclusively());
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                Thread.sleep(SMALL_DELAY_MS);
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.isHeldExclusively());
-        t.join();
-        assertFalse(sync.isHeldExclusively());
-    }
-
-
-    /**
-     * acquireInterruptibly is interruptible.
-     */
-    public void testAcquireInterruptibly1() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new InterruptedSyncRunnable(sync));
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.release(1);
-        t.join();
-    }
-
-    /**
-     * acquireInterruptibly succeeds when released, else is interruptible
-     */
-    public void testAcquireInterruptibly2() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquireInterruptibly(1);
-        Thread t = new Thread(new InterruptedSyncRunnable(sync));
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        assertTrue(sync.isHeldExclusively());
-        t.join();
-    }
-
-    /**
-     * owns is true for a condition created by sync else false
-     */
-    public void testOwns() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        assertTrue(sync.owns(c));
-        assertFalse(sync2.owns(c));
-    }
-
-    /**
-     * Calling await without holding sync throws IllegalMonitorStateException
-     */
-    public void testAwait_IllegalMonitor() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            c.await();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * Calling signal without holding sync throws IllegalMonitorStateException
-     */
-    public void testSignal_IllegalMonitor() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            c.signal();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * awaitNanos without a signal times out
-     */
-    public void testAwaitNanos_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        sync.acquire(1);
-        long t = c.awaitNanos(100);
-        assertTrue(t <= 0);
-        sync.release(1);
-    }
-
-    /**
-     *  Timed await without a signal times out
-     */
-    public void testAwait_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        sync.acquire(1);
-        assertFalse(c.await(SHORT_DELAY_MS, MILLISECONDS));
-        sync.release(1);
-    }
-
-    /**
-     * awaitUntil without a signal times out
-     */
-    public void testAwaitUntil_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        sync.acquire(1);
-        java.util.Date d = new java.util.Date();
-        assertFalse(c.awaitUntil(new java.util.Date(d.getTime() + 10)));
-        sync.release(1);
-    }
-
-    /**
-     * await returns when signalled
-     */
-    public void testAwait() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        c.signal();
-        sync.release(1);
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-
-
-    /**
-     * hasWaiters throws NPE if null
-     */
-    public void testHasWaitersNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.hasWaiters(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws NPE if null
-     */
-    public void testGetWaitQueueLengthNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.getWaitQueueLength(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws NPE if null
-     */
-    public void testGetWaitingThreadsNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.getWaitingThreads(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * hasWaiters throws IAE if not owned
-     */
-    public void testHasWaitersIAE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        try {
-            sync2.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * hasWaiters throws IMSE if not synced
-     */
-    public void testHasWaitersIMSE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            sync.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitQueueLength throws IAE if not owned
-     */
-    public void testGetWaitQueueLengthIAE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        try {
-            sync2.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws IMSE if not synced
-     */
-    public void testGetWaitQueueLengthIMSE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            sync.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws IAE if not owned
-     */
-    public void testGetWaitingThreadsIAE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        try {
-            sync2.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitingThreads throws IMSE if not synced
-     */
-    public void testGetWaitingThreadsIMSE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            sync.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-
-    /**
-     * hasWaiters returns true when a thread is waiting, else false
-     */
-    public void testHasWaiters() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertFalse(sync.hasWaiters(c));
-                threadAssertEquals(0, sync.getWaitQueueLength(c));
-                c.await();
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertTrue(sync.hasWaiters(c));
-        assertEquals(1, sync.getWaitQueueLength(c));
-        c.signal();
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertFalse(sync.hasWaiters(c));
-        assertEquals(0, sync.getWaitQueueLength(c));
-        sync.release(1);
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * getWaitQueueLength returns number of waiting threads
-     */
-    public void testGetWaitQueueLength() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertFalse(sync.hasWaiters(c));
-                threadAssertEquals(0, sync.getWaitQueueLength(c));
-                c.await();
-                sync.release(1);
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertTrue(sync.hasWaiters(c));
-                threadAssertEquals(1, sync.getWaitQueueLength(c));
-                c.await();
-                sync.release(1);
-            }});
-
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertTrue(sync.hasWaiters(c));
-        assertEquals(2, sync.getWaitQueueLength(c));
-        c.signalAll();
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertFalse(sync.hasWaiters(c));
-        assertEquals(0, sync.getWaitQueueLength(c));
-        sync.release(1);
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /**
-     * getWaitingThreads returns only and all waiting threads
-     */
-    public void testGetWaitingThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertTrue(sync.getWaitingThreads(c).isEmpty());
-                c.await();
-                sync.release(1);
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertFalse(sync.getWaitingThreads(c).isEmpty());
-                c.await();
-                sync.release(1);
-            }});
-
-            sync.acquire(1);
-            assertTrue(sync.getWaitingThreads(c).isEmpty());
-            sync.release(1);
-            t1.start();
-            Thread.sleep(SHORT_DELAY_MS);
-            t2.start();
-            Thread.sleep(SHORT_DELAY_MS);
-            sync.acquire(1);
-            assertTrue(sync.hasWaiters(c));
-            assertTrue(sync.getWaitingThreads(c).contains(t1));
-            assertTrue(sync.getWaitingThreads(c).contains(t2));
-            c.signalAll();
-            sync.release(1);
-            Thread.sleep(SHORT_DELAY_MS);
-            sync.acquire(1);
-            assertFalse(sync.hasWaiters(c));
-            assertTrue(sync.getWaitingThreads(c).isEmpty());
-            sync.release(1);
-            t1.join(SHORT_DELAY_MS);
-            t2.join(SHORT_DELAY_MS);
-            assertFalse(t1.isAlive());
-            assertFalse(t2.isAlive());
-    }
-
-
-
-    /**
-     * awaitUninterruptibly doesn't abort on interrupt
-     */
-    public void testAwaitUninterruptibly() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                sync.acquire(1);
-                c.awaitUninterruptibly();
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        sync.acquire(1);
-        c.signal();
-        sync.release(1);
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * await is interruptible
-     */
-    public void testAwait_Interrupt() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitNanos is interruptible
-     */
-    public void testAwaitNanos_Interrupt() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.awaitNanos(MILLISECONDS.toNanos(LONG_DELAY_MS));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitUntil is interruptible
-     */
-    public void testAwaitUntil_Interrupt() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                java.util.Date d = new java.util.Date();
-                c.awaitUntil(new java.util.Date(d.getTime() + 10000));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * signalAll wakes up all threads
-     */
-    public void testSignalAll() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedLongSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-                sync.release(1);
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-                sync.release(1);
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        c.signalAll();
-        sync.release(1);
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-
-    /**
-     * toString indicates current state
-     */
-    public void testToString() {
-        Mutex sync = new Mutex();
-        String us = sync.toString();
-        assertTrue(us.indexOf("State = 0") >= 0);
-        sync.acquire(1);
-        String ls = sync.toString();
-        assertTrue(ls.indexOf("State = " + Mutex.LOCKED) >= 0);
-    }
-
-    /**
-     * A serialized AQS deserializes with current state
-     */
-    public void testSerialization() throws Exception {
-        Mutex l = new Mutex();
-        l.acquire(1);
-        assertTrue(l.isHeldExclusively());
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        Mutex r = (Mutex) in.readObject();
-        assertTrue(r.isHeldExclusively());
-    }
-
-
-    /**
-     * tryReleaseShared setting state changes getState
-     */
-    public void testGetStateWithReleaseShared() {
-        final BooleanLatch l = new BooleanLatch();
-        assertFalse(l.isSignalled());
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-    }
-
-    /**
-     * releaseShared has no effect when already signalled
-     */
-    public void testReleaseShared() {
-        final BooleanLatch l = new BooleanLatch();
-        assertFalse(l.isSignalled());
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-    }
-
-    /**
-     * acquireSharedInterruptibly returns after release, but not before
-     */
-    public void testAcquireSharedInterruptibly() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertFalse(l.isSignalled());
-                l.acquireSharedInterruptibly(0);
-                threadAssertTrue(l.isSignalled());
-            }});
-
-        t.start();
-        assertFalse(l.isSignalled());
-        Thread.sleep(SHORT_DELAY_MS);
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-        t.join();
-    }
-
-
-    /**
-     * acquireSharedTimed returns after release
-     */
-    public void testAsquireSharedTimed() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(l.isSignalled());
-                long nanos = MILLISECONDS.toNanos(MEDIUM_DELAY_MS);
-                assertTrue(l.tryAcquireSharedNanos(0, nanos));
-                assertTrue(l.isSignalled());
-            }});
-
-        t.start();
-        assertFalse(l.isSignalled());
-        Thread.sleep(SHORT_DELAY_MS);
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-        t.join();
-    }
-
-    /**
-     * acquireSharedInterruptibly throws IE if interrupted before released
-     */
-    public void testAcquireSharedInterruptibly_InterruptedException() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertFalse(l.isSignalled());
-                l.acquireSharedInterruptibly(0);
-            }});
-
-        t.start();
-        assertFalse(l.isSignalled());
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * acquireSharedTimed throws IE if interrupted before released
-     */
-    public void testAcquireSharedNanos_InterruptedException() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(l.isSignalled());
-                long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS);
-                l.tryAcquireSharedNanos(0, nanos);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(l.isSignalled());
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * acquireSharedTimed times out if not released before timeout
-     */
-    public void testAcquireSharedNanos_Timeout() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(l.isSignalled());
-                long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS);
-                assertFalse(l.tryAcquireSharedNanos(0, nanos));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(l.isSignalled());
-        t.join();
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueuedSynchronizerTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueuedSynchronizerTest.java
deleted file mode 100644
index a5b6554..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AbstractQueuedSynchronizerTest.java
+++ /dev/null
@@ -1,1023 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent;
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.locks.*;
-import java.io.*;
-
-public class AbstractQueuedSynchronizerTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AbstractQueuedSynchronizerTest.class);
-    }
-
-    /**
-     * A simple mutex class, adapted from the
-     * AbstractQueuedSynchronizer javadoc.  Exclusive acquire tests
-     * exercise this as a sample user extension.  Other
-     * methods/features of AbstractQueuedSynchronizerTest are tested
-     * via other test classes, including those for ReentrantLock,
-     * ReentrantReadWriteLock, and Semaphore
-     */
-    static class Mutex extends AbstractQueuedSynchronizer {
-        public boolean isHeldExclusively() { return getState() == 1; }
-
-        public boolean tryAcquire(int acquires) {
-            assertTrue(acquires == 1);
-            return compareAndSetState(0, 1);
-        }
-
-        public boolean tryRelease(int releases) {
-            if (getState() == 0) throw new IllegalMonitorStateException();
-            setState(0);
-            return true;
-        }
-
-        public AbstractQueuedSynchronizer.ConditionObject newCondition() { return new AbstractQueuedSynchronizer.ConditionObject(); }
-
-    }
-
-
-    /**
-     * A simple latch class, to test shared mode.
-     */
-    static class BooleanLatch extends AbstractQueuedSynchronizer {
-        public boolean isSignalled() { return getState() != 0; }
-
-        public int tryAcquireShared(int ignore) {
-            return isSignalled()? 1 : -1;
-        }
-
-        public boolean tryReleaseShared(int ignore) {
-            setState(1);
-            return true;
-        }
-    }
-
-    /**
-     * A runnable calling acquireInterruptibly that does not expect to
-     * be interrupted.
-     */
-    class InterruptibleSyncRunnable extends CheckedRunnable {
-        final Mutex sync;
-        InterruptibleSyncRunnable(Mutex l) { sync = l; }
-        public void realRun() throws InterruptedException {
-            sync.acquireInterruptibly(1);
-        }
-    }
-
-
-    /**
-     * A runnable calling acquireInterruptibly that expects to be
-     * interrupted.
-     */
-    class InterruptedSyncRunnable extends CheckedInterruptedRunnable {
-        final Mutex sync;
-        InterruptedSyncRunnable(Mutex l) { sync = l; }
-        public void realRun() throws InterruptedException {
-            sync.acquireInterruptibly(1);
-        }
-    }
-
-    /**
-     * isHeldExclusively is false upon construction
-     */
-    public void testIsHeldExclusively() {
-        Mutex rl = new Mutex();
-        assertFalse(rl.isHeldExclusively());
-    }
-
-    /**
-     * acquiring released sync succeeds
-     */
-    public void testAcquire() {
-        Mutex rl = new Mutex();
-        rl.acquire(1);
-        assertTrue(rl.isHeldExclusively());
-        rl.release(1);
-        assertFalse(rl.isHeldExclusively());
-    }
-
-    /**
-     * tryAcquire on an released sync succeeds
-     */
-    public void testTryAcquire() {
-        Mutex rl = new Mutex();
-        assertTrue(rl.tryAcquire(1));
-        assertTrue(rl.isHeldExclusively());
-        rl.release(1);
-    }
-
-    /**
-     * hasQueuedThreads reports whether there are waiting threads
-     */
-    public void testhasQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertFalse(sync.hasQueuedThreads());
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThreads());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThreads());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThreads());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThreads());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * isQueued(null) throws NPE
-     */
-    public void testIsQueuedNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.isQueued(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * isQueued reports whether a thread is queued.
-     */
-    public void testIsQueued() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertFalse(sync.isQueued(t1));
-        assertFalse(sync.isQueued(t2));
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.isQueued(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.isQueued(t1));
-        assertTrue(sync.isQueued(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.isQueued(t1));
-        assertTrue(sync.isQueued(t2));
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.isQueued(t1));
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.isQueued(t2));
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getFirstQueuedThread returns first waiting thread or null if none
-     */
-    public void testGetFirstQueuedThread() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertNull(sync.getFirstQueuedThread());
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(t1, sync.getFirstQueuedThread());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(t1, sync.getFirstQueuedThread());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(t2, sync.getFirstQueuedThread());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertNull(sync.getFirstQueuedThread());
-        t1.join();
-        t2.join();
-    }
-
-
-    /**
-     * hasContended reports false if no thread has ever blocked, else true
-     */
-    public void testHasContended() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertFalse(sync.hasContended());
-        sync.acquire(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasContended());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getQueuedThreads includes waiting threads
-     */
-    public void testGetQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertTrue(sync.getQueuedThreads().isEmpty());
-        sync.acquire(1);
-        assertTrue(sync.getQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getQueuedThreads().contains(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getQueuedThreads().contains(t1));
-        assertTrue(sync.getQueuedThreads().contains(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.getQueuedThreads().contains(t1));
-        assertTrue(sync.getQueuedThreads().contains(t2));
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getExclusiveQueuedThreads includes waiting threads
-     */
-    public void testGetExclusiveQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
-        sync.acquire(1);
-        assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t1));
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.getExclusiveQueuedThreads().contains(t1));
-        assertTrue(sync.getExclusiveQueuedThreads().contains(t2));
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getExclusiveQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getSharedQueuedThreads does not include exclusively waiting threads
-     */
-    public void testGetSharedQueuedThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        Thread t1 = new Thread(new InterruptedSyncRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleSyncRunnable(sync));
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        sync.acquire(1);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.getSharedQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * tryAcquireNanos is interruptible.
-     */
-    public void testInterruptedException2() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.tryAcquireNanos(1, MILLISECONDS.toNanos(MEDIUM_DELAY_MS));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * TryAcquire on exclusively held sync fails
-     */
-    public void testTryAcquireWhenSynced() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertFalse(sync.tryAcquire(1));
-            }});
-
-        t.start();
-        t.join();
-        sync.release(1);
-    }
-
-    /**
-     * tryAcquireNanos on an exclusively held sync times out
-     */
-    public void testAcquireNanos_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                long nanos = MILLISECONDS.toNanos(SHORT_DELAY_MS);
-                assertFalse(sync.tryAcquireNanos(1, nanos));
-            }});
-
-        t.start();
-        t.join();
-        sync.release(1);
-    }
-
-
-    /**
-     * getState is true when acquired and false when not
-     */
-    public void testGetState() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        assertTrue(sync.isHeldExclusively());
-        sync.release(1);
-        assertFalse(sync.isHeldExclusively());
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                Thread.sleep(SMALL_DELAY_MS);
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.isHeldExclusively());
-        t.join();
-        assertFalse(sync.isHeldExclusively());
-    }
-
-
-    /**
-     * acquireInterruptibly is interruptible.
-     */
-    public void testAcquireInterruptibly1() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquire(1);
-        Thread t = new Thread(new InterruptedSyncRunnable(sync));
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.release(1);
-        t.join();
-    }
-
-    /**
-     * acquireInterruptibly succeeds when released, else is interruptible
-     */
-    public void testAcquireInterruptibly2() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        sync.acquireInterruptibly(1);
-        Thread t = new Thread(new InterruptedSyncRunnable(sync));
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        assertTrue(sync.isHeldExclusively());
-        t.join();
-    }
-
-    /**
-     * owns is true for a condition created by sync else false
-     */
-    public void testOwns() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        assertTrue(sync.owns(c));
-        assertFalse(sync2.owns(c));
-    }
-
-    /**
-     * Calling await without holding sync throws IllegalMonitorStateException
-     */
-    public void testAwait_IllegalMonitor() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            c.await();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * Calling signal without holding sync throws IllegalMonitorStateException
-     */
-    public void testSignal_IllegalMonitor() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            c.signal();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * awaitNanos without a signal times out
-     */
-    public void testAwaitNanos_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        sync.acquire(1);
-        long t = c.awaitNanos(100);
-        assertTrue(t <= 0);
-        sync.release(1);
-    }
-
-    /**
-     *  Timed await without a signal times out
-     */
-    public void testAwait_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        sync.acquire(1);
-        assertFalse(c.await(SHORT_DELAY_MS, MILLISECONDS));
-        sync.release(1);
-    }
-
-    /**
-     * awaitUntil without a signal times out
-     */
-    public void testAwaitUntil_Timeout() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        sync.acquire(1);
-        java.util.Date d = new java.util.Date();
-        assertFalse(c.awaitUntil(new java.util.Date(d.getTime() + 10)));
-        sync.release(1);
-    }
-
-    /**
-     * await returns when signalled
-     */
-    public void testAwait() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        c.signal();
-        sync.release(1);
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-
-
-    /**
-     * hasWaiters throws NPE if null
-     */
-    public void testHasWaitersNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.hasWaiters(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws NPE if null
-     */
-    public void testGetWaitQueueLengthNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.getWaitQueueLength(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws NPE if null
-     */
-    public void testGetWaitingThreadsNPE() {
-        final Mutex sync = new Mutex();
-        try {
-            sync.getWaitingThreads(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * hasWaiters throws IAE if not owned
-     */
-    public void testHasWaitersIAE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        try {
-            sync2.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * hasWaiters throws IMSE if not synced
-     */
-    public void testHasWaitersIMSE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            sync.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitQueueLength throws IAE if not owned
-     */
-    public void testGetWaitQueueLengthIAE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        try {
-            sync2.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws IMSE if not synced
-     */
-    public void testGetWaitQueueLengthIMSE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            sync.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws IAE if not owned
-     */
-    public void testGetWaitingThreadsIAE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        final Mutex sync2 = new Mutex();
-        try {
-            sync2.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitingThreads throws IMSE if not synced
-     */
-    public void testGetWaitingThreadsIMSE() {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        try {
-            sync.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-
-    /**
-     * hasWaiters returns true when a thread is waiting, else false
-     */
-    public void testHasWaiters() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertFalse(sync.hasWaiters(c));
-                threadAssertEquals(0, sync.getWaitQueueLength(c));
-                c.await();
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertTrue(sync.hasWaiters(c));
-        assertEquals(1, sync.getWaitQueueLength(c));
-        c.signal();
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertFalse(sync.hasWaiters(c));
-        assertEquals(0, sync.getWaitQueueLength(c));
-        sync.release(1);
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * getWaitQueueLength returns number of waiting threads
-     */
-    public void testGetWaitQueueLength() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertFalse(sync.hasWaiters(c));
-                threadAssertEquals(0, sync.getWaitQueueLength(c));
-                c.await();
-                sync.release(1);
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertTrue(sync.hasWaiters(c));
-                threadAssertEquals(1, sync.getWaitQueueLength(c));
-                c.await();
-                sync.release(1);
-            }});
-
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertTrue(sync.hasWaiters(c));
-        assertEquals(2, sync.getWaitQueueLength(c));
-        c.signalAll();
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertFalse(sync.hasWaiters(c));
-        assertEquals(0, sync.getWaitQueueLength(c));
-        sync.release(1);
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /**
-     * getWaitingThreads returns only and all waiting threads
-     */
-    public void testGetWaitingThreads() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertTrue(sync.getWaitingThreads(c).isEmpty());
-                c.await();
-                sync.release(1);
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                threadAssertFalse(sync.getWaitingThreads(c).isEmpty());
-                c.await();
-                sync.release(1);
-            }});
-
-        sync.acquire(1);
-        assertTrue(sync.getWaitingThreads(c).isEmpty());
-        sync.release(1);
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertTrue(sync.hasWaiters(c));
-        assertTrue(sync.getWaitingThreads(c).contains(t1));
-        assertTrue(sync.getWaitingThreads(c).contains(t2));
-        c.signalAll();
-        sync.release(1);
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        assertFalse(sync.hasWaiters(c));
-        assertTrue(sync.getWaitingThreads(c).isEmpty());
-        sync.release(1);
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-
-
-    /**
-     * awaitUninterruptibly doesn't abort on interrupt
-     */
-    public void testAwaitUninterruptibly() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                sync.acquire(1);
-                c.awaitUninterruptibly();
-                sync.release(1);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        sync.acquire(1);
-        c.signal();
-        sync.release(1);
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * await is interruptible
-     */
-    public void testAwait_Interrupt() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitNanos is interruptible
-     */
-    public void testAwaitNanos_Interrupt() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.awaitNanos(MILLISECONDS.toNanos(LONG_DELAY_MS));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitUntil is interruptible
-     */
-    public void testAwaitUntil_Interrupt() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                java.util.Date d = new java.util.Date();
-                c.awaitUntil(new java.util.Date(d.getTime() + 10000));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * signalAll wakes up all threads
-     */
-    public void testSignalAll() throws InterruptedException {
-        final Mutex sync = new Mutex();
-        final AbstractQueuedSynchronizer.ConditionObject c = sync.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-                sync.release(1);
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                sync.acquire(1);
-                c.await();
-                sync.release(1);
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        sync.acquire(1);
-        c.signalAll();
-        sync.release(1);
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-
-    /**
-     * toString indicates current state
-     */
-    public void testToString() {
-        Mutex sync = new Mutex();
-        String us = sync.toString();
-        assertTrue(us.indexOf("State = 0") >= 0);
-        sync.acquire(1);
-        String ls = sync.toString();
-        assertTrue(ls.indexOf("State = 1") >= 0);
-    }
-
-    /**
-     * A serialized AQS deserializes with current state
-     */
-    public void testSerialization() throws Exception {
-        Mutex l = new Mutex();
-        l.acquire(1);
-        assertTrue(l.isHeldExclusively());
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        Mutex r = (Mutex) in.readObject();
-        assertTrue(r.isHeldExclusively());
-    }
-
-
-    /**
-     * tryReleaseShared setting state changes getState
-     */
-    public void testGetStateWithReleaseShared() {
-        final BooleanLatch l = new BooleanLatch();
-        assertFalse(l.isSignalled());
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-    }
-
-    /**
-     * releaseShared has no effect when already signalled
-     */
-    public void testReleaseShared() {
-        final BooleanLatch l = new BooleanLatch();
-        assertFalse(l.isSignalled());
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-    }
-
-    /**
-     * acquireSharedInterruptibly returns after release, but not before
-     */
-    public void testAcquireSharedInterruptibly() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertFalse(l.isSignalled());
-                l.acquireSharedInterruptibly(0);
-                threadAssertTrue(l.isSignalled());
-            }});
-
-        t.start();
-        assertFalse(l.isSignalled());
-        Thread.sleep(SHORT_DELAY_MS);
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-        t.join();
-    }
-
-
-    /**
-     * acquireSharedTimed returns after release
-     */
-    public void testAsquireSharedTimed() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(l.isSignalled());
-                long nanos = MILLISECONDS.toNanos(MEDIUM_DELAY_MS);
-                assertTrue(l.tryAcquireSharedNanos(0, nanos));
-                assertTrue(l.isSignalled());
-            }});
-
-        t.start();
-        assertFalse(l.isSignalled());
-        Thread.sleep(SHORT_DELAY_MS);
-        l.releaseShared(0);
-        assertTrue(l.isSignalled());
-        t.join();
-    }
-
-    /**
-     * acquireSharedInterruptibly throws IE if interrupted before released
-     */
-    public void testAcquireSharedInterruptibly_InterruptedException() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertFalse(l.isSignalled());
-                l.acquireSharedInterruptibly(0);
-            }});
-
-        t.start();
-        assertFalse(l.isSignalled());
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * acquireSharedTimed throws IE if interrupted before released
-     */
-    public void testAcquireSharedNanos_InterruptedException() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(l.isSignalled());
-                long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS);
-                l.tryAcquireSharedNanos(0, nanos);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(l.isSignalled());
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * acquireSharedTimed times out if not released before timeout
-     */
-    public void testAcquireSharedNanos_Timeout() throws InterruptedException {
-        final BooleanLatch l = new BooleanLatch();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(l.isSignalled());
-                long nanos = MILLISECONDS.toNanos(SMALL_DELAY_MS);
-                assertFalse(l.tryAcquireSharedNanos(0, nanos));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(l.isSignalled());
-        t.join();
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ArrayBlockingQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ArrayBlockingQueueTest.java
deleted file mode 100755
index 8fc5cb6..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ArrayBlockingQueueTest.java
+++ /dev/null
@@ -1,920 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-
-public class ArrayBlockingQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ArrayBlockingQueueTest.class);
-    }
-
-    /**
-     * Create a queue of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private ArrayBlockingQueue populatedQueue(int n) {
-        ArrayBlockingQueue q = new ArrayBlockingQueue(n);
-        assertTrue(q.isEmpty());
-        for (int i = 0; i < n; i++)
-            assertTrue(q.offer(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(0, q.remainingCapacity());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * A new queue has the indicated capacity
-     */
-    public void testConstructor1() {
-        assertEquals(SIZE, new ArrayBlockingQueue(SIZE).remainingCapacity());
-    }
-
-    /**
-     * Constructor throws IAE if capacity argument nonpositive
-     */
-    public void testConstructor2() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(1, true, null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE, false, Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE, false, Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from too large collection throws IAE
-     */
-    public void testConstructor6() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE; ++i)
-                ints[i] = new Integer(i);
-            ArrayBlockingQueue q = new ArrayBlockingQueue(1, false, Arrays.asList(ints));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-     */
-    public void testConstructor7() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE, true, Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * Queue transitions from empty to full when elements added
-     */
-    public void testEmptyFull() {
-        ArrayBlockingQueue q = new ArrayBlockingQueue(2);
-        assertTrue(q.isEmpty());
-        assertEquals(2, q.remainingCapacity());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        q.add(two);
-        assertFalse(q.isEmpty());
-        assertEquals(0, q.remainingCapacity());
-        assertFalse(q.offer(three));
-    }
-
-    /**
-     * remainingCapacity decreases on add, increases on remove
-     */
-    public void testRemainingCapacity() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remainingCapacity());
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.remainingCapacity());
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     *  offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(1);
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     *  add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(1);
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Offer succeeds if not full; fails if full
-     */
-    public void testOffer() {
-        ArrayBlockingQueue q = new ArrayBlockingQueue(1);
-        assertTrue(q.offer(zero));
-        assertFalse(q.offer(one));
-    }
-
-    /**
-     * add succeeds if not full; throws ISE if full
-     */
-    public void testAdd() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE);
-            for (int i = 0; i < SIZE; ++i) {
-                assertTrue(q.add(new Integer(i)));
-            }
-            assertEquals(0, q.remainingCapacity());
-            q.add(new Integer(SIZE));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     *  addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(1);
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            ArrayBlockingQueue q = populatedQueue(SIZE);
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-
-    /**
-     *  addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll throws ISE if not enough room
-     */
-    public void testAddAll4() {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(1);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-    /**
-     * Queue contains all elements, in traversal order, of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE);
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     *  put(null) throws NPE
-     */
-    public void testPutNull() throws InterruptedException {
-        try {
-            ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE);
-            q.put(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-     }
-
-    /**
-     * all elements successfully put are contained
-     */
-    public void testPut() throws InterruptedException {
-        ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            Integer I = new Integer(i);
-            q.put(I);
-            assertTrue(q.contains(I));
-        }
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * put blocks interruptibly if full
-     */
-    public void testBlockingPut() throws InterruptedException {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i)
-                    q.put(i);
-                assertEquals(SIZE, q.size());
-                assertEquals(0, q.remainingCapacity());
-                try {
-                    q.put(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(SIZE, q.size());
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * put blocks waiting for take when full
-     */
-    public void testPutWithTake() throws InterruptedException {
-        final int capacity = 2;
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(capacity);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < capacity + 1; i++)
-                    q.put(i);
-                try {
-                    q.put(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(q.remainingCapacity(), 0);
-        assertEquals(0, q.take());
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(q.remainingCapacity(), 0);
-    }
-
-    /**
-     * timed offer times out if full and elements not taken
-     */
-    public void testTimedOffer() throws InterruptedException {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new Object());
-                q.put(new Object());
-                assertFalse(q.offer(new Object(), SHORT_DELAY_MS/2, MILLISECONDS));
-                try {
-                    q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * take retrieves elements in FIFO order
-     */
-    public void testTake() throws InterruptedException {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.take());
-        }
-    }
-
-    /**
-     * take blocks interruptibly when empty
-     */
-    public void testTakeFromEmpty() throws InterruptedException {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(2);
-        Thread t = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws InterruptedException {
-                q.take();
-            }};
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * Take removes existing elements until empty, then blocks interruptibly
-     */
-    public void testBlockingTake() throws InterruptedException {
-        final ArrayBlockingQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.take());
-                }
-                try {
-                    q.take();
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     * timed pool with zero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll0() throws InterruptedException {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(0, MILLISECONDS));
-        }
-        assertNull(q.poll(0, MILLISECONDS));
-    }
-
-    /**
-     * timed pool with nonzero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll() throws InterruptedException {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));
-        }
-        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed poll throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPoll() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                ArrayBlockingQueue q = populatedQueue(SIZE);
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));;
-                }
-                try {
-                    q.poll(SMALL_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offer fails; after offer succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollWithOffer() throws InterruptedException {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peek());
-            assertEquals(i, q.poll());
-            assertTrue(q.peek() == null ||
-                       !q.peek().equals(i));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.element());
-            assertEquals(i, q.poll());
-        }
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remove());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            assertEquals(i, q.poll());
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        assertEquals(SIZE, q.remainingCapacity());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(one));
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        ArrayBlockingQueue p = new ArrayBlockingQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        ArrayBlockingQueue p = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            ArrayBlockingQueue q = populatedQueue(SIZE);
-            ArrayBlockingQueue p = populatedQueue(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     *  toArray contains all elements
-     */
-    public void testToArray() throws InterruptedException {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        Object[] o = q.toArray();
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.take());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() throws InterruptedException {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.take());
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * toArray with incompatible array type throws CCE
-     */
-    public void testToArray1_BadArg() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(new String[10]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() throws InterruptedException {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertEquals(it.next(), q.take());
-        }
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(3);
-        q.add(two);
-        q.add(one);
-        q.add(three);
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertSame(it.next(), one);
-        assertSame(it.next(), three);
-        assertFalse(it.hasNext());
-    }
-
-    /**
-     * iterator ordering is FIFO
-     */
-    public void testIteratorOrdering() {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(3);
-        q.add(one);
-        q.add(two);
-        q.add(three);
-
-        assertEquals("queue should be full", 0, q.remainingCapacity());
-
-        int k = 0;
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            assertEquals(++k, it.next());
-        }
-        assertEquals(3, k);
-    }
-
-    /**
-     * Modifications do not cause iterators to fail
-     */
-    public void testWeaklyConsistentIteration () {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(3);
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            q.remove();
-            it.next();
-        }
-        assertEquals(0, q.size());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-
-    /**
-     * offer transfers elements across Executor tasks
-     */
-    public void testOfferInExecutor() {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(2);
-        q.add(one);
-        q.add(two);
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(q.offer(three));
-                assertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS));
-                assertEquals(0, q.remainingCapacity());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                assertSame(one, q.take());
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * poll retrieves elements across Executor threads
-     */
-    public void testPollInExecutor() {
-        final ArrayBlockingQueue q = new ArrayBlockingQueue(2);
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll());
-                assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
-                assertTrue(q.isEmpty());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                q.put(one);
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * A deserialized serialized queue has same elements in same order
-     */
-    public void testSerialization() throws Exception {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ArrayBlockingQueue r = (ArrayBlockingQueue)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.remove(), r.remove());
-    }
-
-    /**
-     * drainTo(null) throws NPE
-     */
-    public void testDrainToNull() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this) throws IAE
-     */
-    public void testDrainToSelf() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c) empties queue into another collection c
-     */
-    public void testDrainTo() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        q.add(zero);
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(zero));
-        assertTrue(q.contains(one));
-        l.clear();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), 2);
-        for (int i = 0; i < 2; ++i)
-            assertEquals(l.get(i), new Integer(i));
-    }
-
-    /**
-     * drainTo empties full queue, unblocking a waiting put.
-     */
-    public void testDrainToWithActivePut() throws InterruptedException {
-        final ArrayBlockingQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new Integer(SIZE+1));
-            }});
-
-        t.start();
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertTrue(l.size() >= SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        t.join();
-        assertTrue(q.size() + l.size() >= SIZE);
-    }
-
-    /**
-     * drainTo(null, n) throws NPE
-     */
-    public void testDrainToNullN() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null, 0);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this, n) throws IAE
-     */
-    public void testDrainToSelfN() {
-        ArrayBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q, 0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c, n) empties first max {n, size} elements of queue into c
-     */
-    public void testDrainToN() {
-        ArrayBlockingQueue q = new ArrayBlockingQueue(SIZE*2);
-        for (int i = 0; i < SIZE + 2; ++i) {
-            for (int j = 0; j < SIZE; j++)
-                assertTrue(q.offer(new Integer(j)));
-            ArrayList l = new ArrayList();
-            q.drainTo(l, i);
-            int k = (i < SIZE)? i : SIZE;
-            assertEquals(l.size(), k);
-            assertEquals(q.size(), SIZE-k);
-            for (int j = 0; j < k; ++j)
-                assertEquals(l.get(j), new Integer(j));
-            while (q.poll() != null) ;
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ArrayDequeTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ArrayDequeTest.java
deleted file mode 100644
index cec1d58..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ArrayDequeTest.java
+++ /dev/null
@@ -1,630 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-public class ArrayDequeTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ArrayDequeTest.class);
-    }
-
-    /**
-     * Create a queue of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private ArrayDeque populatedDeque(int n) {
-        ArrayDeque q = new ArrayDeque();
-        assertTrue(q.isEmpty());
-        for (int i = 0; i < n; ++i)
-            assertTrue(q.offerLast(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * new queue is empty
-     */
-    public void testConstructor1() {
-        assertEquals(0, new ArrayDeque().size());
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            ArrayDeque q = new ArrayDeque((Collection)null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-
-     */
-    public void testConstructor6() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        ArrayDeque q = new ArrayDeque(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        ArrayDeque q = new ArrayDeque();
-        assertTrue(q.isEmpty());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.add(new Integer(2));
-        q.removeFirst();
-        q.removeFirst();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testSize() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.removeFirst();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * push(null) throws NPE
-     */
-    public void testPushNull() {
-        try {
-            ArrayDeque q = new ArrayDeque(1);
-            q.push(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * peekFirst returns element inserted with push
-     */
-    public void testPush() {
-        ArrayDeque q = populatedDeque(3);
-        q.pollLast();
-        q.push(four);
-        assertSame(four, q.peekFirst());
-    }
-
-    /**
-     *  pop removes next element, or throws NSEE if empty
-     */
-    public void testPop() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pop());
-        }
-        try {
-            q.pop();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferFirstNull() {
-        try {
-            ArrayDeque q = new ArrayDeque();
-            q.offerFirst(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * OfferFirst succeeds
-     */
-    public void testOfferFirst() {
-        ArrayDeque q = new ArrayDeque();
-        assertTrue(q.offerFirst(new Integer(0)));
-        assertTrue(q.offerFirst(new Integer(1)));
-    }
-
-    /**
-     * OfferLast succeeds
-     */
-    public void testOfferLast() {
-        ArrayDeque q = new ArrayDeque();
-        assertTrue(q.offerLast(new Integer(0)));
-        assertTrue(q.offerLast(new Integer(1)));
-    }
-
-    /**
-     * add succeeds
-     */
-    public void testAdd() {
-        ArrayDeque q = new ArrayDeque();
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            assertTrue(q.add(new Integer(i)));
-        }
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            ArrayDeque q = new ArrayDeque();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements, in traversal order, of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        ArrayDeque q = new ArrayDeque();
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     *  pollFirst succeeds unless empty
-     */
-    public void testPollFirst() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pollFirst());
-        }
-        assertNull(q.pollFirst());
-    }
-
-    /**
-     *  pollLast succeeds unless empty
-     */
-    public void testPollLast() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = SIZE-1; i >= 0; --i) {
-            assertEquals(i, q.pollLast());
-        }
-        assertNull(q.pollLast());
-    }
-
-    /**
-     *  poll succeeds unless empty
-     */
-    public void testPoll() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     *  remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remove());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     *  peekFirst returns next element, or null if empty
-     */
-    public void testPeekFirst() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peekFirst());
-            assertEquals(i, q.pollFirst());
-            assertTrue(q.peekFirst() == null ||
-                       !q.peekFirst().equals(i));
-        }
-        assertNull(q.peekFirst());
-    }
-
-    /**
-     *  peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peek());
-            assertEquals(i, q.poll());
-            assertTrue(q.peek() == null ||
-                       !q.peek().equals(i));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     *  peekLast returns next element, or null if empty
-     */
-    public void testPeekLast() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = SIZE-1; i >= 0; --i) {
-            assertEquals(i, q.peekLast());
-            assertEquals(i, q.pollLast());
-            assertTrue(q.peekLast() == null ||
-                       !q.peekLast().equals(i));
-        }
-        assertNull(q.peekLast());
-    }
-
-    /**
-     * getFirst returns next getFirst, or throws NSEE if empty
-     */
-    public void testFirstElement() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.getFirst());
-            assertEquals(i, q.pollFirst());
-        }
-        try {
-            q.getFirst();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     *  getLast returns next element, or throws NSEE if empty
-     */
-    public void testLastElement() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = SIZE-1; i >= 0; --i) {
-            assertEquals(i, q.getLast());
-            assertEquals(i, q.pollLast());
-        }
-        try {
-            q.getLast();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-        assertNull(q.peekLast());
-    }
-
-
-    /**
-     *  removeFirst removes next element, or throws NSEE if empty
-     */
-    public void testRemoveFirst() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.removeFirst());
-        }
-        try {
-            q.removeFirst();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * removeFirstOccurrence(x) removes x and returns true if present
-     */
-    public void testRemoveFirstOccurrence() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.removeFirstOccurrence(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.removeFirstOccurrence(new Integer(i)));
-            assertFalse(q.removeFirstOccurrence(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * removeLastOccurrence(x) removes x and returns true if present
-     */
-    public void testRemoveLastOccurrence() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.removeLastOccurrence(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.removeLastOccurrence(new Integer(i)));
-            assertFalse(q.removeLastOccurrence(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        ArrayDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            assertEquals(i, q.pollFirst());
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        ArrayDeque q = populatedDeque(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        assertTrue(q.add(new Integer(1)));
-        assertFalse(q.isEmpty());
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        ArrayDeque q = populatedDeque(SIZE);
-        ArrayDeque p = new ArrayDeque();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            assertTrue(p.add(new Integer(i)));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        ArrayDeque q = populatedDeque(SIZE);
-        ArrayDeque p = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            assertEquals(changed, (i > 0));
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.removeFirst();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            ArrayDeque q = populatedDeque(SIZE);
-            ArrayDeque p = populatedDeque(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                assertFalse(q.contains(p.removeFirst()));
-            }
-        }
-    }
-
-    /**
-     *  toArray contains all elements
-     */
-    public void testToArray() {
-        ArrayDeque q = populatedDeque(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.pollFirst());
-    }
-
-    /**
-     *  toArray(a) contains all elements
-     */
-    public void testToArray2() {
-        ArrayDeque q = populatedDeque(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        ArrayDeque l = new ArrayDeque();
-        l.add(new Object());
-        try {
-            Object o[] = l.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * toArray with incompatible array type throws CCE
-     */
-    public void testToArray1_BadArg() {
-        ArrayDeque l = new ArrayDeque();
-        l.add(new Integer(5));
-        try {
-            Object o[] = l.toArray(new String[10]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-    /**
-     *  iterator iterates through all elements
-     */
-    public void testIterator() {
-        ArrayDeque q = populatedDeque(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     *  iterator ordering is FIFO
-     */
-    public void testIteratorOrdering() {
-        final ArrayDeque q = new ArrayDeque();
-        q.add(new Integer(1));
-        q.add(new Integer(2));
-        q.add(new Integer(3));
-        int k = 0;
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            assertEquals(++k, it.next());
-        }
-
-        assertEquals(3, k);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final ArrayDeque q = new ArrayDeque();
-        final Random rng = new Random();
-        for (int iters = 0; iters < 100; ++iters) {
-            int max = rng.nextInt(5) + 2;
-            int split = rng.nextInt(max-1) + 1;
-            for (int j = 1; j <= max; ++j)
-                q.add(new Integer(j));
-            Iterator it = q.iterator();
-            for (int j = 1; j <= split; ++j)
-                assertEquals(it.next(), new Integer(j));
-            it.remove();
-            assertEquals(it.next(), new Integer(split+1));
-            for (int j = 1; j <= split; ++j)
-                q.remove(new Integer(j));
-            it = q.iterator();
-            for (int j = split+1; j <= max; ++j) {
-                assertEquals(it.next(), new Integer(j));
-                it.remove();
-            }
-            assertFalse(it.hasNext());
-            assertTrue(q.isEmpty());
-        }
-    }
-
-    /**
-     *  Descending iterator iterates through all elements
-     */
-    public void testDescendingIterator() {
-        ArrayDeque q = populatedDeque(SIZE);
-        int i = 0;
-        Iterator it = q.descendingIterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-        assertFalse(it.hasNext());
-        try {
-            it.next();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     *  Descending iterator ordering is reverse FIFO
-     */
-    public void testDescendingIteratorOrdering() {
-        final ArrayDeque q = new ArrayDeque();
-        for (int iters = 0; iters < 100; ++iters) {
-            q.add(new Integer(3));
-            q.add(new Integer(2));
-            q.add(new Integer(1));
-            int k = 0;
-            for (Iterator it = q.descendingIterator(); it.hasNext();) {
-                assertEquals(++k, it.next());
-            }
-
-            assertEquals(3, k);
-            q.remove();
-            q.remove();
-            q.remove();
-        }
-    }
-
-    /**
-     * descendingIterator.remove removes current element
-     */
-    public void testDescendingIteratorRemove () {
-        final ArrayDeque q = new ArrayDeque();
-        final Random rng = new Random();
-        for (int iters = 0; iters < 100; ++iters) {
-            int max = rng.nextInt(5) + 2;
-            int split = rng.nextInt(max-1) + 1;
-            for (int j = max; j >= 1; --j)
-                q.add(new Integer(j));
-            Iterator it = q.descendingIterator();
-            for (int j = 1; j <= split; ++j)
-                assertEquals(it.next(), new Integer(j));
-            it.remove();
-            assertEquals(it.next(), new Integer(split+1));
-            for (int j = 1; j <= split; ++j)
-                q.remove(new Integer(j));
-            it = q.descendingIterator();
-            for (int j = split+1; j <= max; ++j) {
-                assertEquals(it.next(), new Integer(j));
-                it.remove();
-            }
-            assertFalse(it.hasNext());
-            assertTrue(q.isEmpty());
-        }
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        ArrayDeque q = populatedDeque(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * peekFirst returns element inserted with addFirst
-     */
-    public void testAddFirst() {
-        ArrayDeque q = populatedDeque(3);
-        q.addFirst(four);
-        assertSame(four, q.peekFirst());
-    }
-
-    /**
-     * peekLast returns element inserted with addLast
-     */
-    public void testAddLast() {
-        ArrayDeque q = populatedDeque(3);
-        q.addLast(four);
-        assertSame(four, q.peekLast());
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicBooleanTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicBooleanTest.java
deleted file mode 100755
index b2d91b8..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicBooleanTest.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-import java.io.*;
-
-public class AtomicBooleanTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicBooleanTest.class);
-    }
-
-    /**
-     * constructor initializes to given value
-     */
-    public void testConstructor() {
-        assertTrue(new AtomicBoolean(true).get());
-        assertFalse(new AtomicBoolean(false).get());
-    }
-
-    /**
-     * default constructed initializes to false
-     */
-    public void testConstructor2() {
-        AtomicBoolean ai = new AtomicBoolean();
-        assertFalse(ai.get());
-    }
-
-    /**
-     * get returns the last value set
-     */
-    public void testGetSet() {
-        AtomicBoolean ai = new AtomicBoolean(true);
-        assertTrue(ai.get());
-        ai.set(false);
-        assertFalse(ai.get());
-        ai.set(true);
-        assertTrue(ai.get());
-    }
-
-    /**
-     * get returns the last value lazySet in same thread
-     */
-    public void testGetLazySet() {
-        AtomicBoolean ai = new AtomicBoolean(true);
-        assertTrue(ai.get());
-        ai.lazySet(false);
-        assertFalse(ai.get());
-        ai.lazySet(true);
-        assertTrue(ai.get());
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicBoolean ai = new AtomicBoolean(true);
-        assertTrue(ai.compareAndSet(true,false));
-        assertFalse(ai.get());
-        assertTrue(ai.compareAndSet(false,false));
-        assertFalse(ai.get());
-        assertFalse(ai.compareAndSet(true,false));
-        assertFalse(ai.get());
-        assertTrue(ai.compareAndSet(false,true));
-        assertTrue(ai.get());
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        final AtomicBoolean ai = new AtomicBoolean(true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(false, true)) Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(true, false));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicBoolean ai = new AtomicBoolean(true);
-        while (!ai.weakCompareAndSet(true,false));
-        assertFalse(ai.get());
-        while (!ai.weakCompareAndSet(false,false));
-        assertFalse(ai.get());
-        while (!ai.weakCompareAndSet(false,true));
-        assertTrue(ai.get());
-    }
-
-    /**
-     * getAndSet returns previous value and sets to given value
-     */
-    public void testGetAndSet() {
-        AtomicBoolean ai = new AtomicBoolean(true);
-        assertEquals(true,ai.getAndSet(false));
-        assertEquals(false,ai.getAndSet(false));
-        assertEquals(false,ai.getAndSet(true));
-        assertTrue(ai.get());
-    }
-
-    /**
-     * a deserialized serialized atomic holds same value
-     */
-    public void testSerialization() throws Exception {
-        AtomicBoolean l = new AtomicBoolean();
-
-        l.set(true);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        AtomicBoolean r = (AtomicBoolean) in.readObject();
-        assertEquals(l.get(), r.get());
-    }
-
-    /**
-     * toString returns current value.
-     */
-    public void testToString() {
-        AtomicBoolean ai = new AtomicBoolean();
-        assertEquals(ai.toString(), Boolean.toString(false));
-        ai.set(true);
-        assertEquals(ai.toString(), Boolean.toString(true));
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerArrayTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerArrayTest.java
deleted file mode 100644
index 838296d..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerArrayTest.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-import java.io.*;
-import java.util.*;
-
-public class AtomicIntegerArrayTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicIntegerArrayTest.class);
-    }
-
-
-    /**
-     * constructor creates array of given size with all elements zero
-     */
-    public void testConstructor() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(0,ai.get(i));
-    }
-
-    /**
-     * constructor with null array throws NPE
-     */
-    public void testConstructor2NPE() {
-        try {
-            int[] a = null;
-            AtomicIntegerArray ai = new AtomicIntegerArray(a);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * constructor with array is of same size and has all elements
-     */
-    public void testConstructor2() {
-        int[] a = { 17, 3, -42, 99, -7};
-        AtomicIntegerArray ai = new AtomicIntegerArray(a);
-        assertEquals(a.length, ai.length());
-        for (int i = 0; i < a.length; ++i)
-            assertEquals(a[i], ai.get(i));
-    }
-
-    /**
-     * get and set for out of bound indices throw IndexOutOfBoundsException
-     */
-    public void testIndexing() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        try {
-            ai.get(SIZE);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.get(-1);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.set(SIZE, 0);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.set(-1, 0);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-    }
-
-    /**
-     * get returns the last value set at index
-     */
-    public void testGetSet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.get(i));
-            ai.set(i, 2);
-            assertEquals(2,ai.get(i));
-            ai.set(i, -3);
-            assertEquals(-3,ai.get(i));
-        }
-    }
-
-    /**
-     * get returns the last value lazySet at index by same thread
-     */
-    public void testGetLazySet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.lazySet(i, 1);
-            assertEquals(1,ai.get(i));
-            ai.lazySet(i, 2);
-            assertEquals(2,ai.get(i));
-            ai.lazySet(i, -3);
-            assertEquals(-3,ai.get(i));
-        }
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertTrue(ai.compareAndSet(i, 1,2));
-            assertTrue(ai.compareAndSet(i, 2,-4));
-            assertEquals(-4,ai.get(i));
-            assertFalse(ai.compareAndSet(i, -5,7));
-            assertEquals(-4,ai.get(i));
-            assertTrue(ai.compareAndSet(i, -4,7));
-            assertEquals(7,ai.get(i));
-        }
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        final AtomicIntegerArray a = new AtomicIntegerArray(1);
-        a.set(0, 1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!a.compareAndSet(0, 2, 3))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(a.compareAndSet(0, 1, 2));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertEquals(a.get(0), 3);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            while (!ai.weakCompareAndSet(i, 1,2));
-            while (!ai.weakCompareAndSet(i, 2,-4));
-            assertEquals(-4,ai.get(i));
-            while (!ai.weakCompareAndSet(i, -4,7));
-            assertEquals(7,ai.get(i));
-        }
-    }
-
-    /**
-     *  getAndSet returns previous value and sets to given value at given index
-     */
-    public void testGetAndSet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndSet(i,0));
-            assertEquals(0,ai.getAndSet(i,-10));
-            assertEquals(-10,ai.getAndSet(i,1));
-        }
-    }
-
-    /**
-     *  getAndAdd returns previous value and adds given value
-     */
-    public void testGetAndAdd() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndAdd(i,2));
-            assertEquals(3,ai.get(i));
-            assertEquals(3,ai.getAndAdd(i,-4));
-            assertEquals(-1,ai.get(i));
-        }
-    }
-
-    /**
-     * getAndDecrement returns previous value and decrements
-     */
-    public void testGetAndDecrement() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndDecrement(i));
-            assertEquals(0,ai.getAndDecrement(i));
-            assertEquals(-1,ai.getAndDecrement(i));
-        }
-    }
-
-    /**
-     * getAndIncrement returns previous value and increments
-     */
-    public void testGetAndIncrement() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndIncrement(i));
-            assertEquals(2,ai.get(i));
-            ai.set(i,-2);
-            assertEquals(-2,ai.getAndIncrement(i));
-            assertEquals(-1,ai.getAndIncrement(i));
-            assertEquals(0,ai.getAndIncrement(i));
-            assertEquals(1,ai.get(i));
-        }
-    }
-
-    /**
-     *  addAndGet adds given value to current, and returns current value
-     */
-    public void testAddAndGet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(3,ai.addAndGet(i,2));
-            assertEquals(3,ai.get(i));
-            assertEquals(-1,ai.addAndGet(i,-4));
-            assertEquals(-1,ai.get(i));
-        }
-    }
-
-    /**
-     * decrementAndGet decrements and returns current value
-     */
-    public void testDecrementAndGet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(0,ai.decrementAndGet(i));
-            assertEquals(-1,ai.decrementAndGet(i));
-            assertEquals(-2,ai.decrementAndGet(i));
-            assertEquals(-2,ai.get(i));
-        }
-    }
-
-    /**
-     *  incrementAndGet increments and returns current value
-     */
-    public void testIncrementAndGet() {
-        AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(2,ai.incrementAndGet(i));
-            assertEquals(2,ai.get(i));
-            ai.set(i, -2);
-            assertEquals(-1,ai.incrementAndGet(i));
-            assertEquals(0,ai.incrementAndGet(i));
-            assertEquals(1,ai.incrementAndGet(i));
-            assertEquals(1,ai.get(i));
-        }
-    }
-
-    static final int COUNTDOWN = 100000;
-
-    class Counter implements Runnable {
-        final AtomicIntegerArray ai;
-        volatile int counts;
-        Counter(AtomicIntegerArray a) { ai = a; }
-        public void run() {
-            for (;;) {
-                boolean done = true;
-                for (int i = 0; i < ai.length(); ++i) {
-                    int v = ai.get(i);
-                    threadAssertTrue(v >= 0);
-                    if (v != 0) {
-                        done = false;
-                        if (ai.compareAndSet(i, v, v-1))
-                            ++counts;
-                    }
-                }
-                if (done)
-                    break;
-            }
-        }
-    }
-
-    /**
-     * Multiple threads using same array of counters successfully
-     * update a number of times equal to total count
-     */
-    public void testCountingInMultipleThreads() throws InterruptedException {
-        final AtomicIntegerArray ai = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            ai.set(i, COUNTDOWN);
-        Counter c1 = new Counter(ai);
-        Counter c2 = new Counter(ai);
-        Thread t1 = new Thread(c1);
-        Thread t2 = new Thread(c2);
-        t1.start();
-        t2.start();
-        t1.join();
-        t2.join();
-        assertEquals(c1.counts+c2.counts, SIZE * COUNTDOWN);
-    }
-
-
-    /**
-     * a deserialized serialized array holds same values
-     */
-    public void testSerialization() throws Exception {
-        AtomicIntegerArray l = new AtomicIntegerArray(SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            l.set(i, -i);
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        AtomicIntegerArray r = (AtomicIntegerArray) in.readObject();
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(l.get(i), r.get(i));
-        }
-    }
-
-
-    /**
-     * toString returns current value.
-     */
-    public void testToString() {
-        int[] a = { 17, 3, -42, 99, -7};
-        AtomicIntegerArray ai = new AtomicIntegerArray(a);
-        assertEquals(Arrays.toString(a), ai.toString());
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerFieldUpdaterTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerFieldUpdaterTest.java
deleted file mode 100755
index 383e30b..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerFieldUpdaterTest.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import java.util.concurrent.atomic.*;
-import junit.framework.*;
-import java.util.*;
-
-public class AtomicIntegerFieldUpdaterTest extends JSR166TestCase {
-    volatile int x = 0;
-    int w;
-    long z;
-    public static Test suite() {
-        return new TestSuite(AtomicIntegerFieldUpdaterTest.class);
-    }
-
-    /**
-     * Construction with non-existent field throws RuntimeException
-     */
-    public void testConstructor() {
-        try {
-            AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest>
-                a = AtomicIntegerFieldUpdater.newUpdater
-                (AtomicIntegerFieldUpdaterTest.class, "y");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     * construction with field not of given type throws RuntimeException
-     */
-    public void testConstructor2() {
-        try {
-            AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest>
-                a = AtomicIntegerFieldUpdater.newUpdater
-                (AtomicIntegerFieldUpdaterTest.class, "z");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     * construction with non-volatile field throws RuntimeException
-     */
-    public void testConstructor3() {
-        try {
-            AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest>
-                a = AtomicIntegerFieldUpdater.newUpdater
-                (AtomicIntegerFieldUpdaterTest.class, "w");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     *  get returns the last value set or assigned
-     */
-    public void testGetSet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.get(this));
-        a.set(this,2);
-        assertEquals(2,a.get(this));
-        a.set(this,-3);
-        assertEquals(-3,a.get(this));
-    }
-
-    /**
-     *  get returns the last value lazySet by same thread
-     */
-    public void testGetLazySet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.get(this));
-        a.lazySet(this,2);
-        assertEquals(2,a.get(this));
-        a.lazySet(this,-3);
-        assertEquals(-3,a.get(this));
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertTrue(a.compareAndSet(this,1,2));
-        assertTrue(a.compareAndSet(this,2,-4));
-        assertEquals(-4,a.get(this));
-        assertFalse(a.compareAndSet(this,-5,7));
-        assertEquals(-4,a.get(this));
-        assertTrue(a.compareAndSet(this,-4,7));
-        assertEquals(7,a.get(this));
-    }
-
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        x = 1;
-        final AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest>a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!a.compareAndSet(AtomicIntegerFieldUpdaterTest.this, 2, 3))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(a.compareAndSet(this, 1, 2));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertEquals(a.get(this), 3);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        while (!a.weakCompareAndSet(this,1,2));
-        while (!a.weakCompareAndSet(this,2,-4));
-        assertEquals(-4,a.get(this));
-        while (!a.weakCompareAndSet(this,-4,7));
-        assertEquals(7,a.get(this));
-    }
-
-    /**
-     *  getAndSet returns previous value and sets to given value
-     */
-    public void testGetAndSet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndSet(this, 0));
-        assertEquals(0,a.getAndSet(this,-10));
-        assertEquals(-10,a.getAndSet(this,1));
-    }
-
-    /**
-     * getAndAdd returns previous value and adds given value
-     */
-    public void testGetAndAdd() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndAdd(this,2));
-        assertEquals(3,a.get(this));
-        assertEquals(3,a.getAndAdd(this,-4));
-        assertEquals(-1,a.get(this));
-    }
-
-    /**
-     * getAndDecrement returns previous value and decrements
-     */
-    public void testGetAndDecrement() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndDecrement(this));
-        assertEquals(0,a.getAndDecrement(this));
-        assertEquals(-1,a.getAndDecrement(this));
-    }
-
-    /**
-     * getAndIncrement returns previous value and increments
-     */
-    public void testGetAndIncrement() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndIncrement(this));
-        assertEquals(2,a.get(this));
-        a.set(this,-2);
-        assertEquals(-2,a.getAndIncrement(this));
-        assertEquals(-1,a.getAndIncrement(this));
-        assertEquals(0,a.getAndIncrement(this));
-        assertEquals(1,a.get(this));
-    }
-
-    /**
-     * addAndGet adds given value to current, and returns current value
-     */
-    public void testAddAndGet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(3,a.addAndGet(this,2));
-        assertEquals(3,a.get(this));
-        assertEquals(-1,a.addAndGet(this,-4));
-        assertEquals(-1,a.get(this));
-    }
-
-    /**
-     * decrementAndGet decrements and returns current value
-     */
-    public void testDecrementAndGet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(0,a.decrementAndGet(this));
-        assertEquals(-1,a.decrementAndGet(this));
-        assertEquals(-2,a.decrementAndGet(this));
-        assertEquals(-2,a.get(this));
-    }
-
-    /**
-     * incrementAndGet increments and returns current value
-     */
-    public void testIncrementAndGet() {
-        AtomicIntegerFieldUpdater<AtomicIntegerFieldUpdaterTest> a;
-        try {
-            a = AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(2,a.incrementAndGet(this));
-        assertEquals(2,a.get(this));
-        a.set(this,-2);
-        assertEquals(-1,a.incrementAndGet(this));
-        assertEquals(0,a.incrementAndGet(this));
-        assertEquals(1,a.incrementAndGet(this));
-        assertEquals(1,a.get(this));
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerTest.java
deleted file mode 100755
index a2f3b4b..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicIntegerTest.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-import java.io.*;
-
-public class AtomicIntegerTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicIntegerTest.class);
-    }
-
-    final int[] VALUES = {
-        Integer.MIN_VALUE, -1, 0, 1, 42, Integer.MAX_VALUE,
-    };
-
-    /**
-     * constructor initializes to given value
-     */
-    public void testConstructor() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(1,ai.get());
-    }
-
-    /**
-     * default constructed initializes to zero
-     */
-    public void testConstructor2() {
-        AtomicInteger ai = new AtomicInteger();
-        assertEquals(0,ai.get());
-    }
-
-    /**
-     * get returns the last value set
-     */
-    public void testGetSet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(1,ai.get());
-        ai.set(2);
-        assertEquals(2,ai.get());
-        ai.set(-3);
-        assertEquals(-3,ai.get());
-    }
-
-    /**
-     * get returns the last value lazySet in same thread
-     */
-    public void testGetLazySet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(1,ai.get());
-        ai.lazySet(2);
-        assertEquals(2,ai.get());
-        ai.lazySet(-3);
-        assertEquals(-3,ai.get());
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertTrue(ai.compareAndSet(1,2));
-        assertTrue(ai.compareAndSet(2,-4));
-        assertEquals(-4,ai.get());
-        assertFalse(ai.compareAndSet(-5,7));
-        assertEquals(-4,ai.get());
-        assertTrue(ai.compareAndSet(-4,7));
-        assertEquals(7,ai.get());
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        final AtomicInteger ai = new AtomicInteger(1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(2, 3))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(1, 2));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertEquals(ai.get(), 3);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        while (!ai.weakCompareAndSet(1,2));
-        while (!ai.weakCompareAndSet(2,-4));
-        assertEquals(-4,ai.get());
-        while (!ai.weakCompareAndSet(-4,7));
-        assertEquals(7,ai.get());
-    }
-
-    /**
-     * getAndSet returns previous value and sets to given value
-     */
-    public void testGetAndSet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(1,ai.getAndSet(0));
-        assertEquals(0,ai.getAndSet(-10));
-        assertEquals(-10,ai.getAndSet(1));
-    }
-
-    /**
-     * getAndAdd returns previous value and adds given value
-     */
-    public void testGetAndAdd() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(1,ai.getAndAdd(2));
-        assertEquals(3,ai.get());
-        assertEquals(3,ai.getAndAdd(-4));
-        assertEquals(-1,ai.get());
-    }
-
-    /**
-     * getAndDecrement returns previous value and decrements
-     */
-    public void testGetAndDecrement() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(1,ai.getAndDecrement());
-        assertEquals(0,ai.getAndDecrement());
-        assertEquals(-1,ai.getAndDecrement());
-    }
-
-    /**
-     * getAndIncrement returns previous value and increments
-     */
-    public void testGetAndIncrement() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(1,ai.getAndIncrement());
-        assertEquals(2,ai.get());
-        ai.set(-2);
-        assertEquals(-2,ai.getAndIncrement());
-        assertEquals(-1,ai.getAndIncrement());
-        assertEquals(0,ai.getAndIncrement());
-        assertEquals(1,ai.get());
-    }
-
-    /**
-     * addAndGet adds given value to current, and returns current value
-     */
-    public void testAddAndGet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(3,ai.addAndGet(2));
-        assertEquals(3,ai.get());
-        assertEquals(-1,ai.addAndGet(-4));
-        assertEquals(-1,ai.get());
-    }
-
-    /**
-     * decrementAndGet decrements and returns current value
-     */
-    public void testDecrementAndGet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(0,ai.decrementAndGet());
-        assertEquals(-1,ai.decrementAndGet());
-        assertEquals(-2,ai.decrementAndGet());
-        assertEquals(-2,ai.get());
-    }
-
-    /**
-     * incrementAndGet increments and returns current value
-     */
-    public void testIncrementAndGet() {
-        AtomicInteger ai = new AtomicInteger(1);
-        assertEquals(2,ai.incrementAndGet());
-        assertEquals(2,ai.get());
-        ai.set(-2);
-        assertEquals(-1,ai.incrementAndGet());
-        assertEquals(0,ai.incrementAndGet());
-        assertEquals(1,ai.incrementAndGet());
-        assertEquals(1,ai.get());
-    }
-
-    /**
-     * a deserialized serialized atomic holds same value
-     */
-    public void testSerialization() throws Exception {
-        AtomicInteger l = new AtomicInteger();
-
-        l.set(22);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        AtomicInteger r = (AtomicInteger) in.readObject();
-        assertEquals(l.get(), r.get());
-    }
-
-    /**
-     * toString returns current value.
-     */
-    public void testToString() {
-        AtomicInteger ai = new AtomicInteger();
-        assertEquals("0", ai.toString());
-        for (int x : VALUES) {
-            ai.set(x);
-            assertEquals(ai.toString(), Integer.toString(x));
-        }
-    }
-
-    /**
-     * intValue returns current value.
-     */
-    public void testIntValue() {
-        AtomicInteger ai = new AtomicInteger();
-        assertEquals(0, ai.intValue());
-        for (int x : VALUES) {
-            ai.set(x);
-            assertEquals(x, ai.intValue());
-        }
-    }
-
-    /**
-     * longValue returns current value.
-     */
-    public void testLongValue() {
-        AtomicInteger ai = new AtomicInteger();
-        assertEquals(0L, ai.longValue());
-        for (int x : VALUES) {
-            ai.set(x);
-            assertEquals((long)x, ai.longValue());
-        }
-    }
-
-    /**
-     * floatValue returns current value.
-     */
-    public void testFloatValue() {
-        AtomicInteger ai = new AtomicInteger();
-        assertEquals(0.0f, ai.floatValue());
-        for (int x : VALUES) {
-            ai.set(x);
-            assertEquals((float)x, ai.floatValue());
-        }
-    }
-
-    /**
-     * doubleValue returns current value.
-     */
-    public void testDoubleValue() {
-        AtomicInteger ai = new AtomicInteger();
-        assertEquals(0.0d, ai.doubleValue());
-        for (int x : VALUES) {
-            ai.set(x);
-            assertEquals((double)x, ai.doubleValue());
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongArrayTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongArrayTest.java
deleted file mode 100644
index 88e0984..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongArrayTest.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-import java.io.*;
-import java.util.*;
-
-public class AtomicLongArrayTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicLongArrayTest.class);
-    }
-
-    /**
-     * constructor creates array of given size with all elements zero
-     */
-    public void testConstructor() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(0,ai.get(i));
-    }
-
-    /**
-     * constructor with null array throws NPE
-     */
-    public void testConstructor2NPE() {
-        try {
-            long[] a = null;
-            AtomicLongArray ai = new AtomicLongArray(a);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * constructor with array is of same size and has all elements
-     */
-    public void testConstructor2() {
-        long[] a = { 17L, 3L, -42L, 99L, -7L};
-        AtomicLongArray ai = new AtomicLongArray(a);
-        assertEquals(a.length, ai.length());
-        for (int i = 0; i < a.length; ++i)
-            assertEquals(a[i], ai.get(i));
-    }
-
-    /**
-     * get and set for out of bound indices throw IndexOutOfBoundsException
-     */
-    public void testIndexing() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        try {
-            ai.get(SIZE);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.get(-1);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.set(SIZE, 0);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.set(-1, 0);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-    }
-
-    /**
-     * get returns the last value set at index
-     */
-    public void testGetSet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.get(i));
-            ai.set(i, 2);
-            assertEquals(2,ai.get(i));
-            ai.set(i, -3);
-            assertEquals(-3,ai.get(i));
-        }
-    }
-
-    /**
-     * get returns the last value lazySet at index by same thread
-     */
-    public void testGetLazySet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.lazySet(i, 1);
-            assertEquals(1,ai.get(i));
-            ai.lazySet(i, 2);
-            assertEquals(2,ai.get(i));
-            ai.lazySet(i, -3);
-            assertEquals(-3,ai.get(i));
-        }
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertTrue(ai.compareAndSet(i, 1,2));
-            assertTrue(ai.compareAndSet(i, 2,-4));
-            assertEquals(-4,ai.get(i));
-            assertFalse(ai.compareAndSet(i, -5,7));
-            assertEquals(-4,ai.get(i));
-            assertTrue(ai.compareAndSet(i, -4,7));
-            assertEquals(7,ai.get(i));
-        }
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws InterruptedException {
-        final AtomicLongArray a = new AtomicLongArray(1);
-        a.set(0, 1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!a.compareAndSet(0, 2, 3))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(a.compareAndSet(0, 1, 2));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertEquals(a.get(0), 3);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            while (!ai.weakCompareAndSet(i, 1,2));
-            while (!ai.weakCompareAndSet(i, 2,-4));
-            assertEquals(-4,ai.get(i));
-            while (!ai.weakCompareAndSet(i, -4,7));
-            assertEquals(7,ai.get(i));
-        }
-    }
-
-    /**
-     *  getAndSet returns previous value and sets to given value at given index
-     */
-    public void testGetAndSet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndSet(i,0));
-            assertEquals(0,ai.getAndSet(i,-10));
-            assertEquals(-10,ai.getAndSet(i,1));
-        }
-    }
-
-    /**
-     *  getAndAdd returns previous value and adds given value
-     */
-    public void testGetAndAdd() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndAdd(i,2));
-            assertEquals(3,ai.get(i));
-            assertEquals(3,ai.getAndAdd(i,-4));
-            assertEquals(-1,ai.get(i));
-        }
-    }
-
-    /**
-     * getAndDecrement returns previous value and decrements
-     */
-    public void testGetAndDecrement() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndDecrement(i));
-            assertEquals(0,ai.getAndDecrement(i));
-            assertEquals(-1,ai.getAndDecrement(i));
-        }
-    }
-
-    /**
-     * getAndIncrement returns previous value and increments
-     */
-    public void testGetAndIncrement() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(1,ai.getAndIncrement(i));
-            assertEquals(2,ai.get(i));
-            ai.set(i,-2);
-            assertEquals(-2,ai.getAndIncrement(i));
-            assertEquals(-1,ai.getAndIncrement(i));
-            assertEquals(0,ai.getAndIncrement(i));
-            assertEquals(1,ai.get(i));
-        }
-    }
-
-    /**
-     *  addAndGet adds given value to current, and returns current value
-     */
-    public void testAddAndGet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(3,ai.addAndGet(i,2));
-            assertEquals(3,ai.get(i));
-            assertEquals(-1,ai.addAndGet(i,-4));
-            assertEquals(-1,ai.get(i));
-        }
-    }
-
-    /**
-     * decrementAndGet decrements and returns current value
-     */
-    public void testDecrementAndGet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(0,ai.decrementAndGet(i));
-            assertEquals(-1,ai.decrementAndGet(i));
-            assertEquals(-2,ai.decrementAndGet(i));
-            assertEquals(-2,ai.get(i));
-        }
-    }
-
-    /**
-     * incrementAndGet increments and returns current value
-     */
-    public void testIncrementAndGet() {
-        AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, 1);
-            assertEquals(2,ai.incrementAndGet(i));
-            assertEquals(2,ai.get(i));
-            ai.set(i, -2);
-            assertEquals(-1,ai.incrementAndGet(i));
-            assertEquals(0,ai.incrementAndGet(i));
-            assertEquals(1,ai.incrementAndGet(i));
-            assertEquals(1,ai.get(i));
-        }
-    }
-
-    static final long COUNTDOWN = 100000;
-
-    class Counter implements Runnable {
-        final AtomicLongArray ai;
-        volatile long counts;
-        Counter(AtomicLongArray a) { ai = a; }
-        public void run() {
-            for (;;) {
-                boolean done = true;
-                for (int i = 0; i < ai.length(); ++i) {
-                    long v = ai.get(i);
-                    threadAssertTrue(v >= 0);
-                    if (v != 0) {
-                        done = false;
-                        if (ai.compareAndSet(i, v, v-1))
-                            ++counts;
-                    }
-                }
-                if (done)
-                    break;
-            }
-        }
-    }
-
-    /**
-     * Multiple threads using same array of counters successfully
-     * update a number of times equal to total count
-     */
-    public void testCountingInMultipleThreads() throws InterruptedException {
-        final AtomicLongArray ai = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            ai.set(i, COUNTDOWN);
-        Counter c1 = new Counter(ai);
-        Counter c2 = new Counter(ai);
-        Thread t1 = new Thread(c1);
-        Thread t2 = new Thread(c2);
-        t1.start();
-        t2.start();
-        t1.join();
-        t2.join();
-        assertEquals(c1.counts+c2.counts, SIZE * COUNTDOWN);
-    }
-
-    /**
-     * a deserialized serialized array holds same values
-     */
-    public void testSerialization() throws Exception {
-        AtomicLongArray l = new AtomicLongArray(SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            l.set(i, -i);
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        AtomicLongArray r = (AtomicLongArray) in.readObject();
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(l.get(i), r.get(i));
-        }
-    }
-
-    /**
-     * toString returns current value.
-     */
-    public void testToString() {
-        long[] a = { 17, 3, -42, 99, -7};
-        AtomicLongArray ai = new AtomicLongArray(a);
-        assertEquals(Arrays.toString(a), ai.toString());
-    }
-
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongFieldUpdaterTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongFieldUpdaterTest.java
deleted file mode 100755
index 491baf4..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongFieldUpdaterTest.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import java.util.concurrent.atomic.*;
-import junit.framework.*;
-import java.util.*;
-
-public class AtomicLongFieldUpdaterTest extends JSR166TestCase {
-    volatile long x = 0;
-    int z;
-    long w;
-
-    public static Test suite() {
-        return new TestSuite(AtomicLongFieldUpdaterTest.class);
-    }
-
-    /**
-     * Construction with non-existent field throws RuntimeException
-     */
-    public void testConstructor() {
-        try {
-            AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>
-                a = AtomicLongFieldUpdater.newUpdater
-                (AtomicLongFieldUpdaterTest.class, "y");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     * construction with field not of given type throws RuntimeException
-     */
-    public void testConstructor2() {
-        try {
-            AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>
-                a = AtomicLongFieldUpdater.newUpdater
-                (AtomicLongFieldUpdaterTest.class, "z");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     * construction with non-volatile field throws RuntimeException
-     */
-    public void testConstructor3() {
-        try {
-            AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>
-                a = AtomicLongFieldUpdater.newUpdater
-                (AtomicLongFieldUpdaterTest.class, "w");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     *  get returns the last value set or assigned
-     */
-    public void testGetSet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.get(this));
-        a.set(this,2);
-        assertEquals(2,a.get(this));
-        a.set(this,-3);
-        assertEquals(-3,a.get(this));
-    }
-
-    /**
-     *  get returns the last value lazySet by same thread
-     */
-    public void testGetLazySet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.get(this));
-        a.lazySet(this,2);
-        assertEquals(2,a.get(this));
-        a.lazySet(this,-3);
-        assertEquals(-3,a.get(this));
-    }
-
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertTrue(a.compareAndSet(this,1,2));
-        assertTrue(a.compareAndSet(this,2,-4));
-        assertEquals(-4,a.get(this));
-        assertFalse(a.compareAndSet(this,-5,7));
-        assertEquals(-4,a.get(this));
-        assertTrue(a.compareAndSet(this,-4,7));
-        assertEquals(7,a.get(this));
-    }
-
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        x = 1;
-        final AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest>a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!a.compareAndSet(AtomicLongFieldUpdaterTest.this, 2, 3))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(a.compareAndSet(this, 1, 2));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertEquals(a.get(this), 3);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        while (!a.weakCompareAndSet(this,1,2));
-        while (!a.weakCompareAndSet(this,2,-4));
-        assertEquals(-4,a.get(this));
-        while (!a.weakCompareAndSet(this,-4,7));
-        assertEquals(7,a.get(this));
-    }
-
-    /**
-     *  getAndSet returns previous value and sets to given value
-     */
-    public void testGetAndSet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndSet(this, 0));
-        assertEquals(0,a.getAndSet(this,-10));
-        assertEquals(-10,a.getAndSet(this,1));
-    }
-
-    /**
-     * getAndAdd returns previous value and adds given value
-     */
-    public void testGetAndAdd() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndAdd(this,2));
-        assertEquals(3,a.get(this));
-        assertEquals(3,a.getAndAdd(this,-4));
-        assertEquals(-1,a.get(this));
-    }
-
-    /**
-     * getAndDecrement returns previous value and decrements
-     */
-    public void testGetAndDecrement() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndDecrement(this));
-        assertEquals(0,a.getAndDecrement(this));
-        assertEquals(-1,a.getAndDecrement(this));
-    }
-
-    /**
-     * getAndIncrement returns previous value and increments
-     */
-    public void testGetAndIncrement() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(1,a.getAndIncrement(this));
-        assertEquals(2,a.get(this));
-        a.set(this,-2);
-        assertEquals(-2,a.getAndIncrement(this));
-        assertEquals(-1,a.getAndIncrement(this));
-        assertEquals(0,a.getAndIncrement(this));
-        assertEquals(1,a.get(this));
-    }
-
-    /**
-     * addAndGet adds given value to current, and returns current value
-     */
-    public void testAddAndGet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(3,a.addAndGet(this,2));
-        assertEquals(3,a.get(this));
-        assertEquals(-1,a.addAndGet(this,-4));
-        assertEquals(-1,a.get(this));
-    }
-
-    /**
-     *  decrementAndGet decrements and returns current value
-     */
-    public void testDecrementAndGet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(0,a.decrementAndGet(this));
-        assertEquals(-1,a.decrementAndGet(this));
-        assertEquals(-2,a.decrementAndGet(this));
-        assertEquals(-2,a.get(this));
-    }
-
-    /**
-     * incrementAndGet increments and returns current value
-     */
-    public void testIncrementAndGet() {
-        AtomicLongFieldUpdater<AtomicLongFieldUpdaterTest> a;
-        try {
-            a = AtomicLongFieldUpdater.newUpdater(AtomicLongFieldUpdaterTest.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = 1;
-        assertEquals(2,a.incrementAndGet(this));
-        assertEquals(2,a.get(this));
-        a.set(this,-2);
-        assertEquals(-1,a.incrementAndGet(this));
-        assertEquals(0,a.incrementAndGet(this));
-        assertEquals(1,a.incrementAndGet(this));
-        assertEquals(1,a.get(this));
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongTest.java
deleted file mode 100755
index e73e86e..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicLongTest.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-import java.io.*;
-
-public class AtomicLongTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicLongTest.class);
-    }
-
-    final long[] VALUES = {
-        Long.MIN_VALUE,
-        Integer.MIN_VALUE, -1, 0, 1, 42, Integer.MAX_VALUE,
-        Long.MAX_VALUE,
-    };
-
-    /**
-     * constructor initializes to given value
-     */
-    public void testConstructor() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(1,ai.get());
-    }
-
-    /**
-     * default constructed initializes to zero
-     */
-    public void testConstructor2() {
-        AtomicLong ai = new AtomicLong();
-        assertEquals(0,ai.get());
-    }
-
-    /**
-     * get returns the last value set
-     */
-    public void testGetSet() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(1,ai.get());
-        ai.set(2);
-        assertEquals(2,ai.get());
-        ai.set(-3);
-        assertEquals(-3,ai.get());
-    }
-
-    /**
-     * get returns the last value lazySet in same thread
-     */
-    public void testGetLazySet() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(1,ai.get());
-        ai.lazySet(2);
-        assertEquals(2,ai.get());
-        ai.lazySet(-3);
-        assertEquals(-3,ai.get());
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicLong ai = new AtomicLong(1);
-        assertTrue(ai.compareAndSet(1,2));
-        assertTrue(ai.compareAndSet(2,-4));
-        assertEquals(-4,ai.get());
-        assertFalse(ai.compareAndSet(-5,7));
-        assertEquals(-4,ai.get());
-        assertTrue(ai.compareAndSet(-4,7));
-        assertEquals(7,ai.get());
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        final AtomicLong ai = new AtomicLong(1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(2, 3))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(1, 2));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertEquals(ai.get(), 3);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicLong ai = new AtomicLong(1);
-        while (!ai.weakCompareAndSet(1,2));
-        while (!ai.weakCompareAndSet(2,-4));
-        assertEquals(-4,ai.get());
-        while (!ai.weakCompareAndSet(-4,7));
-        assertEquals(7,ai.get());
-    }
-
-    /**
-     * getAndSet returns previous value and sets to given value
-     */
-    public void testGetAndSet() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(1,ai.getAndSet(0));
-        assertEquals(0,ai.getAndSet(-10));
-        assertEquals(-10,ai.getAndSet(1));
-    }
-
-    /**
-     * getAndAdd returns previous value and adds given value
-     */
-    public void testGetAndAdd() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(1,ai.getAndAdd(2));
-        assertEquals(3,ai.get());
-        assertEquals(3,ai.getAndAdd(-4));
-        assertEquals(-1,ai.get());
-    }
-
-    /**
-     * getAndDecrement returns previous value and decrements
-     */
-    public void testGetAndDecrement() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(1,ai.getAndDecrement());
-        assertEquals(0,ai.getAndDecrement());
-        assertEquals(-1,ai.getAndDecrement());
-    }
-
-    /**
-     * getAndIncrement returns previous value and increments
-     */
-    public void testGetAndIncrement() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(1,ai.getAndIncrement());
-        assertEquals(2,ai.get());
-        ai.set(-2);
-        assertEquals(-2,ai.getAndIncrement());
-        assertEquals(-1,ai.getAndIncrement());
-        assertEquals(0,ai.getAndIncrement());
-        assertEquals(1,ai.get());
-    }
-
-    /**
-     * addAndGet adds given value to current, and returns current value
-     */
-    public void testAddAndGet() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(3,ai.addAndGet(2));
-        assertEquals(3,ai.get());
-        assertEquals(-1,ai.addAndGet(-4));
-        assertEquals(-1,ai.get());
-    }
-
-    /**
-     * decrementAndGet decrements and returns current value
-     */
-    public void testDecrementAndGet() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(0,ai.decrementAndGet());
-        assertEquals(-1,ai.decrementAndGet());
-        assertEquals(-2,ai.decrementAndGet());
-        assertEquals(-2,ai.get());
-    }
-
-    /**
-     * incrementAndGet increments and returns current value
-     */
-    public void testIncrementAndGet() {
-        AtomicLong ai = new AtomicLong(1);
-        assertEquals(2,ai.incrementAndGet());
-        assertEquals(2,ai.get());
-        ai.set(-2);
-        assertEquals(-1,ai.incrementAndGet());
-        assertEquals(0,ai.incrementAndGet());
-        assertEquals(1,ai.incrementAndGet());
-        assertEquals(1,ai.get());
-    }
-
-    /**
-     * a deserialized serialized atomic holds same value
-     */
-    public void testSerialization() throws Exception {
-        AtomicLong l = new AtomicLong();
-
-        l.set(-22);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        AtomicLong r = (AtomicLong) in.readObject();
-        assertEquals(l.get(), r.get());
-    }
-
-    /**
-     * toString returns current value.
-     */
-    public void testToString() {
-        AtomicLong ai = new AtomicLong();
-        assertEquals("0", ai.toString());
-        for (long i : VALUES) {
-            ai.set(i);
-            assertEquals(ai.toString(), Long.toString(i));
-        }
-    }
-
-    /**
-     * intValue returns current value.
-     */
-    public void testIntValue() {
-        AtomicLong ai = new AtomicLong();
-        assertEquals(0, ai.intValue());
-        for (long x : VALUES) {
-            ai.set(x);
-            assertEquals((int)x, ai.intValue());
-        }
-    }
-
-    /**
-     * longValue returns current value.
-     */
-    public void testLongValue() {
-        AtomicLong ai = new AtomicLong();
-        assertEquals(0L, ai.longValue());
-        for (long x : VALUES) {
-            ai.set(x);
-            assertEquals((long)x, ai.longValue());
-        }
-    }
-
-    /**
-     * floatValue returns current value.
-     */
-    public void testFloatValue() {
-        AtomicLong ai = new AtomicLong();
-        assertEquals(0.0f, ai.floatValue());
-        for (long x : VALUES) {
-            ai.set(x);
-            assertEquals((float)x, ai.floatValue());
-        }
-    }
-
-    /**
-     * doubleValue returns current value.
-     */
-    public void testDoubleValue() {
-        AtomicLong ai = new AtomicLong();
-        assertEquals(0.0d, ai.doubleValue());
-        for (long x : VALUES) {
-            ai.set(x);
-            assertEquals((double)x, ai.doubleValue());
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicMarkableReferenceTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicMarkableReferenceTest.java
deleted file mode 100755
index 72a2337..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicMarkableReferenceTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-
-public class AtomicMarkableReferenceTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicMarkableReferenceTest.class);
-    }
-
-    /**
-     *  constructor initializes to given reference and mark
-     */
-    public void testConstructor() {
-        AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
-        assertSame(one,ai.getReference());
-        assertFalse(ai.isMarked());
-        AtomicMarkableReference a2 = new AtomicMarkableReference(null, true);
-        assertNull(a2.getReference());
-        assertTrue(a2.isMarked());
-    }
-
-    /**
-     *  get returns the last values of reference and mark set
-     */
-    public void testGetSet() {
-        boolean[] mark = new boolean[1];
-        AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
-        assertSame(one,ai.getReference());
-        assertFalse(ai.isMarked());
-        assertSame(one, ai.get(mark));
-        assertFalse(mark[0]);
-        ai.set(two, false);
-        assertSame(two,ai.getReference());
-        assertFalse(ai.isMarked());
-        assertSame(two, ai.get(mark));
-        assertFalse(mark[0]);
-        ai.set(one, true);
-        assertSame(one,ai.getReference());
-        assertTrue(ai.isMarked());
-        assertSame(one, ai.get(mark));
-        assertTrue(mark[0]);
-    }
-
-    /**
-     * attemptMark succeeds in single thread
-     */
-    public void testAttemptMark() {
-        boolean[] mark = new boolean[1];
-        AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
-        assertFalse(ai.isMarked());
-        assertTrue(ai.attemptMark(one, true));
-        assertTrue(ai.isMarked());
-        assertSame(one, ai.get(mark));
-        assertTrue(mark[0]);
-    }
-
-    /**
-     * compareAndSet succeeds in changing values if equal to expected reference
-     * and mark else fails
-     */
-    public void testCompareAndSet() {
-        boolean[] mark = new boolean[1];
-        AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
-        assertSame(one, ai.get(mark));
-        assertFalse(ai.isMarked());
-        assertFalse(mark[0]);
-
-        assertTrue(ai.compareAndSet(one, two, false, false));
-        assertSame(two, ai.get(mark));
-        assertFalse(mark[0]);
-
-        assertTrue(ai.compareAndSet(two, m3, false, true));
-        assertSame(m3, ai.get(mark));
-        assertTrue(mark[0]);
-
-        assertFalse(ai.compareAndSet(two, m3, true, true));
-        assertSame(m3, ai.get(mark));
-        assertTrue(mark[0]);
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for reference value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        final AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(two, three, false, false))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(one, two, false, false));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertSame(ai.getReference(), three);
-        assertFalse(ai.isMarked());
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for mark value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads2() throws Exception {
-        final AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(one, one, true, false))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(one, one, false, true));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertSame(ai.getReference(), one);
-        assertFalse(ai.isMarked());
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing values when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        boolean[] mark = new boolean[1];
-        AtomicMarkableReference ai = new AtomicMarkableReference(one, false);
-        assertSame(one, ai.get(mark));
-        assertFalse(ai.isMarked());
-        assertFalse(mark[0]);
-
-        while (!ai.weakCompareAndSet(one, two, false, false));
-        assertSame(two, ai.get(mark));
-        assertFalse(mark[0]);
-
-        while (!ai.weakCompareAndSet(two, m3, false, true));
-        assertSame(m3, ai.get(mark));
-        assertTrue(mark[0]);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceArrayTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceArrayTest.java
deleted file mode 100644
index 25f8474..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceArrayTest.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-import java.io.*;
-import java.util.*;
-
-public class AtomicReferenceArrayTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicReferenceArrayTest.class);
-    }
-
-    /**
-     * constructor creates array of given size with all elements null
-     */
-    public void testConstructor() {
-        AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertNull(ai.get(i));
-        }
-    }
-
-    /**
-     * constructor with null array throws NPE
-     */
-    public void testConstructor2NPE() {
-        try {
-            Integer[] a = null;
-            AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(a);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * constructor with array is of same size and has all elements
-     */
-    public void testConstructor2() {
-        Integer[] a = { two, one, three, four, seven};
-        AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(a);
-        assertEquals(a.length, ai.length());
-        for (int i = 0; i < a.length; ++i)
-            assertEquals(a[i], ai.get(i));
-    }
-
-
-    /**
-     * get and set for out of bound indices throw IndexOutOfBoundsException
-     */
-    public void testIndexing() {
-        AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(SIZE);
-        try {
-            ai.get(SIZE);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.get(-1);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.set(SIZE, null);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-        try {
-            ai.set(-1, null);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {
-        }
-    }
-
-    /**
-     * get returns the last value set at index
-     */
-    public void testGetSet() {
-        AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, one);
-            assertSame(one,ai.get(i));
-            ai.set(i, two);
-            assertSame(two,ai.get(i));
-            ai.set(i, m3);
-            assertSame(m3,ai.get(i));
-        }
-    }
-
-    /**
-     * get returns the last value lazySet at index by same thread
-     */
-    public void testGetLazySet() {
-        AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.lazySet(i, one);
-            assertSame(one,ai.get(i));
-            ai.lazySet(i, two);
-            assertSame(two,ai.get(i));
-            ai.lazySet(i, m3);
-            assertSame(m3,ai.get(i));
-        }
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, one);
-            assertTrue(ai.compareAndSet(i, one,two));
-            assertTrue(ai.compareAndSet(i, two,m4));
-            assertSame(m4,ai.get(i));
-            assertFalse(ai.compareAndSet(i, m5,seven));
-            assertSame(m4,ai.get(i));
-            assertTrue(ai.compareAndSet(i, m4,seven));
-            assertSame(seven,ai.get(i));
-        }
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws InterruptedException {
-        final AtomicReferenceArray a = new AtomicReferenceArray(1);
-        a.set(0, one);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!a.compareAndSet(0, two, three))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(a.compareAndSet(0, one, two));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertSame(a.get(0), three);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, one);
-            while (!ai.weakCompareAndSet(i, one,two));
-            while (!ai.weakCompareAndSet(i, two,m4));
-            assertSame(m4,ai.get(i));
-            while (!ai.weakCompareAndSet(i, m4,seven));
-            assertSame(seven,ai.get(i));
-        }
-    }
-
-    /**
-     * getAndSet returns previous value and sets to given value at given index
-     */
-    public void testGetAndSet() {
-        AtomicReferenceArray ai = new AtomicReferenceArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            ai.set(i, one);
-            assertSame(one,ai.getAndSet(i,zero));
-            assertSame(zero,ai.getAndSet(i,m10));
-            assertSame(m10,ai.getAndSet(i,one));
-        }
-    }
-
-    /**
-     * a deserialized serialized array holds same values
-     */
-    public void testSerialization() throws Exception {
-        AtomicReferenceArray l = new AtomicReferenceArray(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            l.set(i, new Integer(-i));
-        }
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        AtomicReferenceArray r = (AtomicReferenceArray) in.readObject();
-        assertEquals(l.length(), r.length());
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(r.get(i), l.get(i));
-        }
-    }
-
-
-    /**
-     * toString returns current value.
-     */
-    public void testToString() {
-        Integer[] a = { two, one, three, four, seven};
-        AtomicReferenceArray<Integer> ai = new AtomicReferenceArray<Integer>(a);
-        assertEquals(Arrays.toString(a), ai.toString());
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceFieldUpdaterTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceFieldUpdaterTest.java
deleted file mode 100755
index 78c321e..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceFieldUpdaterTest.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import java.util.concurrent.atomic.*;
-import junit.framework.*;
-import java.util.*;
-
-public class AtomicReferenceFieldUpdaterTest extends JSR166TestCase {
-    volatile Integer x = null;
-    Object z;
-    Integer w;
-
-    public static Test suite() {
-        return new TestSuite(AtomicReferenceFieldUpdaterTest.class);
-    }
-
-    /**
-     * Construction with non-existent field throws RuntimeException
-     */
-    public void testConstructor() {
-        try {
-            AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>
-                a = AtomicReferenceFieldUpdater.newUpdater
-                (AtomicReferenceFieldUpdaterTest.class, Integer.class, "y");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-
-    /**
-     * construction with field not of given type throws RuntimeException
-     */
-    public void testConstructor2() {
-        try {
-            AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>
-                a = AtomicReferenceFieldUpdater.newUpdater
-                (AtomicReferenceFieldUpdaterTest.class, Integer.class, "z");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     * Constructor with non-volatile field throws exception
-     */
-    public void testConstructor3() {
-        try {
-            AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>
-                a = AtomicReferenceFieldUpdater.newUpdater
-                (AtomicReferenceFieldUpdaterTest.class, Integer.class, "w");
-            shouldThrow();
-        } catch (RuntimeException success) {}
-    }
-
-    /**
-     *  get returns the last value set or assigned
-     */
-    public void testGetSet() {
-        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
-        try {
-            a = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, Integer.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = one;
-        assertSame(one,a.get(this));
-        a.set(this,two);
-        assertSame(two,a.get(this));
-        a.set(this,m3);
-        assertSame(m3,a.get(this));
-    }
-
-    /**
-     *  get returns the last value lazySet by same thread
-     */
-    public void testGetLazySet() {
-        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
-        try {
-            a = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, Integer.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = one;
-        assertSame(one,a.get(this));
-        a.lazySet(this,two);
-        assertSame(two,a.get(this));
-        a.lazySet(this,m3);
-        assertSame(m3,a.get(this));
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
-        try {
-            a = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, Integer.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = one;
-        assertTrue(a.compareAndSet(this,one,two));
-        assertTrue(a.compareAndSet(this,two,m4));
-        assertSame(m4,a.get(this));
-        assertFalse(a.compareAndSet(this,m5,seven));
-        assertFalse(seven == a.get(this));
-        assertTrue(a.compareAndSet(this,m4,seven));
-        assertSame(seven,a.get(this));
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        x = one;
-        final AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
-        try {
-            a = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, Integer.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!a.compareAndSet(AtomicReferenceFieldUpdaterTest.this, two, three))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(a.compareAndSet(this, one, two));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertSame(a.get(this), three);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
-        try {
-            a = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, Integer.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = one;
-        while (!a.weakCompareAndSet(this,one,two));
-        while (!a.weakCompareAndSet(this,two,m4));
-        assertSame(m4,a.get(this));
-        while (!a.weakCompareAndSet(this,m4,seven));
-        assertSame(seven,a.get(this));
-    }
-
-    /**
-     * getAndSet returns previous value and sets to given value
-     */
-    public void testGetAndSet() {
-        AtomicReferenceFieldUpdater<AtomicReferenceFieldUpdaterTest, Integer>a;
-        try {
-            a = AtomicReferenceFieldUpdater.newUpdater(AtomicReferenceFieldUpdaterTest.class, Integer.class, "x");
-        } catch (RuntimeException ok) {
-            return;
-        }
-        x = one;
-        assertSame(one,a.getAndSet(this, zero));
-        assertSame(zero,a.getAndSet(this,m10));
-        assertSame(m10,a.getAndSet(this,1));
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceTest.java
deleted file mode 100755
index 5046ee8..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicReferenceTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-import java.io.*;
-
-public class AtomicReferenceTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicReferenceTest.class);
-    }
-
-    /**
-     * constructor initializes to given value
-     */
-    public void testConstructor() {
-        AtomicReference ai = new AtomicReference(one);
-        assertSame(one,ai.get());
-    }
-
-    /**
-     * default constructed initializes to null
-     */
-    public void testConstructor2() {
-        AtomicReference ai = new AtomicReference();
-        assertNull(ai.get());
-    }
-
-    /**
-     * get returns the last value set
-     */
-    public void testGetSet() {
-        AtomicReference ai = new AtomicReference(one);
-        assertSame(one,ai.get());
-        ai.set(two);
-        assertSame(two,ai.get());
-        ai.set(m3);
-        assertSame(m3,ai.get());
-    }
-
-    /**
-     * get returns the last value lazySet in same thread
-     */
-    public void testGetLazySet() {
-        AtomicReference ai = new AtomicReference(one);
-        assertSame(one,ai.get());
-        ai.lazySet(two);
-        assertSame(two,ai.get());
-        ai.lazySet(m3);
-        assertSame(m3,ai.get());
-    }
-
-    /**
-     * compareAndSet succeeds in changing value if equal to expected else fails
-     */
-    public void testCompareAndSet() {
-        AtomicReference ai = new AtomicReference(one);
-        assertTrue(ai.compareAndSet(one,two));
-        assertTrue(ai.compareAndSet(two,m4));
-        assertSame(m4,ai.get());
-        assertFalse(ai.compareAndSet(m5,seven));
-        assertSame(m4,ai.get());
-        assertTrue(ai.compareAndSet(m4,seven));
-        assertSame(seven,ai.get());
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        final AtomicReference ai = new AtomicReference(one);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(two, three))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(one, two));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertSame(ai.get(), three);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing value when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        AtomicReference ai = new AtomicReference(one);
-        while (!ai.weakCompareAndSet(one,two));
-        while (!ai.weakCompareAndSet(two,m4));
-        assertSame(m4,ai.get());
-        while (!ai.weakCompareAndSet(m4,seven));
-        assertSame(seven,ai.get());
-    }
-
-    /**
-     * getAndSet returns previous value and sets to given value
-     */
-    public void testGetAndSet() {
-        AtomicReference ai = new AtomicReference(one);
-        assertSame(one,ai.getAndSet(zero));
-        assertSame(zero,ai.getAndSet(m10));
-        assertSame(m10,ai.getAndSet(one));
-    }
-
-    /**
-     * a deserialized serialized atomic holds same value
-     */
-    public void testSerialization() throws Exception {
-        AtomicReference l = new AtomicReference();
-
-        l.set(one);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        AtomicReference r = (AtomicReference) in.readObject();
-        assertEquals(l.get(), r.get());
-    }
-
-    /**
-     * toString returns current value.
-     */
-    public void testToString() {
-        AtomicReference<Integer> ai = new AtomicReference<Integer>(one);
-        assertEquals(ai.toString(), one.toString());
-        ai.set(two);
-        assertEquals(ai.toString(), two.toString());
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/AtomicStampedReferenceTest.java b/luni/src/test/java/tests/api/java/util/concurrent/AtomicStampedReferenceTest.java
deleted file mode 100755
index ca9b724..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/AtomicStampedReferenceTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.atomic.*;
-
-public class AtomicStampedReferenceTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(AtomicStampedReferenceTest.class);
-    }
-
-    /**
-     * constructor initializes to given reference and stamp
-     */
-    public void testConstructor() {
-        AtomicStampedReference ai = new AtomicStampedReference(one, 0);
-        assertSame(one,ai.getReference());
-        assertEquals(0, ai.getStamp());
-        AtomicStampedReference a2 = new AtomicStampedReference(null, 1);
-        assertNull(a2.getReference());
-        assertEquals(1, a2.getStamp());
-    }
-
-    /**
-     *  get returns the last values of reference and stamp set
-     */
-    public void testGetSet() {
-        int[] mark = new int[1];
-        AtomicStampedReference ai = new AtomicStampedReference(one, 0);
-        assertSame(one,ai.getReference());
-        assertEquals(0, ai.getStamp());
-        assertSame(one, ai.get(mark));
-        assertEquals(0, mark[0]);
-        ai.set(two, 0);
-        assertSame(two,ai.getReference());
-        assertEquals(0, ai.getStamp());
-        assertSame(two, ai.get(mark));
-        assertEquals(0, mark[0]);
-        ai.set(one, 1);
-        assertSame(one,ai.getReference());
-        assertEquals(1, ai.getStamp());
-        assertSame(one, ai.get(mark));
-        assertEquals(1,mark[0]);
-    }
-
-    /**
-     *  attemptStamp succeeds in single thread
-     */
-    public void testAttemptStamp() {
-        int[] mark = new int[1];
-        AtomicStampedReference ai = new AtomicStampedReference(one, 0);
-        assertEquals(0, ai.getStamp());
-        assertTrue(ai.attemptStamp(one, 1));
-        assertEquals(1, ai.getStamp());
-        assertSame(one, ai.get(mark));
-        assertEquals(1, mark[0]);
-    }
-
-    /**
-     * compareAndSet succeeds in changing values if equal to expected reference
-     * and stamp else fails
-     */
-    public void testCompareAndSet() {
-        int[] mark = new int[1];
-        AtomicStampedReference ai = new AtomicStampedReference(one, 0);
-        assertSame(one, ai.get(mark));
-        assertEquals(0, ai.getStamp());
-        assertEquals(0, mark[0]);
-
-        assertTrue(ai.compareAndSet(one, two, 0, 0));
-        assertSame(two, ai.get(mark));
-        assertEquals(0, mark[0]);
-
-        assertTrue(ai.compareAndSet(two, m3, 0, 1));
-        assertSame(m3, ai.get(mark));
-        assertEquals(1, mark[0]);
-
-        assertFalse(ai.compareAndSet(two, m3, 1, 1));
-        assertSame(m3, ai.get(mark));
-        assertEquals(1, mark[0]);
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for reference value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads() throws Exception {
-        final AtomicStampedReference ai = new AtomicStampedReference(one, 0);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(two, three, 0, 0))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(one, two, 0, 0));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertSame(ai.getReference(), three);
-        assertEquals(ai.getStamp(), 0);
-    }
-
-    /**
-     * compareAndSet in one thread enables another waiting for stamp value
-     * to succeed
-     */
-    public void testCompareAndSetInMultipleThreads2() throws Exception {
-        final AtomicStampedReference ai = new AtomicStampedReference(one, 0);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                while (!ai.compareAndSet(one, one, 1, 2))
-                    Thread.yield();
-            }});
-
-        t.start();
-        assertTrue(ai.compareAndSet(one, one, 0, 1));
-        t.join(LONG_DELAY_MS);
-        assertFalse(t.isAlive());
-        assertSame(ai.getReference(), one);
-        assertEquals(ai.getStamp(), 2);
-    }
-
-    /**
-     * repeated weakCompareAndSet succeeds in changing values when equal
-     * to expected
-     */
-    public void testWeakCompareAndSet() {
-        int[] mark = new int[1];
-        AtomicStampedReference ai = new AtomicStampedReference(one, 0);
-        assertSame(one, ai.get(mark));
-        assertEquals(0, ai.getStamp ());
-        assertEquals(0, mark[0]);
-
-        while (!ai.weakCompareAndSet(one, two, 0, 0));
-        assertSame(two, ai.get(mark));
-        assertEquals(0, mark[0]);
-
-        while (!ai.weakCompareAndSet(two, m3, 0, 1));
-        assertSame(m3, ai.get(mark));
-        assertEquals(1, mark[0]);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentHashMapTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentHashMapTest.java
deleted file mode 100755
index 9b355f5..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentHashMapTest.java
+++ /dev/null
@@ -1,596 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.Enumeration;
-import java.io.*;
-
-public class ConcurrentHashMapTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ConcurrentHashMapTest.class);
-    }
-
-    /**
-     * Create a map from Integers 1-5 to Strings "A"-"E".
-     */
-    private static ConcurrentHashMap map5() {
-        ConcurrentHashMap map = new ConcurrentHashMap(5);
-        assertTrue(map.isEmpty());
-        map.put(one, "A");
-        map.put(two, "B");
-        map.put(three, "C");
-        map.put(four, "D");
-        map.put(five, "E");
-        assertFalse(map.isEmpty());
-        assertEquals(5, map.size());
-        return map;
-    }
-
-    /**
-     *  clear removes all pairs
-     */
-    public void testClear() {
-        ConcurrentHashMap map = map5();
-        map.clear();
-        assertEquals(map.size(), 0);
-    }
-
-    /**
-     *  Maps with same contents are equal
-     */
-    public void testEquals() {
-        ConcurrentHashMap map1 = map5();
-        ConcurrentHashMap map2 = map5();
-        assertEquals(map1, map2);
-        assertEquals(map2, map1);
-        map1.clear();
-        assertFalse(map1.equals(map2));
-        assertFalse(map2.equals(map1));
-    }
-
-    /**
-     *  contains returns true for contained value
-     */
-    public void testContains() {
-        ConcurrentHashMap map = map5();
-        assertTrue(map.contains("A"));
-        assertFalse(map.contains("Z"));
-    }
-
-    /**
-     *  containsKey returns true for contained key
-     */
-    public void testContainsKey() {
-        ConcurrentHashMap map = map5();
-        assertTrue(map.containsKey(one));
-        assertFalse(map.containsKey(zero));
-    }
-
-    /**
-     *  containsValue returns true for held values
-     */
-    public void testContainsValue() {
-        ConcurrentHashMap map = map5();
-        assertTrue(map.containsValue("A"));
-        assertFalse(map.containsValue("Z"));
-    }
-
-    /**
-     *   enumeration returns an enumeration containing the correct
-     *   elements
-     */
-    public void testEnumeration() {
-        ConcurrentHashMap map = map5();
-        Enumeration e = map.elements();
-        int count = 0;
-        while (e.hasMoreElements()) {
-            count++;
-            e.nextElement();
-        }
-        assertEquals(5, count);
-    }
-
-    /**
-     *  get returns the correct element at the given key,
-     *  or null if not present
-     */
-    public void testGet() {
-        ConcurrentHashMap map = map5();
-        assertEquals("A", (String)map.get(one));
-        ConcurrentHashMap empty = new ConcurrentHashMap();
-        assertNull(map.get("anything"));
-    }
-
-    /**
-     *  isEmpty is true of empty map and false for non-empty
-     */
-    public void testIsEmpty() {
-        ConcurrentHashMap empty = new ConcurrentHashMap();
-        ConcurrentHashMap map = map5();
-        assertTrue(empty.isEmpty());
-        assertFalse(map.isEmpty());
-    }
-
-    /**
-     *   keys returns an enumeration containing all the keys from the map
-     */
-    public void testKeys() {
-        ConcurrentHashMap map = map5();
-        Enumeration e = map.keys();
-        int count = 0;
-        while (e.hasMoreElements()) {
-            count++;
-            e.nextElement();
-        }
-        assertEquals(5, count);
-    }
-
-    /**
-     *   keySet returns a Set containing all the keys
-     */
-    public void testKeySet() {
-        ConcurrentHashMap map = map5();
-        Set s = map.keySet();
-        assertEquals(5, s.size());
-        assertTrue(s.contains(one));
-        assertTrue(s.contains(two));
-        assertTrue(s.contains(three));
-        assertTrue(s.contains(four));
-        assertTrue(s.contains(five));
-    }
-
-    /**
-     *  keySet.toArray returns contains all keys
-     */
-    public void testKeySetToArray() {
-        ConcurrentHashMap map = map5();
-        Set s = map.keySet();
-        Object[] ar = s.toArray();
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        assertEquals(5, ar.length);
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     *  Values.toArray contains all values
-     */
-    public void testValuesToArray() {
-        ConcurrentHashMap map = map5();
-        Collection v = map.values();
-        Object[] ar = v.toArray();
-        ArrayList s = new ArrayList(Arrays.asList(ar));
-        assertEquals(5, ar.length);
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     *  entrySet.toArray contains all entries
-     */
-    public void testEntrySetToArray() {
-        ConcurrentHashMap map = map5();
-        Set s = map.entrySet();
-        Object[] ar = s.toArray();
-        assertEquals(5, ar.length);
-        for (int i = 0; i < 5; ++i) {
-            assertTrue(map.containsKey(((Map.Entry)(ar[i])).getKey()));
-            assertTrue(map.containsValue(((Map.Entry)(ar[i])).getValue()));
-        }
-    }
-
-    /**
-     * values collection contains all values
-     */
-    public void testValues() {
-        ConcurrentHashMap map = map5();
-        Collection s = map.values();
-        assertEquals(5, s.size());
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     * entrySet contains all pairs
-     */
-    public void testEntrySet() {
-        ConcurrentHashMap map = map5();
-        Set s = map.entrySet();
-        assertEquals(5, s.size());
-        Iterator it = s.iterator();
-        while (it.hasNext()) {
-            Map.Entry e = (Map.Entry) it.next();
-            assertTrue(
-                       (e.getKey().equals(one) && e.getValue().equals("A")) ||
-                       (e.getKey().equals(two) && e.getValue().equals("B")) ||
-                       (e.getKey().equals(three) && e.getValue().equals("C")) ||
-                       (e.getKey().equals(four) && e.getValue().equals("D")) ||
-                       (e.getKey().equals(five) && e.getValue().equals("E")));
-        }
-    }
-
-    /**
-     *   putAll  adds all key-value pairs from the given map
-     */
-    public void testPutAll() {
-        ConcurrentHashMap empty = new ConcurrentHashMap();
-        ConcurrentHashMap map = map5();
-        empty.putAll(map);
-        assertEquals(5, empty.size());
-        assertTrue(empty.containsKey(one));
-        assertTrue(empty.containsKey(two));
-        assertTrue(empty.containsKey(three));
-        assertTrue(empty.containsKey(four));
-        assertTrue(empty.containsKey(five));
-    }
-
-    /**
-     *   putIfAbsent works when the given key is not present
-     */
-    public void testPutIfAbsent() {
-        ConcurrentHashMap map = map5();
-        map.putIfAbsent(six, "Z");
-        assertTrue(map.containsKey(six));
-    }
-
-    /**
-     *   putIfAbsent does not add the pair if the key is already present
-     */
-    public void testPutIfAbsent2() {
-        ConcurrentHashMap map = map5();
-        assertEquals("A", map.putIfAbsent(one, "Z"));
-    }
-
-    /**
-     *   replace fails when the given key is not present
-     */
-    public void testReplace() {
-        ConcurrentHashMap map = map5();
-        assertNull(map.replace(six, "Z"));
-        assertFalse(map.containsKey(six));
-    }
-
-    /**
-     *   replace succeeds if the key is already present
-     */
-    public void testReplace2() {
-        ConcurrentHashMap map = map5();
-        assertNotNull(map.replace(one, "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     * replace value fails when the given key not mapped to expected value
-     */
-    public void testReplaceValue() {
-        ConcurrentHashMap map = map5();
-        assertEquals("A", map.get(one));
-        assertFalse(map.replace(one, "Z", "Z"));
-        assertEquals("A", map.get(one));
-    }
-
-    /**
-     * replace value succeeds when the given key mapped to expected value
-     */
-    public void testReplaceValue2() {
-        ConcurrentHashMap map = map5();
-        assertEquals("A", map.get(one));
-        assertTrue(map.replace(one, "A", "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     *   remove removes the correct key-value pair from the map
-     */
-    public void testRemove() {
-        ConcurrentHashMap map = map5();
-        map.remove(five);
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-    }
-
-    /**
-     * remove(key,value) removes only if pair present
-     */
-    public void testRemove2() {
-        ConcurrentHashMap map = map5();
-        map.remove(five, "E");
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-        map.remove(four, "A");
-        assertEquals(4, map.size());
-        assertTrue(map.containsKey(four));
-    }
-
-    /**
-     *   size returns the correct values
-     */
-    public void testSize() {
-        ConcurrentHashMap map = map5();
-        ConcurrentHashMap empty = new ConcurrentHashMap();
-        assertEquals(0, empty.size());
-        assertEquals(5, map.size());
-    }
-
-    /**
-     * toString contains toString of elements
-     */
-    public void testToString() {
-        ConcurrentHashMap map = map5();
-        String s = map.toString();
-        for (int i = 1; i <= 5; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    // Exception tests
-
-    /**
-     * Cannot create with negative capacity
-     */
-    public void testConstructor1() {
-        try {
-            new ConcurrentHashMap(-1,0,1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Cannot create with negative concurrency level
-     */
-    public void testConstructor2() {
-        try {
-            new ConcurrentHashMap(1,0,-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Cannot create with only negative capacity
-     */
-    public void testConstructor3() {
-        try {
-            new ConcurrentHashMap(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * get(null) throws NPE
-     */
-    public void testGet_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.get(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsKey(null) throws NPE
-     */
-    public void testContainsKey_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.containsKey(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsValue(null) throws NPE
-     */
-    public void testContainsValue_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.containsValue(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * contains(null) throws NPE
-     */
-    public void testContains_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.contains(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * put(null,x) throws NPE
-     */
-    public void testPut1_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.put(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * put(x, null) throws NPE
-     */
-    public void testPut2_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.put("whatever", null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * putIfAbsent(null, x) throws NPE
-     */
-    public void testPutIfAbsent1_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.putIfAbsent(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x) throws NPE
-     */
-    public void testReplace_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.replace(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x, y) throws NPE
-     */
-    public void testReplaceValue_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.replace(null, one, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * putIfAbsent(x, null) throws NPE
-     */
-    public void testPutIfAbsent2_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.putIfAbsent("whatever", null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * replace(x, null) throws NPE
-     */
-    public void testReplace2_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.replace("whatever", null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(x, null, y) throws NPE
-     */
-    public void testReplaceValue2_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.replace("whatever", null, "A");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(x, y, null) throws NPE
-     */
-    public void testReplaceValue3_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.replace("whatever", one, null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * remove(null) throws NPE
-     */
-    public void testRemove1_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.put("sadsdf", "asdads");
-            c.remove(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(null, x) throws NPE
-     */
-    public void testRemove2_NullPointerException() {
-        try {
-            ConcurrentHashMap c = new ConcurrentHashMap(5);
-            c.put("sadsdf", "asdads");
-            c.remove(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(x, null) returns false
-     */
-    public void testRemove3() {
-        ConcurrentHashMap c = new ConcurrentHashMap(5);
-        c.put("sadsdf", "asdads");
-        assertFalse(c.remove("sadsdf", null));
-    }
-
-    /**
-     * A deserialized map equals original
-     */
-    public void testSerialization() throws Exception {
-        ConcurrentHashMap q = map5();
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ConcurrentHashMap r = (ConcurrentHashMap)in.readObject();
-        assertEquals(q.size(), r.size());
-        assertTrue(q.equals(r));
-        assertTrue(r.equals(q));
-    }
-
-
-    /**
-     * SetValue of an EntrySet entry sets value in the map.
-     */
-    public void testSetValueWriteThrough() {
-        // Adapted from a bug report by Eric Zoerner
-        ConcurrentHashMap map = new ConcurrentHashMap(2, 5.0f, 1);
-        assertTrue(map.isEmpty());
-        for (int i = 0; i < 20; i++)
-            map.put(new Integer(i), new Integer(i));
-        assertFalse(map.isEmpty());
-        Map.Entry entry1 = (Map.Entry)map.entrySet().iterator().next();
-
-        // assert that entry1 is not 16
-        assertTrue("entry is 16, test not valid",
-                   !entry1.getKey().equals(new Integer(16)));
-
-        // remove 16 (a different key) from map
-        // which just happens to cause entry1 to be cloned in map
-        map.remove(new Integer(16));
-        entry1.setValue("XYZ");
-        assertTrue(map.containsValue("XYZ")); // fails
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentLinkedQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentLinkedQueueTest.java
deleted file mode 100755
index 1fbc729..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentLinkedQueueTest.java
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class ConcurrentLinkedQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ConcurrentLinkedQueueTest.class);
-    }
-
-    /**
-     * Create a queue of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private ConcurrentLinkedQueue populatedQueue(int n) {
-        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        assertTrue(q.isEmpty());
-        for (int i = 0; i < n; ++i)
-            assertTrue(q.offer(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * new queue is empty
-     */
-    public void testConstructor1() {
-        assertEquals(0, new ConcurrentLinkedQueue().size());
-    }
-
-    /**
-     *  Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue((Collection)null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-     */
-    public void testConstructor6() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        assertTrue(q.isEmpty());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        q.add(two);
-        q.remove();
-        q.remove();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testSize() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * Offer returns true
-     */
-    public void testOffer() {
-        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        assertTrue(q.offer(zero));
-        assertTrue(q.offer(one));
-    }
-
-    /**
-     * add returns true
-     */
-    public void testAdd() {
-        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            assertTrue(q.add(new Integer(i)));
-        }
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            ConcurrentLinkedQueue q = populatedQueue(SIZE);
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     *  addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements, in traversal order, of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     * peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peek());
-            assertEquals(i, q.poll());
-            assertTrue(q.peek() == null ||
-                       !q.peek().equals(i));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.element());
-            assertEquals(i, q.poll());
-        }
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     *  remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remove());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.poll();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        ConcurrentLinkedQueue p = new ConcurrentLinkedQueue();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if change
-     */
-    public void testRetainAll() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        ConcurrentLinkedQueue p = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            ConcurrentLinkedQueue q = populatedQueue(SIZE);
-            ConcurrentLinkedQueue p = populatedQueue(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testToArray() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.poll());
-    }
-
-    /**
-     *  toArray(a) contains all elements
-     */
-    public void testToArray2() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * toArray with incompatible array type throws ArrayStoreException
-     */
-    public void testToArray1_BadArg() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(new String[10]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-    /**
-     *  iterator iterates through all elements
-     */
-    public void testIterator() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     * iterator ordering is FIFO
-     */
-    public void testIteratorOrdering() {
-        final ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        q.add(one);
-        q.add(two);
-        q.add(three);
-
-        int k = 0;
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            assertEquals(++k, it.next());
-        }
-
-        assertEquals(3, k);
-    }
-
-    /**
-     * Modifications do not cause iterators to fail
-     */
-    public void testWeaklyConsistentIteration () {
-        final ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        q.add(one);
-        q.add(two);
-        q.add(three);
-
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            q.remove();
-            it.next();
-        }
-
-        assertEquals("queue should be empty again", 0, q.size());
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final ConcurrentLinkedQueue q = new ConcurrentLinkedQueue();
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-        it = q.iterator();
-        assertSame(it.next(), two);
-        assertSame(it.next(), three);
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * A deserialized serialized queue has same elements in same order
-     */
-    public void testSerialization() throws Exception {
-        ConcurrentLinkedQueue q = populatedQueue(SIZE);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ConcurrentLinkedQueue r = (ConcurrentLinkedQueue)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.remove(), r.remove());
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListMapTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListMapTest.java
deleted file mode 100644
index 3cf5b75..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListMapTest.java
+++ /dev/null
@@ -1,1280 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class ConcurrentSkipListMapTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ConcurrentSkipListMapTest.class);
-    }
-
-    /**
-     * Create a map from Integers 1-5 to Strings "A"-"E".
-     */
-    private static ConcurrentSkipListMap map5() {
-        ConcurrentSkipListMap map = new ConcurrentSkipListMap();
-        assertTrue(map.isEmpty());
-        map.put(one, "A");
-        map.put(five, "E");
-        map.put(three, "C");
-        map.put(two, "B");
-        map.put(four, "D");
-        assertFalse(map.isEmpty());
-        assertEquals(5, map.size());
-        return map;
-    }
-
-    /**
-     *  clear removes all pairs
-     */
-    public void testClear() {
-        ConcurrentSkipListMap map = map5();
-        map.clear();
-        assertEquals(map.size(), 0);
-    }
-
-    /**
-     *
-     */
-    public void testConstructFromSorted() {
-        ConcurrentSkipListMap map = map5();
-        ConcurrentSkipListMap map2 = new ConcurrentSkipListMap(map);
-        assertEquals(map, map2);
-    }
-
-    /**
-     *  Maps with same contents are equal
-     */
-    public void testEquals() {
-        ConcurrentSkipListMap map1 = map5();
-        ConcurrentSkipListMap map2 = map5();
-        assertEquals(map1, map2);
-        assertEquals(map2, map1);
-        map1.clear();
-        assertFalse(map1.equals(map2));
-        assertFalse(map2.equals(map1));
-    }
-
-    /**
-     *  containsKey returns true for contained key
-     */
-    public void testContainsKey() {
-        ConcurrentSkipListMap map = map5();
-        assertTrue(map.containsKey(one));
-        assertFalse(map.containsKey(zero));
-    }
-
-    /**
-     *  containsValue returns true for held values
-     */
-    public void testContainsValue() {
-        ConcurrentSkipListMap map = map5();
-        assertTrue(map.containsValue("A"));
-        assertFalse(map.containsValue("Z"));
-    }
-
-    /**
-     *  get returns the correct element at the given key,
-     *  or null if not present
-     */
-    public void testGet() {
-        ConcurrentSkipListMap map = map5();
-        assertEquals("A", (String)map.get(one));
-        ConcurrentSkipListMap empty = new ConcurrentSkipListMap();
-        assertNull(empty.get(one));
-    }
-
-    /**
-     *  isEmpty is true of empty map and false for non-empty
-     */
-    public void testIsEmpty() {
-        ConcurrentSkipListMap empty = new ConcurrentSkipListMap();
-        ConcurrentSkipListMap map = map5();
-        assertTrue(empty.isEmpty());
-        assertFalse(map.isEmpty());
-    }
-
-    /**
-     *   firstKey returns first key
-     */
-    public void testFirstKey() {
-        ConcurrentSkipListMap map = map5();
-        assertEquals(one, map.firstKey());
-    }
-
-    /**
-     *   lastKey returns last key
-     */
-    public void testLastKey() {
-        ConcurrentSkipListMap map = map5();
-        assertEquals(five, map.lastKey());
-    }
-
-
-    /**
-     *  keySet.toArray returns contains all keys
-     */
-    public void testKeySetToArray() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.keySet();
-        Object[] ar = s.toArray();
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        assertEquals(5, ar.length);
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     *  descendingkeySet.toArray returns contains all keys
-     */
-    public void testDescendingKeySetToArray() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.descendingKeySet();
-        Object[] ar = s.toArray();
-        assertEquals(5, ar.length);
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     *   keySet returns a Set containing all the keys
-     */
-    public void testKeySet() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.keySet();
-        assertEquals(5, s.size());
-        assertTrue(s.contains(one));
-        assertTrue(s.contains(two));
-        assertTrue(s.contains(three));
-        assertTrue(s.contains(four));
-        assertTrue(s.contains(five));
-    }
-
-    /**
-     *   keySet is ordered
-     */
-    public void testKeySetOrder() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.keySet();
-        Iterator i = s.iterator();
-        Integer last = (Integer)i.next();
-        assertEquals(last, one);
-        int count = 1;
-        while (i.hasNext()) {
-            Integer k = (Integer)i.next();
-            assertTrue(last.compareTo(k) < 0);
-            last = k;
-            ++count;
-        }
-        assertEquals(count ,5);
-    }
-
-    /**
-     * descending iterator of key set is inverse ordered
-     */
-    public void testKeySetDescendingIteratorOrder() {
-        ConcurrentSkipListMap map = map5();
-        NavigableSet s = map.navigableKeySet();
-        Iterator i = s.descendingIterator();
-        Integer last = (Integer)i.next();
-        assertEquals(last, five);
-        int count = 1;
-        while (i.hasNext()) {
-            Integer k = (Integer)i.next();
-            assertTrue(last.compareTo(k) > 0);
-            last = k;
-            ++count;
-        }
-        assertEquals(count ,5);
-    }
-
-    /**
-     *   descendingKeySet is ordered
-     */
-    public void testDescendingKeySetOrder() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.descendingKeySet();
-        Iterator i = s.iterator();
-        Integer last = (Integer)i.next();
-        assertEquals(last, five);
-        int count = 1;
-        while (i.hasNext()) {
-            Integer k = (Integer)i.next();
-            assertTrue(last.compareTo(k) > 0);
-            last = k;
-            ++count;
-        }
-        assertEquals(count, 5);
-    }
-
-    /**
-     *  descending iterator of descendingKeySet is ordered
-     */
-    public void testDescendingKeySetDescendingIteratorOrder() {
-        ConcurrentSkipListMap map = map5();
-        NavigableSet s = map.descendingKeySet();
-        Iterator i = s.descendingIterator();
-        Integer last = (Integer)i.next();
-        assertEquals(last, one);
-        int count = 1;
-        while (i.hasNext()) {
-            Integer k = (Integer)i.next();
-            assertTrue(last.compareTo(k) < 0);
-            last = k;
-            ++count;
-        }
-        assertEquals(count, 5);
-    }
-
-    /**
-     *  Values.toArray contains all values
-     */
-    public void testValuesToArray() {
-        ConcurrentSkipListMap map = map5();
-        Collection v = map.values();
-        Object[] ar = v.toArray();
-        ArrayList s = new ArrayList(Arrays.asList(ar));
-        assertEquals(5, ar.length);
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     * values collection contains all values
-     */
-    public void testValues() {
-        ConcurrentSkipListMap map = map5();
-        Collection s = map.values();
-        assertEquals(5, s.size());
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     * entrySet contains all pairs
-     */
-    public void testEntrySet() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.entrySet();
-        assertEquals(5, s.size());
-        Iterator it = s.iterator();
-        while (it.hasNext()) {
-            Map.Entry e = (Map.Entry) it.next();
-            assertTrue(
-                       (e.getKey().equals(one) && e.getValue().equals("A")) ||
-                       (e.getKey().equals(two) && e.getValue().equals("B")) ||
-                       (e.getKey().equals(three) && e.getValue().equals("C")) ||
-                       (e.getKey().equals(four) && e.getValue().equals("D")) ||
-                       (e.getKey().equals(five) && e.getValue().equals("E")));
-        }
-    }
-
-    /**
-     * descendingEntrySet contains all pairs
-     */
-    public void testDescendingEntrySet() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.descendingMap().entrySet();
-        assertEquals(5, s.size());
-        Iterator it = s.iterator();
-        while (it.hasNext()) {
-            Map.Entry e = (Map.Entry) it.next();
-            assertTrue(
-                       (e.getKey().equals(one) && e.getValue().equals("A")) ||
-                       (e.getKey().equals(two) && e.getValue().equals("B")) ||
-                       (e.getKey().equals(three) && e.getValue().equals("C")) ||
-                       (e.getKey().equals(four) && e.getValue().equals("D")) ||
-                       (e.getKey().equals(five) && e.getValue().equals("E")));
-        }
-    }
-
-    /**
-     *  entrySet.toArray contains all entries
-     */
-    public void testEntrySetToArray() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.entrySet();
-        Object[] ar = s.toArray();
-        assertEquals(5, ar.length);
-        for (int i = 0; i < 5; ++i) {
-            assertTrue(map.containsKey(((Map.Entry)(ar[i])).getKey()));
-            assertTrue(map.containsValue(((Map.Entry)(ar[i])).getValue()));
-        }
-    }
-
-    /**
-     *  descendingEntrySet.toArray contains all entries
-     */
-    public void testDescendingEntrySetToArray() {
-        ConcurrentSkipListMap map = map5();
-        Set s = map.descendingMap().entrySet();
-        Object[] ar = s.toArray();
-        assertEquals(5, ar.length);
-        for (int i = 0; i < 5; ++i) {
-            assertTrue(map.containsKey(((Map.Entry)(ar[i])).getKey()));
-            assertTrue(map.containsValue(((Map.Entry)(ar[i])).getValue()));
-        }
-    }
-
-    /**
-     *   putAll  adds all key-value pairs from the given map
-     */
-    public void testPutAll() {
-        ConcurrentSkipListMap empty = new ConcurrentSkipListMap();
-        ConcurrentSkipListMap map = map5();
-        empty.putAll(map);
-        assertEquals(5, empty.size());
-        assertTrue(empty.containsKey(one));
-        assertTrue(empty.containsKey(two));
-        assertTrue(empty.containsKey(three));
-        assertTrue(empty.containsKey(four));
-        assertTrue(empty.containsKey(five));
-    }
-
-    /**
-     *   putIfAbsent works when the given key is not present
-     */
-    public void testPutIfAbsent() {
-        ConcurrentSkipListMap map = map5();
-        map.putIfAbsent(six, "Z");
-        assertTrue(map.containsKey(six));
-    }
-
-    /**
-     *   putIfAbsent does not add the pair if the key is already present
-     */
-    public void testPutIfAbsent2() {
-        ConcurrentSkipListMap map = map5();
-        assertEquals("A", map.putIfAbsent(one, "Z"));
-    }
-
-    /**
-     *   replace fails when the given key is not present
-     */
-    public void testReplace() {
-        ConcurrentSkipListMap map = map5();
-        assertNull(map.replace(six, "Z"));
-        assertFalse(map.containsKey(six));
-    }
-
-    /**
-     *   replace succeeds if the key is already present
-     */
-    public void testReplace2() {
-        ConcurrentSkipListMap map = map5();
-        assertNotNull(map.replace(one, "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     * replace value fails when the given key not mapped to expected value
-     */
-    public void testReplaceValue() {
-        ConcurrentSkipListMap map = map5();
-        assertEquals("A", map.get(one));
-        assertFalse(map.replace(one, "Z", "Z"));
-        assertEquals("A", map.get(one));
-    }
-
-    /**
-     * replace value succeeds when the given key mapped to expected value
-     */
-    public void testReplaceValue2() {
-        ConcurrentSkipListMap map = map5();
-        assertEquals("A", map.get(one));
-        assertTrue(map.replace(one, "A", "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     *   remove removes the correct key-value pair from the map
-     */
-    public void testRemove() {
-        ConcurrentSkipListMap map = map5();
-        map.remove(five);
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-    }
-
-    /**
-     * remove(key,value) removes only if pair present
-     */
-    public void testRemove2() {
-        ConcurrentSkipListMap map = map5();
-        assertTrue(map.containsKey(five));
-        assertEquals("E", map.get(five));
-        map.remove(five, "E");
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-        map.remove(four, "A");
-        assertEquals(4, map.size());
-        assertTrue(map.containsKey(four));
-    }
-
-    /**
-     * lowerEntry returns preceding entry.
-     */
-    public void testLowerEntry() {
-        ConcurrentSkipListMap map = map5();
-        Map.Entry e1 = map.lowerEntry(three);
-        assertEquals(two, e1.getKey());
-
-        Map.Entry e2 = map.lowerEntry(six);
-        assertEquals(five, e2.getKey());
-
-        Map.Entry e3 = map.lowerEntry(one);
-        assertNull(e3);
-
-        Map.Entry e4 = map.lowerEntry(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * higherEntry returns next entry.
-     */
-    public void testHigherEntry() {
-        ConcurrentSkipListMap map = map5();
-        Map.Entry e1 = map.higherEntry(three);
-        assertEquals(four, e1.getKey());
-
-        Map.Entry e2 = map.higherEntry(zero);
-        assertEquals(one, e2.getKey());
-
-        Map.Entry e3 = map.higherEntry(five);
-        assertNull(e3);
-
-        Map.Entry e4 = map.higherEntry(six);
-        assertNull(e4);
-    }
-
-    /**
-     * floorEntry returns preceding entry.
-     */
-    public void testFloorEntry() {
-        ConcurrentSkipListMap map = map5();
-        Map.Entry e1 = map.floorEntry(three);
-        assertEquals(three, e1.getKey());
-
-        Map.Entry e2 = map.floorEntry(six);
-        assertEquals(five, e2.getKey());
-
-        Map.Entry e3 = map.floorEntry(one);
-        assertEquals(one, e3.getKey());
-
-        Map.Entry e4 = map.floorEntry(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * ceilingEntry returns next entry.
-     */
-    public void testCeilingEntry() {
-        ConcurrentSkipListMap map = map5();
-        Map.Entry e1 = map.ceilingEntry(three);
-        assertEquals(three, e1.getKey());
-
-        Map.Entry e2 = map.ceilingEntry(zero);
-        assertEquals(one, e2.getKey());
-
-        Map.Entry e3 = map.ceilingEntry(five);
-        assertEquals(five, e3.getKey());
-
-        Map.Entry e4 = map.ceilingEntry(six);
-        assertNull(e4);
-    }
-
-    /**
-     * lowerEntry, higherEntry, ceilingEntry, and floorEntry return
-     * immutable entries
-     */
-    public void testEntryImmutablity() {
-        ConcurrentSkipListMap map = map5();
-        Map.Entry e = map.lowerEntry(three);
-        assertEquals(two, e.getKey());
-        try {
-            e.setValue("X");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.higherEntry(zero);
-        assertEquals(one, e.getKey());
-        try {
-            e.setValue("X");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.floorEntry(one);
-        assertEquals(one, e.getKey());
-        try {
-            e.setValue("X");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.ceilingEntry(five);
-        assertEquals(five, e.getKey());
-        try {
-            e.setValue("X");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-    }
-
-
-
-    /**
-     * lowerKey returns preceding element
-     */
-    public void testLowerKey() {
-        ConcurrentSkipListMap q = map5();
-        Object e1 = q.lowerKey(three);
-        assertEquals(two, e1);
-
-        Object e2 = q.lowerKey(six);
-        assertEquals(five, e2);
-
-        Object e3 = q.lowerKey(one);
-        assertNull(e3);
-
-        Object e4 = q.lowerKey(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * higherKey returns next element
-     */
-    public void testHigherKey() {
-        ConcurrentSkipListMap q = map5();
-        Object e1 = q.higherKey(three);
-        assertEquals(four, e1);
-
-        Object e2 = q.higherKey(zero);
-        assertEquals(one, e2);
-
-        Object e3 = q.higherKey(five);
-        assertNull(e3);
-
-        Object e4 = q.higherKey(six);
-        assertNull(e4);
-    }
-
-    /**
-     * floorKey returns preceding element
-     */
-    public void testFloorKey() {
-        ConcurrentSkipListMap q = map5();
-        Object e1 = q.floorKey(three);
-        assertEquals(three, e1);
-
-        Object e2 = q.floorKey(six);
-        assertEquals(five, e2);
-
-        Object e3 = q.floorKey(one);
-        assertEquals(one, e3);
-
-        Object e4 = q.floorKey(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * ceilingKey returns next element
-     */
-    public void testCeilingKey() {
-        ConcurrentSkipListMap q = map5();
-        Object e1 = q.ceilingKey(three);
-        assertEquals(three, e1);
-
-        Object e2 = q.ceilingKey(zero);
-        assertEquals(one, e2);
-
-        Object e3 = q.ceilingKey(five);
-        assertEquals(five, e3);
-
-        Object e4 = q.ceilingKey(six);
-        assertNull(e4);
-    }
-
-    /**
-     * pollFirstEntry returns entries in order
-     */
-    public void testPollFirstEntry() {
-        ConcurrentSkipListMap map = map5();
-        Map.Entry e = map.pollFirstEntry();
-        assertEquals(one, e.getKey());
-        assertEquals("A", e.getValue());
-        e = map.pollFirstEntry();
-        assertEquals(two, e.getKey());
-        map.put(one, "A");
-        e = map.pollFirstEntry();
-        assertEquals(one, e.getKey());
-        assertEquals("A", e.getValue());
-        e = map.pollFirstEntry();
-        assertEquals(three, e.getKey());
-        map.remove(four);
-        e = map.pollFirstEntry();
-        assertEquals(five, e.getKey());
-        try {
-            e.setValue("A");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.pollFirstEntry();
-        assertNull(e);
-    }
-
-    /**
-     * pollLastEntry returns entries in order
-     */
-    public void testPollLastEntry() {
-        ConcurrentSkipListMap map = map5();
-        Map.Entry e = map.pollLastEntry();
-        assertEquals(five, e.getKey());
-        assertEquals("E", e.getValue());
-        e = map.pollLastEntry();
-        assertEquals(four, e.getKey());
-        map.put(five, "E");
-        e = map.pollLastEntry();
-        assertEquals(five, e.getKey());
-        assertEquals("E", e.getValue());
-        e = map.pollLastEntry();
-        assertEquals(three, e.getKey());
-        map.remove(two);
-        e = map.pollLastEntry();
-        assertEquals(one, e.getKey());
-        try {
-            e.setValue("E");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.pollLastEntry();
-        assertNull(e);
-    }
-
-    /**
-     *   size returns the correct values
-     */
-    public void testSize() {
-        ConcurrentSkipListMap map = map5();
-        ConcurrentSkipListMap empty = new ConcurrentSkipListMap();
-        assertEquals(0, empty.size());
-        assertEquals(5, map.size());
-    }
-
-    /**
-     * toString contains toString of elements
-     */
-    public void testToString() {
-        ConcurrentSkipListMap map = map5();
-        String s = map.toString();
-        for (int i = 1; i <= 5; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    // Exception tests
-
-    /**
-     * get(null) of nonempty map throws NPE
-     */
-    public void testGet_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = map5();
-            c.get(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsKey(null) of nonempty map throws NPE
-     */
-    public void testContainsKey_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = map5();
-            c.containsKey(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsValue(null) throws NPE
-     */
-    public void testContainsValue_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = new ConcurrentSkipListMap();
-            c.containsValue(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * put(null,x) throws NPE
-     */
-    public void testPut1_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = map5();
-            c.put(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * putIfAbsent(null, x) throws NPE
-     */
-    public void testPutIfAbsent1_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = map5();
-            c.putIfAbsent(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x) throws NPE
-     */
-    public void testReplace_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = map5();
-            c.replace(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x, y) throws NPE
-     */
-    public void testReplaceValue_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = map5();
-            c.replace(null, one, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(null) throws NPE
-     */
-    public void testRemove1_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = new ConcurrentSkipListMap();
-            c.put("sadsdf", "asdads");
-            c.remove(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(null, x) throws NPE
-     */
-    public void testRemove2_NullPointerException() {
-        try {
-            ConcurrentSkipListMap c = new ConcurrentSkipListMap();
-            c.put("sadsdf", "asdads");
-            c.remove(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(x, null) returns false
-     */
-    public void testRemove3() {
-        ConcurrentSkipListMap c = new ConcurrentSkipListMap();
-        c.put("sadsdf", "asdads");
-        assertFalse(c.remove("sadsdf", null));
-    }
-
-    /**
-     * A deserialized map equals original
-     */
-    public void testSerialization() throws Exception {
-        ConcurrentSkipListMap q = map5();
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ConcurrentSkipListMap r = (ConcurrentSkipListMap)in.readObject();
-        assertEquals(q.size(), r.size());
-        assertTrue(q.equals(r));
-        assertTrue(r.equals(q));
-    }
-
-
-
-    /**
-     * subMap returns map with keys in requested range
-     */
-    public void testSubMapContents() {
-        ConcurrentSkipListMap map = map5();
-        NavigableMap sm = map.subMap(two, true, four, false);
-        assertEquals(two, sm.firstKey());
-        assertEquals(three, sm.lastKey());
-        assertEquals(2, sm.size());
-        assertFalse(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertTrue(sm.containsKey(three));
-        assertFalse(sm.containsKey(four));
-        assertFalse(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        Iterator r = sm.descendingKeySet().iterator();
-        k = (Integer)(r.next());
-        assertEquals(three, k);
-        k = (Integer)(r.next());
-        assertEquals(two, k);
-        assertFalse(r.hasNext());
-
-        Iterator j = sm.keySet().iterator();
-        j.next();
-        j.remove();
-        assertFalse(map.containsKey(two));
-        assertEquals(4, map.size());
-        assertEquals(1, sm.size());
-        assertEquals(three, sm.firstKey());
-        assertEquals(three, sm.lastKey());
-        assertEquals("C", sm.remove(three));
-        assertTrue(sm.isEmpty());
-        assertEquals(3, map.size());
-    }
-
-    public void testSubMapContents2() {
-        ConcurrentSkipListMap map = map5();
-        NavigableMap sm = map.subMap(two, true, three, false);
-        assertEquals(1, sm.size());
-        assertEquals(two, sm.firstKey());
-        assertEquals(two, sm.lastKey());
-        assertFalse(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertFalse(sm.containsKey(three));
-        assertFalse(sm.containsKey(four));
-        assertFalse(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        assertFalse(i.hasNext());
-        Iterator r = sm.descendingKeySet().iterator();
-        k = (Integer)(r.next());
-        assertEquals(two, k);
-        assertFalse(r.hasNext());
-
-        Iterator j = sm.keySet().iterator();
-        j.next();
-        j.remove();
-        assertFalse(map.containsKey(two));
-        assertEquals(4, map.size());
-        assertEquals(0, sm.size());
-        assertTrue(sm.isEmpty());
-        assertSame(sm.remove(three), null);
-        assertEquals(4, map.size());
-    }
-
-    /**
-     * headMap returns map with keys in requested range
-     */
-    public void testHeadMapContents() {
-        ConcurrentSkipListMap map = map5();
-        NavigableMap sm = map.headMap(four, false);
-        assertTrue(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertTrue(sm.containsKey(three));
-        assertFalse(sm.containsKey(four));
-        assertFalse(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(one, k);
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        sm.clear();
-        assertTrue(sm.isEmpty());
-        assertEquals(2, map.size());
-        assertEquals(four, map.firstKey());
-    }
-
-    /**
-     * tailMap returns map with keys in requested range
-     */
-    public void testTailMapContents() {
-        ConcurrentSkipListMap map = map5();
-        NavigableMap sm = map.tailMap(two, true);
-        assertFalse(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertTrue(sm.containsKey(three));
-        assertTrue(sm.containsKey(four));
-        assertTrue(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        k = (Integer)(i.next());
-        assertEquals(four, k);
-        k = (Integer)(i.next());
-        assertEquals(five, k);
-        assertFalse(i.hasNext());
-        Iterator r = sm.descendingKeySet().iterator();
-        k = (Integer)(r.next());
-        assertEquals(five, k);
-        k = (Integer)(r.next());
-        assertEquals(four, k);
-        k = (Integer)(r.next());
-        assertEquals(three, k);
-        k = (Integer)(r.next());
-        assertEquals(two, k);
-        assertFalse(r.hasNext());
-
-        Iterator ei = sm.entrySet().iterator();
-        Map.Entry e;
-        e = (Map.Entry)(ei.next());
-        assertEquals(two, e.getKey());
-        assertEquals("B", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(three, e.getKey());
-        assertEquals("C", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(four, e.getKey());
-        assertEquals("D", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(five, e.getKey());
-        assertEquals("E", e.getValue());
-        assertFalse(i.hasNext());
-
-        NavigableMap ssm = sm.tailMap(four, true);
-        assertEquals(four, ssm.firstKey());
-        assertEquals(five, ssm.lastKey());
-        assertEquals("D", ssm.remove(four));
-        assertEquals(1, ssm.size());
-        assertEquals(3, sm.size());
-        assertEquals(4, map.size());
-    }
-
-    Random rnd = new Random(666);
-    BitSet bs;
-
-    /**
-     * Submaps of submaps subdivide correctly
-     */
-    public void testRecursiveSubMaps() throws Exception {
-        int mapSize = 1000;
-        Class cl = ConcurrentSkipListMap.class;
-        NavigableMap<Integer, Integer> map = newMap(cl);
-        bs = new BitSet(mapSize);
-
-        populate(map, mapSize);
-        check(map,                 0, mapSize - 1, true);
-        check(map.descendingMap(), 0, mapSize - 1, false);
-
-        mutateMap(map, 0, mapSize - 1);
-        check(map,                 0, mapSize - 1, true);
-        check(map.descendingMap(), 0, mapSize - 1, false);
-
-        bashSubMap(map.subMap(0, true, mapSize, false),
-                   0, mapSize - 1, true);
-    }
-
-    static NavigableMap<Integer, Integer> newMap(Class cl) throws Exception {
-        NavigableMap<Integer, Integer> result =
-            (NavigableMap<Integer, Integer>) cl.newInstance();
-        assertEquals(result.size(), 0);
-        assertFalse(result.keySet().iterator().hasNext());
-        return result;
-    }
-
-    void populate(NavigableMap<Integer, Integer> map, int limit) {
-        for (int i = 0, n = 2 * limit / 3; i < n; i++) {
-            int key = rnd.nextInt(limit);
-            put(map, key);
-        }
-    }
-
-    void mutateMap(NavigableMap<Integer, Integer> map, int min, int max) {
-        int size = map.size();
-        int rangeSize = max - min + 1;
-
-        // Remove a bunch of entries directly
-        for (int i = 0, n = rangeSize / 2; i < n; i++) {
-            remove(map, min - 5 + rnd.nextInt(rangeSize + 10));
-        }
-
-        // Remove a bunch of entries with iterator
-        for (Iterator<Integer> it = map.keySet().iterator(); it.hasNext(); ) {
-            if (rnd.nextBoolean()) {
-                bs.clear(it.next());
-                it.remove();
-            }
-        }
-
-        // Add entries till we're back to original size
-        while (map.size() < size) {
-            int key = min + rnd.nextInt(rangeSize);
-            assertTrue(key >= min && key<= max);
-            put(map, key);
-        }
-    }
-
-    void mutateSubMap(NavigableMap<Integer, Integer> map, int min, int max) {
-        int size = map.size();
-        int rangeSize = max - min + 1;
-
-        // Remove a bunch of entries directly
-        for (int i = 0, n = rangeSize / 2; i < n; i++) {
-            remove(map, min - 5 + rnd.nextInt(rangeSize + 10));
-        }
-
-        // Remove a bunch of entries with iterator
-        for (Iterator<Integer> it = map.keySet().iterator(); it.hasNext(); ) {
-            if (rnd.nextBoolean()) {
-                bs.clear(it.next());
-                it.remove();
-            }
-        }
-
-        // Add entries till we're back to original size
-        while (map.size() < size) {
-            int key = min - 5 + rnd.nextInt(rangeSize + 10);
-            if (key >= min && key<= max) {
-                put(map, key);
-            } else {
-                try {
-                    map.put(key, 2 * key);
-                    shouldThrow();
-                } catch (IllegalArgumentException success) {}
-            }
-        }
-    }
-
-    void put(NavigableMap<Integer, Integer> map, int key) {
-        if (map.put(key, 2 * key) == null)
-            bs.set(key);
-    }
-
-    void remove(NavigableMap<Integer, Integer> map, int key) {
-        if (map.remove(key) != null)
-            bs.clear(key);
-    }
-
-    void bashSubMap(NavigableMap<Integer, Integer> map,
-                    int min, int max, boolean ascending) {
-        check(map, min, max, ascending);
-        check(map.descendingMap(), min, max, !ascending);
-
-        mutateSubMap(map, min, max);
-        check(map, min, max, ascending);
-        check(map.descendingMap(), min, max, !ascending);
-
-        // Recurse
-        if (max - min < 2)
-            return;
-        int midPoint = (min + max) / 2;
-
-        // headMap - pick direction and endpoint inclusion randomly
-        boolean incl = rnd.nextBoolean();
-        NavigableMap<Integer,Integer> hm = map.headMap(midPoint, incl);
-        if (ascending) {
-            if (rnd.nextBoolean())
-                bashSubMap(hm, min, midPoint - (incl ? 0 : 1), true);
-            else
-                bashSubMap(hm.descendingMap(), min, midPoint - (incl ? 0 : 1),
-                           false);
-        } else {
-            if (rnd.nextBoolean())
-                bashSubMap(hm, midPoint + (incl ? 0 : 1), max, false);
-            else
-                bashSubMap(hm.descendingMap(), midPoint + (incl ? 0 : 1), max,
-                           true);
-        }
-
-        // tailMap - pick direction and endpoint inclusion randomly
-        incl = rnd.nextBoolean();
-        NavigableMap<Integer,Integer> tm = map.tailMap(midPoint,incl);
-        if (ascending) {
-            if (rnd.nextBoolean())
-                bashSubMap(tm, midPoint + (incl ? 0 : 1), max, true);
-            else
-                bashSubMap(tm.descendingMap(), midPoint + (incl ? 0 : 1), max,
-                           false);
-        } else {
-            if (rnd.nextBoolean()) {
-                bashSubMap(tm, min, midPoint - (incl ? 0 : 1), false);
-            } else {
-                bashSubMap(tm.descendingMap(), min, midPoint - (incl ? 0 : 1),
-                           true);
-            }
-        }
-
-        // subMap - pick direction and endpoint inclusion randomly
-        int rangeSize = max - min + 1;
-        int[] endpoints = new int[2];
-        endpoints[0] = min + rnd.nextInt(rangeSize);
-        endpoints[1] = min + rnd.nextInt(rangeSize);
-        Arrays.sort(endpoints);
-        boolean lowIncl = rnd.nextBoolean();
-        boolean highIncl = rnd.nextBoolean();
-        if (ascending) {
-            NavigableMap<Integer,Integer> sm = map.subMap(
-                endpoints[0], lowIncl, endpoints[1], highIncl);
-            if (rnd.nextBoolean())
-                bashSubMap(sm, endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), true);
-            else
-                bashSubMap(sm.descendingMap(), endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), false);
-        } else {
-            NavigableMap<Integer,Integer> sm = map.subMap(
-                endpoints[1], highIncl, endpoints[0], lowIncl);
-            if (rnd.nextBoolean())
-                bashSubMap(sm, endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), false);
-            else
-                bashSubMap(sm.descendingMap(), endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), true);
-        }
-    }
-
-    /**
-     * min and max are both inclusive.  If max < min, interval is empty.
-     */
-    void check(NavigableMap<Integer, Integer> map,
-                      final int min, final int max, final boolean ascending) {
-       class ReferenceSet {
-            int lower(int key) {
-                return ascending ? lowerAscending(key) : higherAscending(key);
-            }
-            int floor(int key) {
-                return ascending ? floorAscending(key) : ceilingAscending(key);
-            }
-            int ceiling(int key) {
-                return ascending ? ceilingAscending(key) : floorAscending(key);
-            }
-            int higher(int key) {
-                return ascending ? higherAscending(key) : lowerAscending(key);
-            }
-            int first() {
-                return ascending ? firstAscending() : lastAscending();
-            }
-            int last() {
-                return ascending ? lastAscending() : firstAscending();
-            }
-            int lowerAscending(int key) {
-                return floorAscending(key - 1);
-            }
-            int floorAscending(int key) {
-                if (key < min)
-                    return -1;
-                else if (key > max)
-                    key = max;
-
-                // BitSet should support this! Test would run much faster
-                while (key >= min) {
-                    if (bs.get(key))
-                        return(key);
-                    key--;
-                }
-                return -1;
-            }
-            int ceilingAscending(int key) {
-                if (key < min)
-                    key = min;
-                else if (key > max)
-                    return -1;
-                int result = bs.nextSetBit(key);
-                return result > max ? -1 : result;
-            }
-            int higherAscending(int key) {
-                return ceilingAscending(key + 1);
-            }
-            private int firstAscending() {
-                int result = ceilingAscending(min);
-                return result > max ? -1 : result;
-            }
-            private int lastAscending() {
-                int result = floorAscending(max);
-                return result < min ? -1 : result;
-            }
-        }
-        ReferenceSet rs = new ReferenceSet();
-
-        // Test contents using containsKey
-        int size = 0;
-        for (int i = min; i <= max; i++) {
-            boolean bsContainsI = bs.get(i);
-            assertEquals(bsContainsI, map.containsKey(i));
-            if (bsContainsI)
-                size++;
-        }
-        assertEquals(map.size(), size);
-
-        // Test contents using contains keySet iterator
-        int size2 = 0;
-        int previousKey = -1;
-        for (int key : map.keySet()) {
-            assertTrue(bs.get(key));
-            size2++;
-            assertTrue(previousKey < 0 ||
-                (ascending ? key - previousKey > 0 : key - previousKey < 0));
-            previousKey = key;
-        }
-        assertEquals(size2, size);
-
-        // Test navigation ops
-        for (int key = min - 1; key <= max + 1; key++) {
-            assertEq(map.lowerKey(key), rs.lower(key));
-            assertEq(map.floorKey(key), rs.floor(key));
-            assertEq(map.higherKey(key), rs.higher(key));
-            assertEq(map.ceilingKey(key), rs.ceiling(key));
-        }
-
-        // Test extrema
-        if (map.size() != 0) {
-            assertEq(map.firstKey(), rs.first());
-            assertEq(map.lastKey(), rs.last());
-        } else {
-            assertEq(rs.first(), -1);
-            assertEq(rs.last(),  -1);
-            try {
-                map.firstKey();
-                shouldThrow();
-            } catch (NoSuchElementException success) {}
-            try {
-                map.lastKey();
-                shouldThrow();
-            } catch (NoSuchElementException success) {}
-        }
-    }
-
-    static void assertEq(Integer i, int j) {
-        if (i == null)
-            assertEquals(j, -1);
-        else
-            assertEquals((int) i, j);
-    }
-
-    static boolean eq(Integer i, int j) {
-        return i == null ? j == -1 : i == j;
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSetTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSetTest.java
deleted file mode 100644
index 2d03b3c..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSetTest.java
+++ /dev/null
@@ -1,961 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class ConcurrentSkipListSetTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ConcurrentSkipListSetTest.class);
-    }
-
-    static class MyReverseComparator implements Comparator {
-        public int compare(Object x, Object y) {
-            return ((Comparable)y).compareTo(x);
-        }
-    }
-
-    /**
-     * Create a set of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private ConcurrentSkipListSet populatedSet(int n) {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.isEmpty());
-        for (int i = n-1; i >= 0; i-=2)
-            assertTrue(q.add(new Integer(i)));
-        for (int i = (n & 1); i < n; i+=2)
-            assertTrue(q.add(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * Create set of first 5 ints
-     */
-    private ConcurrentSkipListSet set5() {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.isEmpty());
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        q.add(four);
-        q.add(five);
-        assertEquals(5, q.size());
-        return q;
-    }
-
-    /**
-     * A new set has unbounded capacity
-     */
-    public void testConstructor1() {
-        assertEquals(0, new ConcurrentSkipListSet().size());
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet((Collection)null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Set contains all elements of collection used to initialize
-     */
-    public void testConstructor6() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     * The comparator used in constructor is used
-     */
-    public void testConstructor7() {
-        MyReverseComparator cmp = new MyReverseComparator();
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet(cmp);
-        assertEquals(cmp, q.comparator());
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        q.addAll(Arrays.asList(ints));
-        for (int i = SIZE-1; i >= 0; --i)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.isEmpty());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.add(new Integer(2));
-        q.pollFirst();
-        q.pollFirst();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testSize() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.pollFirst();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Add of comparable element succeeds
-     */
-    public void testAdd() {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.add(zero));
-        assertTrue(q.add(one));
-    }
-
-    /**
-     * Add of duplicate element fails
-     */
-    public void testAddDup() {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.add(zero));
-        assertFalse(q.add(zero));
-    }
-
-    /**
-     * Add of non-Comparable throws CCE
-     */
-    public void testAddNonComparable() {
-        try {
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-            q.add(new Object());
-            q.add(new Object());
-            q.add(new Object());
-            shouldThrow();
-        } catch (ClassCastException success) {}
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Set contains all elements of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(SIZE-1-i);
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(i, q.pollFirst());
-    }
-
-    /**
-     * pollFirst succeeds unless empty
-     */
-    public void testPollFirst() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pollFirst());
-        }
-        assertNull(q.pollFirst());
-    }
-
-    /**
-     * pollLast succeeds unless empty
-     */
-    public void testPollLast() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        for (int i = SIZE-1; i >= 0; --i) {
-            assertEquals(i, q.pollLast());
-        }
-        assertNull(q.pollFirst());
-    }
-
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.pollFirst();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        ConcurrentSkipListSet p = new ConcurrentSkipListSet();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        ConcurrentSkipListSet p = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.pollFirst();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            ConcurrentSkipListSet q = populatedSet(SIZE);
-            ConcurrentSkipListSet p = populatedSet(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.pollFirst());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-
-
-    /**
-     * lower returns preceding element
-     */
-    public void testLower() {
-        ConcurrentSkipListSet q = set5();
-        Object e1 = q.lower(three);
-        assertEquals(two, e1);
-
-        Object e2 = q.lower(six);
-        assertEquals(five, e2);
-
-        Object e3 = q.lower(one);
-        assertNull(e3);
-
-        Object e4 = q.lower(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * higher returns next element
-     */
-    public void testHigher() {
-        ConcurrentSkipListSet q = set5();
-        Object e1 = q.higher(three);
-        assertEquals(four, e1);
-
-        Object e2 = q.higher(zero);
-        assertEquals(one, e2);
-
-        Object e3 = q.higher(five);
-        assertNull(e3);
-
-        Object e4 = q.higher(six);
-        assertNull(e4);
-    }
-
-    /**
-     * floor returns preceding element
-     */
-    public void testFloor() {
-        ConcurrentSkipListSet q = set5();
-        Object e1 = q.floor(three);
-        assertEquals(three, e1);
-
-        Object e2 = q.floor(six);
-        assertEquals(five, e2);
-
-        Object e3 = q.floor(one);
-        assertEquals(one, e3);
-
-        Object e4 = q.floor(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * ceiling returns next element
-     */
-    public void testCeiling() {
-        ConcurrentSkipListSet q = set5();
-        Object e1 = q.ceiling(three);
-        assertEquals(three, e1);
-
-        Object e2 = q.ceiling(zero);
-        assertEquals(one, e2);
-
-        Object e3 = q.ceiling(five);
-        assertEquals(five, e3);
-
-        Object e4 = q.ceiling(six);
-        assertNull(e4);
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testToArray() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.pollFirst());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     * iterator of empty set has no elements
-     */
-    public void testEmptyIterator() {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, 0);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        q.add(new Integer(2));
-        q.add(new Integer(1));
-        q.add(new Integer(3));
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertEquals(it.next(), new Integer(2));
-        assertEquals(it.next(), new Integer(3));
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * A deserialized serialized set has same elements
-     */
-    public void testSerialization() throws Exception {
-        ConcurrentSkipListSet q = populatedSet(SIZE);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ConcurrentSkipListSet r = (ConcurrentSkipListSet)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.pollFirst(), r.pollFirst());
-    }
-
-    /**
-     * subSet returns set with keys in requested range
-     */
-    public void testSubSetContents() {
-        ConcurrentSkipListSet set = set5();
-        SortedSet sm = set.subSet(two, four);
-        assertEquals(two, sm.first());
-        assertEquals(three, sm.last());
-        assertEquals(2, sm.size());
-        assertFalse(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertTrue(sm.contains(three));
-        assertFalse(sm.contains(four));
-        assertFalse(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.iterator();
-        j.next();
-        j.remove();
-        assertFalse(set.contains(two));
-        assertEquals(4, set.size());
-        assertEquals(1, sm.size());
-        assertEquals(three, sm.first());
-        assertEquals(three, sm.last());
-        assertTrue(sm.remove(three));
-        assertTrue(sm.isEmpty());
-        assertEquals(3, set.size());
-    }
-
-    public void testSubSetContents2() {
-        ConcurrentSkipListSet set = set5();
-        SortedSet sm = set.subSet(two, three);
-        assertEquals(1, sm.size());
-        assertEquals(two, sm.first());
-        assertEquals(two, sm.last());
-        assertFalse(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertFalse(sm.contains(three));
-        assertFalse(sm.contains(four));
-        assertFalse(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.iterator();
-        j.next();
-        j.remove();
-        assertFalse(set.contains(two));
-        assertEquals(4, set.size());
-        assertEquals(0, sm.size());
-        assertTrue(sm.isEmpty());
-        assertFalse(sm.remove(three));
-        assertEquals(4, set.size());
-    }
-
-    /**
-     * headSet returns set with keys in requested range
-     */
-    public void testHeadSetContents() {
-        ConcurrentSkipListSet set = set5();
-        SortedSet sm = set.headSet(four);
-        assertTrue(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertTrue(sm.contains(three));
-        assertFalse(sm.contains(four));
-        assertFalse(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(one, k);
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        sm.clear();
-        assertTrue(sm.isEmpty());
-        assertEquals(2, set.size());
-        assertEquals(four, set.first());
-    }
-
-    /**
-     * tailSet returns set with keys in requested range
-     */
-    public void testTailSetContents() {
-        ConcurrentSkipListSet set = set5();
-        SortedSet sm = set.tailSet(two);
-        assertFalse(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertTrue(sm.contains(three));
-        assertTrue(sm.contains(four));
-        assertTrue(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        k = (Integer)(i.next());
-        assertEquals(four, k);
-        k = (Integer)(i.next());
-        assertEquals(five, k);
-        assertFalse(i.hasNext());
-
-        SortedSet ssm = sm.tailSet(four);
-        assertEquals(four, ssm.first());
-        assertEquals(five, ssm.last());
-        assertTrue(ssm.remove(four));
-        assertEquals(1, ssm.size());
-        assertEquals(3, sm.size());
-        assertEquals(4, set.size());
-    }
-
-    Random rnd = new Random(666);
-    BitSet bs;
-
-    /**
-     * Subsets of subsets subdivide correctly
-     */
-    public void testRecursiveSubSets() throws Exception {
-        int setSize = 1000;
-        Class cl = ConcurrentSkipListSet.class;
-
-        NavigableSet<Integer> set = newSet(cl);
-        bs = new BitSet(setSize);
-
-        populate(set, setSize);
-        check(set,                 0, setSize - 1, true);
-        check(set.descendingSet(), 0, setSize - 1, false);
-
-        mutateSet(set, 0, setSize - 1);
-        check(set,                 0, setSize - 1, true);
-        check(set.descendingSet(), 0, setSize - 1, false);
-
-        bashSubSet(set.subSet(0, true, setSize, false),
-                   0, setSize - 1, true);
-    }
-
-    static NavigableSet<Integer> newSet(Class cl) throws Exception {
-        NavigableSet<Integer> result = (NavigableSet<Integer>) cl.newInstance();
-        assertEquals(result.size(), 0);
-        assertFalse(result.iterator().hasNext());
-        return result;
-    }
-
-    void populate(NavigableSet<Integer> set, int limit) {
-        for (int i = 0, n = 2 * limit / 3; i < n; i++) {
-            int element = rnd.nextInt(limit);
-            put(set, element);
-        }
-    }
-
-    void mutateSet(NavigableSet<Integer> set, int min, int max) {
-        int size = set.size();
-        int rangeSize = max - min + 1;
-
-        // Remove a bunch of entries directly
-        for (int i = 0, n = rangeSize / 2; i < n; i++) {
-            remove(set, min - 5 + rnd.nextInt(rangeSize + 10));
-        }
-
-        // Remove a bunch of entries with iterator
-        for (Iterator<Integer> it = set.iterator(); it.hasNext(); ) {
-            if (rnd.nextBoolean()) {
-                bs.clear(it.next());
-                it.remove();
-            }
-        }
-
-        // Add entries till we're back to original size
-        while (set.size() < size) {
-            int element = min + rnd.nextInt(rangeSize);
-            assertTrue(element >= min && element<= max);
-            put(set, element);
-        }
-    }
-
-    void mutateSubSet(NavigableSet<Integer> set, int min, int max) {
-        int size = set.size();
-        int rangeSize = max - min + 1;
-
-        // Remove a bunch of entries directly
-        for (int i = 0, n = rangeSize / 2; i < n; i++) {
-            remove(set, min - 5 + rnd.nextInt(rangeSize + 10));
-        }
-
-        // Remove a bunch of entries with iterator
-        for (Iterator<Integer> it = set.iterator(); it.hasNext(); ) {
-            if (rnd.nextBoolean()) {
-                bs.clear(it.next());
-                it.remove();
-            }
-        }
-
-        // Add entries till we're back to original size
-        while (set.size() < size) {
-            int element = min - 5 + rnd.nextInt(rangeSize + 10);
-            if (element >= min && element<= max) {
-                put(set, element);
-            } else {
-                try {
-                    set.add(element);
-                    shouldThrow();
-                } catch (IllegalArgumentException success) {}
-            }
-        }
-    }
-
-    void put(NavigableSet<Integer> set, int element) {
-        if (set.add(element))
-            bs.set(element);
-    }
-
-    void remove(NavigableSet<Integer> set, int element) {
-        if (set.remove(element))
-            bs.clear(element);
-    }
-
-    void bashSubSet(NavigableSet<Integer> set,
-                    int min, int max, boolean ascending) {
-        check(set, min, max, ascending);
-        check(set.descendingSet(), min, max, !ascending);
-
-        mutateSubSet(set, min, max);
-        check(set, min, max, ascending);
-        check(set.descendingSet(), min, max, !ascending);
-
-        // Recurse
-        if (max - min < 2)
-            return;
-        int midPoint = (min + max) / 2;
-
-        // headSet - pick direction and endpoint inclusion randomly
-        boolean incl = rnd.nextBoolean();
-        NavigableSet<Integer> hm = set.headSet(midPoint, incl);
-        if (ascending) {
-            if (rnd.nextBoolean())
-                bashSubSet(hm, min, midPoint - (incl ? 0 : 1), true);
-            else
-                bashSubSet(hm.descendingSet(), min, midPoint - (incl ? 0 : 1),
-                           false);
-        } else {
-            if (rnd.nextBoolean())
-                bashSubSet(hm, midPoint + (incl ? 0 : 1), max, false);
-            else
-                bashSubSet(hm.descendingSet(), midPoint + (incl ? 0 : 1), max,
-                           true);
-        }
-
-        // tailSet - pick direction and endpoint inclusion randomly
-        incl = rnd.nextBoolean();
-        NavigableSet<Integer> tm = set.tailSet(midPoint,incl);
-        if (ascending) {
-            if (rnd.nextBoolean())
-                bashSubSet(tm, midPoint + (incl ? 0 : 1), max, true);
-            else
-                bashSubSet(tm.descendingSet(), midPoint + (incl ? 0 : 1), max,
-                           false);
-        } else {
-            if (rnd.nextBoolean()) {
-                bashSubSet(tm, min, midPoint - (incl ? 0 : 1), false);
-            } else {
-                bashSubSet(tm.descendingSet(), min, midPoint - (incl ? 0 : 1),
-                           true);
-            }
-        }
-
-        // subSet - pick direction and endpoint inclusion randomly
-        int rangeSize = max - min + 1;
-        int[] endpoints = new int[2];
-        endpoints[0] = min + rnd.nextInt(rangeSize);
-        endpoints[1] = min + rnd.nextInt(rangeSize);
-        Arrays.sort(endpoints);
-        boolean lowIncl = rnd.nextBoolean();
-        boolean highIncl = rnd.nextBoolean();
-        if (ascending) {
-            NavigableSet<Integer> sm = set.subSet(
-                endpoints[0], lowIncl, endpoints[1], highIncl);
-            if (rnd.nextBoolean())
-                bashSubSet(sm, endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), true);
-            else
-                bashSubSet(sm.descendingSet(), endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), false);
-        } else {
-            NavigableSet<Integer> sm = set.subSet(
-                endpoints[1], highIncl, endpoints[0], lowIncl);
-            if (rnd.nextBoolean())
-                bashSubSet(sm, endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), false);
-            else
-                bashSubSet(sm.descendingSet(), endpoints[0] + (lowIncl ? 0 : 1),
-                           endpoints[1] - (highIncl ? 0 : 1), true);
-        }
-    }
-
-    /**
-     * min and max are both inclusive.  If max < min, interval is empty.
-     */
-    void check(NavigableSet<Integer> set,
-                      final int min, final int max, final boolean ascending) {
-       class ReferenceSet {
-            int lower(int element) {
-                return ascending ?
-                    lowerAscending(element) : higherAscending(element);
-            }
-            int floor(int element) {
-                return ascending ?
-                    floorAscending(element) : ceilingAscending(element);
-            }
-            int ceiling(int element) {
-                return ascending ?
-                    ceilingAscending(element) : floorAscending(element);
-            }
-            int higher(int element) {
-                return ascending ?
-                    higherAscending(element) : lowerAscending(element);
-            }
-            int first() {
-                return ascending ? firstAscending() : lastAscending();
-            }
-            int last() {
-                return ascending ? lastAscending() : firstAscending();
-            }
-            int lowerAscending(int element) {
-                return floorAscending(element - 1);
-            }
-            int floorAscending(int element) {
-                if (element < min)
-                    return -1;
-                else if (element > max)
-                    element = max;
-
-                // BitSet should support this! Test would run much faster
-                while (element >= min) {
-                    if (bs.get(element))
-                        return(element);
-                    element--;
-                }
-                return -1;
-            }
-            int ceilingAscending(int element) {
-                if (element < min)
-                    element = min;
-                else if (element > max)
-                    return -1;
-                int result = bs.nextSetBit(element);
-                return result > max ? -1 : result;
-            }
-            int higherAscending(int element) {
-                return ceilingAscending(element + 1);
-            }
-            private int firstAscending() {
-                int result = ceilingAscending(min);
-                return result > max ? -1 : result;
-            }
-            private int lastAscending() {
-                int result = floorAscending(max);
-                return result < min ? -1 : result;
-            }
-        }
-        ReferenceSet rs = new ReferenceSet();
-
-        // Test contents using containsElement
-        int size = 0;
-        for (int i = min; i <= max; i++) {
-            boolean bsContainsI = bs.get(i);
-            assertEquals(bsContainsI, set.contains(i));
-            if (bsContainsI)
-                size++;
-        }
-        assertEquals(set.size(), size);
-
-        // Test contents using contains elementSet iterator
-        int size2 = 0;
-        int previousElement = -1;
-        for (int element : set) {
-            assertTrue(bs.get(element));
-            size2++;
-            assertTrue(previousElement < 0 || (ascending ?
-                element - previousElement > 0 : element - previousElement < 0));
-            previousElement = element;
-        }
-        assertEquals(size2, size);
-
-        // Test navigation ops
-        for (int element = min - 1; element <= max + 1; element++) {
-            assertEq(set.lower(element), rs.lower(element));
-            assertEq(set.floor(element), rs.floor(element));
-            assertEq(set.higher(element), rs.higher(element));
-            assertEq(set.ceiling(element), rs.ceiling(element));
-        }
-
-        // Test extrema
-        if (set.size() != 0) {
-            assertEq(set.first(), rs.first());
-            assertEq(set.last(), rs.last());
-        } else {
-            assertEq(rs.first(), -1);
-            assertEq(rs.last(),  -1);
-            try {
-                set.first();
-                shouldThrow();
-            } catch (NoSuchElementException success) {}
-            try {
-                set.last();
-                shouldThrow();
-            } catch (NoSuchElementException success) {}
-        }
-    }
-
-    static void assertEq(Integer i, int j) {
-        if (i == null)
-            assertEquals(j, -1);
-        else
-            assertEquals((int) i, j);
-    }
-
-    static boolean eq(Integer i, int j) {
-        return i == null ? j == -1 : i == j;
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSubMapTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSubMapTest.java
deleted file mode 100644
index fc70935..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSubMapTest.java
+++ /dev/null
@@ -1,1438 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class ConcurrentSkipListSubMapTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ConcurrentSkipListSubMapTest.class);
-    }
-
-    /**
-     * Create a map from Integers 1-5 to Strings "A"-"E".
-     */
-    private static ConcurrentNavigableMap map5() {
-        ConcurrentSkipListMap map = new ConcurrentSkipListMap();
-        assertTrue(map.isEmpty());
-        map.put(zero, "Z");
-        map.put(one, "A");
-        map.put(five, "E");
-        map.put(three, "C");
-        map.put(two, "B");
-        map.put(four, "D");
-        map.put(seven, "F");
-        assertFalse(map.isEmpty());
-        assertEquals(7, map.size());
-        return map.subMap(one, true, seven, false);
-    }
-
-    /**
-     * Create a map from Integers -5 to -1 to Strings "A"-"E".
-     */
-    private static ConcurrentNavigableMap dmap5() {
-        ConcurrentSkipListMap map = new ConcurrentSkipListMap();
-        assertTrue(map.isEmpty());
-        map.put(m1, "A");
-        map.put(m5, "E");
-        map.put(m3, "C");
-        map.put(m2, "B");
-        map.put(m4, "D");
-        assertFalse(map.isEmpty());
-        assertEquals(5, map.size());
-        return map.descendingMap();
-    }
-
-    private static ConcurrentNavigableMap map0() {
-        ConcurrentSkipListMap map = new ConcurrentSkipListMap();
-        assertTrue(map.isEmpty());
-        return map.tailMap(one, true);
-    }
-
-    private static ConcurrentNavigableMap dmap0() {
-        ConcurrentSkipListMap map = new ConcurrentSkipListMap();
-        assertTrue(map.isEmpty());
-        return map;
-    }
-
-    /**
-     *  clear removes all pairs
-     */
-    public void testClear() {
-        ConcurrentNavigableMap map = map5();
-        map.clear();
-        assertEquals(map.size(), 0);
-    }
-
-
-    /**
-     *  Maps with same contents are equal
-     */
-    public void testEquals() {
-        ConcurrentNavigableMap map1 = map5();
-        ConcurrentNavigableMap map2 = map5();
-        assertEquals(map1, map2);
-        assertEquals(map2, map1);
-        map1.clear();
-        assertFalse(map1.equals(map2));
-        assertFalse(map2.equals(map1));
-    }
-
-    /**
-     *  containsKey returns true for contained key
-     */
-    public void testContainsKey() {
-        ConcurrentNavigableMap map = map5();
-        assertTrue(map.containsKey(one));
-        assertFalse(map.containsKey(zero));
-    }
-
-    /**
-     *  containsValue returns true for held values
-     */
-    public void testContainsValue() {
-        ConcurrentNavigableMap map = map5();
-        assertTrue(map.containsValue("A"));
-        assertFalse(map.containsValue("Z"));
-    }
-
-    /**
-     *  get returns the correct element at the given key,
-     *  or null if not present
-     */
-    public void testGet() {
-        ConcurrentNavigableMap map = map5();
-        assertEquals("A", (String)map.get(one));
-        ConcurrentNavigableMap empty = map0();
-        assertNull(empty.get(one));
-    }
-
-    /**
-     *  isEmpty is true of empty map and false for non-empty
-     */
-    public void testIsEmpty() {
-        ConcurrentNavigableMap empty = map0();
-        ConcurrentNavigableMap map = map5();
-        assertTrue(empty.isEmpty());
-        assertFalse(map.isEmpty());
-    }
-
-    /**
-     *   firstKey returns first key
-     */
-    public void testFirstKey() {
-        ConcurrentNavigableMap map = map5();
-        assertEquals(one, map.firstKey());
-    }
-
-    /**
-     *   lastKey returns last key
-     */
-    public void testLastKey() {
-        ConcurrentNavigableMap map = map5();
-        assertEquals(five, map.lastKey());
-    }
-
-
-    /**
-     *   keySet returns a Set containing all the keys
-     */
-    public void testKeySet() {
-        ConcurrentNavigableMap map = map5();
-        Set s = map.keySet();
-        assertEquals(5, s.size());
-        assertTrue(s.contains(one));
-        assertTrue(s.contains(two));
-        assertTrue(s.contains(three));
-        assertTrue(s.contains(four));
-        assertTrue(s.contains(five));
-    }
-
-    /**
-     *   keySet is ordered
-     */
-    public void testKeySetOrder() {
-        ConcurrentNavigableMap map = map5();
-        Set s = map.keySet();
-        Iterator i = s.iterator();
-        Integer last = (Integer)i.next();
-        assertEquals(last, one);
-        while (i.hasNext()) {
-            Integer k = (Integer)i.next();
-            assertTrue(last.compareTo(k) < 0);
-            last = k;
-        }
-    }
-
-    /**
-     * values collection contains all values
-     */
-    public void testValues() {
-        ConcurrentNavigableMap map = map5();
-        Collection s = map.values();
-        assertEquals(5, s.size());
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     *  keySet.toArray returns contains all keys
-     */
-    public void testKeySetToArray() {
-        ConcurrentNavigableMap map = map5();
-        Set s = map.keySet();
-        Object[] ar = s.toArray();
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        assertEquals(5, ar.length);
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     *  descendingkeySet.toArray returns contains all keys
-     */
-    public void testDescendingKeySetToArray() {
-        ConcurrentNavigableMap map = map5();
-        Set s = map.descendingKeySet();
-        Object[] ar = s.toArray();
-        assertEquals(5, ar.length);
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     *  Values.toArray contains all values
-     */
-    public void testValuesToArray() {
-        ConcurrentNavigableMap map = map5();
-        Collection v = map.values();
-        Object[] ar = v.toArray();
-        ArrayList s = new ArrayList(Arrays.asList(ar));
-        assertEquals(5, ar.length);
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-
-    /**
-     * entrySet contains all pairs
-     */
-    public void testEntrySet() {
-        ConcurrentNavigableMap map = map5();
-        Set s = map.entrySet();
-        assertEquals(5, s.size());
-        Iterator it = s.iterator();
-        while (it.hasNext()) {
-            Map.Entry e = (Map.Entry) it.next();
-            assertTrue(
-                       (e.getKey().equals(one) && e.getValue().equals("A")) ||
-                       (e.getKey().equals(two) && e.getValue().equals("B")) ||
-                       (e.getKey().equals(three) && e.getValue().equals("C")) ||
-                       (e.getKey().equals(four) && e.getValue().equals("D")) ||
-                       (e.getKey().equals(five) && e.getValue().equals("E")));
-        }
-    }
-
-    /**
-     *   putAll  adds all key-value pairs from the given map
-     */
-    public void testPutAll() {
-        ConcurrentNavigableMap empty = map0();
-        ConcurrentNavigableMap map = map5();
-        empty.putAll(map);
-        assertEquals(5, empty.size());
-        assertTrue(empty.containsKey(one));
-        assertTrue(empty.containsKey(two));
-        assertTrue(empty.containsKey(three));
-        assertTrue(empty.containsKey(four));
-        assertTrue(empty.containsKey(five));
-    }
-
-    /**
-     *   putIfAbsent works when the given key is not present
-     */
-    public void testPutIfAbsent() {
-        ConcurrentNavigableMap map = map5();
-        map.putIfAbsent(six, "Z");
-        assertTrue(map.containsKey(six));
-    }
-
-    /**
-     *   putIfAbsent does not add the pair if the key is already present
-     */
-    public void testPutIfAbsent2() {
-        ConcurrentNavigableMap map = map5();
-        assertEquals("A", map.putIfAbsent(one, "Z"));
-    }
-
-    /**
-     *   replace fails when the given key is not present
-     */
-    public void testReplace() {
-        ConcurrentNavigableMap map = map5();
-        assertNull(map.replace(six, "Z"));
-        assertFalse(map.containsKey(six));
-    }
-
-    /**
-     *   replace succeeds if the key is already present
-     */
-    public void testReplace2() {
-        ConcurrentNavigableMap map = map5();
-        assertNotNull(map.replace(one, "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     * replace value fails when the given key not mapped to expected value
-     */
-    public void testReplaceValue() {
-        ConcurrentNavigableMap map = map5();
-        assertEquals("A", map.get(one));
-        assertFalse(map.replace(one, "Z", "Z"));
-        assertEquals("A", map.get(one));
-    }
-
-    /**
-     * replace value succeeds when the given key mapped to expected value
-     */
-    public void testReplaceValue2() {
-        ConcurrentNavigableMap map = map5();
-        assertEquals("A", map.get(one));
-        assertTrue(map.replace(one, "A", "Z"));
-        assertEquals("Z", map.get(one));
-    }
-
-
-    /**
-     *   remove removes the correct key-value pair from the map
-     */
-    public void testRemove() {
-        ConcurrentNavigableMap map = map5();
-        map.remove(five);
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-    }
-
-    /**
-     * remove(key,value) removes only if pair present
-     */
-    public void testRemove2() {
-        ConcurrentNavigableMap map = map5();
-        assertTrue(map.containsKey(five));
-        assertEquals("E", map.get(five));
-        map.remove(five, "E");
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(five));
-        map.remove(four, "A");
-        assertEquals(4, map.size());
-        assertTrue(map.containsKey(four));
-    }
-
-    /**
-     * lowerEntry returns preceding entry.
-     */
-    public void testLowerEntry() {
-        ConcurrentNavigableMap map = map5();
-        Map.Entry e1 = map.lowerEntry(three);
-        assertEquals(two, e1.getKey());
-
-        Map.Entry e2 = map.lowerEntry(six);
-        assertEquals(five, e2.getKey());
-
-        Map.Entry e3 = map.lowerEntry(one);
-        assertNull(e3);
-
-        Map.Entry e4 = map.lowerEntry(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * higherEntry returns next entry.
-     */
-    public void testHigherEntry() {
-        ConcurrentNavigableMap map = map5();
-        Map.Entry e1 = map.higherEntry(three);
-        assertEquals(four, e1.getKey());
-
-        Map.Entry e2 = map.higherEntry(zero);
-        assertEquals(one, e2.getKey());
-
-        Map.Entry e3 = map.higherEntry(five);
-        assertNull(e3);
-
-        Map.Entry e4 = map.higherEntry(six);
-        assertNull(e4);
-    }
-
-    /**
-     * floorEntry returns preceding entry.
-     */
-    public void testFloorEntry() {
-        ConcurrentNavigableMap map = map5();
-        Map.Entry e1 = map.floorEntry(three);
-        assertEquals(three, e1.getKey());
-
-        Map.Entry e2 = map.floorEntry(six);
-        assertEquals(five, e2.getKey());
-
-        Map.Entry e3 = map.floorEntry(one);
-        assertEquals(one, e3.getKey());
-
-        Map.Entry e4 = map.floorEntry(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * ceilingEntry returns next entry.
-     */
-    public void testCeilingEntry() {
-        ConcurrentNavigableMap map = map5();
-        Map.Entry e1 = map.ceilingEntry(three);
-        assertEquals(three, e1.getKey());
-
-        Map.Entry e2 = map.ceilingEntry(zero);
-        assertEquals(one, e2.getKey());
-
-        Map.Entry e3 = map.ceilingEntry(five);
-        assertEquals(five, e3.getKey());
-
-        Map.Entry e4 = map.ceilingEntry(six);
-        assertNull(e4);
-    }
-
-    /**
-     * pollFirstEntry returns entries in order
-     */
-    public void testPollFirstEntry() {
-        ConcurrentNavigableMap map = map5();
-        Map.Entry e = map.pollFirstEntry();
-        assertEquals(one, e.getKey());
-        assertEquals("A", e.getValue());
-        e = map.pollFirstEntry();
-        assertEquals(two, e.getKey());
-        map.put(one, "A");
-        e = map.pollFirstEntry();
-        assertEquals(one, e.getKey());
-        assertEquals("A", e.getValue());
-        e = map.pollFirstEntry();
-        assertEquals(three, e.getKey());
-        map.remove(four);
-        e = map.pollFirstEntry();
-        assertEquals(five, e.getKey());
-        try {
-            e.setValue("A");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.pollFirstEntry();
-        assertNull(e);
-    }
-
-    /**
-     * pollLastEntry returns entries in order
-     */
-    public void testPollLastEntry() {
-        ConcurrentNavigableMap map = map5();
-        Map.Entry e = map.pollLastEntry();
-        assertEquals(five, e.getKey());
-        assertEquals("E", e.getValue());
-        e = map.pollLastEntry();
-        assertEquals(four, e.getKey());
-        map.put(five, "E");
-        e = map.pollLastEntry();
-        assertEquals(five, e.getKey());
-        assertEquals("E", e.getValue());
-        e = map.pollLastEntry();
-        assertEquals(three, e.getKey());
-        map.remove(two);
-        e = map.pollLastEntry();
-        assertEquals(one, e.getKey());
-        try {
-            e.setValue("E");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.pollLastEntry();
-        assertNull(e);
-    }
-
-    /**
-     *   size returns the correct values
-     */
-    public void testSize() {
-        ConcurrentNavigableMap map = map5();
-        ConcurrentNavigableMap empty = map0();
-        assertEquals(0, empty.size());
-        assertEquals(5, map.size());
-    }
-
-    /**
-     * toString contains toString of elements
-     */
-    public void testToString() {
-        ConcurrentNavigableMap map = map5();
-        String s = map.toString();
-        for (int i = 1; i <= 5; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    // Exception tests
-
-    /**
-     * get(null) of nonempty map throws NPE
-     */
-    public void testGet_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.get(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsKey(null) of nonempty map throws NPE
-     */
-    public void testContainsKey_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.containsKey(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsValue(null) throws NPE
-     */
-    public void testContainsValue_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map0();
-            c.containsValue(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * put(null,x) throws NPE
-     */
-    public void testPut1_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.put(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * putIfAbsent(null, x) throws NPE
-     */
-    public void testPutIfAbsent1_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.putIfAbsent(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x) throws NPE
-     */
-    public void testReplace_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.replace(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x, y) throws NPE
-     */
-    public void testReplaceValue_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.replace(null, one, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(null) throws NPE
-     */
-    public void testRemove1_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.remove(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(null, x) throws NPE
-     */
-    public void testRemove2_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = map5();
-            c.remove(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * A deserialized map equals original
-     */
-    public void testSerialization() throws Exception {
-        ConcurrentNavigableMap q = map5();
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ConcurrentNavigableMap r = (ConcurrentNavigableMap)in.readObject();
-        assertEquals(q.size(), r.size());
-        assertTrue(q.equals(r));
-        assertTrue(r.equals(q));
-    }
-
-
-
-    /**
-     * subMap returns map with keys in requested range
-     */
-    public void testSubMapContents() {
-        ConcurrentNavigableMap map = map5();
-        SortedMap sm = map.subMap(two, four);
-        assertEquals(two, sm.firstKey());
-        assertEquals(three, sm.lastKey());
-        assertEquals(2, sm.size());
-        assertFalse(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertTrue(sm.containsKey(three));
-        assertFalse(sm.containsKey(four));
-        assertFalse(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.keySet().iterator();
-        j.next();
-        j.remove();
-        assertFalse(map.containsKey(two));
-        assertEquals(4, map.size());
-        assertEquals(1, sm.size());
-        assertEquals(three, sm.firstKey());
-        assertEquals(three, sm.lastKey());
-        assertEquals("C", sm.remove(three));
-        assertTrue(sm.isEmpty());
-        assertEquals(3, map.size());
-    }
-
-    public void testSubMapContents2() {
-        ConcurrentNavigableMap map = map5();
-        SortedMap sm = map.subMap(two, three);
-        assertEquals(1, sm.size());
-        assertEquals(two, sm.firstKey());
-        assertEquals(two, sm.lastKey());
-        assertFalse(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertFalse(sm.containsKey(three));
-        assertFalse(sm.containsKey(four));
-        assertFalse(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.keySet().iterator();
-        j.next();
-        j.remove();
-        assertFalse(map.containsKey(two));
-        assertEquals(4, map.size());
-        assertEquals(0, sm.size());
-        assertTrue(sm.isEmpty());
-        assertSame(sm.remove(three), null);
-        assertEquals(4, map.size());
-    }
-
-    /**
-     * headMap returns map with keys in requested range
-     */
-    public void testHeadMapContents() {
-        ConcurrentNavigableMap map = map5();
-        SortedMap sm = map.headMap(four);
-        assertTrue(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertTrue(sm.containsKey(three));
-        assertFalse(sm.containsKey(four));
-        assertFalse(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(one, k);
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        sm.clear();
-        assertTrue(sm.isEmpty());
-        assertEquals(2, map.size());
-        assertEquals(four, map.firstKey());
-    }
-
-    /**
-     * headMap returns map with keys in requested range
-     */
-    public void testTailMapContents() {
-        ConcurrentNavigableMap map = map5();
-        SortedMap sm = map.tailMap(two);
-        assertFalse(sm.containsKey(one));
-        assertTrue(sm.containsKey(two));
-        assertTrue(sm.containsKey(three));
-        assertTrue(sm.containsKey(four));
-        assertTrue(sm.containsKey(five));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        k = (Integer)(i.next());
-        assertEquals(four, k);
-        k = (Integer)(i.next());
-        assertEquals(five, k);
-        assertFalse(i.hasNext());
-
-        Iterator ei = sm.entrySet().iterator();
-        Map.Entry e;
-        e = (Map.Entry)(ei.next());
-        assertEquals(two, e.getKey());
-        assertEquals("B", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(three, e.getKey());
-        assertEquals("C", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(four, e.getKey());
-        assertEquals("D", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(five, e.getKey());
-        assertEquals("E", e.getValue());
-        assertFalse(i.hasNext());
-
-        SortedMap ssm = sm.tailMap(four);
-        assertEquals(four, ssm.firstKey());
-        assertEquals(five, ssm.lastKey());
-        assertEquals("D", ssm.remove(four));
-        assertEquals(1, ssm.size());
-        assertEquals(3, sm.size());
-        assertEquals(4, map.size());
-    }
-
-    /**
-     *  clear removes all pairs
-     */
-    public void testDescendingClear() {
-        ConcurrentNavigableMap map = dmap5();
-        map.clear();
-        assertEquals(map.size(), 0);
-    }
-
-
-    /**
-     *  Maps with same contents are equal
-     */
-    public void testDescendingEquals() {
-        ConcurrentNavigableMap map1 = dmap5();
-        ConcurrentNavigableMap map2 = dmap5();
-        assertEquals(map1, map2);
-        assertEquals(map2, map1);
-        map1.clear();
-        assertFalse(map1.equals(map2));
-        assertFalse(map2.equals(map1));
-    }
-
-    /**
-     *  containsKey returns true for contained key
-     */
-    public void testDescendingContainsKey() {
-        ConcurrentNavigableMap map = dmap5();
-        assertTrue(map.containsKey(m1));
-        assertFalse(map.containsKey(zero));
-    }
-
-    /**
-     *  containsValue returns true for held values
-     */
-    public void testDescendingContainsValue() {
-        ConcurrentNavigableMap map = dmap5();
-        assertTrue(map.containsValue("A"));
-        assertFalse(map.containsValue("Z"));
-    }
-
-    /**
-     *  get returns the correct element at the given key,
-     *  or null if not present
-     */
-    public void testDescendingGet() {
-        ConcurrentNavigableMap map = dmap5();
-        assertEquals("A", (String)map.get(m1));
-        ConcurrentNavigableMap empty = dmap0();
-        assertNull(empty.get(m1));
-    }
-
-    /**
-     *  isEmpty is true of empty map and false for non-empty
-     */
-    public void testDescendingIsEmpty() {
-        ConcurrentNavigableMap empty = dmap0();
-        ConcurrentNavigableMap map = dmap5();
-        assertTrue(empty.isEmpty());
-        assertFalse(map.isEmpty());
-    }
-
-    /**
-     *   firstKey returns first key
-     */
-    public void testDescendingFirstKey() {
-        ConcurrentNavigableMap map = dmap5();
-        assertEquals(m1, map.firstKey());
-    }
-
-    /**
-     *   lastKey returns last key
-     */
-    public void testDescendingLastKey() {
-        ConcurrentNavigableMap map = dmap5();
-        assertEquals(m5, map.lastKey());
-    }
-
-
-    /**
-     *   keySet returns a Set containing all the keys
-     */
-    public void testDescendingKeySet() {
-        ConcurrentNavigableMap map = dmap5();
-        Set s = map.keySet();
-        assertEquals(5, s.size());
-        assertTrue(s.contains(m1));
-        assertTrue(s.contains(m2));
-        assertTrue(s.contains(m3));
-        assertTrue(s.contains(m4));
-        assertTrue(s.contains(m5));
-    }
-
-    /**
-     *   keySet is ordered
-     */
-    public void testDescendingKeySetOrder() {
-        ConcurrentNavigableMap map = dmap5();
-        Set s = map.keySet();
-        Iterator i = s.iterator();
-        Integer last = (Integer)i.next();
-        assertEquals(last, m1);
-        while (i.hasNext()) {
-            Integer k = (Integer)i.next();
-            assertTrue(last.compareTo(k) > 0);
-            last = k;
-        }
-    }
-
-    /**
-     * values collection contains all values
-     */
-    public void testDescendingValues() {
-        ConcurrentNavigableMap map = dmap5();
-        Collection s = map.values();
-        assertEquals(5, s.size());
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-    /**
-     *  keySet.toArray returns contains all keys
-     */
-    public void testDescendingAscendingKeySetToArray() {
-        ConcurrentNavigableMap map = dmap5();
-        Set s = map.keySet();
-        Object[] ar = s.toArray();
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        assertEquals(5, ar.length);
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     *  descendingkeySet.toArray returns contains all keys
-     */
-    public void testDescendingDescendingKeySetToArray() {
-        ConcurrentNavigableMap map = dmap5();
-        Set s = map.descendingKeySet();
-        Object[] ar = s.toArray();
-        assertEquals(5, ar.length);
-        assertTrue(s.containsAll(Arrays.asList(ar)));
-        ar[0] = m10;
-        assertFalse(s.containsAll(Arrays.asList(ar)));
-    }
-
-    /**
-     *  Values.toArray contains all values
-     */
-    public void testDescendingValuesToArray() {
-        ConcurrentNavigableMap map = dmap5();
-        Collection v = map.values();
-        Object[] ar = v.toArray();
-        ArrayList s = new ArrayList(Arrays.asList(ar));
-        assertEquals(5, ar.length);
-        assertTrue(s.contains("A"));
-        assertTrue(s.contains("B"));
-        assertTrue(s.contains("C"));
-        assertTrue(s.contains("D"));
-        assertTrue(s.contains("E"));
-    }
-
-
-    /**
-     * entrySet contains all pairs
-     */
-    public void testDescendingEntrySet() {
-        ConcurrentNavigableMap map = dmap5();
-        Set s = map.entrySet();
-        assertEquals(5, s.size());
-        Iterator it = s.iterator();
-        while (it.hasNext()) {
-            Map.Entry e = (Map.Entry) it.next();
-            assertTrue(
-                       (e.getKey().equals(m1) && e.getValue().equals("A")) ||
-                       (e.getKey().equals(m2) && e.getValue().equals("B")) ||
-                       (e.getKey().equals(m3) && e.getValue().equals("C")) ||
-                       (e.getKey().equals(m4) && e.getValue().equals("D")) ||
-                       (e.getKey().equals(m5) && e.getValue().equals("E")));
-        }
-    }
-
-    /**
-     *   putAll  adds all key-value pairs from the given map
-     */
-    public void testDescendingPutAll() {
-        ConcurrentNavigableMap empty = dmap0();
-        ConcurrentNavigableMap map = dmap5();
-        empty.putAll(map);
-        assertEquals(5, empty.size());
-        assertTrue(empty.containsKey(m1));
-        assertTrue(empty.containsKey(m2));
-        assertTrue(empty.containsKey(m3));
-        assertTrue(empty.containsKey(m4));
-        assertTrue(empty.containsKey(m5));
-    }
-
-    /**
-     *   putIfAbsent works when the given key is not present
-     */
-    public void testDescendingPutIfAbsent() {
-        ConcurrentNavigableMap map = dmap5();
-        map.putIfAbsent(six, "Z");
-        assertTrue(map.containsKey(six));
-    }
-
-    /**
-     *   putIfAbsent does not add the pair if the key is already present
-     */
-    public void testDescendingPutIfAbsent2() {
-        ConcurrentNavigableMap map = dmap5();
-        assertEquals("A", map.putIfAbsent(m1, "Z"));
-    }
-
-    /**
-     *   replace fails when the given key is not present
-     */
-    public void testDescendingReplace() {
-        ConcurrentNavigableMap map = dmap5();
-        assertNull(map.replace(six, "Z"));
-        assertFalse(map.containsKey(six));
-    }
-
-    /**
-     *   replace succeeds if the key is already present
-     */
-    public void testDescendingReplace2() {
-        ConcurrentNavigableMap map = dmap5();
-        assertNotNull(map.replace(m1, "Z"));
-        assertEquals("Z", map.get(m1));
-    }
-
-
-    /**
-     * replace value fails when the given key not mapped to expected value
-     */
-    public void testDescendingReplaceValue() {
-        ConcurrentNavigableMap map = dmap5();
-        assertEquals("A", map.get(m1));
-        assertFalse(map.replace(m1, "Z", "Z"));
-        assertEquals("A", map.get(m1));
-    }
-
-    /**
-     * replace value succeeds when the given key mapped to expected value
-     */
-    public void testDescendingReplaceValue2() {
-        ConcurrentNavigableMap map = dmap5();
-        assertEquals("A", map.get(m1));
-        assertTrue(map.replace(m1, "A", "Z"));
-        assertEquals("Z", map.get(m1));
-    }
-
-
-    /**
-     *   remove removes the correct key-value pair from the map
-     */
-    public void testDescendingRemove() {
-        ConcurrentNavigableMap map = dmap5();
-        map.remove(m5);
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(m5));
-    }
-
-    /**
-     * remove(key,value) removes only if pair present
-     */
-    public void testDescendingRemove2() {
-        ConcurrentNavigableMap map = dmap5();
-        assertTrue(map.containsKey(m5));
-        assertEquals("E", map.get(m5));
-        map.remove(m5, "E");
-        assertEquals(4, map.size());
-        assertFalse(map.containsKey(m5));
-        map.remove(m4, "A");
-        assertEquals(4, map.size());
-        assertTrue(map.containsKey(m4));
-    }
-
-    /**
-     * lowerEntry returns preceding entry.
-     */
-    public void testDescendingLowerEntry() {
-        ConcurrentNavigableMap map = dmap5();
-        Map.Entry e1 = map.lowerEntry(m3);
-        assertEquals(m2, e1.getKey());
-
-        Map.Entry e2 = map.lowerEntry(m6);
-        assertEquals(m5, e2.getKey());
-
-        Map.Entry e3 = map.lowerEntry(m1);
-        assertNull(e3);
-
-        Map.Entry e4 = map.lowerEntry(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * higherEntry returns next entry.
-     */
-    public void testDescendingHigherEntry() {
-        ConcurrentNavigableMap map = dmap5();
-        Map.Entry e1 = map.higherEntry(m3);
-        assertEquals(m4, e1.getKey());
-
-        Map.Entry e2 = map.higherEntry(zero);
-        assertEquals(m1, e2.getKey());
-
-        Map.Entry e3 = map.higherEntry(m5);
-        assertNull(e3);
-
-        Map.Entry e4 = map.higherEntry(m6);
-        assertNull(e4);
-    }
-
-    /**
-     * floorEntry returns preceding entry.
-     */
-    public void testDescendingFloorEntry() {
-        ConcurrentNavigableMap map = dmap5();
-        Map.Entry e1 = map.floorEntry(m3);
-        assertEquals(m3, e1.getKey());
-
-        Map.Entry e2 = map.floorEntry(m6);
-        assertEquals(m5, e2.getKey());
-
-        Map.Entry e3 = map.floorEntry(m1);
-        assertEquals(m1, e3.getKey());
-
-        Map.Entry e4 = map.floorEntry(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * ceilingEntry returns next entry.
-     */
-    public void testDescendingCeilingEntry() {
-        ConcurrentNavigableMap map = dmap5();
-        Map.Entry e1 = map.ceilingEntry(m3);
-        assertEquals(m3, e1.getKey());
-
-        Map.Entry e2 = map.ceilingEntry(zero);
-        assertEquals(m1, e2.getKey());
-
-        Map.Entry e3 = map.ceilingEntry(m5);
-        assertEquals(m5, e3.getKey());
-
-        Map.Entry e4 = map.ceilingEntry(m6);
-        assertNull(e4);
-    }
-
-    /**
-     * pollFirstEntry returns entries in order
-     */
-    public void testDescendingPollFirstEntry() {
-        ConcurrentNavigableMap map = dmap5();
-        Map.Entry e = map.pollFirstEntry();
-        assertEquals(m1, e.getKey());
-        assertEquals("A", e.getValue());
-        e = map.pollFirstEntry();
-        assertEquals(m2, e.getKey());
-        map.put(m1, "A");
-        e = map.pollFirstEntry();
-        assertEquals(m1, e.getKey());
-        assertEquals("A", e.getValue());
-        e = map.pollFirstEntry();
-        assertEquals(m3, e.getKey());
-        map.remove(m4);
-        e = map.pollFirstEntry();
-        assertEquals(m5, e.getKey());
-        try {
-            e.setValue("A");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.pollFirstEntry();
-        assertNull(e);
-    }
-
-    /**
-     * pollLastEntry returns entries in order
-     */
-    public void testDescendingPollLastEntry() {
-        ConcurrentNavigableMap map = dmap5();
-        Map.Entry e = map.pollLastEntry();
-        assertEquals(m5, e.getKey());
-        assertEquals("E", e.getValue());
-        e = map.pollLastEntry();
-        assertEquals(m4, e.getKey());
-        map.put(m5, "E");
-        e = map.pollLastEntry();
-        assertEquals(m5, e.getKey());
-        assertEquals("E", e.getValue());
-        e = map.pollLastEntry();
-        assertEquals(m3, e.getKey());
-        map.remove(m2);
-        e = map.pollLastEntry();
-        assertEquals(m1, e.getKey());
-        try {
-            e.setValue("E");
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-        e = map.pollLastEntry();
-        assertNull(e);
-    }
-
-    /**
-     *   size returns the correct values
-     */
-    public void testDescendingSize() {
-        ConcurrentNavigableMap map = dmap5();
-        ConcurrentNavigableMap empty = dmap0();
-        assertEquals(0, empty.size());
-        assertEquals(5, map.size());
-    }
-
-    /**
-     * toString contains toString of elements
-     */
-    public void testDescendingToString() {
-        ConcurrentNavigableMap map = dmap5();
-        String s = map.toString();
-        for (int i = 1; i <= 5; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    // Exception testDescendings
-
-    /**
-     * get(null) of empty map throws NPE
-     */
-    public void testDescendingGet_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.get(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsKey(null) of empty map throws NPE
-     */
-    public void testDescendingContainsKey_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.containsKey(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * containsValue(null) throws NPE
-     */
-    public void testDescendingContainsValue_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap0();
-            c.containsValue(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * put(null,x) throws NPE
-     */
-    public void testDescendingPut1_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.put(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * putIfAbsent(null, x) throws NPE
-     */
-    public void testDescendingPutIfAbsent1_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.putIfAbsent(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x) throws NPE
-     */
-    public void testDescendingReplace_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.replace(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * replace(null, x, y) throws NPE
-     */
-    public void testDescendingReplaceValue_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.replace(null, m1, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(null) throws NPE
-     */
-    public void testDescendingRemove1_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.remove(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * remove(null, x) throws NPE
-     */
-    public void testDescendingRemove2_NullPointerException() {
-        try {
-            ConcurrentNavigableMap c = dmap5();
-            c.remove(null, "whatever");
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * A deserialized map equals original
-     */
-    public void testDescendingSerialization() throws Exception {
-        ConcurrentNavigableMap q = dmap5();
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ConcurrentNavigableMap r = (ConcurrentNavigableMap)in.readObject();
-        assertEquals(q.size(), r.size());
-        assertTrue(q.equals(r));
-        assertTrue(r.equals(q));
-    }
-
-
-    /**
-     * subMap returns map with keys in requested range
-     */
-    public void testDescendingSubMapContents() {
-        ConcurrentNavigableMap map = dmap5();
-        SortedMap sm = map.subMap(m2, m4);
-        assertEquals(m2, sm.firstKey());
-        assertEquals(m3, sm.lastKey());
-        assertEquals(2, sm.size());
-        assertFalse(sm.containsKey(m1));
-        assertTrue(sm.containsKey(m2));
-        assertTrue(sm.containsKey(m3));
-        assertFalse(sm.containsKey(m4));
-        assertFalse(sm.containsKey(m5));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        k = (Integer)(i.next());
-        assertEquals(m3, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.keySet().iterator();
-        j.next();
-        j.remove();
-        assertFalse(map.containsKey(m2));
-        assertEquals(4, map.size());
-        assertEquals(1, sm.size());
-        assertEquals(m3, sm.firstKey());
-        assertEquals(m3, sm.lastKey());
-        assertEquals("C", sm.remove(m3));
-        assertTrue(sm.isEmpty());
-        assertEquals(3, map.size());
-    }
-
-    public void testDescendingSubMapContents2() {
-        ConcurrentNavigableMap map = dmap5();
-        SortedMap sm = map.subMap(m2, m3);
-        assertEquals(1, sm.size());
-        assertEquals(m2, sm.firstKey());
-        assertEquals(m2, sm.lastKey());
-        assertFalse(sm.containsKey(m1));
-        assertTrue(sm.containsKey(m2));
-        assertFalse(sm.containsKey(m3));
-        assertFalse(sm.containsKey(m4));
-        assertFalse(sm.containsKey(m5));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.keySet().iterator();
-        j.next();
-        j.remove();
-        assertFalse(map.containsKey(m2));
-        assertEquals(4, map.size());
-        assertEquals(0, sm.size());
-        assertTrue(sm.isEmpty());
-        assertSame(sm.remove(m3), null);
-        assertEquals(4, map.size());
-    }
-
-    /**
-     * headMap returns map with keys in requested range
-     */
-    public void testDescendingHeadMapContents() {
-        ConcurrentNavigableMap map = dmap5();
-        SortedMap sm = map.headMap(m4);
-        assertTrue(sm.containsKey(m1));
-        assertTrue(sm.containsKey(m2));
-        assertTrue(sm.containsKey(m3));
-        assertFalse(sm.containsKey(m4));
-        assertFalse(sm.containsKey(m5));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m1, k);
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        k = (Integer)(i.next());
-        assertEquals(m3, k);
-        assertFalse(i.hasNext());
-        sm.clear();
-        assertTrue(sm.isEmpty());
-        assertEquals(2, map.size());
-        assertEquals(m4, map.firstKey());
-    }
-
-    /**
-     * headMap returns map with keys in requested range
-     */
-    public void testDescendingTailMapContents() {
-        ConcurrentNavigableMap map = dmap5();
-        SortedMap sm = map.tailMap(m2);
-        assertFalse(sm.containsKey(m1));
-        assertTrue(sm.containsKey(m2));
-        assertTrue(sm.containsKey(m3));
-        assertTrue(sm.containsKey(m4));
-        assertTrue(sm.containsKey(m5));
-        Iterator i = sm.keySet().iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        k = (Integer)(i.next());
-        assertEquals(m3, k);
-        k = (Integer)(i.next());
-        assertEquals(m4, k);
-        k = (Integer)(i.next());
-        assertEquals(m5, k);
-        assertFalse(i.hasNext());
-
-        Iterator ei = sm.entrySet().iterator();
-        Map.Entry e;
-        e = (Map.Entry)(ei.next());
-        assertEquals(m2, e.getKey());
-        assertEquals("B", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(m3, e.getKey());
-        assertEquals("C", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(m4, e.getKey());
-        assertEquals("D", e.getValue());
-        e = (Map.Entry)(ei.next());
-        assertEquals(m5, e.getKey());
-        assertEquals("E", e.getValue());
-        assertFalse(i.hasNext());
-
-        SortedMap ssm = sm.tailMap(m4);
-        assertEquals(m4, ssm.firstKey());
-        assertEquals(m5, ssm.lastKey());
-        assertEquals("D", ssm.remove(m4));
-        assertEquals(1, ssm.size());
-        assertEquals(3, sm.size());
-        assertEquals(4, map.size());
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSubSetTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSubSetTest.java
deleted file mode 100644
index 9f0a496..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ConcurrentSkipListSubSetTest.java
+++ /dev/null
@@ -1,1117 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class ConcurrentSkipListSubSetTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ConcurrentSkipListSubSetTest.class);
-    }
-
-    static class MyReverseComparator implements Comparator {
-        public int compare(Object x, Object y) {
-            return ((Comparable)y).compareTo(x);
-        }
-    }
-
-    /**
-     * Create a set of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private NavigableSet populatedSet(int n) {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.isEmpty());
-
-        for (int i = n-1; i >= 0; i-=2)
-            assertTrue(q.add(new Integer(i)));
-        for (int i = (n & 1); i < n; i+=2)
-            assertTrue(q.add(new Integer(i)));
-        assertTrue(q.add(new Integer(-n)));
-        assertTrue(q.add(new Integer(n)));
-        NavigableSet s = q.subSet(new Integer(0), true, new Integer(n), false);
-        assertFalse(s.isEmpty());
-        assertEquals(n, s.size());
-        return s;
-    }
-
-    /**
-     * Create set of first 5 ints
-     */
-    private NavigableSet set5() {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.isEmpty());
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        q.add(four);
-        q.add(five);
-        q.add(zero);
-        q.add(seven);
-        NavigableSet s = q.subSet(one, true, seven, false);
-        assertEquals(5, s.size());
-        return s;
-    }
-
-    /**
-     * Create set of first 5 negative ints
-     */
-    private NavigableSet dset5() {
-        ConcurrentSkipListSet q = new ConcurrentSkipListSet();
-        assertTrue(q.isEmpty());
-        q.add(m1);
-        q.add(m2);
-        q.add(m3);
-        q.add(m4);
-        q.add(m5);
-        NavigableSet s = q.descendingSet();
-        assertEquals(5, s.size());
-        return s;
-    }
-
-    private static NavigableSet set0() {
-        ConcurrentSkipListSet set = new ConcurrentSkipListSet();
-        assertTrue(set.isEmpty());
-        return set.tailSet(m1, true);
-    }
-
-    private static NavigableSet dset0() {
-        ConcurrentSkipListSet set = new ConcurrentSkipListSet();
-        assertTrue(set.isEmpty());
-        return set;
-    }
-
-    /**
-     * A new set has unbounded capacity
-     */
-    public void testConstructor1() {
-        assertEquals(0, set0().size());
-    }
-
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        NavigableSet q = set0();
-        assertTrue(q.isEmpty());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.add(new Integer(2));
-        q.pollFirst();
-        q.pollFirst();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testSize() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.pollFirst();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            NavigableSet q = set0();
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Add of comparable element succeeds
-     */
-    public void testAdd() {
-        NavigableSet q = set0();
-        assertTrue(q.add(six));
-    }
-
-    /**
-     * Add of duplicate element fails
-     */
-    public void testAddDup() {
-        NavigableSet q = set0();
-        assertTrue(q.add(six));
-        assertFalse(q.add(six));
-    }
-
-    /**
-     * Add of non-Comparable throws CCE
-     */
-    public void testAddNonComparable() {
-        try {
-            NavigableSet q = set0();
-            q.add(new Object());
-            q.add(new Object());
-            q.add(new Object());
-            shouldThrow();
-        } catch (ClassCastException success) {}
-    }
-
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            NavigableSet q = set0();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            NavigableSet q = set0();
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            NavigableSet q = set0();
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i+SIZE);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Set contains all elements of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(SIZE-1- i);
-        NavigableSet q = set0();
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(new Integer(i), q.pollFirst());
-    }
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pollFirst());
-        }
-        assertNull(q.pollFirst());
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.pollFirst();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        NavigableSet q = populatedSet(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        NavigableSet q = populatedSet(SIZE);
-        NavigableSet p = set0();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        NavigableSet q = populatedSet(SIZE);
-        NavigableSet p = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.pollFirst();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            NavigableSet q = populatedSet(SIZE);
-            NavigableSet p = populatedSet(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.pollFirst());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-
-
-    /**
-     * lower returns preceding element
-     */
-    public void testLower() {
-        NavigableSet q = set5();
-        Object e1 = q.lower(three);
-        assertEquals(two, e1);
-
-        Object e2 = q.lower(six);
-        assertEquals(five, e2);
-
-        Object e3 = q.lower(one);
-        assertNull(e3);
-
-        Object e4 = q.lower(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * higher returns next element
-     */
-    public void testHigher() {
-        NavigableSet q = set5();
-        Object e1 = q.higher(three);
-        assertEquals(four, e1);
-
-        Object e2 = q.higher(zero);
-        assertEquals(one, e2);
-
-        Object e3 = q.higher(five);
-        assertNull(e3);
-
-        Object e4 = q.higher(six);
-        assertNull(e4);
-    }
-
-    /**
-     * floor returns preceding element
-     */
-    public void testFloor() {
-        NavigableSet q = set5();
-        Object e1 = q.floor(three);
-        assertEquals(three, e1);
-
-        Object e2 = q.floor(six);
-        assertEquals(five, e2);
-
-        Object e3 = q.floor(one);
-        assertEquals(one, e3);
-
-        Object e4 = q.floor(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * ceiling returns next element
-     */
-    public void testCeiling() {
-        NavigableSet q = set5();
-        Object e1 = q.ceiling(three);
-        assertEquals(three, e1);
-
-        Object e2 = q.ceiling(zero);
-        assertEquals(one, e2);
-
-        Object e3 = q.ceiling(five);
-        assertEquals(five, e3);
-
-        Object e4 = q.ceiling(six);
-        assertNull(e4);
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testToArray() {
-        NavigableSet q = populatedSet(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.pollFirst());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() {
-        NavigableSet q = populatedSet(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() {
-        NavigableSet q = populatedSet(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     * iterator of empty set has no elements
-     */
-    public void testEmptyIterator() {
-        NavigableSet q = set0();
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, 0);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final NavigableSet q = set0();
-        q.add(new Integer(2));
-        q.add(new Integer(1));
-        q.add(new Integer(3));
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertEquals(it.next(), new Integer(2));
-        assertEquals(it.next(), new Integer(3));
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        NavigableSet q = populatedSet(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * A deserialized serialized set has same elements
-     */
-    public void testSerialization() throws Exception {
-        NavigableSet q = populatedSet(SIZE);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        NavigableSet r = (NavigableSet)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.pollFirst(), r.pollFirst());
-    }
-
-    /**
-     * subSet returns set with keys in requested range
-     */
-    public void testSubSetContents() {
-        NavigableSet set = set5();
-        SortedSet sm = set.subSet(two, four);
-        assertEquals(two, sm.first());
-        assertEquals(three, sm.last());
-        assertEquals(2, sm.size());
-        assertFalse(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertTrue(sm.contains(three));
-        assertFalse(sm.contains(four));
-        assertFalse(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.iterator();
-        j.next();
-        j.remove();
-        assertFalse(set.contains(two));
-        assertEquals(4, set.size());
-        assertEquals(1, sm.size());
-        assertEquals(three, sm.first());
-        assertEquals(three, sm.last());
-        assertTrue(sm.remove(three));
-        assertTrue(sm.isEmpty());
-        assertEquals(3, set.size());
-    }
-
-    public void testSubSetContents2() {
-        NavigableSet set = set5();
-        SortedSet sm = set.subSet(two, three);
-        assertEquals(1, sm.size());
-        assertEquals(two, sm.first());
-        assertEquals(two, sm.last());
-        assertFalse(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertFalse(sm.contains(three));
-        assertFalse(sm.contains(four));
-        assertFalse(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.iterator();
-        j.next();
-        j.remove();
-        assertFalse(set.contains(two));
-        assertEquals(4, set.size());
-        assertEquals(0, sm.size());
-        assertTrue(sm.isEmpty());
-        assertFalse(sm.remove(three));
-        assertEquals(4, set.size());
-    }
-
-    /**
-     * headSet returns set with keys in requested range
-     */
-    public void testHeadSetContents() {
-        NavigableSet set = set5();
-        SortedSet sm = set.headSet(four);
-        assertTrue(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertTrue(sm.contains(three));
-        assertFalse(sm.contains(four));
-        assertFalse(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(one, k);
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        assertFalse(i.hasNext());
-        sm.clear();
-        assertTrue(sm.isEmpty());
-        assertEquals(2, set.size());
-        assertEquals(four, set.first());
-    }
-
-    /**
-     * tailSet returns set with keys in requested range
-     */
-    public void testTailSetContents() {
-        NavigableSet set = set5();
-        SortedSet sm = set.tailSet(two);
-        assertFalse(sm.contains(one));
-        assertTrue(sm.contains(two));
-        assertTrue(sm.contains(three));
-        assertTrue(sm.contains(four));
-        assertTrue(sm.contains(five));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(two, k);
-        k = (Integer)(i.next());
-        assertEquals(three, k);
-        k = (Integer)(i.next());
-        assertEquals(four, k);
-        k = (Integer)(i.next());
-        assertEquals(five, k);
-        assertFalse(i.hasNext());
-
-        SortedSet ssm = sm.tailSet(four);
-        assertEquals(four, ssm.first());
-        assertEquals(five, ssm.last());
-        assertTrue(ssm.remove(four));
-        assertEquals(1, ssm.size());
-        assertEquals(3, sm.size());
-        assertEquals(4, set.size());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testDescendingSize() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.pollFirst();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testDescendingAddNull() {
-        try {
-            NavigableSet q = dset0();
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Add of comparable element succeeds
-     */
-    public void testDescendingAdd() {
-        NavigableSet q = dset0();
-        assertTrue(q.add(m6));
-    }
-
-    /**
-     * Add of duplicate element fails
-     */
-    public void testDescendingAddDup() {
-        NavigableSet q = dset0();
-        assertTrue(q.add(m6));
-        assertFalse(q.add(m6));
-    }
-
-    /**
-     * Add of non-Comparable throws CCE
-     */
-    public void testDescendingAddNonComparable() {
-        try {
-            NavigableSet q = dset0();
-            q.add(new Object());
-            q.add(new Object());
-            q.add(new Object());
-            shouldThrow();
-        } catch (ClassCastException success) {}
-    }
-
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testDescendingAddAll1() {
-        try {
-            NavigableSet q = dset0();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testDescendingAddAll2() {
-        try {
-            NavigableSet q = dset0();
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testDescendingAddAll3() {
-        try {
-            NavigableSet q = dset0();
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i+SIZE);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Set contains all elements of successful addAll
-     */
-    public void testDescendingAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(SIZE-1- i);
-        NavigableSet q = dset0();
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(new Integer(i), q.pollFirst());
-    }
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testDescendingPoll() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pollFirst());
-        }
-        assertNull(q.pollFirst());
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testDescendingRemoveElement() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testDescendingContains() {
-        NavigableSet q = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.pollFirst();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testDescendingClear() {
-        NavigableSet q = populatedSet(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testDescendingContainsAll() {
-        NavigableSet q = populatedSet(SIZE);
-        NavigableSet p = dset0();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testDescendingRetainAll() {
-        NavigableSet q = populatedSet(SIZE);
-        NavigableSet p = populatedSet(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.pollFirst();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testDescendingRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            NavigableSet q = populatedSet(SIZE);
-            NavigableSet p = populatedSet(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.pollFirst());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-
-
-    /**
-     * lower returns preceding element
-     */
-    public void testDescendingLower() {
-        NavigableSet q = dset5();
-        Object e1 = q.lower(m3);
-        assertEquals(m2, e1);
-
-        Object e2 = q.lower(m6);
-        assertEquals(m5, e2);
-
-        Object e3 = q.lower(m1);
-        assertNull(e3);
-
-        Object e4 = q.lower(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * higher returns next element
-     */
-    public void testDescendingHigher() {
-        NavigableSet q = dset5();
-        Object e1 = q.higher(m3);
-        assertEquals(m4, e1);
-
-        Object e2 = q.higher(zero);
-        assertEquals(m1, e2);
-
-        Object e3 = q.higher(m5);
-        assertNull(e3);
-
-        Object e4 = q.higher(m6);
-        assertNull(e4);
-    }
-
-    /**
-     * floor returns preceding element
-     */
-    public void testDescendingFloor() {
-        NavigableSet q = dset5();
-        Object e1 = q.floor(m3);
-        assertEquals(m3, e1);
-
-        Object e2 = q.floor(m6);
-        assertEquals(m5, e2);
-
-        Object e3 = q.floor(m1);
-        assertEquals(m1, e3);
-
-        Object e4 = q.floor(zero);
-        assertNull(e4);
-    }
-
-    /**
-     * ceiling returns next element
-     */
-    public void testDescendingCeiling() {
-        NavigableSet q = dset5();
-        Object e1 = q.ceiling(m3);
-        assertEquals(m3, e1);
-
-        Object e2 = q.ceiling(zero);
-        assertEquals(m1, e2);
-
-        Object e3 = q.ceiling(m5);
-        assertEquals(m5, e3);
-
-        Object e4 = q.ceiling(m6);
-        assertNull(e4);
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testDescendingToArray() {
-        NavigableSet q = populatedSet(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.pollFirst());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testDescendingToArray2() {
-        NavigableSet q = populatedSet(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.pollFirst());
-    }
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testDescendingIterator() {
-        NavigableSet q = populatedSet(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     * iterator of empty set has no elements
-     */
-    public void testDescendingEmptyIterator() {
-        NavigableSet q = dset0();
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, 0);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testDescendingIteratorRemove () {
-        final NavigableSet q = dset0();
-        q.add(new Integer(2));
-        q.add(new Integer(1));
-        q.add(new Integer(3));
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertEquals(it.next(), new Integer(2));
-        assertEquals(it.next(), new Integer(3));
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testDescendingToString() {
-        NavigableSet q = populatedSet(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * A deserialized serialized set has same elements
-     */
-    public void testDescendingSerialization() throws Exception {
-        NavigableSet q = populatedSet(SIZE);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        NavigableSet r = (NavigableSet)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.pollFirst(), r.pollFirst());
-    }
-
-    /**
-     * subSet returns set with keys in requested range
-     */
-    public void testDescendingSubSetContents() {
-        NavigableSet set = dset5();
-        SortedSet sm = set.subSet(m2, m4);
-        assertEquals(m2, sm.first());
-        assertEquals(m3, sm.last());
-        assertEquals(2, sm.size());
-        assertFalse(sm.contains(m1));
-        assertTrue(sm.contains(m2));
-        assertTrue(sm.contains(m3));
-        assertFalse(sm.contains(m4));
-        assertFalse(sm.contains(m5));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        k = (Integer)(i.next());
-        assertEquals(m3, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.iterator();
-        j.next();
-        j.remove();
-        assertFalse(set.contains(m2));
-        assertEquals(4, set.size());
-        assertEquals(1, sm.size());
-        assertEquals(m3, sm.first());
-        assertEquals(m3, sm.last());
-        assertTrue(sm.remove(m3));
-        assertTrue(sm.isEmpty());
-        assertEquals(3, set.size());
-    }
-
-    public void testDescendingSubSetContents2() {
-        NavigableSet set = dset5();
-        SortedSet sm = set.subSet(m2, m3);
-        assertEquals(1, sm.size());
-        assertEquals(m2, sm.first());
-        assertEquals(m2, sm.last());
-        assertFalse(sm.contains(m1));
-        assertTrue(sm.contains(m2));
-        assertFalse(sm.contains(m3));
-        assertFalse(sm.contains(m4));
-        assertFalse(sm.contains(m5));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        assertFalse(i.hasNext());
-        Iterator j = sm.iterator();
-        j.next();
-        j.remove();
-        assertFalse(set.contains(m2));
-        assertEquals(4, set.size());
-        assertEquals(0, sm.size());
-        assertTrue(sm.isEmpty());
-        assertFalse(sm.remove(m3));
-        assertEquals(4, set.size());
-    }
-
-    /**
-     * headSet returns set with keys in requested range
-     */
-    public void testDescendingHeadSetContents() {
-        NavigableSet set = dset5();
-        SortedSet sm = set.headSet(m4);
-        assertTrue(sm.contains(m1));
-        assertTrue(sm.contains(m2));
-        assertTrue(sm.contains(m3));
-        assertFalse(sm.contains(m4));
-        assertFalse(sm.contains(m5));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m1, k);
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        k = (Integer)(i.next());
-        assertEquals(m3, k);
-        assertFalse(i.hasNext());
-        sm.clear();
-        assertTrue(sm.isEmpty());
-        assertEquals(2, set.size());
-        assertEquals(m4, set.first());
-    }
-
-    /**
-     * tailSet returns set with keys in requested range
-     */
-    public void testDescendingTailSetContents() {
-        NavigableSet set = dset5();
-        SortedSet sm = set.tailSet(m2);
-        assertFalse(sm.contains(m1));
-        assertTrue(sm.contains(m2));
-        assertTrue(sm.contains(m3));
-        assertTrue(sm.contains(m4));
-        assertTrue(sm.contains(m5));
-        Iterator i = sm.iterator();
-        Object k;
-        k = (Integer)(i.next());
-        assertEquals(m2, k);
-        k = (Integer)(i.next());
-        assertEquals(m3, k);
-        k = (Integer)(i.next());
-        assertEquals(m4, k);
-        k = (Integer)(i.next());
-        assertEquals(m5, k);
-        assertFalse(i.hasNext());
-
-        SortedSet ssm = sm.tailSet(m4);
-        assertEquals(m4, ssm.first());
-        assertEquals(m5, ssm.last());
-        assertTrue(ssm.remove(m4));
-        assertEquals(1, ssm.size());
-        assertEquals(3, sm.size());
-        assertEquals(4, set.size());
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/CopyOnWriteArrayListTest.java b/luni/src/test/java/tests/api/java/util/concurrent/CopyOnWriteArrayListTest.java
deleted file mode 100755
index 90d708a..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/CopyOnWriteArrayListTest.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class CopyOnWriteArrayListTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(CopyOnWriteArrayListTest.class);
-    }
-
-    static CopyOnWriteArrayList populatedArray(int n) {
-        CopyOnWriteArrayList a = new CopyOnWriteArrayList();
-        assertTrue(a.isEmpty());
-        for (int i = 0; i < n; ++i)
-            a.add(new Integer(i));
-        assertFalse(a.isEmpty());
-        assertEquals(n, a.size());
-        return a;
-    }
-
-
-    /**
-     * a new list is empty
-     */
-    public void testConstructor() {
-        CopyOnWriteArrayList a = new CopyOnWriteArrayList();
-        assertTrue(a.isEmpty());
-    }
-
-    /**
-     * new list contains all elements of initializing array
-     */
-    public void testConstructor2() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE-1; ++i)
-            ints[i] = new Integer(i);
-        CopyOnWriteArrayList a = new CopyOnWriteArrayList(ints);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], a.get(i));
-    }
-
-    /**
-     * new list contains all elements of initializing collection
-     */
-    public void testConstructor3() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE-1; ++i)
-            ints[i] = new Integer(i);
-        CopyOnWriteArrayList a = new CopyOnWriteArrayList(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], a.get(i));
-    }
-
-
-    /**
-     *   addAll  adds each element from the given collection
-     */
-    public void testAddAll() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        Vector v = new Vector();
-        v.add(three);
-        v.add(four);
-        v.add(five);
-        full.addAll(v);
-        assertEquals(6, full.size());
-    }
-
-    /**
-     *   addAllAbsent adds each element from the given collection that did not
-     *  already exist in the List
-     */
-    public void testAddAllAbsent() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        Vector v = new Vector();
-        v.add(three);
-        v.add(four);
-        v.add(one); // will not add this element
-        full.addAllAbsent(v);
-        assertEquals(5, full.size());
-    }
-
-    /**
-     *   addIfAbsent will not add the element if it already exists in the list
-     */
-    public void testAddIfAbsent() {
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        full.addIfAbsent(one);
-        assertEquals(SIZE, full.size());
-    }
-
-    /**
-     *   addIfAbsent adds the element when it does not exist in the list
-     */
-    public void testAddIfAbsent2() {
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        full.addIfAbsent(three);
-        assertTrue(full.contains(three));
-    }
-
-    /**
-     *   clear removes all elements from the list
-     */
-    public void testClear() {
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        full.clear();
-        assertEquals(0, full.size());
-    }
-
-
-    /**
-     *  Cloned list is equal
-     */
-    public void testClone() {
-        CopyOnWriteArrayList l1 = populatedArray(SIZE);
-        CopyOnWriteArrayList l2 = (CopyOnWriteArrayList)(l1.clone());
-        assertEquals(l1, l2);
-        l1.clear();
-        assertFalse(l1.equals(l2));
-    }
-
-    /**
-     *   contains is true for added elements
-     */
-    public void testContains() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        assertTrue(full.contains(one));
-        assertFalse(full.contains(five));
-    }
-
-    /**
-     * adding at an index places it in the indicated index
-     */
-    public void testAddIndex() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        full.add(0, m1);
-        assertEquals(4, full.size());
-        assertEquals(m1, full.get(0));
-        assertEquals(zero, full.get(1));
-
-        full.add(2, m2);
-        assertEquals(5, full.size());
-        assertEquals(m2, full.get(2));
-        assertEquals(two, full.get(4));
-    }
-
-    /**
-     * lists with same elements are equal and have same hashCode
-     */
-    public void testEquals() {
-        CopyOnWriteArrayList a = populatedArray(3);
-        CopyOnWriteArrayList b = populatedArray(3);
-        assertTrue(a.equals(b));
-        assertTrue(b.equals(a));
-        assertEquals(a.hashCode(), b.hashCode());
-        a.add(m1);
-        assertFalse(a.equals(b));
-        assertFalse(b.equals(a));
-        b.add(m1);
-        assertTrue(a.equals(b));
-        assertTrue(b.equals(a));
-        assertEquals(a.hashCode(), b.hashCode());
-    }
-
-
-    /**
-     *   containsAll returns true for collection with subset of elements
-     */
-    public void testContainsAll() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        Vector v = new Vector();
-        v.add(one);
-        v.add(two);
-        assertTrue(full.containsAll(v));
-        v.add(six);
-        assertFalse(full.containsAll(v));
-    }
-
-    /**
-     *   get returns the value at the given index
-     */
-    public void testGet() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        assertEquals(0, full.get(0));
-    }
-
-    /**
-     *   indexOf gives the index for the given object
-     */
-    public void testIndexOf() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        assertEquals(1, full.indexOf(one));
-        assertEquals(-1, full.indexOf("puppies"));
-    }
-
-    /**
-     *   indexOf gives the index based on the given index
-     *  at which to start searching
-     */
-    public void testIndexOf2() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        assertEquals(1, full.indexOf(one, 0));
-        assertEquals(-1, full.indexOf(one, 2));
-    }
-
-    /**
-     *   isEmpty returns true when empty, else false
-     */
-    public void testIsEmpty() {
-        CopyOnWriteArrayList empty = new CopyOnWriteArrayList();
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        assertTrue(empty.isEmpty());
-        assertFalse(full.isEmpty());
-    }
-
-    /**
-     *   iterator() returns an iterator containing the elements of the list
-     */
-    public void testIterator() {
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        Iterator i = full.iterator();
-        int j;
-        for (j = 0; i.hasNext(); j++)
-            assertEquals(j, i.next());
-        assertEquals(SIZE, j);
-    }
-
-    /**
-     * iterator.remove throws UnsupportedOperationException
-     */
-    public void testIteratorRemove () {
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        Iterator it = full.iterator();
-        it.next();
-        try {
-            it.remove();
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-    }
-
-    /**
-     * toString contains toString of elements
-     */
-    public void testToString() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        String s = full.toString();
-        for (int i = 0; i < 3; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     *   lastIndexOf returns the index for the given object
-     */
-    public void testLastIndexOf1() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        full.add(one);
-        full.add(three);
-        assertEquals(3, full.lastIndexOf(one));
-        assertEquals(-1, full.lastIndexOf(six));
-    }
-
-    /**
-     *   lastIndexOf returns the index from the given starting point
-     */
-    public void testlastIndexOf2() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        full.add(one);
-        full.add(three);
-        assertEquals(3, full.lastIndexOf(one, 4));
-        assertEquals(-1, full.lastIndexOf(three, 3));
-    }
-
-    /**
-     *  listIterator traverses all elements
-     */
-    public void testListIterator1() {
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        ListIterator i = full.listIterator();
-        int j;
-        for (j = 0; i.hasNext(); j++)
-            assertEquals(j, i.next());
-        assertEquals(SIZE, j);
-    }
-
-    /**
-     *  listIterator only returns those elements after the given index
-     */
-    public void testListIterator2() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        ListIterator i = full.listIterator(1);
-        int j;
-        for (j = 0; i.hasNext(); j++)
-            assertEquals(j+1, i.next());
-        assertEquals(2, j);
-    }
-
-    /**
-     *   remove  removes and returns the object at the given index
-     */
-    public void testRemove() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        assertEquals(2, full.remove(2));
-        assertEquals(2, full.size());
-    }
-
-    /**
-     *   removeAll  removes all elements from the given collection
-     */
-    public void testRemoveAll() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        Vector v = new Vector();
-        v.add(one);
-        v.add(two);
-        full.removeAll(v);
-        assertEquals(1, full.size());
-    }
-
-    /**
-     *   set  changes the element at the given index
-     */
-    public void testSet() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        assertEquals(2, full.set(2, four));
-        assertEquals(4, full.get(2));
-    }
-
-    /**
-     *   size returns the number of elements
-     */
-    public void testSize() {
-        CopyOnWriteArrayList empty = new CopyOnWriteArrayList();
-        CopyOnWriteArrayList full = populatedArray(SIZE);
-        assertEquals(SIZE, full.size());
-        assertEquals(0, empty.size());
-    }
-
-    /**
-     *   toArray returns an Object array containing all elements from the list
-     */
-    public void testToArray() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        Object[] o = full.toArray();
-        assertEquals(3, o.length);
-        assertEquals(0, o[0]);
-        assertEquals(1, o[1]);
-        assertEquals(2, o[2]);
-    }
-
-    /**
-     *   toArray returns an Integer array containing all elements from
-     *   the list
-     */
-    public void testToArray2() {
-        CopyOnWriteArrayList full = populatedArray(3);
-        Integer[] i = new Integer[3];
-        i = (Integer[])full.toArray(i);
-        assertEquals(3, i.length);
-        assertEquals(0, i[0].intValue());
-        assertEquals(1, i[1].intValue());
-        assertEquals(2, i[2].intValue());
-    }
-
-
-    /**
-     * sublists contains elements at indexes offset from their base
-     */
-    public void testSubList() {
-        CopyOnWriteArrayList a = populatedArray(10);
-        assertTrue(a.subList(1,1).isEmpty());
-        for (int j = 0; j < 9; ++j) {
-            for (int i = j ; i < 10; ++i) {
-                List b = a.subList(j,i);
-                for (int k = j; k < i; ++k) {
-                    assertEquals(new Integer(k), b.get(k-j));
-                }
-            }
-        }
-
-        List s = a.subList(2, 5);
-        assertEquals(s.size(), 3);
-        s.set(2, m1);
-        assertEquals(a.get(4), m1);
-        s.clear();
-        assertEquals(a.size(), 7);
-    }
-
-    // Exception tests
-
-    /**
-     *   toArray throws an ArrayStoreException when the given array
-     *  can not store the objects inside the list
-     */
-    public void testToArray_ArrayStoreException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("zfasdfsdf");
-            c.add("asdadasd");
-            c.toArray(new Long[5]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-    /**
-     *   get throws an IndexOutOfBoundsException on a negative index
-     */
-    public void testGet1_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.get(-1);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   get throws an IndexOutOfBoundsException on a too high index
-     */
-    public void testGet2_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("asdasd");
-            c.add("asdad");
-            c.get(100);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   set throws an IndexOutOfBoundsException on a negative index
-     */
-    public void testSet1_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.set(-1,"qwerty");
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   set throws an IndexOutOfBoundsException on a too high index
-     */
-    public void testSet2() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("asdasd");
-            c.add("asdad");
-            c.set(100, "qwerty");
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   add throws an IndexOutOfBoundsException on a negative index
-     */
-    public void testAdd1_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add(-1,"qwerty");
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   add throws an IndexOutOfBoundsException on a too high index
-     */
-    public void testAdd2_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("asdasd");
-            c.add("asdasdasd");
-            c.add(100, "qwerty");
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   remove throws an IndexOutOfBoundsException on a negative index
-     */
-    public void testRemove1_IndexOutOfBounds() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.remove(-1);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   remove throws an IndexOutOfBoundsException on a too high index
-     */
-    public void testRemove2_IndexOutOfBounds() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("asdasd");
-            c.add("adasdasd");
-            c.remove(100);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   addAll throws an IndexOutOfBoundsException on a negative index
-     */
-    public void testAddAll1_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.addAll(-1,new LinkedList());
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   addAll throws an IndexOutOfBoundsException on a too high index
-     */
-    public void testAddAll2_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("asdasd");
-            c.add("asdasdasd");
-            c.addAll(100, new LinkedList());
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   listIterator throws an IndexOutOfBoundsException on a negative index
-     */
-    public void testListIterator1_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.listIterator(-1);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   listIterator throws an IndexOutOfBoundsException on a too high index
-     */
-    public void testListIterator2_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("adasd");
-            c.add("asdasdas");
-            c.listIterator(100);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   subList throws an IndexOutOfBoundsException on a negative index
-     */
-    public void testSubList1_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.subList(-1,100);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   subList throws an IndexOutOfBoundsException on a too high index
-     */
-    public void testSubList2_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.add("asdasd");
-            c.subList(1,100);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     *   subList throws IndexOutOfBoundsException when the second index
-     *  is lower then the first
-     */
-    public void testSubList3_IndexOutOfBoundsException() {
-        try {
-            CopyOnWriteArrayList c = new CopyOnWriteArrayList();
-            c.subList(3,1);
-            shouldThrow();
-        } catch (IndexOutOfBoundsException success) {}
-    }
-
-    /**
-     * a deserialized serialized list is equal
-     */
-    public void testSerialization() throws Exception {
-        CopyOnWriteArrayList q = populatedArray(SIZE);
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        CopyOnWriteArrayList r = (CopyOnWriteArrayList)in.readObject();
-        assertEquals(q.size(), r.size());
-        assertTrue(q.equals(r));
-        assertTrue(r.equals(q));
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/CopyOnWriteArraySetTest.java b/luni/src/test/java/tests/api/java/util/concurrent/CopyOnWriteArraySetTest.java
deleted file mode 100755
index c78ac50..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/CopyOnWriteArraySetTest.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class CopyOnWriteArraySetTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(CopyOnWriteArraySetTest.class);
-    }
-
-    static CopyOnWriteArraySet populatedSet(int n) {
-        CopyOnWriteArraySet a = new CopyOnWriteArraySet();
-        assertTrue(a.isEmpty());
-        for (int i = 0; i < n; ++i)
-            a.add(new Integer(i));
-        assertFalse(a.isEmpty());
-        assertEquals(n, a.size());
-        return a;
-    }
-
-    /**
-     * Default-constructed set is empty
-     */
-    public void testConstructor() {
-        CopyOnWriteArraySet a = new CopyOnWriteArraySet();
-        assertTrue(a.isEmpty());
-    }
-
-    /**
-     * Collection-constructed set holds all of its elements
-     */
-    public void testConstructor3() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE-1; ++i)
-            ints[i] = new Integer(i);
-        CopyOnWriteArraySet a = new CopyOnWriteArraySet(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertTrue(a.contains(ints[i]));
-    }
-
-
-    /**
-     *  addAll adds each element from the given collection
-     */
-    public void testAddAll() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Vector v = new Vector();
-        v.add(three);
-        v.add(four);
-        v.add(five);
-        full.addAll(v);
-        assertEquals(6, full.size());
-    }
-
-    /**
-     *  addAll adds each element from the given collection that did not
-     *  already exist in the set
-     */
-    public void testAddAll2() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Vector v = new Vector();
-        v.add(three);
-        v.add(four);
-        v.add(one); // will not add this element
-        full.addAll(v);
-        assertEquals(5, full.size());
-    }
-
-    /**
-     *  add will not add the element if it already exists in the set
-     */
-    public void testAdd2() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        full.add(one);
-        assertEquals(3, full.size());
-    }
-
-    /**
-     *  add  adds the element when it does not exist
-     *  in the set
-     */
-    public void testAdd3() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        full.add(three);
-        assertTrue(full.contains(three));
-    }
-
-    /**
-     *  clear removes all elements from the set
-     */
-    public void testClear() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        full.clear();
-        assertEquals(0, full.size());
-    }
-
-    /**
-     *   contains returns true for added elements
-     */
-    public void testContains() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        assertTrue(full.contains(one));
-        assertFalse(full.contains(five));
-    }
-
-    /**
-     * Sets with equal elements are equal
-     */
-    public void testEquals() {
-        CopyOnWriteArraySet a = populatedSet(3);
-        CopyOnWriteArraySet b = populatedSet(3);
-        assertTrue(a.equals(b));
-        assertTrue(b.equals(a));
-        assertEquals(a.hashCode(), b.hashCode());
-        a.add(m1);
-        assertFalse(a.equals(b));
-        assertFalse(b.equals(a));
-        b.add(m1);
-        assertTrue(a.equals(b));
-        assertTrue(b.equals(a));
-        assertEquals(a.hashCode(), b.hashCode());
-    }
-
-
-    /**
-     *  containsAll returns true for collections with subset of elements
-     */
-    public void testContainsAll() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Vector v = new Vector();
-        v.add(one);
-        v.add(two);
-        assertTrue(full.containsAll(v));
-        v.add(six);
-        assertFalse(full.containsAll(v));
-    }
-
-    /**
-     *  isEmpty is true when empty, else false
-     */
-    public void testIsEmpty() {
-        CopyOnWriteArraySet empty = new CopyOnWriteArraySet();
-        CopyOnWriteArraySet full = populatedSet(3);
-        assertTrue(empty.isEmpty());
-        assertFalse(full.isEmpty());
-    }
-
-    /**
-     *  iterator() returns an iterator containing the elements of the set
-     */
-    public void testIterator() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Iterator i = full.iterator();
-        int j;
-        for (j = 0; i.hasNext(); j++)
-            assertEquals(j, i.next());
-        assertEquals(3, j);
-    }
-
-    /**
-     * iterator remove is unsupported
-     */
-    public void testIteratorRemove () {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Iterator it = full.iterator();
-        it.next();
-        try {
-            it.remove();
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-    }
-
-    /**
-     * toString holds toString of elements
-     */
-    public void testToString() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        String s = full.toString();
-        for (int i = 0; i < 3; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-
-    /**
-     *  removeAll  removes all elements from the given collection
-     */
-    public void testRemoveAll() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Vector v = new Vector();
-        v.add(one);
-        v.add(two);
-        full.removeAll(v);
-        assertEquals(1, full.size());
-    }
-
-
-    /**
-     * remove removes an element
-     */
-    public void testRemove() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        full.remove(one);
-        assertFalse(full.contains(one));
-        assertEquals(2, full.size());
-    }
-
-    /**
-     *  size returns the number of elements
-     */
-    public void testSize() {
-        CopyOnWriteArraySet empty = new CopyOnWriteArraySet();
-        CopyOnWriteArraySet full = populatedSet(3);
-        assertEquals(3, full.size());
-        assertEquals(0, empty.size());
-    }
-
-    /**
-     *  toArray returns an Object array containing all elements from the set
-     */
-    public void testToArray() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Object[] o = full.toArray();
-        assertEquals(3, o.length);
-        assertEquals(0, o[0]);
-        assertEquals(1, o[1]);
-        assertEquals(2, o[2]);
-    }
-
-    /**
-     *  toArray returns an Integer array containing all elements from
-     *  the set
-     */
-    public void testToArray2() {
-        CopyOnWriteArraySet full = populatedSet(3);
-        Integer[] i = new Integer[3];
-        i = (Integer[])full.toArray(i);
-        assertEquals(3, i.length);
-        assertEquals(0, (int) i[0]);
-        assertEquals(1, (int) i[1]);
-        assertEquals(2, (int) i[2]);
-    }
-
-
-    /**
-     *  toArray throws an ArrayStoreException when the given array can
-     *  not store the objects inside the set
-     */
-    public void testToArray_ArrayStoreException() {
-        try {
-            CopyOnWriteArraySet c = new CopyOnWriteArraySet();
-            c.add("zfasdfsdf");
-            c.add("asdadasd");
-            c.toArray(new Long[5]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-    /**
-     * A deserialized serialized set is equal
-     */
-    public void testSerialization() throws Exception {
-        CopyOnWriteArraySet q = populatedSet(SIZE);
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        CopyOnWriteArraySet r = (CopyOnWriteArraySet)in.readObject();
-        assertEquals(q.size(), r.size());
-        assertTrue(q.equals(r));
-        assertTrue(r.equals(q));
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/CountDownLatchTest.java b/luni/src/test/java/tests/api/java/util/concurrent/CountDownLatchTest.java
deleted file mode 100755
index b06004e4..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/CountDownLatchTest.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
-public class CountDownLatchTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(CountDownLatchTest.class);
-    }
-
-    /**
-     * negative constructor argument throws IAE
-     */
-    public void testConstructor() {
-        try {
-            new CountDownLatch(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getCount returns initial count and decreases after countDown
-     */
-    public void testGetCount() {
-        final CountDownLatch l = new CountDownLatch(2);
-        assertEquals(2, l.getCount());
-        l.countDown();
-        assertEquals(1, l.getCount());
-    }
-
-    /**
-     * countDown decrements count when positive and has no effect when zero
-     */
-    public void testCountDown() {
-        final CountDownLatch l = new CountDownLatch(1);
-        assertEquals(1, l.getCount());
-        l.countDown();
-        assertEquals(0, l.getCount());
-        l.countDown();
-        assertEquals(0, l.getCount());
-    }
-
-    /**
-     * await returns after countDown to zero, but not before
-     */
-    public void testAwait() throws InterruptedException {
-        final CountDownLatch l = new CountDownLatch(2);
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertTrue(l.getCount() > 0);
-                l.await();
-                threadAssertTrue(l.getCount() == 0);
-            }});
-
-        t.start();
-        assertEquals(l.getCount(), 2);
-        Thread.sleep(SHORT_DELAY_MS);
-        l.countDown();
-        assertEquals(l.getCount(), 1);
-        l.countDown();
-        assertEquals(l.getCount(), 0);
-        t.join();
-    }
-
-
-    /**
-     * timed await returns after countDown to zero
-     */
-    public void testTimedAwait() throws InterruptedException {
-        final CountDownLatch l = new CountDownLatch(2);
-
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertTrue(l.getCount() > 0);
-                threadAssertTrue(l.await(SMALL_DELAY_MS, MILLISECONDS));
-            }});
-
-        t.start();
-        assertEquals(l.getCount(), 2);
-        Thread.sleep(SHORT_DELAY_MS);
-        l.countDown();
-        assertEquals(l.getCount(), 1);
-        l.countDown();
-        assertEquals(l.getCount(), 0);
-        t.join();
-    }
-
-    /**
-     * await throws IE if interrupted before counted down
-     */
-    public void testAwait_InterruptedException() throws InterruptedException {
-        final CountDownLatch l = new CountDownLatch(1);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertTrue(l.getCount() > 0);
-                l.await();
-            }});
-
-        t.start();
-        assertEquals(l.getCount(), 1);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timed await throws IE if interrupted before counted down
-     */
-    public void testTimedAwait_InterruptedException() throws InterruptedException {
-        final CountDownLatch l = new CountDownLatch(1);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertTrue(l.getCount() > 0);
-                l.await(MEDIUM_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(l.getCount(), 1);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timed await times out if not counted down before timeout
-     */
-    public void testAwaitTimeout() throws InterruptedException {
-        final CountDownLatch l = new CountDownLatch(1);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertTrue(l.getCount() > 0);
-                threadAssertFalse(l.await(SHORT_DELAY_MS, MILLISECONDS));
-                threadAssertTrue(l.getCount() > 0);
-            }});
-
-        t.start();
-        assertEquals(l.getCount(), 1);
-        t.join();
-    }
-
-    /**
-     * toString indicates current count
-     */
-    public void testToString() {
-        CountDownLatch s = new CountDownLatch(2);
-        String us = s.toString();
-        assertTrue(us.indexOf("Count = 2") >= 0);
-        s.countDown();
-        String s1 = s.toString();
-        assertTrue(s1.indexOf("Count = 1") >= 0);
-        s.countDown();
-        String s2 = s.toString();
-        assertTrue(s2.indexOf("Count = 0") >= 0);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/CyclicBarrierTest.java b/luni/src/test/java/tests/api/java/util/concurrent/CyclicBarrierTest.java
deleted file mode 100755
index b8f8b24..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/CyclicBarrierTest.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.locks.*;
-import java.util.concurrent.atomic.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
-public class CyclicBarrierTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(CyclicBarrierTest.class);
-    }
-
-    private volatile int countAction;
-    private class MyAction implements Runnable {
-        public void run() { ++countAction; }
-    }
-
-    /**
-     * Creating with negative parties throws IAE
-     */
-    public void testConstructor1() {
-        try {
-            new CyclicBarrier(-1, (Runnable)null);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Creating with negative parties and no action throws IAE
-     */
-    public void testConstructor2() {
-        try {
-            new CyclicBarrier(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getParties returns the number of parties given in constructor
-     */
-    public void testGetParties() {
-        CyclicBarrier b = new CyclicBarrier(2);
-        assertEquals(2, b.getParties());
-        assertEquals(0, b.getNumberWaiting());
-    }
-
-    /**
-     * A 1-party barrier triggers after single await
-     */
-    public void testSingleParty() throws Exception {
-        CyclicBarrier b = new CyclicBarrier(1);
-        assertEquals(1, b.getParties());
-        assertEquals(0, b.getNumberWaiting());
-        b.await();
-        b.await();
-        assertEquals(0, b.getNumberWaiting());
-    }
-
-    /**
-     * The supplied barrier action is run at barrier
-     */
-    public void testBarrierAction() throws Exception {
-        countAction = 0;
-        CyclicBarrier b = new CyclicBarrier(1, new MyAction());
-        assertEquals(1, b.getParties());
-        assertEquals(0, b.getNumberWaiting());
-        b.await();
-        b.await();
-        assertEquals(0, b.getNumberWaiting());
-        assertEquals(countAction, 2);
-    }
-
-    /**
-     * A 2-party/thread barrier triggers after both threads invoke await
-     */
-    public void testTwoParties() throws Exception {
-        final CyclicBarrier b = new CyclicBarrier(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws Exception {
-                b.await();
-                b.await();
-                b.await();
-                b.await();
-            }});
-
-        t.start();
-        b.await();
-        b.await();
-        b.await();
-        b.await();
-        t.join();
-    }
-
-
-    /**
-     * An interruption in one party causes others waiting in await to
-     * throw BrokenBarrierException
-     */
-    public void testAwait1_Interrupted_BrokenBarrier() throws Exception {
-        final CyclicBarrier c = new CyclicBarrier(3);
-        Thread t1 = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws Exception {
-                c.await();
-            }};
-        Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-            public void realRun() throws Exception {
-                c.await();
-            }};
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t1.interrupt();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * An interruption in one party causes others waiting in timed await to
-     * throw BrokenBarrierException
-     */
-    public void testAwait2_Interrupted_BrokenBarrier() throws Exception {
-        final CyclicBarrier c = new CyclicBarrier(3);
-        Thread t1 = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws Exception {
-                c.await(LONG_DELAY_MS, MILLISECONDS);
-            }};
-        Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-            public void realRun() throws Exception {
-                c.await(LONG_DELAY_MS, MILLISECONDS);
-            }};
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t1.interrupt();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * A timeout in timed await throws TimeoutException
-     */
-    public void testAwait3_TimeOutException() throws InterruptedException {
-        final CyclicBarrier c = new CyclicBarrier(2);
-        Thread t = new ThreadShouldThrow(TimeoutException.class) {
-            public void realRun() throws Exception {
-                c.await(SHORT_DELAY_MS, MILLISECONDS);
-            }};
-
-        t.start();
-        t.join();
-    }
-
-    /**
-     * A timeout in one party causes others waiting in timed await to
-     * throw BrokenBarrierException
-     */
-    public void testAwait4_Timeout_BrokenBarrier() throws InterruptedException {
-        final CyclicBarrier c = new CyclicBarrier(3);
-        Thread t1 = new ThreadShouldThrow(TimeoutException.class) {
-            public void realRun() throws Exception {
-                c.await(SHORT_DELAY_MS, MILLISECONDS);
-            }};
-        Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-            public void realRun() throws Exception {
-                c.await(MEDIUM_DELAY_MS, MILLISECONDS);
-            }};
-
-        t1.start();
-        t2.start();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * A timeout in one party causes others waiting in await to
-     * throw BrokenBarrierException
-     */
-    public void testAwait5_Timeout_BrokenBarrier() throws InterruptedException {
-        final CyclicBarrier c = new CyclicBarrier(3);
-        Thread t1 = new ThreadShouldThrow(TimeoutException.class) {
-            public void realRun() throws Exception {
-                c.await(SHORT_DELAY_MS, MILLISECONDS);
-            }};
-        Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-            public void realRun() throws Exception {
-                c.await();
-            }};
-
-        t1.start();
-        t2.start();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * A reset of an active barrier causes waiting threads to throw
-     * BrokenBarrierException
-     */
-    public void testReset_BrokenBarrier() throws InterruptedException {
-        final CyclicBarrier c = new CyclicBarrier(3);
-        Thread t1 = new ThreadShouldThrow(BrokenBarrierException.class) {
-            public void realRun() throws Exception {
-                c.await();
-            }};
-        Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-            public void realRun() throws Exception {
-                c.await();
-            }};
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        c.reset();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * A reset before threads enter barrier does not throw
-     * BrokenBarrierException
-     */
-    public void testReset_NoBrokenBarrier() throws Exception {
-        final CyclicBarrier c = new CyclicBarrier(3);
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws Exception {
-                c.await();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws Exception {
-                c.await();
-            }});
-
-        c.reset();
-        t1.start();
-        t2.start();
-        c.await();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * All threads block while a barrier is broken.
-     */
-    public void testReset_Leakage() throws InterruptedException {
-        final CyclicBarrier c = new CyclicBarrier(2);
-        final AtomicBoolean done = new AtomicBoolean();
-        Thread t = new Thread() {
-                public void run() {
-                    while (!done.get()) {
-                        try {
-                            while (c.isBroken())
-                                c.reset();
-
-                            c.await();
-                            threadFail("await should not return");
-                        }
-                        catch (BrokenBarrierException e) {
-                        }
-                        catch (InterruptedException ie) {
-                        }
-                    }
-                }
-            };
-
-        t.start();
-        for (int i = 0; i < 4; i++) {
-            Thread.sleep(SHORT_DELAY_MS);
-            t.interrupt();
-        }
-        done.set(true);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * Reset of a non-broken barrier does not break barrier
-     */
-    public void testResetWithoutBreakage() throws Exception {
-        final CyclicBarrier start = new CyclicBarrier(3);
-        final CyclicBarrier barrier = new CyclicBarrier(3);
-        for (int i = 0; i < 3; i++) {
-            Thread t1 = new Thread(new CheckedRunnable() {
-                public void realRun() throws Exception {
-                    start.await();
-                    barrier.await();
-                }});
-
-            Thread t2 = new Thread(new CheckedRunnable() {
-                public void realRun() throws Exception {
-                    start.await();
-                    barrier.await();
-                }});
-
-            t1.start();
-            t2.start();
-            start.await();
-            barrier.await();
-            t1.join();
-            t2.join();
-            assertFalse(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-            if (i == 1) barrier.reset();
-            assertFalse(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-        }
-    }
-
-    /**
-     * Reset of a barrier after interruption reinitializes it.
-     */
-    public void testResetAfterInterrupt() throws Exception {
-        final CyclicBarrier start = new CyclicBarrier(3);
-        final CyclicBarrier barrier = new CyclicBarrier(3);
-        for (int i = 0; i < 2; i++) {
-            Thread t1 = new ThreadShouldThrow(InterruptedException.class) {
-                public void realRun() throws Exception {
-                    start.await();
-                    barrier.await();
-                }};
-
-            Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-                public void realRun() throws Exception {
-                    start.await();
-                    barrier.await();
-                }};
-
-            t1.start();
-            t2.start();
-            start.await();
-            t1.interrupt();
-            t1.join();
-            t2.join();
-            assertTrue(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-            barrier.reset();
-            assertFalse(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-        }
-    }
-
-    /**
-     * Reset of a barrier after timeout reinitializes it.
-     */
-    public void testResetAfterTimeout() throws Exception {
-        final CyclicBarrier start = new CyclicBarrier(3);
-        final CyclicBarrier barrier = new CyclicBarrier(3);
-        for (int i = 0; i < 2; i++) {
-            Thread t1 = new ThreadShouldThrow(TimeoutException.class) {
-                    public void realRun() throws Exception {
-                        start.await();
-                        barrier.await(MEDIUM_DELAY_MS, MILLISECONDS);
-                    }};
-
-            Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-                public void realRun() throws Exception {
-                    start.await();
-                    barrier.await();
-                }};
-
-            t1.start();
-            t2.start();
-            start.await();
-            t1.join();
-            t2.join();
-            assertTrue(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-            barrier.reset();
-            assertFalse(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-        }
-    }
-
-
-    /**
-     * Reset of a barrier after a failed command reinitializes it.
-     */
-    public void testResetAfterCommandException() throws Exception {
-        final CyclicBarrier start = new CyclicBarrier(3);
-        final CyclicBarrier barrier =
-            new CyclicBarrier(3, new Runnable() {
-                    public void run() {
-                        throw new NullPointerException(); }});
-        for (int i = 0; i < 2; i++) {
-            Thread t1 = new ThreadShouldThrow(BrokenBarrierException.class) {
-                public void realRun() throws Exception {
-                    start.await();
-                    barrier.await();
-                }};
-
-            Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) {
-                public void realRun() throws Exception {
-                    start.await();
-                    barrier.await();
-                }};
-
-            t1.start();
-            t2.start();
-            start.await();
-            while (barrier.getNumberWaiting() < 2) { Thread.yield(); }
-            try {
-                barrier.await();
-                shouldThrow();
-            } catch (NullPointerException success) {}
-            t1.join();
-            t2.join();
-            assertTrue(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-            barrier.reset();
-            assertFalse(barrier.isBroken());
-            assertEquals(0, barrier.getNumberWaiting());
-        }
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/DelayQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/DelayQueueTest.java
deleted file mode 100755
index 7aeceda..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/DelayQueueTest.java
+++ /dev/null
@@ -1,915 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.*;
-
-public class DelayQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(DelayQueueTest.class);
-    }
-
-    private static final int NOCAP = Integer.MAX_VALUE;
-
-    /**
-     * A delayed implementation for testing.
-     * Most tests use Pseudodelays, where delays are all elapsed
-     * (so, no blocking solely for delays) but are still ordered
-     */
-    static class PDelay implements Delayed {
-        int pseudodelay;
-        PDelay(int i) { pseudodelay = Integer.MIN_VALUE + i; }
-        public int compareTo(PDelay y) {
-            int i = pseudodelay;
-            int j = y.pseudodelay;
-            if (i < j) return -1;
-            if (i > j) return 1;
-            return 0;
-        }
-
-        public int compareTo(Delayed y) {
-            return compareTo((PDelay)y);
-        }
-
-        public boolean equals(Object other) {
-            return equals((PDelay)other);
-        }
-        public boolean equals(PDelay other) {
-            return other.pseudodelay == pseudodelay;
-        }
-
-
-        public long getDelay(TimeUnit ignore) {
-            return pseudodelay;
-        }
-        public int intValue() {
-            return pseudodelay;
-        }
-
-        public String toString() {
-            return String.valueOf(pseudodelay);
-        }
-    }
-
-
-    /**
-     * Delayed implementation that actually delays
-     */
-    static class NanoDelay implements Delayed {
-        long trigger;
-        NanoDelay(long i) {
-            trigger = System.nanoTime() + i;
-        }
-        public int compareTo(NanoDelay y) {
-            long i = trigger;
-            long j = y.trigger;
-            if (i < j) return -1;
-            if (i > j) return 1;
-            return 0;
-        }
-
-        public int compareTo(Delayed y) {
-            return compareTo((NanoDelay)y);
-        }
-
-        public boolean equals(Object other) {
-            return equals((NanoDelay)other);
-        }
-        public boolean equals(NanoDelay other) {
-            return other.trigger == trigger;
-        }
-
-        public long getDelay(TimeUnit unit) {
-            long n = trigger - System.nanoTime();
-            return unit.convert(n, TimeUnit.NANOSECONDS);
-        }
-
-        public long getTriggerTime() {
-            return trigger;
-        }
-
-        public String toString() {
-            return String.valueOf(trigger);
-        }
-    }
-
-
-    /**
-     * Create a queue of given size containing consecutive
-     * PDelays 0 ... n.
-     */
-    private DelayQueue populatedQueue(int n) {
-        DelayQueue q = new DelayQueue();
-        assertTrue(q.isEmpty());
-        for (int i = n-1; i >= 0; i-=2)
-            assertTrue(q.offer(new PDelay(i)));
-        for (int i = (n & 1); i < n; i+=2)
-            assertTrue(q.offer(new PDelay(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(NOCAP, q.remainingCapacity());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * A new queue has unbounded capacity
-     */
-    public void testConstructor1() {
-        assertEquals(NOCAP, new DelayQueue().remainingCapacity());
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            DelayQueue q = new DelayQueue(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            PDelay[] ints = new PDelay[SIZE];
-            DelayQueue q = new DelayQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            PDelay[] ints = new PDelay[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new PDelay(i);
-            DelayQueue q = new DelayQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-     */
-    public void testConstructor6() {
-        PDelay[] ints = new PDelay[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new PDelay(i);
-        DelayQueue q = new DelayQueue(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        DelayQueue q = new DelayQueue();
-        assertTrue(q.isEmpty());
-        assertEquals(NOCAP, q.remainingCapacity());
-        q.add(new PDelay(1));
-        assertFalse(q.isEmpty());
-        q.add(new PDelay(2));
-        q.remove();
-        q.remove();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * remainingCapacity does not change when elements added or removed,
-     * but size does
-     */
-    public void testRemainingCapacity() {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(NOCAP, q.remainingCapacity());
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(NOCAP, q.remainingCapacity());
-            assertEquals(i, q.size());
-            q.add(new PDelay(i));
-        }
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            DelayQueue q = new DelayQueue();
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            DelayQueue q = new DelayQueue();
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * offer non-null succeeds
-     */
-    public void testOffer() {
-        DelayQueue q = new DelayQueue();
-        assertTrue(q.offer(new PDelay(0)));
-        assertTrue(q.offer(new PDelay(1)));
-    }
-
-    /**
-     * add succeeds
-     */
-    public void testAdd() {
-        DelayQueue q = new DelayQueue();
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            assertTrue(q.add(new PDelay(i)));
-        }
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            DelayQueue q = new DelayQueue();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            DelayQueue q = populatedQueue(SIZE);
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            DelayQueue q = new DelayQueue();
-            PDelay[] ints = new PDelay[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            DelayQueue q = new DelayQueue();
-            PDelay[] ints = new PDelay[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new PDelay(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of successful addAll
-     */
-    public void testAddAll5() {
-        PDelay[] empty = new PDelay[0];
-        PDelay[] ints = new PDelay[SIZE];
-        for (int i = SIZE-1; i >= 0; --i)
-            ints[i] = new PDelay(i);
-        DelayQueue q = new DelayQueue();
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * put(null) throws NPE
-     */
-     public void testPutNull() {
-        try {
-            DelayQueue q = new DelayQueue();
-            q.put(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-     }
-
-    /**
-     * all elements successfully put are contained
-     */
-     public void testPut() {
-         DelayQueue q = new DelayQueue();
-         for (int i = 0; i < SIZE; ++i) {
-             PDelay I = new PDelay(i);
-             q.put(I);
-             assertTrue(q.contains(I));
-         }
-         assertEquals(SIZE, q.size());
-    }
-
-    /**
-     * put doesn't block waiting for take
-     */
-    public void testPutWithTake() throws InterruptedException {
-        final DelayQueue q = new DelayQueue();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                q.put(new PDelay(0));
-                q.put(new PDelay(0));
-                q.put(new PDelay(0));
-                q.put(new PDelay(0));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        q.take();
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timed offer does not time out
-     */
-    public void testTimedOffer() throws InterruptedException {
-        final DelayQueue q = new DelayQueue();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new PDelay(0));
-                q.put(new PDelay(0));
-                assertTrue(q.offer(new PDelay(0), SHORT_DELAY_MS, MILLISECONDS));
-                assertTrue(q.offer(new PDelay(0), LONG_DELAY_MS, MILLISECONDS));
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * take retrieves elements in priority order
-     */
-    public void testTake() throws InterruptedException {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(new PDelay(i), ((PDelay)q.take()));
-        }
-    }
-
-    /**
-     * take blocks interruptibly when empty
-     */
-    public void testTakeFromEmpty() throws InterruptedException {
-        final DelayQueue q = new DelayQueue();
-        Thread t = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws InterruptedException {
-                q.take();
-            }};
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * Take removes existing elements until empty, then blocks interruptibly
-     */
-    public void testBlockingTake() throws InterruptedException {
-        final DelayQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(new PDelay(i), ((PDelay)q.take()));
-                }
-                try {
-                    q.take();
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(new PDelay(i), ((PDelay)q.poll()));
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     * timed pool with zero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll0() throws InterruptedException {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(new PDelay(i), ((PDelay)q.poll(0, MILLISECONDS)));
-        }
-        assertNull(q.poll(0, MILLISECONDS));
-    }
-
-    /**
-     * timed pool with nonzero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll() throws InterruptedException {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(new PDelay(i), ((PDelay)q.poll(SHORT_DELAY_MS, MILLISECONDS)));
-        }
-        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed poll throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPoll() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                DelayQueue q = populatedQueue(SIZE);
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(new PDelay(i), ((PDelay)q.poll(SHORT_DELAY_MS, MILLISECONDS)));
-                }
-                try {
-                    q.poll(SMALL_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offer fails; after offer succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollWithOffer() throws InterruptedException {
-        final DelayQueue q = new DelayQueue();
-        final PDelay pdelay = new PDelay(0);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(pdelay, q.poll(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offer(pdelay, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(new PDelay(i), ((PDelay)q.peek()));
-            assertEquals(new PDelay(i), ((PDelay)q.poll()));
-            if (q.isEmpty())
-                assertNull(q.peek());
-            else
-                assertFalse(new PDelay(i).equals(q.peek()));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(new PDelay(i), ((PDelay)q.element()));
-            q.poll();
-        }
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(new PDelay(i), ((PDelay)q.remove()));
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new PDelay(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new PDelay(i)));
-            assertFalse(q.remove(new PDelay(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        DelayQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new PDelay(i)));
-            q.poll();
-            assertFalse(q.contains(new PDelay(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        DelayQueue q = populatedQueue(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        assertEquals(NOCAP, q.remainingCapacity());
-        PDelay x = new PDelay(1);
-        q.add(x);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(x));
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        DelayQueue q = populatedQueue(SIZE);
-        DelayQueue p = new DelayQueue();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new PDelay(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        DelayQueue q = populatedQueue(SIZE);
-        DelayQueue p = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            DelayQueue q = populatedQueue(SIZE);
-            DelayQueue p = populatedQueue(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                PDelay I = (PDelay)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testToArray() throws InterruptedException {
-        DelayQueue q = populatedQueue(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.take());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() throws InterruptedException {
-        DelayQueue q = populatedQueue(SIZE);
-        PDelay[] ints = new PDelay[SIZE];
-        ints = (PDelay[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.take());
-    }
-
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        DelayQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * toArray with incompatible array type throws CCE
-     */
-    public void testToArray1_BadArg() {
-        DelayQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(new String[10]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() {
-        DelayQueue q = populatedQueue(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final DelayQueue q = new DelayQueue();
-        q.add(new PDelay(2));
-        q.add(new PDelay(1));
-        q.add(new PDelay(3));
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-        it = q.iterator();
-        assertEquals(it.next(), new PDelay(2));
-        assertEquals(it.next(), new PDelay(3));
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        DelayQueue q = populatedQueue(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(Integer.MIN_VALUE+i)) >= 0);
-        }
-    }
-
-    /**
-     * offer transfers elements across Executor tasks
-     */
-    public void testPollInExecutor() {
-        final DelayQueue q = new DelayQueue();
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll());
-                assertTrue(null != q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
-                assertTrue(q.isEmpty());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SHORT_DELAY_MS);
-                q.put(new PDelay(1));
-            }});
-
-        joinPool(executor);
-    }
-
-
-    /**
-     * Delayed actions do not occur until their delay elapses
-     */
-    public void testDelay() throws InterruptedException {
-        DelayQueue q = new DelayQueue();
-        NanoDelay[] elements = new NanoDelay[SIZE];
-        for (int i = 0; i < SIZE; ++i) {
-            elements[i] = new NanoDelay(1000000000L + 1000000L * (SIZE - i));
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            q.add(elements[i]);
-        }
-
-        long last = 0;
-        for (int i = 0; i < SIZE; ++i) {
-            NanoDelay e = (NanoDelay)(q.take());
-            long tt = e.getTriggerTime();
-            assertTrue(tt <= System.nanoTime());
-            if (i != 0)
-                assertTrue(tt >= last);
-            last = tt;
-        }
-    }
-
-    /**
-     * peek of a non-empty queue returns non-null even if not expired
-     */
-    public void testPeekDelayed() {
-        DelayQueue q = new DelayQueue();
-        q.add(new NanoDelay(Long.MAX_VALUE));
-        assert(q.peek() != null);
-    }
-
-
-    /**
-     * poll of a non-empty queue returns null if no expired elements.
-     */
-    public void testPollDelayed() {
-        DelayQueue q = new DelayQueue();
-        q.add(new NanoDelay(Long.MAX_VALUE));
-        assertNull(q.poll());
-    }
-
-    /**
-     * timed poll of a non-empty queue returns null if no expired elements.
-     */
-    public void testTimedPollDelayed() throws InterruptedException {
-        DelayQueue q = new DelayQueue();
-        q.add(new NanoDelay(LONG_DELAY_MS * 1000000L));
-        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * drainTo(null) throws NPE
-     */
-    public void testDrainToNull() {
-        DelayQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this) throws IAE
-     */
-    public void testDrainToSelf() {
-        DelayQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c) empties queue into another collection c
-     */
-    public void testDrainTo() {
-        DelayQueue q = new DelayQueue();
-        PDelay[] elems = new PDelay[SIZE];
-        for (int i = 0; i < SIZE; ++i) {
-            elems[i] = new PDelay(i);
-            q.add(elems[i]);
-        }
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), elems[i]);
-        q.add(elems[0]);
-        q.add(elems[1]);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(elems[0]));
-        assertTrue(q.contains(elems[1]));
-        l.clear();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), 2);
-        for (int i = 0; i < 2; ++i)
-            assertEquals(l.get(i), elems[i]);
-    }
-
-    /**
-     * drainTo empties queue
-     */
-    public void testDrainToWithActivePut() throws InterruptedException {
-        final DelayQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                q.put(new PDelay(SIZE+1));
-            }});
-
-        t.start();
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertTrue(l.size() >= SIZE);
-        t.join();
-        assertTrue(q.size() + l.size() >= SIZE);
-    }
-
-    /**
-     * drainTo(null, n) throws NPE
-     */
-    public void testDrainToNullN() {
-        DelayQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null, 0);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this, n) throws IAE
-     */
-    public void testDrainToSelfN() {
-        DelayQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q, 0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c, n) empties first max {n, size} elements of queue into c
-     */
-    public void testDrainToN() {
-        for (int i = 0; i < SIZE + 2; ++i) {
-            DelayQueue q = populatedQueue(SIZE);
-            ArrayList l = new ArrayList();
-            q.drainTo(l, i);
-            int k = (i < SIZE)? i : SIZE;
-            assertEquals(q.size(), SIZE-k);
-            assertEquals(l.size(), k);
-        }
-    }
-
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/EntryTest.java b/luni/src/test/java/tests/api/java/util/concurrent/EntryTest.java
deleted file mode 100644
index 893fd48..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/EntryTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class EntryTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(EntryTest.class);
-    }
-
-    static final String k1 = "1";
-    static final String v1 = "a";
-    static final String k2 = "2";
-    static final String v2 = "b";
-
-
-    /**
-     * A new SimpleEntry(k, v) holds k, v.
-     */
-    public void testConstructor1() {
-        Map.Entry e = new AbstractMap.SimpleEntry(k1, v1);
-        assertEquals(k1, e.getKey());
-        assertEquals(v1, e.getValue());
-    }
-
-    /**
-     * A new SimpleImmutableEntry(k, v) holds k, v.
-     */
-    public void testConstructor2() {
-        Map.Entry s = new AbstractMap.SimpleImmutableEntry(k1, v1);
-        assertEquals(k1, s.getKey());
-        assertEquals(v1, s.getValue());
-    }
-
-
-    /**
-     * A new SimpleEntry(entry(k, v)) holds k, v.
-     */
-    public void testConstructor3() {
-        Map.Entry e2 = new AbstractMap.SimpleEntry(k1, v1);
-        Map.Entry e = new AbstractMap.SimpleEntry(e2);
-        assertEquals(k1, e.getKey());
-        assertEquals(v1, e.getValue());
-    }
-
-    /**
-     * A new SimpleImmutableEntry(entry(k, v)) holds k, v.
-     */
-    public void testConstructor4() {
-        Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1);
-        Map.Entry s = new AbstractMap.SimpleImmutableEntry(s2);
-        assertEquals(k1, s.getKey());
-        assertEquals(v1, s.getValue());
-    }
-
-    /**
-     * Entries with same key-value pairs are equal and have same
-     * hashcodes
-     */
-    public void testEquals() {
-        Map.Entry e2 = new AbstractMap.SimpleEntry(k1, v1);
-        Map.Entry e = new AbstractMap.SimpleEntry(e2);
-        Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1);
-        Map.Entry s = new AbstractMap.SimpleImmutableEntry(s2);
-        assertEquals(e2, e);
-        assertEquals(e2.hashCode(), e.hashCode());
-        assertEquals(s2, s);
-        assertEquals(s2.hashCode(), s.hashCode());
-        assertEquals(e2, s2);
-        assertEquals(e2.hashCode(), s2.hashCode());
-        assertEquals(e, s);
-        assertEquals(e.hashCode(), s.hashCode());
-    }
-
-    /**
-     * Entries with different key-value pairs are not equal
-     */
-    public void testNotEquals() {
-        Map.Entry e2 = new AbstractMap.SimpleEntry(k1, v1);
-        Map.Entry e = new AbstractMap.SimpleEntry(k2, v1);
-        assertFalse(e2.equals( e));
-        e = new AbstractMap.SimpleEntry(k1, v2);
-        assertFalse(e2.equals( e));
-        e = new AbstractMap.SimpleEntry(k2, v2);
-        assertFalse(e2.equals( e));
-
-        Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1);
-        Map.Entry s = new AbstractMap.SimpleImmutableEntry(k2, v1);
-        assertFalse(s2.equals( s));
-        s = new AbstractMap.SimpleImmutableEntry(k1, v2);
-        assertFalse(s2.equals( s));
-        s = new AbstractMap.SimpleImmutableEntry(k2, v2);
-        assertFalse(s2.equals( s));
-    }
-
-
-    /**
-     * getValue returns last setValue for SimpleEntry
-     */
-    public void testSetValue1() {
-        Map.Entry e2 = new AbstractMap.SimpleEntry(k1, v1);
-        Map.Entry e = new AbstractMap.SimpleEntry(e2);
-        assertEquals(k1, e.getKey());
-        assertEquals(v1, e.getValue());
-        e.setValue(k2);
-        assertEquals(k2, e.getValue());
-        assertFalse(e2.equals( e));
-    }
-
-    /**
-     * setValue for SimpleImmutableEntry throws UnsupportedOperationException
-     */
-    public void testsetValue2() {
-        Map.Entry s2 = new AbstractMap.SimpleImmutableEntry(k1, v1);
-        Map.Entry s = new AbstractMap.SimpleImmutableEntry(s2);
-        assertEquals(k1, s.getKey());
-        assertEquals(v1, s.getValue());
-        try {
-            s.setValue(k2);
-            shouldThrow();
-        } catch (UnsupportedOperationException success) {}
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ExchangerTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ExchangerTest.java
deleted file mode 100755
index be1eaa3..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ExchangerTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-
-public class ExchangerTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ExchangerTest.class);
-    }
-
-    /**
-     * exchange exchanges objects across two threads
-     */
-    public void testExchange() throws InterruptedException {
-        final Exchanger e = new Exchanger();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertSame(one, e.exchange(two));
-                assertSame(two, e.exchange(one));
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertSame(two, e.exchange(one));
-                assertSame(one, e.exchange(two));
-            }});
-
-        t1.start();
-        t2.start();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * timed exchange exchanges objects across two threads
-     */
-    public void testTimedExchange() throws InterruptedException {
-        final Exchanger e = new Exchanger();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws Exception {
-                assertSame(one, e.exchange(two, SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(two, e.exchange(one, SHORT_DELAY_MS, MILLISECONDS));
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws Exception {
-                assertSame(two, e.exchange(one, SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(one, e.exchange(two, SHORT_DELAY_MS, MILLISECONDS));
-            }});
-
-        t1.start();
-        t2.start();
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * interrupt during wait for exchange throws IE
-     */
-    public void testExchange_InterruptedException() throws InterruptedException {
-        final Exchanger e = new Exchanger();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                e.exchange(one);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * interrupt during wait for timed exchange throws IE
-     */
-    public void testTimedExchange_InterruptedException() throws InterruptedException {
-        final Exchanger e = new Exchanger();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws Exception {
-                e.exchange(null, SMALL_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timeout during wait for timed exchange throws TOE
-     */
-    public void testExchange_TimeOutException() throws InterruptedException {
-        final Exchanger e = new Exchanger();
-        Thread t = new ThreadShouldThrow(TimeoutException.class) {
-            public void realRun() throws Exception {
-                e.exchange(null, SHORT_DELAY_MS, MILLISECONDS);
-            }};
-
-        t.start();
-        t.join();
-    }
-
-    /**
-     * If one exchanging thread is interrupted, another succeeds.
-     */
-    public void testReplacementAfterExchange() throws InterruptedException {
-        final Exchanger e = new Exchanger();
-        Thread t1 = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertSame(two, e.exchange(one));
-                e.exchange(two);
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertSame(one, e.exchange(two));
-                Thread.sleep(SMALL_DELAY_MS);
-                assertSame(three, e.exchange(one));
-            }});
-        Thread t3 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                assertSame(one, e.exchange(three));
-            }});
-
-        t1.start();
-        t2.start();
-        t3.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t1.interrupt();
-        t1.join();
-        t2.join();
-        t3.join();
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ExecutorCompletionServiceTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ExecutorCompletionServiceTest.java
deleted file mode 100644
index dfa8f7d..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ExecutorCompletionServiceTest.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.atomic.*;
-import java.math.BigInteger;
-import java.security.*;
-
-public class ExecutorCompletionServiceTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ExecutorCompletionServiceTest.class);
-    }
-
-
-    /**
-     * Creating a new ECS with null Executor throw NPE
-     */
-    public void testConstructorNPE() {
-        try {
-            ExecutorCompletionService ecs = new ExecutorCompletionService(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Creating a new ECS with null queue throw NPE
-     */
-    public void testConstructorNPE2() {
-        try {
-            ExecutorService e = Executors.newCachedThreadPool();
-            ExecutorCompletionService ecs = new ExecutorCompletionService(e, null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Submitting a null callable throws NPE
-     */
-    public void testSubmitNPE() {
-        ExecutorService e = Executors.newCachedThreadPool();
-        ExecutorCompletionService ecs = new ExecutorCompletionService(e);
-        try {
-            Callable c = null;
-            ecs.submit(c);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * Submitting a null runnable throws NPE
-     */
-    public void testSubmitNPE2() {
-        ExecutorService e = Executors.newCachedThreadPool();
-        ExecutorCompletionService ecs = new ExecutorCompletionService(e);
-        try {
-            Runnable r = null;
-            ecs.submit(r, Boolean.TRUE);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * A taken submitted task is completed
-     */
-    public void testTake() throws InterruptedException {
-        ExecutorService e = Executors.newCachedThreadPool();
-        ExecutorCompletionService ecs = new ExecutorCompletionService(e);
-        try {
-            Callable c = new StringTask();
-            ecs.submit(c);
-            Future f = ecs.take();
-            assertTrue(f.isDone());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * Take returns the same future object returned by submit
-     */
-    public void testTake2() throws InterruptedException {
-        ExecutorService e = Executors.newCachedThreadPool();
-        ExecutorCompletionService ecs = new ExecutorCompletionService(e);
-        try {
-            Callable c = new StringTask();
-            Future f1 = ecs.submit(c);
-            Future f2 = ecs.take();
-            assertSame(f1, f2);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * If poll returns non-null, the returned task is completed
-     */
-    public void testPoll1() throws InterruptedException {
-        ExecutorService e = Executors.newCachedThreadPool();
-        ExecutorCompletionService ecs = new ExecutorCompletionService(e);
-        try {
-            assertNull(ecs.poll());
-            Callable c = new StringTask();
-            ecs.submit(c);
-            Thread.sleep(SHORT_DELAY_MS);
-            for (;;) {
-                Future f = ecs.poll();
-                if (f != null) {
-                    assertTrue(f.isDone());
-                    break;
-                }
-            }
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * If timed poll returns non-null, the returned task is completed
-     */
-    public void testPoll2() throws InterruptedException {
-        ExecutorService e = Executors.newCachedThreadPool();
-        ExecutorCompletionService ecs = new ExecutorCompletionService(e);
-        try {
-            assertNull(ecs.poll());
-            Callable c = new StringTask();
-            ecs.submit(c);
-            Future f = ecs.poll(SHORT_DELAY_MS, MILLISECONDS);
-            if (f != null)
-                assertTrue(f.isDone());
-        } finally {
-            joinPool(e);
-        }
-    }
-     /**
-      * Submitting to underlying AES that overrides newTaskFor(Callable)
-      * returns and eventually runs Future returned by newTaskFor.
-      */
-     public void testNewTaskForCallable() throws InterruptedException {
-         final AtomicBoolean done = new AtomicBoolean(false);
-         class MyCallableFuture<V> extends FutureTask<V> {
-             MyCallableFuture(Callable<V> c) { super(c); }
-             protected void done() { done.set(true); }
-         }
-         ExecutorService e = new ThreadPoolExecutor(
-                                 1, 1, 30L, TimeUnit.SECONDS,
-                                 new ArrayBlockingQueue<Runnable>(1)) {
-             protected <T> RunnableFuture<T> newTaskFor(Callable<T> c) {
-                 return new MyCallableFuture<T>(c);
-             }
-         };
-         ExecutorCompletionService<String> ecs =
-             new ExecutorCompletionService<String>(e);
-         try {
-             assertNull(ecs.poll());
-             Callable<String> c = new StringTask();
-             Future f1 = ecs.submit(c);
-             assertTrue("submit must return MyCallableFuture",
-                        f1 instanceof MyCallableFuture);
-             Future f2 = ecs.take();
-             assertSame("submit and take must return same objects", f1, f2);
-             assertTrue("completed task must have set done", done.get());
-         } finally {
-             joinPool(e);
-         }
-     }
-
-     /**
-      * Submitting to underlying AES that overrides newTaskFor(Runnable,T)
-      * returns and eventually runs Future returned by newTaskFor.
-      */
-     public void testNewTaskForRunnable() throws InterruptedException {
-         final AtomicBoolean done = new AtomicBoolean(false);
-         class MyRunnableFuture<V> extends FutureTask<V> {
-             MyRunnableFuture(Runnable t, V r) { super(t, r); }
-             protected void done() { done.set(true); }
-         }
-         ExecutorService e = new ThreadPoolExecutor(
-                                 1, 1, 30L, TimeUnit.SECONDS,
-                                 new ArrayBlockingQueue<Runnable>(1)) {
-             protected <T> RunnableFuture<T> newTaskFor(Runnable t, T r) {
-                 return new MyRunnableFuture<T>(t, r);
-             }
-         };
-         ExecutorCompletionService<String> ecs =
-             new ExecutorCompletionService<String>(e);
-         try {
-             assertNull(ecs.poll());
-             Runnable r = new NoOpRunnable();
-             Future f1 = ecs.submit(r, null);
-             assertTrue("submit must return MyRunnableFuture",
-                        f1 instanceof MyRunnableFuture);
-             Future f2 = ecs.take();
-             assertSame("submit and take must return same objects", f1, f2);
-             assertTrue("completed task must have set done", done.get());
-         } finally {
-             joinPool(e);
-         }
-     }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ExecutorsTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ExecutorsTest.java
deleted file mode 100755
index f29a712..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ExecutorsTest.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.math.BigInteger;
-import java.security.*;
-
-public class ExecutorsTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ExecutorsTest.class);
-    }
-
-    /**
-     * A newCachedThreadPool can execute runnables
-     */
-    public void testNewCachedThreadPool1() {
-        ExecutorService e = Executors.newCachedThreadPool();
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        joinPool(e);
-    }
-
-    /**
-     * A newCachedThreadPool with given ThreadFactory can execute runnables
-     */
-    public void testNewCachedThreadPool2() {
-        ExecutorService e = Executors.newCachedThreadPool(new SimpleThreadFactory());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        joinPool(e);
-    }
-
-    /**
-     * A newCachedThreadPool with null ThreadFactory throws NPE
-     */
-    public void testNewCachedThreadPool3() {
-        try {
-            ExecutorService e = Executors.newCachedThreadPool(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * A new SingleThreadExecutor can execute runnables
-     */
-    public void testNewSingleThreadExecutor1() {
-        ExecutorService e = Executors.newSingleThreadExecutor();
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        joinPool(e);
-    }
-
-    /**
-     * A new SingleThreadExecutor with given ThreadFactory can execute runnables
-     */
-    public void testNewSingleThreadExecutor2() {
-        ExecutorService e = Executors.newSingleThreadExecutor(new SimpleThreadFactory());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        joinPool(e);
-    }
-
-    /**
-     * A new SingleThreadExecutor with null ThreadFactory throws NPE
-     */
-    public void testNewSingleThreadExecutor3() {
-        try {
-            ExecutorService e = Executors.newSingleThreadExecutor(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * A new SingleThreadExecutor cannot be casted to concrete implementation
-     */
-    public void testCastNewSingleThreadExecutor() {
-        ExecutorService e = Executors.newSingleThreadExecutor();
-        try {
-            ThreadPoolExecutor tpe = (ThreadPoolExecutor)e;
-            shouldThrow();
-        } catch (ClassCastException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-
-    /**
-     * A new newFixedThreadPool can execute runnables
-     */
-    public void testNewFixedThreadPool1() {
-        ExecutorService e = Executors.newFixedThreadPool(2);
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        joinPool(e);
-    }
-
-    /**
-     * A new newFixedThreadPool with given ThreadFactory can execute runnables
-     */
-    public void testNewFixedThreadPool2() {
-        ExecutorService e = Executors.newFixedThreadPool(2, new SimpleThreadFactory());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        joinPool(e);
-    }
-
-    /**
-     * A new newFixedThreadPool with null ThreadFactory throws NPE
-     */
-    public void testNewFixedThreadPool3() {
-        try {
-            ExecutorService e = Executors.newFixedThreadPool(2, null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * A new newFixedThreadPool with 0 threads throws IAE
-     */
-    public void testNewFixedThreadPool4() {
-        try {
-            ExecutorService e = Executors.newFixedThreadPool(0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-
-    /**
-     * An unconfigurable newFixedThreadPool can execute runnables
-     */
-    public void testunconfigurableExecutorService() {
-        ExecutorService e = Executors.unconfigurableExecutorService(Executors.newFixedThreadPool(2));
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        e.execute(new NoOpRunnable());
-        joinPool(e);
-    }
-
-    /**
-     * unconfigurableExecutorService(null) throws NPE
-     */
-    public void testunconfigurableExecutorServiceNPE() {
-        try {
-            ExecutorService e = Executors.unconfigurableExecutorService(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * unconfigurableScheduledExecutorService(null) throws NPE
-     */
-    public void testunconfigurableScheduledExecutorServiceNPE() {
-        try {
-            ExecutorService e = Executors.unconfigurableScheduledExecutorService(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * a newSingleThreadScheduledExecutor successfully runs delayed task
-     */
-    public void testNewSingleThreadScheduledExecutor() throws Exception {
-        TrackedCallable callable = new TrackedCallable();
-        ScheduledExecutorService p1 = Executors.newSingleThreadScheduledExecutor();
-        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(callable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(callable.done);
-        assertEquals(Boolean.TRUE, f.get());
-        joinPool(p1);
-    }
-
-    /**
-     * a newScheduledThreadPool successfully runs delayed task
-     */
-    public void testnewScheduledThreadPool() throws Exception {
-        TrackedCallable callable = new TrackedCallable();
-        ScheduledExecutorService p1 = Executors.newScheduledThreadPool(2);
-        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(callable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(callable.done);
-        assertEquals(Boolean.TRUE, f.get());
-        joinPool(p1);
-    }
-
-    /**
-     * an unconfigurable newScheduledThreadPool successfully runs delayed task
-     */
-    public void testunconfigurableScheduledExecutorService() throws Exception {
-        TrackedCallable callable = new TrackedCallable();
-        ScheduledExecutorService p1 = Executors.unconfigurableScheduledExecutorService(Executors.newScheduledThreadPool(2));
-        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(callable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(callable.done);
-        assertEquals(Boolean.TRUE, f.get());
-        joinPool(p1);
-    }
-
-    /**
-     *  Future.get on submitted tasks will time out if they compute too long.
-     */
-    public void testTimedCallable() throws Exception {
-        final Runnable sleeper =
-            new RunnableShouldThrow(InterruptedException.class) {
-                public void realRun() throws InterruptedException {
-                    Thread.sleep(LONG_DELAY_MS);
-                }};
-        for (ExecutorService executor :
-                 new ExecutorService[] {
-                     Executors.newSingleThreadExecutor(),
-                     Executors.newCachedThreadPool(),
-                     Executors.newFixedThreadPool(2),
-                     Executors.newScheduledThreadPool(2),
-                 }) {
-            try {
-                Future future = executor.submit(sleeper);
-                try {
-                    future.get(SHORT_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (TimeoutException success) {
-                } finally {
-                    future.cancel(true);
-                }
-            }
-            finally {
-                joinPool(executor);
-            }
-        }
-    }
-
-
-    /**
-     * ThreadPoolExecutor using defaultThreadFactory has
-     * specified group, priority, daemon status, and name
-     */
-    public void testDefaultThreadFactory() throws Exception {
-        final ThreadGroup egroup = Thread.currentThread().getThreadGroup();
-        Runnable r = new Runnable() {
-                public void run() {
-                    try {
-                        Thread current = Thread.currentThread();
-                        threadAssertTrue(!current.isDaemon());
-                        threadAssertTrue(current.getPriority() <= Thread.NORM_PRIORITY);
-                        ThreadGroup g = current.getThreadGroup();
-                        SecurityManager s = System.getSecurityManager();
-                        if (s != null)
-                            threadAssertTrue(g == s.getThreadGroup());
-                        else
-                            threadAssertTrue(g == egroup);
-                        String name = current.getName();
-                        threadAssertTrue(name.endsWith("thread-1"));
-                    } catch (SecurityException ok) {
-                        // Also pass if not allowed to change setting
-                    }
-                }
-            };
-        ExecutorService e = Executors.newSingleThreadExecutor(Executors.defaultThreadFactory());
-
-        e.execute(r);
-        try {
-            e.shutdown();
-        } catch (SecurityException ok) {
-        }
-
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * ThreadPoolExecutor using privilegedThreadFactory has
-     * specified group, priority, daemon status, name,
-     * access control context and context class loader
-     */
-    public void testPrivilegedThreadFactory() throws Exception {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                final ThreadGroup egroup = Thread.currentThread().getThreadGroup();
-                final ClassLoader thisccl = Thread.currentThread().getContextClassLoader();
-                final AccessControlContext thisacc = AccessController.getContext();
-                Runnable r = new CheckedRunnable() {
-                    public void realRun() {
-                        Thread current = Thread.currentThread();
-                        assertTrue(!current.isDaemon());
-                        assertTrue(current.getPriority() <= Thread.NORM_PRIORITY);
-                        ThreadGroup g = current.getThreadGroup();
-                        SecurityManager s = System.getSecurityManager();
-                        if (s != null)
-                            assertTrue(g == s.getThreadGroup());
-                        else
-                            assertTrue(g == egroup);
-                        String name = current.getName();
-                        assertTrue(name.endsWith("thread-1"));
-                        assertTrue(thisccl == current.getContextClassLoader());
-                        assertTrue(thisacc.equals(AccessController.getContext()));
-                    }};
-                ExecutorService e = Executors.newSingleThreadExecutor(Executors.privilegedThreadFactory());
-                e.execute(r);
-                e.shutdown();
-                Thread.sleep(SHORT_DELAY_MS);
-                joinPool(e);
-            }};
-
-        runWithPermissions(r,
-                           new RuntimePermission("getClassLoader"),
-                           new RuntimePermission("setContextClassLoader"),
-                           new RuntimePermission("modifyThread"));
-    }
-
-    boolean haveCCLPermissions() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            try {
-                sm.checkPermission(new RuntimePermission("setContextClassLoader"));
-                sm.checkPermission(new RuntimePermission("getClassLoader"));
-            } catch (AccessControlException e) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    void checkCCL() {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new RuntimePermission("setContextClassLoader"));
-            sm.checkPermission(new RuntimePermission("getClassLoader"));
-        }
-    }
-
-    class CheckCCL implements Callable<Object> {
-        public Object call() {
-            checkCCL();
-            return null;
-        }
-    }
-
-
-    /**
-     * Without class loader permissions, creating
-     * privilegedCallableUsingCurrentClassLoader throws ACE
-     */
-    public void testCreatePrivilegedCallableUsingCCLWithNoPrivs() {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                if (System.getSecurityManager() == null)
-                    return;
-                try {
-                    Executors.privilegedCallableUsingCurrentClassLoader(new NoOpCallable());
-                    shouldThrow();
-                } catch (AccessControlException success) {}
-            }};
-
-        runWithoutPermissions(r);
-    }
-
-    /**
-     * With class loader permissions, calling
-     * privilegedCallableUsingCurrentClassLoader does not throw ACE
-     */
-    public void testprivilegedCallableUsingCCLWithPrivs() throws Exception {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                Executors.privilegedCallableUsingCurrentClassLoader
-                    (new NoOpCallable())
-                    .call();
-            }};
-
-        runWithPermissions(r,
-                           new RuntimePermission("getClassLoader"),
-                           new RuntimePermission("setContextClassLoader"));
-    }
-
-    /**
-     * Without permissions, calling privilegedCallable throws ACE
-     */
-    public void testprivilegedCallableWithNoPrivs() throws Exception {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                if (System.getSecurityManager() == null)
-                    return;
-                Callable task = Executors.privilegedCallable(new CheckCCL());
-                try {
-                    task.call();
-                    shouldThrow();
-                } catch (AccessControlException success) {}
-            }};
-
-        runWithoutPermissions(r);
-
-        // It seems rather difficult to test that the
-        // AccessControlContext of the privilegedCallable is used
-        // instead of its caller.  Below is a failed attempt to do
-        // that, which does not work because the AccessController
-        // cannot capture the internal state of the current Policy.
-        // It would be much more work to differentiate based on,
-        // e.g. CodeSource.
-
-//         final AccessControlContext[] noprivAcc = new AccessControlContext[1];
-//         final Callable[] task = new Callable[1];
-
-//         runWithPermissions
-//             (new CheckedRunnable() {
-//                 public void realRun() {
-//                     if (System.getSecurityManager() == null)
-//                         return;
-//                     noprivAcc[0] = AccessController.getContext();
-//                     task[0] = Executors.privilegedCallable(new CheckCCL());
-//                     try {
-//                         AccessController.doPrivileged(new PrivilegedAction<Void>() {
-//                                                           public Void run() {
-//                                                               checkCCL();
-//                                                               return null;
-//                                                           }}, noprivAcc[0]);
-//                         shouldThrow();
-//                     } catch (AccessControlException success) {}
-//                 }});
-
-//         runWithPermissions
-//             (new CheckedRunnable() {
-//                 public void realRun() throws Exception {
-//                     if (System.getSecurityManager() == null)
-//                         return;
-//                     // Verify that we have an underprivileged ACC
-//                     try {
-//                         AccessController.doPrivileged(new PrivilegedAction<Void>() {
-//                                                           public Void run() {
-//                                                               checkCCL();
-//                                                               return null;
-//                                                           }}, noprivAcc[0]);
-//                         shouldThrow();
-//                     } catch (AccessControlException success) {}
-
-//                     try {
-//                         task[0].call();
-//                         shouldThrow();
-//                     } catch (AccessControlException success) {}
-//                 }},
-//              new RuntimePermission("getClassLoader"),
-//              new RuntimePermission("setContextClassLoader"));
-    }
-
-    /**
-     * With permissions, calling privilegedCallable succeeds
-     */
-    public void testprivilegedCallableWithPrivs() throws Exception {
-        Runnable r = new CheckedRunnable() {
-            public void realRun() throws Exception {
-                Executors.privilegedCallable(new CheckCCL()).call();
-            }};
-
-         runWithPermissions(r,
-                           new RuntimePermission("getClassLoader"),
-                           new RuntimePermission("setContextClassLoader"));
-    }
-
-    /**
-     * callable(Runnable) returns null when called
-     */
-    public void testCallable1() throws Exception {
-        Callable c = Executors.callable(new NoOpRunnable());
-        assertNull(c.call());
-    }
-
-    /**
-     * callable(Runnable, result) returns result when called
-     */
-    public void testCallable2() throws Exception {
-        Callable c = Executors.callable(new NoOpRunnable(), one);
-        assertSame(one, c.call());
-    }
-
-    /**
-     * callable(PrivilegedAction) returns its result when called
-     */
-    public void testCallable3() throws Exception {
-        Callable c = Executors.callable(new PrivilegedAction() {
-                public Object run() { return one; }});
-        assertSame(one, c.call());
-    }
-
-    /**
-     * callable(PrivilegedExceptionAction) returns its result when called
-     */
-    public void testCallable4() throws Exception {
-        Callable c = Executors.callable(new PrivilegedExceptionAction() {
-                public Object run() { return one; }});
-        assertSame(one, c.call());
-    }
-
-
-    /**
-     * callable(null Runnable) throws NPE
-     */
-    public void testCallableNPE1() {
-        try {
-            Callable c = Executors.callable((Runnable) null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * callable(null, result) throws NPE
-     */
-    public void testCallableNPE2() {
-        try {
-            Callable c = Executors.callable((Runnable) null, one);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * callable(null PrivilegedAction) throws NPE
-     */
-    public void testCallableNPE3() {
-        try {
-            Callable c = Executors.callable((PrivilegedAction) null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * callable(null PrivilegedExceptionAction) throws NPE
-     */
-    public void testCallableNPE4() {
-        try {
-            Callable c = Executors.callable((PrivilegedExceptionAction) null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/FutureTaskTest.java b/luni/src/test/java/tests/api/java/util/concurrent/FutureTaskTest.java
deleted file mode 100755
index b1f9f40..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/FutureTaskTest.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.*;
-
-public class FutureTaskTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(FutureTaskTest.class);
-    }
-
-    /**
-     * Subclass to expose protected methods
-     */
-    static class PublicFutureTask extends FutureTask {
-        public PublicFutureTask(Callable r) { super(r); }
-        public boolean runAndReset() { return super.runAndReset(); }
-        public void set(Object x) { super.set(x); }
-        public void setException(Throwable t) { super.setException(t); }
-    }
-
-    /**
-     * Creating a future with a null callable throws NPE
-     */
-    public void testConstructor() {
-        try {
-            FutureTask task = new FutureTask(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * creating a future with null runnable fails
-     */
-    public void testConstructor2() {
-        try {
-            FutureTask task = new FutureTask(null, Boolean.TRUE);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * isDone is true when a task completes
-     */
-    public void testIsDone() {
-        FutureTask task = new FutureTask(new NoOpCallable());
-        task.run();
-        assertTrue(task.isDone());
-        assertFalse(task.isCancelled());
-    }
-
-    /**
-     * runAndReset of a non-cancelled task succeeds
-     */
-    public void testRunAndReset() {
-        PublicFutureTask task = new PublicFutureTask(new NoOpCallable());
-        assertTrue(task.runAndReset());
-        assertFalse(task.isDone());
-    }
-
-    /**
-     * runAndReset after cancellation fails
-     */
-    public void testResetAfterCancel() {
-        PublicFutureTask task = new PublicFutureTask(new NoOpCallable());
-        assertTrue(task.cancel(false));
-        assertFalse(task.runAndReset());
-        assertTrue(task.isDone());
-        assertTrue(task.isCancelled());
-    }
-
-
-
-    /**
-     * setting value causes get to return it
-     */
-    public void testSet() throws Exception {
-        PublicFutureTask task = new PublicFutureTask(new NoOpCallable());
-        task.set(one);
-        assertSame(task.get(), one);
-    }
-
-    /**
-     * setException causes get to throw ExecutionException
-     */
-    public void testSetException() throws Exception {
-        Exception nse = new NoSuchElementException();
-        PublicFutureTask task = new PublicFutureTask(new NoOpCallable());
-        task.setException(nse);
-        try {
-            Object x = task.get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertSame(success.getCause(), nse);
-        }
-    }
-
-    /**
-     *  Cancelling before running succeeds
-     */
-    public void testCancelBeforeRun() {
-        FutureTask task = new FutureTask(new NoOpCallable());
-        assertTrue(task.cancel(false));
-        task.run();
-        assertTrue(task.isDone());
-        assertTrue(task.isCancelled());
-    }
-
-    /**
-     * Cancel(true) before run succeeds
-     */
-    public void testCancelBeforeRun2() {
-        FutureTask task = new FutureTask(new NoOpCallable());
-        assertTrue(task.cancel(true));
-        task.run();
-        assertTrue(task.isDone());
-        assertTrue(task.isCancelled());
-    }
-
-    /**
-     * cancel of a completed task fails
-     */
-    public void testCancelAfterRun() {
-        FutureTask task = new FutureTask(new NoOpCallable());
-        task.run();
-        assertFalse(task.cancel(false));
-        assertTrue(task.isDone());
-        assertFalse(task.isCancelled());
-    }
-
-    /**
-     * cancel(true) interrupts a running task
-     */
-    public void testCancelInterrupt() throws InterruptedException {
-        final FutureTask task =
-            new FutureTask(new CheckedInterruptedCallable<Object>() {
-                public Object realCall() throws InterruptedException {
-                    Thread.sleep(SMALL_DELAY_MS);
-                    return Boolean.TRUE;
-                }});
-
-        Thread t = new Thread(task);
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(task.cancel(true));
-        t.join();
-        assertTrue(task.isDone());
-        assertTrue(task.isCancelled());
-    }
-
-
-    /**
-     * cancel(false) does not interrupt a running task
-     */
-    public void testCancelNoInterrupt() throws InterruptedException {
-        final FutureTask task =
-            new FutureTask(new CheckedCallable<Object>() {
-                public Object realCall() throws InterruptedException {
-                    Thread.sleep(MEDIUM_DELAY_MS);
-                    return Boolean.TRUE;
-                }});
-
-        Thread t = new Thread(task);
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(task.cancel(false));
-        t.join();
-        assertTrue(task.isDone());
-        assertTrue(task.isCancelled());
-    }
-
-    /**
-     * set in one thread causes get in another thread to retrieve value
-     */
-    public void testGet1() throws InterruptedException {
-        final FutureTask ft =
-            new FutureTask(new CheckedCallable<Object>() {
-                public Object realCall() throws InterruptedException {
-                    return Boolean.TRUE;
-                }});
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws Exception {
-                assertSame(Boolean.TRUE, ft.get());
-            }});
-
-        assertFalse(ft.isDone());
-        assertFalse(ft.isCancelled());
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        ft.run();
-        t.join();
-        assertTrue(ft.isDone());
-        assertFalse(ft.isCancelled());
-    }
-
-    /**
-     * set in one thread causes timed get in another thread to retrieve value
-     */
-    public void testTimedGet1() throws InterruptedException {
-        final FutureTask ft =
-            new FutureTask(new CheckedCallable<Object>() {
-                public Object realCall() throws InterruptedException {
-                    return Boolean.TRUE;
-                }});
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws Exception {
-                assertSame(Boolean.TRUE, ft.get(SMALL_DELAY_MS, MILLISECONDS));
-            }});
-
-        assertFalse(ft.isDone());
-        assertFalse(ft.isCancelled());
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        ft.run();
-        t.join();
-        assertTrue(ft.isDone());
-        assertFalse(ft.isCancelled());
-    }
-
-    /**
-     *  Cancelling a task causes timed get in another thread to throw CancellationException
-     */
-    public void testTimedGet_Cancellation() throws InterruptedException {
-        final FutureTask ft =
-            new FutureTask(new CheckedInterruptedCallable<Object>() {
-                public Object realCall() throws InterruptedException {
-                    Thread.sleep(SMALL_DELAY_MS);
-                    return Boolean.TRUE;
-                }});
-
-        Thread t1 = new ThreadShouldThrow(CancellationException.class) {
-            public void realRun() throws Exception {
-                ft.get(MEDIUM_DELAY_MS, MILLISECONDS);
-            }};
-        Thread t2 = new Thread(ft);
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        ft.cancel(true);
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * Cancelling a task causes get in another thread to throw CancellationException
-     */
-    public void testGet_Cancellation() throws InterruptedException {
-        final FutureTask ft =
-            new FutureTask(new CheckedInterruptedCallable<Object>() {
-                public Object realCall() throws InterruptedException {
-                    Thread.sleep(SMALL_DELAY_MS);
-                    return Boolean.TRUE;
-                }});
-        Thread t1 = new ThreadShouldThrow(CancellationException.class) {
-            public void realRun() throws Exception {
-                ft.get();
-            }};
-
-        Thread t2 = new Thread(ft);
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        ft.cancel(true);
-        t1.join();
-        t2.join();
-    }
-
-
-    /**
-     * A runtime exception in task causes get to throw ExecutionException
-     */
-    public void testGet_ExecutionException() throws InterruptedException {
-        final FutureTask ft = new FutureTask(new Callable() {
-            public Object call() {
-                return 5/0;
-            }});
-
-        ft.run();
-        try {
-            ft.get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof ArithmeticException);
-        }
-    }
-
-    /**
-     *  A runtime exception in task causes timed get to throw ExecutionException
-     */
-    public void testTimedGet_ExecutionException2() throws Exception {
-        final FutureTask ft = new FutureTask(new Callable() {
-            public Object call() {
-                return 5/0;
-            }});
-
-        ft.run();
-        try {
-            ft.get(SHORT_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof ArithmeticException);
-        }
-    }
-
-
-    /**
-     * Interrupting a waiting get causes it to throw InterruptedException
-     */
-    public void testGet_InterruptedException() throws InterruptedException {
-        final FutureTask ft = new FutureTask(new NoOpCallable());
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws Exception {
-                ft.get();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  Interrupting a waiting timed get causes it to throw InterruptedException
-     */
-    public void testTimedGet_InterruptedException2() throws InterruptedException {
-        final FutureTask ft = new FutureTask(new NoOpCallable());
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws Exception {
-                ft.get(LONG_DELAY_MS,MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * A timed out timed get throws TimeoutException
-     */
-    public void testGet_TimeoutException() throws Exception {
-        try {
-            FutureTask ft = new FutureTask(new NoOpCallable());
-            ft.get(1,MILLISECONDS);
-            shouldThrow();
-        } catch (TimeoutException success) {}
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/JSR166TestCase.java b/luni/src/test/java/tests/api/java/util/concurrent/JSR166TestCase.java
deleted file mode 100644
index b764855..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/JSR166TestCase.java
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-import java.security.*;
-
-/**
- * Base class for JSR166 Junit TCK tests.  Defines some constants,
- * utility methods and classes, as well as a simple framework for
- * helping to make sure that assertions failing in generated threads
- * cause the associated test that generated them to itself fail (which
- * JUnit does not otherwise arrange).  The rules for creating such
- * tests are:
- *
- * <ol>
- *
- * <li> All assertions in code running in generated threads must use
- * the forms {@link #threadFail}, {@link #threadAssertTrue}, {@link
- * #threadAssertEquals}, or {@link #threadAssertNull}, (not
- * <tt>fail</tt>, <tt>assertTrue</tt>, etc.) It is OK (but not
- * particularly recommended) for other code to use these forms too.
- * Only the most typically used JUnit assertion methods are defined
- * this way, but enough to live with.</li>
- *
- * <li> If you override {@link #setUp} or {@link #tearDown}, make sure
- * to invoke <tt>super.setUp</tt> and <tt>super.tearDown</tt> within
- * them. These methods are used to clear and check for thread
- * assertion failures.</li>
- *
- * <li>All delays and timeouts must use one of the constants <tt>
- * SHORT_DELAY_MS</tt>, <tt> SMALL_DELAY_MS</tt>, <tt> MEDIUM_DELAY_MS</tt>,
- * <tt> LONG_DELAY_MS</tt>. The idea here is that a SHORT is always
- * discriminable from zero time, and always allows enough time for the
- * small amounts of computation (creating a thread, calling a few
- * methods, etc) needed to reach a timeout point. Similarly, a SMALL
- * is always discriminable as larger than SHORT and smaller than
- * MEDIUM.  And so on. These constants are set to conservative values,
- * but even so, if there is ever any doubt, they can all be increased
- * in one spot to rerun tests on slower platforms.</li>
- *
- * <li> All threads generated must be joined inside each test case
- * method (or <tt>fail</tt> to do so) before returning from the
- * method. The <tt> joinPool</tt> method can be used to do this when
- * using Executors.</li>
- *
- * </ol>
- *
- * <p> <b>Other notes</b>
- * <ul>
- *
- * <li> Usually, there is one testcase method per JSR166 method
- * covering "normal" operation, and then as many exception-testing
- * methods as there are exceptions the method can throw. Sometimes
- * there are multiple tests per JSR166 method when the different
- * "normal" behaviors differ significantly. And sometimes testcases
- * cover multiple methods when they cannot be tested in
- * isolation.</li>
- *
- * <li> The documentation style for testcases is to provide as javadoc
- * a simple sentence or two describing the property that the testcase
- * method purports to test. The javadocs do not say anything about how
- * the property is tested. To find out, read the code.</li>
- *
- * <li> These tests are "conformance tests", and do not attempt to
- * test throughput, latency, scalability or other performance factors
- * (see the separate "jtreg" tests for a set intended to check these
- * for the most central aspects of functionality.) So, most tests use
- * the smallest sensible numbers of threads, collection sizes, etc
- * needed to check basic conformance.</li>
- *
- * <li>The test classes currently do not declare inclusion in
- * any particular package to simplify things for people integrating
- * them in TCK test suites.</li>
- *
- * <li> As a convenience, the <tt>main</tt> of this class (JSR166TestCase)
- * runs all JSR166 unit tests.</li>
- *
- * </ul>
- */
-public class JSR166TestCase extends TestCase {
-    private static final boolean useSecurityManager =
-        Boolean.getBoolean("jsr166.useSecurityManager");
-
-    // BEGIN android-removed
-    // /**
-    //  * Runs all JSR166 unit tests using junit.textui.TestRunner
-    //  */
-    // public static void main(String[] args) {
-    //     if (useSecurityManager) {
-    //         System.err.println("Setting a permissive security manager");
-    //         Policy.setPolicy(permissivePolicy());
-    //         System.setSecurityManager(new SecurityManager());
-    //     }
-    //     int iters = 1;
-    //     if (args.length > 0)
-    //         iters = Integer.parseInt(args[0]);
-    //     Test s = suite();
-    //     for (int i = 0; i < iters; ++i) {
-    //         junit.textui.TestRunner.run(s);
-    //         System.gc();
-    //         System.runFinalization();
-    //     }
-    //     System.exit(0);
-    // }
-    // END android-removed
-
-    /**
-     * Collects all JSR166 unit tests as one suite
-     */
-    public static Test suite() {
-        TestSuite suite = new TestSuite("JSR166 Unit Tests");
-
-        suite.addTest(new TestSuite(AbstractExecutorServiceTest.class));
-        suite.addTest(new TestSuite(AbstractQueueTest.class));
-        suite.addTest(new TestSuite(AbstractQueuedSynchronizerTest.class));
-        suite.addTest(new TestSuite(AbstractQueuedLongSynchronizerTest.class));
-        suite.addTest(new TestSuite(ArrayBlockingQueueTest.class));
-        suite.addTest(new TestSuite(ArrayDequeTest.class));
-        suite.addTest(new TestSuite(AtomicBooleanTest.class));
-        suite.addTest(new TestSuite(AtomicIntegerArrayTest.class));
-        suite.addTest(new TestSuite(AtomicIntegerFieldUpdaterTest.class));
-        suite.addTest(new TestSuite(AtomicIntegerTest.class));
-        suite.addTest(new TestSuite(AtomicLongArrayTest.class));
-        suite.addTest(new TestSuite(AtomicLongFieldUpdaterTest.class));
-        suite.addTest(new TestSuite(AtomicLongTest.class));
-        suite.addTest(new TestSuite(AtomicMarkableReferenceTest.class));
-        suite.addTest(new TestSuite(AtomicReferenceArrayTest.class));
-        suite.addTest(new TestSuite(AtomicReferenceFieldUpdaterTest.class));
-        suite.addTest(new TestSuite(AtomicReferenceTest.class));
-        suite.addTest(new TestSuite(AtomicStampedReferenceTest.class));
-        suite.addTest(new TestSuite(ConcurrentHashMapTest.class));
-        suite.addTest(new TestSuite(ConcurrentLinkedQueueTest.class));
-        suite.addTest(new TestSuite(ConcurrentSkipListMapTest.class));
-        suite.addTest(new TestSuite(ConcurrentSkipListSubMapTest.class));
-        suite.addTest(new TestSuite(ConcurrentSkipListSetTest.class));
-        suite.addTest(new TestSuite(ConcurrentSkipListSubSetTest.class));
-        suite.addTest(new TestSuite(CopyOnWriteArrayListTest.class));
-        suite.addTest(new TestSuite(CopyOnWriteArraySetTest.class));
-        suite.addTest(new TestSuite(CountDownLatchTest.class));
-        suite.addTest(new TestSuite(CyclicBarrierTest.class));
-        suite.addTest(new TestSuite(DelayQueueTest.class));
-        suite.addTest(new TestSuite(EntryTest.class));
-        suite.addTest(new TestSuite(ExchangerTest.class));
-        suite.addTest(new TestSuite(ExecutorsTest.class));
-        suite.addTest(new TestSuite(ExecutorCompletionServiceTest.class));
-        suite.addTest(new TestSuite(FutureTaskTest.class));
-        suite.addTest(new TestSuite(LinkedBlockingDequeTest.class));
-        suite.addTest(new TestSuite(LinkedBlockingQueueTest.class));
-        suite.addTest(new TestSuite(LinkedListTest.class));
-        suite.addTest(new TestSuite(LockSupportTest.class));
-        suite.addTest(new TestSuite(PriorityBlockingQueueTest.class));
-        suite.addTest(new TestSuite(PriorityQueueTest.class));
-        suite.addTest(new TestSuite(ReentrantLockTest.class));
-        suite.addTest(new TestSuite(ReentrantReadWriteLockTest.class));
-        suite.addTest(new TestSuite(ScheduledExecutorTest.class));
-        suite.addTest(new TestSuite(ScheduledExecutorSubclassTest.class));
-        suite.addTest(new TestSuite(SemaphoreTest.class));
-        suite.addTest(new TestSuite(SynchronousQueueTest.class));
-        suite.addTest(new TestSuite(SystemTest.class));
-        suite.addTest(new TestSuite(ThreadLocalTest.class));
-        suite.addTest(new TestSuite(ThreadPoolExecutorTest.class));
-        suite.addTest(new TestSuite(ThreadPoolExecutorSubclassTest.class));
-        suite.addTest(new TestSuite(ThreadTest.class));
-        suite.addTest(new TestSuite(TimeUnitTest.class));
-
-        return suite;
-    }
-
-
-    public static long SHORT_DELAY_MS;
-    public static long SMALL_DELAY_MS;
-    public static long MEDIUM_DELAY_MS;
-    public static long LONG_DELAY_MS;
-
-
-    /**
-     * Returns the shortest timed delay. This could
-     * be reimplemented to use for example a Property.
-     */
-    protected long getShortDelay() {
-        // BEGIN android-changed
-        // original value is 50
-        return 250;
-        // END android-changed
-    }
-
-
-    /**
-     * Sets delays as multiples of SHORT_DELAY.
-     */
-    protected void setDelays() {
-        SHORT_DELAY_MS = getShortDelay();
-        SMALL_DELAY_MS = SHORT_DELAY_MS * 5;
-        MEDIUM_DELAY_MS = SHORT_DELAY_MS * 10;
-        LONG_DELAY_MS = SHORT_DELAY_MS * 50;
-    }
-
-    /**
-     * Flag set true if any threadAssert methods fail
-     */
-    volatile boolean threadFailed;
-
-    /**
-     * Initializes test to indicate that no thread assertions have failed
-     */
-    public void setUp() {
-        setDelays();
-        threadFailed = false;
-    }
-
-    /**
-     * Triggers test case failure if any thread assertions have failed
-     */
-    public void tearDown() {
-        assertFalse(threadFailed);
-    }
-
-    /**
-     * Fail, also setting status to indicate current testcase should fail
-     */
-    public void threadFail(String reason) {
-        threadFailed = true;
-        fail(reason);
-    }
-
-    /**
-     * If expression not true, set status to indicate current testcase
-     * should fail
-     */
-    public void threadAssertTrue(boolean b) {
-        if (!b) {
-            threadFailed = true;
-            assertTrue(b);
-        }
-    }
-
-    /**
-     * If expression not false, set status to indicate current testcase
-     * should fail
-     */
-    public void threadAssertFalse(boolean b) {
-        if (b) {
-            threadFailed = true;
-            assertFalse(b);
-        }
-    }
-
-    /**
-     * If argument not null, set status to indicate current testcase
-     * should fail
-     */
-    public void threadAssertNull(Object x) {
-        if (x != null) {
-            threadFailed = true;
-            assertNull(x);
-        }
-    }
-
-    /**
-     * If arguments not equal, set status to indicate current testcase
-     * should fail
-     */
-    public void threadAssertEquals(long x, long y) {
-        if (x != y) {
-            threadFailed = true;
-            assertEquals(x, y);
-        }
-    }
-
-    /**
-     * If arguments not equal, set status to indicate current testcase
-     * should fail
-     */
-    public void threadAssertEquals(Object x, Object y) {
-        if (x != y && (x == null || !x.equals(y))) {
-            threadFailed = true;
-            assertEquals(x, y);
-        }
-    }
-
-    /**
-     * threadFail with message "should throw exception"
-     */
-    public void threadShouldThrow() {
-        threadFailed = true;
-        fail("should throw exception");
-    }
-
-    /**
-     * threadFail with message "should throw" + exceptionName
-     */
-    public void threadShouldThrow(String exceptionName) {
-        threadFailed = true;
-        fail("should throw " + exceptionName);
-    }
-
-    /**
-     * threadFail with message "Unexpected exception"
-     */
-    public void threadUnexpectedException() {
-        threadFailed = true;
-        fail("Unexpected exception");
-    }
-
-    /**
-     * threadFail with message "Unexpected exception", with argument
-     */
-    public void threadUnexpectedException(Throwable ex) {
-        threadFailed = true;
-        ex.printStackTrace();
-        fail("Unexpected exception: " + ex);
-    }
-
-    /**
-     * Wait out termination of a thread pool or fail doing so
-     */
-    public void joinPool(ExecutorService exec) {
-        try {
-            exec.shutdown();
-            assertTrue(exec.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        } catch (SecurityException ok) {
-            // Allowed in case test doesn't have privs
-        } catch (InterruptedException ie) {
-            fail("Unexpected InterruptedException");
-        }
-    }
-
-
-    /**
-     * fail with message "should throw exception"
-     */
-    public void shouldThrow() {
-        fail("Should throw exception");
-    }
-
-    /**
-     * fail with message "should throw " + exceptionName
-     */
-    public void shouldThrow(String exceptionName) {
-        fail("Should throw " + exceptionName);
-    }
-
-    /**
-     * fail with message "Unexpected exception"
-     */
-    public void unexpectedException() {
-        fail("Unexpected exception");
-    }
-
-    /**
-     * fail with message "Unexpected exception", with argument
-     */
-    public void unexpectedException(Throwable ex) {
-        ex.printStackTrace();
-        fail("Unexpected exception: " + ex);
-    }
-
-
-    /**
-     * The number of elements to place in collections, arrays, etc.
-     */
-    public static final int SIZE = 20;
-
-    // Some convenient Integer constants
-
-    public static final Integer zero  = new Integer(0);
-    public static final Integer one   = new Integer(1);
-    public static final Integer two   = new Integer(2);
-    public static final Integer three = new Integer(3);
-    public static final Integer four  = new Integer(4);
-    public static final Integer five  = new Integer(5);
-    public static final Integer six   = new Integer(6);
-    public static final Integer seven = new Integer(7);
-    public static final Integer eight = new Integer(8);
-    public static final Integer nine  = new Integer(9);
-    public static final Integer m1  = new Integer(-1);
-    public static final Integer m2  = new Integer(-2);
-    public static final Integer m3  = new Integer(-3);
-    public static final Integer m4  = new Integer(-4);
-    public static final Integer m5  = new Integer(-5);
-    public static final Integer m6  = new Integer(-6);
-    public static final Integer m10 = new Integer(-10);
-
-
-    /**
-     * Runs Runnable r with a security policy that permits precisely
-     * the specified permissions.  If there is no current security
-     * manager, the runnable is run twice, both with and without a
-     * security manager.  We require that any security manager permit
-     * getPolicy/setPolicy.
-     */
-    public void runWithPermissions(Runnable r, Permission... permissions) {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm == null) {
-            r.run();
-            Policy savedPolicy = Policy.getPolicy();
-            try {
-                Policy.setPolicy(permissivePolicy());
-                System.setSecurityManager(new SecurityManager());
-                runWithPermissions(r, permissions);
-            } finally {
-                System.setSecurityManager(null);
-                Policy.setPolicy(savedPolicy);
-            }
-        } else {
-            Policy savedPolicy = Policy.getPolicy();
-            AdjustablePolicy policy = new AdjustablePolicy(permissions);
-            Policy.setPolicy(policy);
-
-            try {
-                r.run();
-            } finally {
-                policy.addPermission(new SecurityPermission("setPolicy"));
-                Policy.setPolicy(savedPolicy);
-            }
-        }
-    }
-
-    /**
-     * Runs a runnable without any permissions.
-     */
-    public void runWithoutPermissions(Runnable r) {
-        runWithPermissions(r);
-    }
-
-    /**
-     * A security policy where new permissions can be dynamically added
-     * or all cleared.
-     */
-    public static class AdjustablePolicy extends java.security.Policy {
-        Permissions perms = new Permissions();
-        AdjustablePolicy(Permission... permissions) {
-            for (Permission permission : permissions)
-                perms.add(permission);
-        }
-        void addPermission(Permission perm) { perms.add(perm); }
-        void clearPermissions() { perms = new Permissions(); }
-        public PermissionCollection getPermissions(CodeSource cs) {
-            return perms;
-        }
-        public PermissionCollection getPermissions(ProtectionDomain pd) {
-            return perms;
-        }
-        public boolean implies(ProtectionDomain pd, Permission p) {
-            return perms.implies(p);
-        }
-        public void refresh() {}
-    }
-
-    /**
-     * Returns a policy containing all the permissions we ever need.
-     */
-    public static Policy permissivePolicy() {
-        return new AdjustablePolicy
-            // Permissions j.u.c. needs directly
-            (new RuntimePermission("modifyThread"),
-             new RuntimePermission("getClassLoader"),
-             new RuntimePermission("setContextClassLoader"),
-             // Permissions needed to change permissions!
-             new SecurityPermission("getPolicy"),
-             new SecurityPermission("setPolicy"),
-             new RuntimePermission("setSecurityManager"),
-             // Permissions needed by the junit test harness
-             new RuntimePermission("accessDeclaredMembers"),
-             new PropertyPermission("*", "read"),
-             new java.io.FilePermission("<<ALL FILES>>", "read"));
-    }
-
-    /**
-     * Sleep until the timeout has elapsed, or interrupted.
-     * Does <em>NOT</em> throw InterruptedException.
-     */
-    void sleepTillInterrupted(long timeoutMillis) {
-        try {
-            Thread.sleep(timeoutMillis);
-        } catch (InterruptedException wakeup) {}
-    }
-
-    /**
-     * Returns a new started Thread running the given runnable.
-     */
-    Thread newStartedThread(Runnable runnable) {
-        Thread t = new Thread(runnable);
-        t.start();
-        return t;
-    }
-
-    // Some convenient Runnable classes
-
-    public abstract class CheckedRunnable implements Runnable {
-        protected abstract void realRun() throws Throwable;
-
-        public final void run() {
-            try {
-                realRun();
-            } catch (Throwable t) {
-                threadUnexpectedException(t);
-            }
-        }
-    }
-
-    public abstract class RunnableShouldThrow implements Runnable {
-        protected abstract void realRun() throws Throwable;
-
-        final Class<?> exceptionClass;
-
-        <T extends Throwable> RunnableShouldThrow(Class<T> exceptionClass) {
-            this.exceptionClass = exceptionClass;
-        }
-
-        public final void run() {
-            try {
-                realRun();
-                threadShouldThrow(exceptionClass.getSimpleName());
-            } catch (Throwable t) {
-                if (! exceptionClass.isInstance(t))
-                    threadUnexpectedException(t);
-            }
-        }
-    }
-
-    public abstract class ThreadShouldThrow extends Thread {
-        protected abstract void realRun() throws Throwable;
-
-        final Class<?> exceptionClass;
-
-        <T extends Throwable> ThreadShouldThrow(Class<T> exceptionClass) {
-            this.exceptionClass = exceptionClass;
-        }
-
-        public final void run() {
-            try {
-                realRun();
-                threadShouldThrow(exceptionClass.getSimpleName());
-            } catch (Throwable t) {
-                if (! exceptionClass.isInstance(t))
-                    threadUnexpectedException(t);
-            }
-        }
-    }
-
-    public abstract class CheckedInterruptedRunnable implements Runnable {
-        protected abstract void realRun() throws Throwable;
-
-        public final void run() {
-            try {
-                realRun();
-                threadShouldThrow("InterruptedException");
-            } catch (InterruptedException success) {
-            } catch (Throwable t) {
-                threadUnexpectedException(t);
-            }
-        }
-    }
-
-    public abstract class CheckedCallable<T> implements Callable<T> {
-        protected abstract T realCall() throws Throwable;
-
-        public final T call() {
-            try {
-                return realCall();
-            } catch (Throwable t) {
-                threadUnexpectedException(t);
-            }
-            return null;
-        }
-    }
-
-    public abstract class CheckedInterruptedCallable<T> implements Callable<T> {
-        protected abstract T realCall() throws Throwable;
-
-        public final T call() {
-            try {
-                T result = realCall();
-                threadShouldThrow("InterruptedException");
-                return result;
-            } catch (InterruptedException success) {
-            } catch (Throwable t) {
-                threadUnexpectedException(t);
-            }
-            return null;
-        }
-    }
-
-    public static class NoOpRunnable implements Runnable {
-        public void run() {}
-    }
-
-    public static class NoOpCallable implements Callable {
-        public Object call() { return Boolean.TRUE; }
-    }
-
-    public static final String TEST_STRING = "a test string";
-
-    public static class StringTask implements Callable<String> {
-        public String call() { return TEST_STRING; }
-    }
-
-    public Callable<String> latchAwaitingStringTask(final CountDownLatch latch) {
-        return new CheckedCallable<String>() {
-            public String realCall() {
-                try {
-                    latch.await();
-                } catch (InterruptedException quittingTime) {}
-                return TEST_STRING;
-            }};
-    }
-
-    public static class NPETask implements Callable<String> {
-        public String call() { throw new NullPointerException(); }
-    }
-
-    public static class CallableOne implements Callable<Integer> {
-        public Integer call() { return one; }
-    }
-
-    public class ShortRunnable extends CheckedRunnable {
-        protected void realRun() throws Throwable {
-            Thread.sleep(SHORT_DELAY_MS);
-        }
-    }
-
-    public class ShortInterruptedRunnable extends CheckedInterruptedRunnable {
-        protected void realRun() throws InterruptedException {
-            Thread.sleep(SHORT_DELAY_MS);
-        }
-    }
-
-    public class SmallRunnable extends CheckedRunnable {
-        protected void realRun() throws Throwable {
-            Thread.sleep(SMALL_DELAY_MS);
-        }
-    }
-
-    public class SmallPossiblyInterruptedRunnable extends CheckedRunnable {
-        protected void realRun() {
-            try {
-                Thread.sleep(SMALL_DELAY_MS);
-            } catch (InterruptedException ok) {}
-        }
-    }
-
-    public class SmallCallable extends CheckedCallable {
-        protected Object realCall() throws InterruptedException {
-            Thread.sleep(SMALL_DELAY_MS);
-            return Boolean.TRUE;
-        }
-    }
-
-    public class SmallInterruptedRunnable extends CheckedInterruptedRunnable {
-        protected void realRun() throws InterruptedException {
-            Thread.sleep(SMALL_DELAY_MS);
-        }
-    }
-
-    public class MediumRunnable extends CheckedRunnable {
-        protected void realRun() throws Throwable {
-            Thread.sleep(MEDIUM_DELAY_MS);
-        }
-    }
-
-    public class MediumInterruptedRunnable extends CheckedInterruptedRunnable {
-        protected void realRun() throws InterruptedException {
-            Thread.sleep(MEDIUM_DELAY_MS);
-        }
-    }
-
-    public class MediumPossiblyInterruptedRunnable extends CheckedRunnable {
-        protected void realRun() {
-            try {
-                Thread.sleep(MEDIUM_DELAY_MS);
-            } catch (InterruptedException ok) {}
-        }
-    }
-
-    public class LongPossiblyInterruptedRunnable extends CheckedRunnable {
-        protected void realRun() {
-            try {
-                Thread.sleep(LONG_DELAY_MS);
-            } catch (InterruptedException ok) {}
-        }
-    }
-
-    /**
-     * For use as ThreadFactory in constructors
-     */
-    public static class SimpleThreadFactory implements ThreadFactory {
-        public Thread newThread(Runnable r) {
-            return new Thread(r);
-        }
-    }
-
-    public static class TrackedShortRunnable implements Runnable {
-        public volatile boolean done = false;
-        public void run() {
-            try {
-                Thread.sleep(SMALL_DELAY_MS);
-                done = true;
-            } catch (InterruptedException ok) {}
-        }
-    }
-
-    public static class TrackedMediumRunnable implements Runnable {
-        public volatile boolean done = false;
-        public void run() {
-            try {
-                Thread.sleep(MEDIUM_DELAY_MS);
-                done = true;
-            } catch (InterruptedException ok) {}
-        }
-    }
-
-    public static class TrackedLongRunnable implements Runnable {
-        public volatile boolean done = false;
-        public void run() {
-            try {
-                Thread.sleep(LONG_DELAY_MS);
-                done = true;
-            } catch (InterruptedException ok) {}
-        }
-    }
-
-    public static class TrackedNoOpRunnable implements Runnable {
-        public volatile boolean done = false;
-        public void run() {
-            done = true;
-        }
-    }
-
-    public static class TrackedCallable implements Callable {
-        public volatile boolean done = false;
-        public Object call() {
-            try {
-                Thread.sleep(SMALL_DELAY_MS);
-                done = true;
-            } catch (InterruptedException ok) {}
-            return Boolean.TRUE;
-        }
-    }
-
-
-    /**
-     * For use as RejectedExecutionHandler in constructors
-     */
-    public static class NoOpREHandler implements RejectedExecutionHandler {
-        public void rejectedExecution(Runnable r,
-                                      ThreadPoolExecutor executor) {}
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/LinkedBlockingDequeTest.java b/luni/src/test/java/tests/api/java/util/concurrent/LinkedBlockingDequeTest.java
deleted file mode 100644
index a858bb9..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/LinkedBlockingDequeTest.java
+++ /dev/null
@@ -1,1671 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-
-public class LinkedBlockingDequeTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(LinkedBlockingDequeTest.class);
-    }
-
-    /**
-     * Create a deque of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private LinkedBlockingDeque populatedDeque(int n) {
-        LinkedBlockingDeque q = new LinkedBlockingDeque(n);
-        assertTrue(q.isEmpty());
-        for (int i = 0; i < n; i++)
-            assertTrue(q.offer(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(0, q.remainingCapacity());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        LinkedBlockingDeque q = new LinkedBlockingDeque();
-        assertTrue(q.isEmpty());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.add(new Integer(2));
-        q.removeFirst();
-        q.removeFirst();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testSize() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.removeFirst();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferFirstNull() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque();
-            q.offerFirst(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * OfferFirst succeeds
-     */
-    public void testOfferFirst() {
-        LinkedBlockingDeque q = new LinkedBlockingDeque();
-        assertTrue(q.offerFirst(new Integer(0)));
-        assertTrue(q.offerFirst(new Integer(1)));
-    }
-
-    /**
-     * OfferLast succeeds
-     */
-    public void testOfferLast() {
-        LinkedBlockingDeque q = new LinkedBlockingDeque();
-        assertTrue(q.offerLast(new Integer(0)));
-        assertTrue(q.offerLast(new Integer(1)));
-    }
-
-    /**
-     *  pollFirst succeeds unless empty
-     */
-    public void testPollFirst() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pollFirst());
-        }
-        assertNull(q.pollFirst());
-    }
-
-    /**
-     *  pollLast succeeds unless empty
-     */
-    public void testPollLast() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = SIZE-1; i >= 0; --i) {
-            assertEquals(i, q.pollLast());
-        }
-        assertNull(q.pollLast());
-    }
-
-    /**
-     *  peekFirst returns next element, or null if empty
-     */
-    public void testPeekFirst() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peekFirst());
-            assertEquals(i, q.pollFirst());
-            assertTrue(q.peekFirst() == null ||
-                       !q.peekFirst().equals(i));
-        }
-        assertNull(q.peekFirst());
-    }
-
-    /**
-     *  peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peek());
-            assertEquals(i, q.pollFirst());
-            assertTrue(q.peek() == null ||
-                       !q.peek().equals(i));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     *  peekLast returns next element, or null if empty
-     */
-    public void testPeekLast() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = SIZE-1; i >= 0; --i) {
-            assertEquals(i, q.peekLast());
-            assertEquals(i, q.pollLast());
-            assertTrue(q.peekLast() == null ||
-                       !q.peekLast().equals(i));
-        }
-        assertNull(q.peekLast());
-    }
-
-    /**
-     * getFirst returns next getFirst, or throws NSEE if empty
-     */
-    public void testFirstElement() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.getFirst());
-            assertEquals(i, q.pollFirst());
-        }
-        try {
-            q.getFirst();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-        assertNull(q.peekFirst());
-    }
-
-    /**
-     *  getLast returns next element, or throws NSEE if empty
-     */
-    public void testLastElement() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = SIZE-1; i >= 0; --i) {
-            assertEquals(i, q.getLast());
-            assertEquals(i, q.pollLast());
-        }
-        try {
-            q.getLast();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-        assertNull(q.peekLast());
-    }
-
-    /**
-     *  removeFirst removes next element, or throws NSEE if empty
-     */
-    public void testRemoveFirst() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.removeFirst());
-        }
-        try {
-            q.removeFirst();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-        assertNull(q.peekFirst());
-    }
-
-    /**
-     *  removeLast removes last element, or throws NSEE if empty
-     */
-    public void testRemoveLast() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = SIZE - 1; i >= 0; --i) {
-            assertEquals(i, q.removeLast());
-        }
-        try {
-            q.removeLast();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-        assertNull(q.peekLast());
-    }
-
-    /**
-     *  remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remove());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * removeFirstOccurrence(x) removes x and returns true if present
-     */
-    public void testRemoveFirstOccurrence() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.removeFirstOccurrence(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.removeFirstOccurrence(new Integer(i)));
-            assertFalse(q.removeFirstOccurrence(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * removeLastOccurrence(x) removes x and returns true if present
-     */
-    public void testRemoveLastOccurrence() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.removeLastOccurrence(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.removeLastOccurrence(new Integer(i)));
-            assertFalse(q.removeLastOccurrence(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * peekFirst returns element inserted with addFirst
-     */
-    public void testAddFirst() {
-        LinkedBlockingDeque q = populatedDeque(3);
-        q.pollLast();
-        q.addFirst(four);
-        assertSame(four, q.peekFirst());
-    }
-
-    /**
-     * peekLast returns element inserted with addLast
-     */
-    public void testAddLast() {
-        LinkedBlockingDeque q = populatedDeque(3);
-        q.pollLast();
-        q.addLast(four);
-        assertSame(four, q.peekLast());
-    }
-
-
-    /**
-     * A new deque has the indicated capacity, or Integer.MAX_VALUE if
-     * none given
-     */
-    public void testConstructor1() {
-        assertEquals(SIZE, new LinkedBlockingDeque(SIZE).remainingCapacity());
-        assertEquals(Integer.MAX_VALUE, new LinkedBlockingDeque().remainingCapacity());
-    }
-
-    /**
-     * Constructor throws IAE if capacity argument nonpositive
-     */
-    public void testConstructor2() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            LinkedBlockingDeque q = new LinkedBlockingDeque(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            LinkedBlockingDeque q = new LinkedBlockingDeque(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Deque contains all elements of collection used to initialize
-     */
-    public void testConstructor6() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        LinkedBlockingDeque q = new LinkedBlockingDeque(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * Deque transitions from empty to full when elements added
-     */
-    public void testEmptyFull() {
-        LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        assertTrue(q.isEmpty());
-        assertEquals("should have room for 2", 2, q.remainingCapacity());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        q.add(two);
-        assertFalse(q.isEmpty());
-        assertEquals(0, q.remainingCapacity());
-        assertFalse(q.offer(three));
-    }
-
-    /**
-     * remainingCapacity decreases on add, increases on remove
-     */
-    public void testRemainingCapacity() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remainingCapacity());
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.remainingCapacity());
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(1);
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(1);
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * push(null) throws NPE
-     */
-    public void testPushNull() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(1);
-            q.push(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * push succeeds if not full; throws ISE if full
-     */
-    public void testPush() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-            for (int i = 0; i < SIZE; ++i) {
-                Integer I = new Integer(i);
-                q.push(I);
-                assertEquals(I, q.peek());
-            }
-            assertEquals(0, q.remainingCapacity());
-            q.push(new Integer(SIZE));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     * peekFirst returns element inserted with push
-     */
-    public void testPushWithPeek() {
-        LinkedBlockingDeque q = populatedDeque(3);
-        q.pollLast();
-        q.push(four);
-        assertSame(four, q.peekFirst());
-    }
-
-
-    /**
-     *  pop removes next element, or throws NSEE if empty
-     */
-    public void testPop() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pop());
-        }
-        try {
-            q.pop();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-
-    /**
-     * Offer succeeds if not full; fails if full
-     */
-    public void testOffer() {
-        LinkedBlockingDeque q = new LinkedBlockingDeque(1);
-        assertTrue(q.offer(zero));
-        assertFalse(q.offer(one));
-    }
-
-    /**
-     * add succeeds if not full; throws ISE if full
-     */
-    public void testAdd() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-            for (int i = 0; i < SIZE; ++i) {
-                assertTrue(q.add(new Integer(i)));
-            }
-            assertEquals(0, q.remainingCapacity());
-            q.add(new Integer(SIZE));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(1);
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            LinkedBlockingDeque q = populatedDeque(SIZE);
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll throws ISE if not enough room
-     */
-    public void testAddAll4() {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(1);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     * Deque contains all elements, in traversal order, of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-
-    /**
-     * put(null) throws NPE
-     */
-    public void testPutNull() throws InterruptedException {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-            q.put(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * all elements successfully put are contained
-     */
-    public void testPut() throws InterruptedException {
-        LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            Integer I = new Integer(i);
-            q.put(I);
-            assertTrue(q.contains(I));
-        }
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * put blocks interruptibly if full
-     */
-    public void testBlockingPut() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i)
-                    q.put(i);
-                assertEquals(SIZE, q.size());
-                assertEquals(0, q.remainingCapacity());
-                try {
-                    q.put(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(SIZE, q.size());
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * put blocks waiting for take when full
-     */
-    public void testPutWithTake() throws InterruptedException {
-        final int capacity = 2;
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(capacity);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < capacity + 1; i++)
-                    q.put(i);
-                try {
-                    q.put(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(q.remainingCapacity(), 0);
-        assertEquals(0, q.take());
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(q.remainingCapacity(), 0);
-    }
-
-    /**
-     * timed offer times out if full and elements not taken
-     */
-    public void testTimedOffer() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new Object());
-                q.put(new Object());
-                assertFalse(q.offer(new Object(), SHORT_DELAY_MS, MILLISECONDS));
-                try {
-                    q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * take retrieves elements in FIFO order
-     */
-    public void testTake() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.take());
-        }
-    }
-
-    /**
-     * take blocks interruptibly when empty
-     */
-    public void testTakeFromEmpty() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws InterruptedException {
-                q.take();
-            }};
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * Take removes existing elements until empty, then blocks interruptibly
-     */
-    public void testBlockingTake() throws InterruptedException {
-        final LinkedBlockingDeque q = populatedDeque(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.take());
-                }
-                try {
-                    q.take();
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     * timed poll with zero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll0() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(0, MILLISECONDS));
-        }
-        assertNull(q.poll(0, MILLISECONDS));
-    }
-
-    /**
-     * timed poll with nonzero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));
-        }
-        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed poll throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPoll() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                LinkedBlockingDeque q = populatedDeque(SIZE);
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                }
-                try {
-                    q.poll(SMALL_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offer fails; after offer succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollWithOffer() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * putFirst(null) throws NPE
-     */
-     public void testPutFirstNull() throws InterruptedException {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-            q.putFirst(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-     }
-
-    /**
-     * all elements successfully putFirst are contained
-     */
-     public void testPutFirst() throws InterruptedException {
-         LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-         for (int i = 0; i < SIZE; ++i) {
-             Integer I = new Integer(i);
-             q.putFirst(I);
-             assertTrue(q.contains(I));
-         }
-         assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * putFirst blocks interruptibly if full
-     */
-    public void testBlockingPutFirst() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i)
-                    q.putFirst(i);
-                assertEquals(SIZE, q.size());
-                assertEquals(0, q.remainingCapacity());
-                try {
-                    q.putFirst(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(SIZE, q.size());
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * putFirst blocks waiting for take when full
-     */
-    public void testPutFirstWithTake() throws InterruptedException {
-        final int capacity = 2;
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(capacity);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < capacity + 1; i++)
-                    q.putFirst(i);
-                try {
-                    q.putFirst(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(q.remainingCapacity(), 0);
-        assertEquals(capacity - 1, q.take());
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(q.remainingCapacity(), 0);
-    }
-
-    /**
-     * timed offerFirst times out if full and elements not taken
-     */
-    public void testTimedOfferFirst() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.putFirst(new Object());
-                q.putFirst(new Object());
-                assertFalse(q.offerFirst(new Object(), SHORT_DELAY_MS, MILLISECONDS));
-                try {
-                    q.offerFirst(new Object(), LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * take retrieves elements in FIFO order
-     */
-    public void testTakeFirst() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.takeFirst());
-        }
-    }
-
-    /**
-     * takeFirst blocks interruptibly when empty
-     */
-    public void testTakeFirstFromEmpty() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws InterruptedException {
-                q.takeFirst();
-            }};
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * TakeFirst removes existing elements until empty, then blocks interruptibly
-     */
-    public void testBlockingTakeFirst() throws InterruptedException {
-        final LinkedBlockingDeque q = populatedDeque(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i)
-                    assertEquals(i, q.takeFirst());
-                try {
-                    q.takeFirst();
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * timed pollFirst with zero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPollFirst0() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pollFirst(0, MILLISECONDS));
-        }
-        assertNull(q.pollFirst(0, MILLISECONDS));
-    }
-
-    /**
-     * timed pollFirst with nonzero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPollFirst() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.pollFirst(SHORT_DELAY_MS, MILLISECONDS));
-        }
-        assertNull(q.pollFirst(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed pollFirst throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPollFirst() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                LinkedBlockingDeque q = populatedDeque(SIZE);
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.pollFirst(SHORT_DELAY_MS, MILLISECONDS));
-                }
-                try {
-                    q.pollFirst(SMALL_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed pollFirst before a delayed offerFirst fails; after offerFirst succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollFirstWithOfferFirst() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.pollFirst(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.pollFirst(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.pollFirst(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offerFirst(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * putLast(null) throws NPE
-     */
-     public void testPutLastNull() throws InterruptedException {
-        try {
-            LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-            q.putLast(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-     }
-
-    /**
-     * all elements successfully putLast are contained
-     */
-     public void testPutLast() throws InterruptedException {
-         LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-         for (int i = 0; i < SIZE; ++i) {
-             Integer I = new Integer(i);
-             q.putLast(I);
-             assertTrue(q.contains(I));
-         }
-         assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * putLast blocks interruptibly if full
-     */
-    public void testBlockingPutLast() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i)
-                    q.putLast(i);
-                assertEquals(SIZE, q.size());
-                assertEquals(0, q.remainingCapacity());
-                try {
-                    q.putLast(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(SIZE, q.size());
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * putLast blocks waiting for take when full
-     */
-    public void testPutLastWithTake() throws InterruptedException {
-        final int capacity = 2;
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(capacity);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < capacity + 1; i++)
-                    q.putLast(i);
-                try {
-                    q.putLast(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(q.remainingCapacity(), 0);
-        assertEquals(0, q.take());
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(q.remainingCapacity(), 0);
-    }
-
-    /**
-     * timed offerLast times out if full and elements not taken
-     */
-    public void testTimedOfferLast() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.putLast(new Object());
-                q.putLast(new Object());
-                assertFalse(q.offerLast(new Object(), SHORT_DELAY_MS, MILLISECONDS));
-                try {
-                    q.offerLast(new Object(), LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * takeLast retrieves elements in FIFO order
-     */
-    public void testTakeLast() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i-1, q.takeLast());
-        }
-    }
-
-    /**
-     * takeLast blocks interruptibly when empty
-     */
-    public void testTakeLastFromEmpty() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws InterruptedException {
-                q.takeLast();
-            }};
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * TakeLast removes existing elements until empty, then blocks interruptibly
-     */
-    public void testBlockingTakeLast() throws InterruptedException {
-        final LinkedBlockingDeque q = populatedDeque(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i)
-                    assertEquals(SIZE - 1 - i, q.takeLast());
-                try {
-                    q.takeLast();
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timed pollLast with zero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPollLast0() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i-1, q.pollLast(0, MILLISECONDS));
-        }
-        assertNull(q.pollLast(0, MILLISECONDS));
-    }
-
-    /**
-     * timed pollLast with nonzero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPollLast() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i-1, q.pollLast(SHORT_DELAY_MS, MILLISECONDS));
-        }
-        assertNull(q.pollLast(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed pollLast throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPollLast() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                LinkedBlockingDeque q = populatedDeque(SIZE);
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(SIZE-i-1, q.pollLast(SHORT_DELAY_MS, MILLISECONDS));
-                }
-                try {
-                    q.pollLast(SMALL_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offerLast fails; after offerLast succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollWithOfferLast() throws InterruptedException {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offerLast(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.element());
-            q.poll();
-        }
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.poll();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        assertEquals(SIZE, q.remainingCapacity());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(one));
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        LinkedBlockingDeque p = new LinkedBlockingDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        LinkedBlockingDeque p = populatedDeque(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            LinkedBlockingDeque q = populatedDeque(SIZE);
-            LinkedBlockingDeque p = populatedDeque(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testToArray() throws InterruptedException{
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        Object[] o = q.toArray();
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.take());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.take());
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        try {
-            Object o[] = q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * toArray with incompatible array type throws CCE
-     */
-    public void testToArray1_BadArg() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        try {
-            Object o[] = q.toArray(new String[10]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() throws InterruptedException {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertEquals(it.next(), q.take());
-        }
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(3);
-        q.add(two);
-        q.add(one);
-        q.add(three);
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertSame(it.next(), one);
-        assertSame(it.next(), three);
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * iterator ordering is FIFO
-     */
-    public void testIteratorOrdering() {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(3);
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        assertEquals(0, q.remainingCapacity());
-        int k = 0;
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            assertEquals(++k, it.next());
-        }
-        assertEquals(3, k);
-    }
-
-    /**
-     * Modifications do not cause iterators to fail
-     */
-    public void testWeaklyConsistentIteration () {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(3);
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            q.remove();
-            it.next();
-        }
-        assertEquals(0, q.size());
-    }
-
-
-    /**
-     *  Descending iterator iterates through all elements
-     */
-    public void testDescendingIterator() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        int i = 0;
-        Iterator it = q.descendingIterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-        assertFalse(it.hasNext());
-        try {
-            it.next();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     *  Descending iterator ordering is reverse FIFO
-     */
-    public void testDescendingIteratorOrdering() {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque();
-        for (int iters = 0; iters < 100; ++iters) {
-            q.add(new Integer(3));
-            q.add(new Integer(2));
-            q.add(new Integer(1));
-            int k = 0;
-            for (Iterator it = q.descendingIterator(); it.hasNext();) {
-                assertEquals(++k, it.next());
-            }
-
-            assertEquals(3, k);
-            q.remove();
-            q.remove();
-            q.remove();
-        }
-    }
-
-    /**
-     * descendingIterator.remove removes current element
-     */
-    public void testDescendingIteratorRemove () {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque();
-        for (int iters = 0; iters < 100; ++iters) {
-            q.add(new Integer(3));
-            q.add(new Integer(2));
-            q.add(new Integer(1));
-            Iterator it = q.descendingIterator();
-            assertEquals(it.next(), new Integer(1));
-            it.remove();
-            assertEquals(it.next(), new Integer(2));
-            it = q.descendingIterator();
-            assertEquals(it.next(), new Integer(2));
-            assertEquals(it.next(), new Integer(3));
-            it.remove();
-            assertFalse(it.hasNext());
-            q.remove();
-        }
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-
-    /**
-     * offer transfers elements across Executor tasks
-     */
-    public void testOfferInExecutor() {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        q.add(one);
-        q.add(two);
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(q.offer(three));
-                assertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS));
-                assertEquals(0, q.remainingCapacity());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                assertSame(one, q.take());
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * poll retrieves elements across Executor threads
-     */
-    public void testPollInExecutor() {
-        final LinkedBlockingDeque q = new LinkedBlockingDeque(2);
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll());
-                assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
-                assertTrue(q.isEmpty());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                q.put(one);
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * A deserialized serialized deque has same elements in same order
-     */
-    public void testSerialization() throws Exception {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        LinkedBlockingDeque r = (LinkedBlockingDeque)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.remove(), r.remove());
-    }
-
-    /**
-     * drainTo(null) throws NPE
-     */
-    public void testDrainToNull() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        try {
-            q.drainTo(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this) throws IAE
-     */
-    public void testDrainToSelf() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        try {
-            q.drainTo(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c) empties deque into another collection c
-     */
-    public void testDrainTo() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        q.add(zero);
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(zero));
-        assertTrue(q.contains(one));
-        l.clear();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), 2);
-        for (int i = 0; i < 2; ++i)
-            assertEquals(l.get(i), new Integer(i));
-    }
-
-    /**
-     * drainTo empties full deque, unblocking a waiting put.
-     */
-    public void testDrainToWithActivePut() throws InterruptedException {
-        final LinkedBlockingDeque q = populatedDeque(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new Integer(SIZE+1));
-            }});
-
-        t.start();
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertTrue(l.size() >= SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        t.join();
-        assertTrue(q.size() + l.size() >= SIZE);
-    }
-
-    /**
-     * drainTo(null, n) throws NPE
-     */
-    public void testDrainToNullN() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        try {
-            q.drainTo(null, 0);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this, n) throws IAE
-     */
-    public void testDrainToSelfN() {
-        LinkedBlockingDeque q = populatedDeque(SIZE);
-        try {
-            q.drainTo(q, 0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c, n) empties first max {n, size} elements of deque into c
-     */
-    public void testDrainToN() {
-        LinkedBlockingDeque q = new LinkedBlockingDeque();
-        for (int i = 0; i < SIZE + 2; ++i) {
-            for (int j = 0; j < SIZE; j++)
-                assertTrue(q.offer(new Integer(j)));
-            ArrayList l = new ArrayList();
-            q.drainTo(l, i);
-            int k = (i < SIZE)? i : SIZE;
-            assertEquals(l.size(), k);
-            assertEquals(q.size(), SIZE-k);
-            for (int j = 0; j < k; ++j)
-                assertEquals(l.get(j), new Integer(j));
-            while (q.poll() != null) ;
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/LinkedBlockingQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/LinkedBlockingQueueTest.java
deleted file mode 100755
index a98dc21..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/LinkedBlockingQueueTest.java
+++ /dev/null
@@ -1,919 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-
-public class LinkedBlockingQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(LinkedBlockingQueueTest.class);
-    }
-
-
-    /**
-     * Create a queue of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private LinkedBlockingQueue populatedQueue(int n) {
-        LinkedBlockingQueue q = new LinkedBlockingQueue(n);
-        assertTrue(q.isEmpty());
-        for (int i = 0; i < n; i++)
-            assertTrue(q.offer(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(0, q.remainingCapacity());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * A new queue has the indicated capacity, or Integer.MAX_VALUE if
-     * none given
-     */
-    public void testConstructor1() {
-        assertEquals(SIZE, new LinkedBlockingQueue(SIZE).remainingCapacity());
-        assertEquals(Integer.MAX_VALUE, new LinkedBlockingQueue().remainingCapacity());
-    }
-
-    /**
-     * Constructor throws IAE if capacity argument nonpositive
-     */
-    public void testConstructor2() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            LinkedBlockingQueue q = new LinkedBlockingQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            LinkedBlockingQueue q = new LinkedBlockingQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-     */
-    public void testConstructor6() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        LinkedBlockingQueue q = new LinkedBlockingQueue(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * Queue transitions from empty to full when elements added
-     */
-    public void testEmptyFull() {
-        LinkedBlockingQueue q = new LinkedBlockingQueue(2);
-        assertTrue(q.isEmpty());
-        assertEquals("should have room for 2", 2, q.remainingCapacity());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        q.add(two);
-        assertFalse(q.isEmpty());
-        assertEquals(0, q.remainingCapacity());
-        assertFalse(q.offer(three));
-    }
-
-    /**
-     * remainingCapacity decreases on add, increases on remove
-     */
-    public void testRemainingCapacity() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remainingCapacity());
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.remainingCapacity());
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(1);
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(1);
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Offer succeeds if not full; fails if full
-     */
-    public void testOffer() {
-        LinkedBlockingQueue q = new LinkedBlockingQueue(1);
-        assertTrue(q.offer(zero));
-        assertFalse(q.offer(one));
-    }
-
-    /**
-     * add succeeds if not full; throws ISE if full
-     */
-    public void testAdd() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(SIZE);
-            for (int i = 0; i < SIZE; ++i) {
-                assertTrue(q.add(new Integer(i)));
-            }
-            assertEquals(0, q.remainingCapacity());
-            q.add(new Integer(SIZE));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(1);
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            LinkedBlockingQueue q = populatedQueue(SIZE);
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll throws ISE if not enough room
-     */
-    public void testAddAll4() {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(1);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-    /**
-     * Queue contains all elements, in traversal order, of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        LinkedBlockingQueue q = new LinkedBlockingQueue(SIZE);
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * put(null) throws NPE
-     */
-     public void testPutNull() throws InterruptedException {
-        try {
-            LinkedBlockingQueue q = new LinkedBlockingQueue(SIZE);
-            q.put(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-     }
-
-    /**
-     * all elements successfully put are contained
-     */
-    public void testPut() throws InterruptedException {
-        LinkedBlockingQueue q = new LinkedBlockingQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            Integer I = new Integer(i);
-            q.put(I);
-            assertTrue(q.contains(I));
-        }
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * put blocks interruptibly if full
-     */
-    public void testBlockingPut() throws InterruptedException {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i)
-                    q.put(i);
-                assertEquals(SIZE, q.size());
-                assertEquals(0, q.remainingCapacity());
-                try {
-                    q.put(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(SIZE, q.size());
-        assertEquals(0, q.remainingCapacity());
-    }
-
-    /**
-     * put blocks waiting for take when full
-     */
-    public void testPutWithTake() throws InterruptedException {
-        final int capacity = 2;
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < capacity + 1; i++)
-                    q.put(i);
-                try {
-                    q.put(99);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(q.remainingCapacity(), 0);
-        assertEquals(0, q.take());
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        assertEquals(q.remainingCapacity(), 0);
-    }
-
-    /**
-     * timed offer times out if full and elements not taken
-     */
-    public void testTimedOffer() throws InterruptedException {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new Object());
-                q.put(new Object());
-                assertFalse(q.offer(new Object(), SHORT_DELAY_MS, MILLISECONDS));
-                try {
-                    q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * take retrieves elements in FIFO order
-     */
-    public void testTake() throws InterruptedException {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.take());
-        }
-    }
-
-    /**
-     * take blocks interruptibly when empty
-     */
-    public void testTakeFromEmpty() throws InterruptedException {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(2);
-        Thread t = new ThreadShouldThrow(InterruptedException.class) {
-            public void realRun() throws InterruptedException {
-                q.take();
-            }};
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * Take removes existing elements until empty, then blocks interruptibly
-     */
-    public void testBlockingTake() throws InterruptedException {
-        final LinkedBlockingQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.take());
-                }
-                try {
-                    q.take();
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     * timed pool with zero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll0() throws InterruptedException {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(0, MILLISECONDS));
-        }
-        assertNull(q.poll(0, MILLISECONDS));
-    }
-
-    /**
-     * timed pool with nonzero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll() throws InterruptedException {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));
-        }
-        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed poll throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPoll() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                LinkedBlockingQueue q = populatedQueue(SIZE);
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                }
-                try {
-                    q.poll(SMALL_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offer fails; after offer succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollWithOffer() throws InterruptedException {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peek());
-            assertEquals(i, q.poll());
-            assertTrue(q.peek() == null ||
-                       !q.peek().equals(i));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.element());
-            assertEquals(i, q.poll());
-        }
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remove());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * An add following remove(x) succeeds
-     */
-    public void testRemoveElementAndAdd() throws InterruptedException {
-        LinkedBlockingQueue q = new LinkedBlockingQueue();
-        assertTrue(q.add(new Integer(1)));
-        assertTrue(q.add(new Integer(2)));
-        assertTrue(q.remove(new Integer(1)));
-        assertTrue(q.remove(new Integer(2)));
-        assertTrue(q.add(new Integer(3)));
-        assertTrue(q.take() != null);
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.poll();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        assertEquals(SIZE, q.remainingCapacity());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(one));
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        LinkedBlockingQueue p = new LinkedBlockingQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        LinkedBlockingQueue p = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            LinkedBlockingQueue q = populatedQueue(SIZE);
-            LinkedBlockingQueue p = populatedQueue(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testToArray() throws InterruptedException {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        Object[] o = q.toArray();
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.take());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() throws InterruptedException {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.take());
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * toArray with incompatible array type throws CCE
-     */
-    public void testToArray1_BadArg() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(new String[10]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() throws InterruptedException {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertEquals(it.next(), q.take());
-        }
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(3);
-        q.add(two);
-        q.add(one);
-        q.add(three);
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertSame(it.next(), one);
-        assertSame(it.next(), three);
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * iterator ordering is FIFO
-     */
-    public void testIteratorOrdering() {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(3);
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        assertEquals(0, q.remainingCapacity());
-        int k = 0;
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            assertEquals(++k, it.next());
-        }
-        assertEquals(3, k);
-    }
-
-    /**
-     * Modifications do not cause iterators to fail
-     */
-    public void testWeaklyConsistentIteration () {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(3);
-        q.add(one);
-        q.add(two);
-        q.add(three);
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            q.remove();
-            it.next();
-        }
-        assertEquals(0, q.size());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-
-    /**
-     * offer transfers elements across Executor tasks
-     */
-    public void testOfferInExecutor() {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(2);
-        q.add(one);
-        q.add(two);
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(q.offer(three));
-                assertTrue(q.offer(three, MEDIUM_DELAY_MS, MILLISECONDS));
-                assertEquals(0, q.remainingCapacity());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                assertSame(one, q.take());
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * poll retrieves elements across Executor threads
-     */
-    public void testPollInExecutor() {
-        final LinkedBlockingQueue q = new LinkedBlockingQueue(2);
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll());
-                assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
-                assertTrue(q.isEmpty());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                q.put(one);
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * A deserialized serialized queue has same elements in same order
-     */
-    public void testSerialization() throws Exception {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        LinkedBlockingQueue r = (LinkedBlockingQueue)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.remove(), r.remove());
-    }
-
-    /**
-     * drainTo(null) throws NPE
-     */
-    public void testDrainToNull() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this) throws IAE
-     */
-    public void testDrainToSelf() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c) empties queue into another collection c
-     */
-    public void testDrainTo() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        q.add(zero);
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(zero));
-        assertTrue(q.contains(one));
-        l.clear();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), 2);
-        for (int i = 0; i < 2; ++i)
-            assertEquals(l.get(i), new Integer(i));
-    }
-
-    /**
-     * drainTo empties full queue, unblocking a waiting put.
-     */
-    public void testDrainToWithActivePut() throws InterruptedException {
-        final LinkedBlockingQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new Integer(SIZE+1));
-            }});
-
-        t.start();
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertTrue(l.size() >= SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        t.join();
-        assertTrue(q.size() + l.size() >= SIZE);
-    }
-
-    /**
-     * drainTo(null, n) throws NPE
-     */
-    public void testDrainToNullN() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null, 0);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this, n) throws IAE
-     */
-    public void testDrainToSelfN() {
-        LinkedBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q, 0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c, n) empties first max {n, size} elements of queue into c
-     */
-    public void testDrainToN() {
-        LinkedBlockingQueue q = new LinkedBlockingQueue();
-        for (int i = 0; i < SIZE + 2; ++i) {
-            for (int j = 0; j < SIZE; j++)
-                assertTrue(q.offer(new Integer(j)));
-            ArrayList l = new ArrayList();
-            q.drainTo(l, i);
-            int k = (i < SIZE)? i : SIZE;
-            assertEquals(l.size(), k);
-            assertEquals(q.size(), SIZE-k);
-            for (int j = 0; j < k; ++j)
-                assertEquals(l.get(j), new Integer(j));
-            while (q.poll() != null) ;
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/LinkedListTest.java b/luni/src/test/java/tests/api/java/util/concurrent/LinkedListTest.java
deleted file mode 100755
index 802bfbf..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/LinkedListTest.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent;
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-
-public class LinkedListTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(LinkedListTest.class);
-    }
-
-    /**
-     * Create a queue of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private LinkedList populatedQueue(int n) {
-        LinkedList q = new LinkedList();
-        assertTrue(q.isEmpty());
-        for(int i = 0; i < n; ++i)
-            assertTrue(q.offer(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * new queue is empty
-     */
-    public void testConstructor1() {
-        assertEquals(0, new LinkedList().size());
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            LinkedList q = new LinkedList((Collection)null);
-            shouldThrow();
-        }
-        catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-
-     */
-    public void testConstructor6() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE; ++i)
-                ints[i] = new Integer(i);
-            LinkedList q = new LinkedList(Arrays.asList(ints));
-            for (int i = 0; i < SIZE; ++i)
-                assertEquals(ints[i], q.poll());
-        }
-        finally {}
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        LinkedList q = new LinkedList();
-        assertTrue(q.isEmpty());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.add(new Integer(2));
-        q.remove();
-        q.remove();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testSize() {
-        LinkedList q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * offer(null) succeeds
-     */
-    public void testOfferNull() {
-        try {
-            LinkedList q = new LinkedList();
-            q.offer(null);
-        } catch (NullPointerException ie) {
-            unexpectedException();
-        }
-    }
-
-    /**
-     * Offer succeeds
-     */
-    public void testOffer() {
-        LinkedList q = new LinkedList();
-        assertTrue(q.offer(new Integer(0)));
-        assertTrue(q.offer(new Integer(1)));
-    }
-
-    /**
-     * add succeeds
-     */
-    public void testAdd() {
-        LinkedList q = new LinkedList();
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            assertTrue(q.add(new Integer(i)));
-        }
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            LinkedList q = new LinkedList();
-            q.addAll(null);
-            shouldThrow();
-        }
-        catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements, in traversal order, of successful addAll
-     */
-    public void testAddAll5() {
-        try {
-            Integer[] empty = new Integer[0];
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE; ++i)
-                ints[i] = new Integer(i);
-            LinkedList q = new LinkedList();
-            assertFalse(q.addAll(Arrays.asList(empty)));
-            assertTrue(q.addAll(Arrays.asList(ints)));
-            for (int i = 0; i < SIZE; ++i)
-                assertEquals(ints[i], q.poll());
-        }
-        finally {}
-    }
-
-    /**
-     * addAll with too large an index throws IOOBE
-     */
-    public void testAddAll2_IndexOutOfBoundsException() {
-        try {
-            LinkedList l = new LinkedList();
-            l.add(new Object());
-            LinkedList m = new LinkedList();
-            m.add(new Object());
-            l.addAll(4,m);
-            shouldThrow();
-        } catch(IndexOutOfBoundsException  success) {}
-    }
-
-    /**
-     * addAll with negative index throws IOOBE
-     */
-    public void testAddAll4_BadIndex() {
-        try {
-            LinkedList l = new LinkedList();
-            l.add(new Object());
-            LinkedList m = new LinkedList();
-            m.add(new Object());
-            l.addAll(-1,m);
-            shouldThrow();
-        } catch(IndexOutOfBoundsException  success){}
-    }
-
-    /**
-     *  poll succeeds unless empty
-     */
-    public void testPoll() {
-        LinkedList q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, ((Integer)q.poll()).intValue());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     *  peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        LinkedList q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, ((Integer)q.peek()).intValue());
-            q.poll();
-            assertTrue(q.peek() == null ||
-                       i != ((Integer)q.peek()).intValue());
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        LinkedList q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, ((Integer)q.element()).intValue());
-            q.poll();
-        }
-        try {
-            q.element();
-            shouldThrow();
-        }
-        catch (NoSuchElementException success) {}
-    }
-
-    /**
-     *  remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        LinkedList q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, ((Integer)q.remove()).intValue());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success){
-        }
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        LinkedList q = populatedQueue(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        LinkedList q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.poll();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        LinkedList q = populatedQueue(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        LinkedList q = populatedQueue(SIZE);
-        LinkedList p = new LinkedList();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        LinkedList q = populatedQueue(SIZE);
-        LinkedList p = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            LinkedList q = populatedQueue(SIZE);
-            LinkedList p = populatedQueue(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     *  toArray contains all elements
-     */
-    public void testToArray() {
-        LinkedList q = populatedQueue(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for(int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.poll());
-    }
-
-    /**
-     *  toArray(a) contains all elements
-     */
-    public void testToArray2() {
-        LinkedList q = populatedQueue(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for(int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        try {
-            LinkedList l = new LinkedList();
-            l.add(new Object());
-            Object o[] = l.toArray(null);
-            shouldThrow();
-        } catch(NullPointerException success){}
-    }
-
-    /**
-     * toArray with incompatable aray type throws CCE
-     */
-    public void testToArray1_BadArg() {
-        try {
-            LinkedList l = new LinkedList();
-            l.add(new Integer(5));
-            Object o[] = l.toArray(new String[10] );
-            shouldThrow();
-        } catch(ArrayStoreException  success){}
-    }
-
-    /**
-     *  iterator iterates through all elements
-     */
-    public void testIterator() {
-        LinkedList q = populatedQueue(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while(it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     *  iterator ordering is FIFO
-     */
-    public void testIteratorOrdering() {
-        final LinkedList q = new LinkedList();
-        q.add(new Integer(1));
-        q.add(new Integer(2));
-        q.add(new Integer(3));
-        int k = 0;
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            int i = ((Integer)(it.next())).intValue();
-            assertEquals(++k, i);
-        }
-
-        assertEquals(3, k);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final LinkedList q = new LinkedList();
-        q.add(new Integer(1));
-        q.add(new Integer(2));
-        q.add(new Integer(3));
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-        it = q.iterator();
-        assertEquals(it.next(), new Integer(2));
-        assertEquals(it.next(), new Integer(3));
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        LinkedList q = populatedQueue(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * peek returns element inserted with addFirst
-     */
-    public void testAddFirst() {
-        LinkedList q = populatedQueue(3);
-        q.addFirst(four);
-        assertEquals(four,q.peek());
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/LockSupportTest.java b/luni/src/test/java/tests/api/java/util/concurrent/LockSupportTest.java
deleted file mode 100755
index 1052a24..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/LockSupportTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.util.concurrent.locks.*;
-
-public class LockSupportTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(LockSupportTest.class);
-    }
-
-    /**
-     * park is released by unpark occurring after park
-     */
-    public void testPark() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                LockSupport.park();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        LockSupport.unpark(t);
-        t.join();
-    }
-
-    /**
-     * park is released by unpark occurring before park
-     */
-    public void testPark2() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SHORT_DELAY_MS);
-                LockSupport.park();
-            }});
-
-        t.start();
-        LockSupport.unpark(t);
-        t.join();
-    }
-
-    /**
-     * park is released by interrupt
-     */
-    public void testPark3() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                LockSupport.park();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * park returns if interrupted before park
-     */
-    public void testPark4() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        lock.lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.lock();
-                LockSupport.park();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        lock.unlock();
-        t.join();
-    }
-
-    /**
-     * parkNanos times out if not unparked
-     */
-    public void testParkNanos() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                LockSupport.parkNanos(1000);
-            }});
-
-        t.start();
-        t.join();
-    }
-
-
-    /**
-     * parkUntil times out if not unparked
-     */
-    public void testParkUntil() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                long d = new Date().getTime() + 100;
-                LockSupport.parkUntil(d);
-            }});
-
-        t.start();
-        t.join();
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/PriorityBlockingQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/PriorityBlockingQueueTest.java
deleted file mode 100755
index f1dd88d..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/PriorityBlockingQueueTest.java
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-
-public class PriorityBlockingQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(PriorityBlockingQueueTest.class);
-    }
-
-    private static final int NOCAP = Integer.MAX_VALUE;
-
-    /** Sample Comparator */
-    static class MyReverseComparator implements Comparator {
-        public int compare(Object x, Object y) {
-            return ((Comparable)y).compareTo(x);
-        }
-    }
-
-    /**
-     * Create a queue of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private PriorityBlockingQueue populatedQueue(int n) {
-        PriorityBlockingQueue q = new PriorityBlockingQueue(n);
-        assertTrue(q.isEmpty());
-        for (int i = n-1; i >= 0; i-=2)
-            assertTrue(q.offer(new Integer(i)));
-        for (int i = (n & 1); i < n; i+=2)
-            assertTrue(q.offer(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(NOCAP, q.remainingCapacity());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * A new queue has unbounded capacity
-     */
-    public void testConstructor1() {
-        assertEquals(NOCAP, new PriorityBlockingQueue(SIZE).remainingCapacity());
-    }
-
-    /**
-     * Constructor throws IAE if capacity argument nonpositive
-     */
-    public void testConstructor2() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            PriorityBlockingQueue q = new PriorityBlockingQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            PriorityBlockingQueue q = new PriorityBlockingQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-     */
-    public void testConstructor6() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        PriorityBlockingQueue q = new PriorityBlockingQueue(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * The comparator used in constructor is used
-     */
-    public void testConstructor7() {
-        MyReverseComparator cmp = new MyReverseComparator();
-        PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE, cmp);
-        assertEquals(cmp, q.comparator());
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        q.addAll(Arrays.asList(ints));
-        for (int i = SIZE-1; i >= 0; --i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        PriorityBlockingQueue q = new PriorityBlockingQueue(2);
-        assertTrue(q.isEmpty());
-        assertEquals(NOCAP, q.remainingCapacity());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        q.add(two);
-        q.remove();
-        q.remove();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * remainingCapacity does not change when elements added or removed,
-     * but size does
-     */
-    public void testRemainingCapacity() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(NOCAP, q.remainingCapacity());
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(NOCAP, q.remainingCapacity());
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(1);
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(1);
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Offer of comparable element succeeds
-     */
-    public void testOffer() {
-        PriorityBlockingQueue q = new PriorityBlockingQueue(1);
-        assertTrue(q.offer(zero));
-        assertTrue(q.offer(one));
-    }
-
-    /**
-     * Offer of non-Comparable throws CCE
-     */
-    public void testOfferNonComparable() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(1);
-            q.offer(new Object());
-            q.offer(new Object());
-            q.offer(new Object());
-            shouldThrow();
-        } catch (ClassCastException success) {}
-    }
-
-    /**
-     * add of comparable succeeds
-     */
-    public void testAdd() {
-        PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            assertTrue(q.add(new Integer(i)));
-        }
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(1);
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            PriorityBlockingQueue q = populatedQueue(SIZE);
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = SIZE-1; i >= 0; --i)
-            ints[i] = new Integer(i);
-        PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * put(null) throws NPE
-     */
-     public void testPutNull() {
-        try {
-            PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
-            q.put(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-     }
-
-    /**
-     * all elements successfully put are contained
-     */
-     public void testPut() {
-         PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE);
-         for (int i = 0; i < SIZE; ++i) {
-             Integer I = new Integer(i);
-             q.put(I);
-             assertTrue(q.contains(I));
-         }
-         assertEquals(SIZE, q.size());
-    }
-
-    /**
-     * put doesn't block waiting for take
-     */
-    public void testPutWithTake() throws InterruptedException {
-        final PriorityBlockingQueue q = new PriorityBlockingQueue(2);
-        final int size = 4;
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                for (int i = 0; i < size; i++)
-                    q.put(new Integer(0));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(q.size(), size);
-        q.take();
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timed offer does not time out
-     */
-    public void testTimedOffer() throws InterruptedException {
-        final PriorityBlockingQueue q = new PriorityBlockingQueue(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                q.put(new Integer(0));
-                q.put(new Integer(0));
-                assertTrue(q.offer(new Integer(0), SHORT_DELAY_MS, MILLISECONDS));
-                assertTrue(q.offer(new Integer(0), LONG_DELAY_MS, MILLISECONDS));
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * take retrieves elements in priority order
-     */
-    public void testTake() throws InterruptedException {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.take());
-        }
-    }
-
-    /**
-     * take blocks interruptibly when empty
-     */
-    public void testTakeFromEmpty() throws InterruptedException {
-        final PriorityBlockingQueue q = new PriorityBlockingQueue(2);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.take();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * Take removes existing elements until empty, then blocks interruptibly
-     */
-    public void testBlockingTake() throws InterruptedException {
-        final PriorityBlockingQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.take());
-                }
-                try {
-                    q.take();
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     * timed pool with zero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll0() throws InterruptedException {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(0, MILLISECONDS));
-        }
-        assertNull(q.poll(0, MILLISECONDS));
-    }
-
-    /**
-     * timed pool with nonzero timeout succeeds when non-empty, else times out
-     */
-    public void testTimedPoll() throws InterruptedException {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));
-        }
-        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed poll throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPoll() throws InterruptedException {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                PriorityBlockingQueue q = populatedQueue(SIZE);
-                for (int i = 0; i < SIZE; ++i) {
-                    assertEquals(i, q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                }
-                try {
-                    q.poll(SMALL_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offer fails; after offer succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollWithOffer() throws InterruptedException {
-        final PriorityBlockingQueue q = new PriorityBlockingQueue(2);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peek());
-            assertEquals(i, q.poll());
-            assertTrue(q.peek() == null ||
-                       !q.peek().equals(i));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.element());
-            assertEquals(i, q.poll());
-        }
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remove());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.poll();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(one));
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        PriorityBlockingQueue p = new PriorityBlockingQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        PriorityBlockingQueue p = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            PriorityBlockingQueue q = populatedQueue(SIZE);
-            PriorityBlockingQueue p = populatedQueue(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     *  toArray contains all elements
-     */
-    public void testToArray() throws InterruptedException {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.take());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() throws InterruptedException {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.take());
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * toArray with incompatible array type throws CCE
-     */
-    public void testToArray1_BadArg() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        try {
-            Object o[] = q.toArray(new String[10]);
-            shouldThrow();
-        } catch (ArrayStoreException success) {}
-    }
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final PriorityBlockingQueue q = new PriorityBlockingQueue(3);
-        q.add(new Integer(2));
-        q.add(new Integer(1));
-        q.add(new Integer(3));
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertEquals(it.next(), new Integer(2));
-        assertEquals(it.next(), new Integer(3));
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * offer transfers elements across Executor tasks
-     */
-    public void testPollInExecutor() {
-        final PriorityBlockingQueue q = new PriorityBlockingQueue(2);
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll());
-                assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
-                assertTrue(q.isEmpty());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                q.put(one);
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * A deserialized serialized queue has same elements
-     */
-    public void testSerialization() throws Exception {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        PriorityBlockingQueue r = (PriorityBlockingQueue)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.remove(), r.remove());
-    }
-
-    /**
-     * drainTo(null) throws NPE
-     */
-    public void testDrainToNull() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this) throws IAE
-     */
-    public void testDrainToSelf() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c) empties queue into another collection c
-     */
-    public void testDrainTo() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        q.add(zero);
-        q.add(one);
-        assertFalse(q.isEmpty());
-        assertTrue(q.contains(zero));
-        assertTrue(q.contains(one));
-        l.clear();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), 2);
-        for (int i = 0; i < 2; ++i)
-            assertEquals(l.get(i), new Integer(i));
-    }
-
-    /**
-     * drainTo empties queue
-     */
-    public void testDrainToWithActivePut() throws InterruptedException {
-        final PriorityBlockingQueue q = populatedQueue(SIZE);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                q.put(new Integer(SIZE+1));
-            }});
-
-        t.start();
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertTrue(l.size() >= SIZE);
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(l.get(i), new Integer(i));
-        t.join();
-        assertTrue(q.size() + l.size() >= SIZE);
-    }
-
-    /**
-     * drainTo(null, n) throws NPE
-     */
-    public void testDrainToNullN() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(null, 0);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this, n) throws IAE
-     */
-    public void testDrainToSelfN() {
-        PriorityBlockingQueue q = populatedQueue(SIZE);
-        try {
-            q.drainTo(q, 0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c, n) empties first max {n, size} elements of queue into c
-     */
-    public void testDrainToN() {
-        PriorityBlockingQueue q = new PriorityBlockingQueue(SIZE*2);
-        for (int i = 0; i < SIZE + 2; ++i) {
-            for (int j = 0; j < SIZE; j++)
-                assertTrue(q.offer(new Integer(j)));
-            ArrayList l = new ArrayList();
-            q.drainTo(l, i);
-            int k = (i < SIZE)? i : SIZE;
-            assertEquals(l.size(), k);
-            assertEquals(q.size(), SIZE-k);
-            for (int j = 0; j < k; ++j)
-                assertEquals(l.get(j), new Integer(j));
-            while (q.poll() != null) ;
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/PriorityQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/PriorityQueueTest.java
deleted file mode 100755
index 12ddef4..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/PriorityQueueTest.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class PriorityQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(PriorityQueueTest.class);
-    }
-
-    static class MyReverseComparator implements Comparator {
-        public int compare(Object x, Object y) {
-            return ((Comparable)y).compareTo(x);
-        }
-    }
-
-    /**
-     * Create a queue of given size containing consecutive
-     * Integers 0 ... n.
-     */
-    private PriorityQueue populatedQueue(int n) {
-        PriorityQueue q = new PriorityQueue(n);
-        assertTrue(q.isEmpty());
-        for (int i = n-1; i >= 0; i-=2)
-            assertTrue(q.offer(new Integer(i)));
-        for (int i = (n & 1); i < n; i+=2)
-            assertTrue(q.offer(new Integer(i)));
-        assertFalse(q.isEmpty());
-        assertEquals(n, q.size());
-        return q;
-    }
-
-    /**
-     * A new queue has unbounded capacity
-     */
-    public void testConstructor1() {
-        assertEquals(0, new PriorityQueue(SIZE).size());
-    }
-
-    /**
-     * Constructor throws IAE if capacity argument nonpositive
-     */
-    public void testConstructor2() {
-        try {
-            PriorityQueue q = new PriorityQueue(0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Initializing from null Collection throws NPE
-     */
-    public void testConstructor3() {
-        try {
-            PriorityQueue q = new PriorityQueue((Collection)null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection of null elements throws NPE
-     */
-    public void testConstructor4() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            PriorityQueue q = new PriorityQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Initializing from Collection with some null elements throws NPE
-     */
-    public void testConstructor5() {
-        try {
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            PriorityQueue q = new PriorityQueue(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of collection used to initialize
-     */
-    public void testConstructor6() {
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        PriorityQueue q = new PriorityQueue(Arrays.asList(ints));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * The comparator used in constructor is used
-     */
-    public void testConstructor7() {
-        MyReverseComparator cmp = new MyReverseComparator();
-        PriorityQueue q = new PriorityQueue(SIZE, cmp);
-        assertEquals(cmp, q.comparator());
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(i);
-        q.addAll(Arrays.asList(ints));
-        for (int i = SIZE-1; i >= 0; --i)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * isEmpty is true before add, false after
-     */
-    public void testEmpty() {
-        PriorityQueue q = new PriorityQueue(2);
-        assertTrue(q.isEmpty());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.add(new Integer(2));
-        q.remove();
-        q.remove();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * size changes when elements added and removed
-     */
-    public void testSize() {
-        PriorityQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(SIZE-i, q.size());
-            q.remove();
-        }
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            q.add(new Integer(i));
-        }
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            PriorityQueue q = new PriorityQueue(1);
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            PriorityQueue q = new PriorityQueue(1);
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Offer of comparable element succeeds
-     */
-    public void testOffer() {
-        PriorityQueue q = new PriorityQueue(1);
-        assertTrue(q.offer(zero));
-        assertTrue(q.offer(one));
-    }
-
-    /**
-     * Offer of non-Comparable throws CCE
-     */
-    public void testOfferNonComparable() {
-        try {
-            PriorityQueue q = new PriorityQueue(1);
-            q.offer(new Object());
-            q.offer(new Object());
-            q.offer(new Object());
-            shouldThrow();
-        } catch (ClassCastException success) {}
-    }
-
-    /**
-     * add of comparable succeeds
-     */
-    public void testAdd() {
-        PriorityQueue q = new PriorityQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.size());
-            assertTrue(q.add(new Integer(i)));
-        }
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            PriorityQueue q = new PriorityQueue(1);
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            PriorityQueue q = new PriorityQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll of a collection with any null elements throws NPE after
-     * possibly adding some elements
-     */
-    public void testAddAll3() {
-        try {
-            PriorityQueue q = new PriorityQueue(SIZE);
-            Integer[] ints = new Integer[SIZE];
-            for (int i = 0; i < SIZE-1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Queue contains all elements of successful addAll
-     */
-    public void testAddAll5() {
-        Integer[] empty = new Integer[0];
-        Integer[] ints = new Integer[SIZE];
-        for (int i = 0; i < SIZE; ++i)
-            ints[i] = new Integer(SIZE-1-i);
-        PriorityQueue q = new PriorityQueue(SIZE);
-        assertFalse(q.addAll(Arrays.asList(empty)));
-        assertTrue(q.addAll(Arrays.asList(ints)));
-        for (int i = 0; i < SIZE; ++i)
-            assertEquals(new Integer(i), q.poll());
-    }
-
-    /**
-     * poll succeeds unless empty
-     */
-    public void testPoll() {
-        PriorityQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.poll());
-        }
-        assertNull(q.poll());
-    }
-
-    /**
-     * peek returns next element, or null if empty
-     */
-    public void testPeek() {
-        PriorityQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.peek());
-            assertEquals(i, q.poll());
-            assertTrue(q.peek() == null ||
-                       !q.peek().equals(i));
-        }
-        assertNull(q.peek());
-    }
-
-    /**
-     * element returns next element, or throws NSEE if empty
-     */
-    public void testElement() {
-        PriorityQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.element());
-            assertEquals(i, q.poll());
-        }
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove removes next element, or throws NSEE if empty
-     */
-    public void testRemove() {
-        PriorityQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertEquals(i, q.remove());
-        }
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) removes x and returns true if present
-     */
-    public void testRemoveElement() {
-        PriorityQueue q = populatedQueue(SIZE);
-        for (int i = 1; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-        }
-        for (int i = 0; i < SIZE; i+=2) {
-            assertTrue(q.remove(new Integer(i)));
-            assertFalse(q.remove(new Integer(i+1)));
-        }
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains(x) reports true when elements added but not yet removed
-     */
-    public void testContains() {
-        PriorityQueue q = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.contains(new Integer(i)));
-            q.poll();
-            assertFalse(q.contains(new Integer(i)));
-        }
-    }
-
-    /**
-     * clear removes all elements
-     */
-    public void testClear() {
-        PriorityQueue q = populatedQueue(SIZE);
-        q.clear();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        q.add(new Integer(1));
-        assertFalse(q.isEmpty());
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll(c) is true when c contains a subset of elements
-     */
-    public void testContainsAll() {
-        PriorityQueue q = populatedQueue(SIZE);
-        PriorityQueue p = new PriorityQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(q.containsAll(p));
-            assertFalse(p.containsAll(q));
-            p.add(new Integer(i));
-        }
-        assertTrue(p.containsAll(q));
-    }
-
-    /**
-     * retainAll(c) retains only those elements of c and reports true if changed
-     */
-    public void testRetainAll() {
-        PriorityQueue q = populatedQueue(SIZE);
-        PriorityQueue p = populatedQueue(SIZE);
-        for (int i = 0; i < SIZE; ++i) {
-            boolean changed = q.retainAll(p);
-            if (i == 0)
-                assertFalse(changed);
-            else
-                assertTrue(changed);
-
-            assertTrue(q.containsAll(p));
-            assertEquals(SIZE-i, q.size());
-            p.remove();
-        }
-    }
-
-    /**
-     * removeAll(c) removes only those elements of c and reports true if changed
-     */
-    public void testRemoveAll() {
-        for (int i = 1; i < SIZE; ++i) {
-            PriorityQueue q = populatedQueue(SIZE);
-            PriorityQueue p = populatedQueue(i);
-            assertTrue(q.removeAll(p));
-            assertEquals(SIZE-i, q.size());
-            for (int j = 0; j < i; ++j) {
-                Integer I = (Integer)(p.remove());
-                assertFalse(q.contains(I));
-            }
-        }
-    }
-
-    /**
-     * toArray contains all elements
-     */
-    public void testToArray() {
-        PriorityQueue q = populatedQueue(SIZE);
-        Object[] o = q.toArray();
-        Arrays.sort(o);
-        for (int i = 0; i < o.length; i++)
-            assertEquals(o[i], q.poll());
-    }
-
-    /**
-     * toArray(a) contains all elements
-     */
-    public void testToArray2() {
-        PriorityQueue q = populatedQueue(SIZE);
-        Integer[] ints = new Integer[SIZE];
-        ints = (Integer[])q.toArray(ints);
-        Arrays.sort(ints);
-        for (int i = 0; i < ints.length; i++)
-            assertEquals(ints[i], q.poll());
-    }
-
-    /**
-     * iterator iterates through all elements
-     */
-    public void testIterator() {
-        PriorityQueue q = populatedQueue(SIZE);
-        int i = 0;
-        Iterator it = q.iterator();
-        while (it.hasNext()) {
-            assertTrue(q.contains(it.next()));
-            ++i;
-        }
-        assertEquals(i, SIZE);
-    }
-
-    /**
-     * iterator.remove removes current element
-     */
-    public void testIteratorRemove () {
-        final PriorityQueue q = new PriorityQueue(3);
-        q.add(new Integer(2));
-        q.add(new Integer(1));
-        q.add(new Integer(3));
-
-        Iterator it = q.iterator();
-        it.next();
-        it.remove();
-
-        it = q.iterator();
-        assertEquals(it.next(), new Integer(2));
-        assertEquals(it.next(), new Integer(3));
-        assertFalse(it.hasNext());
-    }
-
-
-    /**
-     * toString contains toStrings of elements
-     */
-    public void testToString() {
-        PriorityQueue q = populatedQueue(SIZE);
-        String s = q.toString();
-        for (int i = 0; i < SIZE; ++i) {
-            assertTrue(s.indexOf(String.valueOf(i)) >= 0);
-        }
-    }
-
-    /**
-     * A deserialized serialized queue has same elements
-     */
-    public void testSerialization() throws Exception {
-        PriorityQueue q = populatedQueue(SIZE);
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        PriorityQueue r = (PriorityQueue)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.remove(), r.remove());
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ReentrantLockTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ReentrantLockTest.java
deleted file mode 100755
index d6b434e..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ReentrantLockTest.java
+++ /dev/null
@@ -1,911 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.locks.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.*;
-import java.io.*;
-
-public class ReentrantLockTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ReentrantLockTest.class);
-    }
-
-    /**
-     * A runnable calling lockInterruptibly
-     */
-    class InterruptibleLockRunnable extends CheckedRunnable {
-        final ReentrantLock lock;
-        InterruptibleLockRunnable(ReentrantLock l) { lock = l; }
-        public void realRun() throws InterruptedException {
-            lock.lockInterruptibly();
-        }
-    }
-
-
-    /**
-     * A runnable calling lockInterruptibly that expects to be
-     * interrupted
-     */
-    class InterruptedLockRunnable extends CheckedInterruptedRunnable {
-        final ReentrantLock lock;
-        InterruptedLockRunnable(ReentrantLock l) { lock = l; }
-        public void realRun() throws InterruptedException {
-            lock.lockInterruptibly();
-        }
-    }
-
-    /**
-     * Subclass to expose protected methods
-     */
-    static class PublicReentrantLock extends ReentrantLock {
-        PublicReentrantLock() { super(); }
-        public Collection<Thread> getQueuedThreads() {
-            return super.getQueuedThreads();
-        }
-        public Collection<Thread> getWaitingThreads(Condition c) {
-            return super.getWaitingThreads(c);
-        }
-    }
-
-    /**
-     * Constructor sets given fairness
-     */
-    public void testConstructor() {
-        assertFalse(new ReentrantLock().isFair());
-        assertFalse(new ReentrantLock(false).isFair());
-        assertTrue(new ReentrantLock(true).isFair());
-    }
-
-    /**
-     * locking an unlocked lock succeeds
-     */
-    public void testLock() {
-        ReentrantLock rl = new ReentrantLock();
-        rl.lock();
-        assertTrue(rl.isLocked());
-        rl.unlock();
-        assertFalse(rl.isLocked());
-    }
-
-    /**
-     * locking an unlocked fair lock succeeds
-     */
-    public void testFairLock() {
-        ReentrantLock rl = new ReentrantLock(true);
-        rl.lock();
-        assertTrue(rl.isLocked());
-        rl.unlock();
-    }
-
-    /**
-     * Unlocking an unlocked lock throws IllegalMonitorStateException
-     */
-    public void testUnlock_IllegalMonitorStateException() {
-        ReentrantLock rl = new ReentrantLock();
-        try {
-            rl.unlock();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * tryLock on an unlocked lock succeeds
-     */
-    public void testTryLock() {
-        ReentrantLock rl = new ReentrantLock();
-        assertTrue(rl.tryLock());
-        assertTrue(rl.isLocked());
-        rl.unlock();
-    }
-
-
-    /**
-     * hasQueuedThreads reports whether there are waiting threads
-     */
-    public void testhasQueuedThreads() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertFalse(lock.hasQueuedThreads());
-        lock.lock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        lock.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(lock.hasQueuedThreads());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getQueueLength reports number of waiting threads
-     */
-    public void testGetQueueLength() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertEquals(0, lock.getQueueLength());
-        lock.lock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, lock.getQueueLength());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        lock.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(0, lock.getQueueLength());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getQueueLength reports number of waiting threads
-     */
-    public void testGetQueueLength_fair() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock(true);
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertEquals(0, lock.getQueueLength());
-        lock.lock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, lock.getQueueLength());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        lock.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(0, lock.getQueueLength());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * hasQueuedThread(null) throws NPE
-     */
-    public void testHasQueuedThreadNPE() {
-        final ReentrantLock sync = new ReentrantLock();
-        try {
-            sync.hasQueuedThread(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * hasQueuedThread reports whether a thread is queued.
-     */
-    public void testHasQueuedThread() throws InterruptedException {
-        final ReentrantLock sync = new ReentrantLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(sync));
-        assertFalse(sync.hasQueuedThread(t1));
-        assertFalse(sync.hasQueuedThread(t2));
-        sync.lock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThread(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThread(t1));
-        assertTrue(sync.hasQueuedThread(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThread(t1));
-        assertTrue(sync.hasQueuedThread(t2));
-        sync.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThread(t1));
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThread(t2));
-        t1.join();
-        t2.join();
-    }
-
-
-    /**
-     * getQueuedThreads includes waiting threads
-     */
-    public void testGetQueuedThreads() throws InterruptedException {
-        final PublicReentrantLock lock = new PublicReentrantLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        lock.lock();
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().contains(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().contains(t1));
-        assertTrue(lock.getQueuedThreads().contains(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(lock.getQueuedThreads().contains(t1));
-        assertTrue(lock.getQueuedThreads().contains(t2));
-        lock.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-
-    /**
-     * timed tryLock is interruptible.
-     */
-    public void testInterruptedException2() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        lock.lock();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.tryLock(MEDIUM_DELAY_MS,MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * TryLock on a locked lock fails
-     */
-    public void testTryLockWhenLocked() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        lock.lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertFalse(lock.tryLock());
-            }});
-
-        t.start();
-        t.join();
-        lock.unlock();
-    }
-
-    /**
-     * Timed tryLock on a locked lock times out
-     */
-    public void testTryLock_Timeout() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        lock.lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertFalse(lock.tryLock(1, MILLISECONDS));
-            }});
-
-        t.start();
-        t.join();
-        lock.unlock();
-    }
-
-    /**
-     * getHoldCount returns number of recursive holds
-     */
-    public void testGetHoldCount() {
-        ReentrantLock lock = new ReentrantLock();
-        for (int i = 1; i <= SIZE; i++) {
-            lock.lock();
-            assertEquals(i, lock.getHoldCount());
-        }
-        for (int i = SIZE; i > 0; i--) {
-            lock.unlock();
-            assertEquals(i-1, lock.getHoldCount());
-        }
-    }
-
-
-    /**
-     * isLocked is true when locked and false when not
-     */
-    public void testIsLocked() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        lock.lock();
-        assertTrue(lock.isLocked());
-        lock.unlock();
-        assertFalse(lock.isLocked());
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                Thread.sleep(SMALL_DELAY_MS);
-                lock.unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.isLocked());
-        t.join();
-        assertFalse(lock.isLocked());
-    }
-
-
-    /**
-     * lockInterruptibly is interruptible.
-     */
-    public void testLockInterruptibly1() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        lock.lock();
-        Thread t = new Thread(new InterruptedLockRunnable(lock));
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.unlock();
-        t.join();
-    }
-
-    /**
-     * lockInterruptibly succeeds when unlocked, else is interruptible
-     */
-    public void testLockInterruptibly2() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        lock.lockInterruptibly();
-        Thread t = new Thread(new InterruptedLockRunnable(lock));
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        assertTrue(lock.isLocked());
-        assertTrue(lock.isHeldByCurrentThread());
-        t.join();
-    }
-
-    /**
-     * Calling await without holding lock throws IllegalMonitorStateException
-     */
-    public void testAwait_IllegalMonitor() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        try {
-            c.await();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * Calling signal without holding lock throws IllegalMonitorStateException
-     */
-    public void testSignal_IllegalMonitor() {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        try {
-            c.signal();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * awaitNanos without a signal times out
-     */
-    public void testAwaitNanos_Timeout() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        lock.lock();
-        long t = c.awaitNanos(100);
-        assertTrue(t <= 0);
-        lock.unlock();
-    }
-
-    /**
-     *  timed await without a signal times out
-     */
-    public void testAwait_Timeout() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        lock.lock();
-        assertFalse(c.await(SHORT_DELAY_MS, MILLISECONDS));
-        lock.unlock();
-    }
-
-    /**
-     * awaitUntil without a signal times out
-     */
-    public void testAwaitUntil_Timeout() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        lock.lock();
-        java.util.Date d = new java.util.Date();
-        assertFalse(c.awaitUntil(new java.util.Date(d.getTime() + 10)));
-        lock.unlock();
-    }
-
-    /**
-     * await returns when signalled
-     */
-    public void testAwait() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                c.await();
-                lock.unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        c.signal();
-        lock.unlock();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * hasWaiters throws NPE if null
-     */
-    public void testHasWaitersNPE() {
-        final ReentrantLock lock = new ReentrantLock();
-        try {
-            lock.hasWaiters(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws NPE if null
-     */
-    public void testGetWaitQueueLengthNPE() {
-        final ReentrantLock lock = new ReentrantLock();
-        try {
-            lock.getWaitQueueLength(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws NPE if null
-     */
-    public void testGetWaitingThreadsNPE() {
-        final PublicReentrantLock lock = new PublicReentrantLock();
-        try {
-            lock.getWaitingThreads(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * hasWaiters throws IAE if not owned
-     */
-    public void testHasWaitersIAE() {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        final ReentrantLock lock2 = new ReentrantLock();
-        try {
-            lock2.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * hasWaiters throws IMSE if not locked
-     */
-    public void testHasWaitersIMSE() {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        try {
-            lock.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitQueueLength throws IAE if not owned
-     */
-    public void testGetWaitQueueLengthIAE() {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        final ReentrantLock lock2 = new ReentrantLock();
-        try {
-            lock2.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws IMSE if not locked
-     */
-    public void testGetWaitQueueLengthIMSE() {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        try {
-            lock.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws IAE if not owned
-     */
-    public void testGetWaitingThreadsIAE() {
-        final PublicReentrantLock lock = new PublicReentrantLock();
-        final Condition c = lock.newCondition();
-        final PublicReentrantLock lock2 = new PublicReentrantLock();
-        try {
-            lock2.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitingThreads throws IMSE if not locked
-     */
-    public void testGetWaitingThreadsIMSE() {
-        final PublicReentrantLock lock = new PublicReentrantLock();
-        final Condition c = lock.newCondition();
-        try {
-            lock.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * hasWaiters returns true when a thread is waiting, else false
-     */
-    public void testHasWaiters() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                threadAssertFalse(lock.hasWaiters(c));
-                threadAssertEquals(0, lock.getWaitQueueLength(c));
-                c.await();
-                lock.unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        assertTrue(lock.hasWaiters(c));
-        assertEquals(1, lock.getWaitQueueLength(c));
-        c.signal();
-        lock.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        assertFalse(lock.hasWaiters(c));
-        assertEquals(0, lock.getWaitQueueLength(c));
-        lock.unlock();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * getWaitQueueLength returns number of waiting threads
-     */
-    public void testGetWaitQueueLength() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                threadAssertFalse(lock.hasWaiters(c));
-                threadAssertEquals(0, lock.getWaitQueueLength(c));
-                c.await();
-                lock.unlock();
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                threadAssertTrue(lock.hasWaiters(c));
-                threadAssertEquals(1, lock.getWaitQueueLength(c));
-                c.await();
-                lock.unlock();
-            }});
-
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        assertTrue(lock.hasWaiters(c));
-        assertEquals(2, lock.getWaitQueueLength(c));
-        c.signalAll();
-        lock.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        assertFalse(lock.hasWaiters(c));
-        assertEquals(0, lock.getWaitQueueLength(c));
-        lock.unlock();
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /**
-     * getWaitingThreads returns only and all waiting threads
-     */
-    public void testGetWaitingThreads() throws InterruptedException {
-        final PublicReentrantLock lock = new PublicReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                threadAssertTrue(lock.getWaitingThreads(c).isEmpty());
-                c.await();
-                lock.unlock();
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                threadAssertFalse(lock.getWaitingThreads(c).isEmpty());
-                c.await();
-                lock.unlock();
-            }});
-
-        lock.lock();
-        assertTrue(lock.getWaitingThreads(c).isEmpty());
-        lock.unlock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        assertTrue(lock.hasWaiters(c));
-        assertTrue(lock.getWaitingThreads(c).contains(t1));
-        assertTrue(lock.getWaitingThreads(c).contains(t2));
-        c.signalAll();
-        lock.unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        assertFalse(lock.hasWaiters(c));
-        assertTrue(lock.getWaitingThreads(c).isEmpty());
-        lock.unlock();
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /** A helper class for uninterruptible wait tests */
-    class UninterruptibleThread extends Thread {
-        private ReentrantLock lock;
-        private Condition c;
-
-        public volatile boolean canAwake = false;
-        public volatile boolean interrupted = false;
-        public volatile boolean lockStarted = false;
-
-        public UninterruptibleThread(ReentrantLock lock, Condition c) {
-            this.lock = lock;
-            this.c = c;
-        }
-
-        public synchronized void run() {
-            lock.lock();
-            lockStarted = true;
-
-            while (!canAwake) {
-                c.awaitUninterruptibly();
-            }
-
-            interrupted = isInterrupted();
-            lock.unlock();
-        }
-    }
-
-    /**
-     * awaitUninterruptibly doesn't abort on interrupt
-     */
-    public void testAwaitUninterruptibly() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        UninterruptibleThread thread = new UninterruptibleThread(lock, c);
-
-        thread.start();
-
-        while (!thread.lockStarted) {
-            Thread.sleep(100);
-        }
-
-        lock.lock();
-        try {
-            thread.interrupt();
-            thread.canAwake = true;
-            c.signal();
-        } finally {
-            lock.unlock();
-        }
-
-        thread.join();
-        assertTrue(thread.interrupted);
-        assertFalse(thread.isAlive());
-    }
-
-    /**
-     * await is interruptible
-     */
-    public void testAwait_Interrupt() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                c.await();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitNanos is interruptible
-     */
-    public void testAwaitNanos_Interrupt() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                c.awaitNanos(MILLISECONDS.toNanos(LONG_DELAY_MS));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitUntil is interruptible
-     */
-    public void testAwaitUntil_Interrupt() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                java.util.Date d = new java.util.Date();
-                c.awaitUntil(new java.util.Date(d.getTime() + 10000));
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * signalAll wakes up all threads
-     */
-    public void testSignalAll() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                c.await();
-                lock.unlock();
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                c.await();
-                lock.unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        c.signalAll();
-        lock.unlock();
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /**
-     * await after multiple reentrant locking preserves lock count
-     */
-    public void testAwaitLockCount() throws InterruptedException {
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition c = lock.newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                threadAssertEquals(1, lock.getHoldCount());
-                c.await();
-                threadAssertEquals(1, lock.getHoldCount());
-                lock.unlock();
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.lock();
-                lock.lock();
-                threadAssertEquals(2, lock.getHoldCount());
-                c.await();
-                threadAssertEquals(2, lock.getHoldCount());
-                lock.unlock();
-                lock.unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.lock();
-        c.signalAll();
-        lock.unlock();
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /**
-     * A serialized lock deserializes as unlocked
-     */
-    public void testSerialization() throws Exception {
-        ReentrantLock l = new ReentrantLock();
-        l.lock();
-        l.unlock();
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out =
-            new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin =
-            new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in =
-            new ObjectInputStream(new BufferedInputStream(bin));
-        ReentrantLock r = (ReentrantLock) in.readObject();
-        r.lock();
-        r.unlock();
-    }
-
-    /**
-     * toString indicates current lock state
-     */
-    public void testToString() {
-        ReentrantLock lock = new ReentrantLock();
-        String us = lock.toString();
-        assertTrue(us.indexOf("Unlocked") >= 0);
-        lock.lock();
-        String ls = lock.toString();
-        assertTrue(ls.indexOf("Locked") >= 0);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ReentrantReadWriteLockTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ReentrantReadWriteLockTest.java
deleted file mode 100644
index eb20255..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ReentrantReadWriteLockTest.java
+++ /dev/null
@@ -1,1371 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.locks.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-import java.util.*;
-
-public class ReentrantReadWriteLockTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ReentrantReadWriteLockTest.class);
-    }
-
-    /**
-     * A runnable calling lockInterruptibly
-     */
-    class InterruptibleLockRunnable extends CheckedRunnable {
-        final ReentrantReadWriteLock lock;
-        InterruptibleLockRunnable(ReentrantReadWriteLock l) { lock = l; }
-        public void realRun() throws InterruptedException {
-            lock.writeLock().lockInterruptibly();
-        }
-    }
-
-
-    /**
-     * A runnable calling lockInterruptibly that expects to be
-     * interrupted
-     */
-    class InterruptedLockRunnable extends CheckedInterruptedRunnable {
-        final ReentrantReadWriteLock lock;
-        InterruptedLockRunnable(ReentrantReadWriteLock l) { lock = l; }
-        public void realRun() throws InterruptedException {
-            lock.writeLock().lockInterruptibly();
-        }
-    }
-
-    /**
-     * Subclass to expose protected methods
-     */
-    static class PublicReentrantReadWriteLock extends ReentrantReadWriteLock {
-        PublicReentrantReadWriteLock() { super(); }
-        public Collection<Thread> getQueuedThreads() {
-            return super.getQueuedThreads();
-        }
-        public Collection<Thread> getWaitingThreads(Condition c) {
-            return super.getWaitingThreads(c);
-        }
-    }
-
-    /**
-     * Constructor sets given fairness, and is in unlocked state
-     */
-    public void testConstructor() {
-        ReentrantReadWriteLock rl = new ReentrantReadWriteLock();
-        assertFalse(rl.isFair());
-        assertFalse(rl.isWriteLocked());
-        assertEquals(0, rl.getReadLockCount());
-        ReentrantReadWriteLock r2 = new ReentrantReadWriteLock(true);
-        assertTrue(r2.isFair());
-        assertFalse(r2.isWriteLocked());
-        assertEquals(0, r2.getReadLockCount());
-        ReentrantReadWriteLock r3 = new ReentrantReadWriteLock(false);
-        assertFalse(r3.isFair());
-        assertFalse(r3.isWriteLocked());
-        assertEquals(0, r3.getReadLockCount());
-    }
-
-    /**
-     * write-locking and read-locking an unlocked lock succeed
-     */
-    public void testLock() {
-        ReentrantReadWriteLock rl = new ReentrantReadWriteLock();
-        rl.writeLock().lock();
-        assertTrue(rl.isWriteLocked());
-        assertTrue(rl.isWriteLockedByCurrentThread());
-        assertTrue(rl.writeLock().isHeldByCurrentThread());
-        assertEquals(0, rl.getReadLockCount());
-        rl.writeLock().unlock();
-        assertFalse(rl.isWriteLocked());
-        assertFalse(rl.isWriteLockedByCurrentThread());
-        assertFalse(rl.writeLock().isHeldByCurrentThread());
-        assertEquals(0, rl.getReadLockCount());
-        rl.readLock().lock();
-        assertFalse(rl.isWriteLocked());
-        assertFalse(rl.isWriteLockedByCurrentThread());
-        assertEquals(1, rl.getReadLockCount());
-        rl.readLock().unlock();
-        assertFalse(rl.isWriteLocked());
-        assertFalse(rl.isWriteLockedByCurrentThread());
-        assertEquals(0, rl.getReadLockCount());
-    }
-
-
-    /**
-     * locking an unlocked fair lock succeeds
-     */
-    public void testFairLock() {
-        ReentrantReadWriteLock rl = new ReentrantReadWriteLock(true);
-        rl.writeLock().lock();
-        assertTrue(rl.isWriteLocked());
-        assertTrue(rl.isWriteLockedByCurrentThread());
-        assertTrue(rl.writeLock().isHeldByCurrentThread());
-        assertEquals(0, rl.getReadLockCount());
-        rl.writeLock().unlock();
-        assertFalse(rl.isWriteLocked());
-        assertFalse(rl.isWriteLockedByCurrentThread());
-        assertFalse(rl.writeLock().isHeldByCurrentThread());
-        assertEquals(0, rl.getReadLockCount());
-        rl.readLock().lock();
-        assertFalse(rl.isWriteLocked());
-        assertFalse(rl.isWriteLockedByCurrentThread());
-        assertEquals(1, rl.getReadLockCount());
-        rl.readLock().unlock();
-        assertFalse(rl.isWriteLocked());
-        assertFalse(rl.isWriteLockedByCurrentThread());
-        assertEquals(0, rl.getReadLockCount());
-    }
-
-    /**
-     * getWriteHoldCount returns number of recursive holds
-     */
-    public void testGetWriteHoldCount() {
-        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        for (int i = 1; i <= SIZE; i++) {
-            lock.writeLock().lock();
-            assertEquals(i,lock.getWriteHoldCount());
-        }
-        for (int i = SIZE; i > 0; i--) {
-            lock.writeLock().unlock();
-            assertEquals(i-1,lock.getWriteHoldCount());
-        }
-    }
-
-    /**
-     * WriteLock.getHoldCount returns number of recursive holds
-     */
-    public void testGetHoldCount() {
-        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        for (int i = 1; i <= SIZE; i++) {
-            lock.writeLock().lock();
-            assertEquals(i,lock.writeLock().getHoldCount());
-        }
-        for (int i = SIZE; i > 0; i--) {
-            lock.writeLock().unlock();
-            assertEquals(i-1,lock.writeLock().getHoldCount());
-        }
-    }
-
-    /**
-     * getReadHoldCount returns number of recursive holds
-     */
-    public void testGetReadHoldCount() {
-        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        for (int i = 1; i <= SIZE; i++) {
-            lock.readLock().lock();
-            assertEquals(i,lock.getReadHoldCount());
-        }
-        for (int i = SIZE; i > 0; i--) {
-            lock.readLock().unlock();
-            assertEquals(i-1,lock.getReadHoldCount());
-        }
-    }
-
-
-    /**
-     * write-unlocking an unlocked lock throws IllegalMonitorStateException
-     */
-    public void testUnlock_IllegalMonitorStateException() {
-        ReentrantReadWriteLock rl = new ReentrantReadWriteLock();
-        try {
-            rl.writeLock().unlock();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * write-lockInterruptibly is interruptible
-     */
-    public void testWriteLockInterruptibly_Interrupted() throws Exception {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lockInterruptibly();
-                lock.writeLock().unlock();
-                lock.writeLock().lockInterruptibly();
-                lock.writeLock().unlock();
-            }});
-
-        lock.writeLock().lock();
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().unlock();
-        t.join();
-    }
-
-    /**
-     * timed write-tryLock is interruptible
-     */
-    public void testWriteTryLock_Interrupted() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().tryLock(SMALL_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        lock.writeLock().unlock();
-        t.join();
-    }
-
-    /**
-     * read-lockInterruptibly is interruptible
-     */
-    public void testReadLockInterruptibly_Interrupted() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.readLock().lockInterruptibly();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().unlock();
-        t.join();
-    }
-
-    /**
-     * timed read-tryLock is interruptible
-     */
-    public void testReadTryLock_Interrupted() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.readLock().tryLock(LONG_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * write-tryLock fails if locked
-     */
-    public void testWriteTryLockWhenLocked() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertFalse(lock.writeLock().tryLock());
-            }});
-
-        t.start();
-        t.join();
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * read-tryLock fails if locked
-     */
-    public void testReadTryLockWhenLocked() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertFalse(lock.readLock().tryLock());
-            }});
-
-        t.start();
-        t.join();
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * Multiple threads can hold a read lock when not write-locked
-     */
-    public void testMultipleReadLocks() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.readLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertTrue(lock.readLock().tryLock());
-                lock.readLock().unlock();
-            }});
-
-        t.start();
-        t.join();
-        lock.readLock().unlock();
-    }
-
-    /**
-     * A writelock succeeds after reading threads unlock
-     */
-    public void testWriteAfterMultipleReadLocks() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.readLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.readLock().lock();
-                lock.readLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.readLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-    /**
-     * Readlocks succeed after a writing thread unlocks
-     */
-    public void testReadAfterWriteLock() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.readLock().lock();
-                lock.readLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.readLock().lock();
-                lock.readLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-    /**
-     * Read trylock succeeds if write locked by current thread
-     */
-    public void testReadHoldingWriteLock() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        assertTrue(lock.readLock().tryLock());
-        lock.readLock().unlock();
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * Read lock succeeds if write locked by current thread even if
-     * other threads are waiting for readlock
-     */
-    public void testReadHoldingWriteLock2() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.readLock().lock();
-                lock.readLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.readLock().lock();
-                lock.readLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        lock.writeLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-    /**
-     *  Read lock succeeds if write locked by current thread even if
-     * other threads are waiting for writelock
-     */
-    public void testReadHoldingWriteLock3() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        lock.writeLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-
-    /**
-     *  Write lock succeeds if write locked by current thread even if
-     * other threads are waiting for writelock
-     */
-    public void testWriteHoldingWriteLock4() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        lock.writeLock().lock();
-        lock.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        lock.writeLock().unlock();
-        lock.writeLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-
-    /**
-     * Fair Read trylock succeeds if write locked by current thread
-     */
-    public void testReadHoldingWriteLockFair() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
-        lock.writeLock().lock();
-        assertTrue(lock.readLock().tryLock());
-        lock.readLock().unlock();
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * Fair Read lock succeeds if write locked by current thread even if
-     * other threads are waiting for readlock
-     */
-    public void testReadHoldingWriteLockFair2() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
-        lock.writeLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.readLock().lock();
-                lock.readLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.readLock().lock();
-                lock.readLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        lock.writeLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-
-    /**
-     * Fair Read lock succeeds if write locked by current thread even if
-     * other threads are waiting for writelock
-     */
-    public void testReadHoldingWriteLockFair3() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
-        lock.writeLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.readLock().lock();
-        lock.readLock().unlock();
-        lock.writeLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-
-    /**
-     * Fair Write lock succeeds if write locked by current thread even if
-     * other threads are waiting for writelock
-     */
-    public void testWriteHoldingWriteLockFair4() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
-        lock.writeLock().lock();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                lock.writeLock().lock();
-                lock.writeLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.isWriteLockedByCurrentThread());
-        assertTrue(lock.getWriteHoldCount() == 1);
-        lock.writeLock().lock();
-        assertTrue(lock.getWriteHoldCount() == 2);
-        lock.writeLock().unlock();
-        lock.writeLock().lock();
-        lock.writeLock().unlock();
-        lock.writeLock().unlock();
-        t1.join(MEDIUM_DELAY_MS);
-        t2.join(MEDIUM_DELAY_MS);
-        assertTrue(!t1.isAlive());
-        assertTrue(!t2.isAlive());
-    }
-
-
-    /**
-     * Read tryLock succeeds if readlocked but not writelocked
-     */
-    public void testTryLockWhenReadLocked() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.readLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertTrue(lock.readLock().tryLock());
-                lock.readLock().unlock();
-            }});
-
-        t.start();
-        t.join();
-        lock.readLock().unlock();
-    }
-
-
-
-    /**
-     * write tryLock fails when readlocked
-     */
-    public void testWriteTryLockWhenReadLocked() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.readLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertFalse(lock.writeLock().tryLock());
-            }});
-
-        t.start();
-        t.join();
-        lock.readLock().unlock();
-    }
-
-
-    /**
-     * Fair Read tryLock succeeds if readlocked but not writelocked
-     */
-    public void testTryLockWhenReadLockedFair() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
-        lock.readLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertTrue(lock.readLock().tryLock());
-                lock.readLock().unlock();
-            }});
-
-        t.start();
-        t.join();
-        lock.readLock().unlock();
-    }
-
-
-
-    /**
-     * Fair write tryLock fails when readlocked
-     */
-    public void testWriteTryLockWhenReadLockedFair() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock(true);
-        lock.readLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() {
-                threadAssertFalse(lock.writeLock().tryLock());
-            }});
-
-        t.start();
-        t.join();
-        lock.readLock().unlock();
-    }
-
-
-
-    /**
-     * write timed tryLock times out if locked
-     */
-    public void testWriteTryLock_Timeout() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertFalse(lock.writeLock().tryLock(1, MILLISECONDS));
-            }});
-
-        t.start();
-        t.join();
-        assertTrue(lock.writeLock().isHeldByCurrentThread());
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * read timed tryLock times out if write-locked
-     */
-    public void testReadTryLock_Timeout() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lock();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                threadAssertFalse(lock.readLock().tryLock(1, MILLISECONDS));
-            }});
-
-        t.start();
-        t.join();
-        assertTrue(lock.writeLock().isHeldByCurrentThread());
-        lock.writeLock().unlock();
-    }
-
-
-    /**
-     * write lockInterruptibly succeeds if lock free else is interruptible
-     */
-    public void testWriteLockInterruptibly() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lockInterruptibly();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lockInterruptibly();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.join();
-        lock.writeLock().unlock();
-    }
-
-    /**
-     *  read lockInterruptibly succeeds if lock free else is interruptible
-     */
-    public void testReadLockInterruptibly() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        lock.writeLock().lockInterruptibly();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.readLock().lockInterruptibly();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * Calling await without holding lock throws IllegalMonitorStateException
-     */
-    public void testAwait_IllegalMonitor() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        try {
-            c.await();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * Calling signal without holding lock throws IllegalMonitorStateException
-     */
-    public void testSignal_IllegalMonitor() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        try {
-            c.signal();
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-    /**
-     * awaitNanos without a signal times out
-     */
-    public void testAwaitNanos_Timeout() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-
-        lock.writeLock().lock();
-        long t = c.awaitNanos(100);
-        assertTrue(t <= 0);
-        lock.writeLock().unlock();
-    }
-
-
-    /**
-     *  timed await without a signal times out
-     */
-    public void testAwait_Timeout() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        lock.writeLock().lock();
-        assertFalse(c.await(SHORT_DELAY_MS, MILLISECONDS));
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * awaitUntil without a signal times out
-     */
-    public void testAwaitUntil_Timeout() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        lock.writeLock().lock();
-        java.util.Date d = new java.util.Date();
-        assertFalse(c.awaitUntil(new java.util.Date(d.getTime() + 10)));
-        lock.writeLock().unlock();
-    }
-
-    /**
-     * await returns when signalled
-     */
-    public void testAwait() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        c.signal();
-        lock.writeLock().unlock();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /** A helper class for uninterruptible wait tests */
-    class UninterruptableThread extends Thread {
-        private Lock lock;
-        private Condition c;
-
-        public volatile boolean canAwake = false;
-        public volatile boolean interrupted = false;
-        public volatile boolean lockStarted = false;
-
-        public UninterruptableThread(Lock lock, Condition c) {
-            this.lock = lock;
-            this.c = c;
-        }
-
-        public synchronized void run() {
-            lock.lock();
-            lockStarted = true;
-
-            while (!canAwake) {
-                c.awaitUninterruptibly();
-            }
-
-            interrupted = isInterrupted();
-            lock.unlock();
-        }
-    }
-
-    /**
-     * awaitUninterruptibly doesn't abort on interrupt
-     */
-    public void testAwaitUninterruptibly() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        UninterruptableThread thread = new UninterruptableThread(lock.writeLock(), c);
-
-        thread.start();
-
-        while (!thread.lockStarted) {
-            Thread.sleep(100);
-        }
-
-        lock.writeLock().lock();
-        try {
-            thread.interrupt();
-            thread.canAwake = true;
-            c.signal();
-        } finally {
-            lock.writeLock().unlock();
-        }
-
-        thread.join();
-        assertTrue(thread.interrupted);
-        assertFalse(thread.isAlive());
-    }
-
-    /**
-     * await is interruptible
-     */
-    public void testAwait_Interrupt() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitNanos is interruptible
-     */
-    public void testAwaitNanos_Interrupt() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                c.awaitNanos(MILLISECONDS.toNanos(LONG_DELAY_MS));
-                lock.writeLock().unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * awaitUntil is interruptible
-     */
-    public void testAwaitUntil_Interrupt() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                java.util.Date d = new java.util.Date();
-                c.awaitUntil(new java.util.Date(d.getTime() + 10000));
-                lock.writeLock().unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * signalAll wakes up all threads
-     */
-    public void testSignalAll() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        t1.start();
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        c.signalAll();
-        lock.writeLock().unlock();
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /**
-     * A serialized lock deserializes as unlocked
-     */
-    public void testSerialization() throws Exception {
-        ReentrantReadWriteLock l = new ReentrantReadWriteLock();
-        l.readLock().lock();
-        l.readLock().unlock();
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        ReentrantReadWriteLock r = (ReentrantReadWriteLock) in.readObject();
-        r.readLock().lock();
-        r.readLock().unlock();
-    }
-
-    /**
-     * hasQueuedThreads reports whether there are waiting threads
-     */
-    public void testhasQueuedThreads() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertFalse(lock.hasQueuedThreads());
-        lock.writeLock().lock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        lock.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(lock.hasQueuedThreads());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * hasQueuedThread(null) throws NPE
-     */
-    public void testHasQueuedThreadNPE() {
-        final ReentrantReadWriteLock sync = new ReentrantReadWriteLock();
-        try {
-            sync.hasQueuedThread(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * hasQueuedThread reports whether a thread is queued.
-     */
-    public void testHasQueuedThread() throws InterruptedException {
-        final ReentrantReadWriteLock sync = new ReentrantReadWriteLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(sync));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(sync));
-        assertFalse(sync.hasQueuedThread(t1));
-        assertFalse(sync.hasQueuedThread(t2));
-        sync.writeLock().lock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThread(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(sync.hasQueuedThread(t1));
-        assertTrue(sync.hasQueuedThread(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThread(t1));
-        assertTrue(sync.hasQueuedThread(t2));
-        sync.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThread(t1));
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(sync.hasQueuedThread(t2));
-        t1.join();
-        t2.join();
-    }
-
-
-    /**
-     * getQueueLength reports number of waiting threads
-     */
-    public void testGetQueueLength() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertEquals(0, lock.getQueueLength());
-        lock.writeLock().lock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, lock.getQueueLength());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        lock.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(0, lock.getQueueLength());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getQueuedThreads includes waiting threads
-     */
-    public void testGetQueuedThreads() throws InterruptedException {
-        final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock();
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        lock.writeLock().lock();
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().contains(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().contains(t1));
-        assertTrue(lock.getQueuedThreads().contains(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(lock.getQueuedThreads().contains(t1));
-        assertTrue(lock.getQueuedThreads().contains(t2));
-        lock.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * hasWaiters throws NPE if null
-     */
-    public void testHasWaitersNPE() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        try {
-            lock.hasWaiters(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws NPE if null
-     */
-    public void testGetWaitQueueLengthNPE() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        try {
-            lock.getWaitQueueLength(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws NPE if null
-     */
-    public void testGetWaitingThreadsNPE() {
-        final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock();
-        try {
-            lock.getWaitingThreads(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * hasWaiters throws IAE if not owned
-     */
-    public void testHasWaitersIAE() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        final ReentrantReadWriteLock lock2 = new ReentrantReadWriteLock();
-        try {
-            lock2.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * hasWaiters throws IMSE if not locked
-     */
-    public void testHasWaitersIMSE() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        try {
-            lock.hasWaiters(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitQueueLength throws IAE if not owned
-     */
-    public void testGetWaitQueueLengthIAE() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        final ReentrantReadWriteLock lock2 = new ReentrantReadWriteLock();
-        try {
-            lock2.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitQueueLength throws IMSE if not locked
-     */
-    public void testGetWaitQueueLengthIMSE() {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        try {
-            lock.getWaitQueueLength(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * getWaitingThreads throws IAE if not owned
-     */
-    public void testGetWaitingThreadsIAE() {
-        final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        final PublicReentrantReadWriteLock lock2 = new PublicReentrantReadWriteLock();
-        try {
-            lock2.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * getWaitingThreads throws IMSE if not locked
-     */
-    public void testGetWaitingThreadsIMSE() {
-        final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        try {
-            lock.getWaitingThreads(c);
-            shouldThrow();
-        } catch (IllegalMonitorStateException success) {}
-    }
-
-
-    /**
-     * hasWaiters returns true when a thread is waiting, else false
-     */
-    public void testHasWaiters() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                threadAssertFalse(lock.hasWaiters(c));
-                threadAssertEquals(0, lock.getWaitQueueLength(c));
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        assertTrue(lock.hasWaiters(c));
-        assertEquals(1, lock.getWaitQueueLength(c));
-        c.signal();
-        lock.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        assertFalse(lock.hasWaiters(c));
-        assertEquals(0, lock.getWaitQueueLength(c));
-        lock.writeLock().unlock();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-    /**
-     * getWaitQueueLength returns number of waiting threads
-     */
-    public void testGetWaitQueueLength() throws InterruptedException {
-        final ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                threadAssertFalse(lock.hasWaiters(c));
-                threadAssertEquals(0, lock.getWaitQueueLength(c));
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        assertTrue(lock.hasWaiters(c));
-        assertEquals(1, lock.getWaitQueueLength(c));
-        c.signal();
-        lock.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        assertFalse(lock.hasWaiters(c));
-        assertEquals(0, lock.getWaitQueueLength(c));
-        lock.writeLock().unlock();
-        t.join(SHORT_DELAY_MS);
-        assertFalse(t.isAlive());
-    }
-
-
-    /**
-     * getWaitingThreads returns only and all waiting threads
-     */
-    public void testGetWaitingThreads() throws InterruptedException {
-        final PublicReentrantReadWriteLock lock = new PublicReentrantReadWriteLock();
-        final Condition c = lock.writeLock().newCondition();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                threadAssertTrue(lock.getWaitingThreads(c).isEmpty());
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                lock.writeLock().lock();
-                threadAssertFalse(lock.getWaitingThreads(c).isEmpty());
-                c.await();
-                lock.writeLock().unlock();
-            }});
-
-        lock.writeLock().lock();
-        assertTrue(lock.getWaitingThreads(c).isEmpty());
-        lock.writeLock().unlock();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        assertTrue(lock.hasWaiters(c));
-        assertTrue(lock.getWaitingThreads(c).contains(t1));
-        assertTrue(lock.getWaitingThreads(c).contains(t2));
-        c.signalAll();
-        lock.writeLock().unlock();
-        Thread.sleep(SHORT_DELAY_MS);
-        lock.writeLock().lock();
-        assertFalse(lock.hasWaiters(c));
-        assertTrue(lock.getWaitingThreads(c).isEmpty());
-        lock.writeLock().unlock();
-        t1.join(SHORT_DELAY_MS);
-        t2.join(SHORT_DELAY_MS);
-        assertFalse(t1.isAlive());
-        assertFalse(t2.isAlive());
-    }
-
-    /**
-     * toString indicates current lock state
-     */
-    public void testToString() {
-        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        String us = lock.toString();
-        assertTrue(us.indexOf("Write locks = 0") >= 0);
-        assertTrue(us.indexOf("Read locks = 0") >= 0);
-        lock.writeLock().lock();
-        String ws = lock.toString();
-        assertTrue(ws.indexOf("Write locks = 1") >= 0);
-        assertTrue(ws.indexOf("Read locks = 0") >= 0);
-        lock.writeLock().unlock();
-        lock.readLock().lock();
-        lock.readLock().lock();
-        String rs = lock.toString();
-        assertTrue(rs.indexOf("Write locks = 0") >= 0);
-        assertTrue(rs.indexOf("Read locks = 2") >= 0);
-    }
-
-    /**
-     * readLock.toString indicates current lock state
-     */
-    public void testReadLockToString() {
-        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        String us = lock.readLock().toString();
-        assertTrue(us.indexOf("Read locks = 0") >= 0);
-        lock.readLock().lock();
-        lock.readLock().lock();
-        String rs = lock.readLock().toString();
-        assertTrue(rs.indexOf("Read locks = 2") >= 0);
-    }
-
-    /**
-     * writeLock.toString indicates current lock state
-     */
-    public void testWriteLockToString() {
-        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
-        String us = lock.writeLock().toString();
-        assertTrue(us.indexOf("Unlocked") >= 0);
-        lock.writeLock().lock();
-        String ls = lock.writeLock().toString();
-        assertTrue(ls.indexOf("Locked") >= 0);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ScheduledExecutorSubclassTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ScheduledExecutorSubclassTest.java
deleted file mode 100644
index 21f4ced..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ScheduledExecutorSubclassTest.java
+++ /dev/null
@@ -1,1060 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.atomic.*;
-
-public class ScheduledExecutorSubclassTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ScheduledExecutorSubclassTest.class);
-    }
-
-    static class CustomTask<V> implements RunnableScheduledFuture<V> {
-        RunnableScheduledFuture<V> task;
-        volatile boolean ran;
-        CustomTask(RunnableScheduledFuture<V> t) { task = t; }
-        public boolean isPeriodic() { return task.isPeriodic(); }
-        public void run() {
-            ran = true;
-            task.run();
-        }
-        public long getDelay(TimeUnit unit) { return task.getDelay(unit); }
-        public int compareTo(Delayed t) {
-            return task.compareTo(((CustomTask)t).task);
-        }
-        public boolean cancel(boolean mayInterruptIfRunning) {
-            return task.cancel(mayInterruptIfRunning);
-        }
-        public boolean isCancelled() { return task.isCancelled(); }
-        public boolean isDone() { return task.isDone(); }
-        public V get() throws InterruptedException,  ExecutionException {
-            V v = task.get();
-            assertTrue(ran);
-            return v;
-        }
-        public V get(long time, TimeUnit unit) throws InterruptedException,  ExecutionException, TimeoutException {
-            V v = task.get(time, unit);
-            assertTrue(ran);
-            return v;
-        }
-    }
-
-
-    public class CustomExecutor extends ScheduledThreadPoolExecutor {
-
-        protected <V> RunnableScheduledFuture<V> decorateTask(Runnable r, RunnableScheduledFuture<V> task) {
-            return new CustomTask<V>(task);
-        }
-
-        protected <V> RunnableScheduledFuture<V> decorateTask(Callable<V> c, RunnableScheduledFuture<V> task) {
-            return new CustomTask<V>(task);
-        }
-        CustomExecutor(int corePoolSize) { super(corePoolSize);}
-        CustomExecutor(int corePoolSize, RejectedExecutionHandler handler) {
-            super(corePoolSize, handler);
-        }
-
-        CustomExecutor(int corePoolSize, ThreadFactory threadFactory) {
-            super(corePoolSize, threadFactory);
-        }
-        CustomExecutor(int corePoolSize, ThreadFactory threadFactory,
-                       RejectedExecutionHandler handler) {
-            super(corePoolSize, threadFactory, handler);
-        }
-
-    }
-
-
-    /**
-     * execute successfully executes a runnable
-     */
-    public void testExecute() throws InterruptedException {
-        TrackedShortRunnable runnable =new TrackedShortRunnable();
-        CustomExecutor p1 = new CustomExecutor(1);
-        p1.execute(runnable);
-        assertFalse(runnable.done);
-        Thread.sleep(SHORT_DELAY_MS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p1);
-    }
-
-
-    /**
-     * delayed schedule of callable successfully executes after delay
-     */
-    public void testSchedule1() throws Exception {
-        TrackedCallable callable = new TrackedCallable();
-        CustomExecutor p1 = new CustomExecutor(1);
-        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(callable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(callable.done);
-        assertEquals(Boolean.TRUE, f.get());
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p1);
-    }
-
-    /**
-     *  delayed schedule of runnable successfully executes after delay
-     */
-    public void testSchedule3() throws InterruptedException {
-        TrackedShortRunnable runnable = new TrackedShortRunnable();
-        CustomExecutor p1 = new CustomExecutor(1);
-        p1.schedule(runnable, SMALL_DELAY_MS, MILLISECONDS);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(runnable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p1);
-    }
-
-    /**
-     * scheduleAtFixedRate executes runnable after given initial delay
-     */
-    public void testSchedule4() throws InterruptedException {
-        TrackedShortRunnable runnable = new TrackedShortRunnable();
-        CustomExecutor p1 = new CustomExecutor(1);
-        ScheduledFuture h = p1.scheduleAtFixedRate(runnable, SHORT_DELAY_MS, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(runnable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        h.cancel(true);
-        joinPool(p1);
-    }
-
-    static class RunnableCounter implements Runnable {
-        AtomicInteger count = new AtomicInteger(0);
-        public void run() { count.getAndIncrement(); }
-    }
-
-    /**
-     * scheduleWithFixedDelay executes runnable after given initial delay
-     */
-    public void testSchedule5() throws InterruptedException {
-        TrackedShortRunnable runnable = new TrackedShortRunnable();
-        CustomExecutor p1 = new CustomExecutor(1);
-        ScheduledFuture h = p1.scheduleWithFixedDelay(runnable, SHORT_DELAY_MS, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(runnable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        h.cancel(true);
-        joinPool(p1);
-    }
-
-    /**
-     * scheduleAtFixedRate executes series of tasks at given rate
-     */
-    public void testFixedRateSequence() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        RunnableCounter counter = new RunnableCounter();
-        ScheduledFuture h =
-            p1.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS);
-        Thread.sleep(SMALL_DELAY_MS);
-        h.cancel(true);
-        int c = counter.count.get();
-        // By time scaling conventions, we must have at least
-        // an execution per SHORT delay, but no more than one SHORT more
-        assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS);
-        assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS);
-        joinPool(p1);
-    }
-
-    /**
-     * scheduleWithFixedDelay executes series of tasks with given period
-     */
-    public void testFixedDelaySequence() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        RunnableCounter counter = new RunnableCounter();
-        ScheduledFuture h =
-            p1.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS);
-        Thread.sleep(SMALL_DELAY_MS);
-        h.cancel(true);
-        int c = counter.count.get();
-        assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS);
-        assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS);
-        joinPool(p1);
-    }
-
-
-    /**
-     *  execute (null) throws NPE
-     */
-    public void testExecuteNull() throws InterruptedException {
-        CustomExecutor se = new CustomExecutor(1);
-        try {
-            se.execute(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-        joinPool(se);
-    }
-
-    /**
-     * schedule (null) throws NPE
-     */
-    public void testScheduleNull() throws InterruptedException {
-        CustomExecutor se = new CustomExecutor(1);
-        try {
-            TrackedCallable callable = null;
-            Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-        joinPool(se);
-    }
-
-    /**
-     * execute throws RejectedExecutionException if shutdown
-     */
-    public void testSchedule1_RejectedExecutionException() {
-        CustomExecutor se = new CustomExecutor(1);
-        try {
-            se.shutdown();
-            se.schedule(new NoOpRunnable(),
-                        MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-
-        joinPool(se);
-    }
-
-    /**
-     * schedule throws RejectedExecutionException if shutdown
-     */
-    public void testSchedule2_RejectedExecutionException() {
-        CustomExecutor se = new CustomExecutor(1);
-        try {
-            se.shutdown();
-            se.schedule(new NoOpCallable(),
-                        MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-        joinPool(se);
-    }
-
-    /**
-     * schedule callable throws RejectedExecutionException if shutdown
-     */
-     public void testSchedule3_RejectedExecutionException() {
-         CustomExecutor se = new CustomExecutor(1);
-         try {
-             se.shutdown();
-             se.schedule(new NoOpCallable(),
-                         MEDIUM_DELAY_MS, MILLISECONDS);
-             shouldThrow();
-         } catch (RejectedExecutionException success) {
-         } catch (SecurityException ok) {
-         }
-         joinPool(se);
-    }
-
-    /**
-     *  scheduleAtFixedRate throws RejectedExecutionException if shutdown
-     */
-    public void testScheduleAtFixedRate1_RejectedExecutionException() {
-        CustomExecutor se = new CustomExecutor(1);
-        try {
-            se.shutdown();
-            se.scheduleAtFixedRate(new NoOpRunnable(),
-                                   MEDIUM_DELAY_MS, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-        joinPool(se);
-    }
-
-    /**
-     * scheduleWithFixedDelay throws RejectedExecutionException if shutdown
-     */
-    public void testScheduleWithFixedDelay1_RejectedExecutionException() {
-        CustomExecutor se = new CustomExecutor(1);
-        try {
-            se.shutdown();
-            se.scheduleWithFixedDelay(new NoOpRunnable(),
-                                      MEDIUM_DELAY_MS, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-        joinPool(se);
-    }
-
-    /**
-     *  getActiveCount increases but doesn't overestimate, when a
-     *  thread becomes active
-     */
-    public void testGetActiveCount() throws InterruptedException {
-        CustomExecutor p2 = new CustomExecutor(2);
-        assertEquals(0, p2.getActiveCount());
-        p2.execute(new SmallRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, p2.getActiveCount());
-        joinPool(p2);
-    }
-
-    /**
-     *    getCompletedTaskCount increases, but doesn't overestimate,
-     *   when tasks complete
-     */
-    public void testGetCompletedTaskCount() throws InterruptedException {
-        CustomExecutor p2 = new CustomExecutor(2);
-        assertEquals(0, p2.getCompletedTaskCount());
-        p2.execute(new SmallRunnable());
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertEquals(1, p2.getCompletedTaskCount());
-        joinPool(p2);
-    }
-
-    /**
-     *  getCorePoolSize returns size given in constructor if not otherwise set
-     */
-    public void testGetCorePoolSize() {
-        CustomExecutor p1 = new CustomExecutor(1);
-        assertEquals(1, p1.getCorePoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *    getLargestPoolSize increases, but doesn't overestimate, when
-     *   multiple threads active
-     */
-    public void testGetLargestPoolSize() throws InterruptedException {
-        CustomExecutor p2 = new CustomExecutor(2);
-        assertEquals(0, p2.getLargestPoolSize());
-        p2.execute(new SmallRunnable());
-        p2.execute(new SmallRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, p2.getLargestPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getPoolSize increases, but doesn't overestimate, when threads
-     *   become active
-     */
-    public void testGetPoolSize() {
-        CustomExecutor p1 = new CustomExecutor(1);
-        assertEquals(0, p1.getPoolSize());
-        p1.execute(new SmallRunnable());
-        assertEquals(1, p1.getPoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *    getTaskCount increases, but doesn't overestimate, when tasks
-     *    submitted
-     */
-    public void testGetTaskCount() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        assertEquals(0, p1.getTaskCount());
-        for (int i = 0; i < 5; i++)
-            p1.execute(new SmallRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(5, p1.getTaskCount());
-        joinPool(p1);
-    }
-
-    /**
-     * getThreadFactory returns factory in constructor if not set
-     */
-    public void testGetThreadFactory() {
-        ThreadFactory tf = new SimpleThreadFactory();
-        CustomExecutor p = new CustomExecutor(1, tf);
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-    /**
-     * setThreadFactory sets the thread factory returned by getThreadFactory
-     */
-    public void testSetThreadFactory() {
-        ThreadFactory tf = new SimpleThreadFactory();
-        CustomExecutor p = new CustomExecutor(1);
-        p.setThreadFactory(tf);
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-    /**
-     * setThreadFactory(null) throws NPE
-     */
-    public void testSetThreadFactoryNull() {
-        CustomExecutor p = new CustomExecutor(1);
-        try {
-            p.setThreadFactory(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *   is isShutDown is false before shutdown, true after
-     */
-    public void testIsShutdown() {
-        CustomExecutor p1 = new CustomExecutor(1);
-        try {
-            assertFalse(p1.isShutdown());
-        }
-        finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.isShutdown());
-    }
-
-
-    /**
-     *  isTerminated is false before termination, true after
-     */
-    public void testIsTerminated() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        try {
-            p1.execute(new SmallRunnable());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-    }
-
-    /**
-     *  isTerminating is not true when running or when terminated
-     */
-    public void testIsTerminating() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        assertFalse(p1.isTerminating());
-        try {
-            p1.execute(new SmallRunnable());
-            assertFalse(p1.isTerminating());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-        assertFalse(p1.isTerminating());
-    }
-
-    /**
-     * getQueue returns the work queue, which contains queued tasks
-     */
-    public void testGetQueue() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), 1, MILLISECONDS);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            BlockingQueue<Runnable> q = p1.getQueue();
-            assertTrue(q.contains(tasks[4]));
-            assertFalse(q.contains(tasks[0]));
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     * remove(task) removes queued task, and fails to remove active task
-     */
-    public void testRemove() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), 1, MILLISECONDS);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            BlockingQueue<Runnable> q = p1.getQueue();
-            assertFalse(p1.remove((Runnable)tasks[0]));
-            assertTrue(q.contains((Runnable)tasks[4]));
-            assertTrue(q.contains((Runnable)tasks[3]));
-            assertTrue(p1.remove((Runnable)tasks[4]));
-            assertFalse(p1.remove((Runnable)tasks[4]));
-            assertFalse(q.contains((Runnable)tasks[4]));
-            assertTrue(q.contains((Runnable)tasks[3]));
-            assertTrue(p1.remove((Runnable)tasks[3]));
-            assertFalse(q.contains((Runnable)tasks[3]));
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *  purge removes cancelled tasks from the queue
-     */
-    public void testPurge() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        }
-        try {
-            int max = 5;
-            if (tasks[4].cancel(true)) --max;
-            if (tasks[3].cancel(true)) --max;
-            // There must eventually be an interference-free point at
-            // which purge will not fail. (At worst, when queue is empty.)
-            int k;
-            for (k = 0; k < SMALL_DELAY_MS; ++k) {
-                p1.purge();
-                long count = p1.getTaskCount();
-                if (count >= 0 && count <= max)
-                    break;
-                Thread.sleep(1);
-            }
-            assertTrue(k < SMALL_DELAY_MS);
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *  shutDownNow returns a list containing tasks that were not run
-     */
-    public void testShutDownNow() {
-        CustomExecutor p1 = new CustomExecutor(1);
-        for (int i = 0; i < 5; i++)
-            p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        List l;
-        try {
-            l = p1.shutdownNow();
-        } catch (SecurityException ok) {
-            return;
-        }
-        assertTrue(p1.isShutdown());
-        assertTrue(l.size() > 0 && l.size() <= 5);
-        joinPool(p1);
-    }
-
-    /**
-     * In default setting, shutdown cancels periodic but not delayed
-     * tasks at shutdown
-     */
-    public void testShutDown1() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        assertTrue(p1.getExecuteExistingDelayedTasksAfterShutdownPolicy());
-        assertFalse(p1.getContinueExistingPeriodicTasksAfterShutdownPolicy());
-
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++)
-            tasks[i] = p1.schedule(new NoOpRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        BlockingQueue q = p1.getQueue();
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            ScheduledFuture t = (ScheduledFuture)it.next();
-            assertFalse(t.isCancelled());
-        }
-        assertTrue(p1.isShutdown());
-        Thread.sleep(SMALL_DELAY_MS);
-        for (int i = 0; i < 5; ++i) {
-            assertTrue(tasks[i].isDone());
-            assertFalse(tasks[i].isCancelled());
-        }
-    }
-
-
-    /**
-     * If setExecuteExistingDelayedTasksAfterShutdownPolicy is false,
-     * delayed tasks are cancelled at shutdown
-     */
-    public void testShutDown2() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        p1.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++)
-            tasks[i] = p1.schedule(new NoOpRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(p1.isShutdown());
-        BlockingQueue q = p1.getQueue();
-        assertTrue(q.isEmpty());
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(p1.isTerminated());
-    }
-
-
-    /**
-     * If setContinueExistingPeriodicTasksAfterShutdownPolicy is set false,
-     * periodic tasks are not cancelled at shutdown
-     */
-    public void testShutDown3() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        p1.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
-        ScheduledFuture task =
-            p1.scheduleAtFixedRate(new NoOpRunnable(), 5, 5, MILLISECONDS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(p1.isShutdown());
-        BlockingQueue q = p1.getQueue();
-        assertTrue(q.isEmpty());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(p1.isTerminated());
-    }
-
-    /**
-     * if setContinueExistingPeriodicTasksAfterShutdownPolicy is true,
-     * periodic tasks are cancelled at shutdown
-     */
-    public void testShutDown4() throws InterruptedException {
-        CustomExecutor p1 = new CustomExecutor(1);
-        try {
-            p1.setContinueExistingPeriodicTasksAfterShutdownPolicy(true);
-            ScheduledFuture task =
-                p1.scheduleAtFixedRate(new NoOpRunnable(), 1, 1, MILLISECONDS);
-            assertFalse(task.isCancelled());
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-            assertFalse(task.isCancelled());
-            assertFalse(p1.isTerminated());
-            assertTrue(p1.isShutdown());
-            Thread.sleep(SHORT_DELAY_MS);
-            assertFalse(task.isCancelled());
-            assertTrue(task.cancel(true));
-            assertTrue(task.isDone());
-            Thread.sleep(SHORT_DELAY_MS);
-            assertTrue(p1.isTerminated());
-        }
-        finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     * completed submit of callable returns result
-     */
-    public void testSubmitCallable() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            Future<String> future = e.submit(new StringTask());
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of runnable returns successfully
-     */
-    public void testSubmitRunnable() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            Future<?> future = e.submit(new NoOpRunnable());
-            future.get();
-            assertTrue(future.isDone());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of (runnable, result) returns result
-     */
-    public void testSubmitRunnable2() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(null) throws NPE
-     */
-    public void testInvokeAny1() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            e.invokeAny(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(empty collection) throws IAE
-     */
-    public void testInvokeAny2() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws NPE if c has null elements
-     */
-    public void testInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testInvokeAny4() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) returns result of some task
-     */
-    public void testInvokeAny5() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(null) throws NPE
-     */
-    public void testInvokeAll1() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            e.invokeAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(empty collection) returns empty collection
-     */
-    public void testInvokeAll2() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) throws NPE if c has null elements
-     */
-    public void testInvokeAll3() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of invokeAll(c) throws exception on failed task
-     */
-    public void testInvokeAll4() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        List<Future<String>> futures = e.invokeAll(l);
-        assertEquals(1, futures.size());
-        try {
-            futures.get(0).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) returns results of all completed tasks
-     */
-    public void testInvokeAll5() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures = e.invokeAll(l);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(null) throws NPE
-     */
-    public void testTimedInvokeAny1() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(,,null) throws NPE
-     */
-    public void testTimedInvokeAnyNullTimeUnit() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(empty collection) throws IAE
-     */
-    public void testTimedInvokeAny2() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testTimedInvokeAny4() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) returns result of some task
-     */
-    public void testTimedInvokeAny5() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(null) throws NPE
-     */
-    public void testTimedInvokeAll1() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(,,null) throws NPE
-     */
-    public void testTimedInvokeAllNullTimeUnit() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(empty collection) returns empty collection
-     */
-    public void testTimedInvokeAll2() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAll3() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of element of invokeAll(c) throws exception on failed task
-     */
-    public void testTimedInvokeAll4() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        List<Future<String>> futures =
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-        assertEquals(1, futures.size());
-        try {
-            futures.get(0).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) returns results of all completed tasks
-     */
-    public void testTimedInvokeAll5() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) cancels tasks not completed by timeout
-     */
-    public void testTimedInvokeAll6() throws Exception {
-        ExecutorService e = new CustomExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS);
-            assertEquals(3, futures.size());
-            Iterator<Future<String>> it = futures.iterator();
-            Future<String> f1 = it.next();
-            Future<String> f2 = it.next();
-            Future<String> f3 = it.next();
-            assertTrue(f1.isDone());
-            assertTrue(f2.isDone());
-            assertTrue(f3.isDone());
-            assertFalse(f1.isCancelled());
-            assertTrue(f2.isCancelled());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ScheduledExecutorTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ScheduledExecutorTest.java
deleted file mode 100755
index ff1796e..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ScheduledExecutorTest.java
+++ /dev/null
@@ -1,1012 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.atomic.*;
-
-public class ScheduledExecutorTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ScheduledExecutorTest.class);
-    }
-
-
-    /**
-     * execute successfully executes a runnable
-     */
-    public void testExecute() throws InterruptedException {
-        TrackedShortRunnable runnable =new TrackedShortRunnable();
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        p1.execute(runnable);
-        assertFalse(runnable.done);
-        Thread.sleep(SHORT_DELAY_MS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p1);
-    }
-
-
-    /**
-     * delayed schedule of callable successfully executes after delay
-     */
-    public void testSchedule1() throws Exception {
-        TrackedCallable callable = new TrackedCallable();
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        Future f = p1.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(callable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(callable.done);
-        assertEquals(Boolean.TRUE, f.get());
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p1);
-    }
-
-    /**
-     *  delayed schedule of runnable successfully executes after delay
-     */
-    public void testSchedule3() throws InterruptedException {
-        TrackedShortRunnable runnable = new TrackedShortRunnable();
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        p1.schedule(runnable, SMALL_DELAY_MS, MILLISECONDS);
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(runnable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p1);
-    }
-
-    /**
-     * scheduleAtFixedRate executes runnable after given initial delay
-     */
-    public void testSchedule4() throws InterruptedException {
-        TrackedShortRunnable runnable = new TrackedShortRunnable();
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        ScheduledFuture h = p1.scheduleAtFixedRate(runnable, SHORT_DELAY_MS, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(runnable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        h.cancel(true);
-        joinPool(p1);
-    }
-
-    static class RunnableCounter implements Runnable {
-        AtomicInteger count = new AtomicInteger(0);
-        public void run() { count.getAndIncrement(); }
-    }
-
-    /**
-     * scheduleWithFixedDelay executes runnable after given initial delay
-     */
-    public void testSchedule5() throws InterruptedException {
-        TrackedShortRunnable runnable = new TrackedShortRunnable();
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        ScheduledFuture h = p1.scheduleWithFixedDelay(runnable, SHORT_DELAY_MS, SHORT_DELAY_MS, MILLISECONDS);
-        assertFalse(runnable.done);
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertTrue(runnable.done);
-        h.cancel(true);
-        joinPool(p1);
-    }
-
-    /**
-     * scheduleAtFixedRate executes series of tasks at given rate
-     */
-    public void testFixedRateSequence() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        RunnableCounter counter = new RunnableCounter();
-        ScheduledFuture h =
-            p1.scheduleAtFixedRate(counter, 0, 1, MILLISECONDS);
-        Thread.sleep(SMALL_DELAY_MS);
-        h.cancel(true);
-        int c = counter.count.get();
-        // By time scaling conventions, we must have at least
-        // an execution per SHORT delay, but no more than one SHORT more
-        assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS);
-        assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS);
-        joinPool(p1);
-    }
-
-    /**
-     * scheduleWithFixedDelay executes series of tasks with given period
-     */
-    public void testFixedDelaySequence() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        RunnableCounter counter = new RunnableCounter();
-        ScheduledFuture h =
-            p1.scheduleWithFixedDelay(counter, 0, 1, MILLISECONDS);
-        Thread.sleep(SMALL_DELAY_MS);
-        h.cancel(true);
-        int c = counter.count.get();
-        assertTrue(c >= SMALL_DELAY_MS / SHORT_DELAY_MS);
-        assertTrue(c <= SMALL_DELAY_MS + SHORT_DELAY_MS);
-        joinPool(p1);
-    }
-
-
-    /**
-     *  execute (null) throws NPE
-     */
-    public void testExecuteNull() throws InterruptedException {
-        ScheduledThreadPoolExecutor se = null;
-        try {
-            se = new ScheduledThreadPoolExecutor(1);
-            se.execute(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-
-        joinPool(se);
-    }
-
-    /**
-     * schedule (null) throws NPE
-     */
-    public void testScheduleNull() throws InterruptedException {
-        ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1);
-        try {
-            TrackedCallable callable = null;
-            Future f = se.schedule(callable, SHORT_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-        joinPool(se);
-    }
-
-    /**
-     * execute throws RejectedExecutionException if shutdown
-     */
-    public void testSchedule1_RejectedExecutionException() throws InterruptedException {
-        ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1);
-        try {
-            se.shutdown();
-            se.schedule(new NoOpRunnable(),
-                        MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-
-        joinPool(se);
-    }
-
-    /**
-     * schedule throws RejectedExecutionException if shutdown
-     */
-    public void testSchedule2_RejectedExecutionException() throws InterruptedException {
-        ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1);
-        try {
-            se.shutdown();
-            se.schedule(new NoOpCallable(),
-                        MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-        joinPool(se);
-    }
-
-    /**
-     * schedule callable throws RejectedExecutionException if shutdown
-     */
-     public void testSchedule3_RejectedExecutionException() throws InterruptedException {
-         ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1);
-         try {
-            se.shutdown();
-            se.schedule(new NoOpCallable(),
-                        MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-         joinPool(se);
-    }
-
-    /**
-     *  scheduleAtFixedRate throws RejectedExecutionException if shutdown
-     */
-    public void testScheduleAtFixedRate1_RejectedExecutionException() throws InterruptedException {
-        ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1);
-        try {
-            se.shutdown();
-            se.scheduleAtFixedRate(new NoOpRunnable(),
-                                   MEDIUM_DELAY_MS, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-        joinPool(se);
-    }
-
-    /**
-     * scheduleWithFixedDelay throws RejectedExecutionException if shutdown
-     */
-    public void testScheduleWithFixedDelay1_RejectedExecutionException() throws InterruptedException {
-        ScheduledThreadPoolExecutor se = new ScheduledThreadPoolExecutor(1);
-        try {
-            se.shutdown();
-            se.scheduleWithFixedDelay(new NoOpRunnable(),
-                                      MEDIUM_DELAY_MS, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (RejectedExecutionException success) {
-        } catch (SecurityException ok) {
-        }
-        joinPool(se);
-    }
-
-    /**
-     *  getActiveCount increases but doesn't overestimate, when a
-     *  thread becomes active
-     */
-    public void testGetActiveCount() throws InterruptedException {
-        ScheduledThreadPoolExecutor p2 = new ScheduledThreadPoolExecutor(2);
-        assertEquals(0, p2.getActiveCount());
-        p2.execute(new SmallRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, p2.getActiveCount());
-        joinPool(p2);
-    }
-
-    /**
-     *    getCompletedTaskCount increases, but doesn't overestimate,
-     *   when tasks complete
-     */
-    public void testGetCompletedTaskCount() throws InterruptedException {
-        ScheduledThreadPoolExecutor p2 = new ScheduledThreadPoolExecutor(2);
-        assertEquals(0, p2.getCompletedTaskCount());
-        p2.execute(new SmallRunnable());
-        Thread.sleep(MEDIUM_DELAY_MS);
-        assertEquals(1, p2.getCompletedTaskCount());
-        joinPool(p2);
-    }
-
-    /**
-     *  getCorePoolSize returns size given in constructor if not otherwise set
-     */
-    public void testGetCorePoolSize() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        assertEquals(1, p1.getCorePoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *    getLargestPoolSize increases, but doesn't overestimate, when
-     *   multiple threads active
-     */
-    public void testGetLargestPoolSize() throws InterruptedException {
-        ScheduledThreadPoolExecutor p2 = new ScheduledThreadPoolExecutor(2);
-        assertEquals(0, p2.getLargestPoolSize());
-        p2.execute(new SmallRunnable());
-        p2.execute(new SmallRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, p2.getLargestPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getPoolSize increases, but doesn't overestimate, when threads
-     *   become active
-     */
-    public void testGetPoolSize() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        assertEquals(0, p1.getPoolSize());
-        p1.execute(new SmallRunnable());
-        assertEquals(1, p1.getPoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *    getTaskCount increases, but doesn't overestimate, when tasks
-     *    submitted
-     */
-    public void testGetTaskCount() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        assertEquals(0, p1.getTaskCount());
-        for (int i = 0; i < 5; i++)
-            p1.execute(new SmallRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(5, p1.getTaskCount());
-        joinPool(p1);
-    }
-
-    /**
-     * getThreadFactory returns factory in constructor if not set
-     */
-    public void testGetThreadFactory() throws InterruptedException {
-        ThreadFactory tf = new SimpleThreadFactory();
-        ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1, tf);
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-    /**
-     * setThreadFactory sets the thread factory returned by getThreadFactory
-     */
-    public void testSetThreadFactory() throws InterruptedException {
-        ThreadFactory tf = new SimpleThreadFactory();
-        ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1);
-        p.setThreadFactory(tf);
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-    /**
-     * setThreadFactory(null) throws NPE
-     */
-    public void testSetThreadFactoryNull() throws InterruptedException {
-        ScheduledThreadPoolExecutor p = new ScheduledThreadPoolExecutor(1);
-        try {
-            p.setThreadFactory(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *   is isShutDown is false before shutdown, true after
-     */
-    public void testIsShutdown() {
-
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        try {
-            assertFalse(p1.isShutdown());
-        }
-        finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.isShutdown());
-    }
-
-
-    /**
-     *   isTerminated is false before termination, true after
-     */
-    public void testIsTerminated() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        try {
-            p1.execute(new SmallRunnable());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-    }
-
-    /**
-     *  isTerminating is not true when running or when terminated
-     */
-    public void testIsTerminating() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        assertFalse(p1.isTerminating());
-        try {
-            p1.execute(new SmallRunnable());
-            assertFalse(p1.isTerminating());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-        assertFalse(p1.isTerminating());
-    }
-
-    /**
-     * getQueue returns the work queue, which contains queued tasks
-     */
-    public void testGetQueue() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), 1, MILLISECONDS);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            BlockingQueue<Runnable> q = p1.getQueue();
-            assertTrue(q.contains(tasks[4]));
-            assertFalse(q.contains(tasks[0]));
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     * remove(task) removes queued task, and fails to remove active task
-     */
-    public void testRemove() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), 1, MILLISECONDS);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            BlockingQueue<Runnable> q = p1.getQueue();
-            assertFalse(p1.remove((Runnable)tasks[0]));
-            assertTrue(q.contains((Runnable)tasks[4]));
-            assertTrue(q.contains((Runnable)tasks[3]));
-            assertTrue(p1.remove((Runnable)tasks[4]));
-            assertFalse(p1.remove((Runnable)tasks[4]));
-            assertFalse(q.contains((Runnable)tasks[4]));
-            assertTrue(q.contains((Runnable)tasks[3]));
-            assertTrue(p1.remove((Runnable)tasks[3]));
-            assertFalse(q.contains((Runnable)tasks[3]));
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *  purge removes cancelled tasks from the queue
-     */
-    public void testPurge() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        }
-        try {
-            int max = 5;
-            if (tasks[4].cancel(true)) --max;
-            if (tasks[3].cancel(true)) --max;
-            // There must eventually be an interference-free point at
-            // which purge will not fail. (At worst, when queue is empty.)
-            int k;
-            for (k = 0; k < SMALL_DELAY_MS; ++k) {
-                p1.purge();
-                long count = p1.getTaskCount();
-                if (count >= 0 && count <= max)
-                    break;
-                Thread.sleep(1);
-            }
-            assertTrue(k < SMALL_DELAY_MS);
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *  shutDownNow returns a list containing tasks that were not run
-     */
-    public void testShutDownNow() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        for (int i = 0; i < 5; i++)
-            p1.schedule(new SmallPossiblyInterruptedRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        List l;
-        try {
-            l = p1.shutdownNow();
-        } catch (SecurityException ok) {
-            return;
-        }
-        assertTrue(p1.isShutdown());
-        assertTrue(l.size() > 0 && l.size() <= 5);
-        joinPool(p1);
-    }
-
-    /**
-     * In default setting, shutdown cancels periodic but not delayed
-     * tasks at shutdown
-     */
-    public void testShutDown1() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        assertTrue(p1.getExecuteExistingDelayedTasksAfterShutdownPolicy());
-        assertFalse(p1.getContinueExistingPeriodicTasksAfterShutdownPolicy());
-
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++)
-            tasks[i] = p1.schedule(new NoOpRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        BlockingQueue q = p1.getQueue();
-        for (Iterator it = q.iterator(); it.hasNext();) {
-            ScheduledFuture t = (ScheduledFuture)it.next();
-            assertFalse(t.isCancelled());
-        }
-        assertTrue(p1.isShutdown());
-        Thread.sleep(SMALL_DELAY_MS);
-        for (int i = 0; i < 5; ++i) {
-            assertTrue(tasks[i].isDone());
-            assertFalse(tasks[i].isCancelled());
-        }
-    }
-
-
-    /**
-     * If setExecuteExistingDelayedTasksAfterShutdownPolicy is false,
-     * delayed tasks are cancelled at shutdown
-     */
-    public void testShutDown2() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        p1.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
-        ScheduledFuture[] tasks = new ScheduledFuture[5];
-        for (int i = 0; i < 5; i++)
-            tasks[i] = p1.schedule(new NoOpRunnable(), SHORT_DELAY_MS, MILLISECONDS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(p1.isShutdown());
-        BlockingQueue q = p1.getQueue();
-        assertTrue(q.isEmpty());
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(p1.isTerminated());
-    }
-
-
-    /**
-     * If setContinueExistingPeriodicTasksAfterShutdownPolicy is set false,
-     * periodic tasks are not cancelled at shutdown
-     */
-    public void testShutDown3() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        p1.setContinueExistingPeriodicTasksAfterShutdownPolicy(false);
-        ScheduledFuture task =
-            p1.scheduleAtFixedRate(new NoOpRunnable(), 5, 5, MILLISECONDS);
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(p1.isShutdown());
-        BlockingQueue q = p1.getQueue();
-        assertTrue(q.isEmpty());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(p1.isTerminated());
-    }
-
-    /**
-     * if setContinueExistingPeriodicTasksAfterShutdownPolicy is true,
-     * periodic tasks are cancelled at shutdown
-     */
-    public void testShutDown4() throws InterruptedException {
-        ScheduledThreadPoolExecutor p1 = new ScheduledThreadPoolExecutor(1);
-        try {
-            p1.setContinueExistingPeriodicTasksAfterShutdownPolicy(true);
-            ScheduledFuture task =
-                p1.scheduleAtFixedRate(new NoOpRunnable(), 1, 1, MILLISECONDS);
-            assertFalse(task.isCancelled());
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-            assertFalse(task.isCancelled());
-            assertFalse(p1.isTerminated());
-            assertTrue(p1.isShutdown());
-            Thread.sleep(SHORT_DELAY_MS);
-            assertFalse(task.isCancelled());
-            assertTrue(task.cancel(true));
-            assertTrue(task.isDone());
-            Thread.sleep(SHORT_DELAY_MS);
-            assertTrue(p1.isTerminated());
-        }
-        finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     * completed submit of callable returns result
-     */
-    public void testSubmitCallable() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            Future<String> future = e.submit(new StringTask());
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of runnable returns successfully
-     */
-    public void testSubmitRunnable() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            Future<?> future = e.submit(new NoOpRunnable());
-            future.get();
-            assertTrue(future.isDone());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of (runnable, result) returns result
-     */
-    public void testSubmitRunnable2() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(null) throws NPE
-     */
-    public void testInvokeAny1() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            e.invokeAny(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(empty collection) throws IAE
-     */
-    public void testInvokeAny2() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws NPE if c has null elements
-     */
-    public void testInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testInvokeAny4() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) returns result of some task
-     */
-    public void testInvokeAny5() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(null) throws NPE
-     */
-    public void testInvokeAll1() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            e.invokeAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(empty collection) returns empty collection
-     */
-    public void testInvokeAll2() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) throws NPE if c has null elements
-     */
-    public void testInvokeAll3() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of invokeAll(c) throws exception on failed task
-     */
-    public void testInvokeAll4() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        List<Future<String>> futures = e.invokeAll(l);
-        assertEquals(1, futures.size());
-        try {
-            futures.get(0).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) returns results of all completed tasks
-     */
-    public void testInvokeAll5() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures = e.invokeAll(l);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(null) throws NPE
-     */
-    public void testTimedInvokeAny1() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(,,null) throws NPE
-     */
-    public void testTimedInvokeAnyNullTimeUnit() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(empty collection) throws IAE
-     */
-    public void testTimedInvokeAny2() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testTimedInvokeAny4() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) returns result of some task
-     */
-    public void testTimedInvokeAny5() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(null) throws NPE
-     */
-    public void testTimedInvokeAll1() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(,,null) throws NPE
-     */
-    public void testTimedInvokeAllNullTimeUnit() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(empty collection) returns empty collection
-     */
-    public void testTimedInvokeAll2() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAll3() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of element of invokeAll(c) throws exception on failed task
-     */
-    public void testTimedInvokeAll4() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        List<Future<String>> futures =
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-        assertEquals(1, futures.size());
-        try {
-            futures.get(0).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) returns results of all completed tasks
-     */
-    public void testTimedInvokeAll5() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) cancels tasks not completed by timeout
-     */
-    public void testTimedInvokeAll6() throws Exception {
-        ExecutorService e = new ScheduledThreadPoolExecutor(2);
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS);
-            assertEquals(3, futures.size());
-            Iterator<Future<String>> it = futures.iterator();
-            Future<String> f1 = it.next();
-            Future<String> f2 = it.next();
-            Future<String> f3 = it.next();
-            assertTrue(f1.isDone());
-            assertTrue(f2.isDone());
-            assertTrue(f3.isDone());
-            assertFalse(f1.isCancelled());
-            assertTrue(f2.isCancelled());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/SemaphoreTest.java b/luni/src/test/java/tests/api/java/util/concurrent/SemaphoreTest.java
deleted file mode 100755
index c27893c..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/SemaphoreTest.java
+++ /dev/null
@@ -1,765 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-
-public class SemaphoreTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(SemaphoreTest.class);
-    }
-
-    /**
-     * Subclass to expose protected methods
-     */
-    static class PublicSemaphore extends Semaphore {
-        PublicSemaphore(int p, boolean f) { super(p, f); }
-        public Collection<Thread> getQueuedThreads() {
-            return super.getQueuedThreads();
-        }
-        public void reducePermits(int p) {
-            super.reducePermits(p);
-        }
-    }
-
-    /**
-     * A runnable calling acquire
-     */
-    class InterruptibleLockRunnable extends CheckedRunnable {
-        final Semaphore lock;
-        InterruptibleLockRunnable(Semaphore l) { lock = l; }
-        public void realRun() {
-            try {
-                lock.acquire();
-            }
-            catch (InterruptedException ignored) {}
-        }
-    }
-
-
-    /**
-     * A runnable calling acquire that expects to be interrupted
-     */
-    class InterruptedLockRunnable extends CheckedInterruptedRunnable {
-        final Semaphore lock;
-        InterruptedLockRunnable(Semaphore l) { lock = l; }
-        public void realRun() throws InterruptedException {
-            lock.acquire();
-        }
-    }
-
-    /**
-     * Zero, negative, and positive initial values are allowed in constructor
-     */
-    public void testConstructor() {
-        for (int permits : new int[] { -1, 0, 1 }) {
-            for (boolean fair : new boolean[] { false, true }) {
-                Semaphore s = new Semaphore(permits, fair);
-                assertEquals(permits, s.availablePermits());
-                assertEquals(fair, s.isFair());
-            }
-        }
-    }
-
-    /**
-     * Constructor without fairness argument behaves as nonfair
-     */
-    public void testConstructor2() {
-        for (int permits : new int[] { -1, 0, 1 }) {
-            Semaphore s = new Semaphore(permits);
-            assertEquals(permits, s.availablePermits());
-            assertFalse(s.isFair());
-        }
-    }
-
-    /**
-     * tryAcquire succeeds when sufficient permits, else fails
-     */
-    public void testTryAcquireInSameThread() {
-        Semaphore s = new Semaphore(2, false);
-        assertEquals(2, s.availablePermits());
-        assertTrue(s.tryAcquire());
-        assertTrue(s.tryAcquire());
-        assertEquals(0, s.availablePermits());
-        assertFalse(s.tryAcquire());
-    }
-
-    /**
-     * Acquire and release of semaphore succeed if initially available
-     */
-    public void testAcquireReleaseInSameThread()
-        throws InterruptedException {
-        Semaphore s = new Semaphore(1, false);
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * Uninterruptible acquire and release of semaphore succeed if
-     * initially available
-     */
-    public void testAcquireUninterruptiblyReleaseInSameThread()
-        throws InterruptedException {
-        Semaphore s = new Semaphore(1, false);
-        s.acquireUninterruptibly();
-        s.release();
-        s.acquireUninterruptibly();
-        s.release();
-        s.acquireUninterruptibly();
-        s.release();
-        s.acquireUninterruptibly();
-        s.release();
-        s.acquireUninterruptibly();
-        s.release();
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * Timed Acquire and release of semaphore succeed if
-     * initially available
-     */
-    public void testTimedAcquireReleaseInSameThread()
-        throws InterruptedException {
-        Semaphore s = new Semaphore(1, false);
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * A release in one thread enables an acquire in another thread
-     */
-    public void testAcquireReleaseInDifferentThreads()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, false);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquire();
-                s.release();
-                s.release();
-                s.acquire();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        s.release();
-        s.release();
-        s.acquire();
-        s.acquire();
-        s.release();
-        t.join();
-    }
-
-    /**
-     * A release in one thread enables an uninterruptible acquire in another thread
-     */
-    public void testUninterruptibleAcquireReleaseInDifferentThreads()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, false);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquireUninterruptibly();
-                s.release();
-                s.release();
-                s.acquireUninterruptibly();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        s.release();
-        s.release();
-        s.acquireUninterruptibly();
-        s.acquireUninterruptibly();
-        s.release();
-        t.join();
-    }
-
-
-    /**
-     *  A release in one thread enables a timed acquire in another thread
-     */
-    public void testTimedAcquireReleaseInDifferentThreads()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(1, false);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.release();
-                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-                s.release();
-                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-            }});
-
-        t.start();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        s.release();
-        t.join();
-    }
-
-    /**
-     * A waiting acquire blocks interruptibly
-     */
-    public void testAcquire_InterruptedException()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, false);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquire();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  A waiting timed acquire blocks interruptibly
-     */
-    public void testTryAcquire_InterruptedException()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, false);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.tryAcquire(MEDIUM_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * hasQueuedThreads reports whether there are waiting threads
-     */
-    public void testHasQueuedThreads() throws InterruptedException {
-        final Semaphore lock = new Semaphore(1, false);
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertFalse(lock.hasQueuedThreads());
-        lock.acquireUninterruptibly();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.hasQueuedThreads());
-        lock.release();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(lock.hasQueuedThreads());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getQueueLength reports number of waiting threads
-     */
-    public void testGetQueueLength() throws InterruptedException {
-        final Semaphore lock = new Semaphore(1, false);
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertEquals(0, lock.getQueueLength());
-        lock.acquireUninterruptibly();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, lock.getQueueLength());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        lock.release();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(0, lock.getQueueLength());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * getQueuedThreads includes waiting threads
-     */
-    public void testGetQueuedThreads() throws InterruptedException {
-        final PublicSemaphore lock = new PublicSemaphore(1, false);
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        lock.acquireUninterruptibly();
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().contains(t1));
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().contains(t1));
-        assertTrue(lock.getQueuedThreads().contains(t2));
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertFalse(lock.getQueuedThreads().contains(t1));
-        assertTrue(lock.getQueuedThreads().contains(t2));
-        lock.release();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertTrue(lock.getQueuedThreads().isEmpty());
-        t1.join();
-        t2.join();
-    }
-
-    /**
-     * drainPermits reports and removes given number of permits
-     */
-    public void testDrainPermits() {
-        Semaphore s = new Semaphore(0, false);
-        assertEquals(0, s.availablePermits());
-        assertEquals(0, s.drainPermits());
-        s.release(10);
-        assertEquals(10, s.availablePermits());
-        assertEquals(10, s.drainPermits());
-        assertEquals(0, s.availablePermits());
-        assertEquals(0, s.drainPermits());
-    }
-
-    /**
-     * reducePermits reduces number of permits
-     */
-    public void testReducePermits() {
-        PublicSemaphore s = new PublicSemaphore(10, false);
-        assertEquals(10, s.availablePermits());
-        s.reducePermits(1);
-        assertEquals(9, s.availablePermits());
-        s.reducePermits(10);
-        assertEquals(-1, s.availablePermits());
-    }
-
-    /**
-     * a deserialized serialized semaphore has same number of permits
-     */
-    public void testSerialization() throws Exception {
-        Semaphore l = new Semaphore(3, false);
-        l.acquire();
-        l.release();
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        Semaphore r = (Semaphore) in.readObject();
-        assertEquals(3, r.availablePermits());
-        assertFalse(r.isFair());
-        r.acquire();
-        r.release();
-    }
-
-
-    /**
-     * Zero, negative, and positive initial values are allowed in constructor
-     */
-    public void testConstructor_fair() {
-        Semaphore s0 = new Semaphore(0, true);
-        assertEquals(0, s0.availablePermits());
-        assertTrue(s0.isFair());
-        Semaphore s1 = new Semaphore(-1, true);
-        assertEquals(-1, s1.availablePermits());
-        Semaphore s2 = new Semaphore(-1, true);
-        assertEquals(-1, s2.availablePermits());
-    }
-
-    /**
-     * tryAcquire succeeds when sufficient permits, else fails
-     */
-    public void testTryAcquireInSameThread_fair() {
-        Semaphore s = new Semaphore(2, true);
-        assertEquals(2, s.availablePermits());
-        assertTrue(s.tryAcquire());
-        assertTrue(s.tryAcquire());
-        assertEquals(0, s.availablePermits());
-        assertFalse(s.tryAcquire());
-    }
-
-    /**
-     * tryAcquire(n) succeeds when sufficient permits, else fails
-     */
-    public void testTryAcquireNInSameThread_fair() {
-        Semaphore s = new Semaphore(2, true);
-        assertEquals(2, s.availablePermits());
-        assertTrue(s.tryAcquire(2));
-        assertEquals(0, s.availablePermits());
-        assertFalse(s.tryAcquire());
-    }
-
-    /**
-     * Acquire and release of semaphore succeed if initially available
-     */
-    public void testAcquireReleaseInSameThread_fair()
-        throws InterruptedException {
-        Semaphore s = new Semaphore(1, true);
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        s.acquire();
-        s.release();
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * Acquire(n) and release(n) of semaphore succeed if initially available
-     */
-    public void testAcquireReleaseNInSameThread_fair()
-        throws InterruptedException {
-        Semaphore s = new Semaphore(1, true);
-        s.release(1);
-        s.acquire(1);
-        s.release(2);
-        s.acquire(2);
-        s.release(3);
-        s.acquire(3);
-        s.release(4);
-        s.acquire(4);
-        s.release(5);
-        s.acquire(5);
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * Acquire(n) and release(n) of semaphore succeed if initially available
-     */
-    public void testAcquireUninterruptiblyReleaseNInSameThread_fair() {
-        Semaphore s = new Semaphore(1, true);
-        s.release(1);
-        s.acquireUninterruptibly(1);
-        s.release(2);
-        s.acquireUninterruptibly(2);
-        s.release(3);
-        s.acquireUninterruptibly(3);
-        s.release(4);
-        s.acquireUninterruptibly(4);
-        s.release(5);
-        s.acquireUninterruptibly(5);
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * release(n) in one thread enables timed acquire(n) in another thread
-     */
-    public void testTimedAcquireReleaseNInSameThread_fair()
-        throws InterruptedException {
-        Semaphore s = new Semaphore(1, true);
-        s.release(1);
-        assertTrue(s.tryAcquire(1, SHORT_DELAY_MS, MILLISECONDS));
-        s.release(2);
-        assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
-        s.release(3);
-        assertTrue(s.tryAcquire(3, SHORT_DELAY_MS, MILLISECONDS));
-        s.release(4);
-        assertTrue(s.tryAcquire(4, SHORT_DELAY_MS, MILLISECONDS));
-        s.release(5);
-        assertTrue(s.tryAcquire(5, SHORT_DELAY_MS, MILLISECONDS));
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * release in one thread enables timed acquire in another thread
-     */
-    public void testTimedAcquireReleaseInSameThread_fair()
-        throws InterruptedException {
-        Semaphore s = new Semaphore(1, true);
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-        s.release();
-        assertEquals(1, s.availablePermits());
-    }
-
-    /**
-     * A release in one thread enables an acquire in another thread
-     */
-    public void testAcquireReleaseInDifferentThreads_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquire();
-                s.acquire();
-                s.acquire();
-                s.acquire();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        s.release();
-        s.release();
-        s.release();
-        s.release();
-        s.release();
-        s.release();
-        t.join();
-        assertEquals(2, s.availablePermits());
-    }
-
-    /**
-     * release(n) in one thread enables acquire(n) in another thread
-     */
-    public void testAcquireReleaseNInDifferentThreads_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquire();
-                s.release(2);
-                s.acquire();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        s.release(2);
-        s.acquire(2);
-        s.release(1);
-        t.join();
-    }
-
-    /**
-     * release(n) in one thread enables acquire(n) in another thread
-     */
-    public void testAcquireReleaseNInDifferentThreads_fair2()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquire(2);
-                s.acquire(2);
-                s.release(4);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        s.release(6);
-        s.acquire(2);
-        s.acquire(2);
-        s.release(2);
-        t.join();
-    }
-
-
-    /**
-     * release in one thread enables timed acquire in another thread
-     */
-    public void testTimedAcquireReleaseInDifferentThreads_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(1, true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-                assertTrue(s.tryAcquire(SHORT_DELAY_MS, MILLISECONDS));
-            }});
-
-        t.start();
-        s.release();
-        s.release();
-        s.release();
-        s.release();
-        s.release();
-        t.join();
-    }
-
-    /**
-     * release(n) in one thread enables timed acquire(n) in another thread
-     */
-    public void testTimedAcquireReleaseNInDifferentThreads_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(2, true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
-                s.release(2);
-                assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
-                s.release(2);
-            }});
-
-        t.start();
-        assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
-        s.release(2);
-        assertTrue(s.tryAcquire(2, SHORT_DELAY_MS, MILLISECONDS));
-        s.release(2);
-        t.join();
-    }
-
-    /**
-     * A waiting acquire blocks interruptibly
-     */
-    public void testAcquire_InterruptedException_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, true);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquire();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * A waiting acquire(n) blocks interruptibly
-     */
-    public void testAcquireN_InterruptedException_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(2, true);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.acquire(3);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  A waiting tryAcquire blocks interruptibly
-     */
-    public void testTryAcquire_InterruptedException_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(0, true);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.tryAcquire(MEDIUM_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  A waiting tryAcquire(n) blocks interruptibly
-     */
-    public void testTryAcquireN_InterruptedException_fair()
-        throws InterruptedException {
-        final Semaphore s = new Semaphore(1, true);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                s.tryAcquire(4, MEDIUM_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * getQueueLength reports number of waiting threads
-     */
-    public void testGetQueueLength_fair() throws InterruptedException {
-        final Semaphore lock = new Semaphore(1, true);
-        Thread t1 = new Thread(new InterruptedLockRunnable(lock));
-        Thread t2 = new Thread(new InterruptibleLockRunnable(lock));
-        assertEquals(0, lock.getQueueLength());
-        lock.acquireUninterruptibly();
-        t1.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        t2.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, lock.getQueueLength());
-        t1.interrupt();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, lock.getQueueLength());
-        lock.release();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(0, lock.getQueueLength());
-        t1.join();
-        t2.join();
-    }
-
-
-    /**
-     * a deserialized serialized semaphore has same number of permits
-     */
-    public void testSerialization_fair() throws Exception {
-        Semaphore l = new Semaphore(3, true);
-
-        l.acquire();
-        l.release();
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(l);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        Semaphore r = (Semaphore) in.readObject();
-        assertEquals(3, r.availablePermits());
-        assertTrue(r.isFair());
-        r.acquire();
-        r.release();
-    }
-
-    /**
-     * toString indicates current number of permits
-     */
-    public void testToString() {
-        Semaphore s = new Semaphore(0);
-        String us = s.toString();
-        assertTrue(us.indexOf("Permits = 0") >= 0);
-        s.release();
-        String s1 = s.toString();
-        assertTrue(s1.indexOf("Permits = 1") >= 0);
-        s.release();
-        String s2 = s.toString();
-        assertTrue(s2.indexOf("Permits = 2") >= 0);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/SynchronousQueueTest.java b/luni/src/test/java/tests/api/java/util/concurrent/SynchronousQueueTest.java
deleted file mode 100755
index 9393c5c..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/SynchronousQueueTest.java
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.*;
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.io.*;
-
-public class SynchronousQueueTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(SynchronousQueueTest.class);
-    }
-
-    /**
-     * A SynchronousQueue is both empty and full
-     */
-    public void testEmptyFull() {
-        SynchronousQueue q = new SynchronousQueue();
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        assertEquals(0, q.remainingCapacity());
-        assertFalse(q.offer(zero));
-    }
-
-    /**
-     * A fair SynchronousQueue is both empty and full
-     */
-    public void testFairEmptyFull() {
-        SynchronousQueue q = new SynchronousQueue(true);
-        assertTrue(q.isEmpty());
-        assertEquals(0, q.size());
-        assertEquals(0, q.remainingCapacity());
-        assertFalse(q.offer(zero));
-    }
-
-    /**
-     * offer(null) throws NPE
-     */
-    public void testOfferNull() {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            q.offer(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * add(null) throws NPE
-     */
-    public void testAddNull() {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            q.add(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * offer fails if no active taker
-     */
-    public void testOffer() {
-        SynchronousQueue q = new SynchronousQueue();
-        assertFalse(q.offer(one));
-    }
-
-    /**
-     * add throws ISE if no active taker
-     */
-    public void testAdd() {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            assertEquals(0, q.remainingCapacity());
-            q.add(one);
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     * addAll(null) throws NPE
-     */
-    public void testAddAll1() {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            q.addAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * addAll(this) throws IAE
-     */
-    public void testAddAllSelf() {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            q.addAll(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * addAll of a collection with null elements throws NPE
-     */
-    public void testAddAll2() {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            Integer[] ints = new Integer[1];
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-    /**
-     * addAll throws ISE if no active taker
-     */
-    public void testAddAll4() {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            Integer[] ints = new Integer[1];
-            for (int i = 0; i < 1; ++i)
-                ints[i] = new Integer(i);
-            q.addAll(Arrays.asList(ints));
-            shouldThrow();
-        } catch (IllegalStateException success) {}
-    }
-
-    /**
-     * put(null) throws NPE
-     */
-    public void testPutNull() throws InterruptedException {
-        try {
-            SynchronousQueue q = new SynchronousQueue();
-            q.put(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-     }
-
-    /**
-     * put blocks interruptibly if no active taker
-     */
-    public void testBlockingPut() throws InterruptedException {
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                SynchronousQueue q = new SynchronousQueue();
-                q.put(zero);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * put blocks waiting for take
-     */
-    public void testPutWithTake() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                int added = 0;
-                try {
-                    while (true) {
-                        q.put(added);
-                        ++added;
-                    }
-                } catch (InterruptedException success) {
-                    assertTrue(added == 1);
-                }
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(0, q.take());
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timed offer times out if elements not taken
-     */
-    public void testTimedOffer() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(q.offer(new Object(), SHORT_DELAY_MS, MILLISECONDS));
-                q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * take blocks interruptibly when empty
-     */
-    public void testTakeFromEmpty() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.take();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * put blocks interruptibly if no active taker
-     */
-    public void testFairBlockingPut() throws InterruptedException {
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                SynchronousQueue q = new SynchronousQueue(true);
-                q.put(zero);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * put blocks waiting for take
-     */
-    public void testFairPutWithTake() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue(true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                int added = 0;
-                try {
-                    while (true) {
-                        q.put(added);
-                        ++added;
-                    }
-                } catch (InterruptedException success) {
-                    assertTrue(added == 1);
-                }
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(0, q.take());
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timed offer times out if elements not taken
-     */
-    public void testFairTimedOffer() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue(true);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(q.offer(new Object(), SHORT_DELAY_MS, MILLISECONDS));
-                q.offer(new Object(), LONG_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * take blocks interruptibly when empty
-     */
-    public void testFairTakeFromEmpty() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue(true);
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.take();
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * poll fails unless active taker
-     */
-    public void testPoll() {
-        SynchronousQueue q = new SynchronousQueue();
-        assertNull(q.poll());
-    }
-
-    /**
-     * timed pool with zero timeout times out if no active taker
-     */
-    public void testTimedPoll0() throws InterruptedException {
-        SynchronousQueue q = new SynchronousQueue();
-        assertNull(q.poll(0, MILLISECONDS));
-    }
-
-    /**
-     * timed pool with nonzero timeout times out if no active taker
-     */
-    public void testTimedPoll() throws InterruptedException {
-        SynchronousQueue q = new SynchronousQueue();
-        assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-    }
-
-    /**
-     * Interrupted timed poll throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testInterruptedTimedPoll() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue();
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.poll(SMALL_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offer fails; after offer succeeds;
-     *  on interruption throws
-     */
-    public void testTimedPollWithOffer() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    shouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * Interrupted timed poll throws InterruptedException instead of
-     * returning timeout status
-     */
-    public void testFairInterruptedTimedPoll() throws InterruptedException {
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                SynchronousQueue q = new SynchronousQueue(true);
-                q.poll(SMALL_DELAY_MS, MILLISECONDS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     *  timed poll before a delayed offer fails; after offer succeeds;
-     *  on interruption throws
-     */
-    public void testFairTimedPollWithOffer() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue(true);
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll(SHORT_DELAY_MS, MILLISECONDS));
-                assertSame(zero, q.poll(LONG_DELAY_MS, MILLISECONDS));
-                try {
-                    q.poll(LONG_DELAY_MS, MILLISECONDS);
-                    threadShouldThrow();
-                } catch (InterruptedException success) {}
-            }});
-
-        t.start();
-        Thread.sleep(SMALL_DELAY_MS);
-        assertTrue(q.offer(zero, SHORT_DELAY_MS, MILLISECONDS));
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * peek returns null
-     */
-    public void testPeek() {
-        SynchronousQueue q = new SynchronousQueue();
-        assertNull(q.peek());
-    }
-
-    /**
-     * element throws NSEE
-     */
-    public void testElement() {
-        SynchronousQueue q = new SynchronousQueue();
-        try {
-            q.element();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove throws NSEE if no active taker
-     */
-    public void testRemove() {
-        SynchronousQueue q = new SynchronousQueue();
-        try {
-            q.remove();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * remove(x) returns false
-     */
-    public void testRemoveElement() {
-        SynchronousQueue q = new SynchronousQueue();
-        assertFalse(q.remove(zero));
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * contains returns false
-     */
-    public void testContains() {
-        SynchronousQueue q = new SynchronousQueue();
-        assertFalse(q.contains(zero));
-    }
-
-    /**
-     * clear ensures isEmpty
-     */
-    public void testClear() {
-        SynchronousQueue q = new SynchronousQueue();
-        q.clear();
-        assertTrue(q.isEmpty());
-    }
-
-    /**
-     * containsAll returns false unless empty
-     */
-    public void testContainsAll() {
-        SynchronousQueue q = new SynchronousQueue();
-        Integer[] empty = new Integer[0];
-        assertTrue(q.containsAll(Arrays.asList(empty)));
-        Integer[] ints = new Integer[1]; ints[0] = zero;
-        assertFalse(q.containsAll(Arrays.asList(ints)));
-    }
-
-    /**
-     * retainAll returns false
-     */
-    public void testRetainAll() {
-        SynchronousQueue q = new SynchronousQueue();
-        Integer[] empty = new Integer[0];
-        assertFalse(q.retainAll(Arrays.asList(empty)));
-        Integer[] ints = new Integer[1]; ints[0] = zero;
-        assertFalse(q.retainAll(Arrays.asList(ints)));
-    }
-
-    /**
-     * removeAll returns false
-     */
-    public void testRemoveAll() {
-        SynchronousQueue q = new SynchronousQueue();
-        Integer[] empty = new Integer[0];
-        assertFalse(q.removeAll(Arrays.asList(empty)));
-        Integer[] ints = new Integer[1]; ints[0] = zero;
-        assertFalse(q.containsAll(Arrays.asList(ints)));
-    }
-
-
-    /**
-     * toArray is empty
-     */
-    public void testToArray() {
-        SynchronousQueue q = new SynchronousQueue();
-        Object[] o = q.toArray();
-        assertEquals(o.length, 0);
-    }
-
-    /**
-     * toArray(a) is nulled at position 0
-     */
-    public void testToArray2() {
-        SynchronousQueue q = new SynchronousQueue();
-        Integer[] ints = new Integer[1];
-        assertNull(ints[0]);
-    }
-
-    /**
-     * toArray(null) throws NPE
-     */
-    public void testToArray_BadArg() {
-        SynchronousQueue q = new SynchronousQueue();
-        try {
-            Object o[] = q.toArray(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * iterator does not traverse any elements
-     */
-    public void testIterator() {
-        SynchronousQueue q = new SynchronousQueue();
-        Iterator it = q.iterator();
-        assertFalse(it.hasNext());
-        try {
-            Object x = it.next();
-            shouldThrow();
-        } catch (NoSuchElementException success) {}
-    }
-
-    /**
-     * iterator remove throws ISE
-     */
-    public void testIteratorRemove() {
-        SynchronousQueue q = new SynchronousQueue();
-        Iterator it = q.iterator();
-        try {
-            it.remove();
-            shouldThrow();
-        } catch (IllegalStateException success) {
-        } catch (UnsupportedOperationException success) { // android-added
-        }
-    }
-
-    /**
-     * toString returns a non-null string
-     */
-    public void testToString() {
-        SynchronousQueue q = new SynchronousQueue();
-        String s = q.toString();
-        assertNotNull(s);
-    }
-
-
-    /**
-     * offer transfers elements across Executor tasks
-     */
-    public void testOfferInExecutor() {
-        final SynchronousQueue q = new SynchronousQueue();
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertFalse(q.offer(one));
-                assertTrue(q.offer(one, MEDIUM_DELAY_MS, MILLISECONDS));
-                assertEquals(0, q.remainingCapacity());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SMALL_DELAY_MS);
-                assertSame(one, q.take());
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * poll retrieves elements across Executor threads
-     */
-    public void testPollInExecutor() {
-        final SynchronousQueue q = new SynchronousQueue();
-        ExecutorService executor = Executors.newFixedThreadPool(2);
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                assertNull(q.poll());
-                assertSame(one, q.poll(MEDIUM_DELAY_MS, MILLISECONDS));
-                assertTrue(q.isEmpty());
-            }});
-
-        executor.execute(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(SHORT_DELAY_MS);
-                q.put(one);
-            }});
-
-        joinPool(executor);
-    }
-
-    /**
-     * a deserialized serialized queue is usable
-     */
-    public void testSerialization() throws Exception {
-        SynchronousQueue q = new SynchronousQueue();
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        SynchronousQueue r = (SynchronousQueue)in.readObject();
-        assertEquals(q.size(), r.size());
-        while (!q.isEmpty())
-            assertEquals(q.remove(), r.remove());
-    }
-
-    /**
-     * drainTo(null) throws NPE
-     */
-    public void testDrainToNull() {
-        SynchronousQueue q = new SynchronousQueue();
-        try {
-            q.drainTo(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this) throws IAE
-     */
-    public void testDrainToSelf() {
-        SynchronousQueue q = new SynchronousQueue();
-        try {
-            q.drainTo(q);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c) of empty queue doesn't transfer elements
-     */
-    public void testDrainTo() {
-        SynchronousQueue q = new SynchronousQueue();
-        ArrayList l = new ArrayList();
-        q.drainTo(l);
-        assertEquals(q.size(), 0);
-        assertEquals(l.size(), 0);
-    }
-
-    /**
-     * drainTo empties queue, unblocking a waiting put.
-     */
-    public void testDrainToWithActivePut() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue();
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(new Integer(1));
-            }});
-
-        t.start();
-        ArrayList l = new ArrayList();
-        Thread.sleep(SHORT_DELAY_MS);
-        q.drainTo(l);
-        assertTrue(l.size() <= 1);
-        if (l.size() > 0)
-            assertEquals(l.get(0), new Integer(1));
-        t.join();
-        assertTrue(l.size() <= 1);
-    }
-
-    /**
-     * drainTo(null, n) throws NPE
-     */
-    public void testDrainToNullN() {
-        SynchronousQueue q = new SynchronousQueue();
-        try {
-            q.drainTo(null, 0);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * drainTo(this, n) throws IAE
-     */
-    public void testDrainToSelfN() {
-        SynchronousQueue q = new SynchronousQueue();
-        try {
-            q.drainTo(q, 0);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * drainTo(c, n) empties up to n elements of queue into c
-     */
-    public void testDrainToN() throws InterruptedException {
-        final SynchronousQueue q = new SynchronousQueue();
-        Thread t1 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(one);
-            }});
-
-        Thread t2 = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                q.put(two);
-            }});
-
-        t1.start();
-        t2.start();
-        ArrayList l = new ArrayList();
-        Thread.sleep(SHORT_DELAY_MS);
-        q.drainTo(l, 1);
-        assertTrue(l.size() == 1);
-        q.drainTo(l, 1);
-        assertTrue(l.size() == 2);
-        assertTrue(l.contains(one));
-        assertTrue(l.contains(two));
-        t1.join();
-        t2.join();
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/SystemTest.java b/luni/src/test/java/tests/api/java/util/concurrent/SystemTest.java
deleted file mode 100644
index e906186..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/SystemTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-
-public class SystemTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(SystemTest.class);
-    }
-
-    /**
-     * Worst case rounding for millisecs; set for 60 cycle millis clock.
-     * This value might need to be changed on JVMs with coarser
-     *  System.currentTimeMillis clocks.
-     */
-    static final long MILLIS_ROUND = 17;
-
-    /**
-     * Nanos between readings of millis is no longer than millis (plus
-     * possible rounding).
-     * This shows only that nano timing not (much) worse than milli.
-     */
-    public void testNanoTime1() throws InterruptedException {
-        long m1 = System.currentTimeMillis();
-        Thread.sleep(1);
-        long n1 = System.nanoTime();
-        Thread.sleep(SHORT_DELAY_MS);
-        long n2 = System.nanoTime();
-        Thread.sleep(1);
-        long m2 = System.currentTimeMillis();
-        long millis = m2 - m1;
-        long nanos = n2 - n1;
-        assertTrue(nanos >= 0);
-        long nanosAsMillis = nanos / 1000000;
-        assertTrue(nanosAsMillis <= millis + MILLIS_ROUND);
-    }
-
-    /**
-     * Millis between readings of nanos is less than nanos, adjusting
-     * for rounding.
-     * This shows only that nano timing not (much) worse than milli.
-     */
-    public void testNanoTime2() throws InterruptedException {
-        long n1 = System.nanoTime();
-        Thread.sleep(1);
-        long m1 = System.currentTimeMillis();
-        Thread.sleep(SHORT_DELAY_MS);
-        long m2 = System.currentTimeMillis();
-        Thread.sleep(1);
-        long n2 = System.nanoTime();
-        long millis = m2 - m1;
-        long nanos = n2 - n1;
-
-        assertTrue(nanos >= 0);
-        long nanosAsMillis = nanos / 1000000;
-        assertTrue(millis <= nanosAsMillis + MILLIS_ROUND);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ThreadLocalTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ThreadLocalTest.java
deleted file mode 100644
index d54bce0..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ThreadLocalTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.Semaphore;
-
-public class ThreadLocalTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ThreadLocalTest.class);
-    }
-
-    static ThreadLocal<Integer> tl = new ThreadLocal<Integer>() {
-            public Integer initialValue() {
-                return one;
-            }
-        };
-
-    static InheritableThreadLocal<Integer> itl =
-        new InheritableThreadLocal<Integer>() {
-            protected Integer initialValue() {
-                return zero;
-            }
-
-            protected Integer childValue(Integer parentValue) {
-                return new Integer(parentValue.intValue() + 1);
-            }
-        };
-
-    /**
-     * remove causes next access to return initial value
-     */
-    public void testRemove() {
-        assertSame(tl.get(), one);
-        tl.set(two);
-        assertSame(tl.get(), two);
-        tl.remove();
-        assertSame(tl.get(), one);
-    }
-
-    /**
-     * remove in InheritableThreadLocal causes next access to return
-     * initial value
-     */
-    public void testRemoveITL() {
-        assertSame(itl.get(), zero);
-        itl.set(two);
-        assertSame(itl.get(), two);
-        itl.remove();
-        assertSame(itl.get(), zero);
-    }
-
-    private class ITLThread extends Thread {
-        final int[] x;
-        ITLThread(int[] array) { x = array; }
-        public void run() {
-            Thread child = null;
-            if (itl.get().intValue() < x.length - 1) {
-                child = new ITLThread(x);
-                child.start();
-            }
-            Thread.currentThread().yield();
-
-            int threadId = itl.get().intValue();
-            for (int j = 0; j < threadId; j++) {
-                x[threadId]++;
-                Thread.currentThread().yield();
-            }
-
-            if (child != null) { // Wait for child (if any)
-                try {
-                    child.join();
-                } catch (InterruptedException e) {
-                    threadUnexpectedException(e);
-                }
-            }
-        }
-    }
-
-    /**
-     * InheritableThreadLocal propagates generic values.
-     */
-    public void testGenericITL() throws InterruptedException {
-        final int threadCount = 10;
-        final int x[] = new int[threadCount];
-        Thread progenitor = new ITLThread(x);
-        progenitor.start();
-        progenitor.join();
-        for (int i = 0; i < threadCount; i++) {
-            assertEquals(i, x[i]);
-        }
-    }
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ThreadPoolExecutorSubclassTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ThreadPoolExecutorSubclassTest.java
deleted file mode 100644
index 911a35f..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ThreadPoolExecutorSubclassTest.java
+++ /dev/null
@@ -1,1578 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.locks.*;
-
-import junit.framework.*;
-import java.util.*;
-
-public class ThreadPoolExecutorSubclassTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ThreadPoolExecutorSubclassTest.class);
-    }
-
-    static class CustomTask<V> implements RunnableFuture<V> {
-        final Callable<V> callable;
-        final ReentrantLock lock = new ReentrantLock();
-        final Condition cond = lock.newCondition();
-        boolean done;
-        boolean cancelled;
-        V result;
-        Thread thread;
-        Exception exception;
-        CustomTask(Callable<V> c) {
-            if (c == null) throw new NullPointerException();
-            callable = c;
-        }
-        CustomTask(final Runnable r, final V res) {
-            if (r == null) throw new NullPointerException();
-            callable = new Callable<V>() {
-            public V call() throws Exception { r.run(); return res; }};
-        }
-        public boolean isDone() {
-            lock.lock(); try { return done; } finally { lock.unlock() ; }
-        }
-        public boolean isCancelled() {
-            lock.lock(); try { return cancelled; } finally { lock.unlock() ; }
-        }
-        public boolean cancel(boolean mayInterrupt) {
-            lock.lock();
-            try {
-                if (!done) {
-                    cancelled = true;
-                    done = true;
-                    if (mayInterrupt && thread != null)
-                        thread.interrupt();
-                    return true;
-                }
-                return false;
-            }
-            finally { lock.unlock() ; }
-        }
-        public void run() {
-            boolean runme;
-            lock.lock();
-            try {
-                runme = !done;
-                if (!runme)
-                    thread = Thread.currentThread();
-            }
-            finally { lock.unlock() ; }
-            if (!runme) return;
-            V v = null;
-            Exception e = null;
-            try {
-                v = callable.call();
-            }
-            catch (Exception ex) {
-                e = ex;
-            }
-            lock.lock();
-            try {
-                result = v;
-                exception = e;
-                done = true;
-                thread = null;
-                cond.signalAll();
-            }
-            finally { lock.unlock(); }
-        }
-        public V get() throws InterruptedException, ExecutionException {
-            lock.lock();
-            try {
-                while (!done)
-                    cond.await();
-                if (exception != null)
-                    throw new ExecutionException(exception);
-                return result;
-            }
-            finally { lock.unlock(); }
-        }
-        public V get(long timeout, TimeUnit unit)
-            throws InterruptedException, ExecutionException, TimeoutException {
-            long nanos = unit.toNanos(timeout);
-            lock.lock();
-            try {
-                for (;;) {
-                    if (done) break;
-                    if (nanos < 0)
-                        throw new TimeoutException();
-                    nanos = cond.awaitNanos(nanos);
-                }
-                if (exception != null)
-                    throw new ExecutionException(exception);
-                return result;
-            }
-            finally { lock.unlock(); }
-        }
-    }
-
-
-    static class CustomTPE extends ThreadPoolExecutor {
-        protected <V> RunnableFuture<V> newTaskFor(Callable<V> c) {
-            return new CustomTask<V>(c);
-        }
-        protected <V> RunnableFuture<V> newTaskFor(Runnable r, V v) {
-            return new CustomTask<V>(r, v);
-        }
-
-        CustomTPE(int corePoolSize,
-                  int maximumPoolSize,
-                  long keepAliveTime,
-                  TimeUnit unit,
-                  BlockingQueue<Runnable> workQueue) {
-            super(corePoolSize, maximumPoolSize, keepAliveTime, unit,
-                  workQueue);
-        }
-        CustomTPE(int corePoolSize,
-                  int maximumPoolSize,
-                  long keepAliveTime,
-                  TimeUnit unit,
-                  BlockingQueue<Runnable> workQueue,
-                  ThreadFactory threadFactory) {
-        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
-             threadFactory);
-        }
-
-        CustomTPE(int corePoolSize,
-                  int maximumPoolSize,
-                  long keepAliveTime,
-                  TimeUnit unit,
-                  BlockingQueue<Runnable> workQueue,
-                  RejectedExecutionHandler handler) {
-        super(corePoolSize, maximumPoolSize, keepAliveTime, unit, workQueue,
-              handler);
-        }
-        CustomTPE(int corePoolSize,
-                  int maximumPoolSize,
-                  long keepAliveTime,
-                  TimeUnit unit,
-                  BlockingQueue<Runnable> workQueue,
-                  ThreadFactory threadFactory,
-                  RejectedExecutionHandler handler) {
-            super(corePoolSize, maximumPoolSize, keepAliveTime, unit,
-              workQueue, threadFactory, handler);
-        }
-
-        volatile boolean beforeCalled = false;
-        volatile boolean afterCalled = false;
-        volatile boolean terminatedCalled = false;
-        public CustomTPE() {
-            super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>());
-        }
-        protected void beforeExecute(Thread t, Runnable r) {
-            beforeCalled = true;
-        }
-        protected void afterExecute(Runnable r, Throwable t) {
-            afterCalled = true;
-        }
-        protected void terminated() {
-            terminatedCalled = true;
-        }
-
-    }
-
-    static class FailingThreadFactory implements ThreadFactory {
-        int calls = 0;
-        public Thread newThread(Runnable r) {
-            if (++calls > 1) return null;
-            return new Thread(r);
-        }
-    }
-
-
-    /**
-     *  execute successfully executes a runnable
-     */
-    public void testExecute() throws InterruptedException {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            p1.execute(new ShortRunnable());
-            Thread.sleep(SMALL_DELAY_MS);
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *  getActiveCount increases but doesn't overestimate, when a
-     *  thread becomes active
-     */
-    public void testGetActiveCount() throws InterruptedException {
-        ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getActiveCount());
-        p2.execute(new MediumRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, p2.getActiveCount());
-        joinPool(p2);
-    }
-
-    /**
-     *  prestartCoreThread starts a thread if under corePoolSize, else doesn't
-     */
-    public void testPrestartCoreThread() {
-        ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getPoolSize());
-        assertTrue(p2.prestartCoreThread());
-        assertEquals(1, p2.getPoolSize());
-        assertTrue(p2.prestartCoreThread());
-        assertEquals(2, p2.getPoolSize());
-        assertFalse(p2.prestartCoreThread());
-        assertEquals(2, p2.getPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *  prestartAllCoreThreads starts all corePoolSize threads
-     */
-    public void testPrestartAllCoreThreads() {
-        ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getPoolSize());
-        p2.prestartAllCoreThreads();
-        assertEquals(2, p2.getPoolSize());
-        p2.prestartAllCoreThreads();
-        assertEquals(2, p2.getPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getCompletedTaskCount increases, but doesn't overestimate,
-     *   when tasks complete
-     */
-    public void testGetCompletedTaskCount() throws InterruptedException {
-        ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getCompletedTaskCount());
-        p2.execute(new ShortRunnable());
-        Thread.sleep(SMALL_DELAY_MS);
-        assertEquals(1, p2.getCompletedTaskCount());
-        try { p2.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p2);
-    }
-
-    /**
-     *   getCorePoolSize returns size given in constructor if not otherwise set
-     */
-    public void testGetCorePoolSize() {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(1, p1.getCorePoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *   getKeepAliveTime returns value given in constructor if not otherwise set
-     */
-    public void testGetKeepAliveTime() {
-        ThreadPoolExecutor p2 = new CustomTPE(2, 2, 1000, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(1, p2.getKeepAliveTime(TimeUnit.SECONDS));
-        joinPool(p2);
-    }
-
-
-    /**
-     * getThreadFactory returns factory in constructor if not set
-     */
-    public void testGetThreadFactory() {
-        ThreadFactory tf = new SimpleThreadFactory();
-        ThreadPoolExecutor p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10), tf, new NoOpREHandler());
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-    /**
-     * setThreadFactory sets the thread factory returned by getThreadFactory
-     */
-    public void testSetThreadFactory() {
-        ThreadPoolExecutor p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        ThreadFactory tf = new SimpleThreadFactory();
-        p.setThreadFactory(tf);
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-
-    /**
-     * setThreadFactory(null) throws NPE
-     */
-    public void testSetThreadFactoryNull() {
-        ThreadPoolExecutor p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            p.setThreadFactory(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     * getRejectedExecutionHandler returns handler in constructor if not set
-     */
-    public void testGetRejectedExecutionHandler() {
-        RejectedExecutionHandler h = new NoOpREHandler();
-        ThreadPoolExecutor p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10), h);
-        assertSame(h, p.getRejectedExecutionHandler());
-        joinPool(p);
-    }
-
-    /**
-     * setRejectedExecutionHandler sets the handler returned by
-     * getRejectedExecutionHandler
-     */
-    public void testSetRejectedExecutionHandler() {
-        ThreadPoolExecutor p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        RejectedExecutionHandler h = new NoOpREHandler();
-        p.setRejectedExecutionHandler(h);
-        assertSame(h, p.getRejectedExecutionHandler());
-        joinPool(p);
-    }
-
-
-    /**
-     * setRejectedExecutionHandler(null) throws NPE
-     */
-    public void testSetRejectedExecutionHandlerNull() {
-        ThreadPoolExecutor p = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            p.setRejectedExecutionHandler(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(p);
-        }
-    }
-
-
-    /**
-     *   getLargestPoolSize increases, but doesn't overestimate, when
-     *   multiple threads active
-     */
-    public void testGetLargestPoolSize() throws InterruptedException {
-        ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getLargestPoolSize());
-        p2.execute(new MediumRunnable());
-        p2.execute(new MediumRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, p2.getLargestPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getMaximumPoolSize returns value given in constructor if not
-     *   otherwise set
-     */
-    public void testGetMaximumPoolSize() {
-        ThreadPoolExecutor p2 = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(2, p2.getMaximumPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getPoolSize increases, but doesn't overestimate, when threads
-     *   become active
-     */
-    public void testGetPoolSize() {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p1.getPoolSize());
-        p1.execute(new MediumRunnable());
-        assertEquals(1, p1.getPoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *  getTaskCount increases, but doesn't overestimate, when tasks submitted
-     */
-    public void testGetTaskCount() throws InterruptedException {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p1.getTaskCount());
-        p1.execute(new MediumRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, p1.getTaskCount());
-        joinPool(p1);
-    }
-
-    /**
-     *   isShutDown is false before shutdown, true after
-     */
-    public void testIsShutdown() {
-
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(p1.isShutdown());
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(p1.isShutdown());
-        joinPool(p1);
-    }
-
-
-    /**
-     *  isTerminated is false before termination, true after
-     */
-    public void testIsTerminated() throws InterruptedException {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(p1.isTerminated());
-        try {
-            p1.execute(new MediumRunnable());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-    }
-
-    /**
-     *  isTerminating is not true when running or when terminated
-     */
-    public void testIsTerminating() throws InterruptedException {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(p1.isTerminating());
-        try {
-            p1.execute(new SmallRunnable());
-            assertFalse(p1.isTerminating());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-        assertFalse(p1.isTerminating());
-    }
-
-    /**
-     * getQueue returns the work queue, which contains queued tasks
-     */
-    public void testGetQueue() throws InterruptedException {
-        BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10);
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, q);
-        FutureTask[] tasks = new FutureTask[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = new FutureTask(new MediumPossiblyInterruptedRunnable(), Boolean.TRUE);
-            p1.execute(tasks[i]);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            BlockingQueue<Runnable> wq = p1.getQueue();
-            assertSame(q, wq);
-            assertFalse(wq.contains(tasks[0]));
-            assertTrue(wq.contains(tasks[4]));
-            for (int i = 1; i < 5; ++i)
-                tasks[i].cancel(true);
-            p1.shutdownNow();
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     * remove(task) removes queued task, and fails to remove active task
-     */
-    public void testRemove() throws InterruptedException {
-        BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10);
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, q);
-        FutureTask[] tasks = new FutureTask[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = new FutureTask(new MediumPossiblyInterruptedRunnable(), Boolean.TRUE);
-            p1.execute(tasks[i]);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            assertFalse(p1.remove(tasks[0]));
-            assertTrue(q.contains(tasks[4]));
-            assertTrue(q.contains(tasks[3]));
-            assertTrue(p1.remove(tasks[4]));
-            assertFalse(p1.remove(tasks[4]));
-            assertFalse(q.contains(tasks[4]));
-            assertTrue(q.contains(tasks[3]));
-            assertTrue(p1.remove(tasks[3]));
-            assertFalse(q.contains(tasks[3]));
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *   purge removes cancelled tasks from the queue
-     */
-    public void testPurge() {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        FutureTask[] tasks = new FutureTask[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = new FutureTask(new MediumPossiblyInterruptedRunnable(), Boolean.TRUE);
-            p1.execute(tasks[i]);
-        }
-        tasks[4].cancel(true);
-        tasks[3].cancel(true);
-        p1.purge();
-        long count = p1.getTaskCount();
-        assertTrue(count >= 2 && count < 5);
-        joinPool(p1);
-    }
-
-    /**
-     *  shutDownNow returns a list containing tasks that were not run
-     */
-    public void testShutDownNow() {
-        ThreadPoolExecutor p1 = new CustomTPE(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List l;
-        try {
-            for (int i = 0; i < 5; i++)
-                p1.execute(new MediumPossiblyInterruptedRunnable());
-        }
-        finally {
-            try {
-                l = p1.shutdownNow();
-            } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.isShutdown());
-        assertTrue(l.size() <= 4);
-    }
-
-    // Exception Tests
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor1() {
-        try {
-            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor2() {
-        try {
-            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor3() {
-        try {
-            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor4() {
-        try {
-            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor5() {
-        try {
-            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException() {
-        try {
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor6() {
-        try {
-            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor7() {
-        try {
-            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor8() {
-        try {
-            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor9() {
-        try {
-            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor10() {
-        try {
-            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException2() {
-        try {
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if threadFactory is set to null
-     */
-    public void testConstructorNullPointerException3() {
-        try {
-            ThreadFactory f = null;
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),f);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor11() {
-        try {
-            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor12() {
-        try {
-            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor13() {
-        try {
-            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor14() {
-        try {
-            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor15() {
-        try {
-            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException4() {
-        try {
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null,new NoOpREHandler());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if handler is set to null
-     */
-    public void testConstructorNullPointerException5() {
-        try {
-            RejectedExecutionHandler r = null;
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),r);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor16() {
-        try {
-            new CustomTPE(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor17() {
-        try {
-            new CustomTPE(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor18() {
-        try {
-            new CustomTPE(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor19() {
-        try {
-            new CustomTPE(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor20() {
-        try {
-            new CustomTPE(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException6() {
-        try {
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if handler is set to null
-     */
-    public void testConstructorNullPointerException7() {
-        try {
-            RejectedExecutionHandler r = null;
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),r);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if ThreadFactory is set top null
-     */
-    public void testConstructorNullPointerException8() {
-        try {
-            ThreadFactory f = null;
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),f,new NoOpREHandler());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     *  execute throws RejectedExecutionException
-     *  if saturated.
-     */
-    public void testSaturatedExecute() {
-        ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1));
-        try {
-
-            for (int i = 0; i < 5; ++i) {
-                p.execute(new MediumRunnable());
-            }
-            shouldThrow();
-        } catch (RejectedExecutionException success) {}
-        joinPool(p);
-    }
-
-    /**
-     *  executor using CallerRunsPolicy runs task if saturated.
-     */
-    public void testSaturatedExecute2() {
-        RejectedExecutionHandler h = new CustomTPE.CallerRunsPolicy();
-        ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-        try {
-
-            TrackedNoOpRunnable[] tasks = new TrackedNoOpRunnable[5];
-            for (int i = 0; i < 5; ++i) {
-                tasks[i] = new TrackedNoOpRunnable();
-            }
-            TrackedLongRunnable mr = new TrackedLongRunnable();
-            p.execute(mr);
-            for (int i = 0; i < 5; ++i) {
-                p.execute(tasks[i]);
-            }
-            for (int i = 1; i < 5; ++i) {
-                assertTrue(tasks[i].done);
-            }
-            try { p.shutdownNow(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  executor using DiscardPolicy drops task if saturated.
-     */
-    public void testSaturatedExecute3() {
-        RejectedExecutionHandler h = new CustomTPE.DiscardPolicy();
-        ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-        try {
-
-            TrackedNoOpRunnable[] tasks = new TrackedNoOpRunnable[5];
-            for (int i = 0; i < 5; ++i) {
-                tasks[i] = new TrackedNoOpRunnable();
-            }
-            p.execute(new TrackedLongRunnable());
-            for (int i = 0; i < 5; ++i) {
-                p.execute(tasks[i]);
-            }
-            for (int i = 0; i < 5; ++i) {
-                assertFalse(tasks[i].done);
-            }
-            try { p.shutdownNow(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  executor using DiscardOldestPolicy drops oldest task if saturated.
-     */
-    public void testSaturatedExecute4() {
-        RejectedExecutionHandler h = new CustomTPE.DiscardOldestPolicy();
-        ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-        try {
-            p.execute(new TrackedLongRunnable());
-            TrackedLongRunnable r2 = new TrackedLongRunnable();
-            p.execute(r2);
-            assertTrue(p.getQueue().contains(r2));
-            TrackedNoOpRunnable r3 = new TrackedNoOpRunnable();
-            p.execute(r3);
-            assertFalse(p.getQueue().contains(r2));
-            assertTrue(p.getQueue().contains(r3));
-            try { p.shutdownNow(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  execute throws RejectedExecutionException if shutdown
-     */
-    public void testRejectedExecutionExceptionOnShutdown() {
-        ThreadPoolExecutor tpe =
-            new CustomTPE(1,1,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(1));
-        try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            tpe.execute(new NoOpRunnable());
-            shouldThrow();
-        } catch (RejectedExecutionException success) {}
-
-        joinPool(tpe);
-    }
-
-    /**
-     *  execute using CallerRunsPolicy drops task on shutdown
-     */
-    public void testCallerRunsOnShutdown() {
-        RejectedExecutionHandler h = new CustomTPE.CallerRunsPolicy();
-        ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-
-        try { p.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            p.execute(r);
-            assertFalse(r.done);
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  execute using DiscardPolicy drops task on shutdown
-     */
-    public void testDiscardOnShutdown() {
-        RejectedExecutionHandler h = new CustomTPE.DiscardPolicy();
-        ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-
-        try { p.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            p.execute(r);
-            assertFalse(r.done);
-        } finally {
-            joinPool(p);
-        }
-    }
-
-
-    /**
-     *  execute using DiscardOldestPolicy drops task on shutdown
-     */
-    public void testDiscardOldestOnShutdown() {
-        RejectedExecutionHandler h = new CustomTPE.DiscardOldestPolicy();
-        ThreadPoolExecutor p = new CustomTPE(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-
-        try { p.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            p.execute(r);
-            assertFalse(r.done);
-        } finally {
-            joinPool(p);
-        }
-    }
-
-
-    /**
-     *  execute (null) throws NPE
-     */
-    public void testExecuteNull() {
-        ThreadPoolExecutor tpe = null;
-        try {
-            tpe = new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
-            tpe.execute(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-
-        joinPool(tpe);
-    }
-
-    /**
-     *  setCorePoolSize of negative value throws IllegalArgumentException
-     */
-    public void testCorePoolSizeIllegalArgumentException() {
-        ThreadPoolExecutor tpe =
-            new CustomTPE(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.setCorePoolSize(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-    /**
-     *  setMaximumPoolSize(int) throws IllegalArgumentException if
-     *  given a value less the core pool size
-     */
-    public void testMaximumPoolSizeIllegalArgumentException() {
-        ThreadPoolExecutor tpe =
-            new CustomTPE(2,3,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.setMaximumPoolSize(1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-    /**
-     *  setMaximumPoolSize throws IllegalArgumentException
-     *  if given a negative value
-     */
-    public void testMaximumPoolSizeIllegalArgumentException2() {
-        ThreadPoolExecutor tpe =
-            new CustomTPE(2,3,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.setMaximumPoolSize(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-
-    /**
-     *  setKeepAliveTime  throws IllegalArgumentException
-     *  when given a negative value
-     */
-    public void testKeepAliveTimeIllegalArgumentException() {
-        ThreadPoolExecutor tpe =
-            new CustomTPE(2,3,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
-
-        try {
-            tpe.setKeepAliveTime(-1,MILLISECONDS);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-    /**
-     * terminated() is called on termination
-     */
-    public void testTerminated() {
-        CustomTPE tpe = new CustomTPE();
-        try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(tpe.terminatedCalled);
-        joinPool(tpe);
-    }
-
-    /**
-     * beforeExecute and afterExecute are called when executing task
-     */
-    public void testBeforeAfter() throws InterruptedException {
-        CustomTPE tpe = new CustomTPE();
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            tpe.execute(r);
-            Thread.sleep(SHORT_DELAY_MS);
-            assertTrue(r.done);
-            assertTrue(tpe.beforeCalled);
-            assertTrue(tpe.afterCalled);
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(tpe);
-        }
-    }
-
-    /**
-     * completed submit of callable returns result
-     */
-    public void testSubmitCallable() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            Future<String> future = e.submit(new StringTask());
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of runnable returns successfully
-     */
-    public void testSubmitRunnable() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            Future<?> future = e.submit(new NoOpRunnable());
-            future.get();
-            assertTrue(future.isDone());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of (runnable, result) returns result
-     */
-    public void testSubmitRunnable2() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-
-    /**
-     * invokeAny(null) throws NPE
-     */
-    public void testInvokeAny1() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(empty collection) throws IAE
-     */
-    public void testInvokeAny2() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws NPE if c has null elements
-     */
-    public void testInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testInvokeAny4() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) returns result of some task
-     */
-    public void testInvokeAny5() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(null) throws NPE
-     */
-    public void testInvokeAll1() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(empty collection) returns empty collection
-     */
-    public void testInvokeAll2() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) throws NPE if c has null elements
-     */
-    public void testInvokeAll3() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of element of invokeAll(c) throws exception on failed task
-     */
-    public void testInvokeAll4() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        List<Future<String>> futures = e.invokeAll(l);
-        assertEquals(1, futures.size());
-        try {
-            futures.get(0).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) returns results of all completed tasks
-     */
-    public void testInvokeAll5() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures = e.invokeAll(l);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-
-
-    /**
-     * timed invokeAny(null) throws NPE
-     */
-    public void testTimedInvokeAny1() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(,,null) throws NPE
-     */
-    public void testTimedInvokeAnyNullTimeUnit() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(empty collection) throws IAE
-     */
-    public void testTimedInvokeAny2() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testTimedInvokeAny4() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) returns result of some task
-     */
-    public void testTimedInvokeAny5() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(null) throws NPE
-     */
-    public void testTimedInvokeAll1() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(,,null) throws NPE
-     */
-    public void testTimedInvokeAllNullTimeUnit() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(empty collection) returns empty collection
-     */
-    public void testTimedInvokeAll2() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAll3() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of element of invokeAll(c) throws exception on failed task
-     */
-    public void testTimedInvokeAll4() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        List<Future<String>> futures =
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-        assertEquals(1, futures.size());
-        try {
-            futures.get(0).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) returns results of all completed tasks
-     */
-    public void testTimedInvokeAll5() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) cancels tasks not completed by timeout
-     */
-    public void testTimedInvokeAll6() throws Exception {
-        ExecutorService e = new CustomTPE(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS);
-            assertEquals(3, futures.size());
-            Iterator<Future<String>> it = futures.iterator();
-            Future<String> f1 = it.next();
-            Future<String> f2 = it.next();
-            Future<String> f3 = it.next();
-            assertTrue(f1.isDone());
-            assertTrue(f2.isDone());
-            assertTrue(f3.isDone());
-            assertFalse(f1.isCancelled());
-            assertTrue(f2.isCancelled());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * Execution continues if there is at least one thread even if
-     * thread factory fails to create more
-     */
-    public void testFailingThreadFactory() throws InterruptedException {
-        ExecutorService e = new CustomTPE(100, 100, LONG_DELAY_MS, MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new FailingThreadFactory());
-        try {
-            for (int k = 0; k < 100; ++k) {
-                e.execute(new NoOpRunnable());
-            }
-            Thread.sleep(LONG_DELAY_MS);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * allowsCoreThreadTimeOut is by default false.
-     */
-    public void testAllowsCoreThreadTimeOut() {
-        ThreadPoolExecutor tpe = new CustomTPE(2, 2, 1000, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(tpe.allowsCoreThreadTimeOut());
-        joinPool(tpe);
-    }
-
-    /**
-     * allowCoreThreadTimeOut(true) causes idle threads to time out
-     */
-    public void testAllowCoreThreadTimeOut_true() throws InterruptedException {
-        ThreadPoolExecutor tpe = new CustomTPE(2, 10, 10, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        tpe.allowCoreThreadTimeOut(true);
-        tpe.execute(new NoOpRunnable());
-        try {
-            Thread.sleep(MEDIUM_DELAY_MS);
-            assertEquals(0, tpe.getPoolSize());
-        } finally {
-            joinPool(tpe);
-        }
-    }
-
-    /**
-     * allowCoreThreadTimeOut(false) causes idle threads not to time out
-     */
-    public void testAllowCoreThreadTimeOut_false() throws InterruptedException {
-        ThreadPoolExecutor tpe = new CustomTPE(2, 10, 10, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        tpe.allowCoreThreadTimeOut(false);
-        tpe.execute(new NoOpRunnable());
-        try {
-            Thread.sleep(MEDIUM_DELAY_MS);
-            assertTrue(tpe.getPoolSize() >= 1);
-        } finally {
-            joinPool(tpe);
-        }
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ThreadPoolExecutorTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ThreadPoolExecutorTest.java
deleted file mode 100755
index b706185..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ThreadPoolExecutorTest.java
+++ /dev/null
@@ -1,1511 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import java.util.concurrent.*;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import java.util.concurrent.atomic.*;
-import junit.framework.*;
-import java.util.*;
-
-public class ThreadPoolExecutorTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ThreadPoolExecutorTest.class);
-    }
-
-    static class ExtendedTPE extends ThreadPoolExecutor {
-        volatile boolean beforeCalled = false;
-        volatile boolean afterCalled = false;
-        volatile boolean terminatedCalled = false;
-        public ExtendedTPE() {
-            super(1, 1, LONG_DELAY_MS, MILLISECONDS, new SynchronousQueue<Runnable>());
-        }
-        protected void beforeExecute(Thread t, Runnable r) {
-            beforeCalled = true;
-        }
-        protected void afterExecute(Runnable r, Throwable t) {
-            afterCalled = true;
-        }
-        protected void terminated() {
-            terminatedCalled = true;
-        }
-    }
-
-    static class FailingThreadFactory implements ThreadFactory {
-        int calls = 0;
-        public Thread newThread(Runnable r) {
-            if (++calls > 1) return null;
-            return new Thread(r);
-        }
-    }
-
-
-    /**
-     *  execute successfully executes a runnable
-     */
-    public void testExecute() throws InterruptedException {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            p1.execute(new ShortRunnable());
-            Thread.sleep(SMALL_DELAY_MS);
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *  getActiveCount increases but doesn't overestimate, when a
-     *  thread becomes active
-     */
-    public void testGetActiveCount() throws InterruptedException {
-        ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getActiveCount());
-        p2.execute(new MediumRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, p2.getActiveCount());
-        joinPool(p2);
-    }
-
-    /**
-     *  prestartCoreThread starts a thread if under corePoolSize, else doesn't
-     */
-    public void testPrestartCoreThread() {
-        ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getPoolSize());
-        assertTrue(p2.prestartCoreThread());
-        assertEquals(1, p2.getPoolSize());
-        assertTrue(p2.prestartCoreThread());
-        assertEquals(2, p2.getPoolSize());
-        assertFalse(p2.prestartCoreThread());
-        assertEquals(2, p2.getPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *  prestartAllCoreThreads starts all corePoolSize threads
-     */
-    public void testPrestartAllCoreThreads() {
-        ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getPoolSize());
-        p2.prestartAllCoreThreads();
-        assertEquals(2, p2.getPoolSize());
-        p2.prestartAllCoreThreads();
-        assertEquals(2, p2.getPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getCompletedTaskCount increases, but doesn't overestimate,
-     *   when tasks complete
-     */
-    public void testGetCompletedTaskCount() throws InterruptedException {
-        ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getCompletedTaskCount());
-        p2.execute(new ShortRunnable());
-        Thread.sleep(SMALL_DELAY_MS);
-        assertEquals(1, p2.getCompletedTaskCount());
-        try { p2.shutdown(); } catch (SecurityException ok) { return; }
-        joinPool(p2);
-    }
-
-    /**
-     *   getCorePoolSize returns size given in constructor if not otherwise set
-     */
-    public void testGetCorePoolSize() {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(1, p1.getCorePoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *   getKeepAliveTime returns value given in constructor if not otherwise set
-     */
-    public void testGetKeepAliveTime() {
-        ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, 1000, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(1, p2.getKeepAliveTime(TimeUnit.SECONDS));
-        joinPool(p2);
-    }
-
-
-    /**
-     * getThreadFactory returns factory in constructor if not set
-     */
-    public void testGetThreadFactory() {
-        ThreadFactory tf = new SimpleThreadFactory();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10), tf, new NoOpREHandler());
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-    /**
-     * setThreadFactory sets the thread factory returned by getThreadFactory
-     */
-    public void testSetThreadFactory() {
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        ThreadFactory tf = new SimpleThreadFactory();
-        p.setThreadFactory(tf);
-        assertSame(tf, p.getThreadFactory());
-        joinPool(p);
-    }
-
-
-    /**
-     * setThreadFactory(null) throws NPE
-     */
-    public void testSetThreadFactoryNull() {
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            p.setThreadFactory(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     * getRejectedExecutionHandler returns handler in constructor if not set
-     */
-    public void testGetRejectedExecutionHandler() {
-        RejectedExecutionHandler h = new NoOpREHandler();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10), h);
-        assertSame(h, p.getRejectedExecutionHandler());
-        joinPool(p);
-    }
-
-    /**
-     * setRejectedExecutionHandler sets the handler returned by
-     * getRejectedExecutionHandler
-     */
-    public void testSetRejectedExecutionHandler() {
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        RejectedExecutionHandler h = new NoOpREHandler();
-        p.setRejectedExecutionHandler(h);
-        assertSame(h, p.getRejectedExecutionHandler());
-        joinPool(p);
-    }
-
-
-    /**
-     * setRejectedExecutionHandler(null) throws NPE
-     */
-    public void testSetRejectedExecutionHandlerNull() {
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            p.setRejectedExecutionHandler(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(p);
-        }
-    }
-
-
-    /**
-     *   getLargestPoolSize increases, but doesn't overestimate, when
-     *   multiple threads active
-     */
-    public void testGetLargestPoolSize() throws InterruptedException {
-        ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p2.getLargestPoolSize());
-        p2.execute(new MediumRunnable());
-        p2.execute(new MediumRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(2, p2.getLargestPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getMaximumPoolSize returns value given in constructor if not
-     *   otherwise set
-     */
-    public void testGetMaximumPoolSize() {
-        ThreadPoolExecutor p2 = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(2, p2.getMaximumPoolSize());
-        joinPool(p2);
-    }
-
-    /**
-     *   getPoolSize increases, but doesn't overestimate, when threads
-     *   become active
-     */
-    public void testGetPoolSize() {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p1.getPoolSize());
-        p1.execute(new MediumRunnable());
-        assertEquals(1, p1.getPoolSize());
-        joinPool(p1);
-    }
-
-    /**
-     *  getTaskCount increases, but doesn't overestimate, when tasks submitted
-     */
-    public void testGetTaskCount() throws InterruptedException {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertEquals(0, p1.getTaskCount());
-        p1.execute(new MediumRunnable());
-        Thread.sleep(SHORT_DELAY_MS);
-        assertEquals(1, p1.getTaskCount());
-        joinPool(p1);
-    }
-
-    /**
-     *   isShutDown is false before shutdown, true after
-     */
-    public void testIsShutdown() {
-
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(p1.isShutdown());
-        try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(p1.isShutdown());
-        joinPool(p1);
-    }
-
-
-    /**
-     *  isTerminated is false before termination, true after
-     */
-    public void testIsTerminated() throws InterruptedException {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(p1.isTerminated());
-        try {
-            p1.execute(new MediumRunnable());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-    }
-
-    /**
-     *  isTerminating is not true when running or when terminated
-     */
-    public void testIsTerminating() throws InterruptedException {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(p1.isTerminating());
-        try {
-            p1.execute(new SmallRunnable());
-            assertFalse(p1.isTerminating());
-        } finally {
-            try { p1.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.awaitTermination(LONG_DELAY_MS, MILLISECONDS));
-        assertTrue(p1.isTerminated());
-        assertFalse(p1.isTerminating());
-    }
-
-    /**
-     * getQueue returns the work queue, which contains queued tasks
-     */
-    public void testGetQueue() throws InterruptedException {
-        BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10);
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, q);
-        FutureTask[] tasks = new FutureTask[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = new FutureTask(new MediumPossiblyInterruptedRunnable(), Boolean.TRUE);
-            p1.execute(tasks[i]);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            BlockingQueue<Runnable> wq = p1.getQueue();
-            assertSame(q, wq);
-            assertFalse(wq.contains(tasks[0]));
-            assertTrue(wq.contains(tasks[4]));
-            for (int i = 1; i < 5; ++i)
-                tasks[i].cancel(true);
-            p1.shutdownNow();
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     * remove(task) removes queued task, and fails to remove active task
-     */
-    public void testRemove() throws InterruptedException {
-        BlockingQueue<Runnable> q = new ArrayBlockingQueue<Runnable>(10);
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, q);
-        FutureTask[] tasks = new FutureTask[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = new FutureTask(new MediumPossiblyInterruptedRunnable(), Boolean.TRUE);
-            p1.execute(tasks[i]);
-        }
-        try {
-            Thread.sleep(SHORT_DELAY_MS);
-            assertFalse(p1.remove(tasks[0]));
-            assertTrue(q.contains(tasks[4]));
-            assertTrue(q.contains(tasks[3]));
-            assertTrue(p1.remove(tasks[4]));
-            assertFalse(p1.remove(tasks[4]));
-            assertFalse(q.contains(tasks[4]));
-            assertTrue(q.contains(tasks[3]));
-            assertTrue(p1.remove(tasks[3]));
-            assertFalse(q.contains(tasks[3]));
-        } finally {
-            joinPool(p1);
-        }
-    }
-
-    /**
-     *   purge removes cancelled tasks from the queue
-     */
-    public void testPurge() {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        FutureTask[] tasks = new FutureTask[5];
-        for (int i = 0; i < 5; i++) {
-            tasks[i] = new FutureTask(new MediumPossiblyInterruptedRunnable(), Boolean.TRUE);
-            p1.execute(tasks[i]);
-        }
-        tasks[4].cancel(true);
-        tasks[3].cancel(true);
-        p1.purge();
-        long count = p1.getTaskCount();
-        assertTrue(count >= 2 && count < 5);
-        joinPool(p1);
-    }
-
-    /**
-     *  shutDownNow returns a list containing tasks that were not run
-     */
-    public void testShutDownNow() {
-        ThreadPoolExecutor p1 = new ThreadPoolExecutor(1, 1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List l;
-        try {
-            for (int i = 0; i < 5; i++)
-                p1.execute(new MediumPossiblyInterruptedRunnable());
-        }
-        finally {
-            try {
-                l = p1.shutdownNow();
-            } catch (SecurityException ok) { return; }
-        }
-        assertTrue(p1.isShutdown());
-        assertTrue(l.size() <= 4);
-    }
-
-    // Exception Tests
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor1() {
-        try {
-            new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor2() {
-        try {
-            new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor3() {
-        try {
-            new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor4() {
-        try {
-            new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor5() {
-        try {
-            new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException() {
-        try {
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor6() {
-        try {
-            new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor7() {
-        try {
-            new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor8() {
-        try {
-            new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor9() {
-        try {
-            new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor10() {
-        try {
-            new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException2() {
-        try {
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if threadFactory is set to null
-     */
-    public void testConstructorNullPointerException3() {
-        try {
-            ThreadFactory f = null;
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),f);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor11() {
-        try {
-            new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor12() {
-        try {
-            new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor13() {
-        try {
-            new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor14() {
-        try {
-            new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor15() {
-        try {
-            new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException4() {
-        try {
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null,new NoOpREHandler());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if handler is set to null
-     */
-    public void testConstructorNullPointerException5() {
-        try {
-            RejectedExecutionHandler r = null;
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),r);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     * Constructor throws if corePoolSize argument is less than zero
-     */
-    public void testConstructor16() {
-        try {
-            new ThreadPoolExecutor(-1,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is less than zero
-     */
-    public void testConstructor17() {
-        try {
-            new ThreadPoolExecutor(1,-1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if maximumPoolSize is equal to zero
-     */
-    public void testConstructor18() {
-        try {
-            new ThreadPoolExecutor(1,0,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if keepAliveTime is less than zero
-     */
-    public void testConstructor19() {
-        try {
-            new ThreadPoolExecutor(1,2,-1L,MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if corePoolSize is greater than the maximumPoolSize
-     */
-    public void testConstructor20() {
-        try {
-            new ThreadPoolExecutor(2,1,LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {}
-    }
-
-    /**
-     * Constructor throws if workQueue is set to null
-     */
-    public void testConstructorNullPointerException6() {
-        try {
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,null,new SimpleThreadFactory(),new NoOpREHandler());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if handler is set to null
-     */
-    public void testConstructorNullPointerException7() {
-        try {
-            RejectedExecutionHandler r = null;
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),new SimpleThreadFactory(),r);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-    /**
-     * Constructor throws if ThreadFactory is set top null
-     */
-    public void testConstructorNullPointerException8() {
-        try {
-            ThreadFactory f = null;
-            new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10),f,new NoOpREHandler());
-            shouldThrow();
-        } catch (NullPointerException success) {}
-    }
-
-
-    /**
-     *  execute throws RejectedExecutionException
-     *  if saturated.
-     */
-    public void testSaturatedExecute() {
-        ThreadPoolExecutor p =
-            new ThreadPoolExecutor(1, 1,
-                                   LONG_DELAY_MS, MILLISECONDS,
-                                   new ArrayBlockingQueue<Runnable>(1));
-        try {
-            for (int i = 0; i < 2; ++i)
-                p.execute(new MediumRunnable());
-            for (int i = 0; i < 2; ++i) {
-                try {
-                    p.execute(new MediumRunnable());
-                    shouldThrow();
-                } catch (RejectedExecutionException success) {}
-            }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  executor using CallerRunsPolicy runs task if saturated.
-     */
-    public void testSaturatedExecute2() {
-        RejectedExecutionHandler h = new ThreadPoolExecutor.CallerRunsPolicy();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-        try {
-
-            TrackedNoOpRunnable[] tasks = new TrackedNoOpRunnable[5];
-            for (int i = 0; i < 5; ++i) {
-                tasks[i] = new TrackedNoOpRunnable();
-            }
-            TrackedLongRunnable mr = new TrackedLongRunnable();
-            p.execute(mr);
-            for (int i = 0; i < 5; ++i) {
-                p.execute(tasks[i]);
-            }
-            for (int i = 1; i < 5; ++i) {
-                assertTrue(tasks[i].done);
-            }
-            try { p.shutdownNow(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  executor using DiscardPolicy drops task if saturated.
-     */
-    public void testSaturatedExecute3() {
-        RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardPolicy();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-        try {
-
-            TrackedNoOpRunnable[] tasks = new TrackedNoOpRunnable[5];
-            for (int i = 0; i < 5; ++i) {
-                tasks[i] = new TrackedNoOpRunnable();
-            }
-            p.execute(new TrackedLongRunnable());
-            for (int i = 0; i < 5; ++i) {
-                p.execute(tasks[i]);
-            }
-            for (int i = 0; i < 5; ++i) {
-                assertFalse(tasks[i].done);
-            }
-            try { p.shutdownNow(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  executor using DiscardOldestPolicy drops oldest task if saturated.
-     */
-    public void testSaturatedExecute4() {
-        RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardOldestPolicy();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-        try {
-            p.execute(new TrackedLongRunnable());
-            TrackedLongRunnable r2 = new TrackedLongRunnable();
-            p.execute(r2);
-            assertTrue(p.getQueue().contains(r2));
-            TrackedNoOpRunnable r3 = new TrackedNoOpRunnable();
-            p.execute(r3);
-            assertFalse(p.getQueue().contains(r2));
-            assertTrue(p.getQueue().contains(r3));
-            try { p.shutdownNow(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  execute throws RejectedExecutionException if shutdown
-     */
-    public void testRejectedExecutionExceptionOnShutdown() {
-        ThreadPoolExecutor tpe =
-            new ThreadPoolExecutor(1,1,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(1));
-        try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            tpe.execute(new NoOpRunnable());
-            shouldThrow();
-        } catch (RejectedExecutionException success) {}
-
-        joinPool(tpe);
-    }
-
-    /**
-     *  execute using CallerRunsPolicy drops task on shutdown
-     */
-    public void testCallerRunsOnShutdown() {
-        RejectedExecutionHandler h = new ThreadPoolExecutor.CallerRunsPolicy();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-
-        try { p.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            p.execute(r);
-            assertFalse(r.done);
-        } finally {
-            joinPool(p);
-        }
-    }
-
-    /**
-     *  execute using DiscardPolicy drops task on shutdown
-     */
-    public void testDiscardOnShutdown() {
-        RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardPolicy();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-
-        try { p.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            p.execute(r);
-            assertFalse(r.done);
-        } finally {
-            joinPool(p);
-        }
-    }
-
-
-    /**
-     *  execute using DiscardOldestPolicy drops task on shutdown
-     */
-    public void testDiscardOldestOnShutdown() {
-        RejectedExecutionHandler h = new ThreadPoolExecutor.DiscardOldestPolicy();
-        ThreadPoolExecutor p = new ThreadPoolExecutor(1,1, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(1), h);
-
-        try { p.shutdown(); } catch (SecurityException ok) { return; }
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            p.execute(r);
-            assertFalse(r.done);
-        } finally {
-            joinPool(p);
-        }
-    }
-
-
-    /**
-     *  execute (null) throws NPE
-     */
-    public void testExecuteNull() {
-        ThreadPoolExecutor tpe = new ThreadPoolExecutor(1,2,LONG_DELAY_MS, MILLISECONDS,new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.execute(null);
-            shouldThrow();
-        } catch (NullPointerException success) {}
-
-        joinPool(tpe);
-    }
-
-    /**
-     *  setCorePoolSize of negative value throws IllegalArgumentException
-     */
-    public void testCorePoolSizeIllegalArgumentException() {
-        ThreadPoolExecutor tpe =
-            new ThreadPoolExecutor(1, 2,
-                                   LONG_DELAY_MS, MILLISECONDS,
-                                   new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.setCorePoolSize(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-    /**
-     *  setMaximumPoolSize(int) throws IllegalArgumentException if
-     *  given a value less the core pool size
-     */
-    public void testMaximumPoolSizeIllegalArgumentException() {
-        ThreadPoolExecutor tpe =
-            new ThreadPoolExecutor(2, 3,
-                                   LONG_DELAY_MS, MILLISECONDS,
-                                   new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.setMaximumPoolSize(1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-    /**
-     *  setMaximumPoolSize throws IllegalArgumentException
-     *  if given a negative value
-     */
-    public void testMaximumPoolSizeIllegalArgumentException2() {
-        ThreadPoolExecutor tpe =
-            new ThreadPoolExecutor(2, 3,
-                                   LONG_DELAY_MS, MILLISECONDS,
-                                   new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.setMaximumPoolSize(-1);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-
-    /**
-     *  setKeepAliveTime  throws IllegalArgumentException
-     *  when given a negative value
-     */
-    public void testKeepAliveTimeIllegalArgumentException() {
-        ThreadPoolExecutor tpe =
-            new ThreadPoolExecutor(2, 3,
-                                   LONG_DELAY_MS, MILLISECONDS,
-                                   new ArrayBlockingQueue<Runnable>(10));
-        try {
-            tpe.setKeepAliveTime(-1,MILLISECONDS);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        }
-        joinPool(tpe);
-    }
-
-    /**
-     * terminated() is called on termination
-     */
-    public void testTerminated() {
-        ExtendedTPE tpe = new ExtendedTPE();
-        try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        assertTrue(tpe.terminatedCalled);
-        joinPool(tpe);
-    }
-
-    /**
-     * beforeExecute and afterExecute are called when executing task
-     */
-    public void testBeforeAfter() throws InterruptedException {
-        ExtendedTPE tpe = new ExtendedTPE();
-        try {
-            TrackedNoOpRunnable r = new TrackedNoOpRunnable();
-            tpe.execute(r);
-            Thread.sleep(SHORT_DELAY_MS);
-            assertTrue(r.done);
-            assertTrue(tpe.beforeCalled);
-            assertTrue(tpe.afterCalled);
-            try { tpe.shutdown(); } catch (SecurityException ok) { return; }
-        } finally {
-            joinPool(tpe);
-        }
-    }
-
-    /**
-     * completed submit of callable returns result
-     */
-    public void testSubmitCallable() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            Future<String> future = e.submit(new StringTask());
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of runnable returns successfully
-     */
-    public void testSubmitRunnable() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            Future<?> future = e.submit(new NoOpRunnable());
-            future.get();
-            assertTrue(future.isDone());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * completed submit of (runnable, result) returns result
-     */
-    public void testSubmitRunnable2() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            Future<String> future = e.submit(new NoOpRunnable(), TEST_STRING);
-            String result = future.get();
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-
-    /**
-     * invokeAny(null) throws NPE
-     */
-    public void testInvokeAny1() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(empty collection) throws IAE
-     */
-    public void testInvokeAny2() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>());
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws NPE if c has null elements
-     */
-    public void testInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testInvokeAny4() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAny(c) returns result of some task
-     */
-    public void testInvokeAny5() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(null) throws NPE
-     */
-    public void testInvokeAll1() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAll(null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(empty collection) returns empty collection
-     */
-    public void testInvokeAll2() throws InterruptedException {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>());
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) throws NPE if c has null elements
-     */
-    public void testInvokeAll3() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of element of invokeAll(c) throws exception on failed task
-     */
-    public void testInvokeAll4() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new NPETask());
-            List<Future<String>> futures = e.invokeAll(l);
-            assertEquals(1, futures.size());
-            try {
-                futures.get(0).get();
-                shouldThrow();
-            } catch (ExecutionException success) {
-                assertTrue(success.getCause() instanceof NullPointerException);
-            }
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * invokeAll(c) returns results of all completed tasks
-     */
-    public void testInvokeAll5() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures = e.invokeAll(l);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-
-
-    /**
-     * timed invokeAny(null) throws NPE
-     */
-    public void testTimedInvokeAny1() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(,,null) throws NPE
-     */
-    public void testTimedInvokeAnyNullTimeUnit() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(empty collection) throws IAE
-     */
-    public void testTimedInvokeAny2() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAny(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (IllegalArgumentException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAny3() throws Exception {
-        CountDownLatch latch = new CountDownLatch(1);
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(latchAwaitingStringTask(latch));
-        l.add(null);
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            latch.countDown();
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) throws ExecutionException if no task completes
-     */
-    public void testTimedInvokeAny4() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        try {
-            e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAny(c) returns result of some task
-     */
-    public void testTimedInvokeAny5() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            String result = e.invokeAny(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertSame(TEST_STRING, result);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(null) throws NPE
-     */
-    public void testTimedInvokeAll1() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            e.invokeAll(null, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(,,null) throws NPE
-     */
-    public void testTimedInvokeAllNullTimeUnit() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, null);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(empty collection) returns empty collection
-     */
-    public void testTimedInvokeAll2() throws InterruptedException {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Future<String>> r = e.invokeAll(new ArrayList<Callable<String>>(), MEDIUM_DELAY_MS, MILLISECONDS);
-            assertTrue(r.isEmpty());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) throws NPE if c has null elements
-     */
-    public void testTimedInvokeAll3() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new StringTask());
-        l.add(null);
-        try {
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            shouldThrow();
-        } catch (NullPointerException success) {
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * get of element of invokeAll(c) throws exception on failed task
-     */
-    public void testTimedInvokeAll4() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        List<Callable<String>> l = new ArrayList<Callable<String>>();
-        l.add(new NPETask());
-        List<Future<String>> futures =
-            e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-        assertEquals(1, futures.size());
-        try {
-            futures.get(0).get();
-            shouldThrow();
-        } catch (ExecutionException success) {
-            assertTrue(success.getCause() instanceof NullPointerException);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) returns results of all completed tasks
-     */
-    public void testTimedInvokeAll5() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, MEDIUM_DELAY_MS, MILLISECONDS);
-            assertEquals(2, futures.size());
-            for (Future<String> future : futures)
-                assertSame(TEST_STRING, future.get());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * timed invokeAll(c) cancels tasks not completed by timeout
-     */
-    public void testTimedInvokeAll6() throws Exception {
-        ExecutorService e = new ThreadPoolExecutor(2, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            l.add(new StringTask());
-            l.add(Executors.callable(new MediumPossiblyInterruptedRunnable(), TEST_STRING));
-            l.add(new StringTask());
-            List<Future<String>> futures =
-                e.invokeAll(l, SHORT_DELAY_MS, MILLISECONDS);
-            assertEquals(3, futures.size());
-            Iterator<Future<String>> it = futures.iterator();
-            Future<String> f1 = it.next();
-            Future<String> f2 = it.next();
-            Future<String> f3 = it.next();
-            assertTrue(f1.isDone());
-            assertTrue(f2.isDone());
-            assertTrue(f3.isDone());
-            assertFalse(f1.isCancelled());
-            assertTrue(f2.isCancelled());
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * Execution continues if there is at least one thread even if
-     * thread factory fails to create more
-     */
-    public void testFailingThreadFactory() throws InterruptedException {
-        ExecutorService e = new ThreadPoolExecutor(100, 100, LONG_DELAY_MS, MILLISECONDS, new LinkedBlockingQueue<Runnable>(), new FailingThreadFactory());
-        try {
-            List<Callable<String>> l = new ArrayList<Callable<String>>();
-            for (int k = 0; k < 100; ++k) {
-                e.execute(new NoOpRunnable());
-            }
-            Thread.sleep(LONG_DELAY_MS);
-        } finally {
-            joinPool(e);
-        }
-    }
-
-    /**
-     * allowsCoreThreadTimeOut is by default false.
-     */
-    public void testAllowsCoreThreadTimeOut() {
-        ThreadPoolExecutor tpe = new ThreadPoolExecutor(2, 2, 1000, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        assertFalse(tpe.allowsCoreThreadTimeOut());
-        joinPool(tpe);
-    }
-
-    /**
-     * allowCoreThreadTimeOut(true) causes idle threads to time out
-     */
-    public void testAllowCoreThreadTimeOut_true() throws InterruptedException {
-        ThreadPoolExecutor tpe = new ThreadPoolExecutor(2, 10, 10, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        tpe.allowCoreThreadTimeOut(true);
-        tpe.execute(new NoOpRunnable());
-        try {
-            Thread.sleep(MEDIUM_DELAY_MS);
-            assertEquals(0, tpe.getPoolSize());
-        } finally {
-            joinPool(tpe);
-        }
-    }
-
-    /**
-     * allowCoreThreadTimeOut(false) causes idle threads not to time out
-     */
-    public void testAllowCoreThreadTimeOut_false() throws InterruptedException {
-        ThreadPoolExecutor tpe = new ThreadPoolExecutor(2, 10, 10, MILLISECONDS, new ArrayBlockingQueue<Runnable>(10));
-        tpe.allowCoreThreadTimeOut(false);
-        tpe.execute(new NoOpRunnable());
-        try {
-            Thread.sleep(MEDIUM_DELAY_MS);
-            assertTrue(tpe.getPoolSize() >= 1);
-        } finally {
-            joinPool(tpe);
-        }
-    }
-
-    /**
-     * execute allows the same task to be submitted multiple times, even
-     * if rejected
-     */
-    public void testRejectedRecycledTask() throws InterruptedException {
-        final int nTasks = 1000;
-        final AtomicInteger nRun = new AtomicInteger(0);
-        final Runnable recycledTask = new Runnable() {
-                public void run() {
-                    nRun.getAndIncrement();
-                } };
-        final ThreadPoolExecutor p =
-            new ThreadPoolExecutor(1, 30, 60, TimeUnit.SECONDS,
-                                   new ArrayBlockingQueue(30));
-        try {
-            for (int i = 0; i < nTasks; ++i) {
-                for (;;) {
-                    try {
-                        p.execute(recycledTask);
-                        break;
-                    }
-                    catch (RejectedExecutionException ignore) {
-                    }
-                }
-            }
-            Thread.sleep(5000); // enough time to run all tasks
-            assertEquals(nRun.get(), nTasks);
-        } finally {
-            p.shutdown();
-        }
-    }
-
-    // BEGIN android-added
-    /** http://b/3046427 */
-    public void testRejected() {
-        BlockingQueue<Runnable> queue = new LinkedBlockingQueue<Runnable>(2);
-        ExecutorService executor = new ThreadPoolExecutor(0, 2, 1, TimeUnit.SECONDS, queue);
-        executor.submit(new Sleeper()); // thread #1
-        executor.submit(new Sleeper()); // thread #2
-        executor.submit(new Sleeper()); // queue #1
-        executor.submit(new Sleeper()); // queue #2
-        try {
-            executor.submit(new Sleeper());
-            fail();
-        } catch (RejectedExecutionException expected) {
-            System.out.println(expected.getMessage());
-            assertNotNull(expected.getMessage());
-        }
-        executor.shutdown();
-    }
-
-    static class Sleeper implements Runnable {
-        public void run() {
-            try {
-                Thread.sleep(1000);
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-    }
-    // END android-added
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/ThreadTest.java b/luni/src/test/java/tests/api/java/util/concurrent/ThreadTest.java
deleted file mode 100755
index e9f28ac..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/ThreadTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-
-public class ThreadTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(ThreadTest.class);
-    }
-
-    static class MyHandler implements Thread.UncaughtExceptionHandler {
-        public void uncaughtException(Thread t, Throwable e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * getUncaughtExceptionHandler returns ThreadGroup unless set,
-     * otherwise returning value of last setUncaughtExceptionHandler.
-     */
-    public void testGetAndSetUncaughtExceptionHandler() {
-        // these must be done all at once to avoid state
-        // dependencies across tests
-        Thread current = Thread.currentThread();
-        ThreadGroup tg = current.getThreadGroup();
-        MyHandler eh = new MyHandler();
-        assertEquals(tg, current.getUncaughtExceptionHandler());
-        current.setUncaughtExceptionHandler(eh);
-        assertEquals(eh, current.getUncaughtExceptionHandler());
-        current.setUncaughtExceptionHandler(null);
-        assertEquals(tg, current.getUncaughtExceptionHandler());
-    }
-
-    /**
-     * getDefaultUncaughtExceptionHandler returns value of last
-     * setDefaultUncaughtExceptionHandler.
-     */
-    public void testGetAndSetDefaultUncaughtExceptionHandler() {
-        assertEquals(null, Thread.getDefaultUncaughtExceptionHandler());
-        // failure due to securityException is OK.
-        // Would be nice to explicitly test both ways, but cannot yet.
-        try {
-            Thread current = Thread.currentThread();
-            ThreadGroup tg = current.getThreadGroup();
-            MyHandler eh = new MyHandler();
-            Thread.setDefaultUncaughtExceptionHandler(eh);
-            assertEquals(eh, Thread.getDefaultUncaughtExceptionHandler());
-            Thread.setDefaultUncaughtExceptionHandler(null);
-        }
-        catch (SecurityException ok) {
-        }
-        assertEquals(null, Thread.getDefaultUncaughtExceptionHandler());
-    }
-
-
-    // How to test actually using UEH within junit?
-
-}
diff --git a/luni/src/test/java/tests/api/java/util/concurrent/TimeUnitTest.java b/luni/src/test/java/tests/api/java/util/concurrent/TimeUnitTest.java
deleted file mode 100755
index 84be0c4..0000000
--- a/luni/src/test/java/tests/api/java/util/concurrent/TimeUnitTest.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*
- * Written by Doug Lea with assistance from members of JCP JSR-166
- * Expert Group and released to the public domain, as explained at
- * http://creativecommons.org/licenses/publicdomain
- * Other contributors include Andrew Wright, Jeffrey Hayes,
- * Pat Fisher, Mike Judd.
- */
-
-package tests.api.java.util.concurrent; // android-added
-
-import junit.framework.*;
-import java.util.concurrent.*;
-import java.io.*;
-
-public class TimeUnitTest extends JSR166TestCase {
-    public static Test suite() {
-        return new TestSuite(TimeUnitTest.class);
-    }
-
-    // (loops to 88888 check increments at all time divisions.)
-
-    /**
-     * convert correctly converts sample values across the units
-     */
-    public void testConvert() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t*60*60*24,
-                         TimeUnit.SECONDS.convert(t,
-                                                  TimeUnit.DAYS));
-            assertEquals(t*60*60,
-                         TimeUnit.SECONDS.convert(t,
-                                                  TimeUnit.HOURS));
-            assertEquals(t*60,
-                         TimeUnit.SECONDS.convert(t,
-                                                  TimeUnit.MINUTES));
-            assertEquals(t,
-                         TimeUnit.SECONDS.convert(t,
-                                                  TimeUnit.SECONDS));
-            assertEquals(t,
-                         TimeUnit.SECONDS.convert(1000L*t,
-                                                  TimeUnit.MILLISECONDS));
-            assertEquals(t,
-                         TimeUnit.SECONDS.convert(1000000L*t,
-                                                  TimeUnit.MICROSECONDS));
-            assertEquals(t,
-                         TimeUnit.SECONDS.convert(1000000000L*t,
-                                                  TimeUnit.NANOSECONDS));
-
-
-            assertEquals(1000L*t*60*60*24,
-                         TimeUnit.MILLISECONDS.convert(t,
-                                                  TimeUnit.DAYS));
-            assertEquals(1000L*t*60*60,
-                         TimeUnit.MILLISECONDS.convert(t,
-                                                  TimeUnit.HOURS));
-            assertEquals(1000L*t*60,
-                         TimeUnit.MILLISECONDS.convert(t,
-                                                  TimeUnit.MINUTES));
-            assertEquals(1000L*t,
-                         TimeUnit.MILLISECONDS.convert(t,
-                                                  TimeUnit.SECONDS));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.convert(t,
-                                                  TimeUnit.MILLISECONDS));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.convert(1000L*t,
-                                                  TimeUnit.MICROSECONDS));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.convert(1000000L*t,
-                                                  TimeUnit.NANOSECONDS));
-
-            assertEquals(1000000L*t*60*60*24,
-                         TimeUnit.MICROSECONDS.convert(t,
-                                                  TimeUnit.DAYS));
-            assertEquals(1000000L*t*60*60,
-                         TimeUnit.MICROSECONDS.convert(t,
-                                                  TimeUnit.HOURS));
-            assertEquals(1000000L*t*60,
-                         TimeUnit.MICROSECONDS.convert(t,
-                                                  TimeUnit.MINUTES));
-            assertEquals(1000000L*t,
-                         TimeUnit.MICROSECONDS.convert(t,
-                                                  TimeUnit.SECONDS));
-            assertEquals(1000L*t,
-                         TimeUnit.MICROSECONDS.convert(t,
-                                                  TimeUnit.MILLISECONDS));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.convert(t,
-                                                  TimeUnit.MICROSECONDS));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.convert(1000L*t,
-                                                  TimeUnit.NANOSECONDS));
-
-            assertEquals(1000000000L*t*60*60*24,
-                         TimeUnit.NANOSECONDS.convert(t,
-                                                  TimeUnit.DAYS));
-            assertEquals(1000000000L*t*60*60,
-                         TimeUnit.NANOSECONDS.convert(t,
-                                                  TimeUnit.HOURS));
-            assertEquals(1000000000L*t*60,
-                         TimeUnit.NANOSECONDS.convert(t,
-                                                  TimeUnit.MINUTES));
-            assertEquals(1000000000L*t,
-                         TimeUnit.NANOSECONDS.convert(t,
-                                                  TimeUnit.SECONDS));
-            assertEquals(1000000L*t,
-                         TimeUnit.NANOSECONDS.convert(t,
-                                                  TimeUnit.MILLISECONDS));
-            assertEquals(1000L*t,
-                         TimeUnit.NANOSECONDS.convert(t,
-                                                  TimeUnit.MICROSECONDS));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.convert(t,
-                                                  TimeUnit.NANOSECONDS));
-        }
-    }
-
-    /**
-     * toNanos correctly converts sample values in different units to
-     * nanoseconds
-     */
-    public void testToNanos() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t*1000000000L*60*60*24,
-                         TimeUnit.DAYS.toNanos(t));
-            assertEquals(t*1000000000L*60*60,
-                         TimeUnit.HOURS.toNanos(t));
-            assertEquals(t*1000000000L*60,
-                         TimeUnit.MINUTES.toNanos(t));
-            assertEquals(1000000000L*t,
-                         TimeUnit.SECONDS.toNanos(t));
-            assertEquals(1000000L*t,
-                         TimeUnit.MILLISECONDS.toNanos(t));
-            assertEquals(1000L*t,
-                         TimeUnit.MICROSECONDS.toNanos(t));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.toNanos(t));
-        }
-    }
-
-    /**
-     * toMicros correctly converts sample values in different units to
-     * microseconds
-     */
-    public void testToMicros() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t*1000000L*60*60*24,
-                         TimeUnit.DAYS.toMicros(t));
-            assertEquals(t*1000000L*60*60,
-                         TimeUnit.HOURS.toMicros(t));
-            assertEquals(t*1000000L*60,
-                         TimeUnit.MINUTES.toMicros(t));
-            assertEquals(1000000L*t,
-                         TimeUnit.SECONDS.toMicros(t));
-            assertEquals(1000L*t,
-                         TimeUnit.MILLISECONDS.toMicros(t));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.toMicros(t));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.toMicros(t*1000L));
-        }
-    }
-
-    /**
-     * toMillis correctly converts sample values in different units to
-     * milliseconds
-     */
-    public void testToMillis() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t*1000L*60*60*24,
-                         TimeUnit.DAYS.toMillis(t));
-            assertEquals(t*1000L*60*60,
-                         TimeUnit.HOURS.toMillis(t));
-            assertEquals(t*1000L*60,
-                         TimeUnit.MINUTES.toMillis(t));
-            assertEquals(1000L*t,
-                         TimeUnit.SECONDS.toMillis(t));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.toMillis(t));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.toMillis(t*1000L));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.toMillis(t*1000000L));
-        }
-    }
-
-    /**
-     * toSeconds correctly converts sample values in different units to
-     * seconds
-     */
-    public void testToSeconds() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t*60*60*24,
-                         TimeUnit.DAYS.toSeconds(t));
-            assertEquals(t*60*60,
-                         TimeUnit.HOURS.toSeconds(t));
-            assertEquals(t*60,
-                         TimeUnit.MINUTES.toSeconds(t));
-            assertEquals(t,
-                         TimeUnit.SECONDS.toSeconds(t));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.toSeconds(t*1000L));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.toSeconds(t*1000000L));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.toSeconds(t*1000000000L));
-        }
-    }
-
-    /**
-     * toMinutes correctly converts sample values in different units to
-     * minutes
-     */
-    public void testToMinutes() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t*60*24,
-                         TimeUnit.DAYS.toMinutes(t));
-            assertEquals(t*60,
-                         TimeUnit.HOURS.toMinutes(t));
-            assertEquals(t,
-                         TimeUnit.MINUTES.toMinutes(t));
-            assertEquals(t,
-                         TimeUnit.SECONDS.toMinutes(t*60));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.toMinutes(t*1000L*60));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.toMinutes(t*1000000L*60));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.toMinutes(t*1000000000L*60));
-        }
-    }
-
-    /**
-     * toHours correctly converts sample values in different units to
-     * hours
-     */
-    public void testToHours() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t*24,
-                         TimeUnit.DAYS.toHours(t));
-            assertEquals(t,
-                         TimeUnit.HOURS.toHours(t));
-            assertEquals(t,
-                         TimeUnit.MINUTES.toHours(t*60));
-            assertEquals(t,
-                         TimeUnit.SECONDS.toHours(t*60*60));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.toHours(t*1000L*60*60));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.toHours(t*1000000L*60*60));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.toHours(t*1000000000L*60*60));
-        }
-    }
-
-    /**
-     * toDays correctly converts sample values in different units to
-     * days
-     */
-    public void testToDays() {
-        for (long t = 0; t < 88888; ++t) {
-            assertEquals(t,
-                         TimeUnit.DAYS.toDays(t));
-            assertEquals(t,
-                         TimeUnit.HOURS.toDays(t*24));
-            assertEquals(t,
-                         TimeUnit.MINUTES.toDays(t*60*24));
-            assertEquals(t,
-                         TimeUnit.SECONDS.toDays(t*60*60*24));
-            assertEquals(t,
-                         TimeUnit.MILLISECONDS.toDays(t*1000L*60*60*24));
-            assertEquals(t,
-                         TimeUnit.MICROSECONDS.toDays(t*1000000L*60*60*24));
-            assertEquals(t,
-                         TimeUnit.NANOSECONDS.toDays(t*1000000000L*60*60*24));
-        }
-    }
-
-
-    /**
-     * convert saturates positive too-large values to Long.MAX_VALUE
-     * and negative to LONG.MIN_VALUE
-     */
-    public void testConvertSaturate() {
-        assertEquals(Long.MAX_VALUE,
-                     TimeUnit.NANOSECONDS.convert(Long.MAX_VALUE / 2,
-                                                  TimeUnit.SECONDS));
-        assertEquals(Long.MIN_VALUE,
-                     TimeUnit.NANOSECONDS.convert(-Long.MAX_VALUE / 4,
-                                                  TimeUnit.SECONDS));
-        assertEquals(Long.MAX_VALUE,
-                     TimeUnit.NANOSECONDS.convert(Long.MAX_VALUE / 2,
-                                                  TimeUnit.MINUTES));
-        assertEquals(Long.MIN_VALUE,
-                     TimeUnit.NANOSECONDS.convert(-Long.MAX_VALUE / 4,
-                                                  TimeUnit.MINUTES));
-        assertEquals(Long.MAX_VALUE,
-                     TimeUnit.NANOSECONDS.convert(Long.MAX_VALUE / 2,
-                                                  TimeUnit.HOURS));
-        assertEquals(Long.MIN_VALUE,
-                     TimeUnit.NANOSECONDS.convert(-Long.MAX_VALUE / 4,
-                                                  TimeUnit.HOURS));
-        assertEquals(Long.MAX_VALUE,
-                     TimeUnit.NANOSECONDS.convert(Long.MAX_VALUE / 2,
-                                                  TimeUnit.DAYS));
-        assertEquals(Long.MIN_VALUE,
-                     TimeUnit.NANOSECONDS.convert(-Long.MAX_VALUE / 4,
-                                                  TimeUnit.DAYS));
-    }
-
-    /**
-     * toNanos saturates positive too-large values to Long.MAX_VALUE
-     * and negative to LONG.MIN_VALUE
-     */
-    public void testToNanosSaturate() {
-        assertEquals(Long.MAX_VALUE,
-                     TimeUnit.MILLISECONDS.toNanos(Long.MAX_VALUE / 2));
-        assertEquals(Long.MIN_VALUE,
-                     TimeUnit.MILLISECONDS.toNanos(-Long.MAX_VALUE / 3));
-    }
-
-
-    /**
-     * toString returns string containing common name of unit
-     */
-    public void testToString() {
-        String s = TimeUnit.SECONDS.toString();
-        assertTrue(s.indexOf("ECOND") >= 0);
-    }
-
-
-    /**
-     *  Timed wait without holding lock throws
-     *  IllegalMonitorStateException
-     */
-    public void testTimedWait_IllegalMonitorException() throws Exception {
-        Thread t = new Thread(new CheckedRunnable() {
-            public void realRun() throws InterruptedException {
-                Object o = new Object();
-                TimeUnit tu = TimeUnit.MILLISECONDS;
-                try {
-                    tu.timedWait(o,LONG_DELAY_MS);
-                    threadShouldThrow();
-                } catch (IllegalMonitorStateException success) {}}});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * timedWait throws InterruptedException when interrupted
-     */
-    public void testTimedWait() throws InterruptedException {
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                Object o = new Object();
-
-                TimeUnit tu = TimeUnit.MILLISECONDS;
-                synchronized(o) {
-                    tu.timedWait(o,MEDIUM_DELAY_MS);
-                }
-            }});
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-
-    /**
-     * timedJoin throws InterruptedException when interrupted
-     */
-    public void testTimedJoin() throws InterruptedException {
-        final Thread s = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                Thread.sleep(MEDIUM_DELAY_MS);
-            }});
-        final Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                TimeUnit tu = TimeUnit.MILLISECONDS;
-                tu.timedJoin(s, MEDIUM_DELAY_MS);
-            }});;
-        s.start();
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-        s.interrupt();
-        s.join();
-    }
-
-    /**
-     *  timedSleep throws InterruptedException when interrupted
-     */
-    public void testTimedSleep() throws InterruptedException {
-        Thread t = new Thread(new CheckedInterruptedRunnable() {
-            public void realRun() throws InterruptedException {
-                TimeUnit tu = TimeUnit.MILLISECONDS;
-                tu.sleep(MEDIUM_DELAY_MS);
-            }});
-
-        t.start();
-        Thread.sleep(SHORT_DELAY_MS);
-        t.interrupt();
-        t.join();
-    }
-
-    /**
-     * a deserialized serialized unit is the same instance
-     */
-    public void testSerialization() throws Exception {
-        TimeUnit q = TimeUnit.MILLISECONDS;
-
-        ByteArrayOutputStream bout = new ByteArrayOutputStream(10000);
-        ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(bout));
-        out.writeObject(q);
-        out.close();
-
-        ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
-        ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(bin));
-        TimeUnit r = (TimeUnit)in.readObject();
-        assertSame(q, r);
-    }
-
-}
diff --git a/luni/src/test/java/tests/api/javax/net/ServerSocketFactoryTest.java b/luni/src/test/java/tests/api/javax/net/ServerSocketFactoryTest.java
index 39c3a68..053200f 100644
--- a/luni/src/test/java/tests/api/javax/net/ServerSocketFactoryTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ServerSocketFactoryTest.java
@@ -22,10 +22,6 @@
 
 package tests.api.javax.net;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
@@ -40,18 +36,11 @@
 /**
  * Tests for <code>ServerSocketFactory</code> class constructors and methods.
  */
-@TestTargetClass(ServerSocketFactory.class)
 public class ServerSocketFactoryTest extends TestCase {
 
     /**
-     * @tests javax.net.SocketFactory#SocketFactory()
+     * javax.net.SocketFactory#SocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ServerSocketFactory",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             ServerSocketFactory sf = new MyServerSocketFactory();
@@ -61,14 +50,8 @@
     }
 
     /**
-     * @tests javax.net.ServerSocketFactory#createServerSocket()
+     * javax.net.ServerSocketFactory#createServerSocket()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "IOException checking missed",
-        method = "createServerSocket",
-        args = {}
-    )
     public final void test_createServerSocket_01() {
         ServerSocketFactory sf = ServerSocketFactory.getDefault();
         try {
@@ -81,14 +64,8 @@
     }
 
     /**
-     * @tests javax.net.ServerSocketFactory#createServerSocket(int port)
+     * javax.net.ServerSocketFactory#createServerSocket(int port)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createServerSocket",
-        args = {int.class}
-    )
     public final void test_createServerSocket_02() {
         ServerSocketFactory sf = ServerSocketFactory.getDefault();
         int portNumber = Support_PortManager.getNextPort();
@@ -120,14 +97,8 @@
     }
 
     /**
-     * @tests javax.net.ServerSocketFactory#createServerSocket(int port, int backlog)
+     * javax.net.ServerSocketFactory#createServerSocket(int port, int backlog)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createServerSocket",
-        args = {int.class, int.class}
-    )
     public final void test_createServerSocket_03() {
         ServerSocketFactory sf = ServerSocketFactory.getDefault();
         int portNumber = Support_PortManager.getNextPort();
@@ -159,14 +130,8 @@
     }
 
     /**
-     * @tests javax.net.ServerSocketFactory#createServerSocket(int port, int backlog, InetAddress ifAddress)
+     * javax.net.ServerSocketFactory#createServerSocket(int port, int backlog, InetAddress ifAddress)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createServerSocket",
-        args = {int.class, int.class, InetAddress.class}
-    )
     public final void test_createServerSocket_04() {
         ServerSocketFactory sf = ServerSocketFactory.getDefault();
         int portNumber = Support_PortManager.getNextPort();
@@ -198,14 +163,8 @@
     }
 
     /**
-     * @tests javax.net.ServerSocketFactory#getDefault()
+     * javax.net.ServerSocketFactory#getDefault()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefault",
-        args = {}
-    )
     public final void test_getDefault() {
         ServerSocketFactory sf = ServerSocketFactory.getDefault();
         ServerSocket s;
@@ -248,4 +207,4 @@
             InetAddress address) throws IOException {
         return null;
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/SocketFactoryTest.java b/luni/src/test/java/tests/api/javax/net/SocketFactoryTest.java
index c254095..2250602 100644
--- a/luni/src/test/java/tests/api/javax/net/SocketFactoryTest.java
+++ b/luni/src/test/java/tests/api/javax/net/SocketFactoryTest.java
@@ -22,10 +22,6 @@
 
 package tests.api.javax.net;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
@@ -43,18 +39,11 @@
 /**
  * Tests for <code>SocketFactory</code> class methods.
  */
-@TestTargetClass(SocketFactory.class)
 public class SocketFactoryTest extends TestCase {
 
     /**
-     * @tests javax.net.SocketFactory#SocketFactory()
+     * javax.net.SocketFactory#SocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SocketFactory",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             MySocketFactory sf = new MySocketFactory();
@@ -64,14 +53,8 @@
     }
 
     /**
-     * @tests javax.net.SocketFactory#createSocket()
+     * javax.net.SocketFactory#createSocket()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "IOException check missed",
-        method = "createSocket",
-        args = {}
-    )
     public final void test_createSocket_01() {
         SocketFactory sf = SocketFactory.getDefault();
 
@@ -95,14 +78,8 @@
     }
 
     /**
-     * @tests javax.net.SocketFactory#createSocket(String host, int port)
+     * javax.net.SocketFactory#createSocket(String host, int port)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createSocket",
-        args = {String.class, int.class}
-    )
     public final void test_createSocket_02() {
         SocketFactory sf = SocketFactory.getDefault();
         int portNumber = Support_PortManager.getNextPort();
@@ -153,14 +130,8 @@
     }
 
     /**
-     * @tests javax.net.SocketFactory#createSocket(InetAddress host, int port)
+     * javax.net.SocketFactory#createSocket(InetAddress host, int port)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createSocket",
-        args = {InetAddress.class, int.class}
-    )
     public final void test_createSocket_03() {
         SocketFactory sf = SocketFactory.getDefault();
         int portNumber = Support_PortManager.getNextPort();
@@ -202,15 +173,9 @@
     }
 
     /**
-     * @tests javax.net.SocketFactory#createSocket(InetAddress address, int port,
+     * javax.net.SocketFactory#createSocket(InetAddress address, int port,
      *                                             InetAddress localAddress, int localPort)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createSocket",
-        args = {InetAddress.class, int.class, InetAddress.class, int.class}
-    )
     public final void test_createSocket_04() {
         SocketFactory sf = SocketFactory.getDefault();
         int portNumber = Support_PortManager.getNextPort();
@@ -266,15 +231,9 @@
     }
 
     /**
-     * @tests javax.net.SocketFactory#createSocket(String host, int port,
+     * javax.net.SocketFactory#createSocket(String host, int port,
      *                                             InetAddress localHost, int localPort)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createSocket",
-        args = {String.class, int.class, InetAddress.class, int.class}
-    )
     public final void test_createSocket_05() {
         SocketFactory sf = SocketFactory.getDefault();
         int portNumber = Support_PortManager.getNextPort();
@@ -332,14 +291,8 @@
     }
 
     /**
-     * @tests javax.net.SocketFactory#getDefault()
+     * javax.net.SocketFactory#getDefault()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefault",
-        args = {}
-    )
     public final void test_getDefault() {
         SocketFactory sf = SocketFactory.getDefault();
         Socket s;
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/CertPathTrustManagerParametersTest.java b/luni/src/test/java/tests/api/javax/net/ssl/CertPathTrustManagerParametersTest.java
index df4083d..41407e8 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/CertPathTrustManagerParametersTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/CertPathTrustManagerParametersTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.cert.CertPathParameters;
 import javax.net.ssl.CertPathTrustManagerParameters;
 
@@ -32,21 +27,14 @@
  * and methods.
  *
  */
-@TestTargetClass(CertPathTrustManagerParameters.class)
 public class CertPathTrustManagerParametersTest extends TestCase {
 
     /**
-     * @tests javax.net.ssl.CertPathTrustManagerParameters#
+     * javax.net.ssl.CertPathTrustManagerParameters#
      *     CertPathTrustManagerParameters(java.security.cert.CertPathParameters)
      * Case 1: Try to construct object.
      * Case 2: Check NullPointerException.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertPathTrustManagerParameters",
-        args = {java.security.cert.CertPathParameters.class}
-    )
     public void test_ConstructorLjava_security_cert_CertPathParameters() {
         // case 1: Try to construct object.
         try {
@@ -69,14 +57,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.CertPathTrustManagerParameters#getParameters()
+     * javax.net.ssl.CertPathTrustManagerParameters#getParameters()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameters",
-        args = {}
-    )
     public void test_getParameters() {
         CertPathParameters parameters = new MyCertPathParameters();
         CertPathTrustManagerParameters p = new CertPathTrustManagerParameters(
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/HandshakeCompletedEventTest.java b/luni/src/test/java/tests/api/javax/net/ssl/HandshakeCompletedEventTest.java
index 9aa9612..d868cb2 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/HandshakeCompletedEventTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/HandshakeCompletedEventTest.java
@@ -18,11 +18,6 @@
 package tests.api.javax.net.ssl;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -31,7 +26,6 @@
 import java.security.KeyStore;
 import java.security.cert.Certificate;
 import java.security.cert.CertificateException;
-
 import javax.net.ssl.HandshakeCompletedEvent;
 import javax.net.ssl.HandshakeCompletedListener;
 import javax.net.ssl.KeyManager;
@@ -45,19 +39,15 @@
 import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 import javax.security.cert.X509Certificate;
-
 import junit.framework.TestCase;
-
 import org.apache.harmony.luni.util.Base64;
 import org.apache.harmony.xnet.tests.support.mySSLSession;
-
 import tests.support.Support_PortManager;
 
 /**
  * Tests for <code>HandshakeCompletedEvent</code> class constructors and methods.
  *
  */
-@TestTargetClass(HandshakeCompletedEvent.class)
 public class HandshakeCompletedEventTest extends TestCase {
 
     String certificate = "-----BEGIN CERTIFICATE-----\n"
@@ -79,226 +69,130 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#HandshakeCompletedEvent(SSLSocket sock, SSLSession s)
+     * javax.net.ssl.HandshakeCompletedEvent#HandshakeCompletedEvent(SSLSocket sock, SSLSession s)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Exceptions for null/incorrect parameters are not provided",
-        method = "HandshakeCompletedEvent",
-        args = {javax.net.ssl.SSLSocket.class, javax.net.ssl.SSLSession.class}
-    )
-    public final void test_Constructor() throws IOException {
+    public final void test_Constructor() throws Exception {
         mySSLSession session = new mySSLSession();
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
+        HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
         try {
-            HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
-        try {
-            HandshakeCompletedEvent event = new HandshakeCompletedEvent(null, null);
+            new HandshakeCompletedEvent(null, null);
             fail("Any exception wasn't thrown for null parameters");
-        } catch (Exception e) {
-            //expected
+        } catch (Exception expected) {
         }
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getCipherSuite()
+     * javax.net.ssl.HandshakeCompletedEvent#getCipherSuite()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCipherSuite",
-        args = {}
-    )
-    public final void test_getCipherSuite() throws IOException {
+    public final void test_getCipherSuite() throws Exception {
         mySSLSession session = new mySSLSession("localhost", 1080, null);
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
-        try {
-            assertEquals("SuiteName", event.getCipherSuite());
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        assertEquals("SuiteName", event.getCipherSuite());
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getLocalCertificates()
+     * javax.net.ssl.HandshakeCompletedEvent#getLocalCertificates()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLocalCertificates",
-        args = {}
-    )
-    public final void test_getLocalCertificates() throws IOException {
+    public final void test_getLocalCertificates() throws Exception {
         mySSLSession session = new mySSLSession("localhost", 1080, null);
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
-        try {
-            assertNull(event.getLocalCertificates());
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        assertNull(event.getLocalCertificates());
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getLocalPrincipal()
+     * javax.net.ssl.HandshakeCompletedEvent#getLocalPrincipal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLocalPrincipal",
-        args = {}
-    )
-    public final void test_getLocalPrincipal() throws IOException {
+    public final void test_getLocalPrincipal() throws Exception {
         mySSLSession session = new mySSLSession("localhost", 1080, null);
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
-        try {
-            assertNull(event.getLocalPrincipal());
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        assertNull(event.getLocalPrincipal());
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getPeerCertificateChain()
+     * javax.net.ssl.HandshakeCompletedEvent#getPeerCertificateChain()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPeerCertificateChain",
-        args = {}
-    )
-    public final void test_getPeerCertificateChain() throws IOException {
+    public final void test_getPeerCertificateChain() throws Exception {
         ByteArrayInputStream bis = new ByteArrayInputStream(certificate.getBytes());
         mySSLSession session = new mySSLSession((X509Certificate[]) null);
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
         try {
-            X509Certificate[] res = event.getPeerCertificateChain();
+            event.getPeerCertificateChain();
             fail("SSLPeerUnverifiedException wasn't thrown");
-        } catch (SSLPeerUnverifiedException spue) {
-            //expected
+        } catch (SSLPeerUnverifiedException expected) {
         }
 
-        try {
-            X509Certificate xc = X509Certificate.getInstance(bis);
-            X509Certificate[] xcs = {xc};
-            session = new mySSLSession(xcs);
-            event = new HandshakeCompletedEvent(socket, session);
-        } catch (Exception e) {
-            fail(e + " was thrown for configuration");
-        }
-        try {
-            X509Certificate[] res = event.getPeerCertificateChain();
-            assertEquals(res.length, 1);
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        X509Certificate xc = X509Certificate.getInstance(bis);
+        X509Certificate[] xcs = {xc};
+        session = new mySSLSession(xcs);
+        event = new HandshakeCompletedEvent(socket, session);
+
+        X509Certificate[] res = event.getPeerCertificateChain();
+        assertEquals(1, res.length);
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getPeerCertificates()
+     * javax.net.ssl.HandshakeCompletedEvent#getPeerCertificates()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPeerCertificates",
-        args = {}
-    )
     public final void test_getPeerCertificates() throws IOException {
         mySSLSession session = new mySSLSession("localhost", 1080, null);
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
         try {
-            Certificate[] res = event.getPeerCertificates();
+            event.getPeerCertificates();
             fail("SSLPeerUnverifiedException wasn't thrown");
-        } catch (SSLPeerUnverifiedException spue) {
-            //expected
+        } catch (SSLPeerUnverifiedException expected) {
         }
 
         session = new mySSLSession((X509Certificate[]) null);
         event = new HandshakeCompletedEvent(socket, session);
-        try {
-            Certificate[] res = event.getPeerCertificates();
-            assertEquals(res.length, 3);
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        Certificate[] res = event.getPeerCertificates();
+        assertEquals(3, res.length);
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getPeerPrincipal()
+     * javax.net.ssl.HandshakeCompletedEvent#getPeerPrincipal()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "",
-        method = "getPeerPrincipal",
-        args = {}
-    )
     public final void test_getPeerPrincipal() throws IOException {
         mySSLSession session = new mySSLSession("localhost", 1080, null);
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
-        try {
-            assertNull(event.getPeerPrincipal());
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        assertNull(event.getPeerPrincipal());
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getSession()
+     * javax.net.ssl.HandshakeCompletedEvent#getSession()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSession",
-        args = {}
-    )
     public final void test_getSession() throws IOException {
         mySSLSession session = new mySSLSession("localhost", 1080, null);
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, session);
-        try {
-            SSLSession ss = event.getSession();
-            assertNotNull(ss);
-            assertEquals(session, ss);
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        SSLSession ss = event.getSession();
+        assertNotNull(ss);
+        assertEquals(session, ss);
     }
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.HandshakeCompletedEvent#getSocket()
+     * javax.net.ssl.HandshakeCompletedEvent#getSocket()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSocket",
-        args = {}
-    )
     public final void test_getSocket() throws IOException {
         SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
         HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, null);
-        try {
-            SSLSocket ss = event.getSocket();
-            assertNotNull(ss);
-            assertEquals(socket, ss);
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e);
-        }
+        SSLSocket ss = event.getSocket();
+        assertNotNull(ss);
+        assertEquals(socket, ss);
     }
 
 
@@ -319,120 +213,120 @@
      * single self-generated key. The subject name is "Test Server".
      */
     private static final String SERVER_KEYS_BKS =
-        "AAAAAQAAABQDkebzoP1XwqyWKRCJEpn/t8dqIQAABDkEAAVteWtleQAAARpYl20nAAAAAQAFWC41" +
-        "MDkAAAJNMIICSTCCAbKgAwIBAgIESEfU1jANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJVUzET" +
-        "MBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8wDQYDVQQKEwZHb29nbGUxEDAOBgNV" +
-        "BAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgU2VydmVyMB4XDTA4MDYwNTExNTgxNFoXDTA4MDkw" +
-        "MzExNTgxNFowaTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01U" +
-        "VjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdBbmRyb2lkMRQwEgYDVQQDEwtUZXN0IFNlcnZl" +
-        "cjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LIdKaIr9/vsTq8BZlA3R+NFWRaH4lGsTAQy" +
-        "DPMF9ZqEDOaL6DJuu0colSBBBQ85hQTPa9m9nyJoN3pEi1hgamqOvQIWcXBk+SOpUGRZZFXwniJV" +
-        "zDKU5nE9MYgn2B9AoiH3CSuMz6HRqgVaqtppIe1jhukMc/kHVJvlKRNy9XMCAwEAATANBgkqhkiG" +
-        "9w0BAQUFAAOBgQC7yBmJ9O/eWDGtSH9BH0R3dh2NdST3W9hNZ8hIa8U8klhNHbUCSSktZmZkvbPU" +
-        "hse5LI3dh6RyNDuqDrbYwcqzKbFJaq/jX9kCoeb3vgbQElMRX8D2ID1vRjxwlALFISrtaN4VpWzV" +
-        "yeoHPW4xldeZmoVtjn8zXNzQhLuBqX2MmAAAAqwAAAAUvkUScfw9yCSmALruURNmtBai7kQAAAZx" +
-        "4Jmijxs/l8EBaleaUru6EOPioWkUAEVWCxjM/TxbGHOi2VMsQWqRr/DZ3wsDmtQgw3QTrUK666sR" +
-        "MBnbqdnyCyvM1J2V1xxLXPUeRBmR2CXorYGF9Dye7NkgVdfA+9g9L/0Au6Ugn+2Cj5leoIgkgApN" +
-        "vuEcZegFlNOUPVEs3SlBgUF1BY6OBM0UBHTPwGGxFBBcetcuMRbUnu65vyDG0pslT59qpaR0TMVs" +
-        "P+tcheEzhyjbfM32/vwhnL9dBEgM8qMt0sqF6itNOQU/F4WGkK2Cm2v4CYEyKYw325fEhzTXosck" +
-        "MhbqmcyLab8EPceWF3dweoUT76+jEZx8lV2dapR+CmczQI43tV9btsd1xiBbBHAKvymm9Ep9bPzM" +
-        "J0MQi+OtURL9Lxke/70/MRueqbPeUlOaGvANTmXQD2OnW7PISwJ9lpeLfTG0LcqkoqkbtLKQLYHI" +
-        "rQfV5j0j+wmvmpMxzjN3uvNajLa4zQ8l0Eok9SFaRr2RL0gN8Q2JegfOL4pUiHPsh64WWya2NB7f" +
-        "V+1s65eA5ospXYsShRjo046QhGTmymwXXzdzuxu8IlnTEont6P4+J+GsWk6cldGbl20hctuUKzyx" +
-        "OptjEPOKejV60iDCYGmHbCWAzQ8h5MILV82IclzNViZmzAapeeCnexhpXhWTs+xDEYSKEiG/camt" +
-        "bhmZc3BcyVJrW23PktSfpBQ6D8ZxoMfF0L7V2GQMaUg+3r7ucrx82kpqotjv0xHghNIm95aBr1Qw" +
-        "1gaEjsC/0wGmmBDg1dTDH+F1p9TInzr3EFuYD0YiQ7YlAHq3cPuyGoLXJ5dXYuSBfhDXJSeddUkl" +
-        "k1ufZyOOcskeInQge7jzaRfmKg3U94r+spMEvb0AzDQVOKvjjo1ivxMSgFRZaDb/4qw=";
+            "AAAAAQAAABQDkebzoP1XwqyWKRCJEpn/t8dqIQAABDkEAAVteWtleQAAARpYl20nAAAAAQAFWC41"
+            + "MDkAAAJNMIICSTCCAbKgAwIBAgIESEfU1jANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJVUzET"
+            + "MBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8wDQYDVQQKEwZHb29nbGUxEDAOBgNV"
+            + "BAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgU2VydmVyMB4XDTA4MDYwNTExNTgxNFoXDTA4MDkw"
+            + "MzExNTgxNFowaTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01U"
+            + "VjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdBbmRyb2lkMRQwEgYDVQQDEwtUZXN0IFNlcnZl"
+            + "cjCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0LIdKaIr9/vsTq8BZlA3R+NFWRaH4lGsTAQy"
+            + "DPMF9ZqEDOaL6DJuu0colSBBBQ85hQTPa9m9nyJoN3pEi1hgamqOvQIWcXBk+SOpUGRZZFXwniJV"
+            + "zDKU5nE9MYgn2B9AoiH3CSuMz6HRqgVaqtppIe1jhukMc/kHVJvlKRNy9XMCAwEAATANBgkqhkiG"
+            + "9w0BAQUFAAOBgQC7yBmJ9O/eWDGtSH9BH0R3dh2NdST3W9hNZ8hIa8U8klhNHbUCSSktZmZkvbPU"
+            + "hse5LI3dh6RyNDuqDrbYwcqzKbFJaq/jX9kCoeb3vgbQElMRX8D2ID1vRjxwlALFISrtaN4VpWzV"
+            + "yeoHPW4xldeZmoVtjn8zXNzQhLuBqX2MmAAAAqwAAAAUvkUScfw9yCSmALruURNmtBai7kQAAAZx"
+            + "4Jmijxs/l8EBaleaUru6EOPioWkUAEVWCxjM/TxbGHOi2VMsQWqRr/DZ3wsDmtQgw3QTrUK666sR"
+            + "MBnbqdnyCyvM1J2V1xxLXPUeRBmR2CXorYGF9Dye7NkgVdfA+9g9L/0Au6Ugn+2Cj5leoIgkgApN"
+            + "vuEcZegFlNOUPVEs3SlBgUF1BY6OBM0UBHTPwGGxFBBcetcuMRbUnu65vyDG0pslT59qpaR0TMVs"
+            + "P+tcheEzhyjbfM32/vwhnL9dBEgM8qMt0sqF6itNOQU/F4WGkK2Cm2v4CYEyKYw325fEhzTXosck"
+            + "MhbqmcyLab8EPceWF3dweoUT76+jEZx8lV2dapR+CmczQI43tV9btsd1xiBbBHAKvymm9Ep9bPzM"
+            + "J0MQi+OtURL9Lxke/70/MRueqbPeUlOaGvANTmXQD2OnW7PISwJ9lpeLfTG0LcqkoqkbtLKQLYHI"
+            + "rQfV5j0j+wmvmpMxzjN3uvNajLa4zQ8l0Eok9SFaRr2RL0gN8Q2JegfOL4pUiHPsh64WWya2NB7f"
+            + "V+1s65eA5ospXYsShRjo046QhGTmymwXXzdzuxu8IlnTEont6P4+J+GsWk6cldGbl20hctuUKzyx"
+            + "OptjEPOKejV60iDCYGmHbCWAzQ8h5MILV82IclzNViZmzAapeeCnexhpXhWTs+xDEYSKEiG/camt"
+            + "bhmZc3BcyVJrW23PktSfpBQ6D8ZxoMfF0L7V2GQMaUg+3r7ucrx82kpqotjv0xHghNIm95aBr1Qw"
+            + "1gaEjsC/0wGmmBDg1dTDH+F1p9TInzr3EFuYD0YiQ7YlAHq3cPuyGoLXJ5dXYuSBfhDXJSeddUkl"
+            + "k1ufZyOOcskeInQge7jzaRfmKg3U94r+spMEvb0AzDQVOKvjjo1ivxMSgFRZaDb/4qw=";
 
     /**
      * Defines the keystore contents for the server, JKS version. Holds just a
      * single self-generated key. The subject name is "Test Server".
      */
     private static final String SERVER_KEYS_JKS =
-        "/u3+7QAAAAIAAAABAAAAAQAFbXlrZXkAAAEaWFfBeAAAArowggK2MA4GCisGAQQBKgIRAQEFAASC" +
-        "AqI2kp5XjnF8YZkhcF92YsJNQkvsmH7zqMM87j23zSoV4DwyE3XeC/gZWq1ToScIhoqZkzlbWcu4" +
-        "T/Zfc/DrfGk/rKbBL1uWKGZ8fMtlZk8KoAhxZk1JSyJvdkyKxqmzUbxk1OFMlN2VJNu97FPVH+du" +
-        "dvjTvmpdoM81INWBW/1fZJeQeDvn4mMbbe0IxgpiLnI9WSevlaDP/sm1X3iO9yEyzHLL+M5Erspo" +
-        "Cwa558fOu5DdsICMXhvDQxjWFKFhPHnKtGe+VvwkG9/bAaDgx3kfhk0w5zvdnkKb+8Ed9ylNRzdk" +
-        "ocAa/mxlMTOsTvDKXjjsBupNPIIj7OP4GNnZaxkJjSs98pEO67op1GX2qhy6FSOPNuq8k/65HzUc" +
-        "PYn6voEeh6vm02U/sjEnzRevQ2+2wXoAdp0EwtQ/DlMe+NvcwPGWKuMgX4A4L93DZGb04N2VmAU3" +
-        "YLOtZwTO0LbuWrcCM/q99G/7LcczkxIVrO2I/rh8RXVczlf9QzcrFObFv4ATuspWJ8xG7DhsMbnk" +
-        "rT94Pq6TogYeoz8o8ZMykesAqN6mt/9+ToIemmXv+e+KU1hI5oLwWMnUG6dXM6hIvrULY6o+QCPH" +
-        "172YQJMa+68HAeS+itBTAF4Clm/bLn6reHCGGU6vNdwU0lYldpiOj9cB3t+u2UuLo6tiFWjLf5Zs" +
-        "EQJETd4g/EK9nHxJn0GAKrWnTw7pEHQJ08elzUuy04C/jEEG+4QXU1InzS4o/kR0Sqz2WTGDoSoq" +
-        "ewuPRU5bzQs/b9daq3mXrnPtRBL6HfSDAdpTK76iHqLCGdqx3avHjVSBm4zFvEuYBCev+3iKOBmg" +
-        "yh7eQRTjz4UOWfy85omMBr7lK8PtfVBDzOXpasxS0uBgdUyBDX4tO6k9jZ8a1kmQRQAAAAEABVgu" +
-        "NTA5AAACSDCCAkQwggGtAgRIR8SKMA0GCSqGSIb3DQEBBAUAMGkxCzAJBgNVBAYTAlVTMRMwEQYD" +
-        "VQQIEwpDYWxpZm9ybmlhMQwwCgYDVQQHEwNNVFYxDzANBgNVBAoTBkdvb2dsZTEQMA4GA1UECxMH" +
-        "QW5kcm9pZDEUMBIGA1UEAxMLVGVzdCBTZXJ2ZXIwHhcNMDgwNjA1MTA0ODQyWhcNMDgwOTAzMTA0" +
-        "ODQyWjBpMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8w" +
-        "DQYDVQQKEwZHb29nbGUxEDAOBgNVBAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgU2VydmVyMIGf" +
-        "MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwoC6chqCI84rj1PrXuJgbiit4EV909zR6N0jNlYfg" +
-        "itwB39bP39wH03rFm8T59b3mbSptnGmCIpLZn25KPPFsYD3JJ+wFlmiUdEP9H05flfwtFQJnw9uT" +
-        "3rRIdYVMPcQ3RoZzwAMliGr882I2thIDbA6xjGU/1nRIdvk0LtxH3QIDAQABMA0GCSqGSIb3DQEB" +
-        "BAUAA4GBAJn+6YgUlY18Ie+0+Vt8oEi81DNi/bfPrAUAh63fhhBikx/3R9dl3wh09Z6p7cIdNxjW" +
-        "n2ll+cRW9eqF7z75F0Omm0C7/KAEPjukVbszmzeU5VqzkpSt0j84YWi+TfcHRrfvhLbrlmGITVpY" +
-        "ol5pHLDyqGmDs53pgwipWqsn/nEXEBgj3EoqPeqHbDf7YaP8h/5BSt0=";
+            "/u3+7QAAAAIAAAABAAAAAQAFbXlrZXkAAAEaWFfBeAAAArowggK2MA4GCisGAQQBKgIRAQEFAASC"
+            + "AqI2kp5XjnF8YZkhcF92YsJNQkvsmH7zqMM87j23zSoV4DwyE3XeC/gZWq1ToScIhoqZkzlbWcu4"
+            + "T/Zfc/DrfGk/rKbBL1uWKGZ8fMtlZk8KoAhxZk1JSyJvdkyKxqmzUbxk1OFMlN2VJNu97FPVH+du"
+            + "dvjTvmpdoM81INWBW/1fZJeQeDvn4mMbbe0IxgpiLnI9WSevlaDP/sm1X3iO9yEyzHLL+M5Erspo"
+            + "Cwa558fOu5DdsICMXhvDQxjWFKFhPHnKtGe+VvwkG9/bAaDgx3kfhk0w5zvdnkKb+8Ed9ylNRzdk"
+            + "ocAa/mxlMTOsTvDKXjjsBupNPIIj7OP4GNnZaxkJjSs98pEO67op1GX2qhy6FSOPNuq8k/65HzUc"
+            + "PYn6voEeh6vm02U/sjEnzRevQ2+2wXoAdp0EwtQ/DlMe+NvcwPGWKuMgX4A4L93DZGb04N2VmAU3"
+            + "YLOtZwTO0LbuWrcCM/q99G/7LcczkxIVrO2I/rh8RXVczlf9QzcrFObFv4ATuspWJ8xG7DhsMbnk"
+            + "rT94Pq6TogYeoz8o8ZMykesAqN6mt/9+ToIemmXv+e+KU1hI5oLwWMnUG6dXM6hIvrULY6o+QCPH"
+            + "172YQJMa+68HAeS+itBTAF4Clm/bLn6reHCGGU6vNdwU0lYldpiOj9cB3t+u2UuLo6tiFWjLf5Zs"
+            + "EQJETd4g/EK9nHxJn0GAKrWnTw7pEHQJ08elzUuy04C/jEEG+4QXU1InzS4o/kR0Sqz2WTGDoSoq"
+            + "ewuPRU5bzQs/b9daq3mXrnPtRBL6HfSDAdpTK76iHqLCGdqx3avHjVSBm4zFvEuYBCev+3iKOBmg"
+            + "yh7eQRTjz4UOWfy85omMBr7lK8PtfVBDzOXpasxS0uBgdUyBDX4tO6k9jZ8a1kmQRQAAAAEABVgu"
+            + "NTA5AAACSDCCAkQwggGtAgRIR8SKMA0GCSqGSIb3DQEBBAUAMGkxCzAJBgNVBAYTAlVTMRMwEQYD"
+            + "VQQIEwpDYWxpZm9ybmlhMQwwCgYDVQQHEwNNVFYxDzANBgNVBAoTBkdvb2dsZTEQMA4GA1UECxMH"
+            + "QW5kcm9pZDEUMBIGA1UEAxMLVGVzdCBTZXJ2ZXIwHhcNMDgwNjA1MTA0ODQyWhcNMDgwOTAzMTA0"
+            + "ODQyWjBpMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8w"
+            + "DQYDVQQKEwZHb29nbGUxEDAOBgNVBAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgU2VydmVyMIGf"
+            + "MA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwoC6chqCI84rj1PrXuJgbiit4EV909zR6N0jNlYfg"
+            + "itwB39bP39wH03rFm8T59b3mbSptnGmCIpLZn25KPPFsYD3JJ+wFlmiUdEP9H05flfwtFQJnw9uT"
+            + "3rRIdYVMPcQ3RoZzwAMliGr882I2thIDbA6xjGU/1nRIdvk0LtxH3QIDAQABMA0GCSqGSIb3DQEB"
+            + "BAUAA4GBAJn+6YgUlY18Ie+0+Vt8oEi81DNi/bfPrAUAh63fhhBikx/3R9dl3wh09Z6p7cIdNxjW"
+            + "n2ll+cRW9eqF7z75F0Omm0C7/KAEPjukVbszmzeU5VqzkpSt0j84YWi+TfcHRrfvhLbrlmGITVpY"
+            + "ol5pHLDyqGmDs53pgwipWqsn/nEXEBgj3EoqPeqHbDf7YaP8h/5BSt0=";
 
     /**
      * Defines the keystore contents for the client, JKS version. Holds just a
      * single self-generated key. The subject name is "Test Client".
      */
     private static final String CLIENT_KEYS_JKS =
-        "/u3+7QAAAAIAAAABAAAAAQAFbXlrZXkAAAEaWFhyMAAAArkwggK1MA4GCisGAQQBKgIRAQEFAASC" +
-        "AqGVSfXolBStZy4nnRNn4fAr+S7kfU2BS23wwW8uB2Ru3GvtLzlK9q08Gvq/LNqBafjyFTVL5FV5" +
-        "SED/8YomO5a98GpskSeRvytCiTBLJdgGhws5TOGekgIAcBROPGIyOtJPQ0HfOQs+BqgzGDHzHQhw" +
-        "u/8Tm6yQwiP+W/1I9B1QnaEztZA3mhTyMMJsmsFTYroGgAog885D5Cmzd8sYGfxec3R6I+xcmBAY" +
-        "eibR5kGpWwt1R+qMvRrtBqh5r6WSKhCBNax+SJVbtUNRiKyjKccdJg6fGqIWWeivwYTy0OhjA6b4" +
-        "NiZ/ZZs5pxFGWUj/Rlp0RYy8fCF6aw5/5s4Bf4MI6dPSqMG8Hf7sJR91GbcELyzPdM0h5lNavgit" +
-        "QPEzKeuDrGxhY1frJThBsNsS0gxeu+OgfJPEb/H4lpYX5IvuIGbWKcxoO9zq4/fimIZkdA8A+3eY" +
-        "mfDaowvy65NBVQPJSxaOyFhLHfeLqOeCsVENAea02vA7andZHTZehvcrqyKtm+z8ncHGRC2H9H8O" +
-        "jKwKHfxxrYY/jMAKLl00+PBb3kspO+BHI2EcQnQuMw/zr83OR9Meq4TJ0TMuNkApZELAeFckIBbS" +
-        "rBr8NNjAIfjuCTuKHhsTFWiHfk9ZIzigxXagfeDRiyVc6khOuF/bGorj23N2o7Rf3uLoU6PyXWi4" +
-        "uhctR1aL6NzxDoK2PbYCeA9hxbDv8emaVPIzlVwpPK3Ruvv9mkjcOhZ74J8bPK2fQmbplbOljcZi" +
-        "tZijOfzcO/11JrwhuJZRA6wanTqHoujgChV9EukVrmbWGGAcewFnAsSbFXIik7/+QznXaDIt5NgL" +
-        "H/Bcz4Z/fdV7Ae1eUaxKXdPbI//4J+8liVT/d8awjW2tldIaDlmGMR3aoc830+3mAAAAAQAFWC41" +
-        "MDkAAAJIMIICRDCCAa0CBEhHxLgwDQYJKoZIhvcNAQEEBQAwaTELMAkGA1UEBhMCVVMxEzARBgNV" +
-        "BAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01UVjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdB" +
-        "bmRyb2lkMRQwEgYDVQQDEwtUZXN0IENsaWVudDAeFw0wODA2MDUxMDQ5MjhaFw0wODA5MDMxMDQ5" +
-        "MjhaMGkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMQwwCgYDVQQHEwNNVFYxDzAN" +
-        "BgNVBAoTBkdvb2dsZTEQMA4GA1UECxMHQW5kcm9pZDEUMBIGA1UEAxMLVGVzdCBDbGllbnQwgZ8w" +
-        "DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAIK3Q+KiFbmCGg422TAo4gggdhMH6FJhiuz8DxRyeMKR" +
-        "UAfP4MK0wtc8N42waZ6OKvxpBFUy0BRfBsX0GD4Ku99yu9/tavSigTraeJtwV3WWRRjIqk7L3wX5" +
-        "cmgS2KSD43Y0rNUKrko26lnt9N4qiYRBSj+tcAN3Lx9+ptqk1LApAgMBAAEwDQYJKoZIhvcNAQEE" +
-        "BQADgYEANb7Q1GVSuy1RPJ0FmiXoMYCCtvlRLkmJphwxovK0cAQK12Vll+yAzBhHiQHy/RA11mng" +
-        "wYudC7u3P8X/tBT8GR1Yk7QW3KgFyPafp3lQBBCraSsfrjKj+dCLig1uBLUr4f68W8VFWZWWTHqp" +
-        "NMGpCX6qmjbkJQLVK/Yfo1ePaUexPSOX0G9m8+DoV3iyNw6at01NRw==";
+            "/u3+7QAAAAIAAAABAAAAAQAFbXlrZXkAAAEaWFhyMAAAArkwggK1MA4GCisGAQQBKgIRAQEFAASC"
+            + "AqGVSfXolBStZy4nnRNn4fAr+S7kfU2BS23wwW8uB2Ru3GvtLzlK9q08Gvq/LNqBafjyFTVL5FV5"
+            + "SED/8YomO5a98GpskSeRvytCiTBLJdgGhws5TOGekgIAcBROPGIyOtJPQ0HfOQs+BqgzGDHzHQhw"
+            + "u/8Tm6yQwiP+W/1I9B1QnaEztZA3mhTyMMJsmsFTYroGgAog885D5Cmzd8sYGfxec3R6I+xcmBAY"
+            + "eibR5kGpWwt1R+qMvRrtBqh5r6WSKhCBNax+SJVbtUNRiKyjKccdJg6fGqIWWeivwYTy0OhjA6b4"
+            + "NiZ/ZZs5pxFGWUj/Rlp0RYy8fCF6aw5/5s4Bf4MI6dPSqMG8Hf7sJR91GbcELyzPdM0h5lNavgit"
+            + "QPEzKeuDrGxhY1frJThBsNsS0gxeu+OgfJPEb/H4lpYX5IvuIGbWKcxoO9zq4/fimIZkdA8A+3eY"
+            + "mfDaowvy65NBVQPJSxaOyFhLHfeLqOeCsVENAea02vA7andZHTZehvcrqyKtm+z8ncHGRC2H9H8O"
+            + "jKwKHfxxrYY/jMAKLl00+PBb3kspO+BHI2EcQnQuMw/zr83OR9Meq4TJ0TMuNkApZELAeFckIBbS"
+            + "rBr8NNjAIfjuCTuKHhsTFWiHfk9ZIzigxXagfeDRiyVc6khOuF/bGorj23N2o7Rf3uLoU6PyXWi4"
+            + "uhctR1aL6NzxDoK2PbYCeA9hxbDv8emaVPIzlVwpPK3Ruvv9mkjcOhZ74J8bPK2fQmbplbOljcZi"
+            + "tZijOfzcO/11JrwhuJZRA6wanTqHoujgChV9EukVrmbWGGAcewFnAsSbFXIik7/+QznXaDIt5NgL"
+            + "H/Bcz4Z/fdV7Ae1eUaxKXdPbI//4J+8liVT/d8awjW2tldIaDlmGMR3aoc830+3mAAAAAQAFWC41"
+            + "MDkAAAJIMIICRDCCAa0CBEhHxLgwDQYJKoZIhvcNAQEEBQAwaTELMAkGA1UEBhMCVVMxEzARBgNV"
+            + "BAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01UVjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdB"
+            + "bmRyb2lkMRQwEgYDVQQDEwtUZXN0IENsaWVudDAeFw0wODA2MDUxMDQ5MjhaFw0wODA5MDMxMDQ5"
+            + "MjhaMGkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMQwwCgYDVQQHEwNNVFYxDzAN"
+            + "BgNVBAoTBkdvb2dsZTEQMA4GA1UECxMHQW5kcm9pZDEUMBIGA1UEAxMLVGVzdCBDbGllbnQwgZ8w"
+            + "DQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAIK3Q+KiFbmCGg422TAo4gggdhMH6FJhiuz8DxRyeMKR"
+            + "UAfP4MK0wtc8N42waZ6OKvxpBFUy0BRfBsX0GD4Ku99yu9/tavSigTraeJtwV3WWRRjIqk7L3wX5"
+            + "cmgS2KSD43Y0rNUKrko26lnt9N4qiYRBSj+tcAN3Lx9+ptqk1LApAgMBAAEwDQYJKoZIhvcNAQEE"
+            + "BQADgYEANb7Q1GVSuy1RPJ0FmiXoMYCCtvlRLkmJphwxovK0cAQK12Vll+yAzBhHiQHy/RA11mng"
+            + "wYudC7u3P8X/tBT8GR1Yk7QW3KgFyPafp3lQBBCraSsfrjKj+dCLig1uBLUr4f68W8VFWZWWTHqp"
+            + "NMGpCX6qmjbkJQLVK/Yfo1ePaUexPSOX0G9m8+DoV3iyNw6at01NRw==";
 
     /**
      * Defines the keystore contents for the client, BKS version. Holds just a
      * single self-generated key. The subject name is "Test Client".
      */
     private static final String CLIENT_KEYS_BKS =
-        "AAAAAQAAABT4Rka6fxbFps98Y5k2VilmbibNkQAABfQEAAVteWtleQAAARpYl+POAAAAAQAFWC41" +
-        "MDkAAAJNMIICSTCCAbKgAwIBAgIESEfU9TANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJVUzET" +
-        "MBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8wDQYDVQQKEwZHb29nbGUxEDAOBgNV" +
-        "BAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgQ2xpZW50MB4XDTA4MDYwNTExNTg0NVoXDTA4MDkw" +
-        "MzExNTg0NVowaTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01U" +
-        "VjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdBbmRyb2lkMRQwEgYDVQQDEwtUZXN0IENsaWVu" +
-        "dDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApUvmWsQDHPpbDKK13Yez2/q54tTOmRml/qva" +
-        "2K6dZjkjSTW0iRuk7ztaVEvdJpfVIDv1oBsCI51ttyLHROy1epjF+GoL74mJb7fkcd0VOoSOTjtD" +
-        "+3GgZkHPAm5YmUYxiJXqxKKJJqMCTIW46eJaA2nAep9QIwZ14/NFAs4ObV8CAwEAATANBgkqhkiG" +
-        "9w0BAQUFAAOBgQCJrCr3hZQFDlLIfsSKI1/w+BLvyf4fubOid0pBxfklR8KBNPTiqjSmu7pd/C/F" +
-        "1FR8CdZUDoPflZHCOU+fj5r5KUC1HyigY/tEUvlforBpfB0uCF+tXW4DbUfOWhfMtLV4nCOJOOZg" +
-        "awfZLJWBJouLKOp427vDftxTSB+Ks8YjlgAAAqwAAAAU+NH6TtrzjyDdCXm5B6Vo7xX5G4YAAAZx" +
-        "EAUkcZtmykn7YdaYxC1jRFJ+GEJpC8nZVg83QClVuCSIS8a5f8Hl44Bk4oepOZsPzhtz3RdVzDVi" +
-        "RFfoyZFsrk9F5bDTVJ6sQbb/1nfJkLhZFXokka0vND5AXMSoD5Bj1Fqem3cK7fSUyqKvFoRKC3XD" +
-        "FQvhqoam29F1rbl8FaYdPvhhZo8TfZQYUyUKwW+RbR44M5iHPx+ykieMe/C/4bcM3z8cwIbYI1aO" +
-        "gjQKS2MK9bs17xaDzeAh4sBKrskFGrDe+2dgvrSKdoakJhLTNTBSG6m+rzqMSCeQpafLKMSjTSSz" +
-        "+KoQ9bLyax8cbvViGGju0SlVhquloZmKOfHr8TukIoV64h3uCGFOVFtQjCYDOq6NbfRvMh14UVF5" +
-        "zgDIGczoD9dMoULWxBmniGSntoNgZM+QP6Id7DBasZGKfrHIAw3lHBqcvB5smemSu7F4itRoa3D8" +
-        "N7hhUEKAc+xA+8NKmXfiCBoHfPHTwDvt4IR7gWjeP3Xv5vitcKQ/MAfO5RwfzkYCXQ3FfjfzmsE1" +
-        "1IfLRDiBj+lhQSulhRVStKI88Che3M4JUNGKllrc0nt1pWa1vgzmUhhC4LSdm6trTHgyJnB6OcS9" +
-        "t2furYjK88j1AuB4921oxMxRm8c4Crq8Pyuf+n3YKi8Pl2BzBtw++0gj0ODlgwut8SrVj66/nvIB" +
-        "jN3kLVahR8nZrEFF6vTTmyXi761pzq9yOVqI57wJGx8o3Ygox1p+pWUPl1hQR7rrhUbgK/Q5wno9" +
-        "uJk07h3IZnNxE+/IKgeMTP/H4+jmyT4mhsexJ2BFHeiKF1KT/FMcJdSi+ZK5yoNVcYuY8aZbx0Ef" +
-        "lHorCXAmLFB0W6Cz4KPP01nD9YBB4olxiK1t7m0AU9zscdivNiuUaB5OIEr+JuZ6dNw=";
+            "AAAAAQAAABT4Rka6fxbFps98Y5k2VilmbibNkQAABfQEAAVteWtleQAAARpYl+POAAAAAQAFWC41"
+            + "MDkAAAJNMIICSTCCAbKgAwIBAgIESEfU9TANBgkqhkiG9w0BAQUFADBpMQswCQYDVQQGEwJVUzET"
+            + "MBEGA1UECBMKQ2FsaWZvcm5pYTEMMAoGA1UEBxMDTVRWMQ8wDQYDVQQKEwZHb29nbGUxEDAOBgNV"
+            + "BAsTB0FuZHJvaWQxFDASBgNVBAMTC1Rlc3QgQ2xpZW50MB4XDTA4MDYwNTExNTg0NVoXDTA4MDkw"
+            + "MzExNTg0NVowaTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExDDAKBgNVBAcTA01U"
+            + "VjEPMA0GA1UEChMGR29vZ2xlMRAwDgYDVQQLEwdBbmRyb2lkMRQwEgYDVQQDEwtUZXN0IENsaWVu"
+            + "dDCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEApUvmWsQDHPpbDKK13Yez2/q54tTOmRml/qva"
+            + "2K6dZjkjSTW0iRuk7ztaVEvdJpfVIDv1oBsCI51ttyLHROy1epjF+GoL74mJb7fkcd0VOoSOTjtD"
+            + "+3GgZkHPAm5YmUYxiJXqxKKJJqMCTIW46eJaA2nAep9QIwZ14/NFAs4ObV8CAwEAATANBgkqhkiG"
+            + "9w0BAQUFAAOBgQCJrCr3hZQFDlLIfsSKI1/w+BLvyf4fubOid0pBxfklR8KBNPTiqjSmu7pd/C/F"
+            + "1FR8CdZUDoPflZHCOU+fj5r5KUC1HyigY/tEUvlforBpfB0uCF+tXW4DbUfOWhfMtLV4nCOJOOZg"
+            + "awfZLJWBJouLKOp427vDftxTSB+Ks8YjlgAAAqwAAAAU+NH6TtrzjyDdCXm5B6Vo7xX5G4YAAAZx"
+            + "EAUkcZtmykn7YdaYxC1jRFJ+GEJpC8nZVg83QClVuCSIS8a5f8Hl44Bk4oepOZsPzhtz3RdVzDVi"
+            + "RFfoyZFsrk9F5bDTVJ6sQbb/1nfJkLhZFXokka0vND5AXMSoD5Bj1Fqem3cK7fSUyqKvFoRKC3XD"
+            + "FQvhqoam29F1rbl8FaYdPvhhZo8TfZQYUyUKwW+RbR44M5iHPx+ykieMe/C/4bcM3z8cwIbYI1aO"
+            + "gjQKS2MK9bs17xaDzeAh4sBKrskFGrDe+2dgvrSKdoakJhLTNTBSG6m+rzqMSCeQpafLKMSjTSSz"
+            + "+KoQ9bLyax8cbvViGGju0SlVhquloZmKOfHr8TukIoV64h3uCGFOVFtQjCYDOq6NbfRvMh14UVF5"
+            + "zgDIGczoD9dMoULWxBmniGSntoNgZM+QP6Id7DBasZGKfrHIAw3lHBqcvB5smemSu7F4itRoa3D8"
+            + "N7hhUEKAc+xA+8NKmXfiCBoHfPHTwDvt4IR7gWjeP3Xv5vitcKQ/MAfO5RwfzkYCXQ3FfjfzmsE1"
+            + "1IfLRDiBj+lhQSulhRVStKI88Che3M4JUNGKllrc0nt1pWa1vgzmUhhC4LSdm6trTHgyJnB6OcS9"
+            + "t2furYjK88j1AuB4921oxMxRm8c4Crq8Pyuf+n3YKi8Pl2BzBtw++0gj0ODlgwut8SrVj66/nvIB"
+            + "jN3kLVahR8nZrEFF6vTTmyXi761pzq9yOVqI57wJGx8o3Ygox1p+pWUPl1hQR7rrhUbgK/Q5wno9"
+            + "uJk07h3IZnNxE+/IKgeMTP/H4+jmyT4mhsexJ2BFHeiKF1KT/FMcJdSi+ZK5yoNVcYuY8aZbx0Ef"
+            + "lHorCXAmLFB0W6Cz4KPP01nD9YBB4olxiK1t7m0AU9zscdivNiuUaB5OIEr+JuZ6dNw=";
 
 
     /**
@@ -442,60 +336,43 @@
      * because our self-signed test certificates are not valid.)
      */
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = SSLSocket.class,
-            method = "addHandshakeCompletedListener",
-            args = {HandshakeCompletedListener.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            clazz = HandshakeCompletedListener.class,
-            method = "handshakeCompleted",
-            args = {HandshakeCompletedEvent.class}
-        )
-    })
     @AndroidOnly("Uses bks key store. Change useBKS to false to run on the RI")
-    public void testClientAuth() {
+    public void testClientAuth() throws Exception {
 
         boolean useBKS = true;
 
         listener = new MyHandshakeListener();
-        try {
-            String serverKeys = (useBKS ? SERVER_KEYS_BKS : SERVER_KEYS_JKS);
-            String clientKeys = (useBKS ? CLIENT_KEYS_BKS : CLIENT_KEYS_JKS);
-            TestServer server = new TestServer(true,
-                    TestServer.CLIENT_AUTH_WANTED, serverKeys);
-            TestClient client = new TestClient(true, clientKeys);
+        String serverKeys = (useBKS ? SERVER_KEYS_BKS : SERVER_KEYS_JKS);
+        String clientKeys = (useBKS ? CLIENT_KEYS_BKS : CLIENT_KEYS_JKS);
+        TestServer server = new TestServer(true,
+                                           TestServer.CLIENT_AUTH_WANTED, serverKeys);
+        TestClient client = new TestClient(true, clientKeys);
 
-            Thread serverThread = new Thread(server);
-            Thread clientThread = new Thread(client);
+        Thread serverThread = new Thread(server);
+        Thread clientThread = new Thread(client);
 
-            serverThread.start();
-            Thread.currentThread().sleep(3000);
-            clientThread.start();
+        serverThread.start();
+        Thread.currentThread().sleep(3000);
+        clientThread.start();
 
-            serverThread.join();
-            clientThread.join();
+        serverThread.join();
+        clientThread.join();
 
-            // The server must have completed without an exception.
-            if (server.getException() != null) {
-                throw new RuntimeException(server.getException());
-            }
-
-            // The client must have completed without an exception.
-            if (client.getException() != null) {
-                throw new RuntimeException(client.getException());
-            }
-
-            assertTrue(listener.completeDone);
-
-        } catch (Exception ex) {
-            throw new RuntimeException(ex);
+        // The server must have completed without an exception.
+        Exception e = server.getException();
+        if (e != null) {
+            e.printStackTrace();
         }
+
+        // The client must have completed without an exception.
+        e = client.getException();
+        if (e != null) {
+            e.printStackTrace();
+        }
+
+        assertNull(e);
+
+        assertTrue(listener.completeDone);
     }
 
     /**
@@ -537,7 +414,8 @@
                 SSLContext sslContext = SSLContext.getInstance("TLS");
                 sslContext.init(keyManagers, trustManagers, null);
 
-                SSLServerSocket serverSocket = (SSLServerSocket)sslContext.getServerSocketFactory().createServerSocket();
+                SSLServerSocket serverSocket = (SSLServerSocket)
+                        sslContext.getServerSocketFactory().createServerSocket();
 
                 if (clientAuth == CLIENT_AUTH_WANTED) {
                     serverSocket.setWantClientAuth(true);
@@ -555,9 +433,7 @@
 
                 for (int i = 0; i < 256; i++) {
                     int j = istream.read();
-                    if (i != j) {
-                        throw new RuntimeException("Error reading socket, expected " + i + ", got " + j);
-                    }
+                    assertEquals(i, j);
                 }
 
                 istream.close();
@@ -638,9 +514,7 @@
 
                 for (int i = 0; i < 256; i++) {
                     int j = istream.read();
-                    if (i != j) {
-                        throw new RuntimeException("Error reading socket, expected " + i + ", got " + j);
-                    }
+                    assertEquals(i, j);
                 }
 
                 istream.close();
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/HttpsURLConnectionTest.java b/luni/src/test/java/tests/api/javax/net/ssl/HttpsURLConnectionTest.java
index 3fd8285..3c49fc4 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/HttpsURLConnectionTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/HttpsURLConnectionTest.java
@@ -18,10 +18,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.ByteArrayInputStream;
 import java.net.URL;
 import java.security.Principal;
@@ -45,18 +41,11 @@
  * Tests for <code>HttpsURLConnection</code> class constructors and methods.
  *
  */
-@TestTargetClass(HttpsURLConnection.class)
 public class HttpsURLConnectionTest extends TestCase {
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#HttpsURLConnection(java_net_URL)
+     * javax.net.ssl.HttpsURLConnection#HttpsURLConnection(java_net_URL)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "HttpsURLConnection",
-        args = {java.net.URL.class}
-    )
     public final void test_Constructor() {
         try {
             MyHttpsURLConnection huc = new MyHttpsURLConnection(new URL("https://www.fortify.net/"));
@@ -71,14 +60,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getCipherSuite()
+     * javax.net.ssl.HttpsURLConnection#getCipherSuite()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCipherSuite",
-        args = {}
-    )
     public final void test_getCipherSuite() {
         try {
             URL url = new URL("https://localhost:55555");
@@ -102,14 +85,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getLocalCertificates()
+     * javax.net.ssl.HttpsURLConnection#getLocalCertificates()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLocalCertificates",
-        args = {}
-    )
     public final void test_getLocalCertificates() {
         try {
             URL url = new URL("https://localhost:55555");
@@ -137,14 +114,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getDefaultHostnameVerifier()
+     * javax.net.ssl.HttpsURLConnection#getDefaultHostnameVerifier()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultHostnameVerifier",
-        args = {}
-    )
     public final void test_getDefaultHostnameVerifier() {
         HostnameVerifier verifyer =
             HttpsURLConnection.getDefaultHostnameVerifier();
@@ -152,14 +123,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory()
+     * javax.net.ssl.HttpsURLConnection#getDefaultSSLSocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultSSLSocketFactory",
-        args = {}
-    )
     public final void test_getDefaultSSLSocketFactory() {
         SSLSocketFactory sf = HttpsURLConnection.getDefaultSSLSocketFactory();
         if (!sf.equals(SSLSocketFactory.getDefault())) {
@@ -168,14 +133,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getHostnameVerifier()
+     * javax.net.ssl.HttpsURLConnection#getHostnameVerifier()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHostnameVerifier",
-        args = {}
-    )
     public final void test_getHostnameVerifier()
         throws Exception {
         HttpsURLConnection con = new MyHttpsURLConnection(
@@ -187,14 +146,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getLocalPrincipal()
+     * javax.net.ssl.HttpsURLConnection#getLocalPrincipal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLocalPrincipal",
-        args = {}
-    )
     public final void test_getLocalPrincipal() {
         try {
             URL url = new URL("https://localhost:55555");
@@ -220,14 +173,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getPeerPrincipal()
+     * javax.net.ssl.HttpsURLConnection#getPeerPrincipal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPeerPrincipal",
-        args = {}
-    )
     public final void test_getPeerPrincipal() throws Exception {
         try {
             URL url = new URL("https://localhost:55555");
@@ -259,14 +206,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getServerCertificates()
+     * javax.net.ssl.HttpsURLConnection#getServerCertificates()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getServerCertificates",
-        args = {}
-    )
     public final void test_getServerCertificates() throws Exception {
         try {
             URL url = new URL("https://localhost:55555");
@@ -300,14 +241,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#getSSLSocketFactory()
+     * javax.net.ssl.HttpsURLConnection#getSSLSocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSSLSocketFactory",
-        args = {}
-    )
     public final void test_getSSLSocketFactory() {
         HttpsURLConnection con = new MyHttpsURLConnection(null);
         SSLSocketFactory sf = con.getSSLSocketFactory();
@@ -317,14 +252,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#setDefaultHostnameVerifier()
+     * javax.net.ssl.HttpsURLConnection#setDefaultHostnameVerifier()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDefaultHostnameVerifier",
-        args = {javax.net.ssl.HostnameVerifier.class}
-    )
     public final void test_setDefaultHostnameVerifier() {
         try {
             HttpsURLConnection.setDefaultHostnameVerifier(null);
@@ -345,14 +274,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#setHostnameVerifier()
+     * javax.net.ssl.HttpsURLConnection#setHostnameVerifier()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setHostnameVerifier",
-        args = {javax.net.ssl.HostnameVerifier.class}
-    )
     public final void test_setHostnameVerifier() {
         HttpsURLConnection con = new MyHttpsURLConnection(null);
         try {
@@ -369,14 +292,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#setDefaultSSLSocketFactory()
+     * javax.net.ssl.HttpsURLConnection#setDefaultSSLSocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDefaultSSLSocketFactory",
-        args = {javax.net.ssl.SSLSocketFactory.class}
-    )
     public final void test_setDefaultSSLSocketFactory() {
         try {
             HttpsURLConnection.setDefaultSSLSocketFactory(null);
@@ -393,14 +310,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.HttpsURLConnection#setSSLSocketFactory()
+     * javax.net.ssl.HttpsURLConnection#setSSLSocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSSLSocketFactory",
-        args = {javax.net.ssl.SSLSocketFactory.class}
-    )
     public final void test_setSSLSocketFactory() {
         HttpsURLConnection con = new MyHttpsURLConnection(null);
         try {
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory1Test.java b/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory1Test.java
index f265044..b369ed9 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory1Test.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory1Test.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.KnownFailure;
-
 import java.io.IOException;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
@@ -48,7 +43,6 @@
  * Tests for <code>KeyManagerFactory</code> class constructors and methods.
  *
  */
-@TestTargetClass(KeyManagerFactory.class)
 public class KeyManagerFactory1Test extends TestCase {
 
     private static final String srvKeyManagerFactory = "KeyManagerFactory";
@@ -101,14 +95,8 @@
     }
 
     /**
-     * @tests avax.net.ssl.KeyManagerFactory#getAlgorithm()
+     * avax.net.ssl.KeyManagerFactory#getAlgorithm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm()
         throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) fail(NotSupportedMsg);
@@ -131,12 +119,6 @@
      *  Test for <code>getDefaultAlgorithm()</code> method
      * Assertion: returns value which is specifoed in security property
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultAlgorithm",
-        args = {}
-    )
     public void test_getDefaultAlgorithm() {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -166,12 +148,6 @@
      * returns security property "ssl.KeyManagerFactory.algorithm";
      * returns instance of KeyManagerFactory
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String01() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -192,12 +168,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String02() {
         try {
             KeyManagerFactory.getInstance(null);
@@ -220,12 +190,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null or empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String01() throws NoSuchProviderException,
             NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -254,12 +218,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String02() throws NoSuchProviderException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -288,12 +246,6 @@
      * Assertion: throws NoSuchProviderException when provider has
      * invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String03()
         throws NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -318,12 +270,6 @@
      * Test for <code>getInstance(String algorithm, String provider)</code>
      * method Assertion: returns instance of KeyManagerFactory
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String04()
         throws NoSuchProviderException,
             NoSuchAlgorithmException {
@@ -348,12 +294,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider01()
         throws NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -377,12 +317,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider02() {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -409,12 +343,6 @@
      * method
      * Assertion: returns instance of KeyManagerFactory
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider03()
         throws NoSuchAlgorithmException,
             IllegalArgumentException {
@@ -436,12 +364,6 @@
      * Test for <code>KeyManagerFactory</code> constructor
      * Assertion: returns KeyManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyManagerFactory",
-        args = {javax.net.ssl.KeyManagerFactorySpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void test_Constructor() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -470,19 +392,13 @@
     }
 
     /**
-     * @tests avax.net.ssl.KeyManagerFactory#getKeyManagers()
+     * avax.net.ssl.KeyManagerFactory#getKeyManagers()
      * @throws NoSuchAlgorithmException
      * @throws KeyStoreException
      * @throws IOException
      * @throws CertificateException
      * @throws UnrecoverableKeyException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKeyManagers",
-        args = {}
-    )
     public void test_getKeyManagers()
         throws Exception {
         if (!DEFSupported) fail(NotSupportedMsg);
@@ -495,14 +411,8 @@
     }
 
     /**
-     * @tests avax.net.ssl.KeyManagerFactory#getProvider()
+     * avax.net.ssl.KeyManagerFactory#getProvider()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider()
         throws Exception {
         if (!DEFSupported) fail(NotSupportedMsg);
@@ -526,12 +436,6 @@
      * <code>getKeyManagers()</code>
      * Assertion: returns not empty KeyManager array
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "KeyStoreException, NoSuchAlgorithmException, UnrecoverableKeyException checking missed",
-        method = "init",
-        args = {java.security.KeyStore.class, char[].class}
-    )
     public void test_initLjava_security_KeyStore$C()
         throws NoSuchAlgorithmException,
         KeyStoreException, UnrecoverableKeyException {
@@ -579,12 +483,6 @@
      * Assertion:
      * throws InvalidAlgorithmParameterException when params is null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "functionality is not implemented in org.apache.harmony.xnet.provider.jsse.engineInit(ManagerFactoryParameters)",
-        method = "init",
-        args = {javax.net.ssl.ManagerFactoryParameters.class}
-    )
     public void test_initLjavax_net_ssl_ManagerFactoryParameters()
         throws NoSuchAlgorithmException {
 
@@ -631,4 +529,4 @@
 
 class ProtectionParameterImpl implements KeyStore.ProtectionParameter {
     ProtectionParameterImpl(){}
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory2Test.java b/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory2Test.java
index 2a819cf..3d44396 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory2Test.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory2Test.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -42,7 +37,6 @@
  * Tests for KeyManagerFactory class constructors and methods
  *
  */
-@TestTargetClass(KeyManagerFactory.class)
 public class KeyManagerFactory2Test extends TestCase {
     private static final String srvKeyManagerFactory = "KeyManagerFactory";
 
@@ -130,12 +124,6 @@
      * throws NoSuchAlgorithmException when algorithm is not correct;
      * returns KeyManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() throws Exception {
         try {
             KeyManagerFactory.getInstance(null);
@@ -171,12 +159,6 @@
      * throws NoSuchProviderException when provider is available;
      * returns KeyManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String()
         throws Exception
     {
@@ -243,12 +225,6 @@
      * throws IllegalArgumentException when provider is null;
      * returns KeyManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider()
         throws Exception
     {
@@ -284,4 +260,4 @@
             checkResult(keyMF);
        }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactorySpiTest.java b/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactorySpiTest.java
index c8b5674..fd44fda 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactorySpiTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactorySpiTest.java
@@ -15,10 +15,6 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -32,18 +28,11 @@
 
 import org.apache.harmony.xnet.tests.support.KeyManagerFactorySpiImpl;
 
-@TestTargetClass(KeyManagerFactorySpi.class)
 public class KeyManagerFactorySpiTest extends TestCase {
 
     /**
-     * @tests javax.net.ssl.KeyManagerFactorySpi#KeyManagerFactorySpi()
+     * javax.net.ssl.KeyManagerFactorySpi#KeyManagerFactorySpi()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyManagerFactorySpi",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             KeyManagerFactorySpiImpl kmf = new KeyManagerFactorySpiImpl();
@@ -54,14 +43,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.KeyManagerFactorySpi#KengineInit(KeyStore ks, char[] password)
+     * javax.net.ssl.KeyManagerFactorySpi#KengineInit(KeyStore ks, char[] password)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineInit",
-        args = {java.security.KeyStore.class, char[].class}
-    )
     public void test_engineInit_01() {
         KeyManagerFactorySpiImpl kmf = new KeyManagerFactorySpiImpl();
         KeyStore ks;
@@ -105,14 +88,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.KeyManagerFactorySpi#KengineInit(ManagerFactoryParameters spec)
+     * javax.net.ssl.KeyManagerFactorySpi#KengineInit(ManagerFactoryParameters spec)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineInit",
-        args = {javax.net.ssl.ManagerFactoryParameters.class}
-    )
     public void test_engineInit_02() {
         KeyManagerFactorySpiImpl kmf = new KeyManagerFactorySpiImpl();
 
@@ -135,14 +112,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.KeyManagerFactorySpi#engineGetKeyManagers()
+     * javax.net.ssl.KeyManagerFactorySpi#engineGetKeyManagers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineGetKeyManagers",
-        args = {}
-    )
     public void test_engineGetKeyManagers() {
         KeyManagerFactorySpiImpl kmf = new KeyManagerFactorySpiImpl();
 
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/KeyStoreBuilderParametersTest.java b/luni/src/test/java/tests/api/javax/net/ssl/KeyStoreBuilderParametersTest.java
index 341342e..762850b 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/KeyStoreBuilderParametersTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/KeyStoreBuilderParametersTest.java
@@ -15,11 +15,6 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.KeyManagerFactorySpi;
 import javax.net.ssl.KeyStoreBuilderParameters;
 import java.security.KeyStore;
@@ -28,18 +23,11 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(KeyStoreBuilderParameters.class)
 public class KeyStoreBuilderParametersTest extends TestCase {
 
     /**
-     * @tests javax.net.ssl.KeyStoreBuilderParameters#KeyStoreBuilderParameters(KeyStore.Builder builder)
+     * javax.net.ssl.KeyStoreBuilderParameters#KeyStoreBuilderParameters(KeyStore.Builder builder)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyStoreBuilderParameters",
-        args = {java.security.KeyStore.Builder.class}
-    )
     public void test_Constructor01() {
         KeyStore.Builder bld = null;
 
@@ -64,14 +52,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.KeyStoreBuilderParameters#KeyStoreBuilderParameters(List parameters)
+     * javax.net.ssl.KeyStoreBuilderParameters#KeyStoreBuilderParameters(List parameters)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "KeyStoreBuilderParameters",
-        args = {java.util.List.class}
-    )
     public void test_Constructor02() {
 
         //Null parameter
@@ -105,14 +87,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.KeyStoreBuilderParameters#getParameters()
+     * javax.net.ssl.KeyStoreBuilderParameters#getParameters()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParameters",
-        args = {}
-    )
     public void test_getParameters() {
         String[] param = {"Parameter1", "Parameter2", "Parameter3"};
         List ls = new ArrayList<String>();
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLContext1Test.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLContext1Test.java
index 62b2d95..ee51cc0 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLContext1Test.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLContext1Test.java
@@ -43,15 +43,10 @@
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 import org.apache.harmony.xnet.tests.support.MySSLContextSpi;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 /**
  * Tests for <code>SSLContext</code> class constructors and methods.
  *
  */
-@TestTargetClass(SSLContext.class)
 public class SSLContext1Test extends TestCase {
 
     private static String srvSSLContext = "SSLContext";
@@ -98,12 +93,6 @@
      * Test for <code>SSLContext</code> constructor Assertion: returns
      * SSLContext object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLContext",
-        args = {javax.net.ssl.SSLContextSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void test_ConstructorLjavax_net_ssl_SSLContextSpiLjava_security_ProviderLjava_lang_String()
         throws NoSuchAlgorithmException,
             KeyManagementException {
@@ -149,14 +138,8 @@
 
     /**
      * @throws KeyManagementException
-     * @tests javax.net.ssl.SSLContext#createSSLEngine()
+     * javax.net.ssl.SSLContext#createSSLEngine()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "UnsupportedOperationException checking missed",
-        method = "createSSLEngine",
-        args = {}
-    )
     public void test_createSSLEngine() throws KeyManagementException {
         if (!DEFSupported) fail(NotSupportMsg);
         SSLContextSpi spi = new MySSLContextSpi();
@@ -169,14 +152,8 @@
 
     /**
      * @throws KeyManagementException
-     * @tests javax.net.ssl.SSLContext#createSSLEngine(java.lang.String, int)
+     * javax.net.ssl.SSLContext#createSSLEngine(java.lang.String, int)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "UnsupportedOperationException checking missed",
-        method = "createSSLEngine",
-        args = {java.lang.String.class, int.class}
-    )
     public void test_createSSLEngineLjava_lang_StringI()
         throws KeyManagementException {
         if (!DEFSupported) fail(NotSupportMsg);
@@ -194,12 +171,6 @@
      * methods Assertion: returns correspondent object
      * @throws KeyManagementException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getClientSessionContext",
-        args = {}
-    )
     public void test_getClientSessionContext() throws NoSuchAlgorithmException, KeyManagementException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -220,12 +191,6 @@
      * Test for <code>getInstance(String protocol)</code> method Assertion:
      * returns SSLContext object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String01()
             throws NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -246,12 +211,6 @@
      * throws NullPointerException when protocol is null; throws
      * NoSuchAlgorithmException when protocol is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String02() {
         try {
             SSLContext.getInstance(null);
@@ -274,12 +233,6 @@
      * method Assertion: throws IllegalArgumentException when provider is null
      * or empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String01() throws NoSuchProviderException,
             NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -306,12 +259,6 @@
      * method Assertion: throws NullPointerException when protocol is null;
      * throws NoSuchAlgorithmException when protocol is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String02() throws NoSuchProviderException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -338,12 +285,6 @@
      * method Assertion: throws NoSuchProviderException when provider has
      * invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String03() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -366,12 +307,6 @@
      * Test for <code>getInstance(String protocol, String provider)</code>
      * method Assertion: returns instance of SSLContext
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String04() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!DEFSupported) {
@@ -394,12 +329,6 @@
      * Test for <code>getInstance(String protocol, Provider provider)</code>
      * method Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider01() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -420,12 +349,6 @@
      * method Assertion: throws NullPointerException when protocol is null;
      * throws NoSuchAlgorithmException when protocol is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider02() {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -450,12 +373,6 @@
      * Test for <code>getInstance(String protocol, Provider provider)</code>
      * method Assertion: returns instance of SSLContext
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider03() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportMsg);
@@ -474,14 +391,8 @@
     /**
      * @throws NoSuchAlgorithmException
      * @throws NoSuchProviderException
-     * @tests javax.net.ssl.SSLContext#getProtocol()
+     * javax.net.ssl.SSLContext#getProtocol()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProtocol",
-        args = {}
-    )
     public void test_getProtocol()
         throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) fail(NotSupportMsg);
@@ -507,14 +418,8 @@
     /**
      * @throws NoSuchAlgorithmException
      * @throws NoSuchProviderException
-     * @tests javax.net.ssl.SSLContext#getProvider()
+     * javax.net.ssl.SSLContext#getProvider()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider()
         throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) fail(NotSupportMsg);
@@ -532,14 +437,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLContext#getServletSessionContext()
+     * javax.net.ssl.SSLContext#getServletSessionContext()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getServerSessionContext",
-        args = {}
-    )
     public void test_getServerSessionContext() throws NoSuchAlgorithmException,
         KeyManagementException, KeyStoreException,
         UnrecoverableKeyException {
@@ -572,12 +471,6 @@
      * methods Assertion: returns correspondent object
      *
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getServerSocketFactory",
-        args = {}
-    )
      public void test_getServerSocketFactory() throws NoSuchAlgorithmException,
             KeyManagementException, KeyStoreException,
             UnrecoverableKeyException {
@@ -619,14 +512,8 @@
     }
 
      /**
-      * @tests javax.net.ssl.SSLContext#getSocketFactory()
+      * javax.net.ssl.SSLContext#getSocketFactory()
       */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSocketFactory",
-        args = {}
-    )
      public void test_getSocketFactory() throws NoSuchAlgorithmException,
          KeyManagementException, KeyStoreException,
          UnrecoverableKeyException {
@@ -657,16 +544,10 @@
      * @throws KeyStoreException
      * @throws FileNotFoundException
      * @throws KeyManagementException
-     * @tests javax.net.ssl.SSLContext#
+     * javax.net.ssl.SSLContext#
       *     init(javax.net.ssl.KeyManager[], javax.net.ssl.TrustManager[],
       *     java.security.SecureRandom)
       */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {javax.net.ssl.KeyManager[].class, javax.net.ssl.TrustManager[].class, java.security.SecureRandom.class}
-    )
      public void test_init$Ljavax_net_ssl_KeyManager$Ljavax_net_ssl_TrustManagerLjava_security_SecureRandom()
          throws Exception {
          if (!DEFSupported) fail(NotSupportMsg);
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLContextSpiTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLContextSpiTest.java
index c47730f..45a1c14 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLContextSpiTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLContextSpiTest.java
@@ -15,11 +15,6 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.SSLContextSpi;
 import javax.net.ssl.SSLEngine;
@@ -39,18 +34,11 @@
 
 import org.apache.harmony.xnet.tests.support.SSLContextSpiImpl;
 
-@TestTargetClass(SSLContextSpi.class)
 public class SSLContextSpiTest extends TestCase {
 
     /**
-     * @tests javax.net.ssl.SSLContextSpi#SSLContextSpi()
+     * javax.net.ssl.SSLContextSpi#SSLContextSpi()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLContextSpi",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             SSLContextSpiImpl ssl = new SSLContextSpiImpl();
@@ -61,15 +49,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLContextSpi#engineCreateSSLEngine()
+     * javax.net.ssl.SSLContextSpi#engineCreateSSLEngine()
      * Verify exception when SSLContextSpi object wasn't initialiazed.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "engineCreateSSLEngine",
-        args = {}
-    )
     public void test_engineCreateSSLEngine_01() {
         SSLContextSpiImpl ssl = new SSLContextSpiImpl();
         try {
@@ -85,15 +67,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLContextSpi#engineCreateSSLEngine(String host, int port)
+     * javax.net.ssl.SSLContextSpi#engineCreateSSLEngine(String host, int port)
      * Verify exception when SSLContextSpi object wasn't initialiazed.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "engineCreateSSLEngine",
-        args = {java.lang.String.class, int.class}
-    )
     public void test_engineCreateSSLEngine_02() {
         int[] invalid_port = {Integer.MIN_VALUE, -65535, -1, 65536, Integer.MAX_VALUE};
         SSLContextSpiImpl ssl = new SSLContextSpiImpl();
@@ -119,38 +95,12 @@
     }
 
     /**
-     * @tests SSLContextSpi#engineGetClientSessionContext()
-     * @tests SSLContextSpi#engineGetServerSessionContext()
-     * @tests SSLContextSpi#engineGetServerSocketFactory()
-     * @tests SSLContextSpi#engineGetSocketFactory()
+     * SSLContextSpi#engineGetClientSessionContext()
+     * SSLContextSpi#engineGetServerSessionContext()
+     * SSLContextSpi#engineGetServerSocketFactory()
+     * SSLContextSpi#engineGetSocketFactory()
      * Verify exception when SSLContextSpi object wasn't initialiazed.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetClientSessionContext",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetServerSessionContext",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetServerSocketFactory",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetSocketFactory",
-            args = {}
-        )
-    })
     public void test_commonTest_01() {
         SSLContextSpiImpl ssl = new SSLContextSpiImpl();
 
@@ -200,14 +150,8 @@
     }
 
     /**
-     * @tests SSLContextSpi#engineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr)
+     * SSLContextSpi#engineInit(KeyManager[] km, TrustManager[] tm, SecureRandom sr)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineInit",
-        args = {javax.net.ssl.KeyManager[].class, javax.net.ssl.TrustManager[].class, java.security.SecureRandom.class}
-    )
     public void test_engineInit() {
         SSLContextSpiImpl ssl = new SSLContextSpiImpl();
         String defaultAlgorithm = Security.getProperty("ssl.KeyManagerFactory.algorithm");
@@ -240,51 +184,13 @@
     }
 
     /**
-     * @tests SSLContextSpi#engineCreateSSLEngine()
-     * @tests SSLContextSpi#engineCreateSSLEngine(String host, int port)
-     * @tests SSLContextSpi#engineGetClientSessionContext()
-     * @tests SSLContextSpi#engineGetServerSessionContext()
-     * @tests SSLContextSpi#engineGetServerSocketFactory()
-     * @tests SSLContextSpi#engineGetSocketFactory()
+     * SSLContextSpi#engineCreateSSLEngine()
+     * SSLContextSpi#engineCreateSSLEngine(String host, int port)
+     * SSLContextSpi#engineGetClientSessionContext()
+     * SSLContextSpi#engineGetServerSessionContext()
+     * SSLContextSpi#engineGetServerSocketFactory()
+     * SSLContextSpi#engineGetSocketFactory()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineCreateSSLEngine",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineCreateSSLEngine",
-            args = {java.lang.String.class, int.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetClientSessionContext",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetServerSessionContext",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetServerSocketFactory",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "engineGetSocketFactory",
-            args = {}
-        )
-    })
     public void test_commonTest_02() {
         SSLContextSpiImpl ssl = new SSLContextSpiImpl();
         String defaultAlgorithm = Security.getProperty("ssl.KeyManagerFactory.algorithm");
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultHandshakeStatusTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultHandshakeStatusTest.java
index bc835a1..3b13673 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultHandshakeStatusTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultHandshakeStatusTest.java
@@ -16,10 +16,6 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLEngineResult;
 
 import junit.framework.TestCase;
@@ -28,18 +24,11 @@
  * Tests for SSLEngineResult.Status class
  *
  */
-@TestTargetClass(SSLEngineResult.HandshakeStatus.class)
 public class SSLEngineResultHandshakeStatusTest extends TestCase {
 
     /**
      * Test for <code> SSLEngineResult.HandshakeStatus.values() </code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_SSLEngineResultHandshakeStatus_values() {
         String[] str = {"NOT_HANDSHAKING", "FINISHED", "NEED_TASK", "NEED_WRAP", "NEED_UNWRAP"};
         SSLEngineResult.HandshakeStatus[] enS = SSLEngineResult.HandshakeStatus.values();
@@ -56,12 +45,6 @@
     /**
      * Test for <code> SSLEngineResult.HandshakeStatus.valueOf(String name) </code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "valueOf",
-        args = {String.class}
-    )
     public void test_SSLEngineResultStatus_valueOf() {
         String[] str = {"FINISHED", "NEED_TASK", "NEED_UNWRAP", "NEED_WRAP", "NOT_HANDSHAKING"};
         String[] str_invalid = {"", "FINISHED1", "NEED_task", "NEED_UN",
@@ -97,4 +80,4 @@
         } catch (IllegalArgumentException iae) {
         }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultStatusTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultStatusTest.java
index 3e7def5..05c8f03 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultStatusTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultStatusTest.java
@@ -16,10 +16,6 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLEngineResult;
 
 import junit.framework.TestCase;
@@ -28,18 +24,11 @@
  * Tests for SSLEngineResult.Status class
  *
  */
-@TestTargetClass(SSLEngineResult.Status.class)
 public class SSLEngineResultStatusTest extends TestCase {
 
     /**
      * Test for <code> SSLEngineResult.Status.values() </code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "values",
-        args = {}
-    )
     public void test_SSLEngineResultStatus_values() {
         boolean flag = false;
         String[] str = {"BUFFER_OVERFLOW", "BUFFER_UNDERFLOW", "CLOSED", "OK"};
@@ -63,12 +52,6 @@
     /**
      * Test for <code> SSLEngineResult.Status.valueOf(String name) </code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "valueOf",
-        args = {String.class}
-    )
     public void test_SSLEngineResultStatus_valueOf() {
         String[] str = {"BUFFER_OVERFLOW", "BUFFER_UNDERFLOW", "CLOSED", "OK"};
         String[] str_invalid = {"", "OK1", "BUFFER_overflow", "BUFFER_UND",
@@ -104,4 +87,4 @@
         } catch (IllegalArgumentException iae) {
         }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultTest.java
index 486da1a..7a2ac78 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLEngineResult;
 import junit.framework.TestCase;
 
@@ -30,7 +25,6 @@
  * Tests for SSLEngineResult class
  *
  */
-@TestTargetClass(SSLEngineResult.class)
 public class SSLEngineResultTest extends TestCase {
 
     /**
@@ -50,12 +44,6 @@
      * is null
      *
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLEngineResult",
-        args = {javax.net.ssl.SSLEngineResult.Status.class, javax.net.ssl.SSLEngineResult.HandshakeStatus.class, int.class, int.class}
-    )
     public void test_ConstructorLjavax_net_ssl_SSLEngineResult_StatusLjavax_net_ssl_SSLEngineResult_HandshakeStatusII() {
 
         int[] neg = { -1, -10, -1000, Integer.MIN_VALUE,
@@ -103,12 +91,6 @@
     /**
      * Test for <code>bytesConsumed()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "bytesConsumed",
-        args = {}
-    )
     public void test_bytesConsumed() {
         int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) };
         SSLEngineResult.Status [] enS =
@@ -132,12 +114,6 @@
     /**
      * Test for <code>bytesProduced()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "bytesProduced",
-        args = {}
-    )
     public void test_bytesProduced() {
         int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) };
         SSLEngineResult.Status [] enS =
@@ -161,12 +137,6 @@
     /**
      * Test for <code>getHandshakeStatus()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHandshakeStatus",
-        args = {}
-    )
     public void test_getHandshakeStatus() {
         int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) };
         SSLEngineResult.Status [] enS =
@@ -190,12 +160,6 @@
     /**
      * Test for <code>getStatus()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getStatus",
-        args = {}
-    )
     public void test_getStatus() {
         int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) };
         SSLEngineResult.Status [] enS =
@@ -219,12 +183,6 @@
     /**
      * Test for <code>toString()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         int[] pos = { 0, 1, 1000, Integer.MAX_VALUE, (Integer.MAX_VALUE - 1) };
         SSLEngineResult.Status [] enS =
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java
index d8d186e..31d0a12 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java
@@ -38,17 +38,12 @@
 import junit.framework.TestCase;
 import dalvik.annotation.AndroidOnly;
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
 
 /**
  * Tests for SSLEngine class
  *
  */
-@TestTargetClass(SSLEngine.class)
 public class SSLEngineTest extends TestCase {
 
     private HandshakeHandler clientEngine;
@@ -63,12 +58,6 @@
      * SSLEngine object with null host and -1 port
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLEngine",
-        args = {}
-    )
     public void test_Constructor() throws NoSuchAlgorithmException {
         SSLEngine e = getEngine();
         assertNull(e.getPeerHost());
@@ -82,12 +71,6 @@
      * Test for <code>SSLEngine(String host, int port)</code> constructor
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verification with incorrect parameters missed",
-        method = "SSLEngine",
-        args = {java.lang.String.class, int.class}
-    )
     public void test_ConstructorLjava_lang_StringI01() throws NoSuchAlgorithmException {
         int port = 1010;
         SSLEngine e = getEngine(null, port);
@@ -120,12 +103,6 @@
      * Test for <code>SSLEngine(String host, int port)</code> constructor
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verification with incorrect parameters missed",
-        method = "SSLEngine",
-        args = {java.lang.String.class, int.class}
-    )
     public void test_ConstructorLjava_lang_StringI02() throws NoSuchAlgorithmException {
         String host = "new host";
         int port = 8080;
@@ -143,12 +120,6 @@
      * Test for <code>getPeerHost()</code> method
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPeerHost",
-        args = {}
-    )
     public void test_getPeerHost() throws NoSuchAlgorithmException {
         SSLEngine e = getEngine();
         assertNull(e.getPeerHost());
@@ -160,12 +131,6 @@
      * Test for <code>getPeerPort()</code> method
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPeerPort",
-        args = {}
-    )
     public void test_getPeerPort() throws NoSuchAlgorithmException {
         SSLEngine e = getEngine();
         assertEquals("Incorrect default value of peer port",
@@ -176,14 +141,8 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#getSupportedProtocols()
+     * javax.net.ssl.SSLEngine#getSupportedProtocols()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedProtocols",
-        args = {}
-    )
     public void test_getSupportedProtocols() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -197,23 +156,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#setEnabledProtocols(String[] protocols)
-     * @tests javax.net.ssl.SSLEngine#getEnabledProtocols()
+     * javax.net.ssl.SSLEngine#setEnabledProtocols(String[] protocols)
+     * javax.net.ssl.SSLEngine#getEnabledProtocols()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnabledProtocols",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnabledProtocols",
-            args = {String[].class}
-        )
-    })
     public void test_EnabledProtocols() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         String[] pr = sse.getSupportedProtocols();
@@ -236,14 +181,8 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#getSupportedCipherSuites()
+     * javax.net.ssl.SSLEngine#getSupportedCipherSuites()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedCipherSuites",
-        args = {}
-    )
     public void test_getSupportedCipherSuites() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -257,23 +196,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#setEnabledCipherSuites(String[] suites)
-     * @tests javax.net.ssl.SSLEngine#getEnabledCipherSuites()
+     * javax.net.ssl.SSLEngine#setEnabledCipherSuites(String[] suites)
+     * javax.net.ssl.SSLEngine#getEnabledCipherSuites()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnabledCipherSuites",
-            args = {String[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnabledCipherSuites",
-            args = {}
-        )
-    })
     public void test_EnabledCipherSuites() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         String[] st = sse.getSupportedCipherSuites();
@@ -296,23 +221,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#setEnableSessionCreation(boolean flag)
-     * @tests javax.net.ssl.SSLEngine#getEnableSessionCreation()
+     * javax.net.ssl.SSLEngine#setEnableSessionCreation(boolean flag)
+     * javax.net.ssl.SSLEngine#getEnableSessionCreation()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnableSessionCreation",
-            args = {boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnableSessionCreation",
-            args = {}
-        )
-    })
     public void test_EnableSessionCreation() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -328,23 +239,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#setNeedClientAuth(boolean need)
-     * @tests javax.net.ssl.SSLEngine#getNeedClientAuth()
+     * javax.net.ssl.SSLEngine#setNeedClientAuth(boolean need)
+     * javax.net.ssl.SSLEngine#getNeedClientAuth()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setNeedClientAuth",
-            args = {boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getNeedClientAuth",
-            args = {}
-        )
-    })
     public void test_NeedClientAuth() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -359,23 +256,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#setWantClientAuth(boolean want)
-     * @tests javax.net.ssl.SSLEngine#getWantClientAuth()
+     * javax.net.ssl.SSLEngine#setWantClientAuth(boolean want)
+     * javax.net.ssl.SSLEngine#getWantClientAuth()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setWantClientAuth",
-            args = {boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getWantClientAuth",
-            args = {}
-        )
-    })
     public void test_WantClientAuth() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -390,14 +273,8 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#beginHandshake()
+     * javax.net.ssl.SSLEngine#beginHandshake()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "beginHandshake",
-        args = {}
-    )
     public void test_beginHandshake() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -428,23 +305,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#setUseClientMode(boolean mode)
-     * @tests javax.net.ssl.SSLEngine#getUseClientMode()
+     * javax.net.ssl.SSLEngine#setUseClientMode(boolean mode)
+     * javax.net.ssl.SSLEngine#getUseClientMode()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setUseClientMode",
-            args = {boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getUseClientMode",
-            args = {}
-        )
-    })
     @AndroidOnly("The RI doesn't throw the expected IllegalStateException.")
     public void test_UseClientMode() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
@@ -474,14 +337,8 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#getSession()
+     * javax.net.ssl.SSLEngine#getSession()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSession",
-        args = {}
-    )
     public void test_getSession() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -493,14 +350,8 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#getHandshakeStatus()
+     * javax.net.ssl.SSLEngine#getHandshakeStatus()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getHandshakeStatus",
-        args = {}
-    )
     public void test_getHandshakeStatus() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
         try {
@@ -515,14 +366,8 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#getDelegatedTask()
+     * javax.net.ssl.SSLEngine#getDelegatedTask()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDelegatedTask",
-        args = {}
-    )
     @KnownFailure("org.apache.harmony.xnet.provider.jsse.SSLEngineImpl#getDelegatedTask() throws NPE instead of returning null")
     public void test_getDelegatedTask() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
@@ -536,16 +381,10 @@
     /**
      * @throws IOException
      * @throws InterruptedException
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
      *                                       int offset, int length)
      * Exception case: SSLException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class, int.class, int.class}
-    )
     public void test_unwrap_01() throws IOException, InterruptedException {
         prepareEngines();
         doHandshake();
@@ -561,16 +400,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
      *                                       int offset, int length)
      * Exception case: IndexOutOfBoundsException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class, int.class, int.class}
-    )
     @KnownFailure("Fixed in DonutBurger, boundary checks missing")
     public void test_unwrap_02() throws SSLException {
         String host = "new host";
@@ -608,16 +441,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
      *                                       int offset, int length)
      * Exception case: ReadOnlyBufferException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class, int.class, int.class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_unwrap_03() {
         String host = "new host";
@@ -640,16 +467,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
      *                                       int offset, int length)
      * Exception case: IllegalArgumentException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "IllegalArgumentException should be thrown",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class, int.class, int.class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_unwrap_04() {
         String host = "new host";
@@ -702,16 +523,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
      *                                       int offset, int length)
      * Exception case: IllegalStateException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class, int.class, int.class}
-    )
     @AndroidOnly("The RI doesn't throw the IllegalStateException.")
     public void test_unwrap_05() {
         String host = "new host";
@@ -732,15 +547,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts,
      *                                       int offset, int length)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class, int.class, int.class}
-    )
     public void test_unwrap_06() {
         String host = "new host";
         int port = 8080;
@@ -759,44 +568,19 @@
         }
     }
 
-    /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
-     *                                     int length, ByteBuffer dst)
-     * Exception case: SSLException should be thrown.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "wrap cannot be forced to fail",
-        method = "wrap",
-        args = {ByteBuffer[].class, int.class, int.class, ByteBuffer.class}
-    )
     public void test_wrap_01() throws IOException, InterruptedException {
         prepareEngines();
         doHandshake();
-
         ByteBuffer bbs = ByteBuffer.allocate(100);
         ByteBuffer bbd = ByteBuffer.allocate(20000);
-
-        try {
-            @SuppressWarnings("unused")
-            SSLEngineResult result = clientEngine.engine.wrap(new ByteBuffer[] { bbs }, 0, 1, bbd);
-            //fail("SSLException wasn't thrown");
-        } catch (SSLException ex) {
-            //expected
-        }
+        clientEngine.engine.wrap(new ByteBuffer[] { bbs }, 0, 1, bbd);
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
      *                                     int length, ByteBuffer dst)
      * Exception case: IndexOutOfBoundsException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, int.class, int.class, ByteBuffer.class}
-    )
     @KnownFailure("Fixed in DonutBurger, boundary checks missing")
     public void test_wrap_02() throws SSLException {
         String host = "new host";
@@ -833,16 +617,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
      *                                     int length, ByteBuffer dst)
      * Exception case: ReadOnlyBufferException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, int.class, int.class, ByteBuffer.class}
-    )
     public void test_wrap_03() throws SSLException {
         String host = "new host";
         int port = 8080;
@@ -860,16 +638,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
      *                                     int length, ByteBuffer dst)
      * Exception case: IllegalArgumentException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "IllegalArgumentException must be thrown",
-        method = "wrap",
-        args = {ByteBuffer[].class, int.class, int.class, ByteBuffer.class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_wrap_04() {
         String host = "new host";
@@ -900,16 +672,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
      *                                     int length, ByteBuffer dst)
      * Exception case: IllegalStateException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, int.class, int.class, ByteBuffer.class}
-    )
     @AndroidOnly("The RI doesn't throw the IllegalStateException.")
     public void test_wrap_05() throws SSLException {
         String host = "new host";
@@ -927,15 +693,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, int offset,
      *                                     int length, ByteBuffer dst)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, int.class, int.class, ByteBuffer.class}
-    )
     public void test_wrap_06() {
         String host = "new host";
         int port = 8080;
@@ -953,23 +713,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#closeOutbound()
-     * @tests javax.net.ssl.SSLEngine#isOutboundDone()
+     * javax.net.ssl.SSLEngine#closeOutbound()
+     * javax.net.ssl.SSLEngine#isOutboundDone()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "closeOutbound",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isOutboundDone",
-            args = {}
-        )
-    })
     public void test_closeOutbound() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
 
@@ -984,23 +730,9 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.SSLEngine#closeInbound()
-     * @tests javax.net.ssl.SSLEngine#isInboundDone()
+     * javax.net.ssl.SSLEngine#closeInbound()
+     * javax.net.ssl.SSLEngine#isInboundDone()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "",
-            method = "closeInbound",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isInboundDone",
-            args = {}
-        )
-    })
     public void test_closeInbound() throws NoSuchAlgorithmException {
         SSLEngine sse = getEngine();
 
@@ -1014,15 +746,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
      * SSLException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     public void test_unwrap_ByteBuffer_ByteBuffer_01() throws InterruptedException, IOException {
         prepareEngines();
         doHandshake();
@@ -1038,15 +764,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
      * ReadOnlyBufferException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_unwrap_ByteBuffer_ByteBuffer_02() {
         String host = "new host";
@@ -1067,15 +787,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
      * IllegalArgumentException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_unwrap_ByteBuffer_ByteBuffer_03() {
         String host = "new host";
@@ -1119,15 +833,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
      * IllegalStateException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     @AndroidOnly("The RI doesn't throw the IllegalStateException.")
     public void test_unwrap_ByteBuffer_ByteBuffer_04() {
         String host = "new host";
@@ -1147,14 +855,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer dst)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     public void test_unwrap_ByteBuffer_ByteBuffer_05() {
         String host = "new host";
         int port = 8080;
@@ -1173,15 +875,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
      * SSLException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class}
-    )
     public void test_unwrap_ByteBuffer$ByteBuffer_01() throws IOException, InterruptedException {
         prepareEngines();
         doHandshake();
@@ -1198,15 +894,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
      * ReadOnlyBufferException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_unwrap_ByteBuffer$ByteBuffer_02() {
         String host = "new host";
@@ -1228,15 +918,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
      * IllegalArgumentException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_unwrap_ByteBuffer$ByteBuffer_03() {
         String host = "new host";
@@ -1291,15 +975,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
      * IllegalStateException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class}
-    )
     @AndroidOnly("The RI doesn't throw the IllegalStateException.")
     public void test_unwrap_ByteBuffer$ByteBuffer_04() {
         String host = "new host";
@@ -1319,14 +997,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
+     * javax.net.ssl.SSLEngine#unwrap(ByteBuffer src, ByteBuffer[] dsts)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "unwrap",
-        args = {ByteBuffer.class, ByteBuffer[].class}
-    )
     public void test_unwrap_ByteBuffer$ByteBuffer_05() {
         String host = "new host";
         int port = 8080;
@@ -1344,42 +1016,18 @@
         }
     }
 
-    /**
-     * @throws IOException
-     * @throws InterruptedException
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
-     * SSLException should be thrown.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "wrap cannot be forced to produce SSLException",
-        method = "wrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     public void test_wrap_ByteBuffer_ByteBuffer_01() throws IOException, InterruptedException {
         prepareEngines();
         doHandshake();
         ByteBuffer bbs = ByteBuffer.allocate(20);
         ByteBuffer bbd = ByteBuffer.allocate(20000);
-
-        try {
-            clientEngine.engine.wrap(bbs, bbd);
-            //fail("SSLException wasn't thrown");
-        } catch (SSLException ex) {
-            //expected
-        }
+        clientEngine.engine.wrap(bbs, bbd);
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
      * ReadOnlyBufferException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     public void test_wrap_ByteBuffer_ByteBuffer_02() {
         String host = "new host";
         int port = 8080;
@@ -1399,15 +1047,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
      * IllegalArgumentException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_wrap_ByteBuffer_ByteBuffer_03() {
         String host = "new host";
@@ -1451,15 +1093,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
      * IllegalStateException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     @AndroidOnly("The RI doesn't throw the IllegalStateException.")
     public void test_wrap_ByteBuffer_ByteBuffer_04() {
         String host = "new host";
@@ -1479,14 +1115,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer src, ByteBuffer dst)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer.class, ByteBuffer.class}
-    )
     public void test_wrap_ByteBuffer_ByteBuffer_05() {
         String host = "new host";
         int port = 8080;
@@ -1506,15 +1136,9 @@
     /**
      * @throws IOException
      * @throws InterruptedException
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
      * SSLException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "wrap cannot be forced to throw SSLException",
-        method = "wrap",
-        args = {ByteBuffer[].class, ByteBuffer.class}
-    )
     public void test_wrap_ByteBuffer$ByteBuffer_01() throws IOException, InterruptedException {
         prepareEngines();
         doHandshake();
@@ -1531,15 +1155,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
      * ReadOnlyBufferException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, ByteBuffer.class}
-    )
     public void test_wrap_ByteBuffer$ByteBuffer_02() {
         String host = "new host";
         int port = 8080;
@@ -1559,15 +1177,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
      * IllegalArgumentException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, ByteBuffer.class}
-    )
     @KnownFailure("Fixed on DonutBurger, Wrong Exception thrown")
     public void test_wrap_ByteBuffer$ByteBuffer_03() {
         String host = "new host";
@@ -1611,15 +1223,9 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
      * IllegalStateException should be thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, ByteBuffer.class}
-    )
     @AndroidOnly("The RI doesn't throw the IllegalStateException.")
     public void test_wrap_ByteBuffer$ByteBuffer_04() {
         String host = "new host";
@@ -1639,14 +1245,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
+     * javax.net.ssl.SSLEngine#wrap(ByteBuffer[] srcs, ByteBuffer dst)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "wrap",
-        args = {ByteBuffer[].class, ByteBuffer.class}
-    )
     public void test_wrap_ByteBuffer$ByteBuffer_05() {
         String host = "new host";
         int port = 8080;
@@ -1824,44 +1424,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                notes = "",
-                method = "wrap",
-                args = {ByteBuffer.class, ByteBuffer.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                notes = "",
-                method = "unwrap",
-                args = {ByteBuffer.class, ByteBuffer.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                notes = "",
-                method = "beginHandshake",
-                args = {}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                notes = "",
-                method = "getHandshakeStatus",
-                args = {}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                notes = "",
-                method = "wrap",
-                args = {ByteBuffer[].class, ByteBuffer.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                notes = "",
-                method = "getDelegatedTask",
-                args = {}
-        )
-    })
     @KnownFailure("Handshake Status is never finished. NPE in "
             + "ClientSessionContext$HostAndPort.hashCode() when host is null")
     public void testHandshake() throws IOException, InterruptedException {
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLExceptionTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLExceptionTest.java
index 6cff581..9b4ae35 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLExceptionTest.java
@@ -17,15 +17,10 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLException;
 
 import junit.framework.TestCase;
-@TestTargetClass(SSLException.class)
+
 /**
  * Tests for <code>SSLException</code> class constructors and methods.
  *
@@ -44,12 +39,6 @@
      * constructs SSLException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.String.class}
-    )
     public void testSSLException01() {
         SSLException sE;
         for (int i = 0; i < msgs.length; i++) {
@@ -63,12 +52,6 @@
      * Test for <code>SSLException(String)</code> constructor Assertion:
      * constructs SSLException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.String.class}
-    )
     public void testSSLException02() {
         String msg = null;
         SSLException sE = new SSLException(msg);
@@ -80,12 +63,6 @@
      * Test for <code>SSLException(Throwable)</code> constructor
      * Assertion: constructs SSLException when <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.Throwable.class}
-    )
     public void testSSLException03() {
         Throwable cause = null;
         SSLException sE = new SSLException(cause);
@@ -98,12 +75,6 @@
      * Assertion: constructs SSLException when <code>cause</code> is not
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.Throwable.class}
-    )
     public void testSSLException04() {
         SSLException sE = new SSLException(tCause);
         if (sE.getMessage() != null) {
@@ -121,12 +92,6 @@
      * Assertion: constructs SSLException when <code>cause</code> is null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSSLException05() {
         SSLException sE = new SSLException(null, null);
         assertNull("getMessage() must return null", sE.getMessage());
@@ -138,12 +103,6 @@
      * Assertion: constructs SSLException when <code>cause</code> is null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSSLException06() {
         SSLException sE;
         for (int i = 0; i < msgs.length; i++) {
@@ -159,12 +118,6 @@
      * Assertion: constructs SSLException when <code>cause</code> is not
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSSLException07() {
         SSLException sE = new SSLException(null, tCause);
         if (sE.getMessage() != null) {
@@ -183,12 +136,6 @@
      * Assertion: constructs SSLException when <code>cause</code> is not
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testSSLException08() {
         SSLException sE;
         for (int i = 0; i < msgs.length; i++) {
@@ -208,4 +155,4 @@
                     sE.getCause(), tCause);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLHandshakeExceptionTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLHandshakeExceptionTest.java
index d6f44fe..a2d0ec5a 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLHandshakeExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLHandshakeExceptionTest.java
@@ -15,16 +15,10 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLHandshakeException;
 
 import junit.framework.TestCase;
 
-@TestTargetClass(SSLHandshakeException.class)
 public class SSLHandshakeExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -38,12 +32,6 @@
      * constructs SSLHandshakeException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLHandshakeException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor01() {
         SSLHandshakeException sslE;
         for (int i = 0; i < msgs.length; i++) {
@@ -58,16 +46,10 @@
      * constructs SSLHandshakeException with detail message msg. Parameter
      * <code>msg</code> is null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLHandshakeException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor02() {
         String msg = null;
         SSLHandshakeException sslE = new SSLHandshakeException(msg);
         assertNull("getMessage() must return null.", sslE.getMessage());
         assertNull("getCause() must return null", sslE.getCause());
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLKeyExceptionTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLKeyExceptionTest.java
index 05ad4dc..d6ba998 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLKeyExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLKeyExceptionTest.java
@@ -15,16 +15,10 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLKeyException;
 
 import junit.framework.TestCase;
 
-@TestTargetClass(SSLKeyException.class)
 public class SSLKeyExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -38,12 +32,6 @@
      * constructs SSLKeyException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLKeyException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor01() {
         SSLKeyException skE;
         for (int i = 0; i < msgs.length; i++) {
@@ -58,16 +46,10 @@
      * constructs SSLPeerUnverifiedException with detail message msg. Parameter
      * <code>msg</code> is null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLKeyException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor02() {
         String msg = null;
         SSLKeyException skE = new SSLKeyException(msg);
         assertNull("getMessage() must return null.", skE.getMessage());
         assertNull("getCause() must return null", skE.getCause());
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java
index fe760ad..a8b9ac4 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java
@@ -15,16 +15,10 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLPeerUnverifiedException;
 
 import junit.framework.TestCase;
 
-@TestTargetClass(SSLPeerUnverifiedException.class)
 public class SSLPeerUnverifiedExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -38,12 +32,6 @@
      * constructs SSLPeerUnverifiedException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLPeerUnverifiedException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor01() {
         SSLPeerUnverifiedException sslE;
         for (int i = 0; i < msgs.length; i++) {
@@ -58,12 +46,6 @@
      * constructs SSLPeerUnverifiedException with detail message msg. Parameter
      * <code>msg</code> is null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLPeerUnverifiedException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor02() {
         String msg = null;
         SSLPeerUnverifiedException sslE = new SSLPeerUnverifiedException(msg);
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLPermissionTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLPermissionTest.java
index 81fb0f2..313eace 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLPermissionTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLPermissionTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLPermission;
 import junit.framework.TestCase;
 
@@ -29,18 +25,11 @@
  * Tests for <code>SSLPermission</code> class constructors.
  *
  */
-@TestTargetClass(SSLPermission.class)
 public class SSLPermissionTest extends TestCase {
 
     /*
      * Class under test for void SSLPermission(String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLPermission",
-        args = {String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         try {
             SSLPermission p = new SSLPermission("name");
@@ -58,12 +47,6 @@
     /*
      * Class under test for void SSLPermission(String, String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLPermission",
-        args = {String.class, String.class}
-    )
     public void test_ConstructorLjava_lang_StringLjava_lang_String() {
         try {
             SSLPermission p = new SSLPermission("name", "value");
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLProtocolExceptionTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLProtocolExceptionTest.java
index 47ac731..14b562d 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLProtocolExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLProtocolExceptionTest.java
@@ -15,16 +15,10 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLProtocolException;
 
 import junit.framework.TestCase;
 
-@TestTargetClass(SSLProtocolException.class)
 public class SSLProtocolExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -38,12 +32,6 @@
      * constructs SSLProtocolException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLProtocolException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor01() {
         SSLProtocolException sslE;
         for (int i = 0; i < msgs.length; i++) {
@@ -58,16 +46,10 @@
      * constructs SSLProtocolException with detail message msg. Parameter
      * <code>msg</code> is null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "SSLProtocolException",
-        args = {java.lang.String.class}
-    )
     public void test_Constructor02() {
         String msg = null;
         SSLProtocolException sslE = new SSLProtocolException(msg);
         assertNull("getMessage() must return null.", sslE.getMessage());
         assertNull("getCause() must return null", sslE.getCause());
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketFactoryTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketFactoryTest.java
index 979d574..5958ecb 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketFactoryTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketFactoryTest.java
@@ -16,10 +16,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
@@ -28,7 +24,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(SSLServerSocketFactory.class)
 public class SSLServerSocketFactoryTest extends TestCase {
 
     private class MockSSLServerSocketFactory extends SSLServerSocketFactory {
@@ -65,14 +60,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocketFactory#SSLServerSocketFactory()
+     * javax.net.ssl.SSLServerSocketFactory#SSLServerSocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLServerSocketFactory",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             MockSSLServerSocketFactory ssf = new MockSSLServerSocketFactory();
@@ -82,28 +71,16 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocketFactory#getDefault()
+     * javax.net.ssl.SSLServerSocketFactory#getDefault()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefault",
-        args = {}
-    )
     public void test_getDefault() {
         assertNotNull("Incorrect default socket factory",
                 SSLServerSocketFactory.getDefault());
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocketFactory#getDefaultCipherSuites()
+     * javax.net.ssl.SSLServerSocketFactory#getDefaultCipherSuites()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultCipherSuites",
-        args = {}
-    )
     public void test_getDefaultCipherSuites() {
         SSLServerSocketFactory ssf = (SSLServerSocketFactory) SSLServerSocketFactory
                 .getDefault();
@@ -115,14 +92,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocketFactory#getSupportedCipherSuites()
+     * javax.net.ssl.SSLServerSocketFactory#getSupportedCipherSuites()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedCipherSuites",
-        args = {}
-    )
     public void test_getSupportedCipherSuites() {
         SSLServerSocketFactory ssf = (SSLServerSocketFactory) SSLServerSocketFactory
                 .getDefault();
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketTest.java
index 20ce035..6c8e657 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketTest.java
@@ -16,11 +16,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.luni.util.Base64;
@@ -40,7 +35,6 @@
 import javax.net.ssl.SSLContext;
 import javax.net.ssl.SSLServerSocket;
 
-@TestTargetClass(SSLServerSocket.class)
 public class SSLServerSocketTest extends TestCase {
 
     // set to true if on Android, false if on RI
@@ -124,14 +118,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocket#SSLServerSocket()
+     * javax.net.ssl.SSLServerSocket#SSLServerSocket()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "IOException wasn't implemented",
-        method = "SSLServerSocket",
-        args = {}
-    )
     public void testConstructor_01() {
         try {
             SSLServerSocket ssl = new mySSLServerSocket();
@@ -141,14 +129,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocket#SSLServerSocket(int port)
+     * javax.net.ssl.SSLServerSocket#SSLServerSocket(int port)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLServerSocket",
-        args = {int.class}
-    )
     public void testConstructor_02() {
         SSLServerSocket ssl;
         int portNumber = Support_PortManager.getNextPort();
@@ -184,14 +166,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocket#SSLServerSocket(int port, int backlog)
+     * javax.net.ssl.SSLServerSocket#SSLServerSocket(int port, int backlog)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Invalid values for backlog weren't checked",
-        method = "SSLServerSocket",
-        args = {int.class, int.class}
-    )
     public void testConstructor_03() {
         mySSLServerSocket ssl;
         int portNumber = Support_PortManager.getNextPort();
@@ -225,14 +201,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLServerSocket#SSLServerSocket(int port, int backlog, InetAddress address)
+     * javax.net.ssl.SSLServerSocket#SSLServerSocket(int port, int backlog, InetAddress address)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Invalid values for backlog weren\'t checked",
-        method = "SSLServerSocket",
-        args = {int.class, int.class, InetAddress.class}
-    )
     public void testConstructor_04() {
         mySSLServerSocket ssl;
         InetAddress ia = null;
@@ -276,14 +246,8 @@
 
     /**
      * @throws Exception
-     * @tests javax.net.ssl.SSLServerSocket#getSupportedCipherSuites()
+     * javax.net.ssl.SSLServerSocket#getSupportedCipherSuites()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedCipherSuites",
-        args = {}
-    )
     public void test_getSupportedCipherSuites() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         String[] res = sss.getSupportedCipherSuites();
@@ -293,23 +257,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLServerSocket#getEnabledCipherSuites()
-     * @tests javax.net.ssl.SSLServerSocket#setEnabledCipherSuites(String[] suites)
+     * javax.net.ssl.SSLServerSocket#getEnabledCipherSuites()
+     * javax.net.ssl.SSLServerSocket#setEnabledCipherSuites(String[] suites)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnabledCipherSuites",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnabledCipherSuites",
-            args = {String[].class}
-        )
-    })
     public void test_EnabledCipherSuites() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         try {
@@ -335,14 +285,8 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLServerSocket#getSupportedProtocols()
+     * javax.net.ssl.SSLServerSocket#getSupportedProtocols()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedProtocols",
-        args = {}
-    )
     public void test_getSupportedProtocols() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         String[] res = sss.getSupportedCipherSuites();
@@ -352,23 +296,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLServerSocket#getEnabledProtocols()
-     * @tests javax.net.ssl.SSLServerSocket#setEnabledProtocols(String[] protocols)
+     * javax.net.ssl.SSLServerSocket#getEnabledProtocols()
+     * javax.net.ssl.SSLServerSocket#setEnabledProtocols(String[] protocols)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnabledProtocols",
-            args = {String[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnabledProtocols",
-            args = {}
-        )
-    })
     public void test_EnabledProtocols() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         try {
@@ -392,23 +322,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLServerSocket#setEnableSessionCreation(boolean flag)
-     * @tests javax.net.ssl.SSLServerSocket#getEnableSessionCreation()
+     * javax.net.ssl.SSLServerSocket#setEnableSessionCreation(boolean flag)
+     * javax.net.ssl.SSLServerSocket#getEnableSessionCreation()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnableSessionCreation",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnableSessionCreation",
-            args = {boolean.class}
-        )
-    })
     public void test_EnableSessionCreation() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         assertTrue(sss.getEnableSessionCreation());
@@ -420,23 +336,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLServerSocket#setNeedClientAuth(boolean need)
-     * @tests javax.net.ssl.SSLServerSocket#getNeedClientAuthCreation()
+     * javax.net.ssl.SSLServerSocket#setNeedClientAuth(boolean need)
+     * javax.net.ssl.SSLServerSocket#getNeedClientAuthCreation()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setNeedClientAuth",
-            args = {boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getNeedClientAuth",
-            args = {}
-        )
-    })
     public void test_NeedClientAuth() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         sss.setNeedClientAuth(true);
@@ -447,23 +349,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLServerSocket#getUseClientMode()
-     * @tests javax.net.ssl.SSLServerSocket#setUseClientMode(boolean mode)
+     * javax.net.ssl.SSLServerSocket#getUseClientMode()
+     * javax.net.ssl.SSLServerSocket#setUseClientMode(boolean mode)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getUseClientMode",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setUseClientMode",
-            args = {boolean.class}
-        )
-    })
     public void test_UseClientMode() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         sss.setUseClientMode(false);
@@ -474,23 +362,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLServerSocket#setWantClientAuth(boolean want)
-     * @tests javax.net.ssl.SSLServerSocket#getWantClientAuthCreation()
+     * javax.net.ssl.SSLServerSocket#setWantClientAuth(boolean want)
+     * javax.net.ssl.SSLServerSocket#getWantClientAuthCreation()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getWantClientAuth",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setWantClientAuth",
-            args = {boolean.class}
-        )
-    })
     public void test_WantClientAuth() throws Exception {
         SSLServerSocket sss = getSSLServerSocket();
         sss.setWantClientAuth(true);
@@ -590,12 +464,6 @@
         return sss;
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Guard against native resource leakage.",
-        method = "SSLSocket",
-        args = {}
-    )
     public void test_creationStressTest() throws Exception {
         KeyManager[] keyManagers = getKeyManagers();
         // Test the default codepath, which uses /dev/urandom.
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingEventTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingEventTest.java
index a3bc79a..dfccf68 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingEventTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingEventTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.Principal;
 import java.security.cert.Certificate;
 
@@ -37,15 +32,8 @@
  * Tests for <code>SSLSessionBindingEvent</code> class constructors and methods.
  *
  */
-@TestTargetClass(SSLSessionBindingEvent.class)
 public class SSLSessionBindingEventTest extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLSessionBindingEvent",
-        args = {javax.net.ssl.SSLSession.class, java.lang.String.class}
-    )
     public final void test_ConstructorLjavax_net_ssl_SSLSessionLjava_lang_String() {
         SSLSession ses = new MySSLSession();
 
@@ -76,14 +64,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLSessionBindingEvent#getName()
+     * javax.net.ssl.SSLSessionBindingEvent#getName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() {
         SSLSession ses = new MySSLSession();
         SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
@@ -93,14 +75,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLSessionBindingEvent#getSession()
+     * javax.net.ssl.SSLSessionBindingEvent#getSession()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSession",
-        args = {}
-    )
     public void test_getSession() {
         SSLSession ses = new MySSLSession();
         SSLSessionBindingEvent event = new SSLSessionBindingEvent(ses, "test");
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingListenerTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingListenerTest.java
index 2538c87..a006a83 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingListenerTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingListenerTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import javax.net.ssl.SSLServerSocket;
 import javax.net.ssl.SSLServerSocketFactory;
 import javax.net.ssl.SSLSession;
@@ -39,7 +34,6 @@
  * Tests for SSLSessionBindingListener class
  *
  */
-@TestTargetClass(SSLSessionBindingListener.class)
 public class SSLSessionBindingListenerTest extends TestCase {
 
     public class mySSLSessionBindingListener implements SSLSessionBindingListener {
@@ -62,14 +56,8 @@
      * @throws IOException
      * @throws UnknownHostException
      * @throws InterruptedException
-     * @tests javax.net.ssl.SSLSessionBindingListener#valueBound(SSLSessionBindingEvent event)
+     * javax.net.ssl.SSLSessionBindingListener#valueBound(SSLSessionBindingEvent event)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "valueBound",
-        args = {SSLSessionBindingEvent.class}
-    )
     public void test_valueBound() throws UnknownHostException, IOException,
             InterruptedException {
         SSLSocket sock = (SSLSocket) SSLSocketFactory.getDefault()
@@ -83,14 +71,8 @@
     /**
      * @throws IOException
      * @throws UnknownHostException
-     * @tests javax.net.ssl.SSLSessionBindingListener#valueUnbound(SSLSessionBindingEvent event)
+     * javax.net.ssl.SSLSessionBindingListener#valueUnbound(SSLSessionBindingEvent event)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "valueUnbound",
-        args = {SSLSessionBindingEvent.class}
-    )
     public void test_valueUnbound() throws UnknownHostException, IOException {
         SSLSocket sock = (SSLSocket) SSLSocketFactory.getDefault()
                 .createSocket();
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionContextTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionContextTest.java
index 9e3eac1..aa95eb8 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionContextTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLSessionContextTest.java
@@ -1,10 +1,5 @@
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import javax.net.ssl.SSLContext;
@@ -16,29 +11,14 @@
 /**
  * Tests for <code>SSLSessionContext</code> class constructors and methods.
  */
-@TestTargetClass(SSLSessionContext.class)
 public class SSLSessionContextTest extends TestCase {
 
     /**
      * @throws NoSuchAlgorithmException
      * @throws KeyManagementException
-     * @tests javax.net.ssl.SSLSessionContex#getSessionCacheSize()
-     * @tests javax.net.ssl.SSLSessionContex#setSessionCacheSize(int size)
+     * javax.net.ssl.SSLSessionContex#getSessionCacheSize()
+     * javax.net.ssl.SSLSessionContex#setSessionCacheSize(int size)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSessionCacheSize",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setSessionCacheSize",
-            args = {int.class}
-        )
-    })
     public final void test_sessionCacheSize() throws NoSuchAlgorithmException, KeyManagementException {
         SSLContext context = SSLContext.getInstance("TLS");
         context.init(null, null, null);
@@ -60,23 +40,9 @@
     /**
      * @throws NoSuchAlgorithmException
      * @throws KeyManagementException
-     * @tests javax.net.ssl.SSLSessionContex#getSessionTimeout()
-     * @tests javax.net.ssl.SSLSessionContex#setSessionTimeout(int seconds)
+     * javax.net.ssl.SSLSessionContex#getSessionTimeout()
+     * javax.net.ssl.SSLSessionContex#setSessionTimeout(int seconds)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSessionTimeout",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setSessionTimeout",
-            args = {int.class}
-        )
-    })
     public final void test_sessionTimeout() throws NoSuchAlgorithmException, KeyManagementException {
         SSLContext context = SSLContext.getInstance("TLS");
         context.init(null, null, null);
@@ -98,14 +64,8 @@
     /**
      * @throws NoSuchAlgorithmException
      * @throws KeyManagementException
-     * @tests javax.net.ssl.SSLSessionContex#getSession(byte[] sessionId)
+     * javax.net.ssl.SSLSessionContex#getSession(byte[] sessionId)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSession",
-        args = {byte[].class}
-    )
     public final void test_getSession() throws NoSuchAlgorithmException, KeyManagementException {
         SSLContext context = SSLContext.getInstance("TLS");
         context.init(null, null, null);
@@ -122,14 +82,8 @@
     /**
      * @throws NoSuchAlgorithmException
      * @throws KeyManagementException
-     * @tests javax.net.ssl.SSLSessionContex#getIds()
+     * javax.net.ssl.SSLSessionContex#getIds()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIds",
-        args = {}
-    )
     public final void test_getIds() throws NoSuchAlgorithmException, KeyManagementException {
         SSLContext context = SSLContext.getInstance("TLS");
         context.init(null, null, null);
@@ -138,4 +92,4 @@
         assertFalse(sc.getIds().hasMoreElements());
     }
 
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketFactoryTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketFactoryTest.java
index 112e251..02abcc2 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketFactoryTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketFactoryTest.java
@@ -15,11 +15,6 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.IOException;
 import java.net.ServerSocket;
 import java.net.Socket;
@@ -32,7 +27,6 @@
 
 import tests.support.Support_PortManager;
 
-@TestTargetClass(SSLSocketFactory.class)
 public class SSLSocketFactoryTest extends TestCase {
 
     private ServerSocket ss;
@@ -48,14 +42,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLSocketFactory#SSLSocketFactory()
+     * javax.net.ssl.SSLSocketFactory#SSLSocketFactory()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLSocketFactory",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             SocketFactory sf = SSLSocketFactory.getDefault();
@@ -66,28 +54,16 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLSocketFactory#getDefault()
+     * javax.net.ssl.SSLSocketFactory#getDefault()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefault",
-        args = {}
-    )
     public void test_getDefault() {
         assertNotNull("Incorrect default socket factory",
                 SSLSocketFactory.getDefault());
     }
 
     /**
-     * @tests javax.net.ssl.SSLSocketFactory#createSocket(Socket s, String host, int port, boolean autoClose)
+     * javax.net.ssl.SSLSocketFactory#createSocket(Socket s, String host, int port, boolean autoClose)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "createSocket",
-        args = {java.net.Socket.class, java.lang.String.class, int.class, boolean.class}
-    )
     public void test_createSocket() {
         SSLSocketFactory sf = (SSLSocketFactory)SSLSocketFactory.getDefault();
         int sport = startServer("test_createSocket()");
@@ -138,14 +114,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLSocketFactory#getDefaultCipherSuites()
+     * javax.net.ssl.SSLSocketFactory#getDefaultCipherSuites()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultCipherSuites",
-        args = {}
-    )
     public void test_getDefaultCipherSuites() {
         try {
             SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault();
@@ -157,14 +127,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLSocketFactory#getSupportedCipherSuites()
+     * javax.net.ssl.SSLSocketFactory#getSupportedCipherSuites()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedCipherSuites",
-        args = {}
-    )
     public void test_getSupportedCipherSuites() {
         try {
             SSLSocketFactory sf = (SSLSocketFactory) SSLSocketFactory.getDefault();
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketTest.java b/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketTest.java
index 0742a23..84ac212 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/SSLSocketTest.java
@@ -16,10 +16,6 @@
 package tests.api.javax.net.ssl;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 
 import javax.net.ssl.*;
 import javax.security.cert.X509Certificate;
@@ -39,7 +35,6 @@
 import tests.api.javax.net.ssl.HandshakeCompletedEventTest.TestTrustManager;
 import tests.support.Support_PortManager;
 
-@TestTargetClass(SSLSocket.class)
 public class SSLSocketTest extends TestCase {
 
     public class HandshakeCL implements HandshakeCompletedListener {
@@ -51,14 +46,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.SSLSocket#SSLSocket()
+     * javax.net.ssl.SSLSocket#SSLSocket()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLSocket",
-        args = {}
-    )
     public void testConstructor_01() {
         try {
             SSLSocket ssl = getSSLSocket();
@@ -70,14 +59,8 @@
     /**
      * @throws IOException
      * @throws UnknownHostException
-     * @tests javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port)
+     * javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLSocket",
-        args = {java.net.InetAddress.class, int.class}
-    )
     public void testConstructor_02() throws UnknownHostException, IOException {
         SSLSocket ssl;
         int sport = startServer("Cons InetAddress,I");
@@ -109,15 +92,9 @@
     /**
      * @throws IOException
      * @throws UnknownHostException
-     * @tests javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port,
+     * javax.net.ssl.SSLSocket#SSLSocket(InetAddress address, int port,
      *                                          InetAddress clientAddress, int clientPort)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLSocket",
-        args = {java.net.InetAddress.class, int.class, java.net.InetAddress.class, int.class}
-    )
     public void testConstructor_03() throws UnknownHostException, IOException {
         SSLSocket ssl;
         int sport = startServer("Cons InetAddress,I,InetAddress,I");
@@ -228,14 +205,8 @@
     /**
      * @throws IOException
      * @throws UnknownHostException
-     * @tests javax.net.ssl.SSLSocket#SSLSocket(String host, int port)
+     * javax.net.ssl.SSLSocket#SSLSocket(String host, int port)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLSocket",
-        args = {java.lang.String.class, int.class}
-    )
     public void testConstructor_04() throws UnknownHostException, IOException {
         SSLSocket ssl;
         int sport = startServer("Cons String,I");
@@ -276,15 +247,9 @@
     /**
      * @throws IOException
      * @throws UnknownHostException
-     * @tests javax.net.ssl.SSLSocket#SSLSocket(String host, int port, InetAddress clientAddress,
+     * javax.net.ssl.SSLSocket#SSLSocket(String host, int port, InetAddress clientAddress,
      *           int clientPort)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SSLSocket",
-        args = {java.lang.String.class, int.class, java.net.InetAddress.class, int.class}
-    )
     public void testConstructor_05() throws UnknownHostException, IOException {
         SSLSocket ssl;
         int sport = startServer("Cons String,I,InetAddress,I");
@@ -337,12 +302,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Guard against native resource leakage.",
-        method = "SSLSocket",
-        args = {}
-    )
     public void test_creationStressTest() throws Exception {
         // Test the default codepath, which uses /dev/urandom.
         SSLContext sslContext = SSLContext.getInstance("TLS");
@@ -360,14 +319,8 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#addHandshakeCompletedListener(HandshakeCompletedListener listener)
+     * javax.net.ssl.SSLSocket#addHandshakeCompletedListener(HandshakeCompletedListener listener)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addHandshakeCompletedListener",
-        args = {javax.net.ssl.HandshakeCompletedListener.class}
-    )
     @AndroidOnly("RI doesn't throw the specified IAE")
     public void test_addHandshakeCompletedListener() throws IOException {
         SSLSocket ssl = getSSLSocket();
@@ -387,14 +340,8 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#removeHandshakeCompletedListener(HandshakeCompletedListener listener)
+     * javax.net.ssl.SSLSocket#removeHandshakeCompletedListener(HandshakeCompletedListener listener)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "removeHandshakeCompletedListener",
-        args = {javax.net.ssl.HandshakeCompletedListener.class}
-    )
     public void test_removeHandshakeCompletedListener() throws IOException {
         SSLSocket ssl = getSSLSocket();
         HandshakeCompletedListener ls = new HandshakeCL();
@@ -423,23 +370,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#setEnableSessionCreation(boolean flag)
-     * @tests javax.net.ssl.SSLSocket#getEnableSessionCreation()
+     * javax.net.ssl.SSLSocket#setEnableSessionCreation(boolean flag)
+     * javax.net.ssl.SSLSocket#getEnableSessionCreation()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnableSessionCreation",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnableSessionCreation",
-            args = {boolean.class}
-        )
-    })
     public void test_EnableSessionCreation() throws IOException {
         SSLSocket ssl = getSSLSocket();
         assertTrue(ssl.getEnableSessionCreation());
@@ -452,23 +385,9 @@
     /**
      * @throws IOException
      * @throws UnknownHostException
-     * @tests javax.net.ssl.SSLSocket#setNeedClientAuth(boolean need)
-     * @tests javax.net.ssl.SSLSocket#getNeedClientAuthCreation()
+     * javax.net.ssl.SSLSocket#setNeedClientAuth(boolean need)
+     * javax.net.ssl.SSLSocket#getNeedClientAuthCreation()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setNeedClientAuth",
-            args = {boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getNeedClientAuth",
-            args = {}
-        )
-    })
     public void test_NeedClientAuth() throws UnknownHostException, IOException {
         SSLSocket ssl = getSSLSocket();
         ssl.setNeedClientAuth(true);
@@ -480,23 +399,9 @@
     /**
      * @throws IOException
      * @throws UnknownHostException
-     * @tests javax.net.ssl.SSLSocket#setWantClientAuth(boolean want)
-     * @tests javax.net.ssl.SSLSocket#getWantClientAuthCreation()
+     * javax.net.ssl.SSLSocket#setWantClientAuth(boolean want)
+     * javax.net.ssl.SSLSocket#getWantClientAuthCreation()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setWantClientAuth",
-            args = {boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getWantClientAuth",
-            args = {}
-        )
-    })
     public void test_WantClientAuth() throws UnknownHostException, IOException {
         SSLSocket ssl = getSSLSocket();
         ssl.setWantClientAuth(true);
@@ -507,14 +412,8 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#getSupportedProtocols()
+     * javax.net.ssl.SSLSocket#getSupportedProtocols()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedProtocols",
-        args = {}
-    )
     public void test_getSupportedProtocols() throws IOException {
         SSLSocket ssl = getSSLSocket();
         String[] res = ssl.getSupportedProtocols();
@@ -523,23 +422,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#getEnabledProtocols()
-     * @tests javax.net.ssl.SSLSocket#setEnabledProtocols(String[] protocols)
+     * javax.net.ssl.SSLSocket#getEnabledProtocols()
+     * javax.net.ssl.SSLSocket#setEnabledProtocols(String[] protocols)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnabledProtocols",
-            args = {java.lang.String[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnabledProtocols",
-            args = {}
-        )
-    })
     public void test_EnabledProtocols() throws IOException {
         SSLSocket ssl = getSSLSocket();
         try {
@@ -565,14 +450,8 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#getSession()
+     * javax.net.ssl.SSLSocket#getSession()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSession",
-        args = {}
-    )
     public void test_getSession() throws IOException {
         SSLSocket ssl = getSSLSocket();
         try {
@@ -584,14 +463,8 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#getSupportedCipherSuites()
+     * javax.net.ssl.SSLSocket#getSupportedCipherSuites()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedCipherSuites",
-        args = {}
-    )
     public void test_getSupportedCipherSuites() throws IOException {
         SSLSocket ssl = getSSLSocket();
         String[] res = ssl.getSupportedCipherSuites();
@@ -600,23 +473,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#getEnabledCipherSuites()
-     * @tests javax.net.ssl.SSLSocket#setEnabledCipherSuites(String[] suites)
+     * javax.net.ssl.SSLSocket#getEnabledCipherSuites()
+     * javax.net.ssl.SSLSocket#setEnabledCipherSuites(String[] suites)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEnabledCipherSuites",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setEnabledCipherSuites",
-            args = {java.lang.String[].class}
-        )
-    })
     public void test_EnabledCipherSuites() throws IOException {
         SSLSocket ssl = getSSLSocket();
         try {
@@ -644,23 +503,9 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#getUseClientMode()
-     * @tests javax.net.ssl.SSLSocket#setUseClientMode(boolean mode)
+     * javax.net.ssl.SSLSocket#getUseClientMode()
+     * javax.net.ssl.SSLSocket#setUseClientMode(boolean mode)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getUseClientMode",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setUseClientMode",
-            args = {boolean.class}
-        )
-    })
     public void test_UseClientMode() throws IOException {
         SSLSocket ssl = getSSLSocket();
         assertTrue(ssl.getUseClientMode());
@@ -685,14 +530,8 @@
 
     /**
      * @throws IOException
-     * @tests javax.net.ssl.SSLSocket#startHandshake()
+     * javax.net.ssl.SSLSocket#startHandshake()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "startHandshake",
-        args = {}
-    )
     public void test_startHandshake() throws IOException {
         SSLSocket ssl = getSSLSocket();
         try {
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory1Test.java b/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory1Test.java
index 2fab2ed..1140984 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory1Test.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory1Test.java
@@ -17,9 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 import dalvik.annotation.KnownFailure;
 
 import java.io.IOException;
@@ -56,7 +53,6 @@
  * Tests for <code>TrustManagerFactory</code> class constructors and methods.
  *
  */
-@TestTargetClass(TrustManagerFactory.class)
 public class TrustManagerFactory1Test extends TestCase {
 
     private static final String srvTrustManagerFactory = "TrustManagerFactory";
@@ -114,12 +110,6 @@
      * constructor
      * Assertion: created new TrustManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TrustManagerFactory",
-        args = {javax.net.ssl.TrustManagerFactorySpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void test_ConstructorLjavax_net_ssl_TrustManagerFactorySpiLjava_security_ProviderLjava_lang_String()
         throws NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -152,12 +142,6 @@
      * @throws NoSuchAlgorithmException
      * @throws NoSuchProviderException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void test_getAlgorithm()
         throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) fail(NotSupportedMsg);
@@ -180,12 +164,6 @@
      *  Test for <code>getDefaultAlgorithm()</code> method
      * Assertion: returns value which is specifoed in security property
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultAlgorithm",
-        args = {}
-    )
     public void test_getDefaultAlgorithm() {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -214,12 +192,6 @@
      * Assertions: returns security property "ssl.TrustManagerFactory.algorithm";
      * returns instance of TrustManagerFactory
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String01() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -241,12 +213,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String02() {
         try {
             TrustManagerFactory.getInstance(null);
@@ -270,12 +236,6 @@
      * Assertion: throws IllegalArgumentException when provider is null
      * or empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String01() throws NoSuchProviderException,
             NoSuchAlgorithmException {
         if (!DEFSupported) {
@@ -304,12 +264,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String02() throws NoSuchProviderException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -338,12 +292,6 @@
      * Assertion: throws NoSuchProviderException when provider has
      * invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String03() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -368,12 +316,6 @@
      * method
      * Assertion: returns instance of TrustManagerFactory
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String04() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!DEFSupported) {
@@ -398,12 +340,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider01() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -426,12 +362,6 @@
      * throws NullPointerException when algorithm is null;
      * throws NoSuchAlgorithmException when algorithm is not correct;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider02() {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -459,12 +389,6 @@
      * method
      * Assertion: returns instance of TrustManagerFactory
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_security_Provider03() throws NoSuchAlgorithmException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -488,12 +412,6 @@
      * @throws NoSuchAlgorithmException
      * @throws NoSuchProviderException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider()
         throws NoSuchAlgorithmException, NoSuchProviderException {
         if (!DEFSupported) fail(NotSupportedMsg);
@@ -519,12 +437,6 @@
      * @throws CertificateException
      * @throws NoSuchAlgorithmException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTrustManagers",
-        args = {}
-    )
     public void test_getTrustManagers() {
         try {
             TrustManagerFactory trustMF = TrustManagerFactory.getInstance(defaultAlgorithm);
@@ -544,12 +456,6 @@
      * Test for <code>init(KeyStore keyStore)</code>
      * Assertion: call method with null parameter
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "init",
-        args = {java.security.KeyStore.class}
-    )
     public void test_initLjava_security_KeyStore_01() {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -571,12 +477,6 @@
      * Test for <code>init(KeyStore keyStore)</code>
      * Assertion: call method with not null parameter
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "init",
-        args = {java.security.KeyStore.class}
-    )
     public void test_initLjava_security_KeyStore_02() throws KeyStoreException {
         if (!DEFSupported) {
             fail(NotSupportedMsg);
@@ -601,12 +501,6 @@
      * Assertion:
      * throws InvalidAlgorithmParameterException when params is null
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {javax.net.ssl.ManagerFactoryParameters.class}
-    )
     @KnownFailure("ManagerFactoryParameters object is not supported " +
                   "and InvalidAlgorithmParameterException was thrown.")
     public void test_initLjavax_net_ssl_ManagerFactoryParameters() {
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory2Test.java b/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory2Test.java
index 20d4de3..0c0760f 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory2Test.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory2Test.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
 import java.security.KeyStoreException;
@@ -41,7 +36,6 @@
  * Tests for TrustManagerFactory class constructors and methods
  *
  */
-@TestTargetClass(TrustManagerFactory.class)
 public class TrustManagerFactory2Test extends TestCase {
     private static final String srvTrustManagerFactory = "TrustManagerFactory";
     private static final String defaultAlg = "TMF";
@@ -120,12 +114,6 @@
      * throws NoSuchAlgorithmException when algorithm is not correct;
      * returns TrustManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() throws Exception {
         try {
             TrustManagerFactory.getInstance(null);
@@ -163,12 +151,6 @@
      * throws NoSuchProviderException when provider is available;
      * returns TrustManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String() throws Exception {
         try {
             TrustManagerFactory.getInstance(null, mProv.getName());
@@ -235,12 +217,6 @@
      * throws IllegalArgumentException when provider is null;
      * returns TrustManagerFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testLjava_lang_StringLjava_security_Provider() throws Exception {
         try {
             TrustManagerFactory.getInstance(null, mProv);
@@ -276,4 +252,4 @@
             checkResult(tmf);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactorySpiTest.java b/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactorySpiTest.java
index 56cb2a9..7bdeb45 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactorySpiTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactorySpiTest.java
@@ -15,10 +15,6 @@
  */
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AccessController;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.KeyStore;
@@ -35,19 +31,12 @@
 import org.apache.harmony.xnet.tests.support.TrustManagerFactorySpiImpl;
 import org.apache.harmony.xnet.tests.support.MyTrustManagerFactorySpi.Parameters;
 
-@TestTargetClass(TrustManagerFactorySpi.class)
 public class TrustManagerFactorySpiTest extends TestCase {
 
     private TrustManagerFactorySpiImpl factory = new TrustManagerFactorySpiImpl();
     /**
-     * @tests javax.net.ssl.TrustManagerFactorySpi#TrustManagerFactorySpi()
+     * javax.net.ssl.TrustManagerFactorySpi#TrustManagerFactorySpi()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "TrustManagerFactorySpi",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             TrustManagerFactorySpiImpl tmf = new TrustManagerFactorySpiImpl();
@@ -59,14 +48,8 @@
     /**
      * @throws NoSuchAlgorithmException
      * @throws KeyStoreException
-     * @tests javax.net.ssl.TrustManagerFactorySpi#engineInit(KeyStore ks)
+     * javax.net.ssl.TrustManagerFactorySpi#engineInit(KeyStore ks)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineInit",
-        args = {java.security.KeyStore.class}
-    )
     public void test_engineInit_01() throws NoSuchAlgorithmException,
             KeyStoreException {
         factory.reset();
@@ -92,14 +75,8 @@
     /**
      * @throws InvalidAlgorithmParameterException
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.TrustManagerFactorySpi#engineInit(ManagerFactoryParameters spec)
+     * javax.net.ssl.TrustManagerFactorySpi#engineInit(ManagerFactoryParameters spec)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineInit",
-        args = {javax.net.ssl.ManagerFactoryParameters.class}
-    )
     public void test_engineInit_02() throws InvalidAlgorithmParameterException,
             NoSuchAlgorithmException {
         factory.reset();
@@ -125,14 +102,8 @@
 
     /**
      * @throws NoSuchAlgorithmException
-     * @tests javax.net.ssl.TrustManagerFactorySpi#engineGetTrustManagers()
+     * javax.net.ssl.TrustManagerFactorySpi#engineGetTrustManagers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "engineGetTrustManagers",
-        args = {}
-    )
     public void test_engineGetTrustManagers() throws NoSuchAlgorithmException {
         factory.reset();
         Provider provider = new MyProvider();
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/X509ExtendedKeyManagerTest.java b/luni/src/test/java/tests/api/javax/net/ssl/X509ExtendedKeyManagerTest.java
index 9ae8d58..514fed8 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/X509ExtendedKeyManagerTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/X509ExtendedKeyManagerTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.net.Socket;
 import java.security.Principal;
 import java.security.PrivateKey;
@@ -35,7 +30,6 @@
  * Tests for <code>X509ExtendedKeyManager</code> class constructors and methods.
  *
  */
-@TestTargetClass(X509ExtendedKeyManager.class)
 public class X509ExtendedKeyManagerTest extends TestCase {
 
     private class MockX509ExtendedKeyManager extends X509ExtendedKeyManager {
@@ -93,14 +87,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509ExtendedKeyManager#X509ExtendedKeyManager()
+     * javax.net.ssl.X509ExtendedKeyManager#X509ExtendedKeyManager()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509ExtendedKeyManager",
-        args = {}
-    )
     public final void test_Constructor() {
         try {
             new MockX509ExtendedKeyManager();
@@ -110,16 +98,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509ExtendedKeyManager
+     * javax.net.ssl.X509ExtendedKeyManager
      *     #chooseEngineClientAlias(java.lang.String[],
      *     java.security.Principal[], javax.net.ssl.SSLEngine)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "chooseEngineClientAlias",
-        args = {java.lang.String[].class, java.security.Principal[].class, javax.net.ssl.SSLEngine.class}
-    )
     public final void test_chooseEngineClientAlias() {
         X509ExtendedKeyManager km = new MyX509ExtendedKeyManager();
         if (km.chooseEngineClientAlias(null, null, null) != null) {
@@ -128,16 +110,10 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509ExtendedKeyManager
+     * javax.net.ssl.X509ExtendedKeyManager
      *     #chooseEngineServerAlias(java.lang.String,
      *     java.security.Principal[], javax.net.ssl.SSLEngine)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "chooseEngineServerAlias",
-        args = {java.lang.String.class, java.security.Principal[].class, javax.net.ssl.SSLEngine.class}
-    )
     public final void test_chooseEngineServerAlias() {
         X509ExtendedKeyManager km = new MyX509ExtendedKeyManager();
         if (km.chooseEngineServerAlias(null, null, null) != null) {
diff --git a/luni/src/test/java/tests/api/javax/net/ssl/X509TrustManagerTest.java b/luni/src/test/java/tests/api/javax/net/ssl/X509TrustManagerTest.java
index d426648..ebe57de 100644
--- a/luni/src/test/java/tests/api/javax/net/ssl/X509TrustManagerTest.java
+++ b/luni/src/test/java/tests/api/javax/net/ssl/X509TrustManagerTest.java
@@ -1,10 +1,5 @@
 package tests.api.javax.net.ssl;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.io.ByteArrayInputStream;
 import java.security.cert.CertificateFactory;
 import java.security.cert.CertificateException;
@@ -19,7 +14,6 @@
 /**
  * Tests for <code>X509TrustManager</code> class constructors and methods.
  */
-@TestTargetClass(X509TrustManager.class)
 public class X509TrustManagerTest extends TestCase {
 
     private X509Certificate[] setX509Certificate() {
@@ -51,14 +45,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[] chain, String authType)
+     * javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[] chain, String authType)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkClientTrusted",
-        args = {java.security.cert.X509Certificate[].class, java.lang.String.class}
-    )
     public void test_checkClientTrusted_01() {
         X509TrustManagerImpl xtm = new X509TrustManagerImpl();
         X509Certificate[] xcert = null;
@@ -103,14 +91,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[] chain, String authType)
+     * javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[] chain, String authType)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkClientTrusted",
-        args = {java.security.cert.X509Certificate[].class, java.lang.String.class}
-    )
     public void test_checkClientTrusted_02() {
         X509TrustManagerImpl xtm = new X509TrustManagerImpl();
         X509Certificate[] xcert = setInvalid();
@@ -124,14 +106,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[] chain, String authType)
+     * javax.net.ssl.X509TrustManager#checkClientTrusted(X509Certificate[] chain, String authType)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkClientTrusted",
-        args = {java.security.cert.X509Certificate[].class, java.lang.String.class}
-    )
     public void test_checkClientTrusted_03() {
         X509TrustManagerImpl xtm = new X509TrustManagerImpl();
         X509Certificate[] xcert = setX509Certificate();
@@ -144,14 +120,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[] chain, String authType)
+     * javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[] chain, String authType)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkServerTrusted",
-        args = {java.security.cert.X509Certificate[].class, java.lang.String.class}
-    )
     public void test_checkServerTrusted_01() {
         X509TrustManagerImpl xtm = new X509TrustManagerImpl();
         X509Certificate[] xcert = null;
@@ -196,14 +166,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[] chain, String authType)
+     * javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[] chain, String authType)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkServerTrusted",
-        args = {java.security.cert.X509Certificate[].class, java.lang.String.class}
-    )
     public void test_checkServerTrusted_02() {
         X509TrustManagerImpl xtm = new X509TrustManagerImpl();
         X509Certificate[] xcert = setInvalid();
@@ -217,14 +181,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[] chain, String authType)
+     * javax.net.ssl.X509TrustManager#checkServerTrusted(X509Certificate[] chain, String authType)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "checkServerTrusted",
-        args = {java.security.cert.X509Certificate[].class, java.lang.String.class}
-    )
     public void test_checkServerTrusted_03() {
         X509TrustManagerImpl xtm = new X509TrustManagerImpl();
         X509Certificate[] xcert = setX509Certificate();
@@ -237,14 +195,8 @@
     }
 
     /**
-     * @tests javax.net.ssl.X509TrustManager#getAcceptedIssuers()
+     * javax.net.ssl.X509TrustManager#getAcceptedIssuers()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAcceptedIssuers",
-        args = {}
-    )
     public void test_getAcceptedIssuers() {
         X509TrustManagerImpl xtm = new X509TrustManagerImpl();
 
diff --git a/luni/src/test/java/tests/api/javax/security/auth/AllTests.java b/luni/src/test/java/tests/api/javax/security/auth/AllTests.java
deleted file mode 100644
index 3ed3868..0000000
--- a/luni/src/test/java/tests/api/javax/security/auth/AllTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.javax.security.auth;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.javax.security.auth;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.api.javax.security.auth;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AuthPermissionTest.class);
-        suite.addTestSuite(PrivateCredentialPermissionTest.class);
-        suite.addTestSuite(SubjectTest.class);
-        suite.addTestSuite(SubjectDomainCombinerTest.class);
-        suite.addTestSuite(DestroyFailedExceptionTest.class);
-        suite.addTestSuite(DestroyableTest.class);
-
-        suite.addTestSuite(LoginExceptionTest.class);
-        suite.addTestSuite(X500PrincipalTest.class);
-        suite.addTestSuite(UnsupportedCallbackExceptionTest.class);
-        suite.addTestSuite(PasswordCallbackTest.class);
-        suite.addTestSuite(CallbackHandlerTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/javax/security/auth/AuthPermissionTest.java b/luni/src/test/java/tests/api/javax/security/auth/AuthPermissionTest.java
index 80198d2..c951700 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/AuthPermissionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/AuthPermissionTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.AuthPermission;
@@ -30,18 +26,11 @@
  * Tests for <code>AuthPermission</code> class constructors and methods.
  *
  */
-@TestTargetClass(AuthPermission.class)
 public class AuthPermissionTest extends TestCase {
 
     /**
-     * @tests javax.security.auth.AuthPermission#AuthPermission(String name)
+     * javax.security.auth.AuthPermission#AuthPermission(String name)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AuthPermission",
-        args = {String.class}
-    )
     public void test_Constructor_01() {
         String[] strParam = {"", null};
 
@@ -62,14 +51,8 @@
     }
 
     /**
-     * @tests javax.security.auth.AuthPermission#AuthPermission(String name, String actions)
+     * javax.security.auth.AuthPermission#AuthPermission(String name, String actions)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AuthPermission",
-        args = {String.class, String.class}
-    )
     public void test_Constructor_02() {
         String[] strParam = {"", null};
         String[] actionParam = {"", null, "ActionName"};
diff --git a/luni/src/test/java/tests/api/javax/security/auth/CallbackHandlerTest.java b/luni/src/test/java/tests/api/javax/security/auth/CallbackHandlerTest.java
index 7d63fa8..76c860a 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/CallbackHandlerTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/CallbackHandlerTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.callback.Callback;
@@ -31,18 +26,11 @@
  * Tests for <code>CallbackHandler</code> class constructors and methods.
  *
  */
-@TestTargetClass(CallbackHandler.class)
 public class CallbackHandlerTest extends TestCase {
 
     /**
-     * @tests javax.security.auth.callback.CallbackHandler#handle(Callback[] callbacks)
+     * javax.security.auth.callback.CallbackHandler#handle(Callback[] callbacks)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "handle",
-        args = {Callback[].class}
-    )
     public void test_CallbackHandler() {
         CallbackHandlerImpl ch = new CallbackHandlerImpl();
         assertFalse(ch.called);
diff --git a/luni/src/test/java/tests/api/javax/security/auth/DestroyFailedExceptionTest.java b/luni/src/test/java/tests/api/javax/security/auth/DestroyFailedExceptionTest.java
index b3fa113..3fb3d97 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/DestroyFailedExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/DestroyFailedExceptionTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.DestroyFailedException;
@@ -29,7 +25,6 @@
  * Tests for <code>DestroyFailedException</code> class constructors and methods.
  *
  */
-@TestTargetClass(DestroyFailedException.class)
 public class DestroyFailedExceptionTest extends TestCase {
 
     public static void main(String[] args) {
@@ -51,15 +46,9 @@
 
 
     /**
-     * @tests javax.security.auth.DestroyFailedException#DestroyFailedException()
+     * javax.security.auth.DestroyFailedException#DestroyFailedException()
      * Assertion: constructs DestroyFailedException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "DestroyFailedException",
-        args = {}
-    )
     public void testDestroyFailedException01() {
         DestroyFailedException dfE = new DestroyFailedException();
         assertNull("getMessage() must return null.", dfE.getMessage());
@@ -67,15 +56,9 @@
     }
 
     /**
-     * @tests javax.security.auth.DestroyFailedException#DestroyFailedException(String msg)
+     * javax.security.auth.DestroyFailedException#DestroyFailedException(String msg)
      * Assertion: constructs with not null parameter.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "DestroyFailedException",
-        args = {String.class}
-    )
     public void testDestroyFailedException02() {
         DestroyFailedException dfE;
         for (int i = 0; i < msgs.length; i++) {
@@ -86,15 +69,9 @@
     }
 
     /**
-     * @tests javax.security.auth.DestroyFailedException#DestroyFailedException(String msg)
+     * javax.security.auth.DestroyFailedException#DestroyFailedException(String msg)
      * Assertion: constructs with null parameter.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "DestroyFailedException",
-        args = {String.class}
-    )
     public void testDestroyFailedException03() {
         String msg = null;
         DestroyFailedException dfE = new DestroyFailedException(msg);
diff --git a/luni/src/test/java/tests/api/javax/security/auth/DestroyableTest.java b/luni/src/test/java/tests/api/javax/security/auth/DestroyableTest.java
index fec876b..4ae47ce 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/DestroyableTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/DestroyableTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.Destroyable;
@@ -32,27 +27,12 @@
  * Tests for <code>Destroyable</code> class constructors and methods.
  *
  */
-@TestTargetClass(Destroyable.class)
 public class DestroyableTest extends TestCase {
 
     /**
-     * @tests javax.security.auth.Destroyable#destroy()
-     * @tests javax.security.auth.Destroyable#isDestroyed()
+     * javax.security.auth.Destroyable#destroy()
+     * javax.security.auth.Destroyable#isDestroyed()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "",
-            method = "destroy",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isDestroyed",
-            args = {}
-        )
-    })
     public void test_destroy() {
         myDestroyable md = new myDestroyable();
         try {
diff --git a/luni/src/test/java/tests/api/javax/security/auth/LoginExceptionTest.java b/luni/src/test/java/tests/api/javax/security/auth/LoginExceptionTest.java
index 0fa9364..ef53a98 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/LoginExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/LoginExceptionTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.login.LoginException;
@@ -29,7 +25,6 @@
  * Tests for <code>LoginException</code> class constructors and methods.
  *
  */
-@TestTargetClass(LoginException.class)
 public class LoginExceptionTest extends TestCase {
 
     public static void main(String[] args) {
@@ -51,15 +46,9 @@
 
 
     /**
-     * @tests javax.security.auth.login.LoginException#LoginException()
+     * javax.security.auth.login.LoginException#LoginException()
      * Assertion: constructs LoginException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LoginException",
-        args = {}
-    )
     public void testLoginException01() {
         LoginException lE = new LoginException();
         assertNull("getMessage() must return null.", lE.getMessage());
@@ -67,15 +56,9 @@
     }
 
     /**
-     * @tests javax.security.auth.login.LoginException#LoginException(String msg)
+     * javax.security.auth.login.LoginException#LoginException(String msg)
      * Assertion: constructs with not null parameter.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LoginException",
-        args = {String.class}
-    )
     public void testLoginException02() {
         LoginException lE;
         for (int i = 0; i < msgs.length; i++) {
@@ -86,15 +69,9 @@
     }
 
     /**
-     * @tests javax.security.auth.login.LoginException#LoginException(String msg)
+     * javax.security.auth.login.LoginException#LoginException(String msg)
      * Assertion: constructs with null parameter.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LoginException",
-        args = {String.class}
-    )
     public void testLoginException03() {
         String msg = null;
         LoginException lE = new LoginException(msg);
diff --git a/luni/src/test/java/tests/api/javax/security/auth/PasswordCallbackTest.java b/luni/src/test/java/tests/api/javax/security/auth/PasswordCallbackTest.java
index bdc5f25..cdd992b 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/PasswordCallbackTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/PasswordCallbackTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.callback.PasswordCallback;
@@ -30,34 +25,13 @@
  * Tests for <code>PasswordCallback</code> class constructors and methods.
  *
  */
-@TestTargetClass(PasswordCallback.class)
 public class PasswordCallbackTest extends TestCase {
 
     /**
-     * @tests javax.security.auth.callback.PasswordCallback#PasswordCallback(String prompt, boolean echoOn)
-     * @tests javax.security.auth.callback.PasswordCallback#getPrompt()
-     * @tests javax.security.auth.callback.PasswordCallback#isEchoOn()
+     * javax.security.auth.callback.PasswordCallback#PasswordCallback(String prompt, boolean echoOn)
+     * javax.security.auth.callback.PasswordCallback#getPrompt()
+     * javax.security.auth.callback.PasswordCallback#isEchoOn()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "PasswordCallback",
-            args = {String.class, boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPrompt",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isEchoOn",
-            args = {}
-        )
-    })
     public void test_PasswordCallback() {
         String prompt = "promptTest";
 
@@ -93,30 +67,10 @@
     }
 
     /**
-     * @tests javax.security.auth.callback.PasswordCallback#getPassword()
-     * @tests javax.security.auth.callback.PasswordCallback#setPassword(char[] password)
-     * @tests javax.security.auth.callback.PasswordCallback#clearPassword()
+     * javax.security.auth.callback.PasswordCallback#getPassword()
+     * javax.security.auth.callback.PasswordCallback#setPassword(char[] password)
+     * javax.security.auth.callback.PasswordCallback#clearPassword()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPassword",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setPassword",
-            args = {char[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "clearPassword",
-            args = {}
-        )
-    })
     public void test_Password() {
         String prompt = "promptTest";
         char[] psw1 = "testPassword".toCharArray();
diff --git a/luni/src/test/java/tests/api/javax/security/auth/PrivateCredentialPermissionTest.java b/luni/src/test/java/tests/api/javax/security/auth/PrivateCredentialPermissionTest.java
index 825dd06..6426a26 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/PrivateCredentialPermissionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/PrivateCredentialPermissionTest.java
@@ -19,10 +19,6 @@
 
 import java.security.Permission;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.PrivateCredentialPermission;
@@ -32,7 +28,6 @@
  * Tests for <code>PrivateCredentialPermission</code> class constructors and methods.
  *
  */
-@TestTargetClass(PrivateCredentialPermission.class)
 public class PrivateCredentialPermissionTest extends TestCase {
 
     private final static String cred_class1 = "a.b.Credential";
@@ -48,14 +43,8 @@
     private final static String name3 = cred_class1 + " " + pc1 + " \"" + pn1 + "\" " + pc2 + " \"" + pn2 + "\"";
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#PrivateCredentialPermission(String name, String actions)
+     * javax.security.auth.PrivateCredentialPermission#PrivateCredentialPermission(String name, String actions)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PrivateCredentialPermission",
-        args = {String.class, String.class}
-    )
     public void test_Constructor_01() {
         PrivateCredentialPermission ap = new PrivateCredentialPermission(name1, "read");
 
@@ -94,28 +83,16 @@
     }
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#getActions()
+     * javax.security.auth.PrivateCredentialPermission#getActions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getActions",
-        args = {}
-    )
     public void test_getActions() {
         PrivateCredentialPermission ap = new PrivateCredentialPermission(name1, "read");
         assertEquals("getActions() must alway return \"read\"", "read", ap.getActions());
     }
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#implies()
+     * javax.security.auth.PrivateCredentialPermission#implies()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = { Permission.class }
-    )
     public void test_implies() {
         PrivateCredentialPermission p1 = new PrivateCredentialPermission("* P1 \"abc\"", "read");
         PrivateCredentialPermission p2 = new PrivateCredentialPermission("a.b.Credential P1 \"abc\"", "read");
@@ -142,28 +119,16 @@
     }
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#getCredentialClass()
+     * javax.security.auth.PrivateCredentialPermission#getCredentialClass()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCredentialClass",
-        args = {}
-    )
     public void test_getCredentialClass() {
         PrivateCredentialPermission ap = new PrivateCredentialPermission(name1, "read");
         assertEquals("getCredentialClass() returned wrong name", cred_class1, ap.getCredentialClass());
     }
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#getPrincipals()
+     * javax.security.auth.PrivateCredentialPermission#getPrincipals()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrincipals",
-        args = {}
-    )
     public void test_getPrincipals() {
 
         PrivateCredentialPermission ap = new PrivateCredentialPermission(name3, "read");
@@ -179,14 +144,8 @@
     }
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#equals()
+     * javax.security.auth.PrivateCredentialPermission#equals()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = { Object.class }
-    )
     public void test_equals() {
         PrivateCredentialPermission p1 = new PrivateCredentialPermission(name3, "read");
         PrivateCredentialPermission p2 = new PrivateCredentialPermission(name3, "read");
@@ -214,14 +173,8 @@
     }
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#hashCode()
+     * javax.security.auth.PrivateCredentialPermission#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         PrivateCredentialPermission p1 = new PrivateCredentialPermission(name1, "read");
         PrivateCredentialPermission p2 = new PrivateCredentialPermission(name1, "read");
@@ -244,14 +197,8 @@
     }
 
     /**
-     * @tests javax.security.auth.PrivateCredentialPermission#newPermissionCollection()
+     * javax.security.auth.PrivateCredentialPermission#newPermissionCollection()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void test_newPermissionCollection() {
         PrivateCredentialPermission ap = new PrivateCredentialPermission(name1, "read");
         assertNull("newPermissionCollection must always return null", ap.newPermissionCollection());
diff --git a/luni/src/test/java/tests/api/javax/security/auth/SubjectDomainCombinerTest.java b/luni/src/test/java/tests/api/javax/security/auth/SubjectDomainCombinerTest.java
index f077ec8..b860b1a 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/SubjectDomainCombinerTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/SubjectDomainCombinerTest.java
@@ -32,10 +32,6 @@
 import java.util.HashSet;
 import java.util.Set;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.AuthPermission;
@@ -49,19 +45,12 @@
  * Tests for <code>SubjectDomainCombiner</code> class constructors and methods.
  *
  */
-@TestTargetClass(SubjectDomainCombiner.class)
 public class SubjectDomainCombinerTest extends TestCase {
     private final static boolean DEBUG = true;
 
     /**
-     * @tests javax.security.auth.SubjectDomainCombiner#SubjectDomainCombiner(Subject subject)
+     * javax.security.auth.SubjectDomainCombiner#SubjectDomainCombiner(Subject subject)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SubjectDomainCombiner",
-        args = {Subject.class}
-    )
     public void test_Constructor_01() {
         Subject s = new Subject();
         SubjectDomainCombiner c = new SubjectDomainCombiner(s);
@@ -74,14 +63,8 @@
     }
 
     /**
-     * @tests javax.security.auth.SubjectDomainCombiner#getSubject()
+     * javax.security.auth.SubjectDomainCombiner#getSubject()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies that Subject associated with this SubjectDomainCombiner is returned",
-        method = "getSubject",
-        args = {}
-    )
     public void test_getSubject_01() {
         Subject s = new Subject();
         SubjectDomainCombiner c = new SubjectDomainCombiner(s);
@@ -107,14 +90,8 @@
     protected final static String subjectPvtPerm1 = "writeFileDescriptor";
 
     /**
-     * @tests javax.security.auth.SubjectDomainCombiner#combine()
+     * javax.security.auth.SubjectDomainCombiner#combine()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "both currentDomains and assignedDomains are not null",
-        method = "combine",
-        args = {ProtectionDomain[].class, ProtectionDomain[].class}
-    )
     public void test_combine_01() {
 
         URL url;
@@ -203,14 +180,8 @@
     }
 
     /**
-     * @tests javax.security.auth.SubjectDomainCombiner#combine()
+     * javax.security.auth.SubjectDomainCombiner#combine()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "assignedDomains is null",
-        method = "combine",
-        args = {ProtectionDomain[].class, ProtectionDomain[].class}
-    )
     public void test_combine_02() {
 
         URL url;
@@ -285,14 +256,8 @@
     }
 
     /**
-     * @tests javax.security.auth.SubjectDomainCombiner#combine()
+     * javax.security.auth.SubjectDomainCombiner#combine()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "currentDomains is null",
-        method = "combine",
-        args = {ProtectionDomain[].class, ProtectionDomain[].class}
-    )
     public void test_combine_03() {
 
         URL url;
diff --git a/luni/src/test/java/tests/api/javax/security/auth/SubjectTest.java b/luni/src/test/java/tests/api/javax/security/auth/SubjectTest.java
index 5ef39a3..05741a9 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/SubjectTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/SubjectTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.AuthPermission;
@@ -43,18 +38,11 @@
  * Tests for <code>Subject</code> class constructors and methods.
  *
  */
-@TestTargetClass(Subject.class)
 public class SubjectTest extends TestCase {
 
     /**
-     * @tests javax.security.auth.Subject#Subject()
+     * javax.security.auth.Subject#Subject()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Subject",
-        args = {}
-    )
     public void test_Constructor_01() {
         try {
             Subject s = new Subject();
@@ -68,14 +56,8 @@
     }
 
     /**
-     * @tests javax.security.auth.Subject#doAs(Subject subject, PrivilegedAction action)
+     * javax.security.auth.Subject#doAs(Subject subject, PrivilegedAction action)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doAs",
-        args = {Subject.class, PrivilegedAction.class}
-    )
     public void test_doAs_01() {
         Subject subj = new Subject();
         PrivilegedAction<Object> pa = new myPrivilegedAction();
@@ -101,14 +83,8 @@
     }
 
     /**
-     * @tests javax.security.auth.Subject#doAs(Subject subject, PrivilegedExceptionAction action)
+     * javax.security.auth.Subject#doAs(Subject subject, PrivilegedExceptionAction action)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doAs",
-        args = {Subject.class, PrivilegedExceptionAction.class}
-    )
     public void test_doAs_02() {
         Subject subj = new Subject();
         PrivilegedExceptionAction<Object> pea = new myPrivilegedExceptionAction();
@@ -146,16 +122,10 @@
     }
 
     /**
-     * @tests javax.security.auth.Subject#doAsPrivileged(Subject subject,
+     * javax.security.auth.Subject#doAsPrivileged(Subject subject,
      *                                                   PrivilegedAction action,
      *                                                   AccessControlContext acc)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doAsPrivileged",
-        args = {Subject.class, PrivilegedAction.class, AccessControlContext.class}
-    )
     public void test_doAsPrivileged_01() {
         Subject subj = new Subject();
         PrivilegedAction<Object> pa = new myPrivilegedAction();
@@ -182,16 +152,10 @@
     }
 
     /**
-     * @tests javax.security.auth.Subject#doAsPrivileged(Subject subject,
+     * javax.security.auth.Subject#doAsPrivileged(Subject subject,
      *                                                   PrivilegedExceptionAction action,
      *                                                   AccessControlContext acc)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "doAsPrivileged",
-        args = {Subject.class, PrivilegedExceptionAction.class, AccessControlContext.class}
-    )
     public void test_doAsPrivileged_02() {
         Subject subj = new Subject();
         PrivilegedExceptionAction<Object> pea = new myPrivilegedExceptionAction();
@@ -230,14 +194,8 @@
     }
 
     /**
-     * @tests javax.security.auth.Subject#getSubject(AccessControlContext acc)
+     * javax.security.auth.Subject#getSubject(AccessControlContext acc)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubject",
-        args = {AccessControlContext.class}
-    )
     public void test_getSubject() {
         Subject subj = new Subject();
         AccessControlContext acc = new AccessControlContext(new ProtectionDomain[0]);
@@ -250,14 +208,8 @@
     }
 
     /**
-     * @tests javax.security.auth.Subject#toString()
+     * javax.security.auth.Subject#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         Subject subj = new Subject();
 
@@ -269,14 +221,8 @@
     }
 
     /**
-     * @tests javax.security.auth.Subject#hashCode()
+     * javax.security.auth.Subject#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "SecurityException wasn't tested",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         Subject subj = new Subject();
 
diff --git a/luni/src/test/java/tests/api/javax/security/auth/UnsupportedCallbackExceptionTest.java b/luni/src/test/java/tests/api/javax/security/auth/UnsupportedCallbackExceptionTest.java
index 4cdad92..ac41d69 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/UnsupportedCallbackExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/UnsupportedCallbackExceptionTest.java
@@ -17,11 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.callback.UnsupportedCallbackException;
@@ -31,7 +26,6 @@
  * Tests for <code>UnsupportedCallbackException</code> class constructors and methods.
  *
  */
-@TestTargetClass(UnsupportedCallbackException.class)
 public class UnsupportedCallbackExceptionTest extends TestCase {
 
     public static void main(String[] args) {
@@ -53,24 +47,10 @@
 
 
     /**
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback)
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#getCallback()
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback)
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#getCallback()
      * Assertion: constructs with null parameter.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "UnsupportedCallbackException",
-            args = {Callback.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getCallback",
-            args = {}
-        )
-    })
     public void testUnsupportedCallbackException01() {
         Callback c = null;
         UnsupportedCallbackException ucE = new UnsupportedCallbackException(c);
@@ -79,24 +59,10 @@
     }
 
     /**
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback)
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#getCallback()
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback)
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#getCallback()
      * Assertion: constructs with not null parameter.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "UnsupportedCallbackException",
-            args = {Callback.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "getCallback",
-            args = {}
-        )
-    })
     public void testUnsupportedCallbackException02() {
         myCallback c = new myCallback();
         assertNotNull("Callback object is null", c);
@@ -106,15 +72,9 @@
     }
 
     /**
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
      * Assertion: constructs with null callback parameter and null message.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "UnsupportedCallbackException",
-        args = {Callback.class, String.class}
-    )
     public void testUnsupportedCallbackException03() {
         UnsupportedCallbackException ucE = new UnsupportedCallbackException(null, null);
         assertNull("getMessage() must return null.", ucE.getMessage());
@@ -122,15 +82,9 @@
     }
 
     /**
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
      * Assertion: constructs with null callback parameter and not null message.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "UnsupportedCallbackException",
-        args = {Callback.class, String.class}
-    )
     public void testUnsupportedCallbackException04() {
         UnsupportedCallbackException ucE;
         for (int i = 0; i < msgs.length; i++) {
@@ -141,15 +95,9 @@
     }
 
     /**
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
      * Assertion: constructs with not null callback parameter and null message.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "UnsupportedCallbackException",
-        args = {Callback.class, String.class}
-    )
     public void testUnsupportedCallbackException05() {
         myCallback c = new myCallback();
         assertNotNull("Callback object is null", c);
@@ -159,15 +107,9 @@
     }
 
     /**
-     * @tests javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
+     * javax.security.auth.callback.UnsupportedCallbackExceptionTest#UnsupportedCallbackException(Callback callback, String msg)
      * Assertion: constructs with not null parameters.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "UnsupportedCallbackException",
-        args = {Callback.class, String.class}
-    )
     public void testUnsupportedCallbackException06() {
         myCallback c = new myCallback();
         assertNotNull("Callback object is null", c);
diff --git a/luni/src/test/java/tests/api/javax/security/auth/X500PrincipalTest.java b/luni/src/test/java/tests/api/javax/security/auth/X500PrincipalTest.java
index 34bd207..7cb81bb 100644
--- a/luni/src/test/java/tests/api/javax/security/auth/X500PrincipalTest.java
+++ b/luni/src/test/java/tests/api/javax/security/auth/X500PrincipalTest.java
@@ -17,10 +17,6 @@
 
 package tests.api.javax.security.auth;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import javax.security.auth.x500.X500Principal;
@@ -35,18 +31,11 @@
  * Tests for <code>X500Principal</code> class constructors and methods.
  *
  */
-@TestTargetClass(X500Principal.class)
 public class X500PrincipalTest extends TestCase {
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#X500Principal(String name)
+     * javax.security.auth.x500.X500Principal#X500Principal(String name)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X500Principal",
-        args = {String.class}
-    )
     public void test_X500Principal_01() {
         String name = "CN=Duke,OU=JavaSoft,O=Sun Microsystems,C=US";
 
@@ -77,14 +66,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#X500Principal(InputStream is)
+     * javax.security.auth.x500.X500Principal#X500Principal(InputStream is)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X500Principal",
-        args = {InputStream.class}
-    )
     public void test_X500Principal_02() {
         String name = "CN=Duke,OU=JavaSoft,O=Sun Microsystems,C=US";
         byte[] ba = getByteArray(TestUtils.getX509Certificate_v1());
@@ -119,14 +102,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#X500Principal(byte[] name)
+     * javax.security.auth.x500.X500Principal#X500Principal(byte[] name)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X500Principal",
-        args = {byte[].class}
-    )
     public void test_X500Principal_03() {
         String name = "CN=Duke,OU=JavaSoft,O=Sun Microsystems,C=US";
         byte[] ba = getByteArray(TestUtils.getX509Certificate_v1());
@@ -160,14 +137,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#getName()
+     * javax.security.auth.x500.X500Principal#getName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void test_getName() {
         String name = "CN=Duke,OU=JavaSoft,O=Sun Microsystems,C=US";
         X500Principal xpr = new X500Principal(name);
@@ -180,14 +151,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#getName(String format)
+     * javax.security.auth.x500.X500Principal#getName(String format)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {String.class}
-    )
     public void test_getName_Format() {
         String name = "CN=Duke,OU=JavaSoft,O=Sun Microsystems,C=US";
         String expectedName = "cn=duke,ou=javasoft,o=sun microsystems,c=us";
@@ -227,14 +192,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#hashCode()
+     * javax.security.auth.x500.X500Principal#hashCode()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void test_hashCode() {
         String name = "CN=Duke,OU=JavaSoft,O=Sun Microsystems,C=US";
         X500Principal xpr = new X500Principal(name);
@@ -247,14 +206,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#toString()
+     * javax.security.auth.x500.X500Principal#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         String name = "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US";
         X500Principal xpr = new X500Principal(name);
@@ -268,14 +221,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#getEncoded()
+     * javax.security.auth.x500.X500Principal#getEncoded()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public void test_getEncoded() {
         byte[] ba = getByteArray(TestUtils.getX509Certificate_v1());
         X500Principal xpr = new X500Principal(ba);
@@ -289,14 +236,8 @@
     }
 
     /**
-     * @tests javax.security.auth.x500.X500Principal#equals(Object o)
+     * javax.security.auth.x500.X500Principal#equals(Object o)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {Object.class}
-    )
     public void test_equals() {
         String name1 = "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US";
         String name2 = "cn=duke,ou=javasoft,o=sun microsystems,c=us";
diff --git a/luni/src/test/java/tests/api/javax/security/cert/AllTests.java b/luni/src/test/java/tests/api/javax/security/cert/AllTests.java
deleted file mode 100644
index 30921bd..0000000
--- a/luni/src/test/java/tests/api/javax/security/cert/AllTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.javax.security.cert;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.javax.security.cert;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.api.javax.security.cert;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(CertificateEncodingExceptionTest.class);
-        suite.addTestSuite(CertificateExceptionTest.class);
-        suite.addTestSuite(CertificateExpiredExceptionTest.class);
-        suite.addTestSuite(CertificateNotYetValidExceptionTest.class);
-        suite.addTestSuite(CertificateParsingExceptionTest.class);
-        suite.addTestSuite(CertificateTest.class);
-        suite.addTestSuite(X509CertificateTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/javax/security/cert/CertificateEncodingExceptionTest.java b/luni/src/test/java/tests/api/javax/security/cert/CertificateEncodingExceptionTest.java
index d79cb96..53fbd9f 100644
--- a/luni/src/test/java/tests/api/javax/security/cert/CertificateEncodingExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/cert/CertificateEncodingExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.api.javax.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import javax.security.cert.CertificateEncodingException;
@@ -35,7 +30,6 @@
  * Tests for <code>DigestException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateEncodingException.class)
 public class CertificateEncodingExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -49,12 +43,6 @@
      * Test for <code>CertificateEncodingException()</code> constructor
      * Assertion: constructs CertificateEncodingException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateEncodingException",
-        args = {}
-    )
     public void testCertificateEncodingException01() {
         CertificateEncodingException tE = new CertificateEncodingException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +54,6 @@
      * Assertion: constructs CertificateEncodingException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateEncodingException with valid parameters.",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateEncodingException02() {
         CertificateEncodingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -87,12 +69,6 @@
      * Assertion: constructs CertificateEncodingException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateEncodingException03() {
         String msg = null;
         CertificateEncodingException tE = new CertificateEncodingException(msg);
diff --git a/luni/src/test/java/tests/api/javax/security/cert/CertificateExceptionTest.java b/luni/src/test/java/tests/api/javax/security/cert/CertificateExceptionTest.java
index 625e5ec..ccc3a2c 100644
--- a/luni/src/test/java/tests/api/javax/security/cert/CertificateExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/cert/CertificateExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.api.javax.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import javax.security.cert.CertificateException;
@@ -36,7 +31,6 @@
  * Tests for <code>DigestException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateException.class)
 public class CertificateExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -50,12 +44,6 @@
      * Test for <code>CertificateException()</code> constructor Assertion:
      * constructs CertificateException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateException",
-        args = {}
-    )
     public void testCertificateException01() {
         CertificateException tE = new CertificateException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -67,12 +55,6 @@
      * Assertion: constructs CertificateException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameter.",
-        method = "CertificateException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateException02() {
         CertificateException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -88,12 +70,6 @@
      * Assertion: constructs CertificateException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateException03() {
         String msg = null;
         CertificateException tE = new CertificateException(msg);
diff --git a/luni/src/test/java/tests/api/javax/security/cert/CertificateExpiredExceptionTest.java b/luni/src/test/java/tests/api/javax/security/cert/CertificateExpiredExceptionTest.java
index 7a6c7bb..d0e94e3 100644
--- a/luni/src/test/java/tests/api/javax/security/cert/CertificateExpiredExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/cert/CertificateExpiredExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.api.javax.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import javax.security.cert.CertificateExpiredException;
@@ -36,7 +31,6 @@
  * Tests for <code>DigestException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateExpiredException.class)
 public class CertificateExpiredExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -50,12 +44,6 @@
      * Test for <code>CertificateExpiredException()</code> constructor
      * Assertion: constructs CertificateExpiredException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateExpiredException",
-        args = {}
-    )
     public void testCertificateExpiredException01() {
         CertificateExpiredException tE = new CertificateExpiredException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -67,12 +55,6 @@
      * Assertion: constructs CertificateExpiredException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameter.",
-        method = "CertificateExpiredException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateExpiredException02() {
         CertificateExpiredException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -88,12 +70,6 @@
      * Assertion: constructs CertificateExpiredException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with null as a parameter.",
-        method = "CertificateExpiredException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateExpiredException03() {
         String msg = null;
         CertificateExpiredException tE = new CertificateExpiredException(msg);
diff --git a/luni/src/test/java/tests/api/javax/security/cert/CertificateNotYetValidExceptionTest.java b/luni/src/test/java/tests/api/javax/security/cert/CertificateNotYetValidExceptionTest.java
index 311c2ce..c746648 100644
--- a/luni/src/test/java/tests/api/javax/security/cert/CertificateNotYetValidExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/cert/CertificateNotYetValidExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.api.javax.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import javax.security.cert.CertificateNotYetValidException;
@@ -36,7 +31,6 @@
  * Tests for <code>DigestException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateNotYetValidException.class)
 public class CertificateNotYetValidExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -51,12 +45,6 @@
      * Assertion: constructs CertificateNotYetValidException with no detail
      * message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateNotYetValidException",
-        args = {}
-    )
     public void testCertificateNotYetValidException01() {
         CertificateNotYetValidException tE = new CertificateNotYetValidException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * constructor Assertion: constructs CertificateNotYetValidException with
      * detail message msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateNotYetValidException constructor with valid parameters.",
-        method = "CertificateNotYetValidException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateNotYetValidException02() {
         CertificateNotYetValidException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * constructor Assertion: constructs CertificateNotYetValidException when
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies  CertificateNotYetValidException constructor with null as a parameter.",
-        method = "CertificateNotYetValidException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateNotYetValidException03() {
         String msg = null;
         CertificateNotYetValidException tE = new CertificateNotYetValidException(
diff --git a/luni/src/test/java/tests/api/javax/security/cert/CertificateParsingExceptionTest.java b/luni/src/test/java/tests/api/javax/security/cert/CertificateParsingExceptionTest.java
index eb9ea95..bc07ff6 100644
--- a/luni/src/test/java/tests/api/javax/security/cert/CertificateParsingExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/security/cert/CertificateParsingExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.api.javax.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import javax.security.cert.CertificateParsingException;
@@ -36,7 +31,6 @@
  * Tests for <code>DigestException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateParsingException.class)
 public class CertificateParsingExceptionTest extends TestCase {
 
 
@@ -51,12 +45,6 @@
      * Test for <code>CertificateParsingException()</code> constructor
      * Assertion: constructs CertificateParsingException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateParsingException",
-        args = {}
-    )
     public void testCertificateParsingException01() {
         CertificateParsingException tE = new CertificateParsingException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * Assertion: constructs CertificateParsingException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateParsingException cobstructor with valid parameters.",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateParsingException02() {
         CertificateParsingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * Assertion: constructs CertificateParsingException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateParsingException constructor with null as a parameter.",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateParsingException03() {
         String msg = null;
         CertificateParsingException tE = new CertificateParsingException(msg);
diff --git a/luni/src/test/java/tests/api/javax/security/cert/CertificateTest.java b/luni/src/test/java/tests/api/javax/security/cert/CertificateTest.java
index 14417a9..da1c7a0 100644
--- a/luni/src/test/java/tests/api/javax/security/cert/CertificateTest.java
+++ b/luni/src/test/java/tests/api/javax/security/cert/CertificateTest.java
@@ -22,10 +22,6 @@
 
 package tests.api.javax.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -40,19 +36,6 @@
 import javax.security.cert.CertificateEncodingException;
 import javax.security.cert.CertificateException;
 
-/**
- */
-@TestTargetClass(
-        value = Certificate.class,
-        untestedMethods = {
-            @TestTargetNew(
-                    level = TestLevel.NOT_FEASIBLE,
-                    notes = "not specific enough for black-box testing",
-                    method = "toString",
-                    args = {}
-                  )
-        }
-)
 public class CertificateTest extends TestCase {
 
     /**
@@ -86,12 +69,6 @@
     /**
      * Test for <code>Certificate()</code> constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Certificate",
-        args = {}
-    )
     public final void testCertificate() {
         TBTCert tbt_cert = new TBTCert();
 
@@ -104,12 +81,6 @@
      * operation: it should be reflexive, symmetric, transitive, consistent and
      * should be false on null object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         TBTCert tbt_cert = new TBTCert() {
             public byte[] getEncoded() {
@@ -166,12 +137,6 @@
     /**
      * hashCode() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         TBTCert tbt_cert = new TBTCert() {
             public byte[] getEncoded() {
diff --git a/luni/src/test/java/tests/api/javax/security/cert/X509CertificateTest.java b/luni/src/test/java/tests/api/javax/security/cert/X509CertificateTest.java
index f0ba1ea..996c94df 100644
--- a/luni/src/test/java/tests/api/javax/security/cert/X509CertificateTest.java
+++ b/luni/src/test/java/tests/api/javax/security/cert/X509CertificateTest.java
@@ -23,9 +23,6 @@
 package tests.api.javax.security.cert;
 
 import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import dalvik.annotation.SideEffect;
 
 import junit.framework.Test;
@@ -66,14 +63,9 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 import tests.targets.security.cert.CertificateFactoryTestX509;
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
 /**
  */
-@TestTargetClass(X509Certificate.class)
 public class X509CertificateTest extends TestCase {
 
     // Testing data was generated by using of classes
@@ -179,14 +171,8 @@
 
     /**
      * X509Certificate() constructor testing.
-     * @tests {@link X509Certificate#X509Certificate() }
+     * {@link X509Certificate#X509Certificate() }
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509Certificate",
-        args = {}
-    )
     public void testConstructor() {
         //Direct constructor, check if it throws an exception
         X509Certificate cert = new MyCertificate();
@@ -195,12 +181,6 @@
     /**
      * getInstance(InputStream inStream) method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.io.InputStream.class}
-    )
     public void testGetInstance1() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -235,12 +215,6 @@
      * @throws CertificateEncodingException
      * @throws java.security.cert.CertificateEncodingException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies CertificateException.",
-        method = "getInstance",
-        args = {byte[].class}
-    )
     public void testGetInstance2() throws java.security.cert.CertificateEncodingException, CertificateEncodingException {
         boolean certificateException = false;
         X509Certificate c = null;
@@ -288,12 +262,6 @@
      * @throws java.security.cert.CertificateExpiredException
      * @throws java.security.cert.CertificateNotYetValidException
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Doesn't verify exceptions.",
-        method = "checkValidity",
-        args = {}
-    )
     public void testCheckValidity1() throws CertificateExpiredException, CertificateNotYetValidException, java.security.cert.CertificateExpiredException, java.security.cert.CertificateNotYetValidException {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -336,12 +304,6 @@
      * @throws CertificateNotYetValidException
      * @throws CertificateExpiredException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Doesn't verify exceptions.",
-        method = "checkValidity",
-        args = {java.util.Date.class}
-    )
     public void testCheckValidity2() throws CertificateNotYetValidException, CertificateExpiredException {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -394,12 +356,6 @@
     /**
      * getVersion() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getVersion",
-        args = {}
-    )
     public void testGetVersion() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -412,12 +368,6 @@
     /**
      * getSerialNumber() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSerialNumber",
-        args = {}
-    )
     public void testGetSerialNumber() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -431,12 +381,6 @@
     /**
      * getIssuerDN() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Denigrated API",
-        method = "getIssuerDN",
-        args = {}
-    )
     public void testGetIssuerDN() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -450,12 +394,6 @@
     /**
      * getSubjectDN() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectDN",
-        args = {}
-    )
     public void testGetSubjectDN() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -469,12 +407,6 @@
     /**
      * getNotBefore() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getNotBefore",
-        args = {}
-    )
     public void testGetNotBefore() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -488,12 +420,6 @@
     /**
      * getNotAfter() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getNotAfter",
-        args = {}
-    )
     public void testGetNotAfter() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -507,12 +433,6 @@
     /**
      * getSigAlgName() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSigAlgName",
-        args = {}
-    )
     public void testGetSigAlgName() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -526,12 +446,6 @@
     /**
      * getSigAlgOID() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSigAlgOID",
-        args = {}
-    )
     public void testGetSigAlgOID() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -545,12 +459,6 @@
     /**
      * getSigAlgParams() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSigAlgParams",
-        args = {}
-    )
     public void testGetSigAlgParams() {
         if (this.cert == null) {
             // The requested certificate type is not available.
@@ -719,14 +627,8 @@
 
     /**
      * @throws CertificateEncodingException
-     * @tests {@link Certificate#getEncoded()}
+     * {@link Certificate#getEncoded()}
      */
-    @TestTargetNew(
-      level = TestLevel.SUFFICIENT,
-      notes = "No ASN1/DER encoder available. Exception is not supported.",
-      method = "getEncoded",
-      args = {}
-    )
     public void testGetEncoded()
             throws CertificateEncodingException, java.security.cert.CertificateException {
         // cert = DER encoding of the ASN1.0 structure
@@ -735,14 +637,8 @@
     }
 
     /**
-     * @tests {@link Certificate#getPublicKey()}
+     * {@link Certificate#getPublicKey()}
      */
-    @TestTargetNew(
-      level = TestLevel.COMPLETE,
-      notes = "",
-      method = "getPublicKey",
-      args = {}
-    )
     public void testGetPublicKey() {
        PublicKey key = javaxCert.getPublicKey();
        assertNotNull(key);
@@ -763,17 +659,8 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeyException
      * @throws CertificateException
-     * @tests {@link Certificate#verify(PublicKey)}
+     * {@link Certificate#verify(PublicKey)}
      */
-    @TestTargetNew(
-      level = TestLevel.SUFFICIENT,
-      notes = " CertificateException not supported."+
-              "NoSuchAlgorithmException, NoSuchProviderException can be "+
-              "implemented only with working Cert. Verification fails "+
-              "(see failing) precondition assertions",
-      method = "verify",
-      args = {java.security.PublicKey.class}
-    )
     @SideEffect("Destroys MD5 provider, hurts succeeding tests")
     public void testVerifyPublicKey() throws InvalidKeyException,
             NoSuchAlgorithmException, NoSuchProviderException,
@@ -855,14 +742,8 @@
      * @throws InvalidKeyException
      * @throws IOException
      * @throws CertificateException
-     * @tests {@link Certificate#verify(PublicKey, String)}
+     * {@link Certificate#verify(PublicKey, String)}
      */
-    @TestTargetNew(
-      level = TestLevel.SUFFICIENT,
-      notes = "",
-      method = "verify",
-      args = {java.security.PublicKey.class, java.lang.String.class}
-    )
     @SideEffect("Destroys MD5 provider, hurts succeeding tests")
     public void testVerifyPublicKeyString() throws InvalidKeyException,
             java.security.cert.CertificateException, NoSuchAlgorithmException,
diff --git a/luni/src/test/java/tests/api/javax/xml/parsers/AllTests.java b/luni/src/test/java/tests/api/javax/xml/parsers/AllTests.java
deleted file mode 100644
index 6771ea5..0000000
--- a/luni/src/test/java/tests/api/javax/xml/parsers/AllTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.javax.xml.parsers;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.javax.xml.parsers;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.api.javax.xml.parsers;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(DocumentBuilderFactoryTest.class);
-        suite.addTestSuite(DocumentBuilderTest.class);
-        suite.addTestSuite(FactoryConfigurationErrorTest.class);
-        suite.addTestSuite(ParserConfigurationExceptionTest.class);
-        suite.addTestSuite(SAXParserFactoryTest.class);
-        suite.addTestSuite(SAXParserTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java b/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java
index f911c69a..7d79560 100644
--- a/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java
+++ b/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java
@@ -15,11 +15,6 @@
  */
 package tests.api.javax.xml.parsers;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import org.w3c.dom.Document;
@@ -40,7 +35,6 @@
 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.ParserConfigurationException;
 
-@TestTargetClass(DocumentBuilderFactory.class)
 public class DocumentBuilderFactoryTest extends TestCase {
 
     DocumentBuilderFactory dbf;
@@ -69,14 +63,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#DocumentBuilderFactory().
+     * javax.xml.parsers.DocumentBuilderFactory#DocumentBuilderFactory().
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "DocumentBuilderFactory",
-        args = {}
-    )
     public void test_Constructor() {
         try {
             new DocumentBuilderFactoryChild();
@@ -86,7 +74,7 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#getAttribute(String).
+     * javax.xml.parsers.DocumentBuilderFactory#getAttribute(String).
      */
 //    public void test_getAttributeLjava_lang_String() {
 //        String[] attributes = {
@@ -126,7 +114,7 @@
 //    }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#getFeature(String).
+     * javax.xml.parsers.DocumentBuilderFactory#getFeature(String).
      */
 // TODO Fails on JDK. Why?
 //    public void test_getFeatureLjava_lang_String() {
@@ -175,7 +163,7 @@
 //    }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#getSchema().
+     * javax.xml.parsers.DocumentBuilderFactory#getSchema().
      *  TBD getSchemas() IS NOT SUPPORTED
      */
 /*    public void test_getSchema() {
@@ -193,14 +181,8 @@
     */
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#isCoalescing().
+     * javax.xml.parsers.DocumentBuilderFactory#isCoalescing().
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isCoalescing",
-        args = {}
-    )
     public void test_isCoalescing() {
         dbf.setCoalescing(true);
         assertTrue(dbf.isCoalescing());
@@ -210,14 +192,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#isExpandEntityReferences().
+     * javax.xml.parsers.DocumentBuilderFactory#isExpandEntityReferences().
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isExpandEntityReferences",
-        args = {}
-    )
     public void test_isExpandEntityReferences() {
         dbf.setExpandEntityReferences(true);
         assertTrue(dbf.isExpandEntityReferences());
@@ -227,14 +203,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#isIgnoringComments().
+     * javax.xml.parsers.DocumentBuilderFactory#isIgnoringComments().
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isIgnoringComments",
-        args = {}
-    )
     public void test_isIgnoringComments() {
         dbf.setIgnoringComments(true);
         assertTrue(dbf.isIgnoringComments());
@@ -244,14 +214,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#isIgnoringElementContentWhitespace().
+     * javax.xml.parsers.DocumentBuilderFactory#isIgnoringElementContentWhitespace().
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isIgnoringElementContentWhitespace",
-        args = {}
-    )
     public void test_isIgnoringElementContentWhitespace() {
         dbf.setIgnoringElementContentWhitespace(true);
         assertTrue(dbf.isIgnoringElementContentWhitespace());
@@ -261,14 +225,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#isNamespaceAware().
+     * javax.xml.parsers.DocumentBuilderFactory#isNamespaceAware().
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isNamespaceAware",
-        args = {}
-    )
     public void test_isNamespaceAware() {
         dbf.setNamespaceAware(true);
         assertTrue(dbf.isNamespaceAware());
@@ -277,20 +235,6 @@
         assertFalse(dbf.isNamespaceAware());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isValidating",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "",
-            method = "setValidating",
-            args = {boolean.class}
-        )
-    })
     public void test_setIsValidating() {
         dbf.setValidating(true);
         assertTrue(dbf.isValidating());
@@ -299,20 +243,6 @@
         assertFalse(dbf.isValidating());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isXIncludeAware",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "",
-            method = "setXIncludeAware",
-            args = {boolean.class}
-        )
-    })
     public void test_isSetXIncludeAware() {
         dbf.setXIncludeAware(true);
         assertTrue(dbf.isXIncludeAware());
@@ -322,14 +252,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#newInstance().
+     * javax.xml.parsers.DocumentBuilderFactory#newInstance().
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {}
-    )
     public void test_newInstance() {
         String className = null;
         try {
@@ -380,12 +304,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "SAXException untested; unused on Android",
-        method = "newDocumentBuilder",
-        args = {}
-    )
     public void test_newDocumentBuilder() {
         // Ordinary case
         try {
@@ -406,7 +324,7 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setAttribute(java.lang.String,
+     * javax.xml.parsers.DocumentBuilderFactory#setAttribute(java.lang.String,
      *     java.lang.Object).
      */
 //    public void test_setAttributeLjava_lang_StringLjava_lang_Object() {
@@ -447,14 +365,8 @@
 //    }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setCoalescing(boolean).
+     * javax.xml.parsers.DocumentBuilderFactory#setCoalescing(boolean).
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setCoalescing",
-        args = {boolean.class}
-    )
     public void test_setCoalescingZ() {
         dbf.setCoalescing(true);
         assertTrue(dbf.isCoalescing());
@@ -518,14 +430,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setExpandEntityReferences(boolean).
+     * javax.xml.parsers.DocumentBuilderFactory#setExpandEntityReferences(boolean).
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setExpandEntityReferences",
-        args = {boolean.class}
-    )
     public void test_setExpandEntityReferencesZ() {
         dbf.setExpandEntityReferences(true);
         assertTrue(dbf.isExpandEntityReferences());
@@ -579,22 +485,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setFeature(java.lang.String).
+     * javax.xml.parsers.DocumentBuilderFactory#setFeature(java.lang.String).
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getFeature",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setFeature",
-            args = {java.lang.String.class, boolean.class}
-        )
-    })
     public void test_getSetFeatureLjava_lang_String() {
         String[] features = { "http://xml.org/sax/features/namespaces",
                 "http://xml.org/sax/features/validation" };
@@ -639,14 +531,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setIgnoringComments(boolean).
+     * javax.xml.parsers.DocumentBuilderFactory#setIgnoringComments(boolean).
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIgnoringComments",
-        args = {boolean.class}
-    )
     public void test_setIgnoringCommentsZ() {
         commentElements.clear();
 
@@ -696,14 +582,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setIgnoringElementContentWhitespace(boolean).
+     * javax.xml.parsers.DocumentBuilderFactory#setIgnoringElementContentWhitespace(boolean).
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIgnoringElementContentWhitespace",
-        args = {boolean.class}
-    )
     public void test_setIgnoringElementContentWhitespaceZ() {
         dbf.setIgnoringElementContentWhitespace(true);
         assertTrue(dbf.isIgnoringElementContentWhitespace());
@@ -745,14 +625,8 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setNamespaceAware(boolean).
+     * javax.xml.parsers.DocumentBuilderFactory#setNamespaceAware(boolean).
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setNamespaceAware",
-        args = {boolean.class}
-    )
     public void test_setNamespaceAwareZ() {
         dbf.setNamespaceAware(true);
         assertTrue(dbf.isNamespaceAware());
@@ -793,20 +667,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getAttribute",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setAttribute",
-            args = {java.lang.String.class, Object.class}
-        )
-    })
     public void test_getSetAttribute() {
         // Android SAX implementation doesn't support attributes, so
         // we can only make sure the expected exception is thrown.
@@ -826,7 +686,7 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setSchema(javax.xml.validation.Schema).
+     * javax.xml.parsers.DocumentBuilderFactory#setSchema(javax.xml.validation.Schema).
      */
  /*   public void test_setSchemaLjavax_xml_validation_Schema() {
         SchemaFactory sf =
@@ -841,7 +701,7 @@
     }
 */
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setValidating(boolean).
+     * javax.xml.parsers.DocumentBuilderFactory#setValidating(boolean).
      */
 //    public void test_setValidatingZ() {
 //        Exception parseException = null;
@@ -956,7 +816,7 @@
 //    }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilderFactory#setXIncludeAware().
+     * javax.xml.parsers.DocumentBuilderFactory#setXIncludeAware().
      */
 //    public void test_setXIncludeAware() {
 //        dbf.setXIncludeAware(true);
diff --git a/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java b/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java
index a6a3042..66ce621 100644
--- a/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java
+++ b/luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java
@@ -16,9 +16,6 @@
 
 package tests.api.javax.xml.parsers;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 import junit.framework.TestCase;
 import org.w3c.dom.DOMImplementation;
 import org.w3c.dom.Document;
@@ -44,7 +41,6 @@
 import java.io.InputStream;
 import java.net.URL;
 
-@TestTargetClass(DocumentBuilder.class)
 public class DocumentBuilderTest extends TestCase {
 
     private class MockDocumentBuilder extends DocumentBuilder {
@@ -139,12 +135,6 @@
         super.tearDown();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "DocumentBuilder",
-        args = {}
-    )
     public void testDocumentBuilder() {
         try {
             new MockDocumentBuilder();
@@ -154,7 +144,7 @@
     }
 
     /**
-     *  @tests javax.xml.parsers.DocumentBuilder#getSchema()
+     *  javax.xml.parsers.DocumentBuilder#getSchema()
      *  TBD getSchema() is not supported
      */
  /*   public void test_getSchema() {
@@ -172,12 +162,6 @@
         }
     }
 */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newDocument",
-        args = { }
-    )
     public void testNewDocument() {
         Document d;
 
@@ -193,12 +177,6 @@
         assertNull(d.getNamespaceURI());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDOMImplementation",
-        args = { }
-    )
     public void testGetImplementation() {
         DOMImplementation d;
 
@@ -211,12 +189,6 @@
         assertNotNull(d);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isNamespaceAware",
-        args = {}
-    )
     public void testIsNamespaceAware() {
         try {
             dbf.setNamespaceAware(true);
@@ -228,12 +200,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "No validating parser in Android, hence not tested",
-        method = "isValidating",
-        args = {}
-    )
     public void testIsValidating() {
         try {
             dbf.setValidating(false);
@@ -243,12 +209,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "No XInclude-aware parser in Android, hence not tested",
-        method = "isXIncludeAware",
-        args = {}
-    )
     public void testIsXIncludeAware() {
         try {
             dbf.setXIncludeAware(false);
@@ -261,12 +221,6 @@
     /**
      * Tests that the Base URI for the document is populated with the file URI.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = {java.io.File.class}
-    )
     public void testGetBaseURI() throws IOException, SAXException {
         File f = Support_Resources.resourceToTempFile("/simple.xml");
         Document d = db.parse(f);
@@ -274,18 +228,12 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilder#parse(java.io.File)
+     * javax.xml.parsers.DocumentBuilder#parse(java.io.File)
      * Case 1: Try to parse correct xml document.
      * Case 2: Try to call parse() with null argument.
      * Case 3: Try to parse a non-existent file.
      * Case 4: Try to parse incorrect xml file.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = {java.io.File.class}
-    )
     public void test_parseLjava_io_File() throws IOException {
         File f = Support_Resources.resourceToTempFile("/simple.xml");
 
@@ -341,18 +289,12 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream)
+     * javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream)
      * Case 1: Try to parse correct xml document.
      * Case 2: Try to call parse() with null argument.
      * Case 3: Try to parse a non-existent file.
      * Case 4: Try to parse incorrect xml file.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = {java.io.InputStream.class}
-    )
     public void test_parseLjava_io_InputStream() {
         InputStream is = getClass().getResourceAsStream("/simple.xml");
         // case 1: Trivial use.
@@ -407,18 +349,12 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream)
+     * javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream)
      * Case 1: Try to parse correct xml document.
      * Case 2: Try to call parse() with null argument.
      * Case 3: Try to parse a non-existent file.
      * Case 4: Try to parse incorrect xml file.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = { InputSource.class }
-    )
     public void testParseInputSource() {
         InputStream stream = getClass().getResourceAsStream("/simple.xml");
         InputSource is = new InputSource(stream);
@@ -475,19 +411,13 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream,
+     * javax.xml.parsers.DocumentBuilder#parse(java.io.InputStream,
      *     java.lang.String)
      * Case 1: Try to parse correct xml document.
      * Case 2: Try to call parse() with null argument.
      * Case 3: Try to parse a non-existent file.
      * Case 4: Try to parse incorrect xml file.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = {java.io.InputStream.class, java.lang.String.class}
-    )
     public void test_parseLjava_io_InputStreamLjava_lang_String() {
         InputStream is = getClass().getResourceAsStream("/systemid.xml");
         // case 1: Trivial use.
@@ -547,18 +477,12 @@
     }
 
     /**
-     * @tests javax.xml.parsers.DocumentBuilder#parse(java.lang.String)
+     * javax.xml.parsers.DocumentBuilder#parse(java.lang.String)
      * Case 1: Try to parse correct xml document.
      * Case 2: Try to call parse() with null argument.
      * Case 3: Try to parse a non-existent uri.
      * Case 4: Try to parse incorrect xml file.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "parse",
-        args = {java.lang.String.class}
-    )
     public void test_parseLjava_lang_String() throws Exception {
         // case 1: Trivial use.
         URL resource = getClass().getResource("/simple.xml");
@@ -598,11 +522,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "reset",
-        args = { }
-    )
     public void testReset() {
         // Make sure EntityResolver gets reset
         InputStream source = new ByteArrayInputStream("<a>&foo;</a>".getBytes());
@@ -645,11 +564,6 @@
         assertEquals(0, logger.size());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setErrorHandler",
-        args = { ErrorHandler.class }
-    )
     public void testSetErrorHandler() {
         // Ordinary case
         InputStream source = new ByteArrayInputStream("</a>".getBytes());
@@ -684,11 +598,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setEntityResolver",
-        args = { EntityResolver.class }
-    )
     public void testSetEntityResolver() {
         // Ordinary case
         InputStream source = new ByteArrayInputStream("<a>&foo;</a>".getBytes());
diff --git a/luni/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java b/luni/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java
index 4678212..cdef4e2 100644
--- a/luni/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java
+++ b/luni/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java
@@ -18,19 +18,9 @@
 import javax.xml.parsers.FactoryConfigurationError;
 
 import junit.framework.TestCase;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
-@TestTargetClass(FactoryConfigurationError.class)
 public class FactoryConfigurationErrorTest extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "FactoryConfigurationError",
-        args = {}
-    )
     public void test_Constructor() {
         FactoryConfigurationError fce = new FactoryConfigurationError();
         assertNull(fce.getMessage());
@@ -38,12 +28,6 @@
         assertNull(fce.getCause());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "FactoryConfigurationError",
-        args = {java.lang.Exception.class}
-    )
     public void test_ConstructorLjava_lang_Exception() {
         Exception e = new Exception();
         // case 1: Try to create FactoryConfigurationError
@@ -62,12 +46,6 @@
         assertEquals(e.getCause(), fce.getCause());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "FactoryConfigurationError",
-        args = {java.lang.Exception.class, java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_ExceptionLjava_lang_String() {
         Exception e = new Exception();
         // case 1: Try to create FactoryConfigurationError
@@ -86,12 +64,6 @@
         assertEquals(e.getCause(), fce.getCause());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "FactoryConfigurationError",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         FactoryConfigurationError fce = new FactoryConfigurationError("Oops!");
         assertEquals("Oops!", fce.getMessage());
@@ -99,12 +71,6 @@
         assertNull(fce.getCause());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getException",
-        args = {}
-    )
     public void test_getException() {
         FactoryConfigurationError fce = new FactoryConfigurationError();
         assertNull(fce.getException());
@@ -118,12 +84,6 @@
         assertEquals(npe, fce.getException());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMessage",
-        args = {}
-    )
     public void test_getMessage() {
         assertNull(new FactoryConfigurationError().getMessage());
         assertEquals("msg1",
diff --git a/luni/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java b/luni/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java
index 078d3b6..d1feb9f 100644
--- a/luni/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java
+++ b/luni/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java
@@ -18,19 +18,9 @@
 import javax.xml.parsers.ParserConfigurationException;
 
 import junit.framework.TestCase;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
-@TestTargetClass(ParserConfigurationException.class)
 public class ParserConfigurationExceptionTest extends TestCase{
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ParserConfigurationException",
-        args = {}
-    )
     public void test_Constructor() {
         ParserConfigurationException pce = new ParserConfigurationException();
         assertNull(pce.getMessage());
@@ -38,12 +28,6 @@
         assertNull(pce.getCause());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ParserConfigurationException",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         ParserConfigurationException pce =
             new ParserConfigurationException("Oops!");
diff --git a/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java b/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java
index e358670..614b9d8 100644
--- a/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java
+++ b/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java
@@ -37,12 +37,7 @@
 
 import dalvik.annotation.AndroidOnly;
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
-@TestTargetClass(SAXParserFactory.class)
 public class SAXParserFactoryTest extends TestCase {
 
     SAXParserFactory spf;
@@ -70,12 +65,6 @@
         super.tearDown();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SAXParserFactory",
-        args = {}
-    )
     @AndroidOnly("Android SAX implementation is non-validating")
     public void test_Constructor() {
         MySAXParserFactory mpf = new MySAXParserFactory();
@@ -84,7 +73,7 @@
     }
 
     /**
-     * @tests javax.xml.parsers.SAXParserFactory#getSchema().
+     * javax.xml.parsers.SAXParserFactory#getSchema().
      * TBD getSchema() IS NOT SUPPORTED
      */
     /*   public void test_getSchema() {
@@ -101,20 +90,6 @@
     }
      */
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isNamespaceAware",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "setNamespaceAware",
-            args = {boolean.class}
-        )
-    })
     public void test_setIsNamespaceAware() {
         spf.setNamespaceAware(true);
         assertTrue(spf.isNamespaceAware());
@@ -124,20 +99,6 @@
         assertTrue(spf.isNamespaceAware());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isValidating",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "",
-            method = "setValidating",
-            args = {boolean.class}
-        )
-    })
     public void test_setIsValidating() {
         spf.setValidating(true);
         assertTrue(spf.isValidating());
@@ -147,20 +108,6 @@
         assertTrue(spf.isValidating());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "isXIncludeAware",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "",
-            method = "setXIncludeAware",
-            args = {boolean.class}
-        )
-    })
     public void test_setIsXIncludeAware() {
         spf.setXIncludeAware(true);
         assertTrue(spf.isXIncludeAware());
@@ -168,12 +115,6 @@
         assertFalse(spf.isXIncludeAware());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newInstance",
-        args = {}
-    )
     @KnownFailure("Dalvik doesn't honor system properties when choosing a SAX implementation")
     public void test_newInstance() {
         try {
@@ -206,12 +147,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "SAXException untested; unused on Android",
-        method = "newSAXParser",
-        args = {}
-    )
     public void test_newSAXParser() {
         // Ordinary case
         try {
@@ -233,20 +168,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            method = "setFeature",
-            notes = "ParserConfigurationException untested; unused on Android",
-            args = {java.lang.String.class, boolean.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            method = "getFeature",
-            notes = "ParserConfigurationException untested; unused on Android",
-            args = {java.lang.String.class}
-        )
-    })
     public void test_setFeatureLjava_lang_StringZ() {
         // We can't verify ParserConfigurationException and
         // SAXNotSupportedException since these are never
@@ -309,11 +230,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setNamespaceAware",
-        args = {boolean.class}
-    )
     public void test_setNamespaceAwareZ() throws Exception {
         MyHandler mh = new MyHandler();
 
diff --git a/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java b/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java
index 5bcc7ac..3586162 100644
--- a/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java
+++ b/luni/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java
@@ -16,10 +16,6 @@
 package tests.api.javax.xml.parsers;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -48,7 +44,6 @@
 import tests.support.resource.Support_Resources;
 
 @SuppressWarnings("deprecation")
-@TestTargetClass(SAXParser.class)
 public class SAXParserTest extends TestCase {
 
     private class MockSAXParser extends SAXParser {
@@ -249,12 +244,6 @@
 //        }
 //    }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "SAXParser",
-        args = {}
-    )
     public void testSAXParser() {
         try {
             new MockSAXParser();
@@ -264,7 +253,7 @@
     }
 
     /**
-     * @tests javax.xml.parser.SAXParser#getSchema().
+     * javax.xml.parser.SAXParser#getSchema().
      * TODO getSchema() IS NOT SUPPORTED
      */
     /*   public void test_getSchema() {
@@ -283,12 +272,6 @@
     }
      */
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isNamespaceAware",
-        args = {}
-    )
     public void testIsNamespaceAware() {
         try {
             spf.setNamespaceAware(true);
@@ -300,12 +283,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "No validating parser in Android, hence not tested",
-        method = "isValidating",
-        args = {}
-    )
     public void testIsValidating() {
         try {
             spf.setValidating(false);
@@ -315,12 +292,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "No XInclude-aware parser in Android, hence not tested",
-        method = "isXIncludeAware",
-        args = {}
-    )
     public void testIsXIncludeAware() {
         try {
             spf.setXIncludeAware(false);
@@ -334,12 +305,6 @@
      * @test javax.xml.parsers.SAXParser#parse(java.io.File,
      *     org.xml.sax.helpers.DefaultHandler)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify positive functionality properly; not all exceptions are verified.",
-        method = "parse",
-        args = {java.io.File.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void test_parseLjava_io_FileLorg_xml_sax_helpers_DefaultHandler()
     throws Exception {
 
@@ -376,12 +341,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Sufficient while XML parser situation is still unclear",
-        method = "parse",
-        args = {java.io.File.class, org.xml.sax.HandlerBase.class}
-    )
     public void testParseFileHandlerBase() {
         for(int i = 0; i < list_wf.length; i++) {
             try {
@@ -441,12 +400,6 @@
      * @test javax.xml.parsers.SAXParser#parse(org.xml.sax.InputSource,
      *     org.xml.sax.helpers.DefaultHandler)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify IOException.",
-        method = "parse",
-        args = {org.xml.sax.InputSource.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void test_parseLorg_xml_sax_InputSourceLorg_xml_sax_helpers_DefaultHandler()
             throws Exception {
         for(int i = 0; i < list_wf.length; i++) {
@@ -490,12 +443,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Sufficient while XML parser situation is still unclear",
-        method = "parse",
-        args = {org.xml.sax.InputSource.class, org.xml.sax.HandlerBase.class}
-    )
     public void testParseInputSourceHandlerBase() throws Exception {
         for(int i = 0; i < list_wf.length; i++) {
             HashMap<String, String> hm = sp.readFile(list_out_hb[i].getPath());
@@ -549,12 +496,6 @@
      * @test javax.xml.parsers.SAXParser#parse(java.io.InputStream,
      *     org.xml.sax.helpers.DefaultHandler)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify IOException.",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandler()
     throws Exception {
 
@@ -599,12 +540,6 @@
      * @test javax.xml.parsers.SAXParser#parse(java.io.InputStream,
      *     org.xml.sax.helpers.DefaultHandler, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify  IOException.",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.helpers.DefaultHandler.class, java.lang.String.class}
-    )
     @KnownFailure("We supply optional qnames, but this test doesn't expect them")
     public void test_parseLjava_io_InputStreamLorg_xml_sax_helpers_DefaultHandlerLjava_lang_String() {
         for(int i = 0; i < list_wf.length; i++) {
@@ -715,12 +650,6 @@
 //        }*/
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Sufficient while XML parser situation is still unclear",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.HandlerBase.class}
-    )
     public void testParseInputStreamHandlerBase() throws Exception {
         for(int i = 0; i < list_wf.length; i++) {
             HashMap<String, String> hm = sp.readFile(list_out_hb[i].getPath());
@@ -762,12 +691,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Sufficient while XML parser situation is still unclear",
-        method = "parse",
-        args = {java.io.InputStream.class, org.xml.sax.HandlerBase.class, java.lang.String.class}
-    )
     public void testParseInputStreamHandlerBaseString() throws Exception {
         for(int i = 0; i < list_wf.length; i++) {
             HashMap<String, String> hm = sp.readFile(list_out_hb[i].getPath());
@@ -812,12 +735,6 @@
      * @test javax.xml.parsers.SAXParser#parse(java.lang.String,
      *     org.xml.sax.helpers.DefaultHandler)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify IOException.",
-        method = "parse",
-        args = {java.lang.String.class, org.xml.sax.helpers.DefaultHandler.class}
-    )
     public void test_parseLjava_lang_StringLorg_xml_sax_helpers_DefaultHandler()
     throws Exception {
 
@@ -855,12 +772,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Sufficient while XML parser situation is still unclear",
-        method = "parse",
-        args = {java.lang.String.class, org.xml.sax.HandlerBase.class}
-    )
     public void testParseStringHandlerBase() {
         for(int i = 0; i < list_wf.length; i++) {
             try {
@@ -916,11 +827,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "reset",
-        args = { }
-    )
     public void testReset() {
         try {
             spf = SAXParserFactory.newInstance();
@@ -934,11 +840,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getParser",
-        args = { }
-    )
     public void testGetParser() {
         spf = SAXParserFactory.newInstance();
         try {
@@ -949,11 +850,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getXMLReader",
-        args = { }
-    )
     public void testGetReader() {
         spf = SAXParserFactory.newInstance();
         try {
@@ -964,18 +860,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getProperty",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setProperty",
-            args = { String.class, Object.class }
-        )
-    })
     public void testSetGetProperty() {
         // Ordinary case
         String validName = "http://xml.org/sax/properties/lexical-handler";
diff --git a/luni/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java b/luni/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java
deleted file mode 100644
index ccb8e29..0000000
--- a/luni/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.org.apache.harmony.kernel.dalvik;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static final Test suite() {
-        TestSuite suite = new TestSuite();
-        suite.addTestSuite(tests.api.org.apache.harmony.kernel.dalvik.ThreadsTest.class);
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/org/xml/sax/AllTests.java b/luni/src/test/java/tests/api/org/xml/sax/AllTests.java
deleted file mode 100644
index 96661f4..0000000
--- a/luni/src/test/java/tests/api/org/xml/sax/AllTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.org.xml.sax;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for org.xml.sax package");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(HandlerBaseTest.class);
-        suite.addTestSuite(InputSourceTest.class);
-        suite.addTestSuite(SAXExceptionTest.class);
-        suite.addTestSuite(SAXNotRecognizedExceptionTest.class);
-        suite.addTestSuite(SAXNotSupportedExceptionTest.class);
-        suite.addTestSuite(SAXParseExceptionTest.class);
-
-        suite.addTest(tests.api.org.xml.sax.ext.AllTests.suite());
-        suite.addTest(tests.api.org.xml.sax.helpers.AllTests.suite());
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/org/xml/sax/HandlerBaseTest.java b/luni/src/test/java/tests/api/org/xml/sax/HandlerBaseTest.java
index 25d1d43..8dfe38b 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/HandlerBaseTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/HandlerBaseTest.java
@@ -16,10 +16,6 @@
 
 package tests.api.org.xml.sax;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.xml.sax.AttributeList;
@@ -30,7 +26,6 @@
 import org.xml.sax.helpers.LocatorImpl;
 
 @SuppressWarnings("deprecation")
-@TestTargetClass(HandlerBase.class)
 public class HandlerBaseTest extends TestCase {
 
     /*
@@ -40,11 +35,6 @@
 
     private HandlerBase h = new HandlerBase();
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "resolveEntity",
-        args = { String.class, String.class }
-    )
     public void testResolveEntity() {
         try {
             h.resolveEntity("publicID", "systemID");
@@ -53,38 +43,18 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "notationDecl",
-        args = { String.class, String.class, String.class }
-    )
     public void testNotationDecl() {
         h.notationDecl("name", "publicID", "systemID");
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "unparsedEntityDecl",
-        args = { String.class, String.class, String.class, String.class }
-    )
     public void testUnparsedEntityDecl() {
         h.unparsedEntityDecl("name", "publicID", "systemID", "notationName");
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDocumentLocator",
-        args = { org.xml.sax.Locator.class }
-    )
     public void testSetDocumentLocator() {
         h.setDocumentLocator(new LocatorImpl());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startDocument",
-        args = { }
-    )
     public void testStartDocument() {
         try {
             h.startDocument();
@@ -93,11 +63,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endDocument",
-        args = { }
-    )
     public void testEndDocument() {
         try {
             h.endDocument();
@@ -106,11 +71,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startElement",
-        args = { String.class, AttributeList.class }
-    )
     public void testStartElement() {
         try {
             h.startElement("name", new AttributeListImpl());
@@ -119,11 +79,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endElement",
-        args = { String.class }
-    )
     public void testEndElement() {
         try {
             h.endElement("name");
@@ -132,11 +87,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "characters",
-        args = { char[].class, int.class, int.class }
-    )
     public void testCharacters() {
         try {
             h.characters("The quick brown fox".toCharArray(), 4, 11);
@@ -145,11 +95,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ignorableWhitespace",
-        args = { char[].class, int.class, int.class }
-    )
     public void testIgnorableWhitespace() {
         try {
             h.ignorableWhitespace("                   ".toCharArray(), 4, 11);
@@ -158,11 +103,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "processingInstruction",
-        args = { String.class, String.class }
-    )
     public void testProcessingInstruction() {
         try {
             h.processingInstruction("target", "data");
@@ -171,11 +111,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "warning",
-        args = { org.xml.sax.SAXParseException.class }
-    )
     public void testWarning() {
         try {
             h.warning(new SAXParseException("Foo", new LocatorImpl()));
@@ -184,11 +119,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "error",
-        args = { org.xml.sax.SAXParseException.class }
-    )
     public void testError() {
         try {
             h.error(new SAXParseException("Foo", new LocatorImpl()));
@@ -197,11 +127,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "fatalError",
-        args = { org.xml.sax.SAXParseException.class }
-    )
     public void testFatalError() {
         // Ordinary case
         try {
diff --git a/luni/src/test/java/tests/api/org/xml/sax/InputSourceTest.java b/luni/src/test/java/tests/api/org/xml/sax/InputSourceTest.java
index ccb807e..f9040f0 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/InputSourceTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/InputSourceTest.java
@@ -25,19 +25,8 @@
 
 import org.xml.sax.InputSource;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-@TestTargetClass(InputSource.class)
 public class InputSourceTest extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "InputSource",
-        args = { }
-    )
     public void testInputSource() {
         InputSource i = new InputSource();
 
@@ -48,11 +37,6 @@
         assertNull(i.getSystemId());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "InputSource",
-        args = { String.class }
-    )
     public void testInputSourceString() {
         InputSource i = new InputSource("Foo");
 
@@ -63,11 +47,6 @@
         assertEquals("Foo", i.getSystemId());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "InputSource",
-        args = { InputStream.class }
-    )
     public void testInputSourceInputStream() {
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
 
@@ -90,11 +69,6 @@
         assertNull(i.getSystemId());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "InputSource",
-        args = { Reader.class }
-    )
     public void testInputSourceReader() {
         StringReader sr = new StringReader("Hello, world.");
 
@@ -117,18 +91,6 @@
         assertNull(i.getSystemId());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setPublicId",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getPublicId",
-            args = {  }
-        )
-    })
     public void testSetPublicIdGetPublicId() {
         InputSource i = new InputSource();
 
@@ -139,18 +101,6 @@
         assertNull(i.getPublicId());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setSystemId",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getSystemId",
-            args = {  }
-        )
-    })
     public void testSetSystemIdGetSystemId() {
         InputSource i = new InputSource();
 
@@ -161,18 +111,6 @@
         assertNull(i.getSystemId());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setByteStream",
-            args = { InputStream.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getByteStream",
-            args = {  }
-        )
-    })
     public void testSetByteStreamGetByteStream() {
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[0]);
 
@@ -189,18 +127,6 @@
         assertNull(i.getByteStream());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setEncoding",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getEncoding",
-            args = {  }
-        )
-    })
     public void testSetEncodingGetEncoding() {
         InputSource i = new InputSource();
 
@@ -215,18 +141,6 @@
         assertNull(i.getEncoding());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setCharacterStream",
-            args = { Reader.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getCharacterStream",
-            args = {  }
-        )
-    })
     public void testSetCharacterStreamGetCharacterStream() {
         StringReader sr = new StringReader("Hello, world.");
 
diff --git a/luni/src/test/java/tests/api/org/xml/sax/SAXExceptionTest.java b/luni/src/test/java/tests/api/org/xml/sax/SAXExceptionTest.java
index 6d2eceb..11d00e7 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/SAXExceptionTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/SAXExceptionTest.java
@@ -21,20 +21,10 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-@TestTargetClass(SAXException.class)
 public class SAXExceptionTest extends TestCase {
 
     public static final String ERR = "Houston, we have a problem";
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXException",
-        args = { }
-    )
     public void testSAXParseException() {
         SAXException e = new SAXException();
 
@@ -42,11 +32,6 @@
         assertNull(e.getException());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXException",
-        args = { String.class, Exception.class }
-    )
     public void testSAXException_String_Exception() {
         Exception c = new Exception();
 
@@ -69,11 +54,6 @@
         assertNull(e.getException());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXException",
-        args = { String.class }
-    )
     public void testSAXException_String() {
         // Ordinary case
         SAXException e = new SAXException(ERR);
@@ -88,11 +68,6 @@
         assertNull(e.getException());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXException",
-        args = { Exception.class }
-    )
     public void testSAXException_Exception() {
         Exception c = new Exception();
 
@@ -109,11 +84,6 @@
         assertNull(e.getException());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "toString",
-        args = { }
-    )
     public void testToString() {
         // Ordinary case
         SAXException e = new SAXException(ERR);
@@ -128,4 +98,4 @@
         assertFalse(s.contains(ERR));
    }
 
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/org/xml/sax/SAXNotRecognizedExceptionTest.java b/luni/src/test/java/tests/api/org/xml/sax/SAXNotRecognizedExceptionTest.java
index da86cc8..3c73b56 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/SAXNotRecognizedExceptionTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/SAXNotRecognizedExceptionTest.java
@@ -20,30 +20,15 @@
 
 import org.xml.sax.SAXNotRecognizedException;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-@TestTargetClass(SAXNotRecognizedException.class)
 public class SAXNotRecognizedExceptionTest extends TestCase {
 
     public static final String ERR = "Houston, we have a problem";
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXNotRecognizedException",
-        args = { }
-    )
     public void testSAXNotRecognizedException() {
         SAXNotRecognizedException e = new SAXNotRecognizedException();
         assertNull(e.getMessage());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXNotRecognizedException",
-        args = { String.class }
-    )
     public void testSAXNotRecognizedException_String() {
         SAXNotRecognizedException e = new SAXNotRecognizedException(ERR);
         assertEquals(ERR, e.getMessage());
diff --git a/luni/src/test/java/tests/api/org/xml/sax/SAXNotSupportedExceptionTest.java b/luni/src/test/java/tests/api/org/xml/sax/SAXNotSupportedExceptionTest.java
index c51d280..71ea455 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/SAXNotSupportedExceptionTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/SAXNotSupportedExceptionTest.java
@@ -16,34 +16,19 @@
 
 package tests.api.org.xml.sax;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.xml.sax.SAXNotSupportedException;
 
-@TestTargetClass(SAXNotSupportedException.class)
 public class SAXNotSupportedExceptionTest extends TestCase {
 
     public static final String ERR = "Houston, we have a problem";
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXNotSupportedException",
-        args = { }
-    )
     public void testSAXNotSupportedException() {
         SAXNotSupportedException e = new SAXNotSupportedException();
         assertNull(e.getMessage());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXNotSupportedException",
-        args = { String.class }
-    )
     public void testSAXNotSupportedException_String() {
         SAXNotSupportedException e = new SAXNotSupportedException(ERR);
         assertEquals(ERR, e.getMessage());
diff --git a/luni/src/test/java/tests/api/org/xml/sax/SAXParseExceptionTest.java b/luni/src/test/java/tests/api/org/xml/sax/SAXParseExceptionTest.java
index 235c432..bfc48d4 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/SAXParseExceptionTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/SAXParseExceptionTest.java
@@ -22,12 +22,6 @@
 import org.xml.sax.SAXParseException;
 import org.xml.sax.helpers.LocatorImpl;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-@TestTargetClass(SAXParseException.class)
 public class SAXParseExceptionTest extends TestCase {
 
     public static final String ERR = "Houston, we have a problem";
@@ -40,43 +34,6 @@
 
     public static final int COL = 2;
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "SAXParseException",
-            args = { String.class, Locator.class, Exception.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getMessage",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getException",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getPublicId",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getSystemId",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getLineNumber",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getColumnNumber",
-            args = { }
-        )
-    })
     public void testSAXParseException_String_Locator_Exception() {
         LocatorImpl l = new LocatorImpl();
         l.setPublicId(PUB);
@@ -131,11 +88,6 @@
         assertEquals(COL, e.getColumnNumber());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXParseException",
-        args = { String.class, Locator.class }
-    )
     public void testSAXParseException_String_Locator() {
         LocatorImpl l = new LocatorImpl();
         l.setPublicId(PUB);
@@ -178,12 +130,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXParseException",
-        args = { String.class, String.class, String.class, int.class, int.class,
-                 Exception.class }
-    )
     public void testSAXParseException_String_String_String_int_int_Exception() {
         Exception c = new Exception();
 
@@ -232,12 +178,6 @@
         assertEquals(COL, e.getColumnNumber());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "SAXParseException",
-        args = { String.class, String.class, String.class, int.class,
-                 int.class }
-        )
     public void testSAXParseException_String_String_String_int_int() {
         // Ordinary case
         SAXParseException e = new SAXParseException(ERR, PUB, SYS, ROW, COL);
@@ -273,4 +213,4 @@
         assertEquals(-1, e.getColumnNumber());
     }
 
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/api/org/xml/sax/ext/AllTests.java b/luni/src/test/java/tests/api/org/xml/sax/ext/AllTests.java
deleted file mode 100644
index 1334780..0000000
--- a/luni/src/test/java/tests/api/org/xml/sax/ext/AllTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.org.xml.sax.ext;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for org.xml.sax.ext package");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(Attributes2ImplTest.class);
-        suite.addTestSuite(DefaultHandler2Test.class);
-        suite.addTestSuite(Locator2ImplTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/org/xml/sax/ext/Attributes2ImplTest.java b/luni/src/test/java/tests/api/org/xml/sax/ext/Attributes2ImplTest.java
index e236ba1..348bef5 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/ext/Attributes2ImplTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/ext/Attributes2ImplTest.java
@@ -22,12 +22,6 @@
 import org.xml.sax.ext.Attributes2Impl;
 import org.xml.sax.helpers.AttributesImpl;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-@TestTargetClass(Attributes2Impl.class)
 public class Attributes2ImplTest extends TestCase {
 
     // Note: The original SAX2 implementation of Attributes2Impl is
@@ -67,11 +61,6 @@
                 "CDATA", "hey");
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setAttributes",
-        args = { Attributes.class }
-    )
     public void testSetAttributes() {
         // Ordinary case with Attributes2Impl
         Attributes2Impl attrs = new Attributes2Impl();
@@ -123,12 +112,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "addAttribute",
-        args = { String.class, String.class, String.class, String.class,
-                 String.class }
-    )
     public void testAddAttribute() {
         Attributes2Impl attrs = new Attributes2Impl();
 
@@ -163,11 +146,6 @@
         assertEquals(true, attrs.isSpecified(1));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "removeAttribute",
-        args = { int.class }
-    )
     public void testRemoveAttribute() {
         Attributes2Impl attrs = new Attributes2Impl(multi);
 
@@ -208,20 +186,10 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "Attributes2Impl",
-        args = {  }
-    )
     public void testAttributes2Impl() {
         assertEquals(0, empty.getLength());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "Attributes2Impl",
-        args = { Attributes.class }
-    )
     public void testAttributes2ImplAttributes() {
         // Ordinary case with Attributes2Impl
         Attributes2Impl attrs = new Attributes2Impl(multi);
@@ -269,11 +237,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "isDeclared",
-        args = { int.class }
-    )
     public void testIsDeclaredInt() {
         // Ordinary cases
         assertEquals(false, multi.isDeclared(0));
@@ -295,11 +258,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "isDeclared",
-        args = { String.class, String.class }
-    )
     public void testIsDeclaredStringString() {
         // Ordinary cases
         assertEquals(false, multi.isDeclared("http://some.uri", "foo"));
@@ -314,11 +272,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "isDeclared",
-        args = { String.class }
-    )
     public void testIsDeclaredString() {
         // Ordinary cases
         assertEquals(false, multi.isDeclared("ns1:foo"));
@@ -333,11 +286,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "isSpecified",
-        args = { int.class }
-    )
     public void testIsSpecifiedInt() {
         // Ordinary cases
         assertEquals(false, multi.isSpecified(1));
@@ -359,11 +307,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "isSpecified",
-        args = { String.class, String.class }
-    )
     public void testIsSpecifiedStringString() {
         // Ordinary cases
         assertEquals(false, multi.isSpecified("http://some.uri", "bar"));
@@ -378,11 +321,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "isSpecified",
-        args = { String.class }
-    )
     public void testIsSpecifiedString() {
         // Ordinary cases
         assertEquals(false, multi.isSpecified("ns1:bar"));
@@ -397,11 +335,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDeclared",
-        args = { int.class, boolean.class }
-    )
     public void testSetDeclared() {
         // Ordinary cases
         multi.setSpecified(0, false);
@@ -429,11 +362,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setSpecified",
-        args = { int.class, boolean.class }
-    )
     public void testSetSpecified() {
         // Ordinary cases
         multi.setSpecified(0, false);
diff --git a/luni/src/test/java/tests/api/org/xml/sax/ext/DefaultHandler2Test.java b/luni/src/test/java/tests/api/org/xml/sax/ext/DefaultHandler2Test.java
index e8ee71b..0e6c245 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/ext/DefaultHandler2Test.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/ext/DefaultHandler2Test.java
@@ -16,10 +16,6 @@
 
 package tests.api.org.xml.sax.ext;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.xml.sax.SAXException;
@@ -27,25 +23,14 @@
 
 import java.io.IOException;
 
-@TestTargetClass(DefaultHandler2.class)
 public class DefaultHandler2Test extends TestCase {
 
     private DefaultHandler2 h = new DefaultHandler2();
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "DefaultHandler2",
-        args = { }
-    )
     public void testDefaultHandler2() {
         new DefaultHandler2();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startCDATA",
-        args = { }
-    )
     public void testStartCDATA() {
         try {
             h.startCDATA();
@@ -54,11 +39,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endCDATA",
-        args = { }
-    )
     public void testEndCDATA() {
         try {
             h.endCDATA();
@@ -67,11 +47,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startDTD",
-        args = { String.class, String.class, String.class }
-    )
     public void testStartDTD() {
         try {
             h.startDTD("name", "publicId", "systemId");
@@ -80,11 +55,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endDTD",
-        args = { }
-    )
     public void testEndDTD() {
         try {
             h.endDTD();
@@ -93,11 +63,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startEntity",
-        args = { String.class }
-    )
     public void testStartEntity() {
         try {
             h.startEntity("name");
@@ -106,11 +71,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endEntity",
-        args = { String.class }
-    )
     public void testEndEntity() {
         try {
             h.endEntity("name");
@@ -119,11 +79,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "comment",
-        args = { char[].class, int.class, int.class }
-    )
     public void testComment() {
         try {
             h.comment("<!-- Comment -->".toCharArray(), 0, 15);
@@ -132,12 +87,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "attributeDecl",
-        args = { String.class, String.class, String.class, String.class,
-                 String.class }
-    )
     public void testAttributeDecl() {
         try {
             h.attributeDecl("eName", "aName", "type", "mode", "value");
@@ -146,11 +95,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "elementDecl",
-        args = { String.class, String.class }
-    )
     public void testElementDecl() {
         try {
             h.elementDecl("name", "model");
@@ -159,11 +103,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "externalEntityDecl",
-        args = { String.class, String.class, String.class }
-    )
     public void testExternalEntityDecl() {
         try {
             h.externalEntityDecl("name", "publicId", "systemId");
@@ -172,11 +111,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "internalEntityDecl",
-        args = { String.class, String.class }
-    )
     public void testInternalEntityDecl() {
         try {
             h.internalEntityDecl("name", "value");
@@ -185,11 +119,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getExternalSubset",
-        args = { String.class, String.class }
-    )
     public void testGetExternalSubset() {
         try {
             assertNull(h.getExternalSubset("name", "http://some.uri"));
@@ -200,11 +129,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "resolveEntity",
-        args = { String.class, String.class }
-    )
     public void testResolveEntityStringString() {
         try {
             assertNull(h.resolveEntity("publicId", "systemId"));
@@ -215,11 +139,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "resolveEntity",
-        args = { String.class, String.class, String.class, String.class }
-    )
     public void testResolveEntityStringStringStringString() {
         try {
             assertNull(h.resolveEntity("name", "publicId", "http://some.uri",
diff --git a/luni/src/test/java/tests/api/org/xml/sax/ext/Locator2ImplTest.java b/luni/src/test/java/tests/api/org/xml/sax/ext/Locator2ImplTest.java
index c696a26..dbed1de 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/ext/Locator2ImplTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/ext/Locator2ImplTest.java
@@ -16,18 +16,12 @@
 
 package tests.api.org.xml.sax.ext;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.xml.sax.Locator;
 import org.xml.sax.ext.Locator2Impl;
 import org.xml.sax.helpers.LocatorImpl;
 
-@TestTargetClass(Locator2Impl.class)
 public class Locator2ImplTest extends TestCase {
 
     public static final String SYS = "mySystemID";
@@ -42,11 +36,6 @@
 
     public static final String XML = "1.0";
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "Locator2Impl",
-        args = { }
-    )
     public void testLocatorImpl() {
         Locator2Impl l = new Locator2Impl();
 
@@ -59,11 +48,6 @@
         assertEquals(null, l.getXMLVersion());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "Locator2Impl",
-        args = { Locator.class }
-    )
     public void testLocatorImplLocator() {
         Locator2Impl inner = new Locator2Impl();
 
@@ -106,18 +90,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setXMLVersion",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getXMLVersion",
-            args = { }
-        )
-    })
     public void testSetXMLVersionGetXMLVersion() {
         Locator2Impl l = new Locator2Impl();
 
@@ -128,18 +100,6 @@
         assertEquals(null, l.getXMLVersion());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setEncoding",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getEncoding",
-            args = { }
-        )
-    })
     public void testSetEncodingGetEncoding() {
         Locator2Impl l = new Locator2Impl();
 
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/AllTests.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/AllTests.java
deleted file mode 100644
index 135496c..0000000
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/AllTests.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.org.xml.sax.helpers;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for org.xml.sax.helpers package");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AttributeListImplTest.class);
-        suite.addTestSuite(AttributesImplTest.class);
-        suite.addTestSuite(ParserFactoryTest.class);
-        suite.addTestSuite(DefaultHandlerTest.class);
-        suite.addTestSuite(LocatorImplTest.class);
-        suite.addTestSuite(NamespaceSupportTest.class);
-        suite.addTestSuite(XMLFilterImplTest.class);
-        suite.addTestSuite(XMLReaderAdapterTest.class);
-        suite.addTestSuite(XMLReaderFactoryTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributeListImplTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributeListImplTest.java
index c091225..27f36ae 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributeListImplTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributeListImplTest.java
@@ -21,12 +21,7 @@
 import org.xml.sax.AttributeList;
 import org.xml.sax.helpers.AttributeListImpl;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 @SuppressWarnings("deprecation")
-@TestTargetClass(AttributeListImpl.class)
 public class AttributeListImplTest extends TestCase {
 
     private AttributeListImpl empty = new AttributeListImpl();
@@ -40,21 +35,11 @@
         multi.addAttribute("answer", "int", "42");
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "AttributeListImpl",
-        args = { }
-    )
     public void testAttributeListImpl() {
         assertEquals(0, empty.getLength());
         assertEquals(3, multi.getLength());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "AttributeListImpl",
-        args = { AttributeList.class }
-    )
     public void testAttributeListImplAttributeList() {
         // Ordinary case
         AttributeListImpl ai = new AttributeListImpl(empty);
@@ -74,11 +59,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setAttributeList",
-        args = { AttributeList.class }
-    )
     public void testSetAttributeList() {
         // Ordinary cases
         AttributeListImpl attrs = new AttributeListImpl();
@@ -106,11 +86,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "addAttribute",
-        args = { String.class, String.class, String.class }
-    )
     public void testAddAttribute() {
         // Ordinary case
         multi.addAttribute("doe", "boolean", "false");
@@ -133,11 +108,6 @@
         assertEquals(null, multi.getValue(5));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "removeAttribute",
-        args = { String.class }
-    )
     public void testRemoveAttribute() {
         // Ordinary case
         multi.removeAttribute("foo");
@@ -154,22 +124,12 @@
         assertEquals(2, multi.getLength());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "clear",
-        args = { }
-    )
     public void testClear() {
         assertEquals(3, multi.getLength());
         multi.clear();
         assertEquals(0, multi.getLength());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getLength",
-        args = { }
-    )
     public void testGetLength() {
         AttributeListImpl ai = new AttributeListImpl(empty);
         assertEquals(0, ai.getLength());
@@ -183,11 +143,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getName",
-        args = { int.class }
-    )
     public void testGetName() {
         // Ordinary cases
         assertEquals("foo", multi.getName(0));
@@ -199,11 +154,6 @@
         assertEquals(null, multi.getName(3));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getType",
-        args = { int.class }
-    )
     public void testGetTypeInt() {
         // Ordinary cases
         assertEquals("string", multi.getType(0));
@@ -215,11 +165,6 @@
         assertEquals(null, multi.getType(3));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getValue",
-        args = { int.class }
-    )
     public void testGetValueInt() {
         // Ordinary cases
         assertEquals("abc", multi.getValue(0));
@@ -231,11 +176,6 @@
         assertEquals(null, multi.getValue(5));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getType",
-        args = { String.class }
-    )
     public void testGetTypeString() {
         // Ordinary cases
         assertEquals("string", multi.getType("foo"));
@@ -249,11 +189,6 @@
         assertEquals(null, multi.getType(null));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getValue",
-        args = { String.class }
-    )
     public void testGetValueString() {
         // Ordinary cases
         assertEquals("abc", multi.getValue("foo"));
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributesImplTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributesImplTest.java
index 409d52b..1cc77ee 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributesImplTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/AttributesImplTest.java
@@ -21,11 +21,6 @@
 import org.xml.sax.Attributes;
 import org.xml.sax.helpers.AttributesImpl;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-@TestTargetClass(AttributesImpl.class)
 public class AttributesImplTest extends TestCase {
 
     private AttributesImpl empty = new AttributesImpl();
@@ -45,21 +40,11 @@
         multi.addAttribute("", "", "gabba:hey", "string", "1-2-3-4");
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "AttributesImpl",
-        args = { }
-    )
     public void testAttributesImpl() {
         assertEquals(0, empty.getLength());
         assertEquals(5, multi.getLength());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "AttributesImpl",
-        args = { Attributes.class }
-    )
     public void testAttributesImplAttributes() {
         // Ordinary case
         AttributesImpl ai = new AttributesImpl(empty);
@@ -79,11 +64,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getLength",
-        args = { }
-    )
     public void testGetLength() {
         AttributesImpl ai = new AttributesImpl(empty);
         assertEquals(0, ai.getLength());
@@ -97,11 +77,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getURI",
-        args = { int.class }
-    )
     public void testGetURI() {
         // Ordinary cases
         assertEquals("http://some.uri", multi.getURI(0));
@@ -115,11 +90,6 @@
         assertEquals(null, multi.getURI(5));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getLocalName",
-        args = { int.class }
-    )
     public void testGetLocalName() {
         // Ordinary cases
         assertEquals("foo", multi.getLocalName(0));
@@ -133,11 +103,6 @@
         assertEquals(null, multi.getLocalName(5));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getQName",
-        args = { int.class }
-    )
     public void testGetQName() {
         // Ordinary cases
         assertEquals("ns1:foo", multi.getQName(0));
@@ -151,11 +116,6 @@
         assertEquals(null, multi.getQName(5));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getType",
-        args = { int.class }
-    )
     public void testGetTypeInt() {
         // Ordinary cases
         assertEquals("string", multi.getType(0));
@@ -169,11 +129,6 @@
         assertEquals(null, multi.getType(5));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getValue",
-        args = { int.class }
-    )
     public void testGetValueInt() {
         // Ordinary cases
         assertEquals("abc", multi.getValue(0));
@@ -187,11 +142,6 @@
         assertEquals(null, multi.getValue(5));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getIndex",
-        args = { String.class, String.class }
-    )
     public void testGetIndexStringString() {
         // Ordinary cases
         assertEquals(0, multi.getIndex("http://some.uri", "foo"));
@@ -206,11 +156,6 @@
         assertEquals(-1, multi.getIndex(null, "foo"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getIndex",
-        args = { String.class }
-    )
     public void testGetIndexString() {
         // Ordinary cases
         assertEquals(0, multi.getIndex("ns1:foo"));
@@ -225,11 +170,6 @@
         assertEquals(-1, multi.getIndex(null));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getType",
-        args = { String.class, String.class }
-    )
     public void testGetTypeStringString() {
         // Ordinary cases
         assertEquals("string", multi.getType("http://some.uri", "foo"));
@@ -244,11 +184,6 @@
         assertEquals(null, multi.getType(null, "foo"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getType",
-        args = { String.class }
-    )
     public void testGetTypeString() {
         // Ordinary cases
         assertEquals("string", multi.getType("ns1:foo"));
@@ -263,11 +198,6 @@
         assertEquals(null, multi.getType(null));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getValue",
-        args = { String.class, String.class }
-    )
     public void testGetValueStringString() {
         // Ordinary cases
         assertEquals("abc", multi.getValue("http://some.uri", "foo"));
@@ -282,11 +212,6 @@
         assertEquals(null, multi.getValue(null, "foo"));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getValue",
-        args = { String.class }
-    )
     public void testGetValueString() {
         // Ordinary cases
         assertEquals("abc", multi.getValue("ns1:foo"));
@@ -301,22 +226,12 @@
         assertEquals(null, multi.getValue(null));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "clear",
-        args = { }
-    )
     public void testClear() {
         assertEquals(5, multi.getLength());
         multi.clear();
         assertEquals(0, multi.getLength());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setAttributes",
-        args = { Attributes.class }
-    )
     public void testSetAttributes() {
         // Ordinary cases
         AttributesImpl attrs = new AttributesImpl();
@@ -347,12 +262,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "addAttribute",
-        args = { String.class, String.class, String.class, String.class,
-                 String.class }
-    )
     public void testAddAttribute() {
         // Ordinary case
         multi.addAttribute("http://yet.another.uri", "doe", "john:doe",
@@ -383,12 +292,6 @@
         assertEquals(null, multi.getValue(7));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setAttribute",
-        args = { int.class, String.class, String.class, String.class,
-                 String.class, String.class }
-    )
     public void testSetAttribute() {
         // Ordinary case
         multi.setAttribute(0, "http://yet.another.uri", "doe", "john:doe",
@@ -425,11 +328,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "removeAttribute",
-        args = { int.class }
-    )
     public void testRemoveAttribute() {
         // Ordinary case
         multi.removeAttribute(0);
@@ -455,11 +353,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setURI",
-        args = { int.class, String.class }
-    )
     public void testSetURI() {
         // Ordinary case
         multi.setURI(0, "http://yet.another.uri");
@@ -485,11 +378,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setLocalName",
-        args = { int.class, String.class }
-    )
     public void testSetLocalName() {
         // Ordinary case
         multi.setLocalName(0, "john");
@@ -515,11 +403,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setQName",
-        args = { int.class, String.class }
-    )
     public void testSetQName() {
         // Ordinary case
         multi.setQName(0, "john:doe");
@@ -545,11 +428,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setType",
-        args = { int.class, String.class }
-    )
     public void testSetType() {
         // Ordinary case
         multi.setType(0, "float");
@@ -575,11 +453,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setValue",
-        args = { int.class, String.class }
-    )
     public void testSetValue() {
         // Ordinary case
         multi.setValue(0, "too much");
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/DefaultHandlerTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/DefaultHandlerTest.java
index 7cc0e70..a9530f2 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/DefaultHandlerTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/DefaultHandlerTest.java
@@ -16,10 +16,6 @@
 
 package tests.api.org.xml.sax.helpers;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.xml.sax.Attributes;
@@ -31,7 +27,6 @@
 
 import java.io.IOException;
 
-@TestTargetClass(DefaultHandler.class)
 public class DefaultHandlerTest extends TestCase {
 
     /*
@@ -41,11 +36,6 @@
 
     private DefaultHandler h = new DefaultHandler();
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "resolveEntity",
-        args = { String.class, String.class }
-    )
     public void testResolveEntity() {
         try {
             h.resolveEntity("publicID", "systemID");
@@ -56,11 +46,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "notationDecl",
-        args = { String.class, String.class, String.class }
-    )
     public void testNotationDecl() {
         try {
             h.notationDecl("name", "publicID", "systemID");
@@ -69,11 +54,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "unparsedEntityDecl",
-        args = { String.class, String.class, String.class, String.class }
-    )
     public void testUnparsedEntityDecl() {
         try {
             h.unparsedEntityDecl("name", "publicID", "systemID",
@@ -83,20 +63,10 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDocumentLocator",
-        args = { org.xml.sax.Locator.class }
-    )
     public void testSetDocumentLocator() {
         h.setDocumentLocator(new LocatorImpl());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startDocument",
-        args = { }
-    )
     public void testStartDocument() {
         try {
             h.startDocument();
@@ -105,11 +75,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endDocument",
-        args = { }
-    )
     public void testEndDocument() {
         try {
             h.endDocument();
@@ -118,11 +83,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startPrefixMapping",
-        args = { String.class, String.class }
-    )
     public void testStartPrefixMapping() {
         try {
             h.startPrefixMapping("prefix", "uri");
@@ -131,11 +91,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endPrefixMapping",
-        args = { String.class }
-    )
     public void testEndPrefixMapping() {
         try {
             h.endPrefixMapping("prefix");
@@ -144,12 +99,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startElement",
-        args = { String.class, String.class, String.class,
-                 Attributes.class }
-    )
     public void testStartElement() {
         try {
             h.startElement("uri", "name", "qname", new AttributesImpl());
@@ -158,11 +107,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endElement",
-        args = { String.class, String.class, String.class }
-    )
     public void testEndElement() {
         try {
             h.endElement("uri", "name", "qname");
@@ -171,11 +115,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "characters",
-        args = { char[].class, int.class, int.class }
-    )
     public void testCharacters() {
         try {
             h.characters("The quick brown fox".toCharArray(), 4, 11);
@@ -184,11 +123,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ignorableWhitespace",
-        args = { char[].class, int.class, int.class }
-    )
     public void testIgnorableWhitespace() {
         try {
             h.ignorableWhitespace("                   ".toCharArray(), 4, 11);
@@ -197,11 +131,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "processingInstruction",
-        args = { String.class, String.class }
-    )
     public void testProcessingInstruction() {
         try {
             h.processingInstruction("target", "data");
@@ -210,11 +139,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "skippedEntity",
-        args = { String.class }
-    )
     public void testSkippedEntity() {
         try {
             h.skippedEntity("name");
@@ -223,11 +147,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "warning",
-        args = { org.xml.sax.SAXParseException.class }
-    )
     public void testWarning() {
         try {
             h.warning(new SAXParseException("Foo", new LocatorImpl()));
@@ -236,11 +155,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "error",
-        args = { org.xml.sax.SAXParseException.class }
-    )
     public void testError() {
         try {
             h.error(new SAXParseException("Foo", new LocatorImpl()));
@@ -249,11 +163,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "fatalError",
-        args = { org.xml.sax.SAXParseException.class }
-    )
     public void testFatalError() {
         // Ordinary case
         try {
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/LocatorImplTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/LocatorImplTest.java
index 40dab3f..8aa9c11 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/LocatorImplTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/LocatorImplTest.java
@@ -21,12 +21,6 @@
 import org.xml.sax.Locator;
 import org.xml.sax.helpers.LocatorImpl;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-@TestTargetClass(LocatorImpl.class)
 public class LocatorImplTest extends TestCase {
 
     public static final String SYS = "mySystemID";
@@ -37,11 +31,6 @@
 
     public static final int COL = 2;
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "LocatorImpl",
-        args = { }
-    )
     public void testLocatorImpl() {
         LocatorImpl l = new LocatorImpl();
 
@@ -51,11 +40,6 @@
         assertEquals(0, l.getColumnNumber());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "LocatorImpl",
-        args = { Locator.class }
-    )
     public void testLocatorImplLocator() {
         LocatorImpl inner = new LocatorImpl();
 
@@ -81,18 +65,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setPublicId",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getPublicId",
-            args = { }
-        )
-    })
     public void testSetPublicIdGetPublicId() {
         LocatorImpl l = new LocatorImpl();
 
@@ -103,18 +75,6 @@
         assertEquals(null, l.getPublicId());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setSystemId",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getSystemId",
-            args = { }
-        )
-    })
     public void testSetSystemIdGetSystemId() {
         LocatorImpl l = new LocatorImpl();
 
@@ -125,18 +85,6 @@
         assertEquals(null, l.getSystemId());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setLineNumber",
-            args = { int.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getLineNumber",
-            args = { }
-        )
-    })
     public void testSetLineNumberGetLineNumber() {
         LocatorImpl l = new LocatorImpl();
 
@@ -147,18 +95,6 @@
         assertEquals(0, l.getLineNumber());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setColumnNumber",
-            args = { int.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getColumnNumber",
-            args = { }
-        )
-    })
     public void testSetColumnNumberGetColumnNumber() {
         LocatorImpl l = new LocatorImpl();
 
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/NamespaceSupportTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/NamespaceSupportTest.java
index 8cb8834..2f1ff8d 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/NamespaceSupportTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/NamespaceSupportTest.java
@@ -25,16 +25,6 @@
 
 import org.xml.sax.helpers.NamespaceSupport;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
-@TestTargetClass(
-        value = NamespaceSupport.class,
-        untestedMethods = {
-        }
-)
 public class NamespaceSupportTest extends TestCase {
 
     final static String defaultUri = "http://www.android.com";
@@ -58,20 +48,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                notes = "Checks that a new NamespaceSupport object contains a " +
-                "default context with two predefined prefixes.",
-                method = "NamespaceSupport",
-                args = {}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "popContext",
-                args = {}
-        )
-    })
     public void testConstructor() {
         String prefix;
         boolean xmlPrefixExists = false;
@@ -95,18 +71,6 @@
         }
     }
 
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                method = "pushContext",
-                args = {}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "popContext",
-                args = {}
-        )
-    })
     public void testPush_PopContext() {
         int count;
 
@@ -131,18 +95,6 @@
         }
     }
 
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                method = "reset",
-                args = {}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "popContext",
-                args = {}
-        )
-    })
     public void testReset() {
         int count;
 
@@ -168,18 +120,6 @@
         }
     }
 
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                method = "declarePrefix",
-                args = {String.class, String.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                method = "getPrefix",
-                args = {String.class}
-        )
-    })
     public void testDeclare_GetPrefix() {
         ns.pushContext();
 
@@ -217,11 +157,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getPrefixes",
-            args = {String.class}
-    )
     public void testGetPrefixesLjava_lang_String() {
         ArrayList<String> prefixes;
 
@@ -243,11 +178,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getPrefixes",
-            args = {}
-    )
     public void testGetPrefixes() {
         ArrayList<String> prefixes;
 
@@ -259,11 +189,6 @@
     }
 
     @SuppressWarnings("unchecked")
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getDeclaredPrefixes",
-            args = {}
-    )
     public void testGetDeclaredPrefixes() {
         ArrayList<String> prefixes;
 
@@ -274,18 +199,6 @@
                 expected.containsAll(prefixes) && prefixes.containsAll(expected));
     }
 
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                method = "getURI",
-                args = {String.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "popContext",
-                args = {}
-        )
-    })
     public void testGetUri() {
         assertEquals("Test 1: Incorrect URI returned;",
                 marketUri, ns.getURI("bk"));
@@ -301,18 +214,6 @@
                 NamespaceSupport.XMLNS, ns.getURI("xml"));
     }
 
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "setNamespaceDeclUris",
-                args = {boolean.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.COMPLETE,
-                method = "isNamespaceDeclUris",
-                args = {}
-        )
-    })
     public void testNamespaceDeclUris() {
 
         assertFalse("Test 1: Incorrect default value returned by isNamespaceDeclUris().",
@@ -335,11 +236,6 @@
                 ns.isNamespaceDeclUris());
     }
 
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            method = "processName",
-            args = {String.class, String[].class, boolean.class}
-    )
     public void testProcessName_Element() {
         String[] parts = new String[3];
 
@@ -376,18 +272,6 @@
         assertEquals("Test 18: Incorrect raw name;", "world", parts[2]);
     }
 
-    @TestTargets ({
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "setNamespaceDeclUris",
-                args = {boolean.class}
-        ),
-        @TestTargetNew(
-                level = TestLevel.PARTIAL_COMPLETE,
-                method = "processName",
-                args = {String.class, String[].class, boolean.class}
-        )
-    })
     public void testProcessName_Attribute() {
         String[] parts = new String[3];
 
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserAdapterTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserAdapterTest.java
index c8fa52e..2344736 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserAdapterTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserAdapterTest.java
@@ -40,13 +40,8 @@
 import tests.api.org.xml.sax.support.MockHandler;
 import tests.api.org.xml.sax.support.MockParser;
 import tests.api.org.xml.sax.support.MockResolver;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
 @SuppressWarnings("deprecation")
-@TestTargetClass(ParserAdapter.class)
 public class ParserAdapterTest extends TestCase {
 
     // Note: In many cases we can only test that delegation works
@@ -88,11 +83,6 @@
         super.tearDown();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ParserAdapter",
-        args = { }
-    )
     public void testParserAdapter() {
         System.setProperty("org.xml.sax.parser",
                 "tests.api.org.xml.sax.support.DoNothingParser");
@@ -104,11 +94,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ParserAdapter",
-        args = { Parser.class }
-    )
     public void testParserAdapterParser() {
         // Ordinary case
         @SuppressWarnings("unused")
@@ -123,18 +108,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getFeature",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setFeature",
-            args = { String.class, boolean.class }
-        )
-    })
     public void testGetSetFeature() {
         String[] features = new String[] { NAMESPACES, NAMESPACE_PREFIXES,
                 XMLNS_URIs };
@@ -161,18 +134,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getProperty",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setProperty",
-            args = { String.class, Object.class }
-        )
-    })
     public void testGetSetProperty() {
         try {
             adapter.setProperty("http://argle.bargle", ":)");
@@ -193,18 +154,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getEntityResolver",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setEntityResolver",
-            args = { EntityResolver.class }
-        )
-    })
     public void testGetSetEntityResolver() {
         EntityResolver resolver = new MockResolver();
 
@@ -215,18 +164,6 @@
         assertEquals(null, adapter.getEntityResolver());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getDTDHandler",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setDTDHandler",
-            args = { DTDHandler.class }
-        )
-    })
     public void testGetSetDTDHandler() {
         adapter.setDTDHandler(null);
         assertEquals(null, adapter.getDTDHandler());
@@ -235,18 +172,6 @@
         assertEquals(handler, adapter.getDTDHandler());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getContentHandler",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setContentHandler",
-            args = { ContentHandler.class }
-        )
-    })
     public void testGetSetContentHandler() {
         adapter.setContentHandler(null);
         assertEquals(null, adapter.getContentHandler());
@@ -255,18 +180,6 @@
         assertEquals(handler, adapter.getContentHandler());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getErrorHandler",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setErrorHandler",
-            args = { ErrorHandler.class }
-        )
-    })
     public void testGetSetErrorHandler() {
         adapter.setErrorHandler(null);
         assertEquals(null, adapter.getErrorHandler());
@@ -275,11 +188,6 @@
         assertEquals(handler, adapter.getErrorHandler());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "parse",
-        args = { String.class }
-    )
     public void testParseString() {
         try {
             adapter.parse("foo");
@@ -295,11 +203,6 @@
         assertEquals(InputSource.class, logger.getArgs()[0].getClass());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "parse",
-        args = { InputSource.class }
-    )
     public void testParseInputSource() {
         InputSource source = new InputSource("foo");
 
@@ -315,11 +218,6 @@
         assertEquals(new Object[] { source }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDocumentLocator",
-        args = { Locator.class }
-    )
     public void testSetDocumentLocator() {
         Locator l = new LocatorImpl();
 
@@ -336,11 +234,6 @@
         assertEquals(new Object[] { null }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startDocument",
-        args = { }
-    )
     public void testStartDocument() {
         try {
             adapter.startDocument();
@@ -353,11 +246,6 @@
         assertEquals(new Object[] {}, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endDocument",
-        args = { }
-    )
     public void testEndDocument() {
         try {
             adapter.endDocument();
@@ -370,11 +258,6 @@
         assertEquals(new Object[] {}, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startElement",
-        args = { String.class, AttributeList.class }
-    )
     public void testStartElement() {
         AttributeListImpl atts = new AttributeListImpl();
         atts.addAttribute("john:doe", "int", "42");
@@ -393,11 +276,6 @@
         assertEquals("john:doe", ((Attributes)logger.getArgs()[3]).getQName(0));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endElement",
-        args = { String.class }
-    )
     public void testEndElement() {
         AttributeListImpl atts = new AttributeListImpl();
         atts.addAttribute("john:doe", "int", "42");
@@ -414,11 +292,6 @@
         assertEquals(new String[] { "", "", "foo:bar" }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "characters",
-        args = { char[].class, int.class, int.class }
-    )
     public void testCharacters() {
         char[] ch = "Android".toCharArray();
 
@@ -433,11 +306,6 @@
         assertEquals(new Object[] { ch, 2, 5 }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ignorableWhitespace",
-        args = { char[].class, int.class, int.class }
-    )
     public void testIgnorableWhitespace() {
         char[] ch = "     ".toCharArray();
 
@@ -452,11 +320,6 @@
         assertEquals(new Object[] { ch, 0, 5 }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "processingInstruction",
-        args = { String.class, String.class }
-    )
     public void testProcessingInstruction() {
         try {
             adapter.processingInstruction("foo", "bar");
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserFactoryTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserFactoryTest.java
index c3897ba..b59ce50 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserFactoryTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/ParserFactoryTest.java
@@ -16,28 +16,17 @@
 
 package tests.api.org.xml.sax.helpers;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.xml.sax.helpers.ParserFactory;
 
 @SuppressWarnings("deprecation")
-@TestTargetClass(ParserFactory.class)
 public class ParserFactoryTest extends TestCase {
 
     @Override protected void tearDown() throws Exception {
         super.tearDown();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "makeParser",
-        args = { },
-        notes = "Checks everything except META-INF case"
-    )
     public void testMakeParser() throws ClassNotFoundException,
             IllegalAccessException, InstantiationException {
 
@@ -102,11 +91,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "makeParser",
-        args = { String.class }
-    )
     public void testMakeParserString() throws ClassNotFoundException,
             IllegalAccessException, InstantiationException {
         // No class
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLFilterImplTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLFilterImplTest.java
index 1d98f72..d00879b 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLFilterImplTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLFilterImplTest.java
@@ -40,12 +40,7 @@
 import tests.api.org.xml.sax.support.MockFilter;
 import tests.api.org.xml.sax.support.MockHandler;
 import tests.api.org.xml.sax.support.MockResolver;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
-@TestTargetClass(XMLFilterImpl.class)
 public class XMLFilterImplTest extends TestCase {
 
     // Note: In many cases we can only test that delegation works
@@ -79,20 +74,10 @@
         child.setErrorHandler(handler);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "XMLFilterImpl",
-        args = { }
-    )
     public void testXMLFilterImpl() {
         assertEquals(null, parent.getParent());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "XMLFilterImpl",
-        args = { XMLReader.class }
-    )
     public void testXMLFilterImplXMLReader() {
         // Ordinary case
         assertEquals(null, parent.getParent());
@@ -102,18 +87,6 @@
         assertEquals(null, filter.getParent());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getParent",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setParent",
-            args = { XMLReader.class }
-        )
-    })
     public void testGetSetParent() {
         child.setParent(null);
         assertEquals(null, child.getParent());
@@ -122,18 +95,6 @@
         assertEquals(parent, child.getParent());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getFeature",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setFeature",
-            args = { String.class, boolean.class }
-        )
-    })
     public void testGetSetFeature() {
         // Ordinary case
         try {
@@ -159,18 +120,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getProperty",
-            args = { String.class }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setProperty",
-            args = { String.class, Object.class }
-        )
-    })
     public void testGetSetProperty() {
         // Ordinary case
         try {
@@ -196,18 +145,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getEntityResolver",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setEntityResolver",
-            args = { EntityResolver.class }
-        )
-    })
     public void testGetSetEntityResolver() {
         EntityResolver resolver = new MockResolver();
 
@@ -218,18 +155,6 @@
         assertEquals(null, parent.getEntityResolver());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getDTDHandler",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setDTDHandler",
-            args = { DTDHandler.class }
-        )
-    })
     public void testGetSetDTDHandler() {
         parent.setDTDHandler(null);
         assertEquals(null, parent.getDTDHandler());
@@ -238,18 +163,6 @@
         assertEquals(handler, parent.getDTDHandler());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getContentHandler",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setContentHandler",
-            args = { ContentHandler.class }
-        )
-    })
     public void testGetSetContentHandler() {
         parent.setContentHandler(null);
         assertEquals(null, parent.getContentHandler());
@@ -258,18 +171,6 @@
         assertEquals(handler, parent.getContentHandler());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "getErrorHandler",
-            args = { }
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            method = "setErrorHandler",
-            args = { ErrorHandler.class }
-        )
-    })
     public void testGetSetErrorHandler() {
         parent.setErrorHandler(null);
         assertEquals(null, parent.getErrorHandler());
@@ -278,11 +179,6 @@
         assertEquals(handler, parent.getErrorHandler());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "parse",
-        args = { InputSource.class }
-    )
     public void testParseInputSource() {
         InputSource is = new InputSource();
 
@@ -311,11 +207,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "parse",
-        args = { String.class }
-    )
     public void testParseString() {
         // Ordinary case
         try {
@@ -342,11 +233,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "resolveEntity",
-        args = { String.class, String.class }
-    )
     public void testResolveEntity() {
         InputSource expected = new InputSource();
 
@@ -382,11 +268,6 @@
         assertEquals(null, result);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "notationDecl",
-        args = { String.class, String.class, String.class }
-    )
     public void testNotationDecl() {
         try {
             parent.notationDecl("foo", "bar", "foobar");
@@ -400,11 +281,6 @@
                 logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "unparsedEntityDecl",
-        args = { String.class, String.class, String.class, String.class }
-    )
     public void testUnparsedEntityDecl() {
         try {
             parent.unparsedEntityDecl("foo", "bar", "gabba", "hey");
@@ -418,11 +294,6 @@
                 logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDocumentLocator",
-        args = { Locator.class }
-    )
     public void testSetDocumentLocator() {
         Locator l = new LocatorImpl();
 
@@ -439,11 +310,6 @@
         assertEquals(new Object[] { null }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startDocument",
-        args = { }
-    )
     public void testStartDocument() {
         try {
             parent.startDocument();
@@ -456,11 +322,6 @@
         assertEquals(new Object[] {}, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endDocument",
-        args = { }
-    )
     public void testEndDocument() {
         try {
             parent.endDocument();
@@ -473,11 +334,6 @@
         assertEquals(new Object[] {}, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startPrefixMapping",
-        args = { String.class, String.class }
-    )
     public void testStartPrefixMapping() {
         try {
             parent.startPrefixMapping("foo", "http://some.uri");
@@ -491,11 +347,6 @@
                 logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endPrefixMapping",
-        args = { String.class }
-    )
     public void testEndPrefixMapping() {
         try {
             parent.endPrefixMapping("foo");
@@ -508,11 +359,6 @@
         assertEquals(new Object[] { "foo" }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startElement",
-        args = { String.class, String.class, String.class, Attributes.class }
-    )
     public void testStartElement() {
         Attributes atts = new AttributesImpl();
 
@@ -528,11 +374,6 @@
                 logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endElement",
-        args = { String.class, String.class, String.class }
-    )
     public void testEndElement() {
         try {
             parent.endElement("http://some.uri", "bar", "foo:bar");
@@ -546,11 +387,6 @@
                  logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "characters",
-        args = { char[].class, int.class, int.class }
-    )
     public void testCharacters() {
         char[] ch = "Android".toCharArray();
 
@@ -565,11 +401,6 @@
         assertEquals(new Object[] { ch, 2, 5 }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ignorableWhitespace",
-        args = { char[].class, int.class, int.class }
-    )
     public void testIgnorableWhitespace() {
         char[] ch = "     ".toCharArray();
 
@@ -584,11 +415,6 @@
         assertEquals(new Object[] { ch, 0, 5 }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "processingInstruction",
-        args = { String.class, String.class }
-    )
     public void testProcessingInstruction() {
         try {
             parent.processingInstruction("foo", "bar");
@@ -601,11 +427,6 @@
         assertEquals(new Object[] { "foo", "bar" }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "skippedEntity",
-        args = { String.class }
-    )
     public void testSkippedEntity() {
         try {
             parent.skippedEntity("foo");
@@ -618,11 +439,6 @@
         assertEquals(new Object[] { "foo" }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "warning",
-        args = { SAXParseException.class }
-    )
     public void testWarning() {
         SAXParseException exception = new SAXParseException("Oops!", null);
 
@@ -637,11 +453,6 @@
         assertEquals(new Object[] { exception }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "error",
-        args = { SAXParseException.class }
-    )
     public void testError() {
         SAXParseException exception = new SAXParseException("Oops!", null);
 
@@ -656,11 +467,6 @@
         assertEquals(new Object[] { exception }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "fatalError",
-        args = { SAXParseException.class }
-    )
     public void testFatalError() {
         SAXParseException exception = new SAXParseException("Oops!", null);
 
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderAdapterTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderAdapterTest.java
index 52e308f..16104b3 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderAdapterTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderAdapterTest.java
@@ -39,12 +39,8 @@
 import tests.api.org.xml.sax.support.MockHandler;
 import tests.api.org.xml.sax.support.MockReader;
 import tests.api.org.xml.sax.support.MockResolver;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
 @SuppressWarnings("deprecation")
-@TestTargetClass(XMLReaderAdapter.class)
 public class XMLReaderAdapterTest extends TestCase {
 
     // Note: In many cases we can only test that delegation works
@@ -77,11 +73,6 @@
         super.tearDown();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "XMLReaderAdapter",
-        args = { }
-    )
     public void testXMLReaderAdapter() {
         System.setProperty("org.xml.sax.driver",
                 "tests.api.org.xml.sax.support.DoNothingXMLReader");
@@ -93,11 +84,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "XMLReaderAdapter",
-        args = { XMLReader.class }
-    )
     public void testXMLReaderAdapterXMLReader() {
         // Ordinary case
         @SuppressWarnings("unused")
@@ -112,11 +98,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setLocale",
-        args = { Locale.class }
-    )
     public void testSetLocale() {
         // SAX RI does not support this, hence always expect exception
         try {
@@ -127,11 +108,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setEntityResolver",
-        args = { EntityResolver.class }
-    )
     public void testSetEntityResolver() {
         EntityResolver resolver = new MockResolver();
 
@@ -144,11 +120,6 @@
         assertEquals(null, reader.getEntityResolver());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDTDHandler",
-        args = { DTDHandler.class }
-    )
     public void testSetDTDHandler() {
         // Ordinary case
         assertEquals(handler, reader.getDTDHandler());
@@ -158,11 +129,6 @@
         assertEquals(null, reader.getDTDHandler());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDocumentHandler",
-        args = { DocumentHandler.class }
-    )
     public void testSetDocumentHandler() {
         // There is no getter for the DocumentHandler, so we can only test
         // indirectly whether is has been set correctly.
@@ -179,11 +145,6 @@
         adapter.setDocumentHandler(null);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setErrorHandler",
-        args = { ErrorHandler.class }
-    )
     public void testSetErrorHandler() {
         // Ordinary case
         assertEquals(handler, reader.getErrorHandler());
@@ -193,11 +154,6 @@
         assertEquals(null, reader.getErrorHandler());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "parse",
-        args = { String.class }
-    )
     public void testParseString() {
         try {
             adapter.parse("foo");
@@ -213,11 +169,6 @@
         assertEquals(InputSource.class, logger.getArgs(0)[0].getClass());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "parse",
-        args = { InputSource.class }
-    )
     public void testParseInputSource() {
         InputSource source = new InputSource("foo");
 
@@ -233,11 +184,6 @@
         assertEquals(new Object[] { source }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "setDocumentLocator",
-        args = { Locator.class }
-    )
     public void testSetDocumentLocator() {
         // Ordinary case
         LocatorImpl locator = new LocatorImpl();
@@ -251,11 +197,6 @@
         adapter.setDocumentLocator(locator);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startDocument",
-        args = { }
-    )
     public void testStartDocument() {
         try {
             adapter.startDocument();
@@ -268,11 +209,6 @@
         assertEquals(new Object[] {}, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endDocument",
-        args = { }
-    )
     public void testEndDocument() {
         try {
             adapter.endDocument();
@@ -285,31 +221,16 @@
         assertEquals(new Object[] {}, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startPrefixMapping",
-        args = { String.class, String.class }
-    )
     public void testStartPrefixMapping() {
         adapter.startPrefixMapping("foo", "http://some.uri");
         assertEquals(logger.size(), 0);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endPrefixMapping",
-        args = { String.class }
-    )
     public void testEndPrefixMapping() {
         adapter.endPrefixMapping("foo");
         assertEquals(logger.size(), 0);
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "startElement",
-        args = { String.class, String.class, String.class, Attributes.class }
-    )
     public void testStartElement() {
         AttributesImpl atts = new AttributesImpl();
         atts.addAttribute("http://some.other.uri", "gabba", "gabba:hey",
@@ -328,11 +249,6 @@
                 ((AttributeList)logger.getArgs()[1]).getName(0));
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "endElement",
-        args = { String.class, String.class, String.class }
-    )
     public void testEndElement() {
         try {
             adapter.endElement("http://some.uri", "bar", "foo:bar");
@@ -345,11 +261,6 @@
         assertEquals(new Object[] { "foo:bar" }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "characters",
-        args = { char[].class, int.class, int.class }
-    )
     public void testCharacters() {
         char[] ch = "Android".toCharArray();
 
@@ -364,11 +275,6 @@
         assertEquals(new Object[] { ch, 2, 5 }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ignorableWhitespace",
-        args = { char[].class, int.class, int.class }
-    )
     public void testIgnorableWhitespace() {
         char[] ch = "     ".toCharArray();
 
@@ -383,11 +289,6 @@
         assertEquals(new Object[] { ch, 0, 5 }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "processingInstruction",
-        args = { String.class, String.class }
-    )
     public void testProcessingInstruction() {
         try {
             adapter.processingInstruction("foo", "bar");
@@ -400,11 +301,6 @@
         assertEquals(new Object[] { "foo" , "bar" }, logger.getArgs());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "skippedEntity",
-        args = { String.class }
-    )
     public void testSkippedEntity() {
         try {
             adapter.skippedEntity("foo");
diff --git a/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderFactoryTest.java b/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderFactoryTest.java
index 4876b13..8205dfd 100644
--- a/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderFactoryTest.java
+++ b/luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderFactoryTest.java
@@ -16,16 +16,11 @@
 
 package tests.api.org.xml.sax.helpers;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.xml.sax.SAXException;
 import org.xml.sax.helpers.XMLReaderFactory;
 
-@TestTargetClass(XMLReaderFactory.class)
 public class XMLReaderFactoryTest extends TestCase {
 
     @Override protected void setUp() throws Exception {
@@ -36,12 +31,6 @@
         super.tearDown();
     }
 
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        method = "createXMLReader",
-        args = { },
-        notes = "Checks everything except META-INF case"
-    )
     public void testCreateXMLReader() {
         // Property not set at all
         try {
@@ -103,11 +92,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "createXMLReader",
-        args = { String.class }
-    )
     public void testMakeParserString() {
         // No class
         try {
diff --git a/luni/src/test/java/tests/concurrent/AllTests.java b/luni/src/test/java/tests/concurrent/AllTests.java
deleted file mode 100644
index 4c49f54..0000000
--- a/luni/src/test/java/tests/concurrent/AllTests.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.concurrent;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite for the concurrent module
- */
-public class AllTests {
-    /**
-     * Collects all JSR166 unit tests as one suite
-     */
-    public static Test suite ( ) {
-        TestSuite suite = new TestSuite("JSR166 Unit Tests");
-
-        suite.addTest(tests.api.java.util.concurrent.JSR166TestCase.suite());
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/java/lang/String/Tests.java b/luni/src/test/java/tests/java/lang/String/Tests.java
index 15fe1b6..e5ab269 100644
--- a/luni/src/test/java/tests/java/lang/String/Tests.java
+++ b/luni/src/test/java/tests/java/lang/String/Tests.java
@@ -16,65 +16,29 @@
 
 package tests.java.lang.String;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 /**
  * Tests for the class {@link String}.
  */
-@TestTargetClass(String.class)
 public class Tests extends TestCase {
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check NullPointerException.",
-        method = "contains",
-        args = {java.lang.CharSequence.class}
-    )
     public void test_contains() {
         assertTrue("aabc".contains("abc"));
         assertTrue("abcd".contains("abc"));
         assertFalse("abcd".contains("cba"));
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies positive functionality.",
-        method = "charAt",
-        args = {int.class}
-    )
     public void test_charAt() {
         assertTrue("abcd".charAt(0) == 'a');
         assertTrue("abcd".charAt(3) == 'd');
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check specific cases.",
-        method = "startsWith",
-        args = {java.lang.String.class}
-    )
     public void test_StartsWith() {
         assertTrue("abcd".startsWith("abc"));
         assertFalse("abcd".startsWith("aabc"));
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check specific cases.",
-        method = "endsWith",
-        args = {java.lang.String.class}
-    )
     public void test_EndsWith() {
         assertTrue("abcd".endsWith("bcd"));
         assertFalse("abcd".endsWith("bcde"));
     }
-    @TestTargetNew(
-        level = TestLevel.TODO,
-        notes = "Verifies nothing.",
-        method = "!Constants",
-        args = {}
-    )
     public void test_CASE_INSENSITIVE_ORDER() {
         String  s1 = "ABCDEFG";
         String  s2 = "abcdefg";
diff --git a/luni/src/test/java/tests/java/security/AlgorithmParameterGeneratorSpiTest.java b/luni/src/test/java/tests/java/security/AlgorithmParameterGeneratorSpiTest.java
index 81fde6d..47b9ed6 100644
--- a/luni/src/test/java/tests/java/security/AlgorithmParameterGeneratorSpiTest.java
+++ b/luni/src/test/java/tests/java/security/AlgorithmParameterGeneratorSpiTest.java
@@ -22,11 +22,6 @@
 
 package tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AlgorithmParameters;
 import java.security.InvalidAlgorithmParameterException;
 import java.security.SecureRandom;
@@ -41,39 +36,12 @@
  * and methods.
  *
  */
-@TestTargetClass(java.security.AlgorithmParameterGeneratorSpi.class)
 public class AlgorithmParameterGeneratorSpiTest extends TestCase {
 
     /**
      * Test for <code>AlgorithmParameterGeneratorSpi</code> constructor
      * Assertion: constructs AlgorithmParameterGeneratorSpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AlgorithmParameterGeneratorSpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGenerateParameters",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineInit",
-            args = {java.security.spec.AlgorithmParameterSpec.class, java.security.SecureRandom.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineInit",
-            args = {int.class, java.security.SecureRandom.class}
-        )
-    })
     public void testAlgorithmParameterGeneratorSpi01()
             throws InvalidAlgorithmParameterException {
         MyAlgorithmParameterGeneratorSpi algParGen = new MyAlgorithmParameterGeneratorSpi();
diff --git a/luni/src/test/java/tests/java/security/AllPermissionTest.java b/luni/src/test/java/tests/java/security/AllPermissionTest.java
index 40f0c71..32056d8 100644
--- a/luni/src/test/java/tests/java/security/AllPermissionTest.java
+++ b/luni/src/test/java/tests/java/security/AllPermissionTest.java
@@ -22,18 +22,12 @@
 
 package tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.AllPermission;
 import java.security.BasicPermission;
 import java.security.PermissionCollection;
 import java.security.UnresolvedPermission;
 
 import junit.framework.TestCase;
-@TestTargetClass(AllPermission.class)
 /**
  * Tests for <code>AllPermission</code>
  *
@@ -43,20 +37,6 @@
     /**
      * Test all constructors: an object is created, name and actions are ignored
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AllPermission",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "AllPermission",
-            args = {java.lang.String.class, java.lang.String.class}
-        )
-    })
     public void testCtor()
     {
         AllPermission a1 = new AllPermission();
@@ -73,12 +53,6 @@
     }
 
     /** Any of AllPermission instances are equal and have the same hash code */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals()
     {
         AllPermission a1 = new AllPermission();
@@ -90,12 +64,6 @@
     }
 
     /** AllPermission implies any other permission */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Null parameter checking missed",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void testImplies()
     {
         AllPermission a1 = new AllPermission();
@@ -105,12 +73,6 @@
     }
 
     /** newPermissionCollection() returns a new AllPermissionCollection on every invocation. */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void testCollection()
     {
         AllPermission a1 = new AllPermission();
diff --git a/luni/src/test/java/tests/java/security/AllTests.java b/luni/src/test/java/tests/java/security/AllTests.java
deleted file mode 100644
index 6dadd07..0000000
--- a/luni/src/test/java/tests/java/security/AllTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.java.security;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.java.security;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.java.security;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AlgorithmParameterGeneratorSpiTest.class);
-        suite.addTestSuite(AllPermissionTest.class);
-        suite.addTestSuite(BasicPermissionTest.class);
-        suite.addTestSuite(IdentityTest.class);
-        suite.addTestSuite(SecureClassLoaderTest.class);
-        suite.addTestSuite(SecureRandomTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/java/security/BasicPermissionTest.java b/luni/src/test/java/tests/java/security/BasicPermissionTest.java
index 28eeee4..703a947 100644
--- a/luni/src/test/java/tests/java/security/BasicPermissionTest.java
+++ b/luni/src/test/java/tests/java/security/BasicPermissionTest.java
@@ -22,11 +22,6 @@
 
 package tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.BasicPermission;
 import java.security.PermissionCollection;
 
@@ -36,7 +31,6 @@
  * Tests for <code>BasicPermission</code>
  *
  */
-@TestTargetClass(BasicPermission.class)
 public class BasicPermissionTest extends TestCase {
     /**
      * Check all constructors: an object is created with the specified valid name.
@@ -44,20 +38,6 @@
      * If  name is empty then IAE should be thrown.
      * Action is ignored.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "BasicPermission",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "BasicPermission",
-            args = {java.lang.String.class, java.lang.String.class}
-        )
-    })
     public void testCtor()
     {
         String name = "basic123*$%#";
@@ -103,12 +83,6 @@
      * two BasicPermissions are equal if name and class are equal;
      * equal permissions should have the same hash code
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals()
     {
         BasicPermission b1 = new BasicPermissionImpl("abc");
@@ -127,12 +101,6 @@
      * implies() should return true if a permission is equal to or is implied
      * by wildcarded permission, false otherwise.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "implies",
-        args = {java.security.Permission.class}
-    )
     public void testImplies()
     {
         BasicPermission b1 = new BasicPermissionImpl("a.b.c");
@@ -152,12 +120,6 @@
     /**
      * newPermissionCollection() should return new BasicPermissionCollection on every invocation
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "newPermissionCollection",
-        args = {}
-    )
     public void testCollection()
     {
         BasicPermission b1 = new BasicPermissionImpl("a.b.c");
diff --git a/luni/src/test/java/tests/java/security/IdentityTest.java b/luni/src/test/java/tests/java/security/IdentityTest.java
index 38f52ee..405b100 100644
--- a/luni/src/test/java/tests/java/security/IdentityTest.java
+++ b/luni/src/test/java/tests/java/security/IdentityTest.java
@@ -22,11 +22,6 @@
 
 package tests.java.security;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.security.Identity;
 import java.security.IdentityScope;
 import java.security.KeyManagementException;
@@ -46,7 +41,6 @@
  *
  */
 @SuppressWarnings("deprecation")
-@TestTargetClass(Identity.class)
 public class IdentityTest extends TestCase {
 
     public static class MySecurityManager extends SecurityManager {
@@ -56,22 +50,10 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Method's returned variable is not checked",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         new IdentityStub("testHashCode").hashCode();
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() throws Exception {
         IdentityStub i1 = new IdentityStub("testEquals");
         Object value[] =  {
@@ -96,12 +78,6 @@
     /**
      * verify Identity.toString()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
      public void testToString2() {
         assertNotNull(new IdentityStub("testToString2").toString());
     }
@@ -109,12 +85,6 @@
     /**
      * verify Identity() creates instance
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Identity",
-        args = {}
-    )
     public void testIdentity() {
         assertNotNull(new IdentityStub());
     }
@@ -122,12 +92,6 @@
     /*
      * verify Identity(String) creates instance with given name
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Empty string for parameter is not tested",
-        method = "Identity",
-        args = {java.lang.String.class}
-    )
     public void testIdentityString() {
         Identity i = new IdentityStub("iii");
         assertNotNull(i);
@@ -140,12 +104,6 @@
     /**
      * verify Identity(String, IdentityScope) creates instance with given name and in give scope
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "KeyManagementException checking missed. Null parameters are not checked.",
-        method = "Identity",
-        args = {java.lang.String.class, java.security.IdentityScope.class}
-    )
     public void testIdentityStringIdentityScope() throws Exception {
         IdentityScope s = IdentityScope.getSystemScope();
         Identity i = new IdentityStub("iii2", s);
@@ -160,12 +118,6 @@
      * If the identity has a public key, the public key in the certificate must be the same
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "addCertificate",
-        args = {java.security.Certificate.class}
-    )
     public void testAddCertificate1() throws Exception {
         Identity i = new IdentityStub("iii");
         PublicKeyStub pk1 = new PublicKeyStub("kkk", "fff", new byte[]{1,2,3,4,5});
@@ -185,12 +137,6 @@
      * verify addCertificate(Certificate certificate) adds a certificate for this identity.
      * if the identity does not have a public key, the identity's public key is set to be that specified in the certificate.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "addCertificate",
-        args = {java.security.Certificate.class}
-    )
     public void testAddCertificate2() throws Exception {
         Identity i = new IdentityStub("iii");
         PublicKeyStub pk1 = new PublicKeyStub("kkk", "fff", null);
@@ -204,12 +150,6 @@
     /**
      * verify addCertificate(Certificate certificate) throws KeyManagementException if certificate is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "addCertificate",
-        args = {java.security.Certificate.class}
-    )
     public void testAddCertificate4() throws Exception {
         try {
             new IdentityStub("aaa").addCertificate(null);
@@ -248,12 +188,6 @@
     /**
      * verify certificates() returns a copy of all certificates for this identity
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "certificates",
-        args = {}
-    )
     public void testCertificates() throws Exception {
         Identity i = new IdentityStub("iii");
         PublicKeyStub pk1 = new PublicKeyStub("kkk", "fff", null);
@@ -277,12 +211,6 @@
     /**
      * verify Identity.identityEquals(Identity) return true, only if names and public keys are equal
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "identityEquals",
-        args = {java.security.Identity.class}
-    )
     public void testIdentityEquals() throws Exception {
         String name = "nnn";
         PublicKey pk = new PublicKeyStub("aaa", "fff", new byte[]{1,2,3,4,5});
@@ -309,12 +237,6 @@
     /**
      * verify Identity.toString(boolean) return string representation of identity
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Method's returned value is not checked. SecurityException checking missed.",
-        method = "toString",
-        args = {boolean.class}
-    )
     public void testToStringboolean() throws Exception {
         new IdentityStub("aaa").toString(false);
         new IdentityStub("aaa2", IdentityScope.getSystemScope()).toString(false);
@@ -325,12 +247,6 @@
     /**
      * verify Identity.getScope() returns identity's scope
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getScope",
-        args = {}
-    )
     public void testGetScope() throws Exception {
        Identity i = new IdentityStub("testGetScope");
        assertNull(i.getScope());
@@ -345,12 +261,6 @@
      * verify Identity.setPublicKey() throws KeyManagementException if key is invalid
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "setPublicKey",
-        args = {java.security.PublicKey.class}
-    )
     public void testSetPublicKey2() throws Exception {
         Identity i2 = new IdentityStub("testSetPublicKey2_2", IdentityScope.getSystemScope());
         new PublicKeyStub("kkk", "testSetPublicKey2", new byte[]{1,2,3,4,5});
@@ -382,12 +292,6 @@
      * verify Identity.setPublicKey()  removes old key and all identity's certificates
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "setPublicKey",
-        args = {java.security.PublicKey.class}
-    )
     public void testSetPublicKey4() throws Exception {
         Identity i = new IdentityStub("testSetPublicKey4");
         PublicKeyStub pk1 = new PublicKeyStub("kkk", "Identity.testSetPublicKey4", null);
@@ -407,12 +311,6 @@
     /**
      * verify Identity.getPublicKey() returns public key
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicKey",
-        args = {}
-    )
     public void testGetPublicKey() throws Exception {
         Identity i = new IdentityStub("testGetPublicKey");
         assertNull(i.getPublicKey());
@@ -421,20 +319,6 @@
         assertSame(pk, i.getPublicKey());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Both method were verified",
-            method = "getInfo",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Both method were verified",
-            method = "setInfo",
-            args = {java.lang.String.class}
-        )
-    })
     public void testGetInfo() {
 
         Identity i = new IdentityStub("testGetInfo");
@@ -442,12 +326,6 @@
         assertEquals("some info", i.getInfo());
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public void testGetName() {
         Identity i = new IdentityStub("testGetName");
         assertEquals ("testGetName", i.getName());
diff --git a/luni/src/test/java/tests/java/security/SecureClassLoaderTest.java b/luni/src/test/java/tests/java/security/SecureClassLoaderTest.java
index 5e6c021..9a0761b 100644
--- a/luni/src/test/java/tests/java/security/SecureClassLoaderTest.java
+++ b/luni/src/test/java/tests/java/security/SecureClassLoaderTest.java
@@ -23,9 +23,6 @@
 package tests.java.security;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
 import junit.framework.TestCase;
 
@@ -38,25 +35,7 @@
 import java.security.ProtectionDomain;
 import java.security.SecureClassLoader;
 import java.security.cert.Certificate;
-@TestTargetClass(value=SecureClassLoader.class,
-        untestedMethods={
-            @TestTargetNew(
-                    level = TestLevel.NOT_FEASIBLE,
-                    notes = "cannot be tested",
-                    method = "defineClass",
-                    args = {
-                        java.lang.String.class, byte[].class, int.class,
-                        int.class, java.security.CodeSource.class}
-            ),
-            @TestTargetNew(
-                    level = TestLevel.NOT_FEASIBLE,
-                    notes = "cannot be tested",
-                    method = "defineClass",
-                    args = {
-                        java.lang.String.class, java.nio.ByteBuffer.class,
-                        java.security.CodeSource.class}
-            )
-})
+
 /**
  * Unit test for SecureClassLoader.
  *
@@ -186,15 +165,6 @@
             (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x02, (byte) 0x00,
             (byte) 0x21, };
 
-    /**
-     * Tests SecureClassLoader(ClassLoader)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verification with null parameter missed",
-        method = "SecureClassLoader",
-        args = {java.lang.ClassLoader.class}
-    )
     @KnownFailure("Android doesn't allow null parent.")
     public void testSecureClassLoaderClassLoader() throws Exception {
         URL[] urls = new URL[] { new URL("http://localhost") };
@@ -208,15 +178,6 @@
         }
     }
 
-    /**
-     * Tests getPermission
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "",
-        method = "getPermissions",
-        args = {java.security.CodeSource.class}
-    )
     public void testGetPermissions() throws Exception {
         URL url = new URL("http://localhost");
         CodeSource cs = new CodeSource(url, (Certificate[]) null);
@@ -228,12 +189,6 @@
 //    /**
 //     * Tests defineClass(String, byte[], int, int, CodeSource)
 //     */
-//    @TestTargetNew(
-//        level = TestLevel.NOT_FEASIBLE,
-//        notes = "ClassFormatError, IndexOutOfBoundsException, SecurityException checking missed",
-//        method = "defineClass",
-//        args = {java.lang.String.class, byte[].class, int.class, int.class, java.security.CodeSource.class}
-//    )
 //    public void _testDefineClassStringbyteArrayintintCodeSource() {
 //        MyClassLoader ldr = new MyClassLoader();
 //        Class klass = ldr.define(null, klassData, 0, klassData.length, null);
@@ -243,12 +198,6 @@
 //    /**
 //     * Tests defineClass(String, ByteBuffer, CodeSource)
 //     */
-//    @TestTargetNew(
-//        level = TestLevel.NOT_FEASIBLE,
-//        notes = "ClassFormatError, SecurityException checking missed",
-//        method = "defineClass",
-//        args = {java.lang.String.class, java.nio.ByteBuffer.class, java.security.CodeSource.class}
-//    )
 //    public void _testDefineClassStringByteBufferCodeSource() {
 //        MyClassLoader ldr = new MyClassLoader();
 //        ByteBuffer bbuf = ByteBuffer.wrap(klassData);
diff --git a/luni/src/test/java/tests/java/sql/AllTests.java b/luni/src/test/java/tests/java/sql/AllTests.java
deleted file mode 100644
index 5c9345b..0000000
--- a/luni/src/test/java/tests/java/sql/AllTests.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.java.sql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.java.sql;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.java.sql;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(MultiThreadAccessTest.class);
-        suite.addTestSuite(tests.java.sql.StressTest.class);
-        suite.addTestSuite(tests.java.sql.UpdateFunctionalityTest.class);
-        suite.addTestSuite(tests.java.sql.SelectFunctionalityTest.class);
-        suite.addTestSuite(tests.java.sql.UpdateFunctionalityTest2.class);
-        suite.addTestSuite(tests.java.sql.DeleteFunctionalityTest.class);
-        suite.addTestSuite(tests.java.sql.DatabaseMetaDataTest.class);
-        suite.addTestSuite(tests.java.sql.DatabaseMetaDataNotSupportedTest.class);
-        suite.addTestSuite(tests.java.sql.InsertFunctionalityTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/java/sql/DatabaseMetaDataNotSupportedTest.java b/luni/src/test/java/tests/java/sql/DatabaseMetaDataNotSupportedTest.java
index 459a06e..3f16a69 100644
--- a/luni/src/test/java/tests/java/sql/DatabaseMetaDataNotSupportedTest.java
+++ b/luni/src/test/java/tests/java/sql/DatabaseMetaDataNotSupportedTest.java
@@ -17,9 +17,6 @@
 package tests.java.sql;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
 import junit.extensions.TestSetup;
 import junit.framework.Test;
@@ -37,7 +34,6 @@
 import java.sql.Statement;
 import java.util.HashSet;
 
-@TestTargetClass(DatabaseMetaData.class)
 public class DatabaseMetaDataNotSupportedTest extends TestCase {
 
     private static String VIEW_NAME = "myView";
@@ -130,30 +126,12 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#allProceduresAreCallable()
+     * java.sql.DatabaseMetaData#allProceduresAreCallable()
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "Granting not supported.",
-        method = "allProceduresAreCallable",
-        args = {}
-    )
     public void test_allProceduresAreCallable() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.allProceduresAreCallable());
     }
 
-    /**
-     * @tests {@link java.sql.DatabaseMetaData#allTablesAreSelectable()}
-     *
-     * // NOT_FEASIBLE GRANT and REVOKE are not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "test fails. GRANT and REVOKE not supported",
-        method = "allTablesAreSelectable",
-        args = {}
-    )
     @KnownFailure("Not supported ops applied")
     public void test_allTablesAreSelectable() throws SQLException {
         // grant SELECT privileges
@@ -196,86 +174,42 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()
+     * java.sql.DatabaseMetaData#dataDefinitionCausesTransactionCommit()
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "dataDefinitionCausesTransactionCommit",
-        args = {}
-    )
-    public void test_dataDefinitionCausesTransactionCommit()
-            throws SQLException {
+    public void test_dataDefinitionCausesTransactionCommit() throws SQLException {
         // NOT_FEASIBLE: SQLITE does not implement this functionality
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#dataDefinitionIgnoredInTransactions()
+     * java.sql.DatabaseMetaData#dataDefinitionIgnoredInTransactions()
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "dataDefinitionIgnoredInTransactions",
-        args = {}
-    )
     public void test_dataDefinitionIgnoredInTransactions() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.dataDefinitionIgnoredInTransactions());
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#deletesAreDetected(int)
+     * java.sql.DatabaseMetaData#deletesAreDetected(int)
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "deletesAreDetected",
-        args = {int.class}
-    )
     public void test_deletesAreDetectedI() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.deletesAreDetected(0));
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#doesMaxRowSizeIncludeBlobs()
+     * java.sql.DatabaseMetaData#doesMaxRowSizeIncludeBlobs()
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "doesMaxRowSizeIncludeBlobs",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_doesMaxRowSizeIncludeBlobs() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.doesMaxRowSizeIncludeBlobs());
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData #getAttributes(java.lang.String,
+     * java.sql.DatabaseMetaData #getAttributes(java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getAttributes",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_getAttributesLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#getCatalogs()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported. not supported. Received result wasn't checked.",
-        method = "getCatalogs",
-        args = {}
-    )
     public void test_getCatalogs() throws SQLException {
         ResultSet rs = meta.getCatalogs();
         // NOT_FEASIBLE getCatalog is not supported
@@ -290,60 +224,30 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getCatalogSeparator()
+     * java.sql.DatabaseMetaData#getCatalogSeparator()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getCatalogSeparator",
-        args = {}
-    )
     public void test_getCatalogSeparator() throws SQLException {
         assertTrue("Incorrect catalog separator", "".equals(meta
                 .getCatalogSeparator().trim()));
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getCatalogTerm()
+     * java.sql.DatabaseMetaData#getCatalogTerm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getCatalogTerm",
-        args = {}
-    )
     public void test_getCatalogTerm() throws SQLException {
         assertTrue("Incorrect catalog term", "".equals(meta
                 .getCatalogSeparator().trim()));
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getExtraNameCharacters()
+     * java.sql.DatabaseMetaData#getExtraNameCharacters()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getExtraNameCharacters",
-        args = {}
-    )
     public void test_getExtraNameCharacters() throws SQLException {
         assertNotNull("Incorrect extra name characters", meta
                 .getExtraNameCharacters());
 
     }
 
-    /**
-     * @tests {@link java.sql.DatabaseMetaData #getIndexInfo(java.lang.String,
-     *        java.lang.String, java.lang.String, boolean, boolean)}
-     *
-     *  NOT_FEASIBLE getCatalog is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported. not supported. Received result wasn't checked.",
-        method = "getIndexInfo",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, boolean.class, boolean.class}
-    )
     @KnownFailure("not supported")
     public void test_getIndexInfoLjava_lang_StringLjava_lang_StringLjava_lang_StringZZ()
             throws SQLException {
@@ -389,18 +293,6 @@
         rs.close();
     }
 
-    /**
-     * @tests {@link java.sql.DatabaseMetaData #getColumnPrivileges(java.lang.String,
-     *        java.lang.String, java.lang.String, java.lang.String)}
-     *
-     *  NOT_FEASIBLE GRANT is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported. Received result wasn't checked.",
-        method = "getColumnPrivileges",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("not supported. Privileges are not supported.")
      public void test_getColumnPrivilegesLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
@@ -449,18 +341,6 @@
     }
 
 
-    /**
-     * @tests {@link java.sql.DatabaseMetaData #getExportedKeys(java.lang.String,
-     *        java.lang.String, java.lang.String)}
-     *
-     * NOT_FEASIBLE foreign keys are not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported. not supported. Received result wasn't checked.",
-        method = "getExportedKeys",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("not supported")
      public void test_getExportedKeysLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
@@ -513,46 +393,19 @@
         rs.close();
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getProcedureColumns(java.lang.String,
-     *        java.lang.String, java.lang.String, java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getProcedureColumns",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_getProcedureColumnsLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         meta.getProcedureColumns("", "", "", "");
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getProcedures(java.lang.String,
-     *        java.lang.String, java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getProcedures",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_getProceduresLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
         // NOT_FEASIBLE: SQLITE does not implement this functionality
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getProcedureTerm()
+     * java.sql.DatabaseMetaData#getProcedureTerm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProcedureTerm",
-        args = {}
-    )
     @KnownFailure("Exception test fails")
     public void test_getProcedureTerm() throws SQLException {
         assertTrue("Incorrect procedure term", "".equals(meta
@@ -570,14 +423,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getSchemaTerm()
+     * java.sql.DatabaseMetaData#getSchemaTerm()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getSchemaTerm",
-        args = {}
-    )
     @KnownFailure("Exception test fails")
     public void test_getSchemaTerm() throws SQLException {
         String term = meta.getSchemaTerm();
@@ -596,48 +443,16 @@
          }
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getSuperTables(java.lang.String,
-     *        java.lang.String, java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getSuperTables",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_getSuperTablesLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
         // NOT_FEASIBLE: SQLITE does not implement this functionality
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getSuperTypes(java.lang.String,
-     *        java.lang.String, java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getSuperTypes",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void test_getSuperTypesLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
         // NOT_FEASIBLE: SQLITE does not implement this functionality
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getTablePrivileges(java.lang.String,
-     *        java.lang.String, java.lang.String)
-     *
-     *  NOT_FEASIBLE GRANT is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported. Received result wasn't checked.",
-        method = "getTablePrivileges",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("not supported. Privileges are not supported.")
     public void test_getTablePrivilegesLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
@@ -734,33 +549,11 @@
         privileges.close();
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getUDTs(java.lang.String,
-     *        java.lang.String, java.lang.String, int[])
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getUDTs",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, int[].class}
-    )
     public void test_getUDTsLjava_lang_StringLjava_lang_StringLjava_lang_String$I()
             throws SQLException {
         // NOT_FEASIBLE: JDBC does not implement this functionality
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getVersionColumns(java.lang.String,
-     *        java.lang.String, java.lang.String)
-     *
-     *  NOT_FEASIBLE trigger is not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported. Received result wasn't checked.Triggers not supported",
-        method = "getVersionColumns",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("Not supported ops applied")
     public void test_getVersionColumnsLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
@@ -784,14 +577,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#isCatalogAtStart()
+     * java.sql.DatabaseMetaData#isCatalogAtStart()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isCatalogAtStart",
-        args = {}
-    )
     @KnownFailure("Exception test fails")
     public void test_isCatalogAtStart() throws SQLException {
         assertFalse(
@@ -809,100 +596,34 @@
          }
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#locatorsUpdateCopy()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "locatorsUpdateCopy",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_locatorsUpdateCopy() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.locatorsUpdateCopy());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#nullPlusNonNullIsNull()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "nullPlusNonNullIsNull",
-        args = {}
-    )
     public void test_nullPlusNonNullIsNull() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.nullPlusNonNullIsNull());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#nullsAreSortedAtEnd()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "nullsAreSortedAtEnd",
-        args = {}
-    )
     public void test_nullsAreSortedAtEnd() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.nullsAreSortedAtEnd());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#nullsAreSortedAtStart()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "nullsAreSortedAtStart",
-        args = {}
-    )
     public void test_nullsAreSortedAtStart() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.nullsAreSortedAtStart());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#nullsAreSortedHigh()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "nullsAreSortedHigh",
-        args = {}
-    )
     public void test_nullsAreSortedHigh() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.nullsAreSortedHigh());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#nullsAreSortedLow()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "nullsAreSortedLow",
-        args = {}
-    )
     public void test_nullsAreSortedLow() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.nullsAreSortedLow());
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#ownDeletesAreVisible(int)
+     * java.sql.DatabaseMetaData#ownDeletesAreVisible(int)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Not Fully Supported.",
-        method = "ownDeletesAreVisible",
-        args = {int.class}
-    )
     public void test_ownDeletesAreVisibleI() throws SQLException {
         // NOT_FEASIBLE not supported
 //        assertFalse(
@@ -919,14 +640,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#ownInsertsAreVisible(int)
+     * java.sql.DatabaseMetaData#ownInsertsAreVisible(int)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported.",
-        method = "ownInsertsAreVisible",
-        args = {int.class}
-    )
     public void test_ownInsertsAreVisibleI() throws SQLException {
 //        assertFalse(
 //                "result set's own inserts are visible for TYPE_FORWARD_ONLY type",
@@ -955,645 +670,191 @@
                 meta.ownUpdatesAreVisible(100));
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#storesLowerCaseIdentifiers()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "storesLowerCaseIdentifiers",
-        args = {}
-    )
     public void test_storesLowerCaseIdentifiers() throws SQLException {
         assertFalse(meta.storesLowerCaseIdentifiers());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#storesLowerCaseQuotedIdentifiers()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "storesLowerCaseQuotedIdentifiers",
-        args = {}
-    )
     public void test_storesLowerCaseQuotedIdentifiers() throws SQLException {
         assertFalse(meta.storesLowerCaseQuotedIdentifiers());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#storesUpperCaseIdentifiers()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "storesUpperCaseIdentifiers",
-        args = {}
-    )
     public void test_storesUpperCaseIdentifiers() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.storesUpperCaseIdentifiers());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#storesUpperCaseQuotedIdentifiers()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "storesUpperCaseQuotedIdentifiers",
-        args = {}
-    )
     public void test_storesUpperCaseQuotedIdentifiers() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.storesUpperCaseQuotedIdentifiers());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsANSI92EntryLevelSQL()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsANSI92EntryLevelSQL",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_supportsANSI92EntryLevelSQL() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsANSI92EntryLevelSQL());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsANSI92FullSQL()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsANSI92FullSQL",
-        args = {}
-    )
     public void test_supportsANSI92FullSQL() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsANSI92FullSQL());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsANSI92IntermediateSQL()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsANSI92IntermediateSQL",
-        args = {}
-    )
     public void test_supportsANSI92IntermediateSQL() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsANSI92IntermediateSQL());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsAlterTableWithAddColumn()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsAlterTableWithAddColumn",
-        args = {}
-    )
     public void test_supportsAlterTableWithAddColumn() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsAlterTableWithAddColumn());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsAlterTableWithDropColumn()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsAlterTableWithDropColumn",
-        args = {}
-    )
     public void test_supportsAlterTableWithDropColumn() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsAlterTableWithDropColumn());
-
     }
 
     public void test_supportsBatchUpdates() throws SQLException {
         assertTrue(meta.supportsBatchUpdates());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsCatalogsInDataManipulation()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsCatalogsInDataManipulation",
-        args = {}
-    )
     public void test_supportsCatalogsInDataManipulation() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsCatalogsInDataManipulation());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsCatalogsInIndexDefinitions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsCatalogsInIndexDefinitions",
-        args = {}
-    )
     public void test_supportsCatalogsInIndexDefinitions() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsCatalogsInIndexDefinitions());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsCatalogsInPrivilegeDefinitions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsCatalogsInPrivilegeDefinitions",
-        args = {}
-    )
-    public void test_supportsCatalogsInPrivilegeDefinitions()
-            throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
+    public void test_supportsCatalogsInPrivilegeDefinitions() throws SQLException {
         assertFalse(meta.supportsCatalogsInPrivilegeDefinitions());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsCatalogsInProcedureCalls()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsCatalogsInProcedureCalls",
-        args = {}
-    )
     public void test_supportsCatalogsInProcedureCalls() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsCatalogsInProcedureCalls());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsCatalogsInTableDefinitions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsCatalogsInTableDefinitions",
-        args = {}
-    )
     public void test_supportsCatalogsInTableDefinitions() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsCatalogsInTableDefinitions());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsConvert()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsConvert",
-        args = {}
-    )
     public void test_supportsConvert() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsConvert());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsConvert(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsConvert",
-        args = {int.class, int.class}
-    )
     public void test_supportsConvertII() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsConvert());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsCoreSQLGrammar()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsCoreSQLGrammar",
-        args = {}
-    )
     public void test_supportsCoreSQLGrammar() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsCoreSQLGrammar());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsCorrelatedSubqueries()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsCorrelatedSubqueries",
-        args = {}
-    )
     public void test_supportsCorrelatedSubqueries() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsCorrelatedSubqueries());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsDataDefinitionAndDataManipulationTransactions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsDataDefinitionAndDataManipulationTransactions",
-        args = {}
-    )
     @KnownFailure("not supported")
-    public void test_supportsDataDefinitionAndDataManipulationTransactions()
-            throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
+    public void test_supportsDataDefinitionAndDataManipulationTransactions() throws SQLException {
         assertFalse(meta.supportsDataDefinitionAndDataManipulationTransactions());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsDataManipulationTransactionsOnly()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsDataManipulationTransactionsOnly",
-        args = {}
-    )
-    public void test_supportsDataManipulationTransactionsOnly()
-            throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
+    public void test_supportsDataManipulationTransactionsOnly() throws SQLException {
         assertFalse(meta.supportsDataManipulationTransactionsOnly());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsDifferentTableCorrelationNames()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsDifferentTableCorrelationNames",
-        args = {}
-    )
-    public void test_supportsDifferentTableCorrelationNames()
-            throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
+    public void test_supportsDifferentTableCorrelationNames() throws SQLException {
         assertFalse(meta.supportsDifferentTableCorrelationNames());
     }
 
-
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsExtendedSQLGrammar()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsExtendedSQLGrammar",
-        args = {}
-    )
     public void test_supportsExtendedSQLGrammar() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsExtendedSQLGrammar());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsFullOuterJoins()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsFullOuterJoins",
-        args = {}
-    )
     public void test_supportsFullOuterJoins() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsFullOuterJoins());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsGetGeneratedKeys()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsGetGeneratedKeys",
-        args = {}
-    )
     public void test_supportsGetGeneratedKeys() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsGetGeneratedKeys());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsGroupByBeyondSelect()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsGroupByBeyondSelect",
-        args = {}
-    )
     public void test_supportsGroupByBeyondSelect() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsGroupByBeyondSelect());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsIntegrityEnhancementFacility()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsIntegrityEnhancementFacility",
-        args = {}
-    )
     public void test_supportsIntegrityEnhancementFacility() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsIntegrityEnhancementFacility());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsLikeEscapeClause()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsLikeEscapeClause",
-        args = {}
-    )
     public void test_supportsLikeEscapeClause() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsLikeEscapeClause());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsLimitedOuterJoins()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsLimitedOuterJoins",
-        args = {}
-    )
     public void test_supportsLimitedOuterJoins() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsLimitedOuterJoins());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsMinimumSQLGrammar()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsMinimumSQLGrammar",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_supportsMinimumSQLGrammar() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsMinimumSQLGrammar());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsMixedCaseIdentifiers()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsMixedCaseIdentifiers",
-        args = {}
-    )
     public void test_supportsMixedCaseIdentifiers() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsMixedCaseIdentifiers());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsMixedCaseQuotedIdentifiers()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsMixedCaseQuotedIdentifiers",
-        args = {}
-    )
     public void test_supportsMixedCaseQuotedIdentifiers() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsMixedCaseQuotedIdentifiers());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsMultipleOpenResults()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsMultipleOpenResults",
-        args = {}
-    )
     public void test_supportsMultipleOpenResults() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsMultipleOpenResults());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsMultipleResultSets()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsMultipleResultSets",
-        args = {}
-    )
     public void test_supportsMultipleResultSets() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsMultipleResultSets());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsMultipleTransactions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsMultipleTransactions",
-        args = {}
-    )
     public void test_supportsMultipleTransactions() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsMultipleTransactions());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsNamedParameters()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsNamedParameters",
-        args = {}
-    )
     public void test_supportsNamedParameters() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsNamedParameters());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsOpenCursorsAcrossCommit()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsOpenCursorsAcrossCommit",
-        args = {}
-    )
     public void test_supportsOpenCursorsAcrossCommit() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsOpenCursorsAcrossCommit());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsOpenCursorsAcrossRollback()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsOpenCursorsAcrossRollback",
-        args = {}
-    )
     public void test_supportsOpenCursorsAcrossRollback() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsOpenCursorsAcrossRollback());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsOpenStatementsAcrossCommit()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsOpenStatementsAcrossCommit",
-        args = {}
-    )
     public void test_supportsOpenStatementsAcrossCommit() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsOpenStatementsAcrossCommit());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsOpenStatementsAcrossRollback()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsOpenStatementsAcrossRollback",
-        args = {}
-    )
     public void test_supportsOpenStatementsAcrossRollback() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsOpenStatementsAcrossRollback());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsOuterJoins()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsOuterJoins",
-        args = {}
-    )
     public void test_supportsOuterJoins() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsOuterJoins());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsPositionedDelete()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsPositionedDelete",
-        args = {}
-    )
     public void test_supportsPositionedDelete() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsPositionedDelete());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsPositionedUpdate()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsPositionedUpdate",
-        args = {}
-    )
     public void test_supportsPositionedUpdate() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsPositionedUpdate());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsResultSetConcurrency(int, int)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsResultSetConcurrency",
-        args = {int.class, int.class}
-    )
     public void test_supportsResultSetConcurrencyII() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsResultSetConcurrency(0,0));
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsResultSetHoldability(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsResultSetHoldability",
-        args = {int.class}
-    )
     public void test_supportsResultSetHoldabilityI() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsResultSetHoldability(0));
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsResultSetType(int)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported. Verification with invalid parameters missed.",
-        method = "supportsResultSetType",
-        args = {int.class}
-    )
     @KnownFailure("not supported")
     public void test_supportsResultSetTypeI() throws SQLException {
-        // NOT_FEASIBLE not supported
         assertTrue("database supports TYPE_FORWARD_ONLY type", meta
                 .supportsResultSetType(ResultSet.TYPE_FORWARD_ONLY));
         assertFalse("database doesn't support TYPE_SCROLL_INSENSITIVE type",
@@ -1604,170 +865,52 @@
                 .supportsResultSetType(100));
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSavepoints()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSavepoints",
-        args = {}
-    )
     public void test_supportsSavepoints() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsSavepoints());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSchemasInDataManipulation()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSchemasInDataManipulation",
-        args = {}
-    )
     public void test_supportsSchemasInDataManipulation() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsSchemasInDataManipulation());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSchemasInIndexDefinitions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSchemasInIndexDefinitions",
-        args = {}
-    )
     public void test_supportsSchemasInIndexDefinitions() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsSchemasInIndexDefinitions());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSchemasInPrivilegeDefinitions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSchemasInPrivilegeDefinitions",
-        args = {}
-    )
-    public void test_supportsSchemasInPrivilegeDefinitions()
-            throws SQLException {
+    public void test_supportsSchemasInPrivilegeDefinitions() throws SQLException {
         // NOT_FEASIBLE: SQLITE does not implement this functionality
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSchemasInProcedureCalls()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSchemasInProcedureCalls",
-        args = {}
-    )
     public void test_supportsSchemasInProcedureCalls() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsSchemasInProcedureCalls());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSchemasInTableDefinitions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSchemasInTableDefinitions",
-        args = {}
-    )
     public void test_supportsSchemasInTableDefinitions() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsSchemasInTableDefinitions());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsStatementPooling()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsStatementPooling",
-        args = {}
-    )
     public void test_supportsStatementPooling() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsStatementPooling());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsStoredProcedures()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsStoredProcedures",
-        args = {}
-    )
     public void test_supportsStoredProcedures() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsStoredProcedures());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSubqueriesInComparisons()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSubqueriesInComparisons",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_supportsSubqueriesInComparisons() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsSubqueriesInComparisons());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSubqueriesInIns()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSubqueriesInIns",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_supportsSubqueriesInIns() throws SQLException {
         assertFalse(meta.supportsSubqueriesInIns());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsSubqueriesInQuantifieds()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsSubqueriesInQuantifieds",
-        args = {}
-    )
     public void test_supportsSubqueriesInQuantifieds() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.supportsSubqueriesInQuantifieds());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#supportsTransactions()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "supportsTransactions",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_supportsTransactions() throws SQLException {
         assertFalse(meta.supportsTransactions());
@@ -1781,265 +924,143 @@
         assertTrue(meta.supportsUnionAll());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#usesLocalFilePerTable()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "usesLocalFilePerTable",
-        args = {}
-    )
     public void test_usesLocalFilePerTable() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.usesLocalFilePerTable());
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#usesLocalFiles()
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "usesLocalFiles",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_usesLocalFiles() throws SQLException {
-        // NOT_FEASIBLE: SQLITE does not implement this functionality
         assertFalse(meta.usesLocalFiles());
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxBinaryLiteralLength()
+     * java.sql.DatabaseMetaData#getMaxBinaryLiteralLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxBinaryLiteralLength",
-        args = {}
-    )
     public void test_getMaxBinaryLiteralLength() throws SQLException {
         assertTrue("Incorrect binary literal length", meta
                 .getMaxBinaryLiteralLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxCatalogNameLength()
+     * java.sql.DatabaseMetaData#getMaxCatalogNameLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxCatalogNameLength",
-        args = {}
-    )
     public void test_getMaxCatalogNameLength() throws SQLException {
         assertTrue("Incorrect name length", meta.getMaxCatalogNameLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxCharLiteralLength()
+     * java.sql.DatabaseMetaData#getMaxCharLiteralLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxCharLiteralLength",
-        args = {}
-    )
     public void test_getMaxCharLiteralLength() throws SQLException {
         assertTrue("Incorrect char literal length", meta
                 .getMaxCharLiteralLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxColumnNameLength()
+     * java.sql.DatabaseMetaData#getMaxColumnNameLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxColumnNameLength",
-        args = {}
-    )
     public void test_getMaxColumnNameLength() throws SQLException {
         assertTrue("Incorrect column name length", meta
                 .getMaxColumnNameLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxColumnsInGroupBy()
+     * java.sql.DatabaseMetaData#getMaxColumnsInGroupBy()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxColumnsInGroupBy",
-        args = {}
-    )
     public void test_getMaxColumnsInGroupBy() throws SQLException {
         assertTrue("Incorrect number of columns",
                 meta.getMaxColumnsInGroupBy() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxColumnsInIndex()
+     * java.sql.DatabaseMetaData#getMaxColumnsInIndex()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxColumnsInIndex",
-        args = {}
-    )
     public void test_getMaxColumnsInIndex() throws SQLException {
         assertTrue("Incorrect number of columns",
                 meta.getMaxColumnsInIndex() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxColumnsInOrderBy()
+     * java.sql.DatabaseMetaData#getMaxColumnsInOrderBy()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxColumnsInOrderBy",
-        args = {}
-    )
     public void test_getMaxColumnsInOrderBy() throws SQLException {
         assertTrue("Incorrect number of columns",
                 meta.getMaxColumnsInOrderBy() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxColumnsInSelect()
+     * java.sql.DatabaseMetaData#getMaxColumnsInSelect()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxColumnsInSelect",
-        args = {}
-    )
     public void test_getMaxColumnsInSelect() throws SQLException {
         assertTrue("Incorrect number of columns",
                 meta.getMaxColumnsInSelect() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxColumnsInTable()
+     * java.sql.DatabaseMetaData#getMaxColumnsInTable()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxColumnsInTable",
-        args = {}
-    )
     public void test_getMaxColumnsInTable() throws SQLException {
         assertTrue("Incorrect number of columns",
                 meta.getMaxColumnsInTable() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxConnections()
+     * java.sql.DatabaseMetaData#getMaxConnections()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxConnections",
-        args = {}
-    )
     public void test_getMaxConnections() throws SQLException {
         assertTrue("Incorrect number of connections",
                 meta.getMaxConnections() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxIndexLength()
+     * java.sql.DatabaseMetaData#getMaxIndexLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxIndexLength",
-        args = {}
-    )
     public void test_getMaxIndexLength() throws SQLException {
         assertTrue("Incorrect length of index", meta.getMaxIndexLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxProcedureNameLength()
+     * java.sql.DatabaseMetaData#getMaxProcedureNameLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxProcedureNameLength",
-        args = {}
-    )
     public void test_getMaxProcedureNameLength() throws SQLException {
         assertTrue("Incorrect length of procedure name", meta
                 .getMaxProcedureNameLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxRowSize()
+     * java.sql.DatabaseMetaData#getMaxRowSize()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxRowSize",
-        args = {}
-    )
     public void test_getMaxRowSize() throws SQLException {
         assertTrue("Incorrect size of row", meta.getMaxRowSize() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxSchemaNameLength()
+     * java.sql.DatabaseMetaData#getMaxSchemaNameLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxSchemaNameLength",
-        args = {}
-    )
     public void test_getMaxSchemaNameLength() throws SQLException {
         assertTrue("Incorrect length of schema name", meta
                 .getMaxSchemaNameLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxStatementLength()
+     * java.sql.DatabaseMetaData#getMaxStatementLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxStatementLength",
-        args = {}
-    )
     public void test_getMaxStatementLength() throws SQLException {
         assertTrue("Incorrect length of statement", meta
                 .getMaxStatementLength() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxStatements()
+     * java.sql.DatabaseMetaData#getMaxStatements()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxStatements",
-        args = {}
-    )
     public void test_getMaxStatements() throws SQLException {
         assertTrue("Incorrect number of statements",
                 meta.getMaxStatements() == 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxTableNameLength()
+     * java.sql.DatabaseMetaData#getMaxTableNameLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxTableNameLength",
-        args = {}
-    )
     @KnownFailure("Exception test fails")
     public void test_getMaxTableNameLength() throws SQLException {
         assertTrue("Now supported", meta
@@ -2057,14 +1078,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxTablesInSelect()
+     * java.sql.DatabaseMetaData#getMaxTablesInSelect()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported",
-        method = "getMaxTablesInSelect",
-        args = {}
-    )
     @KnownFailure("Exception test fails")
     public void test_getMaxTablesInSelect() throws SQLException {
         assertTrue("Tables in select is now supported: change test implementation\"",
@@ -2082,14 +1097,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxUserNameLength()
+     * java.sql.DatabaseMetaData#getMaxUserNameLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "usernames not supported",
-        method = "getMaxUserNameLength",
-        args = {}
-    )
     @KnownFailure("Exception test fails")
     public void test_getMaxUserNameLength() throws SQLException {
         assertTrue("Usernames are now supported: change test implementation",
diff --git a/luni/src/test/java/tests/java/sql/DatabaseMetaDataTest.java b/luni/src/test/java/tests/java/sql/DatabaseMetaDataTest.java
index 09abcd4..67818c5 100755
--- a/luni/src/test/java/tests/java/sql/DatabaseMetaDataTest.java
+++ b/luni/src/test/java/tests/java/sql/DatabaseMetaDataTest.java
@@ -16,10 +16,6 @@
 package tests.java.sql;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.extensions.TestSetup;
 import junit.framework.Test;
@@ -44,7 +40,6 @@
 import java.util.Random;
 import java.util.StringTokenizer;
 
-@TestTargetClass(DatabaseMetaData.class)
 public class DatabaseMetaDataTest extends TestCase {
     private static String VIEW_NAME = "myView";
 
@@ -163,15 +158,9 @@
     */
 
     /**
-     * @tests {@link java.sql.DatabaseMetaData #getBestRowIdentifier(java.lang.String,
+     * {@link java.sql.DatabaseMetaData #getBestRowIdentifier(java.lang.String,
      *        java.lang.String, java.lang.String, int, boolean) }
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Not all variants of parameters can be tested: updates on resultSets are not supported.",
-        method = "getBestRowIdentifier",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, int.class, boolean.class}
-    )
     public void test_getBestRowIdentifierLjava_lang_StringLjava_lang_StringLjava_lang_StringIZ()
             throws SQLException {
         ResultSet result = statementForward.executeQuery("SELECT * FROM "
@@ -229,16 +218,10 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData #getColumns(java.lang.String,
+     * java.sql.DatabaseMetaData #getColumns(java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String)
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Tests Columns and search for arbitrary columns. test fails: Columns Name's not according to spec.",
-        method = "getColumns",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("Not supported : pattern with %")
     public void test_getColumnsArbitrary() throws SQLException {
         ResultSet setAllNull = null;
@@ -278,16 +261,10 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData #getColumns(java.lang.String,
+     * java.sql.DatabaseMetaData #getColumns(java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String)
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Tests getColumns with no Catalog and Schema. test fails on arguments: '', '', '%', '%'",
-        method = "getColumns",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("Not supported ops applied: test fails on arguments: '', '', '%', '%' ")
     public void test_getColumnsTableWithNoCatalogSchema() throws SQLException{
 
@@ -351,16 +328,10 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData #getColumns(java.lang.String,
+     * java.sql.DatabaseMetaData #getColumns(java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String)
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "tests for specific tables. test fails: invalid nullable value.",
-        method = "getColumns",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("Wildcard operator does not seem wo work correctly.")
     public void test_getColumnsSpecific() throws SQLException {
         String[] tablesName = {
@@ -447,14 +418,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#getConnection()
+     * java.sql.DatabaseMetaData#getConnection()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getConnection",
-        args = {}
-    )
     public void test_getConnection() throws SQLException {
         assertEquals("Incorrect connection value", conn, meta.getConnection());
 
@@ -470,16 +435,10 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData #getCrossReference(java.lang.String,
+     * java.sql.DatabaseMetaData #getCrossReference(java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String,
      *        java.lang.String, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Test fails: Foreign keys not supported",
-        method = "getCrossReference",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("(Ticket 91) Tables apply foreign key constraint. Catalogs not supported")
     public void test_getCrossReferenceLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
@@ -558,14 +517,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDatabaseMajorVersion()
+     * java.sql.DatabaseMetaData#getDatabaseMajorVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getDatabaseMajorVersion",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getDatabaseMajorVersion() throws SQLException {
         assertTrue("Incorrdct database major version", meta
@@ -584,14 +537,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDatabaseMinorVersion()
+     * java.sql.DatabaseMetaData#getDatabaseMinorVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getDatabaseMinorVersion",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getDatabaseMinorVersion() throws SQLException {
         assertTrue("Incorrect database minor version", meta
@@ -609,14 +556,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDatabaseProductName()
+     * java.sql.DatabaseMetaData#getDatabaseProductName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getDatabaseProductName",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getDatabaseProductName() throws SQLException {
         assertTrue("Incorrect database product name", !"".equals(meta
@@ -635,14 +576,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDatabaseProductVersion()
+     * java.sql.DatabaseMetaData#getDatabaseProductVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getDatabaseProductVersion",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getDatabaseProductVersion() throws SQLException {
         assertTrue("Incorrect database product version", !"".equals(meta
@@ -659,14 +594,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDefaultTransactionIsolation()
+     * java.sql.DatabaseMetaData#getDefaultTransactionIsolation()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getDefaultTransactionIsolation",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getDefaultTransactionIsolation() throws SQLException {
         int defaultLevel = meta.getDefaultTransactionIsolation();
@@ -694,42 +623,24 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDriverMajorVersion()
+     * java.sql.DatabaseMetaData#getDriverMajorVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDriverMajorVersion",
-        args = {}
-    )
     public void test_getDriverMajorVersion()  throws SQLException {
         assertTrue("Incorrect driver major version", meta
                 .getDriverMajorVersion() >= 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDriverMinorVersion()
+     * java.sql.DatabaseMetaData#getDriverMinorVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDriverMinorVersion",
-        args = {}
-    )
     public void test_getDriverMinorVersion() {
         assertTrue("Incorrect driver minor version", meta
                 .getDriverMinorVersion() >= 0);
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDriverName()
+     * java.sql.DatabaseMetaData#getDriverName()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getDriverName",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getDriverName() throws SQLException {
         String driverName = meta.getDriverName();
@@ -748,14 +659,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getDriverVersion()
+     * java.sql.DatabaseMetaData#getDriverVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDriverVersion",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getDriverVersion() throws SQLException {
         assertTrue("Incorrect driver version", !"".equals(meta
@@ -774,16 +679,6 @@
     }
 
 
-    /**
-     * @tests java.sql.DatabaseMetaData #getImportedKeys(java.lang.String,
-     *        java.lang.String, java.lang.String)
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "Test fails: Keys are not supported",
-        method = "getImportedKeys",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure("Keys are not supported: Ticket 91")
     public void test_getImportedKeysLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
@@ -848,14 +743,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getMaxCursorNameLength()
+     * java.sql.DatabaseMetaData#getMaxCursorNameLength()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxCursorNameLength",
-        args = {}
-    )
     public void test_getMaxCursorNameLength() throws SQLException {
         int nameLength = meta.getMaxCursorNameLength();
         if (nameLength > 0) {
@@ -871,14 +760,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getJDBCMinorVersion()
+     * java.sql.DatabaseMetaData#getJDBCMinorVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getJDBCMinorVersion",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getJDBCMinorVersion() throws SQLException {
         assertTrue("Incorrect JDBC minor version",
@@ -897,14 +780,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getJDBCMajorVersion()
+     * java.sql.DatabaseMetaData#getJDBCMajorVersion()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getJDBCMajorVersion",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getJDBCMajorVersion() throws SQLException {
         assertTrue("Incorrect JDBC major version",
@@ -924,14 +801,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#getNumericFunctions()
+     * java.sql.DatabaseMetaData#getNumericFunctions()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Test fails. Not implemented correctly. SQLException checking test fails",
-        method = "getNumericFunctions",
-        args = {}
-    )
     @KnownFailure("Not supported feature, Ticket 98. Broken because "+
             "NUMERIC_FUNCTIONS not complete. When fixed change to @KnownFailure")
     public void test_getNumericFunctions() throws SQLException {
@@ -951,15 +822,9 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData #getPrimaryKeys(java.lang.String,
+     * java.sql.DatabaseMetaData #getPrimaryKeys(java.lang.String,
      *        java.lang.String, java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Functionality test fails: keys and catalogs are not supported.",
-        method = "getPrimaryKeys",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     @KnownFailure(" Ticket 91 : relies on not supported features: getCatalog, keys")
     public void test_getPrimaryKeysLjava_lang_StringLjava_lang_StringLjava_lang_String()
             throws SQLException {
@@ -1001,14 +866,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getResultSetHoldability()
+     * java.sql.DatabaseMetaData#getResultSetHoldability()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getResultSetHoldability",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getResultSetHoldability() throws SQLException {
         int hdb = meta.getResultSetHoldability();
@@ -1036,14 +895,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getSQLKeywords()
+     * java.sql.DatabaseMetaData#getSQLKeywords()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getSQLKeywords",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getSQLKeywords() throws SQLException {
         assertTrue("Incorrect SQL keywords", !"".equals(meta.getSQLKeywords()
@@ -1062,14 +915,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getSQLStateType()
+     * java.sql.DatabaseMetaData#getSQLStateType()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getSQLStateType",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getSQLStateType() throws SQLException {
         int type = meta.getSQLStateType();
@@ -1096,14 +943,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getSchemas()
+     * java.sql.DatabaseMetaData#getSchemas()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getSchemas",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getSchemas() throws SQLException {
         ResultSet rs = meta.getSchemas();
@@ -1132,14 +973,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getSearchStringEscape()
+     * java.sql.DatabaseMetaData#getSearchStringEscape()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getSearchStringEscape",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getSearchStringEscape() throws SQLException {
         assertTrue("Incorrect search string escape", !"".equals(meta
@@ -1158,14 +993,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getStringFunctions()
+     * java.sql.DatabaseMetaData#getStringFunctions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Functionality test fails. SQLException checking test fails",
-        method = "getStringFunctions",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_getStringFunctions() throws SQLException {
         escapedFunctions(STRING_FUNCTIONS, meta.getStringFunctions());
@@ -1186,14 +1015,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#getSystemFunctions()
+     * java.sql.DatabaseMetaData#getSystemFunctions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Functionality test fails. SQLException checking test fails",
-        method = "getSystemFunctions",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_getSystemFunctions() throws SQLException {
         escapedFunctions(SYSTEM_FUNCTIONS, meta.getSystemFunctions());
@@ -1213,14 +1036,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#getTableTypes()
+     * java.sql.DatabaseMetaData#getTableTypes()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getTableTypes",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getTableTypes() throws SQLException {
         String[] tableTypes = { "LOCAL TEMPORARY", "TABLE", "VIEW" };
@@ -1246,15 +1063,9 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData #getTables(java.lang.String,
+     * java.sql.DatabaseMetaData #getTables(java.lang.String,
      *        java.lang.String, java.lang.String, java.lang.String[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Test fails.",
-        method = "getTables",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String[].class}
-    )
     @KnownFailure("If no schema is associated: returns empty string where actually null be returned?. Ticket 98")
     public void test_getTablesLjava_lang_StringLjava_lang_StringLjava_lang_String$Ljava_lang_String()
             throws SQLException {
@@ -1328,14 +1139,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getTimeDateFunctions()
+     * java.sql.DatabaseMetaData#getTimeDateFunctions()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Does not return any functions. test fails. SQLException checking test fails",
-        method = "getTimeDateFunctions",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_getTimeDateFunctions() throws SQLException {
 
@@ -1354,14 +1159,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#getTypeInfo()
+     * java.sql.DatabaseMetaData#getTypeInfo()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getTypeInfo",
-        args = {}
-    )
     @KnownFailure("not supported")
     public void test_getTypeInfo() throws SQLException {
         insertNewRecord();
@@ -1411,14 +1210,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#getURL()
+     * java.sql.DatabaseMetaData#getURL()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getURL",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_getURL() throws SQLException {
         assertEquals("Wrong url", Support_SQL.sqlUrl, meta.getURL());
@@ -1435,18 +1228,7 @@
 
     }
 
-    /**
-     * @tests java.sql.DatabaseMetaData#getUserName()
-     *
-     *  NOT_FEASIBLE not supported
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "getUserName",
-        args = {}
-    )
-     @KnownFailure("Ticket 98")
+    @KnownFailure("Ticket 98")
     public void s() throws SQLException {
       assertEquals("Wrong user name", Support_SQL.sqlUser, meta.getUserName());
 
@@ -1464,14 +1246,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#insertsAreDetected(int)
+     * java.sql.DatabaseMetaData#insertsAreDetected(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "insertsAreDetected",
-        args = {int.class}
-    )
     @KnownFailure("Ticket 98")
     public void test_insertsAreDetectedI() throws SQLException {
         assertFalse(
@@ -1498,14 +1274,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#isReadOnly()
+     * java.sql.DatabaseMetaData#isReadOnly()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "isReadOnly",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_isReadOnly() throws SQLException {
         assertFalse("database is not read-only", meta.isReadOnly());
@@ -1523,14 +1293,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#othersDeletesAreVisible(int)
+     * java.sql.DatabaseMetaData#othersDeletesAreVisible(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails.",
-        method = "othersDeletesAreVisible",
-        args = {int.class}
-    )
     @KnownFailure("Ticket 98")
     public void test_othersDeletesAreVisibleI() throws SQLException {
         assertFalse(
@@ -1558,14 +1322,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#othersInsertsAreVisible(int)
+     * java.sql.DatabaseMetaData#othersInsertsAreVisible(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "othersInsertsAreVisible",
-        args = {int.class}
-    )
     @KnownFailure("Ticket 98")
     public void test_othersInsertsAreVisibleI() throws SQLException {
         assertFalse(
@@ -1593,14 +1351,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#othersUpdatesAreVisible(int)
+     * java.sql.DatabaseMetaData#othersUpdatesAreVisible(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = " Verification with invalid parameters missed.",
-        method = "othersUpdatesAreVisible",
-        args = {int.class}
-    )
     @KnownFailure("Ticket 98")
     public void test_othersUpdatesAreVisibleI() throws SQLException {
         assertFalse(
@@ -1625,22 +1377,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#storesMixedCaseQuotedIdentifiers()
+     * java.sql.DatabaseMetaData#storesMixedCaseQuotedIdentifiers()
      */
-    @TestTargets ({
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "storesMixedCaseQuotedIdentifiers",
-        args = {}
-    ),
-    @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "SQLException checking test fails",
-            method = "storesMixedCaseIdentifiers",
-            args = {}
-        )
-    })
     public void test_storesMixedCaseQuotedIdentifiers() throws SQLException {
         String quote = meta.getIdentifierQuoteString();
 
@@ -1684,12 +1422,6 @@
 
     }
 
-    @TestTargetNew(
-      level = TestLevel.COMPLETE,
-      notes = "Exception test fails.",
-      method = "getIdentifierQuoteString",
-      args = {}
-    )
     @KnownFailure("Ticket 98")
     public void testGetIdentifierQuoteString() throws SQLException {
        assertNotNull(
@@ -1711,14 +1443,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsColumnAliasing()
+     * java.sql.DatabaseMetaData#supportsColumnAliasing()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsColumnAliasing",
-        args = {}
-    )
     @KnownFailure("not supported. SQLException checking test fails")
     public void test_supportsColumnAliasing() throws SQLException {
         insertNewRecord();
@@ -1754,14 +1480,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsExpressionsInOrderBy()
+     * java.sql.DatabaseMetaData#supportsExpressionsInOrderBy()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsExpressionsInOrderBy",
-        args = {}
-    )
     @KnownFailure("exception test fails")
     public void test_supportsExpressionsInOrderBy() throws SQLException {
         insertNewRecord();
@@ -1794,14 +1514,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsGroupBy()
+     * java.sql.DatabaseMetaData#supportsGroupBy()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsGroupBy",
-        args = {}
-    )
     @KnownFailure("exception test fails")
     public void test_supportsGroupBy() throws SQLException {
         insertNewRecord();
@@ -1834,14 +1548,8 @@
 
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsGroupByUnrelated()
+     * java.sql.DatabaseMetaData#supportsGroupByUnrelated()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsGroupByUnrelated",
-        args = {}
-    )
     @KnownFailure("exception test fails")
     public void test_supportsGroupByUnrelated() throws SQLException {
         insertNewRecord();
@@ -1873,14 +1581,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsNonNullableColumns()
+     * java.sql.DatabaseMetaData#supportsNonNullableColumns()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException thrown",
-        method = "supportsNonNullableColumns",
-        args = {}
-    )
     @KnownFailure("Ticket 98")
     public void test_supportsNonNullableColumns() throws SQLException {
         assertTrue(
@@ -1903,14 +1605,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsOrderByUnrelated()
+     * java.sql.DatabaseMetaData#supportsOrderByUnrelated()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsOrderByUnrelated",
-        args = {}
-    )
     @KnownFailure("exception test fails")
     public void test_supportsOrderByUnrelated() throws SQLException {
         insertNewRecord();
@@ -1942,14 +1638,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsSelectForUpdate()
+     * java.sql.DatabaseMetaData#supportsSelectForUpdate()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsSelectForUpdate",
-        args = {}
-    )
     @KnownFailure("exception test fails")
     public void test_supportsSelectForUpdate() throws SQLException {
         insertNewRecord();
@@ -1982,14 +1672,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsSubqueriesInExists()
+     * java.sql.DatabaseMetaData#supportsSubqueriesInExists()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsSubqueriesInExists",
-        args = {}
-    )
     @KnownFailure("exception test fails")
     public void test_supportsSubqueriesInExists() throws SQLException {
         insertNewRecord();
@@ -2024,14 +1708,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsTableCorrelationNames()
+     * java.sql.DatabaseMetaData#supportsTableCorrelationNames()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException checking test fails",
-        method = "supportsTableCorrelationNames",
-        args = {}
-    )
     @KnownFailure("exception test fails")
     public void test_supportsTableCorrelationNames() throws SQLException {
 
@@ -2069,14 +1747,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#supportsTransactionIsolationLevel(int)
+     * java.sql.DatabaseMetaData#supportsTransactionIsolationLevel(int)
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = " Not all Transaction isolation levels supported.",
-        method = "supportsTransactionIsolationLevel",
-        args = {int.class}
-    )
     public void test_supportsTransactionIsolationLevelI() throws SQLException {
         assertFalse("database supports TRANSACTION_NONE isolation level", meta
                 .supportsTransactionIsolationLevel(Connection.TRANSACTION_NONE));
@@ -2110,14 +1782,8 @@
     }
 
     /**
-     * @tests java.sql.DatabaseMetaData#updatesAreDetected(int)
+     * java.sql.DatabaseMetaData#updatesAreDetected(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = " Verification with invalid parameters missed.",
-        method = "updatesAreDetected",
-        args = {int.class}
-    )
     public void test_updatesAreDetectedI() throws SQLException {
         assertFalse(
                 "visible row update can be detected for TYPE_FORWARD_ONLY type",
@@ -2578,12 +2244,6 @@
       *
       * @throws SQLException
       */
-     @TestTargetNew(
-             level = TestLevel.PARTIAL_COMPLETE,
-             notes = "Derby test for getSchema",
-             method = "getSchemas",
-             args = {}
-         )
      public void testGetSchemasReadOnly() throws SQLException {
 
          ResultSet rs = meta.getSchemas();
diff --git a/luni/src/test/java/tests/java/sql/DeleteFunctionalityTest.java b/luni/src/test/java/tests/java/sql/DeleteFunctionalityTest.java
index f760d1d..53e3eb3 100755
--- a/luni/src/test/java/tests/java/sql/DeleteFunctionalityTest.java
+++ b/luni/src/test/java/tests/java/sql/DeleteFunctionalityTest.java
@@ -16,10 +16,6 @@
 package tests.java.sql;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
@@ -35,7 +31,7 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
-@TestTargetClass(Statement.class)
+
 public class DeleteFunctionalityTest extends TestCase {
 
     private static Connection conn = null;
@@ -104,15 +100,9 @@
     }
 
     /**
-     * @tests DeleteFunctionalityTest#testDelete1(). Deletes row with no
+     * DeleteFunctionalityTest#testDelete1(). Deletes row with no
      *        referencing ones and RESTRICT action
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Deletes row with no referencing ones and RESTRICT action",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
     public void testDelete1() throws SQLException {
         DatabaseCreator.fillFKStrictTable(conn);
         statement.execute("DELETE FROM " + DatabaseCreator.PARENT_TABLE
@@ -120,7 +110,7 @@
     }
 
     /**
-     * @tests DeleteFunctionalityTest#testDelete2(). Attempts to delete row with
+     * DeleteFunctionalityTest#testDelete2(). Attempts to delete row with
      *        referencing ones and RESTRICT action - expecting SQLException
      *  TODO foreign key functionality is not supported
      */
@@ -136,15 +126,9 @@
     }
 */
     /**
-     * @tests DeleteFunctionalityTest#testDelete3(). Deletes all referencing
+     * DeleteFunctionalityTest#testDelete3(). Deletes all referencing
      *        rows and then deletes referenced one
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Deletes all referencing rows and then deletes referenced one",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
     public void testDelete3() throws SQLException {
         statement.execute("DELETE FROM " + DatabaseCreator.FKSTRICT_TABLE
                 + " WHERE name_id = 1;");
@@ -153,15 +137,9 @@
     }
 
     /**
-     * @tests DeleteFunctionalityTest#testDelete4(). Deletes row with no
+     * DeleteFunctionalityTest#testDelete4(). Deletes row with no
      *        referencing ones and CASCADE action
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Deletes row with no referencing ones and CASCADE action",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
     public void testDelete4() throws SQLException {
         DatabaseCreator.fillFKCascadeTable(conn);
         statement.execute("DELETE FROM " + DatabaseCreator.PARENT_TABLE
@@ -169,24 +147,10 @@
     }
 
     /**
-     * @tests DeleteFunctionalityTest#testDelete5(). Attempts to delete row with
+     * DeleteFunctionalityTest#testDelete5(). Attempts to delete row with
      *        referencing ones and CASCADE action - expecting all referencing
      *        rows will also be deleted
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Attempts to delete row with referencing ones and CASCADE action - expecting all referencing rows will also be deleted",
-            method = "execute",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Attempts to delete row with referencing ones and CASCADE action - expecting all referencing rows will also be deleted",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testDelete5() throws SQLException {
         statement.execute("DELETE FROM " + DatabaseCreator.PARENT_TABLE
                 + " WHERE id = 1;");
@@ -199,15 +163,9 @@
     }
 
     /**
-     * @tests DeleteFunctionalityTest#testDelete6().
+     * DeleteFunctionalityTest#testDelete6().
      *  TODO Foreign key functionality is not supported
      */
-    @TestTargetNew(
-      level = TestLevel.PARTIAL_COMPLETE,
-      notes = "Deletes rows using subquery in WHERE clause with foreign keys. Foreign keys not supported.",
-      method = "execute",
-      args = {String.class}
-    )
     @KnownFailure("not supported")
     public void testDelete6() throws SQLException {
         DatabaseCreator.fillFKStrictTable(conn);
@@ -222,15 +180,9 @@
     }
 
     /**
-     * @tests DeleteFunctionalityTest#testDelete7(). Deletes rows using
+     * DeleteFunctionalityTest#testDelete7(). Deletes rows using
      *        PreparedStatement
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Deletes rows using PreparedStatement",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void testDelete7() throws SQLException {
         DatabaseCreator.fillTestTable5(conn);
         PreparedStatement stat = conn.prepareStatement("DELETE FROM "
diff --git a/luni/src/test/java/tests/java/sql/InsertFunctionalityTest.java b/luni/src/test/java/tests/java/sql/InsertFunctionalityTest.java
index 825352f..3c6c28f 100755
--- a/luni/src/test/java/tests/java/sql/InsertFunctionalityTest.java
+++ b/luni/src/test/java/tests/java/sql/InsertFunctionalityTest.java
@@ -15,12 +15,6 @@
  */
 package tests.java.sql;
 
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.PreparedStatement;
@@ -36,7 +30,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(Statement.class)
 public class InsertFunctionalityTest extends TestCase {
 
     private static Connection conn = null;
@@ -116,15 +109,9 @@
     }
 
     /**
-     * @tests InsertFunctionalityTest#testInsert1(). Attempts to insert row into
+     * InsertFunctionalityTest#testInsert1(). Attempts to insert row into
      *        table with integrity checking
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Attempts to insert row into table with integrity checking",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
     public void testInsert1() throws SQLException {
         DatabaseCreator.fillParentTable(conn);
         DatabaseCreator.fillFKStrictTable(conn);
@@ -136,16 +123,10 @@
     }
 
     /**
-     * @tests InsertFunctionalityTest#testInsert2(). Attempts to insert row into
+     * InsertFunctionalityTest#testInsert2(). Attempts to insert row into
      *        table with integrity checking when row has incorrect foreign key
      *        value - expecting SQLException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Attempts to insert row into table with integrity checking when row has incorrect foreign key value - expecting SQLException",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
     public void testInsert2() throws SQLException {
         DatabaseCreator.fillParentTable(conn);
         DatabaseCreator.fillFKStrictTable(conn);
@@ -169,23 +150,9 @@
     }
 
     /**
-     * @tests InsertFunctionalityTest#testInsert3(). Tests INSERT ... SELECT
+     * InsertFunctionalityTest#testInsert3(). Tests INSERT ... SELECT
      *        functionality
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Tests INSERT ... SELECT functionality",
-            method = "execute",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Tests INSERT ... SELECT functionality",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testInsert3() throws SQLException {
         DatabaseCreator.fillParentTable(conn);
         DatabaseCreator.fillFKStrictTable(conn);
@@ -200,23 +167,9 @@
     }
 
     /**
-     * @tests InsertFunctionalityTest#testInsert4(). Tests INSERT ... SELECT
+     * InsertFunctionalityTest#testInsert4(). Tests INSERT ... SELECT
      *        with expressions in SELECT query
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Tests INSERT ... SELECT with expressions in SELECT query",
-            method = "execute",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Tests INSERT ... SELECT with expressions in SELECT query",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testInsert4() throws SQLException {
         DatabaseCreator.fillSimpleTable1(conn);
         statement.execute("INSERT INTO " + DatabaseCreator.SIMPLE_TABLE2
@@ -232,23 +185,9 @@
     }
 
     /**
-     * @tests InsertFunctionalityTest#testInsert5(). Inserts multiple rows using
+     * InsertFunctionalityTest#testInsert5(). Inserts multiple rows using
      *        UNION ALL
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Inserts multiple rows using UNION ALL",
-            method = "execute",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Inserts multiple rows using UNION ALL",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testInsert5() throws SQLException {
         statement.execute("INSERT INTO " + DatabaseCreator.TEST_TABLE5
                 + " SELECT 1 as testId, 2 as testValue "
@@ -262,15 +201,9 @@
     }
 
     /**
-     * @tests InsertFunctionalityTest#testInsert6(). Tests INSERT with
+     * InsertFunctionalityTest#testInsert6(). Tests INSERT with
      *        PreparedStatement
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Tests INSERT with PreparedStatement",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void testInsertPrepared() throws SQLException {
         PreparedStatement stat = conn.prepareStatement("INSERT INTO "
                 + DatabaseCreator.TEST_TABLE5 + " VALUES(?, ?)");
diff --git a/luni/src/test/java/tests/java/sql/MultiThreadAccessTest.java b/luni/src/test/java/tests/java/sql/MultiThreadAccessTest.java
index d7dd0bf..947777b 100755
--- a/luni/src/test/java/tests/java/sql/MultiThreadAccessTest.java
+++ b/luni/src/test/java/tests/java/sql/MultiThreadAccessTest.java
@@ -16,11 +16,6 @@
 
 package tests.java.sql;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigDecimal;
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -37,7 +32,6 @@
 
 import tests.support.ThreadPool;
 
-@TestTargetClass(Statement.class)
 public class MultiThreadAccessTest extends TestCase {
 
     private static Connection conn;
@@ -123,12 +117,6 @@
      *
      * @throws SQLException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Functionality test: A few threads execute select operation in the same time for one table in the database.",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_MultipleAccessToOneTable() throws SQLException {
         for (int i = 0; i < numThreads; i++) {
             threadPool.runTask(createTask1(i));
@@ -142,12 +130,6 @@
      *
      * @throws SQLException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Functionality test: A few threads execute select operation in the same time for different tables in the database",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_MultipleAccessToSeveralTables() throws SQLException {
         threadPool.runTask(createTask1(1));
         threadPool.runTask(createTask2(2));
@@ -161,12 +143,6 @@
      *
      * @throws SQLException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Functionality test: A few threads execute update, insert and delete operations in the same time for one table in the database",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_MultipleOperationsInSeveralTables() throws SQLException {
         int id1 = numOfRecords - 1;
         threadPool.runTask(createTask4(id1));
@@ -222,12 +198,6 @@
      *
      * @throws SQLException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Functional test: A few threads execute update operation in the same time for one tables in the database",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_MultipleUpdatesInOneTables() throws SQLException {
         int id = 1;
         String field = "field3";
@@ -460,4 +430,4 @@
             }
         };
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/java/sql/QueryTimeoutTest.java b/luni/src/test/java/tests/java/sql/QueryTimeoutTest.java
index 54c2c57..c553e31 100644
--- a/luni/src/test/java/tests/java/sql/QueryTimeoutTest.java
+++ b/luni/src/test/java/tests/java/sql/QueryTimeoutTest.java
@@ -20,10 +20,6 @@
 import SQLite.Database;
 import SQLite.Function;
 import SQLite.FunctionContext;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.extensions.TestSetup;
 import junit.framework.Test;
@@ -76,7 +72,6 @@
  * timeout. Verifies that the correct exception is thrown.
  * 4. Tests that the query timeout value is not forgotten after the execution of a statement.
  */
-@TestTargetClass(Statement.class)
 public class QueryTimeoutTest extends TestCase {
 
     private static Statement statement;
@@ -341,12 +336,6 @@
     /**
      * Part 1 of this test.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Testing timeout with fetch operations",
-        method = "setQueryTimeout",
-        args = {int.class}
-    )
     public static void testTimeoutWithFetch() throws TestFailedException {
         System.out.println("Testing timeout with fetch operations");
 
@@ -434,12 +423,6 @@
      *
      * Part two of this test.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "test timeout with st.exec()",
-        method = "setQueryTimeout",
-        args = {int.class}
-    )
     public static void testTimeoutWithExec()
             throws TestFailedException {
         System.out.println("Testing timeout with an execute operation");
@@ -519,12 +502,6 @@
      * @test {@link java.sql.Statement#setQueryTimeout(int) }
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Testing setting a negative timeout value",
-        method = "setQueryTimeout",
-        args = {int.class}
-    )
     public static void testInvalidTimeoutValue(Connection conn)
             throws TestFailedException {
 
@@ -581,12 +558,6 @@
      *
      * Part two of this test.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "timeout with executeUpdate call",
-        method = "setQueryTimeout",
-        args = {int.class}
-    )
     public static void testTimeoutWithExecuteUpdate()
             throws TestFailedException {
         System.out.println("Testing timeout with executeUpdate call.");
@@ -600,12 +571,6 @@
     }
 
     /** Test for DERBY-1692. */
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Testing that Statement considers timeout.",
-            method = "setQueryTimeout",
-            args = {int.class}
-        )
     public static void testRememberTimeoutValue()
             throws TestFailedException {
         String sql = getFetchQuery("t");
diff --git a/luni/src/test/java/tests/java/sql/SelectFunctionalityTest.java b/luni/src/test/java/tests/java/sql/SelectFunctionalityTest.java
index 758bd3e..4c02853 100755
--- a/luni/src/test/java/tests/java/sql/SelectFunctionalityTest.java
+++ b/luni/src/test/java/tests/java/sql/SelectFunctionalityTest.java
@@ -17,10 +17,6 @@
 package tests.java.sql;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 
 import java.io.CharArrayReader;
 import java.math.BigDecimal;
@@ -43,7 +39,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(Statement.class)
 public class SelectFunctionalityTest extends TestCase {
 
     private static Connection conn;
@@ -129,15 +124,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectSimple(). Selects all records
+     * SelectFunctionalityTest#test_SelectSimple(). Selects all records
      *        from the table
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects all records from the table",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectSimple() throws SQLException {
         String sql = "SELECT * FROM " + DatabaseCreator.TEST_TABLE2;
         ResultSet result = statement.executeQuery(sql);
@@ -178,15 +167,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectPrepared(). Selects all records
+     * SelectFunctionalityTest#test_SelectPrepared(). Selects all records
      *        from the table using parametric query
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects all records from the table using parametric query",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectPrepared() throws SQLException {
         String sql = "SELECT finteger, ftext, fcharacter, fdecimal, fnumeric,"
                 + " fsmallint, ffloat, freal, fdouble, fdate, ftime" + " FROM "
@@ -246,15 +229,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SubSelect(). Selects records from the
+     * SelectFunctionalityTest#test_SubSelect(). Selects records from the
      *        table using subselect
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from the table using subselect",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SubSelect() throws SQLException {
         String sql = "SELECT finteger," + " (SELECT ftext FROM "
                 + DatabaseCreator.TEST_TABLE2 + " WHERE finteger = 1) as ftext"
@@ -281,15 +258,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectThreeTables(). Selects records
+     * SelectFunctionalityTest#test_SelectThreeTables(). Selects records
      *        from a few tables
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a few tables",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectThreeTables() throws SQLException {
         String sql = "SELECT onum, " + DatabaseCreator.ORDERS_TABLE + ".cnum"
                 + " FROM " + DatabaseCreator.SALESPEOPLE_TABLE + ", "
@@ -325,15 +296,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectThreeTables(). Selects records
+     * SelectFunctionalityTest#test_SelectThreeTables(). Selects records
      *        from a table using union
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a table using union",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectUnionItself() throws SQLException {
         String sql = "SELECT b.cnum, b.cname" + " FROM "
                 + DatabaseCreator.CUSTOMERS_TABLE + " a, "
@@ -359,15 +324,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectLeftOuterJoin(). Selects
+     * SelectFunctionalityTest#test_SelectLeftOuterJoin(). Selects
      *        records from a table using left join
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a table using left join",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectLeftOuterJoin() throws SQLException {
         String sql = "SELECT distinct s.snum as ssnum, c.snum as ccnum FROM "
                 + DatabaseCreator.CUSTOMERS_TABLE + " c left outer join "
@@ -395,17 +354,11 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectRightOuterJoin(). Selects
+     * SelectFunctionalityTest#test_SelectRightOuterJoin(). Selects
      *        records from a table using right join
      *
      * TODO RIGHT and FULL OUTER JOINs are not supported
      */
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "tests right outer joins. RIGHT and FULL OUTER JOINs are not supported",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
     @KnownFailure("not supported")
     public void test_SelectRightOuterJoin() throws SQLException {
         String sql = "SELECT distinct s.snum as ssnum, c.snum as ccnum FROM "
@@ -435,15 +388,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectGroupBy(). Selects records from
+     * SelectFunctionalityTest#test_SelectGroupBy(). Selects records from
      *        a table using group by
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a table using group by",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectGroupBy() throws SQLException {
         String selectQuery = "SELECT rating, SUM(snum) AS sum FROM "
                 + DatabaseCreator.CUSTOMERS_TABLE + " GROUP BY rating";
@@ -468,15 +415,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectOrderBy(). Selects records from
+     * SelectFunctionalityTest#test_SelectOrderBy(). Selects records from
      *        a table using order by
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a table using order by",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectOrderBy() throws SQLException {
         String selectQuery = "SELECT onum FROM " + DatabaseCreator.ORDERS_TABLE
                 + " ORDER BY onum";
@@ -507,15 +448,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectDistinct(). Selects records
+     * SelectFunctionalityTest#test_SelectDistinct(). Selects records
      *        from a table using distinct
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a table using distinct",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectDistinct() throws SQLException {
         String selectQuery = "SELECT DISTINCT rating FROM "
                 + DatabaseCreator.CUSTOMERS_TABLE;
@@ -537,15 +472,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectAgregateFunctions(). Selects
+     * SelectFunctionalityTest#test_SelectAgregateFunctions(). Selects
      *        records from a table using agregate functions
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a table using agregate functions",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectAgregateFunctions() throws SQLException {
         String selectCount = "SELECT count(onum) as count FROM "
                 + DatabaseCreator.ORDERS_TABLE;
@@ -590,15 +519,9 @@
     }
 
     /**
-     * @tests SelectFunctionalityTest#test_SelectHaving(). Selects records from
+     * SelectFunctionalityTest#test_SelectHaving(). Selects records from
      *        a table using having
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Selects records from a table using having",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void test_SelectHaving() throws SQLException {
         String selectQuery = "SELECT snum, max(amt) AS max FROM "
                 + DatabaseCreator.ORDERS_TABLE
diff --git a/luni/src/test/java/tests/java/sql/StressTest.java b/luni/src/test/java/tests/java/sql/StressTest.java
index 8bf695d..b981d5e 100755
--- a/luni/src/test/java/tests/java/sql/StressTest.java
+++ b/luni/src/test/java/tests/java/sql/StressTest.java
@@ -16,11 +16,6 @@
 
 package tests.java.sql;
 
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
 import java.sql.Driver;
@@ -37,7 +32,6 @@
 import tests.support.ThreadPool;
 import junit.framework.TestCase;
 
-@TestTargetClass(Statement.class)
 public class StressTest extends TestCase {
     Vector<Connection> vc = new Vector<Connection>();
 
@@ -108,15 +102,9 @@
 //    }
 
     /**
-     * @tests StressTest#testManyConnectionsUsingOneThread(). Create many
+     * StressTest#testManyConnectionsUsingOneThread(). Create many
      *        connections to the DataBase using one thread.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "connect",
-        clazz = Driver.class,
-        args = {String.class, Properties.class}
-    )
     public void testManyConnectionsUsingOneThread() {
         try {
             int maxConnections = getConnectionNum();
@@ -129,16 +117,9 @@
     }
 
     /**
-     * @tests StressTest#testManyConnectionsUsingManyThreads(). Create many
+     * StressTest#testManyConnectionsUsingManyThreads(). Create many
      *        connections to the DataBase using some threads.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Stress test: Create many connections to the DataBase using some threads",
-        method = "connect",
-        clazz = Driver.class,
-        args = {String.class, Properties.class}
-    )
     public void testManyConnectionsUsingManyThreads() {
         int numTasks = getConnectionNum();
 
@@ -165,15 +146,9 @@
     }
 
     /**
-     * @tests StressTest#testInsertOfManyRowsUsingOneThread(). Insert a lot of
+     * StressTest#testInsertOfManyRowsUsingOneThread(). Insert a lot of
      *        records to the Database using a maximum number of connections.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "connect",
-        clazz = Driver.class,
-        args = {String.class, Properties.class}
-    )
     public void testInsertOfManyRowsUsingOneThread() {
 
         Logger.global
@@ -213,12 +188,6 @@
     /**
      * @tests
      */
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            method = "connect",
-            clazz = Driver.class,
-            args = {String.class, Properties.class}
-    )
     public void testInsertOfManyRowsUsingManyThreads() {
         Logger.global.info("java.sql stress test: multiple threads and many operations.");
 
diff --git a/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest.java b/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest.java
index cbed7dc..c5cf143 100755
--- a/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest.java
+++ b/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest.java
@@ -16,11 +16,6 @@
 
 package tests.java.sql;
 
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-
 import java.math.BigDecimal;
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
@@ -36,7 +31,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(Statement.class)
 public class UpdateFunctionalityTest extends TestCase {
 
     private static final int numberOfRecords = 20;
@@ -106,23 +100,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate1(). Updates all values in one
+     * UpdateFunctionalityTest#testUpdate1(). Updates all values in one
      *        column in the table
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates all values in one column in the table",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates all values in one column in the table",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate1() {
         String newValue = "newValue";
         String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1
@@ -145,23 +125,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate2(). Updates values in one
+     * UpdateFunctionalityTest#testUpdate2(). Updates values in one
      *        column in the table using where condition in update command
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in one column in the table using where condition in update command",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in one column in the table using where condition in update command",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate2() {
         String newValue = "newValue";
         String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1
@@ -191,23 +157,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate3(). Updates values in a several
+     * UpdateFunctionalityTest#testUpdate3(). Updates values in a several
      *        columns in the table
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in a several columns in the table",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in a several columns in the table",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate3() {
         int newValue1 = -1;
         int newValue2 = -2;
@@ -234,23 +186,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate4(). Updates values in a several
+     * UpdateFunctionalityTest#testUpdate4(). Updates values in a several
      *        columns in the table using where condition in update command
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in a several columns in the table using where condition in update command",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in a several columns in the table using where condition in update command",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate4() {
         int newValue1 = -1;
         int newValue2 = -2;
@@ -287,23 +225,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate5(). Updates values in one
+     * UpdateFunctionalityTest#testUpdate5(). Updates values in one
      *        columns in the table using condition
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in one columns in the table using condition",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates values in one columns in the table using condition",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate5() {
         int factor = 3;
         String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1
@@ -339,23 +263,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate6(). Sets value of field2 to
+     * UpdateFunctionalityTest#testUpdate6(). Sets value of field2 to
      *        default
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Sets value of field2 to default",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Sets value of field2 to default",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate6() {
         String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1
                 + " SET field2='1'";
@@ -380,23 +290,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate7(). Updates records in the
+     * UpdateFunctionalityTest#testUpdate7(). Updates records in the
      *        table using subquery in update command
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates records in the table using subquery in update command",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates records in the table using subquery in update command",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate7() {
         String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1
                 + " SET field2='1' WHERE id < ( SELECT COUNT(*) FROM "
@@ -427,23 +323,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest#testUpdate8(). Sets value of field2 to
+     * UpdateFunctionalityTest#testUpdate8(). Sets value of field2 to
      *        NULL
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Sets value of field2 to NULL",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Sets value of field2 to NULL",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate8() {
         String updateQuery = "UPDATE " + DatabaseCreator.TEST_TABLE1
                 + " SET field2=NULL";
diff --git a/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java b/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java
index 72f93c6..01d6140 100755
--- a/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java
+++ b/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java
@@ -17,10 +17,6 @@
 package tests.java.sql;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 
 import java.sql.Connection;
 import java.sql.DatabaseMetaData;
@@ -37,7 +33,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-@TestTargetClass(Statement.class)
 public class UpdateFunctionalityTest2 extends TestCase {
 
     private static Connection conn = null;
@@ -123,15 +118,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate1(). Updates row with no
+     * UpdateFunctionalityTest2#testUpdate1(). Updates row with no
      *        referencing ones and RESTRICT action
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Updates row with no referencing ones and RESTRICT action",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
     public void testUpdate1() throws SQLException {
         DatabaseCreator.fillFKStrictTable(conn);
         statement.execute("UPDATE " + DatabaseCreator.PARENT_TABLE
@@ -139,17 +128,11 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate2(). Attempts to update row
+     * UpdateFunctionalityTest2#testUpdate2(). Attempts to update row
      *        with referencing ones and RESTRICT action - expecting SQLException
      *
      *  TODO not supported
      */
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Attempts to update row with referencing ones and RESTRICT action - expecting SQLException",
-            method = "execute",
-            args = {java.lang.String.class}
-        )
     @KnownFailure("not supported")
     public void testUpdate2() throws SQLException {
         DatabaseCreator.fillFKStrictTable(conn);
@@ -164,15 +147,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate3(). Deletes all referencing
+     * UpdateFunctionalityTest2#testUpdate3(). Deletes all referencing
      *        rows and then updates referenced one
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Deletes all referencing rows and then updates referenced one",
-        method = "execute",
-        args = {java.lang.String.class}
-    )
     public void testUpdate3() throws SQLException {
         DatabaseCreator.fillFKStrictTable(conn);
         statement.execute("DELETE FROM " + DatabaseCreator.FKSTRICT_TABLE
@@ -182,19 +159,13 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate4(). Attempts to set incorrect
+     * UpdateFunctionalityTest2#testUpdate4(). Attempts to set incorrect
      *        foreign key value - expecting SQLException
      *
      *  TODO foreign key functionality is not supported
      */
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Attempts to set incorrect foreign key value - expecting SQLException",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-    )
     @KnownFailure("not supported")
-   public void testUpdate4() throws SQLException {
+    public void testUpdate4() throws SQLException {
        DatabaseCreator.fillFKStrictTable(conn);
         try {
             statement.executeUpdate("UPDATE " + DatabaseCreator.FKSTRICT_TABLE
@@ -206,24 +177,10 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate5(). Updates row with
+     * UpdateFunctionalityTest2#testUpdate5(). Updates row with
      *        referencing ones and CASCADE action - expecting that all
      *        referencing rows will also be updated
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates row with referencing ones and CASCADE action - expecting that all referencing rows will also be updated",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates row with referencing ones and CASCADE action - expecting that all referencing rows will also be updated",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate5() throws SQLException {
         DatabaseCreator.fillFKCascadeTable(conn);
         statement.executeUpdate("UPDATE " + DatabaseCreator.PARENT_TABLE
@@ -241,19 +198,12 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate6(). Attempts to set incorrect
+     * UpdateFunctionalityTest2#testUpdate6(). Attempts to set incorrect
      *        foreign key value to row with CASCADE action - expecting
      *        SQLException
      *
      *  TODO Foreign key functionality is not supported
      */
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Attempts to set incorrect\n" +
-                    "foreign key value to row with CASCADE action - expecting SQLException: not supported",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        )
     @KnownFailure("not supported")
     public void testUpdate6() throws SQLException {
         DatabaseCreator.fillFKCascadeTable(conn);
@@ -267,25 +217,11 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate7(). Updates table using
+     * UpdateFunctionalityTest2#testUpdate7(). Updates table using
      *        subquery in WHERE clause
      *
      *  TODO Foreign key functionality is not supported
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates table using subquery in WHERE clause. Not supported: FK",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates table using subquery in WHERE clause. Not supported: FK.",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        )
-    })
     @KnownFailure("not supported")
    public void testUpdate7() throws SQLException {
 
@@ -301,23 +237,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate8(). Updates table using scalar
+     * UpdateFunctionalityTest2#testUpdate8(). Updates table using scalar
      *        subquery as new field value
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates table using scalar subquery as new field value",
-            method = "executeQuery",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Functionality test: Updates table using scalar subquery as new field value",
-            method = "executeUpdate",
-            args = {java.lang.String.class}
-        )
-    })
     public void testUpdate8() throws SQLException {
         statement.executeUpdate("UPDATE " + DatabaseCreator.SIMPLE_TABLE3
                 + " SET speed = (SELECT MAX(speed) FROM "
@@ -336,15 +258,9 @@
     }
 
     /**
-     * @tests UpdateFunctionalityTest2#testUpdate9(). Updates table using
+     * UpdateFunctionalityTest2#testUpdate9(). Updates table using
      *        PreparedStatement
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Functionality test: Updates table using PreparedStatement",
-        method = "executeQuery",
-        args = {java.lang.String.class}
-    )
     public void testUpdate9() throws SQLException {
         DatabaseCreator.fillTestTable5(conn);
         PreparedStatement stat = conn.prepareStatement("UPDATE "
diff --git a/luni/src/test/java/tests/javax/sql/ConnectionEventListenerTest.java b/luni/src/test/java/tests/javax/sql/ConnectionEventListenerTest.java
deleted file mode 100644
index a89b026..0000000
--- a/luni/src/test/java/tests/javax/sql/ConnectionEventListenerTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import javax.sql.ConnectionEvent;
-import javax.sql.ConnectionEventListener;
-
-@TestTargetClass(ConnectionEventListener.class)
-public class ConnectionEventListenerTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.ConnectionEventListener#connectionClosed(javax.sql.ConnectionEvent)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "connectionClosed",
-        args = {javax.sql.ConnectionEvent.class}
-    )
-    public void testConnectionClosed() {
-        fail("Not yet implemented"); // TODO
-    }
-
-    /**
-     * @test {@link javax.sql.ConnectionEventListener#connectionErrorOccurred(ConnectionEvent)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "connectionErrorOccurred",
-        args = {javax.sql.ConnectionEvent.class}
-    )
-    public void testConnectionErrorOccurred() {
-        fail("Not yet implemented"); // TODO
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/ConnectionPoolDataSourceTest.java b/luni/src/test/java/tests/javax/sql/ConnectionPoolDataSourceTest.java
deleted file mode 100644
index 7dafc46..0000000
--- a/luni/src/test/java/tests/javax/sql/ConnectionPoolDataSourceTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.io.PrintWriter;
-
-import javax.sql.ConnectionPoolDataSource;
-
-
-@TestTargetClass(ConnectionPoolDataSource.class)
-public class ConnectionPoolDataSourceTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.ConnectionPoolDataSource#getLoginTimeout()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getLoginTimeout",
-        args = {}
-    )
-    public void testGetLoginTimeout() {
-        fail("Not yet implemented"); // NOT_FEASIBLE
-    }
-
-    /**
-     * @tests {@link javax.sql.ConnectionPoolDataSource#getLogWriter()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getLogWriter",
-        args = {}
-    )
-    public void testGetLogWriter() {
-        fail("Not yet implemented"); // NOT_FEASIBLE
-    }
-
-    /**
-     * @tests {@link javax.sql.ConnectionPoolDataSource#getPooledConnection()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getPooledConnection",
-        args = {}
-    )
-    public void testGetPooledConnection() {
-        fail("Not yet implemented"); // NOT_FEASIBLE
-    }
-
-    /**
-     * @tests {@link javax.sql.ConnectionPoolDataSource#getPooledConnection(String, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getPooledConnection",
-        args = {String.class, String.class}
-    )
-    public void testGetPooledConnectionStringString() {
-        fail("Not yet implemented"); // NOT_FEASIBLE
-    }
-
-    /**
-     * @tests {@link javax.sql.ConnectionPoolDataSource#setLoginTimeout(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setLoginTimeout",
-        args = {int.class}
-    )
-    public void testSetLoginTimeout() {
-        fail("Not yet implemented"); // NOT_FEASIBLE
-    }
-
-    /**
-     * @tests {@link javax.sql.ConnectionPoolDataSource#setLogWriter(java.io.PrintWriter)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setLogWriter",
-        args = {java.io.PrintWriter.class}
-    )
-    public void testSetLogWriter() {
-        fail("Not yet implemented"); // NOT_FEASIBLE
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/DataSourceTest.java b/luni/src/test/java/tests/javax/sql/DataSourceTest.java
deleted file mode 100644
index 30563c9..0000000
--- a/luni/src/test/java/tests/javax/sql/DataSourceTest.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.io.PrintWriter;
-
-import javax.sql.DataSource;
-
-@TestTargetClass(DataSource.class)
-public class DataSourceTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.DataSource#getConnection()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getConnection",
-        args = {}
-    )
-    public void testGetConnection() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.DataSource#getConnection(String, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getConnection",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
-    public void testGetConnectionStringString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.DataSource#getLoginTimeout()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getLoginTimeout",
-        args = {}
-    )
-    public void testGetLoginTimeout() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.DataSource#getLogWriter()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getLogWriter",
-        args = {}
-    )
-    public void testGetLogWriter() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.DataSource#setLoginTimeout(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setLoginTimeout",
-        args = {int.class}
-    )
-    public void testSetLoginTimeout() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * @tests {@link javax.sql.DataSource#setLogWriter(java.io.PrintWriter)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setLogWriter",
-        args = {PrintWriter.class}
-    )
-    public void testSetLogWriter() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/PooledConnectionTest.java b/luni/src/test/java/tests/javax/sql/PooledConnectionTest.java
deleted file mode 100644
index 2902e8b..0000000
--- a/luni/src/test/java/tests/javax/sql/PooledConnectionTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import javax.sql.ConnectionEventListener;
-import javax.sql.PooledConnection;
-
-@TestTargetClass(PooledConnection.class)
-public class PooledConnectionTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.PooledConnection#addConnectionEventListener(javax.sql.ConnectionEventListener)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "addConnectionEventListener",
-        args = {javax.sql.ConnectionEventListener.class}
-    )
-    public void testAddConnectionEventListener() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.PooledConnection#close()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "close",
-        args = {}
-    )
-    public void testClose() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.PooledConnection#getConnection()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getConnection",
-        args = {}
-    )
-    public void testGetConnection() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * @tests {@link javax.sql.PooledConnection#removeConnectionEventListener(ConnectionEventListener)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "removeConnectionEventListener",
-        args = {javax.sql.ConnectionEventListener.class}
-    )
-    public void testRemoveConnectionEventListener() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/RowSetInternalTest.java b/luni/src/test/java/tests/javax/sql/RowSetInternalTest.java
deleted file mode 100644
index ff9de34..0000000
--- a/luni/src/test/java/tests/javax/sql/RowSetInternalTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import javax.sql.RowSetInternal;
-import javax.sql.RowSetMetaData;
-
-@TestTargetClass(RowSetInternal.class)
-public class RowSetInternalTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.RowSetInternal#getConnection()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getConnection",
-        args = {}
-    )
-    public void testGetConnection() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetInternal#getOriginal()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getOriginal",
-        args = {}
-    )
-    public void testGetOriginal() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetInternal#getOriginalRow()}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getOriginalRow",
-        args = {}
-    )
-    public void testGetOriginalRow() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getParams",
-      args = {}
-    )
-    public void testGetParams() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetInternal#setMetaData(javax.sql.RowSetMetaData)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setMetaData",
-        args = {javax.sql.RowSetMetaData.class}
-    )
-    public void testSetMetaData() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/RowSetListenerTest.java b/luni/src/test/java/tests/javax/sql/RowSetListenerTest.java
deleted file mode 100644
index d238a42..0000000
--- a/luni/src/test/java/tests/javax/sql/RowSetListenerTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import javax.sql.RowSetEvent;
-import javax.sql.RowSetListener;
-
-/**
- *
- */
-@TestTargetClass(RowSetListener.class)
-public class RowSetListenerTest extends TestCase {
-
-    /**
-     * Test method for {@link javax.sql.RowSetListener#cursorMoved(javax.sql.RowSetEvent)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "cursorMoved",
-        args = {javax.sql.RowSetEvent.class}
-    )
-    public void testCursorMoved() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link javax.sql.RowSetListener#rowChanged(javax.sql.RowSetEvent)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "rowChanged",
-        args = {javax.sql.RowSetEvent.class}
-    )
-    public void testRowChanged() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link javax.sql.RowSetListener#rowSetChanged(javax.sql.RowSetEvent)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "rowSetChanged",
-        args = {javax.sql.RowSetEvent.class}
-    )
-    public void testRowSetChanged() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/RowSetMetaDataTest.java b/luni/src/test/java/tests/javax/sql/RowSetMetaDataTest.java
deleted file mode 100644
index 73a2f75..0000000
--- a/luni/src/test/java/tests/javax/sql/RowSetMetaDataTest.java
+++ /dev/null
@@ -1,241 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import javax.sql.RowSetMetaData;
-
-/**
- * @author AGR
- *
- */
-@TestTargetClass(RowSetMetaData.class)
-public class RowSetMetaDataTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setAutoIncrement(int, boolean)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setAutoIncrement",
-        args = {int.class, boolean.class}
-    )
-    public void testSetAutoIncrement() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setCaseSensitive(int, boolean)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setCaseSensitive",
-        args = {int.class, boolean.class}
-    )
-    public void testSetCaseSensitive() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setCatalogName(int, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setCatalogName",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetCatalogName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setColumnCount(int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setColumnCount",
-        args = {int.class}
-    )
-    public void testSetColumnCount() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setColumnDisplaySize(int, int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setColumnDisplaySize",
-        args = {int.class, int.class}
-    )
-    public void testSetColumnDisplaySize() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setColumnLabel(int, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setColumnLabel",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetColumnLabel() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setColumnName(int, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setColumnName",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetColumnName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setColumnType(int, int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setColumnType",
-        args = {int.class, int.class}
-    )
-    public void testSetColumnType() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setColumnTypeName(int, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setColumnTypeName",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetColumnTypeName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setCurrency(int, boolean)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setCurrency",
-        args = {int.class, boolean.class}
-    )
-    public void testSetCurrency() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setNullable(int, int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setNullable",
-        args = {int.class, int.class}
-    )
-    public void testSetNullable() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setPrecision(int, int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setPrecision",
-        args = {int.class, int.class}
-    )
-    public void testSetPrecision() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setScale(int, int)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setScale",
-        args = {int.class, int.class}
-    )
-    public void testSetScale() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setSchemaName(int, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setSchemaName",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetSchemaName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setSearchable(int, boolean)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setSearchable",
-        args = {int.class, boolean.class}
-    )
-    public void testSetSearchable() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setSigned(int, boolean)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setSigned",
-        args = {int.class, boolean.class}
-    )
-    public void testSetSigned() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSetMetaData#setTableName(int, String)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setTableName",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetTableName() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/RowSetReaderTest.java b/luni/src/test/java/tests/javax/sql/RowSetReaderTest.java
deleted file mode 100644
index 0a24234..0000000
--- a/luni/src/test/java/tests/javax/sql/RowSetReaderTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import javax.sql.RowSetInternal;
-import javax.sql.RowSetReader;
-
-@TestTargetClass(RowSetReader.class)
-public class RowSetReaderTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.RowSetReader#readData(RowSetInternal)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "readData",
-        args = {javax.sql.RowSetInternal.class}
-    )
-    public void testReadData() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/javax/sql/RowSetTest.java b/luni/src/test/java/tests/javax/sql/RowSetTest.java
deleted file mode 100644
index cea214e..0000000
--- a/luni/src/test/java/tests/javax/sql/RowSetTest.java
+++ /dev/null
@@ -1,624 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.Ref;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.Map;
-
-import javax.sql.RowSet;
-import javax.sql.RowSetListener;
-
-/**
- *No Implementation class of this interface is available: tests not feasible
- */
-@TestTargetClass(RowSet.class)
-public class RowSetTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.RowSet#addRowSetListener(javax.sql.RowSetListener)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "addRowSetListener",
-        args = {javax.sql.RowSetListener.class}
-    )
-    public void testAddRowSetListener() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSet#clearParameters()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "clearParameters",
-        args = {}
-    )
-    public void testClearParameters() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSet#addRowSetListener(javax.sql.RowSetListener)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "execute",
-        args = {}
-    )
-    public void testExecute() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSet#getCommand()}.
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "setCommand",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "getCommand",
-            args = {}
-        )
-    })
-    public void testSetGetCommand() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * @tests {@link javax.sql.RowSet#getDataSourceName()}.
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "setDataSourceName",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "getDataSourceName",
-            args = {}
-        )
-    })
-    public void testSetGetDataSourceName() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getEscapeProcessing",
-        args = {}
-    )
-    public void testSetGetEscapeProcessing() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getMaxFieldSize",
-        args = {}
-    )
-    public void testSetGetMaxFieldSize() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "getMaxRows",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "setMaxRows",
-            args = {int.class}
-        )
-    })
-    public void testSetGetMaxRows() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getPassword",
-        args = {}
-    )
-    public void testSetGetPassword() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getQueryTimeout",
-        args = {}
-    )
-    public void testSetGetQueryTimeout() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getTransactionIsolation",
-        args = {}
-    )
-    public void testSetGetTransactionIsolation() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getTypeMap",
-        args = {}
-    )
-    public void testSetGetTypeMap() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "setUrl",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "getUrl",
-            args = {}
-        )
-    })
-    public void testSetGetUrl() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "setUsername",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "getUsername",
-            args = {}
-        )
-    })
-    public void testSetGetUsername() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "isReadOnly",
-        args = {}
-    )
-    public void testIsReadOnly() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "removeRowSetListener",
-        args = {javax.sql.RowSetListener.class}
-    )
-    public void testRemoveRowSetListener() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setArray",
-        args = {int.class, java.sql.Array.class}
-    )
-    public void testSetArray() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setAsciiStream",
-        args = {int.class, java.io.InputStream.class, int.class}
-    )
-    public void testSetGetAsciiStream() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setBigDecimal",
-        args = {int.class, java.math.BigDecimal.class}
-    )
-    public void testSetGetBigDecimal() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setBinaryStream",
-        args = {int.class, java.io.InputStream.class, int.class}
-    )
-    public void testSetGetBinaryStream() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setBlob",
-        args = {int.class, java.sql.Blob.class}
-    )
-    public void testSetGetBlob() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setBoolean",
-        args = {int.class, boolean.class}
-    )
-    public void testSetGetBoolean() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setByte",
-        args = {int.class, byte.class}
-    )
-    public void testSetGetByte() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setBytes",
-        args = {int.class, byte[].class}
-    )
-    public void testSetGetBytes() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setCharacterStream",
-        args = {int.class, java.io.Reader.class, int.class}
-    )
-    public void testSetGetCharacterStream() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setClob",
-        args = {int.class, java.sql.Clob.class}
-    )
-    public void testSetGetClob() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setConcurrency",
-        args = {int.class}
-    )
-    public void testSetGetConcurrency() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setDate",
-        args = {int.class, java.sql.Date.class}
-    )
-    public void testSetGetDateIntDate() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setDate",
-        args = {int.class, java.sql.Date.class, java.util.Calendar.class}
-    )
-    public void testSetDateIntDateCalendar() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setEscapeProcessing",
-        args = {boolean.class}
-    )
-    public void testSetEscapeProcessing() {
-
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setDouble",
-        args = {int.class, double.class}
-    )
-    public void testSetGetDouble() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setFloat",
-        args = {int.class, float.class}
-    )
-    public void testSetGetFloat() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setInt",
-        args = {int.class, int.class}
-    )
-    public void testSetGetInt() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setLong",
-        args = {int.class, long.class}
-    )
-    public void testSetGetLong() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "getMaxFieldSize",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "setMaxFieldSize",
-            args = {int.class}
-        )
-    })
-    public void testSetGetGetMaxFieldSize() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setNull",
-        args = {int.class, int.class}
-    )
-    public void testSetGetNullIntInt() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setNull",
-        args = {int.class, int.class, java.lang.String.class}
-    )
-    public void testSetGetNullIntIntString() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setObject",
-        args = {int.class, java.lang.Object.class}
-    )
-    public void testSetGetObjectIntObject() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setObject",
-        args = {int.class, java.lang.Object.class, int.class}
-    )
-    public void testSetGetObjectIntObjectInt() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setObject",
-        args = {int.class, java.lang.Object.class, int.class, int.class}
-    )
-    public void testSetGetObjectIntObjectIntInt() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setPassword",
-        args = {java.lang.String.class}
-    )
-    public void testSetPassword() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setQueryTimeout",
-        args = {int.class}
-    )
-    public void testSetQueryTimeout() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setReadOnly",
-        args = {boolean.class}
-    )
-    public void testSetReadOnly() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setRef",
-        args = {int.class, java.sql.Ref.class}
-    )
-    public void testSetRef() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setShort",
-        args = {int.class, short.class}
-    )
-    public void testSetShort() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setString",
-        args = {int.class, java.lang.String.class}
-    )
-    public void testSetString() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setTime",
-        args = {int.class, java.sql.Time.class}
-    )
-    public void testSetTimeIntTime() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setTime",
-        args = {int.class, java.sql.Time.class, java.util.Calendar.class}
-    )
-    public void testSetTimeIntTimeCalendar() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setTimestamp",
-        args = {int.class, java.sql.Timestamp.class}
-    )
-    public void testSetTimestampIntTimestamp() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setTimestamp",
-        args = {int.class, java.sql.Timestamp.class, java.util.Calendar.class}
-    )
-    public void testSetTimestampIntTimestampCalendar() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setTransactionIsolation",
-        args = {int.class}
-    )
-    public void testSetTransactionIsolation() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setType",
-        args = {int.class}
-    )
-    public void testSetType() {
-        fail("Not yet implemented");
-    }
-
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setTypeMap",
-        args = {java.util.Map.class}
-    )
-    public void testSetTypeMap() {
-        fail("Not yet implemented");
-    }
-}
diff --git a/luni/src/test/java/tests/javax/sql/RowSetWriterTest.java b/luni/src/test/java/tests/javax/sql/RowSetWriterTest.java
deleted file mode 100644
index 1b9f972..0000000
--- a/luni/src/test/java/tests/javax/sql/RowSetWriterTest.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package tests.javax.sql;
-
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-import junit.framework.TestCase;
-
-import javax.sql.RowSetInternal;
-import javax.sql.RowSetWriter;
-
-@TestTargetClass(RowSetWriter.class)
-public class RowSetWriterTest extends TestCase {
-
-    /**
-     * @tests {@link javax.sql.RowSetWriter#writeData(javax.sql.RowSetInternal)}
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "writeData",
-        args = {javax.sql.RowSetInternal.class}
-    )
-    public void testWriteData() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/luni/AllTestsIo.java b/luni/src/test/java/tests/luni/AllTestsIo.java
deleted file mode 100644
index 41b4d51..0000000
--- a/luni/src/test/java/tests/luni/AllTestsIo.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.luni;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Listing of all the tests that are to be run.
- */
-public class AllTestsIo
-{
-
-    public static void run() {
-        TestRunner.main(new String[] { AllTestsIo.class.getName() });
-    }
-
-    public static Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.io");
-
-        suite.addTest(tests.api.java.io.AllTests.suite());
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/luni/AllTestsLang.java b/luni/src/test/java/tests/luni/AllTestsLang.java
deleted file mode 100644
index a7a18a8..0000000
--- a/luni/src/test/java/tests/luni/AllTestsLang.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.luni;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Listing of all the tests that are to be run.
- */
-public class AllTestsLang
-{
-
-    public static void run() {
-        TestRunner.main(new String[] { AllTestsLang.class.getName() });
-    }
-
-    public static final Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.lang");
-
-        suite.addTest(tests.api.java.lang.AllTests.suite());
-
-        suite.addTest(tests.api.java.lang.ref.AllTests.suite());
-
-        suite.addTest(tests.api.java.lang.reflect.AllTests.suite());
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/luni/AllTestsNet.java b/luni/src/test/java/tests/luni/AllTestsNet.java
deleted file mode 100644
index a71b976..0000000
--- a/luni/src/test/java/tests/luni/AllTestsNet.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.luni;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Listing of all the tests that are to be run.
- */
-public class AllTestsNet
-{
-
-    public static void run() {
-        TestRunner.main(new String[] { AllTestsNet.class.getName() });
-    }
-
-    public static final Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.net");
-
-        suite.addTest(org.apache.harmony.luni.tests.java.net.AllTests.suite());
-        suite.addTest(org.apache.harmony.luni.tests.internal.net.www.protocol.http.AllTests.suite());
-        suite.addTest(org.apache.harmony.luni.tests.internal.net.www.protocol.https.AllTests.suite());
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/luni/AllTestsUtil.java b/luni/src/test/java/tests/luni/AllTestsUtil.java
deleted file mode 100644
index 2b16983..0000000
--- a/luni/src/test/java/tests/luni/AllTestsUtil.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.luni;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-/**
- * Listing of all the tests that are to be run.
- */
-public class AllTestsUtil
-{
-
-    public static void run() {
-        TestRunner.main(new String[] { AllTestsUtil.class.getName() });
-    }
-
-    public static final Test suite() {
-        TestSuite suite = new TestSuite("Tests for java.util");
-
-        suite.addTest(tests.api.java.util.AllTests.suite());
-        suite.addTest(org.apache.harmony.luni.tests.java.util.AllTests.suite());
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/math/AllTests.java b/luni/src/test/java/tests/math/AllTests.java
deleted file mode 100644
index 62a5c32..0000000
--- a/luni/src/test/java/tests/math/AllTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.math;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the Math project.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All Math test suites");
-
-        suite.addTest(tests.api.java.math.AllTests.suite());
-
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/org/w3c/dom/AllTests.java b/luni/src/test/java/tests/org/w3c/dom/AllTests.java
deleted file mode 100644
index 659dede..0000000
--- a/luni/src/test/java/tests/org/w3c/dom/AllTests.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.org.w3c.dom;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package org.w3c.dom;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package org.w3c.dom;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AttrGetOwnerElement.class);
-        suite.addTestSuite(CreateAttributeNS.class);
-        suite.addTestSuite(CreateDocument.class);
-        suite.addTestSuite(CreateDocumentType.class);
-        suite.addTestSuite(CreateElementNS.class);
-        suite.addTestSuite(DOMImplementationCreateDocument.class);
-        suite.addTestSuite(DOMImplementationCreateDocumentType.class);
-        suite.addTestSuite(DOMImplementationHasFeature.class);
-        suite.addTestSuite(DocumentCreateAttributeNS.class);
-        suite.addTestSuite(DocumentCreateElementNS.class);
-        suite.addTestSuite(DocumentGetElementsByTagnameNS.class);
-        suite.addTestSuite(DocumentGeteEementById.class);
-        suite.addTestSuite(DocumentImportNode.class);
-        suite.addTestSuite(DocumentTypeInternalSubset.class);
-        suite.addTestSuite(DocumentTypePublicId.class);
-        suite.addTestSuite(DocumentTypeSystemId.class);
-// Is empty. Only test assumes validation. Leave disabled.
-//        suite.addTestSuite(ElementGetAttributeNS.class);
-        suite.addTestSuite(ElementGetAttributeNodeNS.class);
-        suite.addTestSuite(ElementGetElementsByTagNameNS.class);
-        suite.addTestSuite(ElementHasAttribute.class);
-        suite.addTestSuite(ElementHasAttributeNS.class);
-        suite.addTestSuite(ElementRemoveAttributeNS.class);
-        suite.addTestSuite(ElementSetAttributeNS.class);
-        suite.addTestSuite(ElementSetAttributeNodeNS.class);
-        suite.addTestSuite(GetAttributeNS.class);
-        suite.addTestSuite(GetAttributeNodeNS.class);
-        suite.addTestSuite(GetElementById.class);
-        suite.addTestSuite(GetElementsByTagNameNS.class);
-        suite.addTestSuite(GetNamedItemNS.class);
-// Is empty. Only test assumes validation. Leave disabled.
-//        suite.addTestSuite(HCEntitiesRemoveNamedItemNS.class);
-// Is empty. Only test assumes validation. Leave disabled.
-//        suite.addTestSuite(HCEntitiesSetNamedItemNS.class);
-        suite.addTestSuite(HCNamedNodeMapInvalidType.class);
-        suite.addTestSuite(HCNodeDocumentFragmentNormalize.class);
-// Is empty. Only test assumes validation. Leave disabled.
-//        suite.addTestSuite(HCNotationsRemoveNamedItemNS.class);
-// Is empty. Only test assumes validation. Leave disabled.
-//        suite.addTestSuite(HCNotationsSetNamedItemNS.class);
-        suite.addTestSuite(HasAttribute.class);
-        suite.addTestSuite(HasAttributeNS.class);
-        suite.addTestSuite(HasAttributes.class);
-        suite.addTestSuite(ImportNode.class);
-        suite.addTestSuite(InternalSubset.class);
-        suite.addTestSuite(IsSupported.class);
-        suite.addTestSuite(LocalName.class);
-        suite.addTestSuite(NamedNodeMapGetNamedItemNS.class);
-        suite.addTestSuite(NamedNodeMapRemoveNamedItemNS.class);
-        suite.addTestSuite(NamedNodeMapSetNamedItemNS.class);
-        suite.addTestSuite(NamespaceURI.class);
-        suite.addTestSuite(NodeGetLocalName.class);
-        suite.addTestSuite(NodeGetNamespaceURI.class);
-        suite.addTestSuite(NodeGetOwnerDocument.class);
-        suite.addTestSuite(NodeGetPrefix.class);
-        suite.addTestSuite(NodeHasAttributes.class);
-        suite.addTestSuite(NodeIsSupported.class);
-        suite.addTestSuite(NodeNormalize.class);
-        suite.addTestSuite(NodeSetPrefix.class);
-        suite.addTestSuite(Normalize.class);
-        suite.addTestSuite(OwnerDocument.class);
-        suite.addTestSuite(OwnerElement.class);
-        suite.addTestSuite(Prefix.class);
-        suite.addTestSuite(PublicId.class);
-// Is empty. Only test assumes validation. Leave disabled.
-//        suite.addTestSuite(RemoveAttributeNS.class);
-        suite.addTestSuite(RemoveNamedItemNS.class);
-        suite.addTestSuite(SetAttributeNS.class);
-        suite.addTestSuite(SetAttributeNodeNS.class);
-        suite.addTestSuite(SetNamedItemNS.class);
-        suite.addTestSuite(SystemId.class);
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java b/luni/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java
index ab2e6da..66cfd59 100644
--- a/luni/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java
+++ b/luni/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -14,7 +9,6 @@
 
 import javax.xml.parsers.DocumentBuilder;
 
-@TestTargetClass(Attr.class)
 public final class AttrGetOwnerElement extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -61,12 +55,6 @@
 //        assertEquals("attrgetownerelement01", "emp:employee", ownerElementName);
 //
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that getOwnerElement returns null if an attribute is not in use.",
-        method = "getOwnerElement",
-        args = {}
-    )
     public void testGetOwnerElement2() throws Throwable {
         Document doc;
         Element element;
@@ -82,12 +70,6 @@
         ownerElementName = ownerElement.getNodeName();
         assertEquals("attrgetownerelement02", "root", ownerElementName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getOwnerElement returns null if an attribute is not in use.",
-        method = "getOwnerElement",
-        args = {}
-    )
     public void testGetOwnerElement3() throws Throwable {
         Document doc;
         Node ownerElement;
@@ -97,12 +79,6 @@
         ownerElement = attr.getOwnerElement();
         assertNull("attrgetownerelement03", ownerElement);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getOwnerElement returns null if an attribute is not in use.",
-        method = "getOwnerElement",
-        args = {}
-    )
     public void testGetOwnerElement4() throws Throwable {
         Document doc;
         Document docImp;
@@ -124,12 +100,6 @@
         ownerElement = attrImp.getOwnerElement();
         assertNull("attrgetownerelement04", ownerElement);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that getOwnerElement returns null if an attribute is not in use.",
-        method = "getOwnerElement",
-        args = {}
-    )
     public void testGetOwnerElement5() throws Throwable {
         Document doc;
         Node element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java
index 2f9c177..0e53813 100644
--- a/luni/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -35,7 +30,6 @@
 
 import javax.xml.parsers.DocumentBuilder;
 
-@TestTargetClass(Document.class)
 public final class CreateAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -65,12 +59,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NAMESPACE_ERR exception code.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS1() throws Throwable {
         String namespaceURI = "http://www.ecommerce.org/";
         String malformedName = "prefix::local";
@@ -88,12 +76,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies createAttributeNS method with null as the fisrt parameter.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS2() throws Throwable {
         String namespaceURI = null;
 
@@ -112,12 +94,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createAttributeNS throws DOMException.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS3() throws Throwable {
         String namespaceURI = "http://www.wedding.com/";
         String qualifiedName;
@@ -166,12 +142,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify exceptions.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS4() throws Throwable {
         String namespaceURI = "http://www.w3.org/XML/1998/namespaces";
         String qualifiedName = "xml:attr1";
@@ -189,12 +159,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify exceptions.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS5() throws Throwable {
         String namespaceURI = "http://www.ecommerce.org/";
         String qualifiedName = "econm:local";
@@ -206,12 +170,6 @@
         attrName = newAttr.getName();
         assertEquals("throw_Equals", qualifiedName, attrName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS6() throws Throwable {
         String namespaceURI = "http://www.example.com/";
         Document doc;
diff --git a/luni/src/test/java/tests/org/w3c/dom/CreateDocument.java b/luni/src/test/java/tests/org/w3c/dom/CreateDocument.java
index babdac7..e973842 100644
--- a/luni/src/test/java/tests/org/w3c/dom/CreateDocument.java
+++ b/luni/src/test/java/tests/org/w3c/dom/CreateDocument.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -56,7 +51,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocument')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
  */
-@TestTargetClass(DOMImplementation.class)
 public final class CreateDocument extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -86,12 +80,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument1() throws Throwable {
         String namespaceURI = "http://www.ecommerce.org/";
         String malformedName = "prefix::local";
@@ -112,12 +100,6 @@
         assertTrue("throw_NAMESPACE_ERR", success);
 
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument2() throws Throwable {
         String namespaceURI = null;
 
@@ -183,12 +165,6 @@
 //        assertTrue("throw_WRONG_DOCUMENT_ERR", success);
 //
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument5() throws Throwable {
         String namespaceURI = "http://www.ecommerce.org/schema";
         String qualifiedName;
@@ -241,12 +217,6 @@
 
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument6() throws Throwable {
         String namespaceURI = "http://ecommerce.org/schema";
         String qualifiedName = "xml:local";
@@ -267,12 +237,6 @@
         assertTrue("throw_NAMESPACE_ERR", success);
 
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument7() throws Throwable {
         String namespaceURI = "http://www.ecommerce.org/schema";
         String qualifiedName = "y:x";
@@ -291,12 +255,6 @@
         assertEquals("nodeName", "#document", nodeName);
         assertNull("nodeValue", nodeValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument8() throws Throwable {
         String namespaceURI = "http://www.example.org/schema";
         DocumentType docType = null;
diff --git a/luni/src/test/java/tests/org/w3c/dom/CreateDocumentType.java b/luni/src/test/java/tests/org/w3c/dom/CreateDocumentType.java
index d3b84d6..67da437 100644
--- a/luni/src/test/java/tests/org/w3c/dom/CreateDocumentType.java
+++ b/luni/src/test/java/tests/org/w3c/dom/CreateDocumentType.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -56,7 +51,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('Level-2-Core-DOM-createDocType')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
  */
-@TestTargetClass(DOMImplementation.class)
 public final class CreateDocumentType extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -86,12 +80,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocumentType",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateDocumentType1() throws Throwable {
         String publicId = "STAFF";
         String systemId = "staff.xml";
@@ -112,12 +100,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocumentType",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateDocumentType2() throws Throwable {
         String publicId = "http://www.localhost.com/";
         String systemId = "myDoc.dtd";
@@ -171,12 +153,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocumentType",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateDocumentType3() throws Throwable {
 
         String qualifiedName = "prefix:myDoc";
@@ -196,12 +172,6 @@
         nodeValue = newType.getNodeValue();
         assertNull("nodeValue", nodeValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify null as parameters.",
-        method = "createDocumentType",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateDocumentType4() throws Throwable {
         String publicId = "http://www.example.com/";
         String systemId = "myDoc.dtd";
diff --git a/luni/src/test/java/tests/org/w3c/dom/CreateElementNS.java b/luni/src/test/java/tests/org/w3c/dom/CreateElementNS.java
index 166521f..50bfbf3 100644
--- a/luni/src/test/java/tests/org/w3c/dom/CreateElementNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/CreateElementNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -53,7 +48,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-DocCrElNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NAMESPACE_ERR'])</a>
  */
-@TestTargetClass(Document.class)
 public final class CreateElementNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -83,12 +77,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify null as a parameters, and other types of DOMException.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS1() throws Throwable {
         String namespaceURI = "http://www.ecommerce.org/";
         String malformedName = "prefix::local";
@@ -106,12 +94,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify null as a parameters, and other types of DOMException.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS2() throws Throwable {
         String namespaceURI = null;
 
@@ -130,12 +112,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify null as a parameters, and other types of DOMException.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS3() throws Throwable {
         String namespaceURI = "http://www.wedding.com/";
         String qualifiedName;
@@ -185,12 +161,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify null as a parameters, and other types of DOMException.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS4() throws Throwable {
         String namespaceURI = "http://www.w3.org/XML/1998/namespaces";
         String qualifiedName = "xml:element1";
@@ -208,12 +178,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify null as a parameters, and other types of DOMException.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS5() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String qualifiedName = "gov:faculty";
@@ -225,12 +189,6 @@
         elementName = newElement.getTagName();
         assertEquals("throw_Equals", qualifiedName, elementName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify null as a parameters, and other types of DOMException.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS6() throws Throwable {
         String namespaceURI = "http://www.example.com/";
 
diff --git a/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java b/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java
index 6d31a81..8c1e07d 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,7 +23,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
  */
-@TestTargetClass(DOMImplementation.class)
 public final class DOMImplementationCreateDocument extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -58,12 +52,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument3() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -93,12 +81,6 @@
             assertNotNull("domimplementationcreatedocument03", newDoc);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument4() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -121,12 +103,6 @@
             assertTrue("domimplementationcreatedocument04", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument5() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -148,12 +124,6 @@
             assertTrue("domimplementationcreatedocument05", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "createDocument",
-        args = {java.lang.String.class, java.lang.String.class, org.w3c.dom.DocumentType.class}
-    )
     public void testCreateDocument7() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java b/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java
index a6bdfb5..9fd57b6 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -48,7 +43,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-DOM-createDocument</a>
  */
-@TestTargetClass(DOMImplementation.class)
 public final class DOMImplementationCreateDocumentType extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -78,12 +72,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "createDocumentType",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateDocumentType1() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -118,12 +106,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "createDocumentType",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateDocumentType2() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -161,12 +143,6 @@
                     ownerDocument);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "createDocumentType",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateDocumentType4() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java b/luni/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java
index e528009..703730b 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,7 +23,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-5CED94D7</a>
  */
-@TestTargetClass(DOMImplementation.class)
 public final class DOMImplementationHasFeature extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -58,12 +52,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that hasFeature returns true value.",
-        method = "hasFeature",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasFeatureCore() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -73,12 +61,6 @@
         state = domImpl.hasFeature("core", "2.0");
         assertTrue("domimplementationFeaturecoreAssert", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that hasFeature returns true value.",
-        method = "hasFeature",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasFeatureXml() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -88,12 +70,6 @@
         state = domImpl.hasFeature("xml", "2.0");
         assertTrue("domimplementationFeaturexmlVersion2Assert", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that hasFeature method returns false.",
-        method = "hasFeature",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasFeature1() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -129,12 +105,6 @@
             assertTrue("domimplementationhasfeature01_Core_3", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that hasFeature method returns false.",
-        method = "hasFeature",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasFeature2() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DOMTestCase.java b/luni/src/test/java/tests/org/w3c/dom/DOMTestCase.java
index e962d55..a550898 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DOMTestCase.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DOMTestCase.java
@@ -1,7 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargetClass;
-
 import java.net.MalformedURLException;
 import java.net.URL;
 
@@ -13,7 +11,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(Document.class)
 public class DOMTestCase extends TestCase {
 
     public Document load(String docURI, DocumentBuilder builder) {
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java
index 681c4be..00d5287 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -52,7 +47,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrAttrNS</a>
  */
-@TestTargetClass(Document.class)
 public final class DocumentCreateAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -82,12 +76,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS1() throws Throwable {
         Document doc;
         Attr attribute;
@@ -110,12 +98,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS2() throws Throwable {
         Document doc;
         Attr attribute1;
@@ -156,12 +138,6 @@
         assertEquals("documentcreateattributeNS02_att2_namespaceURI",
                 "http://www.w3.org/2000/xmlns/", namespaceURI);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createAttributeNS throws DOMException with INVALID_CHARACTER_ERR code.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS3() throws Throwable {
         Document doc;
 
@@ -193,12 +169,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createAttributeNS throws DOMException with NAMESPACE_ERR code.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS4() throws Throwable {
         Document doc;
 
@@ -228,12 +198,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createAttributeNS throws DOMException with NAMESPACE_ERR code.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS5() throws Throwable {
         Document doc;
         Document newDoc;
@@ -259,12 +223,6 @@
             assertTrue("documentcreateattributeNS05", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createAttributeNS throws DOMException with NAMESPACE_ERR code.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS6() throws Throwable {
         Document doc;
         Document newDoc;
@@ -289,12 +247,6 @@
             assertTrue("documentcreateattributeNS06", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createAttributeNS throws DOMException with NAMESPACE_ERR code.",
-        method = "createAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateAttributeNS7() throws Throwable {
         Document doc;
 
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java b/luni/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java
index 858e5d4..6c683f9 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.DOMException;
@@ -28,7 +23,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-DocCrElNS</a>
  */
-@TestTargetClass(Document.class)
 public final class DocumentCreateElementNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -58,12 +52,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS1() throws Throwable {
         Document doc;
         Element element;
@@ -88,12 +76,6 @@
         assertEquals("documentcreateelementNS01_prefix", "XML", prefix);
         assertEquals("documentcreateelementNS01_tagName", "XML:XML", tagName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createElementNS throws DOMException with INVALID_CHARACTER_ERR code.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS2() throws Throwable {
         Document doc;
 
@@ -112,12 +94,6 @@
             assertTrue("documentcreateelementNS02", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createElementNS throws DOMException with NAMESPACE_ERR code.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS5() throws Throwable {
         Document doc;
 
@@ -136,12 +112,6 @@
             assertTrue("documentcreateelementNS05", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that createElementNS throws DOMException with NAMESPACE_ERR code.",
-        method = "createElementNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCreateElementNS6() throws Throwable {
         Document doc;
         Document newDoc;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java b/luni/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java
index 35f4465..d88c3e8 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.DOMImplementation;
@@ -31,7 +26,6 @@
  * @see <a
  *      href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
  */
-@TestTargetClass(Document.class)
 public final class DocumentGetElementsByTagnameNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -61,12 +55,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies '*' as parameters.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS1() throws Throwable {
         Document doc;
         Document newDoc;
@@ -83,12 +71,6 @@
         assertEquals("documentgetelementsbytagnameNS01", 1, childList
                 .getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies '*' as the first parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS2() throws Throwable {
         Document doc;
         Element docElem;
@@ -103,12 +85,6 @@
         assertEquals("documentgetelementsbytagnameNS02", 6, childList
                 .getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies wrong namespaceURI as a parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS3() throws Throwable {
         Document doc;
         NodeList childList;
@@ -117,12 +93,6 @@
         assertEquals("documentgetelementsbytagnameNS03", 0, childList
                 .getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS4() throws Throwable {
         Document doc;
         NodeList childList;
@@ -133,12 +103,6 @@
         assertEquals("documentgetelementsbytagnameNS04", 0, childList
                 .getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS5() throws Throwable {
         Document doc;
         NodeList childList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java b/luni/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java
index 5db6a5f..b4b3f0f 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -24,7 +19,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBId</a>
  */
-@TestTargetClass(Document.class)
 public final class DocumentGeteEementById extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -54,12 +48,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify getElementById method for existent element.",
-        method = "getElementById",
-        args = {java.lang.String.class}
-    )
     public void testGetElementById() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentImportNode.java b/luni/src/test/java/tests/org/w3c/dom/DocumentImportNode.java
index 1e26b90..e864f99 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentImportNode.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentImportNode.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -37,7 +32,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
  */
-@TestTargetClass(Document.class)
 public final class DocumentImportNode extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -90,12 +84,6 @@
 //        assertEquals("documentimportnode01_nodeType", 2, nodeType);
 //        assertEquals("documentimportnode01_nodeValue", "Yes", nodeValue);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException exception.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode2() throws Throwable {
         Document doc;
         Document docImported;
@@ -178,12 +166,6 @@
 //        assertEquals("documentimportnode04_nodeType", 2, nodeType);
 //        assertEquals("documentimportnode04_nodeValue", "defaultVal", nodeValue);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException exception.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode5() throws Throwable {
         Document doc;
         Document docImported;
@@ -207,12 +189,6 @@
         assertEquals("documentimportnode05_namespaceURI",
                 "http://www.w3.org/DOM/Test", namespaceURI);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that importNode method throws DOMException with NOT_SUPPORTED_ERR code.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode6() throws Throwable {
         Document doc;
 
@@ -228,12 +204,6 @@
             assertTrue("throw_NOT_SUPPORTED_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that importNode method throws DOMException with NOT_SUPPORTED_ERR code.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode7() throws Throwable {
         Document doc;
 
@@ -251,12 +221,6 @@
             assertTrue("throw_NOT_SUPPORTED_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that importNode method throws DOMException with NOT_SUPPORTED_ERR code.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode8() throws Throwable {
         Document doc;
 
@@ -278,12 +242,6 @@
             assertTrue("throw_NOT_SUPPORTED_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException exception.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode9() throws Throwable {
         Document doc;
         DocumentFragment docFragment;
@@ -301,12 +259,6 @@
         success = importedDocFrag.hasChildNodes();
         assertFalse("documentimportnode09", success);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality; doesn't verify DOMException exceptions.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode10() throws Throwable {
         Document doc;
         DocumentFragment docFragment;
@@ -324,12 +276,6 @@
         success = importedDocFrag.hasChildNodes();
         assertTrue("documentimportnode10", success);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException exception.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode11() throws Throwable {
         Document doc;
         Element docElement;
@@ -347,12 +293,6 @@
         assertEquals("documentimportnode11_NodeName", nodeNameImported,
                 nodeNameOrig);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException exception.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode12() throws Throwable {
         Document doc;
         NodeList childList;
@@ -372,12 +312,6 @@
         importedLen = (int) importedChildren.getLength();
         assertEquals("documentimportnode12", importedLen, addressElemLen);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException exception.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode13() throws Throwable {
         Document doc;
         NodeList childList;
@@ -421,12 +355,6 @@
 //                "http://www.w3.org/2000/xmlns/", "emp");
 //        assertEquals("explicitAttrImported", "http://www.nist.gov", attrValue);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies import of TEXT_NODE.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode15() throws Throwable {
         Document doc;
 
@@ -442,12 +370,6 @@
         assertEquals("documentimportnode15",
                 "Document.importNode test for a TEXT_NODE", nodeValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies import of COMMENT_NODE",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode17() throws Throwable {
         Document doc;
 
@@ -463,12 +385,6 @@
         assertEquals("documentimportnode17",
                 "Document.importNode test for a COMMENT_NODE", nodeValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException exception.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode18() throws Throwable {
         Document doc;
 
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java b/luni/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java
index db485f1..284e66c 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.Document;
 import org.w3c.dom.DOMImplementation;
@@ -24,7 +19,6 @@
  * @see <a
  *      href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
  */
-@TestTargetClass(DocumentType.class)
 public final class DocumentTypeInternalSubset extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -54,12 +48,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't check positive case.",
-        method = "getInternalSubset",
-        args = {}
-    )
     public void testGetInternalSubset() throws Throwable {
         Document doc;
         DocumentType docType;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java b/luni/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java
index 50199f6..f2544f0 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.DOMImplementation;
@@ -45,7 +40,6 @@
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId</a>
 * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
 */
-@TestTargetClass(DocumentType.class)
 public final class DocumentTypePublicId extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -73,12 +67,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicId",
-        args = {}
-    )
    public void testGetPublicId() throws Throwable {
       Document doc;
       DocumentType docType;
diff --git a/luni/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java b/luni/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java
index 5aade95..4908e1f 100644
--- a/luni/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java
+++ b/luni/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.Document;
 import org.w3c.dom.DOMImplementation;
@@ -42,7 +37,6 @@
 * @author Neil Delima
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a>
 */
-@TestTargetClass(DocumentType.class)
 public final class DocumentTypeSystemId extends DOMTestCase {
     DOMDocumentBuilderFactory factory;
 
@@ -70,12 +64,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSystemId",
-        args = {}
-    )
    public void testGetSystemId() throws Throwable {
       Document doc;
       DocumentType docType;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java
index fde97ea..5b390f8 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java
@@ -22,8 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargetClass;
-
 import javax.xml.parsers.DocumentBuilder;
 
 import org.w3c.dom.Document;
@@ -41,7 +39,6 @@
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAttrNS</a>
 * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
 */
-@TestTargetClass(Element.class)
 public final class ElementGetAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java b/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java
index 8c0024459f..61791a2 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.Attr;
@@ -23,7 +18,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a>
  */
-@TestTargetClass(Element.class)
 public final class ElementGetAttributeNodeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -53,12 +47,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNodeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNodeNS1() throws Throwable {
         Document doc;
         Element element;
@@ -96,12 +84,6 @@
         assertEquals("elementgetattributenodens01_attrNs",
                 "http://www.w3.org/DOM/Level2", attrNS);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNodeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNodeNS2() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java b/luni/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java
index 5e54ed1..b5657a6 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -23,7 +18,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
  */
-@TestTargetClass(Element.class)
 public final class ElementGetElementsByTagNameNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -53,12 +47,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS1() throws Throwable {
         Document doc;
         Element element;
@@ -69,12 +57,6 @@
         assertEquals("elementgetelementsbytagnamens02", 0, elementList
                 .getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS4() throws Throwable {
         Document doc;
         Element element;
@@ -102,12 +84,6 @@
         assertEquals("elementgetelementsbytagnamens04_2", 3, elementList
                 .getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS5() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java b/luni/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java
index 3d5de49..1132fef 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.Attr;
@@ -21,7 +16,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
  */
-@TestTargetClass(Element.class)
 public final class ElementHasAttribute extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -51,12 +45,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies hasAttribute method with empty string as a parameter.",
-        method = "hasAttribute",
-        args = {java.lang.String.class}
-    )
     public void testHasAttribute1() throws Throwable {
         Document doc;
         Element element;
@@ -80,12 +68,6 @@
 //        state = element.hasAttribute("defaultAttr");
 //        assertTrue("elementhasattribute02", state);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "hasAttribute",
-        args = {java.lang.String.class}
-    )
     public void testHasAttribute3() throws Throwable {
         Document doc;
         Element element;
@@ -101,12 +83,6 @@
         state = element.hasAttribute("domestic");
         assertTrue("elementhasattribute03_True", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "hasAttribute",
-        args = {java.lang.String.class}
-    )
     public void testHasAttribute4() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java
index 2c5e582..1f84cbc 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -47,7 +42,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
  */
-@TestTargetClass(Element.class)
 public final class ElementHasAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -77,12 +71,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "hasAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void _testHasAttributeNS1() throws Throwable {
         Document doc;
         Element element;
@@ -95,12 +83,6 @@
                 .hasAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns");
         assertTrue("elementhasattributens01", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "hasAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasAttributeNS2() throws Throwable {
         Document doc;
         Element element;
@@ -114,12 +96,6 @@
         state = element.hasAttributeNS("http://www.w3.org/DOM", "domestic");
         assertTrue("hasDomesticAttr", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "hasAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasAttributeNS3() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java
index 137ea54..a535072 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -23,7 +18,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElRemAtNS</a>
  */
-@TestTargetClass(Element.class)
 public final class ElementRemoveAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -53,12 +47,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "removeAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveAttributeNS() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java
index 09be837..450fd4c 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -28,7 +23,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAttrNS</a>
  */
-@TestTargetClass(Element.class)
 public final class ElementSetAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -58,12 +52,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS1() throws Throwable {
         Document doc;
         Element element;
@@ -81,12 +69,6 @@
         assertEquals("elementsetattributens01_attrName", "attr", attrName);
         assertEquals("elementsetattributens01_attrValue", "value", attrValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS2() throws Throwable {
         Document doc;
         Element element;
@@ -108,12 +90,6 @@
         assertEquals("elementsetattributens02_attrValue", "Silver Street",
                 attrValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS3() throws Throwable {
         Document doc;
         Element element;
@@ -137,12 +113,6 @@
                 attrName);
         assertEquals("elementsetattributens03_attrValue", "default1", attrValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with INVALID_CHARACTER_ERR.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS4() throws Throwable {
         Document doc;
         Element element;
@@ -176,12 +146,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS5() throws Throwable {
         Document doc;
         Element element;
@@ -201,12 +165,6 @@
             assertTrue("elementsetattributens05", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS8() throws Throwable {
         Document doc;
         Element element;
@@ -236,12 +194,6 @@
             assertTrue("elementsetattributens08_Err2", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNSURINull() throws Throwable {
           String namespaceURI = null;
 
diff --git a/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java b/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java
index 3a4279c..192db97 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.Attr;
@@ -49,7 +44,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElSetAtNodeNS</a>
  */
-@TestTargetClass(Element.class)
 public final class ElementSetAttributeNodeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -79,12 +73,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNodeNS1() throws Throwable {
         Document doc;
         Element element;
@@ -118,12 +106,6 @@
         length = (int) attributes.getLength();
         assertEquals("length", 1, length);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNodeNS2() throws Throwable {
         Document doc;
         Element element;
@@ -149,12 +131,6 @@
         assertEquals("elementsetattributenodens02_attrName", "street", attrName);
         assertEquals("elementsetattributenodens02_attrValue", "Yes", attrValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNodeNS3() throws Throwable {
         Document doc;
         Element element1;
@@ -181,12 +157,6 @@
             assertTrue("elementsetattributenodens03", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNodeNS4() throws Throwable {
         Document doc;
         Element element1;
@@ -209,12 +179,6 @@
             assertTrue("elementsetattributenodens04", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with WRONG_DOCUMENT_ERR code.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNodeNS5() throws Throwable {
         Document doc;
         Document docAlt;
@@ -237,12 +201,6 @@
             assertTrue("throw_WRONG_DOCUMENT_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NO_MODIFICATION_ALLOWED_ERR code.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void _testSetAttributeNodeNS6() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/GetAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/GetAttributeNS.java
index c8244f2..155b75c 100644
--- a/luni/src/test/java/tests/org/w3c/dom/GetAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/GetAttributeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -48,7 +43,6 @@
  * @see <a
  *      href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
  */
-@TestTargetClass(Element.class)
 public final class GetAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -93,12 +87,6 @@
 //        attrValue = testAddr.getAttributeNS(namespaceURI, localName);
 //        assertEquals("attrValue", "DISTRICT", attrValue);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNS2() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String localName = "district";
@@ -120,12 +108,6 @@
         attrValue = testAddr.getAttributeNS(namespaceURI, localName);
         assertEquals("throw_Equals", "", attrValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNS3() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String localName = "domestic";
@@ -141,12 +123,6 @@
         attrValue = testAddr.getAttributeNS(namespaceURI, localName);
         assertEquals("throw_Equals", "", attrValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNS4() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String localName = "blank";
@@ -166,12 +142,6 @@
         attrValue = testAddr.getAttributeNS(namespaceURI, localName);
         assertEquals("throw_Equals", "NewValue", attrValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNS5() throws Throwable {
         Document doc;
         NodeList elementList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java b/luni/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java
index 2ef70a6..7b5c44c 100644
--- a/luni/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -47,7 +42,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElGetAtNodeNS</a>
  */
-@TestTargetClass(Element.class)
 public final class GetAttributeNodeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -77,12 +71,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNodeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNodeNS1() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String localName = "invalidlocalname";
@@ -97,12 +85,6 @@
         attribute = testAddr.getAttributeNodeNS(namespaceURI, localName);
         assertNull("throw_Null", attribute);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getAttributeNodeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetAttributeNodeNS2() throws Throwable {
         Document doc;
         NodeList elementList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/GetElementById.java b/luni/src/test/java/tests/org/w3c/dom/GetElementById.java
index 62e1d19..b49df62 100644
--- a/luni/src/test/java/tests/org/w3c/dom/GetElementById.java
+++ b/luni/src/test/java/tests/org/w3c/dom/GetElementById.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -46,7 +41,6 @@
  * @see <a
  *      href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=383">http://www.w3.org/Bugs/Public/show_bug.cgi?id=383</a>
  */
-@TestTargetClass(Document.class)
 public final class GetElementById extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -86,12 +80,6 @@
 //        tagname = element.getTagName();
 //        assertEquals("throw_Equals", "emp:address", tagname);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify getElementById method for existent element.",
-        method = "getElementById",
-        args = {java.lang.String.class}
-    )
     public void testGetElementById2() throws Throwable {
         Document doc;
         Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java b/luni/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java
index d93da93..19dc827 100644
--- a/luni/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -50,7 +45,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getElBTNNS</a>
  */
-@TestTargetClass(Document.class)
 public final class GetElementsByTagNameNS extends DOMTestCase {
     DOMDocumentBuilderFactory factory;
 
@@ -72,12 +66,6 @@
         builder = null;
         super.tearDown();
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS method with * as parameters.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS1() throws Throwable {
         String namespaceURI = "*";
         String localName = "*";
@@ -89,12 +77,6 @@
         assertEquals("throw_Size", 36, newList.getLength());
         // END android-changed
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS with '*' as the first parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS2() throws Throwable {
         Document doc;
         NodeList newList;
@@ -110,12 +92,6 @@
         lname = newElement.getLocalName();
         assertEquals("lname", "employee", lname);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS with '*' as the second parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS3() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -148,12 +124,6 @@
         }
         assertEquals("nodeNames", expectedResult, result);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS with '*' as the first parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS4() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -177,12 +147,6 @@
         }
         assertEquals("nodeNames", expectedResult, result);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies negative case of getElementsByTagNameNS method.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS5() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String localName = "nomatch";
@@ -192,12 +156,6 @@
         elementList = doc.getElementsByTagNameNS(namespaceURI, localName);
         assertEquals("throw_Size", 0, elementList.getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies negative case of getElementsByTagNameNS method.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS6() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -206,12 +164,6 @@
                 "address");
         assertEquals("matchSize", 0, elementList.getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case of getElementsByTagNameNS method.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS7() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -220,12 +172,6 @@
                 "address");
         assertEquals("addresses", 3, elementList.getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS method with '*' as parameters; positive case.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS8() throws Throwable {
         Document doc;
         Element docElem;
@@ -235,12 +181,6 @@
         newList = docElem.getElementsByTagNameNS("*", "*");
         assertEquals("listSize", 35, newList.getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS method with '*' as the first parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS9() throws Throwable {
         Document doc;
         NodeList newList;
@@ -258,12 +198,6 @@
         lname = newElement.getLocalName();
         assertEquals("lname", "employee", lname);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS method with '*' as the second parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS10() throws Throwable {
         Document doc;
         Element docElem;
@@ -299,12 +233,6 @@
         }
         assertEquals("nodeNames", expectedResult, result);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies getElementsByTagNameNS method with '*' as the first parameter.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS11() throws Throwable {
         Document doc;
         Element docElem;
@@ -330,12 +258,6 @@
         }
         assertEquals("nodeNames", expectedResult, result);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies negative case for getElementsByTagNameNS method.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS12() throws Throwable {
         Document doc;
         Element docElem;
@@ -346,12 +268,6 @@
                 "nomatch");
         assertEquals("size", 0, elementList.getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies negative case for getElementsByTagNameNS method.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS13() throws Throwable {
         Document doc;
         Element docElem;
@@ -362,12 +278,6 @@
                 "address");
         assertEquals("matchSize", 0, elementList.getLength());
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case for getElementsByTagNameNS method.",
-        method = "getElementsByTagNameNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetElementsByTagNameNS14() throws Throwable {
         Document doc;
         Element docElem;
diff --git a/luni/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java
index 51160f5..70c3b53 100644
--- a/luni/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Attr;
@@ -27,7 +22,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class GetNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -57,12 +51,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getNamedItem",
-        args = {java.lang.String.class}
-    )
     public void testGetNamedItemNS1() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -79,12 +67,6 @@
         attrName = domesticAttr.getNodeName();
         assertEquals("attrName", "dmstc:domestic", attrName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetNamedItemNS2() throws Throwable {
         String namespaceURI = "http://www.usa.com";
         String localName = "domest";
diff --git a/luni/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java
index b131444..1c9d65a 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java
@@ -18,8 +18,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargetClass;
-
 import javax.xml.parsers.DocumentBuilder;
 
 import org.w3c.dom.DOMException;
@@ -37,7 +35,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class HCEntitiesRemoveNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
diff --git a/luni/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java
index 56186b8..692b33e 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java
@@ -1,7 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargetClass;
-
 import javax.xml.parsers.DocumentBuilder;
 
 import org.w3c.dom.DOMException;
@@ -20,7 +18,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class HCEntitiesSetNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
diff --git a/luni/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java b/luni/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java
index aab04f2..91d2591 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java
@@ -18,11 +18,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -42,7 +37,6 @@
  * @see <a
  *      href="http://www.w3.org/2000/11/DOM-Level-2-errata#core-4">http://www.w3.org/2000/11/DOM-Level-2-errata#core-4</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class HCNamedNodeMapInvalidType extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -72,12 +66,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that setNamedItem method throws DOMException with HIERARCHY_REQUEST_ERR code.",
-        method = "setNamedItem",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testNamedNodeMapInvalidType() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
diff --git a/luni/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java b/luni/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java
index d2fa3ae..d3ac61e 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentFragment;
@@ -22,7 +17,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-B63ED1A3</a>
  */
-@TestTargetClass(Node.class)
 public final class HCNodeDocumentFragmentNormalize extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -52,20 +46,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Verifies positive functionality of getNodeValue method, and that getNextSibling method returns null.",
-            method = "getNodeValue",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Verifies positive functionality of getNodeValue method, and that getNextSibling method returns null.",
-            method = "getNextSibling",
-            args = {}
-        )
-    })
     public void testNodeDocumentFragmentNormalize1() throws Throwable {
         Document doc;
         DocumentFragment docFragment;
@@ -86,12 +66,6 @@
         retval = txtNode.getNextSibling();
         assertNull("singleChild", retval);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getFirstChild method returns null.",
-        method = "getFirstChild",
-        args = {}
-    )
     public void testNodeDocumentFragmentNormalize2() throws Throwable {
         Document doc;
         DocumentFragment docFragment;
diff --git a/luni/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java
index acde3a7..b658387 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java
@@ -18,11 +18,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
@@ -40,7 +35,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-removeNamedItemNS</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class HCNotationsRemoveNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -70,12 +64,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that removeNamedItemNS method throws DOMException.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS() throws Throwable {
         Document doc;
         NamedNodeMap notations;
diff --git a/luni/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java
index a58eda3..267b2f3 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java
@@ -18,11 +18,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
@@ -41,7 +36,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class HCNotationsSetNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -71,12 +65,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that setNamedItemNS throws DOMException.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testNotationsSetNamedItemNS() throws Throwable {
         Document doc;
         NamedNodeMap notations;
diff --git a/luni/src/test/java/tests/org/w3c/dom/HasAttribute.java b/luni/src/test/java/tests/org/w3c/dom/HasAttribute.java
index d0cd09a..1509e69 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HasAttribute.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HasAttribute.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -22,7 +17,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttr</a>
  */
-@TestTargetClass(Element.class)
 public final class HasAttribute extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -52,12 +46,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that hasAttribute method returns false.",
-        method = "hasAttribute",
-        args = {java.lang.String.class}
-    )
     public void testHasAttribute1() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -82,12 +70,6 @@
 //        state = testNode.hasAttribute("street");
 //        assertTrue("throw_True", state);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that hasAttribute method returns false.",
-        method = "hasAttribute",
-        args = {java.lang.String.class}
-    )
     public void testHasAttribute3() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -99,12 +81,6 @@
         state = testNode.hasAttribute("nomatch");
         assertFalse("throw_False", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that hasAttribute method returns true.",
-        method = "hasAttribute",
-        args = {java.lang.String.class}
-    )
     public void testHasAttribute4() throws Throwable {
         Document doc;
         NodeList elementList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/HasAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/HasAttributeNS.java
index 8ff8fd0..b81b007 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HasAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HasAttributeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -46,7 +41,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-ElHasAttrNS</a>
  */
-@TestTargetClass(Element.class)
 public final class HasAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -76,12 +70,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "hasAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasAttributeNS1() throws Throwable {
         String localName = "nomatch";
         String namespaceURI = "http://www.usa.com";
@@ -95,12 +83,6 @@
         state = testNode.hasAttributeNS(namespaceURI, localName);
         assertFalse("throw_False", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "hasAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasAttributeNS2() throws Throwable {
         String localName = "domestic";
         String namespaceURI = "http://www.nomatch.com";
@@ -114,12 +96,6 @@
         state = testNode.hasAttributeNS(namespaceURI, localName);
         assertFalse("throw_False", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "hasAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasAttributeNS3() throws Throwable {
         String localName = "blank";
         String namespaceURI = "http://www.nist.gov";
@@ -150,12 +126,6 @@
 //        state = testNode.hasAttributeNS(namespaceURI, localName);
 //        assertTrue("hasAttribute", state);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "hasAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testHasAttributeNS5() throws Throwable {
         String localName = "domestic";
         String namespaceURI = "http://www.usa.com";
diff --git a/luni/src/test/java/tests/org/w3c/dom/HasAttributes.java b/luni/src/test/java/tests/org/w3c/dom/HasAttributes.java
index 059d883..11c6d5e 100644
--- a/luni/src/test/java/tests/org/w3c/dom/HasAttributes.java
+++ b/luni/src/test/java/tests/org/w3c/dom/HasAttributes.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -43,7 +38,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
  */
-@TestTargetClass(Node.class)
 public final class HasAttributes extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -73,12 +67,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that hasAttributes method returns false value.",
-        method = "hasAttributes",
-        args = {}
-    )
     public void testHasAttributes1() throws Throwable {
         Document doc;
         NodeList addrList;
@@ -90,12 +78,6 @@
         state = addrNode.hasAttributes();
         assertFalse("throw_False", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that hasAttributes method returns true value.",
-        method = "hasAttributes",
-        args = {}
-    )
     public void testHasAttributes2() throws Throwable {
         Document doc;
         NodeList addrList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/ImportNode.java b/luni/src/test/java/tests/org/w3c/dom/ImportNode.java
index 2064678..442bac7 100644
--- a/luni/src/test/java/tests/org/w3c/dom/ImportNode.java
+++ b/luni/src/test/java/tests/org/w3c/dom/ImportNode.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -64,7 +59,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode">http://www.w3.org/TR/DOM-Level-2-Core/core#Core-Document-importNode</a>
  */
-@TestTargetClass(Document.class)
 public final class ImportNode extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -94,12 +88,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void _testImportNode1() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -143,12 +131,6 @@
         childValue = child.getNodeValue();
         assertEquals("childValue", "importedText", childValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode2() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -171,12 +153,6 @@
         value = aNode.getNodeValue();
         assertEquals("nodeValue", "this is CDATASection data", value);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode3() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -199,12 +175,6 @@
         value = aNode.getNodeValue();
         assertEquals("nodeValue", "this is a comment", value);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode4() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -226,12 +196,6 @@
         childValue = child.getNodeValue();
         assertEquals("descendant1", "descendant1", childValue);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode5() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -259,12 +223,6 @@
         name = aNode.getNodeName();
         assertEquals("nodeName", "emp:address", name);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode6() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -314,12 +272,6 @@
 //        lname = attr.getLocalName();
 //        assertEquals("lname", "defaultAttr", lname);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode8() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -378,12 +330,6 @@
 //        notationName = entity1.getNotationName();
 //        assertEquals("notationName", "notation2", notationName);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode10() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -493,12 +439,6 @@
 //        system = aNode.getSystemId();
 //        assertNull("notationSystemId", system);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode14() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -525,12 +465,6 @@
         data = aNode.getData();
         assertEquals("piData", "data1", data);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode15() throws Throwable {
         Document doc;
         Document aNewDoc;
@@ -553,12 +487,6 @@
         value = aNode.getNodeValue();
         assertEquals("nodeValue", "this is text data", value);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that importNode method throws DOMException with NOT_SUPPORTED_ERR code.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode16() throws Throwable {
         Document doc;
         Document anotherDoc;
@@ -578,12 +506,6 @@
             assertTrue("throw_NOT_SUPPORTED_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that importNode method throws DOMException with NOT_SUPPORTED_ERR code.",
-        method = "importNode",
-        args = {org.w3c.dom.Node.class, boolean.class}
-    )
     public void testImportNode17() throws Throwable {
         Document doc;
         Document anotherDoc;
diff --git a/luni/src/test/java/tests/org/w3c/dom/InternalSubset.java b/luni/src/test/java/tests/org/w3c/dom/InternalSubset.java
index 17eb385..239b793 100644
--- a/luni/src/test/java/tests/org/w3c/dom/InternalSubset.java
+++ b/luni/src/test/java/tests/org/w3c/dom/InternalSubset.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.Document;
 
@@ -44,7 +39,6 @@
 * @author Mary Brady
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-internalSubset</a>
 */
-@TestTargetClass(DocumentType.class)
 public final class InternalSubset extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -72,12 +66,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that getInternalSubset method returns the internal subset as a string.",
-        method = "getInternalSubset",
-        args = {}
-    )
    public void testGetInternalSubset() throws Throwable {
       Document doc;
       DocumentType docType;
diff --git a/luni/src/test/java/tests/org/w3c/dom/IsSupported.java b/luni/src/test/java/tests/org/w3c/dom/IsSupported.java
index 14e20c3..b27d9c8 100644
--- a/luni/src/test/java/tests/org/w3c/dom/IsSupported.java
+++ b/luni/src/test/java/tests/org/w3c/dom/IsSupported.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -30,7 +25,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
  */
-@TestTargetClass(Document.class)
 public final class IsSupported extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -60,12 +54,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns false.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported1() throws Throwable {
         Document doc;
         Node rootNode;
@@ -75,12 +63,6 @@
         state = rootNode.isSupported("XXX", "1.0");
         assertFalse("throw_False", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns false value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported2() throws Throwable {
         Document doc;
         Node rootNode;
@@ -90,12 +72,6 @@
         state = rootNode.isSupported("XML", "9.0");
         assertFalse("throw_False", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns true value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported4() throws Throwable {
         Document doc;
         Node rootNode;
@@ -105,12 +81,6 @@
         state = rootNode.isSupported("xml", "1.0");
         assertTrue("throw_True", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns true value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported5() throws Throwable {
         Document doc;
         Node rootNode;
@@ -120,12 +90,6 @@
         state = rootNode.isSupported("core", "2.0");
         assertTrue("throw_True", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns true value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported6() throws Throwable {
         Document doc;
         Node rootNode;
@@ -135,12 +99,6 @@
         state = rootNode.isSupported("xml", "2.0");
         assertTrue("throw_True", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns true value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported7() throws Throwable {
         Document doc;
         Node rootNode;
@@ -150,12 +108,6 @@
         state = rootNode.isSupported("XML", "");
         assertTrue("throw_True", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns true value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported9() throws Throwable {
         Document doc;
         Node rootNode;
@@ -165,12 +117,6 @@
         state = rootNode.isSupported("XML", "1.0");
         assertTrue("throw_True", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns true.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported10() throws Throwable {
         Document doc;
         Node rootNode;
@@ -180,12 +126,6 @@
         state = rootNode.isSupported("CORE", "2.0");
         assertTrue("throw_True", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns true.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported11() throws Throwable {
         Document doc;
         Node rootNode;
@@ -196,12 +136,6 @@
         assertTrue("throw_True", state);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported12() throws Throwable {
         List<String> features = new ArrayList<String>();
         features.add("Core");
@@ -237,12 +171,6 @@
             state = rootNode.isSupported(featureElement, "2.0");
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns correct value if it has empty string as a version parameter.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported13() throws Throwable {
         Document doc;
         Node rootNode;
@@ -252,12 +180,6 @@
         state = rootNode.isSupported("Core", "");
         assertTrue("Core", state);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns correct value if it has null as a version parameter.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported14() throws Throwable {
         Document doc;
         Node rootNode;
diff --git a/luni/src/test/java/tests/org/w3c/dom/LocalName.java b/luni/src/test/java/tests/org/w3c/dom/LocalName.java
index 7045617..9796ef2 100644
--- a/luni/src/test/java/tests/org/w3c/dom/LocalName.java
+++ b/luni/src/test/java/tests/org/w3c/dom/LocalName.java
@@ -1,10 +1,5 @@
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -28,7 +23,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a>
  */
-@TestTargetClass(Node.class)
 public final class LocalName extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -58,12 +52,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "getLocalName",
-        args = {}
-    )
     public void testGetLocalName1() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -78,12 +66,6 @@
         localName = addrAttr.getLocalName();
         assertEquals("localName", "domestic", localName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getLocalName method returns null.",
-        method = "getLocalName",
-        args = {}
-    )
     public void testGetLocalName2() throws Throwable {
         Document doc;
         Node createdNode;
@@ -93,12 +75,6 @@
         localName = createdNode.getLocalName();
         assertNull("localNameNull", localName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getLocalName method returns null.",
-        method = "getLocalName",
-        args = {}
-    )
     public void testGetLocalName3() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -112,12 +88,6 @@
         localName = textNode.getLocalName();
         assertNull("textNodeLocalName", localName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "getLocalName",
-        args = {}
-    )
     public void testGetLocalName4() throws Throwable {
         Document doc;
         NodeList elementList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java
index e6d2d73..3bdac18 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -51,7 +46,6 @@
  * @see <a
  *      href="http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html">http://lists.w3.org/Archives/Member/w3c-dom-ig/2003Nov/0016.html</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class NamedNodeMapGetNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -103,12 +97,6 @@
 //        notation = (Notation) notations.getNamedItemNS(nullNS, "notation1");
 //        assertNotNull("notationNull", notation);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetNamedItemNS2() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -126,12 +114,6 @@
         attrName = attribute.getNodeName();
         assertEquals("namednodemapgetnameditemns02", "emp:domestic", attrName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetNamedItemNS3() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -153,12 +135,6 @@
         attrName = attribute.getNodeName();
         assertEquals("namednodemapgetnameditemns03", "L2:att", attrName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetNamedItemNS4() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -178,12 +154,6 @@
         attrName = attribute.getNodeName();
         assertEquals("namednodemapgetnameditemns04", "street", attrName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "getNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetNamedItemNS5() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java
index ffdce2c..19795e8 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -48,7 +43,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-D58B193</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class NamedNodeMapRemoveNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -78,12 +72,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS1() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -124,12 +112,6 @@
 //        assertEquals("namednodemapremovenameditemns02_attrValue", "defaultVal",
 //                attrValue);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS3() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -155,12 +137,6 @@
         nodeName = attribute.getNodeName();
         assertEquals("namednodemapremovenameditemns02", "L2:att", nodeName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void _testRemoveNamedItemNS4() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -228,12 +204,6 @@
 //            }
 //        }
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that removeNamedItemNS method throws DOMException with NOT_FOUND_ERR code.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS6() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -256,12 +226,6 @@
             assertTrue("throw_NOT_FOUND_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that removeNamedItemNS method throws DOMException with NOT_FOUND_ERR code.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS7() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -284,12 +248,6 @@
             assertTrue("throw_NOT_FOUND_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that removeNamedItemNS method throws DOMException with NOT_FOUND_ERR code.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS8() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -313,12 +271,6 @@
             assertTrue("throw_NOT_FOUND_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS9() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java
index 3e8c042..70243e6 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Attr;
@@ -53,7 +48,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-getNamedItemNS</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class NamedNodeMapSetNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -86,12 +80,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testSetNamedItemNS1() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -113,12 +101,6 @@
         attrName = attribute.getNodeName();
         assertEquals("namednodemapsetnameditemns01", "streets", attrName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testSetNamedItemNS2() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -138,12 +120,6 @@
         attrName = attribute.getNodeName();
         assertEquals("namednodemapsetnameditemns02", "L1:att", attrName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that setNamedItemNS throws DOMException with WRONG_DOCUMENT_ERR code.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testSetNamedItemNS3() throws Throwable {
 
         Document doc;
@@ -179,12 +155,6 @@
             assertTrue("throw_WRONG_DOCUMENT_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that setNamedItemNS throws DOMException with WRONG_DOCUMENT_ERR code.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testSetNamedItemNS4() throws Throwable {
         Document doc;
         DOMImplementation domImpl;
@@ -255,12 +225,6 @@
 //            assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR_notations", success);
 //        }
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that setNamedItemNS throws DOMException with INUSE_ATTRIBUTE_ERR code.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testSetNamedItemNS6() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -287,12 +251,6 @@
             assertTrue("namednodemapsetnameditemns06", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that setNamedItemNS throws DOMException with INUSE_ATTRIBUTE_ERR code.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testSetNamedItemNS7() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
@@ -319,12 +277,6 @@
             assertTrue("namednodemapsetnameditemns07", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that setNamedItemNS throws DOMException with INUSE_ATTRIBUTE_ERR code.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
     public void testSetNamedItemNS8() throws Throwable {
         Document doc;
         NamedNodeMap attributes;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NamespaceURI.java b/luni/src/test/java/tests/org/w3c/dom/NamespaceURI.java
index 36edf19..9eab9db 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NamespaceURI.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NamespaceURI.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -49,7 +44,6 @@
  * @see <a
  *      href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=238">http://www.w3.org/Bugs/Public/show_bug.cgi?id=238</a>
  */
-@TestTargetClass(Attr.class)
 public final class NamespaceURI extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -94,12 +88,6 @@
 //        attrNamespaceURI = addrAttr.getNamespaceURI();
 //        assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that getNamespaceURI method returns null.",
-        method = "getNamespaceURI",
-        args = {}
-    )
     public void testGetNamespaceURI2() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -115,12 +103,6 @@
         attrNamespaceURI = addrAttr.getNamespaceURI();
         assertEquals("namespaceURI", "http://www.nist.gov", attrNamespaceURI);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that getNamespaceURI method returns null.",
-        method = "getNamespaceURI",
-        args = {}
-    )
     public void testGetNamespaceURI3() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -133,12 +115,6 @@
         employeeNamespace = testEmployee.getNamespaceURI();
         assertEquals("namespaceURI", "http://www.nist.gov", employeeNamespace);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getNamespaceURI method returns null.",
-        method = "getNamespaceURI",
-        args = {}
-    )
     public void testGetNamespaceURI4() throws Throwable {
         Document doc;
         NodeList elementList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java b/luni/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java
index ce7f150..0eaa25d 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -44,7 +39,6 @@
 * @author Neil Delima
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSLocalN</a>
 */
-@TestTargetClass(Node.class)
 public final class NodeGetLocalName extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -72,12 +66,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify that getLocalName method returns null.",
-        method = "getLocalName",
-        args = {}
-    )
    public void testGetLocalName() throws Throwable {
       Document doc;
       Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java b/luni/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java
index ae45975..627709a 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -46,7 +41,6 @@
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSname</a>
 * @see <a href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
 */
-@TestTargetClass(Node.class)
 public final class NodeGetNamespaceURI extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -74,12 +68,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getNamespaceURI",
-        args = {}
-    )
    public void testGetNamespaceURI() throws Throwable {
       Document doc;
       Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java b/luni/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java
index 8ec1b3b..e505eaa 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
@@ -48,7 +43,6 @@
  * @see <a
  *      href="http://www.w3.org/Bugs/Public/show_bug.cgi?id=259">http://www.w3.org/Bugs/Public/show_bug.cgi?id=259</a>
  */
-@TestTargetClass(Node.class)
 public final class NodeGetOwnerDocument extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -78,12 +72,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getOwnerDocument method returns null.",
-        method = "getOwnerDocument",
-        args = {}
-    )
     public void testGetOwnerDocument1() throws Throwable {
         Document doc;
         Document ownerDoc;
@@ -97,12 +85,6 @@
         ownerDoc = docType.getOwnerDocument();
         assertNull("nodegetownerdocument01", ownerDoc);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getOwnerDocument",
-        args = {}
-    )
     public void testGetOwnerDocument2() throws Throwable {
         Document doc;
         Document newDoc;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java b/luni/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java
index 49694c6..13197e8 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -44,7 +39,6 @@
 * @author Neil Delima
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
 */
-@TestTargetClass(Node.class)
 public final class NodeGetPrefix extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -73,12 +67,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrefix",
-        args = {}
-    )
    public void testGetPrefix() throws Throwable {
       Document doc;
       Element element;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java b/luni/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java
index 55029b5..d058485 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -47,7 +42,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeHasAttrs</a>
  */
-@TestTargetClass(Node.class)
 public final class NodeHasAttributes extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -77,12 +71,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hasAttributes",
-        args = {}
-    )
     public void testHasAttributes1() throws Throwable {
         Document doc;
         Element element;
@@ -98,12 +86,6 @@
         hasAttributes = element.hasAttributes();
         assertTrue("nodehasattributes01_2", hasAttributes);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that hasAttributes method returns false value.",
-        method = "hasAttributes",
-        args = {}
-    )
     public void testHasAttributes2() throws Throwable {
         Document doc;
         DocumentType docType;
@@ -113,12 +95,6 @@
         hasAttributes = docType.hasAttributes();
         assertFalse("nodehasattributes02", hasAttributes);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that hasAttributes method returns true value.",
-        method = "hasAttributes",
-        args = {}
-    )
     public void testHasAttributes3() throws Throwable {
         Document doc;
         Element element;
@@ -131,12 +107,6 @@
         hasAttributes = element.hasAttributes();
         assertTrue("hasAttributes", hasAttributes);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that hasAttributes method returns true value.",
-        method = "hasAttributes",
-        args = {}
-    )
     public void testHasAttributes4() throws Throwable {
         Document doc;
         Document newDoc;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeIsSupported.java b/luni/src/test/java/tests/org/w3c/dom/NodeIsSupported.java
index 0d77cac..8987fb3 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeIsSupported.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeIsSupported.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -55,7 +50,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports">http://www.w3.org/TR/DOM-Level-2-Core/core#Level-2-Core-Node-supports</a>
  */
-@TestTargetClass(Node.class)
 public final class NodeIsSupported extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -85,12 +79,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that isSupported method can return false value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported1() throws Throwable {
         Document doc;
         Element element;
@@ -126,12 +114,6 @@
             assertTrue("nodeissupported01_Core3", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify that isSupported method can return false value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported2() throws Throwable {
         Document doc;
         Attr attribute;
@@ -167,12 +149,6 @@
             assertTrue("nodeissupported02_Core3", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns false value if it's called with empty strings as parameters.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported3() throws Throwable {
         Document doc;
         DocumentType docType;
@@ -182,12 +158,6 @@
         success = docType.isSupported("", "");
         assertFalse("nodeissupported03", success);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns false value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported4() throws Throwable {
         Document doc;
         EntityReference entRef;
@@ -198,12 +168,6 @@
         success = entRef.isSupported("XML CORE", "");
         assertFalse("nodeissupported04", success);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that isSupported method returns false value.",
-        method = "isSupported",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testIsSupported5() throws Throwable {
         Document doc;
         ProcessingInstruction pi;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeNormalize.java b/luni/src/test/java/tests/org/w3c/dom/NodeNormalize.java
index 98db190..5fe9c87 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeNormalize.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeNormalize.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -57,7 +52,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize</a>
  */
-@TestTargetClass(Node.class)
 public final class NodeNormalize extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -87,12 +81,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "normalize",
-        args = {}
-    )
     public void testNormalize() throws Throwable {
         Document doc;
         Document newDoc;
diff --git a/luni/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java b/luni/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java
index 2394d7b..311476b 100644
--- a/luni/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java
+++ b/luni/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.util.ArrayList;
 import java.util.List;
 
@@ -54,7 +49,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
  */
-@TestTargetClass(Node.class)
 public final class NodeSetPrefix extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -84,12 +78,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setPrefix",
-        args = {java.lang.String.class}
-    )
     public void testSetPrefix1() throws Throwable {
         Document doc;
         DocumentFragment docFragment;
@@ -134,12 +122,6 @@
 //        assertEquals("nodesetprefix02_attrName", "dmstc:domestic", attrName);
 //        assertEquals("nodesetprefix02_newAttrName", "dom:address", newAttrName);
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setPrefix",
-        args = {java.lang.String.class}
-    )
     public void testSetPrefix3() throws Throwable {
         Document doc;
         Element element;
@@ -181,12 +163,6 @@
 //            assertTrue("nodesetprefix04", success);
 //        }
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setPrefix",
-        args = {java.lang.String.class}
-    )
     public void testSetPrefix5() throws Throwable {
         Document doc;
         Element element;
@@ -215,12 +191,6 @@
             }
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setPrefix",
-        args = {java.lang.String.class}
-    )
     public void testSetPrefix6() throws Throwable {
         Document doc;
         Element element;
@@ -238,12 +208,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setPrefix",
-        args = {java.lang.String.class}
-    )
     public void testSetPrefix7() throws Throwable {
         Document doc;
         Attr attribute;
@@ -261,12 +225,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR.",
-        method = "setPrefix",
-        args = {java.lang.String.class}
-    )
     public void testSetPrefix8() throws Throwable {
         Document doc;
         Element element;
@@ -287,12 +245,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with INVALID_CHARACTER_ERR code.",
-        method = "setPrefix",
-        args = {java.lang.String.class}
-    )
     public void _testSetPrefix9() throws Throwable {
         Document doc;
         String value = "#$%&'()@";
diff --git a/luni/src/test/java/tests/org/w3c/dom/Normalize.java b/luni/src/test/java/tests/org/w3c/dom/Normalize.java
index bc0f958..03d6014a 100644
--- a/luni/src/test/java/tests/org/w3c/dom/Normalize.java
+++ b/luni/src/test/java/tests/org/w3c/dom/Normalize.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -50,7 +45,6 @@
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-normalize</a>
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-72AB8359">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-72AB8359</a>
 */
-@TestTargetClass(Element.class)
 public final class Normalize extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -77,12 +71,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "normalize",
-        args = {}
-    )
    public void testNormalize() throws Throwable {
       Document doc;
       Element root;
diff --git a/luni/src/test/java/tests/org/w3c/dom/OwnerDocument.java b/luni/src/test/java/tests/org/w3c/dom/OwnerDocument.java
index a588926..eb1a8df 100644
--- a/luni/src/test/java/tests/org/w3c/dom/OwnerDocument.java
+++ b/luni/src/test/java/tests/org/w3c/dom/OwnerDocument.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Document;
 import org.w3c.dom.DocumentType;
 
@@ -42,7 +37,6 @@
 * @author Mary Brady
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc">http://www.w3.org/TR/DOM-Level-2-Core/core#node-ownerDoc</a>
 */
-@TestTargetClass(Document.class)
 public final class OwnerDocument extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -70,12 +64,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Dosn't verify that getOwnerDocument can return not null value.",
-        method = "getOwnerDocument",
-        args = {}
-    )
    public void testGetOwnerDocument() throws Throwable {
       Document doc;
       DocumentType ownerDocument;
diff --git a/luni/src/test/java/tests/org/w3c/dom/OwnerElement.java b/luni/src/test/java/tests/org/w3c/dom/OwnerElement.java
index 37bd10f..d777f42 100644
--- a/luni/src/test/java/tests/org/w3c/dom/OwnerElement.java
+++ b/luni/src/test/java/tests/org/w3c/dom/OwnerElement.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -47,7 +42,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-F68D095</a>
  */
-@TestTargetClass(Attr.class)
 public final class OwnerElement extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -77,12 +71,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies positive functionlity.",
-        method = "getOwnerElement",
-        args = {}
-    )
     public void testGetOwnerElement1() throws Throwable {
         Document doc;
         NodeList addressList;
@@ -100,12 +88,6 @@
         name = elementNode.getNodeName();
         assertEquals("throw_Equals", "address", name);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getOwnerElement method returns null.",
-        method = "getOwnerElement",
-        args = {}
-    )
     public void testGetOwnerElement2() throws Throwable {
         Document doc;
         Attr newAttr;
diff --git a/luni/src/test/java/tests/org/w3c/dom/Prefix.java b/luni/src/test/java/tests/org/w3c/dom/Prefix.java
index ea449e1..a8cf6a4 100644
--- a/luni/src/test/java/tests/org/w3c/dom/Prefix.java
+++ b/luni/src/test/java/tests/org/w3c/dom/Prefix.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Node;
 import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
@@ -49,7 +44,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-NodeNSPrefix</a>
  */
-@TestTargetClass(Node.class)
 public final class Prefix extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -79,12 +73,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method can return null.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix1() throws Throwable {
         Document doc;
         Node createdNode;
@@ -94,12 +82,6 @@
         prefix = createdNode.getPrefix();
         assertNull("throw_Null", prefix);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies positive functionality of getPrefix method.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix2() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -114,12 +96,6 @@
         prefix = textNode.getPrefix();
         assertNull("textNodePrefix", prefix);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies positive functionality of getPrefix method.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix3() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -132,12 +108,6 @@
         prefix = testEmployee.getPrefix();
         assertEquals("prefix", "emp", prefix);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method returns null.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix4() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -149,12 +119,6 @@
         prefix = testEmployee.getPrefix();
         assertNull("throw_Null", prefix);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method throws DOMException with NAMESPACE_ERR code.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix5() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -176,12 +140,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method throws DOMException with INVALID_CHARACTER_ERR code.",
-        method = "getPrefix",
-        args = {}
-    )
     public void _testGetPrefix6() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -200,12 +158,6 @@
             assertTrue("throw_INVALID_CHARACTER_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method throws DOMException with NAMESPACE_ERR code.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix7() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -258,12 +210,6 @@
 //            assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
 //        }
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method throws DOMException with NAMESPACE_ERR code.",
-        method = "getPrefix",
-        args = {}
-    )
     public void _testGetPrefix9() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -284,12 +230,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method throws DOMException with NAMESPACE_ERR code.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix10() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -308,12 +248,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getPrefix method throws DOMException with NAMESPACE_ERR code.",
-        method = "getPrefix",
-        args = {}
-    )
     public void testGetPrefix11() throws Throwable {
         Document doc;
         NodeList elementList;
diff --git a/luni/src/test/java/tests/org/w3c/dom/PublicId.java b/luni/src/test/java/tests/org/w3c/dom/PublicId.java
index 32987cf..447a250 100644
--- a/luni/src/test/java/tests/org/w3c/dom/PublicId.java
+++ b/luni/src/test/java/tests/org/w3c/dom/PublicId.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.Document;
 
@@ -43,7 +38,6 @@
 * @author Mary Brady
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-publicId</a>
 */
-@TestTargetClass(DocumentType.class)
 public final class PublicId extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -71,12 +65,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicId",
-        args = {}
-    )
    public void testGetPublicId() throws Throwable {
       Document doc;
       DocumentType docType;
diff --git a/luni/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java
index 540a081..0293578 100644
--- a/luni/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java
@@ -21,8 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargetClass;
-
 import javax.xml.parsers.DocumentBuilder;
 
 import org.w3c.dom.Attr;
@@ -51,7 +49,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElRemAtNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElRemAtNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='NO_MODIFICATION_ALLOWED_ERR'])</a>
  */
-@TestTargetClass(Attr.class)
 public final class RemoveAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
diff --git a/luni/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java
index 1d0ea56..d01d5c1 100644
--- a/luni/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -50,7 +45,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1074577549">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-1074577549</a>
  */
-@TestTargetClass(NamedNodeMap.class)
 public final class RemoveNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -80,12 +74,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Doesn't verify DOMException exception.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS1() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -103,12 +91,6 @@
         newAttr = (Attr) attributes.getNamedItem("dmstc:domestic");
         assertNull("nodeRemoved", newAttr);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies DOMException with NOT_FOUND_ERR code.",
-        method = "removeNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testRemoveNamedItemNS2() throws Throwable {
         String namespaceURI = "http://www.usa.com";
         String localName = "domest";
diff --git a/luni/src/test/java/tests/org/w3c/dom/SetAttributeNS.java b/luni/src/test/java/tests/org/w3c/dom/SetAttributeNS.java
index 56ab3e7..671efbe 100644
--- a/luni/src/test/java/tests/org/w3c/dom/SetAttributeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/SetAttributeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -52,7 +47,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAttrNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INVALID_CHARACTER_ERR'])</a>
  */
-@TestTargetClass(Element.class)
 public final class SetAttributeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -82,12 +76,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with INVALID_CHARACTER_ERR code.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS1() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String qualifiedName = "emp:qual?name";
@@ -109,12 +97,6 @@
             assertTrue("throw_INVALID_CHARACTER_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS2() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String qualifiedName = "emp:";
@@ -176,12 +158,6 @@
 //            assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
 //        }
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "setAttributeNS",
-        args = {String.class, String.class, String.class}
-    )
     public void testSetAttributeNS4() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -210,12 +186,6 @@
         assertEquals("prefix", "newprefix", resultPrefix);
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS5() throws Throwable {
         String localName = "newAttr";
         String namespaceURI = "http://www.newattr.com";
@@ -235,12 +205,6 @@
                 namespaceURI, localName);
         assertEquals("throw_Equals", "<newValue>", resultAttr);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS6() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String qualifiedName = "xml:qualifiedName";
@@ -262,12 +226,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS7() throws Throwable {
         String namespaceURI = "http://www.nist.gov";
         String qualifiedName = "xmlns";
@@ -289,12 +247,6 @@
             assertTrue("throw_NAMESPACE_ERR", success);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS9() throws Throwable {
         String localName = "newAttr";
         String namespaceURI = "http://www.newattr.com";
@@ -325,12 +277,6 @@
         resultPrefix = addrAttr.getPrefix();
         assertEquals("prefix", "emp", resultPrefix);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with NAMESPACE_ERR code.",
-        method = "setAttributeNS",
-        args = {java.lang.String.class, java.lang.String.class, java.lang.String.class}
-    )
     public void testSetAttributeNS10() throws Throwable {
         String namespaceURI = "http://www.example.gov";
         Document doc;
diff --git a/luni/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java b/luni/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java
index 2643ca5..ee218f4 100644
--- a/luni/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.Element;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -55,7 +50,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-ElSetAtNodeNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
  */
-@TestTargetClass(Element.class)
 public final class SetAttributeNodeNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -85,12 +79,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNode1() throws Throwable {
         String namespaceURI = "http://www.newattr.com";
         String qualifiedName = "emp:newAttr";
@@ -157,12 +145,6 @@
 //            assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
 //        }
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNode3() throws Throwable {
         String namespaceURI = "http://www.newattr.com";
         String qualifiedName = "emp:newAttr";
@@ -180,12 +162,6 @@
                 .setAttributeNodeNS(newAttr);
         assertNull("throw_Null", newAddrAttr);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify DOMException.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNode4() throws Throwable {
         Document doc;
         NodeList elementList;
@@ -203,12 +179,6 @@
         newName = newAddrAttr.getNodeName();
         assertEquals("nodeName", "emp:domestic", newName);
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with WRONG_DOCUMENT_ERR code.",
-        method = "setAttributeNodeNS",
-        args = {org.w3c.dom.Attr.class}
-    )
     public void testSetAttributeNode5() throws Throwable {
         String namespaceURI = "http://www.newattr.com";
         String qualifiedName = "emp:newAttr";
diff --git a/luni/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java b/luni/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java
index 140f178..1808885 100644
--- a/luni/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java
+++ b/luni/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java
@@ -22,11 +22,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Document;
 import org.w3c.dom.Node;
@@ -51,7 +46,6 @@
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-setNamedItemNS</a>
 * @see <a href="http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])">http://www.w3.org/TR/DOM-Level-2-Core/core#xpointer(id('ID-setNamedItemNS')/raises/exception[@name='DOMException']/descr/p[substring-before(.,':')='INUSE_ATTRIBUTE_ERR'])</a>
 */
-@TestTargetClass(NamedNodeMap.class)
 public final class SetNamedItemNS extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -79,12 +73,6 @@
     * Runs the test case.
     * @throws Throwable Any uncaught exception causes test to fail
     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with INUSE_ATTRIBUTE_ERR code.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
    public void testSetNamedItemNS1() throws Throwable {
       Document doc;
       NodeList elementList;
@@ -112,12 +100,6 @@
          assertTrue("throw_INUSE_ATTRIBUTE_ERR", success);
       }
 }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies DOMException with WRONG_DOCUMENT_ERR code.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
    public void testSetNamedItemNS2() throws Throwable {
           String namespaceURI = "http://www.usa.com";
           String qualifiedName = "dmstc:domestic";
@@ -146,12 +128,6 @@
              assertTrue("throw_WRONG_DOCUMENT_ERR", success);
           }
     }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive fnctionality.",
-        method = "getNamedItemNS",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
    public void testSetNamedItemNS3() throws Throwable {
           String namespaceURI = "http://www.nist.gov";
           String qualifiedName = "prefix:newAttr";
@@ -217,12 +193,6 @@
 //             assertTrue("throw_NO_MODIFICATION_ALLOWED_ERR", success);
 //          }
 //    }
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive fnctionality.",
-        method = "setNamedItemNS",
-        args = {org.w3c.dom.Node.class}
-    )
    public void testSetNamedItemNS5() throws Throwable {
           String namespaceURI = "http://www.usa.com";
           String qualifiedName = "dmstc:domestic";
diff --git a/luni/src/test/java/tests/org/w3c/dom/SystemId.java b/luni/src/test/java/tests/org/w3c/dom/SystemId.java
index d244f12..641ea0a 100644
--- a/luni/src/test/java/tests/org/w3c/dom/SystemId.java
+++ b/luni/src/test/java/tests/org/w3c/dom/SystemId.java
@@ -21,11 +21,6 @@
 
 package tests.org.w3c.dom;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import org.w3c.dom.DocumentType;
 import org.w3c.dom.Document;
 
@@ -43,7 +38,6 @@
  * @see <a
  *      href="http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId">http://www.w3.org/TR/DOM-Level-2-Core/core#ID-Core-DocType-systemId</a>
  */
-@TestTargetClass(DocumentType.class)
 public final class SystemId extends DOMTestCase {
 
     DOMDocumentBuilderFactory factory;
@@ -73,12 +67,6 @@
      * @throws Throwable
      *             Any uncaught exception causes test to fail
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSystemId",
-        args = {}
-    )
     public void testGetSystemId() throws Throwable {
         Document doc;
         DocumentType docType;
diff --git a/luni/src/test/java/tests/regex/AllTests.java b/luni/src/test/java/tests/regex/AllTests.java
deleted file mode 100644
index 38a2d3a..0000000
--- a/luni/src/test/java/tests/regex/AllTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.regex;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the regex project.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All regex test suites");
-        // $JUnit-BEGIN$
-        suite.addTest(org.apache.harmony.regex.tests.java.util.regex.AllTests.suite());
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/security/AccessControllerTest.java b/luni/src/test/java/tests/security/AccessControllerTest.java
index 5973d30..e031b5e 100644
--- a/luni/src/test/java/tests/security/AccessControllerTest.java
+++ b/luni/src/test/java/tests/security/AccessControllerTest.java
@@ -16,11 +16,6 @@
 
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import java.lang.reflect.Field;
 import java.security.AccessController;
 import java.security.BasicPermission;
@@ -32,7 +27,6 @@
 
 import junit.framework.TestCase;
 
-@TestTargetClass(AccessController.class)
 public class AccessControllerTest extends TestCase {
 
     private static void setProtectionDomain(Class<?> c, ProtectionDomain pd){
@@ -68,16 +62,6 @@
         super.setUp();
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies that checkPermission does not throw a SecurityException " +
-                    "if all classes on the call stack refer to a protection domain " +
-                    "which contains the necessary permissions.",
-            method = "checkPermission",
-            args = {Permission.class}
-        )
-    })
     public void test_do_privileged2() {
         // add TestPermission to T0, T1, T2
         c0.add(p);
diff --git a/luni/src/test/java/tests/security/AllTests.java b/luni/src/test/java/tests/security/AllTests.java
deleted file mode 100644
index 6f348fe..0000000
--- a/luni/src/test/java/tests/security/AllTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.security;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the security project.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All security test suites");
-        // $JUnit-BEGIN$
-        suite.addTest(org.apache.harmony.security.tests.java.security.AllTests.suite());
-        suite.addTest(com.android.org.bouncycastle.jce.provider.AllTests.suite());
-        suite.addTest(tests.api.java.security.AllTests.suite());
-        suite.addTest(tests.java.security.AllTests.suite());
-
-        suite.addTest(tests.security.acl.AllTests.suite());
-        suite.addTest(tests.security.cert.AllTests.suite());
-        suite.addTest(tests.security.interfaces.AllTests.suite());
-        suite.addTest(tests.security.spec.AllTests.suite());
-
-        suite.addTest(tests.api.javax.security.cert.AllTests.suite());
-
-        suite.addTest(tests.targets.security.AllTests.suite());
-        // $JUnit-END$
-
-        // at the very last because of some non-resetting securitymanager
-        suite.addTestSuite(tests.security.AccessControllerTest.class);
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/security/CertPathBuilderTest.java b/luni/src/test/java/tests/security/CertPathBuilderTest.java
index 1c82999..6660390 100644
--- a/luni/src/test/java/tests/security/CertPathBuilderTest.java
+++ b/luni/src/test/java/tests/security/CertPathBuilderTest.java
@@ -15,9 +15,6 @@
  */
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.security.cert.CertPath;
 import java.security.cert.CertPathBuilder;
 import java.security.cert.CertPathBuilderResult;
@@ -42,29 +39,6 @@
     public abstract CertPathParameters getCertPathParameters() throws Exception;
     public abstract void validateCertPath(CertPath path);
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="build",
-                args={CertPathParameters.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                clazz=CertPathBuilderResult.class,
-                method="getCertPath",
-                args={}
-        ),
-        @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     public void testCertPathBuilder() throws Exception {
         CertPathBuilder pathBuilder = CertPathBuilder.getInstance(
                 algorithmName);
diff --git a/luni/src/test/java/tests/security/CertPathValidatorTest.java b/luni/src/test/java/tests/security/CertPathValidatorTest.java
index 2821f47..eb2e196 100644
--- a/luni/src/test/java/tests/security/CertPathValidatorTest.java
+++ b/luni/src/test/java/tests/security/CertPathValidatorTest.java
@@ -15,9 +15,6 @@
  */
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.security.cert.CertPath;
 import java.security.cert.CertPathParameters;
 import java.security.cert.CertPathValidator;
@@ -37,23 +34,6 @@
     public abstract CertPath getCertPath();
     public abstract void validateResult(CertPathValidatorResult validatorResult);
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="validate",
-                args={CertPath.class, CertPathParameters.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     public void testCertPathValidator() throws Exception {
         CertPathValidator certPathValidator = CertPathValidator.getInstance(
                 algorithmName);
diff --git a/luni/src/test/java/tests/security/CertificateFactoryTest.java b/luni/src/test/java/tests/security/CertificateFactoryTest.java
index 1bfa2aa..ca267a9 100644
--- a/luni/src/test/java/tests/security/CertificateFactoryTest.java
+++ b/luni/src/test/java/tests/security/CertificateFactoryTest.java
@@ -15,9 +15,6 @@
  */
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
 import java.security.cert.Certificate;
@@ -39,23 +36,6 @@
         super.setUp();
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="generateCertificate",
-                args={InputStream.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     public void testCertificateFactory() throws Exception {
         CertificateFactory certificateFactory = CertificateFactory.getInstance(
                 algorithmName);
diff --git a/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java b/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java
index c4fac46..d3b7735 100644
--- a/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java
+++ b/luni/src/test/java/tests/security/acl/AclNotFoundException2Test.java
@@ -17,27 +17,15 @@
 
 package tests.security.acl;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.acl.AclNotFoundException;
 
-@TestTargetClass(AclNotFoundException.class)
 public class AclNotFoundException2Test extends TestCase {
 
     /**
-     * @tests java.security.acl.AclNotFoundException#AclNotFoundException()
+     * java.security.acl.AclNotFoundException#AclNotFoundException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AclNotFoundException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.security.acl.AclNotFoundException()
         try {
diff --git a/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java b/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java
index 8dc6753..a4c389e 100644
--- a/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java
+++ b/luni/src/test/java/tests/security/acl/AclNotFoundExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.acl;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.acl.AclNotFoundException;
@@ -35,17 +30,10 @@
  * Unit test for AclNotFoundException.
  *
  */
-@TestTargetClass(AclNotFoundException.class)
 public class AclNotFoundExceptionTest extends TestCase {
     /**
      * check default constructor
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "AclNotFoundException",
-        args = {}
-    )
     public void testAclNotFoundException() {
         assertNotNull(new AclNotFoundException());
         assertNull(new AclNotFoundException().getMessage());
diff --git a/luni/src/test/java/tests/security/acl/AllTests.java b/luni/src/test/java/tests/security/acl/AllTests.java
deleted file mode 100644
index caf9675..0000000
--- a/luni/src/test/java/tests/security/acl/AllTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.security.acl;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.java.security.acl;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.api.java.security.acl;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(AclNotFoundException2Test.class);
-        suite.addTestSuite(AclNotFoundExceptionTest.class);
-        suite.addTestSuite(LastOwnerException2Test.class);
-        suite.addTestSuite(LastOwnerExceptionTest.class);
-        suite.addTestSuite(NotOwnerException2Test.class);
-        suite.addTestSuite(NotOwnerExceptionTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java b/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java
index e11e633..8b7d9a1 100644
--- a/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java
+++ b/luni/src/test/java/tests/security/acl/LastOwnerException2Test.java
@@ -17,27 +17,15 @@
 
 package tests.security.acl;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.acl.LastOwnerException;
 
-@TestTargetClass(LastOwnerException.class)
 public class LastOwnerException2Test extends TestCase {
 
     /**
-     * @tests java.security.acl.LastOwnerException#LastOwnerException()
+     * java.security.acl.LastOwnerException#LastOwnerException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "LastOwnerException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.security.acl.LastOwnerException()
         try {
diff --git a/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java b/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java
index 7ca2aad..5632ec7 100644
--- a/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java
+++ b/luni/src/test/java/tests/security/acl/NotOwnerException2Test.java
@@ -17,27 +17,15 @@
 
 package tests.security.acl;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.acl.NotOwnerException;
 
-@TestTargetClass(NotOwnerException.class)
 public class NotOwnerException2Test extends TestCase {
 
     /**
-     * @tests java.security.acl.NotOwnerException#NotOwnerException()
+     * java.security.acl.NotOwnerException#NotOwnerException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "NotOwnerException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.security.acl.NotOwnerException()
         try {
diff --git a/luni/src/test/java/tests/security/cert/AllTests.java b/luni/src/test/java/tests/security/cert/AllTests.java
deleted file mode 100644
index 5c0af64..0000000
--- a/luni/src/test/java/tests/security/cert/AllTests.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.security.cert;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.api.java.security.cert;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.api.java.security.cert;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(CRLExceptionTest.class);
-        suite.addTestSuite(CRLTest.class);
-        suite.addTestSuite(CertPathBuilder1Test.class);
-        suite.addTestSuite(CertPathBuilder2Test.class);
-        suite.addTestSuite(CertPathBuilderExceptionTest.class);
-        suite.addTestSuite(CertPathBuilderSpiTest.class);
-        suite.addTestSuite(CertPathCertPathRepTest.class);
-        suite.addTestSuite(CertPathTest.class);
-        suite.addTestSuite(CertPathValidator1Test.class);
-        suite.addTestSuite(CertPathValidator2Test.class);
-        suite.addTestSuite(CertPathValidator3Test.class);
-        suite.addTestSuite(CertPathValidatorExceptionTest.class);
-        suite.addTestSuite(CertPathValidatorSpiTest.class);
-        suite.addTestSuite(CertStore1Test.class);
-        suite.addTestSuite(CertStoreExceptionTest.class);
-        suite.addTestSuite(CertStoreSpiTest.class);
-        suite.addTestSuite(CertificateCertificateRepTest.class);
-        suite.addTestSuite(CertificateEncodingException2Test.class);
-        suite.addTestSuite(CertificateEncodingExceptionTest.class);
-        suite.addTestSuite(CertificateException2Test.class);
-        suite.addTestSuite(CertificateExceptionTest.class);
-        suite.addTestSuite(CertificateExpiredExceptionTest.class);
-        suite.addTestSuite(CertificateFactory1Test.class);
-        suite.addTestSuite(CertificateFactory2Test.class);
-        suite.addTestSuite(CertificateFactory3Test.class);
-        suite.addTestSuite(CertificateFactory4Test.class);
-        suite.addTestSuite(CertificateFactorySpiTest.class);
-        suite.addTestSuite(CertificateNotYetValidExceptionTest.class);
-        suite.addTestSuite(CertificateParsingExceptionTest.class);
-        suite.addTestSuite(CertificateTest.class);
-        suite.addTestSuite(CollectionCertStoreParametersTest.class);
-        suite.addTestSuite(LDAPCertStoreParametersTest.class);
-        suite.addTestSuite(PKIXBuilderParametersTest.class);
-        suite.addTestSuite(PKIXCertPathBuilderResultTest.class);
-        suite.addTestSuite(PKIXCertPathCheckerTest.class);
-        suite.addTestSuite(PKIXCertPathValidatorResultTest.class);
-        suite.addTestSuite(PolicyQualifierInfoTest.class);
-        suite.addTestSuite(TrustAnchorTest.class);
-        suite.addTestSuite(X509CRL2Test.class);
-        suite.addTestSuite(X509CRLEntryTest.class);
-        suite.addTestSuite(X509CRLSelector2Test.class);
-        suite.addTestSuite(X509CRLSelectorTest.class);
-        suite.addTestSuite(X509CRLTest.class);
-        // Crashes on RI.
-        // suite.addTestSuite(X509CertSelectorTest.class);
-        suite.addTestSuite(X509Certificate2Test.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/security/cert/CRLExceptionTest.java b/luni/src/test/java/tests/security/cert/CRLExceptionTest.java
index 1de4982..c542a2a 100644
--- a/luni/src/test/java/tests/security/cert/CRLExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CRLExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CRLException;
@@ -35,7 +30,6 @@
  * Tests for <code>CRLException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CRLException.class)
 public class CRLExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -49,12 +43,6 @@
      * Test for <code>CRLException()</code> constructor Assertion: constructs
      * CRLException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CRLException",
-        args = {}
-    )
     public void testCRLException01() {
         CRLException tE = new CRLException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +54,6 @@
      * constructs CRLException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CRLException",
-        args = {java.lang.String.class}
-    )
     public void testCRLException02() {
         CRLException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -86,12 +68,6 @@
      * Test for <code>CRLException(String)</code> constructor Assertion:
      * constructs CRLException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CRLException",
-        args = {java.lang.String.class}
-    )
     public void testCRLException03() {
         String msg = null;
         CRLException tE = new CRLException(msg);
@@ -103,12 +79,6 @@
      * Test for <code>CRLException(Throwable)</code> constructor Assertion:
      * constructs CRLException when <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CRLException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCRLException04() {
         Throwable cause = null;
         CRLException tE = new CRLException(cause);
@@ -120,12 +90,6 @@
      * Test for <code>CRLException(Throwable)</code> constructor Assertion:
      * constructs CRLException when <code>cause</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CRLException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCRLException05() {
         CRLException tE = new CRLException(tCause);
         if (tE.getMessage() != null) {
@@ -144,12 +108,6 @@
      * Assertion: constructs CRLException when <code>cause</code> is null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CRLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCRLException06() {
         CRLException tE = new CRLException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -161,12 +119,6 @@
      * Assertion: constructs CRLException when <code>cause</code> is null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the second parameter.",
-        method = "CRLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCRLException07() {
         CRLException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -182,12 +134,6 @@
      * Assertion: constructs CRLException when <code>cause</code> is not null
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the first parameter.",
-        method = "CRLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCRLException08() {
         CRLException tE = new CRLException(null, tCause);
         if (tE.getMessage() != null) {
@@ -206,12 +152,6 @@
      * Assertion: constructs CRLException when <code>cause</code> is not null
      * <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CRLException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCRLException09() {
         CRLException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/tests/security/cert/CRLTest.java b/luni/src/test/java/tests/security/cert/CRLTest.java
index 1d09239..be8ddcd 100644
--- a/luni/src/test/java/tests/security/cert/CRLTest.java
+++ b/luni/src/test/java/tests/security/cert/CRLTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CRL;
@@ -38,7 +33,6 @@
  * Tests for <code>java.security.cert.CRL</code> fields and methods
  *
  */
-@TestTargetClass(CRL.class)
 public class CRLTest extends TestCase {
 
     public static final String[] validValues = { "X.509", "x.509" };
@@ -52,12 +46,6 @@
     /**
      * Test for <code>CRL(String type)</code> constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CRL",
-        args = {java.lang.String.class}
-    )
     public final void testConstructor() {
         for (int i = 0; i< validValues.length; i++) {
             CRL crl = new MyCRL(validValues[i]);
@@ -81,12 +69,6 @@
      * Test #1 for <code>getType()</code> method<br>
      * Assertion: returns <code>CRL</code> type
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getType",
-        args = {}
-    )
     public final void testGetType01() {
         CRL crl = new MyCRL("TEST_TYPE");
         assertEquals("TEST_TYPE", crl.getType());
@@ -96,12 +78,6 @@
      * Test #2 for <code>getType()</code> method<br>
      * Assertion: returns <code>CRL</code> type
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "getType",
-        args = {}
-    )
     public final void testGetType02() {
         CRL crl = new MyCRL(null);
         assertNull(crl.getType());
@@ -116,12 +92,6 @@
     /**
      * Test for <code>toString()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() {
         CRL crl = new MyCRL("TEST_TYPE");
         crl.toString();
@@ -130,12 +100,6 @@
     /**
      * Test for <code>isRevoked()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isRevoked",
-        args = {java.security.cert.Certificate.class}
-    )
     public final void testIsRevoked() {
         CRL crl = new MyCRL("TEST_TYPE");
         crl.isRevoked(null);
diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java b/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java
index 6d6d527..aae021b 100644
--- a/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java
+++ b/luni/src/test/java/tests/security/cert/CertPathBuilder1Test.java
@@ -23,9 +23,6 @@
 package tests.security.cert;
 
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
 
 import org.apache.harmony.security.tests.support.SpiEngUtils;
 import org.apache.harmony.security.tests.support.cert.MyCertPathBuilderSpi;
@@ -51,7 +48,6 @@
  * methods.
  *
  */
-@TestTargetClass(CertPathBuilder.class)
 public class CertPathBuilder1Test extends TestCase {
 
     public static final String srvCertPathBuilder = "CertPathBuilder";
@@ -97,14 +93,8 @@
     }
 
     /**
-     * @tests java.security.cert.CertPathBuilder#getDefaultType()
+     * java.security.cert.CertPathBuilder#getDefaultType()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultType",
-        args = {}
-    )
     public void test_getDefaultType() throws Exception {
 
         // Regression for HARMONY-2785
@@ -121,12 +111,6 @@
      * throws NoSuchAlgorithmException when algorithm  is not correct
      * or it is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies NoSuchAlgorithmException.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testCertPathBuilder02() throws NoSuchAlgorithmException {
         try {
             CertPathBuilder.getInstance(null);
@@ -146,12 +130,6 @@
      * Test for <code>getInstance(String algorithm)</code> method
      * Assertion: returns CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies positive functionality.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testCertPathBuilder03() throws NoSuchAlgorithmException  {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
@@ -168,12 +146,6 @@
      *
      * FIXME: verify what exception will be thrown if provider is empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathBuilder04()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -200,12 +172,6 @@
      * Assertion:
      * throws NoSuchProviderException when provider has invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance throws NoSuchProviderException when provider has invalid value.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathBuilder05()
             throws NoSuchAlgorithmException  {
         if (!PKIXSupport) {
@@ -228,12 +194,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm  is not correct
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException when algorithm is null; verifies NoSuchAlgorithmException when algorithm  is not correct.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathBuilder06()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -258,12 +218,6 @@
      * Test for <code>getInstance(String algorithm, String provider)</code> method
      * Assertion: returns CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathBuilder07()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -282,12 +236,6 @@
      * Test for <code>getInstance(String algorithm, Provider provider)</code> method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getInstance method throws IllegalArgumentException when provider is null method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testCertPathBuilder08()
             throws NoSuchAlgorithmException  {
         if (!PKIXSupport) {
@@ -310,12 +258,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm  is not correct
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getInstance method throws NullPointerException when algorithm is null, throws NoSuchAlgorithmException when algorithm  is not correct.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testCertPathBuilder09()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -339,12 +281,6 @@
      * Test for <code>getInstance(String algorithm, String provider)</code> method
      * Assertion: returns CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance returns CertPathBuilder object.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathBuilder10()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -362,12 +298,6 @@
      * Test for <code>build(CertPathParameters params)</code> method
      * Assertion: throws InvalidAlgorithmParameterException params is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that build method throws InvalidAlgorithmParameterException if a parameter is null.",
-        method = "build",
-        args = {java.security.cert.CertPathParameters.class}
-    )
     public void testCertPathBuilder11()
             throws NoSuchAlgorithmException, NoSuchProviderException,
             CertPathBuilderException {
@@ -386,12 +316,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies normal case",
-            method="build",
-            args={CertPathParameters.class}
-    )
     // Test passed on RI
     @KnownFailure(value="expired certificate bug 2322662")
     public void testBuild() throws Exception {
@@ -414,12 +338,6 @@
      * <code>CertPathBuilder</code> constructor
      * Assertion: returns CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertPathBuilder",
-        args = {java.security.cert.CertPathBuilderSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testCertPathBuilder12()
             throws CertificateException, NoSuchProviderException,
             NoSuchAlgorithmException, InvalidAlgorithmParameterException,
@@ -452,12 +370,6 @@
      * Test for <code>getAlgorithm()</code> method Assertion: returns
      * CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void testCertPathBuilder13() throws NoSuchAlgorithmException {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
@@ -493,12 +405,6 @@
      * Test for <code>getProvider()</code> method Assertion: returns
      * CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void testCertPathBuilder14() throws NoSuchAlgorithmException {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java b/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java
index ed1dcbb..ffc5d08 100644
--- a/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java
+++ b/luni/src/test/java/tests/security/cert/CertPathBuilder2Test.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import tests.security.cert.myCertPathBuilder.MyProvider;
@@ -45,7 +40,6 @@
  * Tests for CertPathBuilder class constructors and methods
  *
  */
-@TestTargetClass(CertPathBuilder.class)
 public class CertPathBuilder2Test extends TestCase {
     private static final String defaultAlg = "CertPB";
     private static final String CertPathBuilderProviderClass = "org.apache.harmony.security.tests.support.cert.MyCertPathBuilderSpi";
@@ -115,12 +109,6 @@
      * throws NoSuchAlgorithmException when algorithm  is not correct
      * returns CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance01() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException, CertPathBuilderException {
         try {
@@ -155,12 +143,6 @@
      * throws NoSuchProviderException when provider is available;
      * returns CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testGetInstance02() throws NoSuchAlgorithmException,
             NoSuchProviderException, IllegalArgumentException,
             InvalidAlgorithmParameterException, CertPathBuilderException {
@@ -225,12 +207,6 @@
      * throws NoSuchAlgorithmException when algorithm  is not correct
      * returns CertPathBuilder object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance03() throws NoSuchAlgorithmException,
             IllegalArgumentException,
             InvalidAlgorithmParameterException, CertPathBuilderException {
diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java b/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java
index 00b0362..f1694de 100644
--- a/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertPathBuilderExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertPathBuilderException;
@@ -37,7 +32,6 @@
  * methods.
  *
  */
-@TestTargetClass(CertPathBuilderException.class)
 public class CertPathBuilderExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -51,12 +45,6 @@
      * Test for <code>CertPathBuilderException()</code> constructor Assertion:
      * constructs CertPathBuilderException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertPathBuilderException",
-        args = {}
-    )
     public void testCertPathBuilderException01() {
         CertPathBuilderException tE = new CertPathBuilderException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * Assertion: constructs CertPathBuilderException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertPathBuilderException",
-        args = {java.lang.String.class}
-    )
     public void testCertPathBuilderException02() {
         CertPathBuilderException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * Assertion: constructs CertPathBuilderException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertPathBuilderException",
-        args = {java.lang.String.class}
-    )
     public void testCertPathBuilderException03() {
         String msg = null;
         CertPathBuilderException tE = new CertPathBuilderException(msg);
@@ -107,12 +83,6 @@
      * Assertion: constructs CertPathBuilderException when <code>cause</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertPathBuilderException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertPathBuilderException04() {
         Throwable cause = null;
         CertPathBuilderException tE = new CertPathBuilderException(cause);
@@ -125,12 +95,6 @@
      * Assertion: constructs CertPathBuilderException when <code>cause</code>
      * is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertPathBuilderException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertPathBuilderException05() {
         CertPathBuilderException tE = new CertPathBuilderException(tCause);
         if (tE.getMessage() != null) {
@@ -149,12 +113,6 @@
      * constructor Assertion: constructs CertPathBuilderException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CertPathBuilderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathBuilderException06() {
         CertPathBuilderException tE = new CertPathBuilderException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -166,12 +124,6 @@
      * constructor Assertion: constructs CertPathBuilderException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the second parameter.",
-        method = "CertPathBuilderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathBuilderException07() {
         CertPathBuilderException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -187,12 +139,6 @@
      * constructor Assertion: constructs CertPathBuilderException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the first parameter.",
-        method = "CertPathBuilderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathBuilderException08() {
         CertPathBuilderException tE = new CertPathBuilderException(null, tCause);
         if (tE.getMessage() != null) {
@@ -211,12 +157,6 @@
      * constructor Assertion: constructs CertPathBuilderException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "CertPathBuilderException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathBuilderException09() {
         CertPathBuilderException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java b/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java
index dc173dc..b5615cc 100644
--- a/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java
+++ b/luni/src/test/java/tests/security/cert/CertPathBuilderSpiTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.InvalidAlgorithmParameterException;
@@ -41,27 +36,12 @@
  * Tests for <code>CertPathBuilderSpi</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertPathBuilderSpi.class)
 public class CertPathBuilderSpiTest extends TestCase {
 
     /**
      * Test for <code>CertPathBuilderSpi</code> constructor Assertion:
      * constructs CertPathBuilderSpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "CertPathBuilderSpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineBuild",
-            args = {java.security.cert.CertPathParameters.class}
-        )
-    })
     public void testCertPathBuilderSpi01() throws CertPathBuilderException,
             InvalidAlgorithmParameterException {
         CertPathBuilderSpi certPathBuilder = new MyCertPathBuilderSpi();
diff --git a/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java b/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java
index 6f3f2bd..4dac8c3 100644
--- a/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java
+++ b/luni/src/test/java/tests/security/cert/CertPathCertPathRepTest.java
@@ -1,9 +1,5 @@
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.cert.MyCertPath;
@@ -12,7 +8,6 @@
 import java.io.ObjectStreamException;
 import java.security.cert.CertPath;
 
-@TestTargetClass(CertPath.class)
 public class CertPathCertPathRepTest extends TestCase {
 
     private static final byte[] testEncoding = new byte[] { (byte) 1, (byte) 2,
@@ -30,12 +25,6 @@
      * Test for <code>CertPath.CertPathRep(String type, byte[] data)</code>
      * method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertPath.CertPathRep.CertPathRep",
-        args = { String.class, byte[].class}
-    )
     public final void testCertPathCertPathRep() {
         MyCertPath cp = new MyCertPath(testEncoding);
         MyCertPathRep rep = cp.new MyCertPathRep("MyEncoding", testEncoding);
@@ -50,12 +39,6 @@
 
     }
 
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Checks ObjectStreamException",
-        method = "CertPath.CertPathRep.readResolve",
-        args = {}
-    )
     public final void testReadResolve() {
         MyCertPath cp = new MyCertPath(testEncoding);
         MyCertPathRep rep = cp.new MyCertPathRep("MyEncoding", testEncoding);
diff --git a/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java b/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java
index f4bbea8..f3554d6 100644
--- a/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java
+++ b/luni/src/test/java/tests/security/cert/CertPathValidator1Test.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.InvalidAlgorithmParameterException;
@@ -49,7 +44,6 @@
  * methods.
  *
  */
-@TestTargetClass(CertPathValidator.class)
 public class CertPathValidator1Test extends TestCase {
 
     public static final String srvCertPathValidator = "CertPathValidator";
@@ -100,12 +94,6 @@
      * Test for <code>getDefaultType()</code> method
      * Assertion: returns security property "certpathvalidator.type" or "PKIX"
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultType",
-        args = {}
-    )
     public void testCertPathValidator01() {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
@@ -138,12 +126,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm  is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NoSuchAlgorithmException.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testCertPathValidator02() {
         try {
             CertPathValidator.getInstance(null);
@@ -163,12 +145,6 @@
      * Test for <code>getInstance(String algorithm)</code> method
      * Assertion: returns CertPathValidator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testCertPathValidator03() throws NoSuchAlgorithmException  {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
@@ -186,12 +162,6 @@
      *
      * FIXME: verify what exception will be thrown if provider is empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance method throws IllegalArgumentException when provider parameter is null or empty.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathValidator04()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -217,12 +187,6 @@
      * Assertion:
      * throws NoSuchProviderException when provider has invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance method throws NoSuchProviderException when provider parameter has invalid value.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathValidator05() throws NoSuchAlgorithmException {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
@@ -246,12 +210,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm  is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance method throws NullPointerException when algorithm is null, and NoSuchAlgorithmException when algorithm  is not available",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathValidator06()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -276,12 +234,6 @@
      * Test for <code>getInstance(String algorithm, String provider)</code> method
      * Assertion: returns CertPathValidator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance mwthod returns CertPathValidator object.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathValidator07() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!PKIXSupport) {
@@ -303,12 +255,6 @@
      * Test for <code>getInstance(String algorithm, Provider provider)</code> method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getInstance method throws IllegalArgumentException when provider parameter is null.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testCertPathValidator08()
             throws NoSuchAlgorithmException  {
         if (!PKIXSupport) {
@@ -331,12 +277,6 @@
      * throws NullPointerException when algorithm is null
      * throws NoSuchAlgorithmException when algorithm  is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance method throws NullPointerException when algorithm is null, and  NoSuchAlgorithmException when algorithm  is not available.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathValidator09()
             throws NoSuchAlgorithmException, NoSuchProviderException  {
         if (!PKIXSupport) {
@@ -361,12 +301,6 @@
      * Test for <code>getInstance(String algorithm, String provider)</code> method
      * Assertion: returns CertPathValidator object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getInstance method returns CertPathValidator object.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertPathValidator10() throws NoSuchAlgorithmException,
             NoSuchProviderException {
         if (!PKIXSupport) {
@@ -389,12 +323,6 @@
      * Assertion: throws InvalidAlgorithmParameterException params is not
      * instance of PKIXParameters or null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that validate method throws InvalidAlgorithmParameterException if param is not instance of PKIXParameters or null.",
-        method = "validate",
-        args = {java.security.cert.CertPath.class, java.security.cert.CertPathParameters.class}
-    )
     public void testCertPathValidator11()
             throws NoSuchAlgorithmException, NoSuchProviderException, CertPathValidatorException {
         if (!PKIXSupport) {
@@ -424,12 +352,6 @@
      * <code>CertPathValidator</code> constructor
      * Assertion: returns CertPathValidator object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertPathValidator",
-        args = {java.security.cert.CertPathValidatorSpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testCertPathValidator12()
             throws CertificateException, NoSuchProviderException, NoSuchAlgorithmException,
             CertPathValidatorException, InvalidAlgorithmParameterException {
@@ -461,12 +383,6 @@
     /**
      * Test for <code>getAlgorithm()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAlgorithm",
-        args = {}
-    )
     public void testCertPathValidator13() throws NoSuchAlgorithmException {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
@@ -496,12 +412,6 @@
     /**
      * Test for <code>getProvider()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void testCertPathValidator14() throws NoSuchAlgorithmException {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
diff --git a/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java b/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java
index 3f513cc..8f5b6d5 100644
--- a/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java
+++ b/luni/src/test/java/tests/security/cert/CertPathValidator2Test.java
@@ -22,10 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.SpiEngUtils;
@@ -46,7 +42,6 @@
 /**
  * Tests for CertPathValidator class constructors and methods
  */
-@TestTargetClass(CertPathValidator.class)
 public class CertPathValidator2Test extends TestCase {
     private static final String defaultAlg = "CertPB";
 
@@ -110,9 +105,6 @@
      * NoSuchAlgorithmException when algorithm is not available returns
      * CertPathValidator object
      */
-    @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "getInstance", args = {
-        java.lang.String.class
-    })
     public void testGetInstance01() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException, CertPathValidatorException {
         try {
@@ -146,9 +138,6 @@
      * NoSuchProviderException when provider is available; returns
      * CertPathValidator object
      */
-    @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "getInstance", args = {
-            java.lang.String.class, java.lang.String.class
-    })
     public void testGetInstance02() throws NoSuchAlgorithmException, NoSuchProviderException,
             IllegalArgumentException, InvalidAlgorithmParameterException,
             CertPathValidatorException {
@@ -207,9 +196,6 @@
      * IllegalArgumentException when provider is null; returns CertPathValidator
      * object
      */
-    @TestTargetNew(level = TestLevel.COMPLETE, notes = "", method = "getInstance", args = {
-            java.lang.String.class, java.security.Provider.class
-    })
     public void testGetInstance03() throws NoSuchAlgorithmException, IllegalArgumentException,
             InvalidAlgorithmParameterException, CertPathValidatorException {
         try {
@@ -244,9 +230,6 @@
         }
     }
 
-    @TestTargetNew(level = TestLevel.PARTIAL_COMPLETE, method = "validate", args = {
-            CertPath.class, CertPathParameters.class
-    })
     public void testValidate() throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
         MyCertPath mCP = new MyCertPath(new byte[0]);
         CertPathParameters params = new PKIXParameters(TestUtils.getTrustAnchorSet());
diff --git a/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java b/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java
index a4986a5..78410cc 100644
--- a/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java
+++ b/luni/src/test/java/tests/security/cert/CertPathValidator3Test.java
@@ -23,10 +23,6 @@
 package tests.security.cert;
 
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.SpiEngUtils;
@@ -47,7 +43,6 @@
  * Tests for <code>CertPathValidator</code> class  methods.
  *
  */
-@TestTargetClass(CertPathValidator.class)
 public class CertPathValidator3Test extends TestCase {
 
     private static final String defaultType = CertPathBuilder1Test.defaultType;
@@ -91,12 +86,6 @@
      * certpath is not X.509 type
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies exceptions.",
-        method = "validate",
-        args = {java.security.cert.CertPath.class, java.security.cert.CertPathParameters.class}
-    )
     public void testValidate01() throws InvalidAlgorithmParameterException, CertPathValidatorException  {
         if (!PKIXSupport) {
             fail(NotSupportMsg);
diff --git a/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java b/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java
index 62e486e..1eac1f7 100644
--- a/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertPathValidatorExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertPath;
@@ -43,7 +38,6 @@
  * methods.
  *
  */
-@TestTargetClass(CertPathValidatorException.class)
 public class CertPathValidatorExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -57,12 +51,6 @@
      * Test for <code>CertPathValidatorException()</code> constructor
      * Assertion: constructs CertPathValidatorException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertPathValidatorException",
-        args = {}
-    )
     public void testCertPathValidatorException01() {
         CertPathValidatorException tE = new CertPathValidatorException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -74,12 +62,6 @@
      * Assertion: constructs CertPathValidatorException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class}
-    )
     public void testCertPathValidatorException02() {
         CertPathValidatorException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -95,12 +77,6 @@
      * Assertion: constructs CertPathValidatorException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class}
-    )
     public void testCertPathValidatorException03() {
         String msg = null;
         CertPathValidatorException tE = new CertPathValidatorException(msg);
@@ -113,12 +89,6 @@
      * Assertion: constructs CertPathValidatorException when <code>cause</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertPathValidatorException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertPathValidatorException04() {
         Throwable cause = null;
         CertPathValidatorException tE = new CertPathValidatorException(cause);
@@ -131,12 +101,6 @@
      * Assertion: constructs CertPathValidatorException when <code>cause</code>
      * is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertPathValidatorException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertPathValidatorException05() {
         CertPathValidatorException tE = new CertPathValidatorException(tCause);
         if (tE.getMessage() != null) {
@@ -155,12 +119,6 @@
      * constructor Assertion: constructs CertPathValidatorException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathValidatorException06() {
         CertPathValidatorException tE = new CertPathValidatorException(null,
                 null);
@@ -173,12 +131,6 @@
      * constructor Assertion: constructs CertPathValidatorException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the second parameter.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathValidatorException07() {
         CertPathValidatorException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -194,12 +146,6 @@
      * constructor Assertion: constructs CertPathValidatorException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the first parameter.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathValidatorException08() {
         CertPathValidatorException tE = new CertPathValidatorException(null,
                 tCause);
@@ -219,12 +165,6 @@
      * constructor Assertion: constructs CertPathValidatorException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertPathValidatorException09() {
         CertPathValidatorException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -252,12 +192,6 @@
      * <code>cause</code> is null <code>msg</code> is null
      * <code>certPath</code> is null <code>index</code> is -1
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class}
-    )
     public void testCertPathValidatorException10() {
         CertPathValidatorException tE = new CertPathValidatorException(null,
                 null, null, -1);
@@ -275,12 +209,6 @@
      * <code>certPath</code> is null <code>index</code> not -1 throws:
      * IllegalArgumentException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that IllegalArgumentException is thrown.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class}
-    )
     public void testCertPathValidatorException11() {
         int[] indx = { 0, 1, 100, Integer.MAX_VALUE, Integer.MIN_VALUE };
         for (int j = 0; j < indx.length; j++) {
@@ -304,12 +232,6 @@
      * <code>cause</code> not null <code>msg</code> not null
      * <code>certPath</code> is null <code>index</code> is -1
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class}
-    )
     public void testCertPathValidatorException12() {
         CertPathValidatorException tE;
 
@@ -347,12 +269,6 @@
      * <code>certPath</code> not null <code>index</code>< -1 || >=
      * certPath.getCertificates().size() throws: IndexOutOfBoundsException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class}
-    )
     public void testCertPathValidatorException13() {
         myCertPath mcp = new myCertPath("X.509", "");
         CertPath cp = mcp.get("X.509");
@@ -380,12 +296,6 @@
      * <code>certPath</code> not null <code>index</code><
      * certPath.getCertificates().size()
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IndexOutOfBoundsException.",
-        method = "CertPathValidatorException",
-        args = {java.lang.String.class, java.lang.Throwable.class, java.security.cert.CertPath.class, int.class}
-    )
     public void testCertPathValidatorException14() {
         CertPathValidatorException tE;
         myCertPath mcp = new myCertPath("X.509", "");
@@ -424,12 +334,6 @@
      * Test for <code>getCertPath()</code>. Returns the certification path
      * that was being validated when the exception was thrown.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies that getCertPath method returns the certification paththat was being validated when the exception was thrown.",
-        method = "getCertPath",
-        args = {}
-    )
     public void testCertPathValidatorException15() {
         CertPathValidatorException tE = new CertPathValidatorException();
         assertNull("getCertPath() must return null.", tE.getCertPath());
@@ -486,12 +390,6 @@
      * that the list of certificates in a CertPath is zero based. If no index
      * has been set, -1 is returned.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIndex",
-        args = {}
-    )
     public void testCertPathValidatorException16() {
         CertPathValidatorException tE = new CertPathValidatorException();
         assertEquals("getIndex() must be equals -1", -1, tE.getIndex());
diff --git a/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java b/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java
index 8db597b..f69a3e5 100644
--- a/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java
+++ b/luni/src/test/java/tests/security/cert/CertPathValidatorSpiTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.InvalidAlgorithmParameterException;
@@ -41,27 +36,12 @@
  * Tests for <code>CertPathValidatorSpi</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertPathValidatorSpi.class)
 public class CertPathValidatorSpiTest extends TestCase {
 
     /**
      * Test for <code>CertPathValidatorSpi</code> constructor Assertion:
      * constructs CertPathValidatorSpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "CertPathValidatorSpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineValidate",
-            args = {java.security.cert.CertPath.class, java.security.cert.CertPathParameters.class}
-        )
-    })
     public void testCertPathValidatorSpi01() throws CertPathValidatorException,
             InvalidAlgorithmParameterException {
         CertPathValidatorSpi certPathValid = new MyCertPathValidatorSpi();
diff --git a/luni/src/test/java/tests/security/cert/CertStore1Test.java b/luni/src/test/java/tests/security/cert/CertStore1Test.java
index 6da8175..1c290e4 100644
--- a/luni/src/test/java/tests/security/cert/CertStore1Test.java
+++ b/luni/src/test/java/tests/security/cert/CertStore1Test.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.SpiEngUtils;
@@ -51,7 +46,6 @@
  * methods.
  *
  */
-@TestTargetClass(CertStore.class)
 public class CertStore1Test extends TestCase {
 
     public static final String srvCertStore = "CertStore";
@@ -133,12 +127,6 @@
      * Test for <code>getDefaultType()</code> method
      * Assertion: returns security property "certstore.type" or "LDAP"
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDefaultType",
-        args = {}
-    )
     public void testCertStore01() {
         if (!LDAPSupport) {
             return;
@@ -163,12 +151,6 @@
      * <code>CertStore</code> constructor
      * Assertion: returns CertStore object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertStore",
-        args = {java.security.cert.CertStoreSpi.class, java.security.Provider.class, java.lang.String.class, java.security.cert.CertStoreParameters.class}
-    )
     public void testCertStore02() throws InvalidAlgorithmParameterException, CertStoreException {
         if (!initParams()) {
             return;
@@ -202,12 +184,6 @@
      * throws NullPointerException when type is null
      * throws NoSuchAlgorithmException when type is incorrect;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies NoSuchAlgorithmException and NullPointerException. InvalidAlgorithmParameterException checking missed",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class}
-    )
     public void testCertStore03() throws InvalidAlgorithmParameterException {
         if (!initParams()) {
             return;
@@ -231,12 +207,6 @@
      * Test for <code>getInstance(String type, CertStoreParameters params)</code> method
      * Assertion: return CertStore object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "InvalidAlgorithmParameterException checking missed",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class}
-    )
     public void testCertStore05()
             throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
         if (!initParams()) {
@@ -255,12 +225,6 @@
      * Assertion: throws IllegalArgumentException when provider is null or empty
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies IllegalArgumentException. InvalidAlgorithmParameterException checking missed.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class}
-    )
     public void testCertStore06()
             throws InvalidAlgorithmParameterException, NoSuchAlgorithmException,
                 NoSuchProviderException {
@@ -286,12 +250,6 @@
      * <code>getInstance(String type, CertStoreParameters params, String provider)</code>
      * Assertion: throws NoSuchProviderException when provider has invalid value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies NoSuchProviderException. InvalidAlgorithmParameterException checking missed.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class}
-    )
     public void testCertStore07()
             throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
         if (!initParams()) {
@@ -314,12 +272,6 @@
      * throws NullPointerException when type is null
      * throws NoSuchAlgorithmException when type is incorrect;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies NoSuchAlgorithmException and NullPointerException. InvalidAlgorithmParameterException checking missed.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class}
-    )
     public void testCertStore08() throws InvalidAlgorithmParameterException,
             NoSuchProviderException {
         if (!initParams()) {
@@ -345,12 +297,6 @@
      * <code>getInstance(String type, CertStoreParameters params, String provider)</code>
      * Assertion: return CertStore object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies positive case. InvalidAlgorithmParameterException checking missed.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.lang.String.class}
-    )
     public void testCertStore10()
             throws InvalidAlgorithmParameterException, NoSuchAlgorithmException, NoSuchProviderException {
         if (!initParams()) {
@@ -369,12 +315,6 @@
      * <code>getInstance(String type, CertStoreParameters params, Provider provider)</code>
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that getInstance throws IllegalArgumentException when provider is null. InvalidAlgorithmParameterException checking missed.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.security.Provider.class}
-    )
     public void testCertStore11() throws InvalidAlgorithmParameterException,
             NoSuchAlgorithmException {
         if (!initParams()) {
@@ -395,12 +335,6 @@
      * throws NullPointerException when type is null
      * throws NoSuchAlgorithmException when type is incorrect;
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies NullPointerException and NoSuchAlgorithmException. InvalidAlgorithmParameterException checking missed.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.security.Provider.class}
-    )
     public void testCertStore12() throws InvalidAlgorithmParameterException {
         if (!initParams()) {
             return;
@@ -425,12 +359,6 @@
      * <code>getInstance(String type, CertStoreParameters params, Provider provider)</code>
      * Assertion: return CertStore object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies positive case. InvalidAlgorithmParameterException checking missed.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.cert.CertStoreParameters.class, java.security.Provider.class}
-    )
     public void testCertStore14()
             throws InvalidAlgorithmParameterException, NoSuchAlgorithmException {
         if (!initParams()) {
@@ -449,20 +377,6 @@
      * <code>getCRLs(CRLSelector selector)</code>
      * Assertion: returns empty Collection when selector is null
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Verifies that these methods return empty Collection when selector is null.",
-            method = "getCertificates",
-            args = {java.security.cert.CertSelector.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Verifies that these methods return empty Collection when selector is null.",
-            method = "getCRLs",
-            args = {java.security.cert.CRLSelector.class}
-        )
-    })
     public void testCertStore15() throws CertStoreException {
         if (!initParams()) {
             return;
@@ -481,11 +395,6 @@
     /**
      * Test for <code>getType()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getType",
-        args = {}
-    )
     public void testCertStore16() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         if (!initParams()) {
@@ -518,12 +427,6 @@
     /**
      * Test for <code>getProvider()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void testCertStore17() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         if (!initParams()) {
@@ -555,12 +458,6 @@
     /**
      * Test for <code>getCertStoreParameters()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertStoreParameters",
-        args = {}
-    )
     public void testCertStore18() throws NoSuchAlgorithmException,
             InvalidAlgorithmParameterException {
         if (!initParams()) {
diff --git a/luni/src/test/java/tests/security/cert/CertStore2Test.java b/luni/src/test/java/tests/security/cert/CertStore2Test.java
index a5346c8..5b852d7 100644
--- a/luni/src/test/java/tests/security/cert/CertStore2Test.java
+++ b/luni/src/test/java/tests/security/cert/CertStore2Test.java
@@ -1,9 +1,5 @@
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import java.security.InvalidAlgorithmParameterException;
@@ -22,7 +18,6 @@
 import java.util.ArrayList;
 import java.util.Collection;
 
-@TestTargetClass(CertStore.class)
 public class CertStore2Test extends TestCase {
 
     private static final String CERT_STORE_PROVIDER_NAME = "TestCertStoreProvider";
@@ -42,11 +37,6 @@
         Security.removeProvider(CERT_STORE_PROVIDER_NAME);
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class, CertStoreParameters.class}
-    )
     public void testGetInstanceStringCertStoreParameters() {
         try {
             CertStoreParameters parameters = new MyCertStoreParameters();
@@ -91,11 +81,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class, CertStoreParameters.class, String.class}
-    )
     public void testGetInstanceStringCertStoreParametersString() {
         try {
             CertStoreParameters parameters = new MyCertStoreParameters();
@@ -167,11 +152,6 @@
 
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getInstance",
-            args={String.class, CertStoreParameters.class, Provider.class}
-    )
     public void testGetInstanceStringCertStoreParametersProvider() {
         try {
             CertStoreParameters parameters = new MyCertStoreParameters();
@@ -220,11 +200,6 @@
 
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getCertificates",
-            args={CertSelector.class}
-    )
     public void testGetCertificates() {
         CertStore certStore = null;
         try {
@@ -260,11 +235,6 @@
         }
     }
 
-    @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="getCRLs",
-            args={CRLSelector.class}
-    )
     public void testGetCRLs() {
         CertStore certStore = null;
         try {
diff --git a/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java b/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java
index fce8a9c..5736a02 100644
--- a/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertStoreExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertStoreException;
@@ -35,7 +30,6 @@
  * Tests for <code>CertStoreException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertStoreException.class)
 public class CertStoreExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -49,12 +43,6 @@
      * Test for <code>CertStoreException()</code> constructor Assertion:
      * constructs CertStoreException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertStoreException",
-        args = {}
-    )
     public void testCertStoreException01() {
         CertStoreException tE = new CertStoreException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -66,12 +54,6 @@
      * constructs CertStoreException with detail message msg. Parameter
      * <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertStoreException",
-        args = {java.lang.String.class}
-    )
     public void testCertStoreException02() {
         CertStoreException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -86,12 +68,6 @@
      * Test for <code>CertStoreException(String)</code> constructor Assertion:
      * constructs CertStoreException when <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null asa parameter.",
-        method = "CertStoreException",
-        args = {java.lang.String.class}
-    )
     public void testCertStoreException03() {
         String msg = null;
         CertStoreException tE = new CertStoreException(msg);
@@ -104,12 +80,6 @@
      * Assertion: constructs CertStoreException when <code>cause</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertStoreException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertStoreException04() {
         Throwable cause = null;
         CertStoreException tE = new CertStoreException(cause);
@@ -122,12 +92,6 @@
      * Assertion: constructs CertStoreException when <code>cause</code> is not
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertStoreException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertStoreException05() {
         CertStoreException tE = new CertStoreException(tCause);
         if (tE.getMessage() != null) {
@@ -146,12 +110,6 @@
      * Assertion: constructs CertStoreException when <code>cause</code> is
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CertStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertStoreException06() {
         CertStoreException tE = new CertStoreException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -163,12 +121,6 @@
      * Assertion: constructs CertStoreException when <code>cause</code> is
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the second parameter.",
-        method = "CertStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertStoreException07() {
         CertStoreException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -184,12 +136,6 @@
      * Assertion: constructs CertStoreException when <code>cause</code> is not
      * null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the first parameter.",
-        method = "CertStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertStoreException08() {
         CertStoreException tE = new CertStoreException(null, tCause);
         if (tE.getMessage() != null) {
@@ -208,12 +154,6 @@
      * Assertion: constructs CertStoreException when <code>cause</code> is not
      * null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "CertStoreException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertStoreException09() {
         CertStoreException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java b/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java
index 3d16bfa..393abee 100644
--- a/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java
+++ b/luni/src/test/java/tests/security/cert/CertStoreSpiTest.java
@@ -23,11 +23,6 @@
 package tests.security.cert;
 
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -47,7 +42,6 @@
  * Tests for <code>CertStoreSpi</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertStoreSpi.class)
 public class CertStoreSpiTest extends TestCase {
 
 
@@ -55,26 +49,6 @@
      * Test for <code>CertStoreSpi</code> constructor Assertion: constructs
      * CertStoreSpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "CertStoreSpi",
-            args = {java.security.cert.CertStoreParameters.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetCertificates",
-            args = {java.security.cert.CertSelector.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetCRLs",
-            args = {java.security.cert.CRLSelector.class}
-        )
-    })
     public void testCertStoreSpi01() throws InvalidAlgorithmParameterException,
             CertStoreException {
         CertStoreSpi certStoreSpi = null;
diff --git a/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java b/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java
index 924b13b..7d973e7 100644
--- a/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateCertificateRepTest.java
@@ -1,9 +1,5 @@
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.cert.MyCertificate;
@@ -14,7 +10,6 @@
 import java.security.cert.Certificate;
 import java.util.Arrays;
 
-@TestTargetClass(java.security.cert.Certificate.class)
 public class CertificateCertificateRepTest extends TestCase {
 
     private static final byte[] testEncoding = new byte[] { (byte) 1, (byte) 2,
@@ -33,12 +28,6 @@
      * <code>Certificate.CertificateRep(String type, byte[] data)</code>
      * method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Certificate.CertificateRep.CertificateRep",
-        args = { String.class, byte[].class}
-    )
     public final void testCertificateCertificateRep() {
         MyCertificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
         MyCertificateRep rep = c1.new MyCertificateRep("TEST_TYPE", new byte[] {
@@ -67,12 +56,6 @@
     /**
      * Test for <code>readResolve()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "Certificate.CertificateRep.readResolve",
-        args = {}
-    )
     public final void testReadResolve() {
         MyCertificate c1 = new MyCertificate("TEST_TYPE", testEncoding);
         MyCertificateRep rep = c1.new MyCertificateRep("TEST_TYPE", new byte[] {
diff --git a/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java b/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java
index e8698b6..9896dc6 100644
--- a/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java
+++ b/luni/src/test/java/tests/security/cert/CertificateEncodingException2Test.java
@@ -17,25 +17,13 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.security.cert.CertificateEncodingException;
 
-@TestTargetClass(CertificateEncodingException.class)
 public class CertificateEncodingException2Test extends junit.framework.TestCase {
 
     /**
-     * @tests java.security.cert.CertificateEncodingException#CertificateEncodingException()
+     * java.security.cert.CertificateEncodingException#CertificateEncodingException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateEncodingException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.security.cert.CertificateEncodingException()
         try {
diff --git a/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java
index 048c095..fa66cdb 100644
--- a/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateEncodingExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertificateEncodingException;
@@ -37,7 +32,6 @@
  * methods.
  *
  */
-@TestTargetClass(CertificateEncodingException.class)
 public class CertificateEncodingExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -51,12 +45,6 @@
      * Test for <code>CertificateEncodingException()</code> constructor
      * Assertion: constructs CertificateEncodingException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateEncodingException",
-        args = {}
-    )
     public void testCertificateEncodingException01() {
         CertificateEncodingException tE = new CertificateEncodingException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * Assertion: constructs CertificateEncodingException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateEncodingException02() {
         CertificateEncodingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * Assertion: constructs CertificateEncodingException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateEncodingException03() {
         String msg = null;
         CertificateEncodingException tE = new CertificateEncodingException(msg);
@@ -107,12 +83,6 @@
      * constructor Assertion: constructs CertificateEncodingException when
      * <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateEncodingException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertificateEncodingException04() {
         Throwable cause = null;
         CertificateEncodingException tE = new CertificateEncodingException(
@@ -126,12 +96,6 @@
      * constructor Assertion: constructs CertificateEncodingException when
      * <code>cause</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateEncodingException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertificateEncodingException05() {
         CertificateEncodingException tE = new CertificateEncodingException(
                 tCause);
@@ -151,12 +115,6 @@
      * constructor Assertion: constructs CertificateEncodingException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateEncodingException06() {
         CertificateEncodingException tE = new CertificateEncodingException(
                 null, null);
@@ -169,12 +127,6 @@
      * constructor Assertion: constructs CertificateEncodingException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the second parameter.",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateEncodingException07() {
         CertificateEncodingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -190,12 +142,6 @@
      * constructor Assertion: constructs CertificateEncodingException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the first parameter.",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateEncodingException08() {
         CertificateEncodingException tE = new CertificateEncodingException(
                 null, tCause);
@@ -215,12 +161,6 @@
      * constructor Assertion: constructs CertificateEncodingException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateEncodingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateEncodingException09() {
         CertificateEncodingException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/tests/security/cert/CertificateException2Test.java b/luni/src/test/java/tests/security/cert/CertificateException2Test.java
index a3769c4..27f9d0e 100644
--- a/luni/src/test/java/tests/security/cert/CertificateException2Test.java
+++ b/luni/src/test/java/tests/security/cert/CertificateException2Test.java
@@ -17,25 +17,13 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import java.security.cert.CertificateException;
 
-@TestTargetClass(CertificateException.class)
 public class CertificateException2Test extends junit.framework.TestCase {
 
     /**
-     * @tests java.security.cert.CertificateException#CertificateException()
+     * java.security.cert.CertificateException#CertificateException()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateException",
-        args = {}
-    )
     public void test_Constructor() {
         // Test for method java.security.cert.CertificateException()
         try {
@@ -52,14 +40,8 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateException#CertificateException(java.lang.String)
+     * java.security.cert.CertificateException#CertificateException(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Null/empty/invalid parameters checking missed",
-        method = "CertificateException",
-        args = {java.lang.String.class}
-    )
     public void test_ConstructorLjava_lang_String() {
         // Test for method
         // java.security.cert.CertificateException(java.lang.String)
diff --git a/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java
index b88db00..e28a6d2 100644
--- a/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertificateException;
@@ -36,7 +31,6 @@
  * Tests for <code>CertificateException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateException.class)
 public class CertificateExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -50,12 +44,6 @@
      * Test for <code>CertificateException()</code> constructor Assertion:
      * constructs CertificateException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateException",
-        args = {}
-    )
     public void testCertificateException01() {
         CertificateException tE = new CertificateException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -67,12 +55,6 @@
      * Assertion: constructs CertificateException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateException02() {
         CertificateException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -88,12 +70,6 @@
      * Assertion: constructs CertificateException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateException03() {
         String msg = null;
         CertificateException tE = new CertificateException(msg);
@@ -106,12 +82,6 @@
      * Assertion: constructs CertificateException when <code>cause</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertificateException04() {
         Throwable cause = null;
         CertificateException tE = new CertificateException(cause);
@@ -124,12 +94,6 @@
      * Assertion: constructs CertificateException when <code>cause</code> is
      * not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertificateException05() {
         CertificateException tE = new CertificateException(tCause);
         if (tE.getMessage() != null) {
@@ -148,12 +112,6 @@
      * constructor Assertion: constructs CertificateException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CertificateException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateException06() {
         CertificateException tE = new CertificateException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -165,12 +123,6 @@
      * constructor Assertion: constructs CertificateException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as Throwable parameter.",
-        method = "CertificateException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateException07() {
         CertificateException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -186,12 +138,6 @@
      * constructor Assertion: constructs CertificateException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies as String parameter.",
-        method = "CertificateException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateException08() {
         CertificateException tE = new CertificateException(null, tCause);
         if (tE.getMessage() != null) {
@@ -210,12 +156,6 @@
      * constructor Assertion: constructs CertificateException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateException09() {
         CertificateException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java
index d6ee648..bf6f1dd 100644
--- a/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateExpiredExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertificateExpiredException;
@@ -36,7 +31,6 @@
  * Tests for <code>DigestException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateExpiredException.class)
 public class CertificateExpiredExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -50,12 +44,6 @@
      * Test for <code>CertificateExpiredException()</code> constructor
      * Assertion: constructs CertificateExpiredException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateExpiredException",
-        args = {}
-    )
     public void testCertificateExpiredException01() {
         CertificateExpiredException tE = new CertificateExpiredException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -67,12 +55,6 @@
      * Assertion: constructs CertificateExpiredException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateExpiredException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateExpiredException02() {
         CertificateExpiredException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -88,12 +70,6 @@
      * Assertion: constructs CertificateExpiredException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateExpiredException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateExpiredException03() {
         String msg = null;
         CertificateExpiredException tE = new CertificateExpiredException(msg);
diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java
index 4fa6c62..d808f59 100644
--- a/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java
+++ b/luni/src/test/java/tests/security/cert/CertificateFactory1Test.java
@@ -21,11 +21,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.SpiEngUtils;
@@ -56,7 +51,6 @@
  * Tests for <code>CertificateFactory</code> class methods and constructor
  *
  */
-@TestTargetClass(CertificateFactory.class)
 public class CertificateFactory1Test extends TestCase {
 
     public static final String srvCertificateFactory = "CertificateFactory";
@@ -110,12 +104,6 @@
      * Test for <code>getInstance(String type)</code> method
      * Assertion: returns CertificateFactory if type is X.509
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CertificateException.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testCertificateFactory01() throws CertificateException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -134,12 +122,6 @@
      * throws NullPointerException when type is null
      * throws CertificateException when type is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateException.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testCertificateFactory02() {
         try {
             CertificateFactory.getInstance(null);
@@ -161,12 +143,6 @@
      * Test for <code>getInstance(String type, String provider)</code> method
      * Assertion: throws IllegalArgumentException when provider is null or empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException. IllegalArgumentException was checked instead of NoSuchProviderException",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertificateFactory03() throws CertificateException,
             NoSuchProviderException {
         if (!X509Support) {
@@ -194,12 +170,6 @@
      * throws NullPointerException when type is null
      * throws CertificateException when type is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateException and NullPointerException.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertificateFactory04() throws NoSuchProviderException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -228,12 +198,6 @@
      * Assertion: returns CertificateFactory when type and provider have valid
      * values
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void testCertificateFactory05() throws CertificateException,
             NoSuchProviderException {
         if (!X509Support) {
@@ -255,12 +219,6 @@
      * method
      * Assertion: throws IllegalArgumentException when provider is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testCertificateFactory06() throws CertificateException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -283,12 +241,6 @@
      * throws NullPointerException when type is null
      * throws CertificateException when type is not available
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateException.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testCertificateFactory07() {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -318,12 +270,6 @@
      * Assertion: returns CertificateFactorythrows when type and provider
      * have valid values
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality of getInstance method.",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testCertificateFactory08() throws CertificateException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -343,12 +289,6 @@
      * Test for <code>getCertPathEncodings()</code> method
      * Assertion: returns encodings
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertPathEncodings",
-        args = {}
-    )
     public void testCertificateFactory09() {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -399,32 +339,6 @@
      * Assertion: throw CertificateException and CRLException when
      * inStream is null or empty
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies methods with null and empty InputStream.",
-            method = "generateCertificate",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies methods with null and empty InputStream.",
-            method = "generateCertificates",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies methods with null and empty InputStream.",
-            method = "generateCRL",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies methods with null and empty InputStream.",
-            method = "generateCRLs",
-            args = {java.io.InputStream.class}
-        )
-    })
     public void testCertificateFactory10() {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -504,32 +418,6 @@
      * Assertion: throw CertificateException and CRLException when inStream
      * contains incompatible datas
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies positive functionality of methods.",
-            method = "generateCertificate",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies positive functionality of methods.",
-            method = "generateCertificates",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies positive functionality of methods.",
-            method = "generateCRL",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies positive functionality of methods.",
-            method = "generateCRLs",
-            args = {java.io.InputStream.class}
-        )
-    })
     public void testCertificateFactory11() throws IOException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -590,20 +478,6 @@
      * Assertion: throws CertificateException when inStream is null or
      * when isStream contains invalid datas
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies CertificateException.",
-            method = "generateCertPath",
-            args = {java.io.InputStream.class, java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies CertificateException.",
-            method = "generateCertPath",
-            args = {java.io.InputStream.class}
-        )
-    })
     public void testCertificateFactory12() {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -652,20 +526,6 @@
      * methods
      * Assertion: throw CertificateException when isStream contains invalid datas
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies CertificateException.",
-            method = "generateCertPath",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies CertificateException.",
-            method = "generateCertPath",
-            args = {java.io.InputStream.class, java.lang.String.class}
-        )
-    })
     // Test passed on RI
     public void testCertificateFactory13() throws IOException {
         if (!X509Support) {
@@ -707,12 +567,6 @@
      * Test for <code>generateCertPath(List certificates)</code> method
      * Assertion: throw NullPointerException certificates is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException. Valid parameters checking missed.",
-        method = "generateCertPath",
-        args = {java.util.List.class}
-    )
     public void testCertificateFactory14() throws CertificateException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -734,12 +588,6 @@
      * Test for <code>generateCertPath(List certificates)</code> method
      * Assertion: returns empty CertPath if certificates is empty
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that generateCertPath method returns empty CertPath if certificates is empty. Valid parameters checking missed.",
-        method = "generateCertPath",
-        args = {java.util.List.class}
-    )
     public void testCertificateFactory15() throws CertificateException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -760,12 +608,6 @@
      * Assertion: throws CertificateException when certificates contains
      * incorrect Certificate
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateException. Valid parameters checking missed.",
-        method = "generateCertPath",
-        args = {java.util.List.class}
-    )
     public void testCertificateFactory16() {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -789,12 +631,6 @@
      * Test for <code>CertificateFactory</code> constructor
      * Assertion: returns CertificateFactory object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CRLException and NullPointerException.",
-        method = "generateCRLs",
-        args = {java.io.InputStream.class}
-    )
     public void testCertificateFactory17() throws CRLException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -824,12 +660,6 @@
     /**
      * Test for <code>getType()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getType",
-        args = {}
-    )
     public void testCertificateFactory18() throws CertificateException {
         if (!X509Support) {
             fail(NotSupportMsg);
@@ -858,12 +688,6 @@
     }
 
     @SuppressWarnings("cast")
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateFactory",
-        args = {java.security.cert.CertificateFactorySpi.class, java.security.Provider.class, java.lang.String.class}
-    )
     public void testCertificateFactory19() {
         if (!X509Support) {
             fail(NotSupportMsg);
diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java
index e491ba6..18fc79f 100644
--- a/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java
+++ b/luni/src/test/java/tests/security/cert/CertificateFactory2Test.java
@@ -22,10 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.SpiEngUtils;
@@ -50,7 +46,6 @@
  * Tests for CertificateFactory class constructors and methods
  *
  */
-@TestTargetClass(CertificateFactory.class)
 public class CertificateFactory2Test extends TestCase {
     private static final String defaultAlg = "CertFac";
     private static final String CertificateFactoryProviderClass = "org.apache.harmony.security.tests.support.cert.MyCertificateFactorySpi";
@@ -315,60 +310,24 @@
             checkResult(cerF,  mode);
         }
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance01() throws CertificateException, CRLException {
         GetInstance01(true);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance02() throws CertificateException,
         NoSuchProviderException, IllegalArgumentException, CRLException {
         GetInstance02(true);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance03() throws CertificateException,
         IllegalArgumentException, CRLException {
         GetInstance03(true);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void testGetInstance04() throws CertificateException, CRLException {
         GetInstance01(false);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance05() throws CertificateException,
         NoSuchProviderException, IllegalArgumentException, CRLException {
         GetInstance02(false);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.security.Provider.class}
-    )
     public void testGetInstance06() throws CertificateException,
         IllegalArgumentException, CRLException {
         GetInstance03(false);
diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java
index 9163933..f908b69 100644
--- a/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java
+++ b/luni/src/test/java/tests/security/cert/CertificateFactory3Test.java
@@ -22,10 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.SpiEngUtils;
@@ -46,7 +42,6 @@
 /**
  * Tests for <code>CertificateFactory</code> class methods
  */
-@TestTargetClass(CertificateFactory.class)
 public class CertificateFactory3Test extends TestCase {
 
     private static String defaultProviderName = null;
@@ -88,12 +83,6 @@
      * Test for <code>generateCertificate(InputStream inStream)</code> method
      * Assertion: returns Certificate
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CertificateException.",
-        method = "generateCertificate",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCertificate() throws Exception {
         CertificateFactory[] certFs = initCertFs();
         assertNotNull("CertificateFactory objects were not created", certFs);
@@ -110,12 +99,6 @@
      * Test for <code>generateCertificates(InputStream inStream)</code> method
      * Assertion: returns Collection which consists of 1 Certificate
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CertificateException.",
-        method = "generateCertificates",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCertificates() throws Exception {
         CertificateFactory[] certFs = initCertFs();
         assertNotNull("CertificateFactory objects were not created", certFs);
@@ -136,12 +119,6 @@
      * Test for <code>generateCertPath(List certificates)</code> method
      * Assertion: returns CertPath with 1 Certificate
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CertificateException.",
-        method = "generateCertPath",
-        args = {java.util.List.class}
-    )
     public void testGenerateCertPath01() throws Exception {
         CertificateFactory[] certFs = initCertFs();
         assertNotNull("CertificateFactory objects were not created", certFs);
@@ -167,12 +144,6 @@
      * <code>generateCertPath(InputStream inStream, String encoding)</code>
      * method Assertion: returns CertPath with 1 Certificate
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CertificateException.",
-        method = "generateCertPath",
-        args = {java.io.InputStream.class, java.lang.String.class}
-    )
     public void testGenerateCertPath02() throws Exception {
         CertificateFactory[] certFs = initCertFs();
         assertNotNull("CertificateFactory objects were not created", certFs);
@@ -193,12 +164,6 @@
      * Test for <code>generateCertPath(InputStream inStream)</code> method
      * Assertion: returns CertPath with 1 Certificate
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CertificateException.",
-        method = "generateCertPath",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCertPath03() throws Exception {
         String certPathEncoding = "PkiPath";
         CertificateFactory[] certFs = initCertFs();
diff --git a/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java b/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java
index 65f3868..060a4a2 100644
--- a/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java
+++ b/luni/src/test/java/tests/security/cert/CertificateFactory4Test.java
@@ -17,10 +17,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import tests.support.resource.Support_Resources;
@@ -42,7 +38,6 @@
 import java.util.Collection;
 import java.util.List;
 
-@TestTargetClass(CertificateFactory.class)
 public class CertificateFactory4Test extends TestCase {
 
     private static final String BASE_URL = Support_GetResource
@@ -57,14 +52,8 @@
     private static final String[] CRLCOLLECTION_URLS = new String[] { "Bug94404-PKCS7.crl" };
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCertificate(java.io.InputStream)
+     * java.security.cert.CertificateFactory#generateCertificate(java.io.InputStream)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "generateCertificate",
-        args = {java.io.InputStream.class}
-    )
     public void test_generateCertificateLjava_io_InputStream() throws Exception {
         // Test 1
         // Test for method java.security.cert.Certificate
@@ -94,14 +83,8 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCertificates(java.io.InputStream)
+     * java.security.cert.CertificateFactory#generateCertificates(java.io.InputStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IOException.",
-        method = "generateCertificates",
-        args = {java.io.InputStream.class}
-    )
     public void test_generateCertificatesLjava_io_InputStream()
             throws Exception {
         CertificateFactory fact = CertificateFactory.getInstance("X.509");
@@ -123,14 +106,8 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCRL(java.io.InputStream)
+     * java.security.cert.CertificateFactory#generateCRL(java.io.InputStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IOException.",
-        method = "generateCRL",
-        args = {java.io.InputStream.class}
-    )
     public void test_generateCRLLjava_io_InputStream() throws Exception {
         CertificateFactory fact = CertificateFactory.getInstance("X.509");
         for (int i = 0; i < CRL_URLS.length; i++) {
@@ -150,14 +127,8 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCRLs(java.io.InputStream)
+     * java.security.cert.CertificateFactory#generateCRLs(java.io.InputStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IOException.",
-        method = "generateCRLs",
-        args = {java.io.InputStream.class}
-    )
     public void test_generateCRLsLjava_io_InputStream() throws Exception {
         CertificateFactory fact = CertificateFactory.getInstance("X.509");
         for (int i = 0; i < CRLCOLLECTION_URLS.length; i++) {
@@ -175,14 +146,8 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#getInstance(java.lang.String)
+     * java.security.cert.CertificateFactory#getInstance(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify CertificateException.",
-        method = "getInstance",
-        args = {java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_String() throws Exception {
         // Test for method java.security.cert.CertificateFactory
         // java.security.cert.CertificateFactory.getInstance(java.lang.String)
@@ -191,15 +156,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#getInstance(java.lang.String,
+     * java.security.cert.CertificateFactory#getInstance(java.lang.String,
      *        java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInstance",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
     public void test_getInstanceLjava_lang_StringLjava_lang_String()
             throws Exception {
         // Test for method java.security.cert.CertificateFactory
@@ -228,14 +187,8 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#getProvider()
+     * java.security.cert.CertificateFactory#getProvider()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getProvider",
-        args = {}
-    )
     public void test_getProvider() throws Exception {
         // Test for method java.security.Provider
         // java.security.cert.CertificateFactory.getProvider()
@@ -244,15 +197,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCRLs(InputStream
+     * java.security.cert.CertificateFactory#generateCRLs(InputStream
      *        inStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "generateCRLs",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCRLs2() throws Exception {
         // Regression for HARMONY-814
         try {
@@ -263,15 +210,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCertificate(InputStream
+     * java.security.cert.CertificateFactory#generateCertificate(InputStream
      *        inStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter,s and CertificateException.",
-        method = "generateCertificate",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCertificate() throws Exception {
         // Regression for HARMONY-814
         try {
@@ -281,15 +222,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCertificates(InputStream
+     * java.security.cert.CertificateFactory#generateCertificates(InputStream
      *        inStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "generateCertificates",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCertificates2() throws Exception {
         // Regression for HARMONY-814
         try {
@@ -299,15 +234,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCertPath(InputStream
+     * java.security.cert.CertificateFactory#generateCertPath(InputStream
      *        inStream, String encoding)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as InputStream parameter.",
-        method = "generateCertPath",
-        args = {java.io.InputStream.class, java.lang.String.class}
-    )
     public void testGenerateCertPath1() throws Exception {
         // Regression for HARMONY-814
         try {
@@ -318,15 +247,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCertPath(List<?
+     * java.security.cert.CertificateFactory#generateCertPath(List<?
      *        extends Certificate> certificates)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "generateCertPath",
-        args = {java.util.List.class}
-    )
     public void testGenerateCertPath2() throws Exception {
         // Regression for HARMONY-814
         try {
@@ -337,15 +260,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCertPath(InputStream
+     * java.security.cert.CertificateFactory#generateCertPath(InputStream
      *        inStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as  a parameter.",
-        method = "generateCertPath",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCertPath3() throws Exception {
         // Regression for HARMONY-814
         try {
@@ -356,15 +273,9 @@
     }
 
     /**
-     * @tests java.security.cert.CertificateFactory#generateCRL(InputStream
+     * java.security.cert.CertificateFactory#generateCRL(InputStream
      *        inStream)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "generateCRL",
-        args = {java.io.InputStream.class}
-    )
     public void testGenerateCRL() throws Exception {
         // Regression for HARMONY-814
         try {
diff --git a/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java b/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java
index 1c27991..9e3f1ad 100644
--- a/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateFactorySpiTest.java
@@ -23,11 +23,6 @@
 package tests.security.cert;
 
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.cert.MyCertificateFactorySpi;
@@ -49,19 +44,12 @@
  * Tests for <code>CertificateFactorySpi</code> class constructors and methods
  *
  */
-@TestTargetClass(CertificateFactorySpi.class)
 public class CertificateFactorySpiTest extends TestCase {
 
     /**
      * Test for <code>CertificateFactorySpi</code> constructor
      * Assertion: constructs CertificateFactorySpi
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies exceptions.",
-        method = "CertificateFactorySpi",
-        args = {}
-    )
     public void testCertificateFactorySpi01() throws CertificateException,
             CRLException {
         CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
@@ -123,20 +111,6 @@
      * Test for <code>CertificateFactorySpi</code> constructor
      * Assertion: constructs CertificateFactorySpi
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "CertificateFactorySpi",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGetCertPathEncodings",
-            args = {}
-        )
-    })
     public void testCertificateFactorySpi02() throws CertificateException,
             CRLException {
         CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
@@ -207,12 +181,6 @@
      * Test for <code>CertificateFactorySpi</code> constructor
      * Assertion: constructs CertificateFactorySpi
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateFactorySpi",
-        args = {}
-    )
     public void testCertificateFactorySpi03() throws CertificateException,
             CRLException {
         CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
@@ -280,12 +248,6 @@
      * Assertion: Generates a <code>CertPath</code> object and initializes it
      * with the data read from the <code>InputStream</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that engineGenerateCertPath method returns null.",
-        method = "engineGenerateCertPath",
-        args = {java.io.InputStream.class}
-    )
     public void testEngineGenerateCertPathLjava_io_InputStream01() {
         CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
 
@@ -305,12 +267,6 @@
      * Assertion: Generates a <code>CertPath</code> object and initializes it
      * with the data read from the <code>InputStream</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies UnsupportedOperationException.",
-        method = "engineGenerateCertPath",
-        args = {java.io.InputStream.class}
-    )
     public void testEngineGenerateCertPathLjava_io_InputStream02() {
         CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
 
@@ -332,12 +288,6 @@
      * method. Assertion: generates a <code>CertPath</code> object and
      * initializes it with the data read from the <code>InputStream</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies CertificateException.",
-        method = "engineGenerateCertPath",
-        args = {java.io.InputStream.class, java.lang.String.class}
-    )
     public void testEngineGenerateCertPathLjava_io_InputStream_Ljava_lang_String01() {
         CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
         MyCertificateFactorySpi.putMode(true);
@@ -364,12 +314,6 @@
      * method. Assertion: generates a <code>CertPath</code> object and
      * initializes it with the data read from the <code>InputStream</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies UnsupportedOperationException.",
-        method = "engineGenerateCertPath",
-        args = {java.io.InputStream.class, java.lang.String.class}
-    )
     public void testEngineGenerateCertPathLjava_io_InputStream_Ljava_lang_String02() {
         CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
 
@@ -391,12 +335,6 @@
      * method Assertion: generates a <code>CertPath</code> object and
      * initializes it with a <code>List</code> of <code>Certificates</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that engineGenerateCertPath method returns null.",
-        method = "engineGenerateCertPath",
-        args = {java.util.List.class}
-    )
     public void testEngineGenerateCertPathLJava_util_List01() {
         CertificateFactorySpi certFactorySpi = new MyCertificateFactorySpi();
         MyCertificateFactorySpi.putMode(true);
@@ -423,12 +361,6 @@
      * method Assertion: generates a <code>CertPath</code> object and
      * initializes it with a <code>List</code> of <code>Certificates</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies UnsupportedOperationException.",
-        method = "engineGenerateCertPath",
-        args = {java.util.List.class}
-    )
     public void testEngineGenerateCertPathLJava_util_List02() {
         CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
 
@@ -444,32 +376,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGenerateCRL",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGenerateCRLs",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGenerateCertificate",
-            args = {java.io.InputStream.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "engineGenerateCertificates",
-            args = {java.io.InputStream.class}
-        )
-    })
     public void testAbstractMethods() {
         CertificateFactorySpi certFactorySpi = new extCertificateFactorySpi();
         ByteArrayInputStream bais = new ByteArrayInputStream(new byte[3]);
diff --git a/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java
index 361be29..4ea5e8f 100644
--- a/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateNotYetValidExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertificateNotYetValidException;
@@ -36,7 +31,6 @@
  * Tests for <code>DigestException</code> class constructors and methods.
  *
  */
-@TestTargetClass(CertificateNotYetValidException.class)
 public class CertificateNotYetValidExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -51,12 +45,6 @@
      * Assertion: constructs CertificateNotYetValidException with no detail
      * message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateNotYetValidException",
-        args = {}
-    )
     public void testCertificateNotYetValidException01() {
         CertificateNotYetValidException tE = new CertificateNotYetValidException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * constructor Assertion: constructs CertificateNotYetValidException with
      * detail message msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateNotYetValidException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateNotYetValidException02() {
         CertificateNotYetValidException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * constructor Assertion: constructs CertificateNotYetValidException when
      * <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateNotYetValidException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateNotYetValidException03() {
         String msg = null;
         CertificateNotYetValidException tE = new CertificateNotYetValidException(
diff --git a/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java b/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java
index af57c20..cc1f254 100644
--- a/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateParsingExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertificateParsingException;
@@ -37,7 +32,6 @@
  * methods.
  *
  */
-@TestTargetClass(CertificateParsingException.class)
 public class CertificateParsingExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -51,12 +45,6 @@
      * Test for <code>CertificateParsingException()</code> constructor
      * Assertion: constructs CertificateParsingException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "CertificateParsingException",
-        args = {}
-    )
     public void testCertificateParsingException01() {
         CertificateParsingException tE = new CertificateParsingException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * Assertion: constructs CertificateParsingException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateParsingException02() {
         CertificateParsingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * Assertion: constructs CertificateParsingException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class}
-    )
     public void testCertificateParsingException03() {
         String msg = null;
         CertificateParsingException tE = new CertificateParsingException(msg);
@@ -107,12 +83,6 @@
      * constructor Assertion: constructs CertificateParsingException when
      * <code>cause</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CertificateParsingException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertificateParsingException04() {
         Throwable cause = null;
         CertificateParsingException tE = new CertificateParsingException(cause);
@@ -125,12 +95,6 @@
      * constructor Assertion: constructs CertificateParsingException when
      * <code>cause</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CertificateParsingException",
-        args = {java.lang.Throwable.class}
-    )
     public void testCertificateParsingException05() {
         CertificateParsingException tE = new CertificateParsingException(tCause);
         if (tE.getMessage() != null) {
@@ -149,12 +113,6 @@
      * constructor Assertion: constructs CertificateParsingException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateParsingException06() {
         CertificateParsingException tE = new CertificateParsingException(null,
                 null);
@@ -167,12 +125,6 @@
      * constructor Assertion: constructs CertificateParsingException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the second parameter.",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateParsingException07() {
         CertificateParsingException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -188,12 +140,6 @@
      * constructor Assertion: constructs CertificateParsingException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as the first parameter.",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateParsingException08() {
         CertificateParsingException tE = new CertificateParsingException(null,
                 tCause);
@@ -213,12 +159,6 @@
      * constructor Assertion: constructs CertificateParsingException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "CertificateParsingException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testCertificateParsingException09() {
         CertificateParsingException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/tests/security/cert/CertificateTest.java b/luni/src/test/java/tests/security/cert/CertificateTest.java
index 94e1b7d..1fc0c68 100644
--- a/luni/src/test/java/tests/security/cert/CertificateTest.java
+++ b/luni/src/test/java/tests/security/cert/CertificateTest.java
@@ -26,10 +26,6 @@
 
 import dalvik.annotation.AndroidOnly;
 import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargets;
 
 import junit.framework.TestCase;
 
@@ -59,7 +55,6 @@
  * Tests for <code>Certificate</code> fields and methods
  *
  */
-@TestTargetClass(Certificate.class)
 public class CertificateTest extends TestCase {
     /**
      * Meaningless cert encoding just for testing purposes
@@ -74,12 +69,6 @@
     /**
      * Test for <code>Certificate(String type)</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "",
-        method = "Certificate",
-        args = {java.lang.String.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testCertificate() {
@@ -102,12 +91,6 @@
      * Assertion: returns hash of the <code>Certificate</code> instance
      * @throws CertificateEncodingException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testHashCode() throws CertificateEncodingException {
@@ -125,12 +108,6 @@
      * Test for <code>hashCode()</code> method<br>
      * Assertion: hash code of equal objects should be the same
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testHashCodeEqualsObject() {
@@ -146,12 +123,6 @@
      * Test for <code>getType()</code> method<br>
      * Assertion: returns this certificate type
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getType",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testGetType() {
@@ -163,12 +134,6 @@
      * Test #1 for <code>equals(Object)</code> method<br>
      * Assertion: object equals to itself
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testEqualsObject01() {
@@ -181,12 +146,6 @@
      * Assertion: object equals to other <code>Certificate</code>
      * instance with the same state
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testEqualsObject02() {
@@ -199,12 +158,6 @@
      * Test for <code>equals(Object)</code> method<br>
      * Assertion: object not equals to <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies equals method with null as a parameter.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testEqualsObject03() {
@@ -217,12 +170,6 @@
      * Assertion: object not equals to other which is not
      * instance of <code>Certificate</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies negative case.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testEqualsObject04() {
@@ -240,12 +187,6 @@
      * This test just calls <code>getEncoded()</code> method<br>
      * @throws CertificateException
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Can not verify CertificateEncodingException. indirectly tested",
-        method = "getEncoded",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     @KnownFailure("Assertion does not evaluate to true... Works in javax.Certificate")
@@ -277,12 +218,6 @@
      * @throws NoSuchProviderException
      * @throws SignatureException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies only null as a parameter.",
-        method = "verify",
-        args = {java.security.PublicKey.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testVerifyPublicKey()
@@ -304,12 +239,6 @@
      * @throws NoSuchProviderException
      * @throws SignatureException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies only null as parameters.",
-        method = "verify",
-        args = {java.security.PublicKey.class, java.lang.String.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testVerifyPublicKeyString()
@@ -325,12 +254,6 @@
     /**
      * This test just calls <code>toString()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testToString() {
@@ -341,12 +264,6 @@
     /**
      * This test just calls <code>testGetPublicKey()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicKey",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testGetPublicKey() {
@@ -357,12 +274,6 @@
     /**
      * This test just calls <code>writeReplace()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify ObjectStreamException.",
-        method = "writeReplace",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testWriteReplace() {
@@ -462,12 +373,6 @@
      * @throws NoSuchProviderException
      * @throws SignatureException
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Test fails: ClassCastException when SignatureException is expected",
-        method = "verify",
-        args = {java.security.PublicKey.class, java.lang.String.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testVerifyPublicKeyString2() throws InvalidKeyException,
@@ -530,12 +435,6 @@
      * @throws IOException
      * @throws InvalidAlgorithmParameterException
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Can't test exception for cases where the algorithm is unknown",
-        method = "verify",
-        args = {java.security.PublicKey.class}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testVerifyPublicKey2() throws InvalidKeyException,
@@ -571,12 +470,6 @@
     /**
      * This test just calls <code>writeReplace()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "writeReplace",
-        args = {}
-    )
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public final void testWriteReplace2() {
@@ -590,28 +483,8 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility.
+     * serialization/deserialization compatibility.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization compatibility. And tests default constructor",
-            method = "!SerializationSelf",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "writeReplace",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "Certificate.CertificateRep.readResolve",
-            args = {}
-        )
-    })
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public void testSerializationSelf() throws Exception {
@@ -621,28 +494,8 @@
     }
 
     /**
-     * @tests serialization/deserialization compatibility with RI.
+     * serialization/deserialization compatibility with RI.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Verifies serialization/deserialization compatibility.",
-            method = "!SerializationGolden",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "writeReplace",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "Certificate.CertificateRep.readResolve",
-            args = {}
-        )
-    })
     @AndroidOnly("Gets security providers with specific signature algorithm: " +
             "Security.getProviders(\"Signature.sha1WithRSAEncryption\")")
     public void testSerializationCompatibility() throws Exception {
diff --git a/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java b/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java
index b194c70..9e98c16 100644
--- a/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java
+++ b/luni/src/test/java/tests/security/cert/CollectionCertStoreParametersTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertStoreParameters;
@@ -40,7 +35,6 @@
 /**
  * Tests for <code>CollectionCertStoreParameters</code>.
  */
-@TestTargetClass(CollectionCertStoreParameters.class)
 public class CollectionCertStoreParametersTest extends TestCase {
 
     //
@@ -50,12 +44,6 @@
     /**
      * Test #1 for <code>CollectionCertStoreParameters()</code> constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CollectionCertStoreParameters",
-        args = {}
-    )
     public final void testCollectionCertStoreParameters01() {
         CertStoreParameters cp = new CollectionCertStoreParameters();
         assertTrue("isCollectionCertStoreParameters",
@@ -65,12 +53,6 @@
     /**
      * Test #2 for <code>CollectionCertStoreParameters</code> constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CollectionCertStoreParameters",
-        args = {}
-    )
     @SuppressWarnings("unchecked")
     public final void testCollectionCertStoreParameters02() {
         CollectionCertStoreParameters cp = new CollectionCertStoreParameters();
@@ -90,12 +72,6 @@
      * Test #1 for <code>CollectionCertStoreParameters(Collection)</code>
      * constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CollectionCertStoreParameters",
-        args = {java.util.Collection.class}
-    )
     public final void testCollectionCertStoreParametersCollection01() {
         Vector<Certificate> certificates = new Vector<Certificate>();
         certificates.add(new MyCertificate("TEST", new byte[] {}));
@@ -106,12 +82,6 @@
      * Test #2 for <code>CollectionCertStoreParameters(Collection)</code>
      * constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CollectionCertStoreParameters",
-        args = {java.util.Collection.class}
-    )
     public final void testCollectionCertStoreParametersCollection02() {
         // just check that we able to create CollectionCertStoreParameters
         // object passing Collection containing Object which is not
@@ -125,12 +95,6 @@
      * Test #3 for <code>CollectionCertStoreParameters(Collection)</code>
      * constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "CollectionCertStoreParameters",
-        args = {java.util.Collection.class}
-    )
     public final void testCollectionCertStoreParametersCollection03() {
         Vector<Certificate> certificates = new Vector<Certificate>();
         // create using empty collection
@@ -151,12 +115,6 @@
      * Test #4 for <code>CollectionCertStoreParameters(Collection)</code>
      * constructor<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "CollectionCertStoreParameters",
-        args = {java.util.Collection.class}
-    )
     public final void testCollectionCertStoreParametersCollection04() {
         try {
             new CollectionCertStoreParameters(null);
@@ -168,12 +126,6 @@
     /**
      * Test #1 for <code>clone()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void testClone01() {
         Vector<Certificate> certificates = new Vector<Certificate>();
         certificates.add(new MyCertificate("TEST", new byte[] {(byte)4}));
@@ -188,12 +140,6 @@
     /**
      * Test #2 for <code>clone()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void testClone02() {
         Vector<Certificate> certificates = new Vector<Certificate>();
         certificates.add(new MyCertificate("TEST", new byte[] {(byte)4}));
@@ -208,12 +154,6 @@
     /**
      * Test #3 for <code>clone()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void testClone03() {
         CollectionCertStoreParameters cp1 =
             new CollectionCertStoreParameters();
@@ -229,12 +169,6 @@
     /**
      * Test #1 for <code>toString()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString01() {
         CollectionCertStoreParameters cp =
             new CollectionCertStoreParameters();
@@ -245,12 +179,6 @@
     /**
      * Test #2 for <code>toString()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString02() {
         Vector<Certificate> certificates = new Vector<Certificate>();
         certificates.add(new MyCertificate("TEST", new byte[] {(byte)4}));
@@ -263,12 +191,6 @@
     /**
      * Test #1 for <code>getCollection()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getCollection",
-        args = {}
-    )
     public final void testGetCollection01() {
         CollectionCertStoreParameters cp = new CollectionCertStoreParameters();
         assertNotNull(cp.getCollection());
@@ -277,12 +199,6 @@
     /**
      * Test #2 for <code>getCollection()</code> method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getCollection",
-        args = {}
-    )
     public final void testGetCollection02() {
         Vector certificates = new Vector();
         CollectionCertStoreParameters cp =
diff --git a/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java b/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java
index 0a317dc..1963f30 100644
--- a/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java
+++ b/luni/src/test/java/tests/security/cert/LDAPCertStoreParametersTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertStoreParameters;
@@ -37,7 +32,6 @@
  * fields and methods
  *
  */
-@TestTargetClass(LDAPCertStoreParameters.class)
 public class LDAPCertStoreParametersTest extends TestCase {
 
     //
@@ -49,12 +43,6 @@
      * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
      * with the default parameter values (server name "localhost", port 389)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LDAPCertStoreParameters",
-        args = {}
-    )
     public final void testLDAPCertStoreParameters01() {
         CertStoreParameters cp = new LDAPCertStoreParameters();
         assertTrue("isLDAPCertStoreParameters",
@@ -66,12 +54,6 @@
      * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
      * with the default parameter values (server name "localhost", port 389)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LDAPCertStoreParameters",
-        args = {}
-    )
     public final void testLDAPCertStoreParameters02() {
         LDAPCertStoreParameters cp = new LDAPCertStoreParameters();
         assertEquals("host", "localhost", cp.getServerName());
@@ -83,12 +65,6 @@
      * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
      * with the specified server name and a default port of 389
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LDAPCertStoreParameters",
-        args = {java.lang.String.class}
-    )
     public final void testLDAPCertStoreParametersString01() {
         CertStoreParameters cp = new LDAPCertStoreParameters("myhost");
         assertTrue("isLDAPCertStoreParameters",
@@ -100,12 +76,6 @@
      * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
      * with the specified server name and a default port of 389
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LDAPCertStoreParameters",
-        args = {java.lang.String.class}
-    )
     public final void testLDAPCertStoreParametersString02() {
         String serverName = "myhost";
         LDAPCertStoreParameters cp = new LDAPCertStoreParameters(serverName);
@@ -118,12 +88,6 @@
      * Assertion: throws <code>NullPointerException</code> -
      * if <code>serverName</code> is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "LDAPCertStoreParameters",
-        args = {java.lang.String.class}
-    )
     public final void testLDAPCertStoreParametersString03() {
         try {
             new LDAPCertStoreParameters(null);
@@ -137,12 +101,6 @@
      * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
      * with the specified parameter values
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LDAPCertStoreParameters",
-        args = {java.lang.String.class, int.class}
-    )
     public final void testLDAPCertStoreParametersStringint01() {
         CertStoreParameters cp = new LDAPCertStoreParameters("myhost", 1098);
         assertTrue("isLDAPCertStoreParameters",
@@ -154,12 +112,6 @@
      * Assertion: Creates an instance of <code>LDAPCertStoreParameters</code>
      * with the specified parameter values
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "LDAPCertStoreParameters",
-        args = {java.lang.String.class, int.class}
-    )
     public final void testLDAPCertStoreParametersStringint02() {
         String serverName = "myhost";
         int portNumber = 1099;
@@ -174,12 +126,6 @@
      * Assertion: throws <code>NullPointerException</code> -
      * if <code>serverName</code> is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "LDAPCertStoreParameters",
-        args = {java.lang.String.class, int.class}
-    )
     public final void testLDAPCertStoreParametersStringint03() {
         try {
             new LDAPCertStoreParameters(null, 0);
@@ -202,12 +148,6 @@
      * Test for <code>clone()</code> method<br>
      * Assertion: Returns a copy of this object
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void testClone() {
         LDAPCertStoreParameters cp1 =
             new LDAPCertStoreParameters("myhost", 1100);
@@ -223,12 +163,6 @@
      * Test for <code>toString()</code> method<br>
      * Assertion: returns the formatted string describing parameters
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() {
         LDAPCertStoreParameters cp1 =
             new LDAPCertStoreParameters("myhost", 1101);
@@ -240,12 +174,6 @@
      * Test for <code>toString()</code> method<br>
      * Assertion: returns the port number
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPort",
-        args = {}
-    )
     public final void testGetPort() {
         int portNumber = -1099;
         LDAPCertStoreParameters cp =
@@ -257,12 +185,6 @@
      * Test for <code>toString()</code> method<br>
      * Assertion: returns the server name (never <code>null</code>)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getServerName",
-        args = {}
-    )
     public final void testGetServerName() {
         LDAPCertStoreParameters cp =
             new LDAPCertStoreParameters("serverName");
diff --git a/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java b/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java
index 2ef5c0c..f5e3538 100644
--- a/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java
+++ b/luni/src/test/java/tests/security/cert/PKIXBuilderParametersTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.io.ByteArrayInputStream;
@@ -49,7 +44,6 @@
  * Tests for <code>PKIXBuilderParameters</code> fields and methods
  *
  */
-@TestTargetClass(PKIXBuilderParameters.class)
 public class PKIXBuilderParametersTest extends TestCase {
     String certificate = "-----BEGIN CERTIFICATE-----\n"
             + "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n"
@@ -89,12 +83,6 @@
      * Assertion: creates an instance of <code>PKIXBuilderParameters</code>
      * @throws InvalidAlgorithmParameterException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "PKIXBuilderParameters",
-        args = {java.util.Set.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersSetCertSelector01()
         throws InvalidAlgorithmParameterException {
         Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet();
@@ -114,12 +102,6 @@
      * Assertion: creates an instance of <code>PKIXBuilderParameters</code>
      * @throws InvalidAlgorithmParameterException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a CertSelector parameter.",
-        method = "PKIXBuilderParameters",
-        args = {java.util.Set.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersSetCertSelector02()
         throws InvalidAlgorithmParameterException {
         Set<TrustAnchor> taSet = TestUtils.getTrustAnchorSet();
@@ -139,12 +121,6 @@
      * subsequent modifications
      * @throws InvalidAlgorithmParameterException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a CertSelector parameter.",
-        method = "PKIXBuilderParameters",
-        args = {java.util.Set.class, java.security.cert.CertSelector.class}
-    )
     @SuppressWarnings("unchecked")
     public final void testPKIXBuilderParametersSetCertSelector03()
         throws InvalidAlgorithmParameterException {
@@ -172,12 +148,6 @@
      * Assertion: <code>NullPointerException</code> -
      * if the specified <code>Set</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "PKIXBuilderParameters",
-        args = {java.util.Set.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersSetCertSelector04() throws Exception {
         try {
             // pass null
@@ -194,12 +164,6 @@
      * if the specified <code>Set</code> is empty
      * (<code>trustAnchors.isEmpty() == true</code>)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "PKIXBuilderParameters",
-        args = {java.util.Set.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersSetCertSelector05() {
         try {
             // use empty set
@@ -215,12 +179,6 @@
      * Assertion: <code>NullPointerException</code> - if the
      * <code>keystore</code> is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Veirifies null as a KeyStore parameter.",
-        method = "PKIXBuilderParameters",
-        args = {java.security.KeyStore.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersKeyStoreCertSelector01()
             throws Exception {
         try {
@@ -237,12 +195,6 @@
      * Assertion: <code>KeyStoreException</code> - if the
      * <code>keystore</code> has not been initialized
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Veirifies null as a CertSelector parameter.",
-        method = "PKIXBuilderParameters",
-        args = {java.security.KeyStore.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersKeyStoreCertSelector02()
             throws Exception {
         KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
@@ -261,12 +213,6 @@
      * <code>keystore</code> does not contain at least one trusted certificate
      * entry
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "PKIXBuilderParameters",
-        args = {java.security.KeyStore.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersKeyStoreCertSelector03()
             throws Exception {
         KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
@@ -285,12 +231,6 @@
      * Assertion: <code>NullPointerException</code> -
      * if the <code>keystore</code> is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "PKIXBuilderParameters",
-        args = {java.security.KeyStore.class, java.security.cert.CertSelector.class}
-    )
     public final void testPKIXBuilderParametersKeyStoreCertSelector04()
             throws Exception {
         KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
@@ -323,12 +263,6 @@
     /**
      * Test for <code>getMaxPathLength()</code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxPathLength",
-        args = {}
-    )
     public final void testGetMaxPathLength() throws Exception {
         KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
         keyTest.load(null, null);
@@ -357,12 +291,6 @@
     /**
      * Test for <code>setMaxPathLength()</code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMaxPathLength",
-        args = {int.class}
-    )
     public final void testSetMaxPathLength() throws Exception {
         KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
         keyTest.load(null, null);
@@ -406,12 +334,6 @@
     /**
      * Test for <code>toString()</code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() throws Exception {
         KeyStore keyTest = KeyStore.getInstance(KeyStore.getDefaultType());
         keyTest.load(null, null);
diff --git a/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java b/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java
index 2cb6891..e9b14b2 100644
--- a/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java
+++ b/luni/src/test/java/tests/security/cert/PKIXCertPathBuilderResultTest.java
@@ -22,10 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.cert.MyCertPath;
@@ -43,7 +39,6 @@
  * Tests for <code>PKIXCertPathBuilderResult</code>
  *
  */
-@TestTargetClass(PKIXCertPathBuilderResult.class)
 public class PKIXCertPathBuilderResultTest extends TestCase {
     /**
      * Cert path encoding stub
@@ -81,11 +76,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "PKIXCertPathBuilderResult",
-        args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathBuilderResult01()
         throws InvalidKeySpecException,
                NoSuchAlgorithmException {
@@ -109,11 +99,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "PKIXCertPathBuilderResult",
-        args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathBuilderResult02()
         throws InvalidKeySpecException,
                NoSuchAlgorithmException {
@@ -136,11 +121,6 @@
      * Assertion: <code>NullPointerException</code>
      * if certPath is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "PKIXCertPathBuilderResult",
-        args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathBuilderResult03() {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -165,11 +145,6 @@
      * Assertion: <code>NullPointerException</code>
      * if trustAnchor is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "PKIXCertPathBuilderResult",
-        args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathBuilderResult04() {
         try {
             // pass null
@@ -189,11 +164,6 @@
      * Assertion: <code>NullPointerException</code>
      * if publicKey is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        method = "PKIXCertPathBuilderResult",
-        args = {java.security.cert.CertPath.class, java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathBuilderResult05() {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -211,12 +181,6 @@
         } catch (NullPointerException e) {
         }
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void test_clone() {
 
         // Regression for HARMONY-2786.
@@ -243,12 +207,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertPath",
-        args = {}
-    )
     public final void testGetCertPath() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -274,12 +232,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString()
         throws InvalidKeySpecException,
                NoSuchAlgorithmException {
diff --git a/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java b/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java
index 8376e5f..44a2fa4 100644
--- a/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java
+++ b/luni/src/test/java/tests/security/cert/PKIXCertPathCheckerTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.cert.CertPathValidatorException;
@@ -43,18 +38,11 @@
  * Tests for <code>PKIXCertPathChecker</code>
  *
  */
-@TestTargetClass(PKIXCertPathChecker.class)
 public class PKIXCertPathCheckerTest extends TestCase {
 
     //
     // Tests
     //
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PKIXCertPathChecker",
-        args = {}
-    )
     public final void testConstructor() {
         try {
             new MyPKIXCertPathChecker();
@@ -62,12 +50,6 @@
             fail("Unexpected exception " + e.getMessage());
         }
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void testClone() {
         PKIXCertPathChecker pc1 = TestUtils.getTestCertPathChecker();
         PKIXCertPathChecker pc2 = (PKIXCertPathChecker) pc1.clone();
@@ -79,43 +61,19 @@
     // that are abstract in <code>PKIXCertPathChecker</code>
     // (So they just like signature tests)
     //
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "isForwardCheckingSupported",
-        args = {}
-    )
     public final void testIsForwardCheckingSupported() {
         PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker();
         pc.isForwardCheckingSupported();
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "init",
-        args = {boolean.class}
-    )
     public final void testInit()
         throws CertPathValidatorException {
         PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker();
         pc.init(true);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSupportedExtensions",
-        args = {}
-    )
     public final void testGetSupportedExtensions() {
         PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker();
         pc.getSupportedExtensions();
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "check",
-        args = {java.security.cert.Certificate.class, java.util.Collection.class}
-    )
     public final void testCheck() throws CertPathValidatorException {
         PKIXCertPathChecker pc = TestUtils.getTestCertPathChecker();
         pc.check(new MyCertificate("", null), new HashSet<String>());
diff --git a/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java b/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java
index c3de8dd..d578b53 100644
--- a/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java
+++ b/luni/src/test/java/tests/security/cert/PKIXCertPathValidatorResultTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.NoSuchAlgorithmException;
@@ -42,7 +37,6 @@
  * Tests for <code>PKIXCertPathValidatorResult</code>
  *
  */
-@TestTargetClass(PKIXCertPathValidatorResult.class)
 public class PKIXCertPathValidatorResultTest extends TestCase {
     /**
      * PublicKey stub
@@ -73,12 +67,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify NullPointerException.",
-        method = "PKIXCertPathValidatorResult",
-        args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathValidatorResult01()
         throws InvalidKeySpecException,
                NoSuchAlgorithmException {
@@ -98,12 +86,6 @@
      * Assertion: <code>NullPointerException</code> if
      * <code>TrustAnchor</code> parameter is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "PKIXCertPathValidatorResult",
-        args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathValidatorResult02() {
         try {
             // pass null
@@ -122,12 +104,6 @@
      * Assertion: <code>NullPointerException</code> if
      * <code>PublicKey</code> parameter is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "PKIXCertPathValidatorResult",
-        args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathValidatorResult03() {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -149,12 +125,6 @@
      * PolicyNode, PublicKey)</code> constructor<br>
      * Assertion: <code>PolicyNode</code>can be <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "PKIXCertPathValidatorResult",
-        args = {java.security.cert.TrustAnchor.class, java.security.cert.PolicyNode.class, java.security.PublicKey.class}
-    )
     public final void testPKIXCertPathValidatorResult04() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -173,12 +143,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTrustAnchor",
-        args = {}
-    )
     public final void testGetTrustAnchor() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -202,12 +166,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicKey",
-        args = {}
-    )
     public final void testGetPublicKey() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -234,12 +192,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getPolicyTree method returns the root node of the valid policy tree.",
-        method = "getPolicyTree",
-        args = {}
-    )
     public final void testGetPolicyTree01() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -267,12 +219,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getPolicyTree method returns null if there are no valid policies.",
-        method = "getPolicyTree",
-        args = {}
-    )
     public final void testGetPolicyTree02() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -297,12 +243,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public final void testClone() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -354,12 +294,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString01() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
@@ -381,12 +315,6 @@
      * @throws NoSuchAlgorithmException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString02() throws Exception {
         TrustAnchor ta = TestUtils.getTrustAnchor();
         if (ta == null) {
diff --git a/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java b/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java
index 4f7fbfc..a89c063 100644
--- a/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java
+++ b/luni/src/test/java/tests/security/cert/PolicyQualifierInfoTest.java
@@ -21,11 +21,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.io.IOException;
@@ -36,7 +31,6 @@
  * PolicyQualifierInfo test
  *
  */
-@TestTargetClass(PolicyQualifierInfo.class)
 public class PolicyQualifierInfoTest extends TestCase {
 
 
@@ -46,12 +40,6 @@
      * parameter does not represent a valid and parsable policy
      * qualifier info
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException and IOException.",
-        method = "PolicyQualifierInfo",
-        args = {byte[].class}
-    )
     public final void test_Ctor() throws IOException {
         try {
             // pass null
@@ -84,12 +72,6 @@
      * parameter does not represent a valid and parsable policy
      * qualifier info
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IOException.",
-        method = "PolicyQualifierInfo",
-        args = {byte[].class}
-    )
     public final void testPolicyQualifierInfo02() {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -124,12 +106,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "PolicyQualifierInfo",
-        args = {byte[].class}
-    )
     public final void testPolicyQualifierInfo03() throws IOException {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -143,12 +119,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with encoded byte array copied on construction.",
-        method = "PolicyQualifierInfo",
-        args = {byte[].class}
-    )
     public final void testPolicyQualifierInfo04() throws IOException  {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -175,12 +145,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded01() throws IOException {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -198,12 +162,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded02() throws IOException {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -228,12 +186,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPolicyQualifier",
-        args = {}
-    )
     public final void testGetPolicyQualifier01() throws IOException {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -254,12 +206,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPolicyQualifier",
-        args = {}
-    )
     public final void testGetPolicyQualifier02() throws IOException {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -290,12 +236,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPolicyQualifierId",
-        args = {}
-    )
     public final void testGetPolicyQualifierId() throws IOException {
         // get valid encoding
         byte[] encoding = getDerEncoding();
@@ -324,12 +264,6 @@
      *
      * @throws IOException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() throws IOException {
         // get valid encoding
         byte[] encoding = getDerEncoding();
diff --git a/luni/src/test/java/tests/security/cert/TrustAnchorTest.java b/luni/src/test/java/tests/security/cert/TrustAnchorTest.java
index 49f188f..76324f0 100644
--- a/luni/src/test/java/tests/security/cert/TrustAnchorTest.java
+++ b/luni/src/test/java/tests/security/cert/TrustAnchorTest.java
@@ -22,10 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.TestCertUtils;
@@ -46,7 +42,6 @@
 /**
  * Unit tests for <code>TrustAnchor</code>
  */
-@TestTargetClass(TrustAnchor.class)
 public class TrustAnchorTest extends TestCase {
     private static final String keyAlg = "DSA";
     // Sample of some valid CA name
@@ -65,12 +60,6 @@
      * Expected: must pass without any exceptions
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "TrustAnchor",
-        args = {java.lang.String.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorStringPublicKeybyteArray01()
             throws Exception {
 
@@ -93,12 +82,6 @@
      * Expected: must pass without any exceptions
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "TrustAnchor",
-        args = {java.lang.String.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorStringPublicKeybyteArray02()
             throws Exception {
 
@@ -114,12 +97,6 @@
      * Expected: modification must not change object internal state
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "TrustAnchor",
-        args = {java.lang.String.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorStringPublicKeybyteArray03()
             throws Exception {
 
@@ -143,12 +120,6 @@
      * Test preconditions: pass <code>null</code> as mentioned parameter<br>
      * Expected: NullPointerException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies exceptions.",
-        method = "TrustAnchor",
-        args = {java.lang.String.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorStringPublicKeybyteArray04()
             throws Exception {
 
@@ -197,12 +168,6 @@
      * Expected: must pass without any exceptions
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "TrustAnchor",
-        args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorX500PrincipalPublicKeybyteArray01()
             throws Exception {
 
@@ -226,12 +191,6 @@
      * Expected: must pass without any exceptions
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "TrustAnchor",
-        args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorX500PrincipalPublicKeybyteArray02()
             throws Exception {
 
@@ -249,12 +208,6 @@
      * Expected: modification must not change object internal state
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies TrustAnchor with copied byte array.",
-        method = "TrustAnchor",
-        args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorX500PrincipalPublicKeybyteArray03()
             throws Exception {
 
@@ -280,12 +233,6 @@
      * Expected: NullPointerException
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "TrustAnchor",
-        args = {javax.security.auth.x500.X500Principal.class, java.security.PublicKey.class, byte[].class}
-    )
     public final void testTrustAnchorX500PrincipalPublicKeybyteArray04()
             throws Exception {
 
@@ -324,12 +271,6 @@
      * Test preconditions: valid parameters passed<br>
      * Expected: must pass without any exceptions
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "TrustAnchor",
-        args = {java.security.cert.X509Certificate.class, byte[].class}
-    )
     public final void testTrustAnchorX509CertificatebyteArray01()
             throws CertificateException {
 
@@ -379,12 +320,6 @@
      * Test preconditions: <code>null</code> as X509Certificate passed<br>
      * Expected: <code>NullPointerException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "TrustAnchor",
-        args = {java.security.cert.X509Certificate.class, byte[].class}
-    )
     public final void testTrustAnchorX509CertificatebyteArray02()
             throws Exception {
 
@@ -403,12 +338,6 @@
      * Test preconditions: <code>null</code> as nameConstraints passed<br>
      * Expected: must pass without any exceptions
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with null as nameConstraints parameter.",
-        method = "TrustAnchor",
-        args = {java.security.cert.X509Certificate.class, byte[].class}
-    )
     public final void testTrustAnchorX509CertificatebyteArray03()
             throws Exception {
         CertificateFactory certFact = CertificateFactory.getInstance("X509");
@@ -431,12 +360,6 @@
      * IllegalArgumentException
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "TrustAnchor",
-        args = {java.security.cert.X509Certificate.class, byte[].class}
-    )
     public final void testTrustAnchorX509CertificatebyteArray04()
             throws Exception {
 
@@ -461,12 +384,6 @@
      * Test preconditions: both parameters are passed as null<br>
      * Expected: <code>NullPointerException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "TrustAnchor",
-        args = {java.security.cert.X509Certificate.class, byte[].class}
-    )
     public final void testTrustAnchorX509CertificatebyteArray05()
             throws Exception {
 
@@ -486,12 +403,6 @@
      * Expected: the same name must be returned by the method<br>
      *
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCAPublicKey",
-        args = {}
-    )
     public final void testGetCAPublicKey01() throws Exception {
 
         PublicKey pk = new TestKeyPair(keyAlg).getPublic();
@@ -515,12 +426,6 @@
      * Expected: the same name must be returned by the method<br>
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCAName",
-        args = {}
-    )
     public final void testGetCAName01() throws Exception {
 
         PublicKey pk = new TestKeyPair(keyAlg).getPublic();
@@ -544,11 +449,6 @@
      * Expected: <code>null</code> as return value<br>
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "getTrustedCert",
-        args = {}
-    )
     public final void testGetTrustedCer02() throws Exception {
 
         PublicKey pk = new TestKeyPair(keyAlg).getPublic();
@@ -574,12 +474,6 @@
      * Test preconditions: valid parameters are passed to the constructors<br>
      * Expected: the valid parameters must be returned by the method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getNameConstraints",
-        args = {}
-    )
     public final void testGetNameConstraints01() throws Exception {
         PublicKey pk = new TestKeyPair(keyAlg).getPublic();
         TrustAnchor ta1 = new TrustAnchor(validCaNameRfc2253, pk,
@@ -607,12 +501,6 @@
      * Test preconditions: null parameters are passed to the constructors<br>
      * Expected: the null parameters must be returned by the method<br>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getNameConstraints returns null.",
-        method = "getNameConstraints",
-        args = {}
-    )
     public final void testGetNameConstraints02() throws Exception {
         PublicKey pk = new TestKeyPair(keyAlg).getPublic();
         TrustAnchor ta1 = new TrustAnchor(validCaNameRfc2253, pk, null);
@@ -638,12 +526,6 @@
      * Test preconditions: valid parameters are passed to the constructors<br>
      * Expected: not null string<br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public final void testToString() throws Exception {
         PublicKey pk = new TestKeyPair(keyAlg).getPublic();
         TrustAnchor ta1 = new TrustAnchor(validCaNameRfc2253, pk,
@@ -672,12 +554,6 @@
      * by the method<br>
      * @throws InvalidKeySpecException
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCA",
-        args = {}
-    )
     public final void testGetCA01() throws Exception {
 
         PublicKey pk = new TestKeyPair(keyAlg).getPublic();
diff --git a/luni/src/test/java/tests/security/cert/X509CRL2Test.java b/luni/src/test/java/tests/security/cert/X509CRL2Test.java
index 0c21333..c986032 100644
--- a/luni/src/test/java/tests/security/cert/X509CRL2Test.java
+++ b/luni/src/test/java/tests/security/cert/X509CRL2Test.java
@@ -17,11 +17,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import junit.framework.TestCase;
 
 import java.io.ByteArrayInputStream;
@@ -39,7 +34,6 @@
 import java.util.Set;
 import java.util.Vector;
 
-@TestTargetClass(X509CRL.class)
 public class X509CRL2Test extends TestCase {
 
     private X509Certificate pemCert = null;
@@ -79,34 +73,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CRL#getExtensionValue(java.lang.String)
+     * java.security.cert.X509CRL#getExtensionValue(java.lang.String)
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getExtensionValue",
-            args = {java.lang.String.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getCriticalExtensionOIDs",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getNonCriticalExtensionOIDs",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "hasUnsupportedCriticalExtension",
-            args = {}
-        )
-    })
     public void test_getExtensionValueLjava_lang_String() {
         try {
             setUp();
@@ -135,15 +103,9 @@
     }
 
     /**
-     * @tests java.security.cert.X509CRL#X509CRL()
+     * java.security.cert.X509CRL#X509CRL()
      */
     @SuppressWarnings("cast")
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509CRL",
-        args = {}
-    )
     public void test_X509CRL() {
         try {
             MyX509CRL crl = new MyX509CRL();
diff --git a/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java b/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java
index 7d156dd..616caff 100644
--- a/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java
+++ b/luni/src/test/java/tests/security/cert/X509CRLEntryTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -39,7 +34,6 @@
 
 /**
  */
-@TestTargetClass(X509CRLEntry.class)
 public class X509CRLEntryTest extends TestCase {
 
     X509CRLEntry tbt_crlentry;
@@ -100,12 +94,6 @@
     /**
      * X509CRLEntry() method testing. Tests for creating object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509CRLEntry",
-        args = {}
-    )
     public void testX509CRLEntry() {
         TBTCRLEntry tbt_crlentry = new TBTCRLEntry();
 
@@ -126,12 +114,6 @@
      * operation: it should be reflexive, symmetric, transitive, consistent
      * and should be false on null object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         TBTCRLEntry tbt_crlentry_1 = new TBTCRLEntry() {
             public byte[] getEncoded() {
@@ -182,12 +164,6 @@
      * hashCode() method testing. Tests that for equal objects hash codes
      * are equal.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         TBTCRLEntry tbt_crlentry_1 = new TBTCRLEntry() {
             public byte[] getEncoded() {
@@ -202,49 +178,11 @@
      * getCertificateIssuer() method testing. Tests if the method throws
      * appropriate exception.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertificateIssuer",
-        args = {}
-    )
     public void testGetCertificateIssuer() {
         assertNull("The default implementation should return null.",
                 tbt_crlentry.getCertificateIssuer());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEncoded",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getRevocationDate",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSerialNumber",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "hasExtensions",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "toString",
-            args = {}
-        )
-    })
     public void testAbstractMethods() {
         TBTCRLEntry tbt = new TBTCRLEntry() {
             public byte[] getEncoded() {
diff --git a/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java b/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java
index 8e451f0..f2e814d 100644
--- a/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java
+++ b/luni/src/test/java/tests/security/cert/X509CRLSelector2Test.java
@@ -1,10 +1,6 @@
 package tests.security.cert;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 
 import junit.framework.TestCase;
 
@@ -36,7 +32,7 @@
 import java.util.Set;
 
 import javax.security.auth.x500.X500Principal;
-@TestTargetClass(X509CRLSelector.class)
+
 public class X509CRLSelector2Test extends TestCase {
 
     protected void setUp() throws Exception {
@@ -51,12 +47,6 @@
      * constructor testing.
      *
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509CRLSelector",
-        args = {}
-    )
     public void testX509CRLSelector() {
         X509CRLSelector selector = new X509CRLSelector();
         assertNull(selector.getDateAndTime());
@@ -72,19 +62,6 @@
      * specified issuers match the selector, and if not specified issuer does
      * not match the selector.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            method = "addIssuer",
-            args = {javax.security.auth.x500.X500Principal.class}
-        ),
-        @TestTargetNew(
-            level=TestLevel.PARTIAL_COMPLETE,
-            method="match",
-            args={java.security.cert.CRL.class}
-        )
-    })
     public void testAddIssuerLjavax_security_auth_x500_X500Principal02() {
         X509CRLSelector selector = new X509CRLSelector();
         X500Principal iss1 = new X500Principal("O=First Org.");
@@ -107,12 +84,6 @@
      * issuers match the selector, and if not specified issuer does not match
      * the selector.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify IOException.",
-        method = "addIssuerName",
-        args = {java.lang.String.class}
-    )
     public void testAddIssuerNameLjava_lang_String03() {
         X509CRLSelector selector = new X509CRLSelector();
         String iss1 = "O=First Org.";
@@ -147,12 +118,6 @@
      * match the selector, and if the internal collection of issuer names is
      * copied during initialization.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIssuerNames",
-        args = {java.util.Collection.class}
-    )
     @SuppressWarnings("unchecked")
     public void testSetIssuerNamesLjava_util_Collection02() {
         X509CRLSelector selector = new X509CRLSelector();
@@ -201,12 +166,6 @@
      * criteria, if specified issuers match the selector, and if not specified
      * issuer does not match the selector.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIssuers",
-        args = {java.util.Collection.class}
-    )
     public void testSetIssuersLjava_util_Collection() {
         X509CRLSelector selector = new X509CRLSelector();
         X500Principal iss1 = new X500Principal("O=First Org.");
@@ -239,12 +198,6 @@
      * issuers match the selector, and if not specified issuer does not match
      * the selector.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify IOException.",
-        method = "addIssuerName",
-        args = {byte[].class}
-    )
     public void testAddIssuerName$B() {
         X509CRLSelector selector = new X509CRLSelector();
         byte[] iss1 = new byte[]
@@ -284,12 +237,6 @@
      * criteria, if specified minCRL value matches the selector, and if CRL with
      * inappropriate crlNumber value does not match the selector.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMinCRLNumber",
-        args = {java.math.BigInteger.class}
-    )
     @AndroidOnly("Uses specific class: " +
             "org.apache.harmony.security.asn1.ASN1OctetString.")
     public void testSetMinCRLNumberLjava_math_BigInteger() {
@@ -314,12 +261,6 @@
      * criteria, if specified maxCRL value matches the selector, and if CRL with
      * inappropriate crlNumber value does not match the selector.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMaxCRLNumber",
-        args = {java.math.BigInteger.class}
-    )
     @AndroidOnly("Uses specific class: " +
             "org.apache.harmony.security.asn1.ASN1OctetString.")
     public void testSetMaxCRLNumberLjava_math_BigInteger() {
@@ -343,12 +284,6 @@
      * update dates match the selector in the case of null dateAndTime criteria,
      * if correct dates match and incorrect do not match the selector.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setDateAndTime",
-        args = {java.util.Date.class}
-    )
     public void testSetDateAndTimeLjava_util_Date() {
         X509CRLSelector selector = new X509CRLSelector();
         TestCRL crl = new TestCRL(new Date(200), new Date(300));
@@ -375,12 +310,6 @@
     /**
      * setCertificateChecking(X509Certificate) method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setCertificateChecking",
-        args = {java.security.cert.X509Certificate.class}
-    )
     public void testSetCertificateCheckingLjava_X509Certificate()
             throws CertificateException {
         X509CRLSelector selector = new X509CRLSelector();
@@ -407,12 +336,6 @@
      * of not specified issuers, if the returned collection corresponds to the
      * specified issuers and this collection is unmodifiable.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIssuers",
-        args = {}
-    )
     public void testGetIssuers() {
         X509CRLSelector selector = new X509CRLSelector();
         X500Principal iss1 = new X500Principal("O=First Org.");
@@ -436,12 +359,6 @@
      * case of not specified issuers, if the returned collection corresponds to
      * the specified issuers.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIssuerNames",
-        args = {}
-    )
     public void testGetIssuerNames() {
         X509CRLSelector selector = new X509CRLSelector();
         byte[] iss1 = new byte[]
@@ -470,12 +387,6 @@
      * of not specified minCRL criteria, and if the returned value corresponds
      * to the specified one.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMinCRL",
-        args = {}
-    )
     public void testGetMinCRL() {
         X509CRLSelector selector = new X509CRLSelector();
         assertNull("Initially the minCRL should be null.", selector.getMinCRL());
@@ -490,12 +401,6 @@
      * of not specified maxCRL criteria, and if the returned value corresponds
      * to the specified one.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMaxCRL",
-        args = {}
-    )
     public void testGetMaxCRL() {
         X509CRLSelector selector = new X509CRLSelector();
         assertNull("Initially the maxCRL should be null.", selector.getMaxCRL());
@@ -510,12 +415,6 @@
      * case of not specified dateAndTime criteria, and if the returned value
      * corresponds to the specified one.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDateAndTime",
-        args = {}
-    )
     public void testGetDateAndTime() {
         X509CRLSelector selector = new X509CRLSelector();
         assertNull("Initially the dateAndTime criteria should be null.",
@@ -529,12 +428,6 @@
     /**
      * getCertificateChecking() method testing.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertificateChecking",
-        args = {}
-    )
     public void testGetCertificateCheckingLjava_X509Certificate()
             throws CertificateException {
         X509CRLSelector selector = new X509CRLSelector();
@@ -555,12 +448,6 @@
      * match(CRL crl) method testing. Tests if the null object matches to the
      * selector or not.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify not null value as parameter.",
-        method = "match",
-        args = {java.security.cert.CRL.class}
-    )
     public void testMatchLjava_security_cert_X509CRL() {
         X509CRLSelector selector = new X509CRLSelector();
         assertFalse("The null object should not match", selector
@@ -572,12 +459,6 @@
      * crl which matche to the initial selector should match to the clone and
      * the change of clone should not cause the change of initial selector.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     @AndroidOnly("Uses specific classes: " +
             "org.apache.harmony.security.asn1.ASN1OctetString, " +
             "org.apache.harmony.security.asn1.ASN1Integer.")
@@ -608,12 +489,6 @@
                 + "the changes of initial object", selector.getIssuerNames()
                 .size() == 3);
     }
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void testToString() {
         X509CRLSelector selector = new X509CRLSelector();
         X500Principal iss1 = new X500Principal("O=First Org.");
diff --git a/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java b/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java
index 31faaaf..096bfee 100644
--- a/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java
+++ b/luni/src/test/java/tests/security/cert/X509CRLSelectorTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.io.IOException;
@@ -36,18 +31,11 @@
 
 import javax.security.auth.x500.X500Principal;
 
-@TestTargetClass(X509CRLSelector.class)
 public class X509CRLSelectorTest extends TestCase {
 
     /**
-     * @tests java.security.cert.X509CRLSelector#addIssuer(javax.security.auth.x500.X500Principal)
+     * java.security.cert.X509CRLSelector#addIssuer(javax.security.auth.x500.X500Principal)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "addIssuer",
-        args = {javax.security.auth.x500.X500Principal.class}
-    )
     public void test_addIssuerLjavax_security_auth_x500_X500Principal01()
             throws Exception {
         //Regression for HARMONY-465
@@ -61,14 +49,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CRLSelector#addIssuerName(java.lang.String)
+     * java.security.cert.X509CRLSelector#addIssuerName(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IOException.",
-        method = "addIssuerName",
-        args = {java.lang.String.class}
-    )
     public void test_addIssuerNameLjava_lang_String01() throws Exception {
         //Regression for HARMONY-465
         X509CRLSelector obj = new X509CRLSelector();
@@ -89,14 +71,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CRLSelector#addIssuerName(java.lang.String)
+     * java.security.cert.X509CRLSelector#addIssuerName(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "addIssuerName",
-        args = {java.lang.String.class}
-    )
     public void test_addIssuerNameLjava_lang_String02() throws IOException {
         // Regression for HARMONY-736
         X509CRLSelector selector = new X509CRLSelector();
@@ -107,14 +83,8 @@
 
 
     /**
-     * @tests java.security.cert.X509CRLSelector#addIssuerName(byte[])
+     * java.security.cert.X509CRLSelector#addIssuerName(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IOException.",
-        method = "addIssuerName",
-        args = {byte[].class}
-    )
     public void test_addIssuerName$B_3() throws Exception {
         //Regression for HARMONY-465
         X509CRLSelector obj = new X509CRLSelector();
@@ -127,14 +97,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CRLSelector#addIssuerName(byte[])
+     * java.security.cert.X509CRLSelector#addIssuerName(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "addIssuerName",
-        args = {byte[].class}
-    )
     public void test_addIssuerName$B_4() throws Exception {
         //Regression for HARMONY-465
         X509CRLSelector obj = new X509CRLSelector();
@@ -147,14 +111,8 @@
     }
 
     /**
-     * @tests setIssuerNames(Collection <?> names)
+     * setIssuerNames(Collection <?> names)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Regression test.",
-        method = "setIssuerNames",
-        args = {java.util.Collection.class}
-    )
     public void test_setIssuerNamesLjava_util_Collection01() throws IOException {
         // Regression for HARMONY-737
         X509CRLSelector selector = new X509CRLSelector();
diff --git a/luni/src/test/java/tests/security/cert/X509CRLTest.java b/luni/src/test/java/tests/security/cert/X509CRLTest.java
index a460b89..c0163f3 100644
--- a/luni/src/test/java/tests/security/cert/X509CRLTest.java
+++ b/luni/src/test/java/tests/security/cert/X509CRLTest.java
@@ -23,10 +23,6 @@
 package tests.security.cert;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -56,7 +52,6 @@
 import tests.security.cert.X509CRL2Test.MyX509CRL;
 /**
  */
-@TestTargetClass(X509CRL.class)
 public class X509CRLTest extends TestCase {
 
     private X509CRL tbt_crl;
@@ -188,12 +183,6 @@
      * getType() method testing. Tests that getType() method returns
      * the value "X.509"
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getType",
-        args = {}
-    )
     public void testGetType() {
         assertEquals("The type of X509CRL should be X.509",
                                             tbt_crl.getType(), "X.509");
@@ -204,12 +193,6 @@
      * operation: it should be reflexive, symmetric, transitive, consistent
      * and should be false on null object.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public void testEquals() {
         TBTCRL tbt_crl_1 = new TBTCRL() {
             public byte[] getEncoded() {
@@ -258,12 +241,6 @@
      * hashCode() method testing. Tests that for equal objects hash codes
      * are equal.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public void testHashCode() {
         TBTCRL tbt_crl_1 = new TBTCRL() {
             public byte[] getEncoded() {
@@ -275,14 +252,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CRL#getIssuerX500Principal()
+     * java.security.cert.X509CRL#getIssuerX500Principal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIssuerX500Principal",
-        args = {}
-    )
     public void testGetIssuerX500Principal() {
         // return valid encoding
         TBTCRL crl = new TBTCRL() {
@@ -299,12 +270,6 @@
      * Check if the default implementation throws NullPointerException
      * on null input data.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getRevokedCertificate",
-        args = {java.security.cert.X509Certificate.class}
-    )
     @AndroidOnly("Test filed on RI: getRevokedCertificate throws " +
             "RuntimeException.")
     public void testGetRevokedCertificate() {
@@ -325,92 +290,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getEncoded",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getIssuerDN",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getNextUpdate",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getRevokedCertificate",
-            args = {java.math.BigInteger.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getRevokedCertificates",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSigAlgName",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSigAlgOID",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSigAlgParams",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSignature",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getTBSCertList",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getThisUpdate",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getVersion",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "verify",
-            args = {java.security.PublicKey.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "verify",
-            args = {java.security.PublicKey.class, java.lang.String.class}
-        )
-    })
     public void testAbstractMethods() {
         TBTCRL crl = new TBTCRL() {
             public byte[] getEncoded() {
@@ -439,12 +318,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509CRL",
-        args = {}
-    )
     public void testX509CRL() {
         try {
             TBTCRL crl = new TBTCRL();
diff --git a/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java b/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java
index 383b578..438bef9 100644
--- a/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java
+++ b/luni/src/test/java/tests/security/cert/X509CertSelectorTest.java
@@ -17,10 +17,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.io.ByteArrayInputStream;
@@ -83,7 +79,6 @@
 /**
  * X509CertSelectorTest
  */
-@TestTargetClass(X509CertSelector.class)
 public class X509CertSelectorTest extends TestCase {
 
     byte[][] constraintBytes = new byte[][] {
@@ -128,14 +123,8 @@
                     1, -128, 1, 0}};
 
     /**
-     * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[])
+     * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "IOException checking missed",
-        method = "addSubjectAlternativeName",
-        args = {int.class, byte[].class}
-    )
     public void test_addSubjectAlternativeNameLintLbyte_array() throws IOException {
         // Regression for HARMONY-2487
         int[] types = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
@@ -150,14 +139,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String)
+     * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies IOException.",
-        method = "addSubjectAlternativeName",
-        args = {int.class, java.lang.String.class}
-    )
     public void test_addSubjectAlternativeNameLintLjava_lang_String() {
         // Regression for HARMONY-727
         int[] types = { 0, 2, 3, 4, 5, 6, 7, 8 };
@@ -172,14 +155,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#addPathToName(int, byte[])
+     * java.security.cert.X509CertSelector#addPathToName(int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies NullPointerException.",
-        method = "addPathToName",
-        args = {int.class, byte[].class}
-    )
     public void test_addPathToNameLintLbyte_array() throws IOException {
         // Regression for HARMONY-2487
         int[] types = { 0, 1, 2, 3, 4, 5, 6, 7, 8 };
@@ -193,14 +170,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#addPathToName(int, String)
+     * java.security.cert.X509CertSelector#addPathToName(int, String)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies IOException.",
-        method = "addPathToName",
-        args = {int.class, java.lang.String.class}
-    )
     public void test_addPathToNameLintLjava_lang_String() {
         // Regression for HARMONY-724
         for (int type = 0; type <= 8; type++) {
@@ -216,14 +187,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#X509CertSelector()
+     * java.security.cert.X509CertSelector#X509CertSelector()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509CertSelector",
-        args = {}
-    )
     public void test_X509CertSelector() {
         X509CertSelector selector = null;
         try {
@@ -236,14 +201,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#clone()
+     * java.security.cert.X509CertSelector#clone()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "clone",
-        args = {}
-    )
     public void test_clone() throws Exception {
         X509CertSelector selector = new X509CertSelector();
         X509CertSelector selector1 = (X509CertSelector) selector.clone();
@@ -295,14 +254,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getAuthorityKeyIdentifier()
+     * java.security.cert.X509CertSelector#getAuthorityKeyIdentifier()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getAuthorityKeyIdentifier",
-        args = {}
-    )
     public void test_getAuthorityKeyIdentifier() {
         byte[] akid1 = new byte[] { 4, 5, 1, 2, 3, 4, 5 }; // random value
         byte[] akid2 = new byte[] { 4, 5, 5, 4, 3, 2, 1 }; // random value
@@ -320,14 +273,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getBasicConstraints()
+     * java.security.cert.X509CertSelector#getBasicConstraints()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getBasicConstraints",
-        args = {}
-    )
     public void test_getBasicConstraints() {
         X509CertSelector selector = new X509CertSelector();
         int[] validValues = { 2, 1, 0, 1, 2, 3, 10, 20 };
@@ -338,14 +285,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getCertificate()
+     * java.security.cert.X509CertSelector#getCertificate()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertificate",
-        args = {}
-    )
     public void test_getCertificate() throws CertificateException {
         X509CertSelector selector = new X509CertSelector();
         CertificateFactory certFact = CertificateFactory.getInstance("X509");
@@ -368,14 +309,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getCertificateValid()
+     * java.security.cert.X509CertSelector#getCertificateValid()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCertificateValid",
-        args = {}
-    )
     public void test_getCertificateValid() {
         Date date1 = new Date(100);
         Date date2 = new Date(200);
@@ -400,14 +335,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getExtendedKeyUsage()
+     * java.security.cert.X509CertSelector#getExtendedKeyUsage()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getExtendedKeyUsage",
-        args = {}
-    )
     public void test_getExtendedKeyUsage() {
         HashSet<String> ku = new HashSet<String>(Arrays
                 .asList(new String[] { "1.3.6.1.5.5.7.3.1",
@@ -436,14 +365,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getIssuer()
+     * java.security.cert.X509CertSelector#getIssuer()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIssuer",
-        args = {}
-    )
     public void test_getIssuer() {
         X500Principal iss1 = new X500Principal("O=First Org.");
         X500Principal iss2 = new X500Principal("O=Second Org.");
@@ -458,14 +381,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getIssuerAsBytes()
+     * java.security.cert.X509CertSelector#getIssuerAsBytes()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIssuerAsBytes",
-        args = {}
-    )
     public void test_getIssuerAsBytes() {
         byte[] name1 = new byte[]
         // manually obtained DER encoding of "O=First Org." issuer name;
@@ -497,14 +414,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getIssuerAsString()
+     * java.security.cert.X509CertSelector#getIssuerAsString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIssuerAsString",
-        args = {}
-    )
     public void test_getIssuerAsString() {
         String name1 = "O=First Org.";
         String name2 = "O=Second Org.";
@@ -524,14 +435,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getKeyUsage()
+     * java.security.cert.X509CertSelector#getKeyUsage()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKeyUsage",
-        args = {}
-    )
     public void test_getKeyUsage() {
         boolean[] ku = new boolean[] { true, false, true, false, true, false,
                 true, false, true };
@@ -548,14 +453,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getMatchAllSubjectAltNames()
+     * java.security.cert.X509CertSelector#getMatchAllSubjectAltNames()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getMatchAllSubjectAltNames",
-        args = {}
-    )
     public void test_getMatchAllSubjectAltNames() {
         X509CertSelector selector = new X509CertSelector();
         assertTrue("The matchAllNames initially should be true", selector
@@ -566,14 +465,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getNameConstraints()
+     * java.security.cert.X509CertSelector#getNameConstraints()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getNameConstraints",
-        args = {}
-    )
     public void test_getNameConstraints() throws IOException {
 
 // Used to generate following byte array
@@ -612,14 +505,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getPathToNames()
+     * java.security.cert.X509CertSelector#getPathToNames()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPathToNames",
-        args = {}
-    )
     public void test_getPathToNames() {
         try {
             GeneralName san0 = new GeneralName(new OtherName("1.2.3.4.5",
@@ -658,16 +545,7 @@
             Collection<List<?>> sans = sans1.getPairsList();
 
             selector.setPathToNames(sans);
-
-            Collection<List<?>> col = selector.getPathToNames();
-            Iterator<List<?>> i = col.iterator();
-            while (i.hasNext()) {
-                Object o = i.next();
-                if (!(o instanceof List)) {
-                    fail("expected a List");
-                }
-            }
-
+            selector.getPathToNames();
         } catch (IOException e) {
             e.printStackTrace();
             fail("Unexpected IOException was thrown.");
@@ -675,14 +553,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getPolicy()
+     * java.security.cert.X509CertSelector#getPolicy()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPolicy",
-        args = {}
-    )
     public void test_getPolicy() throws IOException {
         String[] policies1 = new String[] { "1.3.6.1.5.5.7.3.1",
                 "1.3.6.1.5.5.7.3.2", "1.3.6.1.5.5.7.3.3", "1.3.6.1.5.5.7.3.4",
@@ -707,14 +579,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getPrivateKeyValid()
+     * java.security.cert.X509CertSelector#getPrivateKeyValid()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrivateKeyValid",
-        args = {}
-    )
     public void test_getPrivateKeyValid() {
         Date date1 = new Date(100);
         Date date2 = new Date(200);
@@ -732,14 +598,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSerialNumber()
+     * java.security.cert.X509CertSelector#getSerialNumber()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSerialNumber",
-        args = {}
-    )
     public void test_getSerialNumber() {
         BigInteger ser1 = new BigInteger("10000");
         BigInteger ser2 = new BigInteger("10001");
@@ -754,14 +614,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSubject()
+     * java.security.cert.X509CertSelector#getSubject()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubject",
-        args = {}
-    )
     public void test_getSubject() {
         X500Principal sub1 = new X500Principal("O=First Org.");
         X500Principal sub2 = new X500Principal("O=Second Org.");
@@ -776,14 +630,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSubjectAlternativeNames()
+     * java.security.cert.X509CertSelector#getSubjectAlternativeNames()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectAlternativeNames",
-        args = {}
-    )
     public void test_getSubjectAlternativeNames() {
         try {
             GeneralName san1 = new GeneralName(1, "rfc@822.Name");
@@ -813,14 +661,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSubjectAsBytes()
+     * java.security.cert.X509CertSelector#getSubjectAsBytes()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectAsBytes",
-        args = {}
-    )
     public void test_getSubjectAsBytes() {
         byte[] name1 = new byte[]
         // manually obtained DER encoding of "O=First Org." issuer name;
@@ -852,14 +694,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSubjectAsString()
+     * java.security.cert.X509CertSelector#getSubjectAsString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectAsString",
-        args = {}
-    )
     public void test_getSubjectAsString() {
         String name1 = "O=First Org.";
         String name2 = "O=Second Org.";
@@ -879,14 +715,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSubjectKeyIdentifier()
+     * java.security.cert.X509CertSelector#getSubjectKeyIdentifier()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectKeyIdentifier",
-        args = {}
-    )
     public void test_getSubjectKeyIdentifier() {
         byte[] skid1 = new byte[] { 1, 2, 3, 4, 5 }; // random value
         byte[] skid2 = new byte[] { 4, 5, 5, 4, 3, 2, 1 }; // random value
@@ -905,14 +735,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSubjectPublicKey()
+     * java.security.cert.X509CertSelector#getSubjectPublicKey()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectPublicKey",
-        args = {}
-    )
     public void test_getSubjectPublicKey() throws Exception {
 
         // SubjectPublicKeyInfo ::= SEQUENCE {
@@ -943,14 +767,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#getSubjectPublicKeyAlgID()
+     * java.security.cert.X509CertSelector#getSubjectPublicKeyAlgID()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectPublicKeyAlgID",
-        args = {}
-    )
     public void test_getSubjectPublicKeyAlgID() {
 
         X509CertSelector selector = new X509CertSelector();
@@ -985,14 +803,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#match(java.security.cert.Certificate)
+     * java.security.cert.X509CertSelector#match(java.security.cert.Certificate)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "match",
-        args = {java.security.cert.Certificate.class}
-    )
     public void test_matchLjava_security_cert_Certificate()
             throws CertificateException {
         X509CertSelector selector = new X509CertSelector();
@@ -1017,14 +829,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setAuthorityKeyIdentifier(byte[])
+     * java.security.cert.X509CertSelector#setAuthorityKeyIdentifier(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setAuthorityKeyIdentifier",
-        args = {byte[].class}
-    )
     public void test_setAuthorityKeyIdentifierLB$() throws CertificateException {
         X509CertSelector selector = new X509CertSelector();
 
@@ -1057,14 +863,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setBasicConstraints(int)
+     * java.security.cert.X509CertSelector#setBasicConstraints(int)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setBasicConstraints",
-        args = {int.class}
-    )
     public void test_setBasicConstraintsLint() {
         X509CertSelector selector = new X509CertSelector();
         int[] invalidValues = { -3, -4, -5, 1000000000 };
@@ -1085,14 +885,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setCertificate(java.security.cert.Certificate)
+     * java.security.cert.X509CertSelector#setCertificate(java.security.cert.Certificate)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setCertificate",
-        args = {java.security.cert.X509Certificate.class}
-    )
     public void test_setCertificateLjava_security_cert_X509Certificate()
             throws CertificateException {
 
@@ -1117,14 +911,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setCertificateValid(java.util.Date)
+     * java.security.cert.X509CertSelector#setCertificateValid(java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setCertificateValid",
-        args = {java.util.Date.class}
-    )
     public void test_setCertificateValidLjava_util_Date()
             throws CertificateException {
         X509CertSelector selector = new X509CertSelector();
@@ -1148,14 +936,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setExtendedKeyUsage(Set<String>)
+     * java.security.cert.X509CertSelector#setExtendedKeyUsage(Set<String>)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setExtendedKeyUsage",
-        args = {java.util.Set.class}
-    )
     public void test_setExtendedKeyUsageLjava_util_Set()
             throws CertificateException {
         HashSet<String> ku1 = new HashSet<String>(Arrays
@@ -1197,14 +979,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setIssuer(byte[])
+     * java.security.cert.X509CertSelector#setIssuer(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIssuer",
-        args = {byte[].class}
-    )
     public void test_setIssuerLB$() throws CertificateException {
         byte[] name1 = new byte[]
         // manually obtained DER encoding of "O=First Org." issuer name;
@@ -1248,14 +1024,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setIssuer(java.lang.String)
+     * java.security.cert.X509CertSelector#setIssuer(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIssuer",
-        args = {java.lang.String.class}
-    )
     public void test_setIssuerLjava_lang_String() throws CertificateException {
 
         String name1 = "O=First Org.";
@@ -1294,14 +1064,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setIssuer(javax.security.auth.x500.X500Principal)
+     * java.security.cert.X509CertSelector#setIssuer(javax.security.auth.x500.X500Principal)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setIssuer",
-        args = {javax.security.auth.x500.X500Principal.class}
-    )
     public void test_setIssuerLjavax_security_auth_x500_X500Principal()
             throws CertificateException {
         X500Principal iss1 = new X500Principal("O=First Org.");
@@ -1325,14 +1089,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setKeyUsage(boolean)
+     * java.security.cert.X509CertSelector#setKeyUsage(boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setKeyUsage",
-        args = {boolean[].class}
-    )
     public void test_setKeyUsageZ() throws CertificateException {
         boolean[] ku1 = new boolean[] { true, true, true, true, true, true,
                 true, true, true };
@@ -1364,14 +1122,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setMatchAllSubjectAltNames(boolean)
+     * java.security.cert.X509CertSelector#setMatchAllSubjectAltNames(boolean)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setMatchAllSubjectAltNames",
-        args = {boolean.class}
-    )
     public void test_setMatchAllSubjectAltNamesZ() {
         TestCert cert = new TestCert();
         X509CertSelector selector = new X509CertSelector();
@@ -1382,15 +1134,9 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setNameConstraints(byte[]
+     * java.security.cert.X509CertSelector#setNameConstraints(byte[]
      *        bytes)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setNameConstraints",
-        args = {byte[].class}
-    )
     public void test_setNameConstraintsLB$() throws IOException {
 //        GeneralName[] name_constraints = new GeneralName[] {
 //                new GeneralName(1, "822.Name"),
@@ -1422,14 +1168,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setPathToNames(Collection<List<?>>)
+     * java.security.cert.X509CertSelector#setPathToNames(Collection<List<?>>)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setPathToNames",
-        args = {java.util.Collection.class}
-    )
     public void test_setPathToNamesLjava_util_Collection() {
         try {
             GeneralName san0 = new GeneralName(new OtherName("1.2.3.4.5",
@@ -1468,16 +1208,7 @@
             Collection<List<?>> sans = sans1.getPairsList();
 
             selector.setPathToNames(sans);
-
-            Collection<List<?>> col = selector.getPathToNames();
-            Iterator<List<?>> i = col.iterator();
-            while (i.hasNext()) {
-                Object o = i.next();
-                if (!(o instanceof List)) {
-                    fail("expected a List");
-                }
-            }
-
+            selector.getPathToNames();
         } catch (IOException e) {
             e.printStackTrace();
             fail("Unexpected IOException was thrown.");
@@ -1485,14 +1216,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setPolicy(Set<String>)
+     * java.security.cert.X509CertSelector#setPolicy(Set<String>)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setPolicy",
-        args = {java.util.Set.class}
-    )
     public void test_setPolicyLjava_util_Set() throws IOException {
         String[] policies1 = new String[] { "1.3.6.1.5.5.7.3.1",
                 "1.3.6.1.5.5.7.3.2", "1.3.6.1.5.5.7.3.3", "1.3.6.1.5.5.7.3.4",
@@ -1528,14 +1253,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setPrivateKeyValid(java.util.Date)
+     * java.security.cert.X509CertSelector#setPrivateKeyValid(java.util.Date)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setPrivateKeyValid",
-        args = {java.util.Date.class}
-    )
     public void test_setPrivateKeyValidLjava_util_Date()
             throws CertificateException {
         Date date1 = new Date(100000000);
@@ -1564,14 +1283,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSerialNumber(java.math.BigInteger)
+     * java.security.cert.X509CertSelector#setSerialNumber(java.math.BigInteger)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSerialNumber",
-        args = {java.math.BigInteger.class}
-    )
     public void test_setSerialNumberLjava_math_BigInteger()
             throws CertificateException {
         BigInteger ser1 = new BigInteger("10000");
@@ -1595,14 +1308,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubject(byte[])
+     * java.security.cert.X509CertSelector#setSubject(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubject",
-        args = {byte[].class}
-    )
     public void test_setSubjectLB$() throws CertificateException {
         byte[] name1 = new byte[]
         // manually obtained DER encoding of "O=First Org." issuer name;
@@ -1646,14 +1353,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubject(java.lang.String)
+     * java.security.cert.X509CertSelector#setSubject(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubject",
-        args = {java.lang.String.class}
-    )
     public void test_setSubjectLjava_lang_String() throws CertificateException {
         String name1 = "O=First Org.";
         String name2 = "O=Second Org.";
@@ -1691,14 +1392,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubject(javax.security.auth.x500.X500Principal)
+     * java.security.cert.X509CertSelector#setSubject(javax.security.auth.x500.X500Principal)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubject",
-        args = {javax.security.auth.x500.X500Principal.class}
-    )
     public void test_setSubjectLjavax_security_auth_x500_X500Principal()
             throws CertificateException {
         X500Principal sub1 = new X500Principal("O=First Org.");
@@ -1723,14 +1418,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubjectAlternativeNames(Collection<List<?>>)
+     * java.security.cert.X509CertSelector#setSubjectAlternativeNames(Collection<List<?>>)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubjectAlternativeNames",
-        args = {java.util.Collection.class}
-    )
     public void test_setSubjectAlternativeNamesLjava_util_Collection() {
 
         try {
@@ -1771,15 +1460,7 @@
 
             selector.setSubjectAlternativeNames(sans);
 
-            Collection<List<?>> col = selector.getSubjectAlternativeNames();
-            Iterator<List<?>> i = col.iterator();
-            while (i.hasNext()) {
-                Object o = i.next();
-                if (!(o instanceof List)) {
-                    fail("expected a List");
-                }
-            }
-
+            selector.getSubjectAlternativeNames();
         } catch (IOException e) {
             e.printStackTrace();
             fail("Unexpected IOException was thrown.");
@@ -1787,14 +1468,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubjectKeyIdentifier(byte[])
+     * java.security.cert.X509CertSelector#setSubjectKeyIdentifier(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubjectKeyIdentifier",
-        args = {byte[].class}
-    )
     public void test_setSubjectKeyIdentifierLB$() throws CertificateException {
         byte[] skid1 = new byte[] { 1, 2, 3, 4, 5 }; // random value
         byte[] skid2 = new byte[] { 5, 4, 3, 2, 1 }; // random value
@@ -1818,14 +1493,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubjectPublicKey(byte[])
+     * java.security.cert.X509CertSelector#setSubjectPublicKey(byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubjectPublicKey",
-        args = {byte[].class}
-    )
     public void test_setSubjectPublicKeyLB$() throws Exception {
 
         //SubjectPublicKeyInfo  ::=  SEQUENCE  {
@@ -1849,14 +1518,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubjectPublicKey(java.security.PublicKey key)
+     * java.security.cert.X509CertSelector#setSubjectPublicKey(java.security.PublicKey key)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubjectPublicKey",
-        args = {java.security.PublicKey.class}
-    )
     public void test_setSubjectPublicKeyLjava_security_PublicKey()
             throws CertificateException {
         PublicKey pkey1 = null;
@@ -1887,14 +1550,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#setSubjectPublicKeyAlgID(java.lang.String)
+     * java.security.cert.X509CertSelector#setSubjectPublicKeyAlgID(java.lang.String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "setSubjectPublicKeyAlgID",
-        args = {java.lang.String.class}
-    )
     public void test_setSubjectPublicKeyAlgIDLjava_lang_String()
             throws CertificateException {
 
@@ -1967,14 +1624,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#toString()
+     * java.security.cert.X509CertSelector#toString()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() {
         X509CertSelector selector = new X509CertSelector();
         assertNotNull(selector.toString());
@@ -2437,14 +2088,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#addPathToName(int, byte[])
+     * java.security.cert.X509CertSelector#addPathToName(int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies Exception",
-        method = "addPathToName",
-        args = {int.class, byte[].class}
-    )
     public void test_addPathToNameLintLbyte_array2() throws Exception {
         TestUtils.initCertPathSSCertChain();
         setupEnvironment();
@@ -2480,14 +2125,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#addPathToName(int, String)
+     * java.security.cert.X509CertSelector#addPathToName(int, String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Verifies IOException.",
-        method = "addPathToName",
-        args = {int.class, java.lang.String.class}
-    )
     public void test_addPathToNameLintLjava_lang_String2() throws Exception {
         setupEnvironment();
         byte[] bytes, bytesName;
@@ -2523,14 +2162,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[])
+     * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, byte[])
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "IOException checking missed",
-        method = "addSubjectAlternativeName",
-        args = {int.class, byte[].class}
-    )
     public void test_addSubjectAlternativeNameLintLbyte_array2()
             throws Exception {
 
@@ -2572,14 +2205,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String)
+     * java.security.cert.X509CertSelector#addSubjectAlternativeName(int, String)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "addSubjectAlternativeName",
-        args = {int.class, java.lang.String.class}
-    )
     public void test_addSubjectAlternativeNameLintLjava_lang_String2() throws Exception{
         GeneralName san6 = new GeneralName(6, "http://uniform.Resource.Id");
         GeneralName san2 = new GeneralName(2, "dNSName");
diff --git a/luni/src/test/java/tests/security/cert/X509Certificate2Test.java b/luni/src/test/java/tests/security/cert/X509Certificate2Test.java
index d8e7100..5578234 100644
--- a/luni/src/test/java/tests/security/cert/X509Certificate2Test.java
+++ b/luni/src/test/java/tests/security/cert/X509Certificate2Test.java
@@ -17,11 +17,6 @@
 
 package tests.security.cert;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
-
 import org.apache.harmony.security.tests.support.cert.TestUtils;
 
 import java.io.ByteArrayInputStream;
@@ -41,18 +36,11 @@
 
 import javax.security.auth.x500.X500Principal;
 
-@TestTargetClass(X509Certificate.class)
 public class X509Certificate2Test extends junit.framework.TestCase {
 
     /**
      * Test for X.509 Certificate provider
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "toString",
-        args = {}
-    )
     public void test_toString() throws Exception {
 
         // Regression for HARMONY-3384
@@ -70,14 +58,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509Certificate#X509Certificate()
+     * java.security.cert.X509Certificate#X509Certificate()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509Certificate",
-        args = {}
-    )
     public void test_X509Certificate() {
         MyX509Certificate s = null;
         try {
@@ -88,110 +70,6 @@
         assertEquals("X.509", s.getType());
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "checkValidity",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "checkValidity",
-            args = {java.util.Date.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getBasicConstraints",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getIssuerDN",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getIssuerUniqueID",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getKeyUsage",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getNotAfter",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getNotBefore",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSerialNumber",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSigAlgName",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSigAlgOID",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSigAlgParams",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSignature",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSubjectDN",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getSubjectUniqueID",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getTBSCertificate",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getVersion",
-            args = {}
-        )
-    })
     public void testAbstractMethods() {
         MyX509Certificate s = new MyX509Certificate();
         try {
@@ -395,27 +273,15 @@
     }
 
     /**
-     * @tests java.security.cert.X509Certificate#getType()
+     * java.security.cert.X509Certificate#getType()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getType",
-        args = {}
-    )
     public void testGetType() {
         assertEquals("X.509", new MyX509Certificate().getType());
     }
 
     /**
-     * @tests java.security.cert.X509Certificate#getIssuerX500Principal()
+     * java.security.cert.X509Certificate#getIssuerX500Principal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getIssuerX500Principal",
-        args = {}
-    )
     public void testGetIssuerX500Principal() {
         // return valid encoding
         MyX509Certificate cert = new MyX509Certificate() {
@@ -430,14 +296,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509Certificate#getSubjectX500Principal()
+     * java.security.cert.X509Certificate#getSubjectX500Principal()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getSubjectX500Principal",
-        args = {}
-    )
     public void testGetSubjectX500Principal() {
         // return valid encoding
         MyX509Certificate cert = new MyX509Certificate() {
@@ -453,14 +313,8 @@
 
     /**
      * @throws CertificateException
-     * @tests java.security.cert.X509Certificate#getExtendedKeyUsage()
+     * java.security.cert.X509Certificate#getExtendedKeyUsage()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Doesn't verify CertificateParsingException.",
-        method = "getExtendedKeyUsage",
-        args = {}
-    )
     public void testGetExtendedKeyUsage() throws CertificateException {
         assertNull(new MyX509Certificate().getExtendedKeyUsage());
 
@@ -490,14 +344,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509Certificate#getSubjectAlternativeNames()
+     * java.security.cert.X509Certificate#getSubjectAlternativeNames()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "",
-        method = "getSubjectAlternativeNames",
-        args = {}
-    )
     public void testGetSubjectAlternativeNames()
             throws CertificateParsingException {
 
@@ -526,14 +374,8 @@
     }
 
     /**
-     * @tests java.security.cert.X509Certificate#getIssuerAlternativeNames()
+     * java.security.cert.X509Certificate#getIssuerAlternativeNames()
      */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Doesn't verify CertificateParsingException.",
-        method = "getIssuerAlternativeNames",
-        args = {}
-    )
     public void testGetIssuerAlternativeNames()
             throws CertificateParsingException {
 
@@ -560,13 +402,6 @@
         assertTrue(coll.size() < 10);
     }
 
-    @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "",
-            clazz = CertificateException.class,
-            method = "CertificateException",
-            args = {}
-        )
     public void testCerficateException() {
         try {
             CertificateFactory cf = CertificateFactory.getInstance("X.509");
diff --git a/luni/src/test/java/tests/security/interfaces/AllTests.java b/luni/src/test/java/tests/security/interfaces/AllTests.java
deleted file mode 100644
index e180408..0000000
--- a/luni/src/test/java/tests/security/interfaces/AllTests.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.security.interfaces;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.security.interfaces;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.security.interfaces;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(DSAKeyTest.class);
-        suite.addTestSuite(DSAParamsTest.class);
-        suite.addTestSuite(DSAKeyPairGeneratorTest.class);
-        suite.addTestSuite(RSAMultiPrimePrivateCrtKeyTest.class);
-        suite.addTestSuite(DSAPrivateKeyTest.class);
-        suite.addTestSuite(DSAPublicKeyTest.class);
-        suite.addTestSuite(RSAKeyTest.class);
-        suite.addTestSuite(RSAPrivateCrtKeyTest.class);
-        suite.addTestSuite(RSAPrivateKeyTest.class);
-        suite.addTestSuite(RSAPublicKeyTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java b/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java
index 0f1df05..0e2fefe 100644
--- a/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java
+++ b/luni/src/test/java/tests/security/interfaces/DSAKeyPairGeneratorTest.java
@@ -16,10 +16,6 @@
 
 package tests.security.interfaces;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -31,7 +27,6 @@
 
 import org.apache.harmony.security.tests.support.interfaces.DSAKeyPairGeneratorImpl;
 
-@TestTargetClass(DSAKeyPairGenerator.class)
 public class DSAKeyPairGeneratorTest extends TestCase {
 
     private final BigInteger p = new BigInteger("4");
@@ -46,15 +41,9 @@
     }
 
     /**
-     * @tests java.security.interfaces.DSAKeyPairGenerator
+     * java.security.interfaces.DSAKeyPairGenerator
      * #initialize(DSAParams params, SecureRandom random)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "initialize",
-        args = {java.security.interfaces.DSAParams.class, java.security.SecureRandom.class}
-    )
     public void test_DSAKeyPairGenerator01() {
         DSAParams dsaParams = new DSAParameterSpec(p, q, g);
         SecureRandom random = null;
@@ -90,15 +79,9 @@
     }
 
     /**
-     * @tests java.security.interfaces.DSAKeyPairGenerator
+     * java.security.interfaces.DSAKeyPairGenerator
      * #initialize(int modlen, boolean genParams, SecureRandom randomm)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "initialize",
-        args = {int.class, boolean.class, java.security.SecureRandom.class}
-    )
     public void test_DSAKeyPairGenerator02() {
         int[] invalidLen = {-1, 0, 511, 513, 650, 1023, 1025};
         DSAParams dsaParams = new DSAParameterSpec(p, q, g);
diff --git a/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java b/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java
index a8aa78a..a53cddb 100644
--- a/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/DSAKeyTest.java
@@ -15,9 +15,6 @@
  */
 
 package tests.security.interfaces;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -26,22 +23,15 @@
 import java.security.interfaces.DSAParams;
 import java.security.spec.DSAParameterSpec;
 
-@TestTargetClass(DSAKey.class)
 public class DSAKeyTest extends TestCase {
 
     /**
-     * @tests java.security.interfaces.DSAKey
+     * java.security.interfaces.DSAKey
      * #getParams()
      * test covers following use cases
      *   Case 1: check private key
      *   Case 2: check public key
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParams",
-        args = {}
-    )
     public void test_getParams() throws Exception {
         DSAParams param = new DSAParameterSpec(Util.P, Util.Q, Util.G);
 
diff --git a/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java b/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java
index 686d0f2..d07d5cd 100644
--- a/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java
+++ b/luni/src/test/java/tests/security/interfaces/DSAParamsTest.java
@@ -14,9 +14,6 @@
  * limitations under the License.
  */
 package tests.security.interfaces;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -24,7 +21,6 @@
 import java.security.interfaces.DSAParams;
 import java.security.spec.DSAParameterSpec;
 
-@TestTargetClass(DSAParams.class)
 public class DSAParamsTest extends TestCase {
 
     private final BigInteger p = new BigInteger("4");
@@ -32,45 +28,27 @@
     private final BigInteger g = BigInteger.ZERO;
 
     /**
-     * @tests java.security.interfaces.DSAParams
+     * java.security.interfaces.DSAParams
      * #getG()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getG",
-        args = {}
-    )
     public void test_getG() {
         DSAParams params = new DSAParameterSpec(p, q, g);
         assertEquals("Invalid G", g, params.getG());
     }
 
     /**
-     * @tests java.security.interfaces.DSAParams
+     * java.security.interfaces.DSAParams
      * #getP()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getP",
-        args = {}
-    )
     public void test_getP() {
         DSAParams params = new DSAParameterSpec(p, q, g);
         assertEquals("Invalid P", p, params.getP());
     }
 
     /**
-     * @tests java.security.interfaces.DSAParams
+     * java.security.interfaces.DSAParams
      * #getQ()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getQ",
-        args = {}
-    )
     public void test_getQ() {
         DSAParams params = new DSAParameterSpec(p, q, g);
         assertEquals("Invalid Q", q, params.getQ());
diff --git a/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java b/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java
index c08d5af..6cebda5 100644
--- a/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/DSAPrivateKeyTest.java
@@ -14,10 +14,6 @@
  * limitations under the License.
  */
 package tests.security.interfaces;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.BrokenTest;
 
 import junit.framework.TestCase;
 
@@ -28,19 +24,12 @@
 import java.security.interfaces.DSAPublicKey;
 import java.security.spec.DSAParameterSpec;
 
-@TestTargetClass(DSAPrivateKey.class)
 public class DSAPrivateKeyTest extends TestCase {
 
     /**
-     * @tests java.security.interfaces.DSAPrivateKey
+     * java.security.interfaces.DSAPrivateKey
      * #getX()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getX",
-        args = {}
-    )
     public void test_getX() throws Exception {
         KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA");
         keyGen.initialize(new DSAParameterSpec(Util.P, Util.Q, Util.G),
diff --git a/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java b/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java
index 533ead5..9fe4910 100644
--- a/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/DSAPublicKeyTest.java
@@ -14,10 +14,6 @@
  * limitations under the License.
  */
 package tests.security.interfaces;
-import dalvik.annotation.BrokenTest;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -28,23 +24,16 @@
 import java.security.interfaces.DSAPublicKey;
 import java.security.spec.DSAParameterSpec;
 
-@TestTargetClass(DSAPublicKey.class)
 public class DSAPublicKeyTest extends TestCase {
 
     /**
-     * @tests java.security.interfaces.DSAPublicKey
+     * java.security.interfaces.DSAPublicKey
      * #getY()
      * test covers following use cases
      *   Case 1: check with predefined p, q, g, x
      *   Case 2: check with random p, q, g, x. It takes some time (up to
      *           minute)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getY",
-        args = {}
-    )
     public void test_getY() throws Exception {
         KeyPairGenerator keyGen = null;
         KeyPair keys = null;
diff --git a/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java
index 63c4df4..9f2830d 100644
--- a/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/RSAKeyTest.java
@@ -14,9 +14,6 @@
  * limitations under the License.
  */
 package tests.security.interfaces;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -26,22 +23,15 @@
 import java.security.spec.RSAPrivateKeySpec;
 import java.security.spec.RSAPublicKeySpec;
 
-@TestTargetClass(RSAKey.class)
 public class RSAKeyTest extends TestCase {
 
     /**
-     * @tests java.security.interfaces.RSAKey
+     * java.security.interfaces.RSAKey
      * #getModulus()
      * test covers following use cases
      *   Case 1: check private key
      *   Case 2: check public key
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModulus",
-        args = {}
-    )
     public void test_getModulus() throws Exception {
         KeyFactory gen = KeyFactory.getInstance("RSA");
         final BigInteger n = BigInteger.valueOf(3233);
diff --git a/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java
index 86d4ae5..dca8de7 100644
--- a/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/RSAMultiPrimePrivateCrtKeyTest.java
@@ -16,11 +16,6 @@
 
 package tests.security.interfaces;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -29,7 +24,6 @@
 
 import org.apache.harmony.security.tests.support.interfaces.RSAMultiPrimePrivateCrtKeyImpl;
 
-@TestTargetClass(RSAMultiPrimePrivateCrtKey.class)
 public class RSAMultiPrimePrivateCrtKeyTest extends TestCase {
 
     /**
@@ -61,51 +55,13 @@
     }
 
     /**
-     * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getCrtCoefficient()
-     * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentP()
-     * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentQ()
-     * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeP()
-     * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeQ()
-     * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPublicExponent()
+     * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getCrtCoefficient()
+     * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentP()
+     * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeExponentQ()
+     * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeP()
+     * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPrimeQ()
+     * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getPublicExponent()
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getCrtCoefficient",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPrimeExponentP",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPrimeExponentQ",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPrimeP",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPrimeQ",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "",
-            method = "getPublicExponent",
-            args = {}
-        )
-    })
     public void test_RSAMultiPrimePrivateCrtKey() {
         RSAMulti rsam = new RSAMulti(publicExponent, primeExponentP, primeExponentQ,
                                      primeP, primeQ, crtCoefficient, opi);
@@ -122,14 +78,8 @@
     }
 
     /**
-     * @tests java.security.interfaces.RSAMultiPrimePrivateCrtKey#getOtherPrimeInfo()
+     * java.security.interfaces.RSAMultiPrimePrivateCrtKey#getOtherPrimeInfo()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getOtherPrimeInfo",
-        args = {}
-    )
     public void test_getOtherPrimeInfo() {
         RSAMulti rsam = new RSAMulti(publicExponent, primeExponentP, primeExponentQ,
                                      primeP, primeQ, crtCoefficient, null);
@@ -147,4 +97,4 @@
             fail("Unexpected exception: " + e);
         }
     }
-}
\ No newline at end of file
+}
diff --git a/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java
index 8d0ef80..d0c794c 100644
--- a/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/RSAPrivateCrtKeyTest.java
@@ -14,16 +14,12 @@
  * limitations under the License.
  */
 package tests.security.interfaces;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
 import java.security.KeyFactory;
 import java.security.interfaces.RSAPrivateCrtKey;
 
-@TestTargetClass(RSAPrivateCrtKey.class)
 public class RSAPrivateCrtKeyTest extends TestCase {
 
     RSAPrivateCrtKey key = null;
@@ -35,90 +31,54 @@
     }
 
     /**
-     * @tests java.security.interfaces.RSAPrivateCrtKey
+     * java.security.interfaces.RSAPrivateCrtKey
      * #getCrtCoefficient()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCrtCoefficient",
-        args = {}
-    )
     public void test_getCrtCoefficient() {
         assertEquals("invalid CRT coefficient",
                 Util.rsaCrtParam.getCrtCoefficient(), key.getCrtCoefficient());
     }
 
     /**
-     * @tests java.security.interfaces.RSAPrivateCrtKey
+     * java.security.interfaces.RSAPrivateCrtKey
      * #getPrimeExponentP()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeExponentP",
-        args = {}
-    )
     public void test_getPrimeExponentP() {
         assertEquals("invalid prime exponent P",
                 Util.rsaCrtParam.getPrimeExponentP(), key.getPrimeExponentP());
     }
 
     /**
-     * @tests java.security.interfaces.RSAPrivateCrtKey
+     * java.security.interfaces.RSAPrivateCrtKey
      * #getPrimeExponentQ()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeExponentQ",
-        args = {}
-    )
     public void test_getPrimeExponentQ() {
         assertEquals("invalid prime exponent Q",
                 Util.rsaCrtParam.getPrimeExponentQ(), key.getPrimeExponentQ());
     }
 
     /**
-     * @tests java.security.interfaces.RSAPrivateCrtKey
+     * java.security.interfaces.RSAPrivateCrtKey
      * #getPrimeP()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeP",
-        args = {}
-    )
     public void test_getPrimeP() {
         assertEquals("invalid prime P",
                 Util.rsaCrtParam.getPrimeP(), key.getPrimeP());
     }
 
     /**
-     * @tests java.security.interfaces.RSAPrivateCrtKey
+     * java.security.interfaces.RSAPrivateCrtKey
      * #getPrimeQ()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeQ",
-        args = {}
-    )
     public void test_getPrimeQ() {
         assertEquals("invalid prime Q",
                 Util.rsaCrtParam.getPrimeQ(), key.getPrimeQ());
     }
 
     /**
-     * @tests java.security.interfaces.RSAPrivateCrtKey
+     * java.security.interfaces.RSAPrivateCrtKey
      * #getPublicExponent()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicExponent",
-        args = {}
-    )
     public void test_getPublicExponent() {
         assertEquals("invalid public exponent",
                 Util.rsaCrtParam.getPublicExponent(), key.getPublicExponent());
diff --git a/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java
index fdd1018..a5035a9 100644
--- a/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/RSAPrivateKeyTest.java
@@ -14,9 +14,6 @@
  * limitations under the License.
  */
 package tests.security.interfaces;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -25,19 +22,12 @@
 import java.security.interfaces.RSAPrivateKey;
 import java.security.spec.RSAPrivateKeySpec;
 
-@TestTargetClass(RSAPrivateKey.class)
 public class RSAPrivateKeyTest extends TestCase {
 
     /**
-     * @tests java.security.interfaces.RSAPrivateKey
+     * java.security.interfaces.RSAPrivateKey
      * #getPrivateExponent()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrivateExponent",
-        args = {}
-    )
     public void test_getPrivateExponent() throws Exception {
         KeyFactory gen = KeyFactory.getInstance("RSA");
         final BigInteger n = BigInteger.valueOf(3233);
diff --git a/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java b/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java
index f3aaaac..09919af 100644
--- a/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java
+++ b/luni/src/test/java/tests/security/interfaces/RSAPublicKeyTest.java
@@ -14,9 +14,6 @@
  * limitations under the License.
  */
 package tests.security.interfaces;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
 
 import junit.framework.TestCase;
 
@@ -25,19 +22,12 @@
 import java.security.interfaces.RSAPublicKey;
 import java.security.spec.RSAPublicKeySpec;
 
-@TestTargetClass(RSAPublicKey.class)
 public class RSAPublicKeyTest extends TestCase {
 
     /**
-     * @tests java.security.interfaces.RSAPublicKey
+     * java.security.interfaces.RSAPublicKey
      * #getPublicExponent()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicExponent",
-        args = {}
-    )
     public void test_getPublicExponent() throws Exception {
         KeyFactory gen = KeyFactory.getInstance("RSA");
         final BigInteger n = BigInteger.valueOf(3233);
diff --git a/luni/src/test/java/tests/security/spec/AllTests.java b/luni/src/test/java/tests/security/spec/AllTests.java
deleted file mode 100644
index 151e0a7..0000000
--- a/luni/src/test/java/tests/security/spec/AllTests.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.security.spec;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * This is autogenerated source file. Includes tests for package tests.security.spec;
- */
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.security.spec;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(DSAParameterSpecTest.class);
-        suite.addTestSuite(DSAPrivateKeySpecTest.class);
-        suite.addTestSuite(DSAPublicKeySpecTest.class);
-        suite.addTestSuite(ECFieldF2mTest.class);
-        suite.addTestSuite(ECFieldFpTest.class);
-        suite.addTestSuite(ECGenParameterSpecTest.class);
-        suite.addTestSuite(ECParameterSpecTest.class);
-        suite.addTestSuite(ECPointTest.class);
-        suite.addTestSuite(ECPrivateKeySpecTest.class);
-        suite.addTestSuite(ECPublicKeySpecTest.class);
-        suite.addTestSuite(EllipticCurveTest.class);
-        suite.addTestSuite(EncodedKeySpec2Test.class);
-        suite.addTestSuite(EncodedKeySpecTest.class);
-        suite.addTestSuite(InvalidKeySpecExceptionTest.class);
-        suite.addTestSuite(InvalidParameterSpecExceptionTest.class);
-        suite.addTestSuite(MGF1ParameterSpecTest.class);
-        suite.addTestSuite(PKCS8EncodedKeySpecTest.class);
-        suite.addTestSuite(PSSParameterSpecTest.class);
-        suite.addTestSuite(RSAKeyGenParameterSpecTest.class);
-        suite.addTestSuite(RSAMultiPrimePrivateCrtKeySpecTest.class);
-        suite.addTestSuite(RSAOtherPrimeInfoTest.class);
-        suite.addTestSuite(RSAPrivateCrtKeySpecTest.class);
-        suite.addTestSuite(RSAPrivateKeySpecTest.class);
-        suite.addTestSuite(RSAPublicKeySpecTest.class);
-        suite.addTestSuite(X509EncodedKeySpecTest.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java b/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java
index 408e74b..c270a0e 100644
--- a/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java
+++ b/luni/src/test/java/tests/security/spec/DSAParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -37,18 +32,11 @@
  * Tests for <code>DSAParameterSpec</code>
  *
  */
-@TestTargetClass(DSAParameterSpec.class)
 public class DSAParameterSpecTest extends TestCase {
 
     /**
      * Ctor test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "DSAParameterSpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testDSAParameterSpec() {
         AlgorithmParameterSpec aps = new DSAParameterSpec(
                 new BigInteger("1"),
@@ -61,12 +49,6 @@
     /**
      * getG() test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getG",
-        args = {}
-    )
     public final void testGetG() {
         DSAParameterSpec dps = new DSAParameterSpec(
                 new BigInteger("1"),
@@ -79,12 +61,6 @@
     /**
      * getP() test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getP",
-        args = {}
-    )
     public final void testGetP() {
         DSAParameterSpec dps = new DSAParameterSpec(
                 new BigInteger("1"),
@@ -97,12 +73,6 @@
     /**
      * getQ() test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getQ",
-        args = {}
-    )
     public final void testGetQ() {
         DSAParameterSpec dps = new DSAParameterSpec(
                 new BigInteger("1"),
diff --git a/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java b/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java
index b44e29b..98bd8f0 100644
--- a/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/DSAPrivateKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -37,18 +32,11 @@
  * Tests for <code>DSAPrivateKeySpec</code>
  *
  */
-@TestTargetClass(DSAPrivateKeySpec.class)
 public class DSAPrivateKeySpecTest extends TestCase {
 
     /**
      * Test for constructor
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "DSAPrivateKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testDSAPrivateKeySpec() {
         KeySpec ks = new DSAPrivateKeySpec(
                 new BigInteger("1"),
@@ -62,12 +50,6 @@
     /**
      * getG() test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getG",
-        args = {}
-    )
     public final void testGetG() {
         DSAPrivateKeySpec dpks = new DSAPrivateKeySpec(
                 new BigInteger("1"),
@@ -81,12 +63,6 @@
     /**
      * getP() test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getP",
-        args = {}
-    )
     public final void testGetP() {
         DSAPrivateKeySpec dpks = new DSAPrivateKeySpec(
                 new BigInteger("1"),
@@ -100,12 +76,6 @@
     /**
      * getQ() test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getQ",
-        args = {}
-    )
     public final void testGetQ() {
         DSAPrivateKeySpec dpks = new DSAPrivateKeySpec(
                 new BigInteger("1"),
@@ -119,12 +89,6 @@
     /**
      * getX() test
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getX",
-        args = {}
-    )
     public final void testGetX() {
         DSAPrivateKeySpec dpks = new DSAPrivateKeySpec(
                 new BigInteger("1"),
diff --git a/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java b/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java
index 6dfecd9..1921566 100644
--- a/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/DSAPublicKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -37,18 +32,11 @@
  * Tests for <code>DSAPublicKeySpec</code>
  *
  */
-@TestTargetClass(DSAPublicKeySpec.class)
 public class DSAPublicKeySpecTest extends TestCase {
 
     /**
      * Test for <code>DSAPublicKeySpec</code> ctor
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "DSAPublicKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testDSAPublicKeySpec() {
         KeySpec ks = new DSAPublicKeySpec(
                 new BigInteger("1"), // y
@@ -62,12 +50,6 @@
     /**
      * Test for <code>getG</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getG",
-        args = {}
-    )
     public final void testGetG() {
         DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                 new BigInteger("1"), // y
@@ -81,12 +63,6 @@
     /**
      * Test for <code>getP</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getP",
-        args = {}
-    )
     public final void testGetP() {
         DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                 new BigInteger("1"), // y
@@ -100,12 +76,6 @@
     /**
      * Test for <code>getQ</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getQ",
-        args = {}
-    )
     public final void testGetQ() {
         DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                 new BigInteger("1"), // y
@@ -119,12 +89,6 @@
     /**
      * Test for <code>getY</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getY",
-        args = {}
-    )
     public final void testGetY() {
         DSAPublicKeySpec dpks = new DSAPublicKeySpec(
                 new BigInteger("1"), // y
diff --git a/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java b/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java
index ae26df7..6e541c3 100644
--- a/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java
+++ b/luni/src/test/java/tests/security/spec/ECFieldF2mTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -38,7 +33,6 @@
  * Tests for <code>ECFieldF2m</code> class fields and methods.
  *
  */
-@TestTargetClass(ECFieldF2m.class)
 public class ECFieldF2mTest extends TestCase {
 
     /**
@@ -132,12 +126,6 @@
      *
      * Assertion: IllegalArgumentException if m is not positive.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ECFieldF2m",
-        args = {int.class}
-    )
     public final void testECFieldF2mint() {
         for(int i=0; i<intCtorTestParameters.length; i++) {
             ECFieldF2mDomainParams tp = intCtorTestParameters[i];
@@ -263,12 +251,6 @@
      *
      * Assertion: IllegalArgumentException if ks is invalid.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ECFieldF2m",
-        args = {int.class, int[].class}
-    )
     public final void testECFieldF2mintintArray() {
         for(int i=0; i<constructorTestParameters.length; i++) {
             ECFieldF2mDomainParams tp = constructorTestParameters[i];
@@ -308,11 +290,6 @@
      *
      * Assertion: IllegalArgumentException if rp is invalid.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        method = "ECFieldF2m",
-        args = {int.class, java.math.BigInteger.class}
-    )
     public final void testECFieldF2mintBigInteger() {
         for(int i=0; i<constructorTestParameters.length; i++) {
             ECFieldF2mDomainParams tp = constructorTestParameters[i];
@@ -343,12 +320,6 @@
      * Assertion: must return the same value if invoked
      * repeatedly on the same object.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode01() {
         ECFieldF2m f = new ECFieldF2m(2000);
         int hc = f.hashCode();
@@ -368,12 +339,6 @@
      * Assertion: must return the same value if invoked
      * repeatedly on the same object.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode02() {
         ECFieldF2m f = new ECFieldF2m(2000, new int[] {981, 2, 1});
         int hc = f.hashCode();
@@ -393,12 +358,6 @@
      * Assertion: must return the same value if invoked
      * on equal (according to the <code>equals(Object)</code> method) objects.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode03() {
         assertTrue(new ECFieldF2m(111).hashCode() ==
                    new ECFieldF2m(111).hashCode());
@@ -410,12 +369,6 @@
      * Assertion: must return the same value if invoked
      * on equal (according to the <code>equals(Object)</code> method) objects.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode04() {
         assertTrue(new ECFieldF2m(2000, new int[] {981, 2, 1}).hashCode() ==
                    new ECFieldF2m(2000, new int[] {981, 2, 1}).hashCode());
@@ -427,12 +380,6 @@
      * Assertion: must return the same value if invoked
      * on equal (according to the <code>equals(Object)</code> method) objects.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode05() {
         assertTrue(new ECFieldF2m(2000, new int[] {981, 2, 1}).hashCode() ==
                    new ECFieldF2m(2000, BigInteger.valueOf(0L).
@@ -445,12 +392,6 @@
      *
      * Assertion: object equals to itself.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject01() {
         ECFieldF2m obj = new ECFieldF2m(1999, new int[] {367});
         assertTrue(obj.equals(obj));
@@ -461,12 +402,6 @@
      *
      * Assertion: normal basis - objects equal if their m are equal.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Simple test. Doesn't verify other cases.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject02() {
         assertTrue(new ECFieldF2m(43).equals(new ECFieldF2m(43)));
     }
@@ -477,12 +412,6 @@
      * Assertion: trinomial basis - objects equal if their m, and rp
      * are mutually equal.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject03() {
         assertTrue(new ECFieldF2m(1999, new int[] {367}).equals(
                    new ECFieldF2m(1999, BigInteger.valueOf(0L).
@@ -495,12 +424,6 @@
      * Assertion: pentanomial basis - objects equal if their m, and rp
      * are mutually equal.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject04() {
         ECFieldF2m f1 = new ECFieldF2m(2000, new int[] {981, 2, 1});
         ECFieldF2m f2 = new ECFieldF2m(2000, BigInteger.valueOf(0L).
@@ -514,12 +437,6 @@
      *
      * Assertion: objects equal if their m, and rp are mutually equal.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject05() {
         ECFieldF2m f1 = new ECFieldF2m(2000);
         ECFieldF2m f2 = new ECFieldF2m(2000, BigInteger.valueOf(0L).
@@ -533,12 +450,6 @@
      *
      * Assertion: returns false if obj is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject06() {
         assertFalse(new ECFieldF2m(2000).equals(null));
     }
@@ -548,12 +459,6 @@
      *
      * Assertion: returns false if obj is not instance of <code>ECFieldF2m</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject07() {
         assertFalse(new ECFieldF2m(2000).equals(new Object()));
     }
@@ -563,12 +468,6 @@
      *
      * Assertion: returns m value for <code>ECFieldF2m</code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFieldSize",
-        args = {}
-    )
     public final void testGetFieldSize() {
         assertEquals(2000, new ECFieldF2m(2000).getFieldSize());
     }
@@ -578,12 +477,6 @@
      *
      * Assertion: returns m value for <code>ECFieldF2m</code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getM",
-        args = {}
-    )
     public final void testGetM() {
         assertEquals(2000, new ECFieldF2m(2000).getM());
     }
@@ -593,12 +486,6 @@
      *
      * Assertion: returns mid terms of reduction polynomial
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getMidTermsOfReductionPolynomial method returns mid terms of reduction polynomial.",
-        method = "getMidTermsOfReductionPolynomial",
-        args = {}
-    )
     public final void testGetMidTermsOfReductionPolynomial01() {
         int[] a = new int[] {981,2,1};
         int[] b = new ECFieldF2m(2000,
@@ -613,12 +500,6 @@
      *
      * Assertion: returns null for normal basis
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getMidTermsOfReductionPolynomial method returns null for normal basis.",
-        method = "getMidTermsOfReductionPolynomial",
-        args = {}
-    )
     public final void testGetMidTermsOfReductionPolynomial02() {
         assertNull(new ECFieldF2m(2000).getMidTermsOfReductionPolynomial());
     }
@@ -628,12 +509,6 @@
      *
      * Assertion: returns mid terms of reduction polynomial
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getMidTermsOfReductionPolynomial method returns mid terms of reduction polynomial.",
-        method = "getMidTermsOfReductionPolynomial",
-        args = {}
-    )
     public final void testGetMidTermsOfReductionPolynomial03() {
         int[] a = new int[] {367};
         int[] b = new ECFieldF2m(1999, a).getMidTermsOfReductionPolynomial();
@@ -645,12 +520,6 @@
      *
      * Assertion: returns reduction polynomial
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getReductionPolynomial method returns reduction polynomial.",
-        method = "getReductionPolynomial",
-        args = {}
-    )
     public final void testGetReductionPolynomial01() {
         BigInteger rp = BigInteger.valueOf(0L).setBit(0).setBit(1).setBit(2).
         setBit(981).setBit(2000);
@@ -662,12 +531,6 @@
      *
      * Assertion: returns null for normal basis
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getReductionPolynomial method returns null for normal basis.",
-        method = "getReductionPolynomial",
-        args = {}
-    )
     public final void testGetReductionPolynomial02() {
         assertNull(new ECFieldF2m(2000).getReductionPolynomial());
     }
@@ -676,12 +539,6 @@
      * Tests that object state is preserved against modifications
      * through array reference passed to the constructor.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL,
-        notes = "Verifies that object state is preserved against modifications through array reference passed to the constructor.",
-        method = "ECFieldF2m",
-        args = {int.class, int[].class}
-    )
     public final void testIsStatePreserved01() {
         // reference array
         int[] a = new int[] {367};
@@ -700,20 +557,6 @@
      * modifications through array reference returned by
      * <code>getMidTermsOfReductionPolynomial()</code> method.
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Verifies that object state is preserved against modifications through array reference returned by getMidTermsOfReductionPolynomial() method.",
-            method = "ECFieldF2m",
-            args = {int.class, int[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL,
-            notes = "Verifies that object state is preserved against modifications through array reference returned by getMidTermsOfReductionPolynomial() method.",
-            method = "getMidTermsOfReductionPolynomial",
-            args = {}
-        )
-    })
     public final void testIsStatePreserved02() {
         // reference array
         int[] a = new int[] {981,2,1};
diff --git a/luni/src/test/java/tests/security/spec/ECFieldFpTest.java b/luni/src/test/java/tests/security/spec/ECFieldFpTest.java
index aacb4b3..838ead0 100644
--- a/luni/src/test/java/tests/security/spec/ECFieldFpTest.java
+++ b/luni/src/test/java/tests/security/spec/ECFieldFpTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -36,7 +31,6 @@
  * Tests for <code>ECFieldFp</code> class fields and methods.
  *
  */
-@TestTargetClass(ECFieldFp.class)
 public class ECFieldFpTest extends TestCase {
 
     //
@@ -49,12 +43,6 @@
      * Assertion: creates new object of <code>ECFieldFp</code> class
      * using valid <code>p</code> (odd prime)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ECFieldFp",
-        args = {java.math.BigInteger.class}
-    )
     public final void testECFieldFp01() {
         new ECFieldFp(BigInteger.valueOf(23L));
     }
@@ -65,12 +53,6 @@
      * Assertion: creates new object of <code>ECFieldFp</code> class
      * using valid <code>p</code> (odd but not prime)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ECFieldFp",
-        args = {java.math.BigInteger.class}
-    )
     public final void testECFieldFp02() {
         new ECFieldFp(BigInteger.valueOf(21L));
     }
@@ -80,12 +62,6 @@
      *
      * Assertion: IllegalArgumentException if <code>p</code> is not positive
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ECFieldFp",
-        args = {java.math.BigInteger.class}
-    )
     public final void testECFieldFp03() {
         try {
             new ECFieldFp(BigInteger.valueOf(-1L));
@@ -100,12 +76,6 @@
      *
      * Assertion: IllegalArgumentException if <code>p</code> is not positive
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ECFieldFp",
-        args = {java.math.BigInteger.class}
-    )
     public final void testECFieldFp04() {
         try {
             new ECFieldFp(BigInteger.valueOf(0L));
@@ -120,12 +90,6 @@
      *
      * Assertion: NullPointerException if <code>p</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ECFieldFp",
-        args = {java.math.BigInteger.class}
-    )
     public final void testECFieldFp05() {
         try {
             new ECFieldFp(null);
@@ -141,12 +105,6 @@
      * Assertion: must return the same value if invoked
      * repeatedly on the same object.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode01() {
         ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
         int hc = f.hashCode();
@@ -166,12 +124,6 @@
      * Assertion: must return the same value if invoked
      * on equal (according to the <code>equals(Object)</code> method) objects.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode02() {
         assertTrue(new ECFieldFp(BigInteger.valueOf(23L)).hashCode() ==
                    new ECFieldFp(BigInteger.valueOf(23L)).hashCode());
@@ -182,12 +134,6 @@
      *
      * Assertion: returns field size in bits which is prime size
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFieldSize",
-        args = {}
-    )
     public final void testGetFieldSize() {
         assertEquals(5, new ECFieldFp(BigInteger.valueOf(23L)).getFieldSize());
     }
@@ -197,12 +143,6 @@
      *
      * Assertion: returns prime
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getP",
-        args = {}
-    )
     public final void testGetP() {
         BigInteger p = BigInteger.valueOf(23L);
         assertTrue(p.equals(new ECFieldFp(p).getP()));
@@ -213,12 +153,6 @@
      *
      * Assertion: object equals to itself.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject01() {
         ECFieldFp obj = new ECFieldFp(BigInteger.valueOf(23L));
         assertTrue(obj.equals(obj));
@@ -229,12 +163,6 @@
      *
      * Assertion: returns false if <code>obj</code> is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject02() {
         assertFalse(new ECFieldFp(BigInteger.valueOf(23L)).equals(null));
     }
@@ -245,12 +173,6 @@
      * Assertion: returns false if <code>obj</code>
      * is not instance of <code>ECFieldFp</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject03() {
         assertFalse(new ECFieldFp(BigInteger.valueOf(23L)).equals(new Object()));
     }
@@ -260,12 +182,6 @@
      *
      * Assertion: true if prime values match.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject04() {
         assertTrue(new ECFieldFp(BigInteger.valueOf(23L)).equals(
                    new ECFieldFp(BigInteger.valueOf(23L))));
diff --git a/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java b/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java
index 343d4ce..f3a3913 100644
--- a/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java
+++ b/luni/src/test/java/tests/security/spec/ECGenParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.spec.ECGenParameterSpec;
@@ -35,7 +30,6 @@
  * Tests for <code>ECGenParameterSpec</code> class fields and methods.
  *
  */
-@TestTargetClass(ECGenParameterSpec.class)
 public class ECGenParameterSpecTest extends TestCase {
 
     //
@@ -48,12 +42,6 @@
      * Assertion: creates new object of <code>ECGenParameterSpec</code> class
      * using valid <code>name</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ECGenParameterSpec",
-        args = {java.lang.String.class}
-    )
     public final void testECGenParameterSpec01() {
         new ECGenParameterSpec("someName");
     }
@@ -64,12 +52,6 @@
      * Assertion: throws NullPointerException
      * if <code>name</code> is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "ECGenParameterSpec",
-        args = {java.lang.String.class}
-    )
     public final void testECGenParameterSpec02() {
         try {
             new ECGenParameterSpec(null);
@@ -82,12 +64,6 @@
      *
      * Assertion: returns the <code>name</code>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getName",
-        args = {}
-    )
     public final void testGetName() {
         String name = "someName";
         ECGenParameterSpec ps = new ECGenParameterSpec(name);
diff --git a/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java b/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java
index 3b4b9a3..cb1c66e 100644
--- a/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java
+++ b/luni/src/test/java/tests/security/spec/ECParameterSpecTest.java
@@ -16,11 +16,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -29,7 +24,6 @@
 import java.security.spec.ECPoint;
 import java.security.spec.EllipticCurve;
 
-@TestTargetClass(ECParameterSpec.class)
 public class ECParameterSpecTest extends TestCase {
 
     EllipticCurve curve;
@@ -63,12 +57,6 @@
      * case 5: IllegalArgumentException - if n is not positive
      * case 6: IllegalArgumentException - if h is not positive
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ECParameterSpec",
-        args = {java.security.spec.EllipticCurve.class, java.security.spec.ECPoint.class, java.math.BigInteger.class, int.class}
-    )
     public void test_constructorLjava_security_spec_EllipticCurveLjava_security_spec_ECPointLjava_math_BigIntegerI() {
 
         // case 1: creating object with valid parameters
@@ -123,12 +111,6 @@
     /**
      * test for getCurve() method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCurve",
-        args = {}
-    )
     public void test_GetCurve() {
         assertEquals("wrong elliptic curve", curve, ecps.getCurve());
     }
@@ -136,12 +118,6 @@
     /**
      * test for getGenerator() method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getGenerator",
-        args = {}
-    )
     public void test_GetGenerator() {
         assertEquals("wrong generator was returned", ecpoint, ecps
                 .getGenerator());
@@ -150,12 +126,6 @@
     /**
      * test for getOrder() method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getOrder",
-        args = {}
-    )
     public void test_GetOrder() {
         assertEquals("wrong order was reteurned", BigInteger.valueOf(1), ecps
                 .getOrder());
@@ -164,12 +134,6 @@
     /**
      * test for getCofactor() method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCofactor",
-        args = {}
-    )
     public void test_GetCofactor() {
         assertEquals("wrong cofactor was returned", 1, ecps.getCofactor());
     }
diff --git a/luni/src/test/java/tests/security/spec/ECPointTest.java b/luni/src/test/java/tests/security/spec/ECPointTest.java
index 515e62c..e240f3c 100644
--- a/luni/src/test/java/tests/security/spec/ECPointTest.java
+++ b/luni/src/test/java/tests/security/spec/ECPointTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -36,7 +31,6 @@
  * Tests for <code>ECPoint</code> class fields and methods.
  *
  */
-@TestTargetClass(ECPoint.class)
 public class ECPointTest extends TestCase {
 
     //
@@ -49,12 +43,6 @@
      * Test preconditions: valid parameters passed<br>
      * Expected: must pass without any exceptions
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive cases.",
-        method = "ECPoint",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testECPoint01() {
         new ECPoint(BigInteger.ZERO, BigInteger.ZERO);
         new ECPoint(BigInteger.valueOf(-23456L), BigInteger.valueOf(-23456L));
@@ -70,12 +58,6 @@
      * Test preconditions: pass <code>null</code> as mentioned parameters<br>
      * Expected: must throw <code>NullPointerException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies exceptions.",
-        method = "ECPoint",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testECPoint02() {
         // test case 1: x is null
         try {
@@ -110,12 +92,6 @@
      * which is equal to the one passed to the constructor;
      * (both must refer the same object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getAffineX",
-        args = {}
-    )
     public final void testGetAffineX01() {
         BigInteger x = BigInteger.valueOf(-23456L);
         ECPoint p = new ECPoint(x, BigInteger.valueOf(23456L));
@@ -131,12 +107,6 @@
      * Expected: must return <code>null</code> for
      * <code>ECPoint.POINT_INFINITY</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getAffineX returns null for POINT_INFINITY.",
-        method = "getAffineX",
-        args = {}
-    )
     public final void testGetAffineX02() {
         assertNull(ECPoint.POINT_INFINITY.getAffineX());
     }
@@ -150,12 +120,6 @@
      * which is equal to the one passed to the constructor;
      * (both must refer the same object)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive functionality.",
-        method = "getAffineY",
-        args = {}
-    )
     public final void testGetAffineY01() {
         BigInteger y =  BigInteger.valueOf(23456L);
         ECPoint p = new ECPoint(BigInteger.valueOf(-23456L), y);
@@ -171,12 +135,6 @@
      * Expected: must return <code>null</code> for
      * <code>ECPoint.POINT_INFINITY</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getAffineY ruturns null for POINT_INFINITY.",
-        method = "getAffineY",
-        args = {}
-    )
     public final void testGetAffineY02() {
         assertNull(ECPoint.POINT_INFINITY.getAffineY());
     }
@@ -187,12 +145,6 @@
      * Test preconditions: see test comments<br>
      * Expected: all objects in this test must be equal
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive cases.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject01() {
         // test case 1: must be equal to itself
         ECPoint p2=null, p1 =
@@ -216,12 +168,6 @@
      * Test preconditions: see test comments<br>
      * Expected: all objects in this test must be not equal
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies negative cases.",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject02() {
         // test case 1: must be not equal to null
         ECPoint p2=null, p1 =
@@ -250,12 +196,6 @@
      * Assertion: must return the same value if invoked
      * repeatedly on the same object.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode01() {
         ECPoint f = new ECPoint(BigInteger.valueOf(-23457L), BigInteger.ONE);
         int hc = f.hashCode();
@@ -287,12 +227,6 @@
      * Assertion: must return the same value if invoked
      * on equal (according to the <code>equals(Object)</code> method) objects.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode02() {
         ECPoint p1 = new ECPoint(BigInteger.valueOf(-23456L), BigInteger.ONE);
         ECPoint p2 = new ECPoint(BigInteger.valueOf(-23456L), BigInteger.valueOf(1L));
diff --git a/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java b/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java
index 2dd7c14..a3db5a7 100644
--- a/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/ECPrivateKeySpecTest.java
@@ -16,11 +16,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -30,7 +25,6 @@
 import java.security.spec.ECPrivateKeySpec;
 import java.security.spec.EllipticCurve;
 
-@TestTargetClass(ECPrivateKeySpec.class)
 public class ECPrivateKeySpecTest extends TestCase {
 
     BigInteger s;
@@ -66,12 +60,6 @@
      * case 2: catch NullPointerException - if s is null.
      * case 3: catch NullPointerException - if params is null.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ECPrivateKeySpec",
-        args = {java.math.BigInteger.class, java.security.spec.ECParameterSpec.class}
-    )
     public void test_constructorLjava_math_BigIntegerLjava_security_spec_ECParameterSpec() {
 
         // case 1: creating object with valid parameters
@@ -98,12 +86,6 @@
     /**
      * test for getS() method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getS",
-        args = {}
-    )
     public void test_GetS() {
         assertEquals("wrong private value", s, ecpks.getS());
     }
@@ -111,12 +93,6 @@
     /**
      * test for getParams() method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParams",
-        args = {}
-    )
     public void test_GetParams() {
         assertEquals("wrong parameters", ecparams, ecpks.getParams());
     }
diff --git a/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java b/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java
index 618d6f5..abac7a2 100644
--- a/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/ECPublicKeySpecTest.java
@@ -16,11 +16,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -30,7 +25,6 @@
 import java.security.spec.ECPublicKeySpec;
 import java.security.spec.EllipticCurve;
 
-@TestTargetClass(ECPublicKeySpec.class)
 public class ECPublicKeySpecTest extends TestCase {
     ECPoint w;
 
@@ -64,12 +58,6 @@
      * case 2: catch NullPointerException - if w is null.
      * case 3: catch NullPointerException - if params is null.
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "ECPublicKeySpec",
-        args = {java.security.spec.ECPoint.class, java.security.spec.ECParameterSpec.class}
-    )
     public final void test_constructorLjava_security_spec_ECPointLjava_security_spec_ECParameterSpec() {
 
         // case 1: creating object with valid parameters
@@ -96,12 +84,6 @@
     /**
      * test for getW() method
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getW",
-        args = {}
-    )
     public final void testGetW() {
         assertEquals("wrong w value", w, ecpks.getW());
     }
@@ -109,12 +91,6 @@
     /**
      * test for getParams() meyhod
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getParams",
-        args = {}
-    )
     public final void testGetParams() {
         assertEquals("wrong params value", params, ecpks.getParams());
     }
diff --git a/luni/src/test/java/tests/security/spec/EllipticCurveTest.java b/luni/src/test/java/tests/security/spec/EllipticCurveTest.java
index a26532d..cd090c6 100644
--- a/luni/src/test/java/tests/security/spec/EllipticCurveTest.java
+++ b/luni/src/test/java/tests/security/spec/EllipticCurveTest.java
@@ -17,11 +17,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -35,7 +30,6 @@
  * Tests for <code>EllipticCurve</code> class fields and methods.
  *
  */
-@TestTargetClass(EllipticCurve.class)
 public class EllipticCurveTest extends TestCase {
 
     /**
@@ -45,12 +39,6 @@
      * Test preconditions: valid parameters passed<br>
      * Expected: must pass without any exceptions
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive cases.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray01() {
         // test case 1 parameters set
         ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
@@ -85,12 +73,6 @@
      * Test preconditions: pass <code>null</code> as mentioned parameters<br>
      * Expected: must throw <code>NullPointerException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray02() {
         // test case 1 parameters set
         ECFieldFp f = null;
@@ -137,12 +119,6 @@
      * not in the <code>field</code> of type <code>ECFieldFp</code><br>
      * Expected: must throw <code>IllegalArgumentException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray03() {
         // test case 1 parameters set,
         // a is not in field
@@ -204,12 +180,6 @@
      * not in the <code>field</code> of type <code>ECFieldF2m</code><br>
      * Expected: must throw <code>IllegalArgumentException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray04() {
         // test case 1 parameters set,
         // a is not in field
@@ -256,12 +226,6 @@
      * Test preconditions: pass <code>seed</code> to the ctor then modify it<br>
      * Expected: getSeed() must return unmodified array
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that byte array of EllipticCurve can't be modified",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class, byte[].class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigIntegerbyteArray05() {
         ECFieldF2m f = new ECFieldF2m(5);
         BigInteger a = BigInteger.valueOf(0L);
@@ -283,12 +247,6 @@
      * Test preconditions: valid parameters passed, field type is ECFieldFp<br>
      * Expected: must pass without any exceptions
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Doesn't verify exceptions.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigInteger01() {
         // test case 1 parameters set
         ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
@@ -321,12 +279,6 @@
      * Test preconditions: pass <code>null</code> as mentioned parameters<br>
      * Expected: must throw <code>NullPointerException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigInteger02() {
         // test case 1 parameters set
         ECFieldFp f = null;
@@ -370,12 +322,6 @@
      * not in the <code>field</code> of type <code>ECFieldFp</code><br>
      * Expected: must throw <code>IllegalArgumentException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigInteger03() {
         // test case 1 parameters set,
         // a is not in field
@@ -433,12 +379,6 @@
      * not in the <code>field</code> of type <code>ECFieldF2m</code><br>
      * Expected: must throw <code>IllegalArgumentException</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigInteger04() {
         // test case 1 parameters set,
         // a is not in field
@@ -483,12 +423,6 @@
      * to the one passed to the constructor; (both must refer
      * the same object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getA",
-        args = {}
-    )
     public final void testGetA() {
         ECFieldF2m f = new ECFieldF2m(5);
         BigInteger a = BigInteger.valueOf(5L);
@@ -499,14 +433,8 @@
     }
 
     /**
-     * @tests java/security/spec/EllipticCurve#EllipticCurve(EcField,BigInteger,BigInteger)
+     * java/security/spec/EllipticCurve#EllipticCurve(EcField,BigInteger,BigInteger)
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test.",
-        method = "EllipticCurve",
-        args = {java.security.spec.ECField.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testEllipticCurveECFieldBigIntegerBigInteger05() {
         // Regression for Harmony-731
         EllipticCurve ec = new EllipticCurve(new testECField(), BigInteger
@@ -525,12 +453,6 @@
      * to the one passed to the constructor; (both must refer
      * the same object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getB",
-        args = {}
-    )
     public final void testGetB() {
         ECFieldF2m f = new ECFieldF2m(5);
         BigInteger a = BigInteger.valueOf(5L);
@@ -549,12 +471,6 @@
      * to the one passed to the constructor; (both must refer
      * the same object)
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getField",
-        args = {}
-    )
     public final void testGetField() {
         ECFieldF2m f = new ECFieldF2m(5);
         BigInteger a = BigInteger.valueOf(5L);
@@ -572,12 +488,6 @@
      * Expected: must return <code>seed</code> which is equal
      * to the one passed to the constructor
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getSeed",
-        args = {}
-    )
     public final void testGetSeed01() {
         ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
         BigInteger a = BigInteger.ONE;
@@ -597,12 +507,6 @@
      * called and then returned array modified<br>
      * Expected: internal state must not be affected by the modification
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that modification of byte array  doesn't change internal state of test object.",
-        method = "getSeed",
-        args = {}
-    )
     public final void testGetSeed02() {
         ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
         BigInteger a = BigInteger.ONE;
@@ -624,12 +528,6 @@
      * created using valid parameters<br>
      * Expected: repeated method calls must return different refs
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that repeated calls of getSeed method must return different refs.",
-        method = "getSeed",
-        args = {}
-    )
     public final void testGetSeed03() {
         ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
         BigInteger a = BigInteger.ONE;
@@ -641,15 +539,9 @@
     }
 
     /**
-     * @tests java.security.spec.EllipticCurve#getSeed()
+     * java.security.spec.EllipticCurve#getSeed()
      * Assertion: null if not specified
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Regression test.",
-        method = "getSeed",
-        args = {}
-    )
     public final void testGetSeed04() {
         //Regression for HARMONY-732
         ECFieldFp f = new ECFieldFp(BigInteger.valueOf(23L));
@@ -663,12 +555,6 @@
      * Test preconditions: see test comments<br>
      * Expected: all objects in this test must be equal
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "equals",
-        args = {java.lang.Object.class}
-    )
     public final void testEqualsObject01() {
         // test case 1: must be equal to itself
         EllipticCurve c2 = null, c1 = new EllipticCurve(new ECFieldFp(
@@ -712,12 +598,6 @@
      * Assertion: must return the same value if invoked
      * repeatedly on the same object.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that several calls of hashCode method for the same objects return the same values.",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode01() {
         int hc = 0;
         EllipticCurve f = new EllipticCurve(new ECFieldFp(BigInteger
@@ -736,12 +616,6 @@
      * Assertion: must return the same value if invoked
      * on equal (according to the <code>equals(Object)</code> method) objects.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "hashCode",
-        args = {}
-    )
     public final void testHashCode02() {
         assertEquals(new EllipticCurve(new ECFieldFp(BigInteger.valueOf(23L)),
                 BigInteger.ONE, BigInteger.valueOf(19L), new byte[24])
diff --git a/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java b/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java
index 8cbab69..edb801e 100644
--- a/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java
+++ b/luni/src/test/java/tests/security/spec/EncodedKeySpec2Test.java
@@ -17,11 +17,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.Key;
@@ -34,18 +29,11 @@
 import java.security.spec.PKCS8EncodedKeySpec;
 import java.security.spec.X509EncodedKeySpec;
 
-@TestTargetClass(EncodedKeySpec.class)
 public class EncodedKeySpec2Test extends TestCase {
 
     /**
-     * @tests java.security.spec.EncodedKeySpec#getEncoded()
+     * java.security.spec.EncodedKeySpec#getEncoded()
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public void test_getEncoded() throws Exception {
 
                KeyPairGenerator keyGen = KeyPairGenerator.getInstance("DSA");
diff --git a/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java b/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java
index 32f2282..d97b37d 100644
--- a/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/EncodedKeySpecTest.java
@@ -22,10 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
 import junit.framework.TestCase;
 
 import org.apache.harmony.security.tests.support.spec.MyEncodedKeySpec;
@@ -37,18 +33,11 @@
  * Tests for <code>EncodedKeySpec</code> class fields and methods.
  *
  */
-@TestTargetClass(EncodedKeySpec.class)
 public class EncodedKeySpecTest extends TestCase {
 
     /**
      * Tests for constructor <code>EncodedKeySpec(byte[])</code><br>
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "EncodedKeySpec",
-        args = {byte[].class}
-    )
     public final void testEncodedKeySpec() {
         byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 };
         EncodedKeySpec eks = new MyEncodedKeySpec(encodedKey);
@@ -69,12 +58,6 @@
     /**
      * Tests that <code>getEncoded()</code> method returns valid byte array
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded() {
 
         byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 };
@@ -99,12 +82,6 @@
      * Tests that internal state of the object can not be modified by modifying
      * initial array value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testIsStatePreserved1() {
         /* Create initial byte array */
         byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 };
@@ -125,12 +102,6 @@
      * Tests that internal state of the object can not be modified using
      * returned value of <code>getEncoded()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testIsStatePreserved2() {
 
         byte[] encodedKey = new byte[] { (byte) 1, (byte) 2, (byte) 3, (byte) 4 };
diff --git a/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java b/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java
index 82523e5..f766d7e 100644
--- a/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java
+++ b/luni/src/test/java/tests/security/spec/InvalidKeySpecExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.spec.InvalidKeySpecException;
@@ -36,7 +31,6 @@
  * methods.
  *
  */
-@TestTargetClass(InvalidKeySpecException.class)
 public class InvalidKeySpecExceptionTest extends TestCase {
 
     private static String[] msgs = {
@@ -50,12 +44,6 @@
      * Test for <code>InvalidKeySpecException()</code> constructor Assertion:
      * constructs InvalidKeySpecException with no detail message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvalidKeySpecException",
-        args = {}
-    )
     public void testInvalidKeySpecException01() {
         InvalidKeySpecException tE = new InvalidKeySpecException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -67,12 +55,6 @@
      * Assertion: constructs InvalidKeySpecException with detail message msg.
      * Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidKeySpecException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidKeySpecException02() {
         InvalidKeySpecException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -88,12 +70,6 @@
      * Assertion: constructs InvalidKeySpecException when <code>msg</code> is
      * null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "InvalidKeySpecException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidKeySpecException03() {
         String msg = null;
         InvalidKeySpecException tE = new InvalidKeySpecException(msg);
@@ -106,12 +82,6 @@
      * Assertion: constructs InvalidKeySpecException when <code>cause</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "InvalidKeySpecException",
-        args = {java.lang.Throwable.class}
-    )
     public void testInvalidKeySpecException04() {
         Throwable cause = null;
         InvalidKeySpecException tE = new InvalidKeySpecException(cause);
@@ -124,12 +94,6 @@
      * Assertion: constructs InvalidKeySpecException when <code>cause</code>
      * is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive cases.",
-        method = "InvalidKeySpecException",
-        args = {java.lang.Throwable.class}
-    )
     public void testInvalidKeySpecException05() {
         InvalidKeySpecException tE = new InvalidKeySpecException(tCause);
         if (tE.getMessage() != null) {
@@ -148,12 +112,6 @@
      * constructor Assertion: constructs InvalidKeySpecException when
      * <code>cause</code> is null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "InvalidKeySpecException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeySpecException06() {
         InvalidKeySpecException tE = new InvalidKeySpecException(null, null);
         assertNull("getMessage() must return null", tE.getMessage());
@@ -165,12 +123,6 @@
      * constructor Assertion: constructs InvalidKeySpecException when
      * <code>cause</code> is null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a cause parameter.",
-        method = "InvalidKeySpecException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeySpecException07() {
         InvalidKeySpecException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -186,12 +138,6 @@
      * constructor Assertion: constructs InvalidKeySpecException when
      * <code>cause</code> is not null <code>msg</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a message parameter.",
-        method = "InvalidKeySpecException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeySpecException08() {
         InvalidKeySpecException tE = new InvalidKeySpecException(null, tCause);
         if (tE.getMessage() != null) {
@@ -210,12 +156,6 @@
      * constructor Assertion: constructs InvalidKeySpecException when
      * <code>cause</code> is not null <code>msg</code> is not null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "InvalidKeySpecException",
-        args = {java.lang.String.class, java.lang.Throwable.class}
-    )
     public void testInvalidKeySpecException09() {
         InvalidKeySpecException tE;
         for (int i = 0; i < msgs.length; i++) {
diff --git a/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java b/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java
index 385696e..daba495 100644
--- a/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java
+++ b/luni/src/test/java/tests/security/spec/InvalidParameterSpecExceptionTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.spec.InvalidParameterSpecException;
@@ -36,7 +31,6 @@
  * methods.
  *
  */
-@TestTargetClass(InvalidParameterSpecException.class)
 public class InvalidParameterSpecExceptionTest extends TestCase {
 
     static String[] msgs = {
@@ -51,12 +45,6 @@
      * Assertion: constructs InvalidParameterSpecException with no detail
      * message
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "InvalidParameterSpecException",
-        args = {}
-    )
     public void testInvalidParameterSpecException01() {
         InvalidParameterSpecException tE = new InvalidParameterSpecException();
         assertNull("getMessage() must return null.", tE.getMessage());
@@ -68,12 +56,6 @@
      * Assertion: constructs InvalidParameterSpecException with detail message
      * msg. Parameter <code>msg</code> is not null.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "InvalidParameterSpecException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidParameterSpecException02() {
         InvalidParameterSpecException tE;
         for (int i = 0; i < msgs.length; i++) {
@@ -89,12 +71,6 @@
      * Assertion: constructs InvalidParameterSpecException when <code>msg</code>
      * is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "InvalidParameterSpecException",
-        args = {java.lang.String.class}
-    )
     public void testInvalidParameterSpecException03() {
         String msg = null;
         InvalidParameterSpecException tE = new InvalidParameterSpecException(
diff --git a/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java b/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java
index d92346a..178fcce 100644
--- a/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java
+++ b/luni/src/test/java/tests/security/spec/MGF1ParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.spec.MGF1ParameterSpec;
@@ -35,7 +30,6 @@
  * Test for MGF1ParameterSpec class
  *
  */
-@TestTargetClass(MGF1ParameterSpec.class)
 public class MGF1ParameterSpecTest extends TestCase {
 
     /**
@@ -52,12 +46,6 @@
      * Assertion: constructs new <code>MGF1ParameterSpec</code>
      * object using valid parameter
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "MGF1ParameterSpec",
-        args = {java.lang.String.class}
-    )
     public final void testMGF1ParameterSpec01() {
         try {
             MGF1ParameterSpec pgf = new MGF1ParameterSpec(testAlgName);
@@ -72,12 +60,6 @@
      * Test #2 for <code>MGF1ParameterSpec</code> constructor<br>
      * Assertion: <code>NullPointerException</code> if parameter is <code>null</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "MGF1ParameterSpec",
-        args = {java.lang.String.class}
-    )
     public final void testMGF1ParameterSpec02() {
         try {
             new MGF1ParameterSpec(null);
@@ -92,12 +74,6 @@
      * Assertion: returns the algorithm name of the message
      * digest used by the mask generation function
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDigestAlgorithm",
-        args = {}
-    )
     public final void testGetDigestAlgorithm() {
         MGF1ParameterSpec aps = new MGF1ParameterSpec(testAlgName);
         assertTrue(testAlgName.equals(aps.getDigestAlgorithm()));
@@ -108,32 +84,6 @@
      * Assertion: returns the algorithm name of the message
      * digest used by the mask generation function
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Field testing",
-            method = "!field SHA1",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Field testing",
-            method = "!field SHA256",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Field testing",
-            method = "!field SHA384",
-            args = {}
-        ),
-        @TestTargetNew(
-            level = TestLevel.COMPLETE,
-            notes = "Field testing",
-            method = "!field SHA512",
-            args = {}
-        )
-    })
 
     public final void testFieldsGetDigestAlgorithm() {
         assertEquals("SHA-1", MGF1ParameterSpec.SHA1.getDigestAlgorithm());
diff --git a/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java b/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java
index 5e86384..41a5d33 100644
--- a/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/PKCS8EncodedKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.spec.EncodedKeySpec;
@@ -37,7 +32,6 @@
  * Tests for <code>PKCS8EncodedKeySpec</code> class fields and methods.
  *
  */
-@TestTargetClass(PKCS8EncodedKeySpec.class)
 public class PKCS8EncodedKeySpecTest extends TestCase {
 
     //
@@ -49,12 +43,6 @@
      * Assertion: constructs new <code>PKCS8EncodedKeySpec</code>
      * object using valid parameter
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "PKCS8EncodedKeySpec",
-        args = {byte[].class}
-    )
     public final void testPKCS8EncodedKeySpec() {
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
 
@@ -73,12 +61,6 @@
      * Test for <code>getEncoded()</code> method<br>
      * Assertion: returns encoded key
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded() {
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
 
@@ -93,12 +75,6 @@
      * Test for <code>getFormat()</code> method
      * Assertion: returns format name (always "PKCS#8")
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFormat",
-        args = {}
-    )
     public final void testGetFormat() {
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
 
@@ -112,12 +88,6 @@
      * can not be changed by modifying initial
      * array value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testIsStatePreserved1() {
         // Reference array
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
@@ -142,12 +112,6 @@
      * can not be modified using returned value
      * of <code>getEncoded()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testIsStatePreserved2() {
         // Reference array
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
diff --git a/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java b/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java
index 1dad00a..6e720d3 100644
--- a/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java
+++ b/luni/src/test/java/tests/security/spec/PSSParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.spec.AlgorithmParameterSpec;
@@ -37,7 +32,6 @@
  * Tests for <code>PSSParameterSpec</code> class (1.5)
  *
  */
-@TestTargetClass(PSSParameterSpec.class)
 public class PSSParameterSpecTest extends TestCase {
 
     /**
@@ -45,12 +39,6 @@
      * Assertion: constructs using valid parameter
      * <code>PSSParameterSpec<code> object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameter.",
-        method = "PSSParameterSpec",
-        args = {int.class}
-    )
     public final void testPSSParameterSpec0101() {
         AlgorithmParameterSpec aps = new PSSParameterSpec(20);
         assertTrue(aps instanceof PSSParameterSpec);
@@ -62,12 +50,6 @@
      * throws <code>IllegalArgumentException</code>
      * if <code>saltLen</code> less than 0
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "PSSParameterSpec",
-        args = {int.class}
-    )
     public final void testPSSParameterSpec0102() {
         try {
             new PSSParameterSpec(-1);
@@ -84,12 +66,6 @@
      * Assertion: constructs using valid parameters
      * <code>PSSParameterSpec<code> object
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameters.",
-        method = "PSSParameterSpec",
-        args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
-    )
     public final void testPSSParameterSpec0201() {
         AlgorithmParameterSpec aps = new PSSParameterSpec("SHA-1", "MGF1",
                 MGF1ParameterSpec.SHA1, 20, 1);
@@ -105,12 +81,6 @@
      * throws <code>NullPointerException</code>
      * if <code>mdName</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "PSSParameterSpec",
-        args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
-    )
     public final void testPSSParameterSpec0202() {
         try {
             new PSSParameterSpec(null, "MGF1", MGF1ParameterSpec.SHA1, 20, 1);
@@ -128,12 +98,6 @@
      * throws <code>NullPointerException</code>
      * if <code>mgfName</code> is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "PSSParameterSpec",
-        args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
-    )
     public final void testPSSParameterSpec0203() {
         try {
             new PSSParameterSpec("SHA-1", null, MGF1ParameterSpec.SHA1, 20, 1);
@@ -151,12 +115,6 @@
      * throws <code>IllegalArgumentException<code>
      * if <code>saltLen<code> less than 0
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "PSSParameterSpec",
-        args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
-    )
     public final void testPSSParameterSpec0204() {
         try {
             new PSSParameterSpec("SHA-1", "MGF1",
@@ -175,12 +133,6 @@
      * throws <code>IllegalArgumentException</code>
      * if <code>trailerField</code> less than 0
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "PSSParameterSpec",
-        args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
-    )
     public final void testPSSParameterSpec0205() {
         try {
             new PSSParameterSpec("SHA-1", "MGF1",
@@ -198,12 +150,6 @@
      * Assertion: <code>AlgorithmParameterSpec</code> can be null
      *
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as AlgorithmParameterSpec parameter.",
-        method = "PSSParameterSpec",
-        args = {java.lang.String.class, java.lang.String.class, java.security.spec.AlgorithmParameterSpec.class, int.class, int.class}
-    )
     public final void testPSSParameterSpec0206() {
         new PSSParameterSpec("SHA-1", "MGF1", null, 20, 1);
     }
@@ -212,12 +158,6 @@
      * Test for <code>getDigestAlgorithm()</code> method
      * Assertion: returns message digest algorithm name
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getDigestAlgorithm",
-        args = {}
-    )
     public final void testGetDigestAlgorithm() {
         PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1",
                 MGF1ParameterSpec.SHA1, 20, 1);
@@ -228,12 +168,6 @@
      * Test for <code>getMGFAlgorithm()</code> method
      * Assertion: returns mask generation function algorithm name
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getMGFAlgorithm",
-        args = {}
-    )
     public final void testGetMGFAlgorithm() {
         PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1",
                 MGF1ParameterSpec.SHA1, 20, 1);
@@ -244,12 +178,6 @@
      * Test #1 for <code>getMGFParameters()</code> method
      * Assertion: returns mask generation function parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getMGFParameters",
-        args = {}
-    )
     public final void testGetMGFParameters01() {
         PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1",
                 MGF1ParameterSpec.SHA1, 20, 1);
@@ -262,12 +190,6 @@
      * if <code>null</code> had been passed as
      * AlgorithmParameterSpec parameter to the ctor
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as a parameter.",
-        method = "getMGFParameters",
-        args = {}
-    )
     public final void testGetMGFParameters02() {
         PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1",
                 null, 20, 1);
@@ -279,12 +201,6 @@
      * Test for <code>getSaltLength()</code> method<br>
      * Assertion: returns salt length value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getSaltLength",
-        args = {}
-    )
     public final void testGetSaltLength() {
         PSSParameterSpec pssps = new PSSParameterSpec(20);
         assertEquals(20, pssps.getSaltLength());
@@ -294,12 +210,6 @@
      * Test for <code>getTrailerField()</code> method<br>
      * Assertion: returns trailer field value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getTrailerField",
-        args = {}
-    )
     public final void testGetTrailerField() {
         PSSParameterSpec pssps = new PSSParameterSpec("SHA-1", "MGF1",
                 MGF1ParameterSpec.SHA1, 20, 1);
@@ -310,12 +220,6 @@
      * Test for <code>DEFAULT</code> field<br>
      * Assertion: default message digest algorithm name is "SHA-1"
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the name of default message digest algorithm.",
-        method = "getDigestAlgorithm",
-        args = {}
-    )
     public final void testDEFAULTmdName() {
         assertEquals("SHA-1", PSSParameterSpec.DEFAULT.getDigestAlgorithm());
     }
@@ -324,12 +228,6 @@
      * Test for <code>DEFAULT</code> field<br>
      * Assertion: default mask generation function algorithm name is "MGF1"
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies the name of default mask generation function algorithm.",
-        method = "getMGFAlgorithm",
-        args = {}
-    )
     public final void testDEFAULTmgfName() {
         assertEquals("MGF1", PSSParameterSpec.DEFAULT.getMGFAlgorithm());
     }
@@ -339,12 +237,6 @@
      * Assertion: default algorithm parameters for mask
      * generation function are <code>MGF1ParameterSpec.SHA1</code>
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies default algorithm parameters for mask generation function.",
-        method = "getMGFParameters",
-        args = {}
-    )
     public final void testDEFAULTmgfSpec() {
         assertTrue(MGF1ParameterSpec.SHA1.equals(PSSParameterSpec.DEFAULT.getMGFParameters()));
     }
@@ -353,12 +245,6 @@
      * Test for <code>DEFAULT</code> field<br>
      * Assertion: default salt length value is 20
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getSaltLength",
-        args = {}
-    )
     public final void testDEFAULTsaltLen() {
         assertEquals(20, PSSParameterSpec.DEFAULT.getSaltLength());
     }
@@ -367,12 +253,6 @@
      * Test for <code>DEFAULT</code> field<br>
      * Assertion: default trailer field value is 1
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies default trailer field value.",
-        method = "getTrailerField",
-        args = {}
-    )
     public final void testDEFAULTtrailerField() {
         assertEquals(1, PSSParameterSpec.DEFAULT.getTrailerField());
     }
diff --git a/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java b/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java
index ae8317c..929034a 100644
--- a/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java
+++ b/luni/src/test/java/tests/security/spec/RSAKeyGenParameterSpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -37,7 +32,6 @@
  * Tests for <code>RSAKeyGenParameterSpec</code> class fields and methods.
  *
  */
-@TestTargetClass(RSAKeyGenParameterSpec.class)
 public class RSAKeyGenParameterSpecTest extends TestCase {
 
     /**
@@ -45,12 +39,6 @@
      * Assertion: constructs <code>RSAKeyGenParameterSpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "RSAKeyGenParameterSpec",
-        args = {int.class, java.math.BigInteger.class}
-    )
     public final void testRSAKeyGenParameterSpec() {
         AlgorithmParameterSpec aps =
             new RSAKeyGenParameterSpec(512, BigInteger.valueOf(0L));
@@ -61,12 +49,6 @@
      * Test for <code>getKeySize()</code> method<br>
      * Assertion: returns key size value
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getKeysize",
-        args = {}
-    )
     public final void testGetKeysize() {
         RSAKeyGenParameterSpec rkgps =
             new RSAKeyGenParameterSpec(512, BigInteger.valueOf(0L));
@@ -77,12 +59,6 @@
      * Test for <code>getPublicExponent()</code> method<br>
      * Assertion: returns public exponent value
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicExponent",
-        args = {}
-    )
     public final void testGetPublicExponent() {
         RSAKeyGenParameterSpec rkgps =
             new RSAKeyGenParameterSpec(512, BigInteger.valueOf(0L));
@@ -93,12 +69,6 @@
      * Test for <code>F0</code> field<br>
      * Assertion: the public exponent value F0 = 3
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Test for F0 field.",
-        method = "!Constants",
-        args = {}
-    )
     public final void testF0Value() {
         assertEquals(3, RSAKeyGenParameterSpec.F0.intValue());
     }
@@ -107,12 +77,6 @@
      * Test for <code>F4</code> field<br>
      * Assertion: the public exponent value F0 = 65537
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Test for F4 field.",
-        method = "!Constants",
-        args = {}
-    )
     public final void testF4Value() {
         assertEquals(65537, RSAKeyGenParameterSpec.F4.intValue());
     }
diff --git a/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java
index 8a50f25..bb6bc87 100644
--- a/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/RSAMultiPrimePrivateCrtKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -39,7 +34,6 @@
  * Tests for <code>RSAMultiPrimePrivateCrtKeySpec</code> class fields and methods.
  *
  */
-@TestTargetClass(RSAMultiPrimePrivateCrtKeySpec.class)
 public class RSAMultiPrimePrivateCrtKeySpecTest extends TestCase {
     /**
      * Reference array of RSAOtherPrimeInfo. DO NOT MODIFY
@@ -67,12 +61,6 @@
      * Assertion: constructs <code>RSAMultiPrimePrivateCrtKeySpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameters.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec01() {
         KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -101,12 +89,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if modulus is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec02() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -138,12 +120,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if publicExponent is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec03() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -175,12 +151,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if privateExponent is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec04() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -212,12 +182,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if primeP is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec05() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -249,12 +213,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if primeQ is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec06() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -286,12 +244,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if primeExponentP is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec07() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -323,12 +275,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if primeExponentQ is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec08() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -360,12 +306,6 @@
      * </code> ctor<br>
      * Assertion: NullPointerException if crtCoefficient is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec09() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -397,12 +337,6 @@
      * </code> ctor<br>
      * Assertion: otherPrimeInfo can be null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null otherPrimeInfo.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec10() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -434,12 +368,6 @@
      * </code> ctor<br>
      * Assertion: IllegalArgumentException if otherPrimeInfo length is 0
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies IllegalArgumentException.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec11() {
         try {
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -473,12 +401,6 @@
      * object using valid parameters. Constructed object must be
      * instance of RSAPrivateKeySpec.
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor using valid parameters. Constructed object must be instance of RSAPrivateKeySpec.",
-        method = "RSAMultiPrimePrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-    )
     public final void testRSAMultiPrimePrivateCrtKeySpec12() {
         KeySpec ks = new RSAMultiPrimePrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -497,12 +419,6 @@
      * Test for <code>getCrtCoefficient()</code> method<br>
      * Assertion: returns crt coefficient
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCrtCoefficient",
-        args = {}
-    )
     public final void testGetCrtCoefficient() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -522,12 +438,6 @@
      * Test for <code>getPrimeExponentP()</code> method<br>
      * Assertion: returns prime exponent P
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeExponentP",
-        args = {}
-    )
     public final void testGetPrimeExponentP() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -547,12 +457,6 @@
      * Test for <code>getPrimeExponentQ()</code> method<br>
      * Assertion: returns prime exponent Q
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeExponentQ",
-        args = {}
-    )
     public final void testGetPrimeExponentQ() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -572,12 +476,6 @@
      * Test for <code>getPrimeP()</code> method<br>
      * Assertion: returns prime P
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeP",
-        args = {}
-    )
     public final void testGetPrimeP() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -597,12 +495,6 @@
      * Test for <code>getPrimeQ()</code> method<br>
      * Assertion: returns prime Q
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeQ",
-        args = {}
-    )
     public final void testGetPrimeQ() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -622,12 +514,6 @@
      * Test for <code>getPublicExponent()</code> method<br>
      * Assertion: returns public exponent
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicExponent",
-        args = {}
-    )
     public final void testGetPublicExponent() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -647,12 +533,6 @@
      * Test #1 for <code>getOtherPrimeInfo()</code> method<br>
      * Assertion: returns array of RSAOtherPrimeInfo
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies positive case.",
-        method = "getOtherPrimeInfo",
-        args = {}
-    )
     public final void testGetOtherPrimeInfo01() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -673,12 +553,6 @@
      * Assertion: returns null if null has been passed to the
      * constructor as otherPrimeInfo parameter
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies that getOtherPrimeInfo returns null if there are only two prime factors.",
-        method = "getOtherPrimeInfo",
-        args = {}
-    )
     public final void testGetOtherPrimeInfo02() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -702,20 +576,6 @@
      * Tests that internal state of the object
      * can not be modified by modifying initial array
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies that internal state of the object can not be modified by modifying initial array.",
-            method = "RSAMultiPrimePrivateCrtKeySpec",
-            args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies that internal state of the object can not be modified by modifying initial array.",
-            method = "getOtherPrimeInfo",
-            args = {}
-        )
-    })
     public final void testIsStatePreserved1() {
         // Create initial array
         RSAOtherPrimeInfo[] opi1 = opi.clone();
@@ -747,20 +607,6 @@
      * returned by <code>getOtherPrimeInfo()</code>
      * method
      */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies that internal state of the object can not be modified using array reference returned by getOtherPrimeInfo() method.",
-            method = "RSAMultiPrimePrivateCrtKeySpec",
-            args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.security.spec.RSAOtherPrimeInfo[].class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.PARTIAL_COMPLETE,
-            notes = "Verifies that internal state of the object can not be modified using array reference returned by getOtherPrimeInfo() method.",
-            method = "getOtherPrimeInfo",
-            args = {}
-        )
-    })
     public final void testIsStatePreserved2() {
         // Create initial array
         RSAOtherPrimeInfo[] opi1 = opi.clone();
@@ -796,12 +642,6 @@
      * Test for <code>getModulus()</code> method<br>
      * Assertion: returns modulus
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModulus",
-        args = {}
-    )
     public final void testGetModulus() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
@@ -821,12 +661,6 @@
      * Test for <code>getPrivateExponent()</code> method<br>
      * Assertion: returns private exponent
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrivateExponent",
-        args = {}
-    )
     public final void testGetPrivateExponent() {
         RSAMultiPrimePrivateCrtKeySpec ks =
             new RSAMultiPrimePrivateCrtKeySpec(
diff --git a/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java b/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java
index b3343ee..ad128e0 100644
--- a/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java
+++ b/luni/src/test/java/tests/security/spec/RSAOtherPrimeInfoTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -36,7 +31,6 @@
  * Tests for <code>RSAOtherPrimeInfo</code> class fields and methods.
  *
  */
-@TestTargetClass(RSAOtherPrimeInfo.class)
 public class RSAOtherPrimeInfoTest extends TestCase {
 
     /**
@@ -44,12 +38,6 @@
      * Assertion: constructs <code>RSAOtherPrimeInfo</code>
      * object using valid parameter
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameters.",
-        method = "RSAOtherPrimeInfo",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAOtherPrimeInfo01() {
         Object o =
             new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
@@ -62,12 +50,6 @@
      * Test #2 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
      * Assertion: NullPointerException if prime is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAOtherPrimeInfo",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAOtherPrimeInfo02() {
         try {
             new RSAOtherPrimeInfo(null,
@@ -82,12 +64,6 @@
      * Test #3 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
      * Assertion: NullPointerException if primeExponent is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAOtherPrimeInfo",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAOtherPrimeInfo03() {
         try {
             new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
@@ -102,12 +78,6 @@
      * Test #4 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
      * Assertion: NullPointerException if crtCoefficient is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAOtherPrimeInfo",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAOtherPrimeInfo04() {
         try {
             new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
@@ -122,12 +92,6 @@
      * Test #5 for <code>RSAOtherPrimeInfo(BigInteger,BigInteger,BigInteger)</code> ctor
      * Assertion: NullPointerException if prime and crtCoefficient is null
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies NullPointerException.",
-        method = "RSAOtherPrimeInfo",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAOtherPrimeInfo05() {
         try {
             new RSAOtherPrimeInfo(null,
@@ -142,12 +106,6 @@
      * Test for <code>getCrtCoefficient()</code> method<br>
      * Assertion: returns CRT coefficient value
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCrtCoefficient",
-        args = {}
-    )
     public final void testGetCrtCoefficient() {
         RSAOtherPrimeInfo ropi =
             new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
@@ -160,12 +118,6 @@
      * Test for <code>getPrime()</code> method<br>
      * Assertion: returns prime value
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrime",
-        args = {}
-    )
     public final void testGetPrime() {
         RSAOtherPrimeInfo ropi =
             new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
@@ -178,12 +130,6 @@
      * Test for <code>getExponent()</code> method<br>
      * Assertion: returns prime exponent value
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getExponent",
-        args = {}
-    )
     public final void testGetExponent() {
         RSAOtherPrimeInfo ropi =
             new RSAOtherPrimeInfo(BigInteger.valueOf(1L),
diff --git a/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java
index 392e998..f19ecc7 100644
--- a/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/RSAPrivateCrtKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -38,7 +33,6 @@
  * Tests for <code>RSAPrivateCrtKeySpec</code> class fields and methods
  *
  */
-@TestTargetClass(RSAPrivateCrtKeySpec.class)
 public class RSAPrivateCrtKeySpecTest extends TestCase {
 
     /**
@@ -46,12 +40,6 @@
      * Assertion: Constructs <code>RSAPrivateCrtKeySpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameters.",
-        method = "RSAPrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAPrivateCrtKeySpec01() {
         KeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -70,12 +58,6 @@
      * Assertion: Constructs <code>RSAPrivateCrtKeySpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameters.",
-        method = "RSAPrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAPrivateCrtKeySpec02() {
         KeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -94,12 +76,6 @@
      * Assertion: Constructs <code>RSAPrivateCrtKeySpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "RSAPrivateCrtKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAPrivateCrtKeySpec03() {
         new RSAPrivateCrtKeySpec(
                 null,
@@ -116,12 +92,6 @@
      * Test for <code>getCrtCoefficient()</code> method<br>
      * Assertion: returns crt coefficient
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getCrtCoefficient",
-        args = {}
-    )
     public final void testGetCrtCoefficient() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -139,12 +109,6 @@
      * Test for <code>getPrimeExponentP()</code> method<br>
      * Assertion: returns prime exponent P
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeExponentP",
-        args = {}
-    )
     public final void testGetPrimeExponentP() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -162,12 +126,6 @@
      * Test for <code>getPrimeExponentQ()</code> method<br>
      * Assertion: returns prime exponent Q
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeExponentQ",
-        args = {}
-    )
     public final void testGetPrimeExponentQ() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -185,12 +143,6 @@
      * Test for <code>getPrimeP()</code> method<br>
      * Assertion: returns prime P
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeP",
-        args = {}
-    )
     public final void testGetPrimeP() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -208,12 +160,6 @@
      * Test for <code>getPrimeQ()</code> method<br>
      * Assertion: returns prime Q
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrimeQ",
-        args = {}
-    )
     public final void testGetPrimeQ() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -231,12 +177,6 @@
      * Test for <code>getPublicExponent()</code> method<br>
      * Assertion: returns public exponent
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicExponent",
-        args = {}
-    )
     public final void testGetPublicExponent() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
@@ -258,12 +198,6 @@
      * Test for <code>getModulus()</code> method<br>
      * Assertion: returns modulus
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModulus",
-        args = {}
-    )
     public final void testGetModulus() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.valueOf(5L),
@@ -281,12 +215,6 @@
      * Test for <code>getPrivateExponent()</code> method<br>
      * Assertion: returns private exponent
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrivateExponent",
-        args = {}
-    )
     public final void testGetPrivateExponent() {
         RSAPrivateCrtKeySpec ks = new RSAPrivateCrtKeySpec(
                 BigInteger.ONE,
diff --git a/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java
index f231fd7..411d4d2 100644
--- a/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/RSAPrivateKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -37,7 +32,6 @@
  * Tests for <code>RSAPrivateKeySpec</code> class fields and methods
  *
  */
-@TestTargetClass(RSAPrivateKeySpec.class)
 public class RSAPrivateKeySpecTest extends TestCase {
 
     /**
@@ -45,12 +39,6 @@
      * Assertion: constructs <code>RSAPrivateKeySpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "RSAPrivateKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAPrivateKeySpec() {
         KeySpec ks = new RSAPrivateKeySpec(BigInteger.valueOf(1234567890L),
                                            BigInteger.valueOf(3L));
@@ -61,12 +49,6 @@
      * Test for <code>getModulus()</code> method<br>
      * Assertion: returns modulus
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModulus",
-        args = {}
-    )
     public final void testGetModulus() {
         RSAPrivateKeySpec rpks =
             new RSAPrivateKeySpec(BigInteger.valueOf(1234567890L),
@@ -78,12 +60,6 @@
      * Test for <code>getPrivateExponent()</code> method<br>
      * Assertion: returns private exponent
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPrivateExponent",
-        args = {}
-    )
     public final void testGetPrivateExponent() {
         RSAPrivateKeySpec rpks =
             new RSAPrivateKeySpec(BigInteger.valueOf(1234567890L),
diff --git a/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java b/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java
index 7a46160..96a1034 100644
--- a/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/RSAPublicKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.math.BigInteger;
@@ -37,7 +32,6 @@
  * Tests for <code>RSAPublicKeySpec</code> class fields and methods
  *
  */
-@TestTargetClass(RSAPublicKeySpec.class)
 public class RSAPublicKeySpecTest extends TestCase {
 
     /**
@@ -45,12 +39,6 @@
      * Assertion: Constructs <code>RSAPublicKeySpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies constructor with valid parameters.",
-        method = "RSAPublicKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAPublicKeySpec01() {
         KeySpec ks =
             new RSAPublicKeySpec(BigInteger.valueOf(1234567890L),
@@ -64,12 +52,6 @@
      * Assertion: Constructs <code>RSAPublicKeySpec</code>
      * object using valid parameters
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Verifies null as parameters.",
-        method = "RSAPublicKeySpec",
-        args = {java.math.BigInteger.class, java.math.BigInteger.class}
-    )
     public final void testRSAPublicKeySpec02() {
         KeySpec ks =
             new RSAPublicKeySpec(null, null);
@@ -81,12 +63,6 @@
      * Test for <code>getModulus()</code> method<br>
      * Assertion: returns modulus
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getModulus",
-        args = {}
-    )
     public final void testGetModulus() {
         RSAPublicKeySpec rpks =
             new RSAPublicKeySpec(BigInteger.valueOf(1234567890L),
@@ -98,12 +74,6 @@
      * Test for <code>getPublicExponent()</code> method<br>
      * Assertion: returns public exponent
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getPublicExponent",
-        args = {}
-    )
     public final void testGetPublicExponent() {
         RSAPublicKeySpec rpks =
             new RSAPublicKeySpec(BigInteger.valueOf(3L),
diff --git a/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java b/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java
index 0ccbf52..1292983 100644
--- a/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java
+++ b/luni/src/test/java/tests/security/spec/X509EncodedKeySpecTest.java
@@ -22,11 +22,6 @@
 
 package tests.security.spec;
 
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
 import junit.framework.TestCase;
 
 import java.security.spec.EncodedKeySpec;
@@ -38,7 +33,6 @@
  * Tests for <code>X509EncodedKeySpec</code> class fields and methods
  *
  */
-@TestTargetClass(X509EncodedKeySpec.class)
 public class X509EncodedKeySpecTest extends TestCase {
 
     //
@@ -50,12 +44,6 @@
      * Assertion: constructs new <code>X509EncodedKeySpec</code>
      * object using valid parameter
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "X509EncodedKeySpec",
-        args = {byte[].class}
-    )
     public final void testX509EncodedKeySpec() {
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
 
@@ -74,12 +62,6 @@
      * Test for <code>getEncoded()</code> method<br>
      * Assertion: returns encoded key
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testGetEncoded() {
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
 
@@ -94,12 +76,6 @@
      * Test for <code>getFormat()</code> method
      * Assertion: returns format name (always "X.509")
      */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getFormat",
-        args = {}
-    )
     public final void testGetFormat() {
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
 
@@ -113,12 +89,6 @@
      * can not be changed by modifying initial
      * array value
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testIsStatePreserved1() {
         // Reference array
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
@@ -143,12 +113,6 @@
      * can not be modified using returned value
      * of <code>getEncoded()</code> method
      */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "",
-        method = "getEncoded",
-        args = {}
-    )
     public final void testIsStatePreserved2() {
         // Reference array
         byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
diff --git a/luni/src/test/java/tests/sql/AllTests.java b/luni/src/test/java/tests/sql/AllTests.java
deleted file mode 100644
index e782d84..0000000
--- a/luni/src/test/java/tests/sql/AllTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the Math project.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All SQL test suites");
-        // $JUnit-BEGIN$
-        suite.addTest(tests.java.sql.AllTests.suite());
-
-        // These don't do blackbox testing *and* crash JUnit on the RI
-        // suite.addTest(tests.SQLite.AllTests.suite());
-
-        suite.addTestSuite(tests.sql.ConnectionTest.class);
-        suite.addTestSuite(tests.sql.PreparedStatementTest.class);
-        suite.addTestSuite(tests.sql.ResultSetGetterTests.class);
-        suite.addTestSuite(tests.sql.ResultSetMetaDataTest.class);
-        suite.addTestSuite(tests.sql.ResultSetTest.class);
-        suite.addTestSuite(tests.sql.StatementTest.class);
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/sql/ArrayTest.java b/luni/src/test/java/tests/sql/ArrayTest.java
deleted file mode 100644
index f3b49d6..0000000
--- a/luni/src/test/java/tests/sql/ArrayTest.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.Array;
-import java.util.Map;
-
-/**
- * @author andrea@google.com (Your Name Here)
- *
- */
-@TestTargetClass(Array.class)
-public class ArrayTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.Array#getArray()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getArray",
-      args = {}
-    )
-    public void testGetArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getArray(long, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getArray",
-      args = {long.class, int.class}
-    )
-    public void testGetArrayLongInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getArray(long, int, java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getArray",
-      args = {long.class, int.class, Map.class}
-    )
-    public void testGetArrayLongIntMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getArray(java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getArray",
-      args = {Map.class}
-    )
-    public void testGetArrayMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getBaseType()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBaseType",
-      args = {}
-    )
-    public void testGetBaseType() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getBaseTypeName()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBaseTypeName",
-      args = {}
-    )
-    public void testGetBaseTypeName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getResultSet()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getResultSet",
-      args = {}
-    )
-    public void testGetResultSet() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getResultSet(long, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getResultSet",
-      args = {long.class, int.class}
-    )
-    public void testGetResultSetLongInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getResultSet(long, int, java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getResultSet",
-      args = {long.class, int.class, Map.class}
-    )
-    public void testGetResultSetLongIntMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Array#getResultSet(java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getResultSet",
-      args = {Map.class}
-    )
-    public void testGetResultSetMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/BlobTest.java b/luni/src/test/java/tests/sql/BlobTest.java
deleted file mode 100644
index 43fb2a6..0000000
--- a/luni/src/test/java/tests/sql/BlobTest.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.Blob;
-
-/**
- * @author andrea@google.com (Your Name Here)
- *
- */
-@TestTargetClass(Blob.class)
-public class BlobTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.Blob#getBinaryStream()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBinaryStream",
-      args = {}
-      )
-    public void testGetBinaryStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#getBytes(long, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBytes",
-      args = {long.class, int.class}
-      )
-    public void testGetBytes() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#length()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "length",
-      args = {}
-      )
-    public void testLength() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#position(java.sql.Blob, long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "position",
-      args = {Blob.class, long.class}
-      )
-    public void testPositionBlobLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#position(byte[], long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method =  "position",
-      args = {byte[].class, long.class}
-    )
-    public void testPositionByteArrayLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#setBinaryStream(long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setBinaryStream",
-      args = {long.class}
-      )
-    public void testSetBinaryStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#setBytes(long, byte[])}.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method  = "setBytes",
-            args = {long.class, byte[].class}
-    )
-    public void testSetBytesLongByteArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#setBytes(long, byte[], int, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setBytes",
-      args = {long.class, byte[].class, int.class, int.class}
-      )
-    public void testSetBytesLongByteArrayIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Blob#truncate(long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "truncate",
-      args = {long.class}
-      )
-    public void testTruncate() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/CallableStatementTest.java b/luni/src/test/java/tests/sql/CallableStatementTest.java
deleted file mode 100644
index db7aca1..0000000
--- a/luni/src/test/java/tests/sql/CallableStatementTest.java
+++ /dev/null
@@ -1,1070 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-import java.sql.CallableStatement;
-import java.sql.Date;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Calendar;
-import java.util.Map;
-
-/**
- * @author andrea@google.com (Your Name Here)
- *
- */
-@TestTargetClass(CallableStatement.class)
-public class CallableStatementTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getArray(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getArray",
-          args = {int.class}
-      )
-    public void testGetArrayInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getArray(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getArray",
-      args = {String.class}
-    )
-    public void testGetArrayString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBigDecimal(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBigDecimal",
-      args = {int.class}
-    )
-    public void testGetBigDecimalInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBigDecimal(int, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBigDecimal",
-      args = {int.class, int.class}
-    )
-    public void testGetBigDecimalIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBigDecimal(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBigDecimal",
-      args = {String.class}
-    )
-    public void testGetBigDecimalString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBlob(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBlob",
-      args = {int.class}
-    )
-    public void testGetBlobInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBlob(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBlob",
-      args = {String.class}
-    )
-    public void testGetBlobString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBoolean(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBoolean",
-      args = {int.class}
-    )
-    public void testGetBooleanInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBoolean(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBoolean",
-      args = {String.class}
-    )
-    public void testGetBooleanString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getByte(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getByte",
-      args = {int.class}
-    )
-    public void testGetByteInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getByte(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getByte",
-      args = {String.class}
-    )
-    public void testGetByteString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBytes(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBytes",
-      args = {int.class}
-    )
-    public void testGetBytesInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getBytes(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBytes",
-      args = {String.class}
-    )
-    public void testGetBytesString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getClob(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getClob",
-      args = {int.class}
-    )
-    public void testGetClobInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getClob(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getClob",
-      args = {String.class}
-    )
-    public void testGetClobString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getDate(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getDate",
-      args = {int.class}
-    )
-    public void testGetDateInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getDate(int, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getDate",
-      args = {int.class, Calendar.class}
-    )
-    public void testGetDateIntCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getDate(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getDate",
-      args = {String.class}
-    )
-    public void testGetDateString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getDate(java.lang.String, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getDate",
-      args = {String.class, Calendar.class}
-    )
-    public void testGetDateStringCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getDouble(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getDouble",
-      args = {int.class}
-    )
-    public void testGetDoubleInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getDouble(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getDouble",
-      args = {String.class}
-    )
-    public void testGetDoubleString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getFloat(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getFloat",
-      args = {int.class}
-    )
-    public void testGetFloatInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getFloat(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getFloat",
-      args = {String.class}
-    )
-    public void testGetFloatString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getInt(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getInt",
-      args = {int.class}
-    )
-    public void testGetIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getInt(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getInt",
-      args = {String.class}
-    )
-    public void testGetIntString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getLong(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getLong",
-      args = {int.class}
-    )
-    public void testGetLongInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getLong(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getLong",
-      args = {String.class}
-    )
-    public void testGetLongString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getObject(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getObject",
-      args = {int.class}
-    )
-    public void testGetObjectInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getObject(int, java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getObject",
-      args = {int.class, Map.class}
-    )
-    public void testGetObjectIntMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getObject(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getObject",
-      args = {String.class}
-    )
-    public void testGetObjectString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getObject(java.lang.String, java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getObject",
-      args = {String.class, Map.class}
-    )
-    public void testGetObjectStringMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getRef(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getRef",
-      args = {int.class}
-    )
-    public void testGetRefInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getRef(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getRef",
-      args = {String.class}
-    )
-    public void testGetRefString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getShort(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getShort",
-      args = {int.class}
-    )
-    public void testGetShortInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getShort(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getShort",
-      args = {String.class}
-    )
-    public void testGetShortString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getString(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getString",
-      args = {int.class}
-    )
-    public void testGetStringInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getString(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getString",
-      args = {String.class}
-    )
-    public void testGetStringString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTime(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTime",
-      args = {int.class}
-    )
-    public void testGetTimeInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTime(int, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTime",
-      args = {int.class, Calendar.class}
-    )
-    public void testGetTimeIntCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTime(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTime",
-      args = {String.class}
-    )
-    public void testGetTimeString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTime(java.lang.String, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTime",
-      args = {String.class, Calendar.class}
-    )
-    public void testGetTimeStringCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTimestamp(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTimestamp",
-      args = {int.class}
-    )
-    public void testGetTimestampInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTimestamp(int, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTimestamp",
-      args = {int.class, Calendar.class}
-    )
-    public void testGetTimestampIntCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTimestamp(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTimestamp",
-      args = {String.class}
-    )
-    public void testGetTimestampString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getTimestamp(java.lang.String, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getTimestamp",
-      args = {String.class, Calendar.class}
-    )
-    public void testGetTimestampStringCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getURL(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getURL",
-      args = {int.class}
-    )
-    public void testGetURLInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#getURL(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getURL",
-      args = {String.class}
-    )
-    public void testGetURLString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#registerOutParameter(int, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "registerOutParameter",
-      args = {int.class, int.class}
-    )
-    public void testRegisterOutParameterIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#registerOutParameter(int, int, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "registerOutParameter",
-      args = {int.class, int.class, int.class}
-    )
-    public void testRegisterOutParameterIntIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#registerOutParameter(int, int, java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "registerOutParameter",
-      args = {int.class, int.class, String.class}
-    )
-    public void testRegisterOutParameterIntIntString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#registerOutParameter(java.lang.String, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "registerOutParameter",
-      args = {String.class, int.class}
-    )
-    public void testRegisterOutParameterStringInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#registerOutParameter(java.lang.String, int, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "registerOutParameter",
-      args = {String.class, int.class, int.class}
-    )
-    public void testRegisterOutParameterStringIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#registerOutParameter(java.lang.String, int, java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "registerOutParameter",
-      args = {String.class, int.class, String.class}
-    )
-    public void testRegisterOutParameterStringIntString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setAsciiStream(java.lang.String, java.io.InputStream, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setAsciiStream",
-      args = {String.class, InputStream.class, int.class}
-    )
-    public void testSetAsciiStreamStringInputStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setBigDecimal(java.lang.String, java.math.BigDecimal)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setBigDecimal",
-      args = {String.class, BigDecimal.class}
-    )
-    public void testSetBigDecimalStringBigDecimal() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setBinaryStream(java.lang.String, java.io.InputStream, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setBinaryStream",
-      args = {String.class, InputStream.class, int.class}
-    )
-    public void testSetBinaryStreamStringInputStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setBoolean(java.lang.String, boolean)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setBoolean",
-      args = {String.class, boolean.class}
-    )
-    public void testSetBooleanStringBoolean() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setByte(java.lang.String, byte)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setByte",
-      args = {String.class, byte.class}
-    )
-    public void testSetByteStringByte() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setBytes(java.lang.String, byte[])}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setBytes",
-      args = {String.class, byte[].class}
-    )
-    public void testSetBytesStringByteArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setCharacterStream(java.lang.String, java.io.Reader, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setCharacterStream",
-      args = {String.class, Reader.class, int.class}
-    )
-    public void testSetCharacterStreamStringReaderInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setDate(java.lang.String, java.sql.Date)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setDate",
-      args = {String.class, Date.class}
-    )
-    public void testSetDateStringDate() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setDate(java.lang.String, java.sql.Date, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setDate",
-      args = {String.class, Date.class, Calendar.class}
-    )
-    public void testSetDateStringDateCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setDouble(java.lang.String, double)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setDouble",
-      args = {String.class, double.class}
-    )
-    public void testSetDoubleStringDouble() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setFloat(java.lang.String, float)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setFloat",
-      args = {String.class, float.class}
-    )
-    public void testSetFloatStringFloat() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setInt(java.lang.String, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setInt",
-      args = {String.class, int.class}
-    )
-    public void testSetIntStringInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setLong(java.lang.String, long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setLong",
-      args = {String.class, long.class}
-    )
-    public void testSetLongStringLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setNull(java.lang.String, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setNull",
-      args = {String.class, int.class}
-    )
-    public void testSetNullStringInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setNull(java.lang.String, int, java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setNull",
-      args = {String.class, int.class, String.class}
-    )
-    public void testSetNullStringIntString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setObject(java.lang.String, java.lang.Object)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setObject",
-      args = {String.class, Object.class}
-    )
-    public void testSetObjectStringObject() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setObject(java.lang.String, java.lang.Object, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setObject",
-      args = {String.class, Object.class, int.class}
-    )
-    public void testSetObjectStringObjectInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setObject(java.lang.String, java.lang.Object, int, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setObject",
-      args = {String.class, Object.class, int.class, int.class}
-    )
-    public void testSetObjectStringObjectIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setShort(java.lang.String, short)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setShort",
-      args = {String.class, short.class}
-    )
-    public void testSetShortStringShort() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setString(java.lang.String, java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setString",
-      args = {String.class, String.class}
-    )
-    public void testSetStringStringString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setTime(java.lang.String, java.sql.Time)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setTime",
-      args = {String.class, Time.class}
-    )
-    public void testSetTimeStringTime() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setTime(java.lang.String, java.sql.Time, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setTime",
-      args = {String.class, Time.class, Calendar.class}
-    )
-    public void testSetTimeStringTimeCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setTimestamp(java.lang.String, java.sql.Timestamp)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setTimestamp",
-      args = {String.class, Timestamp.class}
-    )
-    public void testSetTimestampStringTimestamp() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setTimestamp(java.lang.String, java.sql.Timestamp, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setTimestamp",
-      args = {String.class, Timestamp.class, Calendar.class}
-    )
-    public void testSetTimestampStringTimestampCalendar() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#setURL(java.lang.String, java.net.URL)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "setURL",
-      args = {String.class, URL.class}
-    )
-    public void testSetURLStringURL() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.CallableStatement#wasNull()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "wasNull",
-      args = {}
-    )
-    public void testWasNull() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/ClobTest.java b/luni/src/test/java/tests/sql/ClobTest.java
deleted file mode 100644
index c0f218f..0000000
--- a/luni/src/test/java/tests/sql/ClobTest.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.Clob;
-
-/**
- * @author andrea@google.com (Your Name Here)
- *
- */
-@TestTargetClass(Clob.class)
-public class ClobTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.Clob#getAsciiStream()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getAsciiStream",
-          args = {}
-      )
-    public void testGetAsciiStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#getCharacterStream()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getCharacterStream",
-          args = {}
-      )
-    public void testGetCharacterStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#getSubString(long, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getSubString",
-          args = {long.class, int.class}
-      )
-    public void testGetSubString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#length()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "length",
-          args = {}
-      )
-    public void testLength() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#position(java.sql.Clob, long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "position",
-          args = {Clob.class, long.class}
-      )
-    public void testPositionClobLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#position(java.lang.String, long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "position",
-          args = {String.class, long.class}
-      )
-    public void testPositionStringLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#setAsciiStream(long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "setAsciiStream",
-          args = {long.class}
-      )
-    public void testSetAsciiStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#setCharacterStream(long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "setCharacterStream",
-          args = {long.class}
-      )
-    public void testSetCharacterStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#setString(long, java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "setString",
-          args = {long.class, String.class}
-      )
-    public void testSetStringLongString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#setString(long, java.lang.String, int, int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "setString",
-          args = {long.class, String.class, int.class, int.class}
-      )
-    public void testSetStringLongStringIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Clob#truncate(long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "truncate",
-          args = {long.class}
-      )
-    public void testTruncate() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/ParameterMetaDataTest.java b/luni/src/test/java/tests/sql/ParameterMetaDataTest.java
deleted file mode 100644
index f522450..0000000
--- a/luni/src/test/java/tests/sql/ParameterMetaDataTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.ParameterMetaData;
-
-/**
- *
- */
-@TestTargetClass(ParameterMetaData.class)
-public class ParameterMetaDataTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#getParameterClassName(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getParameterClassName",
-          args = {int.class}
-    )
-    public void testGetParameterClassName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#getParameterCount()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getParameterCount",
-          args = {}
-      )
-    public void testGetParameterCount() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#getParameterMode(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getParameterMode",
-          args = {int.class}
-      )
-    public void testGetParameterMode() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#getParameterType(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getParameterType",
-          args = {int.class}
-      )
-    public void testGetParameterType() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#getParameterTypeName(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getParameterTypeName",
-          args = {int.class}
-      )
-    public void testGetParameterTypeName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#getPrecision(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getPrecision",
-          args = {int.class}
-      )
-    public void testGetPrecision() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#getScale(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getScale",
-          args = {int.class}
-      )
-    public void testGetScale() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#isNullable(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "isNullable",
-          args = {int.class}
-      )
-    public void testIsNullable() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ParameterMetaData#isSigned(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "isSigned",
-          args = {int.class}
-      )
-    public void testIsSigned() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/RefTest.java b/luni/src/test/java/tests/sql/RefTest.java
deleted file mode 100644
index 6109623..0000000
--- a/luni/src/test/java/tests/sql/RefTest.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.Ref;
-import java.util.Map;
-
-/**
- * @author andrea@google.com (Your Name Here)
- *
- */
-@TestTargetClass(Ref.class)
-public class RefTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.Ref#getBaseTypeName()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getBaseTypeName",
-      args = {}
-      )
-    public void testGetBaseTypeName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Ref#getObject()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getObject",
-      args = {}
-      )
-    public void testGetObject() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Ref#getObject(java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getObject",
-      args = {Map.class}
-      )
-    public void testGetObjectMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Ref#setObject(java.lang.Object)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "setObject",
-          args = {Object.class}
-    )
-    public void testSetObject() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/ResultSetGetterTests.java b/luni/src/test/java/tests/sql/ResultSetGetterTests.java
deleted file mode 100644
index 5cb50d5..0000000
--- a/luni/src/test/java/tests/sql/ResultSetGetterTests.java
+++ /dev/null
@@ -1,2183 +0,0 @@
-/*
- * Copyright (C) 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.sql.DatabaseMetaData;
-import java.sql.Date;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Time;
-import java.sql.Timestamp;
-import java.util.Arrays;
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.ListIterator;
-
-/**
- * Tests based on
- * <a href="http://java.sun.com/products/jdbc/download.html">JDBC 1.0 API spec
- * </a> Table 1.0
- */
-@TestTargetClass(ResultSet.class)
-public class ResultSetGetterTests extends SQLTest {
-
-    String queryAllSelect = "select * from type";
-
-    ResultSet res = null;
-
-    Statement st = null;
-
-    // Judgement concerning support is based on the result of ResultSet.getOject
-    // and Table 1 of JDBC 1.0 spec.
-    static boolean booleanSupported = false;
-    static boolean blobSupported = false;
-    static boolean bigIntSupported = false;
-    static boolean smallIntSupported = false;
-    static boolean mediumIntSupported = false;
-    static boolean realSupported = false;
-    static boolean floatSupported = false;
-    static boolean dateSupported = false;
-    static boolean timeSupported = false;
-    static boolean timeStampSupported = false;
-    static boolean dateTimeSupported = false;
-    static boolean urlSupported= false;
-    static boolean tinyIntSupported = false;
-    static boolean decimalSupported = false;
-    static boolean numericSupported = false;
-
-    static List<String> colNames = Arrays.asList("BoolVal", "IntVal", "LongVal",
-            "Bint", "Tint", "Sint", "Mint", "IntegerVal", "RealVal",
-            "DoubleVal", "FloatVal", "DecVal", "NumVal", "charStr",
-            "dateVal", "timeVal", "TS", "DT", "TBlob", "BlobVal", "MBlob",
-            "LBlob", "TText", "TextVal", "MText", "LText", "MaxLongVal",
-            "MinLongVal", "validURL", "invalidURL");
-
-    static List<String> values = Arrays.asList("1", "-1", "22", "2", "33",
-         "3","1","2","3.9","23.2","33.3","44",
-        "5", "test string", "1799-05-26", "12:35:45", "2007-10-09 14:28:02.0",
-        "1221-09-22 10:11:55","1","2","3","4","Test text message tiny",
-        "Test text", "Test text message medium",
-        "Test text message long");
-
-    static boolean[] supported = new boolean[]{
-        booleanSupported,
-        true,
-        true,
-        bigIntSupported,
-        tinyIntSupported,
-        smallIntSupported,
-        mediumIntSupported,
-        true,
-        realSupported,
-        true,
-        floatSupported,
-        decimalSupported,
-        numericSupported,
-        true,
-        dateSupported,
-        timeSupported,
-        timeStampSupported,
-        dateTimeSupported,
-        blobSupported,
-        blobSupported,
-        blobSupported,
-        blobSupported,
-        true,
-        true,
-        true,
-        true,
-        bigIntSupported,
-        bigIntSupported,
-        urlSupported,
-        urlSupported
-      };
-
-    // Not supported: BIT,VARBINARY, LONGVARBINARY, BINARY, VARCHAR, LONGVARCHAR
-    static Class[] typeMap = new Class[]{
-            java.lang.String.class, //
-            java.lang.Integer.class,//Types.INTEGER,
-            java.lang.Integer.class, //Types.LONG, not a JDBC 1.0 type
-            java.lang.Long.class,  // Types.BIGINT,
-            java.lang.Byte.class,            // Types.TINYINT,
-            java.lang.Short.class, // Types.SMALLINT,
-            java.lang.Integer.class, //Types.MEDIUMINT, , not a JDBC 1.0 type
-            java.lang.Integer.class, // Types.Integer
-            java.lang.Float.class,   // Types.REAL,
-            java.lang.Double.class,  // Types.FLOAT,
-            java.lang.Double.class, // Types.DOUBLE,
-            java.math.BigDecimal.class, // Types.DECIMAL,
-            java.math.BigDecimal.class, // Types.NUMERIC,
-            java.lang.String.class,     // Types.CHAR
-            java.sql.Date.class,        // Types.DATE,
-            java.sql.Time.class,        // Types.TIME,
-            java.sql.Timestamp.class,  // Types.TIMESTAMP,
-            java.sql.Date.class,       // types datetime, not a JDBC 1.0 type
-            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
-            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
-            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
-            java.sql.Blob.class,       // Types.BLOB, not a JDBC 1.0 type
-            java.lang.String.class,    // not a JDBC 1.0 type
-            java.lang.String.class,    // not a JDBC 1.0 type
-            java.lang.String.class,    // not a JDBC 1.0 type
-            java.lang.String.class,    // not a JDBC 1.0 type
-            java.lang.Long.class,      // Types.BIGINT,
-            java.lang.Long.class,      // Types.BIGINT,
-            java.net.URL.class,        // not a JDBC 1.0 type
-            java.net.URL.class         // not a JDBC 1.0 type
-
-
-    };
-
-    // first inserted row : actual values
-    // second inserted row: null values
-    String[] queries = {
-            "create table type (" +
-
-            " BoolVal BOOLEAN," + " IntVal INT," + " LongVal LONG,"
-                    + " Bint BIGINT," + " Tint TINYINT," + " Sint SMALLINT,"
-                    + " Mint MEDIUMINT, " +
-
-                    " IntegerVal INTEGER, " + " RealVal REAL, "
-                    + " DoubleVal DOUBLE, " + " FloatVal FLOAT, "
-                    + " DecVal DECIMAL, " +
-
-                    " NumVal NUMERIC, " + " charStr CHAR(20), "
-                    + " dateVal DATE, " + " timeVal TIME, " + " TS TIMESTAMP, "
-                    +
-
-                    " DT DATETIME, " + " TBlob TINYBLOB, " + " BlobVal BLOB, "
-                    + " MBlob MEDIUMBLOB, " + " LBlob LONGBLOB, " +
-
-                    " TText TINYTEXT, " + " TextVal TEXT, "
-                    + " MText MEDIUMTEXT, " + " LText LONGTEXT, " +
-
-                    " MaxLongVal BIGINT, MinLongVal BIGINT, "+
-
-                    " validURL URL, invalidURL URL "+
-
-                    ");"
-             ,
-
-            "insert into type (BoolVal, IntVal, LongVal, Bint, Tint, Sint, Mint,"
-                    + "IntegerVal, RealVal, DoubleVal, FloatVal, DecVal,"
-                    + "NumVal, charStr, dateVal, timeVal, TS,"
-                    + "DT, TBlob, BlobVal, MBlob, LBlob,"
-                    + "TText, TextVal, MText, LText, MaxLongVal, MinLongVal,"
-                    + " validURL, invalidURL"
-                    + ") "
-                    + "values (1, -1, 22, 2, 33,"
-                    + "3, 1, 2, 3.9, 23.2, 33.3, 44,"
-                    + "5, 'test string', '1799-05-26', '12:35:45', '2007-10-09 14:28:02.0',"
-                    + "'1221-09-22 10:11:55', 1, 2, 3, 4,"
-                    + "'Test text message tiny', 'Test text',"
-                    + " 'Test text message medium', 'Test text message long', "
-                    + Long.MAX_VALUE+", "+Long.MIN_VALUE+", "
-                    + "'http://www.android.com', 'helloWorld' "+
-                    ");"
-            ,
-
-           "insert into type (BoolVal, IntVal, LongVal, Bint, Tint, Sint, Mint,"
-                    + "IntegerVal, RealVal, DoubleVal, FloatVal, DecVal,"
-                    + "NumVal, charStr, dateVal, timeVal, TS,"
-                    + "DT, TBlob, BlobVal, MBlob, LBlob,"
-                    + "TText, TextVal, MText, LText, MaxLongVal, MinLongVal,"
-                    +" validURL, invalidURL"
-                    + ") "
-                    + "values (null, null, null, null, null,"
-                    + "null, null, null, null, null, null, null,"
-                    + "null, null, null, null, null,"
-                    + "null, null, null, null, null,"
-                    + "null, null, null, null,null, null, null, null);"
-    };
-
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        try {
-            conn.setAutoCommit(false);
-            st = conn.createStatement();
-            for (int i = 0; i < queries.length; i++) {
-                st.execute(queries[i]);
-            }
-            res = st.executeQuery(queryAllSelect);
-            assertTrue(res.next());
-        } catch (SQLException e) {
-            fail("SQLException is thrown: " + e.getMessage());
-        }
-    }
-
-    public void tearDown() {
-        try {
-            st.execute("drop table if exists type");
-            st.close();
-            res.close();
-        } catch (SQLException e) {
-            fail("SQLException is thrown "+e.getMessage());
-        } finally {
-            try {
-                st.close();
-                res.close();
-            } catch (SQLException ee) {
-            }
-        }
-        super.tearDown();
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBytes(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Exception testing",
-        method = "getBytes",
-        args = {int.class}
-    )
-    public void testGetBytesInt() {
-        int i = 1;
-
-
-        // null value
-        try {
-            i = 1;
-            res.next();
-            for (String t : values) {
-                assertNull(res.getBytes(i));
-                i++;
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.close();
-            res.getBytes(24);
-            fail("Should get Exception");
-        } catch (SQLException e) {
-            //ok
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBytes(int)}.
-     * @throws SQLException
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "VARBINARY value",
-        method = "getBytes",
-        args = {int.class}
-    )
-    public void testGetBytesIntVarbinary() throws SQLException {
-
-        Statement st = null;
-        Statement stQuery = null;
-        PreparedStatement stPrep = null;
-        ResultSet res = null;
-
-        // setup
-        try {
-            String testString = "HelloWorld";
-            st = conn.createStatement();
-            st.executeUpdate("create table testBinary (VARBINARY value);");
-            stPrep = conn
-                    .prepareStatement("insert into testBinary values (?);");
-            stPrep.setBytes(1, testString.getBytes());
-            stPrep.execute();
-
-            stQuery = conn.createStatement();
-            res = stQuery.executeQuery("select * from testBinary");
-            try {
-                assertTrue(res.next());
-                byte[] output = res.getBytes(1);
-                String helloTest = new String(output);
-                assertNotNull(helloTest);
-                assertEquals(testString, helloTest);
-            } catch (SQLException e) {
-                fail("Unexpected exception: " + e.getMessage());
-            }
-        } finally {
-            if (res != null) res.close();
-            if (stPrep != null) stPrep.close();
-            if (st != null) st.close();
-            if (stQuery != null) stQuery.close();
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBytes(int)}.
-     * @throws SQLException
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "BINARY value",
-        method = "getBytes",
-        args = {int.class}
-    )
-    public void testGetBytesIntBinary() throws SQLException {
-
-        Statement st = null;
-        Statement stQuery = null;
-        PreparedStatement stPrep = null;
-        ResultSet res = null;
-
-
-        // setup
-
-        String testString = "HelloWorld";
-        st = conn.createStatement();
-        st.executeUpdate("create table testBinary (BINARY value);");
-        stPrep = conn.prepareStatement("insert into testBinary values (?);");
-        stPrep.setBytes(1, testString.getBytes());
-        stPrep.execute();
-        try {
-            stQuery = conn.createStatement();
-            res = stQuery.executeQuery("select * from testBinary");
-            try {
-                assertTrue(res.next());
-                byte[] output = res.getBytes(1);
-                String helloTest = new String(output);
-                assertNotNull(helloTest);
-                assertEquals(testString, helloTest);
-            } catch (SQLException e) {
-                fail("Unexpected exception: " + e.getMessage());
-            }
-        } finally {
-            if (res != null) res.close();
-            if (stPrep != null) stPrep.close();
-            if (st != null) st.close();
-            if (stQuery != null) stQuery.close();
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBytes(String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "Exception testing",
-        method = "getBytes",
-        args = {String.class}
-    )
-    public void testGetBytesString() {
-        int i = 1;
-
-        // null value
-        try {
-
-            res.next();
-            for (String t : colNames) {
-                assertNull(res.getBytes(t));
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.close();
-            res.getBytes(colNames.get(24));
-            fail("Should get Exception");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBytes(int)}.
-     * @throws SQLException
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "VARBINARY value",
-        method = "getBytes",
-        args = {String.class}
-    )
-    @KnownFailure("last assertion fails: invalid conversion. Test passes on RI")
-    public void testGetBytesStringVarbinary() throws SQLException {
-
-        Statement st = null;
-        Statement stQuery = null;
-        PreparedStatement stPrep = null;
-        ResultSet res = null;
-
-        // setup
-        try {
-            String testString = "HelloWorld";
-            st = conn.createStatement();
-            st.executeUpdate("create table testBinary (VARBINARY value);");
-            stPrep = conn
-                    .prepareStatement("insert into testBinary values (?);");
-            stPrep.setBytes(1, testString.getBytes());
-            stPrep.execute();
-
-            stQuery = conn.createStatement();
-            res = stQuery.executeQuery("select value from testBinary");
-            try {
-                assertTrue(res.next());
-                byte[] output = res.getBytes("value");
-                String helloTest = new String(output);
-                assertNotNull(helloTest);
-                assertEquals(testString, helloTest);
-            } catch (SQLException e) {
-                fail("Unexpected exception: " + e.getMessage());
-            }
-        } finally {
-            if (res != null) res.close();
-            if (stPrep != null) stPrep.close();
-            if (st != null) st.close();
-            if (stQuery != null) stQuery.close();
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBytes(int)}.
-     * @throws SQLException
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "BINARY value",
-        method = "getBytes",
-        args = {String.class}
-    )
-     @KnownFailure("last assertion fails: invalid conversion. Test passes on RI")
-    public void testGetBytesStringBinary() throws SQLException {
-
-        Statement st = null;
-        Statement stQuery = null;
-        PreparedStatement stPrep = null;
-        ResultSet res = null;
-
-
-        // setup
-
-        String testString = "HelloWorld";
-        st = conn.createStatement();
-        st.executeUpdate("create table testBinary (BINARY value);");
-        stPrep = conn.prepareStatement("insert into testBinary values (?);");
-        stPrep.setBytes(1, testString.getBytes());
-        stPrep.execute();
-        try {
-            stQuery = conn.createStatement();
-            res = stQuery.executeQuery("select value from testBinary");
-            try {
-                assertTrue(res.next());
-                byte[] output = res.getBytes("value");
-                String helloTest = new String(output);
-                assertNotNull(helloTest);
-                assertEquals(testString, helloTest);
-            } catch (SQLException e) {
-                fail("Unexpected exception: " + e.getMessage());
-            }
-        } finally {
-            if (res != null) res.close();
-            if (stPrep != null) stPrep.close();
-            if (st != null) st.close();
-            if (stQuery != null) stQuery.close();
-        }
-    }
-
-    public void testGetConcurrency() {
-        try {
-            assertEquals(ResultSet.CONCUR_UPDATABLE, res.getConcurrency());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getDate(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDate",
-        args = {int.class}
-    )
-    public void testGetDateInt() {
-        try {
-
-            GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
-            Date input = new Date(testCal.getTimeInMillis());
-            Date d = res.getDate(15);
-            assertEquals(input.toString(),"1799-05-26");
-            assertEquals(input,d);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        try {
-            Date d = res.getDate(500);
-            fail("Should get exception");
-        } catch (SQLException e) {
-            //ok
-        } catch (Exception e) {
-            fail("Got unspecified Exception "+ e.getMessage());
-        }
-
-        // null value
-        try {
-            assertTrue(res.next());
-            Date d = res.getDate(15);
-            assertNull(d);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getDate(int, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Not fully supported",
-        method = "getDate",
-        args = {int.class, java.util.Calendar.class}
-    )
-    public void testGetDateIntCalendar() {
-        GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
-        try {
-
-            Date input = new Date(testCal.getTimeInMillis());
-            Date d = res.getDate(15, testCal);
-
-            assertEquals(input.toString(),"1799-05-26");
-            assertEquals(input,d);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        try {
-            Date d = res.getDate(500, testCal);
-            fail("Should get exception");
-        } catch (SQLException e) {
-            //ok
-        } catch (Exception e) {
-            fail("Got unspecified Exception "+ e.getMessage());
-        }
-
-
-        // null value
-        try {
-            assertTrue(res.next());
-            Date d = res.getDate(15,testCal);
-            assertNull(d);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getDate(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Not fully supported",
-        method = "getDate",
-        args = {java.lang.String.class}
-    )
-    public void testGetDateString() {
-        try {
-            GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
-            Date input = new Date(testCal.getTimeInMillis());
-            Date d = res.getDate("dateVal");
-            assertEquals(input.toString(),"1799-05-26");
-            assertEquals(input,d);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        try {
-            Date d = res.getDate("bla");
-            fail("Should get exception");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        // null value
-        try {
-            assertTrue(res.next());
-            Date d = res.getDate("dateVal");
-            assertNull(d);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getDate(java.lang.String, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDate",
-        args = {java.lang.String.class, java.util.Calendar.class}
-    )
-    public void testGetDateStringCalendar() {
-        GregorianCalendar testCal = new GregorianCalendar(1799, Calendar.MAY, 26, 0, 0);
-        try {
-            Date input = new Date(testCal.getTimeInMillis());
-            Date d = res.getDate("dateVal", testCal);
-
-            assertEquals(input.toString(),"1799-05-26");
-            assertEquals(input,d);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        try {
-            Date d = res.getDate("bla", testCal);
-            fail("Should get exception");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        // null value
-        try {
-            assertTrue(res.next());
-            Date d = res.getDate("dateVal",testCal);
-            assertNull(d);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getDouble(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getDouble",
-        args = {int.class}
-    )
-    public void testGetDoubleInt() {
-
-        double output = 0.0;
-        try {
-             double[] input = {2.0, 3.9 , 23.2};
-
-             output = res.getDouble(8);
-             assertEquals(input[0],output);
-
-             output = res.getDouble(9);
-             assertEquals(input[1],output);
-
-             output = res.getDouble(10);
-             assertEquals(input[2],output);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try  {
-            res.getDouble(500);
-        } catch (SQLException e) {
-            //ok
-        }
-
-        // null value
-        try {
-            res.next();
-            output = res.getDouble(8);
-            assertEquals(0.0,output);
-
-            output = res.getDouble(9);
-            assertEquals(0.0,output);
-
-            output = res.getDouble(10);
-            assertEquals(0.0,output);
-
-       } catch (SQLException e) {
-           fail("Unexpected exception: " + e.getMessage());
-       }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getDouble(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Not fully supported: eg. getDouble from TinyInt ",
-        method = "getDouble",
-        args = {java.lang.String.class}
-    )
-    public void testGetDoubleString() {
-        double input = 23.2;
-        double output = 0.0;
-
-        try{
-            output = res.getDouble("DoubleVal");
-            assertEquals (input,output);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try{
-            output = res.getDouble("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-
-        // null value
-        try{
-            assertTrue(res.next());
-            output = res.getDouble("DoubleVal");
-            assertEquals (0.0 , output);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getFloat(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Not fully supported: eg.: getFloat from TinyInt according to JDBC 1.0 spec",
-        method = "getFloat",
-        args = {int.class}
-    )
-    public void testGetFloatInt() {
-        float defaultF = 0.0f;
-        try {
-            float[] input = {3.9f, 23.2f, 33.3f};
-
-
-            float output = res.getFloat(9);
-            assertEquals(input[0], output);
-
-            output = res.getFloat(10);
-            assertEquals(input[1], output);
-
-            output = res.getFloat(11);
-            assertEquals(input[2], output);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getFloat(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        try {
-            res.next();
-            float output = res.getFloat(8);
-            assertEquals(defaultF, output);
-
-            output = res.getFloat(9);
-            assertEquals(defaultF, output);
-
-            output = res.getFloat(10);
-            assertEquals(defaultF, output);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getFloat(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "Not fully supported",
-        method = "getFloat",
-        args = {java.lang.String.class}
-    )
-    public void testGetFloatString() {
-        float defaultF = 0.0f;
-        try {
-            String[] input = {"RealVal", "DoubleVal", "FloatVal"};
-            float[] inputF = {3.9f, 23.2f, 33.3f};
-
-
-            float output = res.getFloat(input[0]);
-            assertEquals(inputF[0], output);
-
-            output = res.getFloat(input[1]);
-            assertEquals(inputF[1], output);
-
-            output = res.getFloat(input[2]);
-            assertEquals(inputF[2], output);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getFloat(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        try {
-            res.next();
-            float output = res.getFloat(8);
-            assertEquals(defaultF, output);
-
-            output = res.getFloat(9);
-            assertEquals(defaultF, output);
-
-            output = res.getFloat(10);
-            assertEquals(defaultF, output);
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getInt(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInt",
-        args = {int.class}
-    )
-    public void testGetIntInt() {
-
-        // real input val -1, 22, 2, 33,3, 1, 2
-        List<Integer> input = Arrays.asList(1, -1, 22, 2, 33,3, 1, 2);
-        ListIterator<Integer> it = input.listIterator();
-        Double test2 = new Double(23.2);
-        try {
-            for (int i = 1;i<9;i++ ) {
-                assertEquals(it.next().intValue(),res.getInt(i));
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getInt(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        try {
-            res.next();
-            for (int i = 2;i<11;i++ ) {
-                assertEquals(0,res.getInt(i));
-            }
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getInt(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getInt",
-        args = {java.lang.String.class}
-    )
-    public void testGetIntString() {
-        List<String> inputS = Arrays.asList("BoolVal", "IntVal", "LongVal",
-                "Bint", "Tint", "Sint", "Mint", "IntegerVal");
-        ListIterator<String> itS = inputS.listIterator();
-        List<Integer> input = Arrays.asList(1, -1, 22, 2, 33, 3, 1, 2);
-        ListIterator<Integer> it = input.listIterator();
-        try {
-            while (it.hasNext()) {
-                assertEquals(it.next().intValue(), res.getInt(itS.next()));
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getInt("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        try {
-            res.next();
-            for (String s : inputS) {
-                assertEquals(0, res.getInt(s));
-            }
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getLong(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLong",
-        args = {int.class}
-    )
-    public void testGetLongInt() {
-        long maxVal = Long.MAX_VALUE;
-        long minVal = Long.MIN_VALUE;
-
-        try {
-            assertEquals(maxVal, res.getLong(27));
-            assertEquals(minVal, res.getLong(28));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getInt(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        try {
-            res.next();
-
-            assertEquals(0,res.getLong(27));
-            assertEquals(0,res.getLong(28));
-
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getLong(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getLong",
-        args = {java.lang.String.class}
-    )
-    public void testGetLongString() {
-        long maxVal = Long.MAX_VALUE;
-        long minVal = Long.MIN_VALUE;
-
-        try {
-            assertEquals(maxVal, res.getLong("MaxLongVal"));
-            assertEquals(minVal, res.getLong("MinLongVal"));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getInt("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        try {
-            res.next();
-
-            assertEquals(0,res.getLong("MaxLongVal"));
-            assertEquals(0,res.getLong("MinLongVal"));
-
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getMetaData()}.
-     * type mappings according to
-     * http://java.sun.com/j2se/1.3/docs/guide/jdbc/spec/jdbc-spec.frame8.html
-     * Not supported datatypes are not checked.
-     */
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.SUFFICIENT,
-            notes = "checks supported data types ,not supported types are not checked.",
-            method = "getMetaData",
-            args = {}
-        )
-    })
-    @KnownFailure("Wrong value returned for Long: java.lang.String (VARCHAR)")
-    public void testGetMetaData() {
-        /*
-         * List<String> types = Arrays.asList("BOOLEAN", "INT", "LONG",
-         * "BIGINT", "TINYINT", "SMALLINT", "MEDIUMINT", "INTEGER", "REAL",
-         * "DOUBLE", "FLOAT", "DECIMAL", "NUMERIC", "CHAR(20)", "DATE", "TIME",
-         * "TIMESTAMP", "DATETIME", "TINYBLOB", "BLOB", "MEDIUMBLOB",
-         * "LONGBLOB", "TINYTEXT", "TEXT", "MEDIUMTEXT", "LONGTEXT", "BIGINT",
-         * "BIGINT","URL","URL");
-         */
-        List<String> types = Arrays.asList("VARCHAR", "INTEGER", "INTEGER",
-                "BIGINT", "SMALLINT", "SHORT", "INTEGER", "INTEGER", "FLOAT",
-                "DOUBLE", "DOUBLE", "DECIMAL", "NUMERIC", "VARCHAR", "DATE",
-                "TIME", "TIMESTAMP", "DATETIME", "BLOB", "BLOB", "BLOB",
-                "BLOB", "VARCHAR", "VARCHAR", "VARCHAR", "VARCHAR", "BIGINT",
-                "BIGINT", "URL", "URL");
-
-
-
-        ListIterator<String> it = types.listIterator();
-        ListIterator<String> colNameIt = colNames.listIterator();
-        try {
-            ResultSetMetaData meta = res.getMetaData();
-            assertNotNull(meta);
-            assertEquals("Error in test setup. Columns do not match", types
-                    .size(), meta.getColumnCount());
-            for (int i = 1; i < 31; i++) {
-                String colName = colNameIt.next();
-                String type = it.next();
-                if (supported[i - 1]) {
-                    assertTrue("Wrong column name at " + i, colName
-                            .equalsIgnoreCase(meta.getColumnName(i)));
-                    assertTrue("Wrong type at " + i+" required" +type+ " but is "+meta.getColumnTypeName(i), type.equalsIgnoreCase(meta
-                            .getColumnTypeName(i)));
-                }
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getObject(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not supported types BIT,VARBINARY, LONGVARBINARY, BINARY, VARCHAR, LONGVARCHAR",
-        method = "getObject",
-        args = {int.class}
-    )
-    @KnownFailure("Wrong value returned for Long: java.lang.String")
-    public void testGetObjectInt() {
-
-        try {
-            for (int i = 1; i <= typeMap.length; i++) {
-                if (supported[i-1]) {
-                    Object value = res.getObject(i);
-                    assertTrue("value " + value.getClass().getName()
-                            + " does not correspond " + typeMap[i-1] + "at "+i, value
-                            .getClass().equals(typeMap[i-1]));
-                }
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getObject(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        try {
-            res.next();
-            for (int i = 1; i <= typeMap.length; i++) {
-                    Object value = res.getObject(i);
-                   assertNull(value);
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getObject(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not fully supported",
-        method = "getObject",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Wrong value returned for Long: java.lang.String")
-    public void testGetObjectString() {
-        ListIterator<String> colNameIt = colNames.listIterator();
-        try {
-            for (int i = 1; i <= typeMap.length; i++) {
-                String name = colNameIt.next();
-                if (supported[i-1]) {
-                    Object value = res.getObject(name);
-                    assertTrue("value " + value.getClass().getName()
-                            + " for "+name+" does not correspond " + typeMap[i-1] + "at "+i, value
-                            .getClass().equals(typeMap[i-1]));
-                }
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getObject("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-
-        try {
-            colNameIt = colNames.listIterator();
-            res.next();
-            for (int i = 1; i <= typeMap.length; i++) {
-                    Object value = res.getObject(colNameIt.next());
-                   assertNull(value);
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getRow()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Exception testing missed, test fails. According to spec afterlast row is 0 but returns 3",
-        method = "getRow",
-        args = {}
-    )
-    @KnownFailure("If there is no current row 0 must be returned. res.close() does not wrap up")
-    public void testGetRow() {
-        try {
-            assertEquals(1, res.getRow());
-            assertTrue(res.isFirst());
-            res.next();
-            assertEquals(2, res.getRow());
-            assertTrue(res.isLast());
-            res.next();
-            assertTrue(res.isAfterLast());
-            assertEquals(0, res.getRow());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.close();
-            res.getRow();
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getShort(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getShort",
-        args = {int.class}
-    )
-    public void testGetShortInt() {
-        try {
-            short shorty = res.getShort(6);
-            assertEquals(3,shorty);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.next();
-            short shorty = res.getShort(6);
-            assertEquals(0,shorty);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            res.getShort(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getShort(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getShort",
-        args = {java.lang.String.class}
-    )
-    public void testGetShortString() {
-        try {
-            short shorty = res.getShort("Sint");
-            assertEquals(3,shorty);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.next();
-            short shorty = res.getShort("Sint");
-            assertEquals(0,shorty);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            res.getShort("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getStatement()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "test fails. According to spec info.getStatement should return"+
-        " null but an exception is thrown: stale result set.",
-        method = "getStatement",
-        args = {}
-    )
-    @KnownFailure("According to spec info.getStatement should return null"+
-            " but an exception is thrown: stale result set.")
-    public void testGetStatement() {
-        try {
-            DatabaseMetaData meta = conn.getMetaData();
-            ResultSet info = meta.getTypeInfo();
-            Statement statement2 = info.getStatement();
-            assertNull(statement2);
-        } catch(SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            Statement statement2 = res.getStatement();
-            assertEquals(st, statement2);
-        } catch(SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-       // exception testing
-        try {
-            res.close();
-            res.getStatement();
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getString(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getString",
-        args = {int.class}
-    )
-    public void testGetStringInt() {
-        List<String> texts = Arrays.asList("Test text message tiny",
-                "Test text", "Test text message medium",
-                "Test text message long");
-        int i = 23;
-
-        //text and exception testing
-        try {
-            for (String t : texts) {
-                assertEquals(t, res.getString(i));
-                i++;
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        // the rest: everything should work with getString
-
-        texts = Arrays.asList("1", "-1", "22", "2", "33",
-         "3","1","2","3.9","23.2","33.3","44",
-        "5", "test string", "1799-05-26", "12:35:45", "2007-10-09 14:28:02.0",
-        "1221-09-22 10:11:55","1","2","3","4");
-        i= 1;
-
-        try {
-            for (String t : texts) {
-                assertEquals(t, res.getString(i));
-                i++;
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        //null testing
-
-        try {
-            i = 1;
-            res.next();
-            for (String t : values) {
-                assertNull(res.getString(i));
-                i++;
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        // exception testing
-        try {
-            res.getString(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getString(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "exception test missed",
-        method = "getString",
-        args = {java.lang.String.class}
-    )
-    public void testGetStringString() {
-
-        ListIterator<String> colNameIt = colNames.listIterator();
-        try {
-            for (String t : values) {
-                assertEquals(t, res.getString(colNameIt.next()));
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.next();
-
-            for  (String name: colNames) {
-                assertNull(res.getString(name));
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getString("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTime(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTime",
-        args = {int.class}
-    )
-    @KnownFailure("getTime should return Time value for a TIMESTAMP type but returns null")
-    public void testGetTimeInt() {
-        // values "12:35:45", "2007-10-09 14:28:02.0", "1221-09-22 10:11:55"
-
-        Calendar cal = new GregorianCalendar();
-        cal.clear();
-        cal.set(Calendar.HOUR_OF_DAY, 12);
-        cal.set(Calendar.MINUTE, 35);
-        cal.set(Calendar.SECOND, 45);
-        cal.set(Calendar.MILLISECOND, 0);
-        // set with calendar value (correct init time: since epoch)
-        long millis = cal.getTime().getTime();
-        Time t1 = new java.sql.Time(millis);
-        assertNotNull("t1", t1);
-
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis2 = cal2.getTime().getTime();
-        Time t2 = new java.sql.Time(millis2);
-
-        int i = 16;
-
-        try {
-            Time resTime = res.getTime(i);
-            assertNotNull("Pos " + i + " null", resTime);
-            assertEquals(t1.toString(), resTime.toString());
-            assertEquals(t1.getTime(), resTime.getTime());
-            assertEquals(t1, resTime);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        // Compatibility Test: TIMESTAMP value
-        i = 17;
-
-        try {
-            Time resTime = res.getTime(i);
-            assertNotNull("Pos " + i + " null", resTime);
-            assertEquals(t2.toString(), resTime.toString());
-            assertEquals(t2.getTime(), resTime.getTime());
-            assertEquals(t2, resTime);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            i = 16;
-            res.next();
-            assertNull(res.getTime(i));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTime(int, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTime",
-        args = {int.class, java.util.Calendar.class}
-    )
-     @KnownFailure("getTime on TIMESTAMP value fails: returns null")
-    public void testGetTimeIntCalendar() {
-        List<Time> times = new LinkedList<Time>();
-        List<Calendar> cals = new LinkedList<Calendar>();
-        // Arrays.asList("12:35:45", "2007-10-09 14:28:02.0",
-        // "1221-09-22 10:11:55");
-
-        Calendar cal1 = new GregorianCalendar();
-        cal1.clear();
-        cal1.set(Calendar.HOUR_OF_DAY, 12);
-        cal1.set(Calendar.MINUTE, 35);
-        cal1.set(Calendar.SECOND, 45);
-        cal1.set(Calendar.MILLISECOND, 0);
-
-        long millis = cal1.getTime().getTime();
-        Time t1 = new java.sql.Time(millis);
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis2 = cal2.getTime().getTime();
-        Time t2 = new java.sql.Time(millis2);
-
-        // TIME value
-
-        int i = 16;
-
-        try {
-                Time timeRes = res.getTime(i,new GregorianCalendar());
-                assertNotNull(timeRes);
-                assertEquals(t1.toString(), timeRes.toString());
-                assertEquals(t1.getTime(), timeRes.getTime());
-                assertEquals(t1, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        // TIMESTAMP value
-        i = 17;
-
-        try {
-            Time timeRes = res.getTime(i,new GregorianCalendar());
-            assertNotNull(timeRes);
-            assertEquals(t2.toString(), timeRes.toString());
-            assertEquals(t2.getTime(), timeRes.getTime());
-            assertEquals(t2, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.next();
-
-            for (Calendar c : cals) {
-                assertNull(res.getTime(16,c));
-                i++;
-            }
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime(500,Calendar.getInstance());
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTime(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "",
-        method = "getTime",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("getTime should return a Time value for a TIMESTAMP type but returns null")
-    public void testGetTimeString() {
-        List<Time> times = new LinkedList<Time>();
-
-        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
-        Iterator<String> it = stringTimes.iterator();
-
-        // Arrays.asList("12:35:45", "2007-10-09 14:28:02.0",
-        // "1221-09-22 10:11:55");
-
-        Calendar cal = new GregorianCalendar();
-        cal.clear();
-        cal.set(Calendar.HOUR_OF_DAY, 12);
-        cal.set(Calendar.MINUTE, 35);
-        cal.set(Calendar.SECOND, 45);
-        cal.set(Calendar.MILLISECOND, 0);
-
-        long millis = cal.getTime().getTime();
-        Time t1 = new java.sql.Time(millis);
-
-        String col = it.next();
-
-        try {
-                Time timeRes = res.getTime(col);
-                assertNotNull(timeRes);
-                assertEquals(t1.toString(), timeRes.toString());
-                assertEquals(t1.getTime(), timeRes.getTime());
-                assertEquals(t1, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis2 = cal.getTime().getTime();
-        Time t2 = new java.sql.Time(millis2);
-
-        col = it.next();
-
-        try {
-                Time timeRes = res.getTime(col);
-                assertNotNull(timeRes);
-                assertEquals(t2.toString(), timeRes.toString());
-                assertEquals(t2.getTime(), timeRes.getTime());
-                assertEquals(t2, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            res.next();
-
-                assertNull(res.getTime(col));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTime(java.lang.String, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "Testing getTime with TIME, TIMESTAMP value",
-        method = "getTime",
-        args = {java.lang.String.class, java.util.Calendar.class}
-    )
-    @KnownFailure("getTime on TIMESTAMP value fails: returns null")
-    public void testGetTimeStringCalendar() {
-        List<Time> times = new LinkedList<Time>();
-
-        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
-        Iterator<String> it = stringTimes.iterator();
-        List<Calendar> cals = new LinkedList<Calendar>();
-
-        // Arrays.asList("12:35:45", "2007-10-09 14:28:02.0",
-        // "1221-09-22 10:11:55");
-
-        Calendar cal1 = new GregorianCalendar();
-        cal1.clear();
-        cal1.set(Calendar.HOUR_OF_DAY, 12);
-        cal1.set(Calendar.MINUTE, 35);
-        cal1.set(Calendar.SECOND, 45);
-        cal1.set(Calendar.MILLISECOND, 0);
-
-        long millis = cal1.getTime().getTime();
-        Time t1 = new java.sql.Time(millis);
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis2 = cal2.getTime().getTime();
-        Time t2 = new java.sql.Time(millis2);
-
-        // TIME value
-        String col = it.next();
-
-        try {
-                Time timeRes = res.getTime(col, new GregorianCalendar());
-                assertNotNull(timeRes);
-                assertEquals(t1.toString(), timeRes.toString());
-                assertEquals(t1.getTime(), timeRes.getTime());
-                assertEquals(t1, res.getTime(col));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        //TIMESTAMP value
-        col = it.next();
-
-        try {
-            Time timeRes = res.getTime(col, new GregorianCalendar());
-            assertNotNull(timeRes);
-            assertEquals(t2.toString(), timeRes.toString());
-            assertEquals(t2.getTime(), timeRes.getTime());
-            assertEquals(t2, res.getTime(col));
-    } catch (SQLException e) {
-        fail("Unexpected exception: " + e.getMessage());
-    }
-
-
-
-        try {
-            res.next();
-                assertNull(res.getTime(stringTimes.get(0), new GregorianCalendar()));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTimestamp(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTimestamp",
-        args = {int.class}
-    )
-    public void testGetTimestampInt() {
-        List<Timestamp> times = new LinkedList<Timestamp>();
-
-        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
-        Iterator<String> it = stringTimes.iterator();
-        List<Calendar> cals = new LinkedList<Calendar>();
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis = cal2.getTime().getTime();
-        Timestamp t2 = new Timestamp(millis);
-        times.add(t2);
-
-         Calendar cal3 = new GregorianCalendar();
-          cal3.set(Calendar.YEAR, 1221);
-          cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
-          cal3.set(Calendar.DATE, 22);
-         cal3.set(Calendar.HOUR_OF_DAY, 10);
-         cal3.set(Calendar.MINUTE, 11);
-         cal3.set(Calendar.SECOND, 55);
-         cal3.set(Calendar.MILLISECOND, 0);
-
-         millis = cal3.getTime().getTime();
-         Timestamp t3 = new Timestamp(millis);
-         times.add(t3);
-         // TIMESTAMP value
-        int i = 17;
-
-        try {
-            Timestamp timeRes = res.getTimestamp(i);
-            assertEquals(t2.toString(), timeRes.toString());
-             assertEquals(t2.getTime(), timeRes.getTime());
-             assertEquals(t2, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        // DATE value
-        i = 18;
-        try {
-            Timestamp timeRes = res.getTimestamp(i);
-            assertEquals(t3.toString(), timeRes.toString());
-             assertEquals(t3.getTime(), timeRes.getTime());
-             assertEquals(t3, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.next();
-            assertNull(res.getTime(i));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTimestamp(int, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTimestamp",
-        args = {int.class, java.util.Calendar.class}
-    )
-    public void testGetTimestampIntCalendar() {
-        List<Timestamp> times = new LinkedList<Timestamp>();
-
-        List<String> stringTimes = Arrays.asList("timeVal", "TS", "DT");
-        Iterator<String> it = stringTimes.iterator();
-//        List<Calendar> cals = new LinkedList<Calendar>();
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis = cal2.getTime().getTime();
-        Timestamp t2 = new Timestamp(millis);
-        times.add(t2);
-        //
-         Calendar cal3 = new GregorianCalendar();
-          cal3.set(Calendar.YEAR, 1221);
-          cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
-          cal3.set(Calendar.DATE, 22);
-         cal3.set(Calendar.HOUR_OF_DAY, 10);
-         cal3.set(Calendar.MINUTE, 11);
-         cal3.set(Calendar.SECOND, 55);
-         cal3.set(Calendar.MILLISECOND, 0);
-
-         millis = cal3.getTime().getTime();
-         Timestamp t3 = new Timestamp(millis);
-         times.add(t3);
-
-//         cals.add(cal1);
-//         cals.add(cal2);
-//         cals.add(cal3);
-//
-//        ListIterator<Calendar> calIt = cals.listIterator();
-
-        int i = 17;
-
-        try {
-            Timestamp timeRes = res.getTimestamp(i,new GregorianCalendar());
-            assertEquals(t2.toString(), timeRes.toString());
-            assertEquals(t2, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        i = 18;
-
-        try {
-            Timestamp timeRes = res.getTimestamp(i,new GregorianCalendar());
-            assertEquals(t3.toString(), timeRes.toString());
-            assertEquals(t3, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.next();
-            assertNull(res.getTime(17,cal2));
-            assertNull(res.getTime(18,cal3));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTimestamp(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTimestamp",
-        args = {java.lang.String.class}
-    )
-    public void testGetTimestampString() {
-        List<Timestamp> times = new LinkedList<Timestamp>();
-
-        List<String> stringTimes = Arrays.asList( "TS", "DT");
-        Iterator<String> it = stringTimes.iterator();
-//        List<Calendar> cals = new LinkedList<Calendar>();
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis = cal2.getTime().getTime();
-        Timestamp t2 = new Timestamp(millis);
-        times.add(t2);
-        //
-         Calendar cal3 = new GregorianCalendar();
-          cal3.set(Calendar.YEAR, 1221);
-          cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
-          cal3.set(Calendar.DATE, 22);
-         cal3.set(Calendar.HOUR_OF_DAY, 10);
-         cal3.set(Calendar.MINUTE, 11);
-         cal3.set(Calendar.SECOND, 55);
-         cal3.set(Calendar.MILLISECOND, 0);
-
-         millis = cal3.getTime().getTime();
-         Timestamp t3 = new Timestamp(millis);
-         times.add(t3);
-
-        String col = it.next();
-
-        try {
-            Timestamp timeRes = res.getTimestamp(col);
-            assertEquals(t2.toString(), timeRes.toString());
-            assertEquals(t2.toString(), timeRes.toString());
-            assertEquals(t2.getTime(), timeRes.getTime());
-            assertEquals(t2, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        // DATE value
-        col = it.next();
-
-        try {
-            Timestamp timeRes = res.getTimestamp(col);
-            assertEquals(t3.toString(), timeRes.toString());
-            assertEquals(t3.toString(), timeRes.toString());
-            assertEquals(t3.getTime(), timeRes.getTime());
-            assertEquals(t3, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.next();
-            assertNull(res.getTime(stringTimes.get(0)));
-            assertNull(res.getTime(stringTimes.get(1)));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getTimestamp(java.lang.String, java.util.Calendar)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "getTimestamp",
-        args = {java.lang.String.class, java.util.Calendar.class}
-    )
-    public void testGetTimestampStringCalendar() {
-        List<Timestamp> times = new LinkedList<Timestamp>();
-
-        List<String> stringTimes = Arrays.asList( "TS", "DT");
-        Iterator<String> it = stringTimes.iterator();
-
-        Calendar cal2 = new GregorianCalendar();
-        cal2.set(Calendar.YEAR, 2007);
-        cal2.set(Calendar.MONTH, Calendar.OCTOBER);
-        cal2.set(Calendar.DATE, 9);
-        cal2.set(Calendar.HOUR_OF_DAY, 14);
-        cal2.set(Calendar.MINUTE, 28);
-        cal2.set(Calendar.SECOND, 02);
-        cal2.set(Calendar.MILLISECOND, 0);
-
-        long millis = cal2.getTime().getTime();
-        Timestamp t2 = new Timestamp(millis);
-        times.add(t2);
-        //
-         Calendar cal3 = new GregorianCalendar();
-          cal3.set(Calendar.YEAR, 1221);
-          cal3.set(Calendar.MONTH, Calendar.SEPTEMBER);
-          cal3.set(Calendar.DATE, 22);
-         cal3.set(Calendar.HOUR_OF_DAY, 10);
-         cal3.set(Calendar.MINUTE, 11);
-         cal3.set(Calendar.SECOND, 55);
-         cal3.set(Calendar.MILLISECOND, 0);
-
-         millis = cal3.getTime().getTime();
-         Timestamp t3 = new Timestamp(millis);
-         times.add(t3);
-
-        try {
-            Timestamp timeRes = res.getTimestamp(stringTimes.get(0),cal2);
-            assertEquals(t2.toString(), timeRes.toString());
-            assertEquals(t2.getTime(), timeRes.getTime());
-            assertEquals(t2, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-            // DATE value
-        try {
-            Timestamp timeRes = res.getTimestamp(stringTimes.get(1),cal3);
-            assertEquals(t3.toString(), timeRes.toString());
-            assertEquals(t3.getTime(), timeRes.getTime());
-            assertEquals(t3, timeRes);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        // calIt = cals.listIterator();
-
-        try {
-            res.next();
-            assertNull(res.getTime(stringTimes.get(0),cal2));
-            assertNull(res.getTime(stringTimes.get(1),cal3));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            res.getTime(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getType()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "SQLException checking missed. Only one ResultSet type supported: default values, Test fails.Not fully supported. Always returns ResultSet.TYPE_SCROLL_INSENSITIVE. Wrong default value.",
-        method = "getType",
-        args = {}
-    )
-    @KnownFailure("res.close() does not wrap up")
-    public void testGetType() {
-        try {
-            assertEquals(ResultSet.TYPE_FORWARD_ONLY, res.getType());
-        } catch (SQLException e) {
-            fail("Unexpected exception " + e.getMessage());
-        }
-
-        try {
-            st.close();
-            res.getType();
-            fail("Exception not thrown.");
-        } catch (SQLException e) {
-            //ok
-        }
-
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getURL(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not fully supported type",
-        method = "getURL",
-        args = {int.class}
-    )
-    public void testGetURLInt() {
-        try {
-            URL input = new URL("http://www.android.com");
-            URL validURL = res.getURL(29);
-            assertEquals(input, validURL);
-        } catch (SQLException e) {
-            fail("Unexpected exception " + e.getMessage());
-        } catch (MalformedURLException e) {
-            fail("Unexpected exception " + e.getMessage());
-        }
-
-        try {
-            URL invalidURL = res.getURL(30);
-            assertNull(invalidURL);
-        } catch (SQLException e) {
-            // ok
-        }
-
-        try {
-            res.next();
-            assertNull(res.getURL(29));
-            assertNull(res.getURL(30));
-        } catch (SQLException e) {
-            fail("Unexpected exception " + e.getMessage());
-        }
-
-        try {
-            res.getURL(500);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getURL(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "not fully supported type",
-        method = "getURL",
-        args = {java.lang.String.class}
-    )
-    public void testGetURLString() {
-        try {
-            URL input = new URL("http://www.android.com");
-            URL validURL = res.getURL("validURL");
-            assertEquals(input, validURL);
-        } catch (SQLException e) {
-            fail("Unexpected exception " + e.getMessage());
-        } catch (MalformedURLException e) {
-            fail("Unexpected exception " + e.getMessage());
-        }
-
-        try {
-            URL invalidURL = res.getURL("invalidURL");
-            assertNull(invalidURL);
-        } catch (SQLException e) {
-            // ok
-        }
-
-        try {
-            res.next();
-            assertNull(res.getURL("validURL"));
-            assertNull(res.getURL("invalidURL"));
-        } catch (SQLException e) {
-            fail("Unexpected exception " + e.getMessage());
-        }
-
-        try {
-            res.getURL("bla");
-            fail("Exception expected");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-}
diff --git a/luni/src/test/java/tests/sql/ResultSetNotSupportedTests.java b/luni/src/test/java/tests/sql/ResultSetNotSupportedTests.java
deleted file mode 100644
index dd91f1a..0000000
--- a/luni/src/test/java/tests/sql/ResultSetNotSupportedTests.java
+++ /dev/null
@@ -1,1352 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import java.sql.Ref;
-import java.sql.ResultSet;
-
-@TestTargetClass(ResultSet.class)
-public class ResultSetNotSupportedTests extends SQLTest {
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getArray(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getArray",
-        args = {int.class}
-    )
-    public void testGetArrayInt() {
-
-        fail();
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getArray(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getArray",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetArrayString() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getAsciiStream(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getAsciiStream",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetAsciiStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getAsciiStream(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getAsciiStream",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetAsciiStreamString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBigDecimal(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBigDecimal",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBigDecimalInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBigDecimal(int, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getBigDecimal",
-        args = {int.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBigDecimalIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBigDecimal(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBigDecimal",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBigDecimalString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBigDecimal(java.lang.String, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBigDecimal",
-        args = {java.lang.String.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBigDecimalStringInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBinaryStream(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBinaryStream",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBinaryStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBinaryStream(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBinaryStream",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBinaryStreamString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBlob(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBlob",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBlobInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBlob(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBlob",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBlobString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBoolean(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getBoolean",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBooleanInt() {
-        /*
-        try {
-            assertTrue(res.first());
-            boolean b = res.getBoolean(1);
-            assertTrue(b);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            boolean b = res.getBoolean(5);
-            fail("Should get exception");
-        } catch (SQLException e) {
-            //ok
-        }
-
-
-
-        // null value
-        try {
-            assertTrue(res.next());
-            boolean b = res.getBoolean(1);
-            assertFalse(b);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        */
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getBoolean(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getBoolean",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetBooleanString() {
-        fail("Not yet implemented");
-    }
-
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getByte(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getByte",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetByteString() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getByte(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "getByte",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetByteInt() {
-        /*
-        try {
-            assertTrue(res.first());
-            byte b = res.getByte(14);
-            String testString = Byte.toString(b);
-            assertEquals("test string",testString);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            byte b = res.getByte(5);
-            fail("Should get exception");
-        } catch (SQLException e) {
-            //ok
-        }
-
-        // null value
-        try {
-            assertTrue(res.next());
-            byte b = res.getByte(14);
-            assertNull(b);
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        */
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getCharacterStream(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getCharacterStream",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetCharacterStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getCharacterStream(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getCharacterStream",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetCharacterStreamString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getClob(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getClob",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetClobInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getClob(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getClob",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetClobString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getCursorName()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported, setColumnName is not supported, therefore GetColumname can not be tested",
-        method = "getCursorName",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetCursorName() {
-        /*
-        try {
-            assertNull(res.getCursorName());
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        ResultSet rs2 = null;
-        Statement stmt;
-        String inputCName = "my \"\"\"\"quoted\"\"\"\" cursor\"\"";
-        try {
-            assertNull(res.getCursorName());
-            stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
-                    ResultSet.CONCUR_READ_ONLY);
-            stmt.setCursorName(inputCName);
-            rs2 = stmt.executeQuery("select * from type");
-            rs2.next();
-            String name = rs2.getCursorName();
-            assertEquals(inputCName, name);
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            rs2.close();
-            rs2.getCursorName();
-            fail("Should throw exception");
-        } catch (Exception e) {
-            //ok
-        }
-        */
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getFetchDirection()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported.",
-        method = "getFetchDirection",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetFetchDirection() {
-        /*
-        try {
-            assertEquals(ResultSet.TYPE_FORWARD_ONLY, res.getFetchDirection());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-        */
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getFetchSize()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getFetchSize",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetFetchSize() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getObject(int, java.util.Map)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getObject",
-        args = {int.class, java.util.Map.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetObjectIntMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getObject(java.lang.String, java.util.Map)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getObject",
-        args = {java.lang.String.class, java.util.Map.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetObjectStringMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getRef(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getRef",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetRefInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getRef(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getRef",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetRefString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getUnicodeStream(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getUnicodeStream",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetUnicodeStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getUnicodeStream(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getUnicodeStream",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetUnicodeStreamString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#getWarnings()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "getWarnings",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testGetWarnings() {
-        /*
-        try {
-        res.close();
-        res.getWarnings();
-        fail("Exception expected");
-        } catch (SQLException e) {
-           //ok
-        }
-        */
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#cancelRowUpdates()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "SQLException checking missed",
-        method = "cancelRowUpdates",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testCancelRowUpdates() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#deleteRow()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "deleteRow",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testDeleteRow() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#insertRow()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "insertRow",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testInsertRow() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#moveToCurrentRow()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "moveToCurrentRow",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testMoveToCurrentRow() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#moveToInsertRow()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "moveToInsertRow",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testMoveToInsertRow() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#refreshRow()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "refreshRow",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testRefreshRow() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#rowDeleted()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "rowDeleted",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testRowDeleted() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#rowInserted()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "rowInserted",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testRowInserted() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#rowUpdated()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "rowUpdated",
-        args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testRowUpdated() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#setFetchDirection(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setFetchDirection",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testSetFetchDirection() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#setFetchSize(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "setFetchSize",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testSetFetchSize() {
-        fail("Not yet implemented");
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateArray(int, java.sql.Array)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateArray",
-        args = {int.class, java.sql.Array.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateArrayIntArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateArray(java.lang.String, java.sql.Array)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateArray",
-        args = {java.lang.String.class, java.sql.Array.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateArrayStringArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateAsciiStream(int, java.io.InputStream, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateAsciiStream",
-        args = {int.class, java.io.InputStream.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateAsciiStreamIntInputStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateAsciiStream(java.lang.String, java.io.InputStream, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateAsciiStream",
-        args = {String.class, java.io.InputStream.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateAsciiStreamStringInputStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBigDecimal(int, java.math.BigDecimal)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBigDecimal",
-        args = {int.class, java.math.BigDecimal.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBigDecimalIntBigDecimal() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBigDecimal(java.lang.String, java.math.BigDecimal)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBigDecimal",
-        args = {java.lang.String.class, java.math.BigDecimal.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBigDecimalStringBigDecimal() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBinaryStream(int, java.io.InputStream, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBinaryStream",
-        args = {int.class, java.io.InputStream.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBinaryStreamIntInputStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBinaryStream(java.lang.String, java.io.InputStream, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBinaryStream",
-        args = {java.lang.String.class, java.io.InputStream.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBinaryStreamStringInputStreamInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBlob(int, java.sql.Blob)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBlob",
-        args = {int.class, java.sql.Blob.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBlobIntBlob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBlob(java.lang.String, java.sql.Blob)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBlob",
-        args = {java.lang.String.class, java.sql.Blob.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBlobStringBlob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBoolean(int, boolean)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBoolean",
-        args = {int.class, boolean.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBooleanIntBoolean() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBoolean(java.lang.String, boolean)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBoolean",
-        args = {java.lang.String.class, boolean.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBooleanStringBoolean() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateByte(int, byte)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateByte",
-        args = {int.class, byte.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateByteIntByte() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateByte(java.lang.String, byte)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateByte",
-        args = {java.lang.String.class, byte.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateByteStringByte() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBytes(int, byte[])}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBytes",
-        args = {int.class, byte[].class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBytesIntByteArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateBytes(java.lang.String, byte[])}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateBytes",
-        args = {java.lang.String.class, byte[].class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateBytesStringByteArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateCharacterStream(int, java.io.Reader, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateCharacterStream",
-        args = {int.class, java.io.Reader.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateCharacterStreamIntReaderInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateCharacterStream(java.lang.String, java.io.Reader, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateCharacterStream",
-        args = {java.lang.String.class, java.io.Reader.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateCharacterStreamStringReaderInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateClob(int, java.sql.Clob)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateClob",
-        args = {int.class, java.sql.Clob.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateClobIntClob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateClob(java.lang.String, java.sql.Clob)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateClob",
-        args = {java.lang.String.class, java.sql.Clob.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateClobStringClob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateDate(int, java.sql.Date)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateDate",
-        args = {int.class, java.sql.Date.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateDateIntDate() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateDate(java.lang.String, java.sql.Date)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateDate",
-        args = {java.lang.String.class, java.sql.Date.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateDateStringDate() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateDouble(int, double)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateDouble",
-        args = {int.class, double.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateDoubleIntDouble() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateDouble(java.lang.String, double)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateDouble",
-        args = {java.lang.String.class, double.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateDoubleStringDouble() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateFloat(int, float)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateFloat",
-        args = {int.class, float.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateFloatIntFloat() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateFloat(java.lang.String, float)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateFloat",
-        args = {java.lang.String.class, float.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateFloatStringFloat() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateInt(int, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateInt",
-        args = {int.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateIntIntInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateInt(java.lang.String, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateInt",
-        args = {String.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateIntStringInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateLong(int, long)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateLong",
-        args = {int.class, long.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateLongIntLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateLong(java.lang.String, long)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateLong",
-        args = {java.lang.String.class, long.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateLongStringLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateNull(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateNull",
-        args = {int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateNullInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateNull(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateNull",
-        args = {java.lang.String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateNullString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateObject(int, java.lang.Object)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateObject",
-        args = {int.class, java.lang.Object.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateObjectIntObject() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateObject(int, java.lang.Object, int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "",
-        method = "updateObject",
-        args = {int.class, java.lang.Object.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateObjectIntObjectInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateObject(String, Object) }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateObject",
-            args = {String.class, Object.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateStringObject() {
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateObject(String, Object, int) }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateObject",
-            args = {String.class, Object.class, int.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateStringObjectInt() {
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateRef(int, java.sql.Ref) }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateRef",
-            args = {int.class, Ref.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateRefIntRef() {
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateRef(String, Ref) }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateRef",
-            args = {String.class, Ref.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateRefStringRef() {
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateRow() }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateRow",
-            args = {}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateRow() {
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateShort(int, short) }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateShort",
-            args = {int.class, short.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateShortIntShort() {
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateShort(String, short) }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateShort",
-            args = {String.class, short.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateShortStringShort() {
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateString(int, String) }.
-     */
-    @TestTargetNew(
-            level = TestLevel.NOT_FEASIBLE,
-            notes = "",
-            method = "updateString",
-            args = {int.class, String.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateStringIntString() {
-
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateTime(int, java.sql.Time)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateTime",
-        args = {int.class, java.sql.Time.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateTimeIntTime() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateTime(java.lang.String, java.sql.Time)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateTime",
-        args = {java.lang.String.class, java.sql.Time.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateTimeStringTime() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateTimestamp(int, java.sql.Timestamp)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateTimestamp",
-        args = {int.class, java.sql.Timestamp.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateTimestampIntTimestamp() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateTimestamp(java.lang.String, java.sql.Timestamp)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateTimestamp",
-        args = {java.lang.String.class, java.sql.Timestamp.class}
-    )
-    @KnownFailure("Not Supported")
-    public void testUpdateTimestampStringTimestamp() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/ResultSetTest.java b/luni/src/test/java/tests/sql/ResultSetTest.java
deleted file mode 100644
index c515453..0000000
--- a/luni/src/test/java/tests/sql/ResultSetTest.java
+++ /dev/null
@@ -1,847 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.KnownFailure;
-import dalvik.annotation.TestTargets;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargetClass;
-import tests.support.DatabaseCreator;
-
-import java.io.IOException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-/**
- * @author andrea@google.com (Your Name Here)
- *
- */
-@TestTargetClass(ResultSet.class)
-public class ResultSetTest extends SQLTest {
-
-    ResultSet target = null;
-    ResultSet emptyTarget = null;
-    ResultSet scrollableTarget = null;
-    ResultSet writableTarget = null;
-    Statement stForward = null;
-    Statement stScrollable = null;
-    Statement stWritable = null;
-    final String selectAllAnimals = "select id, name from zoo";
-    final String selectEmptyTable = "select * from "+DatabaseCreator.SIMPLE_TABLE1;
-    /* (non-Javadoc)
-     * @see junit.framework.TestCase#setUp()
-     */
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        try {
-            conn.setAutoCommit(false);
-            stForward = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
-                    ResultSet.CONCUR_READ_ONLY);
-            stForward.execute(selectAllAnimals);
-            target = stForward.getResultSet();
-            assertNotNull(target);
-
-            // empty table
-            stForward = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
-                    ResultSet.CONCUR_READ_ONLY);
-            stForward.execute(DatabaseCreator.CREATE_TABLE_SIMPLE1);
-            stForward.execute(selectEmptyTable);
-            emptyTarget = stForward.getResultSet();
-
-        } catch (SQLException e) {
-            fail("SQLException was thrown: " + e.getMessage());
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see junit.framework.TestCase#tearDown()
-     */
-    public void tearDown() {
-        super.tearDown();
-        try {
-            target.close();
-            stForward.close();
-        } catch (SQLException e) {
-            fail("Error in test setup");
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#absolute(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "absolute",
-        args = {int.class}
-    )
-    public void testAbsolute() {
-        try {
-            assertTrue(target.isBeforeFirst());
-            assertFalse(target.absolute(0));
-            assertTrue(target.absolute(1));
-            assertTrue(target.isFirst());
-            assertTrue(target.absolute(-1));
-            assertTrue(target.isLast());
-            target.next();
-            assertTrue(target.isAfterLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#afterLast()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "afterLast",
-        args = {}
-    )
-    @KnownFailure("res.close() does not wrap up")
-    public void testAfterLast() {
-        try {
-            target.afterLast();
-            assertTrue(target.isAfterLast());
-            assertFalse(target.next());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            emptyTarget.afterLast();
-            assertFalse(emptyTarget.isAfterLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            target.close();
-            target.beforeFirst();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-
-        }
-
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#beforeFirst()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "beforeFirst",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testBeforeFirst() {
-
-        try {
-            target.beforeFirst();
-            assertTrue(target.isBeforeFirst());
-            assertTrue(target.next());
-            assertFalse(target.isBeforeFirst());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            emptyTarget.beforeFirst();
-            assertFalse(emptyTarget.isBeforeFirst());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            target.close();
-            target.beforeFirst();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-
-        }
-
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#clearWarnings()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "Not supported",
-        method = "clearWarnings",
-        args = {}
-    )
-    @KnownFailure("Not supported")
-    public void testClearWarnings() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#close()}.
-     *
-     * According to the JDBC spec close has to "Releases this ResultSet
-     * object's database and JDBC resources immediately", and this implies
-     * the fields should be released as well (so that garbage collection
-     *  can take place)
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "test immediate release of resources, test fails",
-        method = "close",
-        args = {}
-    )
-    @KnownFailure("Resultset.close() does not wrap up")
-    public void testClose1() {
-        try {
-            target.close();
-            target.next();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#close()}.
-     *
-     */
-    @TestTargetNew(
-        level = TestLevel.PARTIAL_COMPLETE,
-        notes = "test that exception in one prepared statement does not affect second statement. (Atomicity Rule)",
-        method = "close",
-        args = {}
-    )
-    public void testClose() {
-        PreparedStatement ps1 = null;
-        PreparedStatement ps2 = null;
-        try {
-
-            Statement s = conn.createStatement();
-            s.addBatch("create table t1 (a text);");
-
-            s.addBatch("insert into t1 values('abc');");
-            s.addBatch("insert into t1 values('def');");
-            s.addBatch("insert into t1 values('ghi');");
-            s.executeBatch();
-            s.close();
-
-            conn.commit();
-            ps1 = conn.prepareStatement("select * from t1");
-            ps2 = conn
-                    .prepareStatement("select * from t1 whe a like '?000'");
-
-            ResultSet rs1 = ps1.executeQuery();
-
-            try {
-                ResultSet rs2 = ps2.executeQuery();
-                while (rs2.next()){
-                    // do nothing
-                }
-                fail("Should get SQLException");
-            } catch (SQLException sqle) {
-                // ok : Division by zero
-            }
-
-            // Although exception happened on ps2 rs1 should still work
-            // Isolation property if ACID rules
-
-            while (rs1.next()) {
-                // do nothing: switching of rows should be possible
-            }
-
-            conn.commit();
-
-            rs1.close();
-            ps1.close();
-            ps2.close();
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        } finally {
-            try {
-                if (ps1 != null) ps1.close();
-                if (ps2 != null) ps2.close();
-                conn.rollback();
-            } catch (SQLException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-        }
-    }
-
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#findColumn(java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "",
-        method = "findColumn",
-        args = {java.lang.String.class}
-    )
-    public void testFindColumn() {
-        try {
-            assertEquals(1, target.findColumn("id"));
-            assertEquals(2, target.findColumn("name"));
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            target.findColumn("bla");
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-            // ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#first()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "first",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testtestFirst() {
-        try {
-            assertFalse(emptyTarget.first());
-            assertTrue(target.first());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            target.close();
-            // releases all resources such that it can be finalized!
-            target.first();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-
-        }
-
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#isAfterLast()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "isAfterLast",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testtestIsAfterLast() {
-        try {
-            assertFalse(target.isAfterLast());
-            target.absolute(-1); // last
-            target.next();
-            assertTrue(target.isAfterLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            assertFalse(emptyTarget.isAfterLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            target.close();
-            // releases all resources such that it can be finalized!
-            target.isAfterLast();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#isBeforeFirst()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "isBeforeFirst",
-        args = {}
-    )
-    @KnownFailure("In Second code block assertion fails. statment. "+
-            "close() does not wrap up")
-    public void testtestIsBeforeFirst() {
-        try {
-            assertTrue(target.isBeforeFirst());
-            assertTrue(target.next());
-            assertFalse(target.isBeforeFirst());
-            assertTrue(target.isFirst());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            assertTrue(emptyTarget.isBeforeFirst());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            target.close();
-            // releases all resources such that it can be finalized!
-            target.isBeforeFirst();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-            //ok
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#isFirst()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "isFirst",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testtestIsFirst() {
-        try {
-            assertFalse(target.isFirst());
-            target.first();
-            assertTrue(target.isFirst());
-            target.next();
-            assertFalse(target.isFirst());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            assertFalse(emptyTarget.isFirst());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            target.close();
-            // releases all resources such that it can be finalized!
-            target.isFirst();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#isLast()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails. Test for empty result set fails",
-        method = "isLast",
-        args = {}
-    )
-    @KnownFailure("Second block first assertion fails. Is Last should evaluate "+
-            "true if the row on which the cursor is actually provides a result."+
-            "statment.close() does not wrap up")
-    public void testtestIsLast() {
-
-        try {
-            assertFalse(target.isLast());
-            target.absolute(-1);
-            assertTrue(target.isLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        //check default value no valid row
-        try {
-            assertFalse(emptyTarget.isLast());
-            assertFalse(emptyTarget.next());
-            assertFalse(emptyTarget.isLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-
-        try {
-            target.close();
-            target.isLast();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-            // ok
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#last()}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "SQLException test fails",
-        method = "last",
-        args = {}
-    )
-    @KnownFailure("statment.close() does not wrap up")
-    public void testtestLast() {
-        try {
-            assertFalse(target.isLast());
-            target.last();
-            assertTrue(target.isLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            target.close();
-            target.last();
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-            // ok
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#next()}.
-     * @throws SQLException
-     */
-    @TestTargetNew(
-        level = TestLevel.SUFFICIENT,
-        notes = "SQLException checking test fails. Clearing of warnings"+
-                " and closed streams not supported.",
-        method = "next",
-        args = {}
-    )
-    @KnownFailure("Resultset.close() does not wrap up")
-    public void testNext() throws SQLException {
-        try {
-            //before first - first
-            assertTrue(target.next());
-            //first - second
-            assertTrue(target.next());
-            //after last
-            assertFalse(target.next());
-            assertTrue(target.isAfterLast());
-            // one more
-            assertFalse(target.next());
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            assertFalse(emptyTarget.next());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        target.close();
-        try {
-            target.next();
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-
-    }
-
-    public void testPrevious() throws SQLException {
-        try {
-            target.first();
-            target.previous();
-            assertTrue(target.isBeforeFirst());
-
-            target.last();
-            target.next();
-            target.previous();
-            assertFalse(target.isAfterLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        target.close();
-        try {
-            target.previous();
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#relative(int)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "test fails: no exception is thrown when moving cursor backwards",
-        method = "relative",
-        args = {int.class}
-    )
-    @KnownFailure("no exception is thrown when moving cursor backwards"
-            +" on forward only statement")
-    public void testRelative() {
-
-        // forward only
-        try {
-            int initialRow = target.getRow();
-            assertFalse(target.relative(0));
-            assertEquals(initialRow, target.getRow());
-
-            assertTrue(target.relative(1));
-            assertTrue(target.isFirst());
-            assertEquals(1, target.getRow());
-
-            assertTrue(target.relative(1));
-            assertFalse(target.isFirst());
-            assertEquals(2, target.getRow());
-
-
-            assertFalse(target.relative(2));
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-
-        try {
-            // should not be able to scroll backwards in forward only RS
-            target.relative(-2);
-            assertEquals(2,target.getRow());
-            fail("Should get SQLException");
-        } catch (SQLException e) {
-            // ok
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            assertFalse(emptyTarget.relative(Integer.MAX_VALUE));
-            assertTrue(emptyTarget.isAfterLast());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#relative(int)}.
-     * @throws SQLException
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "test fails: does not move before first row on min_value",
-        method = "relative",
-        args = {int.class}
-    )
-    @KnownFailure("Scrollable resultSet. Not supported")
-    public void testRelativeScrollableResultSet() throws SQLException {
-     // scrollable resultSet
-        try {
-
-            int initialRow = scrollableTarget.getRow();
-            assertFalse(scrollableTarget.relative(0));
-            assertEquals(initialRow, scrollableTarget.getRow());
-
-            assertTrue(scrollableTarget.relative(1));
-            assertTrue(scrollableTarget.isFirst());
-            assertEquals(1, scrollableTarget.getRow());
-
-            assertTrue(scrollableTarget.relative(1));
-            assertFalse(scrollableTarget.isFirst());
-
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            assertEquals(2, scrollableTarget.getRow());
-            assertFalse(scrollableTarget.relative(2));
-            scrollableTarget.relative(-2);
-            assertEquals(2,scrollableTarget.getRow());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-            assertFalse(scrollableTarget.relative(Integer.MIN_VALUE));
-            assertTrue(scrollableTarget.isBeforeFirst());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-        } catch (Exception e) {
-            fail("Unexpected exception: " + e.getMessage());
-        }
-
-        stScrollable.close();
-        try {
-            scrollableTarget.relative(1);
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateObject(java.lang.String, java.lang.Object)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.NOT_FEASIBLE,
-        notes = "not supported",
-        method = "updateObject",
-        args = {java.lang.String.class, java.lang.Object.class}
-    )
-    @KnownFailure("not supported")
-    public void testUpdateObjectStringObject() {
-        try {
-           writableTarget.next();
-           writableTarget.updateObject("family","bird");
-        } catch (SQLException e) {
-           fail("Unexpected exception: " + e.getMessage());
-        }
-
-        try {
-           target.next();
-           target.updateObject("family","bird");
-           fail("SQLException was not thrown");
-        } catch (SQLException e) {
-           fail("Unexpected exception: " + e.getMessage());
-        }
-    }
-
-
-    /**
-     * Test method for {@link java.sql.ResultSet#updateString(java.lang.String, java.lang.String)}.
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "not supported. Only exception testing. Missing testing for wrong type",
-        method = "updateString",
-        args = {java.lang.String.class, java.lang.String.class}
-    )
-    @KnownFailure("Feature not supported")
-    public void testUpdateStringStringString() throws Exception {
-        try {
-            writableTarget.next();
-            writableTarget.updateString("family","bird");
-         } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-         }
-
-         // non writable target.
-         try {
-            target.next();
-            target.updateString("family","bird");
-            fail("SQLException was not thrown");
-         } catch (SQLException e) {
-            //ok
-         }
-
-
-         // writable but wrong type
-         try {
-             target.updateString(1,"test");
-         } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-         }
-
-         target.close();
-
-      // Exception test
-         try {
-             target.updateString("family","test");
-             fail("Exception expected");
-         } catch (SQLException e) {
-            //ok
-         }
-    }
-
-    /**
-     * Test method for {@link java.sql.ResultSet#wasNull()}.
-     * Spec sais: if something was read... -> if nothing was read it should be false
-     * @throws SQLException
-     */
-    @TestTargetNew(
-        level = TestLevel.COMPLETE,
-        notes = "failing tests.",
-        method = "wasNull",
-        args = {}
-    )
-    @KnownFailure("the default tests, and exception tests fail.")
-    public void testWasNull() throws SQLException {
-
-        // Check default: select statement executed but no get on target called yet
-        // Either false or throw an exception.
-        try {
-            assertFalse(target.wasNull());
-        } catch (SQLException e) {
-            //ok
-        }
-
-
-        try {
-            stForward.execute("insert into zoo values(8,null,null);");
-            stForward.execute(selectAllAnimals);
-            target = stForward.getResultSet();
-            assertNotNull(target);
-            assertTrue(target.last());
-            assertNull(target.getObject(2));
-            assertTrue(target.wasNull());
-            assertNotNull(target.getObject(1));
-            assertFalse(target.wasNull());
-        } catch (SQLException e) {
-            fail("Unexpected exception: " + e.getMessage());
-            e.printStackTrace();
-        }
-
-        target.close();
-        try {
-            target.wasNull();
-            fail("Exception expected");
-        } catch (SQLException e) {
-            //ok
-        }
-    }
-}
diff --git a/luni/src/test/java/tests/sql/SQLDataTest.java b/luni/src/test/java/tests/sql/SQLDataTest.java
deleted file mode 100644
index 1aed820..0000000
--- a/luni/src/test/java/tests/sql/SQLDataTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.SQLData;
-import java.sql.SQLInput;
-import java.sql.SQLOutput;
-
-
-@TestTargetClass(SQLData.class)
-public class SQLDataTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.SQLData#getSQLTypeName()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getSQLTypeName",
-          args = {}
-        )
-    public void testGetSQLTypeName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLData#readSQL(java.sql.SQLInput, java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readSQL",
-          args = {SQLInput.class, String.class}
-        )
-    public void testReadSQL() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLData#writeSQL(java.sql.SQLOutput)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "writeSQL",
-          args = {SQLOutput.class}
-        )
-    public void testWriteSQL() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/SQLInputTest.java b/luni/src/test/java/tests/sql/SQLInputTest.java
deleted file mode 100644
index 818818b..0000000
--- a/luni/src/test/java/tests/sql/SQLInputTest.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.SQLInput;
-
-@TestTargetClass(SQLInput.class)
-public class SQLInputTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readString()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readString",
-          args = {}
-    )
-    public void testReadString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readBoolean()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readBoolean",
-          args = {}
-        )
-    public void testReadBoolean() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readByte()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readByte",
-          args = {}
-        )public void testReadByte() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readShort()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readShort",
-          args = {}
-        )
-    public void testReadShort() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readInt()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readInt",
-          args = {}
-        )
-    public void testReadInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readLong()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readLong",
-          args = {}
-        )
-    public void testReadLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readFloat()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readFloat",
-          args = {}
-        )
-    public void testReadFloat() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readDouble()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readDouble",
-          args = {}
-        )
-    public void testReadDouble() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readBigDecimal()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readBigDecimal",
-          args = {}
-        )
-    public void testReadBigDecimal() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readBytes()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readBytes",
-          args = {}
-        )
-    public void testReadBytes() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readDate()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readDate",
-          args = {}
-        )
-    public void testReadDate() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readTime()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readTime",
-          args = {}
-        )
-    public void testReadTime() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readTimestamp()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readTimestamp",
-          args = {}
-        )
-    public void testReadTimestamp() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readCharacterStream()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readCharacterStream",
-          args = {}
-        )
-    public void testReadCharacterStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readAsciiStream()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readAsciiStream",
-          args = {}
-        )
-    public void testReadAsciiStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readBinaryStream()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readBinaryStream",
-          args = {}
-        )
-    public void testReadBinaryStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readObject()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readObject",
-          args = {}
-        )
-    public void testReadObject() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readRef()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readRef",
-          args = {}
-        )
-    public void testReadRef() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readBlob()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readBlob",
-          args = {}
-    )
-    public void testReadBlob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readClob()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readClob",
-          args = {}
-        )
-    public void testReadClob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readArray()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readArray",
-          args = {}
-        )
-    public void testReadArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#wasNull()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "wasNull",
-          args = {}
-        )
-    public void testWasNull() {
-    fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLInput#readURL()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "readURL",
-          args = {}
-    )
-    public void testReadURL() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/SQLOutputTest.java b/luni/src/test/java/tests/sql/SQLOutputTest.java
deleted file mode 100644
index 13ef4b1..0000000
--- a/luni/src/test/java/tests/sql/SQLOutputTest.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.math.BigDecimal;
-import java.net.URL;
-import java.sql.Array;
-import java.sql.Blob;
-import java.sql.Clob;
-import java.sql.Date;
-import java.sql.Ref;
-import java.sql.SQLData;
-import java.sql.SQLOutput;
-import java.sql.Struct;
-import java.sql.Time;
-import java.sql.Timestamp;
-
-@TestTargetClass(SQLOutput.class)
-public class SQLOutputTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeString(java.lang.String)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeString",
-      args = {String.class}
-      )
-    public void testWriteString() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeBoolean(boolean)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeBoolean",
-      args = {boolean.class}
-      )
-    public void testWriteBoolean() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeByte(byte)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeByte",
-      args = {byte.class}
-      )
-    public void testWriteByte() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeShort(short)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeShort",
-      args = {short.class}
-      )
-    public void testWriteShort() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeInt(int)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeInt",
-      args = {int.class}
-      )
-    public void testWriteInt() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeLong(long)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeLong",
-      args = {long.class}
-      )
-    public void testWriteLong() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeFloat(float)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeFloat",
-      args = {float.class}
-      )
-    public void testWriteFloat() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeDouble(double)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeDouble",
-      args = {double.class}
-      )
-    public void testWriteDouble() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for
-     * {@link java.sql.SQLOutput#writeBigDecimal(java.math.BigDecimal)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeBigDecimal",
-      args = {BigDecimal.class}
-      )
-    public void testWriteBigDecimal() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeBytes(byte[])}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeBytes",
-      args = {byte[].class}
-    )
-    public void testWriteBytes() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeDate(java.sql.Date)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeDate",
-      args = {Date.class}
-      )
-    public void testWriteDate() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeTime(java.sql.Time)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeTime",
-      args = {Time.class}
-      )
-    public void testWriteTime() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for
-     * {@link java.sql.SQLOutput#writeTimestamp(java.sql.Timestamp)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeTimestamp",
-      args = {Timestamp.class}
-      )
-    public void testWriteTimestamp() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for
-     * {@link java.sql.SQLOutput#writeCharacterStream(java.io.Reader)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeCharacterStream",
-      args = {Reader.class}
-      )
-    public void testWriteCharacterStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for
-     * {@link java.sql.SQLOutput#writeAsciiStream(java.io.InputStream)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeAsciiStream",
-      args = {InputStream.class}
-      )
-    public void testWriteAsciiStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for
-     * {@link java.sql.SQLOutput#writeBinaryStream(java.io.InputStream)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeBinaryStream",
-      args = {InputStream.class}
-      )
-    public void testWriteBinaryStream() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeObject(java.sql.SQLData)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeObject",
-      args = {SQLData.class}
-      )
-    public void testWriteObject() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeRef(java.sql.Ref)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeRef",
-      args = {Ref.class}
-      )
-    public void testWriteRef() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeBlob(java.sql.Blob)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeBlob",
-      args = {Blob.class}
-      )
-    public void testWriteBlob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeClob(java.sql.Clob)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeClob",
-      args = {Clob.class}
-      )
-    public void testWriteClob() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeStruct(java.sql.Struct)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeStruct",
-      args = {Struct.class}
-      )
-    public void testWriteStruct() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeArray(java.sql.Array)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeArray",
-      args = {Array.class}
-      )
-    public void testWriteArray() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.SQLOutput#writeURL(java.net.URL)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "writeURL",
-      args = {URL.class}
-      )
-    public void testWriteURL() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/SavepointTest.java b/luni/src/test/java/tests/sql/SavepointTest.java
deleted file mode 100644
index dedf032..0000000
--- a/luni/src/test/java/tests/sql/SavepointTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.Savepoint;
-
-/**
- *
- */
-@TestTargetClass(Savepoint.class)
-public class SavepointTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.Savepoint#getSavepointId()}.
-     */
-   @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getSavepointId",
-      args = {}
-      )
-    public void testGetSavepointId() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Savepoint#getSavepointName()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-      method = "getSavepointName",
-      args = {}
-     )
-    public void testGetSavepointName() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/sql/StructTest.java b/luni/src/test/java/tests/sql/StructTest.java
deleted file mode 100644
index e4c0fd4..0000000
--- a/luni/src/test/java/tests/sql/StructTest.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (C) 2008 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.sql;
-
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetClass;
-import dalvik.annotation.TestTargetNew;
-
-import junit.framework.TestCase;
-
-import java.sql.Struct;
-import java.util.Map;
-
-@TestTargetClass(Struct.class)
-public class StructTest extends TestCase {
-
-    /**
-     * Test method for {@link java.sql.Struct#getSQLTypeName()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getSQLTypeName",
-          args = {}
-
-    )
-    public void testGetSQLTypeName() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Struct#getAttributes()}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-
-          method = "getAttributes",
-          args = {}
-    )
-    public void testGetAttributes() {
-        fail("Not yet implemented");
-    }
-
-    /**
-     * Test method for {@link java.sql.Struct#getAttributes(java.util.Map)}.
-     */
-    @TestTargetNew(
-      level = TestLevel.NOT_FEASIBLE,
-      notes = "",
-          method = "getAttributes",
-          args = {Map.class}
-    )
-    public void testGetAttributesMapOfStringClassOfQ() {
-        fail("Not yet implemented");
-    }
-
-}
diff --git a/luni/src/test/java/tests/suncompat/AllTests.java b/luni/src/test/java/tests/suncompat/AllTests.java
deleted file mode 100644
index e86889c..0000000
--- a/luni/src/test/java/tests/suncompat/AllTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.suncompat;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite that includes all tests for the suncompat project.
- */
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All suncompat test suites");
-        // $JUnit-BEGIN$
-        suite.addTest(sun.misc.AllTests.suite());
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/support/Support_SQL.java b/luni/src/test/java/tests/support/Support_SQL.java
index 0c1e8eb..c56a136 100644
--- a/luni/src/test/java/tests/support/Support_SQL.java
+++ b/luni/src/test/java/tests/support/Support_SQL.java
@@ -73,8 +73,13 @@
     }
 
     public static Connection getConnection() throws SQLException {
-        return DriverManager.getConnection(Support_SQL.sqlUrl,
-                Support_SQL.sqlLogin, Support_SQL.sqlPassword);
+        try {
+            return DriverManager.getConnection(Support_SQL.sqlUrl,
+                    Support_SQL.sqlLogin, Support_SQL.sqlPassword);
+        } catch (SQLException e) {
+            throw new SQLException("Failed to connect. url=" + Support_SQL.sqlUrl + ", sqlLogin="
+                    + Support_SQL.sqlLogin + ", sqlPassword=" + Support_SQL.sqlPassword, e);
+        }
     }
 
     public static Connection getConnection(String url, String login,
diff --git a/luni/src/test/java/tests/targets/security/AllTests.java b/luni/src/test/java/tests/targets/security/AllTests.java
deleted file mode 100644
index 6a896c8..0000000
--- a/luni/src/test/java/tests/targets/security/AllTests.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.targets.security;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.targets.security;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(MessageDigestTestMD2.class);
-        suite.addTestSuite(MessageDigestTestMD5.class);
-        suite.addTestSuite(MessageDigestTestSHA1.class);
-        suite.addTestSuite(MessageDigestTestSHA256.class);
-        suite.addTestSuite(MessageDigestTestSHA384.class);
-        suite.addTestSuite(MessageDigestTestSHA512.class);
-
-        suite.addTestSuite(SignatureTestMD2withRSA.class);
-
-        suite.addTestSuite(KeyStoreTestPKCS12.class);
-
-        suite.addTestSuite(SecureRandomTestSHA1PRNG.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/targets/security/KeyStoreTest.java b/luni/src/test/java/tests/targets/security/KeyStoreTest.java
index 41d0f9a..41206c8 100644
--- a/luni/src/test/java/tests/targets/security/KeyStoreTest.java
+++ b/luni/src/test/java/tests/targets/security/KeyStoreTest.java
@@ -15,9 +15,6 @@
  */
 package tests.targets.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -51,23 +48,6 @@
         this.keyStorePassword = keyStorePassword;
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="load",
-                args={InputStream.class,char[].class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.PARTIAL_COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     public void testKeyStoreLoad() {
         KeyStore keyStore = null;
         try {
@@ -95,28 +75,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="load",
-                args={InputStream.class,char[].class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="setEntry",
-                args={String.class,Entry.class,ProtectionParameter.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.PARTIAL_COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     public void testKeyStoreCreate() {
         KeyStore keyStore = null;
         try {
diff --git a/luni/src/test/java/tests/targets/security/MessageDigestTestMD2.java b/luni/src/test/java/tests/targets/security/MessageDigestTestMD2.java
index ab24067..6811bc0 100644
--- a/luni/src/test/java/tests/targets/security/MessageDigestTestMD2.java
+++ b/luni/src/test/java/tests/targets/security/MessageDigestTestMD2.java
@@ -16,8 +16,6 @@
 package tests.targets.security;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.Provider;
@@ -26,11 +24,6 @@
 
 public class MessageDigestTestMD2 extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        method = "getInstance",
-        args = {String.class}
-    )
     @AndroidOnly("Android doesn't include MD2 message digest algorithm")
     public void testMessageDigest1() throws Exception{
         try {
@@ -49,11 +42,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        method = "getInstance",
-        args = {String.class}
-    )
     @AndroidOnly("Android allows usage of MD2 in third party providers")
     public void testMessageDigest2() throws Exception{
 
diff --git a/luni/src/test/java/tests/targets/security/SignatureTestMD2withRSA.java b/luni/src/test/java/tests/targets/security/SignatureTestMD2withRSA.java
index 2041d41..3a30c2f 100644
--- a/luni/src/test/java/tests/targets/security/SignatureTestMD2withRSA.java
+++ b/luni/src/test/java/tests/targets/security/SignatureTestMD2withRSA.java
@@ -16,8 +16,6 @@
 package tests.targets.security;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 import java.security.InvalidKeyException;
 import java.security.InvalidParameterException;
 import java.security.NoSuchAlgorithmException;
@@ -31,11 +29,6 @@
 
 public class SignatureTestMD2withRSA extends TestCase {
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        method = "getInstance",
-        args = {String.class}
-    )
     @AndroidOnly("Android doesn't include MD2withRSA signature algorithm")
     public void testSignature() {
 
@@ -98,11 +91,6 @@
         }
     }
 
-    @TestTargetNew(
-        level = TestLevel.ADDITIONAL,
-        method = "getInstance",
-        args = {String.class}
-    )
     @AndroidOnly("Android allows usage of MD2withRSA in third party providers")
     public void testSignature2() throws Exception{
 
diff --git a/luni/src/test/java/tests/targets/security/cert/AllTests.java b/luni/src/test/java/tests/targets/security/cert/AllTests.java
deleted file mode 100644
index c0c411d..0000000
--- a/luni/src/test/java/tests/targets/security/cert/AllTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package tests.targets.security.cert;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite("All tests for package tests.targets.security.certs;");
-        // $JUnit-BEGIN$
-
-        suite.addTestSuite(CertificateTest.class);
-        suite.addTestSuite(CertificateFactoryTestX509.class);
-        suite.addTestSuite(CertPathBuilderTestPKIX.class);
-        suite.addTestSuite(CertPathValidatorTestPKIX.class);
-
-        // $JUnit-END$
-        return suite;
-    }
-}
diff --git a/luni/src/test/java/tests/targets/security/cert/CertificateTest.java b/luni/src/test/java/tests/targets/security/cert/CertificateTest.java
index 78619a5..dde7664 100644
--- a/luni/src/test/java/tests/targets/security/cert/CertificateTest.java
+++ b/luni/src/test/java/tests/targets/security/cert/CertificateTest.java
@@ -16,8 +16,6 @@
 package tests.targets.security.cert;
 
 import dalvik.annotation.AndroidOnly;
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
 import java.io.ByteArrayInputStream;
 import java.security.KeyStore;
 import java.security.NoSuchAlgorithmException;
@@ -590,12 +588,6 @@
         + "+qrLMgx5qoZ0bERU9tgHns2Y9CMFCS+iU7XbCoHMXyPLeRHFEVuFaycBifMOuw==\n"
         + "-----END CERTIFICATE-----";
 
-    @TestTargetNew(
-            clazz=Certificate.class,
-            level=TestLevel.ADDITIONAL,
-            method="verify",
-            args={PublicKey.class}
-    )
     public void testVerifyMD5() throws Exception {
         Provider[] providers = Security.getProviders("CertificateFactory.X509");
         for (Provider provider : providers) {
@@ -610,12 +602,6 @@
         }
     }
 
-    @TestTargetNew(
-            clazz=Certificate.class,
-            level=TestLevel.ADDITIONAL,
-            method="verify",
-            args={PublicKey.class}
-    )
     @AndroidOnly("MD2 is not supported by Android")
     public void testVerifyMD2() throws Exception {
         Provider[] providers = Security.getProviders("CertificateFactory.X509");
@@ -635,12 +621,6 @@
         }
     }
 
-    @TestTargetNew(
-            clazz=CertPathValidator.class,
-            level=TestLevel.ADDITIONAL,
-            method="verify",
-            args={PublicKey.class}
-    )
     public void testVerifyMD2_chain() throws Exception {
         CertificateFactory certificateFactory = CertificateFactory
                 .getInstance("X509");
@@ -679,12 +659,6 @@
                 .contains(r.getTrustAnchor()));
     }
 
-    @TestTargetNew(
-            clazz=CertPathValidator.class,
-            level=TestLevel.ADDITIONAL,
-            method="verify",
-            args={PublicKey.class}
-    )
     public void testVerifyMD5_chain() throws Exception {
         CertificateFactory certificateFactory = CertificateFactory
                 .getInstance("X509");
diff --git a/luni/src/test/java/tests/xml/AllTests.java b/luni/src/test/java/tests/xml/AllTests.java
deleted file mode 100644
index 8fd8096..0000000
--- a/luni/src/test/java/tests/xml/AllTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2007 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.xml;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-
-    public static Test suite() {
-        TestSuite suite = new TestSuite();
-
-        suite.addTestSuite(DeclarationTest.class);
-        suite.addTestSuite(DomTest.class);
-        suite.addTestSuite(SimpleParserTest.class);
-        suite.addTestSuite(SimpleBuilderTest.class);
-        suite.addTestSuite(NodeTest.class);
-        suite.addTestSuite(NormalizeTest.class);
-        suite.addTestSuite(SaxTest.class);
-
-        //suite.addTest(tests.org.w3c.dom.AllTests.suite());
-        suite.addTest(tests.api.javax.xml.parsers.AllTests.suite());
-
-        suite.addTest(tests.api.org.xml.sax.AllTests.suite());
-        // BEGIN android-changed: this is in the dom module!
-        // suite.addTest(tests.api.org.w3c.dom.AllTests.suite());
-        // END android-changed
-        suite.addTest(tests.org.w3c.dom.AllTests.suite());
-        suite.addTest(org.kxml2.io.AllTests.suite());
-
-        return suite;
-    }
-
-}
diff --git a/support/src/test/java/libcore/java/security/StandardNames.java b/support/src/test/java/libcore/java/security/StandardNames.java
index 58aaf28..9f32309 100644
--- a/support/src/test/java/libcore/java/security/StandardNames.java
+++ b/support/src/test/java/libcore/java/security/StandardNames.java
@@ -17,8 +17,14 @@
 package libcore.java.security;
 
 import java.security.Security;
+import java.security.spec.DSAPrivateKeySpec;
+import java.security.spec.DSAPublicKeySpec;
+import java.security.spec.ECPrivateKeySpec;
+import java.security.spec.ECPublicKeySpec;
+import java.security.spec.KeySpec;
+import java.security.spec.RSAPrivateCrtKeySpec;
+import java.security.spec.RSAPublicKeySpec;
 import java.util.Arrays;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -27,6 +33,8 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import javax.crypto.spec.DHPrivateKeySpec;
+import javax.crypto.spec.DHPublicKeySpec;
 import junit.framework.Assert;
 
 /**
@@ -663,6 +671,39 @@
             }
         }
     }
+    
+    public static final Map<String, Class<? extends KeySpec>> PRIVATE_KEY_SPEC_CLASSES;
+    public static final Map<String, Class<? extends KeySpec>> PUBLIC_KEY_SPEC_CLASSES;
+    public static final Map<String, Integer> MINIMUM_KEY_SIZE;
+    static {
+        PRIVATE_KEY_SPEC_CLASSES = new HashMap<String, Class<? extends KeySpec>>();
+        PUBLIC_KEY_SPEC_CLASSES = new HashMap<String, Class<? extends KeySpec>>();
+        MINIMUM_KEY_SIZE = new HashMap<String, Integer>();
+        PRIVATE_KEY_SPEC_CLASSES.put("RSA", RSAPrivateCrtKeySpec.class);
+        PUBLIC_KEY_SPEC_CLASSES.put("RSA", RSAPublicKeySpec.class);
+        MINIMUM_KEY_SIZE.put("RSA", 256);
+        PRIVATE_KEY_SPEC_CLASSES.put("DSA", DSAPrivateKeySpec.class);
+        PUBLIC_KEY_SPEC_CLASSES.put("DSA", DSAPublicKeySpec.class);
+        MINIMUM_KEY_SIZE.put("DSA", 512);
+        PRIVATE_KEY_SPEC_CLASSES.put("DH", DHPrivateKeySpec.class);
+        PUBLIC_KEY_SPEC_CLASSES.put("DH", DHPublicKeySpec.class);
+        MINIMUM_KEY_SIZE.put("DH", 256);
+        PRIVATE_KEY_SPEC_CLASSES.put("EC", ECPrivateKeySpec.class);
+        PUBLIC_KEY_SPEC_CLASSES.put("EC", ECPublicKeySpec.class);
+        MINIMUM_KEY_SIZE.put("EC", 256);
+    }
+    
+    public static Class<? extends KeySpec> getPrivateKeySpecClass(String algName) {
+        return PRIVATE_KEY_SPEC_CLASSES.get(algName);
+    }
+
+    public static Class<? extends KeySpec> getPublicKeySpecClass(String algName) {
+        return PUBLIC_KEY_SPEC_CLASSES.get(algName);
+    }
+
+    public static int getMinimumKeySize(String algName) {
+        return MINIMUM_KEY_SIZE.get(algName);
+    }
 
     /**
      * Asserts that the cipher suites array is non-null and that it
diff --git a/support/src/test/java/libcore/java/security/TestKeyStore.java b/support/src/test/java/libcore/java/security/TestKeyStore.java
index 94daaf5..12b166b 100644
--- a/support/src/test/java/libcore/java/security/TestKeyStore.java
+++ b/support/src/test/java/libcore/java/security/TestKeyStore.java
@@ -16,8 +16,13 @@
 
 package libcore.java.security;
 
+import com.android.org.bouncycastle.asn1.DEROctetString;
 import com.android.org.bouncycastle.asn1.x509.BasicConstraints;
+import com.android.org.bouncycastle.asn1.x509.GeneralName;
+import com.android.org.bouncycastle.asn1.x509.GeneralNames;
+import com.android.org.bouncycastle.asn1.x509.GeneralSubtree;
 import com.android.org.bouncycastle.asn1.x509.KeyUsage;
+import com.android.org.bouncycastle.asn1.x509.NameConstraints;
 import com.android.org.bouncycastle.asn1.x509.X509Extensions;
 import com.android.org.bouncycastle.asn1.x509.X509Name;
 import com.android.org.bouncycastle.jce.X509Principal;
@@ -27,14 +32,16 @@
 import java.io.PrintStream;
 import java.math.BigInteger;
 import java.net.InetAddress;
-import java.security.Key;
+import java.net.UnknownHostException;
 import java.security.KeyFactory;
 import java.security.KeyPair;
 import java.security.KeyPairGenerator;
+import java.security.KeyStore;
 import java.security.KeyStore.PasswordProtection;
 import java.security.KeyStore.PrivateKeyEntry;
 import java.security.KeyStore.TrustedCertificateEntry;
-import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
 import java.security.Principal;
 import java.security.PrivateKey;
 import java.security.PublicKey;
@@ -46,9 +53,12 @@
 import java.security.cert.X509Certificate;
 import java.security.interfaces.ECPrivateKey;
 import java.security.spec.PKCS8EncodedKeySpec;
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Date;
 import java.util.Hashtable;
+import java.util.List;
+import java.util.Vector;
 import javax.net.ssl.KeyManager;
 import javax.net.ssl.KeyManagerFactory;
 import javax.net.ssl.TrustManager;
@@ -66,6 +76,14 @@
  */
 public final class TestKeyStore extends Assert {
 
+    private static TestKeyStore ROOT_CA;
+
+    private static TestKeyStore SERVER;
+    private static TestKeyStore CLIENT;
+    private static TestKeyStore CLIENT_CERTIFICATE;
+
+    private static TestKeyStore CLIENT_2;
+
     static {
         if (StandardNames.IS_RI) {
             // Needed to create BKS keystore but add at end so most
@@ -74,6 +92,7 @@
                                       Security.getProviders().length+1);
         }
     }
+
     private static final boolean TEST_MANAGERS = true;
 
     public final KeyStore keyStore;
@@ -84,9 +103,8 @@
     public final TestKeyManager keyManager;
     public final TestTrustManager trustManager;
 
-    private TestKeyStore(KeyStore keyStore,
-                         char[] storePassword,
-                         char[] keyPassword) {
+    private TestKeyStore(KeyStore keyStore, char[] storePassword, char[] keyPassword)
+            throws Exception {
         this.keyStore = keyStore;
         this.storePassword = storePassword;
         this.keyPassword = keyPassword;
@@ -96,90 +114,70 @@
         this.trustManager = (TestTrustManager)trustManagers[0];
     }
 
-    public static KeyManager[] createKeyManagers(final KeyStore keyStore,
-                                                 final char[] storePassword) {
+    public static KeyManager[] createKeyManagers(KeyStore keyStore, char[] storePassword)
+            throws Exception {
+        String kmfa = KeyManagerFactory.getDefaultAlgorithm();
+        KeyManagerFactory kmf = KeyManagerFactory.getInstance(kmfa);
+        kmf.init(keyStore, storePassword);
+        return TestKeyManager.wrap(kmf.getKeyManagers());
+    }
+
+    public static TrustManager[] createTrustManagers(final KeyStore keyStore) throws Exception {
+        String tmfa = TrustManagerFactory.getDefaultAlgorithm();
+        TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfa);
+        tmf.init(keyStore);
+        return TestTrustManager.wrap(tmf.getTrustManagers());
+    }
+
+    /**
+     * Lazily create shared test certificates.
+     */
+    private static synchronized void initCerts() {
+        if (ROOT_CA != null) {
+            return;
+        }
         try {
-            String kmfa = KeyManagerFactory.getDefaultAlgorithm();
-            KeyManagerFactory kmf = KeyManagerFactory.getInstance(kmfa);
-            kmf.init(keyStore, storePassword);
-            return TestKeyManager.wrap(kmf.getKeyManagers());
+            ROOT_CA = new Builder()
+                    .aliasPrefix("RootCA")
+                    .subject("Test Root Certificate Authority")
+                    .ca(true)
+                    .build();
+            TestKeyStore intermediateCa = new Builder()
+                    .aliasPrefix("IntermediateCA")
+                    .subject("Test Intermediate Certificate Authority")
+                    .ca(true)
+                    .signer(ROOT_CA.getPrivateKey("RSA", "RSA"))
+                    .rootCa(ROOT_CA.getRootCertificate("RSA"))
+                    .build();
+            SERVER = new Builder()
+                    .aliasPrefix("server")
+                    .signer(intermediateCa.getPrivateKey("RSA", "RSA"))
+                    .rootCa(intermediateCa.getRootCertificate("RSA"))
+                    .build();
+            CLIENT = new TestKeyStore(createClient(intermediateCa.keyStore), null, null);
+            CLIENT_CERTIFICATE = new Builder()
+                    .aliasPrefix("client")
+                    .subject("test@user")
+                    .signer(intermediateCa.getPrivateKey("RSA", "RSA"))
+                    .rootCa(intermediateCa.getRootCertificate("RSA"))
+                    .build();
+            TestKeyStore rootCa2 = new Builder()
+                    .aliasPrefix("RootCA2")
+                    .subject("Test Root Certificate Authority 2")
+                    .ca(true)
+                    .build();
+            CLIENT_2 = new TestKeyStore(createClient(rootCa2.keyStore), null, null);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
     }
 
-    public static TrustManager[] createTrustManagers(final KeyStore keyStore) {
-        try {
-            String tmfa = TrustManagerFactory.getDefaultAlgorithm();
-            TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmfa);
-            tmf.init(keyStore);
-            return TestTrustManager.wrap(tmf.getTrustManagers());
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    private static final TestKeyStore ROOT_CA
-            = create(new String[] { "RSA" },
-                     null,
-                     null,
-                     "RootCA",
-                     x509Principal("Test Root Certificate Authority"),
-                     0,
-                     true,
-                     null,
-                     null);
-    private static final TestKeyStore INTERMEDIATE_CA
-            = create(new String[] { "RSA" },
-                     null,
-                     null,
-                     "IntermediateCA",
-                     x509Principal("Test Intermediate Certificate Authority"),
-                     0,
-                     true,
-                     ROOT_CA.getPrivateKey("RSA", "RSA"),
-                     ROOT_CA.getRootCertificate("RSA"));
-    private static final TestKeyStore SERVER
-            = create(new String[] { "RSA" },
-                     null,
-                     null,
-                     "server",
-                     localhost(),
-                     0,
-                     false,
-                     INTERMEDIATE_CA.getPrivateKey("RSA", "RSA"),
-                     INTERMEDIATE_CA.getRootCertificate("RSA"));
-    private static final TestKeyStore CLIENT
-            = new TestKeyStore(createClient(INTERMEDIATE_CA.keyStore), null, null);
-    private static final TestKeyStore CLIENT_CERTIFICATE
-            = create(new String[] { "RSA" },
-                     null,
-                     null,
-                     "client",
-                     x509Principal("test@user"),
-                     0,
-                     false,
-                     INTERMEDIATE_CA.getPrivateKey("RSA", "RSA"),
-                     INTERMEDIATE_CA.getRootCertificate("RSA"));
-
-    private static final TestKeyStore ROOT_CA_2
-            = create(new String[] { "RSA" },
-                     null,
-                     null,
-                     "RootCA2",
-                     x509Principal("Test Root Certificate Authority 2"),
-                     0,
-                     true,
-                     null,
-                     null);
-    private static final TestKeyStore CLIENT_2
-            = new TestKeyStore(createClient(ROOT_CA_2.keyStore), null, null);
-
     /**
      * Return a server keystore with a matched RSA certificate and
      * private key as well as a CA certificate.
      */
     public static TestKeyStore getServer() {
+        initCerts();
         return SERVER;
     }
 
@@ -187,6 +185,7 @@
      * Return a keystore with a CA certificate
      */
     public static TestKeyStore getClient() {
+        initCerts();
         return CLIENT;
     }
 
@@ -195,6 +194,7 @@
      * private key as well as a CA certificate.
      */
     public static TestKeyStore getClientCertificate() {
+        initCerts();
         return CLIENT_CERTIFICATE;
     }
 
@@ -204,32 +204,111 @@
      * testing.
      */
     public static TestKeyStore getClientCA2() {
+        initCerts();
         return CLIENT_2;
     }
 
     /**
-     * Create a new KeyStore containing the requested key types.
-     * Since key generation can be expensive, most tests should reuse
-     * the RSA-only singleton instance returned by TestKeyStore.get
-     *
-     * @param keyAlgorithms The requested key types to generate and include
-     * @param keyStorePassword Password used to protect the private key
-     * @param aliasPrefix A unique prefix to identify the key aliases
-     * @param keyUsage {@link KeyUsage} bit mask for 2.5.29.15 extension
-     * @param ca true If the keys being created are for a CA
-     * @param signer If non-null, a private key entry to be used for signing, otherwise self-sign
-     * @param signer If non-null, a root CA to include in the final store
+     * Creates KeyStores containing the requested key types. Since key
+     * generation can be expensive, most tests should reuse the RSA-only
+     * singleton instance returned by TestKeyStore.get.
      */
-    public static TestKeyStore create(String[] keyAlgorithms,
-                                      char[] storePassword,
-                                      char[] keyPassword,
-                                      String aliasPrefix,
-                                      X509Principal subject,
-                                      int keyUsage,
-                                      boolean ca,
-                                      PrivateKeyEntry signer,
-                                      Certificate rootCa) {
-        try {
+    public static class Builder {
+        private String[] keyAlgorithms = { "RSA" };
+        private char[] storePassword;
+        private char[] keyPassword;
+        private String aliasPrefix;
+        private X509Principal subject;
+        private int keyUsage;
+        private boolean ca;
+        private PrivateKeyEntry signer;
+        private Certificate rootCa;
+        private final List<GeneralName> subjectAltNames = new ArrayList<GeneralName>();
+        private final Vector<GeneralSubtree> permittedNameConstraints
+                = new Vector<GeneralSubtree>();
+        private final Vector<GeneralSubtree> excludedNameConstraints = new Vector<GeneralSubtree>();
+
+        public Builder() throws Exception {
+            subject = localhost();
+        }
+
+        /**
+         * Sets the requested key types to generate and include. The default is
+         * RSA only.
+         */
+        public Builder keyAlgorithms(String... keyAlgorithms) {
+            this.keyAlgorithms = keyAlgorithms;
+            return this;
+        }
+
+        /** A unique prefix to identify the key aliases */
+        public Builder aliasPrefix(String aliasPrefix) {
+            this.aliasPrefix = aliasPrefix;
+            return this;
+        }
+
+        /**
+         * Sets the subject common name. The default is the local host's
+         * canonical name.
+         */
+        public Builder subject(X509Principal subject) {
+            this.subject = subject;
+            return this;
+        }
+
+        public Builder subject(String commonName) {
+            return subject(x509Principal(commonName));
+        }
+
+        /** {@link KeyUsage} bit mask for 2.5.29.15 extension */
+        public Builder keyUsage(int keyUsage) {
+            this.keyUsage = keyUsage;
+            return this;
+        }
+
+        /** true If the keys being created are for a CA */
+        public Builder ca(boolean ca) {
+            this.ca = ca;
+            return this;
+        }
+
+        /** a private key entry to be used for signing, otherwise self-sign */
+        public Builder signer(PrivateKeyEntry signer) {
+            this.signer = signer;
+            return this;
+        }
+
+        /** a root CA to include in the final store */
+        public Builder rootCa(Certificate rootCa) {
+            this.rootCa = rootCa;
+            return this;
+        }
+
+        private Builder addSubjectAltName(GeneralName generalName) {
+            subjectAltNames.add(generalName);
+            return this;
+        }
+
+        public Builder addSubjectAltNameIpAddress(byte[] ipAddress) {
+            return addSubjectAltName(
+                    new GeneralName(GeneralName.iPAddress, new DEROctetString(ipAddress)));
+        }
+
+        private Builder addNameConstraint(boolean permitted, GeneralName generalName) {
+            if (permitted) {
+                permittedNameConstraints.add(new GeneralSubtree(generalName));
+            } else {
+                excludedNameConstraints.add(new GeneralSubtree(generalName));
+            }
+            return this;
+        }
+
+        public Builder addNameConstraint(boolean permitted, byte[] ipAddress) {
+            return addNameConstraint(permitted,
+                    new GeneralName(GeneralName.iPAddress, new DEROctetString(ipAddress)));
+        }
+
+        public TestKeyStore build() throws Exception {
             if (StandardNames.IS_RI) {
                 // JKS does not allow null password
                 if (storePassword == null) {
@@ -239,28 +318,17 @@
                     keyPassword = "password".toCharArray();
                 }
             }
+
             KeyStore keyStore = createKeyStore();
-            boolean ecRsa = false;
             for (String keyAlgorithm : keyAlgorithms) {
                 String publicAlias  = aliasPrefix + "-public-"  + keyAlgorithm;
                 String privateAlias = aliasPrefix + "-private-" + keyAlgorithm;
                 if (keyAlgorithm.equals("EC_RSA") && signer == null && rootCa == null) {
-                    createKeys(keyStore, keyPassword,
-                               keyAlgorithm,
-                               publicAlias, privateAlias,
-                               subject,
-                               keyUsage,
-                               ca,
-                               privateKey(keyStore, keyPassword, "RSA", "RSA"));
+                    createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias,
+                            privateKey(keyStore, keyPassword, "RSA", "RSA"));
                     continue;
                 }
-                createKeys(keyStore, keyPassword,
-                           keyAlgorithm,
-                           publicAlias, privateAlias,
-                           subject,
-                           keyUsage,
-                           ca,
-                           signer);
+                createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, signer);
             }
             if (rootCa != null) {
                 keyStore.setCertificateEntry(aliasPrefix
@@ -269,10 +337,180 @@
                                              rootCa);
             }
             return new TestKeyStore(keyStore, storePassword, keyPassword);
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
+        }
+
+        /**
+         * Add newly generated keys of a given key type to an existing
+         * KeyStore. The PrivateKey will be stored under the specified
+         * private alias name. The X509Certificate will be stored on the
+         * public alias name and have the given subject distinguished
+         * name.
+         *
+         * If a CA is provided, it will be used to sign the generated
+         * certificate. Otherwise, the certificate will be self
+         * signed. The certificate will be valid for one day before and
+         * one day after the time of creation.
+         *
+         * Based on:
+         * org.bouncycastle.jce.provider.test.SigTest
+         * org.bouncycastle.jce.provider.test.CertTest
+         */
+        private KeyStore createKeys(KeyStore keyStore,
+                String keyAlgorithm,
+                String publicAlias,
+                String privateAlias,
+                PrivateKeyEntry signer) throws Exception {
+            PrivateKey caKey;
+            X509Certificate caCert;
+            X509Certificate[] caCertChain;
+            if (signer == null) {
+                caKey = null;
+                caCert = null;
+                caCertChain = null;
+            } else {
+                caKey = signer.getPrivateKey();
+                caCert = (X509Certificate)signer.getCertificate();
+                caCertChain = (X509Certificate[])signer.getCertificateChain();
+            }
+
+            PrivateKey privateKey;
+            X509Certificate x509c;
+            if (publicAlias == null && privateAlias == null) {
+                // don't want anything apparently
+                privateKey = null;
+                x509c = null;
+            } else {
+                // 1.) we make the keys
+                int keySize;
+                String signatureAlgorithm;
+                if (keyAlgorithm.equals("RSA")) {
+                    keySize = StandardNames.IS_RI ? 1024 : 512; // 512 breaks SSL_RSA_EXPORT_* on RI
+                    signatureAlgorithm = "sha1WithRSA";
+                } else if (keyAlgorithm.equals("DSA")) {
+                    keySize = 512;
+                    signatureAlgorithm = "sha1WithDSA";
+                } else if (keyAlgorithm.equals("EC")) {
+                    keySize = 256;
+                    signatureAlgorithm = "sha1WithECDSA";
+                } else if (keyAlgorithm.equals("EC_RSA")) {
+                    keySize = 256;
+                    keyAlgorithm = "EC";
+                    signatureAlgorithm = "sha1WithRSA";
+                } else {
+                    throw new IllegalArgumentException("Unknown key algorithm " + keyAlgorithm);
+                }
+
+                KeyPairGenerator kpg = KeyPairGenerator.getInstance(keyAlgorithm);
+                kpg.initialize(keySize, new SecureRandom());
+
+                KeyPair kp = kpg.generateKeyPair();
+                privateKey = kp.getPrivate();
+                PublicKey publicKey  = kp.getPublic();
+                // 2.) use keys to make certificate
+
+                // note that there doesn't seem to be a standard way to make a
+                // certificate using java.* or javax.*. The CertificateFactory
+                // interface assumes you want to read in a stream of bytes a
+                // factory specific format. So here we use Bouncy Castle's
+                // X509V3CertificateGenerator and related classes.
+                X509Principal issuer;
+                if (caCert == null) {
+                    issuer = subject;
+                } else {
+                    Principal xp = caCert.getSubjectDN();
+                    issuer = new X509Principal(new X509Name(xp.getName()));
+                }
+
+                long millisPerDay = 24 * 60 * 60 * 1000;
+                long now = System.currentTimeMillis();
+                Date start = new Date(now - millisPerDay);
+                Date end = new Date(now + millisPerDay);
+                BigInteger serial = BigInteger.valueOf(1);
+
+                X509V3CertificateGenerator x509cg = new X509V3CertificateGenerator();
+                x509cg.setSubjectDN(subject);
+                x509cg.setIssuerDN(issuer);
+                x509cg.setNotBefore(start);
+                x509cg.setNotAfter(end);
+                x509cg.setPublicKey(publicKey);
+                x509cg.setSignatureAlgorithm(signatureAlgorithm);
+                x509cg.setSerialNumber(serial);
+                if (keyUsage != 0) {
+                    x509cg.addExtension(X509Extensions.KeyUsage,
+                                        true,
+                                        new KeyUsage(keyUsage));
+                }
+                if (ca) {
+                    x509cg.addExtension(X509Extensions.BasicConstraints,
+                                        true,
+                                        new BasicConstraints(true));
+                }
+                for (GeneralName subjectAltName : subjectAltNames) {
+                    x509cg.addExtension(X509Extensions.SubjectAlternativeName, false,
+                            new GeneralNames(subjectAltName).getEncoded());
+                }
+                if (!permittedNameConstraints.isEmpty() || !excludedNameConstraints.isEmpty()) {
+                    x509cg.addExtension(X509Extensions.NameConstraints, true,
+                            new NameConstraints(permittedNameConstraints, excludedNameConstraints));
+                }
+
+                PrivateKey signingKey = (caKey == null) ? privateKey : caKey;
+                if (signingKey instanceof ECPrivateKey) {
+                    /*
+                     * bouncycastle needs its own ECPrivateKey implementation
+                     */
+                    KeyFactory kf = KeyFactory.getInstance(keyAlgorithm, "BC");
+                    PKCS8EncodedKeySpec ks = new PKCS8EncodedKeySpec(signingKey.getEncoded());
+                    signingKey = kf.generatePrivate(ks);
+                }
+                x509c = x509cg.generateX509Certificate(signingKey);
+                if (StandardNames.IS_RI) {
+                    /*
+                     * The RI can't handle the BC EC signature algorithm
+                     * string of "ECDSA", since it expects "...WITHEC...",
+                     * so convert from BC to RI X509Certificate
+                     * implementation via bytes.
+                     */
+                    CertificateFactory cf = CertificateFactory.getInstance("X.509");
+                    ByteArrayInputStream bais = new ByteArrayInputStream(x509c.getEncoded());
+                    Certificate c = cf.generateCertificate(bais);
+                    x509c = (X509Certificate) c;
+                }
+            }
+
+            X509Certificate[] x509cc;
+            if (privateAlias == null) {
+                // don't need certificate chain
+                x509cc = null;
+            } else if (caCertChain == null) {
+                x509cc = new X509Certificate[] { x509c };
+            } else {
+                x509cc = new X509Certificate[caCertChain.length+1];
+                x509cc[0] = x509c;
+                System.arraycopy(caCertChain, 0, x509cc, 1, caCertChain.length);
+            }
+
+            // 3.) put certificate and private key into the key store
+            if (privateAlias != null) {
+                keyStore.setKeyEntry(privateAlias, privateKey, keyPassword, x509cc);
+            }
+            if (publicAlias != null) {
+                keyStore.setCertificateEntry(publicAlias, x509c);
+            }
+            return keyStore;
+        }
+
+        private X509Principal localhost() throws UnknownHostException {
+            return x509Principal(InetAddress.getLoopbackAddress().getHostName());
+        }
+
+        /**
+         * Create an X509Principal with the given attributes
+         */
+        public static X509Principal x509Principal(String commonName) {
+            Hashtable attributes = new Hashtable();
+            attributes.put(X509Principal.CN, commonName);
+            return new X509Principal(attributes);
         }
     }
 
@@ -320,187 +558,12 @@
     }
 
     /**
-     * Add newly generated keys of a given key type to an existing
-     * KeyStore. The PrivateKey will be stored under the specified
-     * private alias name. The X509Certificate will be stored on the
-     * public alias name and have the given subject distiguished
-     * name.
-     *
-     * If a CA is provided, it will be used to sign the generated
-     * certificate. Otherwise, the certificate will be self
-     * signed. The certificate will be valid for one day before and
-     * one day after the time of creation.
-     *
-     * Based on:
-     * org.bouncycastle.jce.provider.test.SigTest
-     * org.bouncycastle.jce.provider.test.CertTest
-     */
-    public static KeyStore createKeys(KeyStore keyStore,
-                                      char[] keyPassword,
-                                      String keyAlgorithm,
-                                      String publicAlias,
-                                      String privateAlias,
-                                      X509Principal subject,
-                                      int keyUsage,
-                                      boolean ca,
-                                      PrivateKeyEntry signer) throws Exception {
-        PrivateKey caKey;
-        X509Certificate caCert;
-        X509Certificate[] caCertChain;
-        if (signer == null) {
-            caKey = null;
-            caCert = null;
-            caCertChain = null;
-        } else {
-            caKey = signer.getPrivateKey();
-            caCert = (X509Certificate)signer.getCertificate();
-            caCertChain = (X509Certificate[])signer.getCertificateChain();
-        }
-
-        PrivateKey privateKey;
-        X509Certificate x509c;
-        if (publicAlias == null && privateAlias == null) {
-            // don't want anything apparently
-            privateKey = null;
-            x509c = null;
-        } else {
-            // 1.) we make the keys
-            int keySize;
-            String signatureAlgorithm;
-            if (keyAlgorithm.equals("RSA")) {
-                keySize = StandardNames.IS_RI ? 1024 : 512; // 512 breaks SSL_RSA_EXPORT_* on RI
-                signatureAlgorithm = "sha1WithRSA";
-            } else if (keyAlgorithm.equals("DSA")) {
-                keySize = 512;
-                signatureAlgorithm = "sha1WithDSA";
-            } else if (keyAlgorithm.equals("EC")) {
-                keySize = 256;
-                signatureAlgorithm = "sha1WithECDSA";
-            } else if (keyAlgorithm.equals("EC_RSA")) {
-                keySize = 256;
-                keyAlgorithm = "EC";
-                signatureAlgorithm = "sha1WithRSA";
-            } else {
-                throw new IllegalArgumentException("Unknown key algorithm " + keyAlgorithm);
-            }
-
-            KeyPairGenerator kpg = KeyPairGenerator.getInstance(keyAlgorithm);
-            kpg.initialize(keySize, new SecureRandom());
-
-            KeyPair kp = kpg.generateKeyPair();
-            privateKey = (PrivateKey)kp.getPrivate();
-            PublicKey publicKey  = (PublicKey)kp.getPublic();
-            // 2.) use keys to make certficate
-
-            // note that there doesn't seem to be a standard way to make a
-            // certificate using java.* or javax.*. The CertificateFactory
-            // interface assumes you want to read in a stream of bytes a
-            // factory specific format. So here we use Bouncy Castle's
-            // X509V3CertificateGenerator and related classes.
-            X509Principal issuer;
-            if (caCert == null) {
-                issuer = subject;
-            } else {
-                Principal xp = caCert.getSubjectDN();
-                issuer = new X509Principal(new X509Name(xp.getName()));
-            }
-
-            long millisPerDay = 24 * 60 * 60 * 1000;
-            long now = System.currentTimeMillis();
-            Date start = new Date(now - millisPerDay);
-            Date end = new Date(now + millisPerDay);
-            BigInteger serial = BigInteger.valueOf(1);
-
-            X509V3CertificateGenerator x509cg = new X509V3CertificateGenerator();
-            x509cg.setSubjectDN(subject);
-            x509cg.setIssuerDN(issuer);
-            x509cg.setNotBefore(start);
-            x509cg.setNotAfter(end);
-            x509cg.setPublicKey(publicKey);
-            x509cg.setSignatureAlgorithm(signatureAlgorithm);
-            x509cg.setSerialNumber(serial);
-            if (keyUsage != 0) {
-                x509cg.addExtension(X509Extensions.KeyUsage,
-                                    true,
-                                    new KeyUsage(keyUsage));
-            }
-            if (ca) {
-                x509cg.addExtension(X509Extensions.BasicConstraints,
-                                    true,
-                                    new BasicConstraints(true));
-            }
-            PrivateKey signingKey = (caKey == null) ? privateKey : caKey;
-            if (signingKey instanceof ECPrivateKey) {
-                /*
-                 * bouncycastle needs its own ECPrivateKey implementation
-                 */
-                KeyFactory kf = KeyFactory.getInstance(keyAlgorithm, "BC");
-                PKCS8EncodedKeySpec ks = new PKCS8EncodedKeySpec(signingKey.getEncoded());
-                signingKey = (PrivateKey) kf.generatePrivate(ks);
-            }
-            x509c = x509cg.generateX509Certificate(signingKey);
-            if (StandardNames.IS_RI) {
-                /*
-                 * The RI can't handle the BC EC signature algorithm
-                 * string of "ECDSA", since it expects "...WITHEC...",
-                 * so convert from BC to RI X509Certificate
-                 * implementation via bytes.
-                 */
-                CertificateFactory cf = CertificateFactory.getInstance("X.509");
-                ByteArrayInputStream bais = new ByteArrayInputStream(x509c.getEncoded());
-                Certificate c = cf.generateCertificate(bais);
-                x509c = (X509Certificate) c;
-            }
-        }
-
-        X509Certificate[] x509cc;
-        if (privateAlias == null) {
-            // don't need certificate chain
-            x509cc = null;
-        } else if (caCertChain == null) {
-            x509cc = new X509Certificate[] { x509c };
-        } else {
-            x509cc = new X509Certificate[caCertChain.length+1];
-            x509cc[0] = x509c;
-            System.arraycopy(caCertChain, 0, x509cc, 1, caCertChain.length);
-        }
-
-        // 3.) put certificate and private key into the key store
-        if (privateAlias != null) {
-            keyStore.setKeyEntry(privateAlias, privateKey, keyPassword, x509cc);
-        }
-        if (publicAlias != null) {
-            keyStore.setCertificateEntry(publicAlias, x509c);
-        }
-        return keyStore;
-    }
-
-    /**
-     * Create an X509Principal with the given attributes
-     */
-    public static X509Principal localhost() {
-        try {
-            return x509Principal(InetAddress.getLocalHost().getCanonicalHostName());
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
-    }
-
-    /**
-     * Create an X509Principal with the given attributes
-     */
-    public static X509Principal x509Principal(String commonName) {
-        Hashtable attributes = new Hashtable();
-        attributes.put(X509Principal.CN, commonName);
-        return new X509Principal(attributes);
-    }
-
-    /**
      * Return the only private key in a TestKeyStore for the given
      * algorithms. Throws IllegalStateException if there are are more
      * or less than one.
      */
-    public PrivateKeyEntry getPrivateKey(String keyAlgorithm, String signatureAlgorithm) {
+    public PrivateKeyEntry getPrivateKey(String keyAlgorithm, String signatureAlgorithm)
+            throws Exception {
         return privateKey(keyStore, keyPassword, keyAlgorithm, signatureAlgorithm);
     }
 
@@ -509,43 +572,37 @@
      * algorithms. Throws IllegalStateException if there are are more
      * or less than one.
      */
-    public static PrivateKeyEntry privateKey(KeyStore keyStore,
-                                             char[] keyPassword,
-                                             String keyAlgorithm,
-                                             String signatureAlgorithm) {
-        try {
-            PrivateKeyEntry found = null;
-            PasswordProtection password = new PasswordProtection(keyPassword);
-            for (String alias: Collections.list(keyStore.aliases())) {
-                if (!keyStore.entryInstanceOf(alias, PrivateKeyEntry.class)) {
-                    continue;
-                }
-                PrivateKeyEntry privateKey = (PrivateKeyEntry) keyStore.getEntry(alias, password);
-                if (!privateKey.getPrivateKey().getAlgorithm().equals(keyAlgorithm)) {
-                    continue;
-                }
-                X509Certificate certificate = (X509Certificate) privateKey.getCertificate();
-                if (!certificate.getSigAlgName().contains(signatureAlgorithm)) {
-                    continue;
-                }
-                if (found != null) {
-                    throw new IllegalStateException("keyStore has more than one private key for "
-                                                    + " keyAlgorithm: " + keyAlgorithm
-                                                    + " signatureAlgorithm: " + signatureAlgorithm
-                                                    + "\nfirst: " + found.getPrivateKey()
-                                                    + "\nsecond: " + privateKey.getPrivateKey() );
-                }
-                found = privateKey;
+    public static PrivateKeyEntry privateKey(KeyStore keyStore, char[] keyPassword,
+            String keyAlgorithm, String signatureAlgorithm) throws Exception {
+        PrivateKeyEntry found = null;
+        PasswordProtection password = new PasswordProtection(keyPassword);
+        for (String alias: Collections.list(keyStore.aliases())) {
+            if (!keyStore.entryInstanceOf(alias, PrivateKeyEntry.class)) {
+                continue;
             }
-            if (found == null) {
-                throw new IllegalStateException("keyStore contained no private key for "
+            PrivateKeyEntry privateKey = (PrivateKeyEntry) keyStore.getEntry(alias, password);
+            if (!privateKey.getPrivateKey().getAlgorithm().equals(keyAlgorithm)) {
+                continue;
+            }
+            X509Certificate certificate = (X509Certificate) privateKey.getCertificate();
+            if (!certificate.getSigAlgName().contains(signatureAlgorithm)) {
+                continue;
+            }
+            if (found != null) {
+                throw new IllegalStateException("keyStore has more than one private key for "
                                                 + " keyAlgorithm: " + keyAlgorithm
-                                                + " signatureAlgorithm: " + signatureAlgorithm);
+                                                + " signatureAlgorithm: " + signatureAlgorithm
+                                                + "\nfirst: " + found.getPrivateKey()
+                                                + "\nsecond: " + privateKey.getPrivateKey() );
             }
-            return found;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
+            found = privateKey;
         }
+        if (found == null) {
+            throw new IllegalStateException("keyStore contained no private key for "
+                                            + " keyAlgorithm: " + keyAlgorithm
+                                            + " signatureAlgorithm: " + signatureAlgorithm);
+        }
+        return found;
     }
 
     /**
@@ -553,7 +610,7 @@
      * for the given algorithm. Throws IllegalStateException if there
      * are are more or less than one.
      */
-    public Certificate getRootCertificate(String algorithm) {
+    public Certificate getRootCertificate(String algorithm) throws Exception {
         return rootCertificate(keyStore, algorithm);
     }
 
@@ -562,61 +619,51 @@
      * the given algorithm. Throws IllegalStateException if there are
      * are more or less than one.
      */
-    public static Certificate rootCertificate(KeyStore keyStore,
-                                              String algorithm) {
-        try {
-            Certificate found = null;
-            for (String alias: Collections.list(keyStore.aliases())) {
-                if (!keyStore.entryInstanceOf(alias, TrustedCertificateEntry.class)) {
-                    continue;
-                }
-                TrustedCertificateEntry certificateEntry =
-                        (TrustedCertificateEntry) keyStore.getEntry(alias, null);
-                Certificate certificate = certificateEntry.getTrustedCertificate();
-                if (!certificate.getPublicKey().getAlgorithm().equals(algorithm)) {
-                    continue;
-                }
-                if (!(certificate instanceof X509Certificate)) {
-                    continue;
-                }
-                X509Certificate x = (X509Certificate) certificate;
-                if (!x.getIssuerDN().equals(x.getSubjectDN())) {
-                    continue;
-                }
-                if (found != null) {
-                    throw new IllegalStateException("keyStore has more than one root CA for "
-                                                    + algorithm
-                                                    + "\nfirst: " + found
-                                                    + "\nsecond: " + certificate );
-                }
-                found = certificate;
+    public static Certificate rootCertificate(KeyStore keyStore, String algorithm)
+            throws Exception {
+        Certificate found = null;
+        for (String alias: Collections.list(keyStore.aliases())) {
+            if (!keyStore.entryInstanceOf(alias, TrustedCertificateEntry.class)) {
+                continue;
             }
-            if (found == null) {
-                throw new IllegalStateException("keyStore contained no root CA for " + algorithm);
+            TrustedCertificateEntry certificateEntry =
+                    (TrustedCertificateEntry) keyStore.getEntry(alias, null);
+            Certificate certificate = certificateEntry.getTrustedCertificate();
+            if (!certificate.getPublicKey().getAlgorithm().equals(algorithm)) {
+                continue;
             }
-            return found;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
+            if (!(certificate instanceof X509Certificate)) {
+                continue;
+            }
+            X509Certificate x = (X509Certificate) certificate;
+            if (!x.getIssuerDN().equals(x.getSubjectDN())) {
+                continue;
+            }
+            if (found != null) {
+                throw new IllegalStateException("keyStore has more than one root CA for "
+                                                + algorithm
+                                                + "\nfirst: " + found
+                                                + "\nsecond: " + certificate );
+            }
+            found = certificate;
         }
+        if (found == null) {
+            throw new IllegalStateException("keyStore contained no root CA for " + algorithm);
+        }
+        return found;
     }
 
     /**
      * Create a client key store that only contains self-signed certificates but no private keys
      */
-    public static KeyStore createClient(KeyStore caKeyStore) {
-        try {
-            KeyStore clientKeyStore = createKeyStore();
-            copySelfSignedCertificates(clientKeyStore, caKeyStore);
-            return clientKeyStore;
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
-        }
+    public static KeyStore createClient(KeyStore caKeyStore) throws Exception {
+        KeyStore clientKeyStore = createKeyStore();
+        copySelfSignedCertificates(clientKeyStore, caKeyStore);
+        return clientKeyStore;
     }
 
     /**
-     * Copy self-signed certifcates from one key store to another.
+     * Copy self-signed certificates from one key store to another.
      * Returns true if successful, false if no match found.
      */
     public static boolean copySelfSignedCertificates(KeyStore dst, KeyStore src) throws Exception {
@@ -636,7 +683,7 @@
     }
 
     /**
-     * Copy named certifcates from one key store to another.
+     * Copy named certificates from one key store to another.
      * Returns true if successful, false if no match found.
      */
     public static boolean copyCertificate(Principal subject, KeyStore dst, KeyStore src)
@@ -658,64 +705,57 @@
     /**
      * Dump a key store for debugging.
      */
-    public static void dump(String context,
-                            KeyStore keyStore,
-                            char[] keyPassword) {
-        try {
-            PrintStream out = System.out;
-            out.println("context=" + context);
-            out.println("\tkeyStore=" + keyStore);
-            out.println("\tkeyStore.type=" + keyStore.getType());
-            out.println("\tkeyStore.provider=" + keyStore.getProvider());
-            out.println("\tkeyPassword="
-                        + ((keyPassword == null) ? null : new String(keyPassword)));
-            out.println("\tsize=" + keyStore.size());
-            for (String alias: Collections.list(keyStore.aliases())) {
-                out.println("alias=" + alias);
-                out.println("\tcreationDate=" + keyStore.getCreationDate(alias));
-                if (keyStore.isCertificateEntry(alias)) {
-                    out.println("\tcertificate:");
-                    out.println("==========================================");
-                    out.println(keyStore.getCertificate(alias));
-                    out.println("==========================================");
-                    continue;
-                }
-                if (keyStore.isKeyEntry(alias)) {
-                    out.println("\tkey:");
-                    out.println("==========================================");
-                    String key;
-                    try {
-                        key = ("Key retreived using password\n"
-                               + keyStore.getKey(alias, keyPassword));
-                    } catch (UnrecoverableKeyException e1) {
-                        try {
-                            key = ("Key retreived without password\n"
-                                   + keyStore.getKey(alias, null));
-                        } catch (UnrecoverableKeyException e2) {
-                            key = "Key could not be retreived";
-                        }
-                    }
-                    out.println(key);
-                    out.println("==========================================");
-                    Certificate[] chain = keyStore.getCertificateChain(alias);
-                    if (chain == null) {
-                        out.println("No certificate chain associated with key");
-                        out.println("==========================================");
-                    } else {
-                        for (int i = 0; i < chain.length; i++) {
-                            out.println("Certificate chain element #" + i);
-                            out.println(chain[i]);
-                            out.println("==========================================");
-                        }
-                    }
-                    continue;
-                }
-                out.println("\tunknown entry type");
+    public static void dump(String context, KeyStore keyStore, char[] keyPassword)
+            throws KeyStoreException, NoSuchAlgorithmException {
+        PrintStream out = System.out;
+        out.println("context=" + context);
+        out.println("\tkeyStore=" + keyStore);
+        out.println("\tkeyStore.type=" + keyStore.getType());
+        out.println("\tkeyStore.provider=" + keyStore.getProvider());
+        out.println("\tkeyPassword="
+                    + ((keyPassword == null) ? null : new String(keyPassword)));
+        out.println("\tsize=" + keyStore.size());
+        for (String alias: Collections.list(keyStore.aliases())) {
+            out.println("alias=" + alias);
+            out.println("\tcreationDate=" + keyStore.getCreationDate(alias));
+            if (keyStore.isCertificateEntry(alias)) {
+                out.println("\tcertificate:");
+                out.println("==========================================");
+                out.println(keyStore.getCertificate(alias));
+                out.println("==========================================");
+                continue;
             }
-        } catch (RuntimeException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new RuntimeException(e);
+            if (keyStore.isKeyEntry(alias)) {
+                out.println("\tkey:");
+                out.println("==========================================");
+                String key;
+                try {
+                    key = ("Key retrieved using password\n"
+                           + keyStore.getKey(alias, keyPassword));
+                } catch (UnrecoverableKeyException e1) {
+                    try {
+                        key = ("Key retrieved without password\n"
+                               + keyStore.getKey(alias, null));
+                    } catch (UnrecoverableKeyException e2) {
+                        key = "Key could not be retrieved";
+                    }
+                }
+                out.println(key);
+                out.println("==========================================");
+                Certificate[] chain = keyStore.getCertificateChain(alias);
+                if (chain == null) {
+                    out.println("No certificate chain associated with key");
+                    out.println("==========================================");
+                } else {
+                    for (int i = 0; i < chain.length; i++) {
+                        out.println("Certificate chain element #" + i);
+                        out.println(chain[i]);
+                        out.println("==========================================");
+                    }
+                }
+                continue;
+            }
+            out.println("\tunknown entry type");
         }
     }
 
diff --git a/luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FakeSession.java b/support/src/test/java/libcore/javax/net/ssl/FakeSSLSession.java
similarity index 95%
rename from luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FakeSession.java
rename to support/src/test/java/libcore/javax/net/ssl/FakeSSLSession.java
index 4a793dd..4d876e7 100644
--- a/luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FakeSession.java
+++ b/support/src/test/java/libcore/javax/net/ssl/FakeSSLSession.java
@@ -14,17 +14,17 @@
  * limitations under the License.
  */
 
-package org.apache.harmony.xnet.provider.jsse;
+package libcore.javax.net.ssl;
 
 import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSessionContext;
 import java.security.cert.Certificate;
 import java.security.Principal;
 
-class FakeSession implements SSLSession {
+public class FakeSSLSession implements SSLSession {
     final String host;
 
-    FakeSession(String host) {
+    public FakeSSLSession(String host) {
         this.host = host;
     }
 
diff --git a/support/src/test/java/tests/http/MockWebServer.java b/support/src/test/java/tests/http/MockWebServer.java
index 48e53e7..2083117 100644
--- a/support/src/test/java/tests/http/MockWebServer.java
+++ b/support/src/test/java/tests/http/MockWebServer.java
@@ -82,8 +82,12 @@
         return port;
     }
 
+    public String getHostName() {
+        return InetAddress.getLoopbackAddress().getHostName();
+    }
+
     public Proxy toProxyAddress() {
-        return new Proxy(Proxy.Type.HTTP, new InetSocketAddress("localhost", getPort()));
+        return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(getHostName(), getPort()));
     }
 
     /**
@@ -92,10 +96,9 @@
      * @param path the request path, such as "/".
      */
     public URL getUrl(String path) throws MalformedURLException, UnknownHostException {
-        String host = InetAddress.getLocalHost().getHostName();
         return sslSocketFactory != null
-                ? new URL("https://" + host + ":" + getPort() + path)
-                : new URL("http://" + host + ":" + getPort() + path);
+                ? new URL("https://" + getHostName() + ":" + getPort() + path)
+                : new URL("http://" + getHostName() + ":" + getPort() + path);
     }
 
     /**
diff --git a/support/src/test/java/tests/security/AlgorithmParameterGeneratorTest.java b/support/src/test/java/tests/security/AlgorithmParameterGeneratorTest.java
index 80065f3..7bd52f0 100644
--- a/support/src/test/java/tests/security/AlgorithmParameterGeneratorTest.java
+++ b/support/src/test/java/tests/security/AlgorithmParameterGeneratorTest.java
@@ -15,9 +15,6 @@
  */
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.security.AlgorithmParameterGenerator;
 import java.security.AlgorithmParameters;
 import java.security.NoSuchAlgorithmException;
@@ -33,23 +30,6 @@
         this.helper = helper;
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="init",
-                args={int.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     public void testAlgorithmParameterGenerator() {
         AlgorithmParameterGenerator generator = null;
         try {
diff --git a/support/src/test/java/tests/security/AlgorithmParametersTest.java b/support/src/test/java/tests/security/AlgorithmParametersTest.java
index d5c1910..67255fc 100644
--- a/support/src/test/java/tests/security/AlgorithmParametersTest.java
+++ b/support/src/test/java/tests/security/AlgorithmParametersTest.java
@@ -15,9 +15,6 @@
  */
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.security.AlgorithmParameters;
 import java.security.NoSuchAlgorithmException;
 import java.security.spec.AlgorithmParameterSpec;
@@ -37,23 +34,6 @@
         this.parameterData = parameterData;
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="getInstance",
-                args={String.class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.ADDITIONAL,
-                method="init",
-                args={byte[].class}
-        ),
-        @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-        )
-    })
     public void testAlgorithmParameters() {
         AlgorithmParameters algorithmParameters = null;
         try {
diff --git a/support/src/test/java/tests/security/KeyFactoryTest.java b/support/src/test/java/tests/security/KeyFactoryTest.java
index 179254a..e2f687d 100644
--- a/support/src/test/java/tests/security/KeyFactoryTest.java
+++ b/support/src/test/java/tests/security/KeyFactoryTest.java
@@ -15,9 +15,6 @@
  */
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.security.Key;
 import java.security.KeyFactory;
 import java.security.KeyPair;
@@ -58,28 +55,6 @@
         return null;
     }
 
-    @TestTargets({
-        @TestTargetNew(
-            level = TestLevel.ADDITIONAL,
-            method = "getKeySpec",
-            args = {Key.class, Class.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.ADDITIONAL,
-            method = "generatePrivate",
-            args = {KeySpec.class}
-        ),
-        @TestTargetNew(
-            level = TestLevel.ADDITIONAL,
-            method = "generatePublic",
-            args = {KeySpec.class}
-        ),
-        @TestTargetNew(
-            level=TestLevel.COMPLETE,
-            method="method",
-            args={}
-        )
-    })
     public void testKeyFactory() {
         PrivateKeySpec privateKeySpec = null;
         try {
diff --git a/support/src/test/java/tests/security/KeyPairGeneratorTest.java b/support/src/test/java/tests/security/KeyPairGeneratorTest.java
index adf8d4d..4ade0af 100644
--- a/support/src/test/java/tests/security/KeyPairGeneratorTest.java
+++ b/support/src/test/java/tests/security/KeyPairGeneratorTest.java
@@ -16,9 +16,6 @@
 
 package tests.security;
 
-import dalvik.annotation.TestLevel;
-import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.TestTargets;
 import java.security.KeyPair;
 import java.security.KeyPairGenerator;
 import java.security.NoSuchAlgorithmException;
@@ -50,23 +47,6 @@
         }
     }
 
-    @TestTargets({
-        @TestTargetNew(
-                level = TestLevel.ADDITIONAL,
-                method = "initialize",
-                args = {int.class}
-            ),
-            @TestTargetNew(
-                level = TestLevel.ADDITIONAL,
-                method = "generateKeyPair",
-                args = {}
-            ),
-            @TestTargetNew(
-                level=TestLevel.COMPLETE,
-                method="method",
-                args={}
-            )
-    })
     public void testKeyPairGenerator() throws NoSuchAlgorithmException {
         generator.initialize(1024);
 
diff --git a/support/src/test/java/tests/support/Support_BitSet.java b/support/src/test/java/tests/support/Support_BitSet.java
deleted file mode 100644
index eae33bb..0000000
--- a/support/src/test/java/tests/support/Support_BitSet.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.support;
-
-public class Support_BitSet {
-    private long[] bits;
-
-    private static final int ELM_SIZE = 64; // Size in bits of the data type
-
-    // being used in the bits array
-
-    /**
-     * Create a new BitSet with size equal to 64 bits
-     *
-     * @return The number of bits contained in this BitSet.
-     *
-     * @see #clear
-     * @see #set
-     */
-    public Support_BitSet() {
-        this(64);
-    }
-
-    /**
-     * Create a new BitSet with size equal to nbits. If nbits is not a multiple
-     * of 64, then create a BitSet with size nbits rounded to the next closest
-     * multiple of 64.
-     *
-     * @exception NegativeArraySizeException
-     *                if nbits < 0.
-     * @see #clear
-     * @see #set
-     */
-    public Support_BitSet(int nbits) {
-        if (nbits >= 0) {
-            bits = new long[(nbits / ELM_SIZE) + (nbits % ELM_SIZE > 0 ? 1 : 0)];
-        } else {
-            throw new NegativeArraySizeException();
-        }
-    }
-
-    /**
-     * Clears the bit at index pos. Grows the BitSet if pos > size.
-     *
-     * @param pos
-     *            int
-     *
-     * @exception IndexOutOfBoundsException
-     *                when pos < 0
-     * @see #set
-     */
-    public void clear(int pos) {
-        if (pos >= 0) {
-            if (pos < bits.length * ELM_SIZE) {
-                bits[pos / ELM_SIZE] &= ~(1L << (pos % ELM_SIZE));
-            } else {
-                growBits(pos); // Bit is cleared for free if we have to grow
-            }
-        } else {
-            throw new IndexOutOfBoundsException("Negative index specified");
-        }
-    }
-
-    /**
-     * Retrieve the bit at index pos. Grows the BitSet if pos > size.
-     *
-     * @param pos
-     *            int
-     * @return A boolean value indicating whether the bit at pos has been set.
-     *         Answers false if pos > size().
-     *
-     * @exception IndexOutOfBoundsException
-     *                when pos < 0
-     * @see #set
-     * @see #clear
-     */
-    public boolean get(int pos) {
-        if (pos >= 0) {
-            if (pos < bits.length * ELM_SIZE) {
-                return (bits[pos / ELM_SIZE] & (1L << (pos % ELM_SIZE))) != 0;
-            }
-            return false;
-        }
-        throw new IndexOutOfBoundsException("Negative index specified");
-    }
-
-    /**
-     * Increase the size of the internal array to accomodate pos bits. The new
-     * array max index will be a multiple of 64
-     *
-     * @param pos
-     *            int The index the new array needs to be able to access
-     */
-    private void growBits(int pos) {
-        pos++; // Inc to get correct bit count
-        long[] tempBits = new long[(pos / ELM_SIZE)
-                + (pos % ELM_SIZE > 0 ? 1 : 0)];
-        System.arraycopy(bits, 0, tempBits, 0, bits.length);
-        bits = tempBits;
-    }
-
-    /**
-     * Sets the bit at index pos to 1. Grows the BitSet if pos > size.
-     *
-     * @param pos
-     *            int
-     *
-     * @exception IndexOutOfBoundsException
-     *                when pos < 0
-     * @see #clear
-     */
-    public void set(int pos) {
-        if (pos >= 0) {
-            if (pos >= bits.length * ELM_SIZE) {
-                growBits(pos);
-            }
-            bits[pos / ELM_SIZE] |= 1L << (pos % ELM_SIZE);
-        } else {
-            throw new IndexOutOfBoundsException("Negative index specified");
-        }
-    }
-
-    /**
-     * Clears the bit at index pos.
-     *
-     * @return The number of bits contained in this BitSet.
-     *
-     * @see #BitSet
-     * @see #clear
-     * @see #set
-     */
-    public int size() {
-        return bits.length * ELM_SIZE;
-    }
-
-    /**
-     * Answers a string containing a concise, human-readable description of the
-     * receiver.
-     *
-     * @return A comma delimited list of the indices of all bits that are set.
-     */
-    @Override
-    public String toString() {
-        StringBuffer sb = new StringBuffer(bits.length / 2);
-        int bitCount = 0;
-        sb.append('{');
-        boolean comma = false;
-        for (long element : bits) {
-            if (element == 0) {
-                bitCount += ELM_SIZE;
-                continue;
-            }
-            for (int j = 0; j < ELM_SIZE; j++) {
-                if (((element & (1L << j)) != 0)) {
-                    if (comma) {
-                        sb.append(", ");
-                    }
-                    sb.append(bitCount);
-                    comma = true;
-                }
-                bitCount++;
-            }
-        }
-        sb.append('}');
-        return sb.toString();
-    }
-
-    /**
-     * Returns the number of bits up to and including the highest bit set.
-     *
-     */
-    public int length() {
-        int idx = bits.length - 1;
-        while (idx >= 0 && bits[idx] == 0) {
-            --idx;
-        }
-        if (idx == -1) {
-            return 0;
-        }
-        int i = ELM_SIZE - 1;
-        long val = bits[idx];
-        while ((val & (1L << i)) == 0 && i > 0) {
-            i--;
-        }
-        return idx * ELM_SIZE + i + 1;
-    }
-}
diff --git a/support/src/test/java/tests/support/Support_CollectionTest.java b/support/src/test/java/tests/support/Support_CollectionTest.java
index 6ff1868..190c6b9 100644
--- a/support/src/test/java/tests/support/Support_CollectionTest.java
+++ b/support/src/test/java/tests/support/Support_CollectionTest.java
@@ -17,15 +17,12 @@
 
 package tests.support;
 
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Collection;
 import java.util.TreeSet;
 
 /**
- * @tests java.util.Collection
+ * java.util.Collection
  */
-@TestTargetClass(java.util.Collection.class)
 public class Support_CollectionTest extends junit.framework.TestCase {
     Collection<Integer> col; // must contain the Integers 0 to 99
 
diff --git a/support/src/test/java/tests/support/Support_DecimalFormat.java b/support/src/test/java/tests/support/Support_DecimalFormat.java
index 55bea1e..9baa4cc 100644
--- a/support/src/test/java/tests/support/Support_DecimalFormat.java
+++ b/support/src/test/java/tests/support/Support_DecimalFormat.java
@@ -139,7 +139,7 @@
         Locale us = Locale.US;
         Locale tr = new Locale("de", "CH");
 
-        if (Support_Locale.areLocalesAvailable(us)) {
+        if (Support_Locale.isLocaleAvailable(us)) {
             // locale dependent test, bug 1943269
 
             // test number instance
@@ -183,7 +183,7 @@
         format = new DecimalFormat("0000.0#E0");
         t_Format(10, number, format, getNegativeExponentVector());
 
-        if (Support_Locale.areLocalesAvailable(tr)) {
+        if (Support_Locale.isLocaleAvailable(tr)) {
             // test currency instance with TR Locale
             t_Format(11, number, NumberFormat.getCurrencyInstance(tr),
                     getPositiveCurrencyVectorCH());
diff --git a/support/src/test/java/tests/support/Support_IOTestSecurityManager.java b/support/src/test/java/tests/support/Support_IOTestSecurityManager.java
deleted file mode 100644
index 557787a..0000000
--- a/support/src/test/java/tests/support/Support_IOTestSecurityManager.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-package tests.support;
-
-import java.io.SerializablePermission;
-import java.security.Permission;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-public class Support_IOTestSecurityManager extends SecurityManager {
-    private ArrayList<Permission> permissions;
-
-    public Support_IOTestSecurityManager() {
-        permissions = new ArrayList<Permission>(2);
-        permissions.add(new SerializablePermission("enableSubclassImplementation"));
-        permissions.add(new SerializablePermission("enableSubstitution"));
-    }
-
-    public void checkPermission(Permission p) {
-        for (Iterator<Permission> i = permissions.iterator(); i.hasNext(); ) {
-            if (i.next().equals(p)) {
-                throw new SecurityException();
-            }
-        }
-    }
-}
-
-
diff --git a/support/src/test/java/tests/support/Support_ListTest.java b/support/src/test/java/tests/support/Support_ListTest.java
index f9b7a21..8aeeeaf 100644
--- a/support/src/test/java/tests/support/Support_ListTest.java
+++ b/support/src/test/java/tests/support/Support_ListTest.java
@@ -17,14 +17,11 @@
 
 package tests.support;
 
-import dalvik.annotation.TestTargetClass;
-
 import java.util.LinkedList;
 import java.util.List;
 import java.util.ListIterator;
 import java.util.NoSuchElementException;
 
-@TestTargetClass(List.class)
 public class Support_ListTest extends junit.framework.TestCase {
 
     List<Integer> list; // must contain the Integers 0 to 99 in order
diff --git a/support/src/test/java/tests/support/Support_Locale.java b/support/src/test/java/tests/support/Support_Locale.java
index 92426e3..68f01c5 100644
--- a/support/src/test/java/tests/support/Support_Locale.java
+++ b/support/src/test/java/tests/support/Support_Locale.java
@@ -22,27 +22,12 @@
 import java.util.Locale;
 import java.util.Set;
 
-
 /**
- * Helper class for {@link Locale} tests
+ * Helper class for tests that rely on locale data.
  */
 public class Support_Locale {
-
-    /**
-     * Helper method to determine if given locales are available.
-     *
-     * @param requiredLocales - the set of {@link Locale} to check
-     *
-     * @return true if all requiredLocales are available.
-     */
-    public static boolean areLocalesAvailable(Locale... requiredLocales) {
-        Locale[] availableLocales = Locale.getAvailableLocales();
-        Set<Locale> localeSet = new HashSet<Locale>(Arrays.asList(availableLocales));
-        for (Locale requiredLocale : requiredLocales) {
-            if (!localeSet.contains(requiredLocale)) {
-                return false;
-            }
-        }
-        return true;
+    public static boolean isLocaleAvailable(Locale requiredLocale) {
+        Set<Locale> localeSet = new HashSet<Locale>(Arrays.asList(Locale.getAvailableLocales()));
+        return localeSet.contains(requiredLocale);
     }
-}
\ No newline at end of file
+}
diff --git a/support/src/test/java/tests/support/Support_NetworkInterface.java b/support/src/test/java/tests/support/Support_NetworkInterface.java
deleted file mode 100644
index b159430..0000000
--- a/support/src/test/java/tests/support/Support_NetworkInterface.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package tests.support;
-
-
-import java.net.NetworkInterface;
-
-public class Support_NetworkInterface {
-
-    /**
-     * On windows platforms with IPv6 enabled there are a number of pseudo
-     * interfaces which don't work with our tests. This function is called to
-     * make sure we only use the non-pseudo interfaces
-     */
-    public static boolean useInterface(NetworkInterface theInterface) {
-        boolean result = true;
-        String platform = System.getProperty("os.name");
-        // only use these on windows platforms
-        if (platform.startsWith("Windows")) {
-            if ((theInterface.getDisplayName()
-                    .equals("Teredo Tunneling Pseudo-Interface"))
-                    || (theInterface.getDisplayName()
-                            .equals("6to4 Tunneling Pseudo-Interface"))
-                    || (theInterface.getDisplayName()
-                            .equals("Automatic Tunneling Pseudo-Interface"))
-                    || (theInterface.getDisplayName()
-                            .equals("Loopback Pseudo-Interface"))) {
-                result = false;
-            }
-        }
-        return result;
-    }
-}
diff --git a/support/src/test/java/tests/support/Support_SetTest.java b/support/src/test/java/tests/support/Support_SetTest.java
index cbea1d8..a4a1432 100644
--- a/support/src/test/java/tests/support/Support_SetTest.java
+++ b/support/src/test/java/tests/support/Support_SetTest.java
@@ -17,11 +17,8 @@
 
 package tests.support;
 
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Set;
 
-@TestTargetClass(Set.class)
 public class Support_SetTest extends junit.framework.TestCase {
 
     Set<Integer> set; // must contain only the Integers 0 to 99
diff --git a/support/src/test/java/tests/support/Support_SimpleDateFormat.java b/support/src/test/java/tests/support/Support_SimpleDateFormat.java
deleted file mode 100644
index 8b94c9c..0000000
--- a/support/src/test/java/tests/support/Support_SimpleDateFormat.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.support;
-
-import java.text.DateFormat;
-import java.text.NumberFormat;
-import java.text.SimpleDateFormat;
-import java.text.DateFormat.Field;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.GregorianCalendar;
-import java.util.Locale;
-import java.util.TimeZone;
-import java.util.Vector;
-
-public class Support_SimpleDateFormat extends Support_Format {
-
-    public Support_SimpleDateFormat(String p1) {
-        super(p1);
-    }
-
-    @Override
-    public void runTest() {
-        t_formatToCharacterIterator();
-        t_format_with_FieldPosition();
-    }
-
-    public static void main(String[] args) {
-        new Support_SimpleDateFormat("").runTest();
-    }
-
-    public void t_format_with_FieldPosition() {
-        TimeZone tz = TimeZone.getTimeZone("EST");
-        Calendar cal = new GregorianCalendar(tz);
-        cal.set(1999, Calendar.SEPTEMBER, 13, 17, 19, 01);
-        cal.set(Calendar.MILLISECOND, 0);
-        Date date = cal.getTime();
-        SimpleDateFormat format = (SimpleDateFormat) DateFormat
-                .getDateInstance(DateFormat.DEFAULT, Locale.US);
-        format.setTimeZone(tz);
-
-        // test with all pattern chars, and multiple occurances
-        format
-                .applyPattern("G GGGG y yy yyyy M MM MMM MMMM d dd ddd k kk kkk H HH HHH h hh hhh m mmm s ss sss S SS SSS EE EEEE D DD DDD F FF w www W WWW a  aaa  K KKK z zzzz Z ZZZZ");
-
-        StringBuffer textbuffer = new StringBuffer(
-                "AD AD 99 99 1999 9 09 Sep September 13 13 013 17 17 017 17 17 017 5 05");
-        textbuffer
-                .append(" 005 19 019 1 01 001 0 00 000 Mon Monday 256 256 256 2 02 38 038 3 003 PM");
-        textbuffer.append("  PM  5 005 EDT Eastern Daylight Time -0400 -0400");
-
-        // to avoid passing the huge Stringbuffer each time.
-        super.text = textbuffer.toString();
-
-        // test if field positions are set correctly for these fields occuring
-        // multiple times.
-        t_FormatWithField(0, format, date, null, Field.ERA, 0, 2);
-        t_FormatWithField(1, format, date, null, Field.YEAR, 6, 8);
-        t_FormatWithField(2, format, date, null, Field.MONTH, 17, 18);
-        t_FormatWithField(3, format, date, null, Field.DAY_OF_MONTH, 36, 38);
-        t_FormatWithField(4, format, date, null, Field.HOUR_OF_DAY1, 46, 48);
-        t_FormatWithField(5, format, date, null, Field.HOUR_OF_DAY0, 56, 58);
-        t_FormatWithField(6, format, date, null, Field.HOUR1, 66, 67);
-        t_FormatWithField(7, format, date, null, Field.MINUTE, 75, 77);
-        t_FormatWithField(8, format, date, null, Field.SECOND, 82, 83);
-        t_FormatWithField(9, format, date, null, Field.MILLISECOND, 91, 92);
-        t_FormatWithField(10, format, date, null, Field.DAY_OF_WEEK, 100, 103);
-        t_FormatWithField(11, format, date, null, Field.DAY_OF_YEAR, 111, 114);
-        t_FormatWithField(12, format, date, null, Field.DAY_OF_WEEK_IN_MONTH,
-                123, 124);
-        t_FormatWithField(13, format, date, null, Field.WEEK_OF_YEAR, 128, 130);
-        t_FormatWithField(14, format, date, null, Field.WEEK_OF_MONTH, 135, 136);
-        t_FormatWithField(15, format, date, null, Field.AM_PM, 141, 143);
-        t_FormatWithField(16, format, date, null, Field.HOUR0, 149, 150);
-        t_FormatWithField(17, format, date, null, Field.TIME_ZONE, 155, 158);
-
-        // test fields that are not included in the formatted text
-        t_FormatWithField(18, format, date, null,
-                NumberFormat.Field.EXPONENT_SIGN, 0, 0);
-
-        // test with simple example
-        format.applyPattern("h:m z");
-
-        super.text = "5:19 GMT-05:00";
-        t_FormatWithField(21, format, date, null, Field.HOUR1, 0, 1);
-        t_FormatWithField(22, format, date, null, Field.MINUTE, 2, 4);
-        t_FormatWithField(23, format, date, null, Field.TIME_ZONE, 5, 14);
-
-        // test fields that are not included in the formatted text
-
-        t_FormatWithField(24, format, date, null, Field.ERA, 0, 0);
-        t_FormatWithField(25, format, date, null, Field.YEAR, 0, 0);
-        t_FormatWithField(26, format, date, null, Field.MONTH, 0, 0);
-        t_FormatWithField(27, format, date, null, Field.DAY_OF_MONTH, 0, 0);
-        t_FormatWithField(28, format, date, null, Field.HOUR_OF_DAY1, 0, 0);
-        t_FormatWithField(29, format, date, null, Field.HOUR_OF_DAY0, 0, 0);
-        t_FormatWithField(30, format, date, null, Field.SECOND, 0, 0);
-        t_FormatWithField(31, format, date, null, Field.MILLISECOND, 0, 0);
-        t_FormatWithField(32, format, date, null, Field.DAY_OF_WEEK, 0, 0);
-        t_FormatWithField(33, format, date, null, Field.DAY_OF_YEAR, 0, 0);
-        t_FormatWithField(34, format, date, null, Field.DAY_OF_WEEK_IN_MONTH,
-                0, 0);
-        t_FormatWithField(35, format, date, null, Field.WEEK_OF_YEAR, 0, 0);
-        t_FormatWithField(36, format, date, null, Field.WEEK_OF_MONTH, 0, 0);
-        t_FormatWithField(37, format, date, null, Field.AM_PM, 0, 0);
-        t_FormatWithField(38, format, date, null, Field.HOUR0, 0, 0);
-
-        t_FormatWithField(39, format, date, null, NumberFormat.Field.EXPONENT,
-                0, 0);
-
-        // test with simple example with pattern char Z
-        format.applyPattern("h:m Z z");
-        super.text = "5:19 -0400 GMT-05:00";
-        t_FormatWithField(40, format, date, null, Field.HOUR1, 0, 1);
-        t_FormatWithField(41, format, date, null, Field.MINUTE, 2, 4);
-        t_FormatWithField(42, format, date, null, Field.TIME_ZONE, 5, 10);
-    }
-
-    public void t_formatToCharacterIterator() {
-        TimeZone tz = TimeZone.getTimeZone("GMT-05:00");
-        Calendar cal = new GregorianCalendar(tz);
-        cal.set(1999, Calendar.SEPTEMBER, 13, 17, 19, 01);
-        cal.set(Calendar.MILLISECOND, 0);
-        Date date = cal.getTime();
-        SimpleDateFormat format = (SimpleDateFormat) DateFormat
-                .getDateInstance(DateFormat.DEFAULT, Locale.US);
-        format.setTimeZone(tz);
-
-        format.applyPattern("yyyyMMddHHmmss");
-        t_Format(1, date, format, getDateVector1());
-
-        format.applyPattern("w W dd MMMM yyyy EEEE");
-        t_Format(2, date, format, getDateVector2());
-
-        format.applyPattern("h:m z");
-        t_Format(3, date, format, getDateVector3());
-
-        format.applyPattern("h:m Z");
-        t_Format(5, date, format, getDateVector5());
-
-        // with all pattern chars, and multiple occurances
-        format
-                .applyPattern("G GGGG y yy yyyy M MM MMM MMMM d dd ddd k kk kkk H HH HHH h hh hhh m mmm s ss sss S SS SSS EE EEEE D DD DDD F FF w www W WWW a  aaa  K KKK z zzzz Z ZZZZ");
-        t_Format(4, date, format, getDateVector4());
-    }
-
-    private Vector<FieldContainer> getDateVector1() {
-        // "19990913171901"
-        Vector<FieldContainer> v = new Vector<FieldContainer>();
-        v.add(new FieldContainer(0, 4, Field.YEAR));
-        v.add(new FieldContainer(4, 6, Field.MONTH));
-        v.add(new FieldContainer(6, 8, Field.DAY_OF_MONTH));
-        v.add(new FieldContainer(8, 10, Field.HOUR_OF_DAY0));
-        v.add(new FieldContainer(10, 12, Field.MINUTE));
-        v.add(new FieldContainer(12, 14, Field.SECOND));
-        return v;
-    }
-
-    private Vector<FieldContainer> getDateVector2() {
-        // "12 3 5 March 2002 Monday"
-        Vector<FieldContainer> v = new Vector<FieldContainer>();
-        v.add(new FieldContainer(0, 2, Field.WEEK_OF_YEAR));
-        v.add(new FieldContainer(3, 4, Field.WEEK_OF_MONTH));
-        v.add(new FieldContainer(5, 7, Field.DAY_OF_MONTH));
-        v.add(new FieldContainer(8, 17, Field.MONTH));
-        v.add(new FieldContainer(18, 22, Field.YEAR));
-        v.add(new FieldContainer(23, 29, Field.DAY_OF_WEEK));
-        return v;
-    }
-
-    private Vector<FieldContainer> getDateVector3() {
-        // "5:19 GMT-05:00"
-        Vector<FieldContainer> v = new Vector<FieldContainer>();
-        v.add(new FieldContainer(0, 1, Field.HOUR1));
-        v.add(new FieldContainer(2, 4, Field.MINUTE));
-        v.add(new FieldContainer(5, 14, Field.TIME_ZONE));
-        return v;
-    }
-
-    private Vector<FieldContainer> getDateVector5() {
-        // "5:19 -0400"
-        Vector<FieldContainer> v = new Vector<FieldContainer>();
-        v.add(new FieldContainer(0, 1, Field.HOUR1));
-        v.add(new FieldContainer(2, 4, Field.MINUTE));
-        v.add(new FieldContainer(5, 10, Field.TIME_ZONE));
-        return v;
-    }
-
-    private Vector<FieldContainer> getDateVector4() {
-        Vector<FieldContainer> v = new Vector<FieldContainer>();
-
-        // BEGIN android-changed
-        // Datetime pattern 'y' for year 1999 is 1999 not 99.  See http://unicode.org/reports/tr35/.
-        // "AD AD 1999 99 1999 9 09 Sep September 13 13 013 17 17 017 17 17 017 5
-        // 05
-        // 005 19 019 1 01 001 0 00 000 Mon Monday 256 256 256 2 02 38 038 3 003
-        // PM
-        // PM 5 005 GMT-05:00 GMT-05:00 -0500 -0500"
-        v.add(new FieldContainer(0, 2, Field.ERA));
-        v.add(new FieldContainer(3, 5, Field.ERA));
-        v.add(new FieldContainer(6, 10, Field.YEAR));
-        v.add(new FieldContainer(11, 13, Field.YEAR));
-        v.add(new FieldContainer(14, 18, Field.YEAR));
-        v.add(new FieldContainer(19, 20, Field.MONTH));
-        v.add(new FieldContainer(21, 23, Field.MONTH));
-        v.add(new FieldContainer(24, 27, Field.MONTH));
-        v.add(new FieldContainer(28, 37, Field.MONTH));
-        v.add(new FieldContainer(38, 40, Field.DAY_OF_MONTH));
-        v.add(new FieldContainer(41, 43, Field.DAY_OF_MONTH));
-        v.add(new FieldContainer(44, 47, Field.DAY_OF_MONTH));
-        v.add(new FieldContainer(48, 50, Field.HOUR_OF_DAY1));
-        v.add(new FieldContainer(51, 53, Field.HOUR_OF_DAY1));
-        v.add(new FieldContainer(54, 57, Field.HOUR_OF_DAY1));
-        v.add(new FieldContainer(58, 60, Field.HOUR_OF_DAY0));
-        v.add(new FieldContainer(61, 63, Field.HOUR_OF_DAY0));
-        v.add(new FieldContainer(64, 67, Field.HOUR_OF_DAY0));
-        v.add(new FieldContainer(68, 69, Field.HOUR1));
-        v.add(new FieldContainer(70, 72, Field.HOUR1));
-        v.add(new FieldContainer(73, 76, Field.HOUR1));
-        v.add(new FieldContainer(77, 79, Field.MINUTE));
-        v.add(new FieldContainer(80, 83, Field.MINUTE));
-        v.add(new FieldContainer(84, 85, Field.SECOND));
-        v.add(new FieldContainer(86, 88, Field.SECOND));
-        v.add(new FieldContainer(89, 92, Field.SECOND));
-        v.add(new FieldContainer(93, 94, Field.MILLISECOND));
-        v.add(new FieldContainer(95, 97, Field.MILLISECOND));
-        v.add(new FieldContainer(98, 101, Field.MILLISECOND));
-        v.add(new FieldContainer(102, 105, Field.DAY_OF_WEEK));
-        v.add(new FieldContainer(106, 112, Field.DAY_OF_WEEK));
-        v.add(new FieldContainer(113, 116, Field.DAY_OF_YEAR));
-        v.add(new FieldContainer(117, 120, Field.DAY_OF_YEAR));
-        v.add(new FieldContainer(121, 124, Field.DAY_OF_YEAR));
-        v.add(new FieldContainer(125, 126, Field.DAY_OF_WEEK_IN_MONTH));
-        v.add(new FieldContainer(127, 129, Field.DAY_OF_WEEK_IN_MONTH));
-        v.add(new FieldContainer(130, 132, Field.WEEK_OF_YEAR));
-        v.add(new FieldContainer(133, 136, Field.WEEK_OF_YEAR));
-        v.add(new FieldContainer(137, 138, Field.WEEK_OF_MONTH));
-        v.add(new FieldContainer(139, 142, Field.WEEK_OF_MONTH));
-        v.add(new FieldContainer(143, 145, Field.AM_PM));
-        v.add(new FieldContainer(147, 149, Field.AM_PM));
-        v.add(new FieldContainer(151, 152, Field.HOUR0));
-        v.add(new FieldContainer(153, 156, Field.HOUR0));
-        v.add(new FieldContainer(157, 166, Field.TIME_ZONE));
-        v.add(new FieldContainer(167, 176, Field.TIME_ZONE));
-        v.add(new FieldContainer(177, 182, Field.TIME_ZONE));
-        v.add(new FieldContainer(183, 188, Field.TIME_ZONE));
-        // END android-changed
-        return v;
-    }
-
-}
diff --git a/support/src/test/java/tests/support/Support_TimeZone.java b/support/src/test/java/tests/support/Support_TimeZone.java
deleted file mode 100644
index e9d2895..0000000
--- a/support/src/test/java/tests/support/Support_TimeZone.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.support;
-
-import java.util.Calendar;
-import java.util.GregorianCalendar;
-import java.util.TimeZone;
-
-/**
- * Sample java.util.TimeZone subclass to test getDSTSavings() and getOffset(long)
- * APIs
- *
- */
-public class Support_TimeZone extends TimeZone {
-    private static final long serialVersionUID = 1L;
-
-    int rawOffset;
-
-    boolean useDaylightTime;
-
-    public Support_TimeZone(int rawOffset, boolean useDaylightTime) {
-        this.rawOffset = rawOffset;
-        this.useDaylightTime = useDaylightTime;
-    }
-
-    @Override
-    public int getRawOffset() {
-        return rawOffset;
-    }
-
-    /**
-     * let's assume this timezone has daylight savings from the 4th month till
-     * the 10th month of the year to ame things simple.
-     */
-    @Override
-    public boolean inDaylightTime(java.util.Date p1) {
-        if (!useDaylightTime) {
-            return false;
-        }
-        GregorianCalendar cal = new GregorianCalendar();
-        cal.setTime(p1);
-        int month = cal.get(Calendar.MONTH);
-
-        if (month > 4 && month < 10) {
-            return true;
-        }
-        return false;
-    }
-
-    @Override
-    public boolean useDaylightTime() {
-        return useDaylightTime;
-    }
-
-    /*
-     * return 0 to keep it simple, since this subclass is not used to test this
-     * method..
-     */
-    @Override
-    public int getOffset(int p1, int p2, int p3, int p4, int p5, int p6) {
-        return 0;
-    }
-
-    @Override
-    public void setRawOffset(int p1) {
-        rawOffset = p1;
-    }
-}
diff --git a/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java b/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java
index a07b9b4..ee266c6 100644
--- a/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java
+++ b/support/src/test/java/tests/support/Support_UnmodifiableCollectionTest.java
@@ -17,8 +17,6 @@
 
 package tests.support;
 
-import dalvik.annotation.TestTargetClass;
-
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -26,7 +24,6 @@
 import java.util.TreeSet;
 import junit.framework.TestCase;
 
-@TestTargetClass(Collection.class)
 public class Support_UnmodifiableCollectionTest extends TestCase {
 
     Collection<Integer> col;
diff --git a/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java b/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java
index 464ee93..e7a1620 100644
--- a/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java
+++ b/support/src/test/java/tests/support/Support_UnmodifiableMapTest.java
@@ -17,15 +17,12 @@
 
 package tests.support;
 
-import dalvik.annotation.TestTargetClass;
-
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 import junit.framework.TestCase;
 
-@TestTargetClass(Map.class)
 public class Support_UnmodifiableMapTest extends TestCase {
 
     Map<String, Integer> map;
diff --git a/xml/src/main/java/org/kxml2/io/KXmlParser.java b/xml/src/main/java/org/kxml2/io/KXmlParser.java
index 4b4f328..7a2d052 100644
--- a/xml/src/main/java/org/kxml2/io/KXmlParser.java
+++ b/xml/src/main/java/org/kxml2/io/KXmlParser.java
@@ -38,11 +38,11 @@
  */
 public class KXmlParser implements XmlPullParser, Closeable {
 
-    private final String PROPERTY_XMLDECL_VERSION
+    private static final String PROPERTY_XMLDECL_VERSION
             = "http://xmlpull.org/v1/doc/properties.html#xmldecl-version";
-    private final String PROPERTY_XMLDECL_STANDALONE
+    private static final String PROPERTY_XMLDECL_STANDALONE
             = "http://xmlpull.org/v1/doc/properties.html#xmldecl-standalone";
-    private final String PROPERTY_LOCATION = "http://xmlpull.org/v1/doc/properties.html#location";
+    private static final String PROPERTY_LOCATION = "http://xmlpull.org/v1/doc/properties.html#location";
     private static final String FEATURE_RELAXED = "http://xmlpull.org/v1/doc/features.html#relaxed";
 
     private static final Map<String, String> DEFAULT_ENTITIES = new HashMap<String, String>();
diff --git a/xml/src/main/java/org/kxml2/io/KXmlSerializer.java b/xml/src/main/java/org/kxml2/io/KXmlSerializer.java
index d676c41..d1965d6 100644
--- a/xml/src/main/java/org/kxml2/io/KXmlSerializer.java
+++ b/xml/src/main/java/org/kxml2/io/KXmlSerializer.java
@@ -22,6 +22,7 @@
 package org.kxml2.io;
 
 import java.io.*;
+import java.util.Locale;
 import org.xmlpull.v1.*;
 
 public class KXmlSerializer implements XmlSerializer {
@@ -332,21 +333,19 @@
                 ? new OutputStreamWriter(os)
                 : new OutputStreamWriter(os, encoding));
         this.encoding = encoding;
-        if (encoding != null
-            && encoding.toLowerCase().startsWith("utf"))
+        if (encoding != null && encoding.toLowerCase(Locale.US).startsWith("utf")) {
             unicode = true;
+        }
     }
 
-    public void startDocument(
-        String encoding,
-        Boolean standalone)
-        throws IOException {
+    public void startDocument(String encoding, Boolean standalone) throws IOException {
         writer.write("<?xml version='1.0' ");
 
         if (encoding != null) {
             this.encoding = encoding;
-            if (encoding.toLowerCase().startsWith("utf"))
+            if (encoding.toLowerCase(Locale.US).startsWith("utf")) {
                 unicode = true;
+            }
         }
 
         if (this.encoding != null) {
diff --git a/xml/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java b/xml/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java
index 8ad1b89..4375a41 100644
--- a/xml/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java
+++ b/xml/src/main/java/org/xmlpull/v1/XmlPullParserFactory.java
@@ -85,10 +85,8 @@
      * @param state if true feature will be set; if false will be ignored
      */
 
-    public void setFeature(String name,
-                           boolean state) throws XmlPullParserException {
-
-        features.put(name, new Boolean(state));
+    public void setFeature(String name, boolean state) throws XmlPullParserException {
+        features.put(name, state);
     }
 
 
@@ -116,7 +114,7 @@
      */
 
     public void setNamespaceAware(boolean awareness) {
-        features.put (XmlPullParser.FEATURE_PROCESS_NAMESPACES, new Boolean (awareness));
+        features.put (XmlPullParser.FEATURE_PROCESS_NAMESPACES, awareness);
     }
 
     /**
@@ -143,7 +141,7 @@
      */
 
     public void setValidating(boolean validating) {
-        features.put (XmlPullParser.FEATURE_VALIDATION, new Boolean (validating));
+        features.put (XmlPullParser.FEATURE_VALIDATION, validating);
     }
 
     /**
@@ -175,7 +173,7 @@
         if (parserClasses.size() == 0) throw new XmlPullParserException
                 ("No valid parser classes found in "+classNamesLocation);
 
-        final StringBuffer issues = new StringBuffer ();
+        final StringBuilder issues = new StringBuilder();
 
         for (int i = 0; i < parserClasses.size(); i++) {
             final Class ppClass = (Class) parserClasses.get(i);
@@ -221,7 +219,7 @@
                 ("No valid serializer classes found in "+classNamesLocation);
         }
 
-        final StringBuffer issues = new StringBuffer ();
+        final StringBuilder issues = new StringBuilder ();
 
         for (int i = 0; i < serializerClasses.size (); i++) {
             final Class ppClass = (Class) serializerClasses.get(i);
@@ -269,7 +267,7 @@
                 if (is == null) throw new XmlPullParserException
                         ("resource not found: "+RESOURCE_NAME
                              +" make sure that parser implementing XmlPull API is available");
-                final StringBuffer sb = new StringBuffer();
+                final StringBuilder sb = new StringBuilder();
 
                 while (true) {
                     final int ch = is.read();
diff --git a/xml/src/main/java/org/xmlpull/v1/sax2/Driver.java b/xml/src/main/java/org/xmlpull/v1/sax2/Driver.java
index 0bd2d4f..88cffd7 100644
--- a/xml/src/main/java/org/xmlpull/v1/sax2/Driver.java
+++ b/xml/src/main/java/org/xmlpull/v1/sax2/Driver.java
@@ -358,7 +358,7 @@
                     "start tag must be read before skiping subtree"+pp.getPositionDescription());
             }
             final int[] holderForStartAndLength = new int[2];
-            final StringBuffer rawName = new StringBuffer(16);
+            final StringBuilder rawName = new StringBuilder(16);
             String prefix = null;
             String name = null;
             int level = pp.getDepth() - 1;
diff --git a/xml/src/test/java/org/kxml2/io/AllTests.java b/xml/src/test/java/org/kxml2/io/AllTests.java
deleted file mode 100644
index 4fcc44a..0000000
--- a/xml/src/test/java/org/kxml2/io/AllTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.kxml2.io;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllTests {
-    public static Test suite() {
-        TestSuite suite = new TestSuite();
-        suite.addTestSuite(KXmlSerializerTest.class);
-        return suite;
-    }
-
-}