Merge "Port openJDK8 java.nio.channels changes"
diff --git a/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java b/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java
index a986434..40819f8 100644
--- a/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java
+++ b/benchmarks/src/benchmarks/regression/MessageDigestBenchmark.java
@@ -17,6 +17,7 @@
package benchmarks.regression;
import com.google.caliper.Param;
+import java.nio.ByteBuffer;
import java.security.MessageDigest;
public class MessageDigestBenchmark {
@@ -29,6 +30,29 @@
}
}
+ private static final int LARGE_DATA_SIZE = 256 * 1024;
+ private static final byte[] LARGE_DATA = new byte[LARGE_DATA_SIZE];
+ static {
+ for (int i = 0; i < LARGE_DATA_SIZE; i++) {
+ LARGE_DATA[i] = (byte)i;
+ }
+ }
+
+ private static final ByteBuffer SMALL_BUFFER = ByteBuffer.wrap(DATA);
+ private static final ByteBuffer SMALL_DIRECT_BUFFER = ByteBuffer.allocateDirect(DATA_SIZE);
+ static {
+ SMALL_DIRECT_BUFFER.put(DATA);
+ SMALL_DIRECT_BUFFER.flip();
+ }
+
+ private static final ByteBuffer LARGE_BUFFER = ByteBuffer.wrap(LARGE_DATA);
+ private static final ByteBuffer LARGE_DIRECT_BUFFER =
+ ByteBuffer.allocateDirect(LARGE_DATA_SIZE);
+ static {
+ LARGE_DIRECT_BUFFER.put(LARGE_DATA);
+ LARGE_DIRECT_BUFFER.flip();
+ }
+
@Param private Algorithm algorithm;
public enum Algorithm { MD5, SHA1, SHA256, SHA384, SHA512 };
@@ -45,4 +69,88 @@
digest.digest();
}
}
+
+ public void timeLargeArray(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ digest.update(LARGE_DATA, 0, LARGE_DATA_SIZE);
+ digest.digest();
+ }
+ }
+
+ public void timeSmallChunkOfLargeArray(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ digest.update(LARGE_DATA, LARGE_DATA_SIZE / 2, DATA_SIZE);
+ digest.digest();
+ }
+ }
+
+ public void timeSmallByteBuffer(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ SMALL_BUFFER.position(0);
+ SMALL_BUFFER.limit(SMALL_BUFFER.capacity());
+ digest.update(SMALL_BUFFER);
+ digest.digest();
+ }
+ }
+
+ public void timeSmallDirectByteBuffer(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ SMALL_DIRECT_BUFFER.position(0);
+ SMALL_DIRECT_BUFFER.limit(SMALL_DIRECT_BUFFER.capacity());
+ digest.update(SMALL_DIRECT_BUFFER);
+ digest.digest();
+ }
+ }
+
+ public void timeLargeByteBuffer(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ LARGE_BUFFER.position(0);
+ LARGE_BUFFER.limit(LARGE_BUFFER.capacity());
+ digest.update(LARGE_BUFFER);
+ digest.digest();
+ }
+ }
+
+ public void timeLargeDirectByteBuffer(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ LARGE_DIRECT_BUFFER.position(0);
+ LARGE_DIRECT_BUFFER.limit(LARGE_DIRECT_BUFFER.capacity());
+ digest.update(LARGE_DIRECT_BUFFER);
+ digest.digest();
+ }
+ }
+
+ public void timeSmallChunkOfLargeByteBuffer(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ LARGE_BUFFER.position(LARGE_BUFFER.capacity() / 2);
+ LARGE_BUFFER.limit(LARGE_BUFFER.position() + DATA_SIZE);
+ digest.update(LARGE_BUFFER);
+ digest.digest();
+ }
+ }
+
+ public void timeSmallChunkOfLargeDirectByteBuffer(int reps) throws Exception {
+ for (int i = 0; i < reps; ++i) {
+ MessageDigest digest = MessageDigest.getInstance(algorithm.toString(),
+ provider.toString());
+ LARGE_DIRECT_BUFFER.position(LARGE_DIRECT_BUFFER.capacity() / 2);
+ LARGE_DIRECT_BUFFER.limit(LARGE_DIRECT_BUFFER.position() + DATA_SIZE);
+ digest.update(LARGE_DIRECT_BUFFER);
+ digest.digest();
+ }
+ }
}
diff --git a/dalvik/src/main/java/dalvik/system/DexFile.java b/dalvik/src/main/java/dalvik/system/DexFile.java
index 29609d7..a4870ae 100644
--- a/dalvik/src/main/java/dalvik/system/DexFile.java
+++ b/dalvik/src/main/java/dalvik/system/DexFile.java
@@ -41,7 +41,6 @@
private Object mCookie;
private Object mInternalCookie;
private final String mFileName;
- private final CloseGuard guard = CloseGuard.get();
/**
* Opens a DEX file from a given File object. This will usually be a ZIP/JAR
@@ -113,7 +112,6 @@
mCookie = openDexFile(fileName, null, 0, loader, elements);
mInternalCookie = mCookie;
mFileName = fileName;
- guard.open("close");
//System.out.println("DEX FILE cookie is " + mCookie + " fileName=" + fileName);
}
@@ -250,7 +248,6 @@
if (closeDexFile(mInternalCookie)) {
mInternalCookie = null;
}
- guard.close();
mCookie = null;
}
}
@@ -349,9 +346,6 @@
*/
@Override protected void finalize() throws Throwable {
try {
- if (guard != null) {
- guard.warnIfOpen();
- }
if (mInternalCookie != null && !closeDexFile(mInternalCookie)) {
throw new AssertionError("Failed to close dex file in finalizer.");
}
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectInputStream2Test.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectInputStream2Test.java
index af5fce5..e81224a 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectInputStream2Test.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectInputStream2Test.java
@@ -17,8 +17,10 @@
package org.apache.harmony.tests.java.io;
+import dalvik.system.DexFile;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidClassException;
@@ -27,6 +29,9 @@
import java.io.ObjectStreamClass;
import java.io.ObjectStreamException;
import java.io.Serializable;
+import java.lang.reflect.Field;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
import java.util.ArrayList;
import junit.framework.TestCase;
@@ -210,4 +215,54 @@
// Excpected
}
}
+
+ // http://b/29721023
+ public void test_sameName() throws Exception {
+ // Load class from dex, it's not possible to create a class with same-named
+ // fields in java (but it's allowed in dex).
+ File sameFieldNames = File.createTempFile("sameFieldNames", ".dex");
+ InputStream dexIs = this.getClass().getClassLoader().
+ getResourceAsStream("tests/api/java/io/sameFieldNames.dex");
+ assertNotNull(dexIs);
+
+ Class<?> clazz = null;
+
+ // Get the class object
+ try {
+ Files.copy(dexIs, sameFieldNames.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ DexFile dexFile = new DexFile(sameFieldNames);
+ clazz = dexFile.loadClass("sameFieldNames", getClass().getClassLoader());
+ dexFile.close();
+ } finally {
+ if (sameFieldNames.exists()) {
+ sameFieldNames.delete();
+ }
+ }
+
+ // Create class instance, fill it with content
+ Object o1 = clazz.getConstructor().newInstance();
+ int v = 123;
+ for(Field f : clazz.getFields()) {
+ if (f.getType() == Integer.class) {
+ f.set(o1, new Integer(v++));
+ } else if (f.getType() == Long.class) {
+ f.set(o1, new Long(v++));
+ }
+ }
+
+ // Serialize and deserialize
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ ObjectOutputStream oos = new ObjectOutputStream(baos);
+ oos.writeObject(o1);
+ oos.close();
+ ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(
+ baos.toByteArray()));
+ Object o2 = ois.readObject();
+ ois.close();
+
+ // Compare content
+ for(Field f : clazz.getFields()) {
+ assertEquals(f.get(o1), f.get(o2));
+ }
+ }
}
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectStreamClassTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectStreamClassTest.java
index 7ae4617..948059b 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectStreamClassTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/ObjectStreamClassTest.java
@@ -17,16 +17,22 @@
package org.apache.harmony.tests.java.io;
-import junit.framework.TestCase;
+import dalvik.system.DexFile;
import java.io.Externalizable;
+import java.io.File;
import java.io.IOException;
+import java.io.InputStream;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.ObjectStreamClass;
import java.io.ObjectStreamField;
import java.io.Serializable;
+import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
+import java.nio.file.Files;
+import java.nio.file.StandardCopyOption;
+import junit.framework.TestCase;
public class ObjectStreamClassTest extends TestCase {
@@ -294,4 +300,27 @@
hasStaticInitializer.invoke(null, NoClinitChildWithNoClinitParent.class,
true /* checkSuperclass */));
}
+
+ // http://b/29721023
+ public void testClassWithSameFieldName() throws Exception {
+ // Load class from dex, it's not possible to create a class with same-named
+ // fields in java (but it's allowed in dex).
+ File sameFieldNames = File.createTempFile("sameFieldNames", ".dex");
+ InputStream dexIs = this.getClass().getClassLoader().
+ getResourceAsStream("tests/api/java/io/sameFieldNames.dex");
+ assertNotNull(dexIs);
+
+ try {
+ Files.copy(dexIs, sameFieldNames.toPath(), StandardCopyOption.REPLACE_EXISTING);
+ DexFile dexFile = new DexFile(sameFieldNames);
+ Class<?> clazz = dexFile.loadClass("sameFieldNames", getClass().getClassLoader());
+ ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);
+ assertEquals(4, osc.getFields().length);
+ dexFile.close();
+ } finally {
+ if (sameFieldNames.exists()) {
+ sameFieldNames.delete();
+ }
+ }
+ }
}
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessBuilderTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessBuilderTest.java
index 87cf88c..2fea31a 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessBuilderTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessBuilderTest.java
@@ -4,9 +4,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -168,4 +168,13 @@
assertTrue(err.read(buf) > 0);
}
}
+
+ public void testNullInCommand() {
+ ProcessBuilder pb = new ProcessBuilder("ls", "with\u0000inside");
+ try {
+ pb.start();
+ fail();
+ } catch(IOException expected) {}
+ }
+
}
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessTest.java
index a5b6509..cf6f89e 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/ProcessTest.java
@@ -23,6 +23,7 @@
import java.io.OutputStream;
import java.util.ArrayList;
import libcore.io.Libcore;
+import java.util.concurrent.TimeUnit;
public class ProcessTest extends junit.framework.TestCase {
// Test that failures to exec don't leave zombies lying around.
@@ -140,4 +141,45 @@
process.destroy();
process.destroy();
}
+
+ public void test_destroyForcibly() throws Exception {
+ String[] commands = { "sh", "-c", "sleep 3000"};
+ Process process = Runtime.getRuntime().exec(commands, null, null);
+ assertNotNull(process.destroyForcibly());
+ process.waitFor(); // destroy is asynchronous.
+ assertTrue(process.exitValue() != 0);
+ }
+
+ public void test_isAlive() throws Exception {
+ String[] commands = { "sh", "-c", "sleep 3000"};
+ Process process = Runtime.getRuntime().exec(commands, null, null);
+ assertTrue(process.isAlive());
+ assertNotNull(process.destroyForcibly());
+ process.waitFor(); // destroy is asynchronous.
+ assertFalse(process.isAlive());
+ }
+
+ public void test_waitForTimeout() throws Exception {
+ String[] commands = { "sh", "-c", "sleep 3000"};
+ Process process = Runtime.getRuntime().exec(commands, null, null);
+ assertFalse(process.waitFor(0, TimeUnit.MICROSECONDS));
+ assertTrue(process.isAlive());
+ assertFalse(process.waitFor(500, TimeUnit.MICROSECONDS));
+ assertTrue(process.isAlive());
+ assertNotNull(process.destroyForcibly());
+ assertTrue(process.waitFor(2, TimeUnit.SECONDS));
+ assertFalse(process.isAlive());
+ }
+
+ public void test_waitForTimeout_NPE() throws Exception {
+ String[] commands = { "sh", "-c", "sleep 3000"};
+ Process process = Runtime.getRuntime().exec(commands, null, null);
+ try {
+ process.waitFor(500, null);
+ fail();
+ } catch(NullPointerException expected) {}
+ assertNotNull(process.destroyForcibly());
+ process.waitFor();
+ }
+
}
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/HttpCookieTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/HttpCookieTest.java
index e8d2ba9..3282616 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/HttpCookieTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/net/HttpCookieTest.java
@@ -164,6 +164,10 @@
match = HttpCookie.domainMatches(null, "b.a.AJAX.com");
assertFalse(match);
+
+ // JDK-7023713
+ match = HttpCookie.domainMatches("hostname.local", "hostname");
+ assertTrue(match);
}
/**
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ChoiceFormatTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ChoiceFormatTest.java
index e7acfdf..d2f4ca3 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ChoiceFormatTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ChoiceFormatTest.java
@@ -294,35 +294,6 @@
}
/**
- * @tests java.text.ChoiceFormat#getFormats()
- */
- public void test_getFormats() {
- // Test for method java.lang.Object []
- // java.text.ChoiceFormat.getFormats()
- String[] orgFormats = (String[]) formats.clone();
- String[] f = (String[]) f1.getFormats();
- // getFormats() documentation says "Get the formats passed in the constructor",
- // which can be interpreted as object identity.
- assertTrue("Wrong formats", f == formats);
- f[0] = "Modified";
- assertTrue("Formats copied", f != orgFormats);
- }
-
- /**
- * @tests java.text.ChoiceFormat#getLimits()
- */
- public void test_getLimits() {
- // Test for method double [] java.text.ChoiceFormat.getLimits()
- double[] orgLimits = (double[]) limits.clone();
- double[] l = f1.getLimits();
- // getLimits() documentation says "Get the limits passed in the constructor",
- // which can be interpreted as object identity.
- assertTrue("Wrong limits", l == limits);
- l[0] = 3.14527;
- assertTrue("Limits copied", l != orgLimits);
- }
-
- /**
* @tests java.text.ChoiceFormat#hashCode()
*/
public void test_hashCode() {
@@ -394,20 +365,6 @@
.previousDouble(Double.NaN)));
}
- /**
- * @tests java.text.ChoiceFormat#setChoices(double[], java.lang.String[])
- */
- public void test_setChoices$D$Ljava_lang_String() {
- // Test for method void java.text.ChoiceFormat.setChoices(double [],
- // java.lang.String [])
- ChoiceFormat f = (ChoiceFormat) f1.clone();
- double[] l = new double[] { 0, 1 };
- String[] fs = new String[] { "0", "1" };
- f.setChoices(l, fs);
- assertTrue("Limits copied", f.getLimits() == l);
- assertTrue("Formats copied", f.getFormats() == fs);
- }
-
/**
* @tests java.text.ChoiceFormat#toPattern()
*/
diff --git a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ParseExceptionTest.java b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ParseExceptionTest.java
index c73d8e3..307cfb6 100644
--- a/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ParseExceptionTest.java
+++ b/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ParseExceptionTest.java
@@ -16,6 +16,8 @@
*/
package org.apache.harmony.tests.java.text;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
import java.text.DateFormat;
import java.text.ParseException;
@@ -46,4 +48,17 @@
assertEquals("getErrorOffsetFailed.", 4, e.getErrorOffset());
}
}
+
+ public void test_serialize() throws Exception {
+ try (InputStream inputStream = getClass().getResourceAsStream(
+ "/serialization/org/apache/harmony/tests/java/text/ParseException.ser");
+ ObjectInputStream ois = new ObjectInputStream(inputStream)) {
+
+ Object object = ois.readObject();
+ assertTrue("Not a ParseException", object instanceof ParseException);
+ ParseException parseException = (ParseException) object;
+ assertEquals("fred", parseException.getMessage());
+ assertEquals(4, parseException.getErrorOffset());
+ }
+ }
}
diff --git a/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/text/ParseException.ser b/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/text/ParseException.ser
new file mode 100644
index 0000000..a25d6b1
--- /dev/null
+++ b/harmony-tests/src/test/resources/serialization/org/apache/harmony/tests/java/text/ParseException.ser
Binary files differ
diff --git a/luni/src/main/java/java/math/BigDecimal.java b/luni/src/main/java/java/math/BigDecimal.java
index 4bc8dae..d03b66f 100644
--- a/luni/src/main/java/java/math/BigDecimal.java
+++ b/luni/src/main/java/java/math/BigDecimal.java
@@ -937,8 +937,14 @@
}
/* Let be: this = [u1,s1] and multiplicand = [u2,s2] so:
* this x multiplicand = [ s1 * s2 , s1 + s2 ] */
- if(this.bitLength + multiplicand.bitLength < 64) {
- return valueOf(this.smallValue*multiplicand.smallValue, safeLongToInt(newScale));
+ if (this.bitLength + multiplicand.bitLength < 64) {
+ long unscaledValue = this.smallValue * multiplicand.smallValue;
+ // b/19185440 Case where result should be +2^63 but unscaledValue overflowed to -2^63
+ boolean longMultiplicationOverflowed = (unscaledValue == Long.MIN_VALUE) &&
+ (Math.signum(smallValue) * Math.signum(multiplicand.smallValue) > 0);
+ if (!longMultiplicationOverflowed) {
+ return valueOf(unscaledValue, safeLongToInt(newScale));
+ }
}
return new BigDecimal(this.getUnscaledValue().multiply(
multiplicand.getUnscaledValue()), safeLongToInt(newScale));
diff --git a/luni/src/test/java/libcore/java/io/InterruptedStreamTest.java b/luni/src/test/java/libcore/java/io/InterruptedStreamTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/libcore/java/io/OldBufferedReaderTest.java b/luni/src/test/java/libcore/java/io/OldBufferedReaderTest.java
index 986c672..00c5389 100644
--- a/luni/src/test/java/libcore/java/io/OldBufferedReaderTest.java
+++ b/luni/src/test/java/libcore/java/io/OldBufferedReaderTest.java
@@ -387,11 +387,6 @@
PrintWriter pw = new PrintWriter(new OutputStreamWriter(pos));
pw.print("hello, world\r");
pw.flush();
- try {
- Thread.sleep(2*60*1000);
- } catch (InterruptedException ex) {
- fail();
- }
}
};
t.start();
diff --git a/luni/src/test/java/libcore/java/lang/OldAndroidMathTest.java b/luni/src/test/java/libcore/java/lang/OldAndroidMathTest.java
index c18f2bd..ab6cfe6 100644
--- a/luni/src/test/java/libcore/java/lang/OldAndroidMathTest.java
+++ b/luni/src/test/java/libcore/java/lang/OldAndroidMathTest.java
@@ -20,6 +20,8 @@
import junit.framework.Assert;
import junit.framework.TestCase;
+import static java.lang.Math.PI;
+
public class OldAndroidMathTest extends TestCase {
private static final double HYP = Math.sqrt(2.0);
@@ -101,13 +103,51 @@
double answer = Math.tan(Math.atan(1.0));
assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
&& answer >= 9.9999999999999983E-1);
+
+ assertEquals("wrong atan(1)", PI / 4, Math.atan(1d), 0);
+ assertEquals("wrong atan(-1)", -PI / 4, Math.atan(-1), 0);
+ assertEquals("wrong atan(+INF)", PI / 2, Math.atan(Double.POSITIVE_INFINITY), 0);
+ assertEquals("wrong atan(-INF)", -PI / 2, Math.atan(Double.NEGATIVE_INFINITY), 0);
+ }
+
+ public void testAtanDZeroValues() {
+ double negativeZero = Math.copySign(0d, -1d);
+ assertEquals("wrong value for atan(0)", 0, Math.atan(0d), 0);
+ assertTrue("Wrong sign for atan(0)", Math.copySign(1, Math.atan(0d)) == 1);
+
+ assertEquals("wrong value for atan(-0)", negativeZero, Math.atan(negativeZero), 0);
+ assertTrue("Wrong sign for atan(-0)", Math.copySign(1, Math.atan(negativeZero)) == -1);
}
public void testAtan2DD() {
- // Test for method double java.lang.Math.atan2(double, double)
- double answer = Math.atan(Math.tan(1.0));
- assertTrue("Returned incorrect arc tangent: " + answer, answer <= 1.0
- && answer >= 9.9999999999999983E-1);
+ // Verify values are put in the correct quadrants.
+ assertEquals("wrong atan2(0, 1)", 0, Math.atan2(0, 1), 0);
+ assertEquals("wrong atan2(1, 1)", PI / 4, Math.atan2(1, 1), 0);
+ assertEquals("wrong atan2(1, 0)", PI / 2, Math.atan2(1, 0), 0);
+ assertEquals("wrong atan2(1, -1)", 3 * PI / 4, Math.atan2(1, -1), 0);
+ assertEquals("wrong atan2(0, -1)", PI, Math.atan2(0, -1), 0);
+ assertEquals("wrong atan2(-1, -1)", -3 * PI / 4, Math.atan2(-1, -1), 0);
+ assertEquals("wrong atan2(-1, 0)", -PI / 2, Math.atan2(-1, 0), 0);
+ assertEquals("wrong atan2(-1, 1)", -PI / 4, Math.atan2(-1, 1), 0);
+
+ // Check numeric values.
+ assertEquals("atan2(42, 42) != atan2(1, 1)", Math.atan2(1, 1), Math.atan2(42, 42), 0);
+ assertEquals("wrong atan2(2, 1)", Math.atan(2), Math.atan2(2, 1), 0);
+ assertEquals("wrong atan2(5, 3)", Math.atan(5d / 3), Math.atan2(5, 3), 0);
+ assertEquals("wrong atan2(9, 10)", Math.atan(9d / 10), Math.atan2(9, 10), 0);
+ assertEquals("wrong atan2(-10, 5)", Math.atan(-10d / 5), Math.atan2(-10, 5), 0);
+ }
+
+ public void testAtan2DDZeroValues() {
+ double negativeZero = Math.copySign(0d, -1d);
+ assertEquals("wrong atan2(+0, +0)", 0, Math.atan2(+0, +0), 0);
+ assertTrue("Wrong sign for atan2(+0, +0)",
+ Math.copySign(1, Math.atan2(+0, +0)) == 1);;
+ assertEquals("wrong atan2(+0, -0)", PI, Math.atan2(+0, negativeZero), 0);
+ assertEquals("wrong atan2(-0, +0)", -0, Math.atan2(negativeZero, +0), 0);
+ assertTrue("Wrong sign for atan2(-0, +0)",
+ Math.copySign(1, Math.atan2(negativeZero, +0)) == -1);
+ assertEquals("wrong atan2(-0, -0)", -PI, Math.atan2(negativeZero, negativeZero), 0);
}
public void testCbrtD() {
@@ -560,7 +600,7 @@
assertEquals("Wrong value E",
4613303445314885481L, Double.doubleToLongBits(Math.E));
assertEquals("Wrong value PI",
- 4614256656552045848L, Double.doubleToLongBits(Math.PI));
+ 4614256656552045848L, Double.doubleToLongBits(PI));
for (int i = 500; i >= 0; i--) {
double d = Math.random();
diff --git a/luni/src/test/java/libcore/java/lang/OldAndroidMonitorTest.java b/luni/src/test/java/libcore/java/lang/OldAndroidMonitorTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/libcore/java/math/BigDecimalTest.java b/luni/src/test/java/libcore/java/math/BigDecimalTest.java
index a9a796c..9f55272 100644
--- a/luni/src/test/java/libcore/java/math/BigDecimalTest.java
+++ b/luni/src/test/java/libcore/java/math/BigDecimalTest.java
@@ -24,6 +24,8 @@
import junit.framework.TestCase;
+import static java.math.BigDecimal.valueOf;
+
public final class BigDecimalTest extends TestCase {
public void testGetPrecision() {
@@ -115,7 +117,7 @@
BigDecimal zero = BigDecimal.ZERO;
zero = zero.setScale(2, RoundingMode.HALF_EVEN);
- BigDecimal other = BigDecimal.valueOf(999999998000000001.00);
+ BigDecimal other = valueOf(999999998000000001.00);
other = other.setScale(2, RoundingMode.HALF_EVEN);
assertFalse(zero.equals(other));
@@ -203,6 +205,62 @@
}
}
+ public void testNegate() {
+ checkNegate(valueOf(0), valueOf(0));
+ checkNegate(valueOf(1), valueOf(-1));
+ checkNegate(valueOf(43), valueOf(-43));
+ checkNegate(valueOf(Long.MAX_VALUE), valueOf(-Long.MAX_VALUE));
+ checkNegate(new BigDecimal("9223372036854775808"), valueOf(Long.MIN_VALUE));
+ // arbitrary large decimal
+ checkNegate(new BigDecimal("342343243546465623424321423112321.43243434343412321"),
+ new BigDecimal("-342343243546465623424321423112321.43243434343412321"));
+ }
+
+ private static void checkNegate(BigDecimal a, BigDecimal b) {
+ if (!a.toString().equals("0")) {
+ assertFalse(a.equals(b));
+ }
+ assertEquals(a.negate(), b);
+ assertEquals(a, b.negate());
+ assertEquals(a, a.negate().negate());
+ }
+
+ public void testAddAndSubtract_near64BitOverflow() throws Exception {
+ // Check that the test is set up correctly - these values should be MIN_VALUE and MAX_VALUE
+ assertEquals("-9223372036854775808", Long.toString(Long.MIN_VALUE));
+ assertEquals("9223372036854775807", Long.toString(Long.MAX_VALUE));
+
+ // Exactly MIN_VALUE and MAX_VALUE
+ assertSum("-9223372036854775808", -(1L << 62L), -(1L << 62L));
+ assertSum("9223372036854775807", (1L << 62L) - 1L, 1L << 62L);
+
+ // One beyond MIN_VALUE and MAX_VALUE
+ assertSum("-9223372036854775809", -(1L << 62L), -(1L << 62L) - 1);
+ assertSum("-9223372036854775809", Long.MIN_VALUE + 1, -2);
+ assertSum("9223372036854775808", 1L << 62L, 1L << 62L);
+ assertSum("9223372036854775808", Long.MAX_VALUE, 1);
+ }
+
+ /**
+ * Assert that {@code (a + b), (b + a), (a - (-b)) and (b - (-a))} all have the same
+ * expected result in BigDecimal arithmetic.
+ */
+ private static void assertSum(String expectedSumAsString, long a, long b) {
+ if (a == Long.MIN_VALUE || b == Long.MIN_VALUE) {
+ // - (Long.MIN_VALUE) can't be represented as a long, so don't allow it here.
+ throw new IllegalArgumentException("Long.MIN_VALUE not allowed");
+ }
+ BigDecimal bigA = valueOf(a);
+ BigDecimal bigB = valueOf(b);
+ BigDecimal bigMinusB = valueOf(-b);
+ BigDecimal bigMinusA = valueOf(-a);
+
+ assertEquals("a + b", expectedSumAsString, bigA.add(bigB).toString());
+ assertEquals("b + a", expectedSumAsString, bigB.add(bigA).toString());
+ assertEquals("a - (-b)", expectedSumAsString, bigA.subtract(bigMinusB).toString());
+ assertEquals("b - (-a)", expectedSumAsString, bigB.subtract(bigMinusA).toString());
+ }
+
/**
* Tests that Long.MIN_VALUE / -1 doesn't overflow back to Long.MIN_VALUE,
* like it would in long arithmetic.
@@ -248,7 +306,119 @@
new BigDecimal("9223372036854775808"),
new BigDecimal("-4611686018427387904").divide(
new BigDecimal("-5E-1"), /* scale = */ 0, RoundingMode.UNNECESSARY));
+ }
+ /**
+ * Tests addition, subtraction, multiplication and division involving a range of
+ * even long values and 1/2 of that value.
+ */
+ public void testCommonOperations_halfOfEvenLongValue() {
+ checkCommonOperations(0);
+ checkCommonOperations(2);
+ checkCommonOperations(-2);
+ checkCommonOperations(Long.MIN_VALUE);
+ checkCommonOperations(1L << 62L);
+ checkCommonOperations(-(1L << 62L));
+ checkCommonOperations(1L << 62L + 1 << 30 + 1 << 10);
+ checkCommonOperations(Long.MAX_VALUE - 1);
+ }
+
+ private static void checkCommonOperations(long value) {
+ if (value % 2 != 0) {
+ throw new IllegalArgumentException("Expected even value, got " + value);
+ }
+ BigDecimal bigHalfValue = valueOf(value / 2);
+ BigDecimal bigValue = valueOf(value);
+ BigDecimal two = valueOf(2);
+
+ assertEquals(bigValue, bigHalfValue.multiply(two));
+ assertEquals(bigValue, bigHalfValue.add(bigHalfValue));
+ assertEquals(bigHalfValue, bigValue.subtract(bigHalfValue));
+ assertEquals(bigHalfValue, bigValue.divide(two, RoundingMode.UNNECESSARY));
+ if (value != 0) {
+ assertEquals(two, bigValue.divide(bigHalfValue, RoundingMode.UNNECESSARY));
+ }
+ }
+
+ /**
+ * Tests that when long multiplication doesn't overflow, its result is consistent with
+ * BigDecimal multiplication.
+ */
+ public void testMultiply_consistentWithLong() {
+ checkMultiply_consistentWithLong(0, 0);
+ checkMultiply_consistentWithLong(0, 1);
+ checkMultiply_consistentWithLong(1, 1);
+ checkMultiply_consistentWithLong(2, 3);
+ checkMultiply_consistentWithLong(123, 456);
+ checkMultiply_consistentWithLong(9, 9);
+ checkMultiply_consistentWithLong(34545, 3423421);
+ checkMultiply_consistentWithLong(5465653, 342343234568L);
+ checkMultiply_consistentWithLong(Integer.MAX_VALUE, Integer.MAX_VALUE);
+ checkMultiply_consistentWithLong((1L << 40) + 454L, 34324);
+ }
+
+ private void checkMultiply_consistentWithLong(long a, long b) {
+ // Guard against the test using examples that overflow. This condition here is
+ // not meant to be exact, it'll reject some values that wouldn't overflow.
+ if (a != 0 && b != 0 && Math.abs(Long.MAX_VALUE / a) <= Math.abs(b)) {
+ throw new IllegalArgumentException("Multiplication might overflow: " + a + " * " + b);
+ }
+ long expectedResult = a * b;
+ // check the easy case with no decimals
+ assertEquals(Long.toString(expectedResult),
+ valueOf(a).multiply(valueOf(b)).toString());
+ // number with 2 decimals * number with 3 decimals => number with 5 decimals
+ // E.g. 9E-2 * 2E-3 == 18E-5 == 0.00018
+ // valueOf(unscaledValue, scale) corresponds to {@code unscaledValue * 10<sup>-scale</sup>}
+ assertEquals(valueOf(expectedResult, 5), valueOf(a, 2).multiply(valueOf(b, 3)));
+ }
+
+ public void testMultiply_near64BitOverflow_scaled() {
+ // -((2^31) / 100) * (-2/10) == (2^64)/1000
+ assertEquals("9223372036854775.808",
+ valueOf(-(1L << 62L), 2).multiply(valueOf(-2, 1)).toString());
+
+ // -((2^31) / 100) * (2/10) == -(2^64)/1000
+ assertEquals("-9223372036854775.808",
+ valueOf(-(1L << 62L), 2).multiply(valueOf(2, 1)).toString());
+
+ // -((2^31) * 100) * (-2/10) == (2^64) * 10
+ assertEquals(new BigDecimal("9223372036854775808E1"),
+ valueOf(-(1L << 62L), -2).multiply(valueOf(-2, 1)));
+ }
+
+ /** Tests multiplications whose result is near 2^63 (= Long.MAX_VALUE + 1). */
+ public void testMultiply_near64BitOverflow_positive() {
+ // Results of exactly +2^63, which doesn't fit into a long even though -2^63 does
+ assertEquals("9223372036854775808", bigMultiply(Long.MIN_VALUE, -1).toString());
+ assertEquals("9223372036854775808", bigMultiply(Long.MIN_VALUE / 2, -2).toString());
+ assertEquals("9223372036854775808", bigMultiply(-(Long.MIN_VALUE / 2), 2).toString());
+ assertEquals("9223372036854775808", bigMultiply(1L << 31, 1L << 32).toString());
+ assertEquals("9223372036854775808", bigMultiply(-(1L << 31), -(1L << 32)).toString());
+
+ // Results near but not exactly +2^63
+ assertEquals("9223372036854775806", bigMultiply(2147483647, 4294967298L).toString());
+ assertEquals("9223372036854775807", bigMultiply(Long.MAX_VALUE, 1).toString());
+ assertEquals("9223372036854775807", bigMultiply(42128471623L, 218934409L).toString());
+ assertEquals("9223372036854775809", bigMultiply(77158673929L, 119537721L).toString());
+ assertEquals("9223372036854775810", bigMultiply((1L << 62L) + 1, 2).toString());
+ }
+
+ /** Tests multiplications whose result is near -2^63 (= Long.MIN_VALUE). */
+ public void testMultiply_near64BitOverflow_negative() {
+ assertEquals("-9223372036854775808", bigMultiply(Long.MIN_VALUE, 1).toString());
+ assertEquals("-9223372036854775808", bigMultiply(Long.MIN_VALUE / 2, 2).toString());
+ assertEquals("-9223372036854775808", bigMultiply(-(1L << 31), 1L << 32).toString());
+ assertEquals("-9223372036854775807", bigMultiply(-42128471623L, 218934409L).toString());
+ assertEquals("-9223372036854775810", bigMultiply(-(Long.MIN_VALUE / 2) + 1, -2).toString());
+ }
+
+ private static BigDecimal bigMultiply(long a, long b) {
+ BigDecimal bigA = valueOf(a);
+ BigDecimal bigB = valueOf(b);
+ BigDecimal result = bigA.multiply(bigB);
+ assertEquals("Multiplication should be commutative", result, bigB.multiply(bigA));
+ return result;
}
}
diff --git a/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java b/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
index 2aea4ef..2f1221d 100644
--- a/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
+++ b/luni/src/test/java/libcore/java/net/OldURLClassLoaderTest.java
@@ -134,6 +134,17 @@
}
}
+ // JDK-8057936
+ public void testFindClass() {
+ TestURLClassLoader tucl = new TestURLClassLoader(new URL[0]);
+
+ // Should throw ClassNotFoundException instead of NPE.
+ try {
+ tucl.findClass("foobar");
+ fail();
+ } catch (ClassNotFoundException expected) { }
+ }
+
public void test_definePackage() throws MalformedURLException {
Manifest manifest = new Manifest();
URL[] u = new URL[0];
diff --git a/luni/src/test/java/libcore/java/net/URITest.java b/luni/src/test/java/libcore/java/net/URITest.java
index edc6577..67504d4 100644
--- a/luni/src/test/java/libcore/java/net/URITest.java
+++ b/luni/src/test/java/libcore/java/net/URITest.java
@@ -738,5 +738,18 @@
assertNull(new URI("http://example..com/").getHost());
}
+ public void test_JDK7171415() {
+ URI lower, mixed;
+ lower = URI.create("http://www.example.com/%2b");
+ mixed = URI.create("http://wWw.ExAmPlE.com/%2B");
+ assertTrue(lower.equals(mixed));
+ assertEquals(lower.hashCode(), mixed.hashCode());
+
+ lower = URI.create("http://www.example.com/%2bbb");
+ mixed = URI.create("http://wWw.ExAmPlE.com/%2BbB");
+ assertFalse(lower.equals(mixed));
+ assertFalse(lower.hashCode() == mixed.hashCode());
+ }
+
// Adding a new test? Consider adding an equivalent test to URLTest.java
}
diff --git a/luni/src/test/java/libcore/java/net/URLConnectionTest.java b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
index 7873e99..120df10 100644
--- a/luni/src/test/java/libcore/java/net/URLConnectionTest.java
+++ b/luni/src/test/java/libcore/java/net/URLConnectionTest.java
@@ -23,6 +23,8 @@
import com.google.mockwebserver.SocketPolicy;
import com.android.okhttp.AndroidShimResponseCache;
+import com.android.okhttp.internal.Platform;
+import com.android.okhttp.internal.tls.TrustRootIndex;
import junit.framework.TestCase;
@@ -914,11 +916,15 @@
*/
public void testProxyConnectIncludesProxyHeadersOnly()
throws IOException, InterruptedException {
+ Authenticator.setDefault(new SimpleAuthenticator());
RecordingHostnameVerifier hostnameVerifier = new RecordingHostnameVerifier();
TestSSLContext testSSLContext = createDefaultTestSSLContext();
server.useHttps(testSSLContext.serverContext.getSocketFactory(), true);
server.enqueue(new MockResponse()
+ .setResponseCode(407)
+ .addHeader("Proxy-Authenticate: Basic realm=\"localhost\""));
+ server.enqueue(new MockResponse()
.setSocketPolicy(SocketPolicy.UPGRADE_TO_SSL_AT_END)
.clearHeaders());
server.enqueue(new MockResponse().setBody("encrypted response from the origin server"));
@@ -928,18 +934,34 @@
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection(
server.toProxyAddress());
connection.addRequestProperty("Private", "Secret");
- connection.addRequestProperty("Proxy-Authorization", "bar");
connection.addRequestProperty("User-Agent", "baz");
connection.setSSLSocketFactory(testSSLContext.clientContext.getSocketFactory());
connection.setHostnameVerifier(hostnameVerifier);
assertContent("encrypted response from the origin server", connection);
- RecordedRequest connect = server.takeRequest();
- assertContainsNoneMatching(connect.getHeaders(), "Private.*");
- assertContains(connect.getHeaders(), "Proxy-Authorization: bar");
- assertContains(connect.getHeaders(), "User-Agent: baz");
- assertContains(connect.getHeaders(), "Host: android.com");
- assertContains(connect.getHeaders(), "Proxy-Connection: Keep-Alive");
+ // connect1 and connect2 are tunnel requests which potentially tunnel multiple requests;
+ // Thus we can't expect its headers to exactly match those of the wrapped request.
+ // See https://github.com/square/okhttp/commit/457fb428a729c50c562822571ea9b13e689648f3
+
+ {
+ RecordedRequest connect1 = server.takeRequest();
+ List<String> headers = connect1.getHeaders();
+ assertContainsNoneMatching(headers, "Private.*");
+ assertContainsNoneMatching(headers, "Proxy\\-Authorization.*");
+ assertHeaderPresent(connect1, "User-Agent");
+ assertContains(headers, "Host: android.com");
+ assertContains(headers, "Proxy-Connection: Keep-Alive");
+ }
+
+ {
+ RecordedRequest connect2 = server.takeRequest();
+ List<String> headers = connect2.getHeaders();
+ assertContainsNoneMatching(headers, "Private.*");
+ assertHeaderPresent(connect2, "Proxy-Authorization");
+ assertHeaderPresent(connect2, "User-Agent");
+ assertContains(headers, "Host: android.com");
+ assertContains(headers, "Proxy-Connection: Keep-Alive");
+ }
RecordedRequest get = server.takeRequest();
assertContains(get.getHeaders(), "Private: Secret");
@@ -1804,8 +1826,10 @@
// The first URI will be the initial request. We want to inspect the redirect.
URI uri = proxySelectorUris.get(1);
- // The HttpURLConnectionImpl converts %0 -> %250. i.e. it escapes the %.
- assertEquals(redirectPath + "?foo=%250&bar=%00", uri.toString());
+ // The proxy is selected by Address alone (not the whole target URI).
+ // In OkHttp, HttpEngine.createAddress() converts to an Address and the
+ // RouteSelector converts back to address.url().
+ assertEquals(server2.getUrl("/").toString(), uri.toString());
} finally {
ProxySelector.setDefault(originalSelector);
server2.shutdown();
@@ -2835,6 +2859,65 @@
}
/**
+ * Checks that OkHttp's certificate pinning logic is not used for the common case
+ * of HttpsUrlConnections.
+ *
+ * <p>OkHttp 2.7 introduced logic for Certificate Pinning. We deliberately don't
+ * expose any API surface that would interact with OkHttp's implementation because
+ * Android has its own API / implementation for certificate pinning. We can't
+ * easily test that there is *no* code path that would invoke OkHttp's certificate
+ * pinning logic, so this test only covers the *common* code path of a
+ * HttpsURLConnection as a sanity check.
+ *
+ * <p>To check whether OkHttp performs certificate pinning under the hood, this
+ * test disables two {@link Platform} methods. In OkHttp 2.7.5, these two methods
+ * are exclusively used in relation to certificate pinning. Android only provides
+ * the minimal implementation of these methods to get OkHttp's tests to pass, so
+ * they should never be invoked outside of OkHttp's tests.
+ */
+ public void testTrustManagerAndTrustRootIndex_unusedForHttpsConnection() throws Exception {
+ Platform platform = Platform.getAndSetForTest(new PlatformWithoutTrustManager());
+ try {
+ testConnectViaHttps();
+ } finally {
+ Platform.getAndSetForTest(platform);
+ }
+ }
+
+ /**
+ * Similar to {@link #testTrustManagerAndTrustRootIndex_unusedForHttpsConnection()},
+ * but for the HTTP case. In the HTTP case, no certificate or trust management
+ * related logic should ever be involved at all, so some pretty basic things must
+ * be going wrong in order for this test to (unexpectedly) invoke the corresponding
+ * Platform methods.
+ */
+ public void testTrustManagerAndTrustRootIndex_unusedForHttpConnection() throws Exception {
+ Platform platform = Platform.getAndSetForTest(new PlatformWithoutTrustManager());
+ try {
+ server.enqueue(new MockResponse().setBody("response").setResponseCode(200));
+ server.play();
+ HttpURLConnection urlConnection =
+ (HttpURLConnection) server.getUrl("/").openConnection();
+ assertEquals(200, urlConnection.getResponseCode());
+ } finally {
+ Platform.getAndSetForTest(platform);
+ }
+ }
+
+ /**
+ * A {@link Platform} that doesn't support two methods that, in OkHttp 2.7.5,
+ * are exclusively used to provide custom CertificatePinning.
+ */
+ static class PlatformWithoutTrustManager extends Platform {
+ @Override public X509TrustManager trustManager(SSLSocketFactory sslSocketFactory) {
+ throw new AssertionError("Unexpected call");
+ }
+ @Override public TrustRootIndex trustRootIndex(X509TrustManager trustManager) {
+ throw new AssertionError("Unexpected call");
+ }
+ }
+
+ /**
* Returns a gzipped copy of {@code bytes}.
*/
public byte[] gzip(byte[] bytes) throws IOException {
@@ -2860,6 +2943,11 @@
assertContent(expected, connection, Integer.MAX_VALUE);
}
+ private static void assertHeaderPresent(RecordedRequest request, String headerName) {
+ assertNotNull(headerName + " missing: " + request.getHeaders(),
+ request.getHeader(headerName));
+ }
+
private void assertContains(List<String> list, String value) {
assertTrue(list.toString(), list.contains(value));
}
diff --git a/luni/src/test/java/libcore/java/nio/channels/MembershipKeyTest.java b/luni/src/test/java/libcore/java/nio/channels/MembershipKeyTest.java
index 18dc615..40c2cac 100644
--- a/luni/src/test/java/libcore/java/nio/channels/MembershipKeyTest.java
+++ b/luni/src/test/java/libcore/java/nio/channels/MembershipKeyTest.java
@@ -36,7 +36,6 @@
public class MembershipKeyTest extends TestCase {
private MembershipKey key;
- private MembershipKey keyWithSource;
private final int PORT = 5000;
private final String TEST_MESSAGE = "hello";
private DatagramChannel client;
@@ -50,7 +49,7 @@
client.configureBlocking(false);
if (withSource) {
- keyWithSource = client.join(MULTICAST_ADDRESS, NETWORK_INTERFACE, sourceAddress);
+ key = client.join(MULTICAST_ADDRESS, NETWORK_INTERFACE, sourceAddress);
} else {
key = client.join(MULTICAST_ADDRESS, NETWORK_INTERFACE);
}
@@ -164,7 +163,6 @@
setup(true);
try {
key.block(sourceAddress);
- fail();
} catch (IllegalStateException expected) {}
}
@@ -191,16 +189,19 @@
// Blocking a multicast channel
try {
key.block(Inet4Address.getByName("224.0.0.10"));
+ fail();
} catch (IllegalArgumentException expected) {}
// Different address type than the group
try {
key.block(Inet6Address.LOOPBACK);
+ fail();
} catch (IllegalArgumentException expected) {}
key.drop();
try {
key.block(sourceAddress);
+ fail();
} catch (IllegalStateException expected) {}
}
@@ -208,6 +209,7 @@
setup(true);
try {
key.unblock(Inet4Address.getByName("127.0.0.2"));
+ fail();
} catch (IllegalStateException expected) {}
}
@@ -239,12 +241,14 @@
setup(false);
try {
key.unblock(sourceAddress);
+ fail();
} catch (IllegalStateException expected) {}
key.drop();
try {
key.unblock(sourceAddress);
+ fail();
} catch (IllegalStateException expected) {}
}
diff --git a/luni/src/test/java/libcore/java/sql/OldConnectionTest.java b/luni/src/test/java/libcore/java/sql/OldConnectionTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/libcore/java/sql/OldPreparedStatementTest.java b/luni/src/test/java/libcore/java/sql/OldPreparedStatementTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/libcore/java/sql/OldResultSetMetaDataTest.java b/luni/src/test/java/libcore/java/sql/OldResultSetMetaDataTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/libcore/java/sql/OldSQLTest.java b/luni/src/test/java/libcore/java/sql/OldSQLTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/libcore/java/sql/OldStatementTest.java b/luni/src/test/java/libcore/java/sql/OldStatementTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/libcore/java/text/ChoiceFormatTest.java b/luni/src/test/java/libcore/java/text/ChoiceFormatTest.java
new file mode 100644
index 0000000..419ef34
--- /dev/null
+++ b/luni/src/test/java/libcore/java/text/ChoiceFormatTest.java
@@ -0,0 +1,75 @@
+package libcore.java.text;
+
+import java.text.ChoiceFormat;
+import junit.framework.TestCase;
+
+/**
+ */
+public class ChoiceFormatTest extends TestCase {
+
+ /**
+ * Limits for {@link ChoiceFormat}, will be modified by some tests to ensure that ChoiceFormat
+ * stores a copy of the arrays provided.
+ */
+ private final double[] limits = new double[] { 0, 1, 2, 3, 4 };
+
+ /**
+ * Format strings for {@link ChoiceFormat}, will be modified by some tests to ensure that
+ * ChoiceFormat stores a copy of the arrays provided.
+ */
+ private final String[] formats = new String[] { "zero", "one", "a couple", "a few", "some" };
+
+ public void testConstructor_doubleArray_StringArray() throws Exception {
+ ChoiceFormat format = new ChoiceFormat(limits, formats);
+
+ verifyChoiceFormatCopiesSuppliedArrays(format);
+ }
+
+ public void testSetChoices() throws Exception {
+ ChoiceFormat format = new ChoiceFormat(new double[] { 0 }, new String[] { "" });
+ assertEquals("", format.format(1.4));
+
+ // Change the limits.
+ format.setChoices(limits, formats);
+
+ verifyChoiceFormatCopiesSuppliedArrays(format);
+ }
+
+ private void verifyChoiceFormatCopiesSuppliedArrays(ChoiceFormat format) {
+ assertEquals("one", format.format(1.4));
+
+ // Change the formats array and make sure that it doesn't affect the ChoiceFormat.
+ formats[1] = "uno";
+ assertEquals("ChoiceFormat doesn't make defensive copies of formats array",
+ "one", format.format(1.4));
+
+ // Change the limits array and make sure that it doesn't affect the ChoiceFormat.
+ limits[2] = 1.2;
+ assertEquals("ChoiceFormat doesn't make defensive copies of limits array",
+ "one", format.format(1.4));
+ }
+
+ public void testGetLimits() throws Exception {
+ ChoiceFormat format = new ChoiceFormat(limits, formats);
+ assertEquals("some", format.format(100));
+
+ // Get the limits array, change the contents and make sure it doesn't affect the behavior
+ // of the format.
+ double[] copiedLimits = format.getLimits();
+ copiedLimits[4] = 200;
+ assertEquals("ChoiceFormat doesn't return a copy of choiceLimits array",
+ "some", format.format(100));
+ }
+
+ public void testGetFormats() throws Exception {
+ ChoiceFormat format = new ChoiceFormat(limits, formats);
+ assertEquals("zero", format.format(-4));
+
+ // Get the formats array, change the contents and make sure it doesn't affect the behavior
+ // of the format.
+ Object[] copiedFormats = format.getFormats();
+ copiedFormats[0] = "none or less";
+ assertEquals("ChoiceFormat doesn't return a copy of choiceFormats array",
+ "zero", format.format(-4));
+ }
+}
diff --git a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
index 77bf62f..d0e2995 100644
--- a/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
+++ b/luni/src/test/java/org/apache/harmony/security/tests/java/security/KeyStore3Test.java
@@ -48,32 +48,6 @@
private Certificate certificate;
- public KeyStore3Test() throws Exception {
- KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
- keyPair = keyPairGenerator.generateKeyPair();
-
- String certificateData = "-----BEGIN CERTIFICATE-----\n"
- + "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n"
- + "HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl\n"
- + "IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NzAyMjAwMDAwMDBa\n"
- + "Fw05ODAyMjAyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv\n"
- + "cm5pYTESMBAGA1UEBxMJUGFsbyBBbHRvMR8wHQYDVQQKExZTdW4gTWljcm9zeXN0\n"
- + "ZW1zLCBJbmMuMSEwHwYDVQQLExhUZXN0IGFuZCBFdmFsdWF0aW9uIE9ubHkxGjAY\n"
- + "BgNVBAMTEWFyZ29uLmVuZy5zdW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
- + "iQKBgQCofmdY+PiUWN01FOzEewf+GaG+lFf132UpzATmYJkA4AEA/juW7jSi+LJk\n"
- + "wJKi5GO4RyZoyimAL/5yIWDV6l1KlvxyKslr0REhMBaD/3Z3EsLTTEf5gVrQS6sT\n"
- + "WMoSZAyzB39kFfsB6oUXNtV8+UKKxSxKbxvhQn267PeCz5VX2QIDAQABMA0GCSqG\n"
- + "SIb3DQEBAgUAA34AXl3at6luiV/7I9MN5CXYoPJYI8Bcdc1hBagJvTMcmlqL2uOZ\n"
- + "H9T5hNMEL9Tk6aI7yZPXcw/xI2K6pOR/FrMp0UwJmdxX7ljV6ZtUZf7pY492UqwC\n"
- + "1777XQ9UEZyrKJvF5ntleeO0ayBqLGVKCWzWZX9YsXCpv47FNLZbupE=\n"
- + "-----END CERTIFICATE-----\n";
-
- ByteArrayInputStream certArray = new ByteArrayInputStream(
- certificateData.getBytes());
- CertificateFactory cf = CertificateFactory.getInstance("X.509");
- certificate = cf.generateCertificate(certArray);
- }
-
public void test_load() throws Exception {
// No exception should be thrown out.
mockKeyStore.load(null);
@@ -168,6 +142,29 @@
protected void setUp() throws Exception {
super.setUp();
+
+ KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("DSA");
+ keyPair = keyPairGenerator.generateKeyPair();
+
+ String certificateData = "-----BEGIN CERTIFICATE-----\n"
+ + "MIICZTCCAdICBQL3AAC2MA0GCSqGSIb3DQEBAgUAMF8xCzAJBgNVBAYTAlVTMSAw\n"
+ + "HgYDVQQKExdSU0EgRGF0YSBTZWN1cml0eSwgSW5jLjEuMCwGA1UECxMlU2VjdXJl\n"
+ + "IFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05NzAyMjAwMDAwMDBa\n"
+ + "Fw05ODAyMjAyMzU5NTlaMIGWMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv\n"
+ + "cm5pYTESMBAGA1UEBxMJUGFsbyBBbHRvMR8wHQYDVQQKExZTdW4gTWljcm9zeXN0\n"
+ + "ZW1zLCBJbmMuMSEwHwYDVQQLExhUZXN0IGFuZCBFdmFsdWF0aW9uIE9ubHkxGjAY\n"
+ + "BgNVBAMTEWFyZ29uLmVuZy5zdW4uY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB\n"
+ + "iQKBgQCofmdY+PiUWN01FOzEewf+GaG+lFf132UpzATmYJkA4AEA/juW7jSi+LJk\n"
+ + "wJKi5GO4RyZoyimAL/5yIWDV6l1KlvxyKslr0REhMBaD/3Z3EsLTTEf5gVrQS6sT\n"
+ + "WMoSZAyzB39kFfsB6oUXNtV8+UKKxSxKbxvhQn267PeCz5VX2QIDAQABMA0GCSqG\n"
+ + "SIb3DQEBAgUAA34AXl3at6luiV/7I9MN5CXYoPJYI8Bcdc1hBagJvTMcmlqL2uOZ\n"
+ + "H9T5hNMEL9Tk6aI7yZPXcw/xI2K6pOR/FrMp0UwJmdxX7ljV6ZtUZf7pY492UqwC\n"
+ + "1777XQ9UEZyrKJvF5ntleeO0ayBqLGVKCWzWZX9YsXCpv47FNLZbupE=\n"
+ + "-----END CERTIFICATE-----\n";
+ ByteArrayInputStream certArray = new ByteArrayInputStream(
+ certificateData.getBytes());
+ CertificateFactory cf = CertificateFactory.getInstance("X.509");
+ certificate = cf.generateCertificate(certArray);
mockKeyStore = new MyKeyStore(new MyKeyStoreSpi(), null, "MyKeyStore");
}
diff --git a/luni/src/test/java/tests/java/sql/DatabaseMetaDataTest.java b/luni/src/test/java/tests/java/sql/DatabaseMetaDataTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/java/sql/DeleteFunctionalityTest.java b/luni/src/test/java/tests/java/sql/DeleteFunctionalityTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/java/sql/InsertFunctionalityTest.java b/luni/src/test/java/tests/java/sql/InsertFunctionalityTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/java/sql/MultiThreadAccessTest.java b/luni/src/test/java/tests/java/sql/MultiThreadAccessTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/java/sql/SelectFunctionalityTest.java b/luni/src/test/java/tests/java/sql/SelectFunctionalityTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/java/sql/StressTest.java b/luni/src/test/java/tests/java/sql/StressTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest.java b/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java b/luni/src/test/java/tests/java/sql/UpdateFunctionalityTest2.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/java/tests/support/DatabaseCreator.java b/luni/src/test/java/tests/support/DatabaseCreator.java
old mode 100755
new mode 100644
diff --git a/luni/src/test/resources/tests/api/java/io/sameFieldNames.dex b/luni/src/test/resources/tests/api/java/io/sameFieldNames.dex
new file mode 100644
index 0000000..ada4935
--- /dev/null
+++ b/luni/src/test/resources/tests/api/java/io/sameFieldNames.dex
Binary files differ
diff --git a/luni/src/test/resources/tests/api/java/io/sameFieldNames.smali b/luni/src/test/resources/tests/api/java/io/sameFieldNames.smali
new file mode 100644
index 0000000..657b965
--- /dev/null
+++ b/luni/src/test/resources/tests/api/java/io/sameFieldNames.smali
@@ -0,0 +1,17 @@
+# Source for sameFieldNames.dex
+.class public LsameFieldNames;
+.super Ljava/lang/Object;
+.implements Ljava/io/Serializable;
+
+# Test multiple fields with the same name and different types.
+# (Invalid in Java language but valid in bytecode.)
+.field public a:J
+.field public a:I
+.field public a:Ljava/lang/Integer;
+.field public a:Ljava/lang/Long;
+
+.method public constructor <init>()V
+ .registers 2
+ invoke-direct {p0}, Ljava/lang/Object;-><init>()V
+ return-void
+.end method
diff --git a/ojluni/src/main/java/com/sun/net/ssl/internal/ssl/X509ExtendedTrustManager.java b/ojluni/src/main/java/com/sun/net/ssl/internal/ssl/X509ExtendedTrustManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/com/sun/security/cert/internal/x509/X509V1CertImpl.java b/ojluni/src/main/java/com/sun/security/cert/internal/x509/X509V1CertImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/awt/font/NumericShaper.java b/ojluni/src/main/java/java/awt/font/NumericShaper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/awt/font/TextAttribute.java b/ojluni/src/main/java/java/awt/font/TextAttribute.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/beans/ChangeListenerMap.java b/ojluni/src/main/java/java/beans/ChangeListenerMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/beans/IndexedPropertyChangeEvent.java b/ojluni/src/main/java/java/beans/IndexedPropertyChangeEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/beans/PropertyChangeEvent.java b/ojluni/src/main/java/java/beans/PropertyChangeEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/beans/PropertyChangeListener.java b/ojluni/src/main/java/java/beans/PropertyChangeListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/beans/PropertyChangeListenerProxy.java b/ojluni/src/main/java/java/beans/PropertyChangeListenerProxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/beans/PropertyChangeSupport.java b/ojluni/src/main/java/java/beans/PropertyChangeSupport.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Bits.java b/ojluni/src/main/java/java/io/Bits.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/BufferedInputStream.java b/ojluni/src/main/java/java/io/BufferedInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/BufferedOutputStream.java b/ojluni/src/main/java/java/io/BufferedOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/BufferedReader.java b/ojluni/src/main/java/java/io/BufferedReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/BufferedWriter.java b/ojluni/src/main/java/java/io/BufferedWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ByteArrayInputStream.java b/ojluni/src/main/java/java/io/ByteArrayInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ByteArrayOutputStream.java b/ojluni/src/main/java/java/io/ByteArrayOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/CharArrayReader.java b/ojluni/src/main/java/java/io/CharArrayReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/CharArrayWriter.java b/ojluni/src/main/java/java/io/CharArrayWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/CharConversionException.java b/ojluni/src/main/java/java/io/CharConversionException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Closeable.java b/ojluni/src/main/java/java/io/Closeable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Console.java b/ojluni/src/main/java/java/io/Console.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/DataInput.java b/ojluni/src/main/java/java/io/DataInput.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/DataInputStream.java b/ojluni/src/main/java/java/io/DataInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/DataOutput.java b/ojluni/src/main/java/java/io/DataOutput.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/DataOutputStream.java b/ojluni/src/main/java/java/io/DataOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/DeleteOnExitHook.java b/ojluni/src/main/java/java/io/DeleteOnExitHook.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/EOFException.java b/ojluni/src/main/java/java/io/EOFException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ExpiringCache.java b/ojluni/src/main/java/java/io/ExpiringCache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Externalizable.java b/ojluni/src/main/java/java/io/Externalizable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/File.java b/ojluni/src/main/java/java/io/File.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileDescriptor.java b/ojluni/src/main/java/java/io/FileDescriptor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileFilter.java b/ojluni/src/main/java/java/io/FileFilter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileInputStream.java b/ojluni/src/main/java/java/io/FileInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileNotFoundException.java b/ojluni/src/main/java/java/io/FileNotFoundException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileOutputStream.java b/ojluni/src/main/java/java/io/FileOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FilePermission.java b/ojluni/src/main/java/java/io/FilePermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileReader.java b/ojluni/src/main/java/java/io/FileReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileSystem.java b/ojluni/src/main/java/java/io/FileSystem.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FileWriter.java b/ojluni/src/main/java/java/io/FileWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FilenameFilter.java b/ojluni/src/main/java/java/io/FilenameFilter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FilterInputStream.java b/ojluni/src/main/java/java/io/FilterInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FilterOutputStream.java b/ojluni/src/main/java/java/io/FilterOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FilterReader.java b/ojluni/src/main/java/java/io/FilterReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/FilterWriter.java b/ojluni/src/main/java/java/io/FilterWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Flushable.java b/ojluni/src/main/java/java/io/Flushable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/IOError.java b/ojluni/src/main/java/java/io/IOError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/IOException.java b/ojluni/src/main/java/java/io/IOException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/InputStream.java b/ojluni/src/main/java/java/io/InputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/InputStreamReader.java b/ojluni/src/main/java/java/io/InputStreamReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/InterruptedIOException.java b/ojluni/src/main/java/java/io/InterruptedIOException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/InvalidClassException.java b/ojluni/src/main/java/java/io/InvalidClassException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/InvalidObjectException.java b/ojluni/src/main/java/java/io/InvalidObjectException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/LineNumberInputStream.java b/ojluni/src/main/java/java/io/LineNumberInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/LineNumberReader.java b/ojluni/src/main/java/java/io/LineNumberReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/NotActiveException.java b/ojluni/src/main/java/java/io/NotActiveException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/NotSerializableException.java b/ojluni/src/main/java/java/io/NotSerializableException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectInput.java b/ojluni/src/main/java/java/io/ObjectInput.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectInputStream.java b/ojluni/src/main/java/java/io/ObjectInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectInputValidation.java b/ojluni/src/main/java/java/io/ObjectInputValidation.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectOutput.java b/ojluni/src/main/java/java/io/ObjectOutput.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectOutputStream.java b/ojluni/src/main/java/java/io/ObjectOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectStreamClass.java b/ojluni/src/main/java/java/io/ObjectStreamClass.java
old mode 100755
new mode 100644
index a157f4d..ffbde98e
--- a/ojluni/src/main/java/java/io/ObjectStreamClass.java
+++ b/ojluni/src/main/java/java/io/ObjectStreamClass.java
@@ -2246,13 +2246,9 @@
ObjectStreamField f = fields[i], m = null;
for (int j = 0; j < localFields.length; j++) {
ObjectStreamField lf = localFields[j];
- if (f.getName().equals(lf.getName())) {
- if ((f.isPrimitive() || lf.isPrimitive()) &&
- f.getTypeCode() != lf.getTypeCode())
- {
- throw new InvalidClassException(localDesc.name,
- "incompatible types for field " + f.getName());
- }
+ // Android-changed: We can have fields with a same name and a different type.
+ if (f.getName().equals(lf.getName()) &&
+ f.getSignature().equals(lf.getSignature())) {
if (lf.getField() != null) {
m = new ObjectStreamField(
lf.getField(), lf.isUnshared(), false);
diff --git a/ojluni/src/main/java/java/io/ObjectStreamConstants.java b/ojluni/src/main/java/java/io/ObjectStreamConstants.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectStreamException.java b/ojluni/src/main/java/java/io/ObjectStreamException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/ObjectStreamField.java b/ojluni/src/main/java/java/io/ObjectStreamField.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/OptionalDataException.java b/ojluni/src/main/java/java/io/OptionalDataException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/OutputStream.java b/ojluni/src/main/java/java/io/OutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/OutputStreamWriter.java b/ojluni/src/main/java/java/io/OutputStreamWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PipedInputStream.java b/ojluni/src/main/java/java/io/PipedInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PipedOutputStream.java b/ojluni/src/main/java/java/io/PipedOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PipedReader.java b/ojluni/src/main/java/java/io/PipedReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PipedWriter.java b/ojluni/src/main/java/java/io/PipedWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PrintStream.java b/ojluni/src/main/java/java/io/PrintStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PrintWriter.java b/ojluni/src/main/java/java/io/PrintWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PushbackInputStream.java b/ojluni/src/main/java/java/io/PushbackInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/PushbackReader.java b/ojluni/src/main/java/java/io/PushbackReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/RandomAccessFile.java b/ojluni/src/main/java/java/io/RandomAccessFile.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Reader.java b/ojluni/src/main/java/java/io/Reader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/SequenceInputStream.java b/ojluni/src/main/java/java/io/SequenceInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/SerialCallbackContext.java b/ojluni/src/main/java/java/io/SerialCallbackContext.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Serializable.java b/ojluni/src/main/java/java/io/Serializable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/SerializablePermission.java b/ojluni/src/main/java/java/io/SerializablePermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/StreamCorruptedException.java b/ojluni/src/main/java/java/io/StreamCorruptedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/StreamTokenizer.java b/ojluni/src/main/java/java/io/StreamTokenizer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/StringBufferInputStream.java b/ojluni/src/main/java/java/io/StringBufferInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/StringReader.java b/ojluni/src/main/java/java/io/StringReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/StringWriter.java b/ojluni/src/main/java/java/io/StringWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/SyncFailedException.java b/ojluni/src/main/java/java/io/SyncFailedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/UTFDataFormatException.java b/ojluni/src/main/java/java/io/UTFDataFormatException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/UnixFileSystem.java b/ojluni/src/main/java/java/io/UnixFileSystem.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/UnsupportedEncodingException.java b/ojluni/src/main/java/java/io/UnsupportedEncodingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/WriteAbortedException.java b/ojluni/src/main/java/java/io/WriteAbortedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/io/Writer.java b/ojluni/src/main/java/java/io/Writer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/AbstractMethodError.java b/ojluni/src/main/java/java/lang/AbstractMethodError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Appendable.java b/ojluni/src/main/java/java/lang/Appendable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ArithmeticException.java b/ojluni/src/main/java/java/lang/ArithmeticException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java b/ojluni/src/main/java/java/lang/ArrayIndexOutOfBoundsException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Class.java b/ojluni/src/main/java/java/lang/Class.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ClassCircularityError.java b/ojluni/src/main/java/java/lang/ClassCircularityError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ClassFormatError.java b/ojluni/src/main/java/java/lang/ClassFormatError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ClassLoader.java b/ojluni/src/main/java/java/lang/ClassLoader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ClassNotFoundException.java b/ojluni/src/main/java/java/lang/ClassNotFoundException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/CloneNotSupportedException.java b/ojluni/src/main/java/java/lang/CloneNotSupportedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Cloneable.java b/ojluni/src/main/java/java/lang/Cloneable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Compiler.java b/ojluni/src/main/java/java/lang/Compiler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Enum.java b/ojluni/src/main/java/java/lang/Enum.java
old mode 100755
new mode 100644
index 5548f42..56666f2
--- a/ojluni/src/main/java/java/lang/Enum.java
+++ b/ojluni/src/main/java/java/lang/Enum.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -178,8 +178,8 @@
* method is the order in which the constants are declared.
*/
public final int compareTo(E o) {
- Enum other = (Enum)o;
- Enum self = this;
+ Enum<?> other = (Enum<?>)o;
+ Enum<E> self = this;
if (self.getClass() != other.getClass() && // optimization
self.getDeclaringClass() != other.getDeclaringClass())
throw new ClassCastException();
@@ -198,10 +198,11 @@
* @return the Class object corresponding to this enum constant's
* enum type
*/
+ @SuppressWarnings("unchecked")
public final Class<E> getDeclaringClass() {
- Class clazz = getClass();
- Class zuper = clazz.getSuperclass();
- return (zuper == Enum.class) ? clazz : zuper;
+ Class<?> clazz = getClass();
+ Class<?> zuper = clazz.getSuperclass();
+ return (zuper == Enum.class) ? (Class<E>)clazz : (Class<E>)zuper;
}
/**
diff --git a/ojluni/src/main/java/java/lang/EnumConstantNotPresentException.java b/ojluni/src/main/java/java/lang/EnumConstantNotPresentException.java
old mode 100755
new mode 100644
index 76bfd27..17731606e
--- a/ojluni/src/main/java/java/lang/EnumConstantNotPresentException.java
+++ b/ojluni/src/main/java/java/lang/EnumConstantNotPresentException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 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
@@ -36,6 +36,7 @@
* @see java.lang.reflect.AnnotatedElement
* @since 1.5
*/
+@SuppressWarnings("rawtypes") /* rawtypes are part of the public api */
public class EnumConstantNotPresentException extends RuntimeException {
private static final long serialVersionUID = -6046998521960521108L;
diff --git a/ojluni/src/main/java/java/lang/Error.java b/ojluni/src/main/java/java/lang/Error.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Exception.java b/ojluni/src/main/java/java/lang/Exception.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ExceptionInInitializerError.java b/ojluni/src/main/java/java/lang/ExceptionInInitializerError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/IllegalAccessError.java b/ojluni/src/main/java/java/lang/IllegalAccessError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/IllegalAccessException.java b/ojluni/src/main/java/java/lang/IllegalAccessException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/IllegalArgumentException.java b/ojluni/src/main/java/java/lang/IllegalArgumentException.java
old mode 100755
new mode 100644
index 13ffbf1..c29a9d5
--- a/ojluni/src/main/java/java/lang/IllegalArgumentException.java
+++ b/ojluni/src/main/java/java/lang/IllegalArgumentException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2012, 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
@@ -30,7 +30,6 @@
* inappropriate argument.
*
* @author unascribed
- * @see java.lang.Thread#setPriority(int)
* @since JDK1.0
*/
public
diff --git a/ojluni/src/main/java/java/lang/IllegalMonitorStateException.java b/ojluni/src/main/java/java/lang/IllegalMonitorStateException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/IllegalStateException.java b/ojluni/src/main/java/java/lang/IllegalStateException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/IllegalThreadStateException.java b/ojluni/src/main/java/java/lang/IllegalThreadStateException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/IncompatibleClassChangeError.java b/ojluni/src/main/java/java/lang/IncompatibleClassChangeError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/IndexOutOfBoundsException.java b/ojluni/src/main/java/java/lang/IndexOutOfBoundsException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/InheritableThreadLocal.java b/ojluni/src/main/java/java/lang/InheritableThreadLocal.java
old mode 100755
new mode 100644
index 859e651..935c5f1
--- a/ojluni/src/main/java/java/lang/InheritableThreadLocal.java
+++ b/ojluni/src/main/java/java/lang/InheritableThreadLocal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2012, 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
@@ -76,7 +76,6 @@
*
* @param t the current thread
* @param firstValue value for the initial entry of the table.
- * @param map the map to store.
*/
void createMap(Thread t, T firstValue) {
t.inheritableThreadLocals = new ThreadLocalMap(this, firstValue);
diff --git a/ojluni/src/main/java/java/lang/InstantiationError.java b/ojluni/src/main/java/java/lang/InstantiationError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/InstantiationException.java b/ojluni/src/main/java/java/lang/InstantiationException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Integer.java b/ojluni/src/main/java/java/lang/Integer.java
old mode 100755
new mode 100644
index dadfefa..f742505
--- a/ojluni/src/main/java/java/lang/Integer.java
+++ b/ojluni/src/main/java/java/lang/Integer.java
@@ -26,7 +26,7 @@
package java.lang;
-import java.util.Properties;
+import java.lang.annotation.Native;
/**
* The {@code Integer} class wraps a value of the primitive type
@@ -55,13 +55,13 @@
* A constant holding the minimum value an {@code int} can
* have, -2<sup>31</sup>.
*/
- public static final int MIN_VALUE = 0x80000000;
+ @Native public static final int MIN_VALUE = 0x80000000;
/**
* A constant holding the maximum value an {@code int} can
* have, 2<sup>31</sup>-1.
*/
- public static final int MAX_VALUE = 0x7fffffff;
+ @Native public static final int MAX_VALUE = 0x7fffffff;
/**
* The {@code Class} instance representing the primitive type
@@ -69,6 +69,7 @@
*
* @since JDK1.1
*/
+ @SuppressWarnings("unchecked")
public static final Class<Integer> TYPE = (Class<Integer>) int[].class.getComponentType();
/**
@@ -93,13 +94,13 @@
*
* <p>If the first argument is negative, the first element of the
* result is the ASCII minus character {@code '-'}
- * (<code>'\u002D'</code>). If the first argument is not
+ * ({@code '\u005Cu002D'}). If the first argument is not
* negative, no sign character appears in the result.
*
* <p>The remaining characters of the result represent the magnitude
* of the first argument. If the magnitude is zero, it is
* represented by a single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
+ * ({@code '\u005Cu0030'}); otherwise, the first character of
* the representation of the magnitude will not be the zero
* character. The following ASCII characters are used as digits:
*
@@ -107,9 +108,9 @@
* {@code 0123456789abcdefghijklmnopqrstuvwxyz}
* </blockquote>
*
- * These are <code>'\u0030'</code> through
- * <code>'\u0039'</code> and <code>'\u0061'</code> through
- * <code>'\u007A'</code>. If {@code radix} is
+ * These are {@code '\u005Cu0030'} through
+ * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
+ * {@code '\u005Cu007A'}. If {@code radix} is
* <var>N</var>, then the first <var>N</var> of these characters
* are used as radix-<var>N</var> digits in the order shown. Thus,
* the digits for hexadecimal (radix 16) are
@@ -128,7 +129,6 @@
* @see java.lang.Character#MIN_RADIX
*/
public static String toString(int i, int radix) {
-
if (radix < Character.MIN_RADIX || radix > Character.MAX_RADIX)
radix = 10;
@@ -146,9 +146,8 @@
}
while (i <= -radix) {
- int q = i / radix;
- buf[charPos--] = digits[radix * q - i];
- i = q;
+ buf[charPos--] = digits[-(i % radix)];
+ i = i / radix;
}
buf[charPos] = digits[-i];
@@ -197,20 +196,26 @@
* if the argument is negative; otherwise, it is equal to the
* argument. This value is converted to a string of ASCII digits
* in hexadecimal (base 16) with no extra leading
- * {@code 0}s. If the unsigned magnitude is zero, it is
- * represented by a single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
- * the representation of the unsigned magnitude will not be the
- * zero character. The following characters are used as
- * hexadecimal digits:
+ * {@code 0}s.
+ *
+ * <p>The value of the argument can be recovered from the returned
+ * string {@code s} by calling {@link
+ * Integer#parseUnsignedInt(String, int)
+ * Integer.parseUnsignedInt(s, 16)}.
+ *
+ * <p>If the unsigned magnitude is zero, it is represented by a
+ * single zero character {@code '0'} ({@code '\u005Cu0030'});
+ * otherwise, the first character of the representation of the
+ * unsigned magnitude will not be the zero character. The
+ * following characters are used as hexadecimal digits:
*
* <blockquote>
* {@code 0123456789abcdef}
* </blockquote>
*
- * These are the characters <code>'\u0030'</code> through
- * <code>'\u0039'</code> and <code>'\u0061'</code> through
- * <code>'\u0066'</code>. If uppercase letters are
+ * These are the characters {@code '\u005Cu0030'} through
+ * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
+ * {@code '\u005Cu0066'}. If uppercase letters are
* desired, the {@link java.lang.String#toUpperCase()} method may
* be called on the result:
*
@@ -221,6 +226,8 @@
* @param i an integer to be converted to a string.
* @return the string representation of the unsigned integer value
* represented by the argument in hexadecimal (base 16).
+ * @see #parseUnsignedInt(String, int)
+ * @see #toUnsignedString(int, int)
* @since JDK1.0.2
*/
public static String toHexString(int i) {
@@ -236,23 +243,29 @@
* argument. This value is converted to a string of ASCII digits
* in octal (base 8) with no extra leading {@code 0}s.
*
+ * <p>The value of the argument can be recovered from the returned
+ * string {@code s} by calling {@link
+ * Integer#parseUnsignedInt(String, int)
+ * Integer.parseUnsignedInt(s, 8)}.
+ *
* <p>If the unsigned magnitude is zero, it is represented by a
- * single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
- * the representation of the unsigned magnitude will not be the
- * zero character. The following characters are used as octal
- * digits:
+ * single zero character {@code '0'} ({@code '\u005Cu0030'});
+ * otherwise, the first character of the representation of the
+ * unsigned magnitude will not be the zero character. The
+ * following characters are used as octal digits:
*
* <blockquote>
* {@code 01234567}
* </blockquote>
*
- * These are the characters <code>'\u0030'</code> through
- * <code>'\u0037'</code>.
+ * These are the characters {@code '\u005Cu0030'} through
+ * {@code '\u005Cu0037'}.
*
* @param i an integer to be converted to a string.
* @return the string representation of the unsigned integer value
* represented by the argument in octal (base 8).
+ * @see #parseUnsignedInt(String, int)
+ * @see #toUnsignedString(int, int)
* @since JDK1.0.2
*/
public static String toOctalString(int i) {
@@ -267,17 +280,24 @@
* if the argument is negative; otherwise it is equal to the
* argument. This value is converted to a string of ASCII digits
* in binary (base 2) with no extra leading {@code 0}s.
- * If the unsigned magnitude is zero, it is represented by a
- * single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
- * the representation of the unsigned magnitude will not be the
- * zero character. The characters {@code '0'}
- * (<code>'\u0030'</code>) and {@code '1'}
- * (<code>'\u0031'</code>) are used as binary digits.
+ *
+ * <p>The value of the argument can be recovered from the returned
+ * string {@code s} by calling {@link
+ * Integer#parseUnsignedInt(String, int)
+ * Integer.parseUnsignedInt(s, 2)}.
+ *
+ * <p>If the unsigned magnitude is zero, it is represented by a
+ * single zero character {@code '0'} ({@code '\u005Cu0030'});
+ * otherwise, the first character of the representation of the
+ * unsigned magnitude will not be the zero character. The
+ * characters {@code '0'} ({@code '\u005Cu0030'}) and {@code
+ * '1'} ({@code '\u005Cu0031'}) are used as binary digits.
*
* @param i an integer to be converted to a string.
* @return the string representation of the unsigned integer value
* represented by the argument in binary (base 2).
+ * @see #parseUnsignedInt(String, int)
+ * @see #toUnsignedString(int, int)
* @since JDK1.0.2
*/
public static String toBinaryString(int i) {
@@ -287,17 +307,37 @@
/**
* Convert the integer to an unsigned number.
*/
- private static String toUnsignedString0(int i, int shift) {
- char[] buf = new char[32];
- int charPos = 32;
+ private static String toUnsignedString0(int val, int shift) {
+ // assert shift > 0 && shift <=5 : "Illegal shift value";
+ int mag = Integer.SIZE - Integer.numberOfLeadingZeros(val);
+ int chars = Math.max(((mag + (shift - 1)) / shift), 1);
+ char[] buf = new char[chars];
+
+ formatUnsignedInt(val, shift, buf, 0, chars);
+
+ // Use special constructor which takes over "buf".
+ return new String(buf);
+ }
+
+ /**
+ * Format a long (treated as unsigned) into a character buffer.
+ * @param val the unsigned int to format
+ * @param shift the log2 of the base to format in (4 for hex, 3 for octal, 1 for binary)
+ * @param buf the character buffer to write to
+ * @param offset the offset in the destination buffer to start at
+ * @param len the number of characters to write
+ * @return the lowest character location used
+ */
+ static int formatUnsignedInt(int val, int shift, char[] buf, int offset, int len) {
+ int charPos = len;
int radix = 1 << shift;
int mask = radix - 1;
do {
- buf[--charPos] = digits[i & mask];
- i >>>= shift;
- } while (i != 0);
+ buf[offset + --charPos] = Integer.digits[val & mask];
+ val >>>= shift;
+ } while (val != 0 && charPos > 0);
- return new String(buf, charPos, (32 - charPos));
+ return charPos;
}
private static final String[] SMALL_NEG_VALUES = new String[100];
@@ -468,9 +508,9 @@
* must all be digits of the specified radix (as determined by
* whether {@link java.lang.Character#digit(char, int)} returns a
* nonnegative value), except that the first character may be an
- * ASCII minus sign {@code '-'} (<code>'\u002D'</code>) to
+ * ASCII minus sign {@code '-'} ({@code '\u005Cu002D'}) to
* indicate a negative value or an ASCII plus sign {@code '+'}
- * (<code>'\u002B'</code>) to indicate a positive value. The
+ * ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting integer value is returned.
*
* <p>An exception of type {@code NumberFormatException} is
@@ -485,8 +525,8 @@
*
* <li>Any character of the string is not a digit of the specified
* radix, except that the first character may be a minus sign
- * {@code '-'} (<code>'\u002D'</code>) or plus sign
- * {@code '+'} (<code>'\u002B'</code>) provided that the
+ * {@code '-'} ({@code '\u005Cu002D'}) or plus sign
+ * {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1.
*
* <li>The value represented by the string is not a value of type
@@ -586,8 +626,8 @@
* Parses the string argument as a signed decimal integer. The
* characters in the string must all be decimal digits, except
* that the first character may be an ASCII minus sign {@code '-'}
- * (<code>'\u002D'</code>) to indicate a negative value or an
- * ASCII plus sign {@code '+'} (<code>'\u002B'</code>) to
+ * ({@code '\u005Cu002D'}) to indicate a negative value or an
+ * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting integer value is
* returned, exactly as if the argument and the radix 10 were
* given as arguments to the {@link #parseInt(java.lang.String,
@@ -759,7 +799,7 @@
* -128 and 127 (inclusive) as required by JLS.
*
* The cache is initialized on first usage. The size of the cache
- * may be controlled by the -XX:AutoBoxCacheMax=<size> option.
+ * may be controlled by the {@code -XX:AutoBoxCacheMax=<size>} option.
* During VM initialization, java.lang.Integer.IntegerCache.high property
* may be set and saved in the private system properties in the
* sun.misc.VM class.
@@ -776,10 +816,14 @@
String integerCacheHighPropValue =
sun.misc.VM.getSavedProperty("java.lang.Integer.IntegerCache.high");
if (integerCacheHighPropValue != null) {
- int i = parseInt(integerCacheHighPropValue);
- i = Math.max(i, 127);
- // Maximum array size is Integer.MAX_VALUE
- h = Math.min(i, Integer.MAX_VALUE - (-low) -1);
+ try {
+ int i = parseInt(integerCacheHighPropValue);
+ i = Math.max(i, 127);
+ // Maximum array size is Integer.MAX_VALUE
+ h = Math.min(i, Integer.MAX_VALUE - (-low) -1);
+ } catch( NumberFormatException nfe) {
+ // If the property cannot be parsed into an int, ignore it.
+ }
}
high = h;
@@ -787,6 +831,9 @@
int j = low;
for(int k = 0; k < cache.length; k++)
cache[k] = new Integer(j++);
+
+ // range [-128, 127] must be interned (JLS7 5.1.7)
+ assert IntegerCache.high >= 127;
}
private IntegerCache() {}
@@ -808,7 +855,6 @@
* @since 1.5
*/
public static Integer valueOf(int i) {
- assert IntegerCache.high >= 127;
if (i >= IntegerCache.low && i <= IntegerCache.high)
return IntegerCache.cache[i + (-IntegerCache.low)];
return new Integer(i);
@@ -850,16 +896,18 @@
}
/**
- * Returns the value of this {@code Integer} as a
- * {@code byte}.
+ * Returns the value of this {@code Integer} as a {@code byte}
+ * after a narrowing primitive conversion.
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public byte byteValue() {
return (byte)value;
}
/**
- * Returns the value of this {@code Integer} as a
- * {@code short}.
+ * Returns the value of this {@code Integer} as a {@code short}
+ * after a narrowing primitive conversion.
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public short shortValue() {
return (short)value;
@@ -874,24 +922,28 @@
}
/**
- * Returns the value of this {@code Integer} as a
- * {@code long}.
+ * Returns the value of this {@code Integer} as a {@code long}
+ * after a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
+ * @see Integer#toUnsignedLong(int)
*/
public long longValue() {
return (long)value;
}
/**
- * Returns the value of this {@code Integer} as a
- * {@code float}.
+ * Returns the value of this {@code Integer} as a {@code float}
+ * after a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public float floatValue() {
return (float)value;
}
/**
- * Returns the value of this {@code Integer} as a
- * {@code double}.
+ * Returns the value of this {@code Integer} as a {@code double}
+ * after a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public double doubleValue() {
return (double)value;
@@ -918,8 +970,9 @@
* primitive {@code int} value represented by this
* {@code Integer} object.
*/
+ @Override
public int hashCode() {
- return value;
+ return Integer.hashCode(value);
}
/**
@@ -956,17 +1009,17 @@
* Determines the integer value of the system property with the
* specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the
- * {@link java.lang.System#getProperty(java.lang.String)} method. The
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
+ * java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as an integer
- * value and an {@code Integer} object representing this value is
- * returned. Details of possible numeric formats can be found with
- * the definition of {@code getProperty}.
+ * value using the grammar supported by {@link Integer#decode decode} and
+ * an {@code Integer} object representing this value is returned.
*
- * <p>If there is no property with the specified name, if the specified name
- * is empty or {@code null}, or if the property does not have
- * the correct numeric format, then {@code null} is returned.
+ * <p>If there is no property with the specified name, if the
+ * specified name is empty or {@code null}, or if the property
+ * does not have the correct numeric format, then {@code null} is
+ * returned.
*
* <p>In other words, this method returns an {@code Integer}
* object equal to the value of:
@@ -977,6 +1030,8 @@
*
* @param nm property name.
* @return the {@code Integer} value of the property.
+ * @throws SecurityException for the same reasons as
+ * {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
@@ -988,13 +1043,12 @@
* Determines the integer value of the system property with the
* specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the {@link
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
* string value of this property is then interpreted as an integer
- * value and an {@code Integer} object representing this value is
- * returned. Details of possible numeric formats can be found with
- * the definition of {@code getProperty}.
+ * value using the grammar supported by {@link Integer#decode decode} and
+ * an {@code Integer} object representing this value is returned.
*
* <p>The second argument is the default value. An {@code Integer} object
* that represents the value of the second argument is returned if there
@@ -1022,6 +1076,8 @@
* @param nm property name.
* @param val default value.
* @return the {@code Integer} value of the property.
+ * @throws SecurityException for the same reasons as
+ * {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
@@ -1036,9 +1092,9 @@
* system property. System properties are accessible through the
* {@link java.lang.System#getProperty(java.lang.String)} method.
* The string value of this property is then interpreted as an
- * integer value, as per the {@code Integer.decode} method,
+ * integer value, as per the {@link Integer#decode decode} method,
* and an {@code Integer} object representing this value is
- * returned.
+ * returned; in summary:
*
* <ul><li>If the property value begins with the two ASCII characters
* {@code 0x} or the ASCII character {@code #}, not
@@ -1062,16 +1118,16 @@
* @param nm property name.
* @param val default value.
* @return the {@code Integer} value of the property.
- * @see java.lang.System#getProperty(java.lang.String)
- * @see java.lang.System#getProperty(java.lang.String, java.lang.String)
- * @see java.lang.Integer#decode
+ * @throws SecurityException for the same reasons as
+ * {@link System#getProperty(String) System.getProperty}
+ * @see System#getProperty(java.lang.String)
+ * @see System#getProperty(java.lang.String, java.lang.String)
*/
public static Integer getInteger(String nm, Integer val) {
String v = null;
try {
v = System.getProperty(nm);
- } catch (IllegalArgumentException e) {
- } catch (NullPointerException e) {
+ } catch (IllegalArgumentException | NullPointerException e) {
}
if (v != null) {
try {
@@ -1095,7 +1151,7 @@
* <dd><i>Sign<sub>opt</sub></i> {@code 0X} <i>HexDigits</i>
* <dd><i>Sign<sub>opt</sub></i> {@code #} <i>HexDigits</i>
* <dd><i>Sign<sub>opt</sub></i> {@code 0} <i>OctalDigits</i>
- * <p>
+ *
* <dt><i>Sign:</i>
* <dd>{@code -}
* <dd>{@code +}
@@ -1292,8 +1348,7 @@
*
* @since 1.5
*/
- public static final int SIZE = 32;
-
+ @Native public static final int SIZE = 32;
/**
* The number of bytes used to represent a {@code int} value in two's
@@ -1310,6 +1365,7 @@
* one-bits in its two's complement binary representation, that is, if it
* is equal to zero.
*
+ * @param i the value whose highest one bit is to be computed
* @return an {@code int} value with a single one-bit, in the position
* of the highest-order one-bit in the specified value, or zero if
* the specified value is itself equal to zero.
@@ -1332,6 +1388,7 @@
* one-bits in its two's complement binary representation, that is, if it
* is equal to zero.
*
+ * @param i the value whose lowest one bit is to be computed
* @return an {@code int} value with a single one-bit, in the position
* of the lowest-order one-bit in the specified value, or zero if
* the specified value is itself equal to zero.
@@ -1356,6 +1413,7 @@
* <li>ceil(log<sub>2</sub>(x)) = {@code 32 - numberOfLeadingZeros(x - 1)}
* </ul>
*
+ * @param i the value whose number of leading zeros is to be computed
* @return the number of zero bits preceding the highest-order
* ("leftmost") one-bit in the two's complement binary representation
* of the specified {@code int} value, or 32 if the value
@@ -1382,6 +1440,7 @@
* one-bits in its two's complement representation, in other words if it is
* equal to zero.
*
+ * @param i the value whose number of trailing zeros is to be computed
* @return the number of zero bits following the lowest-order ("rightmost")
* one-bit in the two's complement binary representation of the
* specified {@code int} value, or 32 if the value is equal
@@ -1405,6 +1464,7 @@
* representation of the specified {@code int} value. This function is
* sometimes referred to as the <i>population count</i>.
*
+ * @param i the value whose bits are to be counted
* @return the number of one-bits in the two's complement binary
* representation of the specified {@code int} value.
* @since 1.5
@@ -1432,6 +1492,8 @@
* ignored, even if the distance is negative: {@code rotateLeft(val,
* distance) == rotateLeft(val, distance & 0x1F)}.
*
+ * @param i the value whose bits are to be rotated left
+ * @param distance the number of bit positions to rotate left
* @return the value obtained by rotating the two's complement binary
* representation of the specified {@code int} value left by the
* specified number of bits.
@@ -1454,6 +1516,8 @@
* ignored, even if the distance is negative: {@code rotateRight(val,
* distance) == rotateRight(val, distance & 0x1F)}.
*
+ * @param i the value whose bits are to be rotated right
+ * @param distance the number of bit positions to rotate right
* @return the value obtained by rotating the two's complement binary
* representation of the specified {@code int} value right by the
* specified number of bits.
@@ -1468,6 +1532,7 @@
* two's complement binary representation of the specified {@code int}
* value.
*
+ * @param i the value to be reversed
* @return the value obtained by reversing order of the bits in the
* specified {@code int} value.
* @since 1.5
@@ -1487,6 +1552,7 @@
* return value is -1 if the specified value is negative; 0 if the
* specified value is zero; and 1 if the specified value is positive.)
*
+ * @param i the value whose signum is to be computed
* @return the signum function of the specified {@code int} value.
* @since 1.5
*/
@@ -1499,6 +1565,7 @@
* Returns the value obtained by reversing the order of the bytes in the
* two's complement representation of the specified {@code int} value.
*
+ * @param i the value whose bytes are to be reversed
* @return the value obtained by reversing the bytes in the specified
* {@code int} value.
* @since 1.5
@@ -1552,5 +1619,5 @@
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
- private static final long serialVersionUID = 1360826667806852920L;
+ @Native private static final long serialVersionUID = 1360826667806852920L;
}
diff --git a/ojluni/src/main/java/java/lang/InternalError.java b/ojluni/src/main/java/java/lang/InternalError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/InterruptedException.java b/ojluni/src/main/java/java/lang/InterruptedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/LinkageError.java b/ojluni/src/main/java/java/lang/LinkageError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Long.java b/ojluni/src/main/java/java/lang/Long.java
old mode 100755
new mode 100644
index 422a4a0..3f383b4
--- a/ojluni/src/main/java/java/lang/Long.java
+++ b/ojluni/src/main/java/java/lang/Long.java
@@ -26,6 +26,7 @@
package java.lang;
+import java.lang.annotation.Native;
import java.math.*;
@@ -56,13 +57,13 @@
* A constant holding the minimum value a {@code long} can
* have, -2<sup>63</sup>.
*/
- public static final long MIN_VALUE = 0x8000000000000000L;
+ @Native public static final long MIN_VALUE = 0x8000000000000000L;
/**
* A constant holding the maximum value a {@code long} can
* have, 2<sup>63</sup>-1.
*/
- public static final long MAX_VALUE = 0x7fffffffffffffffL;
+ @Native public static final long MAX_VALUE = 0x7fffffffffffffffL;
/**
* The {@code Class} instance representing the primitive type
@@ -70,6 +71,7 @@
*
* @since JDK1.1
*/
+ @SuppressWarnings("unchecked")
public static final Class<Long> TYPE = (Class<Long>) long[].class.getComponentType();
/**
@@ -82,13 +84,13 @@
*
* <p>If the first argument is negative, the first element of the
* result is the ASCII minus sign {@code '-'}
- * (<code>'\u002d'</code>). If the first argument is not
+ * ({@code '\u005Cu002d'}). If the first argument is not
* negative, no sign character appears in the result.
*
* <p>The remaining characters of the result represent the magnitude
* of the first argument. If the magnitude is zero, it is
* represented by a single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
+ * ({@code '\u005Cu0030'}); otherwise, the first character of
* the representation of the magnitude will not be the zero
* character. The following ASCII characters are used as digits:
*
@@ -96,9 +98,9 @@
* {@code 0123456789abcdefghijklmnopqrstuvwxyz}
* </blockquote>
*
- * These are <code>'\u0030'</code> through
- * <code>'\u0039'</code> and <code>'\u0061'</code> through
- * <code>'\u007a'</code>. If {@code radix} is
+ * These are {@code '\u005Cu0030'} through
+ * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
+ * {@code '\u005Cu007a'}. If {@code radix} is
* <var>N</var>, then the first <var>N</var> of these characters
* are used as radix-<var>N</var> digits in the order shown. Thus,
* the digits for hexadecimal (radix 16) are
@@ -232,20 +234,26 @@
* 2<sup>64</sup> if the argument is negative; otherwise, it is
* equal to the argument. This value is converted to a string of
* ASCII digits in hexadecimal (base 16) with no extra
- * leading {@code 0}s. If the unsigned magnitude is zero, it
- * is represented by a single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
- * the representation of the unsigned magnitude will not be the
- * zero character. The following characters are used as
- * hexadecimal digits:
+ * leading {@code 0}s.
+ *
+ * <p>The value of the argument can be recovered from the returned
+ * string {@code s} by calling {@link
+ * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s,
+ * 16)}.
+ *
+ * <p>If the unsigned magnitude is zero, it is represented by a
+ * single zero character {@code '0'} ({@code '\u005Cu0030'});
+ * otherwise, the first character of the representation of the
+ * unsigned magnitude will not be the zero character. The
+ * following characters are used as hexadecimal digits:
*
* <blockquote>
* {@code 0123456789abcdef}
* </blockquote>
*
- * These are the characters <code>'\u0030'</code> through
- * <code>'\u0039'</code> and <code>'\u0061'</code> through
- * <code>'\u0066'</code>. If uppercase letters are desired,
+ * These are the characters {@code '\u005Cu0030'} through
+ * {@code '\u005Cu0039'} and {@code '\u005Cu0061'} through
+ * {@code '\u005Cu0066'}. If uppercase letters are desired,
* the {@link java.lang.String#toUpperCase()} method may be called
* on the result:
*
@@ -257,6 +265,8 @@
* @return the string representation of the unsigned {@code long}
* value represented by the argument in hexadecimal
* (base 16).
+ * @see #parseUnsignedLong(String, int)
+ * @see #toUnsignedString(long, int)
* @since JDK 1.0.2
*/
public static String toHexString(long i) {
@@ -273,23 +283,29 @@
* ASCII digits in octal (base 8) with no extra leading
* {@code 0}s.
*
+ * <p>The value of the argument can be recovered from the returned
+ * string {@code s} by calling {@link
+ * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s,
+ * 8)}.
+ *
* <p>If the unsigned magnitude is zero, it is represented by a
- * single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
- * the representation of the unsigned magnitude will not be the
- * zero character. The following characters are used as octal
- * digits:
+ * single zero character {@code '0'} ({@code '\u005Cu0030'});
+ * otherwise, the first character of the representation of the
+ * unsigned magnitude will not be the zero character. The
+ * following characters are used as octal digits:
*
* <blockquote>
* {@code 01234567}
* </blockquote>
*
- * These are the characters <code>'\u0030'</code> through
- * <code>'\u0037'</code>.
+ * These are the characters {@code '\u005Cu0030'} through
+ * {@code '\u005Cu0037'}.
*
* @param i a {@code long} to be converted to a string.
* @return the string representation of the unsigned {@code long}
* value represented by the argument in octal (base 8).
+ * @see #parseUnsignedLong(String, int)
+ * @see #toUnsignedString(long, int)
* @since JDK 1.0.2
*/
public static String toOctalString(long i) {
@@ -304,17 +320,25 @@
* 2<sup>64</sup> if the argument is negative; otherwise, it is
* equal to the argument. This value is converted to a string of
* ASCII digits in binary (base 2) with no extra leading
- * {@code 0}s. If the unsigned magnitude is zero, it is
- * represented by a single zero character {@code '0'}
- * (<code>'\u0030'</code>); otherwise, the first character of
- * the representation of the unsigned magnitude will not be the
- * zero character. The characters {@code '0'}
- * (<code>'\u0030'</code>) and {@code '1'}
- * (<code>'\u0031'</code>) are used as binary digits.
+ * {@code 0}s.
+ *
+ * <p>The value of the argument can be recovered from the returned
+ * string {@code s} by calling {@link
+ * Long#parseUnsignedLong(String, int) Long.parseUnsignedLong(s,
+ * 2)}.
+ *
+ * <p>If the unsigned magnitude is zero, it is represented by a
+ * single zero character {@code '0'} ({@code '\u005Cu0030'});
+ * otherwise, the first character of the representation of the
+ * unsigned magnitude will not be the zero character. The
+ * characters {@code '0'} ({@code '\u005Cu0030'}) and {@code
+ * '1'} ({@code '\u005Cu0031'}) are used as binary digits.
*
* @param i a {@code long} to be converted to a string.
* @return the string representation of the unsigned {@code long}
* value represented by the argument in binary (base 2).
+ * @see #parseUnsignedLong(String, int)
+ * @see #toUnsignedString(long, int)
* @since JDK 1.0.2
*/
public static String toBinaryString(long i) {
@@ -322,18 +346,39 @@
}
/**
- * Convert the integer to an unsigned number.
+ * Format a long (treated as unsigned) into a String.
+ * @param val the value to format
+ * @param shift the log2 of the base to format in (4 for hex, 3 for octal, 1 for binary)
*/
- private static String toUnsignedString0(long i, int shift) {
- char[] buf = new char[64];
- int charPos = 64;
+ static String toUnsignedString0(long val, int shift) {
+ // assert shift > 0 && shift <=5 : "Illegal shift value";
+ int mag = Long.SIZE - Long.numberOfLeadingZeros(val);
+ int chars = Math.max(((mag + (shift - 1)) / shift), 1);
+ char[] buf = new char[chars];
+
+ formatUnsignedLong(val, shift, buf, 0, chars);
+ return new String(buf);
+ }
+
+ /**
+ * Format a long (treated as unsigned) into a character buffer.
+ * @param val the unsigned long to format
+ * @param shift the log2 of the base to format in (4 for hex, 3 for octal, 1 for binary)
+ * @param buf the character buffer to write to
+ * @param offset the offset in the destination buffer to start at
+ * @param len the number of characters to write
+ * @return the lowest character location used
+ */
+ static int formatUnsignedLong(long val, int shift, char[] buf, int offset, int len) {
+ int charPos = len;
int radix = 1 << shift;
- long mask = radix - 1;
+ int mask = radix - 1;
do {
- buf[--charPos] = Integer.digits[(int)(i & mask)];
- i >>>= shift;
- } while (i != 0);
- return new String(buf, charPos, (64 - charPos));
+ buf[offset + --charPos] = Integer.digits[((int) val) & mask];
+ val >>>= shift;
+ } while (val != 0 && charPos > 0);
+
+ return charPos;
}
/**
@@ -352,7 +397,6 @@
int size = (i < 0) ? stringSize(-i) + 1 : stringSize(i);
char[] buf = new char[size];
getChars(i, size, buf);
- // Android-changed: change string constructor.
return new String(buf);
}
@@ -447,18 +491,18 @@
* string must all be digits of the specified radix (as determined
* by whether {@link java.lang.Character#digit(char, int)} returns
* a nonnegative value), except that the first character may be an
- * ASCII minus sign {@code '-'} (<code>'\u002D'</code>) to
+ * ASCII minus sign {@code '-'} ({@code '\u005Cu002D'}) to
* indicate a negative value or an ASCII plus sign {@code '+'}
- * (<code>'\u002B'</code>) to indicate a positive value. The
+ * ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting {@code long} value is returned.
*
* <p>Note that neither the character {@code L}
- * (<code>'\u004C'</code>) nor {@code l}
- * (<code>'\u006C'</code>) is permitted to appear at the end
+ * ({@code '\u005Cu004C'}) nor {@code l}
+ * ({@code '\u005Cu006C'}) is permitted to appear at the end
* of the string as a type indicator, as would be permitted in
* Java programming language source code - except that either
* {@code L} or {@code l} may appear as a digit for a
- * radix greater than 22.
+ * radix greater than or equal to 22.
*
* <p>An exception of type {@code NumberFormatException} is
* thrown if any of the following situations occurs:
@@ -473,8 +517,8 @@
*
* <li>Any character of the string is not a digit of the specified
* radix, except that the first character may be a minus sign
- * {@code '-'} (<code>'\u002d'</code>) or plus sign {@code
- * '+'} (<code>'\u002B'</code>) provided that the string is
+ * {@code '-'} ({@code '\u005Cu002d'}) or plus sign {@code
+ * '+'} ({@code '\u005Cu002B'}) provided that the string is
* longer than length 1.
*
* <li>The value represented by the string is not a value of type
@@ -564,16 +608,16 @@
* Parses the string argument as a signed decimal {@code long}.
* The characters in the string must all be decimal digits, except
* that the first character may be an ASCII minus sign {@code '-'}
- * (<code>\u002D'</code>) to indicate a negative value or an
- * ASCII plus sign {@code '+'} (<code>'\u002B'</code>) to
+ * ({@code \u005Cu002D'}) to indicate a negative value or an
+ * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting {@code long} value is
* returned, exactly as if the argument and the radix {@code 10}
* were given as arguments to the {@link
* #parseLong(java.lang.String, int)} method.
*
* <p>Note that neither the character {@code L}
- * (<code>'\u004C'</code>) nor {@code l}
- * (<code>'\u006C'</code>) is permitted to appear at the end
+ * ({@code '\u005Cu004C'}) nor {@code l}
+ * ({@code '\u005Cu006C'}) is permitted to appear at the end
* of the string as a type indicator, as would be permitted in
* Java programming language source code.
*
@@ -810,7 +854,7 @@
* <dd><i>Sign<sub>opt</sub></i> {@code 0X} <i>HexDigits</i>
* <dd><i>Sign<sub>opt</sub></i> {@code #} <i>HexDigits</i>
* <dd><i>Sign<sub>opt</sub></i> {@code 0} <i>OctalDigits</i>
- * <p>
+ *
* <dt><i>Sign:</i>
* <dd>{@code -}
* <dd>{@code +}
@@ -923,24 +967,27 @@
}
/**
- * Returns the value of this {@code Long} as a
- * {@code byte}.
+ * Returns the value of this {@code Long} as a {@code byte} after
+ * a narrowing primitive conversion.
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public byte byteValue() {
return (byte)value;
}
/**
- * Returns the value of this {@code Long} as a
- * {@code short}.
+ * Returns the value of this {@code Long} as a {@code short} after
+ * a narrowing primitive conversion.
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public short shortValue() {
return (short)value;
}
/**
- * Returns the value of this {@code Long} as an
- * {@code int}.
+ * Returns the value of this {@code Long} as an {@code int} after
+ * a narrowing primitive conversion.
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public int intValue() {
return (int)value;
@@ -951,20 +998,22 @@
* {@code long} value.
*/
public long longValue() {
- return (long)value;
+ return value;
}
/**
- * Returns the value of this {@code Long} as a
- * {@code float}.
+ * Returns the value of this {@code Long} as a {@code float} after
+ * a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public float floatValue() {
return (float)value;
}
/**
- * Returns the value of this {@code Long} as a
- * {@code double}.
+ * Returns the value of this {@code Long} as a {@code double}
+ * after a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public double doubleValue() {
return (double)value;
@@ -996,6 +1045,7 @@
*
* @return a hash code value for this object.
*/
+ @Override
public int hashCode() {
return Long.hashCode(value);
}
@@ -1033,22 +1083,20 @@
* Determines the {@code long} value of the system property
* with the specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the {@link
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
- * string value of this property is then interpreted as a
- * {@code long} value and a {@code Long} object
- * representing this value is returned. Details of possible
- * numeric formats can be found with the definition of
- * {@code getProperty}.
+ * string value of this property is then interpreted as a {@code
+ * long} value using the grammar supported by {@link Long#decode decode}
+ * and a {@code Long} object representing this value is returned.
*
* <p>If there is no property with the specified name, if the
- * specified name is empty or {@code null}, or if the
- * property does not have the correct numeric format, then
- * {@code null} is returned.
+ * specified name is empty or {@code null}, or if the property
+ * does not have the correct numeric format, then {@code null} is
+ * returned.
*
- * <p>In other words, this method returns a {@code Long} object equal to
- * the value of:
+ * <p>In other words, this method returns a {@code Long} object
+ * equal to the value of:
*
* <blockquote>
* {@code getLong(nm, null)}
@@ -1056,6 +1104,8 @@
*
* @param nm property name.
* @return the {@code Long} value of the property.
+ * @throws SecurityException for the same reasons as
+ * {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
@@ -1067,14 +1117,12 @@
* Determines the {@code long} value of the system property
* with the specified name.
*
- * <p>The first argument is treated as the name of a system property.
- * System properties are accessible through the {@link
+ * <p>The first argument is treated as the name of a system
+ * property. System properties are accessible through the {@link
* java.lang.System#getProperty(java.lang.String)} method. The
- * string value of this property is then interpreted as a
- * {@code long} value and a {@code Long} object
- * representing this value is returned. Details of possible
- * numeric formats can be found with the definition of
- * {@code getProperty}.
+ * string value of this property is then interpreted as a {@code
+ * long} value using the grammar supported by {@link Long#decode decode}
+ * and a {@code Long} object representing this value is returned.
*
* <p>The second argument is the default value. A {@code Long} object
* that represents the value of the second argument is returned if there
@@ -1101,6 +1149,8 @@
* @param nm property name.
* @param val default value.
* @return the {@code Long} value of the property.
+ * @throws SecurityException for the same reasons as
+ * {@link System#getProperty(String) System.getProperty}
* @see java.lang.System#getProperty(java.lang.String)
* @see java.lang.System#getProperty(java.lang.String, java.lang.String)
*/
@@ -1116,8 +1166,8 @@
* the {@link java.lang.System#getProperty(java.lang.String)}
* method. The string value of this property is then interpreted
* as a {@code long} value, as per the
- * {@code Long.decode} method, and a {@code Long} object
- * representing this value is returned.
+ * {@link Long#decode decode} method, and a {@code Long} object
+ * representing this value is returned; in summary:
*
* <ul>
* <li>If the property value begins with the two ASCII characters
@@ -1135,8 +1185,8 @@
* </ul>
*
* <p>Note that, in every case, neither {@code L}
- * (<code>'\u004C'</code>) nor {@code l}
- * (<code>'\u006C'</code>) is permitted to appear at the end
+ * ({@code '\u005Cu004C'}) nor {@code l}
+ * ({@code '\u005Cu006C'}) is permitted to appear at the end
* of the property value as a type indicator, as would be
* permitted in Java programming language source code.
*
@@ -1148,16 +1198,16 @@
* @param nm property name.
* @param val default value.
* @return the {@code Long} value of the property.
- * @see java.lang.System#getProperty(java.lang.String)
- * @see java.lang.System#getProperty(java.lang.String, java.lang.String)
- * @see java.lang.Long#decode
+ * @throws SecurityException for the same reasons as
+ * {@link System#getProperty(String) System.getProperty}
+ * @see System#getProperty(java.lang.String)
+ * @see System#getProperty(java.lang.String, java.lang.String)
*/
public static Long getLong(String nm, Long val) {
String v = null;
try {
v = System.getProperty(nm);
- } catch (IllegalArgumentException e) {
- } catch (NullPointerException e) {
+ } catch (IllegalArgumentException | NullPointerException e) {
}
if (v != null) {
try {
@@ -1291,7 +1341,7 @@
*
* @since 1.5
*/
- public static final int SIZE = 64;
+ @Native public static final int SIZE = 64;
/**
* The number of bytes used to represent a {@code long} value in two's
@@ -1308,6 +1358,7 @@
* one-bits in its two's complement binary representation, that is, if it
* is equal to zero.
*
+ * @param i the value whose highest one bit is to be computed
* @return a {@code long} value with a single one-bit, in the position
* of the highest-order one-bit in the specified value, or zero if
* the specified value is itself equal to zero.
@@ -1331,6 +1382,7 @@
* one-bits in its two's complement binary representation, that is, if it
* is equal to zero.
*
+ * @param i the value whose lowest one bit is to be computed
* @return a {@code long} value with a single one-bit, in the position
* of the lowest-order one-bit in the specified value, or zero if
* the specified value is itself equal to zero.
@@ -1355,6 +1407,7 @@
* <li>ceil(log<sub>2</sub>(x)) = {@code 64 - numberOfLeadingZeros(x - 1)}
* </ul>
*
+ * @param i the value whose number of leading zeros is to be computed
* @return the number of zero bits preceding the highest-order
* ("leftmost") one-bit in the two's complement binary representation
* of the specified {@code long} value, or 64 if the value
@@ -1383,6 +1436,7 @@
* one-bits in its two's complement representation, in other words if it is
* equal to zero.
*
+ * @param i the value whose number of trailing zeros is to be computed
* @return the number of zero bits following the lowest-order ("rightmost")
* one-bit in the two's complement binary representation of the
* specified {@code long} value, or 64 if the value is equal
@@ -1407,6 +1461,7 @@
* representation of the specified {@code long} value. This function is
* sometimes referred to as the <i>population count</i>.
*
+ * @param i the value whose bits are to be counted
* @return the number of one-bits in the two's complement binary
* representation of the specified {@code long} value.
* @since 1.5
@@ -1435,6 +1490,8 @@
* ignored, even if the distance is negative: {@code rotateLeft(val,
* distance) == rotateLeft(val, distance & 0x3F)}.
*
+ * @param i the value whose bits are to be rotated left
+ * @param distance the number of bit positions to rotate left
* @return the value obtained by rotating the two's complement binary
* representation of the specified {@code long} value left by the
* specified number of bits.
@@ -1457,6 +1514,8 @@
* ignored, even if the distance is negative: {@code rotateRight(val,
* distance) == rotateRight(val, distance & 0x3F)}.
*
+ * @param i the value whose bits are to be rotated right
+ * @param distance the number of bit positions to rotate right
* @return the value obtained by rotating the two's complement binary
* representation of the specified {@code long} value right by the
* specified number of bits.
@@ -1471,6 +1530,7 @@
* two's complement binary representation of the specified {@code long}
* value.
*
+ * @param i the value to be reversed
* @return the value obtained by reversing order of the bits in the
* specified {@code long} value.
* @since 1.5
@@ -1491,6 +1551,7 @@
* return value is -1 if the specified value is negative; 0 if the
* specified value is zero; and 1 if the specified value is positive.)
*
+ * @param i the value whose signum is to be computed
* @return the signum function of the specified {@code long} value.
* @since 1.5
*/
@@ -1503,6 +1564,7 @@
* Returns the value obtained by reversing the order of the bytes in the
* two's complement representation of the specified {@code long} value.
*
+ * @param i the value whose bytes are to be reversed
* @return the value obtained by reversing the bytes in the specified
* {@code long} value.
* @since 1.5
@@ -1555,5 +1617,5 @@
}
/** use serialVersionUID from JDK 1.0.2 for interoperability */
- private static final long serialVersionUID = 4290774380558885855L;
+ @Native private static final long serialVersionUID = 4290774380558885855L;
}
diff --git a/ojluni/src/main/java/java/lang/Math.java b/ojluni/src/main/java/java/lang/Math.java
old mode 100755
new mode 100644
index 4c82331..e96cc58
--- a/ojluni/src/main/java/java/lang/Math.java
+++ b/ojluni/src/main/java/java/lang/Math.java
@@ -26,6 +26,7 @@
package java.lang;
import java.util.Random;
+
import sun.misc.FloatConsts;
import sun.misc.DoubleConsts;
@@ -52,34 +53,50 @@
*
* <p>The quality of implementation specifications concern two
* properties, accuracy of the returned result and monotonicity of the
- * method. Accuracy of the floating-point {@code Math} methods
- * is measured in terms of <i>ulps</i>, units in the last place. For
- * a given floating-point format, an ulp of a specific real number
- * value is the distance between the two floating-point values
- * bracketing that numerical value. When discussing the accuracy of a
- * method as a whole rather than at a specific argument, the number of
- * ulps cited is for the worst-case error at any argument. If a
- * method always has an error less than 0.5 ulps, the method always
- * returns the floating-point number nearest the exact result; such a
- * method is <i>correctly rounded</i>. A correctly rounded method is
- * generally the best a floating-point approximation can be; however,
- * it is impractical for many floating-point methods to be correctly
- * rounded. Instead, for the {@code Math} class, a larger error
- * bound of 1 or 2 ulps is allowed for certain methods. Informally,
- * with a 1 ulp error bound, when the exact result is a representable
- * number, the exact result should be returned as the computed result;
- * otherwise, either of the two floating-point values which bracket
- * the exact result may be returned. For exact results large in
- * magnitude, one of the endpoints of the bracket may be infinite.
- * Besides accuracy at individual arguments, maintaining proper
- * relations between the method at different arguments is also
- * important. Therefore, most methods with more than 0.5 ulp errors
- * are required to be <i>semi-monotonic</i>: whenever the mathematical
- * function is non-decreasing, so is the floating-point approximation,
- * likewise, whenever the mathematical function is non-increasing, so
- * is the floating-point approximation. Not all approximations that
- * have 1 ulp accuracy will automatically meet the monotonicity
- * requirements.
+ * method. Accuracy of the floating-point {@code Math} methods is
+ * measured in terms of <i>ulps</i>, units in the last place. For a
+ * given floating-point format, an {@linkplain #ulp(double) ulp} of a
+ * specific real number value is the distance between the two
+ * floating-point values bracketing that numerical value. When
+ * discussing the accuracy of a method as a whole rather than at a
+ * specific argument, the number of ulps cited is for the worst-case
+ * error at any argument. If a method always has an error less than
+ * 0.5 ulps, the method always returns the floating-point number
+ * nearest the exact result; such a method is <i>correctly
+ * rounded</i>. A correctly rounded method is generally the best a
+ * floating-point approximation can be; however, it is impractical for
+ * many floating-point methods to be correctly rounded. Instead, for
+ * the {@code Math} class, a larger error bound of 1 or 2 ulps is
+ * allowed for certain methods. Informally, with a 1 ulp error bound,
+ * when the exact result is a representable number, the exact result
+ * should be returned as the computed result; otherwise, either of the
+ * two floating-point values which bracket the exact result may be
+ * returned. For exact results large in magnitude, one of the
+ * endpoints of the bracket may be infinite. Besides accuracy at
+ * individual arguments, maintaining proper relations between the
+ * method at different arguments is also important. Therefore, most
+ * methods with more than 0.5 ulp errors are required to be
+ * <i>semi-monotonic</i>: whenever the mathematical function is
+ * non-decreasing, so is the floating-point approximation, likewise,
+ * whenever the mathematical function is non-increasing, so is the
+ * floating-point approximation. Not all approximations that have 1
+ * ulp accuracy will automatically meet the monotonicity requirements.
+ *
+ * <p>
+ * The platform uses signed two's complement integer arithmetic with
+ * int and long primitive types. The developer should choose
+ * the primitive type to ensure that arithmetic operations consistently
+ * produce correct results, which in some cases means the operations
+ * will not overflow the range of values of the computation.
+ * The best practice is to choose the primitive type and algorithm to avoid
+ * overflow. In cases where the size is {@code int} or {@code long} and
+ * overflow errors need to be detected, the methods {@code addExact},
+ * {@code subtractExact}, {@code multiplyExact}, and {@code toIntExact}
+ * throw an {@code ArithmeticException} when the results overflow.
+ * For other arithmetic operations such as divide, absolute value,
+ * increment, decrement, and negation overflow occurs only with
+ * a specific minimum or maximum value and should be checked against
+ * the minimum or maximum as appropriate.
*
* @author unascribed
* @author Joseph D. Darcy
@@ -688,8 +705,8 @@
}
}
- private static class NoImagePreloadHolder {
- private static final Random INSTANCE = new Random();
+ private static final class RandomNumberGeneratorHolder {
+ static final Random randomNumberGenerator = new Random();
}
/**
@@ -716,7 +733,7 @@
* @see Random#nextDouble()
*/
public static double random() {
- return NoImagePreloadHolder.INSTANCE.nextDouble();
+ return RandomNumberGeneratorHolder.randomNumberGenerator.nextDouble();
}
/**
@@ -726,14 +743,14 @@
* @hide for internal use only.
*/
public static void setRandomSeedInternal(long seed) {
- NoImagePreloadHolder.INSTANCE.setSeed(seed);
+ RandomNumberGeneratorHolder.randomNumberGenerator.setSeed(seed);
}
/**
* @hide for internal use only.
*/
public static int randomIntInternal() {
- return NoImagePreloadHolder.INSTANCE.nextInt();
+ return RandomNumberGeneratorHolder.randomNumberGenerator.nextInt();
}
/**
@@ -1229,8 +1246,9 @@
return (a >= b) ? a : b;
}
- private static long negativeZeroFloatBits = Float.floatToIntBits(-0.0f);
- private static long negativeZeroDoubleBits = Double.doubleToLongBits(-0.0d);
+ // Use raw bit-wise conversions on guaranteed non-NaN arguments.
+ private static long negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f);
+ private static long negativeZeroDoubleBits = Double.doubleToRawLongBits(-0.0d);
/**
* Returns the greater of two {@code float} values. That is,
@@ -1247,9 +1265,12 @@
* @return the larger of {@code a} and {@code b}.
*/
public static float max(float a, float b) {
- if (a != a) return a; // a is NaN
- if ((a == 0.0f) && (b == 0.0f)
- && (Float.floatToIntBits(a) == negativeZeroFloatBits)) {
+ if (a != a)
+ return a; // a is NaN
+ if ((a == 0.0f) &&
+ (b == 0.0f) &&
+ (Float.floatToRawIntBits(a) == negativeZeroFloatBits)) {
+ // Raw conversion ok since NaN can't map to -0.0.
return b;
}
return (a >= b) ? a : b;
@@ -1270,9 +1291,12 @@
* @return the larger of {@code a} and {@code b}.
*/
public static double max(double a, double b) {
- if (a != a) return a; // a is NaN
- if ((a == 0.0d) && (b == 0.0d)
- && (Double.doubleToLongBits(a) == negativeZeroDoubleBits)) {
+ if (a != a)
+ return a; // a is NaN
+ if ((a == 0.0d) &&
+ (b == 0.0d) &&
+ (Double.doubleToRawLongBits(a) == negativeZeroDoubleBits)) {
+ // Raw conversion ok since NaN can't map to -0.0.
return b;
}
return (a >= b) ? a : b;
@@ -1321,9 +1345,12 @@
* @return the smaller of {@code a} and {@code b}.
*/
public static float min(float a, float b) {
- if (a != a) return a; // a is NaN
- if ((a == 0.0f) && (b == 0.0f)
- && (Float.floatToIntBits(b) == negativeZeroFloatBits)) {
+ if (a != a)
+ return a; // a is NaN
+ if ((a == 0.0f) &&
+ (b == 0.0f) &&
+ (Float.floatToRawIntBits(b) == negativeZeroFloatBits)) {
+ // Raw conversion ok since NaN can't map to -0.0.
return b;
}
return (a <= b) ? a : b;
@@ -1344,20 +1371,23 @@
* @return the smaller of {@code a} and {@code b}.
*/
public static double min(double a, double b) {
- if (a != a) return a; // a is NaN
- if ((a == 0.0d) && (b == 0.0d)
- && (Double.doubleToLongBits(b) == negativeZeroDoubleBits)) {
+ if (a != a)
+ return a; // a is NaN
+ if ((a == 0.0d) &&
+ (b == 0.0d) &&
+ (Double.doubleToRawLongBits(b) == negativeZeroDoubleBits)) {
+ // Raw conversion ok since NaN can't map to -0.0.
return b;
}
return (a <= b) ? a : b;
}
/**
- * Returns the size of an ulp of the argument. An ulp of a
- * {@code double} value is the positive distance between this
- * floating-point value and the {@code double} value next
- * larger in magnitude. Note that for non-NaN <i>x</i>,
- * <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
+ * Returns the size of an ulp of the argument. An ulp, unit in
+ * the last place, of a {@code double} value is the positive
+ * distance between this floating-point value and the {@code
+ * double} value next larger in magnitude. Note that for non-NaN
+ * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
@@ -1376,15 +1406,39 @@
* @since 1.5
*/
public static double ulp(double d) {
- return sun.misc.FpUtils.ulp(d);
+ int exp = getExponent(d);
+
+ switch(exp) {
+ case DoubleConsts.MAX_EXPONENT+1: // NaN or infinity
+ return Math.abs(d);
+
+ case DoubleConsts.MIN_EXPONENT-1: // zero or subnormal
+ return Double.MIN_VALUE;
+
+ default:
+ assert exp <= DoubleConsts.MAX_EXPONENT && exp >= DoubleConsts.MIN_EXPONENT;
+
+ // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
+ exp = exp - (DoubleConsts.SIGNIFICAND_WIDTH-1);
+ if (exp >= DoubleConsts.MIN_EXPONENT) {
+ return powerOfTwoD(exp);
+ }
+ else {
+ // return a subnormal result; left shift integer
+ // representation of Double.MIN_VALUE appropriate
+ // number of positions
+ return Double.longBitsToDouble(1L <<
+ (exp - (DoubleConsts.MIN_EXPONENT - (DoubleConsts.SIGNIFICAND_WIDTH-1)) ));
+ }
+ }
}
/**
- * Returns the size of an ulp of the argument. An ulp of a
- * {@code float} value is the positive distance between this
- * floating-point value and the {@code float} value next
- * larger in magnitude. Note that for non-NaN <i>x</i>,
- * <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
+ * Returns the size of an ulp of the argument. An ulp, unit in
+ * the last place, of a {@code float} value is the positive
+ * distance between this floating-point value and the {@code
+ * float} value next larger in magnitude. Note that for non-NaN
+ * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
@@ -1403,7 +1457,31 @@
* @since 1.5
*/
public static float ulp(float f) {
- return sun.misc.FpUtils.ulp(f);
+ int exp = getExponent(f);
+
+ switch(exp) {
+ case FloatConsts.MAX_EXPONENT+1: // NaN or infinity
+ return Math.abs(f);
+
+ case FloatConsts.MIN_EXPONENT-1: // zero or subnormal
+ return FloatConsts.MIN_VALUE;
+
+ default:
+ assert exp <= FloatConsts.MAX_EXPONENT && exp >= FloatConsts.MIN_EXPONENT;
+
+ // ulp(x) is usually 2^(SIGNIFICAND_WIDTH-1)*(2^ilogb(x))
+ exp = exp - (FloatConsts.SIGNIFICAND_WIDTH-1);
+ if (exp >= FloatConsts.MIN_EXPONENT) {
+ return powerOfTwoF(exp);
+ }
+ else {
+ // return a subnormal result; left shift integer
+ // representation of FloatConsts.MIN_VALUE appropriate
+ // number of positions
+ return Float.intBitsToFloat(1 <<
+ (exp - (FloatConsts.MIN_EXPONENT - (FloatConsts.SIGNIFICAND_WIDTH-1)) ));
+ }
+ }
}
/**
@@ -1424,7 +1502,7 @@
* @since 1.5
*/
public static double signum(double d) {
- return sun.misc.FpUtils.signum(d);
+ return (d == 0.0 || Double.isNaN(d))?d:copySign(1.0, d);
}
/**
@@ -1445,7 +1523,7 @@
* @since 1.5
*/
public static float signum(float f) {
- return sun.misc.FpUtils.signum(f);
+ return (f == 0.0f || Float.isNaN(f))?f:copySign(1.0f, f);
}
/**
@@ -1653,7 +1731,11 @@
* @since 1.6
*/
public static double copySign(double magnitude, double sign) {
- return sun.misc.FpUtils.rawCopySign(magnitude, sign);
+ return Double.longBitsToDouble((Double.doubleToRawLongBits(sign) &
+ (DoubleConsts.SIGN_BIT_MASK)) |
+ (Double.doubleToRawLongBits(magnitude) &
+ (DoubleConsts.EXP_BIT_MASK |
+ DoubleConsts.SIGNIF_BIT_MASK)));
}
/**
@@ -1672,7 +1754,11 @@
* @since 1.6
*/
public static float copySign(float magnitude, float sign) {
- return sun.misc.FpUtils.rawCopySign(magnitude, sign);
+ return Float.intBitsToFloat((Float.floatToRawIntBits(sign) &
+ (FloatConsts.SIGN_BIT_MASK)) |
+ (Float.floatToRawIntBits(magnitude) &
+ (FloatConsts.EXP_BIT_MASK |
+ FloatConsts.SIGNIF_BIT_MASK)));
}
/**
@@ -1690,7 +1776,13 @@
* @since 1.6
*/
public static int getExponent(float f) {
- return sun.misc.FpUtils.getExponent(f);
+ /*
+ * Bitwise convert f to integer, mask out exponent bits, shift
+ * to the right and then subtract out float's bias adjust to
+ * get true exponent value
+ */
+ return ((Float.floatToRawIntBits(f) & FloatConsts.EXP_BIT_MASK) >>
+ (FloatConsts.SIGNIFICAND_WIDTH - 1)) - FloatConsts.EXP_BIAS;
}
/**
@@ -1708,7 +1800,13 @@
* @since 1.6
*/
public static int getExponent(double d) {
- return sun.misc.FpUtils.getExponent(d);
+ /*
+ * Bitwise convert d to long, mask out exponent bits, shift
+ * to the right and then subtract out double's bias adjust to
+ * get true exponent value.
+ */
+ return (int)(((Double.doubleToRawLongBits(d) & DoubleConsts.EXP_BIT_MASK) >>
+ (DoubleConsts.SIGNIFICAND_WIDTH - 1)) - DoubleConsts.EXP_BIAS);
}
/**
@@ -1752,7 +1850,63 @@
* @since 1.6
*/
public static double nextAfter(double start, double direction) {
- return sun.misc.FpUtils.nextAfter(start, direction);
+ /*
+ * The cases:
+ *
+ * nextAfter(+infinity, 0) == MAX_VALUE
+ * nextAfter(+infinity, +infinity) == +infinity
+ * nextAfter(-infinity, 0) == -MAX_VALUE
+ * nextAfter(-infinity, -infinity) == -infinity
+ *
+ * are naturally handled without any additional testing
+ */
+
+ // First check for NaN values
+ if (Double.isNaN(start) || Double.isNaN(direction)) {
+ // return a NaN derived from the input NaN(s)
+ return start + direction;
+ } else if (start == direction) {
+ return direction;
+ } else { // start > direction or start < direction
+ // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0)
+ // then bitwise convert start to integer.
+ long transducer = Double.doubleToRawLongBits(start + 0.0d);
+
+ /*
+ * IEEE 754 floating-point numbers are lexicographically
+ * ordered if treated as signed- magnitude integers .
+ * Since Java's integers are two's complement,
+ * incrementing" the two's complement representation of a
+ * logically negative floating-point value *decrements*
+ * the signed-magnitude representation. Therefore, when
+ * the integer representation of a floating-point values
+ * is less than zero, the adjustment to the representation
+ * is in the opposite direction than would be expected at
+ * first .
+ */
+ if (direction > start) { // Calculate next greater value
+ transducer = transducer + (transducer >= 0L ? 1L:-1L);
+ } else { // Calculate next lesser value
+ assert direction < start;
+ if (transducer > 0L)
+ --transducer;
+ else
+ if (transducer < 0L )
+ ++transducer;
+ /*
+ * transducer==0, the result is -MIN_VALUE
+ *
+ * The transition from zero (implicitly
+ * positive) to the smallest negative
+ * signed magnitude value must be done
+ * explicitly.
+ */
+ else
+ transducer = DoubleConsts.SIGN_BIT_MASK | 1L;
+ }
+
+ return Double.longBitsToDouble(transducer);
+ }
}
/**
@@ -1795,7 +1949,63 @@
* @since 1.6
*/
public static float nextAfter(float start, double direction) {
- return sun.misc.FpUtils.nextAfter(start, direction);
+ /*
+ * The cases:
+ *
+ * nextAfter(+infinity, 0) == MAX_VALUE
+ * nextAfter(+infinity, +infinity) == +infinity
+ * nextAfter(-infinity, 0) == -MAX_VALUE
+ * nextAfter(-infinity, -infinity) == -infinity
+ *
+ * are naturally handled without any additional testing
+ */
+
+ // First check for NaN values
+ if (Float.isNaN(start) || Double.isNaN(direction)) {
+ // return a NaN derived from the input NaN(s)
+ return start + (float)direction;
+ } else if (start == direction) {
+ return (float)direction;
+ } else { // start > direction or start < direction
+ // Add +0.0 to get rid of a -0.0 (+0.0 + -0.0 => +0.0)
+ // then bitwise convert start to integer.
+ int transducer = Float.floatToRawIntBits(start + 0.0f);
+
+ /*
+ * IEEE 754 floating-point numbers are lexicographically
+ * ordered if treated as signed- magnitude integers .
+ * Since Java's integers are two's complement,
+ * incrementing" the two's complement representation of a
+ * logically negative floating-point value *decrements*
+ * the signed-magnitude representation. Therefore, when
+ * the integer representation of a floating-point values
+ * is less than zero, the adjustment to the representation
+ * is in the opposite direction than would be expected at
+ * first.
+ */
+ if (direction > start) {// Calculate next greater value
+ transducer = transducer + (transducer >= 0 ? 1:-1);
+ } else { // Calculate next lesser value
+ assert direction < start;
+ if (transducer > 0)
+ --transducer;
+ else
+ if (transducer < 0 )
+ ++transducer;
+ /*
+ * transducer==0, the result is -MIN_VALUE
+ *
+ * The transition from zero (implicitly
+ * positive) to the smallest negative
+ * signed magnitude value must be done
+ * explicitly.
+ */
+ else
+ transducer = FloatConsts.SIGN_BIT_MASK | 1;
+ }
+
+ return Float.intBitsToFloat(transducer);
+ }
}
/**
@@ -1824,7 +2034,13 @@
* @since 1.6
*/
public static double nextUp(double d) {
- return sun.misc.FpUtils.nextUp(d);
+ if( Double.isNaN(d) || d == Double.POSITIVE_INFINITY)
+ return d;
+ else {
+ d += 0.0d;
+ return Double.longBitsToDouble(Double.doubleToRawLongBits(d) +
+ ((d >= 0.0d)?+1L:-1L));
+ }
}
/**
@@ -1853,8 +2069,15 @@
* @since 1.6
*/
public static float nextUp(float f) {
- return sun.misc.FpUtils.nextUp(f);
+ if( Float.isNaN(f) || f == FloatConsts.POSITIVE_INFINITY)
+ return f;
+ else {
+ f += 0.0f;
+ return Float.intBitsToFloat(Float.floatToRawIntBits(f) +
+ ((f >= 0.0f)?+1:-1));
+ }
}
+
/**
* Returns the floating-point value adjacent to {@code d} in
* the direction of negative infinity. This method is
@@ -1930,7 +2153,7 @@
}
/**
- * Return {@code d} ×
+ * Returns {@code d} ×
* 2<sup>{@code scaleFactor}</sup> rounded as if performed
* by a single correctly rounded floating-point multiply to a
* member of the double value set. See the Java
@@ -1960,11 +2183,84 @@
* @since 1.6
*/
public static double scalb(double d, int scaleFactor) {
- return sun.misc.FpUtils.scalb(d, scaleFactor);
+ /*
+ * This method does not need to be declared strictfp to
+ * compute the same correct result on all platforms. When
+ * scaling up, it does not matter what order the
+ * multiply-store operations are done; the result will be
+ * finite or overflow regardless of the operation ordering.
+ * However, to get the correct result when scaling down, a
+ * particular ordering must be used.
+ *
+ * When scaling down, the multiply-store operations are
+ * sequenced so that it is not possible for two consecutive
+ * multiply-stores to return subnormal results. If one
+ * multiply-store result is subnormal, the next multiply will
+ * round it away to zero. This is done by first multiplying
+ * by 2 ^ (scaleFactor % n) and then multiplying several
+ * times by by 2^n as needed where n is the exponent of number
+ * that is a covenient power of two. In this way, at most one
+ * real rounding error occurs. If the double value set is
+ * being used exclusively, the rounding will occur on a
+ * multiply. If the double-extended-exponent value set is
+ * being used, the products will (perhaps) be exact but the
+ * stores to d are guaranteed to round to the double value
+ * set.
+ *
+ * It is _not_ a valid implementation to first multiply d by
+ * 2^MIN_EXPONENT and then by 2 ^ (scaleFactor %
+ * MIN_EXPONENT) since even in a strictfp program double
+ * rounding on underflow could occur; e.g. if the scaleFactor
+ * argument was (MIN_EXPONENT - n) and the exponent of d was a
+ * little less than -(MIN_EXPONENT - n), meaning the final
+ * result would be subnormal.
+ *
+ * Since exact reproducibility of this method can be achieved
+ * without any undue performance burden, there is no
+ * compelling reason to allow double rounding on underflow in
+ * scalb.
+ */
+
+ // magnitude of a power of two so large that scaling a finite
+ // nonzero value by it would be guaranteed to over or
+ // underflow; due to rounding, scaling down takes takes an
+ // additional power of two which is reflected here
+ final int MAX_SCALE = DoubleConsts.MAX_EXPONENT + -DoubleConsts.MIN_EXPONENT +
+ DoubleConsts.SIGNIFICAND_WIDTH + 1;
+ int exp_adjust = 0;
+ int scale_increment = 0;
+ double exp_delta = Double.NaN;
+
+ // Make sure scaling factor is in a reasonable range
+
+ if(scaleFactor < 0) {
+ scaleFactor = Math.max(scaleFactor, -MAX_SCALE);
+ scale_increment = -512;
+ exp_delta = twoToTheDoubleScaleDown;
+ }
+ else {
+ scaleFactor = Math.min(scaleFactor, MAX_SCALE);
+ scale_increment = 512;
+ exp_delta = twoToTheDoubleScaleUp;
+ }
+
+ // Calculate (scaleFactor % +/-512), 512 = 2^9, using
+ // technique from "Hacker's Delight" section 10-2.
+ int t = (scaleFactor >> 9-1) >>> 32 - 9;
+ exp_adjust = ((scaleFactor + t) & (512 -1)) - t;
+
+ d *= powerOfTwoD(exp_adjust);
+ scaleFactor -= exp_adjust;
+
+ while(scaleFactor != 0) {
+ d *= exp_delta;
+ scaleFactor -= scale_increment;
+ }
+ return d;
}
/**
- * Return {@code f} ×
+ * Returns {@code f} ×
* 2<sup>{@code scaleFactor}</sup> rounded as if performed
* by a single correctly rounded floating-point multiply to a
* member of the float value set. See the Java
@@ -1994,6 +2290,49 @@
* @since 1.6
*/
public static float scalb(float f, int scaleFactor) {
- return sun.misc.FpUtils.scalb(f, scaleFactor);
+ // magnitude of a power of two so large that scaling a finite
+ // nonzero value by it would be guaranteed to over or
+ // underflow; due to rounding, scaling down takes takes an
+ // additional power of two which is reflected here
+ final int MAX_SCALE = FloatConsts.MAX_EXPONENT + -FloatConsts.MIN_EXPONENT +
+ FloatConsts.SIGNIFICAND_WIDTH + 1;
+
+ // Make sure scaling factor is in a reasonable range
+ scaleFactor = Math.max(Math.min(scaleFactor, MAX_SCALE), -MAX_SCALE);
+
+ /*
+ * Since + MAX_SCALE for float fits well within the double
+ * exponent range and + float -> double conversion is exact
+ * the multiplication below will be exact. Therefore, the
+ * rounding that occurs when the double product is cast to
+ * float will be the correctly rounded float result. Since
+ * all operations other than the final multiply will be exact,
+ * it is not necessary to declare this method strictfp.
+ */
+ return (float)((double)f*powerOfTwoD(scaleFactor));
+ }
+
+ // Constants used in scalb
+ static double twoToTheDoubleScaleUp = powerOfTwoD(512);
+ static double twoToTheDoubleScaleDown = powerOfTwoD(-512);
+
+ /**
+ * Returns a floating-point power of two in the normal range.
+ */
+ static double powerOfTwoD(int n) {
+ assert(n >= DoubleConsts.MIN_EXPONENT && n <= DoubleConsts.MAX_EXPONENT);
+ return Double.longBitsToDouble((((long)n + (long)DoubleConsts.EXP_BIAS) <<
+ (DoubleConsts.SIGNIFICAND_WIDTH-1))
+ & DoubleConsts.EXP_BIT_MASK);
+ }
+
+ /**
+ * Returns a floating-point power of two in the normal range.
+ */
+ static float powerOfTwoF(int n) {
+ assert(n >= FloatConsts.MIN_EXPONENT && n <= FloatConsts.MAX_EXPONENT);
+ return Float.intBitsToFloat(((n + FloatConsts.EXP_BIAS) <<
+ (FloatConsts.SIGNIFICAND_WIDTH-1))
+ & FloatConsts.EXP_BIT_MASK);
}
}
diff --git a/ojluni/src/main/java/java/lang/NegativeArraySizeException.java b/ojluni/src/main/java/java/lang/NegativeArraySizeException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/NoClassDefFoundError.java b/ojluni/src/main/java/java/lang/NoClassDefFoundError.java
old mode 100755
new mode 100644
index 575c267..869c8d9
--- a/ojluni/src/main/java/java/lang/NoClassDefFoundError.java
+++ b/ojluni/src/main/java/java/lang/NoClassDefFoundError.java
@@ -60,7 +60,6 @@
super(s);
}
-
/**
* Constructs a new {@code NoClassDefFoundError} with the current stack
* trace, the specified detail message and the specified cause. Used
diff --git a/ojluni/src/main/java/java/lang/NoSuchFieldError.java b/ojluni/src/main/java/java/lang/NoSuchFieldError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/NoSuchFieldException.java b/ojluni/src/main/java/java/lang/NoSuchFieldException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/NoSuchMethodError.java b/ojluni/src/main/java/java/lang/NoSuchMethodError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/NoSuchMethodException.java b/ojluni/src/main/java/java/lang/NoSuchMethodException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/NullPointerException.java b/ojluni/src/main/java/java/lang/NullPointerException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Number.java b/ojluni/src/main/java/java/lang/Number.java
old mode 100755
new mode 100644
index 216ce8d..d901609
--- a/ojluni/src/main/java/java/lang/Number.java
+++ b/ojluni/src/main/java/java/lang/Number.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 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
@@ -26,69 +26,78 @@
package java.lang;
/**
- * The abstract class <code>Number</code> is the superclass of classes
- * <code>BigDecimal</code>, <code>BigInteger</code>,
- * <code>Byte</code>, <code>Double</code>, <code>Float</code>,
- * <code>Integer</code>, <code>Long</code>, and <code>Short</code>.
- * <p>
- * Subclasses of <code>Number</code> must provide methods to convert
- * the represented numeric value to <code>byte</code>, <code>double</code>,
- * <code>float</code>, <code>int</code>, <code>long</code>, and
- * <code>short</code>.
+ * The abstract class {@code Number} is the superclass of platform
+ * classes representing numeric values that are convertible to the
+ * primitive types {@code byte}, {@code double}, {@code float}, {@code
+ * int}, {@code long}, and {@code short}.
+ *
+ * The specific semantics of the conversion from the numeric value of
+ * a particular {@code Number} implementation to a given primitive
+ * type is defined by the {@code Number} implementation in question.
+ *
+ * For platform classes, the conversion is often analogous to a
+ * narrowing primitive conversion or a widening primitive conversion
+ * as defining in <cite>The Java™ Language Specification</cite>
+ * for converting between primitive types. Therefore, conversions may
+ * lose information about the overall magnitude of a numeric value, may
+ * lose precision, and may even return a result of a different sign
+ * than the input.
+ *
+ * See the documentation of a given {@code Number} implementation for
+ * conversion details.
*
* @author Lee Boynton
* @author Arthur van Hoff
- * @see java.lang.Byte
- * @see java.lang.Double
- * @see java.lang.Float
- * @see java.lang.Integer
- * @see java.lang.Long
- * @see java.lang.Short
+ * @jls 5.1.2 Widening Primitive Conversions
+ * @jls 5.1.3 Narrowing Primitive Conversions
* @since JDK1.0
*/
public abstract class Number implements java.io.Serializable {
/**
- * Returns the value of the specified number as an <code>int</code>.
- * This may involve rounding or truncation.
+ * Returns the value of the specified number as an {@code int},
+ * which may involve rounding or truncation.
*
* @return the numeric value represented by this object after conversion
- * to type <code>int</code>.
+ * to type {@code int}.
*/
public abstract int intValue();
/**
- * Returns the value of the specified number as a <code>long</code>.
- * This may involve rounding or truncation.
+ * Returns the value of the specified number as a {@code long},
+ * which may involve rounding or truncation.
*
* @return the numeric value represented by this object after conversion
- * to type <code>long</code>.
+ * to type {@code long}.
*/
public abstract long longValue();
/**
- * Returns the value of the specified number as a <code>float</code>.
- * This may involve rounding.
+ * Returns the value of the specified number as a {@code float},
+ * which may involve rounding.
*
* @return the numeric value represented by this object after conversion
- * to type <code>float</code>.
+ * to type {@code float}.
*/
public abstract float floatValue();
/**
- * Returns the value of the specified number as a <code>double</code>.
- * This may involve rounding.
+ * Returns the value of the specified number as a {@code double},
+ * which may involve rounding.
*
* @return the numeric value represented by this object after conversion
- * to type <code>double</code>.
+ * to type {@code double}.
*/
public abstract double doubleValue();
/**
- * Returns the value of the specified number as a <code>byte</code>.
- * This may involve rounding or truncation.
+ * Returns the value of the specified number as a {@code byte},
+ * which may involve rounding or truncation.
+ *
+ * <p>This implementation returns the result of {@link #intValue} cast
+ * to a {@code byte}.
*
* @return the numeric value represented by this object after conversion
- * to type <code>byte</code>.
+ * to type {@code byte}.
* @since JDK1.1
*/
public byte byteValue() {
@@ -96,11 +105,14 @@
}
/**
- * Returns the value of the specified number as a <code>short</code>.
- * This may involve rounding or truncation.
+ * Returns the value of the specified number as a {@code short},
+ * which may involve rounding or truncation.
+ *
+ * <p>This implementation returns the result of {@link #intValue} cast
+ * to a {@code short}.
*
* @return the numeric value represented by this object after conversion
- * to type <code>short</code>.
+ * to type {@code short}.
* @since JDK1.1
*/
public short shortValue() {
diff --git a/ojluni/src/main/java/java/lang/NumberFormatException.java b/ojluni/src/main/java/java/lang/NumberFormatException.java
old mode 100755
new mode 100644
index c1d19de..ea1ec9f
--- a/ojluni/src/main/java/java/lang/NumberFormatException.java
+++ b/ojluni/src/main/java/java/lang/NumberFormatException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2001, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2012, 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
@@ -31,7 +31,7 @@
* have the appropriate format.
*
* @author unascribed
- * @see java.lang.Integer#toString()
+ * @see java.lang.Integer#parseInt(String)
* @since JDK1.0
*/
public
diff --git a/ojluni/src/main/java/java/lang/Object.java b/ojluni/src/main/java/java/lang/Object.java
old mode 100755
new mode 100644
index fdeef6c..811930f
--- a/ojluni/src/main/java/java/lang/Object.java
+++ b/ojluni/src/main/java/java/lang/Object.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2012, 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
@@ -57,8 +57,7 @@
*
* @return The {@code Class} object that represents the runtime
* class of this object.
- * @see Class Literals, section 15.8.2 of
- * <cite>The Java™ Language Specification</cite>.
+ * @jls 15.8.2 Class Literals
*/
public final Class<?> getClass() {
return shadow$_klass_;
@@ -93,7 +92,7 @@
* objects. (This is typically implemented by converting the internal
* address of the object into an integer, but this implementation
* technique is not required by the
- * Java<font size="-2"><sup>TM</sup></font> programming language.)
+ * Java™ programming language.)
*
* @return a hash code value for this object.
* @see java.lang.Object#equals(java.lang.Object)
@@ -213,7 +212,7 @@
* exception at run time.
*
* @return a clone of this instance.
- * @exception CloneNotSupportedException if the object's class does not
+ * @throws CloneNotSupportedException if the object's class does not
* support the {@code Cloneable} interface. Subclasses
* that override the {@code clone} method can also
* throw this exception to indicate that an instance cannot
@@ -287,7 +286,7 @@
* <p>
* Only one thread at a time can own an object's monitor.
*
- * @exception IllegalMonitorStateException if the current thread is not
+ * @throws IllegalMonitorStateException if the current thread is not
* the owner of this object's monitor.
* @see java.lang.Object#notifyAll()
* @see java.lang.Object#wait()
@@ -311,7 +310,7 @@
* description of the ways in which a thread can become the owner of
* a monitor.
*
- * @exception IllegalMonitorStateException if the current thread is not
+ * @throws IllegalMonitorStateException if the current thread is not
* the owner of this object's monitor.
* @see java.lang.Object#notify()
* @see java.lang.Object#wait()
@@ -391,11 +390,11 @@
* a monitor.
*
* @param millis the maximum time to wait in milliseconds.
- * @exception IllegalArgumentException if the value of timeout is
+ * @throws IllegalArgumentException if the value of timeout is
* negative.
- * @exception IllegalMonitorStateException if the current thread is not
+ * @throws IllegalMonitorStateException if the current thread is not
* the owner of the object's monitor.
- * @exception InterruptedException if any thread interrupted the
+ * @throws InterruptedException if any thread interrupted the
* current thread before or while the current thread
* was waiting for a notification. The <i>interrupted
* status</i> of the current thread is cleared when
@@ -458,12 +457,12 @@
* @param millis the maximum time to wait in milliseconds.
* @param nanos additional time, in nanoseconds range
* 0-999999.
- * @exception IllegalArgumentException if the value of timeout is
+ * @throws IllegalArgumentException if the value of timeout is
* negative or the value of nanos is
* not in the range 0-999999.
- * @exception IllegalMonitorStateException if the current thread is not
+ * @throws IllegalMonitorStateException if the current thread is not
* the owner of this object's monitor.
- * @exception InterruptedException if any thread interrupted the
+ * @throws InterruptedException if any thread interrupted the
* current thread before or while the current thread
* was waiting for a notification. The <i>interrupted
* status</i> of the current thread is cleared when
@@ -499,9 +498,9 @@
* description of the ways in which a thread can become the owner of
* a monitor.
*
- * @exception IllegalMonitorStateException if the current thread is not
+ * @throws IllegalMonitorStateException if the current thread is not
* the owner of the object's monitor.
- * @exception InterruptedException if any thread interrupted the
+ * @throws InterruptedException if any thread interrupted the
* current thread before or while the current thread
* was waiting for a notification. The <i>interrupted
* status</i> of the current thread is cleared when
@@ -518,7 +517,7 @@
* system resources or to perform other cleanup.
* <p>
* The general contract of {@code finalize} is that it is invoked
- * if and when the Java<font size="-2"><sup>TM</sup></font> virtual
+ * if and when the Java™ virtual
* machine has determined that there is no longer any
* means by which this object can be accessed by any thread that has
* not yet died, except as a result of an action taken by the
@@ -557,6 +556,9 @@
* ignored.
*
* @throws Throwable the {@code Exception} raised by this method
+ * @see java.lang.ref.WeakReference
+ * @see java.lang.ref.PhantomReference
+ * @jls 12.6 Finalization of Class Instances
*/
protected void finalize() throws Throwable { }
}
diff --git a/ojluni/src/main/java/java/lang/OutOfMemoryError.java b/ojluni/src/main/java/java/lang/OutOfMemoryError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Override.java b/ojluni/src/main/java/java/lang/Override.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Package.java b/ojluni/src/main/java/java/lang/Package.java
old mode 100755
new mode 100644
index a4777c5..9153430
--- a/ojluni/src/main/java/java/lang/Package.java
+++ b/ojluni/src/main/java/java/lang/Package.java
@@ -78,18 +78,18 @@
* by the following formal grammar:
* <blockquote>
* <dl>
- * <dt><i>SpecificationVersion:
- * <dd>Digits RefinedVersion<sub>opt</sub></i>
+ * <dt><i>SpecificationVersion:</i>
+ * <dd><i>Digits RefinedVersion<sub>opt</sub></i>
- * <p><dt><i>RefinedVersion:</i>
+ * <dt><i>RefinedVersion:</i>
* <dd>{@code .} <i>Digits</i>
* <dd>{@code .} <i>Digits RefinedVersion</i>
*
- * <p><dt><i>Digits:
- * <dd>Digit
- * <dd>Digits</i>
+ * <dt><i>Digits:</i>
+ * <dd><i>Digit</i>
+ * <dd><i>Digits</i>
*
- * <p><dt><i>Digit:</i>
+ * <dt><i>Digit:</i>
* <dd>any character for which {@link Character#isDigit} returns {@code true},
* e.g. 0, 1, 2, ...
* </dl>
@@ -322,7 +322,7 @@
* attributes are defined in the manifests that accompany
* the classes.
*
- * @param class the class to get the package of.
+ * @param c the class to get the package of.
* @return the package of the class. It may be null if no package
* information is available from the archive or codebase. */
static Package getPackage(Class<?> c) {
@@ -400,6 +400,16 @@
}
/**
+ * {@inheritDoc}
+ * @throws NullPointerException {@inheritDoc}
+ * @since 1.5
+ */
+ @Override
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) {
+ return AnnotatedElement.super.isAnnotationPresent(annotationClass);
+ }
+
+ /**
* @throws NullPointerException {@inheritDoc}
* @since 1.8
*/
@@ -443,14 +453,13 @@
/**
* Construct a package instance with the specified version
* information.
- * @param pkgName the name of the package
+ * @param name the name of the package
* @param spectitle the title of the specification
* @param specversion the version of the specification
* @param specvendor the organization that maintains the specification
* @param impltitle the title of the implementation
* @param implversion the version of the implementation
* @param implvendor the organization that maintains the implementation
- * @return a new package for containing the specified information.
*/
Package(String name,
String spectitle, String specversion, String specvendor,
@@ -640,5 +649,5 @@
private final String implVendor;
private final URL sealBase;
private transient final ClassLoader loader;
- private transient Class packageInfo;
+ private transient Class<?> packageInfo;
}
diff --git a/ojluni/src/main/java/java/lang/Process.java b/ojluni/src/main/java/java/lang/Process.java
old mode 100755
new mode 100644
index ec0a661..0f93702
--- a/ojluni/src/main/java/java/lang/Process.java
+++ b/ojluni/src/main/java/java/lang/Process.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2012, 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
@@ -26,6 +26,7 @@
package java.lang;
import java.io.*;
+import java.util.concurrent.TimeUnit;
/**
* The {@link ProcessBuilder#start()} and
@@ -56,10 +57,6 @@
* to promptly write the input stream or read the output stream of
* the subprocess may cause the subprocess to block, or even deadlock.
*
- * <p>Where desired, <a href="ProcessBuilder.html#redirect-input">
- * subprocess I/O can also be redirected</a>
- * using methods of the {@link ProcessBuilder} class.
- *
* <p>The subprocess is not killed when there are no more references to
* the {@code Process} object, but rather the subprocess
* continues executing asynchronously.
@@ -79,66 +76,39 @@
* subprocess. Output to the stream is piped into the standard
* input of the process represented by this {@code Process} object.
*
- * <p>If the standard input of the subprocess has been redirected using
- * {@link ProcessBuilder#redirectInput(Redirect)
- * ProcessBuilder.redirectInput}
- * then this method will return a
- * <a href="ProcessBuilder.html#redirect-input">null output stream</a>.
- *
* <p>Implementation note: It is a good idea for the returned
* output stream to be buffered.
*
* @return the output stream connected to the normal input of the
* subprocess
*/
- abstract public OutputStream getOutputStream();
+ public abstract OutputStream getOutputStream();
/**
* Returns the input stream connected to the normal output of the
* subprocess. The stream obtains data piped from the standard
* output of the process represented by this {@code Process} object.
*
- * <p>If the standard output of the subprocess has been redirected using
- * {@link ProcessBuilder#redirectOutput(Redirect)
- * ProcessBuilder.redirectOutput}
- * then this method will return a
- * <a href="ProcessBuilder.html#redirect-output">null input stream</a>.
- *
- * <p>Otherwise, if the standard error of the subprocess has been
- * redirected using
- * {@link ProcessBuilder#redirectErrorStream(boolean)
- * ProcessBuilder.redirectErrorStream}
- * then the input stream returned by this method will receive the
- * merged standard output and the standard error of the subprocess.
- *
* <p>Implementation note: It is a good idea for the returned
* input stream to be buffered.
*
* @return the input stream connected to the normal output of the
* subprocess
*/
- abstract public InputStream getInputStream();
+ public abstract InputStream getInputStream();
/**
* Returns the input stream connected to the error output of the
* subprocess. The stream obtains data piped from the error output
* of the process represented by this {@code Process} object.
*
- * <p>If the standard error of the subprocess has been redirected using
- * {@link ProcessBuilder#redirectError(Redirect)
- * ProcessBuilder.redirectError} or
- * {@link ProcessBuilder#redirectErrorStream(boolean)
- * ProcessBuilder.redirectErrorStream}
- * then this method will return a
- * <a href="ProcessBuilder.html#redirect-output">null input stream</a>.
- *
* <p>Implementation note: It is a good idea for the returned
* input stream to be buffered.
*
* @return the input stream connected to the error output of
* the subprocess
*/
- abstract public InputStream getErrorStream();
+ public abstract InputStream getErrorStream();
/**
* Causes the current thread to wait, if necessary, until the
@@ -156,7 +126,51 @@
* thread while it is waiting, then the wait is ended and
* an {@link InterruptedException} is thrown.
*/
- abstract public int waitFor() throws InterruptedException;
+ public abstract int waitFor() throws InterruptedException;
+
+ /**
+ * Causes the current thread to wait, if necessary, until the
+ * subprocess represented by this {@code Process} object has
+ * terminated, or the specified waiting time elapses.
+ *
+ * <p>If the subprocess has already terminated then this method returns
+ * immediately with the value {@code true}. If the process has not
+ * terminated and the timeout value is less than, or equal to, zero, then
+ * this method returns immediately with the value {@code false}.
+ *
+ * <p>The default implementation of this methods polls the {@code exitValue}
+ * to check if the process has terminated. Concrete implementations of this
+ * class are strongly encouraged to override this method with a more
+ * efficient implementation.
+ *
+ * @param timeout the maximum time to wait
+ * @param unit the time unit of the {@code timeout} argument
+ * @return {@code true} if the subprocess has exited and {@code false} if
+ * the waiting time elapsed before the subprocess has exited.
+ * @throws InterruptedException if the current thread is interrupted
+ * while waiting.
+ * @throws NullPointerException if unit is null
+ * @since 1.8
+ */
+ public boolean waitFor(long timeout, TimeUnit unit)
+ throws InterruptedException
+ {
+ long startTime = System.nanoTime();
+ long rem = unit.toNanos(timeout);
+
+ do {
+ try {
+ exitValue();
+ return true;
+ } catch(IllegalThreadStateException ex) {
+ if (rem > 0)
+ Thread.sleep(
+ Math.min(TimeUnit.NANOSECONDS.toMillis(rem) + 1, 100));
+ }
+ rem = unit.toNanos(timeout) - (System.nanoTime() - startTime);
+ } while (rem > 0);
+ return false;
+ }
/**
* Returns the exit value for the subprocess.
@@ -167,11 +181,54 @@
* @throws IllegalThreadStateException if the subprocess represented
* by this {@code Process} object has not yet terminated
*/
- abstract public int exitValue();
+ public abstract int exitValue();
+
+ /**
+ * Kills the subprocess. Whether the subprocess represented by this
+ * {@code Process} object is forcibly terminated or not is
+ * implementation dependent.
+ */
+ public abstract void destroy();
/**
* Kills the subprocess. The subprocess represented by this
* {@code Process} object is forcibly terminated.
+ *
+ * <p>The default implementation of this method invokes {@link #destroy}
+ * and so may not forcibly terminate the process. Concrete implementations
+ * of this class are strongly encouraged to override this method with a
+ * compliant implementation. Invoking this method on {@code Process}
+ * objects returned by {@link ProcessBuilder#start} and
+ * {@link Runtime#exec} will forcibly terminate the process.
+ *
+ * <p>Note: The subprocess may not terminate immediately.
+ * i.e. {@code isAlive()} may return true for a brief period
+ * after {@code destroyForcibly()} is called. This method
+ * may be chained to {@code waitFor()} if needed.
+ *
+ * @return the {@code Process} object representing the
+ * subprocess to be forcibly destroyed.
+ * @since 1.8
*/
- abstract public void destroy();
+ public Process destroyForcibly() {
+ destroy();
+ return this;
+ }
+
+ /**
+ * Tests whether the subprocess represented by this {@code Process} is
+ * alive.
+ *
+ * @return {@code true} if the subprocess represented by this
+ * {@code Process} object has not yet terminated.
+ * @since 1.8
+ */
+ public boolean isAlive() {
+ try {
+ exitValue();
+ return false;
+ } catch(IllegalThreadStateException e) {
+ return true;
+ }
+ }
}
diff --git a/ojluni/src/main/java/java/lang/ProcessBuilder.java b/ojluni/src/main/java/java/lang/ProcessBuilder.java
old mode 100755
new mode 100644
index a38533d..dd61e53
--- a/ojluni/src/main/java/java/lang/ProcessBuilder.java
+++ b/ojluni/src/main/java/java/lang/ProcessBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -29,7 +29,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
-import java.security.AccessControlException;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;
@@ -65,65 +64,6 @@
* working directory of the current process, usually the directory
* named by the system property {@code user.dir}.
*
- * <li><a name="redirect-input">a source of <i>standard input</i>.
- * By default, the subprocess reads input from a pipe. Java code
- * can access this pipe via the output stream returned by
- * {@link Process#getOutputStream()}. However, standard input may
- * be redirected to another source using
- * {@link #redirectInput(Redirect) redirectInput}.
- * In this case, {@link Process#getOutputStream()} will return a
- * <i>null output stream</i>, for which:
- *
- * <ul>
- * <li>the {@link OutputStream#write(int) write} methods always
- * throw {@code IOException}
- * <li>the {@link OutputStream#close() close} method does nothing
- * </ul>
- *
- * <li><a name="redirect-output">a destination for <i>standard output</i>
- * and <i>standard error</i>. By default, the subprocess writes standard
- * output and standard error to pipes. Java code can access these pipes
- * via the input streams returned by {@link Process#getInputStream()} and
- * {@link Process#getErrorStream()}. However, standard output and
- * standard error may be redirected to other destinations using
- * {@link #redirectOutput(Redirect) redirectOutput} and
- * {@link #redirectError(Redirect) redirectError}.
- * In this case, {@link Process#getInputStream()} and/or
- * {@link Process#getErrorStream()} will return a <i>null input
- * stream</i>, for which:
- *
- * <ul>
- * <li>the {@link InputStream#read() read} methods always return
- * {@code -1}
- * <li>the {@link InputStream#available() available} method always returns
- * {@code 0}
- * <li>the {@link InputStream#close() close} method does nothing
- * </ul>
- *
- * <li>a <i>redirectErrorStream</i> property. Initially, this property
- * is {@code false}, meaning that the standard output and error
- * output of a subprocess are sent to two separate streams, which can
- * be accessed using the {@link Process#getInputStream()} and {@link
- * Process#getErrorStream()} methods.
- *
- * <p>If the value is set to {@code true}, then:
- *
- * <ul>
- * <li>standard error is merged with the standard output and always sent
- * to the same destination (this makes it easier to correlate error
- * messages with the corresponding output)
- * <li>the common destination of standard error and standard output can be
- * redirected using
- * {@link #redirectOutput(Redirect) redirectOutput}
- * <li>any redirection set by the
- * {@link #redirectError(Redirect) redirectError}
- * method is ignored when creating a subprocess
- * <li>the stream returned from {@link Process#getErrorStream()} will
- * always be a <a href="#redirect-output">null input stream</a>
- * </ul>
- *
- * </ul>
- *
* <p>Modifying a process builder's attributes will affect processes
* subsequently started by that object's {@link #start()} method, but
* will never affect previously started processes or the Java process
@@ -148,8 +88,7 @@
* }</pre>
*
* <p>Here is an example that starts a process with a modified working
- * directory and environment, and redirects standard output and error
- * to be appended to a log file:
+ * directory and environment:
*
* <pre> {@code
* ProcessBuilder pb =
@@ -159,13 +98,7 @@
* env.remove("OTHERVAR");
* env.put("VAR2", env.get("VAR1") + "suffix");
* pb.directory(new File("myDir"));
- * File log = new File("log");
- * pb.redirectErrorStream(true);
- * pb.redirectOutput(Redirect.appendTo(log));
* Process p = pb.start();
- * assert pb.redirectInput() == Redirect.PIPE;
- * assert pb.redirectOutput().file() == log;
- * assert p.getInputStream().read() == -1;
* }</pre>
*
* <p>To start a process with an explicit set of environment
@@ -456,6 +389,8 @@
* {@link Type Type}.
*
* @since 1.7
+ *
+ * @hide
*/
public static abstract class Redirect {
/**
@@ -554,6 +489,7 @@
* Redirect.from(file).type() == Redirect.Type.READ
* }</pre>
*
+ * @param file The {@code File} for the {@code Redirect}.
* @throws NullPointerException if the specified file is null
* @return a redirect to read from the specified file
*/
@@ -580,6 +516,7 @@
* Redirect.to(file).type() == Redirect.Type.WRITE
* }</pre>
*
+ * @param file The {@code File} for the {@code Redirect}.
* @throws NullPointerException if the specified file is null
* @return a redirect to write to the specified file
*/
@@ -610,6 +547,7 @@
* Redirect.appendTo(file).type() == Redirect.Type.APPEND
* }</pre>
*
+ * @param file The {@code File} for the {@code Redirect}.
* @throws NullPointerException if the specified file is null
* @return a redirect to append to the specified file
*/
@@ -694,6 +632,8 @@
* {@link Redirect.Type#WRITE WRITE} or
* {@link Redirect.Type#APPEND APPEND}
* @since 1.7
+ *
+ * @hide
*/
public ProcessBuilder redirectInput(Redirect source) {
if (source.type() == Redirect.Type.WRITE ||
@@ -725,6 +665,8 @@
* destination of data, that is, has type
* {@link Redirect.Type#READ READ}
* @since 1.7
+ *
+ * @hide
*/
public ProcessBuilder redirectOutput(Redirect destination) {
if (destination.type() == Redirect.Type.READ)
@@ -759,6 +701,8 @@
* destination of data, that is, has type
* {@link Redirect.Type#READ READ}
* @since 1.7
+ *
+ * @hide
*/
public ProcessBuilder redirectError(Redirect destination) {
if (destination.type() == Redirect.Type.READ)
@@ -780,6 +724,8 @@
* @param file the new standard input source
* @return this process builder
* @since 1.7
+ *
+ * @hide
*/
public ProcessBuilder redirectInput(File file) {
return redirectInput(Redirect.from(file));
@@ -797,6 +743,8 @@
* @param file the new standard output destination
* @return this process builder
* @since 1.7
+ *
+ * @hide
*/
public ProcessBuilder redirectOutput(File file) {
return redirectOutput(Redirect.to(file));
@@ -814,6 +762,8 @@
* @param file the new standard error destination
* @return this process builder
* @since 1.7
+ *
+ * @hide
*/
public ProcessBuilder redirectError(File file) {
return redirectError(Redirect.to(file));
@@ -828,6 +778,8 @@
*
* @return this process builder's standard input source
* @since 1.7
+ *
+ * @hide
*/
public Redirect redirectInput() {
return (redirects == null) ? Redirect.PIPE : redirects[0];
@@ -842,6 +794,8 @@
*
* @return this process builder's standard output destination
* @since 1.7
+ *
+ * @hide
*/
public Redirect redirectOutput() {
return (redirects == null) ? Redirect.PIPE : redirects[1];
@@ -856,6 +810,8 @@
*
* @return this process builder's standard error destination
* @since 1.7
+ *
+ * @hide
*/
public Redirect redirectError() {
return (redirects == null) ? Redirect.PIPE : redirects[2];
@@ -882,6 +838,8 @@
*
* @return this process builder
* @since 1.7
+ *
+ * @hide
*/
public ProcessBuilder inheritIO() {
Arrays.fill(redirects(), Redirect.INHERIT);
@@ -979,20 +937,6 @@
* <li>its
* {@link SecurityManager#checkExec checkExec}
* method doesn't allow creation of the subprocess, or
- *
- * <li>the standard input to the subprocess was
- * {@linkplain #redirectInput redirected from a file}
- * and the security manager's
- * {@link SecurityManager#checkRead checkRead} method
- * denies read access to the file, or
- *
- * <li>the standard output or standard error of the
- * subprocess was
- * {@linkplain #redirectOutput redirected to a file}
- * and the security manager's
- * {@link SecurityManager#checkWrite checkWrite} method
- * denies write access to the file
- *
* </ul>
*
* @throws IOException if an I/O error occurs
@@ -1012,12 +956,17 @@
String prog = cmdarray[0];
SecurityManager security = System.getSecurityManager();
- if (security != null) {
+ if (security != null)
security.checkExec(prog);
- }
String dir = directory == null ? null : directory.toString();
+ for (int i = 1; i < cmdarray.length; i++) {
+ if (cmdarray[i].indexOf('\u0000') >= 0) {
+ throw new IOException("invalid null character in command");
+ }
+ }
+
try {
return ProcessImpl.start(cmdarray,
environment,
@@ -1031,9 +980,9 @@
// Can not disclose the fail reason for read-protected files.
try {
security.checkRead(prog);
- } catch (AccessControlException ace) {
+ } catch (SecurityException se) {
exceptionInfo = "";
- cause = ace;
+ cause = se;
}
}
// It's much easier for us to create a high-quality error
diff --git a/ojluni/src/main/java/java/lang/ProcessEnvironment.java b/ojluni/src/main/java/java/lang/ProcessEnvironment.java
old mode 100755
new mode 100644
index bb60c71..08d260c
--- a/ojluni/src/main/java/java/lang/ProcessEnvironment.java
+++ b/ojluni/src/main/java/java/lang/ProcessEnvironment.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 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
@@ -91,6 +91,7 @@
}
/* Only for use by ProcessBuilder.environment() */
+ @SuppressWarnings("unchecked")
static Map<String,String> environment() {
return new StringEnvironment
((Map<Variable,Value>)(theEnvironment.clone()));
diff --git a/ojluni/src/main/java/java/lang/ProcessImpl.java b/ojluni/src/main/java/java/lang/ProcessImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Readable.java b/ojluni/src/main/java/java/lang/Readable.java
old mode 100755
new mode 100644
index 7e4e924..c7a3d1a
--- a/ojluni/src/main/java/java/lang/Readable.java
+++ b/ojluni/src/main/java/java/lang/Readable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2013, 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
@@ -34,7 +34,6 @@
*
* @since 1.5
*/
-
public interface Readable {
/**
@@ -51,5 +50,4 @@
* @throws java.nio.ReadOnlyBufferException if cb is a read only buffer
*/
public int read(java.nio.CharBuffer cb) throws IOException;
-
}
diff --git a/ojluni/src/main/java/java/lang/ReflectiveOperationException.java b/ojluni/src/main/java/java/lang/ReflectiveOperationException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Runnable.java b/ojluni/src/main/java/java/lang/Runnable.java
old mode 100755
new mode 100644
index 6aeb892..b9f1df7
--- a/ojluni/src/main/java/java/lang/Runnable.java
+++ b/ojluni/src/main/java/java/lang/Runnable.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2013, 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
@@ -52,8 +52,8 @@
* @see java.util.concurrent.Callable
* @since JDK1.0
*/
-public
-interface Runnable {
+@FunctionalInterface
+public interface Runnable {
/**
* When an object implementing interface <code>Runnable</code> is used
* to create a thread, starting the thread causes the object's
diff --git a/ojluni/src/main/java/java/lang/Runtime.java b/ojluni/src/main/java/java/lang/Runtime.java
old mode 100755
new mode 100644
index eb01061..fa0adbe
--- a/ojluni/src/main/java/java/lang/Runtime.java
+++ b/ojluni/src/main/java/java/lang/Runtime.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1995, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -181,11 +181,11 @@
*
* <ul>
*
- * <p> <li> The program <i>exits</i> normally, when the last non-daemon
+ * <li> The program <i>exits</i> normally, when the last non-daemon
* thread exits or when the <tt>{@link #exit exit}</tt> (equivalently,
- * <tt>{@link System#exit(int) System.exit}</tt>) method is invoked, or
+ * {@link System#exit(int) System.exit}) method is invoked, or
*
- * <p> <li> The virtual machine is <i>terminated</i> in response to a
+ * <li> The virtual machine is <i>terminated</i> in response to a
* user interrupt, such as typing <tt>^C</tt>, or a system-wide event,
* such as user logoff or system shutdown.
*
@@ -737,7 +737,7 @@
/**
* Returns the maximum amount of memory that the Java virtual machine will
* attempt to use. If there is no inherent limit then the value {@link
- * java.lang.Long#MAX_VALUE} will be returned. </p>
+ * java.lang.Long#MAX_VALUE} will be returned.
*
* @return the maximum amount of memory that the virtual machine will
* attempt to use, measured in bytes
@@ -803,11 +803,10 @@
* method causes the virtual machine to stop performing the
* detailed instruction trace it is performing.
*
- * @param enable <code>true</code> to enable instruction tracing;
+ * @param on <code>true</code> to enable instruction tracing;
* <code>false</code> to disable this feature.
*/
- // Android changed - param name s/on/enable
- public void traceInstructions(boolean enable) {
+ public void traceInstructions(boolean on) {
}
/**
@@ -823,26 +822,36 @@
* Calling this method with argument false suggests that the
* virtual machine cease emitting per-call debugging information.
*
- * @param enable <code>true</code> to enable instruction tracing;
+ * @param on <code>true</code> to enable instruction tracing;
* <code>false</code> to disable this feature.
*/
- // Android changed - param name s/on/enable
- public void traceMethodCalls(boolean enable) {
- if (enable != tracingMethods) {
- if (enable) {
+ public void traceMethodCalls(boolean on) {
+ if (on != tracingMethods) {
+ if (on) {
VMDebug.startMethodTracing();
} else {
VMDebug.stopMethodTracing();
}
- tracingMethods = enable;
+ tracingMethods = on;
}
}
/**
- * Loads the specified filename as a dynamic library. The filename
- * argument must be a complete path name,
+ * Loads the native library specified by the filename argument. The filename
+ * argument must be an absolute path name.
* (for example
* <code>Runtime.getRuntime().load("/home/avh/lib/libX11.so");</code>).
+ *
+ * If the filename argument, when stripped of any platform-specific library
+ * prefix, path, and file extension, indicates a library whose name is,
+ * for example, L, and a native library called L is statically linked
+ * with the VM, then the JNI_OnLoad_L function exported by the library
+ * is invoked rather than attempting to load a dynamic library.
+ * A filename matching the argument does not have to exist in the file
+ * system. See the JNI Specification for more details.
+ *
+ * Otherwise, the filename argument is mapped to a native library image in
+ * an implementation-dependent manner.
* <p>
* First, if there is a security manager, its <code>checkLink</code>
* method is called with the <code>filename</code> as its argument.
@@ -859,7 +868,10 @@
* @exception SecurityException if a security manager exists and its
* <code>checkLink</code> method doesn't allow
* loading of the specified dynamic library
- * @exception UnsatisfiedLinkError if the file does not exist.
+ * @exception UnsatisfiedLinkError if either the filename is not an
+ * absolute path name, the native library is not statically
+ * linked with the VM, or the library cannot be mapped to
+ * a native library image by the host system.
* @exception NullPointerException if <code>filename</code> is
* <code>null</code>
* @see java.lang.Runtime#getRuntime()
@@ -884,7 +896,7 @@
}
}
- synchronized void load0(Class fromClass, String filename) {
+ synchronized void load0(Class<?> fromClass, String filename) {
if (!(new File(filename).isAbsolute())) {
throw new UnsatisfiedLinkError(
"Expecting an absolute path of the library: " + filename);
@@ -899,12 +911,16 @@
}
/**
- * Loads the dynamic library with the specified library name.
- * A file containing native code is loaded from the local file system
- * from a place where library files are conventionally obtained. The
- * details of this process are implementation-dependent. The
- * mapping from a library name to a specific filename is done in a
- * system-specific manner.
+ * Loads the native library specified by the <code>libname</code>
+ * argument. The <code>libname</code> argument must not contain any platform
+ * specific prefix, file extension or path. If a native library
+ * called <code>libname</code> is statically linked with the VM, then the
+ * JNI_OnLoad_<code>libname</code> function exported by the library is invoked.
+ * See the JNI Specification for more details.
+ *
+ * Otherwise, the libname argument is loaded from a system library
+ * location and mapped to a native library image in an implementation-
+ * dependent manner.
* <p>
* First, if there is a security manager, its <code>checkLink</code>
* method is called with the <code>libname</code> as its argument.
@@ -929,7 +945,10 @@
* @exception SecurityException if a security manager exists and its
* <code>checkLink</code> method doesn't allow
* loading of the specified dynamic library
- * @exception UnsatisfiedLinkError if the library does not exist.
+ * @exception UnsatisfiedLinkError if either the libname argument
+ * contains a file path, the native library is not statically
+ * linked with the VM, or the library cannot be mapped to a
+ * native library image by the host system.
* @exception NullPointerException if <code>libname</code> is
* <code>null</code>
* @see java.lang.SecurityException
diff --git a/ojluni/src/main/java/java/lang/RuntimeException.java b/ojluni/src/main/java/java/lang/RuntimeException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/RuntimePermission.java b/ojluni/src/main/java/java/lang/RuntimePermission.java
old mode 100755
new mode 100644
index aed1297..19dff55
--- a/ojluni/src/main/java/java/lang/RuntimePermission.java
+++ b/ojluni/src/main/java/java/lang/RuntimePermission.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2013, 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
@@ -33,13 +33,15 @@
public final class RuntimePermission extends BasicPermission {
+ private static final long serialVersionUID = 7399184964622342223L;
+
public RuntimePermission(String name)
{
- super("");
+ super(name);
}
public RuntimePermission(String name, String actions)
{
- super("", "");
+ super(name, actions);
}
}
diff --git a/ojluni/src/main/java/java/lang/SafeVarargs.java b/ojluni/src/main/java/java/lang/SafeVarargs.java
old mode 100755
new mode 100644
index 818ea21..6fcd48e
--- a/ojluni/src/main/java/java/lang/SafeVarargs.java
+++ b/ojluni/src/main/java/java/lang/SafeVarargs.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2013, 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
@@ -82,8 +82,10 @@
*
* </ul>
*
+ * @since 1.7
* @jls 4.7 Reifiable Types
* @jls 8.4.1 Formal Parameters
+ * @jls 9.6.3.7 @SafeVarargs
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
diff --git a/ojluni/src/main/java/java/lang/SecurityException.java b/ojluni/src/main/java/java/lang/SecurityException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/SecurityManager.java b/ojluni/src/main/java/java/lang/SecurityManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Short.java b/ojluni/src/main/java/java/lang/Short.java
old mode 100755
new mode 100644
index 61ad03c..0031711
--- a/ojluni/src/main/java/java/lang/Short.java
+++ b/ojluni/src/main/java/java/lang/Short.java
@@ -59,6 +59,7 @@
* The {@code Class} instance representing the primitive type
* {@code short}.
*/
+ @SuppressWarnings("unchecked")
public static final Class<Short> TYPE = (Class<Short>) short[].class.getComponentType();
/**
@@ -80,8 +81,8 @@
* determined by whether {@link java.lang.Character#digit(char,
* int)} returns a nonnegative value) except that the first
* character may be an ASCII minus sign {@code '-'}
- * (<code>'\u002D'</code>) to indicate a negative value or an
- * ASCII plus sign {@code '+'} (<code>'\u002B'</code>) to
+ * ({@code '\u005Cu002D'}) to indicate a negative value or an
+ * ASCII plus sign {@code '+'} ({@code '\u005Cu002B'}) to
* indicate a positive value. The resulting {@code short} value
* is returned.
*
@@ -97,8 +98,8 @@
*
* <li> Any character of the string is not a digit of the
* specified radix, except that the first character may be a minus
- * sign {@code '-'} (<code>'\u002D'</code>) or plus sign
- * {@code '+'} (<code>'\u002B'</code>) provided that the
+ * sign {@code '-'} ({@code '\u005Cu002D'}) or plus sign
+ * {@code '+'} ({@code '\u005Cu002B'}) provided that the
* string is longer than length 1.
*
* <li> The value represented by the string is not a value of type
@@ -126,9 +127,9 @@
* Parses the string argument as a signed decimal {@code
* short}. The characters in the string must all be decimal
* digits, except that the first character may be an ASCII minus
- * sign {@code '-'} (<code>'\u002D'</code>) to indicate a
+ * sign {@code '-'} ({@code '\u005Cu002D'}) to indicate a
* negative value or an ASCII plus sign {@code '+'}
- * (<code>'\u002B'</code>) to indicate a positive value. The
+ * ({@code '\u005Cu002B'}) to indicate a positive value. The
* resulting {@code short} value is returned, exactly as if the
* argument and the radix 10 were given as arguments to the {@link
* #parseShort(java.lang.String, int)} method.
@@ -249,7 +250,7 @@
* <dd><i>Sign<sub>opt</sub></i> {@code 0X} <i>HexDigits</i>
* <dd><i>Sign<sub>opt</sub></i> {@code #} <i>HexDigits</i>
* <dd><i>Sign<sub>opt</sub></i> {@code 0} <i>OctalDigits</i>
- * <p>
+ *
* <dt><i>Sign:</i>
* <dd>{@code -}
* <dd>{@code +}
@@ -322,8 +323,9 @@
}
/**
- * Returns the value of this {@code Short} as a
- * {@code byte}.
+ * Returns the value of this {@code Short} as a {@code byte} after
+ * a narrowing primitive conversion.
+ * @jls 5.1.3 Narrowing Primitive Conversions
*/
public byte byteValue() {
return (byte)value;
@@ -338,32 +340,36 @@
}
/**
- * Returns the value of this {@code Short} as an
- * {@code int}.
+ * Returns the value of this {@code Short} as an {@code int} after
+ * a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public int intValue() {
return (int)value;
}
/**
- * Returns the value of this {@code Short} as a
- * {@code long}.
+ * Returns the value of this {@code Short} as a {@code long} after
+ * a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public long longValue() {
return (long)value;
}
/**
- * Returns the value of this {@code Short} as a
- * {@code float}.
+ * Returns the value of this {@code Short} as a {@code float}
+ * after a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public float floatValue() {
return (float)value;
}
/**
- * Returns the value of this {@code Short} as a
- * {@code double}.
+ * Returns the value of this {@code Short} as a {@code double}
+ * after a widening primitive conversion.
+ * @jls 5.1.2 Widening Primitive Conversions
*/
public double doubleValue() {
return (double)value;
@@ -389,6 +395,7 @@
*
* @return a hash code value for this {@code Short}
*/
+ @Override
public int hashCode() {
return Short.hashCode(value);
}
@@ -476,6 +483,7 @@
* Returns the value obtained by reversing the order of the bytes in the
* two's complement representation of the specified {@code short} value.
*
+ * @param i the value whose bytes are to be reversed
* @return the value obtained by reversing (or, equivalently, swapping)
* the bytes in the specified {@code short} value.
* @since 1.5
diff --git a/ojluni/src/main/java/java/lang/StackOverflowError.java b/ojluni/src/main/java/java/lang/StackOverflowError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/StackTraceElement.java b/ojluni/src/main/java/java/lang/StackTraceElement.java
old mode 100755
new mode 100644
index b973d0f..58738d8
--- a/ojluni/src/main/java/java/lang/StackTraceElement.java
+++ b/ojluni/src/main/java/java/lang/StackTraceElement.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -181,12 +181,12 @@
* {@code StackTraceElement} instance representing the same execution
* point as this instance. Two stack trace elements {@code a} and
* {@code b} are equal if and only if:
- * <pre>
+ * <pre>{@code
* equals(a.getFileName(), b.getFileName()) &&
* a.getLineNumber() == b.getLineNumber()) &&
* equals(a.getClassName(), b.getClassName()) &&
* equals(a.getMethodName(), b.getMethodName())
- * </pre>
+ * }</pre>
* where {@code equals} has the semantics of {@link
* java.util.Objects#equals(Object, Object) Objects.equals}.
*
diff --git a/ojluni/src/main/java/java/lang/StrictMath.java b/ojluni/src/main/java/java/lang/StrictMath.java
old mode 100755
new mode 100644
index 3023fc0..ae4af2b
--- a/ojluni/src/main/java/java/lang/StrictMath.java
+++ b/ojluni/src/main/java/java/lang/StrictMath.java
@@ -25,7 +25,6 @@
package java.lang;
import java.util.Random;
-import sun.misc.FpUtils;
import sun.misc.DoubleConsts;
/**
@@ -57,6 +56,22 @@
* {@code sinh}, {@code cosh}, {@code tanh},
* {@code hypot}, {@code expm1}, and {@code log1p}.
*
+ * <p>
+ * The platform uses signed two's complement integer arithmetic with
+ * int and long primitive types. The developer should choose
+ * the primitive type to ensure that arithmetic operations consistently
+ * produce correct results, which in some cases means the operations
+ * will not overflow the range of values of the computation.
+ * The best practice is to choose the primitive type and algorithm to avoid
+ * overflow. In cases where the size is {@code int} or {@code long} and
+ * overflow errors need to be detected, the methods {@code addExact},
+ * {@code subtractExact}, {@code multiplyExact}, and {@code toIntExact}
+ * throw an {@code ArithmeticException} when the results overflow.
+ * For other arithmetic operations such as divide, absolute value,
+ * increment, decrement, and negation overflow occurs only with
+ * a specific minimum or maximum value and should be checked against
+ * the minimum or maximum as appropriate.
+ *
* @author unascribed
* @author Joseph D. Darcy
* @since 1.3
@@ -162,6 +177,8 @@
* in radians.
*/
public static strictfp double toRadians(double angdeg) {
+ // Do not delegate to Math.toRadians(angdeg) because
+ // this method has the strictfp modifier.
return angdeg / 180.0 * PI;
}
@@ -177,6 +194,8 @@
* in degrees.
*/
public static strictfp double toDegrees(double angrad) {
+ // Do not delegate to Math.toDegrees(angrad) because
+ // this method has the strictfp modifier.
return angrad * 180.0 / PI;
}
@@ -428,7 +447,7 @@
* 1.0, which is exact too.
*/
double twoToThe52 = (double)(1L << 52); // 2^52
- double sign = FpUtils.rawCopySign(1.0, a); // preserve sign info
+ double sign = Math.copySign(1.0, a); // preserve sign info
a = Math.abs(a);
if (a < twoToThe52) { // E_min <= ilogb(a) <= 51
@@ -659,11 +678,8 @@
return Math.round(a);
}
- private static Random randomNumberGenerator;
-
- private static synchronized Random initRNG() {
- Random rnd = randomNumberGenerator;
- return (rnd == null) ? (randomNumberGenerator = new Random()) : rnd;
+ private static final class RandomNumberGeneratorHolder {
+ static final Random randomNumberGenerator = new Random();
}
/**
@@ -683,16 +699,14 @@
* <p>This method is properly synchronized to allow correct use by
* more than one thread. However, if many threads need to generate
* pseudorandom numbers at a great rate, it may reduce contention
- * for each thread to have its own pseudorandom number generator.
+ * for each thread to have its own pseudorandom-number generator.
*
* @return a pseudorandom {@code double} greater than or equal
* to {@code 0.0} and less than {@code 1.0}.
* @see Random#nextDouble()
*/
public static double random() {
- Random rnd = randomNumberGenerator;
- if (rnd == null) rnd = initRNG();
- return rnd.nextDouble();
+ return RandomNumberGeneratorHolder.randomNumberGenerator.nextDouble();
}
/**
@@ -901,7 +915,7 @@
}
/**
- * Returns the absolute value of an {@code int} value..
+ * Returns the absolute value of an {@code int} value.
* If the argument is not negative, the argument is returned.
* If the argument is negative, the negation of the argument is returned.
*
@@ -914,7 +928,7 @@
* @return the absolute value of the argument.
*/
public static int abs(int a) {
- return (a < 0) ? -a : a;
+ return Math.abs(a);
}
/**
@@ -931,7 +945,7 @@
* @return the absolute value of the argument.
*/
public static long abs(long a) {
- return (a < 0) ? -a : a;
+ return Math.abs(a);
}
/**
@@ -950,7 +964,7 @@
* @return the absolute value of the argument.
*/
public static float abs(float a) {
- return (a <= 0.0F) ? 0.0F - a : a;
+ return Math.abs(a);
}
/**
@@ -969,7 +983,7 @@
* @return the absolute value of the argument.
*/
public static double abs(double a) {
- return (a <= 0.0D) ? 0.0D - a : a;
+ return Math.abs(a);
}
/**
@@ -983,7 +997,7 @@
* @return the larger of {@code a} and {@code b}.
*/
public static int max(int a, int b) {
- return (a >= b) ? a : b;
+ return Math.max(a, b);
}
/**
@@ -997,13 +1011,9 @@
* @return the larger of {@code a} and {@code b}.
*/
public static long max(long a, long b) {
- return (a >= b) ? a : b;
+ return Math.max(a, b);
}
- // Use raw bit-wise conversions on guaranteed non-NaN arguments.
- private static long negativeZeroFloatBits = Float.floatToRawIntBits(-0.0f);
- private static long negativeZeroDoubleBits = Double.doubleToRawLongBits(-0.0d);
-
/**
* Returns the greater of two {@code float} values. That is,
* the result is the argument closer to positive infinity. If the
@@ -1019,15 +1029,7 @@
* @return the larger of {@code a} and {@code b}.
*/
public static float max(float a, float b) {
- if (a != a)
- return a; // a is NaN
- if ((a == 0.0f) &&
- (b == 0.0f) &&
- (Float.floatToRawIntBits(a) == negativeZeroFloatBits)) {
- // Raw conversion ok since NaN can't map to -0.0.
- return b;
- }
- return (a >= b) ? a : b;
+ return Math.max(a, b);
}
/**
@@ -1045,15 +1047,7 @@
* @return the larger of {@code a} and {@code b}.
*/
public static double max(double a, double b) {
- if (a != a)
- return a; // a is NaN
- if ((a == 0.0d) &&
- (b == 0.0d) &&
- (Double.doubleToRawLongBits(a) == negativeZeroDoubleBits)) {
- // Raw conversion ok since NaN can't map to -0.0.
- return b;
- }
- return (a >= b) ? a : b;
+ return Math.max(a, b);
}
/**
@@ -1067,7 +1061,7 @@
* @return the smaller of {@code a} and {@code b}.
*/
public static int min(int a, int b) {
- return (a <= b) ? a : b;
+ return Math.min(a, b);
}
/**
@@ -1081,7 +1075,7 @@
* @return the smaller of {@code a} and {@code b}.
*/
public static long min(long a, long b) {
- return (a <= b) ? a : b;
+ return Math.min(a, b);
}
/**
@@ -1099,15 +1093,7 @@
* @return the smaller of {@code a} and {@code b.}
*/
public static float min(float a, float b) {
- if (a != a)
- return a; // a is NaN
- if ((a == 0.0f) &&
- (b == 0.0f) &&
- (Float.floatToRawIntBits(b) == negativeZeroFloatBits)) {
- // Raw conversion ok since NaN can't map to -0.0.
- return b;
- }
- return (a <= b) ? a : b;
+ return Math.min(a, b);
}
/**
@@ -1125,23 +1111,15 @@
* @return the smaller of {@code a} and {@code b}.
*/
public static double min(double a, double b) {
- if (a != a)
- return a; // a is NaN
- if ((a == 0.0d) &&
- (b == 0.0d) &&
- (Double.doubleToRawLongBits(b) == negativeZeroDoubleBits)) {
- // Raw conversion ok since NaN can't map to -0.0.
- return b;
- }
- return (a <= b) ? a : b;
+ return Math.min(a, b);
}
/**
- * Returns the size of an ulp of the argument. An ulp of a
- * {@code double} value is the positive distance between this
- * floating-point value and the {@code double} value next
- * larger in magnitude. Note that for non-NaN <i>x</i>,
- * <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
+ * Returns the size of an ulp of the argument. An ulp, unit in
+ * the last place, of a {@code double} value is the positive
+ * distance between this floating-point value and the {@code
+ * double} value next larger in magnitude. Note that for non-NaN
+ * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
@@ -1160,15 +1138,15 @@
* @since 1.5
*/
public static double ulp(double d) {
- return sun.misc.FpUtils.ulp(d);
+ return Math.ulp(d);
}
/**
- * Returns the size of an ulp of the argument. An ulp of a
- * {@code float} value is the positive distance between this
- * floating-point value and the {@code float} value next
- * larger in magnitude. Note that for non-NaN <i>x</i>,
- * <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
+ * Returns the size of an ulp of the argument. An ulp, unit in
+ * the last place, of a {@code float} value is the positive
+ * distance between this floating-point value and the {@code
+ * float} value next larger in magnitude. Note that for non-NaN
+ * <i>x</i>, <code>ulp(-<i>x</i>) == ulp(<i>x</i>)</code>.
*
* <p>Special Cases:
* <ul>
@@ -1187,7 +1165,7 @@
* @since 1.5
*/
public static float ulp(float f) {
- return sun.misc.FpUtils.ulp(f);
+ return Math.ulp(f);
}
/**
@@ -1208,7 +1186,7 @@
* @since 1.5
*/
public static double signum(double d) {
- return sun.misc.FpUtils.signum(d);
+ return Math.signum(d);
}
/**
@@ -1229,7 +1207,7 @@
* @since 1.5
*/
public static float signum(float f) {
- return sun.misc.FpUtils.signum(f);
+ return Math.signum(f);
}
/**
@@ -1407,7 +1385,7 @@
* @since 1.6
*/
public static double copySign(double magnitude, double sign) {
- return sun.misc.FpUtils.copySign(magnitude, sign);
+ return Math.copySign(magnitude, (Double.isNaN(sign)?1.0d:sign));
}
/**
@@ -1423,7 +1401,7 @@
* @since 1.6
*/
public static float copySign(float magnitude, float sign) {
- return sun.misc.FpUtils.copySign(magnitude, sign);
+ return Math.copySign(magnitude, (Float.isNaN(sign)?1.0f:sign));
}
/**
* Returns the unbiased exponent used in the representation of a
@@ -1436,10 +1414,11 @@
* {@link Float#MIN_EXPONENT} -1.
* </ul>
* @param f a {@code float} value
+ * @return the unbiased exponent of the argument
* @since 1.6
*/
public static int getExponent(float f) {
- return sun.misc.FpUtils.getExponent(f);
+ return Math.getExponent(f);
}
/**
@@ -1453,10 +1432,11 @@
* {@link Double#MIN_EXPONENT} -1.
* </ul>
* @param d a {@code double} value
+ * @return the unbiased exponent of the argument
* @since 1.6
*/
public static int getExponent(double d) {
- return sun.misc.FpUtils.getExponent(d);
+ return Math.getExponent(d);
}
/**
@@ -1499,7 +1479,7 @@
* @since 1.6
*/
public static double nextAfter(double start, double direction) {
- return sun.misc.FpUtils.nextAfter(start, direction);
+ return Math.nextAfter(start, direction);
}
/**
@@ -1541,7 +1521,7 @@
* @since 1.6
*/
public static float nextAfter(float start, double direction) {
- return sun.misc.FpUtils.nextAfter(start, direction);
+ return Math.nextAfter(start, direction);
}
/**
@@ -1570,7 +1550,7 @@
* @since 1.6
*/
public static double nextUp(double d) {
- return sun.misc.FpUtils.nextUp(d);
+ return Math.nextUp(d);
}
/**
@@ -1599,7 +1579,7 @@
* @since 1.6
*/
public static float nextUp(float f) {
- return sun.misc.FpUtils.nextUp(f);
+ return Math.nextUp(f);
}
/**
@@ -1661,7 +1641,7 @@
}
/**
- * Return {@code d} ×
+ * Returns {@code d} ×
* 2<sup>{@code scaleFactor}</sup> rounded as if performed
* by a single correctly rounded floating-point multiply to a
* member of the double value set. See the Java
@@ -1691,11 +1671,11 @@
* @since 1.6
*/
public static double scalb(double d, int scaleFactor) {
- return sun.misc.FpUtils.scalb(d, scaleFactor);
+ return Math.scalb(d, scaleFactor);
}
/**
- * Return {@code f} ×
+ * Returns {@code f} ×
* 2<sup>{@code scaleFactor}</sup> rounded as if performed
* by a single correctly rounded floating-point multiply to a
* member of the float value set. See the Java
@@ -1725,6 +1705,6 @@
* @since 1.6
*/
public static float scalb(float f, int scaleFactor) {
- return sun.misc.FpUtils.scalb(f, scaleFactor);
+ return Math.scalb(f, scaleFactor);
}
}
diff --git a/ojluni/src/main/java/java/lang/String.java b/ojluni/src/main/java/java/lang/String.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/StringCoding.java b/ojluni/src/main/java/java/lang/StringCoding.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/StringIndexOutOfBoundsException.java b/ojluni/src/main/java/java/lang/StringIndexOutOfBoundsException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/SuppressWarnings.java b/ojluni/src/main/java/java/lang/SuppressWarnings.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/System.java b/ojluni/src/main/java/java/lang/System.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Thread.java b/ojluni/src/main/java/java/lang/Thread.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ThreadDeath.java b/ojluni/src/main/java/java/lang/ThreadDeath.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ThreadGroup.java b/ojluni/src/main/java/java/lang/ThreadGroup.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ThreadLocal.java b/ojluni/src/main/java/java/lang/ThreadLocal.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Throwable.java b/ojluni/src/main/java/java/lang/Throwable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/TypeNotPresentException.java b/ojluni/src/main/java/java/lang/TypeNotPresentException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/UnknownError.java b/ojluni/src/main/java/java/lang/UnknownError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/UnsatisfiedLinkError.java b/ojluni/src/main/java/java/lang/UnsatisfiedLinkError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/UnsupportedClassVersionError.java b/ojluni/src/main/java/java/lang/UnsupportedClassVersionError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/UnsupportedOperationException.java b/ojluni/src/main/java/java/lang/UnsupportedOperationException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/VerifyError.java b/ojluni/src/main/java/java/lang/VerifyError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/VirtualMachineError.java b/ojluni/src/main/java/java/lang/VirtualMachineError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/Void.java b/ojluni/src/main/java/java/lang/Void.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/annotation/AnnotationFormatError.java b/ojluni/src/main/java/java/lang/annotation/AnnotationFormatError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java b/ojluni/src/main/java/java/lang/annotation/AnnotationTypeMismatchException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/annotation/Documented.java b/ojluni/src/main/java/java/lang/annotation/Documented.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/annotation/ElementType.java b/ojluni/src/main/java/java/lang/annotation/ElementType.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/annotation/RetentionPolicy.java b/ojluni/src/main/java/java/lang/annotation/RetentionPolicy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ref/PhantomReference.java b/ojluni/src/main/java/java/lang/ref/PhantomReference.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ref/Reference.java b/ojluni/src/main/java/java/lang/ref/Reference.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ref/ReferenceQueue.java b/ojluni/src/main/java/java/lang/ref/ReferenceQueue.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ref/SoftReference.java b/ojluni/src/main/java/java/lang/ref/SoftReference.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/ref/WeakReference.java b/ojluni/src/main/java/java/lang/ref/WeakReference.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/AccessibleObject.java b/ojluni/src/main/java/java/lang/reflect/AccessibleObject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/AnnotatedElement.java b/ojluni/src/main/java/java/lang/reflect/AnnotatedElement.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Array.java b/ojluni/src/main/java/java/lang/reflect/Array.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Constructor.java b/ojluni/src/main/java/java/lang/reflect/Constructor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Field.java b/ojluni/src/main/java/java/lang/reflect/Field.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/GenericArrayType.java b/ojluni/src/main/java/java/lang/reflect/GenericArrayType.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/GenericDeclaration.java b/ojluni/src/main/java/java/lang/reflect/GenericDeclaration.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java b/ojluni/src/main/java/java/lang/reflect/GenericSignatureFormatError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/InvocationHandler.java b/ojluni/src/main/java/java/lang/reflect/InvocationHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/InvocationTargetException.java b/ojluni/src/main/java/java/lang/reflect/InvocationTargetException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java b/ojluni/src/main/java/java/lang/reflect/MalformedParameterizedTypeException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Member.java b/ojluni/src/main/java/java/lang/reflect/Member.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Method.java b/ojluni/src/main/java/java/lang/reflect/Method.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Modifier.java b/ojluni/src/main/java/java/lang/reflect/Modifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/ParameterizedType.java b/ojluni/src/main/java/java/lang/reflect/ParameterizedType.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Proxy.java b/ojluni/src/main/java/java/lang/reflect/Proxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/ReflectPermission.java b/ojluni/src/main/java/java/lang/reflect/ReflectPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/Type.java b/ojluni/src/main/java/java/lang/reflect/Type.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/TypeVariable.java b/ojluni/src/main/java/java/lang/reflect/TypeVariable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/UndeclaredThrowableException.java b/ojluni/src/main/java/java/lang/reflect/UndeclaredThrowableException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/lang/reflect/WildcardType.java b/ojluni/src/main/java/java/lang/reflect/WildcardType.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java b/ojluni/src/main/java/java/net/AbstractPlainDatagramSocketImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java b/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java
old mode 100755
new mode 100644
index 330e014..1cb26d6
--- a/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java
+++ b/ojluni/src/main/java/java/net/AbstractPlainSocketImpl.java
@@ -55,6 +55,7 @@
private boolean shut_wr = false;
private SocketInputStream socketInputStream = null;
+ private SocketOutputStream socketOutputStream = null;
/* lock when accessing fd */
protected final Object fdLock = new Object();
@@ -393,14 +394,13 @@
* Gets an InputStream for this socket.
*/
protected synchronized InputStream getInputStream() throws IOException {
- if (isClosedOrPending()) {
- throw new IOException("Socket Closed");
- }
- if (shut_rd) {
- throw new IOException("Socket input is shutdown");
- }
- if (socketInputStream == null) {
- socketInputStream = new SocketInputStream(this);
+ synchronized (fdLock) {
+ if (isClosedOrPending())
+ throw new IOException("Socket Closed");
+ if (shut_rd)
+ throw new IOException("Socket input is shutdown");
+ if (socketInputStream == null)
+ socketInputStream = new SocketInputStream(this);
}
return socketInputStream;
}
@@ -413,13 +413,15 @@
* Gets an OutputStream for this socket.
*/
protected synchronized OutputStream getOutputStream() throws IOException {
- if (isClosedOrPending()) {
- throw new IOException("Socket Closed");
+ synchronized (fdLock) {
+ if (isClosedOrPending())
+ throw new IOException("Socket Closed");
+ if (shut_wr)
+ throw new IOException("Socket output is shutdown");
+ if (socketOutputStream == null)
+ socketOutputStream = new SocketOutputStream(this);
}
- if (shut_wr) {
- throw new IOException("Socket output is shutdown");
- }
- return new SocketOutputStream(this);
+ return socketOutputStream;
}
void setFileDescriptor(FileDescriptor fd) {
diff --git a/ojluni/src/main/java/java/net/Authenticator.java b/ojluni/src/main/java/java/net/Authenticator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/BindException.java b/ojluni/src/main/java/java/net/BindException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/CacheRequest.java b/ojluni/src/main/java/java/net/CacheRequest.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/CacheResponse.java b/ojluni/src/main/java/java/net/CacheResponse.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ConnectException.java b/ojluni/src/main/java/java/net/ConnectException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ContentHandler.java b/ojluni/src/main/java/java/net/ContentHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ContentHandlerFactory.java b/ojluni/src/main/java/java/net/ContentHandlerFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/CookieHandler.java b/ojluni/src/main/java/java/net/CookieHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/CookieManager.java b/ojluni/src/main/java/java/net/CookieManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/CookiePolicy.java b/ojluni/src/main/java/java/net/CookiePolicy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/CookieStore.java b/ojluni/src/main/java/java/net/CookieStore.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/DatagramPacket.java b/ojluni/src/main/java/java/net/DatagramPacket.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/DatagramSocket.java b/ojluni/src/main/java/java/net/DatagramSocket.java
old mode 100755
new mode 100644
index 6925816..7577e63
--- a/ojluni/src/main/java/java/net/DatagramSocket.java
+++ b/ojluni/src/main/java/java/net/DatagramSocket.java
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2013, 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
@@ -28,7 +28,6 @@
import java.io.FileDescriptor;
import java.io.IOException;
-import java.io.InterruptedIOException;
import java.nio.channels.DatagramChannel;
import java.security.AccessController;
import java.security.PrivilegedExceptionAction;
@@ -802,6 +801,7 @@
} // end of while
}
}
+ DatagramPacket tmp = null;
if ((connectState == ST_CONNECTED_NO_IMPL) || explicitFilter) {
// We have to do the filtering the old fashioned way since
// the native impl doesn't support connect or the connect
@@ -826,11 +826,13 @@
if ((!connectedAddress.equals(peekAddress)) ||
(connectedPort != peekPort)) {
// throw the packet away and silently continue
- DatagramPacket tmp = new DatagramPacket(
+ tmp = new DatagramPacket(
new byte[1024], 1024);
getImpl().receive(tmp);
if (explicitFilter) {
- bytesLeftToFilter -= tmp.getLength();
+ if (checkFiltering(tmp)) {
+ stop = true;
+ }
}
} else {
stop = true;
@@ -840,18 +842,22 @@
// If the security check succeeds, or the datagram is
// connected then receive the packet
getImpl().receive(p);
- if (explicitFilter) {
- bytesLeftToFilter -= p.getLength();
- if (bytesLeftToFilter <= 0) {
- explicitFilter = false;
- } else {
- // break out of filter, if there is no more data queued
- explicitFilter = getImpl().dataAvailable() > 0;
- }
+ if (explicitFilter && tmp == null) {
+ // packet was not filtered, account for it here
+ checkFiltering(p);
}
}
}
+ private boolean checkFiltering(DatagramPacket p) throws SocketException {
+ bytesLeftToFilter -= p.getLength();
+ if (bytesLeftToFilter <= 0 || getImpl().dataAvailable() <= 0) {
+ explicitFilter = false;
+ return true;
+ }
+ return false;
+ }
+
/**
* Gets the local address to which the socket is bound.
*
diff --git a/ojluni/src/main/java/java/net/DatagramSocketImpl.java b/ojluni/src/main/java/java/net/DatagramSocketImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/DatagramSocketImplFactory.java b/ojluni/src/main/java/java/net/DatagramSocketImplFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/DefaultDatagramSocketImplFactory.java b/ojluni/src/main/java/java/net/DefaultDatagramSocketImplFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/DefaultInterface.java b/ojluni/src/main/java/java/net/DefaultInterface.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/FileNameMap.java b/ojluni/src/main/java/java/net/FileNameMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/HttpCookie.java b/ojluni/src/main/java/java/net/HttpCookie.java
old mode 100755
new mode 100644
index 3c80f29..295c926
--- a/ojluni/src/main/java/java/net/HttpCookie.java
+++ b/ojluni/src/main/java/java/net/HttpCookie.java
@@ -693,10 +693,14 @@
&& (embeddedDotInDomain == -1 || embeddedDotInDomain == domain.length() - 1))
return false;
- // if the host name contains no dot and the domain name is .local
+ // if the host name contains no dot and the domain name
+ // is .local or host.local
int firstDotInHost = host.indexOf('.');
- if (firstDotInHost == -1 && isLocalDomain)
+ if (firstDotInHost == -1 &&
+ (isLocalDomain ||
+ domain.equalsIgnoreCase(host + ".local"))) {
return true;
+ }
int domainLength = domain.length();
int lengthDiff = host.length() - domainLength;
diff --git a/ojluni/src/main/java/java/net/HttpRetryException.java b/ojluni/src/main/java/java/net/HttpRetryException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/HttpURLConnection.java b/ojluni/src/main/java/java/net/HttpURLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/IDN.java b/ojluni/src/main/java/java/net/IDN.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/InMemoryCookieStore.java b/ojluni/src/main/java/java/net/InMemoryCookieStore.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/Inet4Address.java b/ojluni/src/main/java/java/net/Inet4Address.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/Inet6Address.java b/ojluni/src/main/java/java/net/Inet6Address.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/Inet6AddressImpl.java b/ojluni/src/main/java/java/net/Inet6AddressImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/InetAddress.java b/ojluni/src/main/java/java/net/InetAddress.java
old mode 100755
new mode 100644
index d837e98..edfdb00
--- a/ojluni/src/main/java/java/net/InetAddress.java
+++ b/ojluni/src/main/java/java/net/InetAddress.java
@@ -183,10 +183,26 @@
class InetAddress implements java.io.Serializable {
static class InetAddressHolder {
+ /**
+ * Reserve the original application specified hostname.
+ *
+ * The original hostname is useful for domain-based endpoint
+ * identification (see RFC 2818 and RFC 6125). If an address
+ * was created with a raw IP address, a reverse name lookup
+ * may introduce endpoint identification security issue via
+ * DNS forging.
+ *
+ * Oracle JSSE provider is using this original hostname, via
+ * sun.misc.JavaNetAccess, for SSL/TLS endpoint identification.
+ *
+ * Note: May define a new public method in the future if necessary.
+ */
+ private String originalHostName;
InetAddressHolder() {}
InetAddressHolder(String hostName, int address, int family) {
+ this.originalHostName = hostName;
this.hostName = hostName;
this.address = address;
this.family = family;
@@ -198,6 +214,10 @@
return hostName;
}
+ String getOriginalHostName() {
+ return originalHostName;
+ }
+
/**
* Holds a 32-bit IPv4 address.
*/
diff --git a/ojluni/src/main/java/java/net/InetAddressImpl.java b/ojluni/src/main/java/java/net/InetAddressImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/InetSocketAddress.java b/ojluni/src/main/java/java/net/InetSocketAddress.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/InterfaceAddress.java b/ojluni/src/main/java/java/net/InterfaceAddress.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/JarURLConnection.java b/ojluni/src/main/java/java/net/JarURLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/MalformedURLException.java b/ojluni/src/main/java/java/net/MalformedURLException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/MulticastSocket.java b/ojluni/src/main/java/java/net/MulticastSocket.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/NetPermission.java b/ojluni/src/main/java/java/net/NetPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/NetUtil.java b/ojluni/src/main/java/java/net/NetUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/NetworkInterface.java b/ojluni/src/main/java/java/net/NetworkInterface.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/NoRouteToHostException.java b/ojluni/src/main/java/java/net/NoRouteToHostException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/PasswordAuthentication.java b/ojluni/src/main/java/java/net/PasswordAuthentication.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/PlainDatagramSocketImpl.java b/ojluni/src/main/java/java/net/PlainDatagramSocketImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/PlainSocketImpl.java b/ojluni/src/main/java/java/net/PlainSocketImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/PortUnreachableException.java b/ojluni/src/main/java/java/net/PortUnreachableException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ProtocolException.java b/ojluni/src/main/java/java/net/ProtocolException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ProtocolFamily.java b/ojluni/src/main/java/java/net/ProtocolFamily.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/Proxy.java b/ojluni/src/main/java/java/net/Proxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ProxySelector.java b/ojluni/src/main/java/java/net/ProxySelector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ResponseCache.java b/ojluni/src/main/java/java/net/ResponseCache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SecureCacheResponse.java b/ojluni/src/main/java/java/net/SecureCacheResponse.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/ServerSocket.java b/ojluni/src/main/java/java/net/ServerSocket.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/Socket.java b/ojluni/src/main/java/java/net/Socket.java
old mode 100755
new mode 100644
index bdb2114..c3178ff
--- a/ojluni/src/main/java/java/net/Socket.java
+++ b/ojluni/src/main/java/java/net/Socket.java
@@ -434,6 +434,7 @@
connect(address);
} catch (IOException | IllegalArgumentException | SecurityException e) {
try {
+ // Android-changed:
// Do not call #close, classes that extend this class may do not expect a call
// to #close coming from the superclass constructor.
if (impl != null) {
diff --git a/ojluni/src/main/java/java/net/SocketAddress.java b/ojluni/src/main/java/java/net/SocketAddress.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocketException.java b/ojluni/src/main/java/java/net/SocketException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocketImpl.java b/ojluni/src/main/java/java/net/SocketImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocketImplFactory.java b/ojluni/src/main/java/java/net/SocketImplFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocketInputStream.java b/ojluni/src/main/java/java/net/SocketInputStream.java
old mode 100755
new mode 100644
index ea849a0..2982ab5
--- a/ojluni/src/main/java/java/net/SocketInputStream.java
+++ b/ojluni/src/main/java/java/net/SocketInputStream.java
@@ -32,7 +32,6 @@
import java.nio.channels.FileChannel;
import dalvik.system.BlockGuard;
-import sun.misc.IoTrace;
import sun.net.ConnectionResetException;
/**
@@ -95,6 +94,26 @@
int timeout)
throws IOException;
+ // wrap native call to allow instrumentation
+ /**
+ * Reads into an array of bytes at the specified offset using
+ * the received socket primitive.
+ * @param fd the FileDescriptor
+ * @param b the buffer into which the data is read
+ * @param off the start offset of the data
+ * @param len the maximum number of bytes read
+ * @param timeout the read timeout in ms
+ * @return the actual number of bytes read, -1 is
+ * returned when the end of the stream is reached.
+ * @exception IOException If an I/O error has occurred.
+ */
+ private int socketRead(FileDescriptor fd,
+ byte b[], int off, int len,
+ int timeout)
+ throws IOException {
+ return socketRead0(fd, b, off, len, timeout);
+ }
+
/**
* Reads into a byte array data from the socket.
* @param b the buffer into which the data is read
@@ -121,7 +140,7 @@
}
int read(byte b[], int off, int length, int timeout) throws IOException {
- int n = 0;
+ int n;
// EOF already encountered
if (eof) {
@@ -143,20 +162,16 @@
boolean gotReset = false;
- Object traceContext = IoTrace.socketReadBegin();
// acquire file descriptor and do the read
FileDescriptor fd = impl.acquireFD();
try {
BlockGuard.getThreadPolicy().onNetwork();
- n = socketRead0(fd, b, off, length, timeout);
+ n = socketRead(fd, b, off, length, timeout);
if (n > 0) {
return n;
}
} catch (ConnectionResetException rstExc) {
gotReset = true;
- } finally {
- IoTrace.socketReadEnd(traceContext, impl.address, impl.port,
- timeout, n > 0 ? n : 0);
}
/*
@@ -164,17 +179,13 @@
* buffered on the socket
*/
if (gotReset) {
- traceContext = IoTrace.socketReadBegin();
impl.setConnectionResetPending();
try {
- n = socketRead0(fd, b, off, length, timeout);
+ n = socketRead(fd, b, off, length, timeout);
if (n > 0) {
return n;
}
} catch (ConnectionResetException rstExc) {
- } finally {
- IoTrace.socketReadEnd(traceContext, impl.address, impl.port,
- timeout, n > 0 ? n : 0);
}
}
diff --git a/ojluni/src/main/java/java/net/SocketOption.java b/ojluni/src/main/java/java/net/SocketOption.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocketOptions.java b/ojluni/src/main/java/java/net/SocketOptions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocketOutputStream.java b/ojluni/src/main/java/java/net/SocketOutputStream.java
old mode 100755
new mode 100644
index fff612f..da0a0de
--- a/ojluni/src/main/java/java/net/SocketOutputStream.java
+++ b/ojluni/src/main/java/java/net/SocketOutputStream.java
@@ -32,7 +32,6 @@
import java.nio.channels.FileChannel;
import dalvik.system.BlockGuard;
-import sun.misc.IoTrace;
/**
* This stream extends FileOutputStream to implement a
@@ -104,13 +103,10 @@
throw new ArrayIndexOutOfBoundsException();
}
- Object traceContext = IoTrace.socketWriteBegin();
- int bytesWritten = 0;
FileDescriptor fd = impl.acquireFD();
try {
BlockGuard.getThreadPolicy().onNetwork();
socketWrite0(fd, b, off, len);
- bytesWritten = len;
} catch (SocketException se) {
if (se instanceof sun.net.ConnectionResetException) {
impl.setConnectionResetPending();
@@ -121,8 +117,6 @@
} else {
throw se;
}
- } finally {
- IoTrace.socketWriteEnd(traceContext, impl.address, impl.port, bytesWritten);
}
}
diff --git a/ojluni/src/main/java/java/net/SocketPermission.java b/ojluni/src/main/java/java/net/SocketPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocketTimeoutException.java b/ojluni/src/main/java/java/net/SocketTimeoutException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocksConsts.java b/ojluni/src/main/java/java/net/SocksConsts.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/SocksSocketImpl.java b/ojluni/src/main/java/java/net/SocksSocketImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/StandardProtocolFamily.java b/ojluni/src/main/java/java/net/StandardProtocolFamily.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/StandardSocketOptions.java b/ojluni/src/main/java/java/net/StandardSocketOptions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/URI.java b/ojluni/src/main/java/java/net/URI.java
old mode 100755
new mode 100644
index cfeb731..a74e237
--- a/ojluni/src/main/java/java/net/URI.java
+++ b/ojluni/src/main/java/java/net/URI.java
@@ -1682,6 +1682,13 @@
return c;
}
+ // US-ASCII only
+ private static int toUpper(char c) {
+ if ((c >= 'a') && (c <= 'z'))
+ return c - ('a' - 'A');
+ return c;
+ }
+
private static boolean equal(String s, String t) {
if (s == t) return true;
if ((s != null) && (t != null)) {
@@ -1732,7 +1739,26 @@
private static int hash(int hash, String s) {
if (s == null) return hash;
- return hash * 127 + s.hashCode();
+ return s.indexOf('%') < 0 ? hash * 127 + s.hashCode()
+ : normalizedHash(hash, s);
+ }
+
+
+ private static int normalizedHash(int hash, String s) {
+ int h = 0;
+ for (int index = 0; index < s.length(); index++) {
+ char ch = s.charAt(index);
+ h = 31 * h + ch;
+ if (ch == '%') {
+ /*
+ * Process the next two encoded characters
+ */
+ for (int i = index + 1; i < index + 3; i++)
+ h = 31 * h + toUpper(s.charAt(i));
+ index += 2;
+ }
+ }
+ return hash * 127 + h;
}
// US-ASCII only
diff --git a/ojluni/src/main/java/java/net/URISyntaxException.java b/ojluni/src/main/java/java/net/URISyntaxException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/URL.java b/ojluni/src/main/java/java/net/URL.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/URLClassLoader.java b/ojluni/src/main/java/java/net/URLClassLoader.java
old mode 100755
new mode 100644
index fa994ba..f8d1c35
--- a/ojluni/src/main/java/java/net/URLClassLoader.java
+++ b/ojluni/src/main/java/java/net/URLClassLoader.java
@@ -352,10 +352,11 @@
protected Class<?> findClass(final String name)
throws ClassNotFoundException
{
+ final Class<?> result;
try {
- return AccessController.doPrivileged(
- new PrivilegedExceptionAction<Class>() {
- public Class run() throws ClassNotFoundException {
+ result = AccessController.doPrivileged(
+ new PrivilegedExceptionAction<Class<?>>() {
+ public Class<?> run() throws ClassNotFoundException {
String path = name.replace('.', '/').concat(".class");
Resource res = ucp.getResource(path, false);
if (res != null) {
@@ -365,13 +366,17 @@
throw new ClassNotFoundException(name, e);
}
} else {
- throw new ClassNotFoundException(name);
+ return null;
}
}
}, acc);
} catch (java.security.PrivilegedActionException pae) {
throw (ClassNotFoundException) pae.getException();
}
+ if (result == null) {
+ throw new ClassNotFoundException(name);
+ }
+ return result;
}
/*
@@ -756,6 +761,10 @@
public URLClassPath getURLClassPath (URLClassLoader u) {
return u.ucp;
}
+
+ public String getOriginalHostName(InetAddress ia) {
+ return ia.holder.getOriginalHostName();
+ }
}
);*/
ClassLoader.registerAsParallelCapable();
diff --git a/ojluni/src/main/java/java/net/URLConnection.java b/ojluni/src/main/java/java/net/URLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/URLDecoder.java b/ojluni/src/main/java/java/net/URLDecoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/URLEncoder.java b/ojluni/src/main/java/java/net/URLEncoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/URLStreamHandler.java b/ojluni/src/main/java/java/net/URLStreamHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/URLStreamHandlerFactory.java b/ojluni/src/main/java/java/net/URLStreamHandlerFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/UnknownHostException.java b/ojluni/src/main/java/java/net/UnknownHostException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/net/UnknownServiceException.java b/ojluni/src/main/java/java/net/UnknownServiceException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/Bits.java b/ojluni/src/main/java/java/nio/Bits.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/Buffer.java b/ojluni/src/main/java/java/nio/Buffer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/ByteOrder.java b/ojluni/src/main/java/java/nio/ByteOrder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/MappedByteBuffer.java b/ojluni/src/main/java/java/nio/MappedByteBuffer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/StringCharBuffer.java b/ojluni/src/main/java/java/nio/StringCharBuffer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/AsynchronousByteChannel.java b/ojluni/src/main/java/java/nio/channels/AsynchronousByteChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/AsynchronousChannel.java b/ojluni/src/main/java/java/nio/channels/AsynchronousChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/AsynchronousChannelGroup.java b/ojluni/src/main/java/java/nio/channels/AsynchronousChannelGroup.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/AsynchronousServerSocketChannel.java b/ojluni/src/main/java/java/nio/channels/AsynchronousServerSocketChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/AsynchronousSocketChannel.java b/ojluni/src/main/java/java/nio/channels/AsynchronousSocketChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/ByteChannel.java b/ojluni/src/main/java/java/nio/channels/ByteChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/Channel.java b/ojluni/src/main/java/java/nio/channels/Channel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/Channels.java b/ojluni/src/main/java/java/nio/channels/Channels.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/CompletionHandler.java b/ojluni/src/main/java/java/nio/channels/CompletionHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/DatagramChannel.java b/ojluni/src/main/java/java/nio/channels/DatagramChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/FileChannel.java b/ojluni/src/main/java/java/nio/channels/FileChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/FileLock.java b/ojluni/src/main/java/java/nio/channels/FileLock.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/GatheringByteChannel.java b/ojluni/src/main/java/java/nio/channels/GatheringByteChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/InterruptibleChannel.java b/ojluni/src/main/java/java/nio/channels/InterruptibleChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/MembershipKey.java b/ojluni/src/main/java/java/nio/channels/MembershipKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/MulticastChannel.java b/ojluni/src/main/java/java/nio/channels/MulticastChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/NetworkChannel.java b/ojluni/src/main/java/java/nio/channels/NetworkChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/Pipe.java b/ojluni/src/main/java/java/nio/channels/Pipe.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/ReadableByteChannel.java b/ojluni/src/main/java/java/nio/channels/ReadableByteChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/ScatteringByteChannel.java b/ojluni/src/main/java/java/nio/channels/ScatteringByteChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/SeekableByteChannel.java b/ojluni/src/main/java/java/nio/channels/SeekableByteChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/SelectableChannel.java b/ojluni/src/main/java/java/nio/channels/SelectableChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/SelectionKey.java b/ojluni/src/main/java/java/nio/channels/SelectionKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/Selector.java b/ojluni/src/main/java/java/nio/channels/Selector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/ServerSocketChannel.java b/ojluni/src/main/java/java/nio/channels/ServerSocketChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/SocketChannel.java b/ojluni/src/main/java/java/nio/channels/SocketChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/WritableByteChannel.java b/ojluni/src/main/java/java/nio/channels/WritableByteChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/spi/AbstractInterruptibleChannel.java b/ojluni/src/main/java/java/nio/channels/spi/AbstractInterruptibleChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/spi/AbstractSelectableChannel.java b/ojluni/src/main/java/java/nio/channels/spi/AbstractSelectableChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/spi/AbstractSelectionKey.java b/ojluni/src/main/java/java/nio/channels/spi/AbstractSelectionKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/spi/AbstractSelector.java b/ojluni/src/main/java/java/nio/channels/spi/AbstractSelector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/spi/AsynchronousChannelProvider.java b/ojluni/src/main/java/java/nio/channels/spi/AsynchronousChannelProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/channels/spi/SelectorProvider.java b/ojluni/src/main/java/java/nio/channels/spi/SelectorProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/Charset.java b/ojluni/src/main/java/java/nio/charset/Charset.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/CoderMalfunctionError.java b/ojluni/src/main/java/java/nio/charset/CoderMalfunctionError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/CoderResult.java b/ojluni/src/main/java/java/nio/charset/CoderResult.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/CodingErrorAction.java b/ojluni/src/main/java/java/nio/charset/CodingErrorAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/MalformedInputException.java b/ojluni/src/main/java/java/nio/charset/MalformedInputException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/StandardCharsets.java b/ojluni/src/main/java/java/nio/charset/StandardCharsets.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/UnmappableCharacterException.java b/ojluni/src/main/java/java/nio/charset/UnmappableCharacterException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/nio/charset/spi/CharsetProvider.java b/ojluni/src/main/java/java/nio/charset/spi/CharsetProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AccessControlContext.java b/ojluni/src/main/java/java/security/AccessControlContext.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AccessControlException.java b/ojluni/src/main/java/java/security/AccessControlException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AccessController.java b/ojluni/src/main/java/java/security/AccessController.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AlgorithmConstraints.java b/ojluni/src/main/java/java/security/AlgorithmConstraints.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java b/ojluni/src/main/java/java/security/AlgorithmParameterGenerator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameterGeneratorSpi.java b/ojluni/src/main/java/java/security/AlgorithmParameterGeneratorSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AlgorithmParameters.java b/ojluni/src/main/java/java/security/AlgorithmParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AlgorithmParametersSpi.java b/ojluni/src/main/java/java/security/AlgorithmParametersSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AllPermission.java b/ojluni/src/main/java/java/security/AllPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/AuthProvider.java b/ojluni/src/main/java/java/security/AuthProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/BasicPermission.java b/ojluni/src/main/java/java/security/BasicPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Certificate.java b/ojluni/src/main/java/java/security/Certificate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/CodeSigner.java b/ojluni/src/main/java/java/security/CodeSigner.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/CodeSource.java b/ojluni/src/main/java/java/security/CodeSource.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/CryptoPrimitive.java b/ojluni/src/main/java/java/security/CryptoPrimitive.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/DigestException.java b/ojluni/src/main/java/java/security/DigestException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/DigestInputStream.java b/ojluni/src/main/java/java/security/DigestInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/DigestOutputStream.java b/ojluni/src/main/java/java/security/DigestOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/DomainCombiner.java b/ojluni/src/main/java/java/security/DomainCombiner.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/GeneralSecurityException.java b/ojluni/src/main/java/java/security/GeneralSecurityException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Guard.java b/ojluni/src/main/java/java/security/Guard.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/GuardedObject.java b/ojluni/src/main/java/java/security/GuardedObject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Identity.java b/ojluni/src/main/java/java/security/Identity.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/IdentityScope.java b/ojluni/src/main/java/java/security/IdentityScope.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java b/ojluni/src/main/java/java/security/InvalidAlgorithmParameterException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/InvalidKeyException.java b/ojluni/src/main/java/java/security/InvalidKeyException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/InvalidParameterException.java b/ojluni/src/main/java/java/security/InvalidParameterException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Key.java b/ojluni/src/main/java/java/security/Key.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyException.java b/ojluni/src/main/java/java/security/KeyException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyFactory.java b/ojluni/src/main/java/java/security/KeyFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyFactorySpi.java b/ojluni/src/main/java/java/security/KeyFactorySpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyManagementException.java b/ojluni/src/main/java/java/security/KeyManagementException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyPair.java b/ojluni/src/main/java/java/security/KeyPair.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyPairGenerator.java b/ojluni/src/main/java/java/security/KeyPairGenerator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyPairGeneratorSpi.java b/ojluni/src/main/java/java/security/KeyPairGeneratorSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyRep.java b/ojluni/src/main/java/java/security/KeyRep.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyStore.java b/ojluni/src/main/java/java/security/KeyStore.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyStoreException.java b/ojluni/src/main/java/java/security/KeyStoreException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/KeyStoreSpi.java b/ojluni/src/main/java/java/security/KeyStoreSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/MessageDigest.java b/ojluni/src/main/java/java/security/MessageDigest.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/MessageDigestSpi.java b/ojluni/src/main/java/java/security/MessageDigestSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/NoSuchAlgorithmException.java b/ojluni/src/main/java/java/security/NoSuchAlgorithmException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/NoSuchProviderException.java b/ojluni/src/main/java/java/security/NoSuchProviderException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Permission.java b/ojluni/src/main/java/java/security/Permission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/PermissionCollection.java b/ojluni/src/main/java/java/security/PermissionCollection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Permissions.java b/ojluni/src/main/java/java/security/Permissions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Policy.java b/ojluni/src/main/java/java/security/Policy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/PolicySpi.java b/ojluni/src/main/java/java/security/PolicySpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Principal.java b/ojluni/src/main/java/java/security/Principal.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/PrivateKey.java b/ojluni/src/main/java/java/security/PrivateKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/PrivilegedAction.java b/ojluni/src/main/java/java/security/PrivilegedAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/PrivilegedActionException.java b/ojluni/src/main/java/java/security/PrivilegedActionException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/PrivilegedExceptionAction.java b/ojluni/src/main/java/java/security/PrivilegedExceptionAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/ProtectionDomain.java b/ojluni/src/main/java/java/security/ProtectionDomain.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Provider.java b/ojluni/src/main/java/java/security/Provider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/ProviderException.java b/ojluni/src/main/java/java/security/ProviderException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/PublicKey.java b/ojluni/src/main/java/java/security/PublicKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/SecureClassLoader.java b/ojluni/src/main/java/java/security/SecureClassLoader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/SecureRandom.java b/ojluni/src/main/java/java/security/SecureRandom.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/SecureRandomSpi.java b/ojluni/src/main/java/java/security/SecureRandomSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Security.java b/ojluni/src/main/java/java/security/Security.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/SecurityPermission.java b/ojluni/src/main/java/java/security/SecurityPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Signature.java b/ojluni/src/main/java/java/security/Signature.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/SignatureException.java b/ojluni/src/main/java/java/security/SignatureException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/SignatureSpi.java b/ojluni/src/main/java/java/security/SignatureSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/SignedObject.java b/ojluni/src/main/java/java/security/SignedObject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Signer.java b/ojluni/src/main/java/java/security/Signer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/Timestamp.java b/ojluni/src/main/java/java/security/Timestamp.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/UnrecoverableEntryException.java b/ojluni/src/main/java/java/security/UnrecoverableEntryException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/UnrecoverableKeyException.java b/ojluni/src/main/java/java/security/UnrecoverableKeyException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/UnresolvedPermission.java b/ojluni/src/main/java/java/security/UnresolvedPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/UnresolvedPermissionCollection.java b/ojluni/src/main/java/java/security/UnresolvedPermissionCollection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/Acl.java b/ojluni/src/main/java/java/security/acl/Acl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/AclEntry.java b/ojluni/src/main/java/java/security/acl/AclEntry.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/AclNotFoundException.java b/ojluni/src/main/java/java/security/acl/AclNotFoundException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/Group.java b/ojluni/src/main/java/java/security/acl/Group.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/LastOwnerException.java b/ojluni/src/main/java/java/security/acl/LastOwnerException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/NotOwnerException.java b/ojluni/src/main/java/java/security/acl/NotOwnerException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/Owner.java b/ojluni/src/main/java/java/security/acl/Owner.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/acl/Permission.java b/ojluni/src/main/java/java/security/acl/Permission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CRL.java b/ojluni/src/main/java/java/security/cert/CRL.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CRLException.java b/ojluni/src/main/java/java/security/cert/CRLException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CRLReason.java b/ojluni/src/main/java/java/security/cert/CRLReason.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CRLSelector.java b/ojluni/src/main/java/java/security/cert/CRLSelector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPath.java b/ojluni/src/main/java/java/security/cert/CertPath.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathBuilder.java b/ojluni/src/main/java/java/security/cert/CertPathBuilder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathBuilderException.java b/ojluni/src/main/java/java/security/cert/CertPathBuilderException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathBuilderResult.java b/ojluni/src/main/java/java/security/cert/CertPathBuilderResult.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathBuilderSpi.java b/ojluni/src/main/java/java/security/cert/CertPathBuilderSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathHelperImpl.java b/ojluni/src/main/java/java/security/cert/CertPathHelperImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathParameters.java b/ojluni/src/main/java/java/security/cert/CertPathParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathValidator.java b/ojluni/src/main/java/java/security/cert/CertPathValidator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathValidatorException.java b/ojluni/src/main/java/java/security/cert/CertPathValidatorException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathValidatorResult.java b/ojluni/src/main/java/java/security/cert/CertPathValidatorResult.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertPathValidatorSpi.java b/ojluni/src/main/java/java/security/cert/CertPathValidatorSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertSelector.java b/ojluni/src/main/java/java/security/cert/CertSelector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertStore.java b/ojluni/src/main/java/java/security/cert/CertStore.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertStoreException.java b/ojluni/src/main/java/java/security/cert/CertStoreException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertStoreParameters.java b/ojluni/src/main/java/java/security/cert/CertStoreParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertStoreSpi.java b/ojluni/src/main/java/java/security/cert/CertStoreSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/Certificate.java b/ojluni/src/main/java/java/security/cert/Certificate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateEncodingException.java b/ojluni/src/main/java/java/security/cert/CertificateEncodingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateException.java b/ojluni/src/main/java/java/security/cert/CertificateException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateExpiredException.java b/ojluni/src/main/java/java/security/cert/CertificateExpiredException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateFactory.java b/ojluni/src/main/java/java/security/cert/CertificateFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java b/ojluni/src/main/java/java/security/cert/CertificateFactorySpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateNotYetValidException.java b/ojluni/src/main/java/java/security/cert/CertificateNotYetValidException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateParsingException.java b/ojluni/src/main/java/java/security/cert/CertificateParsingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CertificateRevokedException.java b/ojluni/src/main/java/java/security/cert/CertificateRevokedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/CollectionCertStoreParameters.java b/ojluni/src/main/java/java/security/cert/CollectionCertStoreParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/Extension.java b/ojluni/src/main/java/java/security/cert/Extension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/LDAPCertStoreParameters.java b/ojluni/src/main/java/java/security/cert/LDAPCertStoreParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PKIXBuilderParameters.java b/ojluni/src/main/java/java/security/cert/PKIXBuilderParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PKIXCertPathBuilderResult.java b/ojluni/src/main/java/java/security/cert/PKIXCertPathBuilderResult.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PKIXCertPathChecker.java b/ojluni/src/main/java/java/security/cert/PKIXCertPathChecker.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java b/ojluni/src/main/java/java/security/cert/PKIXCertPathValidatorResult.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PKIXParameters.java b/ojluni/src/main/java/java/security/cert/PKIXParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PKIXReason.java b/ojluni/src/main/java/java/security/cert/PKIXReason.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PolicyNode.java b/ojluni/src/main/java/java/security/cert/PolicyNode.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/PolicyQualifierInfo.java b/ojluni/src/main/java/java/security/cert/PolicyQualifierInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/TrustAnchor.java b/ojluni/src/main/java/java/security/cert/TrustAnchor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/X509CRL.java b/ojluni/src/main/java/java/security/cert/X509CRL.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/X509CRLEntry.java b/ojluni/src/main/java/java/security/cert/X509CRLEntry.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/X509CRLSelector.java b/ojluni/src/main/java/java/security/cert/X509CRLSelector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/X509CertSelector.java b/ojluni/src/main/java/java/security/cert/X509CertSelector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/X509Certificate.java b/ojluni/src/main/java/java/security/cert/X509Certificate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/cert/X509Extension.java b/ojluni/src/main/java/java/security/cert/X509Extension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAKey.java b/ojluni/src/main/java/java/security/interfaces/DSAKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java b/ojluni/src/main/java/java/security/interfaces/DSAKeyPairGenerator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAParams.java b/ojluni/src/main/java/java/security/interfaces/DSAParams.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java b/ojluni/src/main/java/java/security/interfaces/DSAPrivateKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java b/ojluni/src/main/java/java/security/interfaces/DSAPublicKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/ECKey.java b/ojluni/src/main/java/java/security/interfaces/ECKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/ECPrivateKey.java b/ojluni/src/main/java/java/security/interfaces/ECPrivateKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/ECPublicKey.java b/ojluni/src/main/java/java/security/interfaces/ECPublicKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAKey.java b/ojluni/src/main/java/java/security/interfaces/RSAKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java b/ojluni/src/main/java/java/security/interfaces/RSAMultiPrimePrivateCrtKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPrivateCrtKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPrivateKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java b/ojluni/src/main/java/java/security/interfaces/RSAPublicKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/AlgorithmParameterSpec.java b/ojluni/src/main/java/java/security/spec/AlgorithmParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/DSAParameterSpec.java b/ojluni/src/main/java/java/security/spec/DSAParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/DSAPrivateKeySpec.java b/ojluni/src/main/java/java/security/spec/DSAPrivateKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/DSAPublicKeySpec.java b/ojluni/src/main/java/java/security/spec/DSAPublicKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECField.java b/ojluni/src/main/java/java/security/spec/ECField.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECFieldF2m.java b/ojluni/src/main/java/java/security/spec/ECFieldF2m.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECFieldFp.java b/ojluni/src/main/java/java/security/spec/ECFieldFp.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java b/ojluni/src/main/java/java/security/spec/ECGenParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECParameterSpec.java b/ojluni/src/main/java/java/security/spec/ECParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECPoint.java b/ojluni/src/main/java/java/security/spec/ECPoint.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECPrivateKeySpec.java b/ojluni/src/main/java/java/security/spec/ECPrivateKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/ECPublicKeySpec.java b/ojluni/src/main/java/java/security/spec/ECPublicKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/EllipticCurve.java b/ojluni/src/main/java/java/security/spec/EllipticCurve.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/EncodedKeySpec.java b/ojluni/src/main/java/java/security/spec/EncodedKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/InvalidKeySpecException.java b/ojluni/src/main/java/java/security/spec/InvalidKeySpecException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/InvalidParameterSpecException.java b/ojluni/src/main/java/java/security/spec/InvalidParameterSpecException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/KeySpec.java b/ojluni/src/main/java/java/security/spec/KeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/MGF1ParameterSpec.java b/ojluni/src/main/java/java/security/spec/MGF1ParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/PKCS8EncodedKeySpec.java b/ojluni/src/main/java/java/security/spec/PKCS8EncodedKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/PSSParameterSpec.java b/ojluni/src/main/java/java/security/spec/PSSParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/RSAKeyGenParameterSpec.java b/ojluni/src/main/java/java/security/spec/RSAKeyGenParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java b/ojluni/src/main/java/java/security/spec/RSAMultiPrimePrivateCrtKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/RSAOtherPrimeInfo.java b/ojluni/src/main/java/java/security/spec/RSAOtherPrimeInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/RSAPrivateCrtKeySpec.java b/ojluni/src/main/java/java/security/spec/RSAPrivateCrtKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/RSAPrivateKeySpec.java b/ojluni/src/main/java/java/security/spec/RSAPrivateKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/RSAPublicKeySpec.java b/ojluni/src/main/java/java/security/spec/RSAPublicKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/security/spec/X509EncodedKeySpec.java b/ojluni/src/main/java/java/security/spec/X509EncodedKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Array.java b/ojluni/src/main/java/java/sql/Array.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/BatchUpdateException.java b/ojluni/src/main/java/java/sql/BatchUpdateException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Blob.java b/ojluni/src/main/java/java/sql/Blob.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/CallableStatement.java b/ojluni/src/main/java/java/sql/CallableStatement.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/ClientInfoStatus.java b/ojluni/src/main/java/java/sql/ClientInfoStatus.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Clob.java b/ojluni/src/main/java/java/sql/Clob.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Connection.java b/ojluni/src/main/java/java/sql/Connection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/DataTruncation.java b/ojluni/src/main/java/java/sql/DataTruncation.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/DatabaseMetaData.java b/ojluni/src/main/java/java/sql/DatabaseMetaData.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Date.java b/ojluni/src/main/java/java/sql/Date.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Driver.java b/ojluni/src/main/java/java/sql/Driver.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/DriverManager.java b/ojluni/src/main/java/java/sql/DriverManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/DriverPropertyInfo.java b/ojluni/src/main/java/java/sql/DriverPropertyInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/NClob.java b/ojluni/src/main/java/java/sql/NClob.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/ParameterMetaData.java b/ojluni/src/main/java/java/sql/ParameterMetaData.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/PreparedStatement.java b/ojluni/src/main/java/java/sql/PreparedStatement.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Ref.java b/ojluni/src/main/java/java/sql/Ref.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/ResultSet.java b/ojluni/src/main/java/java/sql/ResultSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/ResultSetMetaData.java b/ojluni/src/main/java/java/sql/ResultSetMetaData.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/RowId.java b/ojluni/src/main/java/java/sql/RowId.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/RowIdLifetime.java b/ojluni/src/main/java/java/sql/RowIdLifetime.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLClientInfoException.java b/ojluni/src/main/java/java/sql/SQLClientInfoException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLData.java b/ojluni/src/main/java/java/sql/SQLData.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLDataException.java b/ojluni/src/main/java/java/sql/SQLDataException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLException.java b/ojluni/src/main/java/java/sql/SQLException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLFeatureNotSupportedException.java b/ojluni/src/main/java/java/sql/SQLFeatureNotSupportedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLInput.java b/ojluni/src/main/java/java/sql/SQLInput.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLIntegrityConstraintViolationException.java b/ojluni/src/main/java/java/sql/SQLIntegrityConstraintViolationException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLInvalidAuthorizationSpecException.java b/ojluni/src/main/java/java/sql/SQLInvalidAuthorizationSpecException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLNonTransientConnectionException.java b/ojluni/src/main/java/java/sql/SQLNonTransientConnectionException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLNonTransientException.java b/ojluni/src/main/java/java/sql/SQLNonTransientException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLOutput.java b/ojluni/src/main/java/java/sql/SQLOutput.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLPermission.java b/ojluni/src/main/java/java/sql/SQLPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLRecoverableException.java b/ojluni/src/main/java/java/sql/SQLRecoverableException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLSyntaxErrorException.java b/ojluni/src/main/java/java/sql/SQLSyntaxErrorException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLTimeoutException.java b/ojluni/src/main/java/java/sql/SQLTimeoutException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLTransactionRollbackException.java b/ojluni/src/main/java/java/sql/SQLTransactionRollbackException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLTransientConnectionException.java b/ojluni/src/main/java/java/sql/SQLTransientConnectionException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLTransientException.java b/ojluni/src/main/java/java/sql/SQLTransientException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLWarning.java b/ojluni/src/main/java/java/sql/SQLWarning.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/SQLXML.java b/ojluni/src/main/java/java/sql/SQLXML.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Savepoint.java b/ojluni/src/main/java/java/sql/Savepoint.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Statement.java b/ojluni/src/main/java/java/sql/Statement.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Struct.java b/ojluni/src/main/java/java/sql/Struct.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Time.java b/ojluni/src/main/java/java/sql/Time.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Timestamp.java b/ojluni/src/main/java/java/sql/Timestamp.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Types.java b/ojluni/src/main/java/java/sql/Types.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/sql/Wrapper.java b/ojluni/src/main/java/java/sql/Wrapper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/Annotation.java b/ojluni/src/main/java/java/text/Annotation.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/AttributedCharacterIterator.java b/ojluni/src/main/java/java/text/AttributedCharacterIterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/AttributedString.java b/ojluni/src/main/java/java/text/AttributedString.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/Bidi.java b/ojluni/src/main/java/java/text/Bidi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/BreakIterator.java b/ojluni/src/main/java/java/text/BreakIterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/CalendarBuilder.java b/ojluni/src/main/java/java/text/CalendarBuilder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/CharacterIterator.java b/ojluni/src/main/java/java/text/CharacterIterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/CharacterIteratorFieldDelegate.java b/ojluni/src/main/java/java/text/CharacterIteratorFieldDelegate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/ChoiceFormat.java b/ojluni/src/main/java/java/text/ChoiceFormat.java
old mode 100755
new mode 100644
index 6c5f281..553a29c
--- a/ojluni/src/main/java/java/text/ChoiceFormat.java
+++ b/ojluni/src/main/java/java/text/ChoiceFormat.java
@@ -345,24 +345,34 @@
throw new IllegalArgumentException(
"Array and limit arrays must be of the same length.");
}
- choiceLimits = limits;
- choiceFormats = formats;
+ choiceLimits = Arrays.copyOf(limits, limits.length);
+ choiceFormats = Arrays.copyOf(formats, formats.length);
}
/**
* Get the limits passed in the constructor.
+ *
+ * <p>The contents of the array are the same as the array passed into the constructor but the
+ * array will not be the same array.
+ *
* @return the limits.
*/
public double[] getLimits() {
- return choiceLimits;
+ double[] newLimits = Arrays.copyOf(choiceLimits, choiceLimits.length);
+ return newLimits;
}
/**
* Get the formats passed in the constructor.
+ *
+ * <p>The contents of the array are the same as the array passed into the constructor but the
+ * array will not be the same array.
+ *
* @return the formats.
*/
public Object[] getFormats() {
- return choiceFormats;
+ Object[] newFormats = Arrays.copyOf(choiceFormats, choiceFormats.length);
+ return newFormats;
}
// Overrides
@@ -470,8 +480,8 @@
{
ChoiceFormat other = (ChoiceFormat) super.clone();
// for primitives or immutables, shallow clone is enough
- other.choiceLimits = (double[]) choiceLimits.clone();
- other.choiceFormats = (String[]) choiceFormats.clone();
+ other.choiceLimits = choiceLimits.clone();
+ other.choiceFormats = choiceFormats.clone();
return other;
}
diff --git a/ojluni/src/main/java/java/text/CollationElementIterator.java b/ojluni/src/main/java/java/text/CollationElementIterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/CollationKey.java b/ojluni/src/main/java/java/text/CollationKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/Collator.java b/ojluni/src/main/java/java/text/Collator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/DateFormat.java b/ojluni/src/main/java/java/text/DateFormat.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/DateFormatSymbols.java b/ojluni/src/main/java/java/text/DateFormatSymbols.java
old mode 100755
new mode 100644
index 1e591e0..95626af
--- a/ojluni/src/main/java/java/text/DateFormatSymbols.java
+++ b/ojluni/src/main/java/java/text/DateFormatSymbols.java
@@ -259,7 +259,7 @@
static final int PATTERN_WEEK_YEAR = 19; // Y
static final int PATTERN_ISO_DAY_OF_WEEK = 20; // u
static final int PATTERN_ISO_ZONE = 21; // X
- static final int PATTERN_STANDALONE_MONTH = 22; // L
+ static final int PATTERN_MONTH_STANDALONE = 22; // L
static final int PATTERN_STANDALONE_DAY_OF_WEEK = 23; // c
/**
diff --git a/ojluni/src/main/java/java/text/DecimalFormat.java b/ojluni/src/main/java/java/text/DecimalFormat.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/DecimalFormatSymbols.java b/ojluni/src/main/java/java/text/DecimalFormatSymbols.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/DigitList.java b/ojluni/src/main/java/java/text/DigitList.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/DontCareFieldPosition.java b/ojluni/src/main/java/java/text/DontCareFieldPosition.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/EntryPair.java b/ojluni/src/main/java/java/text/EntryPair.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/FieldPosition.java b/ojluni/src/main/java/java/text/FieldPosition.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/Format.java b/ojluni/src/main/java/java/text/Format.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/IcuIteratorWrapper.java b/ojluni/src/main/java/java/text/IcuIteratorWrapper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/MergeCollation.java b/ojluni/src/main/java/java/text/MergeCollation.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/MessageFormat.java b/ojluni/src/main/java/java/text/MessageFormat.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/Normalizer.java b/ojluni/src/main/java/java/text/Normalizer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/NumberFormat.java b/ojluni/src/main/java/java/text/NumberFormat.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/ParseException.java b/ojluni/src/main/java/java/text/ParseException.java
old mode 100755
new mode 100644
index 0e9870c..f9ad001
--- a/ojluni/src/main/java/java/text/ParseException.java
+++ b/ojluni/src/main/java/java/text/ParseException.java
@@ -49,6 +49,8 @@
public
class ParseException extends Exception {
+ private static final long serialVersionUID = 2703218443322787634L;
+
/**
* Constructs a ParseException with the specified detail message and
* offset.
diff --git a/ojluni/src/main/java/java/text/ParsePosition.java b/ojluni/src/main/java/java/text/ParsePosition.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/PatternEntry.java b/ojluni/src/main/java/java/text/PatternEntry.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/RuleBasedCollator.java b/ojluni/src/main/java/java/text/RuleBasedCollator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/SimpleDateFormat.java b/ojluni/src/main/java/java/text/SimpleDateFormat.java
old mode 100755
new mode 100644
index 61eb11e..f81df1b
--- a/ojluni/src/main/java/java/text/SimpleDateFormat.java
+++ b/ojluni/src/main/java/java/text/SimpleDateFormat.java
@@ -508,7 +508,7 @@
* Cache NumberFormat instances with Locale key.
*/
private static final ConcurrentMap<Locale, NumberFormat> cachedNumberFormatData
- = new ConcurrentHashMap<Locale, NumberFormat>(3);
+ = new ConcurrentHashMap<>(3);
/**
* The Locale used to instantiate this
@@ -754,7 +754,7 @@
private char[] compile(String pattern) {
int length = pattern.length();
boolean inQuote = false;
- StringBuilder compiledPattern = new StringBuilder(length * 2);
+ StringBuilder compiledCode = new StringBuilder(length * 2);
StringBuilder tmpBuffer = null;
int count = 0;
int lastTag = -1;
@@ -770,21 +770,21 @@
if (c == '\'') {
i++;
if (count != 0) {
- encode(lastTag, count, compiledPattern);
+ encode(lastTag, count, compiledCode);
lastTag = -1;
count = 0;
}
if (inQuote) {
tmpBuffer.append(c);
} else {
- compiledPattern.append((char)(TAG_QUOTE_ASCII_CHAR << 8 | c));
+ compiledCode.append((char)(TAG_QUOTE_ASCII_CHAR << 8 | c));
}
continue;
}
}
if (!inQuote) {
if (count != 0) {
- encode(lastTag, count, compiledPattern);
+ encode(lastTag, count, compiledCode);
lastTag = -1;
count = 0;
}
@@ -799,14 +799,14 @@
if (len == 1) {
char ch = tmpBuffer.charAt(0);
if (ch < 128) {
- compiledPattern.append((char)(TAG_QUOTE_ASCII_CHAR << 8 | ch));
+ compiledCode.append((char)(TAG_QUOTE_ASCII_CHAR << 8 | ch));
} else {
- compiledPattern.append((char)(TAG_QUOTE_CHARS << 8 | 1));
- compiledPattern.append(ch);
+ compiledCode.append((char)(TAG_QUOTE_CHARS << 8 | 1));
+ compiledCode.append(ch);
}
} else {
- encode(TAG_QUOTE_CHARS, len, compiledPattern);
- compiledPattern.append(tmpBuffer);
+ encode(TAG_QUOTE_CHARS, len, compiledCode);
+ compiledCode.append(tmpBuffer);
}
inQuote = false;
}
@@ -818,13 +818,13 @@
}
if (!(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z')) {
if (count != 0) {
- encode(lastTag, count, compiledPattern);
+ encode(lastTag, count, compiledCode);
lastTag = -1;
count = 0;
}
if (c < 128) {
// In most cases, c would be a delimiter, such as ':'.
- compiledPattern.append((char)(TAG_QUOTE_ASCII_CHAR << 8 | c));
+ compiledCode.append((char)(TAG_QUOTE_ASCII_CHAR << 8 | c));
} else {
// Take any contiguous non-ASCII alphabet characters and
// put them in a single TAG_QUOTE_CHARS.
@@ -835,9 +835,9 @@
break;
}
}
- compiledPattern.append((char)(TAG_QUOTE_CHARS << 8 | (j - i)));
+ compiledCode.append((char)(TAG_QUOTE_CHARS << 8 | (j - i)));
for (; i < j; i++) {
- compiledPattern.append(pattern.charAt(i));
+ compiledCode.append(pattern.charAt(i));
}
i--;
}
@@ -854,7 +854,7 @@
count++;
continue;
}
- encode(lastTag, count, compiledPattern);
+ encode(lastTag, count, compiledCode);
lastTag = tag;
count = 1;
}
@@ -864,13 +864,13 @@
}
if (count != 0) {
- encode(lastTag, count, compiledPattern);
+ encode(lastTag, count, compiledCode);
}
// Copy the compiled pattern to a char array
- int len = compiledPattern.length();
+ int len = compiledCode.length();
char[] r = new char[len];
- compiledPattern.getChars(0, len, r, 0);
+ compiledCode.getChars(0, len, r, 0);
return r;
}
@@ -1169,7 +1169,7 @@
if (calendar instanceof GregorianCalendar) {
if (count != 2) {
zeroPaddingNumber(value, count, maxIntCount, buffer);
- } else { // count == 2
+ } else {
zeroPaddingNumber(value, 2, 2, buffer);
} // clip 1996 to 96
} else {
@@ -1187,7 +1187,7 @@
break;
}
- case PATTERN_STANDALONE_MONTH: // 'L'
+ case PATTERN_MONTH_STANDALONE: // 'L'
{
current = formatMonth(count, value, maxIntCount, buffer, useDateFormatSymbols,
true /* standalone */);
@@ -1806,6 +1806,15 @@
if (count != 1) {
// Proceed with parsing mm
c = text.charAt(index++);
+ // Intentional change in behavior from OpenJDK. OpenJDK will return an error code
+ // if a : is found and colonRequired is false, this will return an error code if
+ // a : is not found and colonRequired is true.
+ //
+ // colonRequired | c == ':' | OpenJDK | this
+ // false | false | ok | ok
+ // false | true | error | ok
+ // true | false | ok | error
+ // true | true | ok | ok
if (c == ':') {
c = text.charAt(index++);
} else if (colonRequired) {
@@ -1992,7 +2001,7 @@
break parsing;
}
- case PATTERN_STANDALONE_MONTH: // 'L'.
+ case PATTERN_MONTH_STANDALONE: // 'L'.
{
final int idx = parseMonth(text, count, value, start, field, pos,
useDateFormatSymbols, true /* isStandalone */, calb);
diff --git a/ojluni/src/main/java/java/text/StringCharacterIterator.java b/ojluni/src/main/java/java/text/StringCharacterIterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/spi/BreakIteratorProvider.java b/ojluni/src/main/java/java/text/spi/BreakIteratorProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/spi/CollatorProvider.java b/ojluni/src/main/java/java/text/spi/CollatorProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/spi/DateFormatProvider.java b/ojluni/src/main/java/java/text/spi/DateFormatProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/spi/DateFormatSymbolsProvider.java b/ojluni/src/main/java/java/text/spi/DateFormatSymbolsProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java b/ojluni/src/main/java/java/text/spi/DecimalFormatSymbolsProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/text/spi/NumberFormatProvider.java b/ojluni/src/main/java/java/text/spi/NumberFormatProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/AbstractCollection.java b/ojluni/src/main/java/java/util/AbstractCollection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/AbstractList.java b/ojluni/src/main/java/java/util/AbstractList.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/AbstractMap.java b/ojluni/src/main/java/java/util/AbstractMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/AbstractSequentialList.java b/ojluni/src/main/java/java/util/AbstractSequentialList.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/AbstractSet.java b/ojluni/src/main/java/java/util/AbstractSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ArrayList.java b/ojluni/src/main/java/java/util/ArrayList.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Arrays.java b/ojluni/src/main/java/java/util/Arrays.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/BitSet.java b/ojluni/src/main/java/java/util/BitSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Calendar.java b/ojluni/src/main/java/java/util/Calendar.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Collection.java b/ojluni/src/main/java/java/util/Collection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ComparableTimSort.java b/ojluni/src/main/java/java/util/ComparableTimSort.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ConcurrentModificationException.java b/ojluni/src/main/java/java/util/ConcurrentModificationException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Currency.java b/ojluni/src/main/java/java/util/Currency.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Date.java b/ojluni/src/main/java/java/util/Date.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Dictionary.java b/ojluni/src/main/java/java/util/Dictionary.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/DualPivotQuicksort.java b/ojluni/src/main/java/java/util/DualPivotQuicksort.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/DuplicateFormatFlagsException.java b/ojluni/src/main/java/java/util/DuplicateFormatFlagsException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/EmptyStackException.java b/ojluni/src/main/java/java/util/EmptyStackException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/EnumMap.java b/ojluni/src/main/java/java/util/EnumMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/EnumSet.java b/ojluni/src/main/java/java/util/EnumSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Enumeration.java b/ojluni/src/main/java/java/util/Enumeration.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/EventListener.java b/ojluni/src/main/java/java/util/EventListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/EventListenerProxy.java b/ojluni/src/main/java/java/util/EventListenerProxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/EventObject.java b/ojluni/src/main/java/java/util/EventObject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/FormatFlagsConversionMismatchException.java b/ojluni/src/main/java/java/util/FormatFlagsConversionMismatchException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Formattable.java b/ojluni/src/main/java/java/util/Formattable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/FormattableFlags.java b/ojluni/src/main/java/java/util/FormattableFlags.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Formatter.java b/ojluni/src/main/java/java/util/Formatter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/FormatterClosedException.java b/ojluni/src/main/java/java/util/FormatterClosedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/GregorianCalendar.java b/ojluni/src/main/java/java/util/GregorianCalendar.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/HashMap.java b/ojluni/src/main/java/java/util/HashMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/HashSet.java b/ojluni/src/main/java/java/util/HashSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Hashtable.java b/ojluni/src/main/java/java/util/Hashtable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IdentityHashMap.java b/ojluni/src/main/java/java/util/IdentityHashMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IllegalFormatCodePointException.java b/ojluni/src/main/java/java/util/IllegalFormatCodePointException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IllegalFormatConversionException.java b/ojluni/src/main/java/java/util/IllegalFormatConversionException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IllegalFormatException.java b/ojluni/src/main/java/java/util/IllegalFormatException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IllegalFormatFlagsException.java b/ojluni/src/main/java/java/util/IllegalFormatFlagsException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IllegalFormatPrecisionException.java b/ojluni/src/main/java/java/util/IllegalFormatPrecisionException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IllegalFormatWidthException.java b/ojluni/src/main/java/java/util/IllegalFormatWidthException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/IllformedLocaleException.java b/ojluni/src/main/java/java/util/IllformedLocaleException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/InputMismatchException.java b/ojluni/src/main/java/java/util/InputMismatchException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/InvalidPropertiesFormatException.java b/ojluni/src/main/java/java/util/InvalidPropertiesFormatException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Iterator.java b/ojluni/src/main/java/java/util/Iterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/JumboEnumSet.java b/ojluni/src/main/java/java/util/JumboEnumSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/LinkedHashMap.java b/ojluni/src/main/java/java/util/LinkedHashMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/LinkedHashSet.java b/ojluni/src/main/java/java/util/LinkedHashSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/LinkedList.java b/ojluni/src/main/java/java/util/LinkedList.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/List.java b/ojluni/src/main/java/java/util/List.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ListIterator.java b/ojluni/src/main/java/java/util/ListIterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ListResourceBundle.java b/ojluni/src/main/java/java/util/ListResourceBundle.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Locale.java b/ojluni/src/main/java/java/util/Locale.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/MissingFormatArgumentException.java b/ojluni/src/main/java/java/util/MissingFormatArgumentException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/MissingFormatWidthException.java b/ojluni/src/main/java/java/util/MissingFormatWidthException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/MissingResourceException.java b/ojluni/src/main/java/java/util/MissingResourceException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/NoSuchElementException.java b/ojluni/src/main/java/java/util/NoSuchElementException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Objects.java b/ojluni/src/main/java/java/util/Objects.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Observable.java b/ojluni/src/main/java/java/util/Observable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Observer.java b/ojluni/src/main/java/java/util/Observer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Properties.java b/ojluni/src/main/java/java/util/Properties.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/PropertyPermission.java b/ojluni/src/main/java/java/util/PropertyPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/PropertyResourceBundle.java b/ojluni/src/main/java/java/util/PropertyResourceBundle.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Random.java b/ojluni/src/main/java/java/util/Random.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/RandomAccess.java b/ojluni/src/main/java/java/util/RandomAccess.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/RegularEnumSet.java b/ojluni/src/main/java/java/util/RegularEnumSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ResourceBundle.java b/ojluni/src/main/java/java/util/ResourceBundle.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Scanner.java b/ojluni/src/main/java/java/util/Scanner.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ServiceConfigurationError.java b/ojluni/src/main/java/java/util/ServiceConfigurationError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/ServiceLoader.java b/ojluni/src/main/java/java/util/ServiceLoader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Set.java b/ojluni/src/main/java/java/util/Set.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/SimpleTimeZone.java b/ojluni/src/main/java/java/util/SimpleTimeZone.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/SortedMap.java b/ojluni/src/main/java/java/util/SortedMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/SortedSet.java b/ojluni/src/main/java/java/util/SortedSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Stack.java b/ojluni/src/main/java/java/util/Stack.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/StringTokenizer.java b/ojluni/src/main/java/java/util/StringTokenizer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/TimSort.java b/ojluni/src/main/java/java/util/TimSort.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/TimeZone.java b/ojluni/src/main/java/java/util/TimeZone.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Timer.java b/ojluni/src/main/java/java/util/Timer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/TimerTask.java b/ojluni/src/main/java/java/util/TimerTask.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/TooManyListenersException.java b/ojluni/src/main/java/java/util/TooManyListenersException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/TreeMap.java b/ojluni/src/main/java/java/util/TreeMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/TreeSet.java b/ojluni/src/main/java/java/util/TreeSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/UUID.java b/ojluni/src/main/java/java/util/UUID.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/UnknownFormatConversionException.java b/ojluni/src/main/java/java/util/UnknownFormatConversionException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/UnknownFormatFlagsException.java b/ojluni/src/main/java/java/util/UnknownFormatFlagsException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/Vector.java b/ojluni/src/main/java/java/util/Vector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/WeakHashMap.java b/ojluni/src/main/java/java/util/WeakHashMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/XMLUtils.java b/ojluni/src/main/java/java/util/XMLUtils.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/Attributes.java b/ojluni/src/main/java/java/util/jar/Attributes.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/JarEntry.java b/ojluni/src/main/java/java/util/jar/JarEntry.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/JarException.java b/ojluni/src/main/java/java/util/jar/JarException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/JarFile.java b/ojluni/src/main/java/java/util/jar/JarFile.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/JarInputStream.java b/ojluni/src/main/java/java/util/jar/JarInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/JarOutputStream.java b/ojluni/src/main/java/java/util/jar/JarOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/JarVerifier.java b/ojluni/src/main/java/java/util/jar/JarVerifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/Manifest.java b/ojluni/src/main/java/java/util/jar/Manifest.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/jar/Pack200.java b/ojluni/src/main/java/java/util/jar/Pack200.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/ConsoleHandler.java b/ojluni/src/main/java/java/util/logging/ConsoleHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/ErrorManager.java b/ojluni/src/main/java/java/util/logging/ErrorManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/FileHandler.java b/ojluni/src/main/java/java/util/logging/FileHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/Filter.java b/ojluni/src/main/java/java/util/logging/Filter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/Formatter.java b/ojluni/src/main/java/java/util/logging/Formatter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/Handler.java b/ojluni/src/main/java/java/util/logging/Handler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/Level.java b/ojluni/src/main/java/java/util/logging/Level.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/LogManager.java b/ojluni/src/main/java/java/util/logging/LogManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/LogRecord.java b/ojluni/src/main/java/java/util/logging/LogRecord.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/Logger.java b/ojluni/src/main/java/java/util/logging/Logger.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/Logging.java b/ojluni/src/main/java/java/util/logging/Logging.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/LoggingMXBean.java b/ojluni/src/main/java/java/util/logging/LoggingMXBean.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/LoggingPermission.java b/ojluni/src/main/java/java/util/logging/LoggingPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/LoggingProxyImpl.java b/ojluni/src/main/java/java/util/logging/LoggingProxyImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/MemoryHandler.java b/ojluni/src/main/java/java/util/logging/MemoryHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/SimpleFormatter.java b/ojluni/src/main/java/java/util/logging/SimpleFormatter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/SocketHandler.java b/ojluni/src/main/java/java/util/logging/SocketHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/StreamHandler.java b/ojluni/src/main/java/java/util/logging/StreamHandler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/logging/XMLFormatter.java b/ojluni/src/main/java/java/util/logging/XMLFormatter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/AbstractPreferences.java b/ojluni/src/main/java/java/util/prefs/AbstractPreferences.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/BackingStoreException.java b/ojluni/src/main/java/java/util/prefs/BackingStoreException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/Base64.java b/ojluni/src/main/java/java/util/prefs/Base64.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/FileSystemPreferences.java b/ojluni/src/main/java/java/util/prefs/FileSystemPreferences.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/FileSystemPreferencesFactory.java b/ojluni/src/main/java/java/util/prefs/FileSystemPreferencesFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/InvalidPreferencesFormatException.java b/ojluni/src/main/java/java/util/prefs/InvalidPreferencesFormatException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/NodeChangeEvent.java b/ojluni/src/main/java/java/util/prefs/NodeChangeEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/NodeChangeListener.java b/ojluni/src/main/java/java/util/prefs/NodeChangeListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/PreferenceChangeEvent.java b/ojluni/src/main/java/java/util/prefs/PreferenceChangeEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/PreferenceChangeListener.java b/ojluni/src/main/java/java/util/prefs/PreferenceChangeListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/Preferences.java b/ojluni/src/main/java/java/util/prefs/Preferences.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/PreferencesFactory.java b/ojluni/src/main/java/java/util/prefs/PreferencesFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/prefs/XmlSupport.java b/ojluni/src/main/java/java/util/prefs/XmlSupport.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/regex/MatchResult.java b/ojluni/src/main/java/java/util/regex/MatchResult.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/regex/Matcher.java b/ojluni/src/main/java/java/util/regex/Matcher.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/regex/Pattern.java b/ojluni/src/main/java/java/util/regex/Pattern.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/regex/PatternSyntaxException.java b/ojluni/src/main/java/java/util/regex/PatternSyntaxException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/spi/CurrencyNameProvider.java b/ojluni/src/main/java/java/util/spi/CurrencyNameProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/spi/LocaleNameProvider.java b/ojluni/src/main/java/java/util/spi/LocaleNameProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/spi/LocaleServiceProvider.java b/ojluni/src/main/java/java/util/spi/LocaleServiceProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/spi/TimeZoneNameProvider.java b/ojluni/src/main/java/java/util/spi/TimeZoneNameProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/Adler32.java b/ojluni/src/main/java/java/util/zip/Adler32.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/CRC32.java b/ojluni/src/main/java/java/util/zip/CRC32.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/CheckedInputStream.java b/ojluni/src/main/java/java/util/zip/CheckedInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/CheckedOutputStream.java b/ojluni/src/main/java/java/util/zip/CheckedOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/Checksum.java b/ojluni/src/main/java/java/util/zip/Checksum.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/DataFormatException.java b/ojluni/src/main/java/java/util/zip/DataFormatException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/Deflater.java b/ojluni/src/main/java/java/util/zip/Deflater.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/DeflaterInputStream.java b/ojluni/src/main/java/java/util/zip/DeflaterInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/DeflaterOutputStream.java b/ojluni/src/main/java/java/util/zip/DeflaterOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/GZIPInputStream.java b/ojluni/src/main/java/java/util/zip/GZIPInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/GZIPOutputStream.java b/ojluni/src/main/java/java/util/zip/GZIPOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/Inflater.java b/ojluni/src/main/java/java/util/zip/Inflater.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/InflaterInputStream.java b/ojluni/src/main/java/java/util/zip/InflaterInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/InflaterOutputStream.java b/ojluni/src/main/java/java/util/zip/InflaterOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZStreamRef.java b/ojluni/src/main/java/java/util/zip/ZStreamRef.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipCoder.java b/ojluni/src/main/java/java/util/zip/ZipCoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipConstants.java b/ojluni/src/main/java/java/util/zip/ZipConstants.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipConstants64.java b/ojluni/src/main/java/java/util/zip/ZipConstants64.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipEntry.java b/ojluni/src/main/java/java/util/zip/ZipEntry.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipError.java b/ojluni/src/main/java/java/util/zip/ZipError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipException.java b/ojluni/src/main/java/java/util/zip/ZipException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipFile.java b/ojluni/src/main/java/java/util/zip/ZipFile.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipInputStream.java b/ojluni/src/main/java/java/util/zip/ZipInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/java/util/zip/ZipOutputStream.java b/ojluni/src/main/java/java/util/zip/ZipOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/AEADBadTagException.java b/ojluni/src/main/java/javax/crypto/AEADBadTagException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/BadPaddingException.java b/ojluni/src/main/java/javax/crypto/BadPaddingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/Cipher.java b/ojluni/src/main/java/javax/crypto/Cipher.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/CipherInputStream.java b/ojluni/src/main/java/javax/crypto/CipherInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/CipherOutputStream.java b/ojluni/src/main/java/javax/crypto/CipherOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/CipherSpi.java b/ojluni/src/main/java/javax/crypto/CipherSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/CryptoAllPermission.java b/ojluni/src/main/java/javax/crypto/CryptoAllPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/CryptoPermission.java b/ojluni/src/main/java/javax/crypto/CryptoPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/CryptoPermissions.java b/ojluni/src/main/java/javax/crypto/CryptoPermissions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/CryptoPolicyParser.java b/ojluni/src/main/java/javax/crypto/CryptoPolicyParser.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java b/ojluni/src/main/java/javax/crypto/EncryptedPrivateKeyInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/ExemptionMechanism.java b/ojluni/src/main/java/javax/crypto/ExemptionMechanism.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/ExemptionMechanismException.java b/ojluni/src/main/java/javax/crypto/ExemptionMechanismException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/ExemptionMechanismSpi.java b/ojluni/src/main/java/javax/crypto/ExemptionMechanismSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/IllegalBlockSizeException.java b/ojluni/src/main/java/javax/crypto/IllegalBlockSizeException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/JarVerifier.java b/ojluni/src/main/java/javax/crypto/JarVerifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/JceSecurity.java b/ojluni/src/main/java/javax/crypto/JceSecurity.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/JceSecurityManager.java b/ojluni/src/main/java/javax/crypto/JceSecurityManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/KeyAgreement.java b/ojluni/src/main/java/javax/crypto/KeyAgreement.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/KeyAgreementSpi.java b/ojluni/src/main/java/javax/crypto/KeyAgreementSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/KeyGenerator.java b/ojluni/src/main/java/javax/crypto/KeyGenerator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/KeyGeneratorSpi.java b/ojluni/src/main/java/javax/crypto/KeyGeneratorSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/Mac.java b/ojluni/src/main/java/javax/crypto/Mac.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/MacSpi.java b/ojluni/src/main/java/javax/crypto/MacSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/NoSuchPaddingException.java b/ojluni/src/main/java/javax/crypto/NoSuchPaddingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/NullCipher.java b/ojluni/src/main/java/javax/crypto/NullCipher.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/NullCipherSpi.java b/ojluni/src/main/java/javax/crypto/NullCipherSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/SealedObject.java b/ojluni/src/main/java/javax/crypto/SealedObject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/SecretKey.java b/ojluni/src/main/java/javax/crypto/SecretKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/SecretKeyFactory.java b/ojluni/src/main/java/javax/crypto/SecretKeyFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/SecretKeyFactorySpi.java b/ojluni/src/main/java/javax/crypto/SecretKeyFactorySpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/ShortBufferException.java b/ojluni/src/main/java/javax/crypto/ShortBufferException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/interfaces/DHKey.java b/ojluni/src/main/java/javax/crypto/interfaces/DHKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/interfaces/DHPrivateKey.java b/ojluni/src/main/java/javax/crypto/interfaces/DHPrivateKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/interfaces/DHPublicKey.java b/ojluni/src/main/java/javax/crypto/interfaces/DHPublicKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/interfaces/PBEKey.java b/ojluni/src/main/java/javax/crypto/interfaces/PBEKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/DESKeySpec.java b/ojluni/src/main/java/javax/crypto/spec/DESKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/DESedeKeySpec.java b/ojluni/src/main/java/javax/crypto/spec/DESedeKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/DHGenParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/DHGenParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/DHParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/DHParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java b/ojluni/src/main/java/javax/crypto/spec/DHPrivateKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/DHPublicKeySpec.java b/ojluni/src/main/java/javax/crypto/spec/DHPublicKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/GCMParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/GCMParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/IvParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/IvParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/OAEPParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/OAEPParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/PBEKeySpec.java b/ojluni/src/main/java/javax/crypto/spec/PBEKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/PBEParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/PBEParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/PSource.java b/ojluni/src/main/java/javax/crypto/spec/PSource.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/RC2ParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/RC2ParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/RC5ParameterSpec.java b/ojluni/src/main/java/javax/crypto/spec/RC5ParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/crypto/spec/SecretKeySpec.java b/ojluni/src/main/java/javax/crypto/spec/SecretKeySpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ServerSocketFactory.java b/ojluni/src/main/java/javax/net/ServerSocketFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/SocketFactory.java b/ojluni/src/main/java/javax/net/SocketFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/CertPathTrustManagerParameters.java b/ojluni/src/main/java/javax/net/ssl/CertPathTrustManagerParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/ExtendedSSLSession.java b/ojluni/src/main/java/javax/net/ssl/ExtendedSSLSession.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java b/ojluni/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/HandshakeCompletedListener.java b/ojluni/src/main/java/javax/net/ssl/HandshakeCompletedListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/HostnameVerifier.java b/ojluni/src/main/java/javax/net/ssl/HostnameVerifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/HttpsURLConnection.java b/ojluni/src/main/java/javax/net/ssl/HttpsURLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/KeyManager.java b/ojluni/src/main/java/javax/net/ssl/KeyManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/KeyManagerFactory.java b/ojluni/src/main/java/javax/net/ssl/KeyManagerFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java b/ojluni/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java b/ojluni/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/ManagerFactoryParameters.java b/ojluni/src/main/java/javax/net/ssl/ManagerFactoryParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLContext.java b/ojluni/src/main/java/javax/net/ssl/SSLContext.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLContextSpi.java b/ojluni/src/main/java/javax/net/ssl/SSLContextSpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLEngine.java b/ojluni/src/main/java/javax/net/ssl/SSLEngine.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLEngineResult.java b/ojluni/src/main/java/javax/net/ssl/SSLEngineResult.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLException.java b/ojluni/src/main/java/javax/net/ssl/SSLException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLHandshakeException.java b/ojluni/src/main/java/javax/net/ssl/SSLHandshakeException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLKeyException.java b/ojluni/src/main/java/javax/net/ssl/SSLKeyException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLParameters.java b/ojluni/src/main/java/javax/net/ssl/SSLParameters.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java b/ojluni/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLPermission.java b/ojluni/src/main/java/javax/net/ssl/SSLPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLProtocolException.java b/ojluni/src/main/java/javax/net/ssl/SSLProtocolException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLServerSocket.java b/ojluni/src/main/java/javax/net/ssl/SSLServerSocket.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLServerSocketFactory.java b/ojluni/src/main/java/javax/net/ssl/SSLServerSocketFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLSession.java b/ojluni/src/main/java/javax/net/ssl/SSLSession.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java b/ojluni/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLSessionBindingListener.java b/ojluni/src/main/java/javax/net/ssl/SSLSessionBindingListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLSessionContext.java b/ojluni/src/main/java/javax/net/ssl/SSLSessionContext.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLSocket.java b/ojluni/src/main/java/javax/net/ssl/SSLSocket.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/SSLSocketFactory.java b/ojluni/src/main/java/javax/net/ssl/SSLSocketFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/TrustManager.java b/ojluni/src/main/java/javax/net/ssl/TrustManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/TrustManagerFactory.java b/ojluni/src/main/java/javax/net/ssl/TrustManagerFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java b/ojluni/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java b/ojluni/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/X509ExtendedTrustManager.java b/ojluni/src/main/java/javax/net/ssl/X509ExtendedTrustManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/X509KeyManager.java b/ojluni/src/main/java/javax/net/ssl/X509KeyManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/net/ssl/X509TrustManager.java b/ojluni/src/main/java/javax/net/ssl/X509TrustManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/AuthPermission.java b/ojluni/src/main/java/javax/security/auth/AuthPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/DestroyFailedException.java b/ojluni/src/main/java/javax/security/auth/DestroyFailedException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/Destroyable.java b/ojluni/src/main/java/javax/security/auth/Destroyable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/PrivateCredentialPermission.java b/ojluni/src/main/java/javax/security/auth/PrivateCredentialPermission.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/Subject.java b/ojluni/src/main/java/javax/security/auth/Subject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/SubjectDomainCombiner.java b/ojluni/src/main/java/javax/security/auth/SubjectDomainCombiner.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/callback/Callback.java b/ojluni/src/main/java/javax/security/auth/callback/Callback.java
old mode 100755
new mode 100644
index 43f884f..83855ca
--- a/ojluni/src/main/java/javax/security/auth/callback/Callback.java
+++ b/ojluni/src/main/java/javax/security/auth/callback/Callback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -28,14 +28,14 @@
/**
* <p> Implementations of this interface are passed to a
- * <code>CallbackHandler</code>, allowing underlying security services
+ * {@code CallbackHandler}, allowing underlying security services
* the ability to interact with a calling application to retrieve specific
* authentication data such as usernames and passwords, or to display
* certain information, such as error and warning messages.
*
- * <p> <code>Callback</code> implementations do not retrieve or
+ * <p> {@code Callback} implementations do not retrieve or
* display the information requested by underlying security services.
- * <code>Callback</code> implementations simply provide the means
+ * {@code Callback} implementations simply provide the means
* to pass such requests to applications, and for applications,
* if appropriate, to return requested information back to the
* underlying security services.
diff --git a/ojluni/src/main/java/javax/security/auth/callback/CallbackHandler.java b/ojluni/src/main/java/javax/security/auth/callback/CallbackHandler.java
old mode 100755
new mode 100644
index f49b1c4..af02496
--- a/ojluni/src/main/java/javax/security/auth/callback/CallbackHandler.java
+++ b/ojluni/src/main/java/javax/security/auth/callback/CallbackHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -26,7 +26,7 @@
package javax.security.auth.callback;
/**
- * <p> An application implements a <code>CallbackHandler</code> and passes
+ * <p> An application implements a {@code CallbackHandler} and passes
* it to underlying security services so that they may interact with
* the application to retrieve specific authentication data,
* such as usernames and passwords, or to display certain information,
@@ -40,33 +40,30 @@
*
* <p> Underlying security services make requests for different types
* of information by passing individual Callbacks to the
- * <code>CallbackHandler</code>. The <code>CallbackHandler</code>
+ * {@code CallbackHandler}. The {@code CallbackHandler}
* implementation decides how to retrieve and display information
* depending on the Callbacks passed to it. For example,
* if the underlying service needs a username and password to
- * authenticate a user, it uses a <code>NameCallback</code> and
- * <code>PasswordCallback</code>. The <code>CallbackHandler</code>
+ * authenticate a user, it uses a {@code NameCallback} and
+ * {@code PasswordCallback}. The {@code CallbackHandler}
* can then choose to prompt for a username and password serially,
* or to prompt for both in a single window.
*
- * <p> A default <code>CallbackHandler</code> class implementation
- * may be specified in the <i>auth.login.defaultCallbackHandler</i>
- * security property. The security property can be set
- * in the Java security properties file located in the file named
- * <JAVA_HOME>/lib/security/java.security.
- * <JAVA_HOME> refers to the value of the java.home system property,
- * and specifies the directory where the JRE is installed.
+ * <p> A default {@code CallbackHandler} class implementation
+ * may be specified by setting the value of the
+ * {@code auth.login.defaultCallbackHandler} security property.
*
* <p> If the security property is set to the fully qualified name of a
- * <code>CallbackHandler</code> implementation class,
- * then a <code>LoginContext</code> will load the specified
- * <code>CallbackHandler</code> and pass it to the underlying LoginModules.
- * The <code>LoginContext</code> only loads the default handler
+ * {@code CallbackHandler} implementation class,
+ * then a {@code LoginContext} will load the specified
+ * {@code CallbackHandler} and pass it to the underlying LoginModules.
+ * The {@code LoginContext} only loads the default handler
* if it was not provided one.
*
* <p> All default handler implementations must provide a public
* zero-argument constructor.
*
+ * @see java.security.Security security properties
*/
public interface CallbackHandler {
@@ -74,15 +71,15 @@
* <p> Retrieve or display the information requested in the
* provided Callbacks.
*
- * <p> The <code>handle</code> method implementation checks the
- * instance(s) of the <code>Callback</code> object(s) passed in
+ * <p> The {@code handle} method implementation checks the
+ * instance(s) of the {@code Callback} object(s) passed in
* to retrieve or display the requested information.
* The following example is provided to help demonstrate what an
- * <code>handle</code> method implementation might look like.
+ * {@code handle} method implementation might look like.
* This example code is for guidance only. Many details,
* including proper error handling, are left out for simplicity.
*
- * <pre>
+ * <pre>{@code
* public void handle(Callback[] callbacks)
* throws IOException, UnsupportedCallbackException {
*
@@ -136,9 +133,9 @@
* private char[] readPassword(InputStream in) throws IOException {
* // insert code to read a user password from the input stream
* }
- * </pre>
+ * }</pre>
*
- * @param callbacks an array of <code>Callback</code> objects provided
+ * @param callbacks an array of {@code Callback} objects provided
* by an underlying security service which contains
* the information requested to be retrieved or displayed.
*
@@ -146,7 +143,7 @@
*
* @exception UnsupportedCallbackException if the implementation of this
* method does not support one or more of the Callbacks
- * specified in the <code>callbacks</code> parameter.
+ * specified in the {@code callbacks} parameter.
*/
void handle(Callback[] callbacks)
throws java.io.IOException, UnsupportedCallbackException;
diff --git a/ojluni/src/main/java/javax/security/auth/callback/PasswordCallback.java b/ojluni/src/main/java/javax/security/auth/callback/PasswordCallback.java
old mode 100755
new mode 100644
index d040740..0e8fb7b
--- a/ojluni/src/main/java/javax/security/auth/callback/PasswordCallback.java
+++ b/ojluni/src/main/java/javax/security/auth/callback/PasswordCallback.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -27,8 +27,8 @@
/**
* <p> Underlying security services instantiate and pass a
- * <code>PasswordCallback</code> to the <code>handle</code>
- * method of a <code>CallbackHandler</code> to retrieve password information.
+ * {@code PasswordCallback} to the {@code handle}
+ * method of a {@code CallbackHandler} to retrieve password information.
*
* @see javax.security.auth.callback.CallbackHandler
*/
@@ -53,7 +53,7 @@
private char[] inputPassword;
/**
- * Construct a <code>PasswordCallback</code> with a prompt
+ * Construct a {@code PasswordCallback} with a prompt
* and a boolean specifying whether the password should be displayed
* as it is being typed.
*
@@ -64,8 +64,8 @@
* @param echoOn true if the password should be displayed
* as it is being typed.
*
- * @exception IllegalArgumentException if <code>prompt</code> is null or
- * if <code>prompt</code> has a length of 0.
+ * @exception IllegalArgumentException if {@code prompt} is null or
+ * if {@code prompt} has a length of 0.
*/
public PasswordCallback(String prompt, boolean echoOn) {
if (prompt == null || prompt.length() == 0)
diff --git a/ojluni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java b/ojluni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java
old mode 100755
new mode 100644
index cb9b66b..0a9fa51
--- a/ojluni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java
+++ b/ojluni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2013, 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
@@ -26,8 +26,8 @@
package javax.security.auth.callback;
/**
- * Signals that a <code>CallbackHandler</code> does not
- * recognize a particular <code>Callback</code>.
+ * Signals that a {@code CallbackHandler} does not
+ * recognize a particular {@code Callback}.
*
*/
public class UnsupportedCallbackException extends Exception {
@@ -40,12 +40,12 @@
private Callback callback;
/**
- * Constructs a <code>UnsupportedCallbackException</code>
+ * Constructs a {@code UnsupportedCallbackException}
* with no detail message.
*
* <p>
*
- * @param callback the unrecognized <code>Callback</code>.
+ * @param callback the unrecognized {@code Callback}.
*/
public UnsupportedCallbackException(Callback callback) {
super();
@@ -59,7 +59,7 @@
*
* <p>
*
- * @param callback the unrecognized <code>Callback</code>. <p>
+ * @param callback the unrecognized {@code Callback}. <p>
*
* @param msg the detail message.
*/
@@ -69,11 +69,11 @@
}
/**
- * Get the unrecognized <code>Callback</code>.
+ * Get the unrecognized {@code Callback}.
*
* <p>
*
- * @return the unrecognized <code>Callback</code>.
+ * @return the unrecognized {@code Callback}.
*/
public Callback getCallback() {
return callback;
diff --git a/ojluni/src/main/java/javax/security/auth/callback/package-info.java b/ojluni/src/main/java/javax/security/auth/callback/package-info.java
new file mode 100644
index 0000000..4cd5daf
--- /dev/null
+++ b/ojluni/src/main/java/javax/security/auth/callback/package-info.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2000, 2013, 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.
+ */
+
+/**
+ * This package provides the classes necessary for services
+ * to interact with applications in order to retrieve
+ * information (authentication data including usernames
+ * or passwords, for example) or to display information
+ * (error and warning messages, for example).
+ *
+ * @since JDK1.4
+ */
+package javax.security.auth.callback;
diff --git a/ojluni/src/main/java/javax/security/auth/callback/package.html b/ojluni/src/main/java/javax/security/auth/callback/package.html
deleted file mode 100755
index 66d58e4..0000000
--- a/ojluni/src/main/java/javax/security/auth/callback/package.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, 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.
--->
-
-</head>
-<body bgcolor="white">
-
- This package provides the classes necessary for services
- to interact with applications in order to retrieve
- information (authentication data including usernames
- or passwords, for example) or to display information
- (error and warning messages, for example).
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
- <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
- <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
-
--->
-
-@since JDK1.4
-</body>
-</html>
diff --git a/ojluni/src/main/java/javax/security/auth/login/LoginException.java b/ojluni/src/main/java/javax/security/auth/login/LoginException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/auth/login/package-info.java b/ojluni/src/main/java/javax/security/auth/login/package-info.java
new file mode 100644
index 0000000..a0f7f68
--- /dev/null
+++ b/ojluni/src/main/java/javax/security/auth/login/package-info.java
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2000, 2013, 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.
+ */
+
+/**
+ * This package provides a pluggable authentication framework.
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/../technotes/guides/security/StandardNames.html">
+ * <b>Java™
+ * Cryptography Architecture Standard Algorithm Name
+ * Documentation</b></a></li>
+ * </ul>
+ *
+ * @since 1.4
+ */
+package javax.security.auth.login;
diff --git a/ojluni/src/main/java/javax/security/auth/login/package.html b/ojluni/src/main/java/javax/security/auth/login/package.html
deleted file mode 100755
index 6bf4b6d..0000000
--- a/ojluni/src/main/java/javax/security/auth/login/package.html
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, 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.
--->
-
-</head>
-<body bgcolor="white">
-
- This package provides a pluggable authentication framework.
-<h2>Package Specification</h2>
-
-<ul>
- <li><a href="{@docRoot}openjdk-redirect.html?v=8&path=/technotes/guides/security/StandardNames.html">
- <b>Java<FONT SIZE=-2><SUP>TM</SUP></FONT>
- Cryptography Architecture Standard Algorithm Name
- Documentation</b></a></li>
-</ul>
-
-<!--
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
- <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
-
--->
-
-@since 1.4
-</body>
-</html>
diff --git a/ojluni/src/main/java/javax/security/auth/x500/X500Principal.java b/ojluni/src/main/java/javax/security/auth/x500/X500Principal.java
old mode 100755
new mode 100644
index 5636856..77292b0
--- a/ojluni/src/main/java/javax/security/auth/x500/X500Principal.java
+++ b/ojluni/src/main/java/javax/security/auth/x500/X500Principal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -33,8 +33,8 @@
import sun.security.util.*;
/**
- * <p> This class represents an X.500 <code>Principal</code>.
- * <code>X500Principal</code>s are represented by distinguished names such as
+ * <p> This class represents an X.500 {@code Principal}.
+ * {@code X500Principal}s are represented by distinguished names such as
* "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US".
*
* <p> This class can be instantiated by using a string representation
@@ -50,12 +50,12 @@
* <a href="http://www.ietf.org/rfc/rfc3280.txt">RFC 3280: Internet X.509
* Public Key Infrastructure Certificate and CRL Profile</a>.
*
- * <p> The string representation for this <code>X500Principal</code>
- * can be obtained by calling the <code>getName</code> methods.
+ * <p> The string representation for this {@code X500Principal}
+ * can be obtained by calling the {@code getName} methods.
*
- * <p> Note that the <code>getSubjectX500Principal</code> and
- * <code>getIssuerX500Principal</code> methods of
- * <code>X509Certificate</code> return X500Principals representing the
+ * <p> Note that the {@code getSubjectX500Principal} and
+ * {@code getIssuerX500Principal} methods of
+ * {@code X509Certificate} return X500Principals representing the
* issuer and subject fields of the certificate.
*
* @see java.security.cert.X509Certificate
@@ -97,7 +97,7 @@
}
/**
- * Creates an <code>X500Principal</code> from a string representation of
+ * Creates an {@code X500Principal} from a string representation of
* an X.500 distinguished name (ex:
* "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US").
* The distinguished name must be specified using the grammar defined in
@@ -107,22 +107,29 @@
* defined in RFC 1779 and RFC 2253
* (and listed in {@link #getName(String format) getName(String format)}),
* as well as the T, DNQ or DNQUALIFIER, SURNAME, GIVENNAME, INITIALS,
- * GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose OIDs are
- * defined in RFC 3280 and its successor.
+ * GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose Object
+ * Identifiers (OIDs) are defined in RFC 3280 and its successor.
* Any other attribute type must be specified as an OID.
*
+ * <p>This implementation enforces a more restrictive OID syntax than
+ * defined in RFC 1779 and 2253. It uses the more correct syntax defined in
+ * <a href="http://www.ietf.org/rfc/rfc4512.txt">RFC 4512</a>, which
+ * specifies that OIDs contain at least 2 digits:
+ *
+ * <p>{@code numericoid = number 1*( DOT number ) }
+ *
* @param name an X.500 distinguished name in RFC 1779 or RFC 2253 format
- * @exception NullPointerException if the <code>name</code>
- * is <code>null</code>
- * @exception IllegalArgumentException if the <code>name</code>
+ * @exception NullPointerException if the {@code name}
+ * is {@code null}
+ * @exception IllegalArgumentException if the {@code name}
* is improperly specified
*/
public X500Principal(String name) {
- this(name, (Map<String, String>) Collections.EMPTY_MAP);
+ this(name, Collections.<String, String>emptyMap());
}
/**
- * Creates an <code>X500Principal</code> from a string representation of
+ * Creates an {@code X500Principal} from a string representation of
* an X.500 distinguished name (ex:
* "CN=Duke, OU=JavaSoft, O=Sun Microsystems, C=US").
* The distinguished name must be specified using the grammar defined in
@@ -130,24 +137,31 @@
*
* <p> This constructor recognizes the attribute type keywords specified
* in {@link #X500Principal(String)} and also recognizes additional
- * keywords that have entries in the <code>keywordMap</code> parameter.
+ * keywords that have entries in the {@code keywordMap} parameter.
* Keyword entries in the keywordMap take precedence over the default
- * keywords recognized by <code>X500Principal(String)</code>. Keywords
+ * keywords recognized by {@code X500Principal(String)}. Keywords
* MUST be specified in all upper-case, otherwise they will be ignored.
* Improperly specified keywords are ignored; however if a keyword in the
- * name maps to an improperly specified OID, an
- * <code>IllegalArgumentException</code> is thrown. It is permissible to
+ * name maps to an improperly specified Object Identifier (OID), an
+ * {@code IllegalArgumentException} is thrown. It is permissible to
* have 2 different keywords that map to the same OID.
*
+ * <p>This implementation enforces a more restrictive OID syntax than
+ * defined in RFC 1779 and 2253. It uses the more correct syntax defined in
+ * <a href="http://www.ietf.org/rfc/rfc4512.txt">RFC 4512</a>, which
+ * specifies that OIDs contain at least 2 digits:
+ *
+ * <p>{@code numericoid = number 1*( DOT number ) }
+ *
* @param name an X.500 distinguished name in RFC 1779 or RFC 2253 format
* @param keywordMap an attribute type keyword map, where each key is a
* keyword String that maps to a corresponding object identifier in String
* form (a sequence of nonnegative integers separated by periods). The map
- * may be empty but never <code>null</code>.
- * @exception NullPointerException if <code>name</code> or
- * <code>keywordMap</code> is <code>null</code>
- * @exception IllegalArgumentException if the <code>name</code> is
- * improperly specified or a keyword in the <code>name</code> maps to an
+ * may be empty but never {@code null}.
+ * @exception NullPointerException if {@code name} or
+ * {@code keywordMap} is {@code null}
+ * @exception IllegalArgumentException if the {@code name} is
+ * improperly specified or a keyword in the {@code name} maps to an
* OID that is not in the correct form
* @since 1.6
*/
@@ -174,10 +188,10 @@
}
/**
- * Creates an <code>X500Principal</code> from a distinguished name in
+ * Creates an {@code X500Principal} from a distinguished name in
* ASN.1 DER encoded form. The ASN.1 notation for this structure is as
* follows.
- * <pre><code>
+ * <pre>{@code
* Name ::= CHOICE {
* RDNSequence }
*
@@ -200,7 +214,7 @@
* universalString UniversalString (SIZE (1..MAX)),
* utf8String UTF8String (SIZE (1.. MAX)),
* bmpString BMPString (SIZE (1..MAX)) }
- * </code></pre>
+ * }</pre>
*
* @param name a byte array containing the distinguished name in ASN.1
* DER encoded form
@@ -219,7 +233,7 @@
}
/**
- * Creates an <code>X500Principal</code> from an <code>InputStream</code>
+ * Creates an {@code X500Principal} from an {@code InputStream}
* containing the distinguished name in ASN.1 DER encoded form.
* The ASN.1 notation for this structure is supplied in the
* documentation for
@@ -228,11 +242,11 @@
* <p> The read position of the input stream is positioned
* to the next available byte after the encoded distinguished name.
*
- * @param is an <code>InputStream</code> containing the distinguished
+ * @param is an {@code InputStream} containing the distinguished
* name in ASN.1 DER encoded form
*
- * @exception NullPointerException if the <code>InputStream</code>
- * is <code>null</code>
+ * @exception NullPointerException if the {@code InputStream}
+ * is {@code null}
* @exception IllegalArgumentException if an encoding error occurs
* (incorrect form for DN)
*/
@@ -270,9 +284,9 @@
* the format defined in RFC 2253.
*
* <p>This method is equivalent to calling
- * <code>getName(X500Principal.RFC2253)</code>.
+ * {@code getName(X500Principal.RFC2253)}.
*
- * @return the distinguished name of this <code>X500Principal</code>
+ * @return the distinguished name of this {@code X500Principal}
*/
public String getName() {
return getName(X500Principal.RFC2253);
@@ -300,7 +314,7 @@
* this method returns an RFC 2253 conformant string representation
* with the following additional canonicalizations:
*
- * <p><ol>
+ * <ol>
* <li> Leading zeros are removed from attribute types
* that are encoded as dotted decimal OIDs
* <li> DirectoryString attribute values of type
@@ -324,9 +338,9 @@
* those which section 2.4 of RFC 2253 states must be escaped
* (they are escaped using a preceding backslash character)
* <li> The entire name is converted to upper case
- * using <code>String.toUpperCase(Locale.US)</code>
+ * using {@code String.toUpperCase(Locale.US)}
* <li> The entire name is converted to lower case
- * using <code>String.toLowerCase(Locale.US)</code>
+ * using {@code String.toLowerCase(Locale.US)}
* <li> The name is finally normalized using normalization form KD,
* as described in the Unicode Standard and UAX #15
* </ol>
@@ -335,7 +349,7 @@
*
* @param format the format to use
*
- * @return a string representation of this <code>X500Principal</code>
+ * @return a string representation of this {@code X500Principal}
* using the specified format
* @throws IllegalArgumentException if the specified format is invalid
* or null
@@ -357,16 +371,16 @@
* Returns a string representation of the X.500 distinguished name
* using the specified format. Valid values for the format are
* "RFC1779" and "RFC2253" (case insensitive). "CANONICAL" is not
- * permitted and an <code>IllegalArgumentException</code> will be thrown.
+ * permitted and an {@code IllegalArgumentException} will be thrown.
*
* <p>This method returns Strings in the format as specified in
* {@link #getName(String)} and also emits additional attribute type
- * keywords for OIDs that have entries in the <code>oidMap</code>
+ * keywords for OIDs that have entries in the {@code oidMap}
* parameter. OID entries in the oidMap take precedence over the default
- * OIDs recognized by <code>getName(String)</code>.
+ * OIDs recognized by {@code getName(String)}.
* Improperly specified OIDs are ignored; however if an OID
* in the name maps to an improperly specified keyword, an
- * <code>IllegalArgumentException</code> is thrown.
+ * {@code IllegalArgumentException} is thrown.
*
* <p> Additional standard formats may be introduced in the future.
*
@@ -379,12 +393,12 @@
* @param oidMap an OID map, where each key is an object identifier in
* String form (a sequence of nonnegative integers separated by periods)
* that maps to a corresponding attribute type keyword String.
- * The map may be empty but never <code>null</code>.
- * @return a string representation of this <code>X500Principal</code>
+ * The map may be empty but never {@code null}.
+ * @return a string representation of this {@code X500Principal}
* using the specified format
* @throws IllegalArgumentException if the specified format is invalid,
* null, or an OID in the name maps to an improperly specified keyword
- * @throws NullPointerException if <code>oidMap</code> is <code>null</code>
+ * @throws NullPointerException if {@code oidMap} is {@code null}
* @since 1.6
*/
public String getName(String format, Map<String, String> oidMap) {
@@ -424,31 +438,31 @@
/**
* Return a user-friendly string representation of this
- * <code>X500Principal</code>.
+ * {@code X500Principal}.
*
- * @return a string representation of this <code>X500Principal</code>
+ * @return a string representation of this {@code X500Principal}
*/
public String toString() {
return thisX500Name.toString();
}
/**
- * Compares the specified <code>Object</code> with this
- * <code>X500Principal</code> for equality.
+ * Compares the specified {@code Object} with this
+ * {@code X500Principal} for equality.
*
- * <p> Specifically, this method returns <code>true</code> if
- * the <code>Object</code> <i>o</i> is an <code>X500Principal</code>
+ * <p> Specifically, this method returns {@code true} if
+ * the {@code Object} <i>o</i> is an {@code X500Principal}
* and if the respective canonical string representations
- * (obtained via the <code>getName(X500Principal.CANONICAL)</code> method)
+ * (obtained via the {@code getName(X500Principal.CANONICAL)} method)
* of this object and <i>o</i> are equal.
*
* <p> This implementation is compliant with the requirements of RFC 3280.
*
* @param o Object to be compared for equality with this
- * <code>X500Principal</code>
+ * {@code X500Principal}
*
- * @return <code>true</code> if the specified <code>Object</code> is equal
- * to this <code>X500Principal</code>, <code>false</code> otherwise
+ * @return {@code true} if the specified {@code Object} is equal
+ * to this {@code X500Principal}, {@code false} otherwise
*/
public boolean equals(Object o) {
if (this == o) {
@@ -462,12 +476,12 @@
}
/**
- * Return a hash code for this <code>X500Principal</code>.
+ * Return a hash code for this {@code X500Principal}.
*
* <p> The hash code is calculated via:
- * <code>getName(X500Principal.CANONICAL).hashCode()</code>
+ * {@code getName(X500Principal.CANONICAL).hashCode()}
*
- * @return a hash code for this <code>X500Principal</code>
+ * @return a hash code for this {@code X500Principal}
*/
public int hashCode() {
return thisX500Name.hashCode();
@@ -476,9 +490,9 @@
/**
* Save the X500Principal object to a stream.
*
- * @serialData this <code>X500Principal</code> is serialized
+ * @serialData this {@code X500Principal} is serialized
* by writing out its DER-encoded form
- * (the value of <code>getEncoded</code> is serialized).
+ * (the value of {@code getEncoded} is serialized).
*/
private void writeObject(java.io.ObjectOutputStream s)
throws IOException {
diff --git a/ojluni/src/main/java/javax/security/auth/x500/package-info.java b/ojluni/src/main/java/javax/security/auth/x500/package-info.java
new file mode 100644
index 0000000..12f8a53
--- /dev/null
+++ b/ojluni/src/main/java/javax/security/auth/x500/package-info.java
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2000, 2013, 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.
+ */
+
+/**
+ * This package contains the classes that should be used to store
+ * X500 Principal and X500 Private Credentials in a
+ * <i>Subject</i>.
+ *
+ * <h2>Package Specification</h2>
+ *
+ * <ul>
+ * <li><a href="http://www.ietf.org/rfc/rfc1779.txt">
+ * RFC 1779: A String Representation of Distinguished Names</a></li>
+ * <li><a href="http://www.ietf.org/rfc/rfc2253.txt">
+ * RFC 2253: Lightweight Directory Access Protocol (v3):
+ * UTF-8 String Representation of Distinguished Names</a></li>
+ * <li><a href="http://www.ietf.org/rfc/rfc3280.txt">
+ * RFC 3280: Internet X.509 Public Key Infrastructure
+ * Certificate and Certificate Revocation List (CRL) Profile</a></li>
+ * <li><a href="http://www.ietf.org/rfc/rfc4512.txt">
+ * RFC 4512: Lightweight Directory Access Protocol (LDAP):
+ * Directory Information Models</a></li>
+ * </ul>
+ *
+ * @since JDK1.4
+ */
+package javax.security.auth.x500;
diff --git a/ojluni/src/main/java/javax/security/auth/x500/package.html b/ojluni/src/main/java/javax/security/auth/x500/package.html
deleted file mode 100755
index 508380f..0000000
--- a/ojluni/src/main/java/javax/security/auth/x500/package.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<!--
-Copyright (c) 2000, 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.
--->
-
-</head>
-<body bgcolor="white">
-
- This package contains the classes that should be used to store
- X500 Principal and X500 Private Crendentials in a
- <i>Subject</i>.
-
-<!--
-<h2>Package Specification</h2>
-
-##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
-<ul>
- <li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
-</ul>
-
-<h2>Related Documentation</h2>
-
-For overviews, tutorials, examples, guides, and tool documentation, please see:
-<ul>
- <li><a href="">##### REFER TO NON-SPEC DOCUMENTATION HERE #####</a>
-</ul>
-
--->
-
-@since JDK1.4
-</body>
-</html>
diff --git a/ojluni/src/main/java/javax/security/cert/Certificate.java b/ojluni/src/main/java/javax/security/cert/Certificate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/cert/CertificateEncodingException.java b/ojluni/src/main/java/javax/security/cert/CertificateEncodingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/cert/CertificateException.java b/ojluni/src/main/java/javax/security/cert/CertificateException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/cert/CertificateExpiredException.java b/ojluni/src/main/java/javax/security/cert/CertificateExpiredException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/cert/CertificateNotYetValidException.java b/ojluni/src/main/java/javax/security/cert/CertificateNotYetValidException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/cert/CertificateParsingException.java b/ojluni/src/main/java/javax/security/cert/CertificateParsingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/security/cert/X509Certificate.java b/ojluni/src/main/java/javax/security/cert/X509Certificate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/CommonDataSource.java b/ojluni/src/main/java/javax/sql/CommonDataSource.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/ConnectionEvent.java b/ojluni/src/main/java/javax/sql/ConnectionEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/ConnectionEventListener.java b/ojluni/src/main/java/javax/sql/ConnectionEventListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/ConnectionPoolDataSource.java b/ojluni/src/main/java/javax/sql/ConnectionPoolDataSource.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/DataSource.java b/ojluni/src/main/java/javax/sql/DataSource.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/PooledConnection.java b/ojluni/src/main/java/javax/sql/PooledConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/RowSet.java b/ojluni/src/main/java/javax/sql/RowSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/RowSetEvent.java b/ojluni/src/main/java/javax/sql/RowSetEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/RowSetInternal.java b/ojluni/src/main/java/javax/sql/RowSetInternal.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/RowSetListener.java b/ojluni/src/main/java/javax/sql/RowSetListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/RowSetMetaData.java b/ojluni/src/main/java/javax/sql/RowSetMetaData.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/RowSetReader.java b/ojluni/src/main/java/javax/sql/RowSetReader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/RowSetWriter.java b/ojluni/src/main/java/javax/sql/RowSetWriter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/StatementEvent.java b/ojluni/src/main/java/javax/sql/StatementEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/javax/sql/StatementEventListener.java b/ojluni/src/main/java/javax/sql/StatementEventListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/ASCIICaseInsensitiveComparator.java b/ojluni/src/main/java/sun/misc/ASCIICaseInsensitiveComparator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/BASE64Decoder.java b/ojluni/src/main/java/sun/misc/BASE64Decoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/BASE64Encoder.java b/ojluni/src/main/java/sun/misc/BASE64Encoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/CEFormatException.java b/ojluni/src/main/java/sun/misc/CEFormatException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/CEStreamExhausted.java b/ojluni/src/main/java/sun/misc/CEStreamExhausted.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/CharacterDecoder.java b/ojluni/src/main/java/sun/misc/CharacterDecoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/CharacterEncoder.java b/ojluni/src/main/java/sun/misc/CharacterEncoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/Cleaner.java b/ojluni/src/main/java/sun/misc/Cleaner.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/CompoundEnumeration.java b/ojluni/src/main/java/sun/misc/CompoundEnumeration.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/DoubleConsts.java b/ojluni/src/main/java/sun/misc/DoubleConsts.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/FileURLMapper.java b/ojluni/src/main/java/sun/misc/FileURLMapper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/FloatConsts.java b/ojluni/src/main/java/sun/misc/FloatConsts.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/FpUtils.java b/ojluni/src/main/java/sun/misc/FpUtils.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/Hashing.java b/ojluni/src/main/java/sun/misc/Hashing.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/HexDumpEncoder.java b/ojluni/src/main/java/sun/misc/HexDumpEncoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/IOUtils.java b/ojluni/src/main/java/sun/misc/IOUtils.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/InvalidJarIndexException.java b/ojluni/src/main/java/sun/misc/InvalidJarIndexException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/IoTrace.java b/ojluni/src/main/java/sun/misc/IoTrace.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/JarIndex.java b/ojluni/src/main/java/sun/misc/JarIndex.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/JavaSecurityProtectionDomainAccess.java b/ojluni/src/main/java/sun/misc/JavaSecurityProtectionDomainAccess.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/LRUCache.java b/ojluni/src/main/java/sun/misc/LRUCache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/MessageUtils.java b/ojluni/src/main/java/sun/misc/MessageUtils.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/MetaIndex.java b/ojluni/src/main/java/sun/misc/MetaIndex.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/REException.java b/ojluni/src/main/java/sun/misc/REException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/RegexpPool.java b/ojluni/src/main/java/sun/misc/RegexpPool.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/RegexpTarget.java b/ojluni/src/main/java/sun/misc/RegexpTarget.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/Resource.java b/ojluni/src/main/java/sun/misc/Resource.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/Service.java b/ojluni/src/main/java/sun/misc/Service.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/ServiceConfigurationError.java b/ojluni/src/main/java/sun/misc/ServiceConfigurationError.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/SoftCache.java b/ojluni/src/main/java/sun/misc/SoftCache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/URLClassPath.java b/ojluni/src/main/java/sun/misc/URLClassPath.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/misc/VM.java b/ojluni/src/main/java/sun/misc/VM.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ApplicationProxy.java b/ojluni/src/main/java/sun/net/ApplicationProxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ConnectionResetException.java b/ojluni/src/main/java/sun/net/ConnectionResetException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/InetAddressCachePolicy.java b/ojluni/src/main/java/sun/net/InetAddressCachePolicy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/NetHooks.java b/ojluni/src/main/java/sun/net/NetHooks.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/NetProperties.java b/ojluni/src/main/java/sun/net/NetProperties.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/NetworkClient.java b/ojluni/src/main/java/sun/net/NetworkClient.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ProgressEvent.java b/ojluni/src/main/java/sun/net/ProgressEvent.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ProgressListener.java b/ojluni/src/main/java/sun/net/ProgressListener.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ProgressMeteringPolicy.java b/ojluni/src/main/java/sun/net/ProgressMeteringPolicy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ProgressMonitor.java b/ojluni/src/main/java/sun/net/ProgressMonitor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ProgressSource.java b/ojluni/src/main/java/sun/net/ProgressSource.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/RegisteredDomain.java b/ojluni/src/main/java/sun/net/RegisteredDomain.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ResourceManager.java b/ojluni/src/main/java/sun/net/ResourceManager.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/SocksProxy.java b/ojluni/src/main/java/sun/net/SocksProxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/TelnetInputStream.java b/ojluni/src/main/java/sun/net/TelnetInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/TelnetOutputStream.java b/ojluni/src/main/java/sun/net/TelnetOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/TelnetProtocolException.java b/ojluni/src/main/java/sun/net/TelnetProtocolException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/TransferProtocolClient.java b/ojluni/src/main/java/sun/net/TransferProtocolClient.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/FtpClient.java b/ojluni/src/main/java/sun/net/ftp/FtpClient.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/FtpClientProvider.java b/ojluni/src/main/java/sun/net/ftp/FtpClientProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/FtpDirEntry.java b/ojluni/src/main/java/sun/net/ftp/FtpDirEntry.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/FtpDirParser.java b/ojluni/src/main/java/sun/net/ftp/FtpDirParser.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/FtpLoginException.java b/ojluni/src/main/java/sun/net/ftp/FtpLoginException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/FtpProtocolException.java b/ojluni/src/main/java/sun/net/ftp/FtpProtocolException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/FtpReplyCode.java b/ojluni/src/main/java/sun/net/ftp/FtpReplyCode.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/impl/DefaultFtpClientProvider.java b/ojluni/src/main/java/sun/net/ftp/impl/DefaultFtpClientProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/ftp/impl/FtpClient.java b/ojluni/src/main/java/sun/net/ftp/impl/FtpClient.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/smtp/SmtpClient.java b/ojluni/src/main/java/sun/net/smtp/SmtpClient.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/smtp/SmtpProtocolException.java b/ojluni/src/main/java/sun/net/smtp/SmtpProtocolException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/spi/DefaultProxySelector.java b/ojluni/src/main/java/sun/net/spi/DefaultProxySelector.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/spi/nameservice/NameService.java b/ojluni/src/main/java/sun/net/spi/nameservice/NameService.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/spi/nameservice/NameServiceDescriptor.java b/ojluni/src/main/java/sun/net/spi/nameservice/NameServiceDescriptor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/util/IPAddressUtil.java b/ojluni/src/main/java/sun/net/util/IPAddressUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/util/URLUtil.java b/ojluni/src/main/java/sun/net/util/URLUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/HeaderParser.java b/ojluni/src/main/java/sun/net/www/HeaderParser.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/MessageHeader.java b/ojluni/src/main/java/sun/net/www/MessageHeader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/MeteredStream.java b/ojluni/src/main/java/sun/net/www/MeteredStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/ParseUtil.java b/ojluni/src/main/java/sun/net/www/ParseUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/URLConnection.java b/ojluni/src/main/java/sun/net/www/URLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/ChunkedInputStream.java b/ojluni/src/main/java/sun/net/www/http/ChunkedInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/ChunkedOutputStream.java b/ojluni/src/main/java/sun/net/www/http/ChunkedOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/HttpCapture.java b/ojluni/src/main/java/sun/net/www/http/HttpCapture.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/HttpCaptureInputStream.java b/ojluni/src/main/java/sun/net/www/http/HttpCaptureInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/HttpCaptureOutputStream.java b/ojluni/src/main/java/sun/net/www/http/HttpCaptureOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/HttpClient.java b/ojluni/src/main/java/sun/net/www/http/HttpClient.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/Hurryable.java b/ojluni/src/main/java/sun/net/www/http/Hurryable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/KeepAliveCache.java b/ojluni/src/main/java/sun/net/www/http/KeepAliveCache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/KeepAliveStream.java b/ojluni/src/main/java/sun/net/www/http/KeepAliveStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/KeepAliveStreamCleaner.java b/ojluni/src/main/java/sun/net/www/http/KeepAliveStreamCleaner.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/http/PosterOutputStream.java b/ojluni/src/main/java/sun/net/www/http/PosterOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/file/FileURLConnection.java b/ojluni/src/main/java/sun/net/www/protocol/file/FileURLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/file/Handler.java b/ojluni/src/main/java/sun/net/www/protocol/file/Handler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java b/ojluni/src/main/java/sun/net/www/protocol/ftp/FtpURLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/ftp/Handler.java b/ojluni/src/main/java/sun/net/www/protocol/ftp/Handler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/AuthCache.java b/ojluni/src/main/java/sun/net/www/protocol/http/AuthCache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/AuthCacheImpl.java b/ojluni/src/main/java/sun/net/www/protocol/http/AuthCacheImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/AuthCacheValue.java b/ojluni/src/main/java/sun/net/www/protocol/http/AuthCacheValue.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/AuthScheme.java b/ojluni/src/main/java/sun/net/www/protocol/http/AuthScheme.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/AuthenticationHeader.java b/ojluni/src/main/java/sun/net/www/protocol/http/AuthenticationHeader.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/AuthenticationInfo.java b/ojluni/src/main/java/sun/net/www/protocol/http/AuthenticationInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/BasicAuthentication.java b/ojluni/src/main/java/sun/net/www/protocol/http/BasicAuthentication.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/DigestAuthentication.java b/ojluni/src/main/java/sun/net/www/protocol/http/DigestAuthentication.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/Handler.java b/ojluni/src/main/java/sun/net/www/protocol/http/Handler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/HttpAuthenticator.java b/ojluni/src/main/java/sun/net/www/protocol/http/HttpAuthenticator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/HttpCallerInfo.java b/ojluni/src/main/java/sun/net/www/protocol/http/HttpCallerInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/HttpURLConnection.java b/ojluni/src/main/java/sun/net/www/protocol/http/HttpURLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/NTLMAuthenticationProxy.java b/ojluni/src/main/java/sun/net/www/protocol/http/NTLMAuthenticationProxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/NegotiateAuthentication.java b/ojluni/src/main/java/sun/net/www/protocol/http/NegotiateAuthentication.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/http/Negotiator.java b/ojluni/src/main/java/sun/net/www/protocol/http/Negotiator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/jar/Handler.java b/ojluni/src/main/java/sun/net/www/protocol/jar/Handler.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/jar/JarFileFactory.java b/ojluni/src/main/java/sun/net/www/protocol/jar/JarFileFactory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/jar/JarURLConnection.java b/ojluni/src/main/java/sun/net/www/protocol/jar/JarURLConnection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/jar/URLJarFile.java b/ojluni/src/main/java/sun/net/www/protocol/jar/URLJarFile.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/net/www/protocol/jar/URLJarFileCallBack.java b/ojluni/src/main/java/sun/net/www/protocol/jar/URLJarFileCallBack.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ByteBuffered.java b/ojluni/src/main/java/sun/nio/ByteBuffered.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/AbstractPollArrayWrapper.java b/ojluni/src/main/java/sun/nio/ch/AbstractPollArrayWrapper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/AbstractPollSelectorImpl.java b/ojluni/src/main/java/sun/nio/ch/AbstractPollSelectorImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/AllocatedNativeObject.java b/ojluni/src/main/java/sun/nio/ch/AllocatedNativeObject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/AsynchronousChannelGroupImpl.java b/ojluni/src/main/java/sun/nio/ch/AsynchronousChannelGroupImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/AsynchronousServerSocketChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/AsynchronousServerSocketChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/AsynchronousSocketChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/AsynchronousSocketChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/BsdAsynchronousChannelProvider.java b/ojluni/src/main/java/sun/nio/ch/BsdAsynchronousChannelProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Cancellable.java b/ojluni/src/main/java/sun/nio/ch/Cancellable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/ChannelInputStream.java b/ojluni/src/main/java/sun/nio/ch/ChannelInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/CompletedFuture.java b/ojluni/src/main/java/sun/nio/ch/CompletedFuture.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/DatagramChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/DatagramChannelImpl.java
old mode 100755
new mode 100644
index c93e82d..3e06fd0
--- a/ojluni/src/main/java/sun/nio/ch/DatagramChannelImpl.java
+++ b/ojluni/src/main/java/sun/nio/ch/DatagramChannelImpl.java
@@ -780,7 +780,7 @@
}
do {
tmpBuf.clear();
- } while (read(tmpBuf) > 0);
+ } while (receive(tmpBuf) != null);
} finally {
if (blocking) {
configureBlocking(true);
diff --git a/ojluni/src/main/java/sun/nio/ch/DatagramDispatcher.java b/ojluni/src/main/java/sun/nio/ch/DatagramDispatcher.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/DatagramSocketAdaptor.java b/ojluni/src/main/java/sun/nio/ch/DatagramSocketAdaptor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/DefaultAsynchronousChannelProvider.java b/ojluni/src/main/java/sun/nio/ch/DefaultAsynchronousChannelProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/DefaultSelectorProvider.java b/ojluni/src/main/java/sun/nio/ch/DefaultSelectorProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/DirectBuffer.java b/ojluni/src/main/java/sun/nio/ch/DirectBuffer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/EPoll.java b/ojluni/src/main/java/sun/nio/ch/EPoll.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/EPollArrayWrapper.java b/ojluni/src/main/java/sun/nio/ch/EPollArrayWrapper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/EPollPort.java b/ojluni/src/main/java/sun/nio/ch/EPollPort.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/EPollSelectorImpl.java b/ojluni/src/main/java/sun/nio/ch/EPollSelectorImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/EPollSelectorProvider.java b/ojluni/src/main/java/sun/nio/ch/EPollSelectorProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/ExtendedSocketOption.java b/ojluni/src/main/java/sun/nio/ch/ExtendedSocketOption.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/FileChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/FileDispatcher.java b/ojluni/src/main/java/sun/nio/ch/FileDispatcher.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/FileDispatcherImpl.java b/ojluni/src/main/java/sun/nio/ch/FileDispatcherImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/FileKey.java b/ojluni/src/main/java/sun/nio/ch/FileKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/FileLockImpl.java b/ojluni/src/main/java/sun/nio/ch/FileLockImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/FileLockTable.java b/ojluni/src/main/java/sun/nio/ch/FileLockTable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Groupable.java b/ojluni/src/main/java/sun/nio/ch/Groupable.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/IOStatus.java b/ojluni/src/main/java/sun/nio/ch/IOStatus.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/IOUtil.java b/ojluni/src/main/java/sun/nio/ch/IOUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/IOVecWrapper.java b/ojluni/src/main/java/sun/nio/ch/IOVecWrapper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/InheritedChannel.java b/ojluni/src/main/java/sun/nio/ch/InheritedChannel.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Interruptible.java b/ojluni/src/main/java/sun/nio/ch/Interruptible.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Invoker.java b/ojluni/src/main/java/sun/nio/ch/Invoker.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/KQueue.java b/ojluni/src/main/java/sun/nio/ch/KQueue.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/KQueuePort.java b/ojluni/src/main/java/sun/nio/ch/KQueuePort.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/LinuxAsynchronousChannelProvider.java b/ojluni/src/main/java/sun/nio/ch/LinuxAsynchronousChannelProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/MembershipKeyImpl.java b/ojluni/src/main/java/sun/nio/ch/MembershipKeyImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/MembershipRegistry.java b/ojluni/src/main/java/sun/nio/ch/MembershipRegistry.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/NativeDispatcher.java b/ojluni/src/main/java/sun/nio/ch/NativeDispatcher.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/NativeObject.java b/ojluni/src/main/java/sun/nio/ch/NativeObject.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/NativeThread.java b/ojluni/src/main/java/sun/nio/ch/NativeThread.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/NativeThreadSet.java b/ojluni/src/main/java/sun/nio/ch/NativeThreadSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Net.java b/ojluni/src/main/java/sun/nio/ch/Net.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/OptionKey.java b/ojluni/src/main/java/sun/nio/ch/OptionKey.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/PendingFuture.java b/ojluni/src/main/java/sun/nio/ch/PendingFuture.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/PipeImpl.java b/ojluni/src/main/java/sun/nio/ch/PipeImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/PollArrayWrapper.java b/ojluni/src/main/java/sun/nio/ch/PollArrayWrapper.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/PollSelectorImpl.java b/ojluni/src/main/java/sun/nio/ch/PollSelectorImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/PollSelectorProvider.java b/ojluni/src/main/java/sun/nio/ch/PollSelectorProvider.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Port.java b/ojluni/src/main/java/sun/nio/ch/Port.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Reflect.java b/ojluni/src/main/java/sun/nio/ch/Reflect.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SelChImpl.java b/ojluni/src/main/java/sun/nio/ch/SelChImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SelectionKeyImpl.java b/ojluni/src/main/java/sun/nio/ch/SelectionKeyImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SelectorImpl.java b/ojluni/src/main/java/sun/nio/ch/SelectorImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SelectorProviderImpl.java b/ojluni/src/main/java/sun/nio/ch/SelectorProviderImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/ServerSocketAdaptor.java b/ojluni/src/main/java/sun/nio/ch/ServerSocketAdaptor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/ServerSocketChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/ServerSocketChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SinkChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/SinkChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SocketAdaptor.java b/ojluni/src/main/java/sun/nio/ch/SocketAdaptor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SocketChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/SocketChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SocketDispatcher.java b/ojluni/src/main/java/sun/nio/ch/SocketDispatcher.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/SourceChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/SourceChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/ThreadPool.java b/ojluni/src/main/java/sun/nio/ch/ThreadPool.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/UnixAsynchronousServerSocketChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java b/ojluni/src/main/java/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/ch/Util.java b/ojluni/src/main/java/sun/nio/ch/Util.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/cs/ArrayDecoder.java b/ojluni/src/main/java/sun/nio/cs/ArrayDecoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/cs/ArrayEncoder.java b/ojluni/src/main/java/sun/nio/cs/ArrayEncoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/cs/HistoricallyNamedCharset.java b/ojluni/src/main/java/sun/nio/cs/HistoricallyNamedCharset.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/cs/StreamDecoder.java b/ojluni/src/main/java/sun/nio/cs/StreamDecoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/cs/StreamEncoder.java b/ojluni/src/main/java/sun/nio/cs/StreamEncoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/nio/cs/ThreadLocalCoders.java b/ojluni/src/main/java/sun/nio/cs/ThreadLocalCoders.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/reflect/CallerSensitive.java b/ojluni/src/main/java/sun/reflect/CallerSensitive.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/reflect/ConstructorAccessor.java b/ojluni/src/main/java/sun/reflect/ConstructorAccessor.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/reflect/Reflection.java b/ojluni/src/main/java/sun/reflect/Reflection.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/reflect/annotation/AnnotationType.java b/ojluni/src/main/java/sun/reflect/annotation/AnnotationType.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/reflect/misc/ReflectUtil.java b/ojluni/src/main/java/sun/reflect/misc/ReflectUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/action/GetBooleanAction.java b/ojluni/src/main/java/sun/security/action/GetBooleanAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/action/GetIntegerAction.java b/ojluni/src/main/java/sun/security/action/GetIntegerAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/action/GetPropertyAction.java b/ojluni/src/main/java/sun/security/action/GetPropertyAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/action/LoadLibraryAction.java b/ojluni/src/main/java/sun/security/action/LoadLibraryAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/action/PutAllAction.java b/ojluni/src/main/java/sun/security/action/PutAllAction.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/ec/ECKeyFactory.java b/ojluni/src/main/java/sun/security/ec/ECKeyFactory.java
deleted file mode 100755
index e5197e1c..0000000
--- a/ojluni/src/main/java/sun/security/ec/ECKeyFactory.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- * Copyright (c) 2006, 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.
- */
-
-package sun.security.ec;
-
-import java.security.*;
-import java.security.interfaces.*;
-import java.security.spec.*;
-
-/**
- * KeyFactory for EC keys. Keys must be instances of PublicKey or PrivateKey
- * and getAlgorithm() must return "EC". For such keys, it supports conversion
- * between the following:
- *
- * For public keys:
- * . PublicKey with an X.509 encoding
- * . ECPublicKey
- * . ECPublicKeySpec
- * . X509EncodedKeySpec
- *
- * For private keys:
- * . PrivateKey with a PKCS#8 encoding
- * . ECPrivateKey
- * . ECPrivateKeySpec
- * . PKCS8EncodedKeySpec
- *
- * @since 1.6
- * @author Andreas Sterbenz
- */
-public final class ECKeyFactory extends KeyFactorySpi {
-
- // Used by translateKey() and the SunPKCS11 provider
- public final static KeyFactory INSTANCE;
-
- // Internal provider object we can obtain the KeyFactory and
- // AlgorithmParameters from. Used by ECParameters and AlgorithmId.
- // This can go away once we have EC always available in the SUN provider.
- // Used by ECParameters and AlgorithmId.
- public final static Provider ecInternalProvider;
-
- static {
- final Provider p = new Provider("SunEC-Internal", 1.0d, null) {};
- AccessController.doPrivileged(new PrivilegedAction<Void>() {
- public Void run() {
- // Android changed : replace string reference with class name. It
- // makes no difference in this case since these classes are already
- // in direct use here.
- p.put("KeyFactory.EC", ECKeyFactory.class.getName());
- p.put("AlgorithmParameters.EC", ECParameters.class.getName());
- p.put("Alg.Alias.AlgorithmParameters.1.2.840.10045.2.1", "EC");
- return null;
- }
- });
- try {
- INSTANCE = KeyFactory.getInstance("EC", p);
- } catch (NoSuchAlgorithmException e) {
- throw new RuntimeException(e);
- }
- ecInternalProvider = p;
- }
-
- public ECKeyFactory() {
- // empty
- }
-
- /**
- * Static method to convert Key into a useable instance of
- * ECPublicKey or ECPrivateKey. Check the key and convert it
- * to a Sun key if necessary. If the key is not an EC key
- * or cannot be used, throw an InvalidKeyException.
- *
- * The difference between this method and engineTranslateKey() is that
- * we do not convert keys of other providers that are already an
- * instance of ECPublicKey or ECPrivateKey.
- *
- * To be used by future Java ECDSA and ECDH implementations.
- */
- public static ECKey toECKey(Key key) throws InvalidKeyException {
- if (key instanceof ECKey) {
- ECKey ecKey = (ECKey)key;
- checkKey(ecKey);
- return ecKey;
- } else {
- return (ECKey)INSTANCE.translateKey(key);
- }
- }
-
- /**
- * Check that the given EC key is valid.
- */
- private static void checkKey(ECKey key) throws InvalidKeyException {
- // check for subinterfaces, omit additional checks for our keys
- if (key instanceof ECPublicKey) {
- if (key instanceof ECPublicKeyImpl) {
- return;
- }
- } else if (key instanceof ECPrivateKey) {
- if (key instanceof ECPrivateKeyImpl) {
- return;
- }
- } else {
- throw new InvalidKeyException("Neither a public nor a private key");
- }
- // ECKey does not extend Key, so we need to do a cast
- String keyAlg = ((Key)key).getAlgorithm();
- if (keyAlg.equals("EC") == false) {
- throw new InvalidKeyException("Not an EC key: " + keyAlg);
- }
- // XXX further sanity checks about whether this key uses supported
- // fields, point formats, etc. would go here
- }
-
- /**
- * Translate an EC key into a Sun EC key. If conversion is
- * not possible, throw an InvalidKeyException.
- * See also JCA doc.
- */
- protected Key engineTranslateKey(Key key) throws InvalidKeyException {
- if (key == null) {
- throw new InvalidKeyException("Key must not be null");
- }
- String keyAlg = key.getAlgorithm();
- if (keyAlg.equals("EC") == false) {
- throw new InvalidKeyException("Not an EC key: " + keyAlg);
- }
- if (key instanceof PublicKey) {
- return implTranslatePublicKey((PublicKey)key);
- } else if (key instanceof PrivateKey) {
- return implTranslatePrivateKey((PrivateKey)key);
- } else {
- throw new InvalidKeyException("Neither a public nor a private key");
- }
- }
-
- // see JCA doc
- protected PublicKey engineGeneratePublic(KeySpec keySpec)
- throws InvalidKeySpecException {
- try {
- return implGeneratePublic(keySpec);
- } catch (InvalidKeySpecException e) {
- throw e;
- } catch (GeneralSecurityException e) {
- throw new InvalidKeySpecException(e);
- }
- }
-
- // see JCA doc
- protected PrivateKey engineGeneratePrivate(KeySpec keySpec)
- throws InvalidKeySpecException {
- try {
- return implGeneratePrivate(keySpec);
- } catch (InvalidKeySpecException e) {
- throw e;
- } catch (GeneralSecurityException e) {
- throw new InvalidKeySpecException(e);
- }
- }
-
- // internal implementation of translateKey() for public keys. See JCA doc
- private PublicKey implTranslatePublicKey(PublicKey key)
- throws InvalidKeyException {
- if (key instanceof ECPublicKey) {
- if (key instanceof ECPublicKeyImpl) {
- return key;
- }
- ECPublicKey ecKey = (ECPublicKey)key;
- return new ECPublicKeyImpl(
- ecKey.getW(),
- ecKey.getParams()
- );
- } else if ("X.509".equals(key.getFormat())) {
- byte[] encoded = key.getEncoded();
- return new ECPublicKeyImpl(encoded);
- } else {
- throw new InvalidKeyException("Public keys must be instance "
- + "of ECPublicKey or have X.509 encoding");
- }
- }
-
- // internal implementation of translateKey() for private keys. See JCA doc
- private PrivateKey implTranslatePrivateKey(PrivateKey key)
- throws InvalidKeyException {
- if (key instanceof ECPrivateKey) {
- if (key instanceof ECPrivateKeyImpl) {
- return key;
- }
- ECPrivateKey ecKey = (ECPrivateKey)key;
- return new ECPrivateKeyImpl(
- ecKey.getS(),
- ecKey.getParams()
- );
- } else if ("PKCS#8".equals(key.getFormat())) {
- return new ECPrivateKeyImpl(key.getEncoded());
- } else {
- throw new InvalidKeyException("Private keys must be instance "
- + "of ECPrivateKey or have PKCS#8 encoding");
- }
- }
-
- // internal implementation of generatePublic. See JCA doc
- private PublicKey implGeneratePublic(KeySpec keySpec)
- throws GeneralSecurityException {
- if (keySpec instanceof X509EncodedKeySpec) {
- X509EncodedKeySpec x509Spec = (X509EncodedKeySpec)keySpec;
- return new ECPublicKeyImpl(x509Spec.getEncoded());
- } else if (keySpec instanceof ECPublicKeySpec) {
- ECPublicKeySpec ecSpec = (ECPublicKeySpec)keySpec;
- return new ECPublicKeyImpl(
- ecSpec.getW(),
- ecSpec.getParams()
- );
- } else {
- throw new InvalidKeySpecException("Only ECPublicKeySpec "
- + "and X509EncodedKeySpec supported for EC public keys");
- }
- }
-
- // internal implementation of generatePrivate. See JCA doc
- private PrivateKey implGeneratePrivate(KeySpec keySpec)
- throws GeneralSecurityException {
- if (keySpec instanceof PKCS8EncodedKeySpec) {
- PKCS8EncodedKeySpec pkcsSpec = (PKCS8EncodedKeySpec)keySpec;
- return new ECPrivateKeyImpl(pkcsSpec.getEncoded());
- } else if (keySpec instanceof ECPrivateKeySpec) {
- ECPrivateKeySpec ecSpec = (ECPrivateKeySpec)keySpec;
- return new ECPrivateKeyImpl(ecSpec.getS(), ecSpec.getParams());
- } else {
- throw new InvalidKeySpecException("Only ECPrivateKeySpec "
- + "and PKCS8EncodedKeySpec supported for EC private keys");
- }
- }
-
- protected <T extends KeySpec> T engineGetKeySpec(Key key, Class<T> keySpec)
- throws InvalidKeySpecException {
- try {
- // convert key to one of our keys
- // this also verifies that the key is a valid EC key and ensures
- // that the encoding is X.509/PKCS#8 for public/private keys
- key = engineTranslateKey(key);
- } catch (InvalidKeyException e) {
- throw new InvalidKeySpecException(e);
- }
- if (key instanceof ECPublicKey) {
- ECPublicKey ecKey = (ECPublicKey)key;
- if (ECPublicKeySpec.class.isAssignableFrom(keySpec)) {
- return (T) new ECPublicKeySpec(
- ecKey.getW(),
- ecKey.getParams()
- );
- } else if (X509EncodedKeySpec.class.isAssignableFrom(keySpec)) {
- return (T) new X509EncodedKeySpec(key.getEncoded());
- } else {
- throw new InvalidKeySpecException
- ("KeySpec must be ECPublicKeySpec or "
- + "X509EncodedKeySpec for EC public keys");
- }
- } else if (key instanceof ECPrivateKey) {
- if (PKCS8EncodedKeySpec.class.isAssignableFrom(keySpec)) {
- return (T) new PKCS8EncodedKeySpec(key.getEncoded());
- } else if (ECPrivateKeySpec.class.isAssignableFrom(keySpec)) {
- ECPrivateKey ecKey = (ECPrivateKey)key;
- return (T) new ECPrivateKeySpec(
- ecKey.getS(),
- ecKey.getParams()
- );
- } else {
- throw new InvalidKeySpecException
- ("KeySpec must be ECPrivateKeySpec or "
- + "PKCS8EncodedKeySpec for EC private keys");
- }
- } else {
- // should not occur, caught in engineTranslateKey()
- throw new InvalidKeySpecException("Neither public nor private key");
- }
- }
-}
diff --git a/ojluni/src/main/java/sun/security/ec/ECParameters.java b/ojluni/src/main/java/sun/security/ec/ECParameters.java
deleted file mode 100755
index cf66984..0000000
--- a/ojluni/src/main/java/sun/security/ec/ECParameters.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*
- * Copyright (c) 2006, 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.
- */
-
-package sun.security.ec;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-import java.security.*;
-import java.security.spec.*;
-
-import sun.security.util.*;
-
-/**
- * This class implements encoding and decoding of Elliptic Curve parameters
- * as specified in RFC 3279.
- *
- * However, only named curves are currently supported.
- *
- * ASN.1 from RFC 3279 follows. Note that X9.62 (2005) has added some additional
- * options.
- *
- * <pre>
- * EcpkParameters ::= CHOICE {
- * ecParameters ECParameters,
- * namedCurve OBJECT IDENTIFIER,
- * implicitlyCA NULL }
- *
- * ECParameters ::= SEQUENCE {
- * version ECPVer, -- version is always 1
- * fieldID FieldID, -- identifies the finite field over
- * -- which the curve is defined
- * curve Curve, -- coefficients a and b of the
- * -- elliptic curve
- * base ECPoint, -- specifies the base point P
- * -- on the elliptic curve
- * order INTEGER, -- the order n of the base point
- * cofactor INTEGER OPTIONAL -- The integer h = #E(Fq)/n
- * }
- *
- * ECPVer ::= INTEGER {ecpVer1(1)}
- *
- * Curve ::= SEQUENCE {
- * a FieldElement,
- * b FieldElement,
- * seed BIT STRING OPTIONAL }
- *
- * FieldElement ::= OCTET STRING
- *
- * ECPoint ::= OCTET STRING
- * </pre>
- *
- * @since 1.6
- * @author Andreas Sterbenz
- */
-public final class ECParameters extends AlgorithmParametersSpi {
-
- public ECParameters() {
- // empty
- }
-
- // Used by SunPKCS11 and SunJSSE.
- public static ECPoint decodePoint(byte[] data, EllipticCurve curve)
- throws IOException {
- if ((data.length == 0) || (data[0] != 4)) {
- throw new IOException("Only uncompressed point format supported");
- }
- int n = (curve.getField().getFieldSize() + 7 ) >> 3;
- if (data.length != (n * 2) + 1) {
- throw new IOException("Point does not match field size");
- }
- byte[] xb = new byte[n];
- byte[] yb = new byte[n];
- System.arraycopy(data, 1, xb, 0, n);
- System.arraycopy(data, n + 1, yb, 0, n);
- return new ECPoint(new BigInteger(1, xb), new BigInteger(1, yb));
- }
-
- // Used by SunPKCS11 and SunJSSE.
- public static byte[] encodePoint(ECPoint point, EllipticCurve curve) {
- // get field size in bytes (rounding up)
- int n = (curve.getField().getFieldSize() + 7) >> 3;
- byte[] xb = trimZeroes(point.getAffineX().toByteArray());
- byte[] yb = trimZeroes(point.getAffineY().toByteArray());
- if ((xb.length > n) || (yb.length > n)) {
- throw new RuntimeException
- ("Point coordinates do not match field size");
- }
- byte[] b = new byte[1 + (n << 1)];
- b[0] = 4; // uncompressed
- System.arraycopy(xb, 0, b, n - xb.length + 1, xb.length);
- System.arraycopy(yb, 0, b, b.length - yb.length, yb.length);
- return b;
- }
-
- // Copied from the SunPKCS11 code - should be moved to a common location.
- // trim leading (most significant) zeroes from the result
- static byte[] trimZeroes(byte[] b) {
- int i = 0;
- while ((i < b.length - 1) && (b[i] == 0)) {
- i++;
- }
- if (i == 0) {
- return b;
- }
- byte[] t = new byte[b.length - i];
- System.arraycopy(b, i, t, 0, t.length);
- return t;
- }
-
- // Convert the given ECParameterSpec object to a NamedCurve object.
- // If params does not represent a known named curve, return null.
- // Used by SunPKCS11.
- public static NamedCurve getNamedCurve(ECParameterSpec params) {
- if ((params instanceof NamedCurve) || (params == null)) {
- return (NamedCurve)params;
- }
- // This is a hack to allow SunJSSE to work with 3rd party crypto
- // providers for ECC and not just SunPKCS11.
- // This can go away once we decide how to expose curve names in the
- // public API.
- // Note that it assumes that the 3rd party provider encodes named
- // curves using the short form, not explicitly. If it did that, then
- // the SunJSSE TLS ECC extensions are wrong, which could lead to
- // interoperability problems.
- int fieldSize = params.getCurve().getField().getFieldSize();
- for (ECParameterSpec namedCurve : NamedCurve.knownECParameterSpecs()) {
- // ECParameterSpec does not define equals, so check all the
- // components ourselves.
- // Quick field size check first
- if (namedCurve.getCurve().getField().getFieldSize() != fieldSize) {
- continue;
- }
- if (namedCurve.getCurve().equals(params.getCurve()) == false) {
- continue;
- }
- if (namedCurve.getGenerator().equals(params.getGenerator()) == false) {
- continue;
- }
- if (namedCurve.getOrder().equals(params.getOrder()) == false) {
- continue;
- }
- if (namedCurve.getCofactor() != params.getCofactor()) {
- continue;
- }
- // everything matches our named curve, return it
- return (NamedCurve)namedCurve;
- }
- // no match found
- return null;
- }
-
- // Used by SunJSSE.
- public static String getCurveName(ECParameterSpec params) {
- NamedCurve curve = getNamedCurve(params);
- return (curve == null) ? null : curve.getObjectIdentifier().toString();
- }
-
- // Used by SunPKCS11.
- public static byte[] encodeParameters(ECParameterSpec params) {
- NamedCurve curve = getNamedCurve(params);
- if (curve == null) {
- throw new RuntimeException("Not a known named curve: " + params);
- }
- return curve.getEncoded();
- }
-
- // Used by SunPKCS11.
- public static ECParameterSpec decodeParameters(byte[] params) throws IOException {
- DerValue encodedParams = new DerValue(params);
- if (encodedParams.tag == DerValue.tag_ObjectId) {
- ObjectIdentifier oid = encodedParams.getOID();
- ECParameterSpec spec = NamedCurve.getECParameterSpec(oid);
- if (spec == null) {
- throw new IOException("Unknown named curve: " + oid);
- }
- return spec;
- }
-
- throw new IOException("Only named ECParameters supported");
-
- // The code below is incomplete.
- // It is left as a starting point for a complete parsing implementation.
-
-/*
- if (encodedParams.tag != DerValue.tag_Sequence) {
- throw new IOException("Unsupported EC parameters, tag: " + encodedParams.tag);
- }
-
- encodedParams.data.reset();
-
- DerInputStream in = encodedParams.data;
-
- int version = in.getInteger();
- if (version != 1) {
- throw new IOException("Unsupported EC parameters version: " + version);
- }
- ECField field = parseField(in);
- EllipticCurve curve = parseCurve(in, field);
- ECPoint point = parsePoint(in, curve);
-
- BigInteger order = in.getBigInteger();
- int cofactor = 0;
-
- if (in.available() != 0) {
- cofactor = in.getInteger();
- }
-
- // XXX HashAlgorithm optional
-
- if (encodedParams.data.available() != 0) {
- throw new IOException("encoded params have " +
- encodedParams.data.available() +
- " extra bytes");
- }
-
- return new ECParameterSpec(curve, point, order, cofactor);
-*/
- }
-
-/*
- private static final ObjectIdentifier fieldTypePrime =
- ObjectIdentifier.newInternal(new int[] {1, 2, 840, 10045, 1, 1});
-
- private static final ObjectIdentifier fieldTypeChar2 =
- ObjectIdentifier.newInternal(new int[] {1, 2, 840, 10045, 1, 2});
-
- private static ECField parseField(DerInputStream in) throws IOException {
- DerValue v = in.getDerValue();
- ObjectIdentifier oid = v.data.getOID();
- if (oid.equals(fieldTypePrime) == false) {
- throw new IOException("Only prime fields supported: " + oid);
- }
- BigInteger fieldSize = v.data.getBigInteger();
- return new ECFieldFp(fieldSize);
- }
-
- private static EllipticCurve parseCurve(DerInputStream in, ECField field)
- throws IOException {
- DerValue v = in.getDerValue();
- byte[] ab = v.data.getOctetString();
- byte[] bb = v.data.getOctetString();
- return new EllipticCurve(field, new BigInteger(1, ab), new BigInteger(1, bb));
- }
-
- private static ECPoint parsePoint(DerInputStream in, EllipticCurve curve)
- throws IOException {
- byte[] data = in.getOctetString();
- return decodePoint(data, curve);
- }
-*/
-
- // used by ECPublicKeyImpl and ECPrivateKeyImpl
- static AlgorithmParameters getAlgorithmParameters(ECParameterSpec spec)
- throws InvalidKeyException {
- try {
- AlgorithmParameters params = AlgorithmParameters.getInstance
- ("EC", ECKeyFactory.ecInternalProvider);
- params.init(spec);
- return params;
- } catch (GeneralSecurityException e) {
- throw new InvalidKeyException("EC parameters error", e);
- }
- }
-
- // AlgorithmParameterSpi methods
-
- // The parameters these AlgorithmParameters object represents.
- // Currently, it is always an instance of NamedCurve.
- private ECParameterSpec paramSpec;
-
- protected void engineInit(AlgorithmParameterSpec paramSpec)
- throws InvalidParameterSpecException {
- if (paramSpec instanceof ECParameterSpec) {
- this.paramSpec = getNamedCurve((ECParameterSpec)paramSpec);
- if (this.paramSpec == null) {
- throw new InvalidParameterSpecException
- ("Not a supported named curve: " + paramSpec);
- }
- } else if (paramSpec instanceof ECGenParameterSpec) {
- String name = ((ECGenParameterSpec)paramSpec).getName();
- ECParameterSpec spec = NamedCurve.getECParameterSpec(name);
- if (spec == null) {
- throw new InvalidParameterSpecException("Unknown curve: " + name);
- }
- this.paramSpec = spec;
- } else if (paramSpec == null) {
- throw new InvalidParameterSpecException
- ("paramSpec must not be null");
- } else {
- throw new InvalidParameterSpecException
- ("Only ECParameterSpec and ECGenParameterSpec supported");
- }
- }
-
- protected void engineInit(byte[] params) throws IOException {
- paramSpec = decodeParameters(params);
- }
-
- protected void engineInit(byte[] params, String decodingMethod) throws IOException {
- engineInit(params);
- }
-
- protected <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> spec)
- throws InvalidParameterSpecException {
- if (spec.isAssignableFrom(ECParameterSpec.class)) {
- return (T)paramSpec;
- } else if (spec.isAssignableFrom(ECGenParameterSpec.class)) {
- return (T)new ECGenParameterSpec(getCurveName(paramSpec));
- } else {
- throw new InvalidParameterSpecException
- ("Only ECParameterSpec and ECGenParameterSpec supported");
- }
- }
-
- protected byte[] engineGetEncoded() throws IOException {
- return encodeParameters(paramSpec);
- }
-
- protected byte[] engineGetEncoded(String encodingMethod) throws IOException {
- return engineGetEncoded();
- }
-
- protected String engineToString() {
- return paramSpec.toString();
- }
-}
diff --git a/ojluni/src/main/java/sun/security/ec/ECPrivateKeyImpl.java b/ojluni/src/main/java/sun/security/ec/ECPrivateKeyImpl.java
deleted file mode 100755
index fb309d3..0000000
--- a/ojluni/src/main/java/sun/security/ec/ECPrivateKeyImpl.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright (c) 2006, 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.
- */
-
-package sun.security.ec;
-
-import java.io.IOException;
-import java.math.BigInteger;
-
-import java.security.*;
-import java.security.interfaces.*;
-import java.security.spec.*;
-
-import sun.security.util.*;
-import sun.security.x509.AlgorithmId;
-import sun.security.pkcs.PKCS8Key;
-
-/**
- * Key implementation for EC private keys.
- *
- * ASN.1 syntax for EC private keys from SEC 1 v1.5 (draft):
- *
- * <pre>
- * EXPLICIT TAGS
- *
- * ECPrivateKey ::= SEQUENCE {
- * version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
- * privateKey OCTET STRING,
- * parameters [0] ECDomainParameters {{ SECGCurveNames }} OPTIONAL,
- * publicKey [1] BIT STRING OPTIONAL
- * }
- * </pre>
- *
- * We currently ignore the optional parameters and publicKey fields. We
- * require that the parameters are encoded as part of the AlgorithmIdentifier,
- * not in the private key structure.
- *
- * @since 1.6
- * @author Andreas Sterbenz
- */
-public final class ECPrivateKeyImpl extends PKCS8Key implements ECPrivateKey {
-
- private static final long serialVersionUID = 88695385615075129L;
-
- private BigInteger s; // private value
- private ECParameterSpec params;
-
- /**
- * Construct a key from its encoding. Called by the ECKeyFactory and
- * the SunPKCS11 code.
- */
- public ECPrivateKeyImpl(byte[] encoded) throws InvalidKeyException {
- decode(encoded);
- }
-
- /**
- * Construct a key from its components. Used by the
- * KeyFactory and the SunPKCS11 code.
- */
- public ECPrivateKeyImpl(BigInteger s, ECParameterSpec params)
- throws InvalidKeyException {
- this.s = s;
- this.params = params;
- // generate the encoding
- algid = new AlgorithmId
- (AlgorithmId.EC_oid, ECParameters.getAlgorithmParameters(params));
- try {
- DerOutputStream out = new DerOutputStream();
- out.putInteger(1); // version 1
- byte[] privBytes = ECParameters.trimZeroes(s.toByteArray());
- out.putOctetString(privBytes);
- DerValue val =
- new DerValue(DerValue.tag_Sequence, out.toByteArray());
- key = val.toByteArray();
- } catch (IOException exc) {
- // should never occur
- throw new InvalidKeyException(exc);
- }
- }
-
- // see JCA doc
- public String getAlgorithm() {
- return "EC";
- }
-
- // see JCA doc
- public BigInteger getS() {
- return s;
- }
-
- // see JCA doc
- public ECParameterSpec getParams() {
- return params;
- }
-
- /**
- * Parse the key. Called by PKCS8Key.
- */
- protected void parseKeyBits() throws InvalidKeyException {
- try {
- DerInputStream in = new DerInputStream(key);
- DerValue derValue = in.getDerValue();
- if (derValue.tag != DerValue.tag_Sequence) {
- throw new IOException("Not a SEQUENCE");
- }
- DerInputStream data = derValue.data;
- int version = data.getInteger();
- if (version != 1) {
- throw new IOException("Version must be 1");
- }
- byte[] privData = data.getOctetString();
- s = new BigInteger(1, privData);
- while (data.available() != 0) {
- DerValue value = data.getDerValue();
- if (value.isContextSpecific((byte)0)) {
- // ignore for now
- } else if (value.isContextSpecific((byte)1)) {
- // ignore for now
- } else {
- throw new InvalidKeyException("Unexpected value: " + value);
- }
- }
- AlgorithmParameters algParams = this.algid.getParameters();
- if (algParams == null) {
- throw new InvalidKeyException("EC domain parameters must be "
- + "encoded in the algorithm identifier");
- }
- params = algParams.getParameterSpec(ECParameterSpec.class);
- } catch (IOException e) {
- throw new InvalidKeyException("Invalid EC private key", e);
- } catch (InvalidParameterSpecException e) {
- throw new InvalidKeyException("Invalid EC private key", e);
- }
- }
-
- // return a string representation of this key for debugging
- public String toString() {
- return "Sun EC private key, " + params.getCurve().getField().getFieldSize()
- + " bits\n private value: "
- + s + "\n parameters: " + params;
- }
-
-}
diff --git a/ojluni/src/main/java/sun/security/ec/ECPublicKeyImpl.java b/ojluni/src/main/java/sun/security/ec/ECPublicKeyImpl.java
deleted file mode 100755
index 6d471e9..0000000
--- a/ojluni/src/main/java/sun/security/ec/ECPublicKeyImpl.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- * Copyright (c) 2006, 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.
- */
-
-package sun.security.ec;
-
-import java.io.IOException;
-
-import java.security.*;
-import java.security.interfaces.*;
-import java.security.spec.*;
-
-import sun.security.util.*;
-import sun.security.x509.*;
-
-/**
- * Key implementation for EC public keys.
- *
- * @since 1.6
- * @author Andreas Sterbenz
- */
-public final class ECPublicKeyImpl extends X509Key implements ECPublicKey {
-
- private static final long serialVersionUID = -2462037275160462289L;
-
- private ECPoint w;
- private ECParameterSpec params;
-
- /**
- * Construct a key from its components. Used by the
- * ECKeyFactory and SunPKCS11.
- */
- public ECPublicKeyImpl(ECPoint w, ECParameterSpec params)
- throws InvalidKeyException {
- this.w = w;
- this.params = params;
- // generate the encoding
- algid = new AlgorithmId
- (AlgorithmId.EC_oid, ECParameters.getAlgorithmParameters(params));
- key = ECParameters.encodePoint(w, params.getCurve());
- }
-
- /**
- * Construct a key from its encoding. Used by RSAKeyFactory.
- */
- public ECPublicKeyImpl(byte[] encoded) throws InvalidKeyException {
- decode(encoded);
- }
-
- // see JCA doc
- public String getAlgorithm() {
- return "EC";
- }
-
- // see JCA doc
- public ECPoint getW() {
- return w;
- }
-
- // see JCA doc
- public ECParameterSpec getParams() {
- return params;
- }
-
- // Internal API to get the encoded point. Currently used by SunPKCS11.
- // This may change/go away depending on what we do with the public API.
- public byte[] getEncodedPublicValue() {
- return key.clone();
- }
-
- /**
- * Parse the key. Called by X509Key.
- */
- protected void parseKeyBits() throws InvalidKeyException {
- try {
- AlgorithmParameters algParams = this.algid.getParameters();
- params = algParams.getParameterSpec(ECParameterSpec.class);
- w = ECParameters.decodePoint(key, params.getCurve());
- } catch (IOException e) {
- throw new InvalidKeyException("Invalid EC key", e);
- } catch (InvalidParameterSpecException e) {
- throw new InvalidKeyException("Invalid EC key", e);
- }
- }
-
- // return a string representation of this key for debugging
- public String toString() {
- return "Sun EC public key, " + params.getCurve().getField().getFieldSize()
- + " bits\n public x coord: " + w.getAffineX()
- + "\n public y coord: " + w.getAffineY()
- + "\n parameters: " + params;
- }
-
- protected Object writeReplace() throws java.io.ObjectStreamException {
- return new KeyRep(KeyRep.Type.PUBLIC,
- getAlgorithm(),
- getFormat(),
- getEncoded());
- }
-}
diff --git a/ojluni/src/main/java/sun/security/ec/NamedCurve.java b/ojluni/src/main/java/sun/security/ec/NamedCurve.java
deleted file mode 100755
index d655a98..0000000
--- a/ojluni/src/main/java/sun/security/ec/NamedCurve.java
+++ /dev/null
@@ -1,664 +0,0 @@
-/*
- * Copyright (c) 2006, 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.
- */
-
-package sun.security.ec;
-
-import java.io.IOException;
-import java.math.BigInteger;
-import java.util.*;
-import java.util.regex.Pattern;
-
-import java.security.spec.*;
-
-import sun.security.util.ObjectIdentifier;
-import sun.security.util.DerOutputStream;
-
-/**
- * Repository for well-known Elliptic Curve parameters. It is used by both
- * the SunPKCS11 and SunJSSE code.
- *
- * @since 1.6
- * @author Andreas Sterbenz
- */
-public final class NamedCurve extends ECParameterSpec {
-
- // friendly name for toString() output
- private final String name;
-
- // well known OID
- private final ObjectIdentifier oid;
-
- // encoded form (as NamedCurve identified via OID)
- private final byte[] encoded;
-
- private NamedCurve(String name, ObjectIdentifier oid, EllipticCurve curve,
- ECPoint g, BigInteger n, int h) throws IOException {
- super(curve, g, n, h);
- this.name = name;
- this.oid = oid;
-
- DerOutputStream out = new DerOutputStream();
- out.putOID(oid);
- encoded = out.toByteArray();
- }
-
- // Return a NamedCurve for the specified OID/name or null if unknown.
- // Used by SunJSSE and SunPKCS11.
- public static ECParameterSpec getECParameterSpec(String name) {
- NamedCurve spec = oidMap.get(name);
- return (spec != null) ? spec : nameMap.get(name);
- }
-
- // Return a NamedCurve for the specified OID or null if unknown.
- static ECParameterSpec getECParameterSpec(ObjectIdentifier oid) {
- return getECParameterSpec(oid.toString());
- }
-
- // Return EC parameters for the specified field size. If there are known
- // NIST recommended parameters for the given length, they are returned.
- // Otherwise, if there are multiple matches for the given size, an
- // arbitrary one is returns.
- // If no parameters are known, the method returns null.
- // NOTE that this method returns both prime and binary curves.
- // Used by SunPKCS11.
- public static ECParameterSpec getECParameterSpec(int length) {
- return lengthMap.get(length);
- }
-
- // Used by unit tests.
- public static Collection<? extends ECParameterSpec> knownECParameterSpecs() {
- return Collections.unmodifiableCollection(oidMap.values());
- }
-
- byte[] getEncoded() {
- return encoded.clone();
- }
-
- ObjectIdentifier getObjectIdentifier() {
- return oid;
- }
-
- public String toString() {
- return name + " (" + oid + ")";
- }
-
- private static final Map<String,NamedCurve> oidMap =
- new LinkedHashMap<String,NamedCurve>();
- private static final Map<String,NamedCurve> nameMap =
- new HashMap<String,NamedCurve>();
- private static final Map<Integer,NamedCurve> lengthMap =
- new HashMap<Integer,NamedCurve>();
-
- private static BigInteger bi(String s) {
- return new BigInteger(s, 16);
- }
-
- private static Pattern SPLIT_PATTERN = Pattern.compile(",|\\[|\\]");
-
- private static void add(String name, String soid, int type, String sfield,
- String a, String b, String x, String y, String n, int h) {
- BigInteger p = bi(sfield);
- ECField field;
- if ((type == P) || (type == PD)) {
- field = new ECFieldFp(p);
- } else if ((type == B) || (type == BD)) {
- field = new ECFieldF2m(p.bitLength() - 1, p);
- } else {
- throw new RuntimeException("Invalid type: " + type);
- }
-
- EllipticCurve curve = new EllipticCurve(field, bi(a), bi(b));
- ECPoint g = new ECPoint(bi(x), bi(y));
-
- try {
- ObjectIdentifier oid = new ObjectIdentifier(soid);
- NamedCurve params = new NamedCurve(name, oid, curve, g, bi(n), h);
- if (oidMap.put(soid, params) != null) {
- throw new RuntimeException("Duplication oid: " + soid);
- }
- String[] commonNames = SPLIT_PATTERN.split(name);
- for (String commonName : commonNames) {
- if (nameMap.put(commonName.trim(), params) != null) {
- throw new RuntimeException("Duplication name: " + commonName);
- }
- }
- int len = field.getFieldSize();
- if ((type == PD) || (type == BD) || (lengthMap.get(len) == null)) {
- // add entry if none present for this field size or if
- // the curve is marked as a default curve.
- lengthMap.put(len, params);
- }
- } catch (IOException e) {
- throw new RuntimeException("Internal error", e);
- }
- }
-
- private final static int P = 1; // prime curve
- private final static int B = 2; // binary curve
- private final static int PD = 5; // prime curve, mark as default
- private final static int BD = 6; // binary curve, mark as default
-
- static {
- /* SEC2 prime curves */
- add("secp112r1", "1.3.132.0.6", P,
- "DB7C2ABF62E35E668076BEAD208B",
- "DB7C2ABF62E35E668076BEAD2088",
- "659EF8BA043916EEDE8911702B22",
- "09487239995A5EE76B55F9C2F098",
- "A89CE5AF8724C0A23E0E0FF77500",
- "DB7C2ABF62E35E7628DFAC6561C5",
- 1);
-
- add("secp112r2", "1.3.132.0.7", P,
- "DB7C2ABF62E35E668076BEAD208B",
- "6127C24C05F38A0AAAF65C0EF02C",
- "51DEF1815DB5ED74FCC34C85D709",
- "4BA30AB5E892B4E1649DD0928643",
- "adcd46f5882e3747def36e956e97",
- "36DF0AAFD8B8D7597CA10520D04B",
- 4);
-
- add("secp128r1", "1.3.132.0.28", P,
- "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",
- "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC",
- "E87579C11079F43DD824993C2CEE5ED3",
- "161FF7528B899B2D0C28607CA52C5B86",
- "CF5AC8395BAFEB13C02DA292DDED7A83",
- "FFFFFFFE0000000075A30D1B9038A115",
- 1);
-
- add("secp128r2", "1.3.132.0.29", P,
- "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF",
- "D6031998D1B3BBFEBF59CC9BBFF9AEE1",
- "5EEEFCA380D02919DC2C6558BB6D8A5D",
- "7B6AA5D85E572983E6FB32A7CDEBC140",
- "27B6916A894D3AEE7106FE805FC34B44",
- "3FFFFFFF7FFFFFFFBE0024720613B5A3",
- 4);
-
- add("secp160k1", "1.3.132.0.9", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",
- "0000000000000000000000000000000000000000",
- "0000000000000000000000000000000000000007",
- "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB",
- "938CF935318FDCED6BC28286531733C3F03C4FEE",
- "0100000000000000000001B8FA16DFAB9ACA16B6B3",
- 1);
-
- add("secp160r1", "1.3.132.0.8", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC",
- "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45",
- "4A96B5688EF573284664698968C38BB913CBFC82",
- "23A628553168947D59DCC912042351377AC5FB32",
- "0100000000000000000001F4C8F927AED3CA752257",
- 1);
-
- add("secp160r2", "1.3.132.0.30", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70",
- "B4E134D3FB59EB8BAB57274904664D5AF50388BA",
- "52DCB034293A117E1F4FF11B30F7199D3144CE6D",
- "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E",
- "0100000000000000000000351EE786A818F3A1A16B",
- 1);
-
- add("secp192k1", "1.3.132.0.31", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37",
- "000000000000000000000000000000000000000000000000",
- "000000000000000000000000000000000000000000000003",
- "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D",
- "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",
- "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D",
- 1);
-
- add("secp192r1 [NIST P-192, X9.62 prime192v1]", "1.2.840.10045.3.1.1", PD,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
- "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1",
- "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012",
- "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",
- "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831",
- 1);
-
- add("secp224k1", "1.3.132.0.32", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D",
- "00000000000000000000000000000000000000000000000000000000",
- "00000000000000000000000000000000000000000000000000000005",
- "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C",
- "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5",
- "010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7",
- 1);
-
- add("secp224r1 [NIST P-224]", "1.3.132.0.33", PD,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE",
- "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4",
- "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21",
- "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D",
- 1);
-
- add("secp256k1", "1.3.132.0.10", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F",
- "0000000000000000000000000000000000000000000000000000000000000000",
- "0000000000000000000000000000000000000000000000000000000000000007",
- "79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798",
- "483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141",
- 1);
-
- add("secp256r1 [NIST P-256, X9.62 prime256v1]", "1.2.840.10045.3.1.7", PD,
- "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF",
- "FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC",
- "5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B",
- "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296",
- "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",
- "FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551",
- 1);
-
- add("secp384r1 [NIST P-384]", "1.3.132.0.34", PD,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC",
- "B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF",
- "AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7",
- "3617DE4A96262C6F5D9E98BF9292DC29F8F41DBD289A147CE9DA3113B5F0B8C00A60B1CE1D7E819D7A431D7C90EA0E5F",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973",
- 1);
-
- add("secp521r1 [NIST P-521]", "1.3.132.0.35", PD,
- "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
- "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC",
- "0051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00",
- "00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66",
- "011839296A789A3BC0045C8A5FB42C7D1BD998F54449579B446817AFBD17273E662C97EE72995EF42640C550B9013FAD0761353C7086A272C24088BE94769FD16650",
- "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409",
- 1);
-
- /* ANSI X9.62 prime curves */
- add("X9.62 prime192v2", "1.2.840.10045.3.1.2", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
- "CC22D6DFB95C6B25E49C0D6364A4E5980C393AA21668D953",
- "EEA2BAE7E1497842F2DE7769CFE9C989C072AD696F48034A",
- "6574D11D69B6EC7A672BB82A083DF2F2B0847DE970B2DE15",
- "FFFFFFFFFFFFFFFFFFFFFFFE5FB1A724DC80418648D8DD31",
- 1);
-
- add("X9.62 prime192v3", "1.2.840.10045.3.1.3", P,
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF",
- "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC",
- "22123DC2395A05CAA7423DAECCC94760A7D462256BD56916",
- "7D29778100C65A1DA1783716588DCE2B8B4AEE8E228F1896",
- "38A90F22637337334B49DCB66A6DC8F9978ACA7648A943B0",
- "FFFFFFFFFFFFFFFFFFFFFFFF7A62D031C83F4294F640EC13",
- 1);
-
- add("X9.62 prime239v1", "1.2.840.10045.3.1.4", P,
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
- "6B016C3BDCF18941D0D654921475CA71A9DB2FB27D1D37796185C2942C0A",
- "0FFA963CDCA8816CCC33B8642BEDF905C3D358573D3F27FBBD3B3CB9AAAF",
- "7DEBE8E4E90A5DAE6E4054CA530BA04654B36818CE226B39FCCB7B02F1AE",
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B",
- 1);
-
- add("X9.62 prime239v2", "1.2.840.10045.3.1.5", P,
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
- "617FAB6832576CBBFED50D99F0249C3FEE58B94BA0038C7AE84C8C832F2C",
- "38AF09D98727705120C921BB5E9E26296A3CDCF2F35757A0EAFD87B830E7",
- "5B0125E4DBEA0EC7206DA0FC01D9B081329FB555DE6EF460237DFF8BE4BA",
- "7FFFFFFFFFFFFFFFFFFFFFFF800000CFA7E8594377D414C03821BC582063",
- 1);
-
- add("X9.62 prime239v3", "1.2.840.10045.3.1.6", P,
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF",
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC",
- "255705FA2A306654B1F4CB03D6A750A30C250102D4988717D9BA15AB6D3E",
- "6768AE8E18BB92CFCF005C949AA2C6D94853D0E660BBF854B1C9505FE95A",
- "1607E6898F390C06BC1D552BAD226F3B6FCFE48B6E818499AF18E3ED6CF3",
- "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF975DEB41B3A6057C3C432146526551",
- 1);
-
- /* SEC2 binary curves */
- add("sect113r1", "1.3.132.0.4", B,
- "020000000000000000000000000201",
- "003088250CA6E7C7FE649CE85820F7",
- "00E8BEE4D3E2260744188BE0E9C723",
- "009D73616F35F4AB1407D73562C10F",
- "00A52830277958EE84D1315ED31886",
- "0100000000000000D9CCEC8A39E56F",
- 2);
-
- add("sect113r2", "1.3.132.0.5", B,
- "020000000000000000000000000201",
- "00689918DBEC7E5A0DD6DFC0AA55C7",
- "0095E9A9EC9B297BD4BF36E059184F",
- "01A57A6A7B26CA5EF52FCDB8164797",
- "00B3ADC94ED1FE674C06E695BABA1D",
- "010000000000000108789B2496AF93",
- 2);
-
- add("sect131r1", "1.3.132.0.22", B,
- "080000000000000000000000000000010D",
- "07A11B09A76B562144418FF3FF8C2570B8",
- "0217C05610884B63B9C6C7291678F9D341",
- "0081BAF91FDF9833C40F9C181343638399",
- "078C6E7EA38C001F73C8134B1B4EF9E150",
- "0400000000000000023123953A9464B54D",
- 2);
-
- add("sect131r2", "1.3.132.0.23", B,
- "080000000000000000000000000000010D",
- "03E5A88919D7CAFCBF415F07C2176573B2",
- "04B8266A46C55657AC734CE38F018F2192",
- "0356DCD8F2F95031AD652D23951BB366A8",
- "0648F06D867940A5366D9E265DE9EB240F",
- "0400000000000000016954A233049BA98F",
- 2);
-
- add("sect163k1 [NIST K-163]", "1.3.132.0.1", BD,
- "0800000000000000000000000000000000000000C9",
- "000000000000000000000000000000000000000001",
- "000000000000000000000000000000000000000001",
- "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8",
- "0289070FB05D38FF58321F2E800536D538CCDAA3D9",
- "04000000000000000000020108A2E0CC0D99F8A5EF",
- 2);
-
- add("sect163r1", "1.3.132.0.2", B,
- "0800000000000000000000000000000000000000C9",
- "07B6882CAAEFA84F9554FF8428BD88E246D2782AE2",
- "0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9",
- "0369979697AB43897789566789567F787A7876A654",
- "00435EDB42EFAFB2989D51FEFCE3C80988F41FF883",
- "03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B",
- 2);
-
- add("sect163r2 [NIST B-163]", "1.3.132.0.15", BD,
- "0800000000000000000000000000000000000000C9",
- "000000000000000000000000000000000000000001",
- "020A601907B8C953CA1481EB10512F78744A3205FD",
- "03F0EBA16286A2D57EA0991168D4994637E8343E36",
- "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1",
- "040000000000000000000292FE77E70C12A4234C33",
- 2);
-
- add("sect193r1", "1.3.132.0.24", B,
- "02000000000000000000000000000000000000000000008001",
- "0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01",
- "00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814",
- "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1",
- "0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05",
- "01000000000000000000000000C7F34A778F443ACC920EBA49",
- 2);
-
- add("sect193r2", "1.3.132.0.25", B,
- "02000000000000000000000000000000000000000000008001",
- "0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B",
- "00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE",
- "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F",
- "01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C",
- "010000000000000000000000015AAB561B005413CCD4EE99D5",
- 2);
-
- add("sect233k1 [NIST K-233]", "1.3.132.0.26", BD,
- "020000000000000000000000000000000000000004000000000000000001",
- "000000000000000000000000000000000000000000000000000000000000",
- "000000000000000000000000000000000000000000000000000000000001",
- "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126",
- "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3",
- "008000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF",
- 4);
-
- add("sect233r1 [NIST B-233]", "1.3.132.0.27", B,
- "020000000000000000000000000000000000000004000000000000000001",
- "000000000000000000000000000000000000000000000000000000000001",
- "0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD",
- "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B",
- "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052",
- "01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7",
- 2);
-
- add("sect239k1", "1.3.132.0.3", B,
- "800000000000000000004000000000000000000000000000000000000001",
- "000000000000000000000000000000000000000000000000000000000000",
- "000000000000000000000000000000000000000000000000000000000001",
- "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC",
- "76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA",
- "2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5",
- 4);
-
- add("sect283k1 [NIST K-283]", "1.3.132.0.16", BD,
- "0800000000000000000000000000000000000000000000000000000000000000000010A1",
- "000000000000000000000000000000000000000000000000000000000000000000000000",
- "000000000000000000000000000000000000000000000000000000000000000000000001",
- "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836",
- "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259",
- "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61",
- 4);
-
- add("sect283r1 [NIST B-283]", "1.3.132.0.17", B,
- "0800000000000000000000000000000000000000000000000000000000000000000010A1",
- "000000000000000000000000000000000000000000000000000000000000000000000001",
- "027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5",
- "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053",
- "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4",
- "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307",
- 2);
-
- add("sect409k1 [NIST K-409]", "1.3.132.0.36", BD,
- "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001",
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
- "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746",
- "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B",
- "007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF",
- 4);
-
- add("sect409r1 [NIST B-409]", "1.3.132.0.37", B,
- "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001",
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
- "0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F",
- "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7",
- "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706",
- "010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173",
- 2);
-
- add("sect571k1 [NIST K-571]", "1.3.132.0.38", BD,
- "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425",
- "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
- "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
- "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972",
- "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3",
- "020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001",
- 4);
-
- add("sect571r1 [NIST B-571]", "1.3.132.0.39", B,
- "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425",
- "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
- "02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A",
- "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19",
- "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B",
- "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47",
- 2);
-
- /* ANSI X9.62 binary curves */
- add("X9.62 c2tnb191v1", "1.2.840.10045.3.0.5", B,
- "800000000000000000000000000000000000000000000201",
- "2866537B676752636A68F56554E12640276B649EF7526267",
- "2E45EF571F00786F67B0081B9495A3D95462F5DE0AA185EC",
- "36B3DAF8A23206F9C4F299D7B21A9C369137F2C84AE1AA0D",
- "765BE73433B3F95E332932E70EA245CA2418EA0EF98018FB",
- "40000000000000000000000004A20E90C39067C893BBB9A5",
- 2);
-
- add("X9.62 c2tnb191v2", "1.2.840.10045.3.0.6", B,
- "800000000000000000000000000000000000000000000201",
- "401028774D7777C7B7666D1366EA432071274F89FF01E718",
- "0620048D28BCBD03B6249C99182B7C8CD19700C362C46A01",
- "3809B2B7CC1B28CC5A87926AAD83FD28789E81E2C9E3BF10",
- "17434386626D14F3DBF01760D9213A3E1CF37AEC437D668A",
- "20000000000000000000000050508CB89F652824E06B8173",
- 4);
-
- add("X9.62 c2tnb191v3", "1.2.840.10045.3.0.7", B,
- "800000000000000000000000000000000000000000000201",
- "6C01074756099122221056911C77D77E77A777E7E7E77FCB",
- "71FE1AF926CF847989EFEF8DB459F66394D90F32AD3F15E8",
- "375D4CE24FDE434489DE8746E71786015009E66E38A926DD",
- "545A39176196575D985999366E6AD34CE0A77CD7127B06BE",
- "155555555555555555555555610C0B196812BFB6288A3EA3",
- 6);
-
- add("X9.62 c2tnb239v1", "1.2.840.10045.3.0.11", B,
- "800000000000000000000000000000000000000000000000001000000001",
- "32010857077C5431123A46B808906756F543423E8D27877578125778AC76",
- "790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16",
- "57927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D",
- "61D8EE5077C33FECF6F1A16B268DE469C3C7744EA9A971649FC7A9616305",
- "2000000000000000000000000000000F4D42FFE1492A4993F1CAD666E447",
- 4);
-
- add("X9.62 c2tnb239v2", "1.2.840.10045.3.0.12", B,
- "800000000000000000000000000000000000000000000000001000000001",
- "4230017757A767FAE42398569B746325D45313AF0766266479B75654E65F",
- "5037EA654196CFF0CD82B2C14A2FCF2E3FF8775285B545722F03EACDB74B",
- "28F9D04E900069C8DC47A08534FE76D2B900B7D7EF31F5709F200C4CA205",
- "5667334C45AFF3B5A03BAD9DD75E2C71A99362567D5453F7FA6E227EC833",
- "1555555555555555555555555555553C6F2885259C31E3FCDF154624522D",
- 6);
-
- add("X9.62 c2tnb239v3", "1.2.840.10045.3.0.13", B,
- "800000000000000000000000000000000000000000000000001000000001",
- "01238774666A67766D6676F778E676B66999176666E687666D8766C66A9F",
- "6A941977BA9F6A435199ACFC51067ED587F519C5ECB541B8E44111DE1D40",
- "70F6E9D04D289C4E89913CE3530BFDE903977D42B146D539BF1BDE4E9C92",
- "2E5A0EAF6E5E1305B9004DCE5C0ED7FE59A35608F33837C816D80B79F461",
- "0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCAC4912D2D9DF903EF9888B8A0E4CFF",
- 0xA);
-
- add("X9.62 c2tnb359v1", "1.2.840.10045.3.0.18", B,
- "800000000000000000000000000000000000000000000000000000000000000000000000100000000000000001",
- "5667676A654B20754F356EA92017D946567C46675556F19556A04616B567D223A5E05656FB549016A96656A557",
- "2472E2D0197C49363F1FE7F5B6DB075D52B6947D135D8CA445805D39BC345626089687742B6329E70680231988",
- "3C258EF3047767E7EDE0F1FDAA79DAEE3841366A132E163ACED4ED2401DF9C6BDCDE98E8E707C07A2239B1B097",
- "53D7E08529547048121E9C95F3791DD804963948F34FAE7BF44EA82365DC7868FE57E4AE2DE211305A407104BD",
- "01AF286BCA1AF286BCA1AF286BCA1AF286BCA1AF286BC9FB8F6B85C556892C20A7EB964FE7719E74F490758D3B",
- 0x4C);
-
- add("X9.62 c2tnb431r1", "1.2.840.10045.3.0.20", B,
- "800000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000001",
- "1A827EF00DD6FC0E234CAF046C6A5D8A85395B236CC4AD2CF32A0CADBDC9DDF620B0EB9906D0957F6C6FEACD615468DF104DE296CD8F",
- "10D9B4A3D9047D8B154359ABFB1B7F5485B04CEB868237DDC9DEDA982A679A5A919B626D4E50A8DD731B107A9962381FB5D807BF2618",
- "120FC05D3C67A99DE161D2F4092622FECA701BE4F50F4758714E8A87BBF2A658EF8C21E7C5EFE965361F6C2999C0C247B0DBD70CE6B7",
- "20D0AF8903A96F8D5FA2C255745D3C451B302C9346D9B7E485E7BCE41F6B591F3E8F6ADDCBB0BC4C2F947A7DE1A89B625D6A598B3760",
- "0340340340340340340340340340340340340340340340340340340323C313FAB50589703B5EC68D3587FEC60D161CC149C1AD4A91",
- 0x2760);
-
- /* ANSI X9.62 binary curves from the 1998 standard but forbidden
- * in the 2005 version of the standard.
- * We don't register them but leave them here for the time being in
- * case we need to support them after all.
- */
-/*
- add("X9.62 c2pnb163v1", "1.2.840.10045.3.0.1", B,
- "080000000000000000000000000000000000000107",
- "072546B5435234A422E0789675F432C89435DE5242",
- "00C9517D06D5240D3CFF38C74B20B6CD4D6F9DD4D9",
- "07AF69989546103D79329FCC3D74880F33BBE803CB",
- "01EC23211B5966ADEA1D3F87F7EA5848AEF0B7CA9F",
- "0400000000000000000001E60FC8821CC74DAEAFC1",
- 2);
-
- add("X9.62 c2pnb163v2", "1.2.840.10045.3.0.2", B,
- "080000000000000000000000000000000000000107",
- "0108B39E77C4B108BED981ED0E890E117C511CF072",
- "0667ACEB38AF4E488C407433FFAE4F1C811638DF20",
- "0024266E4EB5106D0A964D92C4860E2671DB9B6CC5",
- "079F684DDF6684C5CD258B3890021B2386DFD19FC5",
- "03FFFFFFFFFFFFFFFFFFFDF64DE1151ADBB78F10A7",
- 2);
-
- add("X9.62 c2pnb163v3", "1.2.840.10045.3.0.3", B,
- "080000000000000000000000000000000000000107",
- "07A526C63D3E25A256A007699F5447E32AE456B50E",
- "03F7061798EB99E238FD6F1BF95B48FEEB4854252B",
- "02F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB",
- "05B935590C155E17EA48EB3FF3718B893DF59A05D0",
- "03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309",
- 2);
-
- add("X9.62 c2pnb176w1", "1.2.840.10045.3.0.4", B,
- "0100000000000000000000000000000000080000000007",
- "E4E6DB2995065C407D9D39B8D0967B96704BA8E9C90B",
- "5DDA470ABE6414DE8EC133AE28E9BBD7FCEC0AE0FFF2",
- "8D16C2866798B600F9F08BB4A8E860F3298CE04A5798",
- "6FA4539C2DADDDD6BAB5167D61B436E1D92BB16A562C",
- "00010092537397ECA4F6145799D62B0A19CE06FE26AD",
- 0xFF6E);
-
- add("X9.62 c2pnb208w1", "1.2.840.10045.3.0.10", B,
- "010000000000000000000000000000000800000000000000000007",
- "0000000000000000000000000000000000000000000000000000",
- "C8619ED45A62E6212E1160349E2BFA844439FAFC2A3FD1638F9E",
- "89FDFBE4ABE193DF9559ECF07AC0CE78554E2784EB8C1ED1A57A",
- "0F55B51A06E78E9AC38A035FF520D8B01781BEB1A6BB08617DE3",
- "000101BAF95C9723C57B6C21DA2EFF2D5ED588BDD5717E212F9D",
- 0xFE48);
-
- add("X9.62 c2pnb272w1", "1.2.840.10045.3.0.16", B,
- "010000000000000000000000000000000000000000000000000000010000000000000B",
- "91A091F03B5FBA4AB2CCF49C4EDD220FB028712D42BE752B2C40094DBACDB586FB20",
- "7167EFC92BB2E3CE7C8AAAFF34E12A9C557003D7C73A6FAF003F99F6CC8482E540F7",
- "6108BABB2CEEBCF787058A056CBE0CFE622D7723A289E08A07AE13EF0D10D171DD8D",
- "10C7695716851EEF6BA7F6872E6142FBD241B830FF5EFCACECCAB05E02005DDE9D23",
- "000100FAF51354E0E39E4892DF6E319C72C8161603FA45AA7B998A167B8F1E629521",
- 0xFF06);
-
- add("X9.62 c2pnb304w1", "1.2.840.10045.3.0.17", B,
- "010000000000000000000000000000000000000000000000000000000000000000000000000807",
- "FD0D693149A118F651E6DCE6802085377E5F882D1B510B44160074C1288078365A0396C8E681",
- "BDDB97E555A50A908E43B01C798EA5DAA6788F1EA2794EFCF57166B8C14039601E55827340BE",
- "197B07845E9BE2D96ADB0F5F3C7F2CFFBD7A3EB8B6FEC35C7FD67F26DDF6285A644F740A2614",
- "E19FBEB76E0DA171517ECF401B50289BF014103288527A9B416A105E80260B549FDC1B92C03B",
- "000101D556572AABAC800101D556572AABAC8001022D5C91DD173F8FB561DA6899164443051D",
- 0xFE2E);
-
- add("X9.62 c2pnb368w1", "1.2.840.10045.3.0.19", B,
- "0100000000000000000000000000000000000000000000000000000000000000000000002000000000000000000007",
- "E0D2EE25095206F5E2A4F9ED229F1F256E79A0E2B455970D8D0D865BD94778C576D62F0AB7519CCD2A1A906AE30D",
- "FC1217D4320A90452C760A58EDCD30C8DD069B3C34453837A34ED50CB54917E1C2112D84D164F444F8F74786046A",
- "1085E2755381DCCCE3C1557AFA10C2F0C0C2825646C5B34A394CBCFA8BC16B22E7E789E927BE216F02E1FB136A5F",
- "7B3EB1BDDCBA62D5D8B2059B525797FC73822C59059C623A45FF3843CEE8F87CD1855ADAA81E2A0750B80FDA2310",
- "00010090512DA9AF72B08349D98A5DD4C7B0532ECA51CE03E2D10F3B7AC579BD87E909AE40A6F131E9CFCE5BD967",
- 0xFF70);
-*/
-
- SPLIT_PATTERN = null;
- }
-
-}
diff --git a/ojluni/src/main/java/sun/security/internal/interfaces/TlsMasterSecret.java b/ojluni/src/main/java/sun/security/internal/interfaces/TlsMasterSecret.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/internal/spec/TlsKeyMaterialParameterSpec.java b/ojluni/src/main/java/sun/security/internal/spec/TlsKeyMaterialParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/internal/spec/TlsKeyMaterialSpec.java b/ojluni/src/main/java/sun/security/internal/spec/TlsKeyMaterialSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/internal/spec/TlsMasterSecretParameterSpec.java b/ojluni/src/main/java/sun/security/internal/spec/TlsMasterSecretParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/internal/spec/TlsPrfParameterSpec.java b/ojluni/src/main/java/sun/security/internal/spec/TlsPrfParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java b/ojluni/src/main/java/sun/security/internal/spec/TlsRsaPremasterSecretParameterSpec.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/jca/GetInstance.java b/ojluni/src/main/java/sun/security/jca/GetInstance.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/jca/JCAUtil.java b/ojluni/src/main/java/sun/security/jca/JCAUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/jca/ProviderConfig.java b/ojluni/src/main/java/sun/security/jca/ProviderConfig.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/jca/ProviderList.java b/ojluni/src/main/java/sun/security/jca/ProviderList.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/jca/Providers.java b/ojluni/src/main/java/sun/security/jca/Providers.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/jca/ServiceId.java b/ojluni/src/main/java/sun/security/jca/ServiceId.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/ContentInfo.java b/ojluni/src/main/java/sun/security/pkcs/ContentInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/PKCS7.java b/ojluni/src/main/java/sun/security/pkcs/PKCS7.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/PKCS8Key.java b/ojluni/src/main/java/sun/security/pkcs/PKCS8Key.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/PKCS9Attribute.java b/ojluni/src/main/java/sun/security/pkcs/PKCS9Attribute.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/PKCS9Attributes.java b/ojluni/src/main/java/sun/security/pkcs/PKCS9Attributes.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/ParsingException.java b/ojluni/src/main/java/sun/security/pkcs/ParsingException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/SignerInfo.java b/ojluni/src/main/java/sun/security/pkcs/SignerInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/pkcs/SigningCertificateInfo.java b/ojluni/src/main/java/sun/security/pkcs/SigningCertificateInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/provider/X509Factory.java b/ojluni/src/main/java/sun/security/provider/X509Factory.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/rsa/SunRsaSignEntries.java b/ojluni/src/main/java/sun/security/rsa/SunRsaSignEntries.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/timestamp/TimestampToken.java b/ojluni/src/main/java/sun/security/timestamp/TimestampToken.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/BitArray.java b/ojluni/src/main/java/sun/security/util/BitArray.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/ByteArrayLexOrder.java b/ojluni/src/main/java/sun/security/util/ByteArrayLexOrder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/ByteArrayTagOrder.java b/ojluni/src/main/java/sun/security/util/ByteArrayTagOrder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/Cache.java b/ojluni/src/main/java/sun/security/util/Cache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/Debug.java b/ojluni/src/main/java/sun/security/util/Debug.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerEncoder.java b/ojluni/src/main/java/sun/security/util/DerEncoder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerIndefLenConverter.java b/ojluni/src/main/java/sun/security/util/DerIndefLenConverter.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerInputBuffer.java b/ojluni/src/main/java/sun/security/util/DerInputBuffer.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerInputStream.java b/ojluni/src/main/java/sun/security/util/DerInputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerOutputStream.java b/ojluni/src/main/java/sun/security/util/DerOutputStream.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DerValue.java b/ojluni/src/main/java/sun/security/util/DerValue.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/DisabledAlgorithmConstraints.java b/ojluni/src/main/java/sun/security/util/DisabledAlgorithmConstraints.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/KeyUtil.java b/ojluni/src/main/java/sun/security/util/KeyUtil.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/Length.java b/ojluni/src/main/java/sun/security/util/Length.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/ManifestDigester.java b/ojluni/src/main/java/sun/security/util/ManifestDigester.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/ManifestEntryVerifier.java b/ojluni/src/main/java/sun/security/util/ManifestEntryVerifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/ObjectIdentifier.java b/ojluni/src/main/java/sun/security/util/ObjectIdentifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/PropertyExpander.java b/ojluni/src/main/java/sun/security/util/PropertyExpander.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/Resources.java b/ojluni/src/main/java/sun/security/util/Resources.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/ResourcesMgr.java b/ojluni/src/main/java/sun/security/util/ResourcesMgr.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/SecurityConstants.java b/ojluni/src/main/java/sun/security/util/SecurityConstants.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java b/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/util/UntrustedCertificates.java b/ojluni/src/main/java/sun/security/util/UntrustedCertificates.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/validator/EndEntityChecker.java b/ojluni/src/main/java/sun/security/validator/EndEntityChecker.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/validator/KeyStores.java b/ojluni/src/main/java/sun/security/validator/KeyStores.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/validator/PKIXValidator.java b/ojluni/src/main/java/sun/security/validator/PKIXValidator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/validator/SimpleValidator.java b/ojluni/src/main/java/sun/security/validator/SimpleValidator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/validator/Validator.java b/ojluni/src/main/java/sun/security/validator/Validator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/validator/ValidatorException.java b/ojluni/src/main/java/sun/security/validator/ValidatorException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/AVA.java b/ojluni/src/main/java/sun/security/x509/AVA.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/AccessDescription.java b/ojluni/src/main/java/sun/security/x509/AccessDescription.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/AlgorithmId.java b/ojluni/src/main/java/sun/security/x509/AlgorithmId.java
old mode 100755
new mode 100644
index f2de8ab..88edaf1
--- a/ojluni/src/main/java/sun/security/x509/AlgorithmId.java
+++ b/ojluni/src/main/java/sun/security/x509/AlgorithmId.java
@@ -121,20 +121,17 @@
try {
algParams = AlgorithmParameters.getInstance(algidString);
} catch (NoSuchAlgorithmException e) {
- try {
- // Try the internal EC code so that we can fully parse EC
- // keys even if the provider is not registered.
- // This code can go away once we have EC in the SUN provider.
- algParams = AlgorithmParameters.getInstance(algidString,
- sun.security.ec.ECKeyFactory.ecInternalProvider);
- } catch (NoSuchAlgorithmException ee) {
- /*
- * This algorithm parameter type is not supported, so we cannot
- * parse the parameters.
- */
- algParams = null;
- return;
- }
+ // BEGIN android-changed
+ // It was searching for the EC parameters in an internal provider in the deleted package
+ // sun.security.ec before setting them to null. Since EC is in the OpenSSL provider,
+ // there's no need for such fallback. Setting it to null directly.
+ /*
+ * This algorithm parameter type is not supported, so we cannot
+ * parse the parameters.
+ */
+ algParams = null;
+ return;
+ // END android-changed
}
// Decode (parse) the parameters
algParams.init(params.toByteArray());
diff --git a/ojluni/src/main/java/sun/security/x509/AttributeNameEnumeration.java b/ojluni/src/main/java/sun/security/x509/AttributeNameEnumeration.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/AuthorityInfoAccessExtension.java b/ojluni/src/main/java/sun/security/x509/AuthorityInfoAccessExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/AuthorityKeyIdentifierExtension.java b/ojluni/src/main/java/sun/security/x509/AuthorityKeyIdentifierExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/BasicConstraintsExtension.java b/ojluni/src/main/java/sun/security/x509/BasicConstraintsExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CRLDistributionPointsExtension.java b/ojluni/src/main/java/sun/security/x509/CRLDistributionPointsExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CRLExtensions.java b/ojluni/src/main/java/sun/security/x509/CRLExtensions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CRLNumberExtension.java b/ojluni/src/main/java/sun/security/x509/CRLNumberExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java b/ojluni/src/main/java/sun/security/x509/CRLReasonCodeExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertAttrSet.java b/ojluni/src/main/java/sun/security/x509/CertAttrSet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateAlgorithmId.java b/ojluni/src/main/java/sun/security/x509/CertificateAlgorithmId.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateExtensions.java b/ojluni/src/main/java/sun/security/x509/CertificateExtensions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateIssuerExtension.java b/ojluni/src/main/java/sun/security/x509/CertificateIssuerExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateIssuerName.java b/ojluni/src/main/java/sun/security/x509/CertificateIssuerName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateIssuerUniqueIdentity.java b/ojluni/src/main/java/sun/security/x509/CertificateIssuerUniqueIdentity.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificatePoliciesExtension.java b/ojluni/src/main/java/sun/security/x509/CertificatePoliciesExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificatePolicyId.java b/ojluni/src/main/java/sun/security/x509/CertificatePolicyId.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificatePolicyMap.java b/ojluni/src/main/java/sun/security/x509/CertificatePolicyMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificatePolicySet.java b/ojluni/src/main/java/sun/security/x509/CertificatePolicySet.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateSerialNumber.java b/ojluni/src/main/java/sun/security/x509/CertificateSerialNumber.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateSubjectName.java b/ojluni/src/main/java/sun/security/x509/CertificateSubjectName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateSubjectUniqueIdentity.java b/ojluni/src/main/java/sun/security/x509/CertificateSubjectUniqueIdentity.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateValidity.java b/ojluni/src/main/java/sun/security/x509/CertificateValidity.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateVersion.java b/ojluni/src/main/java/sun/security/x509/CertificateVersion.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java b/ojluni/src/main/java/sun/security/x509/CertificateX509Key.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/DNSName.java b/ojluni/src/main/java/sun/security/x509/DNSName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/DeltaCRLIndicatorExtension.java b/ojluni/src/main/java/sun/security/x509/DeltaCRLIndicatorExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/DistributionPoint.java b/ojluni/src/main/java/sun/security/x509/DistributionPoint.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/DistributionPointName.java b/ojluni/src/main/java/sun/security/x509/DistributionPointName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/EDIPartyName.java b/ojluni/src/main/java/sun/security/x509/EDIPartyName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/ExtendedKeyUsageExtension.java b/ojluni/src/main/java/sun/security/x509/ExtendedKeyUsageExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/Extension.java b/ojluni/src/main/java/sun/security/x509/Extension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/FreshestCRLExtension.java b/ojluni/src/main/java/sun/security/x509/FreshestCRLExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/GeneralName.java b/ojluni/src/main/java/sun/security/x509/GeneralName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/GeneralNameInterface.java b/ojluni/src/main/java/sun/security/x509/GeneralNameInterface.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/GeneralNames.java b/ojluni/src/main/java/sun/security/x509/GeneralNames.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/GeneralSubtree.java b/ojluni/src/main/java/sun/security/x509/GeneralSubtree.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java b/ojluni/src/main/java/sun/security/x509/GeneralSubtrees.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/IPAddressName.java b/ojluni/src/main/java/sun/security/x509/IPAddressName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/InhibitAnyPolicyExtension.java b/ojluni/src/main/java/sun/security/x509/InhibitAnyPolicyExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/InvalidityDateExtension.java b/ojluni/src/main/java/sun/security/x509/InvalidityDateExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/IssuerAlternativeNameExtension.java b/ojluni/src/main/java/sun/security/x509/IssuerAlternativeNameExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/IssuingDistributionPointExtension.java b/ojluni/src/main/java/sun/security/x509/IssuingDistributionPointExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/KeyIdentifier.java b/ojluni/src/main/java/sun/security/x509/KeyIdentifier.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/KeyUsageExtension.java b/ojluni/src/main/java/sun/security/x509/KeyUsageExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/NameConstraintsExtension.java b/ojluni/src/main/java/sun/security/x509/NameConstraintsExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/NetscapeCertTypeExtension.java b/ojluni/src/main/java/sun/security/x509/NetscapeCertTypeExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/OCSPNoCheckExtension.java b/ojluni/src/main/java/sun/security/x509/OCSPNoCheckExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/OIDMap.java b/ojluni/src/main/java/sun/security/x509/OIDMap.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/OIDName.java b/ojluni/src/main/java/sun/security/x509/OIDName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/OtherName.java b/ojluni/src/main/java/sun/security/x509/OtherName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/PKIXExtensions.java b/ojluni/src/main/java/sun/security/x509/PKIXExtensions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/PolicyConstraintsExtension.java b/ojluni/src/main/java/sun/security/x509/PolicyConstraintsExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/PolicyInformation.java b/ojluni/src/main/java/sun/security/x509/PolicyInformation.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/PolicyMappingsExtension.java b/ojluni/src/main/java/sun/security/x509/PolicyMappingsExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/PrivateKeyUsageExtension.java b/ojluni/src/main/java/sun/security/x509/PrivateKeyUsageExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/RDN.java b/ojluni/src/main/java/sun/security/x509/RDN.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/RFC822Name.java b/ojluni/src/main/java/sun/security/x509/RFC822Name.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/ReasonFlags.java b/ojluni/src/main/java/sun/security/x509/ReasonFlags.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/SerialNumber.java b/ojluni/src/main/java/sun/security/x509/SerialNumber.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/SubjectAlternativeNameExtension.java b/ojluni/src/main/java/sun/security/x509/SubjectAlternativeNameExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/SubjectInfoAccessExtension.java b/ojluni/src/main/java/sun/security/x509/SubjectInfoAccessExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/SubjectKeyIdentifierExtension.java b/ojluni/src/main/java/sun/security/x509/SubjectKeyIdentifierExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/URIName.java b/ojluni/src/main/java/sun/security/x509/URIName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/UniqueIdentity.java b/ojluni/src/main/java/sun/security/x509/UniqueIdentity.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X400Address.java b/ojluni/src/main/java/sun/security/x509/X400Address.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X500Name.java b/ojluni/src/main/java/sun/security/x509/X500Name.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X509AttributeName.java b/ojluni/src/main/java/sun/security/x509/X509AttributeName.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X509CRLEntryImpl.java b/ojluni/src/main/java/sun/security/x509/X509CRLEntryImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java b/ojluni/src/main/java/sun/security/x509/X509CRLImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X509CertImpl.java b/ojluni/src/main/java/sun/security/x509/X509CertImpl.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X509CertInfo.java b/ojluni/src/main/java/sun/security/x509/X509CertInfo.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/security/x509/X509Key.java b/ojluni/src/main/java/sun/security/x509/X509Key.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/LocaleServiceProviderPool.java b/ojluni/src/main/java/sun/util/LocaleServiceProviderPool.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/ResourceBundleEnumeration.java b/ojluni/src/main/java/sun/util/ResourceBundleEnumeration.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/AbstractCalendar.java b/ojluni/src/main/java/sun/util/calendar/AbstractCalendar.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/BaseCalendar.java b/ojluni/src/main/java/sun/util/calendar/BaseCalendar.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/CalendarDate.java b/ojluni/src/main/java/sun/util/calendar/CalendarDate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/CalendarSystem.java b/ojluni/src/main/java/sun/util/calendar/CalendarSystem.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/CalendarUtils.java b/ojluni/src/main/java/sun/util/calendar/CalendarUtils.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/Era.java b/ojluni/src/main/java/sun/util/calendar/Era.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/Gregorian.java b/ojluni/src/main/java/sun/util/calendar/Gregorian.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/ImmutableGregorianDate.java b/ojluni/src/main/java/sun/util/calendar/ImmutableGregorianDate.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/JulianCalendar.java b/ojluni/src/main/java/sun/util/calendar/JulianCalendar.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/LocalGregorianCalendar.java b/ojluni/src/main/java/sun/util/calendar/LocalGregorianCalendar.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/calendar/TzIDOldMapping.java b/ojluni/src/main/java/sun/util/calendar/TzIDOldMapping.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/BaseLocale.java b/ojluni/src/main/java/sun/util/locale/BaseLocale.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/Extension.java b/ojluni/src/main/java/sun/util/locale/Extension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/InternalLocaleBuilder.java b/ojluni/src/main/java/sun/util/locale/InternalLocaleBuilder.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/LanguageTag.java b/ojluni/src/main/java/sun/util/locale/LanguageTag.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/LocaleExtensions.java b/ojluni/src/main/java/sun/util/locale/LocaleExtensions.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/LocaleObjectCache.java b/ojluni/src/main/java/sun/util/locale/LocaleObjectCache.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/LocaleSyntaxException.java b/ojluni/src/main/java/sun/util/locale/LocaleSyntaxException.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/LocaleUtils.java b/ojluni/src/main/java/sun/util/locale/LocaleUtils.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/ParseStatus.java b/ojluni/src/main/java/sun/util/locale/ParseStatus.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/StringTokenIterator.java b/ojluni/src/main/java/sun/util/locale/StringTokenIterator.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/locale/UnicodeLocaleExtension.java b/ojluni/src/main/java/sun/util/locale/UnicodeLocaleExtension.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/logging/LoggingProxy.java b/ojluni/src/main/java/sun/util/logging/LoggingProxy.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/logging/LoggingSupport.java b/ojluni/src/main/java/sun/util/logging/LoggingSupport.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/logging/PlatformLogger.java b/ojluni/src/main/java/sun/util/logging/PlatformLogger.java
old mode 100755
new mode 100644
diff --git a/ojluni/src/main/java/sun/util/resources/OpenListResourceBundle.java b/ojluni/src/main/java/sun/util/resources/OpenListResourceBundle.java
old mode 100755
new mode 100644
diff --git a/openjdk_java_files.mk b/openjdk_java_files.mk
index 37c010c..c3eb5f6 100644
--- a/openjdk_java_files.mk
+++ b/openjdk_java_files.mk
@@ -295,6 +295,7 @@
ojluni/src/main/java/java/net/SocketOptions.java \
ojluni/src/main/java/java/net/SocketOutputStream.java \
ojluni/src/main/java/java/net/SocketPermission.java \
+ ojluni/src/main/java/java/net/SocketSecrets.java \
ojluni/src/main/java/java/net/SocketTimeoutException.java \
ojluni/src/main/java/java/net/SocksConsts.java \
ojluni/src/main/java/java/net/SocksSocketImpl.java \
@@ -1103,13 +1104,16 @@
ojluni/src/main/java/javax/security/auth/callback/Callback.java \
ojluni/src/main/java/javax/security/auth/callback/PasswordCallback.java \
ojluni/src/main/java/javax/security/auth/callback/UnsupportedCallbackException.java \
+ ojluni/src/main/java/javax/security/auth/callback/package-info.java \
ojluni/src/main/java/javax/security/auth/Destroyable.java \
ojluni/src/main/java/javax/security/auth/DestroyFailedException.java \
ojluni/src/main/java/javax/security/auth/login/LoginException.java \
+ ojluni/src/main/java/javax/security/auth/login/package-info.java \
ojluni/src/main/java/javax/security/auth/PrivateCredentialPermission.java \
ojluni/src/main/java/javax/security/auth/SubjectDomainCombiner.java \
ojluni/src/main/java/javax/security/auth/Subject.java \
ojluni/src/main/java/javax/security/auth/x500/X500Principal.java \
+ ojluni/src/main/java/javax/security/auth/x500/package-info.java \
ojluni/src/main/java/javax/security/cert/CertificateEncodingException.java \
ojluni/src/main/java/javax/security/cert/CertificateException.java \
ojluni/src/main/java/javax/security/cert/CertificateExpiredException.java \
@@ -1404,11 +1408,6 @@
ojluni/src/main/java/sun/security/action/GetPropertyAction.java \
ojluni/src/main/java/sun/security/action/LoadLibraryAction.java \
ojluni/src/main/java/sun/security/action/PutAllAction.java \
- ojluni/src/main/java/sun/security/ec/ECKeyFactory.java \
- ojluni/src/main/java/sun/security/ec/ECParameters.java \
- ojluni/src/main/java/sun/security/ec/ECPrivateKeyImpl.java \
- ojluni/src/main/java/sun/security/ec/ECPublicKeyImpl.java \
- ojluni/src/main/java/sun/security/ec/NamedCurve.java \
ojluni/src/main/java/sun/security/internal/interfaces/TlsMasterSecret.java \
ojluni/src/main/java/sun/security/internal/spec/TlsKeyMaterialParameterSpec.java \
ojluni/src/main/java/sun/security/internal/spec/TlsKeyMaterialSpec.java \
diff --git a/support/src/test/java/tests/support/Support_TestWebServer.java b/support/src/test/java/tests/support/Support_TestWebServer.java
index 33216a7..4ccf92c 100644
--- a/support/src/test/java/tests/support/Support_TestWebServer.java
+++ b/support/src/test/java/tests/support/Support_TestWebServer.java
@@ -84,12 +84,6 @@
/* If set, this indicates the reason for redirection */
int redirectCode = -1;
- /* Set the number of connections the server will accept before shutdown */
- int acceptLimit = 100;
-
- /* Count of number of accepted connections */
- int acceptedConnections = 0;
-
public Support_TestWebServer() {
}
@@ -166,14 +160,6 @@
}
/**
- * Call this to specify the maximum number of sockets to accept
- * @param limit The number of sockets to accept
- */
- public void setAcceptLimit(int limit) {
- acceptLimit = limit;
- }
-
- /**
* Call this to indicate redirection port requirement.
* When this value is set, the server will respond to a request with
* a redirect code with the Location response header set to the value
@@ -195,10 +181,6 @@
return pathToRequest;
}
- public int getNumAcceptedConnections() {
- return acceptedConnections;
- }
-
/**
* Cause the thread accepting connections on the server socket to close
*/
@@ -217,12 +199,8 @@
class AcceptThread extends Thread {
ServerSocket ss = null;
- boolean running = false;
+ volatile boolean closed = false;
- /**
- * @param port the port to use, or 0 to let the OS choose.
- * Hard-coding ports is evil, so always pass 0!
- */
public int init() throws IOException {
ss = new ServerSocket(0);
ss.setSoTimeout(5000);
@@ -233,15 +211,10 @@
/**
* Main thread responding to new connections
*/
- public synchronized void run() {
- running = true;
- while (running) {
+ public void run() {
+ while (!closed) {
try {
Socket s = ss.accept();
- acceptedConnections++;
- if (acceptedConnections >= acceptLimit) {
- running = false;
- }
new Thread(new Worker(s), "additional worker").start();
} catch (SocketException e) {
log(e.getMessage());
@@ -255,7 +228,7 @@
// Close this socket
public void close() {
try {
- running = false;
+ closed = true;
/* Stop server socket from processing further. Currently
this does not cause the SocketException from ss.accept
therefore the acceptLimit functionality has been added