Merge "Fix Signature2Test."
diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
index 4e44caa..22d0d26 100644
--- a/benchmarks/Android.mk
+++ b/benchmarks/Android.mk
@@ -21,19 +21,19 @@
 include $(CLEAR_VARS)
 LOCAL_MODULE := benchmarks
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
-LOCAL_STATIC_JAVA_LIBRARIES := caliper-prebuilt mockwebserver core-tests-support
+LOCAL_STATIC_JAVA_LIBRARIES := mockwebserver core-tests-support
 LOCAL_NO_STANDARD_LIBRARIES := true
-LOCAL_JAVA_LIBRARIES := core-oj core-libart conscrypt core-junit bouncycastle framework
+LOCAL_JAVA_LIBRARIES := \
+  caliper-api-target \
+  core-oj \
+  core-libart \
+  conscrypt \
+  core-junit \
+  bouncycastle \
+  framework
 LOCAL_MODULE_TAGS := tests
 LOCAL_MODULE_PATH := $(PRODUCT_OUT)/data/caliperperf
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 include $(BUILD_JAVA_LIBRARY)
 
-##################################################
-# Prebuilt Java libraries
-include $(CLEAR_VARS)
-LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES := caliper-prebuilt:libs/caliper.jar
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-include $(BUILD_MULTI_PREBUILT)
-
 endif
diff --git a/benchmarks/libs/caliper.jar b/benchmarks/libs/caliper.jar
deleted file mode 100644
index 715e698..0000000
--- a/benchmarks/libs/caliper.jar
+++ /dev/null
Binary files differ
diff --git a/benchmarks/src/benchmarks/AdditionBenchmark.java b/benchmarks/src/benchmarks/AdditionBenchmark.java
index a18856e..5d7528b 100644
--- a/benchmarks/src/benchmarks/AdditionBenchmark.java
+++ b/benchmarks/src/benchmarks/AdditionBenchmark.java
@@ -16,14 +16,10 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * What do various kinds of addition cost?
  */
-public class AdditionBenchmark extends SimpleBenchmark {
+public class AdditionBenchmark {
     public int timeAddConstantToLocalInt(int reps) {
         int result = 0;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/ArrayCopyBenchmark.java b/benchmarks/src/benchmarks/ArrayCopyBenchmark.java
index 75ad243..000782c 100644
--- a/benchmarks/src/benchmarks/ArrayCopyBenchmark.java
+++ b/benchmarks/src/benchmarks/ArrayCopyBenchmark.java
@@ -16,13 +16,9 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 import java.util.Arrays;
 
-public class ArrayCopyBenchmark extends SimpleBenchmark {
+public class ArrayCopyBenchmark {
     public void timeManualArrayCopy(int reps) {
         char[] src = new char[8192];
         for (int rep = 0; rep < reps; ++rep) {
diff --git a/benchmarks/src/benchmarks/ArrayIterationBenchmark.java b/benchmarks/src/benchmarks/ArrayIterationBenchmark.java
index bdc255b..1425ca0 100644
--- a/benchmarks/src/benchmarks/ArrayIterationBenchmark.java
+++ b/benchmarks/src/benchmarks/ArrayIterationBenchmark.java
@@ -16,14 +16,10 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * How do various ways of iterating through an array compare?
  */
-public class ArrayIterationBenchmark extends SimpleBenchmark {
+public class ArrayIterationBenchmark {
     Foo[] mArray = new Foo[27];
     {
         for (int i = 0; i < mArray.length; ++i) mArray[i] = new Foo();
diff --git a/benchmarks/src/benchmarks/ArrayListIterationBenchmark.java b/benchmarks/src/benchmarks/ArrayListIterationBenchmark.java
index 4e5f145..92a8e66 100644
--- a/benchmarks/src/benchmarks/ArrayListIterationBenchmark.java
+++ b/benchmarks/src/benchmarks/ArrayListIterationBenchmark.java
@@ -16,16 +16,12 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 import java.util.ArrayList;
 
 /**
  * Is a hand-coded counted loop through an ArrayList cheaper than enhanced for?
  */
-public class ArrayListIterationBenchmark extends SimpleBenchmark {
+public class ArrayListIterationBenchmark {
     ArrayList<Foo> mList = new ArrayList<Foo>();
     {
         for (int i = 0; i < 27; ++i) mList.add(new Foo());
diff --git a/benchmarks/src/benchmarks/BufferedZipFileBenchmark.java b/benchmarks/src/benchmarks/BufferedZipFileBenchmark.java
index f4d3822..3c0122f 100644
--- a/benchmarks/src/benchmarks/BufferedZipFileBenchmark.java
+++ b/benchmarks/src/benchmarks/BufferedZipFileBenchmark.java
@@ -16,8 +16,8 @@
 
 package benchmarks;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.io.BufferedInputStream;
 import java.io.File;
 import java.io.FileOutputStream;
@@ -27,13 +27,14 @@
 import java.util.zip.ZipFile;
 import java.util.zip.ZipOutputStream;
 
-public final class BufferedZipFileBenchmark extends SimpleBenchmark {
+public final class BufferedZipFileBenchmark {
     @Param({"128", "1024", "8192", "65536"}) int compressedSize;
     @Param({"4", "32", "128"}) int readSize;
 
     private File file;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         file = File.createTempFile(getClass().getName(), ".zip");
         file.deleteOnExit();
 
diff --git a/benchmarks/src/benchmarks/ClassLoaderResourceBenchmark.java b/benchmarks/src/benchmarks/ClassLoaderResourceBenchmark.java
index 379eaec..33666b5 100644
--- a/benchmarks/src/benchmarks/ClassLoaderResourceBenchmark.java
+++ b/benchmarks/src/benchmarks/ClassLoaderResourceBenchmark.java
@@ -16,11 +16,9 @@
 
 package benchmarks;
 
-import com.google.caliper.SimpleBenchmark;
-
 import junit.framework.Assert;
 
-public class ClassLoaderResourceBenchmark extends SimpleBenchmark {
+public class ClassLoaderResourceBenchmark {
 
   private static final String EXISTENT_RESOURCE = "java/util/logging/logging.properties";
   private static final String MISSING_RESOURCE = "missing_entry";
diff --git a/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java b/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java
index 09b3186..1429062 100644
--- a/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java
+++ b/benchmarks/src/benchmarks/DeepArrayOpsBenchmark.java
@@ -17,13 +17,11 @@
 package benchmarks;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
-
 import java.lang.reflect.Array;
 import java.lang.reflect.Constructor;
 import java.util.Arrays;
 
-public class DeepArrayOpsBenchmark extends SimpleBenchmark {
+public class DeepArrayOpsBenchmark {
     @Param({"1", "4", "16", "256", "2048"}) int arrayLength;
 
     private Object[] array;
diff --git a/benchmarks/src/benchmarks/FieldAccessBenchmark.java b/benchmarks/src/benchmarks/FieldAccessBenchmark.java
index 19cb060..c2391d6 100644
--- a/benchmarks/src/benchmarks/FieldAccessBenchmark.java
+++ b/benchmarks/src/benchmarks/FieldAccessBenchmark.java
@@ -16,14 +16,10 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * What does field access cost?
  */
-public class FieldAccessBenchmark extends SimpleBenchmark {
+public class FieldAccessBenchmark {
     private static class Inner {
         public int publicInnerIntVal;
         protected int protectedInnerIntVal;
diff --git a/benchmarks/src/benchmarks/HashedCollectionsBenchmark.java b/benchmarks/src/benchmarks/HashedCollectionsBenchmark.java
index a826271..f2ecd1d 100644
--- a/benchmarks/src/benchmarks/HashedCollectionsBenchmark.java
+++ b/benchmarks/src/benchmarks/HashedCollectionsBenchmark.java
@@ -16,19 +16,15 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-import java.util.concurrent.ConcurrentHashMap;
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.LinkedHashMap;
+import java.util.concurrent.ConcurrentHashMap;
 
 /**
  * How do the various hash maps compare?
  */
-public class HashedCollectionsBenchmark extends SimpleBenchmark {
+public class HashedCollectionsBenchmark {
     public void timeHashMapGet(int reps) {
         HashMap<String, String> map = new HashMap<String, String>();
         map.put("hello", "world");
diff --git a/benchmarks/src/benchmarks/MethodInvocationBenchmark.java b/benchmarks/src/benchmarks/MethodInvocationBenchmark.java
index 7a5e1b6..6a023e0 100644
--- a/benchmarks/src/benchmarks/MethodInvocationBenchmark.java
+++ b/benchmarks/src/benchmarks/MethodInvocationBenchmark.java
@@ -16,14 +16,10 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * Compares various kinds of method invocation.
  */
-public class MethodInvocationBenchmark extends SimpleBenchmark {
+public class MethodInvocationBenchmark {
     interface I {
         void emptyInterface();
     }
diff --git a/benchmarks/src/benchmarks/MultiplicationBenchmark.java b/benchmarks/src/benchmarks/MultiplicationBenchmark.java
index b2f945b..8dfa628 100644
--- a/benchmarks/src/benchmarks/MultiplicationBenchmark.java
+++ b/benchmarks/src/benchmarks/MultiplicationBenchmark.java
@@ -16,14 +16,10 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * How much do various kinds of multiplication cost?
  */
-public class MultiplicationBenchmark extends SimpleBenchmark {
+public class MultiplicationBenchmark {
     public int timeMultiplyIntByConstant10(int reps) {
         int result = 1;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/ReferenceBenchmark.java b/benchmarks/src/benchmarks/ReferenceBenchmark.java
index 0fa63f2..80bcb5e 100644
--- a/benchmarks/src/benchmarks/ReferenceBenchmark.java
+++ b/benchmarks/src/benchmarks/ReferenceBenchmark.java
@@ -16,14 +16,13 @@
 
 package benchmarks;
 
-import com.google.caliper.SimpleBenchmark;
 import java.lang.ref.PhantomReference;
 import java.lang.ref.ReferenceQueue;
 
 /**
  * Benchmark to evaluate the performance of References.
  */
-public class ReferenceBenchmark extends SimpleBenchmark {
+public class ReferenceBenchmark {
 
     private Object object;
 
diff --git a/benchmarks/src/benchmarks/ReferenceGetBenchmark.java b/benchmarks/src/benchmarks/ReferenceGetBenchmark.java
index 80142a1..6ea237b 100644
--- a/benchmarks/src/benchmarks/ReferenceGetBenchmark.java
+++ b/benchmarks/src/benchmarks/ReferenceGetBenchmark.java
@@ -17,14 +17,12 @@
 package benchmarks;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
-
 import java.lang.ref.Reference;
 import java.lang.ref.SoftReference;
 import java.lang.ref.WeakReference;
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
 
-public class ReferenceGetBenchmark extends SimpleBenchmark {
+public class ReferenceGetBenchmark {
     @Param boolean intrinsicDisabled;
 
     private Object obj = "str";
diff --git a/benchmarks/src/benchmarks/StringIterationBenchmark.java b/benchmarks/src/benchmarks/StringIterationBenchmark.java
index 22c6ae2..1ee9e8c7 100644
--- a/benchmarks/src/benchmarks/StringIterationBenchmark.java
+++ b/benchmarks/src/benchmarks/StringIterationBenchmark.java
@@ -16,14 +16,10 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * How do the various schemes for iterating through a string compare?
  */
-public class StringIterationBenchmark extends SimpleBenchmark {
+public class StringIterationBenchmark {
     public void timeStringIteration0(int reps) {
         String s = "hello, world!";
         for (int rep = 0; rep < reps; ++rep) {
diff --git a/benchmarks/src/benchmarks/SystemArrayCopyBenchmark.java b/benchmarks/src/benchmarks/SystemArrayCopyBenchmark.java
index 5095ee1..000b497 100644
--- a/benchmarks/src/benchmarks/SystemArrayCopyBenchmark.java
+++ b/benchmarks/src/benchmarks/SystemArrayCopyBenchmark.java
@@ -17,9 +17,8 @@
 package benchmarks;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 
-public class SystemArrayCopyBenchmark extends SimpleBenchmark {
+public class SystemArrayCopyBenchmark {
   @Param({"2", "4", "8", "16", "32", "64", "128", "256", "512", "1024",
           "2048", "4096", "8192", "16384", "32768", "65536", "131072", "262144"})
   int arrayLength;
diff --git a/benchmarks/src/benchmarks/VirtualVersusInterfaceBenchmark.java b/benchmarks/src/benchmarks/VirtualVersusInterfaceBenchmark.java
index f029c81..fa3bd6c 100644
--- a/benchmarks/src/benchmarks/VirtualVersusInterfaceBenchmark.java
+++ b/benchmarks/src/benchmarks/VirtualVersusInterfaceBenchmark.java
@@ -16,18 +16,14 @@
 
 package benchmarks;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  * Is there a performance reason to "Prefer virtual over interface", as the
  * Android documentation once claimed?
  */
-public class VirtualVersusInterfaceBenchmark extends SimpleBenchmark {
+public class VirtualVersusInterfaceBenchmark {
     public void timeMapPut(int reps) {
         Map<String, String> map = new HashMap<String, String>();
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/XmlParseBenchmark.java b/benchmarks/src/benchmarks/XmlParseBenchmark.java
index b5e7b93..69ab7a5 100644
--- a/benchmarks/src/benchmarks/XmlParseBenchmark.java
+++ b/benchmarks/src/benchmarks/XmlParseBenchmark.java
@@ -16,9 +16,8 @@
 
 package benchmarks;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
@@ -37,7 +36,7 @@
 import org.xml.sax.helpers.DefaultHandler;
 import org.xmlpull.v1.XmlPullParser;
 
-public class XmlParseBenchmark extends SimpleBenchmark {
+public class XmlParseBenchmark {
 
     @Param String xmlFile;
     ByteArrayInputStream inputStream;
@@ -54,7 +53,8 @@
     private Constructor<? extends XmlPullParser> expatConstructor;
 
     @SuppressWarnings("unchecked")
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         byte[] xmlBytes = getXmlBytes();
         inputStream = new ByteArrayInputStream(xmlBytes);
         inputStream.mark(xmlBytes.length);
@@ -146,8 +146,4 @@
         }
         return elementCount;
     }
-
-    public static void main(String[] args) {
-        Runner.main(XmlParseBenchmark.class, args);
-    }
 }
diff --git a/benchmarks/src/benchmarks/XmlSerializeBenchmark.java b/benchmarks/src/benchmarks/XmlSerializeBenchmark.java
index 7319490..0ef2620 100644
--- a/benchmarks/src/benchmarks/XmlSerializeBenchmark.java
+++ b/benchmarks/src/benchmarks/XmlSerializeBenchmark.java
@@ -16,20 +16,15 @@
 
 package benchmarks;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-import org.xmlpull.v1.*;
-
 import java.io.CharArrayWriter;
-import java.io.IOException;
 import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
 import java.util.Random;
+import org.xmlpull.v1.XmlSerializer;
 
 
-public class XmlSerializeBenchmark extends SimpleBenchmark {
+public class XmlSerializeBenchmark {
 
     @Param( {"0.99 0.7 0.7 0.7 0.7 0.7",
             "0.999 0.3 0.3 0.95 0.9 0.9"})
@@ -84,7 +79,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    @Override
+    @BeforeExperiment
     protected void setUp() throws Exception {
         kxmlConstructor = (Constructor) Class.forName("org.kxml2.io.KXmlSerializer")
                 .getConstructor();
@@ -111,8 +106,4 @@
     public void timeFast(int reps) throws Exception {
         internalTimeSerializer(fastConstructor, reps);
     }
-
-    public static void main(String[] args) {
-        Runner.main(XmlSerializeBenchmark.class, args);
-    }
 }
diff --git a/benchmarks/src/benchmarks/regression/AnnotatedElementBenchmark.java b/benchmarks/src/benchmarks/regression/AnnotatedElementBenchmark.java
index 107767b..dd7da4c 100644
--- a/benchmarks/src/benchmarks/regression/AnnotatedElementBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/AnnotatedElementBenchmark.java
@@ -16,20 +16,20 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
+import com.google.caliper.BeforeExperiment;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
-public class AnnotatedElementBenchmark extends SimpleBenchmark {
+public class AnnotatedElementBenchmark {
 
     private Class<?> type;
     private Field field;
     private Method method;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         type = Type.class;
         field = Type.class.getField("field");
         method = Type.class.getMethod("method", String.class);
@@ -257,8 +257,4 @@
         int f() default 0;
         long g() default 0L;
     }
-
-    public static void main(String[] args) throws Exception {
-        Runner.main(AnnotatedElementBenchmark.class, args);
-    }
 }
diff --git a/benchmarks/src/benchmarks/regression/BidiBenchmark.java b/benchmarks/src/benchmarks/regression/BidiBenchmark.java
index bb5087e..a4e47e1 100644
--- a/benchmarks/src/benchmarks/regression/BidiBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/BidiBenchmark.java
@@ -16,14 +16,12 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-
 import java.math.BigDecimal;
 import java.text.AttributedCharacterIterator;
 import java.text.Bidi;
 import java.text.DecimalFormat;
 
-public class BidiBenchmark extends SimpleBenchmark {
+public class BidiBenchmark {
 
     private static final AttributedCharacterIterator charIter =
             DecimalFormat.getInstance().formatToCharacterIterator(new BigDecimal(Math.PI));
diff --git a/benchmarks/src/benchmarks/regression/BigIntegerBenchmark.java b/benchmarks/src/benchmarks/regression/BigIntegerBenchmark.java
index 841b901..b890aa1 100644
--- a/benchmarks/src/benchmarks/regression/BigIntegerBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/BigIntegerBenchmark.java
@@ -18,10 +18,8 @@
 
 import java.math.BigInteger;
 import java.util.Random;
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 
-public class BigIntegerBenchmark extends SimpleBenchmark {
+public class BigIntegerBenchmark {
     public void timeRandomDivision(int reps) throws Exception {
         Random r = new Random();
         BigInteger x = new BigInteger(1024, r);
diff --git a/benchmarks/src/benchmarks/regression/BitSetBenchmark.java b/benchmarks/src/benchmarks/regression/BitSetBenchmark.java
index ee91993..92ef8f1 100644
--- a/benchmarks/src/benchmarks/regression/BitSetBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/BitSetBenchmark.java
@@ -16,17 +16,18 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.util.BitSet;
 
-public class BitSetBenchmark extends SimpleBenchmark {
+public class BitSetBenchmark {
     @Param({ "1000", "10000" })
     private int size;
 
     private BitSet bs;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         bs = new BitSet(size);
     }
 
diff --git a/benchmarks/src/benchmarks/regression/BreakIteratorBenchmark.java b/benchmarks/src/benchmarks/regression/BreakIteratorBenchmark.java
index 8602ddc..804b7e3 100644
--- a/benchmarks/src/benchmarks/regression/BreakIteratorBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/BreakIteratorBenchmark.java
@@ -17,12 +17,10 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
-
 import java.text.BreakIterator;
 import java.util.Locale;
 
-public final class BreakIteratorBenchmark extends SimpleBenchmark {
+public final class BreakIteratorBenchmark {
 
     public static enum Text {
         LIPSUM(Locale.US, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi mollis consequat nisl non pharetra. Praesent pretium vehicula odio sed ultrices. Aenean a felis libero. Vivamus sed commodo nibh. Pellentesque turpis lectus, euismod vel ante nec, cursus posuere orci. Suspendisse velit neque, fermentum luctus ultrices in, ultrices vitae arcu. Duis tincidunt cursus lorem. Nam ultricies accumsan quam vitae imperdiet. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque aliquet pretium nisi, eget laoreet enim molestie sit amet. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.\nNam dapibus aliquam lacus ac suscipit. Proin in nibh sit amet purus congue laoreet eget quis nisl. Morbi gravida dignissim justo, a venenatis ante pulvinar at. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin ultrices vestibulum dui, vel aliquam lacus aliquam quis. Duis fringilla sapien ac lacus egestas, vel adipiscing elit euismod. Donec non tellus odio. Donec gravida eu massa ac feugiat. Aliquam erat volutpat. Praesent id adipiscing metus, nec laoreet enim. Aliquam vitae posuere turpis. Mauris ac pharetra sem. In at placerat tortor. Vivamus ac vehicula neque. Cras volutpat ullamcorper massa et varius. Praesent sagittis neque vitae nulla euismod pharetra.\nSed placerat sapien non molestie sollicitudin. Nullam sit amet dictum quam. Etiam tincidunt tortor vel pretium vehicula. Praesent fringilla ipsum vel velit luctus dignissim. Nulla massa ligula, mattis in enim et, mattis lacinia odio. Suspendisse tristique urna a orci commodo tempor. Duis lacinia egestas arcu a sollicitudin.\nIn ac feugiat lacus. Nunc fermentum eu est at tristique. Pellentesque quis ligula et orci placerat lacinia. Maecenas quis mauris diam. Etiam mi ipsum, tempus in purus quis, euismod faucibus orci. Nulla facilisi. Praesent sit amet sapien vel elit porta adipiscing. Phasellus sit amet volutpat diam.\nProin bibendum elit non lacus pharetra, quis eleifend tellus placerat. Nulla facilisi. Maecenas ante diam, pellentesque mattis mattis in, porta ut lorem. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nunc interdum tristique metus, in scelerisque odio fermentum eget. Cras nec venenatis lacus. Aenean euismod eget metus quis molestie. Cras tincidunt dolor ut massa ornare, in elementum lacus auctor. Cras sodales nisl lacus, id ultrices ligula varius at. Sed tristique sit amet tellus vel mollis. Sed sed sollicitudin quam. Sed sed adipiscing risus, et dictum orci. Cras tempor pellentesque turpis et tempus."),
diff --git a/benchmarks/src/benchmarks/regression/ByteBufferBenchmark.java b/benchmarks/src/benchmarks/regression/ByteBufferBenchmark.java
index 7812013..4febc0a 100644
--- a/benchmarks/src/benchmarks/regression/ByteBufferBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ByteBufferBenchmark.java
@@ -17,16 +17,20 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
+import java.io.File;
+import java.io.IOException;
+import java.io.RandomAccessFile;
+import java.nio.ByteBuffer;
+import java.nio.ByteOrder;
+import java.nio.CharBuffer;
+import java.nio.DoubleBuffer;
+import java.nio.FloatBuffer;
+import java.nio.IntBuffer;
+import java.nio.LongBuffer;
+import java.nio.ShortBuffer;
+import java.nio.channels.FileChannel;
 
-import java.io.*;
-import java.nio.*;
-import java.nio.channels.*;
-import java.util.Arrays;
-import java.util.Collection;
-
-public class ByteBufferBenchmark extends SimpleBenchmark {
+public class ByteBufferBenchmark {
     public enum MyByteOrder {
         BIG(ByteOrder.BIG_ENDIAN), LITTLE(ByteOrder.LITTLE_ENDIAN);
         final ByteOrder byteOrder;
diff --git a/benchmarks/src/benchmarks/regression/ByteBufferScalarVersusVectorBenchmark.java b/benchmarks/src/benchmarks/regression/ByteBufferScalarVersusVectorBenchmark.java
index 7c75deb..4e1856a 100644
--- a/benchmarks/src/benchmarks/regression/ByteBufferScalarVersusVectorBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ByteBufferScalarVersusVectorBenchmark.java
@@ -17,16 +17,9 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
+import java.nio.ByteBuffer;
 
-import java.io.*;
-import java.nio.*;
-import java.nio.channels.*;
-import java.util.Arrays;
-import java.util.Collection;
-
-public class ByteBufferScalarVersusVectorBenchmark extends SimpleBenchmark {
+public class ByteBufferScalarVersusVectorBenchmark {
   @Param private ByteBufferBenchmark.MyByteOrder byteOrder;
   @Param({"true", "false"}) private boolean aligned;
   @Param private ByteBufferBenchmark.MyBufferType bufferType;
diff --git a/benchmarks/src/benchmarks/regression/CharacterBenchmark.java b/benchmarks/src/benchmarks/regression/CharacterBenchmark.java
index 953513b..bb9a51f 100644
--- a/benchmarks/src/benchmarks/regression/CharacterBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/CharacterBenchmark.java
@@ -16,15 +16,14 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 
 /**
  * Tests various Character methods, intended for testing multiple
  * implementations against each other.
  */
-public class CharacterBenchmark extends SimpleBenchmark {
+public class CharacterBenchmark {
 
     @Param private CharacterSet characterSet;
 
@@ -32,13 +31,14 @@
 
     private char[] chars;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         this.chars = characterSet.chars;
     }
 
     public enum Overload { CHAR, INT }
 
-    @Override public double nanosToUnits(double nanos) {
+    public double nanosToUnits(double nanos) {
         return nanos / 65536;
     }
 
diff --git a/benchmarks/src/benchmarks/regression/CharsetBenchmark.java b/benchmarks/src/benchmarks/regression/CharsetBenchmark.java
index 21b9966..131dc8a 100644
--- a/benchmarks/src/benchmarks/regression/CharsetBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/CharsetBenchmark.java
@@ -16,11 +16,9 @@
 
 package benchmarks.regression;
 
-import java.nio.charset.Charset;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 
-public class CharsetBenchmark extends SimpleBenchmark {
+public class CharsetBenchmark {
     @Param({ "1", "10", "100", "1000", "10000" })
     private int length;
 
diff --git a/benchmarks/src/benchmarks/regression/CharsetForNameBenchmark.java b/benchmarks/src/benchmarks/regression/CharsetForNameBenchmark.java
index 87dfb8b..d5b72e8 100644
--- a/benchmarks/src/benchmarks/regression/CharsetForNameBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/CharsetForNameBenchmark.java
@@ -16,11 +16,10 @@
 
 package benchmarks.regression;
 
-import java.nio.charset.Charset;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
+import java.nio.charset.Charset;
 
-public class CharsetForNameBenchmark extends SimpleBenchmark {
+public class CharsetForNameBenchmark {
     // canonical    => canonical charset name
     // built-in     => guaranteed-present charset
     // special-case => libcore treats this charset specially for performance
diff --git a/benchmarks/src/benchmarks/regression/ChecksumBenchmark.java b/benchmarks/src/benchmarks/regression/ChecksumBenchmark.java
index 0e7bf8d..61a95d7 100644
--- a/benchmarks/src/benchmarks/regression/ChecksumBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ChecksumBenchmark.java
@@ -16,13 +16,10 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.util.zip.Adler32;
 import java.util.zip.CRC32;
 
-public class ChecksumBenchmark extends SimpleBenchmark {
+public class ChecksumBenchmark {
     public void timeAdler_block(int reps) throws Exception {
         byte[] bytes = new byte[10000];
         Adler32 adler = new Adler32();
diff --git a/benchmarks/src/benchmarks/regression/CipherBenchmark.java b/benchmarks/src/benchmarks/regression/CipherBenchmark.java
index 56d549b..31cbcc3 100644
--- a/benchmarks/src/benchmarks/regression/CipherBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/CipherBenchmark.java
@@ -16,25 +16,21 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
 import java.security.spec.AlgorithmParameterSpec;
-
-import javax.crypto.KeyGenerator;
-import javax.crypto.SecretKey;
 import java.util.HashMap;
 import java.util.Map;
-
 import javax.crypto.Cipher;
+import javax.crypto.KeyGenerator;
+import javax.crypto.SecretKey;
 import javax.crypto.spec.IvParameterSpec;
 
 /**
  * Cipher benchmarks. Only runs on AES currently because of the combinatorial
  * explosion of the test as it stands.
  */
-public class CipherBenchmark extends SimpleBenchmark {
+public class CipherBenchmark {
 
     private static final int DATA_SIZE = 8192;
     private static final byte[] DATA = new byte[DATA_SIZE];
@@ -99,7 +95,8 @@
 
     private AlgorithmParameterSpec spec;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         cipherAlgorithm = algorithm.toString() + "/" + mode.toString() + "/"
                 + padding.toString();
 
diff --git a/benchmarks/src/benchmarks/regression/CipherInputStreamBenchmark.java b/benchmarks/src/benchmarks/regression/CipherInputStreamBenchmark.java
index 9dce12a..161002c 100644
--- a/benchmarks/src/benchmarks/regression/CipherInputStreamBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/CipherInputStreamBenchmark.java
@@ -16,29 +16,20 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
-
+import com.google.caliper.BeforeExperiment;
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
-import java.security.KeyPair;
-import java.security.KeyPairGenerator;
 import java.security.spec.AlgorithmParameterSpec;
-
+import javax.crypto.Cipher;
 import javax.crypto.CipherInputStream;
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.crypto.Cipher;
 import javax.crypto.spec.IvParameterSpec;
 
 /**
  * CipherInputStream benchmark.
  */
-public class CipherInputStreamBenchmark extends SimpleBenchmark {
+public class CipherInputStreamBenchmark {
 
     private static final int DATA_SIZE = 1024 * 1024;
     private static final byte[] DATA = new byte[DATA_SIZE];
@@ -63,7 +54,8 @@
 
     private AlgorithmParameterSpec spec;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         KeyGenerator generator = KeyGenerator.getInstance("AES");
         generator.init(128);
         key = generator.generateKey();
diff --git a/benchmarks/src/benchmarks/regression/CollatorBenchmark.java b/benchmarks/src/benchmarks/regression/CollatorBenchmark.java
index 9a8f20e..794f5ec 100644
--- a/benchmarks/src/benchmarks/regression/CollatorBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/CollatorBenchmark.java
@@ -16,13 +16,11 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-
 import java.text.Collator;
 import java.text.RuleBasedCollator;
 import java.util.Locale;
 
-public class CollatorBenchmark extends SimpleBenchmark {
+public class CollatorBenchmark {
 
     private static final RuleBasedCollator collator = (RuleBasedCollator)
             Collator.getInstance(Locale.US);
diff --git a/benchmarks/src/benchmarks/regression/CollectionsBenchmark.java b/benchmarks/src/benchmarks/regression/CollectionsBenchmark.java
index 18b969a..00c1191 100644
--- a/benchmarks/src/benchmarks/regression/CollectionsBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/CollectionsBenchmark.java
@@ -17,7 +17,6 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
@@ -25,7 +24,7 @@
 import java.util.Random;
 import java.util.Vector;
 
-public class CollectionsBenchmark extends SimpleBenchmark {
+public class CollectionsBenchmark {
     @Param({"4", "16", "64", "256", "1024"})
     private int arrayListLength;
 
diff --git a/benchmarks/src/benchmarks/regression/DateIntervalFormatBenchmark.java b/benchmarks/src/benchmarks/regression/DateIntervalFormatBenchmark.java
index e904b4d..3cde240 100644
--- a/benchmarks/src/benchmarks/regression/DateIntervalFormatBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DateIntervalFormatBenchmark.java
@@ -16,16 +16,13 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-
-import android.icu.util.ULocale;
 import android.icu.util.TimeZone;
-
+import android.icu.util.ULocale;
 import libcore.icu.DateIntervalFormat;
 
 import static libcore.icu.DateUtilsBridge.*;
 
-public class DateIntervalFormatBenchmark extends SimpleBenchmark {
+public class DateIntervalFormatBenchmark {
   public void timeDateIntervalFormat_formatDateRange_DATE(int reps) throws Exception {
     ULocale l = ULocale.US;
     TimeZone utc = TimeZone.getTimeZone("UTC");
diff --git a/benchmarks/src/benchmarks/regression/DateToStringBenchmark.java b/benchmarks/src/benchmarks/regression/DateToStringBenchmark.java
index 7fee61c..052fe38 100644
--- a/benchmarks/src/benchmarks/regression/DateToStringBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DateToStringBenchmark.java
@@ -17,19 +17,18 @@
 package benchmarks.regression;
 
 import android.text.format.DateFormat;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
+import com.google.caliper.BeforeExperiment;
 import java.text.SimpleDateFormat;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 
-public final class DateToStringBenchmark extends SimpleBenchmark {
+public final class DateToStringBenchmark {
     Date date;
     Calendar calendar;
     SimpleDateFormat format;
 
-    @Override
+    @BeforeExperiment
     protected void setUp() throws Exception {
         date = new Date(0);
         calendar = new GregorianCalendar();
@@ -60,8 +59,4 @@
             DateFormat.format("EEE MMM dd HH:mm:ss zzz yyyy", calendar);
         }
     }
-
-    public static void main(String[] args) throws Exception {
-        Runner.main(DateToStringBenchmark.class, args);
-    }
 }
diff --git a/benchmarks/src/benchmarks/regression/DecimalFormatBenchmark.java b/benchmarks/src/benchmarks/regression/DecimalFormatBenchmark.java
index 3d65ef0..0c4aa77 100644
--- a/benchmarks/src/benchmarks/regression/DecimalFormatBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DecimalFormatBenchmark.java
@@ -1,13 +1,11 @@
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-
 import java.math.BigDecimal;
 import java.text.DecimalFormat;
 import java.text.NumberFormat;
 import java.util.Locale;
 
-public class DecimalFormatBenchmark extends SimpleBenchmark {
+public class DecimalFormatBenchmark {
 
     private static final String EXP_PATTERN = "##E0";
 
@@ -155,5 +153,4 @@
     public void time_formatToCharacterIterator10e1000(int reps) {
         formatToCharacterIterator(BD10E1000, reps);
     }
-
 }
diff --git a/benchmarks/src/benchmarks/regression/DefaultCharsetBenchmark.java b/benchmarks/src/benchmarks/regression/DefaultCharsetBenchmark.java
index bc7b013..24283e4 100644
--- a/benchmarks/src/benchmarks/regression/DefaultCharsetBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DefaultCharsetBenchmark.java
@@ -17,10 +17,8 @@
 package benchmarks.regression;
 
 import java.nio.charset.Charset;
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 
-public class DefaultCharsetBenchmark extends SimpleBenchmark {
+public class DefaultCharsetBenchmark {
     public void time_defaultCharset(int reps) throws Exception {
         for (int i = 0; i < reps; ++i) {
             Charset.defaultCharset();
diff --git a/benchmarks/src/benchmarks/regression/DigestBenchmark.java b/benchmarks/src/benchmarks/regression/DigestBenchmark.java
index 7d00fec..e576d87 100644
--- a/benchmarks/src/benchmarks/regression/DigestBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DigestBenchmark.java
@@ -16,11 +16,11 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import com.android.org.bouncycastle.crypto.Digest;
+import com.google.caliper.BeforeExperiment;
+import com.google.caliper.Param;
 
-public class DigestBenchmark extends SimpleBenchmark {
+public class DigestBenchmark {
 
     private static final int DATA_SIZE = 8192;
     private static final byte[] DATA = new byte[DATA_SIZE];
@@ -40,7 +40,8 @@
 
     private Class<? extends Digest> digestClass;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         String className = "com.android.org.bouncycastle.crypto.digests.";
         switch (implementation) {
             case OPENSSL:
diff --git a/benchmarks/src/benchmarks/regression/DnsBenchmark.java b/benchmarks/src/benchmarks/regression/DnsBenchmark.java
index 2a71716..86bfa66 100644
--- a/benchmarks/src/benchmarks/regression/DnsBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DnsBenchmark.java
@@ -16,13 +16,10 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
-public class DnsBenchmark extends SimpleBenchmark {
+public class DnsBenchmark {
     public void timeDns(int reps) throws Exception {
         String[] hosts = new String[] {
             "www.amazon.com",
diff --git a/benchmarks/src/benchmarks/regression/DoPrivilegedBenchmark.java b/benchmarks/src/benchmarks/regression/DoPrivilegedBenchmark.java
index effb284..48b1fc8 100644
--- a/benchmarks/src/benchmarks/regression/DoPrivilegedBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DoPrivilegedBenchmark.java
@@ -16,13 +16,10 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-public class DoPrivilegedBenchmark extends SimpleBenchmark {
+public class DoPrivilegedBenchmark {
     public void timeDirect(int reps) throws Exception {
         for (int i = 0; i < reps; ++i) {
             String lineSeparator = System.getProperty("line.separator");
diff --git a/benchmarks/src/benchmarks/regression/DoubleBenchmark.java b/benchmarks/src/benchmarks/regression/DoubleBenchmark.java
index aa692ac..546c17e 100644
--- a/benchmarks/src/benchmarks/regression/DoubleBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/DoubleBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class DoubleBenchmark extends SimpleBenchmark {
+public class DoubleBenchmark {
     private double d = 1.2;
     private long l = 4608083138725491507L;
 
diff --git a/benchmarks/src/benchmarks/regression/EqualsHashCodeBenchmark.java b/benchmarks/src/benchmarks/regression/EqualsHashCodeBenchmark.java
index 72bb216..0a303d6 100644
--- a/benchmarks/src/benchmarks/regression/EqualsHashCodeBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/EqualsHashCodeBenchmark.java
@@ -16,12 +16,12 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.net.URI;
 import java.net.URL;
 
-public final class EqualsHashCodeBenchmark extends SimpleBenchmark {
+public final class EqualsHashCodeBenchmark {
     private enum Type {
         URI() {
             @Override Object newInstance(String text) throws Exception {
@@ -48,7 +48,8 @@
     Object c1;
     Object c2;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         a1 = type.newInstance("https://mail.google.com/mail/u/0/?shva=1#inbox");
         a2 = type.newInstance("https://mail.google.com/mail/u/0/?shva=1#inbox");
         b1 = type.newInstance("http://developer.android.com/reference/java/net/URI.html");
diff --git a/benchmarks/src/benchmarks/regression/ExpensiveObjectsBenchmark.java b/benchmarks/src/benchmarks/regression/ExpensiveObjectsBenchmark.java
index 535e298..2777884 100644
--- a/benchmarks/src/benchmarks/regression/ExpensiveObjectsBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ExpensiveObjectsBenchmark.java
@@ -16,17 +16,19 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Benchmark;
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-import java.text.*;
-import java.util.*;
+import java.text.Collator;
+import java.text.DateFormat;
+import java.text.DateFormatSymbols;
+import java.text.DecimalFormatSymbols;
+import java.text.NumberFormat;
+import java.text.SimpleDateFormat;
+import java.util.GregorianCalendar;
+import java.util.Locale;
 
 /**
  * Benchmarks creation and cloning various expensive objects.
  */
-public class ExpensiveObjectsBenchmark extends SimpleBenchmark {
+public class ExpensiveObjectsBenchmark {
     public void timeNewDateFormatTimeInstance(int reps) {
         for (int i = 0; i < reps; ++i) {
             DateFormat df = DateFormat.getTimeInstance(DateFormat.SHORT);
diff --git a/benchmarks/src/benchmarks/regression/FloatBenchmark.java b/benchmarks/src/benchmarks/regression/FloatBenchmark.java
index a92bb69..6964b01 100644
--- a/benchmarks/src/benchmarks/regression/FloatBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/FloatBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class FloatBenchmark extends SimpleBenchmark {
+public class FloatBenchmark {
     private float f = 1.2f;
     private int i = 1067030938;
 
diff --git a/benchmarks/src/benchmarks/regression/FormatterBenchmark.java b/benchmarks/src/benchmarks/regression/FormatterBenchmark.java
index 0d4cf26..091e7ea 100644
--- a/benchmarks/src/benchmarks/regression/FormatterBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/FormatterBenchmark.java
@@ -16,15 +16,13 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.util.Formatter;
 import java.util.Locale;
 
 /**
  * Compares Formatter against hand-written StringBuilder code.
  */
-public class FormatterBenchmark extends SimpleBenchmark {
+public class FormatterBenchmark {
     public void timeFormatter_NoFormatting(int reps) {
         for (int i = 0; i < reps; i++) {
             Formatter f = new Formatter();
diff --git a/benchmarks/src/benchmarks/regression/HostnameVerifierBenchmark.java b/benchmarks/src/benchmarks/regression/HostnameVerifierBenchmark.java
index e9218c4..9bf72a8 100644
--- a/benchmarks/src/benchmarks/regression/HostnameVerifierBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/HostnameVerifierBenchmark.java
@@ -16,9 +16,8 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.io.ByteArrayInputStream;
 import java.net.URL;
 import java.security.Principal;
@@ -37,7 +36,7 @@
  * caches previous results which skews the results of the benchmark: In practice
  * each certificate instance is verified once and then released.
  */
-public final class HostnameVerifierBenchmark extends SimpleBenchmark {
+public final class HostnameVerifierBenchmark {
 
     @Param({"android.clients.google.com",
             "m.google.com",
@@ -49,7 +48,8 @@
     private HostnameVerifier hostnameVerifier;
     private byte[][] encodedCertificates;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         URL url = new URL("https", host, "/");
         hostnameVerifier = HttpsURLConnection.getDefaultHostnameVerifier();
         HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();
@@ -163,8 +163,4 @@
             throw new UnsupportedOperationException();
         }
     }
-
-    public static void main(String[] args) {
-        Runner.main(HostnameVerifierBenchmark.class, args);
-    }
 }
diff --git a/benchmarks/src/benchmarks/regression/IcuBenchmark.java b/benchmarks/src/benchmarks/regression/IcuBenchmark.java
index 36014f2..47661b8 100644
--- a/benchmarks/src/benchmarks/regression/IcuBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IcuBenchmark.java
@@ -16,13 +16,10 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-
 import java.util.Locale;
-
 import libcore.icu.ICU;
 
-public class IcuBenchmark extends SimpleBenchmark {
+public class IcuBenchmark {
 
     private static final String ASCII_LOWERCASE = makeUnicodeRange(97, 122);
     private static final String ASCII_UPPERCASE = makeUnicodeRange(65, 90);
diff --git a/benchmarks/src/benchmarks/regression/IdnBenchmark.java b/benchmarks/src/benchmarks/regression/IdnBenchmark.java
index 9de5261..6a40d01 100644
--- a/benchmarks/src/benchmarks/regression/IdnBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IdnBenchmark.java
@@ -16,11 +16,9 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-
 import java.net.IDN;
 
-public class IdnBenchmark extends SimpleBenchmark {
+public class IdnBenchmark {
 
     public void timeToUnicode(int reps) {
         for (int i = 0; i < reps; i++) {
diff --git a/benchmarks/src/benchmarks/regression/IntConstantDivisionBenchmark.java b/benchmarks/src/benchmarks/regression/IntConstantDivisionBenchmark.java
index 498b783..533461b 100644
--- a/benchmarks/src/benchmarks/regression/IntConstantDivisionBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IntConstantDivisionBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class IntConstantDivisionBenchmark extends SimpleBenchmark {
+public class IntConstantDivisionBenchmark {
     public int timeDivideIntByConstant2(int reps) {
         int result = 1;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/regression/IntConstantMultiplicationBenchmark.java b/benchmarks/src/benchmarks/regression/IntConstantMultiplicationBenchmark.java
index ca1349c..cc096d6 100644
--- a/benchmarks/src/benchmarks/regression/IntConstantMultiplicationBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IntConstantMultiplicationBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class IntConstantMultiplicationBenchmark extends SimpleBenchmark {
+public class IntConstantMultiplicationBenchmark {
     public int timeMultiplyIntByConstant6(int reps) {
         int result = 1;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/regression/IntConstantRemainderBenchmark.java b/benchmarks/src/benchmarks/regression/IntConstantRemainderBenchmark.java
index 6174721..b22868d 100644
--- a/benchmarks/src/benchmarks/regression/IntConstantRemainderBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IntConstantRemainderBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class IntConstantRemainderBenchmark extends SimpleBenchmark {
+public class IntConstantRemainderBenchmark {
     public int timeRemainderIntByConstant2(int reps) {
         int result = 1;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/regression/IntegerBenchmark.java b/benchmarks/src/benchmarks/regression/IntegerBenchmark.java
index 601bb5d..f7f97c7 100644
--- a/benchmarks/src/benchmarks/regression/IntegerBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IntegerBenchmark.java
@@ -16,10 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
-
-public class IntegerBenchmark extends SimpleBenchmark {
+public class IntegerBenchmark {
     public int timeLongSignumBranch(int reps) {
         int t = 0;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/regression/IntegralToStringBenchmark.java b/benchmarks/src/benchmarks/regression/IntegralToStringBenchmark.java
index cab9e98..3445849 100644
--- a/benchmarks/src/benchmarks/regression/IntegralToStringBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/IntegralToStringBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class IntegralToStringBenchmark extends SimpleBenchmark {
+public class IntegralToStringBenchmark {
 
     private static final int SMALL  = 12;
     private static final int MEDIUM = 12345;
diff --git a/benchmarks/src/benchmarks/regression/JarFileBenchmark.java b/benchmarks/src/benchmarks/regression/JarFileBenchmark.java
index 626ca21..6e0cb57 100644
--- a/benchmarks/src/benchmarks/regression/JarFileBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/JarFileBenchmark.java
@@ -16,12 +16,12 @@
 
 package benchmarks.regression;
 
-import java.io.File;
-import java.util.jar.*;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
+import java.io.File;
+import java.util.jar.JarFile;
+import java.util.jar.Manifest;
 
-public class JarFileBenchmark extends SimpleBenchmark {
+public class JarFileBenchmark {
     @Param({
         "/system/framework/bouncycastle.jar",
         "/system/framework/core.jar",
diff --git a/benchmarks/src/benchmarks/regression/KeyPairGeneratorBenchmark.java b/benchmarks/src/benchmarks/regression/KeyPairGeneratorBenchmark.java
index 762c935..75c71b4 100644
--- a/benchmarks/src/benchmarks/regression/KeyPairGeneratorBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/KeyPairGeneratorBenchmark.java
@@ -16,17 +16,13 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.security.KeyPair;
-import java.security.PrivateKey;
-import java.security.PublicKey;
 import java.security.KeyPairGenerator;
 import java.security.SecureRandom;
-import java.util.HashMap;
-import java.util.Map;
 
-public class KeyPairGeneratorBenchmark extends SimpleBenchmark {
+public class KeyPairGeneratorBenchmark {
     @Param private Algorithm algorithm;
 
     public enum Algorithm {
@@ -42,7 +38,8 @@
     private KeyPairGenerator generator;
     private SecureRandom random;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         this.generatorAlgorithm = algorithm.toString();
         
         final String provider;
diff --git a/benchmarks/src/benchmarks/regression/LoopingBackwardsBenchmark.java b/benchmarks/src/benchmarks/regression/LoopingBackwardsBenchmark.java
index 054eff9..f0a474c 100644
--- a/benchmarks/src/benchmarks/regression/LoopingBackwardsBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/LoopingBackwardsBenchmark.java
@@ -17,15 +17,13 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 
 /**
  * Testing the old canard that looping backwards is faster.
  *
  * @author Kevin Bourrillion
  */
-public class LoopingBackwardsBenchmark extends SimpleBenchmark {
+public class LoopingBackwardsBenchmark {
   @Param({"2", "20", "2000", "20000000"}) int max;
 
   public int timeForwards(int reps) {
diff --git a/benchmarks/src/benchmarks/regression/MathBenchmark.java b/benchmarks/src/benchmarks/regression/MathBenchmark.java
index 19b2162..41426b5 100644
--- a/benchmarks/src/benchmarks/regression/MathBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/MathBenchmark.java
@@ -16,15 +16,11 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * Many of these tests are bogus in that the cost will vary wildly depending on inputs.
  * For _my_ current purposes, that's okay. But beware!
  */
-public class MathBenchmark extends SimpleBenchmark {
+public class MathBenchmark {
     private final double d = 1.2;
     private final float f = 1.2f;
     private final int i = 1;
diff --git a/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java b/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java
index c9d8074..a986434 100644
--- a/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java
@@ -17,10 +17,9 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.security.MessageDigest;
 
-public class MessageDigestBenchmark extends SimpleBenchmark {
+public class MessageDigestBenchmark {
 
     private static final int DATA_SIZE = 8192;
     private static final byte[] DATA = new byte[DATA_SIZE];
diff --git a/benchmarks/src/benchmarks/regression/MutableIntBenchmark.java b/benchmarks/src/benchmarks/regression/MutableIntBenchmark.java
index ee4f2d9..9e7f893 100644
--- a/benchmarks/src/benchmarks/regression/MutableIntBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/MutableIntBenchmark.java
@@ -17,11 +17,9 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.util.concurrent.atomic.AtomicInteger;
 
-public final class MutableIntBenchmark extends SimpleBenchmark {
+public final class MutableIntBenchmark {
 
     enum Kind {
         ARRAY() {
@@ -85,8 +83,4 @@
     public void timeGet(int reps) {
         kind.timeGet(reps);
     }
-
-    public static void main(String[] args) {
-        Runner.main(MutableIntBenchmark.class, args);
-    }
 }
diff --git a/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java b/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java
index 2e482ef..c30ea08 100644
--- a/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/NativeMethodBenchmark.java
@@ -16,10 +16,9 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
 import org.apache.harmony.dalvik.NativeTestTarget;
 
-public class NativeMethodBenchmark extends SimpleBenchmark {
+public class NativeMethodBenchmark {
     public void time_emptyJniStaticSynchronizedMethod0(int reps) throws Exception {
         for (int i = 0; i < reps; ++i) {
             NativeTestTarget.emptyJniStaticSynchronizedMethod0();
diff --git a/benchmarks/src/benchmarks/regression/ParseBenchmark.java b/benchmarks/src/benchmarks/regression/ParseBenchmark.java
index b44b429..8f52a34 100644
--- a/benchmarks/src/benchmarks/regression/ParseBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ParseBenchmark.java
@@ -16,9 +16,8 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -40,7 +39,7 @@
  * That file contains Twitter feed data, which is representative of what
  * applications will be parsing.
  */
-public final class ParseBenchmark extends SimpleBenchmark {
+public final class ParseBenchmark {
 
     @Param Document document;
     @Param Api api;
@@ -90,7 +89,8 @@
     private String text;
     private Parser parser;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         text = resourceToString("/" + document.name() + "." + api.extension);
         parser = api.newParser();
     }
@@ -101,10 +101,6 @@
         }
     }
 
-    public static void main(String... args) throws Exception {
-        Runner.main(ParseBenchmark.class, args);
-    }
-
     private static String resourceToString(String path) throws Exception {
         InputStream in = ParseBenchmark.class.getResourceAsStream(path);
         if (in == null) {
diff --git a/benchmarks/src/benchmarks/regression/PriorityQueueBenchmark.java b/benchmarks/src/benchmarks/regression/PriorityQueueBenchmark.java
index 2fe661b..a5b02b4 100644
--- a/benchmarks/src/benchmarks/regression/PriorityQueueBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/PriorityQueueBenchmark.java
@@ -16,15 +16,15 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.PriorityQueue;
 import java.util.Random;
 
-public class PriorityQueueBenchmark extends SimpleBenchmark {
+public class PriorityQueueBenchmark {
     @Param({"100", "1000", "10000"}) private int queueSize;
     @Param({"0", "25", "50", "75", "100"}) private int hitRate;
 
@@ -33,7 +33,8 @@
     private List<Integer> seekElements;
     private Random random = new Random(189279387L);
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         pq = new PriorityQueue<Integer>();
         usepq = new PriorityQueue<Integer>();
         seekElements = new ArrayList<Integer>();
diff --git a/benchmarks/src/benchmarks/regression/PropertyAccessBenchmark.java b/benchmarks/src/benchmarks/regression/PropertyAccessBenchmark.java
index cabd6ed..2781a29 100644
--- a/benchmarks/src/benchmarks/regression/PropertyAccessBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/PropertyAccessBenchmark.java
@@ -16,11 +16,11 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
+import com.google.caliper.BeforeExperiment;
 import java.lang.reflect.Field;
 import java.lang.reflect.Method;
 
-public final class PropertyAccessBenchmark extends SimpleBenchmark {
+public final class PropertyAccessBenchmark {
     private View view = new View();
     private Method setX;
     private GeneratedProperty generatedSetter = new GeneratedSetter();
@@ -28,7 +28,8 @@
     private Field x;
     private Object[] argsBox = new Object[1];
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         setX = View.class.getDeclaredMethod("setX", float.class);
         x = View.class.getDeclaredField("x");
     }
diff --git a/benchmarks/src/benchmarks/regression/ProviderBenchmark.java b/benchmarks/src/benchmarks/regression/ProviderBenchmark.java
index 649aa01..cfbd642 100644
--- a/benchmarks/src/benchmarks/regression/ProviderBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ProviderBenchmark.java
@@ -20,11 +20,7 @@
 import java.security.Security;
 import javax.crypto.Cipher;
 
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
-import javax.net.ssl.SSLSocketFactory;
-
-public class ProviderBenchmark extends SimpleBenchmark {
+public class ProviderBenchmark {
     public void timeStableProviders(int reps) throws Exception {
         for (int i = 0; i < reps; ++i) {
             Cipher c = Cipher.getInstance("RSA");
diff --git a/benchmarks/src/benchmarks/regression/RandomBenchmark.java b/benchmarks/src/benchmarks/regression/RandomBenchmark.java
index 0792805..284c63f 100644
--- a/benchmarks/src/benchmarks/regression/RandomBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/RandomBenchmark.java
@@ -18,10 +18,8 @@
 
 import java.security.SecureRandom;
 import java.util.Random;
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 
-public class RandomBenchmark extends SimpleBenchmark {
+public class RandomBenchmark {
     public void timeNewRandom(int reps) throws Exception {
         for (int i = 0; i < reps; ++i) {
             Random rng = new Random();
diff --git a/benchmarks/src/benchmarks/regression/RealToStringBenchmark.java b/benchmarks/src/benchmarks/regression/RealToStringBenchmark.java
index 8914cf64..dcdae39 100644
--- a/benchmarks/src/benchmarks/regression/RealToStringBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/RealToStringBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class RealToStringBenchmark extends SimpleBenchmark {
+public class RealToStringBenchmark {
 
     private static final float SMALL  = -123.45f;
     private static final float MEDIUM = -123.45e8f;
diff --git a/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java b/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java
index 4b47b26..e3c7bbf 100644
--- a/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ReflectionBenchmark.java
@@ -16,12 +16,11 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-import java.lang.reflect.*;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 
-public class ReflectionBenchmark extends SimpleBenchmark {
+public class ReflectionBenchmark {
     public void timeObject_getClass(int reps) throws Exception {
         C c = new C();
         for (int rep = 0; rep < reps; ++rep) {
diff --git a/benchmarks/src/benchmarks/regression/RelativeDateTimeFormatterBenchmark.java b/benchmarks/src/benchmarks/regression/RelativeDateTimeFormatterBenchmark.java
index ea2cf4a..6ddbc77 100644
--- a/benchmarks/src/benchmarks/regression/RelativeDateTimeFormatterBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/RelativeDateTimeFormatterBenchmark.java
@@ -16,8 +16,6 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-
 import java.util.Locale;
 import java.util.TimeZone;
 
@@ -25,7 +23,7 @@
 import static libcore.icu.RelativeDateTimeFormatter.getRelativeDateTimeString;
 import static libcore.icu.RelativeDateTimeFormatter.getRelativeTimeSpanString;
 
-public class RelativeDateTimeFormatterBenchmark extends SimpleBenchmark {
+public class RelativeDateTimeFormatterBenchmark {
   public void timeRelativeDateTimeFormatter_getRelativeTimeSpanString(int reps) throws Exception {
     Locale l = Locale.US;
     TimeZone utc = TimeZone.getTimeZone("Europe/London");
diff --git a/benchmarks/src/benchmarks/regression/SSLLoopbackBenchmark.java b/benchmarks/src/benchmarks/regression/SSLLoopbackBenchmark.java
index 0d9a792..f88c793 100644
--- a/benchmarks/src/benchmarks/regression/SSLLoopbackBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/SSLLoopbackBenchmark.java
@@ -16,23 +16,12 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.InetAddress;
-import java.net.Socket;
-import java.net.URL;
-import javax.net.SocketFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLServerSocketFactory;
 import javax.net.ssl.SSLSocket;
-
 import libcore.java.security.TestKeyStore;
 import libcore.javax.net.ssl.TestSSLContext;
 import libcore.javax.net.ssl.TestSSLSocketPair;
 
-public class SSLLoopbackBenchmark extends SimpleBenchmark {
+public class SSLLoopbackBenchmark {
 
     public void time(int reps) throws Exception {
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/regression/SSLSocketBenchmark.java b/benchmarks/src/benchmarks/regression/SSLSocketBenchmark.java
index 5be890e..d7aa8ff 100644
--- a/benchmarks/src/benchmarks/regression/SSLSocketBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/SSLSocketBenchmark.java
@@ -16,8 +16,8 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -27,7 +27,7 @@
 import javax.net.SocketFactory;
 import javax.net.ssl.SSLContext;
 
-public class SSLSocketBenchmark extends SimpleBenchmark {
+public class SSLSocketBenchmark {
 
     private static final int BUFFER_SIZE = 8192;
 
@@ -71,7 +71,8 @@
 
     private SocketFactory sf;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         SSLContext sslContext = SSLContext.getInstance("SSL");
         sslContext.init(null, null, null);
         this.sf = sslContext.getSocketFactory();
diff --git a/benchmarks/src/benchmarks/regression/SSLSocketFactoryBenchmark.java b/benchmarks/src/benchmarks/regression/SSLSocketFactoryBenchmark.java
index d0448d6..2b00c39 100644
--- a/benchmarks/src/benchmarks/regression/SSLSocketFactoryBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/SSLSocketFactoryBenchmark.java
@@ -16,11 +16,9 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import javax.net.ssl.SSLSocketFactory;
 
-public class SSLSocketFactoryBenchmark extends SimpleBenchmark {
+public class SSLSocketFactoryBenchmark {
     public void time(int reps) throws Exception {
         for (int i = 0; i < reps; ++i) {
             SSLSocketFactory.getDefault();
diff --git a/benchmarks/src/benchmarks/regression/SchemePrefixBenchmark.java b/benchmarks/src/benchmarks/regression/SchemePrefixBenchmark.java
index d90fe29..375965e 100644
--- a/benchmarks/src/benchmarks/regression/SchemePrefixBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/SchemePrefixBenchmark.java
@@ -17,12 +17,11 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.util.Locale;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
-public final class SchemePrefixBenchmark extends SimpleBenchmark {
+public final class SchemePrefixBenchmark {
 
     enum Strategy {
         JAVA() {
diff --git a/benchmarks/src/benchmarks/regression/SerializationBenchmark.java b/benchmarks/src/benchmarks/regression/SerializationBenchmark.java
index bc958eb..6ff4342 100644
--- a/benchmarks/src/benchmarks/regression/SerializationBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/SerializationBenchmark.java
@@ -16,14 +16,15 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-import java.io.*;
-import java.lang.reflect.*;
-import java.util.*;
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.ObjectStreamClass;
+import java.io.Serializable;
+import java.util.ArrayList;
 
-public class SerializationBenchmark extends SimpleBenchmark {
+public class SerializationBenchmark {
     private static byte[] bytes(Object o) throws Exception {
         ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
         ObjectOutputStream out = new ObjectOutputStream(baos);
diff --git a/benchmarks/src/benchmarks/regression/SignatureBenchmark.java b/benchmarks/src/benchmarks/regression/SignatureBenchmark.java
index 373b876..e7a3c80 100644
--- a/benchmarks/src/benchmarks/regression/SignatureBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/SignatureBenchmark.java
@@ -16,9 +16,8 @@
 
 package benchmarks.regression;
 
-import com.android.org.conscrypt.OpenSSLSignature;
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.security.KeyPair;
 import java.security.KeyPairGenerator;
 import java.security.PrivateKey;
@@ -30,7 +29,7 @@
 /**
  * Tests RSA and DSA signature creation and verification.
  */
-public class SignatureBenchmark extends SimpleBenchmark {
+public class SignatureBenchmark {
 
     private static final int DATA_SIZE = 8192;
     private static final byte[] DATA = new byte[DATA_SIZE];
@@ -64,7 +63,8 @@
     private PrivateKey privateKey;
     private PublicKey publicKey;
 
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         this.signatureAlgorithm = algorithm.toString();
 
         String keyAlgorithm = signatureAlgorithm.substring(signatureAlgorithm.length() - 3 ,
diff --git a/benchmarks/src/benchmarks/regression/StrictMathBenchmark.java b/benchmarks/src/benchmarks/regression/StrictMathBenchmark.java
index e844d93..0dcf882 100644
--- a/benchmarks/src/benchmarks/regression/StrictMathBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StrictMathBenchmark.java
@@ -16,15 +16,11 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
 /**
  * Many of these tests are bogus in that the cost will vary wildly depending on inputs.
  * For _my_ current purposes, that's okay. But beware!
  */
-public class StrictMathBenchmark extends SimpleBenchmark {
+public class StrictMathBenchmark {
     private final double d = 1.2;
     private final float f = 1.2f;
     private final int i = 1;
diff --git a/benchmarks/src/benchmarks/regression/StringBenchmark.java b/benchmarks/src/benchmarks/regression/StringBenchmark.java
index e09ee8b..dc425c3 100644
--- a/benchmarks/src/benchmarks/regression/StringBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringBenchmark.java
@@ -17,9 +17,8 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 
-public class StringBenchmark extends SimpleBenchmark {
+public class StringBenchmark {
     enum StringLengths {
         EMPTY(""),
         SHORT("short"),
diff --git a/benchmarks/src/benchmarks/regression/StringBuilderBenchmark.java b/benchmarks/src/benchmarks/regression/StringBuilderBenchmark.java
index 79eff2a..07a2305 100644
--- a/benchmarks/src/benchmarks/regression/StringBuilderBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringBuilderBenchmark.java
@@ -17,13 +17,11 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 
 /**
  * Tests the performance of various StringBuilder methods.
  */
-public class StringBuilderBenchmark extends SimpleBenchmark {
+public class StringBuilderBenchmark {
 
     @Param({"1", "10", "100"}) private int length;
 
diff --git a/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java b/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java
index 64f1c5f..1693157 100644
--- a/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringCaseMappingBenchmark.java
@@ -16,11 +16,10 @@
 
 package benchmarks.regression;
 
-import java.util.Locale;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
+import java.util.Locale;
 
-public class StringCaseMappingBenchmark extends SimpleBenchmark {
+public class StringCaseMappingBenchmark {
     enum Inputs {
         EMPTY(""),
 
diff --git a/benchmarks/src/benchmarks/regression/StringEqualsBenchmark.java b/benchmarks/src/benchmarks/regression/StringEqualsBenchmark.java
index 3ba2ac1..db19b25 100644
--- a/benchmarks/src/benchmarks/regression/StringEqualsBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringEqualsBenchmark.java
@@ -16,9 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
+import com.google.caliper.BeforeExperiment;
 import junit.framework.Assert;
 
 /**
@@ -27,7 +25,7 @@
  * that are not equal, identical strings with different references, strings with different endings,
  * interned strings, and strings of different lengths.
  */
-public class StringEqualsBenchmark extends SimpleBenchmark {
+public class StringEqualsBenchmark {
     private final String long1 = "Ahead-of-time compilation is possible as the compiler may just"
         + "convert an instruction thus: dex code: add-int v1000, v2000, v3000 C code: setIntRegter"
         + "(1000, call_dex_add_int(getIntRegister(2000), getIntRegister(3000)) This means even lid"
@@ -181,7 +179,8 @@
 
     // Check assumptions about how the compiler, new String(String), and String.intern() work.
     // Any failures here would invalidate these benchmarks.
-    @Override protected void setUp() throws Exception {
+    @BeforeExperiment
+    protected void setUp() throws Exception {
         // String constants are the same object
         Assert.assertSame("abc", "abc");
         // new String(String) makes a copy
diff --git a/benchmarks/src/benchmarks/regression/StringIsEmptyBenchmark.java b/benchmarks/src/benchmarks/regression/StringIsEmptyBenchmark.java
index a3be80a..4be478e 100644
--- a/benchmarks/src/benchmarks/regression/StringIsEmptyBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringIsEmptyBenchmark.java
@@ -16,10 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class StringIsEmptyBenchmark extends SimpleBenchmark {
+public class StringIsEmptyBenchmark {
     public void timeIsEmpty_NonEmpty(int reps) {
         boolean result = true;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/regression/StringLengthBenchmark.java b/benchmarks/src/benchmarks/regression/StringLengthBenchmark.java
index 962e395..104103a 100644
--- a/benchmarks/src/benchmarks/regression/StringLengthBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringLengthBenchmark.java
@@ -16,10 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class StringLengthBenchmark extends SimpleBenchmark {
+public class StringLengthBenchmark {
     public void timeLength(int reps) {
         int length = 0;
         for (int i = 0; i < reps; ++i) {
diff --git a/benchmarks/src/benchmarks/regression/StringSplitBenchmark.java b/benchmarks/src/benchmarks/regression/StringSplitBenchmark.java
index 37fdf8f..7c747cf 100644
--- a/benchmarks/src/benchmarks/regression/StringSplitBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringSplitBenchmark.java
@@ -16,10 +16,9 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
 import java.util.regex.Pattern;
 
-public class StringSplitBenchmark extends SimpleBenchmark {
+public class StringSplitBenchmark {
     public void timeStringSplitComma(int reps) {
         for (int i = 0; i < reps; ++i) {
             "this,is,a,simple,example".split(",");
diff --git a/benchmarks/src/benchmarks/regression/StringToRealBenchmark.java b/benchmarks/src/benchmarks/regression/StringToRealBenchmark.java
index ef7a633..5d04d7b 100644
--- a/benchmarks/src/benchmarks/regression/StringToRealBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/StringToRealBenchmark.java
@@ -17,10 +17,8 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
 
-public class StringToRealBenchmark extends SimpleBenchmark {
+public class StringToRealBenchmark {
 
     @Param({
         "NaN",
diff --git a/benchmarks/src/benchmarks/regression/ThreadLocalBenchmark.java b/benchmarks/src/benchmarks/regression/ThreadLocalBenchmark.java
index df0715b..59f7fc6 100644
--- a/benchmarks/src/benchmarks/regression/ThreadLocalBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/ThreadLocalBenchmark.java
@@ -16,11 +16,7 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.Param;
-import com.google.caliper.Runner;
-import com.google.caliper.SimpleBenchmark;
-
-public class ThreadLocalBenchmark extends SimpleBenchmark {
+public class ThreadLocalBenchmark {
     private static final ThreadLocal<char[]> BUFFER = new ThreadLocal<char[]>() {
         @Override protected char[] initialValue() {
             return new char[20];
diff --git a/benchmarks/src/benchmarks/regression/TimeZoneBenchmark.java b/benchmarks/src/benchmarks/regression/TimeZoneBenchmark.java
index ccef392..191e00d 100644
--- a/benchmarks/src/benchmarks/regression/TimeZoneBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/TimeZoneBenchmark.java
@@ -16,10 +16,9 @@
 
 package benchmarks.regression;
 
-import com.google.caliper.SimpleBenchmark;
 import java.util.TimeZone;
 
-public class TimeZoneBenchmark extends SimpleBenchmark {
+public class TimeZoneBenchmark {
     public void timeTimeZone_getDefault(int reps) throws Exception {
         for (int rep = 0; rep < reps; ++rep) {
             TimeZone.getDefault();
diff --git a/benchmarks/src/benchmarks/regression/URLConnectionBenchmark.java b/benchmarks/src/benchmarks/regression/URLConnectionBenchmark.java
index a4817b5..bd7c047 100644
--- a/benchmarks/src/benchmarks/regression/URLConnectionBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/URLConnectionBenchmark.java
@@ -17,7 +17,6 @@
 package benchmarks.regression;
 
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import com.google.mockwebserver.Dispatcher;
 import com.google.mockwebserver.MockResponse;
 import com.google.mockwebserver.MockWebServer;
@@ -26,9 +25,8 @@
 import java.io.InputStream;
 import java.net.HttpURLConnection;
 import java.net.URL;
-import java.net.URLConnection;
 
-public final class URLConnectionBenchmark extends SimpleBenchmark {
+public final class URLConnectionBenchmark {
 
     @Param({"0", "1024", "1048576"}) private int bodySize;
     @Param({"2048"}) private int chunkSize;
diff --git a/benchmarks/src/benchmarks/regression/XmlEntitiesBenchmark.java b/benchmarks/src/benchmarks/regression/XmlEntitiesBenchmark.java
index 4c5cc18..7c50975 100644
--- a/benchmarks/src/benchmarks/regression/XmlEntitiesBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/XmlEntitiesBenchmark.java
@@ -16,8 +16,8 @@
 
 package benchmarks.regression;
 
+import com.google.caliper.BeforeExperiment;
 import com.google.caliper.Param;
-import com.google.caliper.SimpleBenchmark;
 import java.io.StringReader;
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -26,7 +26,7 @@
 import org.xmlpull.v1.XmlPullParserFactory;
 
 // http://code.google.com/p/android/issues/detail?id=18102
-public final class XmlEntitiesBenchmark extends SimpleBenchmark {
+public final class XmlEntitiesBenchmark {
   
   @Param({"10", "100", "1000"}) int length;
   @Param({"0", "0.5", "1.0"}) float entityFraction;
@@ -37,7 +37,8 @@
   /** a string like {@code <doc>&amp;&amp;++</doc>}. */
   private String xml;
 
-  @Override protected void setUp() throws Exception {
+  @BeforeExperiment
+  protected void setUp() throws Exception {
     xmlPullParserFactory = XmlPullParserFactory.newInstance();
     documentBuilderFactory = DocumentBuilderFactory.newInstance();
 
diff --git a/dalvik/src/main/java/dalvik/system/SocketTagger.java b/dalvik/src/main/java/dalvik/system/SocketTagger.java
index 75242ce..97059a4 100644
--- a/dalvik/src/main/java/dalvik/system/SocketTagger.java
+++ b/dalvik/src/main/java/dalvik/system/SocketTagger.java
@@ -17,6 +17,7 @@
 package dalvik.system;
 
 import java.io.FileDescriptor;
+import java.net.DatagramSocket;
 import java.net.Socket;
 import java.net.SocketException;
 
@@ -61,6 +62,18 @@
         }
     }
 
+    public final void tag(DatagramSocket socket) throws SocketException {
+        if (!socket.isClosed()) {
+            tag(socket.getFileDescriptor$());
+        }
+    }
+
+    public final void untag(DatagramSocket socket) throws SocketException {
+        if (!socket.isClosed()) {
+            untag(socket.getFileDescriptor$());
+        }
+    }
+
     /**
      * Sets this process' socket tagger to {@code tagger}.
      */
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/CookieManagerTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/CookieManagerTest.java
index d0c4ee1..9092f26 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/CookieManagerTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/CookieManagerTest.java
@@ -24,6 +24,7 @@
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -300,4 +301,64 @@
         assertNotNull(store);
     }
 
+    // http://b/25763487
+    public void testCookieWithNullPath() throws Exception {
+        FakeSingleCookieStore fscs = new FakeSingleCookieStore();
+        CookieManager cm = new CookieManager(fscs, CookiePolicy.ACCEPT_ALL);
+
+        HttpCookie cookie = new HttpCookie("foo", "bar");
+        cookie.setDomain("http://www.foo.com");
+        cookie.setVersion(0);
+
+        fscs.setNextCookie(cookie);
+
+        Map<String, List<String>> cookieHeaders = cm.get(
+                new URI("http://www.foo.com/log/me/in"), Collections.EMPTY_MAP);
+
+        List<String> cookies = cookieHeaders.get("Cookie");
+        assertEquals("foo=bar", cookies.get(0));
+    }
+
+    /**
+     * A cookie store that always returns one cookie per URI (without any sort of
+     * rule matching). The cookie that's returned is provided via a call to setNextCookie
+     */
+    public static class FakeSingleCookieStore implements CookieStore {
+        private List<HttpCookie> cookies;
+
+        void setNextCookie(HttpCookie cookie) {
+            cookies = Collections.singletonList(cookie);
+        }
+
+        @Override
+        public void add(URI uri, HttpCookie cookie) {
+        }
+
+        @Override
+        public List<HttpCookie> get(URI uri) {
+            return cookies;
+        }
+
+        @Override
+        public List<HttpCookie> getCookies() {
+            return cookies;
+        }
+
+        @Override
+        public List<URI> getURIs() {
+            return null;
+        }
+
+        @Override
+        public boolean remove(URI uri, HttpCookie cookie) {
+            cookies = Collections.EMPTY_LIST;
+            return true;
+        }
+
+        @Override
+        public boolean removeAll() {
+            cookies = Collections.EMPTY_LIST;
+            return true;
+        }
+    }
 }
diff --git a/jvm.h b/jvm.h
deleted file mode 100644
index ed51dd1..0000000
--- a/jvm.h
+++ /dev/null
@@ -1,1483 +0,0 @@
-/*
- * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-#ifndef _JAVASOFT_JVM_H_
-#define _JAVASOFT_JVM_H_
-
-#include <sys/stat.h>
-#include <stdio.h>
-
-#include "jni.h"
-#include "jvm_md.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * This file contains additional functions exported from the VM.
- * These functions are complementary to the standard JNI support.
- * There are three parts to this file:
- *
- * First, this file contains the VM-related functions needed by native
- * libraries in the standard Java API. For example, the java.lang.Object
- * class needs VM-level functions that wait for and notify monitors.
- *
- * Second, this file contains the functions and constant definitions
- * needed by the byte code verifier and class file format checker.
- * These functions allow the verifier and format checker to be written
- * in a VM-independent way.
- *
- * Third, this file contains various I/O and nerwork operations needed
- * by the standard Java I/O and network APIs.
- */
-
-/*
- * Bump the version number when either of the following happens:
- *
- * 1. There is a change in JVM_* functions.
- *
- * 2. There is a change in the contract between VM and Java classes.
- *    For example, if the VM relies on a new private field in Thread
- *    class.
- */
-
-#define JVM_INTERFACE_VERSION 4
-
-JNIEXPORT jint JNICALL
-JVM_GetInterfaceVersion(void);
-
-/*************************************************************************
- PART 1: Functions for Native Libraries
- ************************************************************************/
-/*
- * java.lang.Object
- */
-JNIEXPORT jint JNICALL
-JVM_IHashCode(JNIEnv *env, jobject obj);
-
-JNIEXPORT void JNICALL
-JVM_MonitorWait(JNIEnv *env, jobject obj, jlong ms);
-
-JNIEXPORT void JNICALL
-JVM_MonitorNotify(JNIEnv *env, jobject obj);
-
-JNIEXPORT void JNICALL
-JVM_MonitorNotifyAll(JNIEnv *env, jobject obj);
-
-JNIEXPORT jobject JNICALL
-JVM_Clone(JNIEnv *env, jobject obj);
-
-/*
- * java.lang.String
- */
-JNIEXPORT jstring JNICALL
-JVM_InternString(JNIEnv *env, jstring str);
-
-/*
- * java.lang.System
- */
-JNIEXPORT jlong JNICALL
-JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored);
-
-JNIEXPORT jlong JNICALL
-JVM_NanoTime(JNIEnv *env, jclass ignored);
-
-JNIEXPORT void JNICALL
-JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,
-              jobject dst, jint dst_pos, jint length);
-
-JNIEXPORT jobject JNICALL
-JVM_InitProperties(JNIEnv *env, jobject p);
-
-/*
- * java.io.File
- */
-JNIEXPORT void JNICALL
-JVM_OnExit(void (*func)(void));
-
-/*
- * java.lang.Runtime
- */
-JNIEXPORT void JNICALL
-JVM_Exit(jint code);
-
-JNIEXPORT void JNICALL
-JVM_Halt(jint code);
-
-JNIEXPORT void JNICALL
-JVM_GC(void);
-
-/* Returns the number of real-time milliseconds that have elapsed since the
- * least-recently-inspected heap object was last inspected by the garbage
- * collector.
- *
- * For simple stop-the-world collectors this value is just the time
- * since the most recent collection.  For generational collectors it is the
- * time since the oldest generation was most recently collected.  Other
- * collectors are free to return a pessimistic estimate of the elapsed time, or
- * simply the time since the last full collection was performed.
- *
- * Note that in the presence of reference objects, a given object that is no
- * longer strongly reachable may have to be inspected multiple times before it
- * can be reclaimed.
- */
-JNIEXPORT jlong JNICALL
-JVM_MaxObjectInspectionAge(void);
-
-JNIEXPORT void JNICALL
-JVM_TraceInstructions(jboolean on);
-
-JNIEXPORT void JNICALL
-JVM_TraceMethodCalls(jboolean on);
-
-JNIEXPORT jlong JNICALL
-JVM_TotalMemory(void);
-
-JNIEXPORT jlong JNICALL
-JVM_FreeMemory(void);
-
-JNIEXPORT jlong JNICALL
-JVM_MaxMemory(void);
-
-JNIEXPORT jint JNICALL
-JVM_ActiveProcessorCount(void);
-
-JNIEXPORT jstring JVM_NativeLoad(JNIEnv* env, jstring javaFilename, jobject javaLoader,
-                                 jstring javaLdLibraryPath);
-
-JNIEXPORT void * JNICALL
-JVM_LoadLibrary(const char *name);
-
-JNIEXPORT void JNICALL
-JVM_UnloadLibrary(void * handle);
-
-JNIEXPORT void * JNICALL
-JVM_FindLibraryEntry(void *handle, const char *name);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsSupportedJNIVersion(jint version);
-
-/*
- * java.lang.Float and java.lang.Double
- */
-JNIEXPORT jboolean JNICALL
-JVM_IsNaN(jdouble d);
-
-/*
- * java.lang.Throwable
- */
-JNIEXPORT void JNICALL
-JVM_FillInStackTrace(JNIEnv *env, jobject throwable);
-
-JNIEXPORT void JNICALL
-JVM_PrintStackTrace(JNIEnv *env, jobject throwable, jobject printable);
-
-JNIEXPORT jint JNICALL
-JVM_GetStackTraceDepth(JNIEnv *env, jobject throwable);
-
-JNIEXPORT jobject JNICALL
-JVM_GetStackTraceElement(JNIEnv *env, jobject throwable, jint index);
-
-/*
- * java.lang.Compiler
- */
-JNIEXPORT void JNICALL
-JVM_InitializeCompiler (JNIEnv *env, jclass compCls);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsSilentCompiler(JNIEnv *env, jclass compCls);
-
-JNIEXPORT jboolean JNICALL
-JVM_CompileClass(JNIEnv *env, jclass compCls, jclass cls);
-
-JNIEXPORT jboolean JNICALL
-JVM_CompileClasses(JNIEnv *env, jclass cls, jstring jname);
-
-JNIEXPORT jobject JNICALL
-JVM_CompilerCommand(JNIEnv *env, jclass compCls, jobject arg);
-
-JNIEXPORT void JNICALL
-JVM_EnableCompiler(JNIEnv *env, jclass compCls);
-
-JNIEXPORT void JNICALL
-JVM_DisableCompiler(JNIEnv *env, jclass compCls);
-
-/*
- * java.lang.Thread
- */
-JNIEXPORT void JNICALL
-JVM_StartThread(JNIEnv *env, jobject thread, jlong stack_size, jboolean daemon);
-
-JNIEXPORT void JNICALL
-JVM_StopThread(JNIEnv *env, jobject thread, jobject exception);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsThreadAlive(JNIEnv *env, jobject thread);
-
-JNIEXPORT void JNICALL
-JVM_SuspendThread(JNIEnv *env, jobject thread);
-
-JNIEXPORT void JNICALL
-JVM_ResumeThread(JNIEnv *env, jobject thread);
-
-JNIEXPORT void JNICALL
-JVM_SetThreadPriority(JNIEnv *env, jobject thread, jint prio);
-
-JNIEXPORT void JNICALL
-JVM_Yield(JNIEnv *env, jclass threadClass);
-
-JNIEXPORT void JNICALL
-JVM_Sleep(JNIEnv *env, jclass threadClass, jobject java_object, jlong millis);
-
-JNIEXPORT jobject JNICALL
-JVM_CurrentThread(JNIEnv *env, jclass threadClass);
-
-JNIEXPORT jint JNICALL
-JVM_CountStackFrames(JNIEnv *env, jobject thread);
-
-JNIEXPORT void JNICALL
-JVM_Interrupt(JNIEnv *env, jobject thread);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsInterrupted(JNIEnv *env, jobject thread, jboolean clearInterrupted);
-
-JNIEXPORT jboolean JNICALL
-JVM_HoldsLock(JNIEnv *env, jclass threadClass, jobject obj);
-
-JNIEXPORT void JNICALL
-JVM_DumpAllStacks(JNIEnv *env, jclass unused);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetAllThreads(JNIEnv *env, jclass dummy);
-
-JNIEXPORT void JNICALL
-JVM_SetNativeThreadName(JNIEnv *env, jobject jthread, jstring name);
-
-/* getStackTrace() and getAllStackTraces() method */
-JNIEXPORT jobjectArray JNICALL
-JVM_DumpThreads(JNIEnv *env, jclass threadClass, jobjectArray threads);
-
-/*
- * java.lang.SecurityManager
- */
-JNIEXPORT jclass JNICALL
-JVM_CurrentLoadedClass(JNIEnv *env);
-
-JNIEXPORT jobject JNICALL
-JVM_CurrentClassLoader(JNIEnv *env);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetClassContext(JNIEnv *env);
-
-JNIEXPORT jint JNICALL
-JVM_ClassDepth(JNIEnv *env, jstring name);
-
-JNIEXPORT jint JNICALL
-JVM_ClassLoaderDepth(JNIEnv *env);
-
-/*
- * java.lang.Package
- */
-JNIEXPORT jstring JNICALL
-JVM_GetSystemPackage(JNIEnv *env, jstring name);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetSystemPackages(JNIEnv *env);
-
-/*
- * java.io.ObjectInputStream
- */
-JNIEXPORT jobject JNICALL
-JVM_AllocateNewObject(JNIEnv *env, jobject obj, jclass currClass,
-                      jclass initClass);
-
-JNIEXPORT jobject JNICALL
-JVM_AllocateNewArray(JNIEnv *env, jobject obj, jclass currClass,
-                     jint length);
-
-JNIEXPORT jobject JNICALL
-JVM_LatestUserDefinedLoader(JNIEnv *env);
-
-/*
- * This function has been deprecated and should not be considered
- * part of the specified JVM interface.
- */
-JNIEXPORT jclass JNICALL
-JVM_LoadClass0(JNIEnv *env, jobject obj, jclass currClass,
-               jstring currClassName);
-
-/*
- * java.lang.reflect.Array
- */
-JNIEXPORT jint JNICALL
-JVM_GetArrayLength(JNIEnv *env, jobject arr);
-
-JNIEXPORT jobject JNICALL
-JVM_GetArrayElement(JNIEnv *env, jobject arr, jint index);
-
-JNIEXPORT jvalue JNICALL
-JVM_GetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jint wCode);
-
-JNIEXPORT void JNICALL
-JVM_SetArrayElement(JNIEnv *env, jobject arr, jint index, jobject val);
-
-JNIEXPORT void JNICALL
-JVM_SetPrimitiveArrayElement(JNIEnv *env, jobject arr, jint index, jvalue v,
-                             unsigned char vCode);
-
-JNIEXPORT jobject JNICALL
-JVM_NewArray(JNIEnv *env, jclass eltClass, jint length);
-
-JNIEXPORT jobject JNICALL
-JVM_NewMultiArray(JNIEnv *env, jclass eltClass, jintArray dim);
-
-/*
- * java.lang.Class and java.lang.ClassLoader
- */
-/*
- * Returns the class in which the code invoking the native method
- * belongs.
- *
- * Note that in JDK 1.1, native methods did not create a frame.
- * In 1.2, they do. Therefore native methods like Class.forName
- * can no longer look at the current frame for the caller class.
- */
-JNIEXPORT jclass JNICALL
-JVM_GetCallerClass(JNIEnv *env, int n);
-
-/*
- * Find primitive classes
- * utf: class name
- */
-JNIEXPORT jclass JNICALL
-JVM_FindPrimitiveClass(JNIEnv *env, const char *utf);
-
-/*
- * Link the class
- */
-JNIEXPORT void JNICALL
-JVM_ResolveClass(JNIEnv *env, jclass cls);
-
-/*
- * Find a class from a boot class loader. Returns NULL if class not found.
- */
-JNIEXPORT jclass JNICALL
-JVM_FindClassFromBootLoader(JNIEnv *env, const char *name);
-
-/*
- * Find a class from a given class loader. Throw ClassNotFoundException
- * or NoClassDefFoundError depending on the value of the last
- * argument.
- */
-JNIEXPORT jclass JNICALL
-JVM_FindClassFromClassLoader(JNIEnv *env, const char *name, jboolean init,
-                             jobject loader, jboolean throwError);
-
-/*
- * Find a class from a given class.
- */
-JNIEXPORT jclass JNICALL
-JVM_FindClassFromClass(JNIEnv *env, const char *name, jboolean init,
-                             jclass from);
-
-/* Find a loaded class cached by the VM */
-JNIEXPORT jclass JNICALL
-JVM_FindLoadedClass(JNIEnv *env, jobject loader, jstring name);
-
-/* Define a class */
-JNIEXPORT jclass JNICALL
-JVM_DefineClass(JNIEnv *env, const char *name, jobject loader, const jbyte *buf,
-                jsize len, jobject pd);
-
-/* Define a class with a source (added in JDK1.5) */
-JNIEXPORT jclass JNICALL
-JVM_DefineClassWithSource(JNIEnv *env, const char *name, jobject loader,
-                          const jbyte *buf, jsize len, jobject pd,
-                          const char *source);
-
-/*
- * Reflection support functions
- */
-
-JNIEXPORT jstring JNICALL
-JVM_GetClassName(JNIEnv *env, jclass cls);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetClassInterfaces(JNIEnv *env, jclass cls);
-
-JNIEXPORT jobject JNICALL
-JVM_GetClassLoader(JNIEnv *env, jclass cls);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsInterface(JNIEnv *env, jclass cls);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetClassSigners(JNIEnv *env, jclass cls);
-
-JNIEXPORT void JNICALL
-JVM_SetClassSigners(JNIEnv *env, jclass cls, jobjectArray signers);
-
-JNIEXPORT jobject JNICALL
-JVM_GetProtectionDomain(JNIEnv *env, jclass cls);
-
-JNIEXPORT void JNICALL
-JVM_SetProtectionDomain(JNIEnv *env, jclass cls, jobject protection_domain);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsArrayClass(JNIEnv *env, jclass cls);
-
-JNIEXPORT jboolean JNICALL
-JVM_IsPrimitiveClass(JNIEnv *env, jclass cls);
-
-JNIEXPORT jclass JNICALL
-JVM_GetComponentType(JNIEnv *env, jclass cls);
-
-JNIEXPORT jint JNICALL
-JVM_GetClassModifiers(JNIEnv *env, jclass cls);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetDeclaredClasses(JNIEnv *env, jclass ofClass);
-
-JNIEXPORT jclass JNICALL
-JVM_GetDeclaringClass(JNIEnv *env, jclass ofClass);
-
-/* Generics support (JDK 1.5) */
-JNIEXPORT jstring JNICALL
-JVM_GetClassSignature(JNIEnv *env, jclass cls);
-
-/* Annotations support (JDK 1.5) */
-JNIEXPORT jbyteArray JNICALL
-JVM_GetClassAnnotations(JNIEnv *env, jclass cls);
-
-/*
- * New (JDK 1.4) reflection implementation
- */
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetClassDeclaredMethods(JNIEnv *env, jclass ofClass, jboolean publicOnly);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetClassDeclaredFields(JNIEnv *env, jclass ofClass, jboolean publicOnly);
-
-JNIEXPORT jobjectArray JNICALL
-JVM_GetClassDeclaredConstructors(JNIEnv *env, jclass ofClass, jboolean publicOnly);
-
-/* Differs from JVM_GetClassModifiers in treatment of inner classes.
-   This returns the access flags for the class as specified in the
-   class file rather than searching the InnerClasses attribute (if
-   present) to find the source-level access flags. Only the values of
-   the low 13 bits (i.e., a mask of 0x1FFF) are guaranteed to be
-   valid. */
-JNIEXPORT jint JNICALL
-JVM_GetClassAccessFlags(JNIEnv *env, jclass cls);
-
-/* The following two reflection routines are still needed due to startup time issues */
-/*
- * java.lang.reflect.Method
- */
-JNIEXPORT jobject JNICALL
-JVM_InvokeMethod(JNIEnv *env, jobject method, jobject obj, jobjectArray args0);
-
-/*
- * java.lang.reflect.Constructor
- */
-JNIEXPORT jobject JNICALL
-JVM_NewInstanceFromConstructor(JNIEnv *env, jobject c, jobjectArray args0);
-
-/*
- * Constant pool access; currently used to implement reflective access to annotations (JDK 1.5)
- */
-
-JNIEXPORT jobject JNICALL
-JVM_GetClassConstantPool(JNIEnv *env, jclass cls);
-
-JNIEXPORT jint JNICALL JVM_ConstantPoolGetSize
-(JNIEnv *env, jobject unused, jobject jcpool);
-
-JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jclass JNICALL JVM_ConstantPoolGetClassAtIfLoaded
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jobject JNICALL JVM_ConstantPoolGetMethodAtIfLoaded
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jobject JNICALL JVM_ConstantPoolGetFieldAtIfLoaded
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jobjectArray JNICALL JVM_ConstantPoolGetMemberRefInfoAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jint JNICALL JVM_ConstantPoolGetIntAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jlong JNICALL JVM_ConstantPoolGetLongAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jfloat JNICALL JVM_ConstantPoolGetFloatAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jdouble JNICALL JVM_ConstantPoolGetDoubleAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jstring JNICALL JVM_ConstantPoolGetStringAt
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-JNIEXPORT jstring JNICALL JVM_ConstantPoolGetUTF8At
-(JNIEnv *env, jobject unused, jobject jcpool, jint index);
-
-/*
- * java.security.*
- */
-
-JNIEXPORT jobject JNICALL
-JVM_DoPrivileged(JNIEnv *env, jclass cls,
-                 jobject action, jobject context, jboolean wrapException);
-
-JNIEXPORT jobject JNICALL
-JVM_GetInheritedAccessControlContext(JNIEnv *env, jclass cls);
-
-JNIEXPORT jobject JNICALL
-JVM_GetStackAccessControlContext(JNIEnv *env, jclass cls);
-
-/*
- * Signal support, used to implement the shutdown sequence.  Every VM must
- * support JVM_SIGINT and JVM_SIGTERM, raising the former for user interrupts
- * (^C) and the latter for external termination (kill, system shutdown, etc.).
- * Other platform-dependent signal values may also be supported.
- */
-
-JNIEXPORT void * JNICALL
-JVM_RegisterSignal(jint sig, void *handler);
-
-JNIEXPORT jboolean JNICALL
-JVM_RaiseSignal(jint sig);
-
-JNIEXPORT jint JNICALL
-JVM_FindSignal(const char *name);
-
-/*
- * Retrieve the assertion directives for the specified class.
- */
-JNIEXPORT jboolean JNICALL
-JVM_DesiredAssertionStatus(JNIEnv *env, jclass unused, jclass cls);
-
-/*
- * Retrieve the assertion directives from the VM.
- */
-JNIEXPORT jobject JNICALL
-JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused);
-
-/*
- * java.util.concurrent.AtomicLong
- */
-JNIEXPORT jboolean JNICALL
-JVM_SupportsCX8(void);
-
-/*
- * com.sun.dtrace.jsdt support
- */
-
-#define JVM_TRACING_DTRACE_VERSION 1
-
-/*
- * Structure to pass one probe description to JVM
- */
-typedef struct {
-    jmethodID method;
-    jstring   function;
-    jstring   name;
-    void*            reserved[4];     // for future use
-} JVM_DTraceProbe;
-
-/**
- * Encapsulates the stability ratings for a DTrace provider field
- */
-typedef struct {
-    jint nameStability;
-    jint dataStability;
-    jint dependencyClass;
-} JVM_DTraceInterfaceAttributes;
-
-/*
- * Structure to pass one provider description to JVM
- */
-typedef struct {
-    jstring                       name;
-    JVM_DTraceProbe*              probes;
-    jint                          probe_count;
-    JVM_DTraceInterfaceAttributes providerAttributes;
-    JVM_DTraceInterfaceAttributes moduleAttributes;
-    JVM_DTraceInterfaceAttributes functionAttributes;
-    JVM_DTraceInterfaceAttributes nameAttributes;
-    JVM_DTraceInterfaceAttributes argsAttributes;
-    void*                         reserved[4]; // for future use
-} JVM_DTraceProvider;
-
-/*
- * Get the version number the JVM was built with
- */
-JNIEXPORT jint JNICALL
-JVM_DTraceGetVersion(JNIEnv* env);
-
-/*
- * Register new probe with given signature, return global handle
- *
- * The version passed in is the version that the library code was
- * built with.
- */
-JNIEXPORT jlong JNICALL
-JVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name,
-  jint providers_count, JVM_DTraceProvider* providers);
-
-/*
- * Check JSDT probe
- */
-JNIEXPORT jboolean JNICALL
-JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method);
-
-/*
- * Destroy custom DOF
- */
-JNIEXPORT void JNICALL
-JVM_DTraceDispose(JNIEnv* env, jlong activation_handle);
-
-/*
- * Check to see if DTrace is supported by OS
- */
-JNIEXPORT jboolean JNICALL
-JVM_DTraceIsSupported(JNIEnv* env);
-
-/*************************************************************************
- PART 2: Support for the Verifier and Class File Format Checker
- ************************************************************************/
-/*
- * Return the class name in UTF format. The result is valid
- * until JVM_ReleaseUTf is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetClassNameUTF(JNIEnv *env, jclass cb);
-
-/*
- * Returns the constant pool types in the buffer provided by "types."
- */
-JNIEXPORT void JNICALL
-JVM_GetClassCPTypes(JNIEnv *env, jclass cb, unsigned char *types);
-
-/*
- * Returns the number of Constant Pool entries.
- */
-JNIEXPORT jint JNICALL
-JVM_GetClassCPEntriesCount(JNIEnv *env, jclass cb);
-
-/*
- * Returns the number of *declared* fields or methods.
- */
-JNIEXPORT jint JNICALL
-JVM_GetClassFieldsCount(JNIEnv *env, jclass cb);
-
-JNIEXPORT jint JNICALL
-JVM_GetClassMethodsCount(JNIEnv *env, jclass cb);
-
-/*
- * Returns the CP indexes of exceptions raised by a given method.
- * Places the result in the given buffer.
- *
- * The method is identified by method_index.
- */
-JNIEXPORT void JNICALL
-JVM_GetMethodIxExceptionIndexes(JNIEnv *env, jclass cb, jint method_index,
-                                unsigned short *exceptions);
-/*
- * Returns the number of exceptions raised by a given method.
- * The method is identified by method_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetMethodIxExceptionsCount(JNIEnv *env, jclass cb, jint method_index);
-
-/*
- * Returns the byte code sequence of a given method.
- * Places the result in the given buffer.
- *
- * The method is identified by method_index.
- */
-JNIEXPORT void JNICALL
-JVM_GetMethodIxByteCode(JNIEnv *env, jclass cb, jint method_index,
-                        unsigned char *code);
-
-/*
- * Returns the length of the byte code sequence of a given method.
- * The method is identified by method_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetMethodIxByteCodeLength(JNIEnv *env, jclass cb, jint method_index);
-
-/*
- * A structure used to a capture exception table entry in a Java method.
- */
-typedef struct {
-    jint start_pc;
-    jint end_pc;
-    jint handler_pc;
-    jint catchType;
-} JVM_ExceptionTableEntryType;
-
-/*
- * Returns the exception table entry at entry_index of a given method.
- * Places the result in the given buffer.
- *
- * The method is identified by method_index.
- */
-JNIEXPORT void JNICALL
-JVM_GetMethodIxExceptionTableEntry(JNIEnv *env, jclass cb, jint method_index,
-                                   jint entry_index,
-                                   JVM_ExceptionTableEntryType *entry);
-
-/*
- * Returns the length of the exception table of a given method.
- * The method is identified by method_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetMethodIxExceptionTableLength(JNIEnv *env, jclass cb, int index);
-
-/*
- * Returns the modifiers of a given field.
- * The field is identified by field_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetFieldIxModifiers(JNIEnv *env, jclass cb, int index);
-
-/*
- * Returns the modifiers of a given method.
- * The method is identified by method_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetMethodIxModifiers(JNIEnv *env, jclass cb, int index);
-
-/*
- * Returns the number of local variables of a given method.
- * The method is identified by method_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetMethodIxLocalsCount(JNIEnv *env, jclass cb, int index);
-
-/*
- * Returns the number of arguments (including this pointer) of a given method.
- * The method is identified by method_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetMethodIxArgsSize(JNIEnv *env, jclass cb, int index);
-
-/*
- * Returns the maximum amount of stack (in words) used by a given method.
- * The method is identified by method_index.
- */
-JNIEXPORT jint JNICALL
-JVM_GetMethodIxMaxStack(JNIEnv *env, jclass cb, int index);
-
-/*
- * Is a given method a constructor.
- * The method is identified by method_index.
- */
-JNIEXPORT jboolean JNICALL
-JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index);
-
-/*
- * Returns the name of a given method in UTF format.
- * The result remains valid until JVM_ReleaseUTF is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the signature of a given method in UTF format.
- * The result remains valid until JVM_ReleaseUTF is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetMethodIxSignatureUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the name of the field refered to at a given constant pool
- * index.
- *
- * The result is in UTF format and remains valid until JVM_ReleaseUTF
- * is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetCPFieldNameUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the name of the method refered to at a given constant pool
- * index.
- *
- * The result is in UTF format and remains valid until JVM_ReleaseUTF
- * is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetCPMethodNameUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the signature of the method refered to at a given constant pool
- * index.
- *
- * The result is in UTF format and remains valid until JVM_ReleaseUTF
- * is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetCPMethodSignatureUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the signature of the field refered to at a given constant pool
- * index.
- *
- * The result is in UTF format and remains valid until JVM_ReleaseUTF
- * is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetCPFieldSignatureUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the class name refered to at a given constant pool index.
- *
- * The result is in UTF format and remains valid until JVM_ReleaseUTF
- * is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetCPClassNameUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the class name refered to at a given constant pool index.
- *
- * The constant pool entry must refer to a CONSTANT_Fieldref.
- *
- * The result is in UTF format and remains valid until JVM_ReleaseUTF
- * is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetCPFieldClassNameUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the class name refered to at a given constant pool index.
- *
- * The constant pool entry must refer to CONSTANT_Methodref or
- * CONSTANT_InterfaceMethodref.
- *
- * The result is in UTF format and remains valid until JVM_ReleaseUTF
- * is called.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- */
-JNIEXPORT const char * JNICALL
-JVM_GetCPMethodClassNameUTF(JNIEnv *env, jclass cb, jint index);
-
-/*
- * Returns the modifiers of a field in calledClass. The field is
- * referred to in class cb at constant pool entry index.
- *
- * The caller must treat the string as a constant and not modify it
- * in any way.
- *
- * Returns -1 if the field does not exist in calledClass.
- */
-JNIEXPORT jint JNICALL
-JVM_GetCPFieldModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
-
-/*
- * Returns the modifiers of a method in calledClass. The method is
- * referred to in class cb at constant pool entry index.
- *
- * Returns -1 if the method does not exist in calledClass.
- */
-JNIEXPORT jint JNICALL
-JVM_GetCPMethodModifiers(JNIEnv *env, jclass cb, int index, jclass calledClass);
-
-/*
- * Releases the UTF string obtained from the VM.
- */
-JNIEXPORT void JNICALL
-JVM_ReleaseUTF(const char *utf);
-
-/*
- * Compare if two classes are in the same package.
- */
-JNIEXPORT jboolean JNICALL
-JVM_IsSameClassPackage(JNIEnv *env, jclass class1, jclass class2);
-
-/* Get classfile constants */
-#include "classfile_constants.h"
-
-/*
- * A function defined by the byte-code verifier and called by the VM.
- * This is not a function implemented in the VM.
- *
- * Returns JNI_FALSE if verification fails. A detailed error message
- * will be places in msg_buf, whose length is specified by buf_len.
- */
-typedef jboolean (*verifier_fn_t)(JNIEnv *env,
-                                  jclass cb,
-                                  char * msg_buf,
-                                  jint buf_len);
-
-
-/*
- * Support for a VM-independent class format checker.
- */
-typedef struct {
-    unsigned long code;    /* byte code */
-    unsigned long excs;    /* exceptions */
-    unsigned long etab;    /* catch table */
-    unsigned long lnum;    /* line number */
-    unsigned long lvar;    /* local vars */
-} method_size_info;
-
-typedef struct {
-    unsigned int constants;    /* constant pool */
-    unsigned int fields;
-    unsigned int methods;
-    unsigned int interfaces;
-    unsigned int fields2;      /* number of static 2-word fields */
-    unsigned int innerclasses; /* # of records in InnerClasses attr */
-
-    method_size_info clinit;   /* memory used in clinit */
-    method_size_info main;     /* used everywhere else */
-} class_size_info;
-
-/*
- * Functions defined in libjava.so to perform string conversions.
- *
- */
-
-typedef jstring (*to_java_string_fn_t)(JNIEnv *env, char *str);
-
-typedef char *(*to_c_string_fn_t)(JNIEnv *env, jstring s, jboolean *b);
-
-/* This is the function defined in libjava.so that performs class
- * format checks. This functions fills in size information about
- * the class file and returns:
- *
- *   0: good
- *  -1: out of memory
- *  -2: bad format
- *  -3: unsupported version
- *  -4: bad class name
- */
-
-typedef jint (*check_format_fn_t)(char *class_name,
-                                  unsigned char *data,
-                                  unsigned int data_size,
-                                  class_size_info *class_size,
-                                  char *message_buffer,
-                                  jint buffer_length,
-                                  jboolean measure_only,
-                                  jboolean check_relaxed);
-
-#define JVM_RECOGNIZED_CLASS_MODIFIERS (JVM_ACC_PUBLIC | \
-                                        JVM_ACC_FINAL | \
-                                        JVM_ACC_SUPER | \
-                                        JVM_ACC_INTERFACE | \
-                                        JVM_ACC_ABSTRACT | \
-                                        JVM_ACC_ANNOTATION | \
-                                        JVM_ACC_ENUM | \
-                                        JVM_ACC_SYNTHETIC)
-
-#define JVM_RECOGNIZED_FIELD_MODIFIERS (JVM_ACC_PUBLIC | \
-                                        JVM_ACC_PRIVATE | \
-                                        JVM_ACC_PROTECTED | \
-                                        JVM_ACC_STATIC | \
-                                        JVM_ACC_FINAL | \
-                                        JVM_ACC_VOLATILE | \
-                                        JVM_ACC_TRANSIENT | \
-                                        JVM_ACC_ENUM | \
-                                        JVM_ACC_SYNTHETIC)
-
-#define JVM_RECOGNIZED_METHOD_MODIFIERS (JVM_ACC_PUBLIC | \
-                                         JVM_ACC_PRIVATE | \
-                                         JVM_ACC_PROTECTED | \
-                                         JVM_ACC_STATIC | \
-                                         JVM_ACC_FINAL | \
-                                         JVM_ACC_SYNCHRONIZED | \
-                                         JVM_ACC_BRIDGE | \
-                                         JVM_ACC_VARARGS | \
-                                         JVM_ACC_NATIVE | \
-                                         JVM_ACC_ABSTRACT | \
-                                         JVM_ACC_STRICT | \
-                                         JVM_ACC_SYNTHETIC)
-
-/*
- * This is the function defined in libjava.so to perform path
- * canonicalization. VM call this function before opening jar files
- * to load system classes.
- *
- */
-
-typedef int (*canonicalize_fn_t)(JNIEnv *env, char *orig, char *out, int len);
-
-/*************************************************************************
- PART 3: I/O and Network Support
- ************************************************************************/
-
-/* Note that the JVM IO functions are expected to return JVM_IO_ERR
- * when there is any kind of error. The caller can then use the
- * platform specific support (e.g., errno) to get the detailed
- * error info.  The JVM_GetLastErrorString procedure may also be used
- * to obtain a descriptive error string.
- */
-#define JVM_IO_ERR  (-1)
-
-/* For interruptible IO. Returning JVM_IO_INTR indicates that an IO
- * operation has been disrupted by Thread.interrupt. There are a
- * number of technical difficulties related to interruptible IO that
- * need to be solved. For example, most existing programs do not handle
- * InterruptedIOExceptions specially, they simply treat those as any
- * IOExceptions, which typically indicate fatal errors.
- *
- * There are also two modes of operation for interruptible IO. In the
- * resumption mode, an interrupted IO operation is guaranteed not to
- * have any side-effects, and can be restarted. In the termination mode,
- * an interrupted IO operation corrupts the underlying IO stream, so
- * that the only reasonable operation on an interrupted stream is to
- * close that stream. The resumption mode seems to be impossible to
- * implement on Win32 and Solaris. Implementing the termination mode is
- * easier, but it's not clear that's the right semantics.
- *
- * Interruptible IO is not supported on Win32.It can be enabled/disabled
- * using a compile-time flag on Solaris. Third-party JVM ports do not
- * need to implement interruptible IO.
- */
-#define JVM_IO_INTR (-2)
-
-/* Write a string into the given buffer, in the platform's local encoding,
- * that describes the most recent system-level error to occur in this thread.
- * Return the length of the string or zero if no error occurred.
- */
-JNIEXPORT jint JNICALL
-JVM_GetLastErrorString(char *buf, int len);
-
-/*
- * Convert a pathname into native format.  This function does syntactic
- * cleanup, such as removing redundant separator characters.  It modifies
- * the given pathname string in place.
- */
-JNIEXPORT char * JNICALL
-JVM_NativePath(char *);
-
-/*
- * JVM I/O error codes
- */
-#define JVM_EEXIST       -100
-
-/*
- * Open a file descriptor. This function returns a negative error code
- * on error, and a non-negative integer that is the file descriptor on
- * success.
- */
-JNIEXPORT jint JNICALL
-JVM_Open(const char *fname, jint flags, jint mode);
-
-/*
- * Close a file descriptor. This function returns -1 on error, and 0
- * on success.
- *
- * fd        the file descriptor to close.
- */
-JNIEXPORT jint JNICALL
-JVM_Close(jint fd);
-
-/*
- * Read data from a file decriptor into a char array.
- *
- * fd        the file descriptor to read from.
- * buf       the buffer where to put the read data.
- * nbytes    the number of bytes to read.
- *
- * This function returns -1 on error, and 0 on success.
- */
-JNIEXPORT jint JNICALL
-JVM_Read(jint fd, char *buf, jint nbytes);
-
-/*
- * Write data from a char array to a file decriptor.
- *
- * fd        the file descriptor to read from.
- * buf       the buffer from which to fetch the data.
- * nbytes    the number of bytes to write.
- *
- * This function returns -1 on error, and 0 on success.
- */
-JNIEXPORT jint JNICALL
-JVM_Write(jint fd, char *buf, jint nbytes);
-
-/*
- * Move the file descriptor pointer from whence by offset.
- *
- * fd        the file descriptor to move.
- * offset    the number of bytes to move it by.
- * whence    the start from where to move it.
- *
- * This function returns the resulting pointer location.
- */
-JNIEXPORT jlong JNICALL
-JVM_Lseek(jint fd, jlong offset, jint whence);
-
-/*
- * Set the length of the file associated with the given descriptor to the given
- * length.  If the new length is longer than the current length then the file
- * is extended; the contents of the extended portion are not defined.  The
- * value of the file pointer is undefined after this procedure returns.
- */
-JNIEXPORT jint JNICALL
-JVM_SetLength(jint fd, jlong length);
-
-/*
- * Synchronize the file descriptor's in memory state with that of the
- * physical device.  Return of -1 is an error, 0 is OK.
- */
-JNIEXPORT jint JNICALL
-JVM_Sync(jint fd);
-
-/*
- * Networking library support
- */
-
-JNIEXPORT jint JNICALL
-JVM_InitializeSocketLibrary(void);
-
-struct sockaddr;
-
-JNIEXPORT jint JNICALL
-JVM_Socket(jint domain, jint type, jint protocol);
-
-JNIEXPORT jint JNICALL
-JVM_SocketClose(jint fd);
-
-JNIEXPORT jint JNICALL
-JVM_SocketShutdown(jint fd, jint howto);
-
-JNIEXPORT jint JNICALL
-JVM_Recv(jint fd, char *buf, jint nBytes, jint flags);
-
-JNIEXPORT jint JNICALL
-JVM_Send(jint fd, char *buf, jint nBytes, jint flags);
-
-JNIEXPORT jint JNICALL
-JVM_Timeout(int fd, long timeout);
-
-JNIEXPORT jint JNICALL
-JVM_Listen(jint fd, jint count);
-
-JNIEXPORT jint JNICALL
-JVM_Connect(jint fd, struct sockaddr *him, jint len);
-
-JNIEXPORT jint JNICALL
-JVM_Bind(jint fd, struct sockaddr *him, jint len);
-
-JNIEXPORT jint JNICALL
-JVM_Accept(jint fd, struct sockaddr *him, jint *len);
-
-JNIEXPORT jint JNICALL
-JVM_RecvFrom(jint fd, char *buf, int nBytes,
-                  int flags, struct sockaddr *from, int *fromlen);
-
-JNIEXPORT jint JNICALL
-JVM_SendTo(jint fd, char *buf, int len,
-                int flags, struct sockaddr *to, int tolen);
-
-JNIEXPORT jint JNICALL
-JVM_SocketAvailable(jint fd, jint *result);
-
-
-JNIEXPORT jint JNICALL
-JVM_GetSockName(jint fd, struct sockaddr *him, int *len);
-
-JNIEXPORT jint JNICALL
-JVM_GetSockOpt(jint fd, int level, int optname, char *optval, int *optlen);
-
-JNIEXPORT jint JNICALL
-JVM_SetSockOpt(jint fd, int level, int optname, const char *optval, int optlen);
-
-JNIEXPORT int JNICALL
-JVM_GetHostName(char* name, int namelen);
-
-/*
- * The standard printing functions supported by the Java VM. (Should they
- * be renamed to JVM_* in the future?
- */
-
-/*
- * BE CAREFUL! The following functions do not implement the
- * full feature set of standard C printf formats.
- */
-int
-jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args);
-
-int
-jio_snprintf(char *str, size_t count, const char *fmt, ...);
-
-int
-jio_fprintf(FILE *, const char *fmt, ...);
-
-int
-jio_vfprintf(FILE *, const char *fmt, va_list args);
-
-
-JNIEXPORT void * JNICALL
-JVM_RawMonitorCreate(void);
-
-JNIEXPORT void JNICALL
-JVM_RawMonitorDestroy(void *mon);
-
-JNIEXPORT jint JNICALL
-JVM_RawMonitorEnter(void *mon);
-
-JNIEXPORT void JNICALL
-JVM_RawMonitorExit(void *mon);
-
-/*
- * java.lang.management support
- */
-JNIEXPORT void* JNICALL
-JVM_GetManagement(jint version);
-
-/*
- * com.sun.tools.attach.VirtualMachine support
- *
- * Initialize the agent properties with the properties maintained in the VM.
- */
-JNIEXPORT jobject JNICALL
-JVM_InitAgentProperties(JNIEnv *env, jobject agent_props);
-
-/* Generics reflection support.
- *
- * Returns information about the given class's EnclosingMethod
- * attribute, if present, or null if the class had no enclosing
- * method.
- *
- * If non-null, the returned array contains three elements. Element 0
- * is the java.lang.Class of which the enclosing method is a member,
- * and elements 1 and 2 are the java.lang.Strings for the enclosing
- * method's name and descriptor, respectively.
- */
-JNIEXPORT jobjectArray JNICALL
-JVM_GetEnclosingMethodInfo(JNIEnv* env, jclass ofClass);
-
-/*
- * Java thread state support
- */
-enum {
-    JAVA_THREAD_STATE_NEW           = 0,
-    JAVA_THREAD_STATE_RUNNABLE      = 1,
-    JAVA_THREAD_STATE_BLOCKED       = 2,
-    JAVA_THREAD_STATE_WAITING       = 3,
-    JAVA_THREAD_STATE_TIMED_WAITING = 4,
-    JAVA_THREAD_STATE_TERMINATED    = 5,
-    JAVA_THREAD_STATE_COUNT         = 6
-};
-
-/*
- * Returns an array of the threadStatus values representing the
- * given Java thread state.  Returns NULL if the VM version is
- * incompatible with the JDK or doesn't support the given
- * Java thread state.
- */
-JNIEXPORT jintArray JNICALL
-JVM_GetThreadStateValues(JNIEnv* env, jint javaThreadState);
-
-/*
- * Returns an array of the substate names representing the
- * given Java thread state.  Returns NULL if the VM version is
- * incompatible with the JDK or the VM doesn't support
- * the given Java thread state.
- * values must be the jintArray returned from JVM_GetThreadStateValues
- * and javaThreadState.
- */
-JNIEXPORT jobjectArray JNICALL
-JVM_GetThreadStateNames(JNIEnv* env, jint javaThreadState, jintArray values);
-
-/* =========================================================================
- * The following defines a private JVM interface that the JDK can query
- * for the JVM version and capabilities.  sun.misc.Version defines
- * the methods for getting the VM version and its capabilities.
- *
- * When a new bit is added, the following should be updated to provide
- * access to the new capability:
- *    HS:   JVM_GetVersionInfo and Abstract_VM_Version class
- *    SDK:  Version class
- *
- * Similary, a private JDK interface JDK_GetVersionInfo0 is defined for
- * JVM to query for the JDK version and capabilities.
- *
- * When a new bit is added, the following should be updated to provide
- * access to the new capability:
- *    HS:   JDK_Version class
- *    SDK:  JDK_GetVersionInfo0
- *
- * ==========================================================================
- */
-typedef struct {
-    /* Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx */
-    unsigned int jvm_version;   /* Consists of major, minor, micro (n.n.n) */
-                                /* and build number (xx) */
-    unsigned int update_version : 8;         /* Update release version (uu) */
-    unsigned int special_update_version : 8; /* Special update release version (c)*/
-    unsigned int reserved1 : 16;
-    unsigned int reserved2;
-
-    /* The following bits represents JVM supports that JDK has dependency on.
-     * JDK can use these bits to determine which JVM version
-     * and support it has to maintain runtime compatibility.
-     *
-     * When a new bit is added in a minor or update release, make sure
-     * the new bit is also added in the main/baseline.
-     */
-    unsigned int is_attach_supported : 1;
-    unsigned int is_kernel_jvm : 1;
-    unsigned int : 30;
-    unsigned int : 32;
-    unsigned int : 32;
-} jvm_version_info;
-
-#define JVM_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)
-#define JVM_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)
-#define JVM_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)
-
-/* Build number is available only for RE builds.
- * It will be zero for internal builds.
- */
-#define JVM_VERSION_BUILD(version) ((version & 0x000000FF))
-
-JNIEXPORT void JNICALL
-JVM_GetVersionInfo(JNIEnv* env, jvm_version_info* info, size_t info_size);
-
-typedef struct {
-    // Naming convention of RE build version string: n.n.n[_uu[c]][-<identifier>]-bxx
-    unsigned int jdk_version;   /* Consists of major, minor, micro (n.n.n) */
-                                /* and build number (xx) */
-    unsigned int update_version : 8;         /* Update release version (uu) */
-    unsigned int special_update_version : 8; /* Special update release version (c)*/
-    unsigned int reserved1 : 16;
-    unsigned int reserved2;
-
-    /* The following bits represents new JDK supports that VM has dependency on.
-     * VM implementation can use these bits to determine which JDK version
-     * and support it has to maintain runtime compatibility.
-     *
-     * When a new bit is added in a minor or update release, make sure
-     * the new bit is also added in the main/baseline.
-     */
-    unsigned int thread_park_blocker : 1;
-    unsigned int post_vm_init_hook_enabled : 1;
-    unsigned int : 30;
-    unsigned int : 32;
-    unsigned int : 32;
-} jdk_version_info;
-
-#define JDK_VERSION_MAJOR(version) ((version & 0xFF000000) >> 24)
-#define JDK_VERSION_MINOR(version) ((version & 0x00FF0000) >> 16)
-#define JDK_VERSION_MICRO(version) ((version & 0x0000FF00) >> 8)
-
-/* Build number is available only for RE build (i.e. JDK_BUILD_NUMBER is set to bNN)
- * It will be zero for internal builds.
- */
-#define JDK_VERSION_BUILD(version) ((version & 0x000000FF))
-
-/*
- * This is the function JDK_GetVersionInfo0 defined in libjava.so
- * that is dynamically looked up by JVM.
- */
-typedef void (*jdk_version_info_fn_t)(jdk_version_info* info, size_t info_size);
-
-/*
- * This structure is used by the launcher to get the default thread
- * stack size from the VM using JNI_GetDefaultJavaVMInitArgs() with a
- * version of 1.1.  As it is not supported otherwise, it has been removed
- * from jni.h
- */
-typedef struct JDK1_1InitArgs {
-    jint version;
-
-    char **properties;
-    jint checkSource;
-    jint nativeStackSize;
-    jint javaStackSize;
-    jint minHeapSize;
-    jint maxHeapSize;
-    jint verifyMode;
-    char *classpath;
-
-    jint (JNICALL *vfprintf)(FILE *fp, const char *format, va_list args);
-    void (JNICALL *exit)(jint code);
-    void (JNICALL *abort)(void);
-
-    jint enableClassGC;
-    jint enableVerboseGC;
-    jint disableAsyncGC;
-    jint verbose;
-    jboolean debugging;
-    jint debugPort;
-} JDK1_1InitArgs;
-
-
-#ifdef __cplusplus
-} /* extern "C" */
-
-#endif /* __cplusplus */
-
-#endif /* !_JAVASOFT_JVM_H_ */
diff --git a/luni/src/main/native/java_lang_ProcessManager.cpp b/luni/src/main/native/java_lang_ProcessManager.cpp
index efa5e77..7d2079d 100644
--- a/luni/src/main/native/java_lang_ProcessManager.cpp
+++ b/luni/src/main/native/java_lang_ProcessManager.cpp
@@ -39,13 +39,6 @@
   // On Cygwin, Linux, and Solaris, the best way to close iterates over "/proc/self/fd/".
   const char* fd_path = "/proc/self/fd";
 
-  // Keep track of the system properties fd so we don't close it.
-  int properties_fd = -1;
-  char* properties_fd_string = getenv("ANDROID_PROPERTY_WORKSPACE");
-  if (properties_fd_string != NULL) {
-    properties_fd = atoi(properties_fd_string);
-  }
-
   DIR* d = opendir(fd_path);
   int dir_fd = dirfd(d);
   dirent* e;
@@ -53,7 +46,7 @@
     char* end;
     int fd = strtol(e->d_name, &end, 10);
     if (!*end) {
-      if (fd > STDERR_FILENO && fd != dir_fd && fd != status_pipe_fd && fd != properties_fd) {
+      if (fd > STDERR_FILENO && fd != dir_fd && fd != status_pipe_fd) {
         close(fd);
       }
     }
diff --git a/luni/src/test/java/libcore/java/net/URITest.java b/luni/src/test/java/libcore/java/net/URITest.java
index c87433a..9fcae92 100644
--- a/luni/src/test/java/libcore/java/net/URITest.java
+++ b/luni/src/test/java/libcore/java/net/URITest.java
@@ -713,5 +713,10 @@
         assertEquals("a_b.c.d.net", uri.getHost());
     }
 
+    // http://b/25991669
+    public void testHostWithLeadingPeriod() throws Exception {
+        assertEquals(".vk.com", new URI("https://.vk.com/").getHost());
+    }
+
     // Adding a new test? Consider adding an equivalent test to URLTest.java
 }
diff --git a/luni/src/test/java/libcore/java/nio/BufferTest.java b/luni/src/test/java/libcore/java/nio/BufferTest.java
index 860c071..7745db1 100644
--- a/luni/src/test/java/libcore/java/nio/BufferTest.java
+++ b/luni/src/test/java/libcore/java/nio/BufferTest.java
@@ -1261,4 +1261,42 @@
         }
     }
 
+    // b/26019694
+    public void testIndependentLimit() {
+        // Check if the limit parameter of original ByteBuffer
+        // is not affecting buffer created by its as*Buffer
+        testBuffersIndependentLimit(ByteBuffer.allocateDirect(16));
+        testBuffersIndependentLimit(ByteBuffer.allocate(16));
+    }
+
+    private void testBuffersIndependentLimit(ByteBuffer b) {
+        CharBuffer c = b.asCharBuffer();
+        b.limit(b.capacity()); c.put(1, (char)1);
+        b.limit(0);  c.put(1, (char)1);
+
+        b.limit(b.capacity());
+        ShortBuffer s = b.asShortBuffer();
+        b.limit(b.capacity()); s.put(1, (short)1);
+        b.limit(0);  s.put(1, (short)1);
+
+        b.limit(b.capacity());
+        IntBuffer i = b.asIntBuffer();
+        i.put(1, (int)1);
+        b.limit(0);  i.put(1, (int)1);
+
+        b.limit(b.capacity());
+        LongBuffer l = b.asLongBuffer();
+        l.put(1, (long)1);
+        b.limit(0);  l.put(1, (long)1);
+
+        b.limit(b.capacity());
+        FloatBuffer f = b.asFloatBuffer();
+        f.put(1, (float)1);
+        b.limit(0);  f.put(1, (float)1);
+
+        b.limit(b.capacity());
+        DoubleBuffer d = b.asDoubleBuffer();
+        d.put(1, (double)1);
+        b.limit(0);  d.put(1, (double)1);
+    }
 }
diff --git a/luni/src/test/java/libcore/java/security/SignatureTest.java b/luni/src/test/java/libcore/java/security/SignatureTest.java
index a353494..35712e0 100644
--- a/luni/src/test/java/libcore/java/security/SignatureTest.java
+++ b/luni/src/test/java/libcore/java/security/SignatureTest.java
@@ -29,7 +29,6 @@
 import java.security.KeyFactory;
 import java.security.KeyPair;
 import java.security.KeyPairGenerator;
-import java.security.MessageDigest;
 import java.security.PrivateKey;
 import java.security.Provider;
 import java.security.PublicKey;
@@ -45,6 +44,9 @@
 import java.security.spec.ECPublicKeySpec;
 import java.security.spec.EllipticCurve;
 import java.security.spec.InvalidKeySpecException;
+import java.security.spec.InvalidParameterSpecException;
+import java.security.spec.MGF1ParameterSpec;
+import java.security.spec.PSSParameterSpec;
 import java.security.spec.RSAPrivateCrtKeySpec;
 import java.security.spec.RSAPrivateKeySpec;
 import java.security.spec.RSAPublicKeySpec;
@@ -54,6 +56,7 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.Callable;
@@ -339,17 +342,20 @@
             = new HashMap<String, KeyPair>();
 
     private KeyPair keyPair(String sigAlgorithm, String providerName) throws Exception {
-        if (sigAlgorithm.endsWith("Encryption")) {
-            sigAlgorithm = sigAlgorithm.substring(0, sigAlgorithm.length()-"Encryption".length());
+        String sigAlgorithmUpperCase = sigAlgorithm.toUpperCase(Locale.US);
+        if (sigAlgorithmUpperCase.endsWith("ENCRYPTION")) {
+            sigAlgorithm = sigAlgorithm.substring(0, sigAlgorithm.length()-"ENCRYPTION".length());
+            sigAlgorithmUpperCase = sigAlgorithm.toUpperCase(Locale.US);
         }
 
         String kpAlgorithm;
         // note ECDSA must be before DSA
-        if (sigAlgorithm.endsWith("ECDSA")) {
+        if (sigAlgorithmUpperCase.endsWith("ECDSA")) {
             kpAlgorithm = "EC";
-        } else if (sigAlgorithm.endsWith("DSA")) {
+        } else if (sigAlgorithmUpperCase.endsWith("DSA")) {
             kpAlgorithm = "DSA";
-        } else if ((sigAlgorithm.endsWith("RSA")) || (sigAlgorithm.endsWith("RSA/PSS"))) {
+        } else if ((sigAlgorithmUpperCase.endsWith("RSA"))
+                || (sigAlgorithmUpperCase.endsWith("RSA/PSS"))) {
             kpAlgorithm = "RSA";
         } else {
             throw new Exception("Unknown KeyPair algorithm for Signature algorithm "
@@ -359,7 +365,7 @@
         KeyPair kp = keypairAlgorithmToInstance.get(kpAlgorithm);
         if (kp == null) {
             kp = KeyPairGenerator.getInstance(kpAlgorithm).generateKeyPair();
-            keypairAlgorithmToInstance.put(sigAlgorithm, kp);
+            keypairAlgorithmToInstance.put(kpAlgorithm, kp);
         }
         return kp;
     }
@@ -964,6 +970,116 @@
         (byte) 0x2A, (byte) 0x71, (byte) 0xC1, (byte) 0xBC, (byte) 0x1C, (byte) 0xFD,
         (byte) 0x75, (byte) 0x16, (byte) 0x6E, (byte) 0x85,
     };
+    private static final PSSParameterSpec SHA1withRSAPSS_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 20, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha1 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha1 -pkeyopt rsa_pss_saltlen:0 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA1withRSAPSS_NoSalt_Vector2Signature = new byte[] {
+        (byte) 0x31, (byte) 0x61, (byte) 0xA5, (byte) 0x47, (byte) 0x28, (byte) 0x44,
+        (byte) 0x48, (byte) 0x5A, (byte) 0xDA, (byte) 0x78, (byte) 0xA7, (byte) 0x85,
+        (byte) 0xE9, (byte) 0x64, (byte) 0x69, (byte) 0xCF, (byte) 0x14, (byte) 0x07,
+        (byte) 0x3F, (byte) 0xA8, (byte) 0xDB, (byte) 0xFC, (byte) 0xB7, (byte) 0x89,
+        (byte) 0x87, (byte) 0x74, (byte) 0xB9, (byte) 0x81, (byte) 0x37, (byte) 0x62,
+        (byte) 0xD1, (byte) 0x07, (byte) 0x0F, (byte) 0x3D, (byte) 0xDF, (byte) 0xA8,
+        (byte) 0x84, (byte) 0x38, (byte) 0x31, (byte) 0xEB, (byte) 0x17, (byte) 0x3F,
+        (byte) 0xE0, (byte) 0x28, (byte) 0x75, (byte) 0x1F, (byte) 0xE9, (byte) 0x4D,
+        (byte) 0xD3, (byte) 0x62, (byte) 0xFA, (byte) 0xCF, (byte) 0xCC, (byte) 0x2E,
+        (byte) 0xC7, (byte) 0x81, (byte) 0xE1, (byte) 0xEA, (byte) 0xEC, (byte) 0x78,
+        (byte) 0xFE, (byte) 0x19, (byte) 0x59, (byte) 0x54, (byte) 0x1D, (byte) 0x27,
+        (byte) 0xED, (byte) 0x0C, (byte) 0x54, (byte) 0xDF, (byte) 0xE3, (byte) 0x44,
+        (byte) 0x31, (byte) 0x21, (byte) 0x31, (byte) 0xA7, (byte) 0x23, (byte) 0xC4,
+        (byte) 0xE2, (byte) 0x69, (byte) 0x8A, (byte) 0xB3, (byte) 0x1A, (byte) 0x72,
+        (byte) 0x4F, (byte) 0x4E, (byte) 0x82, (byte) 0x86, (byte) 0x2D, (byte) 0x2B,
+        (byte) 0x85, (byte) 0xFE, (byte) 0x4A, (byte) 0x28, (byte) 0x90, (byte) 0xF7,
+        (byte) 0xDF, (byte) 0xD6, (byte) 0xB1, (byte) 0x3E, (byte) 0xC6, (byte) 0xFB,
+        (byte) 0x76, (byte) 0x7B, (byte) 0x3D, (byte) 0x12, (byte) 0x81, (byte) 0x6E,
+        (byte) 0xFD, (byte) 0x00, (byte) 0x7D, (byte) 0xD0, (byte) 0xDC, (byte) 0x25,
+        (byte) 0xD0, (byte) 0x86, (byte) 0x6C, (byte) 0xE8, (byte) 0x0F, (byte) 0x09,
+        (byte) 0x82, (byte) 0x74, (byte) 0x89, (byte) 0x79, (byte) 0x69, (byte) 0x73,
+        (byte) 0x37, (byte) 0x64, (byte) 0xEE, (byte) 0x53, (byte) 0x57, (byte) 0x20,
+        (byte) 0xFA, (byte) 0x0B, (byte) 0x4A, (byte) 0x5A, (byte) 0x4D, (byte) 0x33,
+        (byte) 0xAC, (byte) 0x8B, (byte) 0x04, (byte) 0xA5, (byte) 0x4A, (byte) 0x1A,
+        (byte) 0x9B, (byte) 0x66, (byte) 0xAA, (byte) 0x0B, (byte) 0x3D, (byte) 0x15,
+        (byte) 0xD9, (byte) 0x3E, (byte) 0x2F, (byte) 0xD2, (byte) 0xA1, (byte) 0x28,
+        (byte) 0x13, (byte) 0x59, (byte) 0x98, (byte) 0xC3, (byte) 0x45, (byte) 0x7C,
+        (byte) 0xEE, (byte) 0x60, (byte) 0xD0, (byte) 0xBD, (byte) 0x42, (byte) 0x16,
+        (byte) 0x84, (byte) 0x19, (byte) 0xF6, (byte) 0xD9, (byte) 0xF7, (byte) 0x7D,
+        (byte) 0x77, (byte) 0xAD, (byte) 0x60, (byte) 0xE2, (byte) 0xE3, (byte) 0x22,
+        (byte) 0xB9, (byte) 0xFA, (byte) 0xD5, (byte) 0xFA, (byte) 0x6E, (byte) 0x1F,
+        (byte) 0x69, (byte) 0x3F, (byte) 0xB1, (byte) 0xA7, (byte) 0x1A, (byte) 0x22,
+        (byte) 0xF7, (byte) 0x31, (byte) 0x97, (byte) 0x68, (byte) 0x62, (byte) 0x0F,
+        (byte) 0x39, (byte) 0xB0, (byte) 0xE7, (byte) 0x63, (byte) 0xAE, (byte) 0x65,
+        (byte) 0x69, (byte) 0xD0, (byte) 0xD3, (byte) 0x56, (byte) 0xC9, (byte) 0xA6,
+        (byte) 0xA4, (byte) 0xA5, (byte) 0xA4, (byte) 0x61, (byte) 0xA9, (byte) 0xC4,
+        (byte) 0x45, (byte) 0xCD, (byte) 0x49, (byte) 0x76, (byte) 0xC8, (byte) 0x53,
+        (byte) 0x46, (byte) 0xD0, (byte) 0x63, (byte) 0x35, (byte) 0x89, (byte) 0x04,
+        (byte) 0x22, (byte) 0xD7, (byte) 0xB6, (byte) 0x63, (byte) 0xAF, (byte) 0xC2,
+        (byte) 0x97, (byte) 0x10, (byte) 0xDF, (byte) 0xDE, (byte) 0xE6, (byte) 0x39,
+        (byte) 0x25, (byte) 0x2F, (byte) 0xEA, (byte) 0xD8, (byte) 0x56, (byte) 0x5A,
+        (byte) 0xC1, (byte) 0xB8, (byte) 0xCA, (byte) 0xC1, (byte) 0x8A, (byte) 0xB8,
+        (byte) 0x87, (byte) 0x2F, (byte) 0xCD, (byte) 0x21,
+    };
+    private static final PSSParameterSpec SHA1withRSAPSS_NoSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 0, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha1 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha1 -pkeyopt rsa_pss_saltlen:234 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA1withRSAPSS_MaxSalt_Vector2Signature = new byte[] {
+        (byte) 0x49, (byte) 0xDB, (byte) 0xAD, (byte) 0x48, (byte) 0x7C, (byte) 0x06,
+        (byte) 0x03, (byte) 0x7C, (byte) 0x58, (byte) 0xE1, (byte) 0x38, (byte) 0x20,
+        (byte) 0x46, (byte) 0x28, (byte) 0x60, (byte) 0x64, (byte) 0x94, (byte) 0x51,
+        (byte) 0xA3, (byte) 0xD1, (byte) 0xC9, (byte) 0x52, (byte) 0xC6, (byte) 0x2A,
+        (byte) 0xB3, (byte) 0xCC, (byte) 0xD6, (byte) 0x19, (byte) 0x50, (byte) 0x99,
+        (byte) 0x60, (byte) 0x58, (byte) 0xA2, (byte) 0x86, (byte) 0xA8, (byte) 0x74,
+        (byte) 0x50, (byte) 0x8C, (byte) 0x0E, (byte) 0x32, (byte) 0x58, (byte) 0x56,
+        (byte) 0x6D, (byte) 0x30, (byte) 0x38, (byte) 0xFB, (byte) 0x26, (byte) 0xC3,
+        (byte) 0xFD, (byte) 0x8E, (byte) 0x36, (byte) 0x73, (byte) 0x82, (byte) 0x9A,
+        (byte) 0xB4, (byte) 0xE5, (byte) 0x22, (byte) 0x96, (byte) 0x55, (byte) 0x3C,
+        (byte) 0x18, (byte) 0xD7, (byte) 0x46, (byte) 0xF1, (byte) 0x7C, (byte) 0xE6,
+        (byte) 0x8E, (byte) 0x0A, (byte) 0x18, (byte) 0xA7, (byte) 0x29, (byte) 0x96,
+        (byte) 0x8D, (byte) 0xFC, (byte) 0x0E, (byte) 0xBE, (byte) 0x91, (byte) 0xA0,
+        (byte) 0xF8, (byte) 0xE2, (byte) 0x70, (byte) 0x5A, (byte) 0xE3, (byte) 0x76,
+        (byte) 0xAC, (byte) 0x18, (byte) 0x10, (byte) 0xB4, (byte) 0xB1, (byte) 0xFF,
+        (byte) 0x58, (byte) 0xBC, (byte) 0x10, (byte) 0xF5, (byte) 0x88, (byte) 0x2F,
+        (byte) 0x0B, (byte) 0x10, (byte) 0x9D, (byte) 0x52, (byte) 0x2D, (byte) 0x42,
+        (byte) 0xDB, (byte) 0xFD, (byte) 0xA7, (byte) 0x23, (byte) 0x3C, (byte) 0x4B,
+        (byte) 0xB3, (byte) 0xD2, (byte) 0x96, (byte) 0x1B, (byte) 0xCE, (byte) 0xB3,
+        (byte) 0xA3, (byte) 0xC3, (byte) 0x42, (byte) 0xA4, (byte) 0x0E, (byte) 0x35,
+        (byte) 0x5C, (byte) 0xC2, (byte) 0x32, (byte) 0xC7, (byte) 0x8C, (byte) 0xFC,
+        (byte) 0x7F, (byte) 0xE0, (byte) 0xF7, (byte) 0x1D, (byte) 0x38, (byte) 0x21,
+        (byte) 0x3C, (byte) 0xDF, (byte) 0x82, (byte) 0x1A, (byte) 0xBD, (byte) 0x83,
+        (byte) 0xE9, (byte) 0x56, (byte) 0xF0, (byte) 0xF1, (byte) 0x54, (byte) 0x76,
+        (byte) 0xE3, (byte) 0xCE, (byte) 0x86, (byte) 0x69, (byte) 0xC2, (byte) 0x61,
+        (byte) 0x6D, (byte) 0x8E, (byte) 0xF5, (byte) 0xA3, (byte) 0x61, (byte) 0xCA,
+        (byte) 0x16, (byte) 0xCB, (byte) 0x7A, (byte) 0xF5, (byte) 0xBF, (byte) 0x36,
+        (byte) 0xCB, (byte) 0x7D, (byte) 0xB1, (byte) 0xE9, (byte) 0x70, (byte) 0x41,
+        (byte) 0xCF, (byte) 0x89, (byte) 0x51, (byte) 0x13, (byte) 0xCC, (byte) 0x95,
+        (byte) 0x50, (byte) 0xC8, (byte) 0xB6, (byte) 0x30, (byte) 0x35, (byte) 0xE3,
+        (byte) 0x13, (byte) 0x08, (byte) 0xF6, (byte) 0xBE, (byte) 0x20, (byte) 0xF1,
+        (byte) 0x48, (byte) 0x4D, (byte) 0x46, (byte) 0x95, (byte) 0xFE, (byte) 0x9E,
+        (byte) 0xD2, (byte) 0xD5, (byte) 0x29, (byte) 0x81, (byte) 0x2E, (byte) 0x0F,
+        (byte) 0x6F, (byte) 0xA7, (byte) 0x02, (byte) 0x15, (byte) 0xCA, (byte) 0x75,
+        (byte) 0x77, (byte) 0x29, (byte) 0x7C, (byte) 0x3A, (byte) 0xE3, (byte) 0x2B,
+        (byte) 0xD7, (byte) 0x3D, (byte) 0x5C, (byte) 0x94, (byte) 0x3B, (byte) 0x2A,
+        (byte) 0x91, (byte) 0xDB, (byte) 0xFA, (byte) 0x69, (byte) 0x47, (byte) 0x1C,
+        (byte) 0x2C, (byte) 0x46, (byte) 0x49, (byte) 0xE6, (byte) 0x37, (byte) 0x5D,
+        (byte) 0x78, (byte) 0x71, (byte) 0x76, (byte) 0xC1, (byte) 0xB6, (byte) 0x2E,
+        (byte) 0x4E, (byte) 0x3C, (byte) 0x83, (byte) 0x6F, (byte) 0x82, (byte) 0xC3,
+        (byte) 0xD8, (byte) 0x50, (byte) 0xD7, (byte) 0x1B, (byte) 0xAF, (byte) 0xF9,
+        (byte) 0xE3, (byte) 0xF1, (byte) 0x47, (byte) 0xC8, (byte) 0x12, (byte) 0x86,
+        (byte) 0x82, (byte) 0x9D, (byte) 0x3F, (byte) 0xCE,
+    };
+    private static final PSSParameterSpec SHA1withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-1", "MGF1", MGF1ParameterSpec.SHA1, 234, 1);
 
     /*
      * echo "This is a signed message from Kenny Root." | openssl sha224 -binary -out digest.bin \
@@ -1016,6 +1132,116 @@
         (byte) 0xE4, (byte) 0xB0, (byte) 0xAE, (byte) 0x82, (byte) 0x4E, (byte) 0xCA,
         (byte) 0xA6, (byte) 0x12, (byte) 0xCA, (byte) 0x70,
     };
+    private static final PSSParameterSpec SHA224withRSAPSS_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-224", "MGF1", new MGF1ParameterSpec("SHA-224"), 28, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha224 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha224 -pkeyopt rsa_pss_saltlen:0 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA224withRSAPSS_NoSalt_Vector2Signature = new byte[] {
+        (byte) 0xD8, (byte) 0x38, (byte) 0x48, (byte) 0xCD, (byte) 0xA4, (byte) 0x09,
+        (byte) 0x36, (byte) 0x35, (byte) 0x47, (byte) 0x55, (byte) 0xDB, (byte) 0x6C,
+        (byte) 0x2D, (byte) 0x83, (byte) 0x17, (byte) 0x10, (byte) 0x3E, (byte) 0xCE,
+        (byte) 0x95, (byte) 0x02, (byte) 0x58, (byte) 0xCE, (byte) 0xA8, (byte) 0x02,
+        (byte) 0x44, (byte) 0xB7, (byte) 0xE4, (byte) 0x32, (byte) 0x3D, (byte) 0x50,
+        (byte) 0xE1, (byte) 0x8C, (byte) 0xF3, (byte) 0x24, (byte) 0x6F, (byte) 0xA4,
+        (byte) 0x2D, (byte) 0xD7, (byte) 0xFB, (byte) 0x70, (byte) 0x97, (byte) 0xBE,
+        (byte) 0xED, (byte) 0x27, (byte) 0x2D, (byte) 0x22, (byte) 0xDC, (byte) 0x62,
+        (byte) 0x97, (byte) 0x66, (byte) 0x39, (byte) 0xE0, (byte) 0x36, (byte) 0x5F,
+        (byte) 0x07, (byte) 0x78, (byte) 0xAF, (byte) 0x5E, (byte) 0xDC, (byte) 0xFD,
+        (byte) 0x21, (byte) 0xA8, (byte) 0xD5, (byte) 0xA7, (byte) 0xD1, (byte) 0xBA,
+        (byte) 0x1C, (byte) 0xDA, (byte) 0xCA, (byte) 0x80, (byte) 0x72, (byte) 0x8A,
+        (byte) 0xDD, (byte) 0x5C, (byte) 0x16, (byte) 0x6A, (byte) 0x47, (byte) 0xFC,
+        (byte) 0x11, (byte) 0x42, (byte) 0x7E, (byte) 0x4E, (byte) 0x3F, (byte) 0x49,
+        (byte) 0xCF, (byte) 0x2F, (byte) 0x54, (byte) 0xD7, (byte) 0x13, (byte) 0x76,
+        (byte) 0x5D, (byte) 0xE9, (byte) 0x2A, (byte) 0x29, (byte) 0xCC, (byte) 0x73,
+        (byte) 0xDB, (byte) 0xE5, (byte) 0xDE, (byte) 0x48, (byte) 0xA2, (byte) 0xE9,
+        (byte) 0xD1, (byte) 0xD0, (byte) 0x35, (byte) 0xFE, (byte) 0xA1, (byte) 0x1C,
+        (byte) 0x13, (byte) 0x04, (byte) 0x75, (byte) 0x77, (byte) 0xF4, (byte) 0x55,
+        (byte) 0x03, (byte) 0xC4, (byte) 0x6D, (byte) 0xAC, (byte) 0x25, (byte) 0x1D,
+        (byte) 0x57, (byte) 0xFF, (byte) 0x0D, (byte) 0xE0, (byte) 0x91, (byte) 0xEA,
+        (byte) 0xF6, (byte) 0x1F, (byte) 0x3F, (byte) 0x69, (byte) 0xD6, (byte) 0x00,
+        (byte) 0xBD, (byte) 0x89, (byte) 0xEA, (byte) 0xD3, (byte) 0x31, (byte) 0x80,
+        (byte) 0x5E, (byte) 0x04, (byte) 0x4C, (byte) 0x59, (byte) 0xDE, (byte) 0xD0,
+        (byte) 0x62, (byte) 0x93, (byte) 0x3B, (byte) 0xC9, (byte) 0x9F, (byte) 0xE7,
+        (byte) 0x69, (byte) 0xC0, (byte) 0xB8, (byte) 0xED, (byte) 0xBF, (byte) 0x0D,
+        (byte) 0x60, (byte) 0x28, (byte) 0x55, (byte) 0x20, (byte) 0x0C, (byte) 0x9F,
+        (byte) 0xA2, (byte) 0x42, (byte) 0x34, (byte) 0x95, (byte) 0xAE, (byte) 0xF8,
+        (byte) 0x67, (byte) 0x7C, (byte) 0xF1, (byte) 0xA0, (byte) 0xC0, (byte) 0x74,
+        (byte) 0xF2, (byte) 0xDF, (byte) 0x75, (byte) 0x5B, (byte) 0x6E, (byte) 0x2F,
+        (byte) 0xFB, (byte) 0x1F, (byte) 0xDD, (byte) 0xC3, (byte) 0xD3, (byte) 0x90,
+        (byte) 0x0A, (byte) 0x33, (byte) 0xF6, (byte) 0x03, (byte) 0x16, (byte) 0xC4,
+        (byte) 0xF8, (byte) 0xED, (byte) 0xB7, (byte) 0x45, (byte) 0x39, (byte) 0x5D,
+        (byte) 0x7C, (byte) 0xF8, (byte) 0x82, (byte) 0xCE, (byte) 0x7D, (byte) 0xFB,
+        (byte) 0x02, (byte) 0x2D, (byte) 0xE0, (byte) 0x96, (byte) 0x35, (byte) 0x60,
+        (byte) 0x5D, (byte) 0xBC, (byte) 0x35, (byte) 0x80, (byte) 0x4C, (byte) 0x39,
+        (byte) 0x7C, (byte) 0xE7, (byte) 0xD4, (byte) 0xB4, (byte) 0x19, (byte) 0xD1,
+        (byte) 0xE5, (byte) 0x8E, (byte) 0x6D, (byte) 0x25, (byte) 0x0C, (byte) 0xB9,
+        (byte) 0x0C, (byte) 0x8D, (byte) 0x45, (byte) 0xE4, (byte) 0x67, (byte) 0x73,
+        (byte) 0xCF, (byte) 0x87, (byte) 0x7C, (byte) 0x78, (byte) 0xAA, (byte) 0xB9,
+        (byte) 0x42, (byte) 0xAE, (byte) 0x7F, (byte) 0xB8, (byte) 0xEC, (byte) 0x4F,
+        (byte) 0xD2, (byte) 0x85, (byte) 0x01, (byte) 0x80, (byte) 0x00, (byte) 0xBD,
+        (byte) 0xF5, (byte) 0xEA, (byte) 0x44, (byte) 0x6D,
+    };
+    private static final PSSParameterSpec SHA224withRSAPSS_NoSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-224", "MGF1", new MGF1ParameterSpec("SHA-224"), 0, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha224 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha224 -pkeyopt rsa_pss_saltlen:226 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA224withRSAPSS_MaxSalt_Vector2Signature = new byte[] {
+        (byte) 0x2C, (byte) 0x19, (byte) 0x5E, (byte) 0x63, (byte) 0xC5, (byte) 0x32,
+        (byte) 0xC3, (byte) 0xC7, (byte) 0x52, (byte) 0xE9, (byte) 0x69, (byte) 0x4C,
+        (byte) 0x04, (byte) 0xE5, (byte) 0x4A, (byte) 0xF2, (byte) 0x72, (byte) 0x78,
+        (byte) 0xBF, (byte) 0xC5, (byte) 0x8D, (byte) 0x5A, (byte) 0x71, (byte) 0xEF,
+        (byte) 0xA9, (byte) 0x58, (byte) 0x77, (byte) 0x94, (byte) 0x49, (byte) 0x71,
+        (byte) 0xBF, (byte) 0x45, (byte) 0x3E, (byte) 0xA4, (byte) 0x2E, (byte) 0x33,
+        (byte) 0x9B, (byte) 0x4E, (byte) 0xA4, (byte) 0x95, (byte) 0x07, (byte) 0x9C,
+        (byte) 0xAA, (byte) 0xC4, (byte) 0xA8, (byte) 0x60, (byte) 0xBC, (byte) 0xCD,
+        (byte) 0xC3, (byte) 0x45, (byte) 0xE6, (byte) 0xBC, (byte) 0xAD, (byte) 0xB6,
+        (byte) 0xF3, (byte) 0x0E, (byte) 0xF6, (byte) 0xD5, (byte) 0xCF, (byte) 0x33,
+        (byte) 0xA3, (byte) 0x82, (byte) 0x62, (byte) 0x52, (byte) 0x95, (byte) 0xA8,
+        (byte) 0x0E, (byte) 0xD4, (byte) 0xAC, (byte) 0x1F, (byte) 0x9A, (byte) 0xDC,
+        (byte) 0x00, (byte) 0xD6, (byte) 0x78, (byte) 0xEA, (byte) 0x53, (byte) 0x00,
+        (byte) 0x19, (byte) 0xE3, (byte) 0x81, (byte) 0x7C, (byte) 0x7A, (byte) 0x8E,
+        (byte) 0x30, (byte) 0x57, (byte) 0xB7, (byte) 0x81, (byte) 0xD7, (byte) 0x4D,
+        (byte) 0x1D, (byte) 0xCB, (byte) 0x99, (byte) 0x8D, (byte) 0xE4, (byte) 0xFA,
+        (byte) 0x6E, (byte) 0x4E, (byte) 0xA6, (byte) 0xDA, (byte) 0x13, (byte) 0x92,
+        (byte) 0x31, (byte) 0x7C, (byte) 0x2B, (byte) 0x3A, (byte) 0xA0, (byte) 0xF1,
+        (byte) 0x03, (byte) 0x83, (byte) 0x12, (byte) 0xD1, (byte) 0x23, (byte) 0xED,
+        (byte) 0xC4, (byte) 0x01, (byte) 0x57, (byte) 0x63, (byte) 0xAF, (byte) 0x40,
+        (byte) 0x15, (byte) 0xEC, (byte) 0xB8, (byte) 0x5A, (byte) 0xCE, (byte) 0x3D,
+        (byte) 0x3E, (byte) 0xCD, (byte) 0xD8, (byte) 0xF3, (byte) 0x76, (byte) 0xCA,
+        (byte) 0x23, (byte) 0x20, (byte) 0x68, (byte) 0x17, (byte) 0x5B, (byte) 0x7F,
+        (byte) 0xBC, (byte) 0x22, (byte) 0x67, (byte) 0x2A, (byte) 0x91, (byte) 0x05,
+        (byte) 0xB3, (byte) 0x85, (byte) 0x60, (byte) 0xD8, (byte) 0x76, (byte) 0xD5,
+        (byte) 0x2B, (byte) 0x9C, (byte) 0x80, (byte) 0xB6, (byte) 0xEA, (byte) 0x1E,
+        (byte) 0x05, (byte) 0xC7, (byte) 0x95, (byte) 0x2C, (byte) 0x4F, (byte) 0x14,
+        (byte) 0x5F, (byte) 0xEE, (byte) 0x08, (byte) 0x32, (byte) 0xF7, (byte) 0x12,
+        (byte) 0x2B, (byte) 0xCD, (byte) 0xF3, (byte) 0x83, (byte) 0x7C, (byte) 0xCE,
+        (byte) 0x04, (byte) 0x8A, (byte) 0x36, (byte) 0x3D, (byte) 0xB2, (byte) 0x97,
+        (byte) 0x15, (byte) 0xDB, (byte) 0xD6, (byte) 0xFA, (byte) 0x53, (byte) 0x29,
+        (byte) 0xD1, (byte) 0x43, (byte) 0x55, (byte) 0xDD, (byte) 0xAE, (byte) 0xA7,
+        (byte) 0xB4, (byte) 0x2C, (byte) 0xD9, (byte) 0xA7, (byte) 0x74, (byte) 0xA8,
+        (byte) 0x08, (byte) 0xD6, (byte) 0xC2, (byte) 0x05, (byte) 0xBF, (byte) 0x67,
+        (byte) 0x3B, (byte) 0xBA, (byte) 0x8D, (byte) 0x99, (byte) 0xC1, (byte) 0x14,
+        (byte) 0x1A, (byte) 0x32, (byte) 0xCA, (byte) 0xD5, (byte) 0xCC, (byte) 0xF9,
+        (byte) 0x64, (byte) 0x07, (byte) 0x5B, (byte) 0xB8, (byte) 0xA9, (byte) 0x69,
+        (byte) 0xED, (byte) 0x01, (byte) 0xCD, (byte) 0xD2, (byte) 0x88, (byte) 0x67,
+        (byte) 0xFF, (byte) 0x92, (byte) 0xA3, (byte) 0xC6, (byte) 0x97, (byte) 0x97,
+        (byte) 0xA1, (byte) 0xC5, (byte) 0x15, (byte) 0xC8, (byte) 0xB6, (byte) 0xFE,
+        (byte) 0x4A, (byte) 0x07, (byte) 0x2E, (byte) 0x46, (byte) 0x3F, (byte) 0x27,
+        (byte) 0xB8, (byte) 0xEE, (byte) 0x69, (byte) 0xCB, (byte) 0xDC, (byte) 0x30,
+        (byte) 0x19, (byte) 0x77, (byte) 0xC5, (byte) 0xEF,
+    };
+    private static final PSSParameterSpec SHA224withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-224", "MGF1", new MGF1ParameterSpec("SHA-224"), 226, 1);
 
     /*
      * echo "This is a signed message from Kenny Root." | openssl sha256 -binary -out digest.bin \
@@ -1068,6 +1294,116 @@
         (byte) 0x7F, (byte) 0x9B, (byte) 0xA9, (byte) 0xD3, (byte) 0xBB, (byte) 0xFC,
         (byte) 0xAC, (byte) 0xC9, (byte) 0x31, (byte) 0xB6,
     };
+    private static final PSSParameterSpec SHA256withRSAPSS_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, 32, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha256 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha256 -pkeyopt rsa_pss_saltlen:0 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA256withRSAPSS_NoSalt_Vector2Signature = new byte[] {
+        (byte) 0x4C, (byte) 0xB7, (byte) 0x33, (byte) 0x78, (byte) 0x0A, (byte) 0xA7,
+        (byte) 0xEB, (byte) 0x35, (byte) 0x5E, (byte) 0x99, (byte) 0x8F, (byte) 0xE9,
+        (byte) 0x2A, (byte) 0x3D, (byte) 0x8C, (byte) 0x9B, (byte) 0x19, (byte) 0xC7,
+        (byte) 0xC8, (byte) 0xB8, (byte) 0x10, (byte) 0xC5, (byte) 0x6D, (byte) 0xA4,
+        (byte) 0x44, (byte) 0x3E, (byte) 0xAB, (byte) 0x90, (byte) 0x82, (byte) 0x70,
+        (byte) 0xFA, (byte) 0x7B, (byte) 0xE6, (byte) 0x06, (byte) 0x36, (byte) 0x06,
+        (byte) 0x93, (byte) 0x54, (byte) 0x50, (byte) 0xCD, (byte) 0x5F, (byte) 0xAA,
+        (byte) 0x01, (byte) 0x42, (byte) 0xAD, (byte) 0xB9, (byte) 0x02, (byte) 0x6E,
+        (byte) 0xAE, (byte) 0x60, (byte) 0x00, (byte) 0x60, (byte) 0x55, (byte) 0x1B,
+        (byte) 0xBB, (byte) 0x9E, (byte) 0x03, (byte) 0xB7, (byte) 0x86, (byte) 0x3D,
+        (byte) 0xCC, (byte) 0xFA, (byte) 0x6E, (byte) 0x20, (byte) 0x07, (byte) 0x61,
+        (byte) 0x8F, (byte) 0x53, (byte) 0xC6, (byte) 0x2B, (byte) 0xEF, (byte) 0x8F,
+        (byte) 0x0F, (byte) 0x8B, (byte) 0x80, (byte) 0x22, (byte) 0xDC, (byte) 0x9E,
+        (byte) 0x20, (byte) 0x4A, (byte) 0x57, (byte) 0xA1, (byte) 0x15, (byte) 0xE0,
+        (byte) 0x01, (byte) 0x95, (byte) 0xDB, (byte) 0x46, (byte) 0x85, (byte) 0x6D,
+        (byte) 0x27, (byte) 0x9F, (byte) 0x44, (byte) 0x3B, (byte) 0xB1, (byte) 0x35,
+        (byte) 0x04, (byte) 0x9D, (byte) 0xF8, (byte) 0xC6, (byte) 0xD7, (byte) 0xD7,
+        (byte) 0xEF, (byte) 0x9A, (byte) 0x53, (byte) 0x5A, (byte) 0x73, (byte) 0xB3,
+        (byte) 0xD0, (byte) 0x32, (byte) 0x39, (byte) 0xE1, (byte) 0x28, (byte) 0x3A,
+        (byte) 0x9D, (byte) 0x69, (byte) 0x4E, (byte) 0x57, (byte) 0xC1, (byte) 0xDF,
+        (byte) 0xFE, (byte) 0x5F, (byte) 0xA8, (byte) 0xFF, (byte) 0xE8, (byte) 0x75,
+        (byte) 0x85, (byte) 0x33, (byte) 0x90, (byte) 0x83, (byte) 0x3D, (byte) 0x8F,
+        (byte) 0x15, (byte) 0x47, (byte) 0x16, (byte) 0xF2, (byte) 0x32, (byte) 0xF9,
+        (byte) 0x46, (byte) 0x96, (byte) 0xCC, (byte) 0x2E, (byte) 0x8F, (byte) 0x27,
+        (byte) 0x3F, (byte) 0xCF, (byte) 0x91, (byte) 0xA6, (byte) 0x9E, (byte) 0xBF,
+        (byte) 0x42, (byte) 0x2F, (byte) 0xD6, (byte) 0x52, (byte) 0xD7, (byte) 0x3B,
+        (byte) 0xCD, (byte) 0xFE, (byte) 0x0B, (byte) 0x4A, (byte) 0x3B, (byte) 0x19,
+        (byte) 0x57, (byte) 0x47, (byte) 0x65, (byte) 0x33, (byte) 0xD9, (byte) 0xF7,
+        (byte) 0xE4, (byte) 0xC3, (byte) 0x05, (byte) 0x49, (byte) 0x3C, (byte) 0xC0,
+        (byte) 0xDF, (byte) 0xC1, (byte) 0x54, (byte) 0x18, (byte) 0x8D, (byte) 0xDA,
+        (byte) 0xE4, (byte) 0x59, (byte) 0xE9, (byte) 0x3B, (byte) 0xD6, (byte) 0x89,
+        (byte) 0x07, (byte) 0x99, (byte) 0xB0, (byte) 0xF4, (byte) 0x09, (byte) 0x0A,
+        (byte) 0x2C, (byte) 0xBA, (byte) 0x0B, (byte) 0xE4, (byte) 0x79, (byte) 0xB1,
+        (byte) 0xDB, (byte) 0xAD, (byte) 0xAB, (byte) 0x5D, (byte) 0xA2, (byte) 0x1E,
+        (byte) 0x76, (byte) 0x7F, (byte) 0x74, (byte) 0x62, (byte) 0x49, (byte) 0x07,
+        (byte) 0x7A, (byte) 0x5B, (byte) 0xD7, (byte) 0x0F, (byte) 0xA4, (byte) 0x2C,
+        (byte) 0x36, (byte) 0x13, (byte) 0x42, (byte) 0xBA, (byte) 0xCF, (byte) 0x0A,
+        (byte) 0xFC, (byte) 0xC3, (byte) 0x31, (byte) 0x5E, (byte) 0x06, (byte) 0x84,
+        (byte) 0x8A, (byte) 0x8A, (byte) 0x84, (byte) 0x0D, (byte) 0x48, (byte) 0xBD,
+        (byte) 0x67, (byte) 0xCF, (byte) 0x04, (byte) 0xB4, (byte) 0xFB, (byte) 0xBB,
+        (byte) 0x04, (byte) 0x91, (byte) 0xB1, (byte) 0x0A, (byte) 0xA4, (byte) 0x70,
+        (byte) 0x58, (byte) 0x1A, (byte) 0x9B, (byte) 0x02, (byte) 0x86, (byte) 0xBD,
+        (byte) 0xAE, (byte) 0x77, (byte) 0x97, (byte) 0x1C,
+    };
+    private static final PSSParameterSpec SHA256withRSAPSS_NoSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, 0, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha256 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha256 -pkeyopt rsa_pss_saltlen:222 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA256withRSAPSS_MaxSalt_Vector2Signature = new byte[] {
+        (byte) 0x3B, (byte) 0x43, (byte) 0xA8, (byte) 0xB5, (byte) 0x34, (byte) 0xD8,
+        (byte) 0xF9, (byte) 0xAD, (byte) 0xDD, (byte) 0x1F, (byte) 0x7A, (byte) 0x73,
+        (byte) 0xBF, (byte) 0xFA, (byte) 0xED, (byte) 0x10, (byte) 0xF3, (byte) 0x16,
+        (byte) 0xCC, (byte) 0xE5, (byte) 0x09, (byte) 0x0F, (byte) 0x68, (byte) 0x02,
+        (byte) 0xE7, (byte) 0x55, (byte) 0x0D, (byte) 0xCF, (byte) 0x1B, (byte) 0x83,
+        (byte) 0xCD, (byte) 0xA2, (byte) 0xD6, (byte) 0x02, (byte) 0xDD, (byte) 0x72,
+        (byte) 0xA6, (byte) 0x5F, (byte) 0x05, (byte) 0x8A, (byte) 0x1E, (byte) 0xA1,
+        (byte) 0x4F, (byte) 0x92, (byte) 0xD9, (byte) 0x09, (byte) 0x19, (byte) 0x6E,
+        (byte) 0x80, (byte) 0xA0, (byte) 0x47, (byte) 0x98, (byte) 0x5C, (byte) 0xF7,
+        (byte) 0x34, (byte) 0x52, (byte) 0x7D, (byte) 0x85, (byte) 0xCF, (byte) 0x9F,
+        (byte) 0xEB, (byte) 0xAF, (byte) 0xB4, (byte) 0x53, (byte) 0xF0, (byte) 0x5D,
+        (byte) 0x28, (byte) 0x87, (byte) 0xAC, (byte) 0xA7, (byte) 0xB4, (byte) 0xCF,
+        (byte) 0xDD, (byte) 0x8B, (byte) 0xA4, (byte) 0xC9, (byte) 0xCA, (byte) 0xAA,
+        (byte) 0xF4, (byte) 0xA8, (byte) 0x25, (byte) 0x26, (byte) 0x34, (byte) 0x11,
+        (byte) 0x14, (byte) 0x24, (byte) 0x1C, (byte) 0x1C, (byte) 0x50, (byte) 0xC8,
+        (byte) 0xFF, (byte) 0x7E, (byte) 0xFF, (byte) 0x6F, (byte) 0x4F, (byte) 0x14,
+        (byte) 0xB3, (byte) 0x57, (byte) 0x48, (byte) 0x0A, (byte) 0x5A, (byte) 0x95,
+        (byte) 0x5D, (byte) 0xEB, (byte) 0x71, (byte) 0x4E, (byte) 0x86, (byte) 0xFC,
+        (byte) 0x38, (byte) 0x1B, (byte) 0x93, (byte) 0x45, (byte) 0x09, (byte) 0x15,
+        (byte) 0xD3, (byte) 0x06, (byte) 0x6B, (byte) 0x9D, (byte) 0x05, (byte) 0x5C,
+        (byte) 0x4A, (byte) 0xB3, (byte) 0x93, (byte) 0xD1, (byte) 0x01, (byte) 0x54,
+        (byte) 0xCC, (byte) 0xED, (byte) 0xBF, (byte) 0x0E, (byte) 0x7E, (byte) 0x33,
+        (byte) 0x32, (byte) 0xA6, (byte) 0xA5, (byte) 0xF7, (byte) 0x3D, (byte) 0x2E,
+        (byte) 0xCB, (byte) 0x76, (byte) 0xA7, (byte) 0x22, (byte) 0x64, (byte) 0xB8,
+        (byte) 0x19, (byte) 0x53, (byte) 0xFE, (byte) 0x8C, (byte) 0xC8, (byte) 0x1E,
+        (byte) 0x6C, (byte) 0xEE, (byte) 0x08, (byte) 0x07, (byte) 0x7E, (byte) 0x93,
+        (byte) 0x43, (byte) 0x1B, (byte) 0xCF, (byte) 0x37, (byte) 0xE4, (byte) 0xAB,
+        (byte) 0xE7, (byte) 0xD7, (byte) 0x83, (byte) 0x8E, (byte) 0x19, (byte) 0xAE,
+        (byte) 0x05, (byte) 0x51, (byte) 0x91, (byte) 0x10, (byte) 0x7B, (byte) 0x70,
+        (byte) 0xFC, (byte) 0x73, (byte) 0x12, (byte) 0x96, (byte) 0xFA, (byte) 0xD0,
+        (byte) 0xCA, (byte) 0xA3, (byte) 0x59, (byte) 0xA7, (byte) 0xDD, (byte) 0xC3,
+        (byte) 0x1D, (byte) 0x9C, (byte) 0x7B, (byte) 0x50, (byte) 0xBB, (byte) 0x57,
+        (byte) 0xB8, (byte) 0x86, (byte) 0xF2, (byte) 0xCA, (byte) 0xC4, (byte) 0x86,
+        (byte) 0x7A, (byte) 0x96, (byte) 0x90, (byte) 0x02, (byte) 0xDF, (byte) 0xA0,
+        (byte) 0x88, (byte) 0x0E, (byte) 0x89, (byte) 0x45, (byte) 0x27, (byte) 0x52,
+        (byte) 0xDA, (byte) 0x86, (byte) 0x42, (byte) 0x4B, (byte) 0x90, (byte) 0xC3,
+        (byte) 0xC1, (byte) 0x41, (byte) 0x60, (byte) 0x5C, (byte) 0x29, (byte) 0x15,
+        (byte) 0xE5, (byte) 0x5C, (byte) 0x43, (byte) 0x9B, (byte) 0x40, (byte) 0xE5,
+        (byte) 0x04, (byte) 0x1B, (byte) 0x4A, (byte) 0x93, (byte) 0xDD, (byte) 0x55,
+        (byte) 0xC4, (byte) 0xFC, (byte) 0xFE, (byte) 0x0C, (byte) 0x65, (byte) 0x96,
+        (byte) 0x98, (byte) 0xDE, (byte) 0xC5, (byte) 0x05, (byte) 0xC5, (byte) 0x3E,
+        (byte) 0xB0, (byte) 0x25, (byte) 0x4E, (byte) 0x65, (byte) 0x24, (byte) 0x8D,
+        (byte) 0x4E, (byte) 0x9D, (byte) 0x94, (byte) 0x01,
+    };
+    private static final PSSParameterSpec SHA256withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA256, 222, 1);
 
     /*
      * echo "This is a signed message from Kenny Root." | openssl sha384 -binary -out digest.bin \
@@ -1120,6 +1456,116 @@
         (byte) 0x9A, (byte) 0x06, (byte) 0x6D, (byte) 0x22, (byte) 0x81, (byte) 0xB5,
         (byte) 0x63, (byte) 0xAE, (byte) 0x4A, (byte) 0xEE,
     };
+    private static final PSSParameterSpec SHA384withRSAPSS_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-384", "MGF1", MGF1ParameterSpec.SHA384, 48, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha384 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha384 -pkeyopt rsa_pss_saltlen:0 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA384withRSAPSS_NoSalt_Vector2Signature = new byte[] {
+        (byte) 0x41, (byte) 0x0C, (byte) 0x3A, (byte) 0xEC, (byte) 0xF6, (byte) 0xD9,
+        (byte) 0x8F, (byte) 0xA3, (byte) 0x61, (byte) 0xBB, (byte) 0x03, (byte) 0xED,
+        (byte) 0xD9, (byte) 0x69, (byte) 0x7D, (byte) 0xE1, (byte) 0xE1, (byte) 0x4E,
+        (byte) 0x5E, (byte) 0x71, (byte) 0x4E, (byte) 0x88, (byte) 0x9C, (byte) 0x79,
+        (byte) 0xD3, (byte) 0x71, (byte) 0x28, (byte) 0x07, (byte) 0x28, (byte) 0x19,
+        (byte) 0x96, (byte) 0x55, (byte) 0x30, (byte) 0x81, (byte) 0x29, (byte) 0x5C,
+        (byte) 0x4A, (byte) 0x18, (byte) 0x69, (byte) 0x36, (byte) 0x74, (byte) 0xAC,
+        (byte) 0x99, (byte) 0xB1, (byte) 0xBC, (byte) 0xA0, (byte) 0xFC, (byte) 0x17,
+        (byte) 0xA4, (byte) 0xD1, (byte) 0xAE, (byte) 0x84, (byte) 0xA6, (byte) 0x09,
+        (byte) 0x6B, (byte) 0xB3, (byte) 0x02, (byte) 0xB2, (byte) 0x81, (byte) 0x04,
+        (byte) 0x59, (byte) 0x8C, (byte) 0xCF, (byte) 0xAD, (byte) 0xFB, (byte) 0x76,
+        (byte) 0x6F, (byte) 0xE2, (byte) 0x5E, (byte) 0x09, (byte) 0xE5, (byte) 0xBC,
+        (byte) 0x54, (byte) 0xBD, (byte) 0x08, (byte) 0xA8, (byte) 0x18, (byte) 0x60,
+        (byte) 0xAF, (byte) 0x09, (byte) 0x67, (byte) 0x15, (byte) 0x03, (byte) 0xA8,
+        (byte) 0x8B, (byte) 0x3F, (byte) 0x31, (byte) 0xB7, (byte) 0x76, (byte) 0xFD,
+        (byte) 0xF6, (byte) 0x82, (byte) 0xC7, (byte) 0x89, (byte) 0xC2, (byte) 0x47,
+        (byte) 0x80, (byte) 0x06, (byte) 0x4F, (byte) 0x8C, (byte) 0x9C, (byte) 0xD7,
+        (byte) 0x4F, (byte) 0x63, (byte) 0x1E, (byte) 0xF0, (byte) 0x34, (byte) 0xD7,
+        (byte) 0x91, (byte) 0xD2, (byte) 0x96, (byte) 0x62, (byte) 0xFD, (byte) 0x68,
+        (byte) 0xE3, (byte) 0xE0, (byte) 0xFB, (byte) 0x7D, (byte) 0x0A, (byte) 0xD7,
+        (byte) 0x52, (byte) 0xFE, (byte) 0xD1, (byte) 0x95, (byte) 0x9E, (byte) 0xD2,
+        (byte) 0x84, (byte) 0xBE, (byte) 0x3D, (byte) 0x1F, (byte) 0x8C, (byte) 0xC4,
+        (byte) 0xD6, (byte) 0xE3, (byte) 0xCF, (byte) 0xE8, (byte) 0xB3, (byte) 0x82,
+        (byte) 0x2E, (byte) 0xFA, (byte) 0x39, (byte) 0xA3, (byte) 0x20, (byte) 0x3C,
+        (byte) 0xBE, (byte) 0x6A, (byte) 0xFA, (byte) 0x04, (byte) 0xD2, (byte) 0x74,
+        (byte) 0x41, (byte) 0xDC, (byte) 0xE8, (byte) 0x0E, (byte) 0xE7, (byte) 0xF2,
+        (byte) 0x36, (byte) 0xD4, (byte) 0x2E, (byte) 0x6A, (byte) 0xCF, (byte) 0xDF,
+        (byte) 0x8B, (byte) 0x4B, (byte) 0x77, (byte) 0xE8, (byte) 0x0A, (byte) 0x64,
+        (byte) 0x86, (byte) 0x2C, (byte) 0xCA, (byte) 0x92, (byte) 0x01, (byte) 0xB2,
+        (byte) 0x8A, (byte) 0xB8, (byte) 0xB2, (byte) 0x6C, (byte) 0x0B, (byte) 0x18,
+        (byte) 0x90, (byte) 0x31, (byte) 0x93, (byte) 0x29, (byte) 0xBA, (byte) 0xB1,
+        (byte) 0x88, (byte) 0x94, (byte) 0x44, (byte) 0x0B, (byte) 0x38, (byte) 0x64,
+        (byte) 0xC1, (byte) 0xDE, (byte) 0x0B, (byte) 0xD8, (byte) 0xE4, (byte) 0xBA,
+        (byte) 0x0A, (byte) 0x41, (byte) 0x24, (byte) 0x35, (byte) 0xAA, (byte) 0xE3,
+        (byte) 0x59, (byte) 0x8E, (byte) 0x57, (byte) 0x51, (byte) 0x43, (byte) 0xE1,
+        (byte) 0x9C, (byte) 0xF6, (byte) 0xF8, (byte) 0x16, (byte) 0x68, (byte) 0x83,
+        (byte) 0x08, (byte) 0x8C, (byte) 0x2D, (byte) 0x40, (byte) 0xD2, (byte) 0xEF,
+        (byte) 0xD6, (byte) 0xAE, (byte) 0x98, (byte) 0x77, (byte) 0xE8, (byte) 0xF2,
+        (byte) 0xC7, (byte) 0x19, (byte) 0x61, (byte) 0xD6, (byte) 0x43, (byte) 0xCD,
+        (byte) 0x76, (byte) 0x2E, (byte) 0x7A, (byte) 0xCB, (byte) 0x1A, (byte) 0x5D,
+        (byte) 0x73, (byte) 0x45, (byte) 0xF2, (byte) 0x7C, (byte) 0xD0, (byte) 0x88,
+        (byte) 0x83, (byte) 0x51, (byte) 0xF3, (byte) 0x19, (byte) 0x0F, (byte) 0xD5,
+        (byte) 0x40, (byte) 0x3F, (byte) 0xD9, (byte) 0xBF,
+    };
+    private static final PSSParameterSpec SHA384withRSAPSS_NoSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-384", "MGF1", MGF1ParameterSpec.SHA384, 0, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha384 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha384 -pkeyopt rsa_pss_saltlen:206 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA384withRSAPSS_MaxSalt_Vector2Signature = new byte[] {
+        (byte) 0xDE, (byte) 0xF7, (byte) 0xC3, (byte) 0x21, (byte) 0x79, (byte) 0x0F,
+        (byte) 0x55, (byte) 0xD1, (byte) 0x56, (byte) 0x9A, (byte) 0xB0, (byte) 0x08,
+        (byte) 0xA1, (byte) 0x27, (byte) 0xC9, (byte) 0x5E, (byte) 0x64, (byte) 0xF4,
+        (byte) 0xC7, (byte) 0x83, (byte) 0x94, (byte) 0xCA, (byte) 0xBD, (byte) 0x50,
+        (byte) 0xD6, (byte) 0xC5, (byte) 0x56, (byte) 0x94, (byte) 0xBD, (byte) 0x0B,
+        (byte) 0x55, (byte) 0xE6, (byte) 0x04, (byte) 0xAD, (byte) 0xAF, (byte) 0xAF,
+        (byte) 0x4F, (byte) 0x2D, (byte) 0x91, (byte) 0x7F, (byte) 0xF1, (byte) 0x60,
+        (byte) 0x0C, (byte) 0xEE, (byte) 0xE8, (byte) 0x44, (byte) 0xFC, (byte) 0x69,
+        (byte) 0x80, (byte) 0x43, (byte) 0xBC, (byte) 0xAB, (byte) 0x83, (byte) 0x35,
+        (byte) 0xB0, (byte) 0xC6, (byte) 0xCB, (byte) 0xE6, (byte) 0x92, (byte) 0x29,
+        (byte) 0x09, (byte) 0xCF, (byte) 0xDB, (byte) 0xAD, (byte) 0x16, (byte) 0x93,
+        (byte) 0xC7, (byte) 0xBE, (byte) 0x81, (byte) 0x68, (byte) 0x0F, (byte) 0x7B,
+        (byte) 0xC1, (byte) 0xC2, (byte) 0x8C, (byte) 0xBA, (byte) 0x59, (byte) 0x80,
+        (byte) 0xAE, (byte) 0xFB, (byte) 0x60, (byte) 0x22, (byte) 0x28, (byte) 0x36,
+        (byte) 0xBE, (byte) 0x37, (byte) 0x72, (byte) 0x86, (byte) 0x02, (byte) 0x4B,
+        (byte) 0xF9, (byte) 0x14, (byte) 0x5A, (byte) 0x6B, (byte) 0x32, (byte) 0x44,
+        (byte) 0x72, (byte) 0x33, (byte) 0x2E, (byte) 0x7F, (byte) 0xA1, (byte) 0xFD,
+        (byte) 0x07, (byte) 0xF2, (byte) 0xD9, (byte) 0x9D, (byte) 0x03, (byte) 0x77,
+        (byte) 0x17, (byte) 0xFB, (byte) 0x0E, (byte) 0xFF, (byte) 0xF7, (byte) 0x37,
+        (byte) 0x68, (byte) 0xF6, (byte) 0x8F, (byte) 0x9B, (byte) 0x2C, (byte) 0xEB,
+        (byte) 0xAF, (byte) 0x6C, (byte) 0x50, (byte) 0x9F, (byte) 0x34, (byte) 0xB2,
+        (byte) 0x52, (byte) 0x3B, (byte) 0x94, (byte) 0x6F, (byte) 0x60, (byte) 0x16,
+        (byte) 0x52, (byte) 0x0A, (byte) 0xBF, (byte) 0x95, (byte) 0x41, (byte) 0x44,
+        (byte) 0x83, (byte) 0x91, (byte) 0x85, (byte) 0xA1, (byte) 0xF7, (byte) 0xF9,
+        (byte) 0x17, (byte) 0x4A, (byte) 0xF7, (byte) 0xF1, (byte) 0xE8, (byte) 0x9C,
+        (byte) 0x75, (byte) 0x86, (byte) 0x12, (byte) 0x44, (byte) 0x19, (byte) 0x5C,
+        (byte) 0x65, (byte) 0x31, (byte) 0x89, (byte) 0x2A, (byte) 0xFC, (byte) 0xBE,
+        (byte) 0xE8, (byte) 0xEC, (byte) 0xC9, (byte) 0xD7, (byte) 0x41, (byte) 0xDA,
+        (byte) 0xD9, (byte) 0xC9, (byte) 0x8B, (byte) 0x90, (byte) 0x60, (byte) 0xCC,
+        (byte) 0xB2, (byte) 0x7A, (byte) 0xBA, (byte) 0xA0, (byte) 0xEE, (byte) 0xBE,
+        (byte) 0x9C, (byte) 0xE7, (byte) 0xF2, (byte) 0x27, (byte) 0x92, (byte) 0x9C,
+        (byte) 0x3C, (byte) 0x0F, (byte) 0x5C, (byte) 0xEE, (byte) 0x38, (byte) 0x48,
+        (byte) 0xCF, (byte) 0xFF, (byte) 0x33, (byte) 0x35, (byte) 0x80, (byte) 0x99,
+        (byte) 0x5D, (byte) 0xA7, (byte) 0x5A, (byte) 0x7A, (byte) 0xEA, (byte) 0x96,
+        (byte) 0x74, (byte) 0x28, (byte) 0x36, (byte) 0x7B, (byte) 0xE1, (byte) 0x33,
+        (byte) 0x7C, (byte) 0x78, (byte) 0xEC, (byte) 0x05, (byte) 0x72, (byte) 0x0E,
+        (byte) 0x5D, (byte) 0x16, (byte) 0x5C, (byte) 0x77, (byte) 0x58, (byte) 0xA7,
+        (byte) 0x31, (byte) 0x3F, (byte) 0xBA, (byte) 0x91, (byte) 0xA7, (byte) 0x16,
+        (byte) 0xFC, (byte) 0x31, (byte) 0xCA, (byte) 0x30, (byte) 0xE0, (byte) 0xF4,
+        (byte) 0x5D, (byte) 0x07, (byte) 0x4A, (byte) 0x9C, (byte) 0x1D, (byte) 0x2B,
+        (byte) 0x4E, (byte) 0xB8, (byte) 0x7C, (byte) 0x67, (byte) 0xCB, (byte) 0x34,
+        (byte) 0x69, (byte) 0x85, (byte) 0x4E, (byte) 0x99, (byte) 0x41, (byte) 0x8A,
+        (byte) 0x35, (byte) 0x85, (byte) 0xF2, (byte) 0x1A,
+    };
+    private static final PSSParameterSpec SHA384withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-384", "MGF1", MGF1ParameterSpec.SHA384, 206, 1);
 
     /*
      * echo "This is a signed message from Kenny Root." | openssl sha512 -binary -out digest.bin \
@@ -1172,6 +1618,116 @@
         (byte) 0xF9, (byte) 0x9E, (byte) 0x65, (byte) 0x05, (byte) 0xF0, (byte) 0x22,
         (byte) 0x7F, (byte) 0x4F, (byte) 0x40, (byte) 0x45,
     };
+    private static final PSSParameterSpec SHA512withRSAPSS_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-512", "MGF1", MGF1ParameterSpec.SHA512, 64, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha512 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha512 -pkeyopt rsa_pss_saltlen:64 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA512withRSAPSS_NoSalt_Vector2Signature = new byte[] {
+        (byte) 0x49, (byte) 0xA3, (byte) 0xBC, (byte) 0x2E, (byte) 0x67, (byte) 0x96,
+        (byte) 0xA5, (byte) 0x3E, (byte) 0x39, (byte) 0x46, (byte) 0xD6, (byte) 0xA1,
+        (byte) 0xA0, (byte) 0x4F, (byte) 0x3A, (byte) 0x03, (byte) 0x8F, (byte) 0x62,
+        (byte) 0xF2, (byte) 0xD8, (byte) 0x90, (byte) 0xAD, (byte) 0xE2, (byte) 0x3B,
+        (byte) 0x4F, (byte) 0x98, (byte) 0x88, (byte) 0x51, (byte) 0x41, (byte) 0x09,
+        (byte) 0x23, (byte) 0xEB, (byte) 0xF4, (byte) 0x5D, (byte) 0x6A, (byte) 0x22,
+        (byte) 0x12, (byte) 0x12, (byte) 0xDC, (byte) 0x27, (byte) 0xE9, (byte) 0xF7,
+        (byte) 0x64, (byte) 0xA3, (byte) 0xDE, (byte) 0x3A, (byte) 0xB0, (byte) 0xD6,
+        (byte) 0xF2, (byte) 0xC6, (byte) 0xBC, (byte) 0x0B, (byte) 0xA2, (byte) 0xA1,
+        (byte) 0xAA, (byte) 0xB0, (byte) 0x51, (byte) 0xDA, (byte) 0x4F, (byte) 0x28,
+        (byte) 0xA8, (byte) 0xEB, (byte) 0x34, (byte) 0x60, (byte) 0x37, (byte) 0xF7,
+        (byte) 0x50, (byte) 0x7D, (byte) 0xB8, (byte) 0xE7, (byte) 0x24, (byte) 0x8E,
+        (byte) 0xAC, (byte) 0x03, (byte) 0x31, (byte) 0xB8, (byte) 0xE0, (byte) 0xDB,
+        (byte) 0x97, (byte) 0xE9, (byte) 0x1B, (byte) 0x7E, (byte) 0x27, (byte) 0x99,
+        (byte) 0x93, (byte) 0x4D, (byte) 0x46, (byte) 0xB3, (byte) 0xFE, (byte) 0xD6,
+        (byte) 0x23, (byte) 0xB3, (byte) 0xAB, (byte) 0x3E, (byte) 0x33, (byte) 0xA1,
+        (byte) 0x10, (byte) 0x4E, (byte) 0x34, (byte) 0x27, (byte) 0x58, (byte) 0x25,
+        (byte) 0xB7, (byte) 0xBA, (byte) 0xEE, (byte) 0xBE, (byte) 0xE0, (byte) 0x6E,
+        (byte) 0x54, (byte) 0xF7, (byte) 0x73, (byte) 0x7B, (byte) 0x5A, (byte) 0x9C,
+        (byte) 0x74, (byte) 0xEA, (byte) 0xC7, (byte) 0x7E, (byte) 0xC6, (byte) 0xF7,
+        (byte) 0xD5, (byte) 0x32, (byte) 0x0E, (byte) 0x28, (byte) 0x99, (byte) 0xD8,
+        (byte) 0xEF, (byte) 0x97, (byte) 0x62, (byte) 0x8A, (byte) 0xE3, (byte) 0x16,
+        (byte) 0xAD, (byte) 0xE2, (byte) 0xF4, (byte) 0x11, (byte) 0x91, (byte) 0x17,
+        (byte) 0xF3, (byte) 0x32, (byte) 0x90, (byte) 0xCB, (byte) 0x3C, (byte) 0x89,
+        (byte) 0xF4, (byte) 0x20, (byte) 0xF1, (byte) 0x2D, (byte) 0x74, (byte) 0x22,
+        (byte) 0x50, (byte) 0x64, (byte) 0xC2, (byte) 0xF4, (byte) 0xC4, (byte) 0x0D,
+        (byte) 0x18, (byte) 0x6A, (byte) 0x02, (byte) 0x52, (byte) 0x14, (byte) 0x85,
+        (byte) 0x67, (byte) 0xA4, (byte) 0x08, (byte) 0xE5, (byte) 0xBF, (byte) 0x65,
+        (byte) 0x15, (byte) 0xB3, (byte) 0x5A, (byte) 0x88, (byte) 0xEB, (byte) 0xD4,
+        (byte) 0x75, (byte) 0xF9, (byte) 0x52, (byte) 0x73, (byte) 0xA0, (byte) 0x5E,
+        (byte) 0xBA, (byte) 0x37, (byte) 0x6A, (byte) 0x61, (byte) 0x2B, (byte) 0x16,
+        (byte) 0x8A, (byte) 0xA8, (byte) 0x00, (byte) 0xBB, (byte) 0x4D, (byte) 0xFA,
+        (byte) 0x04, (byte) 0xB8, (byte) 0xAB, (byte) 0x4D, (byte) 0xA4, (byte) 0xFC,
+        (byte) 0x9D, (byte) 0xCF, (byte) 0x63, (byte) 0x83, (byte) 0x34, (byte) 0xAE,
+        (byte) 0xAE, (byte) 0xA6, (byte) 0x77, (byte) 0x73, (byte) 0xA2, (byte) 0xB5,
+        (byte) 0x77, (byte) 0xAC, (byte) 0x00, (byte) 0x03, (byte) 0x06, (byte) 0xD4,
+        (byte) 0xDF, (byte) 0x81, (byte) 0x61, (byte) 0xCE, (byte) 0x8E, (byte) 0xC1,
+        (byte) 0xD5, (byte) 0x99, (byte) 0xD5, (byte) 0x2F, (byte) 0xE8, (byte) 0x27,
+        (byte) 0xFA, (byte) 0x84, (byte) 0x7E, (byte) 0x57, (byte) 0xF1, (byte) 0xC9,
+        (byte) 0xEB, (byte) 0x4F, (byte) 0xF9, (byte) 0x92, (byte) 0xC6, (byte) 0xD0,
+        (byte) 0x25, (byte) 0x8A, (byte) 0x16, (byte) 0xD0, (byte) 0xEC, (byte) 0xE5,
+        (byte) 0x33, (byte) 0xA6, (byte) 0xF9, (byte) 0xD5, (byte) 0x0C, (byte) 0x7B,
+        (byte) 0xEC, (byte) 0xC6, (byte) 0x58, (byte) 0x45,
+    };
+    private static final PSSParameterSpec SHA512withRSAPSS_NoSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-512", "MGF1", MGF1ParameterSpec.SHA512, 0, 1);
+
+    /*
+     * echo "This is a signed message from Kenny Root." | openssl sha512 -binary -out digest.bin \
+     *     && openssl pkeyutl -sign -in digest.bin -inkey privkey.pem \
+     *         -pkeyopt rsa_padding_mode:pss -pkeyopt digest:sha512 -pkeyopt rsa_pss_saltlen:190 \
+     *     | recode ../x1 | sed 's/0x/(byte) 0x/g'
+     */
+    private static final byte[] SHA512withRSAPSS_MaxSalt_Vector2Signature = new byte[] {
+        (byte) 0x90, (byte) 0x92, (byte) 0x45, (byte) 0xA1, (byte) 0x1E, (byte) 0x0F,
+        (byte) 0x5F, (byte) 0xF6, (byte) 0x8F, (byte) 0xA0, (byte) 0xBE, (byte) 0x34,
+        (byte) 0x29, (byte) 0x62, (byte) 0xBE, (byte) 0x41, (byte) 0x80, (byte) 0xF0,
+        (byte) 0xB8, (byte) 0x9F, (byte) 0x29, (byte) 0x63, (byte) 0x89, (byte) 0x26,
+        (byte) 0xC2, (byte) 0x22, (byte) 0x1F, (byte) 0x60, (byte) 0xB6, (byte) 0xFC,
+        (byte) 0x5A, (byte) 0x3E, (byte) 0x99, (byte) 0xB8, (byte) 0xC6, (byte) 0x3B,
+        (byte) 0x67, (byte) 0x33, (byte) 0x97, (byte) 0x19, (byte) 0xC6, (byte) 0xFF,
+        (byte) 0x0C, (byte) 0xA9, (byte) 0x04, (byte) 0x5A, (byte) 0xF0, (byte) 0x02,
+        (byte) 0x9A, (byte) 0x19, (byte) 0x0F, (byte) 0xEA, (byte) 0x77, (byte) 0x0D,
+        (byte) 0x56, (byte) 0x38, (byte) 0x0A, (byte) 0xED, (byte) 0x4E, (byte) 0xB7,
+        (byte) 0x57, (byte) 0xBD, (byte) 0xC9, (byte) 0xA3, (byte) 0xE8, (byte) 0xC0,
+        (byte) 0x7D, (byte) 0xF6, (byte) 0xA3, (byte) 0x4B, (byte) 0x61, (byte) 0x45,
+        (byte) 0x06, (byte) 0x5E, (byte) 0x56, (byte) 0xF5, (byte) 0xEF, (byte) 0x76,
+        (byte) 0x6B, (byte) 0xB7, (byte) 0xD4, (byte) 0xBB, (byte) 0xA4, (byte) 0x3C,
+        (byte) 0x52, (byte) 0xF8, (byte) 0x06, (byte) 0x67, (byte) 0xF7, (byte) 0xC3,
+        (byte) 0x8C, (byte) 0x5E, (byte) 0xDF, (byte) 0xFE, (byte) 0x30, (byte) 0x2E,
+        (byte) 0xF8, (byte) 0x59, (byte) 0x3C, (byte) 0x3B, (byte) 0xEA, (byte) 0xA0,
+        (byte) 0x5D, (byte) 0x8F, (byte) 0x18, (byte) 0x73, (byte) 0x1A, (byte) 0x2D,
+        (byte) 0xB1, (byte) 0x55, (byte) 0x07, (byte) 0xC8, (byte) 0x33, (byte) 0xED,
+        (byte) 0x8A, (byte) 0x5E, (byte) 0xC3, (byte) 0xAE, (byte) 0x51, (byte) 0x31,
+        (byte) 0xC4, (byte) 0xFA, (byte) 0xE8, (byte) 0xE9, (byte) 0xBE, (byte) 0x2E,
+        (byte) 0x28, (byte) 0xAA, (byte) 0xED, (byte) 0xA8, (byte) 0x4B, (byte) 0xA3,
+        (byte) 0x13, (byte) 0xB9, (byte) 0x82, (byte) 0x57, (byte) 0xD1, (byte) 0x72,
+        (byte) 0x0D, (byte) 0xA7, (byte) 0xF8, (byte) 0x67, (byte) 0xB8, (byte) 0x55,
+        (byte) 0xF3, (byte) 0x06, (byte) 0xAE, (byte) 0xA7, (byte) 0x69, (byte) 0x66,
+        (byte) 0x0B, (byte) 0x80, (byte) 0x56, (byte) 0x65, (byte) 0xC7, (byte) 0xE9,
+        (byte) 0x60, (byte) 0xDC, (byte) 0x2D, (byte) 0x4B, (byte) 0x26, (byte) 0xA9,
+        (byte) 0xED, (byte) 0x54, (byte) 0x79, (byte) 0x9E, (byte) 0x55, (byte) 0x1D,
+        (byte) 0xEE, (byte) 0x78, (byte) 0x49, (byte) 0xA1, (byte) 0x1F, (byte) 0x9B,
+        (byte) 0x37, (byte) 0xC0, (byte) 0xBA, (byte) 0xE6, (byte) 0x4B, (byte) 0x3B,
+        (byte) 0xAF, (byte) 0x12, (byte) 0x99, (byte) 0x32, (byte) 0x14, (byte) 0x8C,
+        (byte) 0x4D, (byte) 0xEB, (byte) 0x08, (byte) 0xA4, (byte) 0xE3, (byte) 0xC6,
+        (byte) 0x37, (byte) 0x8B, (byte) 0x6E, (byte) 0x7C, (byte) 0xEC, (byte) 0xA3,
+        (byte) 0x78, (byte) 0xED, (byte) 0x4E, (byte) 0x36, (byte) 0xBC, (byte) 0xA2,
+        (byte) 0x7D, (byte) 0x11, (byte) 0x0E, (byte) 0xD0, (byte) 0x53, (byte) 0x14,
+        (byte) 0x93, (byte) 0x16, (byte) 0x54, (byte) 0x45, (byte) 0x79, (byte) 0x7A,
+        (byte) 0x1A, (byte) 0xA1, (byte) 0xEC, (byte) 0xF3, (byte) 0x12, (byte) 0x3F,
+        (byte) 0xFE, (byte) 0x68, (byte) 0xFF, (byte) 0x5A, (byte) 0x3F, (byte) 0xE7,
+        (byte) 0x13, (byte) 0x37, (byte) 0xEB, (byte) 0x60, (byte) 0x0A, (byte) 0x8E,
+        (byte) 0x4F, (byte) 0x54, (byte) 0x46, (byte) 0x19, (byte) 0x82, (byte) 0xBF,
+        (byte) 0xB7, (byte) 0xD2, (byte) 0x19, (byte) 0x71, (byte) 0x78, (byte) 0x38,
+        (byte) 0x4C, (byte) 0xE3, (byte) 0xC4, (byte) 0xEA, (byte) 0x8F, (byte) 0x9B,
+        (byte) 0xE5, (byte) 0xBA, (byte) 0x06, (byte) 0xFC,
+    };
+    private static final PSSParameterSpec SHA512withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec =
+            new PSSParameterSpec("SHA-512", "MGF1", MGF1ParameterSpec.SHA512, 190, 1);
 
     public void testGetCommonInstances_Success() throws Exception {
         assertNotNull(Signature.getInstance("SHA1withRSA"));
@@ -1255,12 +1811,42 @@
 
         Signature sig = Signature.getInstance("SHA1withRSA/PSS");
         sig.initVerify(pubKey);
+        assertPSSAlgorithmParametersEquals(
+                SHA1withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
         sig.update(Vector2Data);
 
         assertTrue("Signature must verify",
                 sig.verify(SHA1withRSAPSS_Vector2Signature));
     }
 
+    public void testVerify_SHA1withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA1withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA1withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA1withRSAPSS_NoSalt_Vector2Signature));
+    }
+
+    public void testVerify_SHA1withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA1withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA1withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA1withRSAPSS_MaxSalt_Vector2Signature));
+    }
+
     public void testVerify_SHA224withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
@@ -1268,12 +1854,42 @@
 
         Signature sig = Signature.getInstance("SHA224withRSA/PSS");
         sig.initVerify(pubKey);
+        assertPSSAlgorithmParametersEquals(
+                SHA224withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
         sig.update(Vector2Data);
 
         assertTrue("Signature must verify",
                 sig.verify(SHA224withRSAPSS_Vector2Signature));
     }
 
+    public void testVerify_SHA224withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA224withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA224withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA224withRSAPSS_NoSalt_Vector2Signature));
+    }
+
+    public void testVerify_SHA224withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA224withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA224withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA224withRSAPSS_MaxSalt_Vector2Signature));
+    }
+
     public void testVerify_SHA256withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
@@ -1281,12 +1897,42 @@
 
         Signature sig = Signature.getInstance("SHA256withRSA/PSS");
         sig.initVerify(pubKey);
+        assertPSSAlgorithmParametersEquals(
+                SHA256withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
         sig.update(Vector2Data);
 
         assertTrue("Signature must verify",
                 sig.verify(SHA256withRSAPSS_Vector2Signature));
     }
 
+    public void testVerify_SHA256withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA256withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA256withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA256withRSAPSS_NoSalt_Vector2Signature));
+    }
+
+    public void testVerify_SHA256withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA256withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA256withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA256withRSAPSS_MaxSalt_Vector2Signature));
+    }
+
     public void testVerify_SHA384withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
@@ -1294,12 +1940,42 @@
 
         Signature sig = Signature.getInstance("SHA384withRSA/PSS");
         sig.initVerify(pubKey);
+        assertPSSAlgorithmParametersEquals(
+                SHA384withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
         sig.update(Vector2Data);
 
         assertTrue("Signature must verify",
                 sig.verify(SHA384withRSAPSS_Vector2Signature));
     }
 
+    public void testVerify_SHA384withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA384withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA384withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA384withRSAPSS_NoSalt_Vector2Signature));
+    }
+
+    public void testVerify_SHA384withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA384withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA384withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA384withRSAPSS_MaxSalt_Vector2Signature));
+    }
+
     public void testVerify_SHA512withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
@@ -1307,12 +1983,42 @@
 
         Signature sig = Signature.getInstance("SHA512withRSA/PSS");
         sig.initVerify(pubKey);
+        assertPSSAlgorithmParametersEquals(
+                SHA512withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
         sig.update(Vector2Data);
 
         assertTrue("Signature must verify",
                 sig.verify(SHA512withRSAPSS_Vector2Signature));
     }
 
+    public void testVerify_SHA512withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA512withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA512withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA512withRSAPSS_NoSalt_Vector2Signature));
+    }
+
+    public void testVerify_SHA512withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPublicKeySpec keySpec = new RSAPublicKeySpec(RSA_2048_modulus, RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(keySpec);
+
+        Signature sig = Signature.getInstance("SHA512withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA512withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        assertTrue("Signature must verify",
+                sig.verify(SHA512withRSAPSS_MaxSalt_Vector2Signature));
+    }
+
     public void testVerify_SHA1withRSA_Key_InitSignThenInitVerify_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
@@ -1624,6 +2330,8 @@
 
         byte[] signature = sig.sign();
         assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA1withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
 
         RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
                 RSA_2048_publicExponent);
@@ -1633,6 +2341,59 @@
         assertTrue("Signature must verify correctly", sig.verify(signature));
     }
 
+    public void testSign_SHA1withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA1withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA1withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA1withRSAPSS_NoSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+        assertTrue("Signature should match expected",
+                Arrays.equals(signature, SHA1withRSAPSS_NoSalt_Vector2Signature));
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA1withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
+    public void testSign_SHA1withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA1withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA1withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA1withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig = Signature.getInstance("SHA1withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA1withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
     public void testSign_SHA224withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
@@ -1645,6 +2406,8 @@
 
         byte[] signature = sig.sign();
         assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA224withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
 
         RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
                 RSA_2048_publicExponent);
@@ -1654,6 +2417,59 @@
         assertTrue("Signature must verify correctly", sig.verify(signature));
     }
 
+    public void testSign_SHA224withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA224withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA224withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA224withRSAPSS_NoSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+        assertTrue("Signature should match expected",
+                Arrays.equals(signature, SHA224withRSAPSS_NoSalt_Vector2Signature));
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA224withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
+    public void testSign_SHA224withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA224withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA224withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA224withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig = Signature.getInstance("SHA224withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA224withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
     public void testSign_SHA256withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
@@ -1666,6 +2482,8 @@
 
         byte[] signature = sig.sign();
         assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA256withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
 
         RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
                 RSA_2048_publicExponent);
@@ -1675,6 +2493,59 @@
         assertTrue("Signature must verify correctly", sig.verify(signature));
     }
 
+    public void testSign_SHA256withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA256withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA256withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA256withRSAPSS_NoSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+        assertTrue("Signature should match expected",
+                Arrays.equals(signature, SHA256withRSAPSS_NoSalt_Vector2Signature));
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA256withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
+    public void testSign_SHA256withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA256withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA256withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA256withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig = Signature.getInstance("SHA256withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA256withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
     public void testSign_SHA384withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
@@ -1687,6 +2558,8 @@
 
         byte[] signature = sig.sign();
         assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA384withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
 
         RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
                 RSA_2048_publicExponent);
@@ -1696,6 +2569,59 @@
         assertTrue("Signature must verify correctly", sig.verify(signature));
     }
 
+    public void testSign_SHA384withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA384withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA384withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA384withRSAPSS_NoSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+        assertTrue("Signature should match expected",
+                Arrays.equals(signature, SHA384withRSAPSS_NoSalt_Vector2Signature));
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA384withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
+    public void testSign_SHA384withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA384withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA384withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA384withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig = Signature.getInstance("SHA384withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA384withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
     public void testSign_SHA512withRSAPSS_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
@@ -1708,6 +2634,8 @@
 
         byte[] signature = sig.sign();
         assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA512withRSAPSS_Vector2Signature_ParameterSpec, sig.getParameters());
 
         RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
                 RSA_2048_publicExponent);
@@ -1717,6 +2645,59 @@
         assertTrue("Signature must verify correctly", sig.verify(signature));
     }
 
+    public void testSign_SHA512withRSAPSS_NoSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA512withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA512withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA512withRSAPSS_NoSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+        assertTrue("Signature should match expected",
+                Arrays.equals(signature, SHA512withRSAPSS_NoSalt_Vector2Signature));
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA512withRSAPSS_NoSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
+    public void testSign_SHA512withRSAPSS_MaxSalt_Key_Success() throws Exception {
+        KeyFactory kf = KeyFactory.getInstance("RSA");
+        RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
+                RSA_2048_privateExponent);
+        PrivateKey privKey = kf.generatePrivate(keySpec);
+
+        Signature sig = Signature.getInstance("SHA512withRSA/PSS");
+        sig.initSign(privKey);
+        sig.setParameter(SHA512withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+
+        byte[] signature = sig.sign();
+        assertNotNull("Signature must not be null", signature);
+        assertPSSAlgorithmParametersEquals(
+                SHA512withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec, sig.getParameters());
+
+        RSAPublicKeySpec pubKeySpec = new RSAPublicKeySpec(RSA_2048_modulus,
+                RSA_2048_publicExponent);
+        PublicKey pubKey = kf.generatePublic(pubKeySpec);
+        sig = Signature.getInstance("SHA512withRSA/PSS");
+        sig.initVerify(pubKey);
+        sig.setParameter(SHA512withRSAPSS_MaxSalt_Vector2Signature_ParameterSpec);
+        sig.update(Vector2Data);
+        assertTrue("Signature must verify correctly", sig.verify(signature));
+    }
+
     public void testSign_NONEwithRSA_Key_Success() throws Exception {
         KeyFactory kf = KeyFactory.getInstance("RSA");
         RSAPrivateKeySpec keySpec = new RSAPrivateKeySpec(RSA_2048_modulus,
@@ -2233,6 +3214,45 @@
         verify(signatureSpi).engineGetParameters();
     }
 
+    private static void assertPSSAlgorithmParametersEquals(
+            PSSParameterSpec expectedSpec, AlgorithmParameters actual)
+                    throws InvalidParameterSpecException {
+        assertNotNull(actual);
+        assertEqualsIgnoreCase("PSS", actual.getAlgorithm());
+        PSSParameterSpec actualSpec = actual.getParameterSpec(PSSParameterSpec.class);
+        assertPSSParameterSpecEquals(expectedSpec, actualSpec);
+    }
+
+    private static void assertPSSParameterSpecEquals(
+            PSSParameterSpec expected, PSSParameterSpec actual) {
+        assertEqualsIgnoreCase(expected.getDigestAlgorithm(), actual.getDigestAlgorithm());
+        assertEqualsIgnoreCase(expected.getMGFAlgorithm(), actual.getMGFAlgorithm());
+        if (!"MGF1".equalsIgnoreCase(expected.getMGFAlgorithm())) {
+            fail("Unsupported MGF algorithm: " + expected.getMGFAlgorithm());
+        }
+        MGF1ParameterSpec expectedMgfParams = (MGF1ParameterSpec) expected.getMGFParameters();
+        MGF1ParameterSpec actualMgfParams = (MGF1ParameterSpec) actual.getMGFParameters();
+        assertEqualsIgnoreCase(
+                expectedMgfParams.getDigestAlgorithm(), actualMgfParams.getDigestAlgorithm());
+        assertEquals(expected.getSaltLength(), actual.getSaltLength());
+        assertEquals(expected.getTrailerField(), actual.getTrailerField());
+    }
+
+    private static void assertEqualsIgnoreCase(String expected, String actual) {
+        if (expected == null) {
+            if (actual == null) {
+                return;
+            }
+            fail("Expected null, actual: <" + actual + ">");
+        } else if (actual == null) {
+            fail("Expected: <" + expected + ">, actual: null");
+        } else {
+            if (!expected.equalsIgnoreCase(actual)) {
+                fail("Expected: <" + expected + ">, actual: <" + actual + ">");
+            }
+        }
+    }
+
     public static class MockableProvider extends Provider {
         protected MockableProvider() {
             super("MockableProvider", 1.0, "Used by Mockito");
diff --git a/ojluni/src/main/java/java/lang/Object.java b/ojluni/src/main/java/java/lang/Object.java
index 56150fc..28bc2b3 100755
--- a/ojluni/src/main/java/java/lang/Object.java
+++ b/ojluni/src/main/java/java/lang/Object.java
@@ -100,10 +100,11 @@
      */
     public int hashCode() {
         int lockWord = shadow$_monitor_;
-        final int lockWordMask = 0xC0000000;  // Top 2 bits.
+        final int lockWordStateMask = 0xC0000000;  // Top 2 bits.
         final int lockWordStateHash = 0x80000000;  // Top 2 bits are value 2 (kStateHash).
-        if ((lockWord & lockWordMask) == lockWordStateHash) {
-            return lockWord & ~lockWordMask;
+        final int lockWordHashMask = 0x0FFFFFFF;  // Low 28 bits.
+        if ((lockWord & lockWordStateMask) == lockWordStateHash) {
+            return lockWord & lockWordHashMask;
         }
         return System.identityHashCode(this);
     }
diff --git a/ojluni/src/main/java/java/net/CookieManager.java b/ojluni/src/main/java/java/net/CookieManager.java
index 0e0ece7..4e52fce 100755
--- a/ojluni/src/main/java/java/net/CookieManager.java
+++ b/ojluni/src/main/java/java/net/CookieManager.java
@@ -204,20 +204,17 @@
         Map<String, List<String>> cookieMap =
                         new java.util.HashMap<String, List<String>>();
         // if there's no default CookieStore, no way for us to get any cookie
-        if (cookieJar == null)
+        if (cookieJar == null) {
             return Collections.unmodifiableMap(cookieMap);
+        }
 
         boolean secureLink = "https".equalsIgnoreCase(uri.getScheme());
         List<HttpCookie> cookies = new java.util.ArrayList<HttpCookie>();
-        String path = uri.getPath();
-        if (path == null || path.isEmpty()) {
-            path = "/";
-        }
         for (HttpCookie cookie : cookieJar.get(uri)) {
             // apply path-matches rule (RFC 2965 sec. 3.3.4)
             // and check for the possible "secure" tag (i.e. don't send
             // 'secure' cookies over unsecure links)
-            if (pathMatches(path, cookie.getPath()) &&
+            if (pathMatches(uri, cookie) &&
                     (secureLink || !cookie.getSecure())) {
 
                 // Let's check the authorize port list if it exists
@@ -302,7 +299,7 @@
                             cookie.setPath(path);
                         } else {
                             // Validate existing path
-                            if (!pathMatches(uri.getPath(), cookie.getPath())) {
+                            if (!pathMatches(uri, cookie)) {
                                 continue;
                             }
                         }
@@ -389,65 +386,60 @@
         return false;
     }
 
-    /*
-     * path-matches algorithm, as defined by RFC 2965
+    /**
+     * Return true iff. the path from {@code cookie} matches the path from {@code uri}.
      */
-    private boolean pathMatches(String path, String pathToMatchWith) {
-        if (path == pathToMatchWith)
-            return true;
-        if (path == null || pathToMatchWith == null)
-            return false;
+    private static boolean pathMatches(URI uri, HttpCookie cookie) {
+        return normalizePath(uri.getPath()).startsWith(normalizePath(cookie.getPath()));
+    }
+
+    private static String normalizePath(String path) {
+        if (path == null) {
+            path = "";
+        }
 
         if (!path.endsWith("/")) {
             path = path + "/";
         }
-        if (!pathToMatchWith.endsWith("/")) {
-            pathToMatchWith = pathToMatchWith + "/";
-        }
 
-        if (path.startsWith(pathToMatchWith))
-            return true;
-
-        return false;
+        return path;
     }
 
 
     /*
      * sort cookies with respect to their path: those with more specific Path attributes
-     * precede those with less specific, as defined in RFC 2965 sec. 3.3.4
+     * precede those with less specific, as defined in RFC 2965 sec. 3.3.4.
      */
     private List<String> sortByPath(List<HttpCookie> cookies) {
         Collections.sort(cookies, new CookiePathComparator());
 
-        // ----- BEGIN android -----
-        StringBuilder result = new StringBuilder();
-        // ----- END android -----
+        final StringBuilder result = new StringBuilder();
 
-        List<String> cookieHeader = new java.util.ArrayList<String>();
+        // Netscape cookie spec and RFC 2965 have different format of Cookie
+        // header; RFC 2965 requires a leading $Version="1" string while Netscape
+        // does not.
+        // The workaround here is to add a $Version="1" string in advance
+        int minVersion = 1;
         for (HttpCookie cookie : cookies) {
-            // Netscape cookie spec and RFC 2965 have different format of Cookie
-            // header; RFC 2965 requires a leading $Version="1" string while Netscape
-            // does not.
-            // The workaround here is to add a $Version="1" string in advance
-            if (cookies.indexOf(cookie) == 0 && cookie.getVersion() > 0) {
-                // ----- BEGIN android -----
-                // cookieHeader.add("$Version=\"1\"");
-                result.append("$Version=\"1\"; ");
-                // ----- END android -----
+            if (cookie.getVersion() < minVersion) {
+                minVersion = cookie.getVersion();
             }
+        }
 
-            // ----- BEGIN android -----
-            //cookieHeader.add(cookie.toString());
-            if (cookies.indexOf(cookie) != 0) {
+        if (minVersion == 1) {
+            result.append("$Version=\"1\"; ");
+        }
+
+        for (int i = 0; i < cookies.size(); ++i) {
+            if (i != 0) {
                 result.append("; ");
             }
-            result.append(cookie.toString());
-            // ----- END android -----
 
+            result.append(cookies.get(i).toString());
         }
-        // ----- BEGIN android -----
+
+        List<String> cookieHeader = new java.util.ArrayList<String>();
         cookieHeader.add(result.toString());
-        // ----- END android -----
         return cookieHeader;
     }
 
@@ -461,10 +453,13 @@
             // path rule only applies to the cookies with same name
             if (!c1.getName().equals(c2.getName())) return 0;
 
+            final String c1Path = normalizePath(c1.getPath());
+            final String c2Path = normalizePath(c2.getPath());
+
             // those with more specific Path attributes precede those with less specific
-            if (c1.getPath().startsWith(c2.getPath()))
+            if (c1Path.startsWith(c2Path))
                 return -1;
-            else if (c2.getPath().startsWith(c1.getPath()))
+            else if (c2Path.startsWith(c1Path))
                 return 1;
             else
                 return 0;
diff --git a/ojluni/src/main/java/java/net/URL.java b/ojluni/src/main/java/java/net/URL.java
index dc88bf0..25ad28a 100755
--- a/ojluni/src/main/java/java/net/URL.java
+++ b/ojluni/src/main/java/java/net/URL.java
@@ -1121,22 +1121,6 @@
     static Hashtable handlers = new Hashtable();
     private static Object streamHandlerLock = new Object();
 
-    // special case the gopher protocol, disabled by default
-    private static final String GOPHER = "gopher";
-    private static final String ENABLE_GOPHER_PROP = "jdk.net.registerGopherProtocol";
-    private static final boolean enableGopher = AccessController.doPrivileged(
-                new PrivilegedAction<Boolean>() {
-                    @Override
-                    public Boolean run() {
-                        String prop = System.getProperty(ENABLE_GOPHER_PROP);
-                        return prop == null ? false :
-                                   (prop.equalsIgnoreCase("false") ? false : true);
-                    }
-                });
-
-    // package name of the JDK implementation protocol handlers
-    private static final String JDK_PACKAGE_PREFIX =  "sun.net.www.protocol";
-
     /**
      * Returns the Stream Handler.
      * @param protocol the protocol to use
@@ -1156,65 +1140,36 @@
 
             // Try java protocol handler
             if (handler == null) {
-                String packagePrefixList = null;
-
-                packagePrefixList
-                    = java.security.AccessController.doPrivileged(
-                    new sun.security.action.GetPropertyAction(
-                        protocolPathProp,""));
-                if (packagePrefixList != "") {
-                    packagePrefixList += "|";
-                }
-
-                /* ----- BEGIN android -----
-                sun.net.www.protocol is not a default handlers package.
-
-                // REMIND: decide whether to allow the "null" class prefix
-                // or not.
-                packagePrefixList += JDK_PACKAGE_PREFIX;*/
-
-                StringTokenizer packagePrefixIter =
-                    new StringTokenizer(packagePrefixList, "|");
+                final String packagePrefixList = System.getProperty(protocolPathProp,"");
+                StringTokenizer packagePrefixIter = new StringTokenizer(packagePrefixList, "|");
 
                 while (handler == null &&
                        packagePrefixIter.hasMoreTokens()) {
 
-                    String packagePrefix =
-                      packagePrefixIter.nextToken().trim();
-
-                    // do not try to instantiate the JDK gopher handler
-                    // unless the system property had been explicitly set
-                    if (protocol.equalsIgnoreCase(GOPHER) &&
-                        packagePrefix.equals(JDK_PACKAGE_PREFIX) &&
-                        !enableGopher) {
-                            continue;
-                    }
+                    String packagePrefix = packagePrefixIter.nextToken().trim();
                     try {
-                        String clsName = packagePrefix + "." + protocol +
-                          ".Handler";
+                        String clsName = packagePrefix + "." + protocol +  ".Handler";
                         Class cls = null;
                         try {
-                            cls = Class.forName(clsName);
-                        } catch (ClassNotFoundException e) {
                             ClassLoader cl = ClassLoader.getSystemClassLoader();
-                            if (cl != null) {
-                                cls = cl.loadClass(clsName);
+                            cls = Class.forName(clsName, true, cl);
+                        } catch (ClassNotFoundException e) {
+                            ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
+                            if (contextLoader != null) {
+                                cls = Class.forName(clsName, true, contextLoader);
                             }
                         }
                         if (cls != null) {
                             handler  =
                               (URLStreamHandler)cls.newInstance();
                         }
-                    } catch (Exception e) {
-                        // any number of exceptions can get thrown here
+                    } catch (ReflectiveOperationException ignored) {
                     }
                 }
             }
 
-            /* ----- BEGIN android -----
             // Fallback to built-in stream handler.
-            // Makes okhttp the default http/https handler.
-            */
+            // Makes okhttp the default http/https handler
             if (handler == null) {
                 try {
                     if (protocol.equals("file")) {
@@ -1237,7 +1192,6 @@
                     throw new AssertionError(e);
                 }
             }
-            /* ----- END android -----*/
 
             synchronized (streamHandlerLock) {
 
diff --git a/ojluni/src/main/java/java/nio/ByteBufferAsCharBuffer.java b/ojluni/src/main/java/java/nio/ByteBufferAsCharBuffer.java
index 40d4e77..a3c475c 100644
--- a/ojluni/src/main/java/java/nio/ByteBufferAsCharBuffer.java
+++ b/ojluni/src/main/java/java/nio/ByteBufferAsCharBuffer.java
@@ -37,7 +37,7 @@
         super(-1, 0,
               bb.remaining() >> 1,
               bb.remaining() >> 1);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
@@ -52,7 +52,7 @@
                            int mark, int pos, int lim, int cap,
                            int off, ByteOrder order) {
         super(mark, pos, lim, cap);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
diff --git a/ojluni/src/main/java/java/nio/ByteBufferAsDoubleBuffer.java b/ojluni/src/main/java/java/nio/ByteBufferAsDoubleBuffer.java
index fe28210..56b7e69 100644
--- a/ojluni/src/main/java/java/nio/ByteBufferAsDoubleBuffer.java
+++ b/ojluni/src/main/java/java/nio/ByteBufferAsDoubleBuffer.java
@@ -38,7 +38,7 @@
         super(-1, 0,
               bb.remaining() >> 3,
               bb.remaining() >> 3);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
@@ -53,7 +53,7 @@
                              int mark, int pos, int lim, int cap,
                              int off, ByteOrder order) {
         super(mark, pos, lim, cap);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
diff --git a/ojluni/src/main/java/java/nio/ByteBufferAsFloatBuffer.java b/ojluni/src/main/java/java/nio/ByteBufferAsFloatBuffer.java
index 9cb0b24..3b93cc9 100644
--- a/ojluni/src/main/java/java/nio/ByteBufferAsFloatBuffer.java
+++ b/ojluni/src/main/java/java/nio/ByteBufferAsFloatBuffer.java
@@ -37,7 +37,7 @@
         super(-1, 0,
               bb.remaining() >> 2,
               bb.remaining() >> 2);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
@@ -52,7 +52,7 @@
                             int mark, int pos, int lim, int cap,
                             int off, ByteOrder order) {
         super(mark, pos, lim, cap);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
diff --git a/ojluni/src/main/java/java/nio/ByteBufferAsIntBuffer.java b/ojluni/src/main/java/java/nio/ByteBufferAsIntBuffer.java
index bb1eca5..5dee92a 100644
--- a/ojluni/src/main/java/java/nio/ByteBufferAsIntBuffer.java
+++ b/ojluni/src/main/java/java/nio/ByteBufferAsIntBuffer.java
@@ -37,7 +37,7 @@
         super(-1, 0,
               bb.remaining() >> 2,
               bb.remaining() >> 2);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
@@ -52,7 +52,7 @@
                           int mark, int pos, int lim, int cap,
                           int off, ByteOrder order) {
         super(mark, pos, lim, cap);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
diff --git a/ojluni/src/main/java/java/nio/ByteBufferAsLongBuffer.java b/ojluni/src/main/java/java/nio/ByteBufferAsLongBuffer.java
index e88cdb2..9a18ff9 100644
--- a/ojluni/src/main/java/java/nio/ByteBufferAsLongBuffer.java
+++ b/ojluni/src/main/java/java/nio/ByteBufferAsLongBuffer.java
@@ -37,7 +37,7 @@
         super(-1, 0,
               bb.remaining() >> 3,
               bb.remaining() >> 3);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
@@ -52,7 +52,7 @@
                            int mark, int pos, int lim, int cap,
                            int off, ByteOrder order) {
         super(mark, pos, lim, cap);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
diff --git a/ojluni/src/main/java/java/nio/ByteBufferAsShortBuffer.java b/ojluni/src/main/java/java/nio/ByteBufferAsShortBuffer.java
index ef86c94..97a6a0a 100644
--- a/ojluni/src/main/java/java/nio/ByteBufferAsShortBuffer.java
+++ b/ojluni/src/main/java/java/nio/ByteBufferAsShortBuffer.java
@@ -37,7 +37,7 @@
         super(-1, 0,
               bb.remaining() >> 1,
               bb.remaining() >> 1);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
@@ -52,7 +52,7 @@
                             int mark, int pos, int lim, int cap,
                             int off, ByteOrder order) {
         super(mark, pos, lim, cap);
-        this.bb = bb;
+        this.bb = bb.duplicate().order(bb.order());
         this.isReadOnly = bb.isReadOnly;
         this.address = bb.address;
         this.order = order;
diff --git a/ojluni/src/main/java/java/nio/DirectByteBuffer.java b/ojluni/src/main/java/java/nio/DirectByteBuffer.java
index 4de6c1e..51f63c6 100644
--- a/ojluni/src/main/java/java/nio/DirectByteBuffer.java
+++ b/ojluni/src/main/java/java/nio/DirectByteBuffer.java
@@ -47,19 +47,10 @@
     // ensure that its memory isn't freed before we are done with it.
     private final Object att;
 
-    private boolean freed = false;
-
     public Object attachment() {
         return att;
     }
 
-    private class Deallocator implements Runnable {
-
-        public void run() {
-            free();
-        }
-    }
-
     private Cleaner cleaner;
 
     public Cleaner cleaner() { return cleaner; }
@@ -69,7 +60,9 @@
               .newNonMovableArray(byte.class, capacity), 0);
         VMRuntime runtime = VMRuntime.getRuntime();
         address = runtime.addressOf(hb);
-        cleaner = Cleaner.create(this, new Deallocator());
+        // Only have references to java objects, no need for a cleaner since the GC will do all
+        // the work.
+        cleaner = null;
         this.isReadOnly = false;
         att = null;
     }
@@ -706,16 +699,6 @@
                                                            order()));
     }
 
-    public final void free() {
-        freed = true;
-    }
-
-    private final void checkIfFreed() {
-        if (freed) {
-            throw new IllegalStateException("buffer is inaccessible");
-        }
-    }
-
     public boolean isAccessible() {
         return isAccessible;
     }
diff --git a/ojluni/src/main/java/sun/nio/ch/Util.java b/ojluni/src/main/java/sun/nio/ch/Util.java
index 765e433..afa5bc6 100755
--- a/ojluni/src/main/java/sun/nio/ch/Util.java
+++ b/ojluni/src/main/java/sun/nio/ch/Util.java
@@ -215,7 +215,10 @@
      * Frees the memory for the given direct buffer
      */
     private static void free(ByteBuffer buf) {
-        ((DirectBuffer)buf).cleaner().clean();
+        Cleaner cleaner = ((DirectBuffer)buf).cleaner();
+        if (cleaner != null) {
+            cleaner.clean();
+        }
     }
 
     private static class SelectorWrapper {