+ *
*
*
* Target |
@@ -132,7 +132,7 @@ import java.lang.annotation.Target;
*
* Class |
* {} |
- * [property]+ -> elements |
+ * [property]+ -> elements |
* complexcontent xs:all |
* |
*
@@ -140,7 +140,7 @@ import java.lang.annotation.Target;
*
* Class |
* non empty |
- * [property]+ -> elements |
+ * [property]+ -> elements |
* complexcontent xs:sequence |
* |
*
@@ -148,7 +148,7 @@ import java.lang.annotation.Target;
*
* Class |
* X |
- * no property -> element |
+ * no property -> element |
* complexcontent empty sequence |
* |
*
@@ -156,8 +156,7 @@ import java.lang.annotation.Target;
*
* Class |
* X |
- * 1 [ @XmlValue property] && [property]+
- * ->attributes |
+ * 1 [@XmlValue property] {@literal &&} [property]+ -> attributes |
* simplecontent |
* |
*
@@ -165,11 +164,9 @@ import java.lang.annotation.Target;
*
* Class |
* X |
- * 1 [ @XmlValue property ]&& no properties
- * -> attribute |
+ * 1 [@XmlValue property] {@literal &&} no properties -> attribute |
* |
* simpletype |
- * |
*
*
*
@@ -212,16 +209,16 @@ import java.lang.annotation.Target;
* void setZip(java.math.BigDecimal) {..};
* }
*
- * <!-- XML Schema mapping for USAddress -->
- * <xs:complexType name="USAddress">
- * <xs:sequence>
- * <xs:element name="street" type="xs:string"/>
- * <xs:element name="city" type="xs:string"/>
- * <xs:element name="state" type="xs:string"/>
- * <xs:element name="zip" type="xs:decimal"/>
- * <xs:element name="name" type="xs:string"/>
- * </xs:all>
- * </xs:complexType>
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="USAddress">
+ * <xs:sequence>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * <xs:element name="name" type="xs:string"/>
+ * </xs:all>
+ * </xs:complexType>
*
* Example 2: Map a class to a complex type with
* xs:all
@@ -229,16 +226,16 @@ import java.lang.annotation.Target;
* @XmlType(propOrder={})
* public class USAddress { ...}
*
- * <!-- XML Schema mapping for USAddress -->
- * <xs:complexType name="USAddress">
- * <xs:all>
- * <xs:element name="name" type="xs:string"/>
- * <xs:element name="street" type="xs:string"/>
- * <xs:element name="city" type="xs:string"/>
- * <xs:element name="state" type="xs:string"/>
- * <xs:element name="zip" type="xs:decimal"/>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="USAddress">
+ * <xs:all>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:sequence>
+ * </xs:complexType>
*
* Example 3: Map a class to a global element with an
* anonymous type.
@@ -248,22 +245,22 @@ import java.lang.annotation.Target;
* @XmlType(name="")
* public class USAddress { ...}
*
- * <!-- XML Schema mapping for USAddress -->
- * <xs:element name="USAddress">
- * <xs:complexType>
- * <xs:sequence>
- * <xs:element name="name" type="xs:string"/>
- * <xs:element name="street" type="xs:string"/>
- * <xs:element name="city" type="xs:string"/>
- * <xs:element name="state" type="xs:string"/>
- * <xs:element name="zip" type="xs:decimal"/>
- * </xs:sequence>
- * </xs:complexType>
- * </xs:element>
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:element name="USAddress">
+ * <xs:complexType>
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:element name="street" type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:sequence>
+ * </xs:complexType>
+ * </xs:element>
*
*
*
Example 4: Map a property to a local element with
- * anonmyous type.
+ * anonymous type.
*
* //Example: Code fragment
* public class Invoice {
@@ -275,20 +272,20 @@ import java.lang.annotation.Target;
* public class USAddress { ... }
* }
*
- * <!-- XML Schema mapping for USAddress -->
- * <xs:complexType name="Invoice">
- * <xs:sequence>
- * <xs:element name="addr">
- * <xs:complexType>
- * <xs:element name="name", type="xs:string"/>
- * <xs:element name="city", type="xs:string"/>
- * <xs:element name="city" type="xs:string"/>
- * <xs:element name="state" type="xs:string"/>
- * <xs:element name="zip" type="xs:decimal"/>
- * </xs:complexType>
+ * <!-- XML Schema mapping for USAddress -->
+ * <xs:complexType name="Invoice">
+ * <xs:sequence>
+ * <xs:element name="addr">
+ * <xs:complexType>
+ * <xs:element name="name", type="xs:string"/>
+ * <xs:element name="city", type="xs:string"/>
+ * <xs:element name="city" type="xs:string"/>
+ * <xs:element name="state" type="xs:string"/>
+ * <xs:element name="zip" type="xs:decimal"/>
+ * </xs:complexType>
* ...
- * </xs:sequence>
- * </xs:complexType>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
* Example 5: Map a property to an attribute with
@@ -310,17 +307,17 @@ import java.lang.annotation.Target;
* public java.math.BigDecimal price;
* }
*
- * <!-- Example: XML Schema fragment -->
- * <xs:complexType name="Item">
- * <xs:sequence>
- * <xs:element name="name" type="xs:string"/>
- * <xs:attribute name="price">
- * <xs:simpleType>
- * <xs:restriction base="xs:decimal"/>
- * </xs:simpleType>
- * </xs:attribute>
- * </xs:sequence>
- * </xs:complexType>
+ * <!-- Example: XML Schema fragment -->
+ * <xs:complexType name="Item">
+ * <xs:sequence>
+ * <xs:element name="name" type="xs:string"/>
+ * <xs:attribute name="price">
+ * <xs:simpleType>
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
+ * </xs:attribute>
+ * </xs:sequence>
+ * </xs:complexType>
*
*
*
Example 6: Define a factoryClass and factoryMethod
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
index ecf23aceb49..1ab10854a4f 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/XmlValue.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -67,7 +67,6 @@ import static java.lang.annotation.RetentionPolicy.*;
* type, then the type must map to a XML Schema simple type.
*
*
- *
*
* If the annotated JavaBean property is the sole class member being
* mapped to XML Schema construct, then the class is mapped to a
@@ -89,10 +88,10 @@ import static java.lang.annotation.RetentionPolicy.*;
* public java.math.BigDecimal price;
* }
*
- * <!-- Example 1: XML Schema fragment -->
- * <xs:simpleType name="USPrice">
- * <xs:restriction base="xs:decimal"/>
- * </xs:simpleType>
+ * <!-- Example 1: XML Schema fragment -->
+ * <xs:simpleType name="USPrice">
+ * <xs:restriction base="xs:decimal"/>
+ * </xs:simpleType>
*
*
*
@@ -110,17 +109,16 @@ import static java.lang.annotation.RetentionPolicy.*;
* public String currency;
* }
*
- * <!-- Example 2: XML Schema fragment -->
- * <xs:complexType name="InternationalPrice">
- * <xs:simpleContent>
- * <xs:extension base="xs:decimal">
- * <xs:attribute name="currency" type="xs:string"/>
- * </xs:extension>
- * </xs:simpleContent>
- * </xs:complexType>
+ * <!-- Example 2: XML Schema fragment -->
+ * <xs:complexType name="InternationalPrice">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:decimal">
+ * <xs:attribute name="currency" type="xs:string"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
*
*
- *
*
* @author Sekhar Vajjhala, Sun Microsystems, Inc.
* @see XmlType
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
index 4ca79b0358d..4a500814f02 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/annotation/adapters/XmlAdapter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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,11 +76,11 @@ package javax.xml.bind.annotation.adapters;
* Step 1: Determine the desired XML representation for HashMap.
*
*
- * <hashmap>
- * <entry key="id123">this is a value</entry>
- * <entry key="id312">this is another value</entry>
+ * <hashmap>
+ * <entry key="id123">this is a value</entry>
+ * <entry key="id312">this is another value</entry>
* ...
- * </hashmap>
+ * </hashmap>
*
*
* Step 2: Determine the schema definition that the
@@ -88,20 +88,20 @@ package javax.xml.bind.annotation.adapters;
*
*
*
- * <xs:complexType name="myHashMapType">
- * <xs:sequence>
+ * <xs:complexType name="myHashMapType">
+ * <xs:sequence>
* <xs:element name="entry" type="myHashMapEntryType"
- * minOccurs = "0" maxOccurs="unbounded"/>
- * </xs:sequence>
- * </xs:complexType>
+ * minOccurs = "0" maxOccurs="unbounded"/>
+ * </xs:sequence>
+ * </xs:complexType>
*
- * <xs:complexType name="myHashMapEntryType">
- * <xs:simpleContent>
- * <xs:extension base="xs:string">
- * <xs:attribute name="key" type="xs:int"/>
- * </xs:extension>
- * </xs:simpleContent>
- * </xs:complexType>
+ * <xs:complexType name="myHashMapEntryType">
+ * <xs:simpleContent>
+ * <xs:extension base="xs:string">
+ * <xs:attribute name="key" type="xs:int"/>
+ * </xs:extension>
+ * </xs:simpleContent>
+ * </xs:complexType>
*
*
*
@@ -110,7 +110,7 @@ package javax.xml.bind.annotation.adapters;
*
*
* public class MyHashMapType {
- * List<MyHashMapEntryType> entry;
+ * List<MyHashMapEntryType> entry;
* }
*
* public class MyHashMapEntryType {
@@ -127,7 +127,7 @@ package javax.xml.bind.annotation.adapters;
*
*
* public final class MyHashMapAdapter extends
- * XmlAdapter<MyHashMapType,HashMap> { ... }
+ * XmlAdapter<MyHashMapType,HashMap> { ... }
*
*
*
@@ -144,11 +144,11 @@ package javax.xml.bind.annotation.adapters;
* The above code fragment will map to the following schema:
*
*
- * <xs:complexType name="Foo">
- * <xs:sequence>
- * <xs:element name="hashmap" type="myHashMapType"
- * </xs:sequence>
- * </xs:complexType>
+ * <xs:complexType name="Foo">
+ * <xs:sequence>
+ * <xs:element name="hashmap" type="myHashMapType">
+ * </xs:sequence>
+ * </xs:complexType>
*
*
* @param
diff --git a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
index 548f3c9bafe..3ce6621a44b 100644
--- a/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
+++ b/jaxws/src/java.xml.bind/share/classes/javax/xml/bind/attachment/AttachmentUnmarshaller.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -70,7 +70,7 @@ public abstract class AttachmentUnmarshaller {
*
* The returned DataHandler
instance must be configured
* to meet the following required mapping constaint.
- *
+ *
*
*
*
@@ -100,7 +100,7 @@ public abstract class AttachmentUnmarshaller {
* |
*
*
- * Note that it is allowable to support additional mappings.
+ * Note that it is allowable to support additional mappings.
*
* @param cid It is expected to be a valid lexical form of the XML Schema
* xs:anyURI
datatype. If {@link #isXOPPackage()}
diff --git a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
index 1ae4b3cd94f..b18bbc710b0 100644
--- a/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
+++ b/jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/ws/util/version.properties
@@ -23,7 +23,7 @@
# questions.
#
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
index d8194d0aa17..427db1f466e 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle.properties
@@ -30,10 +30,10 @@ BASEDIR_DOESNT_EXIST = \
Non-existent directory: {0}
VERSION = \
- schemagen 2.2.12-b141016.1821
+ schemagen 2.2.12-b150126.1924
FULLVERSION = \
- schemagen full version "2.2.12-b141016.1821"
+ schemagen full version "2.2.12-b150126.1924"
USAGE = \
Usage: schemagen [-options ...] \n\
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
index fff47122d87..435ed7150a6 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_de.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Nicht erkanntes {0} in Zeile {1} Spalte {2}
BASEDIR_DOESNT_EXIST = Nicht vorhandenes Verzeichnis: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b141016.1821"
+FULLVERSION = schemagen vollst\u00E4ndige Version "2.2.12-b150126.1924"
USAGE = Verwendung: schemagen [-options ...] \nOptionen: \n\\ \\ \\ \\ -d : Gibt an, wo die von Prozessor und javac generierten Klassendateien gespeichert werden sollen\n\\ \\ \\ \\ -cp : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -classpath : Gibt an, wo die vom Benutzer angegebenen Dateien gespeichert sind\n\\ \\ \\ \\ -encoding : Gibt die Codierung f\u00FCr die Annotationsverarbeitung/den javac-Aufruf an \n\\ \\ \\ \\ -episode : Generiert Episodendatei f\u00FCr separate Kompilierung\n\\ \\ \\ \\ -version : Zeigt Versionsinformation an\n\\ \\ \\ \\ -fullversion : Zeigt vollst\u00E4ndige Versionsinformationen an\n\\ \\ \\ \\ -help : Zeigt diese Verwendungsmeldung an
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
index 60ecdc915a5..c6d5aad27fa 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_es.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Aparece un {0} inesperado en la l\u00EDnea {1} y la colu
BASEDIR_DOESNT_EXIST = Directorio no existente: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b141016.1821"
+FULLVERSION = versi\u00F3n completa de schemagen "2.2.12-b150126.1924"
USAGE = Sintaxis: schemagen [-options ...] \nOpciones: \n\\ \\ \\ \\ -d : especifique d\u00F3nde se colocan los archivos de clase generados por javac y el procesador\n\\ \\ \\ \\ -cp : especifique d\u00F3nde se encuentran los archivos especificados por el usuario\n\\ \\ \\ \\ -encoding : especifique la codificaci\u00F3n que se va a utilizar para el procesamiento de anotaciones/llamada de javac\n\\ \\ \\ \\ -episode : genera un archivo de episodio para una compilaci\u00F3n diferente\n\\ \\ \\ \\ -version : muestra la informaci\u00F3n de la versi\u00F3n\n\\ \\ \\ \\ -fullversion : muestra la informaci\u00F3n completa de la versi\u00F3n\n\\ \\ \\ \\ -help : muestra este mensaje de sintaxis
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
index 1b9109796f0..756a94788fa 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_fr.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = Un \u00E9l\u00E9ment {0} inattendu appara\u00EEt \u00E0
BASEDIR_DOESNT_EXIST = R\u00E9pertoire {0} inexistant
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b141016.1821"
+FULLVERSION = version compl\u00E8te de schemagen "2.2.12-b150126.1924"
USAGE = Syntaxe : schemagen [-options ...] \nOptions : \n\ \ \ \ -d : indiquez o\u00F9 placer les fichiers de classe g\u00E9n\u00E9r\u00E9s par le processeur et le compilateur javac\n\ \ \ \ -cp : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -classpath : indiquez o\u00F9 trouver les fichiers sp\u00E9cifi\u00E9s par l'utilisateur\n\ \ \ \ -encoding : indiquez l'encodage \u00E0 utiliser pour l'appel de javac/traitement de l'annotation \n\ \ \ \ -episode : g\u00E9n\u00E9rez un fichier d'\u00E9pisode pour la compilation s\u00E9par\u00E9e\n\ \ \ \ -version : affichez les informations de version\n\ \ \ \ -fullversion : affichez les informations compl\u00E8tes de version\n\ \ \ \ -help : affichez ce message de syntaxe
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
index ba82f11fe95..992b68e2c77 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_it.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} imprevisto visualizzato sulla riga {1} colonna {2}
BASEDIR_DOESNT_EXIST = Directory non esistente: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = versione completa schemagen "2.2.12-b141016.1821"
+FULLVERSION = versione completa schemagen "2.2.12-b150126.1924"
USAGE = Uso: schemagen [-options ...] \nOpzioni: \n\ \ \ \ -d : specifica dove posizionare il processore e i file della classe generata javac\n\ \ \ \ -cp : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -classpath : specifica dove trovare i file specificati dall'utente\n\ \ \ \ -encoding : specifica la codifica da usare per l'elaborazione dell'annotazione/richiamo javac \n\ \ \ \ -episode : genera il file di episodio per la compilazione separata\n\ \ \ \ -version : visualizza le informazioni sulla versione\n\ \ \ \ -fullversion : visualizza le informazioni sulla versione completa\n\ \ \ \ -help : visualizza questo messaggio sull'uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
index bd3107c2387..bf3e933ce1c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ja.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u4E88\u671F\u3057\u306A\u3044{0}\u304C\u884C{1}\u3001\u
BASEDIR_DOESNT_EXIST = \u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304C\u5B58\u5728\u3057\u307E\u305B\u3093: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+FULLVERSION = schemagen\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
USAGE = \u4F7F\u7528\u65B9\u6CD5: schemagen [-options ...] \n\u30AA\u30D7\u30B7\u30E7\u30F3: \n\ \ \ \ -d : \u30D7\u30ED\u30BB\u30C3\u30B5\u304A\u3088\u3073javac\u304C\u751F\u6210\u3057\u305F\u30AF\u30E9\u30B9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u7F6E\u304F\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -cp : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -classpath : \u30E6\u30FC\u30B6\u30FC\u304C\u6307\u5B9A\u3057\u305F\u30D5\u30A1\u30A4\u30EB\u3092\u691C\u7D22\u3059\u308B\u4F4D\u7F6E\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -encoding : \u6CE8\u91C8\u51E6\u7406/javac\u547C\u51FA\u3057\u306B\u4F7F\u7528\u3059\u308B\u30A8\u30F3\u30B3\u30FC\u30C7\u30A3\u30F3\u30B0\u3092\u6307\u5B9A\u3057\u307E\u3059\n\ \ \ \ -episode : \u30B3\u30F3\u30D1\u30A4\u30EB\u3054\u3068\u306B\u30A8\u30D4\u30BD\u30FC\u30C9\u30FB\u30D5\u30A1\u30A4\u30EB\u3092\u751F\u6210\u3057\u307E\u3059\n\ \ \ \ -version : \u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -fullversion : \u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\u8868\u793A\u3057\u307E\u3059\n\ \ \ \ -help : \u3053\u306E\u4F7F\u7528\u4F8B\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3057\u307E\u3059
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
index 642294c211d..31ba0ab9637 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_ko.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \uC608\uC0C1\uCE58 \uC54A\uC740 {0}\uC774(\uAC00) {1}\uD
BASEDIR_DOESNT_EXIST = \uC874\uC7AC\uD558\uC9C0 \uC54A\uB294 \uB514\uB809\uD1A0\uB9AC: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+FULLVERSION = schemagen \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
USAGE = \uC0AC\uC6A9\uBC95: schemagen [-options ...] \n\uC635\uC158: \n\ \ \ \ -d : \uD504\uB85C\uC138\uC11C \uBC0F javac\uC5D0\uC11C \uC0DD\uC131\uD55C \uD074\uB798\uC2A4 \uD30C\uC77C\uC744 \uBC30\uCE58\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -cp : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -classpath : \uC0AC\uC6A9\uC790\uAC00 \uC9C0\uC815\uD55C \uD30C\uC77C\uC744 \uCC3E\uC744 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4.\n\ \ \ \ -encoding : \uC8FC\uC11D \uCC98\uB9AC/javac \uD638\uCD9C\uC5D0 \uC0AC\uC6A9\uD560 \uC778\uCF54\uB529\uC744 \uC9C0\uC815\uD569\uB2C8\uB2E4. \n\ \ \ \ -episode : \uBCC4\uB3C4 \uCEF4\uD30C\uC77C\uC744 \uC704\uD574 episode \uD30C\uC77C\uC744 \uC0DD\uC131\uD569\uB2C8\uB2E4.\n\ \ \ \ -version : \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -fullversion : \uC815\uC2DD \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n\ \ \ \ -help : \uC774 \uC0AC\uC6A9\uBC95 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
index c4284ad4ff2..c2f4155d874 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_pt_BR.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = {0} inesperado aparece na linha {1} coluna {2}
BASEDIR_DOESNT_EXIST = Diret\u00F3rio n\u00E3o existente: {0}
-VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b141016.1821
+VERSION = gera\u00E7\u00E3o do esquema 2.2.12-b150126.1924
-FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b141016.1821"
+FULLVERSION = vers\u00E3o completa da gera\u00E7\u00E3o do esquema "2.2.12-b150126.1924"
USAGE = Uso: gera\u00E7\u00E3o do esquema [-options ...] \nOp\u00E7\u00F5es: \n\\ \\ \\ \\ -d : especificar onde colocar o processador e os arquivos da classe gerados por javac\n\\ \\ \\ \\ -cp : especificar onde localizar arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -classpath : especificar onde localizar os arquivos especificados pelo usu\u00E1rio\n\\ \\ \\ \\ -encoding : especificar codifica\u00E7\u00E3o a ser usada para processamento de anota\u00E7\u00E3o/chamada javac \n\\ \\ \\ \\ -episode : gerar arquivo do epis\u00F3dio para compila\u00E7\u00E3o separada\n\\ \\ \\ \\ -version : exibir informa\u00E7\u00F5es da vers\u00E3o\n\\ \\ \\ \\ -fullversion : exibir informa\u00E7\u00F5es da vers\u00E3o completa\n\\ \\ \\ \\ -help : exibir esta mensagem de uso
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
index c89cc1ebf51..cec06517656 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_CN.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u5728\u7B2C {1} \u884C, \u7B2C {2} \u5217\u51FA\u73B0\u
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u5F55: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9009\u9879: \n\ \ \ \ -d : \u6307\u5B9A\u653E\u7F6E\u5904\u7406\u7A0B\u5E8F\u548C javac \u751F\u6210\u7684\u7C7B\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -cp : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -classpath : \u6307\u5B9A\u67E5\u627E\u7528\u6237\u6307\u5B9A\u6587\u4EF6\u7684\u4F4D\u7F6E\n\ \ \ \ -encoding : \u6307\u5B9A\u7528\u4E8E\u6CE8\u91CA\u5904\u7406/javac \u8C03\u7528\u7684\u7F16\u7801\n\ \ \ \ -episode : \u751F\u6210\u7247\u6BB5\u6587\u4EF6\u4EE5\u4F9B\u5355\u72EC\u7F16\u8BD1\n\ \ \ \ -version : \u663E\u793A\u7248\u672C\u4FE1\u606F\n\ \ \ \ -fullversion : \u663E\u793A\u5B8C\u6574\u7684\u7248\u672C\u4FE1\u606F\n\ \ \ \ -help : \u663E\u793A\u6B64\u7528\u6CD5\u6D88\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
index f6e5241eebc..938aef76528 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/jxc/MessageBundle_zh_TW.properties
@@ -27,8 +27,8 @@ UNEXPECTED_NGCC_TOKEN = \u672A\u9810\u671F\u7684 {0} \u986F\u793A\u65BC\u884C {1
BASEDIR_DOESNT_EXIST = \u4E0D\u5B58\u5728\u7684\u76EE\u9304: {0}
-VERSION = schemagen 2.2.12-b141016.1821
+VERSION = schemagen 2.2.12-b150126.1924
-FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+FULLVERSION = schemagen \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
USAGE = \u7528\u6CD5: schemagen [-options ...] \n\u9078\u9805: \n\\ \\ \\ \\ -d : \u6307\u5B9A\u8655\u7406\u5668\u4EE5\u53CA javac \u7522\u751F\u7684\u985E\u5225\u6A94\u6848\u653E\u7F6E\u4F4D\u7F6E\n\\ \\ \\ \\ -cp : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -classpath : \u6307\u5B9A\u8981\u5C0B\u627E\u4F7F\u7528\u8005\u6307\u5B9A\u6A94\u6848\u7684\u4F4D\u7F6E\n\\ \\ \\ \\ -encoding : \u6307\u5B9A\u8981\u7528\u65BC\u8A3B\u89E3\u8655\u7406/javac \u547C\u53EB\u7684\u7DE8\u78BC \n\\ \\ \\ \\ -episode : \u7522\u751F\u7368\u7ACB\u7DE8\u8B6F\u7684\u4E8B\u4EF6 (episode) \u6A94\u6848\n\\ \\ \\ \\ -version : \u986F\u793A\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -fullversion : \u986F\u793A\u5B8C\u6574\u7248\u672C\u8CC7\u8A0A\n\\ \\ \\ \\ -help : \u986F\u793A\u6B64\u7528\u6CD5\u8A0A\u606F
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
index adbe668bfb0..fd88f7f2d7f 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle.properties
@@ -171,20 +171,20 @@ Driver.CompilingSchema = \
Driver.FailedToGenerateCode = \
Failed to produce code.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
Driver.FilePrologComment = \
- This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \n\
+ This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \n\
See http://java.sun.com/xml/jaxb \n\
Any modifications to this file will be lost upon recompilation of the source schema. \n\
Generated on: {0} \n
Driver.Version = \
- xjc 2.2.12-b141016.1821
+ xjc 2.2.12-b150126.1924
Driver.FullVersion = \
- xjc full version "2.2.12-b141016.1821"
+ xjc full version "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
index df277d39716..97271e9de79 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_de.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = Ein Schema wird kompiliert ...
Driver.FailedToGenerateCode = Code konnte nicht erzeugt werden.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Diese Datei wurde mit der JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 generiert \nSiehe http://java.sun.com/xml/jaxb \n\u00c4nderungen an dieser Datei gehen bei einer Neukompilierung des Quellschemas verloren. \nGeneriert: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b141016.1821"
+Driver.FullVersion = xjc vollst\u00E4ndige Version "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
index d27e3ef36d3..eadb52fac88 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_es.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = Compilando un esquema...
Driver.FailedToGenerateCode = Fallo al producir c\u00f3digo.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b141016.1821 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Este archivo ha sido generado por la arquitectura JavaTM para la implantaci\u00f3n de la referencia de enlace (JAXB) XML v2.2.12-b150126.1924 \nVisite http://java.sun.com/xml/jaxb \nTodas las modificaciones realizadas en este archivo se perder\u00e1n si se vuelve a compilar el esquema de origen. \nGenerado el: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versi\u00F3n completa de xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
index 8f3deded4f1..dd19a1687df 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_fr.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilation d'un sch\u00e9ma...
Driver.FailedToGenerateCode = Echec de la production du code.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b141016.1821 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Ce fichier a \u00e9t\u00e9 g\u00e9n\u00e9r\u00e9 par l''impl\u00e9mentation de r\u00e9f\u00e9rence JavaTM Architecture for XML Binding (JAXB), v2.2.12-b150126.1924 \nVoir http://java.sun.com/xml/jaxb \nToute modification apport\u00e9e \u00e0 ce fichier sera perdue lors de la recompilation du sch\u00e9ma source. \nG\u00e9n\u00e9r\u00e9 le : {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b141016.1821"
+Driver.FullVersion = version compl\u00E8te xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
index 21f60a899e8..f259cb3d291 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_it.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilazione di uno schema in corso...
Driver.FailedToGenerateCode = Produzione del codice non riuscita.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b141016.1821 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Questo file \u00e8 stato generato dall''architettura JavaTM per XML Binding (JAXB) Reference Implementation, v2.2.12-b150126.1924 \nVedere http://java.sun.com/xml/jaxb \nQualsiasi modifica a questo file andr\u00e0 persa durante la ricompilazione dello schema di origine. \nGenerato il: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = versione completa xjc "2.2.12-b141016.1821"
+Driver.FullVersion = versione completa xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
index 342dbcaca62..9674081427e 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ja.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u30b9\u30ad\u30fc\u30de\u306e\u30b3\u30f3\u30d1\u30a4\
Driver.FailedToGenerateCode = \u30b3\u30fc\u30c9\u306e\u751f\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b141016.1821\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306f\u3001JavaTM Architecture for XML Binding(JAXB) Reference Implementation\u3001v2.2.12-b150126.1924\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u307e\u3057\u305f \nhttp://java.sun.com/xml/jaxb\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044 \n\u30bd\u30fc\u30b9\u30fb\u30b9\u30ad\u30fc\u30de\u306e\u518d\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u306e\u5909\u66f4\u306f\u5931\u308f\u308c\u307e\u3059\u3002 \n\u751f\u6210\u65e5: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b141016.1821"
+Driver.FullVersion = xjc\u30D5\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3"2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
index 97cf258262e..3715185d805 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_ko.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \uc2a4\ud0a4\ub9c8\ub97c \ucef4\ud30c\uc77c\ud558\ub294
Driver.FailedToGenerateCode = \ucf54\ub4dc \uc0dd\uc131\uc744 \uc2e4\ud328\ud588\uc2b5\ub2c8\ub2e4.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b141016.1821 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \uc774 \ud30c\uc77c\uc740 JAXB(JavaTM Architecture for XML Binding) \ucc38\uc870 \uad6c\ud604 2.2.12-b150126.1924 \ubc84\uc804\uc744 \ud1b5\ud574 \uc0dd\uc131\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \nhttp://java.sun.com/xml/jaxb\ub97c \ucc38\uc870\ud558\uc2ed\uc2dc\uc624. \n\uc774 \ud30c\uc77c\uc744 \uc218\uc815\ud558\uba74 \uc18c\uc2a4 \uc2a4\ud0a4\ub9c8\ub97c \uc7ac\ucef4\ud30c\uc77c\ud560 \ub54c \uc218\uc815 \uc0ac\ud56d\uc774 \uc190\uc2e4\ub429\ub2c8\ub2e4. \n\uc0dd\uc131 \ub0a0\uc9dc: {0} \n
-Driver.Version = XJC 2.2.12-b141016.1821
+Driver.Version = XJC 2.2.12-b150126.1924
-Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b141016.1821"
+Driver.FullVersion = XJC \uC815\uC2DD \uBC84\uC804 "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
index 395ede3aefc..9f44278b4eb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_pt_BR.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = compilando um esquema...
Driver.FailedToGenerateCode = Falha ao produzir o c\u00f3digo.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b141016.1821 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = Este arquivo foi gerado pela Arquitetura JavaTM para Implementa\u00e7\u00e3o de Refer\u00eancia (JAXB) de Bind XML, v2.2.12-b150126.1924 \nConsulte http://java.sun.com/xml/jaxb \nTodas as modifica\u00e7\u00f5es neste arquivo ser\u00e3o perdidas ap\u00f3s a recompila\u00e7\u00e3o do esquema de origem. \nGerado em: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b141016.1821"
+Driver.FullVersion = vers\u00E3o completa de xjc "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
index 048488a1500..11276a8352a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_CN.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7f16\u8bd1\u6a21\u5f0f...
Driver.FailedToGenerateCode = \u65e0\u6cd5\u751f\u6210\u4ee3\u7801\u3002
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b141016.1821 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u6b64\u6587\u4ef6\u662f\u7531 JavaTM Architecture for XML Binding (JAXB) \u5f15\u7528\u5b9e\u73b0 v2.2.12-b150126.1924 \u751f\u6210\u7684\n\u8bf7\u8bbf\u95ee http://java.sun.com/xml/jaxb \n\u5728\u91cd\u65b0\u7f16\u8bd1\u6e90\u6a21\u5f0f\u65f6, \u5bf9\u6b64\u6587\u4ef6\u7684\u6240\u6709\u4fee\u6539\u90fd\u5c06\u4e22\u5931\u3002\n\u751f\u6210\u65f6\u95f4: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
index 185fc08bdb7..27227f5b5c5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/MessageBundle_zh_TW.properties
@@ -96,14 +96,14 @@ Driver.CompilingSchema = \u6b63\u5728\u7de8\u8b6f\u7db1\u8981...
Driver.FailedToGenerateCode = \u7121\u6cd5\u7522\u751f\u7a0b\u5f0f\u78bc.
-# DO NOT localize the 2.2.12-b141016.1821 string - it is a token for an mvn
-Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b141016.1821 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
+# DO NOT localize the 2.2.12-b150126.1924 string - it is a token for an mvn
+Driver.FilePrologComment = \u6b64\u6a94\u6848\u662f\u7531 JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.12-b150126.1924 \u6240\u7522\u751f \n\u8acb\u53c3\u95b1 http://java.sun.com/xml/jaxb \n\u4e00\u65e6\u91cd\u65b0\u7de8\u8b6f\u4f86\u6e90\u7db1\u8981, \u5c0d\u6b64\u6a94\u6848\u6240\u505a\u7684\u4efb\u4f55\u4fee\u6539\u90fd\u5c07\u6703\u907a\u5931. \n\u7522\u751f\u6642\u9593: {0} \n
-Driver.Version = xjc 2.2.12-b141016.1821
+Driver.Version = xjc 2.2.12-b150126.1924
-Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b141016.1821"
+Driver.FullVersion = xjc \u5B8C\u6574\u7248\u672C "2.2.12-b150126.1924"
-Driver.BuildID = 2.2.12-b141016.1821
+Driver.BuildID = 2.2.12-b150126.1924
# for JDK integration - include version in source zip
jaxb.jdk.version=@@JAXB_JDK_VERSION@@
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
index fefa33f9830..275dfd70ced 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/Options.java
@@ -32,18 +32,18 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringWriter;
-import java.lang.reflect.Array;
-import java.lang.reflect.InvocationTargetException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;
+import java.util.ServiceLoader;
import java.util.Set;
import com.sun.codemodel.internal.CodeWriter;
@@ -354,9 +354,7 @@ public class Options
*/
public List getAllPlugins() {
if(allPlugins==null) {
- allPlugins = new ArrayList();
- ClassLoader ucl = getUserClassLoader(SecureLoader.getClassClassLoader(getClass()));
- allPlugins.addAll(Arrays.asList(findServices(Plugin.class,ucl)));
+ allPlugins = findServices(Plugin.class);
}
return allPlugins;
@@ -924,118 +922,44 @@ public class Options
/**
* If a plugin failed to load, report.
*/
- private static String pluginLoadFailure;
+ private String pluginLoadFailure;
/**
* Looks for all "META-INF/services/[className]" files and
* create one instance for each class name found inside this file.
*/
- private static T[] findServices( Class clazz, ClassLoader classLoader ) {
- // if true, print debug output
- final boolean debug = com.sun.tools.internal.xjc.util.Util.getSystemProperty(Options.class,"findServices")!=null;
-
- // if we are running on Mustang or Dolphin, use ServiceLoader
- // so that we can take advantage of JSR-277 module system.
+ private List findServices( Class clazz) {
+ final List result = new ArrayList();
+ final boolean debug = getDebugPropertyValue();
try {
- Class> serviceLoader = Class.forName("java.util.ServiceLoader");
- if(debug)
- System.out.println("Using java.util.ServiceLoader");
- Iterable itr = (Iterable)serviceLoader.getMethod("load",Class.class,ClassLoader.class).invoke(null,clazz,classLoader);
- List r = new ArrayList();
- for (T t : itr)
- r.add(t);
- return r.toArray((T[])Array.newInstance(clazz,r.size()));
- } catch (ClassNotFoundException e) {
- // fall through
- } catch (IllegalAccessException e) {
- Error x = new IllegalAccessError();
- x.initCause(e);
- throw x;
- } catch (InvocationTargetException e) {
- Throwable x = e.getTargetException();
- if (x instanceof RuntimeException)
- throw (RuntimeException) x;
- if (x instanceof Error)
- throw (Error) x;
- throw new Error(x);
- } catch (NoSuchMethodException e) {
- Error x = new NoSuchMethodError();
- x.initCause(e);
- throw x;
- }
-
- String serviceId = "META-INF/services/" + clazz.getName();
-
- // used to avoid creating the same instance twice
- Set classNames = new HashSet();
-
- if(debug) {
- System.out.println("Looking for "+serviceId+" for add-ons");
- }
-
- // try to find services in CLASSPATH
- try {
- Enumeration e = classLoader.getResources(serviceId);
- if(e==null) return (T[])Array.newInstance(clazz,0);
-
- ArrayList a = new ArrayList();
- while(e.hasMoreElements()) {
- URL url = e.nextElement();
- BufferedReader reader=null;
-
- if(debug) {
- System.out.println("Checking "+url+" for an add-on");
- }
-
- try {
- reader = new BufferedReader(new InputStreamReader(url.openStream()));
- String impl;
- while((impl = reader.readLine())!=null ) {
- // try to instanciate the object
- impl = impl.trim();
- if(classNames.add(impl)) {
- Class implClass = classLoader.loadClass(impl);
- if(!clazz.isAssignableFrom(implClass)) {
- pluginLoadFailure = impl+" is not a subclass of "+clazz+". Skipping";
- if(debug)
- System.out.println(pluginLoadFailure);
- continue;
- }
- if(debug) {
- System.out.println("Attempting to instanciate "+impl);
- }
- a.add(clazz.cast(implClass.newInstance()));
- }
- }
- reader.close();
- } catch( Exception ex ) {
- // let it go.
- StringWriter w = new StringWriter();
- ex.printStackTrace(new PrintWriter(w));
- pluginLoadFailure = w.toString();
- if(debug) {
- System.out.println(pluginLoadFailure);
- }
- if( reader!=null ) {
- try {
- reader.close();
- } catch( IOException ex2 ) {
- // ignore
- }
- }
- }
- }
-
- return a.toArray((T[])Array.newInstance(clazz,a.size()));
+ // TCCL allows user plugins to be loaded even if xjc is in jdk
+ // We have to use our SecureLoader to obtain it because we are trying to avoid SecurityException
+ final ClassLoader tccl = SecureLoader.getContextClassLoader();
+ final ServiceLoader sl = ServiceLoader.load(clazz, tccl);
+ for (T t : sl)
+ result.add(t);
} catch( Throwable e ) {
// ignore any error
StringWriter w = new StringWriter();
e.printStackTrace(new PrintWriter(w));
pluginLoadFailure = w.toString();
- if(debug) {
+ if(debug)
System.out.println(pluginLoadFailure);
- }
- return (T[])Array.newInstance(clazz,0);
+ }
+ return result;
+ }
+
+ private static boolean getDebugPropertyValue() {
+ final String debugPropertyName = Options.class.getName() + ".findServices";
+ if (System.getSecurityManager() != null) {
+ return AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
+ public Boolean run() {
+ return Boolean.getBoolean(debugPropertyName);
+ }
+ });
+ } else {
+ return Boolean.getBoolean(debugPropertyName);
}
}
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
index 426a06b1b39..d17afa13387 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementCollectionAdapter.java
@@ -40,7 +40,7 @@ import com.sun.codemodel.internal.JForEach;
import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.model.CElementInfo;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
index cad3f700def..77a63b152d7 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/ElementSingleAdapter.java
@@ -33,7 +33,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.codemodel.internal.JConditional;
import com.sun.codemodel.internal.JExpr;
import com.sun.codemodel.internal.JExpression;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldOutline;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.model.CElementInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
index 444a5576175..a9182ec74ae 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/api/impl/s2j/TypeAndAnnotationImpl.java
@@ -36,7 +36,7 @@ import com.sun.tools.internal.xjc.generator.annotation.spec.XmlJavaTypeAdapterWr
import com.sun.tools.internal.xjc.model.CAdapter;
import com.sun.tools.internal.xjc.model.TypeUse;
import com.sun.tools.internal.xjc.model.nav.NType;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.runtime.SwaRefAdapterMarker;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
index a8082b3eb35..6b383810edd 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/BeanGenerator.java
@@ -25,7 +25,7 @@
package com.sun.tools.internal.xjc.generator.bean;
-import static com.sun.tools.internal.xjc.model.Aspect.EXPOSED;
+import static com.sun.tools.internal.xjc.outline.Aspect.EXPOSED;
import java.io.Serializable;
import java.net.URL;
@@ -90,7 +90,7 @@ import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.Model;
import com.sun.tools.internal.xjc.model.CClassRef;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.ClassOutline;
import com.sun.tools.internal.xjc.outline.EnumConstantOutline;
import com.sun.tools.internal.xjc.outline.EnumOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
index c0ed6134d6a..8d71f17ad36 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ElementOutlineImpl.java
@@ -39,7 +39,7 @@ import com.sun.codemodel.internal.JMethod;
import com.sun.codemodel.internal.JMod;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.CElementInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.ElementOutline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
index 5e3a32d0876..9a9a559831a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ImplStructureStrategy.java
@@ -42,7 +42,7 @@ import com.sun.codemodel.internal.JType;
import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.annotation.spec.XmlAccessorTypeWriter;
import com.sun.tools.internal.xjc.model.CClassInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
index 71d6a5d551a..6ed5b8327bb 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/ObjectFactoryGeneratorImpl.java
@@ -51,7 +51,7 @@ import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.Constructor;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
import com.sun.xml.internal.bind.v2.TODO;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
index 04d024c3b87..5ffc3e31150 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PackageOutlineImpl.java
@@ -49,7 +49,7 @@ import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
import com.sun.tools.internal.xjc.model.Model;
import com.sun.tools.internal.xjc.outline.PackageOutline;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
/**
* {@link PackageOutline} enhanced with schema2java specific
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
index b43bd348af9..0d28eb4cc23 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PrivateObjectFactoryGenerator.java
@@ -32,7 +32,7 @@ import com.sun.codemodel.internal.JPackage;
import com.sun.codemodel.internal.fmt.JPropertyFile;
import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.runtime.JAXBContextFactory;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
index 31afd1df0ee..f0105e59806 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/PublicObjectFactoryGenerator.java
@@ -28,7 +28,7 @@ package com.sun.tools.internal.xjc.generator.bean;
import com.sun.codemodel.internal.JPackage;
import com.sun.tools.internal.xjc.model.CElementInfo;
import com.sun.tools.internal.xjc.model.Model;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
/**
* Generates public ObjectFactory.
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
index 79a7c2084d3..318fa4271d9 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/AbstractField.java
@@ -63,8 +63,8 @@ import com.sun.tools.internal.xjc.model.CTypeInfo;
import com.sun.tools.internal.xjc.model.CTypeRef;
import com.sun.tools.internal.xjc.model.CValuePropertyInfo;
import com.sun.tools.internal.xjc.model.nav.NClass;
-import com.sun.tools.internal.xjc.model.Aspect;
-import static com.sun.tools.internal.xjc.model.Aspect.IMPLEMENTATION;
+import com.sun.tools.internal.xjc.outline.Aspect;
+import static com.sun.tools.internal.xjc.outline.Aspect.IMPLEMENTATION;
import com.sun.tools.internal.xjc.outline.ClassOutline;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.tools.internal.xjc.outline.FieldOutline;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
index 0535385cefe..331ca3ed8c2 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/ContentListField.java
@@ -38,7 +38,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import java.io.Serializable;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
index b1fe84d32de..28c061fe9e9 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/NoExtendedContentField.java
@@ -40,7 +40,7 @@ import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CElement;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
import com.sun.tools.internal.xjc.model.CReferencePropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.api.impl.NameConverter;
import java.io.Serializable;
import java.util.Set;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
index d1d60072d9e..97eaabdb59c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/generator/bean/field/UnboxedField.java
@@ -35,7 +35,7 @@ import com.sun.codemodel.internal.JVar;
import com.sun.tools.internal.xjc.generator.bean.ClassOutlineImpl;
import com.sun.tools.internal.xjc.generator.bean.MethodWriter;
import com.sun.tools.internal.xjc.model.CPropertyInfo;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.FieldAccessor;
import com.sun.xml.internal.bind.api.impl.NameConverter;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
index fb5ce6a5f5c..b4f90f58249 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CAdapter.java
@@ -34,6 +34,7 @@ import com.sun.tools.internal.xjc.model.nav.EagerNClass;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.Adapter;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
index 2fc179cf2da..d1d3c142a63 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CArrayInfo.java
@@ -28,6 +28,7 @@ package com.sun.tools.internal.xjc.model;
import javax.xml.namespace.QName;
import com.sun.codemodel.internal.JType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.v2.model.util.ArrayInfoUtil;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
index d4f50da7f3c..48ee3c7b1b3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CBuiltinLeafInfo.java
@@ -49,6 +49,7 @@ import com.sun.codemodel.internal.JExpr;
import com.sun.codemodel.internal.JExpression;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.core.BuiltinLeafInfo;
import com.sun.xml.internal.bind.v2.model.core.Element;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
index c74ee55c578..9dcb52738da 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassInfo.java
@@ -45,6 +45,7 @@ import com.sun.istack.internal.Nullable;
import com.sun.tools.internal.xjc.Language;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.Ring;
import com.sun.tools.internal.xjc.reader.xmlschema.BGMBuilder;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
index f546e28ce2e..9e22dfd60b3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CClassRef.java
@@ -30,6 +30,7 @@ import javax.xml.namespace.QName;
import com.sun.codemodel.internal.JClass;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIClass;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIEnum;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
index 6a7419bdddd..8526bfaff7b 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CElementInfo.java
@@ -43,6 +43,7 @@ import static com.sun.tools.internal.xjc.model.CElementPropertyInfo.CollectionMo
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIInlineBinaryData;
import com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIFactoryMethod;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
index 2914606bc84..463f8d3df26 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CEnumLeafInfo.java
@@ -34,6 +34,7 @@ import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JExpression;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.annotation.Locatable;
import com.sun.xml.internal.bind.v2.model.core.EnumLeafInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
index d5c64a83679..d7bbf3b38e5 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CReferencePropertyInfo.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model;
import java.util.Collection;
-import java.util.HashSet;
+import java.util.LinkedHashSet;
import java.util.Set;
import java.util.Map;
@@ -60,7 +60,7 @@ public final class CReferencePropertyInfo extends CPropertyInfo implements Refer
/**
* List of referenced elements.
*/
- private final Set elements = new HashSet();
+ private final Set elements = new LinkedHashSet();
private final boolean isMixed;
private WildcardMode wildcard;
@@ -87,7 +87,7 @@ public final class CReferencePropertyInfo extends CPropertyInfo implements Refer
// so the Java types of the substitution members need to be taken into account
// when computing the signature
- final class RefList extends HashSet {
+ final class RefList extends LinkedHashSet {
RefList() {
super(elements.size());
addAll(elements);
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
index a987439c694..53fec35534c 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CTypeInfo.java
@@ -29,6 +29,7 @@ import com.sun.codemodel.internal.JClass;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.TypeInfo;
@@ -44,7 +45,7 @@ public interface CTypeInfo extends TypeInfo, CCustomizable {
* Returns the {@link JClass} that represents the class being bound,
* under the given {@link Outline}.
*
- * @see NType#toType(Outline, Aspect)
+ * @see NType#toType(Outline, com.sun.tools.internal.xjc.outline.Aspect)
*/
JType toType(Outline o, Aspect aspect);
}
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
index 58506956982..8da2c69a2cf 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/CWildcardTypeInfo.java
@@ -29,6 +29,7 @@ import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.model.nav.NClass;
import com.sun.tools.internal.xjc.model.nav.NType;
import com.sun.tools.internal.xjc.model.nav.NavigatorImpl;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
import com.sun.xml.internal.bind.v2.model.core.WildcardTypeInfo;
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
index 2fadd1cfea5..979269f345a 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNClass.java
@@ -30,7 +30,7 @@ import java.util.HashSet;
import java.util.Set;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
index dbb598c0db4..fc7f2058fd3 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/EagerNType.java
@@ -28,7 +28,7 @@ package com.sun.tools.internal.xjc.model.nav;
import java.lang.reflect.Type;
import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
index 3499949bdb2..9a48f0f08ce 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClass.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
index 558f15740ea..61b82533b67 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NClassByJClass.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
index b7a2c9a647d..1747c735b92 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NParameterizedType.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JClass;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
index 4e30ccf7c38..e95c2084386 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/nav/NType.java
@@ -26,7 +26,7 @@
package com.sun.tools.internal.xjc.model.nav;
import com.sun.codemodel.internal.JType;
-import com.sun.tools.internal.xjc.model.Aspect;
+import com.sun.tools.internal.xjc.outline.Aspect;
import com.sun.tools.internal.xjc.outline.Outline;
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
similarity index 91%
rename from jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java
rename to jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
index 7d825b60844..f8fa0b13355 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/model/Aspect.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Aspect.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -23,7 +23,7 @@
* questions.
*/
-package com.sun.tools.internal.xjc.model;
+package com.sun.tools.internal.xjc.outline;
import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
@@ -35,6 +35,8 @@ import com.sun.tools.internal.xjc.generator.bean.ImplStructureStrategy;
* This is an enumeration of all possible aspects.
*
* @author Kohsuke Kawaguchi
+ *
+ * TODO: move this to the model package. We cannot do this before JAXB3 because of old plugins
*/
public enum Aspect {
/**
diff --git a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
index 49a8b911e93..d49f2c0ba04 100644
--- a/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
+++ b/jaxws/src/jdk.xml.bind/share/classes/com/sun/tools/internal/xjc/outline/Outline.java
@@ -33,7 +33,6 @@ import com.sun.codemodel.internal.JCodeModel;
import com.sun.codemodel.internal.JPackage;
import com.sun.codemodel.internal.JType;
import com.sun.tools.internal.xjc.ErrorReceiver;
-import com.sun.tools.internal.xjc.model.Aspect;
import com.sun.tools.internal.xjc.model.CClassInfo;
import com.sun.tools.internal.xjc.model.CClassInfoParent;
import com.sun.tools.internal.xjc.model.CElementInfo;
diff --git a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
index 1ae4b3cd94f..b18bbc710b0 100644
--- a/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
+++ b/jaxws/src/jdk.xml.ws/share/classes/com/sun/tools/internal/ws/version.properties
@@ -23,7 +23,7 @@
# questions.
#
-build-id=2.2.11-b141124.1933
-build-version=JAX-WS RI 2.2.11-b141124.1933
+build-id=2.2.11-b150127.1410
+build-version=JAX-WS RI 2.2.11-b150127.1410
major-version=2.2.11
-svn-revision=312b19a2e0e312b55e1ea6f531bd595955cd581f
+svn-revision=28121d09ed8ac02b76788709ccb4cdb66e03bbfa
diff --git a/jdk/.hgtags b/jdk/.hgtags
index c5a3e91f84e..1eb1a114227 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -291,3 +291,6 @@ e336cbd8b15e959e70ed02f0f5e93fa76ebd4c07 jdk9-b41
efedac7f44ed41cea2b1038138047271f55aacba jdk9-b46
b641c14730ac05d9ec8b4f66e6fca3dc21adb403 jdk9-b47
ebb2eb7f1aec78eb6d8cc4c96f018afa11093cde jdk9-b48
+541a8cef4e0d54c3e4b52a98c6af3c31e2096669 jdk9-b49
+f6b8edd397ee463be208fee27517c99101293267 jdk9-b50
+a0dad230aeb3b0d5cfd5b0715029e48d50573f8c jdk9-b51
diff --git a/jdk/make/Tools.gmk b/jdk/make/Tools.gmk
index 32174efec0c..0165341c491 100644
--- a/jdk/make/Tools.gmk
+++ b/jdk/make/Tools.gmk
@@ -147,6 +147,15 @@ $(eval $(call SetupJavaCompilation,BUILD_INTERIM_JIMAGE, \
EXCLUDES := jdk/internal/jimage/concurrent, \
BIN := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes))
+# Because of the explicit INCLUDES in the compilation setup above, the service provider
+# file will not be copied unless META-INF/services would also be added to the INCLUDES.
+# Adding META-INF/services would include all files in that directory when only the one
+# is needed, which is why this explicit copy is defined instead.
+$(eval $(call SetupCopyFiles,COPY_JIMAGE_SERVICE_PROVIDER, \
+ SRC := $(JDK_TOPDIR)/src/java.base/share/classes, \
+ DEST := $(BUILDTOOLS_OUTPUTDIR)/interim_jimage_classes, \
+ FILES := META-INF/services/java.nio.file.spi.FileSystemProvider))
+
##########################################################################################
# Tools needed on solaris because OBJCOPY is broken.
@@ -173,7 +182,7 @@ ifeq ($(OPENJDK_TARGET_OS), solaris)
PROGRAM := fix_empty_sec_hdr_flags))
endif
-$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE)
+$(BUILD_TOOLS_JDK): $(BUILD_INTERIM_JIMAGE) $(COPY_JIMAGE_SERVICE_PROVIDER)
java-tools: $(BUILD_TOOLS_JDK)
diff --git a/jdk/make/copy/Copy-java.base.gmk b/jdk/make/copy/Copy-java.base.gmk
index c4f1c6c025a..296442e0f13 100644
--- a/jdk/make/copy/Copy-java.base.gmk
+++ b/jdk/make/copy/Copy-java.base.gmk
@@ -60,16 +60,28 @@ ifneq ($(findstring $(OPENJDK_TARGET_OS), windows aix),)
endif
################################################################################
-# Copy msvcrXX.dll on windows
-
+# Copy the microsoft runtime libraries on windows
ifeq ($(OPENJDK_TARGET_OS), windows)
- MSVCR_TARGET := $(LIB_DST_DIR)/$(notdir $(MSVCR_DLL))
- # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
- $(MSVCR_TARGET): $(MSVCR_DLL)
- $(call install-file)
- $(CHMOD) a+rx $@
- TARGETS += $(MSVCR_TARGET)
+ # Chmod to avoid permission issues if bundles are unpacked on unix platforms.
+ define copy-and-chmod
+ $(install-file)
+ $(CHMOD) a+rx $@
+ endef
+
+ # Use separate macro calls in case the source files are not in the same
+ # directory.
+ $(eval $(call SetupCopyFiles,COPY_MSVCR, \
+ DEST := $(LIB_DST_DIR), \
+ FILES := $(MSVCR_DLL), \
+ MACRO := copy-and-chmod))
+
+ $(eval $(call SetupCopyFiles,COPY_MSVCP, \
+ DEST := $(LIB_DST_DIR), \
+ FILES := $(MSVCP_DLL), \
+ MACRO := copy-and-chmod))
+
+ TARGETS += $(COPY_MSVCR) $(COPY_MSVCP)
endif
################################################################################
diff --git a/jdk/make/data/charsetmapping/DoubleByte-X.java.template b/jdk/make/data/charsetmapping/DoubleByte-X.java.template
index 17476e0bff1..4ef582c9317 100644
--- a/jdk/make/data/charsetmapping/DoubleByte-X.java.template
+++ b/jdk/make/data/charsetmapping/DoubleByte-X.java.template
@@ -32,7 +32,8 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.util.Arrays;
import sun.nio.cs.HistoricallyNamedCharset;
-import sun.nio.cs.ext.DoubleByte;
+import sun.nio.cs.DoubleByte;
+import sun.nio.cs.*;
public class $NAME_CLZ$ extends Charset
$IMPLEMENTS$
diff --git a/jdk/make/data/charsetmapping/charsets b/jdk/make/data/charsetmapping/charsets
new file mode 100644
index 00000000000..682a14ca46c
--- /dev/null
+++ b/jdk/make/data/charsetmapping/charsets
@@ -0,0 +1,1818 @@
+#
+# Copyright (c) 2000, 2015, 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.
+#
+
+########################################################
+#
+# Standard charsets provided by StandardCharsets provider.
+#
+# Note that these "standard" charsets listed here are not
+# necessary to be the "Standard charsets" defined in the
+# specification of java.nio.charset.Charset. Instead these
+# are the charsets that this implementation believes should
+# be packaged into the charsets provider class "StandardCharsets"
+# which is initialized at startup time by java.nio.charset.Charset,
+# compared to the charsets packaged in "ExtendedCharsets" provider,
+# which is lazy initialized.
+########################################################
+
+charset US-ASCII US_ASCII
+ package sun.nio.cs
+ type source
+ alias iso-ir-6 # IANA aliases
+ alias ANSI_X3.4-1986
+ alias ISO_646.irv:1991
+ alias ASCII
+ alias ISO646-US
+ alias us
+ alias IBM367
+ alias cp367
+ alias csASCII
+ alias default
+ # Other aliases
+ alias 646 # Solaris POSIX locale
+ alias iso_646.irv:1983
+ alias ANSI_X3.4-1968 # Linux POSIX locale (RedHat)
+ alias ascii7
+
+charset UTF-8 UTF_8
+ package sun.nio.cs
+ type source
+ alias UTF8 # JDK historical
+ alias unicode-1-1-utf-8
+
+charset CESU-8 CESU_8
+ package sun.nio.cs
+ type source
+ alias CESU8
+ alias csCESU-8
+
+charset UTF-16 UTF_16
+ package sun.nio.cs
+ type source
+ alias UTF_16 # JDK historical
+ alias utf16
+ alias unicode
+ alias UnicodeBig
+
+charset UTF-16BE UTF_16BE
+ package sun.nio.cs
+ type source
+ alias UTF_16BE
+ alias ISO-10646-UCS-2
+ alias X-UTF-16BE
+ alias UnicodeBigUnmarked
+
+charset UTF-16LE UTF_16LE
+ package sun.nio.cs
+ type source
+ alias UTF_16LE
+ alias X-UTF-16LE
+ alias UnicodeLittleUnmarked
+
+charset x-UTF-16LE-BOM UTF_16LE_BOM
+ package sun.nio.cs
+ type source
+ alias UnicodeLittle
+
+charset UTF-32 UTF_32
+ package sun.nio.cs
+ type source
+ alias UTF_32
+ alias UTF32
+
+charset UTF-32LE UTF_32LE
+ package sun.nio.cs
+ type source
+ alias UTF_32LE
+ alias X-UTF-32LE
+
+charset UTF-32BE UTF_32BE
+ package sun.nio.cs
+ type source
+ alias UTF_32BE
+ alias X-UTF-32BE
+
+charset X-UTF-32LE-BOM UTF_32LE_BOM
+ package sun.nio.cs
+ type source
+ alias UTF_32LE_BOM
+ alias UTF-32LE-BOM
+
+charset X-UTF-32BE-BOM UTF_32BE_BOM
+ package sun.nio.cs
+ type source
+ alias UTF_32BE_BOM
+ alias UTF-32BE-BOM
+
+charset ISO-8859-1 ISO_8859_1
+ package sun.nio.cs
+ type source
+ alias iso-ir-100 # IANA aliases
+ alias ISO_8859-1
+ alias latin1
+ alias l1
+ alias IBM819
+ alias cp819
+ alias csISOLatin1
+ alias 819 # Other aliases
+ alias IBM-819
+ alias ISO8859_1
+ alias ISO_8859-1:1987
+ alias ISO_8859_1
+ alias 8859_1
+ alias ISO8859-1
+
+charset ISO-8859-2 ISO_8859_2
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_2
+ ascii true
+ alias iso8859_2 # JDK historical
+ alias 8859_2
+ alias iso-ir-101
+ alias ISO_8859-2
+ alias ISO_8859-2:1987
+ alias ISO8859-2
+ alias latin2
+ alias l2
+ alias ibm912
+ alias ibm-912
+ alias cp912
+ alias 912
+ alias csISOLatin2
+
+charset ISO-8859-4 ISO_8859_4
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_4
+ ascii true
+ alias iso8859_4 # JDK historical
+ alias iso8859-4
+ alias 8859_4
+ alias iso-ir-110
+ alias ISO_8859-4
+ alias ISO_8859-4:1988
+ alias latin4
+ alias l4
+ alias ibm914
+ alias ibm-914
+ alias cp914
+ alias 914
+ alias csISOLatin4
+
+charset ISO-8859-5 ISO_8859_5
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_5
+ ascii true
+ alias iso8859_5 # JDK historical
+ alias 8859_5
+ alias iso-ir-144
+ alias ISO_8859-5
+ alias ISO_8859-5:1988
+ alias ISO8859-5
+ alias cyrillic
+ alias ibm915
+ alias ibm-915
+ alias cp915
+ alias 915
+ alias csISOLatinCyrillic
+
+charset ISO-8859-7 ISO_8859_7
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_7
+ ascii true
+ alias iso8859_7 # JDK historical
+ alias 8859_7
+ alias iso-ir-126
+ alias ISO_8859-7
+ alias ISO_8859-7:1987
+ alias ELOT_928
+ alias ECMA-118
+ alias greek
+ alias greek8
+ alias csISOLatinGreek
+ alias sun_eu_greek # Solaris 7/8 compatibility
+ alias ibm813
+ alias ibm-813
+ alias 813
+ alias cp813
+ alias iso8859-7 # Solaris 9 compatibility
+
+charset ISO-8859-9 ISO_8859_9
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_9
+ ascii true
+ alias iso8859_9 # JDK historical
+ alias 8859_9
+ alias iso-ir-148
+ alias ISO_8859-9
+ alias ISO_8859-9:1989
+ alias ISO8859-9
+ alias latin5
+ alias l5
+ alias ibm920
+ alias ibm-920
+ alias 920
+ alias cp920
+ alias csISOLatin5
+
+charset ISO-8859-13 ISO_8859_13
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_13
+ ascii true
+ alias iso8859_13 # JDK historical
+ alias 8859_13
+ alias iso_8859-13
+ alias ISO8859-13
+
+charset ISO-8859-15 ISO_8859_15
+ package sun.nio.cs
+ type sbcs
+ hisname ISO8859_15
+ ascii true
+ alias ISO_8859-15 # IANA alias
+ alias 8859_15 # Other aliases
+ alias ISO-8859-15
+ alias ISO8859_15
+ alias ISO8859-15
+ alias IBM923
+ alias IBM-923
+ alias cp923
+ alias 923
+ alias LATIN0
+ alias LATIN9
+ alias L9
+ alias csISOlatin0
+ alias csISOlatin9
+ alias ISO8859_15_FDIS
+
+charset KOI8-R KOI8_R
+ package sun.nio.cs
+ type sbcs
+ hisname KOI8_R
+ ascii true
+ alias koi8_r # JDK historical
+ alias koi8
+ alias cskoi8r
+
+charset KOI8-U KOI8_U
+ package sun.nio.cs
+ type sbcs
+ hisname KOI8_U
+ ascii true
+ alias koi8_u
+
+charset windows-1250 MS1250
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1250
+ ascii true
+ alias cp1250 # JDK historical
+ alias cp5346 # Euro IBM CCSID
+
+charset windows-1251 MS1251
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1251
+ ascii true
+ alias cp1251 # JDK historical
+ alias cp5347 # Euro IBM CCSID
+ alias ansi-1251 # Solaris compatibility
+
+charset windows-1252 MS1252
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1252
+ ascii true
+ alias cp1252 # JDK historical
+ alias cp5348 # Euro IBM CCSID
+
+charset windows-1253 MS1253
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1253
+ ascii true
+ alias cp1253 # JDK historical
+ alias cp5349 # Euro IBM CCSID
+
+charset windows-1254 MS1254
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1254
+ ascii true
+ alias cp1254 # JDK historical
+ alias cp5350 # Euro IBM CCSID
+
+charset windows-1257 MS1257
+ package sun.nio.cs
+ type sbcs
+ hisname Cp1257
+ ascii true
+ alias cp1257 # JDK historical
+ alias cp5353 # Euro IBM CCSID
+
+
+charset IBM437 IBM437
+ package sun.nio.cs
+ type sbcs
+ hisname Cp437
+ ascii false
+ alias cp437 #JDK historical
+ alias ibm437
+ alias ibm-437
+ alias 437
+ alias cspc8codepage437
+ alias windows-437
+
+charset x-IBM737 IBM737
+ package sun.nio.cs
+ type sbcs
+ hisname Cp737
+ ascii false
+ alias cp737 #JDK historical
+ alias ibm737
+ alias ibm-737
+ alias 737
+
+charset IBM775 IBM775
+ package sun.nio.cs
+ type sbcs
+ hisname Cp775
+ ascii false
+ alias cp775 #JDK historical
+ alias ibm775
+ alias ibm-775
+ alias 775
+
+charset IBM850 IBM850
+ package sun.nio.cs
+ type sbcs
+ hisname Cp850
+ ascii false
+ alias cp850 #JDK historical
+ alias ibm-850
+ alias ibm850
+ alias 850
+ alias cspc850multilingual
+
+charset IBM852 IBM852
+ package sun.nio.cs
+ type sbcs
+ hisname Cp852
+ ascii false
+ alias cp852 #JDK historical
+ alias ibm852
+ alias ibm-852
+ alias 852
+ alias csPCp852
+
+charset IBM855 IBM855
+ package sun.nio.cs
+ type sbcs
+ hisname Cp855
+ ascii false
+ alias cp855 #JDK historical
+ alias ibm-855
+ alias ibm855
+ alias 855
+ alias cspcp855
+
+charset IBM857 IBM857
+ package sun.nio.cs
+ type sbcs
+ hisname Cp857
+ ascii false
+ alias cp857 #JDK historical
+ alias ibm857
+ alias ibm-857
+ alias 857
+ alias csIBM857
+
+charset IBM00858 IBM858
+ package sun.nio.cs
+ type sbcs
+ hisname Cp858
+ ascii false
+ alias cp858 #JDK historical
+ alias ccsid00858
+ alias cp00858
+ alias 858
+ alias PC-Multilingual-850+euro
+
+charset IBM862 IBM862
+ package sun.nio.cs
+ type sbcs
+ hisname Cp862
+ ascii false
+ alias cp862 #JDK historical
+ alias ibm862
+ alias ibm-862
+ alias 862
+ alias csIBM862
+ alias cspc862latinhebrew
+
+charset IBM866 IBM866
+ package sun.nio.cs
+ type sbcs
+ hisname Cp866
+ ascii false
+ alias cp866 #JDK historical
+ alias ibm866
+ alias ibm-866
+ alias 866
+ alias csIBM866
+
+charset x-IBM874 IBM874
+ package sun.nio.cs
+ type sbcs
+ hisname Cp874
+ ascii false
+ alias cp874 #JDK historical
+ alias ibm874
+ alias ibm-874
+ alias 874
+
+########################################################
+#
+# charsets provided by ExtendedCharsets provider.
+#
+########################################################
+charset Big5 Big5
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Big5
+ ascii true
+ minmax 0xa1 0xf9 0x40 0xfe
+ alias csBig5 # IANA aliases
+
+charset x-MS950-HKSCS-XP MS950_HKSCS_XP
+ package sun.nio.cs.ext
+ type template
+ alias MS950_HKSCS_XP # JDK historical;
+
+charset x-MS950-HKSCS MS950_HKSCS
+ package sun.nio.cs.ext
+ type source
+ hisname MS950_HKSCS
+ ascii true
+ alias MS950_HKSCS # JDK historical;
+
+charset x-windows-950 MS950
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS950
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias ms950 # JDK historical
+ alias windows-950
+
+charset x-windows-874 MS874
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MS874
+ ascii true
+ alias ms874 # JDK historical
+ alias ms-874
+ alias windows-874
+
+charset x-EUC-TW EUC_TW
+ package sun.nio.cs.ext
+ type source
+ alias euc_tw # JDK historical
+ alias euctw
+ alias cns11643
+ alias EUC-TW
+
+charset Big5-HKSCS Big5_HKSCS
+ package sun.nio.cs.ext
+ type template
+ hisname Big5_HKSCS
+ ascii true
+ alias Big5_HKSCS # JDK historical
+ alias big5hk
+ alias big5-hkscs
+ alias big5hkscs # Linux alias
+
+charset x-Big5-HKSCS-2001 Big5_HKSCS_2001
+ package sun.nio.cs.ext
+ type source
+ alias Big5_HKSCS_2001
+ alias big5hk-2001
+ alias big5-hkscs-2001
+ alias big5-hkscs:unicode3.0
+ alias big5hkscs-2001
+
+charset x-Big5-Solaris Big5_Solaris
+ package sun.nio.cs.ext
+ type template
+ hisname Big5_Solaris
+ ascii true
+ alias Big5_Solaris # JDK historical
+
+
+charset GBK GBK # Simplified Chinese
+ package sun.nio.cs.ext
+ type dbcs
+ hisname GBK
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias windows-936
+ alias CP936
+
+charset GB18030 GB18030
+ package sun.nio.cs.ext
+ type source
+ alias gb18030-2000
+
+charset GB2312 EUC_CN
+ package sun.nio.cs.ext
+ type dbcs
+ hisname EUC_CN
+ ascii true
+ minmax 0xa1 0xf7 0xa1 0xfe
+ # IANA aliases
+ alias gb2312
+ alias gb2312-80
+ alias gb2312-1980
+ alias euc-cn
+ alias euccn
+ alias x-EUC-CN # 1.4 compatibility
+ alias EUC_CN # JDK historical
+
+charset x-mswin-936 MS936
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS936
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias ms936 # JDK historical
+ alias ms_936 // IANA aliases
+
+# The definition of this charset may be overridden by the init method,
+# below, if the sun.nio.cs.map property is defined.
+#
+charset Shift_JIS SJIS
+ package sun.nio.cs.ext
+ type dbcs
+ hisname SJIS
+ ascii true
+ minmax 0x81 0xfc 0x40 0xfc
+ # IANA aliases
+ alias sjis # historical
+ alias shift_jis
+ alias shift-jis
+ alias ms_kanji
+ alias x-sjis
+ alias csShiftJIS
+
+# The definition of this charset may be overridden by the init method,
+# below, if the sun.nio.cs.map property is defined.
+charset windows-31j MS932
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS932
+ ascii true
+ minmax 0x81 0xfc 0x40 0xfc
+ alias MS932 # JDK historical
+ alias windows-932
+ alias csWindows31J
+
+charset JIS_X0201 JIS_X_0201
+ package sun.nio.cs.ext
+ type sbcs
+ hisname JIS_X0201
+ ascii true
+ alias JIS0201 # JDK historical
+ # IANA aliases
+ alias JIS_X0201
+ alias X0201
+ alias csHalfWidthKatakana
+
+charset x-JIS0208 JIS_X_0208
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS0208
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ alias JIS0208 # JDK historical
+ # IANA aliases
+ alias JIS_C6226-1983
+ alias iso-ir-87
+ alias x0208
+ alias JIS_X0208-1983
+ alias csISO87JISX0208
+
+charset JIS_X0212-1990 JIS_X_0212
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS0212
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ alias JIS0212 # JDK historical
+ # IANA aliases
+ alias jis_x0212-1990
+ alias x0212
+ alias iso-ir-159
+ alias csISO159JISX02121990
+
+charset x-SJIS_0213 SJIS_0213
+ package sun.nio.cs.ext
+ type source
+ alias sjis-0213
+ alias sjis_0213
+ alias sjis:2004
+ alias sjis_0213:2004
+ alias shift_jis_0213:2004
+ alias shift_jis:2004
+
+charset x-MS932_0213 MS932_0213
+ package sun.nio.cs.ext
+ type source
+ alias MS932-0213
+ alias MS932_0213
+ alias MS932:2004
+ alias windows-932-0213
+ alias windows-932:2004
+
+charset EUC-JP EUC_JP
+ package sun.nio.cs.ext
+ type template
+ hisname EUC_JP
+ ascii true
+ alias euc_jp # JDK historical
+ alias eucjis # IANA aliases
+ alias eucjp
+ alias Extended_UNIX_Code_Packed_Format_for_Japanese
+ alias csEUCPkdFmtjapanese
+ alias x-euc-jp
+ alias x-eucjp
+
+charset x-euc-jp-linux EUC_JP_LINUX
+ package sun.nio.cs.ext
+ type template
+ hisname EUC_JP_LINUX
+ ascii true
+ alias euc_jp_linux # JDK historical
+ alias euc-jp-linux
+
+charset x-eucjp-open EUC_JP_Open
+ package sun.nio.cs.ext
+ type template
+ hisname EUC_JP_Solari
+ ascii true
+ alias EUC_JP_Solaris # JDK historical
+ alias eucJP-open
+
+charset x-PCK PCK
+ package sun.nio.cs.ext
+ type dbcs
+ hisname PCK
+ ascii true
+ minmax 0x81 0xfc 0x40 0xfc
+ # IANA aliases
+ alias pck # JDK historical
+
+charset ISO-2022-JP ISO2022_JP
+ package sun.nio.cs.ext
+ type source
+ # IANA aliases
+ alias iso2022jp # JDK historical
+ alias jis
+ alias csISO2022JP
+ alias jis_encoding
+ alias csjisencoding
+
+charset ISO-2022-JP-2 ISO2022_JP_2
+ package sun.nio.cs.ext
+ type source
+ # IANA aliases
+ alias csISO2022JP2
+ alias iso2022jp2
+
+charset x-windows-50221 MS50221
+ package sun.nio.cs.ext
+ type source
+ alias ms50221 # JDK historical
+ alias cp50221
+
+charset x-windows-50220 MS50220
+ package sun.nio.cs.ext
+ type source
+ alias ms50220 # JDK historical
+ alias cp50220
+
+charset x-windows-iso2022jp MSISO2022JP
+ package sun.nio.cs.ext
+ type source
+ alias windows-iso2022jp # JDK historical
+
+charset x-JISAutoDetect JISAutoDetect
+ package sun.nio.cs.ext
+ type source
+ alias JISAutoDetect # JDK historical
+
+
+charset EUC-KR EUC_KR # Korean
+ package sun.nio.cs.ext
+ type dbcs
+ hisname EUC_KR
+ ascii true
+ minmax 0xa1 0xfd 0xa1 0xfe
+ alias euc_kr # JDK historical
+ # IANA aliases
+ alias ksc5601
+ alias euckr
+ alias ks_c_5601-1987
+ alias ksc5601-1987
+ alias ksc5601_1987
+ alias ksc_5601
+ alias csEUCKR
+ alias 5601
+
+charset x-windows-949 MS949
+ package sun.nio.cs.ext
+ type dbcs
+ hisname MS949
+ ascii true
+ minmax 0x81 0xfe 0x41 0xfe
+ alias ms949 # JDK historical
+ alias windows949
+ alias windows-949
+ alias ms_949 # IANA aliases
+
+charset x-Johab Johab
+ package sun.nio.cs.ext
+ type dbcs
+ hisname x-Johab
+ ascii true
+ minmax 0x84 0xf9 0x31 0xfe
+ alias ksc5601-1992
+ alias ksc5601_1992
+ alias ms1361
+ alias johab # JDK historical
+
+charset ISO-2022-KR ISO2022_KR
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022KR # JDK historical
+ alias csISO2022KR
+
+charset ISO-2022-CN ISO2022_CN
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022CN # JDK historical
+ alias csISO2022CN
+
+charset x-ISO-2022-CN-CNS ISO2022_CN_CNS
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022CN_CNS # JDK historical
+ alias ISO-2022-CN-CNS
+
+charset x-ISO-2022-CN-GB ISO2022_CN_GB
+ package sun.nio.cs.ext
+ type source
+ alias ISO2022CN_GB # JDK historical
+ alias ISO-2022-CN-GB
+
+charset x-ISCII91 ISCII91
+ package sun.nio.cs.ext
+ type source
+ alias iscii
+ alias ST_SEV_358-88
+ alias iso-ir-153
+ alias csISO153GOST1976874
+ alias ISCII91 # JDK historical
+
+charset ISO-8859-3 ISO_8859_3
+ package sun.nio.cs.ext
+ type sbcs
+ hisname ISO8859_3
+ ascii true
+ alias iso8859_3 # JDK historical
+ alias 8859_3
+ alias ISO_8859-3:1988
+ alias iso-ir-109
+ alias ISO_8859-3
+ alias ISO8859-3
+ alias latin3
+ alias l3
+ alias ibm913
+ alias ibm-913
+ alias cp913
+ alias 913
+ alias csISOLatin3
+
+charset ISO-8859-6 ISO_8859_6
+ package sun.nio.cs.ext
+ type sbcs
+ hisname ISO8859_6
+ ascii true
+ alias iso8859_6 # JDK historical
+ alias 8859_6
+ alias iso-ir-127
+ alias ISO_8859-6
+ alias ISO_8859-6:1987
+ alias ISO8859-6
+ alias ECMA-114
+ alias ASMO-708
+ alias arabic
+ alias ibm1089
+ alias ibm-1089
+ alias cp1089
+ alias 1089
+ alias csISOLatinArabic
+
+charset ISO-8859-8 ISO_8859_8
+ package sun.nio.cs.ext
+ type sbcs
+ hisname ISO8859_8
+ ascii true
+ alias iso8859_8 # JDK historical
+ alias 8859_8
+ alias iso-ir-138
+ alias ISO_8859-8
+ alias ISO_8859-8:1988
+ alias ISO8859-8
+ alias cp916
+ alias 916
+ alias ibm916
+ alias ibm-916
+ alias hebrew
+ alias csISOLatinHebrew
+
+charset x-iso-8859-11 ISO_8859_11
+ package sun.nio.cs.ext
+ type sbcs
+ hisname x-iso-8859-11
+ ascii true
+ alias iso-8859-11
+ alias iso8859_11
+
+charset TIS-620 TIS_620
+ package sun.nio.cs.ext
+ type sbcs
+ hisname TIS620
+ ascii true
+ alias tis620 # JDK historical
+ alias tis620.2533
+
+# Microsoft Windows codepages
+
+charset windows-1255 MS1255
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1255
+ ascii true
+ alias cp1255 # JDK historical
+
+charset windows-1256 MS1256
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1256
+ ascii true
+ alias cp1256 # JDK historical
+
+charset windows-1258 MS1258
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1258
+ ascii true
+ alias cp1258 # JDK historical
+
+charset x-IBM942 IBM942 # IBM & PC/MSDOS encodings
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp942
+ ascii false
+ minmax 0x81 0xfc 0x40 0xfc
+ alias cp942 # JDK historical
+ alias ibm942
+ alias ibm-942
+ alias 942
+
+charset x-IBM942C IBM942C
+ package sun.nio.cs.ext
+ type source
+ alias cp942C # JDK historical
+ alias ibm942C
+ alias ibm-942C
+ alias 942C
+
+charset x-IBM943 IBM943
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp943
+ ascii false
+ minmax 0x81 0xfc 0x40 0xfc
+ alias cp943 # JDK historical
+ alias ibm943
+ alias ibm-943
+ alias 943
+
+charset x-IBM943C IBM943C
+ package sun.nio.cs.ext
+ type source
+ alias cp943C # JDK historical
+ alias ibm943C
+ alias ibm-943C
+ alias 943C
+
+charset x-IBM948 IBM948
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp948
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfc
+ alias cp948 # JDK historical
+ alias ibm948
+ alias ibm-948
+ alias 948
+
+charset x-IBM950 IBM950
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp950
+ ascii true
+ minmax 0x81 0xfe 0x40 0xfe
+ alias cp950 # JDK historical
+ alias ibm950
+ alias ibm-950
+ alias 950
+
+charset x-IBM930 IBM930
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp930
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp930 # JDK historical
+ alias ibm930
+ alias ibm-930
+ alias 930
+
+charset x-IBM935 IBM935
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp935
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp935 # JDK historical
+ alias ibm935
+ alias ibm-935
+ alias 935
+
+charset x-IBM937 IBM937
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp937
+ ascii false
+ minmax 0x40 0xe2 0x40 0xfe
+ alias cp937 # JDK historical
+ alias ibm937
+ alias ibm-937
+ alias 937
+
+charset x-IBM856 IBM856
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp856
+ ascii false
+ alias cp856 # JDK historical
+ alias ibm-856
+ alias ibm856
+ alias 856
+
+charset IBM860 IBM860
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp860
+ ascii false
+ alias cp860 # JDK historical
+ alias ibm860
+ alias ibm-860
+ alias 860
+ alias csIBM860
+
+charset IBM861 IBM861
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp861
+ ascii false
+ alias cp861 # JDK historical
+ alias ibm861
+ alias ibm-861
+ alias 861
+ alias csIBM861
+ alias cp-is
+
+charset IBM863 IBM863
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp863
+ ascii false
+ alias cp863 # JDK historical
+ alias ibm863
+ alias ibm-863
+ alias 863
+ alias csIBM863
+
+charset IBM864 IBM864
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp864
+ ascii false
+ alias cp864 # JDK historical
+ alias ibm864
+ alias ibm-864
+ alias 864
+ alias csIBM864
+
+
+charset IBM865 IBM865
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp865
+ ascii false
+ alias cp865 # JDK historical
+ alias ibm865
+ alias ibm-865
+ alias 865
+ alias csIBM865
+
+charset IBM868 IBM868
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp868
+ ascii false
+ alias cp868 # JDK historical
+ alias ibm868
+ alias ibm-868
+ alias 868
+ alias cp-ar
+ alias csIBM868
+
+charset IBM869 IBM869
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp869
+ ascii false
+ alias cp869 # JDK historical
+ alias ibm869
+ alias ibm-869
+ alias 869
+ alias cp-gr
+ alias csIBM869
+
+charset x-IBM921 IBM921
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp921
+ ascii false
+ alias cp921 # JDK historical
+ alias ibm921
+ alias ibm-921
+ alias 921
+
+charset x-IBM1006 IBM1006
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1006
+ ascii false
+ alias cp1006 # JDK historical
+ alias ibm1006
+ alias ibm-1006
+ alias 1006
+
+charset x-IBM1046 IBM1046
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1046
+ ascii false
+ alias cp1046 # JDK historical
+ alias ibm1046
+ alias ibm-1046
+ alias 1046
+
+charset IBM1047 IBM1047
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1047
+ ascii false
+ alias cp1047 # JDK historical
+ alias ibm-1047
+ alias 1047
+
+charset x-IBM1098 IBM1098
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1098
+ ascii false
+ alias cp1098 # JDK historical
+ alias ibm1098
+ alias ibm-1098
+ alias 1098
+
+charset IBM037 IBM037
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp037
+ ascii false
+ alias cp037 # JDK historical
+ alias ibm037
+ alias ebcdic-cp-us
+ alias ebcdic-cp-ca
+ alias ebcdic-cp-wt
+ alias ebcdic-cp-nl
+ alias csIBM037
+ alias cs-ebcdic-cp-us
+ alias cs-ebcdic-cp-ca
+ alias cs-ebcdic-cp-wt
+ alias cs-ebcdic-cp-nl
+ alias ibm-037
+ alias ibm-37
+ alias cpibm37
+ alias 037
+
+charset x-IBM1025 IBM1025
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1025
+ ascii false
+ alias cp1025 # JDK historical
+ alias ibm1025
+ alias ibm-1025
+ alias 1025
+
+charset IBM1026 IBM1026
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1026
+ ascii false
+ alias cp1026 # JDK historical
+ alias ibm1026
+ alias ibm-1026
+ alias 1026
+
+charset x-IBM1112 IBM1112
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1112
+ ascii false
+ alias cp1112 # JDK historical
+ alias ibm1112
+ alias ibm-1112
+ alias 1112
+
+charset x-IBM1122 IBM1122
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1122
+ ascii false
+ alias cp1122 # JDK historical
+ alias ibm1122
+ alias ibm-1122
+ alias 1122
+
+charset x-IBM1123 IBM1123
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1123
+ ascii false
+ alias cp1123 # JDK historical
+ alias ibm1123
+ alias ibm-1123
+ alias 1123
+
+charset x-IBM1124 IBM1124
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1124
+ ascii false
+ alias cp1124 # JDK historical
+ alias ibm1124
+ alias ibm-1124
+ alias 1124
+
+charset x-IBM1364 IBM1364
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp1364
+ ascii false
+ minmax 0x40 0xde 0x40 0xfe
+ alias cp1364
+ alias ibm1364
+ alias ibm-1364
+ alias 1364
+
+charset IBM273 IBM273
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp273
+ ascii false
+ alias cp273 # JDK historical
+ alias ibm273
+ alias ibm-273
+ alias 273
+
+charset IBM277 IBM277
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp277
+ ascii false
+ alias cp277 # JDK historical
+ alias ibm277
+ alias ibm-277
+ alias 277
+
+charset IBM278 IBM278
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp278
+ ascii false
+ alias cp278 # JDK historical
+ alias ibm278
+ alias ibm-278
+ alias 278
+ alias ebcdic-sv
+ alias ebcdic-cp-se
+ alias csIBM278
+
+charset IBM280 IBM280
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp280
+ ascii false
+ alias cp280 # JDK historical
+ alias ibm280
+ alias ibm-280
+ alias 280
+
+charset IBM284 IBM284
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp284
+ ascii false
+ alias cp284 # JDK historical
+ alias ibm284
+ alias ibm-284
+ alias 284
+ alias csIBM284
+ alias cpibm284
+
+charset IBM285 IBM285
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp285
+ ascii false
+ alias cp285 # JDK historical
+ alias ibm285
+ alias ibm-285
+ alias 285
+ alias ebcdic-cp-gb
+ alias ebcdic-gb
+ alias csIBM285
+ alias cpibm285
+
+charset IBM297 IBM297
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp297
+ ascii false
+ alias cp297 # JDK historical
+ alias ibm297
+ alias ibm-297
+ alias 297
+ alias ebcdic-cp-fr
+ alias cpibm297
+ alias csIBM297
+
+charset IBM420 IBM420
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp420
+ ascii false
+ alias cp420 # JDK historical
+ alias ibm420
+ alias ibm-420
+ alias ebcdic-cp-ar1
+ alias 420
+ alias csIBM420
+
+charset IBM424 IBM424
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp424
+ ascii false
+ alias cp424 # JDK historical
+ alias ibm424
+ alias ibm-424
+ alias 424
+ alias ebcdic-cp-he
+ alias csIBM424
+
+charset IBM500 IBM500
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp500
+ ascii false
+ alias cp500 # JDK historical
+ alias ibm500
+ alias ibm-500
+ alias 500
+ alias ebcdic-cp-ch
+ alias ebcdic-cp-bh
+ alias csIBM500
+
+charset x-IBM833 IBM833
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp833
+ ascii false
+ alias cp833
+ alias ibm833
+ alias ibm-833
+
+
+charset x-IBM834 IBM834 # EBCDIC DBCS-only Korean
+ package sun.nio.cs.ext
+ type source
+ alias cp834
+ alias ibm834
+ alias 834
+ alias ibm-834
+
+charset IBM-Thai IBM838
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp838
+ ascii false
+ alias cp838 # JDK historical
+ alias ibm838
+ alias ibm-838
+ alias 838
+
+charset IBM870 IBM870
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp870
+ ascii false
+ alias cp870 # JDK historical
+ alias ibm870
+ alias ibm-870
+ alias 870
+ alias ebcdic-cp-roece
+ alias ebcdic-cp-yu
+ alias csIBM870
+
+charset IBM871 IBM871
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp871
+ ascii false
+ alias cp871 # JDK historical
+ alias ibm871
+ alias ibm-871
+ alias 871
+ alias ebcdic-cp-is
+ alias csIBM871
+
+charset x-IBM875 IBM875
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp875
+ ascii false
+ alias cp875 # JDK historical
+ alias ibm875
+ alias ibm-875
+ alias 875
+
+charset IBM918 IBM918
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp918
+ ascii false
+ alias cp918 # JDK historical
+ alias ibm-918
+ alias 918
+ alias ebcdic-cp-ar2
+
+charset x-IBM922 IBM922
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp922
+ ascii false
+ alias cp922 # JDK historical
+ alias ibm922
+ alias ibm-922
+ alias 922
+
+charset x-IBM1097 IBM1097
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1097
+ ascii false
+ alias cp1097 # JDK historical
+ alias ibm1097
+ alias ibm-1097
+ alias 1097
+
+charset x-IBM949 IBM949
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp949
+ ascii false
+ minmax 0x8f 0xfe 0xa1 0xfe
+ alias cp949 # JDK historical
+ alias ibm949
+ alias ibm-949
+ alias 949
+
+charset x-IBM949C IBM949C
+ package sun.nio.cs.ext
+ type source
+ alias cp949C # JDK historical
+ alias ibm949C
+ alias ibm-949C
+ alias 949C
+
+charset x-IBM939 IBM939
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp939
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp939 # JDK historical
+ alias ibm939
+ alias ibm-939
+ alias 939
+
+charset x-IBM933 IBM933
+ package sun.nio.cs.ext
+ type ebcdic
+ hisname Cp933
+ ascii false
+ minmax 0x40 0xdd 0x40 0xfe
+ alias cp933 # JDK historical
+ alias ibm933
+ alias ibm-933
+ alias 933
+
+charset x-IBM1381 IBM1381
+ package sun.nio.cs.ext
+ type dbcs
+ hisname Cp1381
+ ascii true
+ minmax 0x8c 0xf7 0xa1 0xfe
+ alias cp1381 # JDK historical
+ alias ibm1381
+ alias ibm-1381
+ alias 1381
+
+charset x-IBM1383 IBM1383
+ package sun.nio.cs.ext
+ type euc_sim
+ hisname Cp1383
+ ascii true
+ minmax 0xa1 0xfe 0xa1 0xfe
+ alias cp1383 # JDK historical
+ alias ibm1383
+ alias ibm-1383
+ alias 1383
+
+charset x-IBM970 IBM970
+ package sun.nio.cs.ext
+ type euc_sim
+ hisname Cp970
+ ascii true
+ minmax 0xa1 0xfe 0xa1 0xfe
+ alias cp970 # JDK historical
+ alias ibm970
+ alias ibm-970
+ alias ibm-eucKR
+ alias 970
+
+charset x-IBM964 IBM964
+ package sun.nio.cs.ext
+ type source
+ alias cp964 # JDK historical
+ alias ibm964
+ alias ibm-964
+ alias 964
+
+charset x-IBM33722 IBM33722
+ package sun.nio.cs.ext
+ type source
+ alias cp33722 # JDK historical
+ alias ibm33722
+ alias ibm-33722
+ alias ibm-5050 # from IBM alias list
+ alias ibm-33722_vascii_vpua # from IBM alias list
+ alias 33722
+
+charset IBM01140 IBM1140
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1140
+ ascii false
+ alias cp1140 # JDK historical
+ alias ccsid01140
+ alias cp01140
+ alias 1140
+ alias ebcdic-us-037+euro
+
+charset IBM01141 IBM1141
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1141
+ ascii false
+ alias cp1141 # JDK historical
+ alias ccsid01141
+ alias cp01141
+ alias 1141
+ alias ebcdic-de-273+euro
+
+charset IBM01142 IBM1142
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1142
+ ascii false
+ alias cp1142 # JDK historical
+ alias ccsid01142
+ alias cp01142
+ alias 1142
+ alias ebcdic-no-277+euro
+ alias ebcdic-dk-277+euro
+
+charset IBM01143 IBM1143
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1143
+ ascii false
+ alias cp1143 # JDK historical
+ alias ccsid01143
+ alias cp01143
+ alias 1143
+ alias ebcdic-fi-278+euro
+ alias ebcdic-se-278+euro
+
+charset IBM01144 IBM1144
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1144
+ ascii false
+ alias cp1144 # JDK historical
+ alias ccsid01144
+ alias cp01144
+ alias 1144
+ alias ebcdic-it-280+euro
+
+charset IBM01145 IBM1145
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1145
+ ascii false
+ alias cp1145 # JDK historical
+ alias ccsid01145
+ alias cp01145
+ alias 1145
+ alias ebcdic-es-284+euro
+
+charset IBM01146 IBM1146
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1146
+ ascii false
+ alias cp1146 # JDK historical
+ alias ccsid01146
+ alias cp01146
+ alias 1146
+ alias ebcdic-gb-285+euro
+
+charset IBM01147 IBM1147
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1147
+ ascii false
+ alias cp1147 # JDK historical
+ alias ccsid01147
+ alias cp01147
+ alias 1147
+ alias ebcdic-fr-277+euro
+
+charset IBM01148 IBM1148
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1148
+ ascii false
+ alias cp1148 # JDK historical
+ alias ccsid01148
+ alias cp01148
+ alias 1148
+ alias ebcdic-international-500+euro
+
+charset IBM01149 IBM1149
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp1149
+ ascii false
+ alias cp1149 # JDK historical
+ alias ccsid01149
+ alias cp01149
+ alias 1149
+ alias ebcdic-s-871+euro
+
+charset IBM290 IBM290
+ package sun.nio.cs.ext
+ type sbcs
+ hisname Cp290
+ ascii false
+ alias cp290
+ alias ibm290
+ alias ibm-290
+ alias csIBM290
+ alias EBCDIC-JP-kana
+ alias 290
+
+charset x-IBM300 IBM300
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname Cp300
+ ascii false
+ minmax 0x40 0x7f 0x40 0xfe
+ alias cp300
+ alias ibm300
+ alias ibm-300
+ alias 300
+
+# Macintosh MacOS/Apple char encodingd
+
+charset x-MacRoman MacRoman
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacRoman
+ ascii false
+ alias MacRoman # JDK historical
+
+charset x-MacCentralEurope MacCentralEurope
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacCentralEurope
+ ascii false
+ alias MacCentralEurope # JDK historical
+
+charset x-MacCroatian MacCroatian
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacCroatian
+ ascii false
+ alias MacCroatian # JDK historical
+
+charset x-MacGreek MacGreek
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacGreek
+ ascii false
+ alias MacGreek # JDK historical
+
+charset x-MacCyrillic MacCyrillic
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacCyrillic
+ ascii false
+ alias MacCyrillic # JDK historical
+
+charset x-MacUkraine MacUkraine
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacUkraine
+ ascii false
+ alias MacUkraine # JDK historical
+
+charset x-MacTurkish MacTurkish
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacTurkish
+ ascii false
+ alias MacTurkish # JDK historical
+
+charset x-MacArabic MacArabic
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacArabic
+ ascii false
+ alias MacArabic # JDK historical
+
+charset x-MacHebrew MacHebrew
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacHebrew
+ ascii false
+ alias MacHebrew # JDK historical
+
+charset x-MacIceland MacIceland
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacIceland
+ ascii false
+ alias MacIceland # JDK historical
+
+charset x-MacRomania MacRomania
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacRomania
+ ascii false
+ alias MacRomania # JDK historical
+
+charset x-MacThai MacThai
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacThai
+ ascii false
+ alias MacThai # JDK historical
+
+charset x-MacSymbol MacSymbol
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacSymbol
+ ascii false
+ alias MacSymbol # JDK historical
+
+charset x-MacDingbat MacDingbat
+ package sun.nio.cs.ext
+ type sbcs
+ hisname MacDingbat
+ ascii false
+ alias MacDingbat # JDK historical
+
+########################################################
+#
+# internal use, not to be registered into spi
+#
+########################################################
+
+charset x-JIS0208_Solaris JIS_X_0208_Solaris
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS0208
+ ascii false
+ minmax 0x21 0x9e 0x21 0x7e
+ internal true
+
+charset x-JIS0208_MS5022X JIS_X_0208_MS5022X
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0208_MS5022X
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true
+
+charset x-JIS0208_MS932 JIS_X_0208_MS932
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0208_MS932
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true # "internal implementation
+
+charset x-JIS0212_Solaris JIS_X_0212_Solaris
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0212_Solaris
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true # "internal implementation
+
+charset x-JIS0212_MS5022X JIS_X_0212_MS5022X
+ package sun.nio.cs.ext
+ type dbcsonly
+ hisname JIS_X_0212_MS5022X
+ ascii false
+ minmax 0x21 0x7e 0x21 0x7e
+ internal true # "internal implementation
diff --git a/jdk/make/data/charsetmapping/dbcs b/jdk/make/data/charsetmapping/dbcs
deleted file mode 100644
index a22e886977f..00000000000
--- a/jdk/make/data/charsetmapping/dbcs
+++ /dev/null
@@ -1,36 +0,0 @@
-#
-#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
-#
-Big5 Big5 Big5 basic sun.nio.cs.ext true 0xa1 0xf9 0x40 0xfe
-Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
-EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
-EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
-MS932 windows-31j MS932 basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
-MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
-MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-SJIS Shift_JIS SJIS basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
-PCK x-PCK PCK basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
-IBM1364 x-IBM1364 Cp1364 ebcdic sun.nio.cs.ext false 0x40 0xde 0x40 0xfe
-IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
-IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
-IBM300 x-IBM300 Cp300 dbcsonly sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM933 x-IBM933 Cp933 ebcdic sun.nio.cs.ext false 0x40 0xdd 0x40 0xfe
-IBM935 x-IBM935 Cp935 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM937 x-IBM937 Cp937 ebcdic sun.nio.cs.ext false 0x40 0xe2 0x40 0xfe
-IBM939 x-IBM939 Cp939 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
-IBM942 x-IBM942 Cp942 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
-IBM943 x-IBM943 Cp943 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
-IBM948 x-IBM948 Cp948 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfc
-IBM949 x-IBM949 Cp949 basic sun.nio.cs.ext false 0x8f 0xfe 0xa1 0xfe
-IBM950 x-IBM950 Cp950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
-IBM970 x-IBM970 Cp970 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
-JIS_X_0208 x-JIS0208 JIS0208 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0212 JIS_X0212-1990 JIS0212 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0208_Solaris x-JIS0208_Solaris JIS0208_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x9e 0x21 0x7e
-JIS_X_0208_MS5022X x-JIS0208_MS5022X JIS0208_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0208_MS932 x-JIS0208_MS932 JIS0208_MS932 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0212_Solaris x-JIS0212_Solaris JIS0212_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
-JIS_X_0212_MS5022X x-JIS0212_MS5022X JIS0212_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
diff --git a/jdk/make/data/charsetmapping/extsbcs b/jdk/make/data/charsetmapping/extsbcs
deleted file mode 100644
index ed82dbe82d9..00000000000
--- a/jdk/make/data/charsetmapping/extsbcs
+++ /dev/null
@@ -1,76 +0,0 @@
-# clzName csName hisName containASCII pkg
-IBM037 IBM037 Cp037 false sun.nio.cs.ext
-IBM1006 x-IBM1006 Cp1006 false sun.nio.cs.ext
-IBM1025 x-IBM1025 Cp1025 false sun.nio.cs.ext
-IBM1026 IBM1026 Cp1026 false sun.nio.cs.ext
-IBM1046 x-IBM1046 Cp1046 false sun.nio.cs.ext
-IBM1047 IBM1047 Cp1047 false sun.nio.cs.ext
-IBM1097 x-IBM1097 Cp1097 false sun.nio.cs.ext
-IBM1098 x-IBM1098 Cp1098 false sun.nio.cs.ext
-IBM1112 x-IBM1112 Cp1112 false sun.nio.cs.ext
-IBM1122 x-IBM1122 Cp1122 false sun.nio.cs.ext
-IBM1123 x-IBM1123 Cp1123 false sun.nio.cs.ext
-IBM1124 x-IBM1124 Cp1124 false sun.nio.cs.ext
-# map tables for 1140-1149 are updated manualy with the u+20ac entry
-IBM1140 IBM01140 Cp1140 false sun.nio.cs.ext
-IBM1141 IBM01141 Cp1141 false sun.nio.cs.ext
-IBM1142 IBM01142 Cp1142 false sun.nio.cs.ext
-IBM1143 IBM01143 Cp1143 false sun.nio.cs.ext
-IBM1144 IBM01144 Cp1144 false sun.nio.cs.ext
-IBM1145 IBM01145 Cp1145 false sun.nio.cs.ext
-IBM1146 IBM01146 Cp1146 false sun.nio.cs.ext
-IBM1147 IBM01147 Cp1147 false sun.nio.cs.ext
-IBM1148 IBM01148 Cp1148 false sun.nio.cs.ext
-IBM1149 IBM01149 Cp1149 false sun.nio.cs.ext
-IBM273 IBM273 Cp273 false sun.nio.cs.ext
-IBM277 IBM277 Cp277 false sun.nio.cs.ext
-IBM278 IBM278 Cp278 false sun.nio.cs.ext
-IBM280 IBM280 Cp280 false sun.nio.cs.ext
-IBM284 IBM284 Cp284 false sun.nio.cs.ext
-IBM285 IBM285 Cp285 false sun.nio.cs.ext
-IBM290 IBM290 Cp290 false sun.nio.cs.ext
-IBM297 IBM297 Cp297 false sun.nio.cs.ext
-IBM420 IBM420 Cp420 false sun.nio.cs.ext
-IBM424 IBM424 Cp424 false sun.nio.cs.ext
-IBM500 IBM500 Cp500 false sun.nio.cs.ext
-IBM833 x-IBM833 Cp833 false sun.nio.cs.ext
-IBM838 IBM-Thai Cp838 false sun.nio.cs.ext
-IBM856 x-IBM856 Cp856 false sun.nio.cs.ext
-IBM860 IBM860 Cp860 false sun.nio.cs.ext
-IBM861 IBM861 Cp861 false sun.nio.cs.ext
-IBM863 IBM863 Cp863 false sun.nio.cs.ext
-IBM864 IBM864 Cp864 false sun.nio.cs.ext
-IBM865 IBM865 Cp865 false sun.nio.cs.ext
-IBM868 IBM868 Cp868 false sun.nio.cs.ext
-IBM869 IBM869 Cp869 false sun.nio.cs.ext
-IBM870 IBM870 Cp870 false sun.nio.cs.ext
-IBM871 IBM871 Cp871 false sun.nio.cs.ext
-IBM875 x-IBM875 Cp875 false sun.nio.cs.ext
-IBM918 IBM918 Cp918 false sun.nio.cs.ext
-IBM921 x-IBM921 Cp921 false sun.nio.cs.ext
-IBM922 x-IBM922 Cp922 false sun.nio.cs.ext
-# use name as hisname as well, cs did not support hisname prevously
-ISO_8859_11 x-iso-8859-11 x-iso-8859-11 true sun.nio.cs.ext
-ISO_8859_3 ISO-8859-3 ISO8859_3 true sun.nio.cs.ext
-ISO_8859_6 ISO-8859-6 ISO8859_6 true sun.nio.cs.ext
-ISO_8859_8 ISO-8859-8 ISO8859_8 true sun.nio.cs.ext
-JIS_X_0201 JIS_X0201 JIS_X0201 true sun.nio.cs.ext
-MS1255 windows-1255 Cp1255 true sun.nio.cs.ext
-MS1256 windows-1256 Cp1256 true sun.nio.cs.ext
-MS1258 windows-1258 Cp1258 true sun.nio.cs.ext
-MS874 x-windows-874 MS874 true sun.nio.cs.ext
-MacArabic x-MacArabic MacArabic false sun.nio.cs.ext
-MacCentralEurope x-MacCentralEurope MacCentralEurope false sun.nio.cs.ext
-MacCroatian x-MacCroatian MacCroatian false sun.nio.cs.ext
-MacCyrillic x-MacCyrillic MacCyrillic false sun.nio.cs.ext
-MacDingbat x-MacDingbat MacDingbat false sun.nio.cs.ext
-MacGreek x-MacGreek MacGreek false sun.nio.cs.ext
-MacHebrew x-MacHebrew MacHebrew false sun.nio.cs.ext
-MacIceland x-MacIceland MacIceland false sun.nio.cs.ext
-MacRoman x-MacRoman MacRoman false sun.nio.cs.ext
-MacRomania x-MacRomania MacRomania false sun.nio.cs.ext
-MacSymbol x-MacSymbol MacSymbol false sun.nio.cs.ext
-MacThai x-MacThai MacThai false sun.nio.cs.ext
-MacTurkish x-MacTurkish MacTurkish false sun.nio.cs.ext
-MacUkraine x-MacUkraine MacUkraine false sun.nio.cs.ext
-TIS_620 TIS-620 TIS620 true sun.nio.cs.ext
diff --git a/jdk/make/data/charsetmapping/list_old b/jdk/make/data/charsetmapping/list_old
new file mode 100644
index 00000000000..ca03b40921b
--- /dev/null
+++ b/jdk/make/data/charsetmapping/list_old
@@ -0,0 +1,149 @@
+#
+# This is the copy of the old configuration files sbcs, dbcs and extsbcs
+# used in jdk8.
+############################### sbcs #########################################
+#
+# clzName csName hisName containASCII pkg
+#
+IBM437 IBM437 Cp437 false sun.nio.cs
+IBM737 x-IBM737 Cp737 false sun.nio.cs
+IBM775 IBM775 Cp775 false sun.nio.cs
+IBM850 IBM850 Cp850 false sun.nio.cs
+IBM852 IBM852 Cp852 false sun.nio.cs
+IBM855 IBM855 Cp855 false sun.nio.cs
+IBM857 IBM857 Cp857 false sun.nio.cs
+IBM858 IBM00858 Cp858 false sun.nio.cs
+IBM862 IBM862 Cp862 false sun.nio.cs
+IBM866 IBM866 Cp866 false sun.nio.cs
+IBM874 x-IBM874 Cp874 false sun.nio.cs
+ISO_8859_2 ISO-8859-2 ISO8859_2 true sun.nio.cs
+ISO_8859_4 ISO-8859-4 ISO8859_4 true sun.nio.cs
+ISO_8859_5 ISO-8859-5 ISO8859_5 true sun.nio.cs
+ISO_8859_7 ISO-8859-7 ISO8859_7 true sun.nio.cs
+ISO_8859_9 ISO-8859-9 ISO8859_9 true sun.nio.cs
+ISO_8859_13 ISO-8859-13 ISO8859_13 true sun.nio.cs
+ISO_8859_15 ISO-8859-15 ISO8859_15 true sun.nio.cs
+KOI8_R KOI8-R KOI8_R true sun.nio.cs
+KOI8_U KOI8-U KOI8_U true sun.nio.cs
+MS1250 windows-1250 Cp1250 true sun.nio.cs
+MS1251 windows-1251 Cp1251 true sun.nio.cs
+MS1252 windows-1252 Cp1252 true sun.nio.cs
+MS1253 windows-1253 Cp1253 true sun.nio.cs
+MS1254 windows-1254 Cp1254 true sun.nio.cs
+MS1257 windows-1257 Cp1257 true sun.nio.cs
+#
+############################### extsbcs #######################################
+#
+IBM037 IBM037 Cp037 false sun.nio.cs.ext
+IBM1006 x-IBM1006 Cp1006 false sun.nio.cs.ext
+IBM1025 x-IBM1025 Cp1025 false sun.nio.cs.ext
+IBM1026 IBM1026 Cp1026 false sun.nio.cs.ext
+IBM1046 x-IBM1046 Cp1046 false sun.nio.cs.ext
+IBM1047 IBM1047 Cp1047 false sun.nio.cs.ext
+IBM1097 x-IBM1097 Cp1097 false sun.nio.cs.ext
+IBM1098 x-IBM1098 Cp1098 false sun.nio.cs.ext
+IBM1112 x-IBM1112 Cp1112 false sun.nio.cs.ext
+IBM1122 x-IBM1122 Cp1122 false sun.nio.cs.ext
+IBM1123 x-IBM1123 Cp1123 false sun.nio.cs.ext
+IBM1124 x-IBM1124 Cp1124 false sun.nio.cs.ext
+# map tables for 1140-1149 are updated manualy with the u+20ac entry
+IBM1140 IBM01140 Cp1140 false sun.nio.cs.ext
+IBM1141 IBM01141 Cp1141 false sun.nio.cs.ext
+IBM1142 IBM01142 Cp1142 false sun.nio.cs.ext
+IBM1143 IBM01143 Cp1143 false sun.nio.cs.ext
+IBM1144 IBM01144 Cp1144 false sun.nio.cs.ext
+IBM1145 IBM01145 Cp1145 false sun.nio.cs.ext
+IBM1146 IBM01146 Cp1146 false sun.nio.cs.ext
+IBM1147 IBM01147 Cp1147 false sun.nio.cs.ext
+IBM1148 IBM01148 Cp1148 false sun.nio.cs.ext
+IBM1149 IBM01149 Cp1149 false sun.nio.cs.ext
+IBM273 IBM273 Cp273 false sun.nio.cs.ext
+IBM277 IBM277 Cp277 false sun.nio.cs.ext
+IBM278 IBM278 Cp278 false sun.nio.cs.ext
+IBM280 IBM280 Cp280 false sun.nio.cs.ext
+IBM284 IBM284 Cp284 false sun.nio.cs.ext
+IBM285 IBM285 Cp285 false sun.nio.cs.ext
+IBM290 IBM290 Cp290 false sun.nio.cs.ext
+IBM297 IBM297 Cp297 false sun.nio.cs.ext
+IBM420 IBM420 Cp420 false sun.nio.cs.ext
+IBM424 IBM424 Cp424 false sun.nio.cs.ext
+IBM500 IBM500 Cp500 false sun.nio.cs.ext
+IBM833 x-IBM833 Cp833 false sun.nio.cs.ext
+IBM838 IBM-Thai Cp838 false sun.nio.cs.ext
+IBM856 x-IBM856 Cp856 false sun.nio.cs.ext
+IBM860 IBM860 Cp860 false sun.nio.cs.ext
+IBM861 IBM861 Cp861 false sun.nio.cs.ext
+IBM863 IBM863 Cp863 false sun.nio.cs.ext
+IBM864 IBM864 Cp864 false sun.nio.cs.ext
+IBM865 IBM865 Cp865 false sun.nio.cs.ext
+IBM868 IBM868 Cp868 false sun.nio.cs.ext
+IBM869 IBM869 Cp869 false sun.nio.cs.ext
+IBM870 IBM870 Cp870 false sun.nio.cs.ext
+IBM871 IBM871 Cp871 false sun.nio.cs.ext
+IBM875 x-IBM875 Cp875 false sun.nio.cs.ext
+IBM918 IBM918 Cp918 false sun.nio.cs.ext
+IBM921 x-IBM921 Cp921 false sun.nio.cs.ext
+IBM922 x-IBM922 Cp922 false sun.nio.cs.ext
+# use name as hisname as well, cs did not support hisname prevously
+ISO_8859_11 x-iso-8859-11 x-iso-8859-11 true sun.nio.cs.ext
+ISO_8859_3 ISO-8859-3 ISO8859_3 true sun.nio.cs.ext
+ISO_8859_6 ISO-8859-6 ISO8859_6 true sun.nio.cs.ext
+ISO_8859_8 ISO-8859-8 ISO8859_8 true sun.nio.cs.ext
+JIS_X_0201 JIS_X0201 JIS_X0201 true sun.nio.cs.ext
+MS1255 windows-1255 Cp1255 true sun.nio.cs.ext
+MS1256 windows-1256 Cp1256 true sun.nio.cs.ext
+MS1258 windows-1258 Cp1258 true sun.nio.cs.ext
+MS874 x-windows-874 MS874 true sun.nio.cs.ext
+MacArabic x-MacArabic MacArabic false sun.nio.cs.ext
+MacCentralEurope x-MacCentralEurope MacCentralEurope false sun.nio.cs.ext
+MacCroatian x-MacCroatian MacCroatian false sun.nio.cs.ext
+MacCyrillic x-MacCyrillic MacCyrillic false sun.nio.cs.ext
+MacDingbat x-MacDingbat MacDingbat false sun.nio.cs.ext
+MacGreek x-MacGreek MacGreek false sun.nio.cs.ext
+MacHebrew x-MacHebrew MacHebrew false sun.nio.cs.ext
+MacIceland x-MacIceland MacIceland false sun.nio.cs.ext
+MacRoman x-MacRoman MacRoman false sun.nio.cs.ext
+MacRomania x-MacRomania MacRomania false sun.nio.cs.ext
+MacSymbol x-MacSymbol MacSymbol false sun.nio.cs.ext
+MacThai x-MacThai MacThai false sun.nio.cs.ext
+MacTurkish x-MacTurkish MacTurkish false sun.nio.cs.ext
+MacUkraine x-MacUkraine MacUkraine false sun.nio.cs.ext
+TIS_620 TIS-620 TIS620 true sun.nio.cs.ext
+#
+############################### dbcs #########################################
+#
+#clzName csName hisName dbtype pkg ascii b1min b1max b2min b2max
+#
+Big5 Big5 Big5 basic sun.nio.cs.ext true 0xa1 0xf9 0x40 0xfe
+Johab x-Johab x-Johab basic sun.nio.cs.ext true 0x84 0xf9 0x31 0xfe
+EUC_CN GB2312 EUC_CN basic sun.nio.cs.ext true 0xa1 0xf7 0xa1 0xfe
+EUC_KR EUC-KR EUC_KR basic sun.nio.cs.ext true 0xa1 0xfd 0xa1 0xfe
+MS932 windows-31j MS932 basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
+MS936 x-mswin-936 MS936 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+MS949 x-windows-949 MS949 basic sun.nio.cs.ext true 0x81 0xfe 0x41 0xfe
+MS950 x-windows-950 MS950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+GBK GBK GBK basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+SJIS Shift_JIS SJIS basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
+PCK x-PCK PCK basic sun.nio.cs.ext true 0x81 0xfc 0x40 0xfc
+IBM1364 x-IBM1364 Cp1364 ebcdic sun.nio.cs.ext false 0x40 0xde 0x40 0xfe
+IBM1381 x-IBM1381 Cp1381 basic sun.nio.cs.ext true 0x8c 0xf7 0xa1 0xfe
+IBM1383 x-IBM1383 Cp1383 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
+IBM300 x-IBM300 Cp300 dbcsonly sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM930 x-IBM930 Cp930 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM933 x-IBM933 Cp933 ebcdic sun.nio.cs.ext false 0x40 0xdd 0x40 0xfe
+IBM935 x-IBM935 Cp935 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM937 x-IBM937 Cp937 ebcdic sun.nio.cs.ext false 0x40 0xe2 0x40 0xfe
+IBM939 x-IBM939 Cp939 ebcdic sun.nio.cs.ext false 0x40 0x7f 0x40 0xfe
+IBM942 x-IBM942 Cp942 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
+IBM943 x-IBM943 Cp943 basic sun.nio.cs.ext false 0x81 0xfc 0x40 0xfc
+IBM948 x-IBM948 Cp948 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfc
+IBM949 x-IBM949 Cp949 basic sun.nio.cs.ext false 0x8f 0xfe 0xa1 0xfe
+IBM950 x-IBM950 Cp950 basic sun.nio.cs.ext true 0x81 0xfe 0x40 0xfe
+IBM970 x-IBM970 Cp970 euc_sim sun.nio.cs.ext true 0xa1 0xfe 0xa1 0xfe
+JIS_X_0208 x-JIS0208 JIS0208 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0212 JIS_X0212-1990 JIS0212 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0208_Solaris x-JIS0208_Solaris JIS0208_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x9e 0x21 0x7e
+JIS_X_0208_MS5022X x-JIS0208_MS5022X JIS0208_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0208_MS932 x-JIS0208_MS932 JIS0208_MS932 dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0212_Solaris x-JIS0212_Solaris JIS0212_Solaris dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
+JIS_X_0212_MS5022X x-JIS0212_MS5022X JIS0212_MS5022X dbcsonly sun.nio.cs.ext false 0x21 0x7e 0x21 0x7e
diff --git a/jdk/make/data/charsetmapping/sbcs b/jdk/make/data/charsetmapping/sbcs
deleted file mode 100644
index 0b11960411b..00000000000
--- a/jdk/make/data/charsetmapping/sbcs
+++ /dev/null
@@ -1,28 +0,0 @@
-# clzName csName hisName containASCII pkg
-IBM437 IBM437 Cp437 false sun.nio.cs
-IBM737 x-IBM737 Cp737 false sun.nio.cs
-IBM775 IBM775 Cp775 false sun.nio.cs
-IBM850 IBM850 Cp850 false sun.nio.cs
-IBM852 IBM852 Cp852 false sun.nio.cs
-IBM855 IBM855 Cp855 false sun.nio.cs
-IBM857 IBM857 Cp857 false sun.nio.cs
-IBM858 IBM00858 Cp858 false sun.nio.cs
-IBM862 IBM862 Cp862 false sun.nio.cs
-IBM866 IBM866 Cp866 false sun.nio.cs
-IBM874 x-IBM874 Cp874 false sun.nio.cs
-ISO_8859_2 ISO-8859-2 ISO8859_2 true sun.nio.cs
-ISO_8859_4 ISO-8859-4 ISO8859_4 true sun.nio.cs
-ISO_8859_5 ISO-8859-5 ISO8859_5 true sun.nio.cs
-ISO_8859_7 ISO-8859-7 ISO8859_7 true sun.nio.cs
-ISO_8859_9 ISO-8859-9 ISO8859_9 true sun.nio.cs
-ISO_8859_13 ISO-8859-13 ISO8859_13 true sun.nio.cs
-ISO_8859_15 ISO-8859-15 ISO8859_15 true sun.nio.cs
-KOI8_R KOI8-R KOI8_R true sun.nio.cs
-KOI8_U KOI8-U KOI8_U true sun.nio.cs
-MS1250 windows-1250 Cp1250 true sun.nio.cs
-MS1251 windows-1251 Cp1251 true sun.nio.cs
-MS1252 windows-1252 Cp1252 true sun.nio.cs
-MS1253 windows-1253 Cp1253 true sun.nio.cs
-MS1254 windows-1254 Cp1254 true sun.nio.cs
-MS1257 windows-1257 Cp1257 true sun.nio.cs
-
diff --git a/jdk/make/data/charsetmapping/standard-charsets b/jdk/make/data/charsetmapping/standard-charsets
deleted file mode 100644
index f9f4db12c6a..00000000000
--- a/jdk/make/data/charsetmapping/standard-charsets
+++ /dev/null
@@ -1,337 +0,0 @@
-#
-# Copyright (c) 2000, 2014, 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.
-#
-
-# Standard charsets provided by StandardCharsets provider.
-#
-# Note that these "standard" charsets listed here are not
-# necessary to be the "Standard charsets" defined in the
-# specification of java.nio.charset.Charset. Instead these
-# are the charsets that this implementation believes should
-# be packaged into the charsets provider class "StandardCharsets"
-# which is initialized at startup time by java.nio.charset.Charset,
-# compared to the charsets packaged in "ExtendedCharsets" provider,
-# which is lazy initialized.
-
-charset US-ASCII US_ASCII
-
- # IANA aliases
- alias iso-ir-6
- alias ANSI_X3.4-1986
- alias ISO_646.irv:1991
- alias ASCII
- alias ISO646-US
- alias us
- alias IBM367
- alias cp367
- alias csASCII
- alias default
-
- # Other aliases
- alias 646 # Solaris POSIX locale
- alias iso_646.irv:1983
- alias ANSI_X3.4-1968 # Linux POSIX locale (RedHat)
- alias ascii7
-
-charset UTF-8 UTF_8
- alias UTF8 # JDK historical
- alias unicode-1-1-utf-8
-
-charset CESU-8 CESU_8
- alias CESU8
- alias csCESU-8
-
-charset UTF-16 UTF_16
- alias UTF_16 # JDK historical
- alias utf16
- alias unicode
- alias UnicodeBig
-
-charset UTF-16BE UTF_16BE
- alias UTF_16BE
- alias ISO-10646-UCS-2
- alias X-UTF-16BE
- alias UnicodeBigUnmarked
-
-charset UTF-16LE UTF_16LE
- alias UTF_16LE
- alias X-UTF-16LE
- alias UnicodeLittleUnmarked
-
-charset x-UTF-16LE-BOM UTF_16LE_BOM
- alias UnicodeLittle
-
-charset UTF-32 UTF_32
- alias UTF_32
- alias UTF32
-
-charset UTF-32LE UTF_32LE
- alias UTF_32LE
- alias X-UTF-32LE
-
-charset UTF-32BE UTF_32BE
- alias UTF_32BE
- alias X-UTF-32BE
-
-charset X-UTF-32LE-BOM UTF_32LE_BOM
- alias UTF_32LE_BOM
- alias UTF-32LE-BOM
-
-charset X-UTF-32BE-BOM UTF_32BE_BOM
- alias UTF_32BE_BOM
- alias UTF-32BE-BOM
-
-charset ISO-8859-1 ISO_8859_1
-
- # IANA aliases
- alias iso-ir-100
- alias ISO_8859-1
- alias latin1
- alias l1
- alias IBM819
- alias cp819
- alias csISOLatin1
-
- # Other aliases
- alias 819
- alias IBM-819
- alias ISO8859_1
- alias ISO_8859-1:1987
- alias ISO_8859_1
- alias 8859_1
- alias ISO8859-1
-
-charset ISO-8859-2 ISO_8859_2
- alias iso8859_2 # JDK historical
- alias 8859_2
- alias iso-ir-101
- alias ISO_8859-2
- alias ISO_8859-2:1987
- alias ISO8859-2
- alias latin2
- alias l2
- alias ibm912
- alias ibm-912
- alias cp912
- alias 912
- alias csISOLatin2
-
-charset ISO-8859-4 ISO_8859_4
- alias iso8859_4 # JDK historical
- alias iso8859-4
- alias 8859_4
- alias iso-ir-110
- alias ISO_8859-4
- alias ISO_8859-4:1988
- alias latin4
- alias l4
- alias ibm914
- alias ibm-914
- alias cp914
- alias 914
- alias csISOLatin4
-
-charset ISO-8859-5 ISO_8859_5
- alias iso8859_5 # JDK historical
- alias 8859_5
- alias iso-ir-144
- alias ISO_8859-5
- alias ISO_8859-5:1988
- alias ISO8859-5
- alias cyrillic
- alias ibm915
- alias ibm-915
- alias cp915
- alias 915
- alias csISOLatinCyrillic
-
-charset ISO-8859-7 ISO_8859_7
- alias iso8859_7 # JDK historical
- alias 8859_7
- alias iso-ir-126
- alias ISO_8859-7
- alias ISO_8859-7:1987
- alias ELOT_928
- alias ECMA-118
- alias greek
- alias greek8
- alias csISOLatinGreek
- alias sun_eu_greek # Solaris 7/8 compatibility
- alias ibm813
- alias ibm-813
- alias 813
- alias cp813
- alias iso8859-7 # Solaris 9 compatibility
-
-charset ISO-8859-9 ISO_8859_9
- alias iso8859_9 # JDK historical
- alias 8859_9
- alias iso-ir-148
- alias ISO_8859-9
- alias ISO_8859-9:1989
- alias ISO8859-9
- alias latin5
- alias l5
- alias ibm920
- alias ibm-920
- alias 920
- alias cp920
- alias csISOLatin5
-
-charset ISO-8859-13 ISO_8859_13
- alias iso8859_13 # JDK historical
- alias 8859_13
- alias iso_8859-13
- alias ISO8859-13
-
-charset ISO-8859-15 ISO_8859_15
-
- # IANA alias
- alias ISO_8859-15
-
- # Other aliases
- alias 8859_15
- alias ISO-8859-15
- alias ISO8859_15
- alias ISO8859-15
- alias IBM923
- alias IBM-923
- alias cp923
- alias 923
- alias LATIN0
- alias LATIN9
- alias L9
- alias csISOlatin0
- alias csISOlatin9
- alias ISO8859_15_FDIS
-
-charset KOI8-R KOI8_R
- alias koi8_r # JDK historical
- alias koi8
- alias cskoi8r
-
-charset KOI8-U KOI8_U
- alias koi8_u
-
-charset windows-1250 MS1250
- alias cp1250 # JDK historical
- alias cp5346 # Euro IBM CCSID
-
-charset windows-1251 MS1251
- alias cp1251 # JDK historical
- alias cp5347 # Euro IBM CCSID
- alias ansi-1251 # Solaris compatibility
-
-charset windows-1252 MS1252
- alias cp1252 # JDK historical
- alias cp5348 # Euro IBM CCSID
-
-charset windows-1253 MS1253
- alias cp1253 # JDK historical
- alias cp5349 # Euro IBM CCSID
-
-charset windows-1254 MS1254
- alias cp1254 # JDK historical
- alias cp5350 # Euro IBM CCSID
-
-charset windows-1257 MS1257
- alias cp1257 # JDK historical
- alias cp5353 # Euro IBM CCSID
-
-
-charset IBM437 IBM437
- alias cp437 #JDK historical
- alias ibm437
- alias ibm-437
- alias 437
- alias cspc8codepage437
- alias windows-437
-
-charset x-IBM737 IBM737
- alias cp737 #JDK historical
- alias ibm737
- alias ibm-737
- alias 737
-
-charset IBM775 IBM775
- alias cp775 #JDK historical
- alias ibm775
- alias ibm-775
- alias 775
-
-charset IBM850 IBM850
- alias cp850 #JDK historical
- alias ibm-850
- alias ibm850
- alias 850
- alias cspc850multilingual
-
-charset IBM852 IBM852
- alias cp852 #JDK historical
- alias ibm852
- alias ibm-852
- alias 852
- alias csPCp852
-
-charset IBM855 IBM855
- alias cp855 #JDK historical
- alias ibm-855
- alias ibm855
- alias 855
- alias cspcp855
-
-charset IBM857 IBM857
- alias cp857 #JDK historical
- alias ibm857
- alias ibm-857
- alias 857
- alias csIBM857
-
-charset IBM00858 IBM858
- alias cp858 #JDK historical
- alias ccsid00858
- alias cp00858
- alias 858
- alias PC-Multilingual-850+euro
-
-charset IBM862 IBM862
- alias cp862 #JDK historical
- alias ibm862
- alias ibm-862
- alias 862
- alias csIBM862
- alias cspc862latinhebrew
-
-charset IBM866 IBM866
- alias cp866 #JDK historical
- alias ibm866
- alias ibm-866
- alias 866
- alias csIBM866
-
-charset x-IBM874 IBM874
- alias cp874 #JDK historical
- alias ibm874
- alias ibm-874
- alias 874
diff --git a/jdk/make/data/charsetmapping/stdcs-linux b/jdk/make/data/charsetmapping/stdcs-linux
new file mode 100644
index 00000000000..6ab35ee715e
--- /dev/null
+++ b/jdk/make/data/charsetmapping/stdcs-linux
@@ -0,0 +1,19 @@
+#
+# generate these charsets into sun.nio.cs
+#
+Big5
+Big5_Solaris
+Big5_HKSCS
+EUC_CN
+EUC_KR
+EUC_JP
+EUC_JP_LINUX
+EUC_JP_Open
+GBK
+Johab
+PCK
+JIS_X_0201
+JIS_X_0208
+JIS_X_0212
+JIS_X_0208_Solaris
+JIS_X_0212_Solaris
diff --git a/jdk/make/data/charsetmapping/stdcs-solaris b/jdk/make/data/charsetmapping/stdcs-solaris
new file mode 100644
index 00000000000..6e57033b3c7
--- /dev/null
+++ b/jdk/make/data/charsetmapping/stdcs-solaris
@@ -0,0 +1,23 @@
+#
+# generate these charsets into sun.nio.cs
+#
+Big5
+Big5_Solaris
+Big5_HKSCS # always together with Big5
+EUC_CN
+EUC_KR
+EUC_JP
+EUC_JP_LINUX
+EUC_JP_Open
+GBK
+ISO_8859_11
+ISO_8859_3
+ISO_8859_6
+ISO_8859_8
+Johab
+PCK
+JIS_X_0201
+JIS_X_0208
+JIS_X_0212
+JIS_X_0208_Solaris
+JIS_X_0212_Solaris
diff --git a/jdk/make/data/charsetmapping/stdcs-windows b/jdk/make/data/charsetmapping/stdcs-windows
new file mode 100644
index 00000000000..e579c89cb52
--- /dev/null
+++ b/jdk/make/data/charsetmapping/stdcs-windows
@@ -0,0 +1,16 @@
+#
+# generate these charsets into sun.nio.cs
+#
+GBK
+Johab
+MS1255
+MS1256
+MS1258
+MS874
+MS932
+JIS_X_0201 # JIS_X_0201 is used by MS932 in its contains() method
+SJIS # SJIS must go together with MS932 to support sun.nio.cs.map
+MS936
+MS949
+MS950
+MS950_HKSCS_XP
diff --git a/jdk/make/data/tzdata/VERSION b/jdk/make/data/tzdata/VERSION
index 9987fde6dcb..034114ae6ca 100644
--- a/jdk/make/data/tzdata/VERSION
+++ b/jdk/make/data/tzdata/VERSION
@@ -21,4 +21,4 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
#
-tzdata2014j
+tzdata2015a
diff --git a/jdk/make/data/tzdata/antarctica b/jdk/make/data/tzdata/antarctica
index 0cdac270861..1f3e4347b21 100644
--- a/jdk/make/data/tzdata/antarctica
+++ b/jdk/make/data/tzdata/antarctica
@@ -70,8 +70,8 @@ Rule ChileAQ 2009 only - Mar Sun>=9 3:00u 0 -
Rule ChileAQ 2010 only - Apr Sun>=1 3:00u 0 -
Rule ChileAQ 2011 only - May Sun>=2 3:00u 0 -
Rule ChileAQ 2011 only - Aug Sun>=16 4:00u 1:00 S
-Rule ChileAQ 2012 max - Apr Sun>=23 3:00u 0 -
-Rule ChileAQ 2012 max - Sep Sun>=2 4:00u 1:00 S
+Rule ChileAQ 2012 2015 - Apr Sun>=23 3:00u 0 -
+Rule ChileAQ 2012 2014 - Sep Sun>=2 4:00u 1:00 S
# Argentina - year-round bases
# Belgrano II, Confin Coast, -770227-0343737, since 1972-02-05
@@ -377,9 +377,10 @@ Zone Antarctica/Rothera 0 - zzz 1976 Dec 1
#
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Antarctica/Palmer 0 - zzz 1965
- -4:00 ArgAQ AR%sT 1969 Oct 5
+ -4:00 ArgAQ AR%sT 1969 Oct 5
-3:00 ArgAQ AR%sT 1982 May
- -4:00 ChileAQ CL%sT
+ -4:00 ChileAQ CL%sT 2015 Apr 26 3:00u
+ -3:00 - CLT
#
#
# McMurdo Station, Ross Island, since 1955-12
diff --git a/jdk/make/data/tzdata/asia b/jdk/make/data/tzdata/asia
index 960cab5062e..bff837c48d8 100644
--- a/jdk/make/data/tzdata/asia
+++ b/jdk/make/data/tzdata/asia
@@ -168,10 +168,7 @@ Zone Asia/Baku 3:19:24 - LMT 1924 May 2
4:00 Azer AZ%sT
# Bahrain
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Bahrain 3:22:20 - LMT 1920 # Manamah
- 4:00 - GST 1972 Jun
- 3:00 - AST
+# See Asia/Qatar.
# Bangladesh
# From Alexander Krivenyshev (2009-05-13):
@@ -1754,9 +1751,7 @@ Zone Asia/Pyongyang 8:23:00 - LMT 1908 Apr 1
###############################################################################
# Kuwait
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Kuwait 3:11:56 - LMT 1950
- 3:00 - AST
+# See Asia/Riyadh.
# Laos
# See Asia/Bangkok.
@@ -1977,12 +1972,7 @@ Zone Asia/Kathmandu 5:41:16 - LMT 1920
5:45 - NPT # Nepal Time
# Oman
-
-# Milne says 3:54:24 was the meridian of the Muscat Tidal Observatory.
-
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Muscat 3:54:24 - LMT 1920
- 4:00 - GST
+# See Asia/Dubai.
# Pakistan
@@ -2476,6 +2466,7 @@ Zone Asia/Manila -15:56:00 - LMT 1844 Dec 31
Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha
4:00 - GST 1972 Jun
3:00 - AST
+Link Asia/Qatar Asia/Bahrain
# Saudi Arabia
#
@@ -2502,6 +2493,8 @@ Zone Asia/Qatar 3:26:08 - LMT 1920 # Al Dawhah / Doha
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Riyadh 3:06:52 - LMT 1947 Mar 14
3:00 - AST
+Link Asia/Riyadh Asia/Aden # Yemen
+Link Asia/Riyadh Asia/Kuwait
# Singapore
# taken from Mok Ly Yng (2003-10-30)
@@ -2790,6 +2783,7 @@ Zone Asia/Ashgabat 3:53:32 - LMT 1924 May 2 # or Ashkhabad
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
Zone Asia/Dubai 3:41:12 - LMT 1920
4:00 - GST
+Link Asia/Dubai Asia/Muscat # Oman
# Uzbekistan
# Byalokoz 1919 says Uzbekistan was 4:27:53.
@@ -2874,10 +2868,4 @@ Zone Asia/Ho_Chi_Minh 7:06:40 - LMT 1906 Jul 1
7:00 - ICT
# Yemen
-
-# Milne says 2:59:54 was the meridian of the saluting battery at Aden,
-# and that Yemen was at 1:55:56, the meridian of the Hagia Sophia.
-
-# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Asia/Aden 2:59:54 - LMT 1950
- 3:00 - AST
+# See Asia/Riyadh.
diff --git a/jdk/make/data/tzdata/backward b/jdk/make/data/tzdata/backward
index ba012f45733..95266a6f16c 100644
--- a/jdk/make/data/tzdata/backward
+++ b/jdk/make/data/tzdata/backward
@@ -28,7 +28,7 @@
# and their old names. Many names changed in late 1993.
# Link TARGET LINK-NAME
-Link Africa/Asmara Africa/Asmera
+Link Africa/Nairobi Africa/Asmera
Link Africa/Abidjan Africa/Timbuktu
Link America/Argentina/Catamarca America/Argentina/ComodRivadavia
Link America/Adak America/Atka
diff --git a/jdk/make/data/tzdata/europe b/jdk/make/data/tzdata/europe
index 2ed6ad36b5d..89790f06c17 100644
--- a/jdk/make/data/tzdata/europe
+++ b/jdk/make/data/tzdata/europe
@@ -1430,35 +1430,32 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 Oct
# might be a reference to the Julian calendar as opposed to Gregorian, or it
# might mean something else (???).
#
-# From Paul Eggert (2006-03-22):
-# The Iceland Almanak, Shanks & Pottenger, and Whitman disagree on many points.
-# We go with the Almanak, except for one claim from Shanks & Pottenger, namely
-# that Reykavik was 21W57 from 1837 to 1908, local mean time before that.
+# From Paul Eggert (2014-11-22):
+# The information below is taken from the 1988 Almanak; see
+# http://www.almanak.hi.is/klukkan.html
#
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
-Rule Iceland 1917 1918 - Feb 19 23:00 1:00 S
+Rule Iceland 1917 1919 - Feb 19 23:00 1:00 S
Rule Iceland 1917 only - Oct 21 1:00 0 -
-Rule Iceland 1918 only - Nov 16 1:00 0 -
+Rule Iceland 1918 1919 - Nov 16 1:00 0 -
+Rule Iceland 1921 only - Mar 19 23:00 1:00 S
+Rule Iceland 1921 only - Jun 23 1:00 0 -
Rule Iceland 1939 only - Apr 29 23:00 1:00 S
-Rule Iceland 1939 only - Nov 29 2:00 0 -
+Rule Iceland 1939 only - Oct 29 2:00 0 -
Rule Iceland 1940 only - Feb 25 2:00 1:00 S
-Rule Iceland 1940 only - Nov 3 2:00 0 -
-Rule Iceland 1941 only - Mar 2 1:00s 1:00 S
-Rule Iceland 1941 only - Nov 2 1:00s 0 -
-Rule Iceland 1942 only - Mar 8 1:00s 1:00 S
-Rule Iceland 1942 only - Oct 25 1:00s 0 -
+Rule Iceland 1940 1941 - Nov Sun>=2 1:00s 0 -
+Rule Iceland 1941 1942 - Mar Sun>=2 1:00s 1:00 S
# 1943-1946 - first Sunday in March until first Sunday in winter
Rule Iceland 1943 1946 - Mar Sun>=1 1:00s 1:00 S
-Rule Iceland 1943 1948 - Oct Sun>=22 1:00s 0 -
+Rule Iceland 1942 1948 - Oct Sun>=22 1:00s 0 -
# 1947-1967 - first Sunday in April until first Sunday in winter
Rule Iceland 1947 1967 - Apr Sun>=1 1:00s 1:00 S
-# 1949 Oct transition delayed by 1 week
+# 1949 and 1967 Oct transitions delayed by 1 week
Rule Iceland 1949 only - Oct 30 1:00s 0 -
Rule Iceland 1950 1966 - Oct Sun>=22 1:00s 0 -
Rule Iceland 1967 only - Oct 29 1:00s 0 -
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
-Zone Atlantic/Reykjavik -1:27:24 - LMT 1837
- -1:27:48 - RMT 1908 # Reykjavik Mean Time?
+Zone Atlantic/Reykjavik -1:28 - LMT 1908
-1:00 Iceland IS%sT 1968 Apr 7 1:00s
0:00 - GMT
diff --git a/jdk/make/data/tzdata/leapseconds b/jdk/make/data/tzdata/leapseconds
index 7612f2bc9b7..9b0a2278433 100644
--- a/jdk/make/data/tzdata/leapseconds
+++ b/jdk/make/data/tzdata/leapseconds
@@ -77,3 +77,7 @@ Leap 1998 Dec 31 23:59:60 + S
Leap 2005 Dec 31 23:59:60 + S
Leap 2008 Dec 31 23:59:60 + S
Leap 2012 Jun 30 23:59:60 + S
+Leap 2015 Jun 30 23:59:60 + S
+
+# Updated through IERS Bulletin C49
+# File expires on: 28 December 2015
diff --git a/jdk/make/data/tzdata/northamerica b/jdk/make/data/tzdata/northamerica
index 86c9503a4eb..5943cfeec4b 100644
--- a/jdk/make/data/tzdata/northamerica
+++ b/jdk/make/data/tzdata/northamerica
@@ -147,7 +147,7 @@ Rule US 1918 1919 - Mar lastSun 2:00 1:00 D
Rule US 1918 1919 - Oct lastSun 2:00 0 S
Rule US 1942 only - Feb 9 2:00 1:00 W # War
Rule US 1945 only - Aug 14 23:00u 1:00 P # Peace
-Rule US 1945 only - Sep 30 2:00 0 S
+Rule US 1945 only - Sep lastSun 2:00 0 S
Rule US 1967 2006 - Oct lastSun 2:00 0 S
Rule US 1967 1973 - Apr lastSun 2:00 1:00 D
Rule US 1974 only - Jan 6 2:00 1:00 D
@@ -2147,11 +2147,11 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# Mexico
-# From Paul Eggert (2001-03-05):
+# From Paul Eggert (2014-12-07):
# The Investigation and Analysis Service of the
# Mexican Library of Congress (MLoC) has published a
# history of Mexican local time (in Spanish)
-# http://www.cddhcu.gob.mx/bibliot/publica/inveyana/polisoc/horver/
+# http://www.diputados.gob.mx/bibliot/publica/inveyana/polisoc/horver/index.htm
#
# Here are the discrepancies between Shanks & Pottenger (S&P) and the MLoC.
# (In all cases we go with the MLoC.)
@@ -2320,6 +2320,24 @@ Zone America/Dawson -9:17:40 - LMT 1900 Aug 20
# efecto desde las dos horas del segundo domingo de marzo y concluirá a
# las dos horas del primer domingo de noviembre.
+# From Steffen Thorsen (2014-12-08), translated by Gwillim Law:
+# The Mexican state of Quintana Roo will likely change to EST in 2015.
+#
+# http://www.unioncancun.mx/articulo/2014/12/04/medio-ambiente/congreso-aprueba-una-hora-mas-de-sol-en-qroo
+# "With this change, the time conflict that has existed between the municipios
+# of Quintana Roo and the municipio of Felipe Carrillo Puerto may come to an
+# end. The latter declared itself in rebellion 15 years ago when a time change
+# was initiated in Mexico, and since then it has refused to change its time
+# zone along with the rest of the country."
+#
+# From Steffen Thorsen (2015-01-14), translated by Gwillim Law:
+# http://sipse.com/novedades/confirman-aplicacion-de-nueva-zona-horaria-para-quintana-roo-132331.html
+# "...the new time zone will come into effect at two o'clock on the first Sunday
+# of February, when we will have to advance the clock one hour from its current
+# time..."
+#
+# Also, the new zone will not use DST.
+
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
Rule Mexico 1939 only - Feb 5 0:00 1:00 D
Rule Mexico 1939 only - Jun 25 0:00 0 S
@@ -2340,7 +2358,8 @@ Rule Mexico 2002 max - Oct lastSun 2:00 0 S
Zone America/Cancun -5:47:04 - LMT 1922 Jan 1 0:12:56
-6:00 - CST 1981 Dec 23
-5:00 Mexico E%sT 1998 Aug 2 2:00
- -6:00 Mexico C%sT
+ -6:00 Mexico C%sT 2015 Feb 1 2:00
+ -5:00 - EST
# Campeche, Yucatán; represented by Mérida
Zone America/Merida -5:58:28 - LMT 1922 Jan 1 0:01:32
-6:00 - CST 1981 Dec 23
diff --git a/jdk/make/data/tzdata/southamerica b/jdk/make/data/tzdata/southamerica
index 0b70dea5616..02cf12113a0 100644
--- a/jdk/make/data/tzdata/southamerica
+++ b/jdk/make/data/tzdata/southamerica
@@ -1229,6 +1229,11 @@ Zone America/Rio_Branco -4:31:12 - LMT 1914
# DST Start: first Saturday of September 2014 (Sun 07 Sep 2014 04:00 UTC)
# http://www.diariooficial.interior.gob.cl//media/2014/02/19/do-20140219.pdf
+# From Juan Correa (2015-01-28):
+# ... today the Ministry of Energy announced that Chile will drop DST, will keep
+# "summer time" (UTC -3 / UTC -5) all year round....
+# http://www.minenergia.cl/ministerio/noticias/generales/ministerio-de-energia-anuncia.html
+
# NOTE: ChileAQ rules for Antarctic bases are stored separately in the
# 'antarctica' file.
@@ -1270,8 +1275,8 @@ Rule Chile 2009 only - Mar Sun>=9 3:00u 0 -
Rule Chile 2010 only - Apr Sun>=1 3:00u 0 -
Rule Chile 2011 only - May Sun>=2 3:00u 0 -
Rule Chile 2011 only - Aug Sun>=16 4:00u 1:00 S
-Rule Chile 2012 max - Apr Sun>=23 3:00u 0 -
-Rule Chile 2012 max - Sep Sun>=2 4:00u 1:00 S
+Rule Chile 2012 2015 - Apr Sun>=23 3:00u 0 -
+Rule Chile 2012 2014 - Sep Sun>=2 4:00u 1:00 S
# IATA SSIM anomalies: (1992-02) says 1992-03-14;
# (1996-09) says 1998-03-08. Ignore these.
# Zone NAME GMTOFF RULES FORMAT [UNTIL]
@@ -1282,11 +1287,13 @@ Zone America/Santiago -4:42:46 - LMT 1890
-4:00 - CLT 1919 Jul 1 # Chile Time
-4:42:46 - SMT 1927 Sep 1 # Santiago Mean Time
-5:00 Chile CL%sT 1947 May 22 # Chile Time
- -4:00 Chile CL%sT
+ -4:00 Chile CL%sT 2015 Apr 26 3:00u
+ -3:00 - CLT
Zone Pacific/Easter -7:17:44 - LMT 1890
-7:17:28 - EMT 1932 Sep # Easter Mean Time
- -7:00 Chile EAS%sT 1982 Mar 13 21:00 # Easter Time
- -6:00 Chile EAS%sT
+ -7:00 Chile EAS%sT 1982 Mar 13 3:00u # Easter Time
+ -6:00 Chile EAS%sT 2015 Apr 26 3:00u
+ -5:00 - EAST
#
# Salas y Gómez Island is uninhabited.
# Other Chilean locations, including Juan Fernández Is, Desventuradas Is,
diff --git a/jdk/make/data/tzdata/zone.tab b/jdk/make/data/tzdata/zone.tab
index 0ef9ba869ea..ffb6469676e 100644
--- a/jdk/make/data/tzdata/zone.tab
+++ b/jdk/make/data/tzdata/zone.tab
@@ -297,7 +297,7 @@ MU -2010+05730 Indian/Mauritius
MV +0410+07330 Indian/Maldives
MW -1547+03500 Africa/Blantyre
MX +1924-09909 America/Mexico_City Central Time - most locations
-MX +2105-08646 America/Cancun Central Time - Quintana Roo
+MX +2105-08646 America/Cancun Eastern Standard Time - Quintana Roo
MX +2058-08937 America/Merida Central Time - Campeche, Yucatan
MX +2540-10019 America/Monterrey Mexican Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas away from US border
MX +2550-09730 America/Matamoros US Central Time - Coahuila, Durango, Nuevo Leon, Tamaulipas near US border
diff --git a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk
index a646099c339..85d67f34c71 100644
--- a/jdk/make/gensrc/Gensrc-jdk.charsets.gmk
+++ b/jdk/make/gensrc/Gensrc-jdk.charsets.gmk
@@ -30,23 +30,27 @@ include GensrcCommon.gmk
# Generate files using the charsetmapping tool
#
CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
+
CHARSET_GENSRC_JAVA_DIR_CS := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.charsets/sun/nio/cs/ext
CHARSET_DONE_CS := $(CHARSET_GENSRC_JAVA_DIR_CS)/_the.charsetmapping
CHARSET_COPYRIGHT_HEADER := $(JDK_TOPDIR)/make/src/classes/build/tools/charsetmapping
CHARSET_TEMPLATES := \
$(CHARSET_DATA_DIR)/SingleByte-X.java.template \
$(CHARSET_DATA_DIR)/DoubleByte-X.java.template
+CHARSET_EXTENDED_JAVA_TEMPLATES := \
+ $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext/ExtendedCharsets.java.template
+CHARSET_EXTENDED_JAVA_DIR := $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext
+CHARSET_STANDARD_OS := stdcs-$(OPENJDK_TARGET_OS)
-$(CHARSET_DONE_CS)-extsbcs: $(CHARSET_DATA_DIR)/extsbcs \
- $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
+$(CHARSET_DONE_CS)-extcs: $(CHARSET_DATA_DIR)/charsets \
+ $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \
+ $(CHARSET_TEMPLATES) $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
+ $(BUILD_TOOLS_JDK)
$(MKDIR) -p $(@D)
- $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) extsbcs
- $(TOUCH) '$@'
-
-$(CHARSET_DONE_CS)-dbcs: $(CHARSET_DATA_DIR)/dbcs \
- $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
- $(MKDIR) -p $(@D)
- $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) dbcs
+ $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_CS) \
+ extcs charsets $(CHARSET_STANDARD_OS) \
+ $(CHARSET_EXTENDED_JAVA_TEMPLATES) \
+ $(CHARSET_EXTENDED_JAVA_DIR) $(LOG_INFO)
$(TOUCH) '$@'
$(CHARSET_DONE_CS)-hkscs: $(CHARSET_COPYRIGHT_HEADER)/HKSCS.java \
@@ -67,8 +71,7 @@ $(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat: $(CHARSET_DATA_DIR)/sjis0213.map \
$(TOOL_CHARSETMAPPING) '$<' '$@' sjis0213
GENSRC_JDK_CHARSETS += \
- $(CHARSET_DONE_CS)-extsbcs \
- $(CHARSET_DONE_CS)-dbcs \
+ $(CHARSET_DONE_CS)-extcs \
$(CHARSET_DONE_CS)-hkscs \
$(CHARSET_DONE_CS)-euctw \
$(CHARSET_GENSRC_JAVA_DIR_CS)/sjis0213.dat \
diff --git a/jdk/make/gensrc/GensrcCharsetMapping.gmk b/jdk/make/gensrc/GensrcCharsetMapping.gmk
index af1e9f08ce4..e0243a95dcf 100644
--- a/jdk/make/gensrc/GensrcCharsetMapping.gmk
+++ b/jdk/make/gensrc/GensrcCharsetMapping.gmk
@@ -25,112 +25,29 @@
################################################################################
#
-# Generate files using the charsetmapping tool
+# Generate StandardCharsets.java and individul sun.nio.cs charset class using
+# the charsetmapping tool
#
CHARSET_DATA_DIR := $(JDK_TOPDIR)/make/data/charsetmapping
+CHARSET_EXTSRC_DIR := $(JDK_TOPDIR)/src/jdk.charsets/share/classes/sun/nio/cs/ext
CHARSET_GENSRC_JAVA_DIR_BASE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/sun/nio/cs
CHARSET_DONE_BASE := $(CHARSET_GENSRC_JAVA_DIR_BASE)/_the.charsetmapping
CHARSET_TEMPLATES := \
$(CHARSET_DATA_DIR)/SingleByte-X.java.template \
$(CHARSET_DATA_DIR)/DoubleByte-X.java.template
+CHARSET_STANDARD_JAVA_TEMPLATES := \
+ $(JDK_TOPDIR)/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
+CHARSET_STANDARD_OS := stdcs-$(OPENJDK_TARGET_OS)
-$(CHARSET_DONE_BASE)-sbcs: $(CHARSET_DATA_DIR)/sbcs \
- $(CHARSET_TEMPLATES) $(BUILD_TOOLS_JDK)
+$(CHARSET_DONE_BASE)-stdcs: $(CHARSET_DATA_DIR)/charsets \
+ $(wildcard $(CHARSET_DATA_DIR)/$(CHARSET_STANDARD_OS)) \
+ $(CHARSET_TEMPLATES) $(CHARSET_STANDARD_JAVA_TEMPLATES) \
+ $(BUILD_TOOLS_JDK)
$(MKDIR) -p $(@D)
- $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) sbcs
+ $(TOOL_CHARSETMAPPING) $(CHARSET_DATA_DIR) $(CHARSET_GENSRC_JAVA_DIR_BASE) \
+ stdcs charsets $(CHARSET_STANDARD_OS) \
+ $(CHARSET_STANDARD_JAVA_TEMPLATES) $(CHARSET_EXTSRC_DIR) $(LOG_INFO)
$(TOUCH) '$@'
-GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-sbcs
+GENSRC_JAVA_BASE += $(CHARSET_DONE_BASE)-stdcs
-################################################################################
-#
-# Generate the sun/nio/cs/StandardCharsets.java file
-#
-CHARSET_STANDARD_GENSRC_DIR := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/_standardcharsets
-CHARSET_STANDARD_DATA := $(CHARSET_DATA_DIR)/standard-charsets
-CHARSET_STANDARD_JAVA := sun/nio/cs/StandardCharsets.java
-
-CHARSET_ALIASES_TABLES_AWK := ' \
- BEGIN { n = 1; m = 1; } \
- /^[ \t]*charset / { \
- csn = $$2; cln = $$3; \
- lcsn = tolower(csn); \
- lcsns[n++] = lcsn; \
- csns[lcsn] = csn; \
- classMap[lcsn] = cln; \
- if (n > 2) \
- printf " };\n\n"; \
- printf " static final String[] aliases_%s = new String[] {\n", cln; \
- } \
- /^[ \t]*alias / { \
- acsns[m++] = tolower($$2); \
- aliasMap[tolower($$2)] = lcsn; \
- printf " \"%s\",\n", $$2; \
- } \
- END { \
- printf " };\n\n"; \
- } '
-
-CHARSET_ALIASES_MAP_AWK := ' \
- /^[ \t]*charset / { \
- csn = $$2; \
- lcsn = tolower(csn); \
- } \
- /^[ \t]*alias / { \
- an = tolower($$2); \
- printf "%-20s \"%s\"\n", an, lcsn; \
- } '
-
-CHARSET_CLASSES_MAP_AWK := ' \
- /^[ \t]*charset / { \
- csn = $$2; cln = $$3; \
- lcsn = tolower(csn); \
- printf "%-20s \"%s\"\n", lcsn, cln; \
- } '
-
-# This target should be referenced using the order-only operator (|)
-$(CHARSET_STANDARD_GENSRC_DIR):
- $(MKDIR) -p '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet: $(CHARSET_STANDARD_DATA) \
- | $(CHARSET_STANDARD_GENSRC_DIR)
- $(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_TABLES_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map: $(CHARSET_STANDARD_DATA) \
- | $(CHARSET_STANDARD_GENSRC_DIR)
- $(NAWK) < '$<' > '$@' $(CHARSET_ALIASES_MAP_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/classes-map: $(CHARSET_STANDARD_DATA) \
- | $(CHARSET_STANDARD_GENSRC_DIR)
- $(NAWK) < '$<' > '$@' $(CHARSET_CLASSES_MAP_AWK)
-
-$(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map \
- $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
- $(TOOL_HASHER) -i Aliases < '$<' > '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
- $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
- $(TOOL_HASHER) -i Classes < '$<' > '$@'
-
-$(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet: $(CHARSET_STANDARD_GENSRC_DIR)/classes-map \
- $(BUILD_TOOLS_JDK) | $(CHARSET_STANDARD_GENSRC_DIR)
- $(TOOL_HASHER) -i -e Cache -t Charset < '$<' > '$@'
-
-$(eval $(call SetupTextFileProcessing, BUILD_CHARSET_STANDARD, \
- SOURCE_FILES := $(JDK_TOPDIR)/src/java.base/share/classes/$(CHARSET_STANDARD_JAVA).template, \
- OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/gensrc/java.base/$(CHARSET_STANDARD_JAVA), \
- INCLUDES := \
- _INCLUDE_ALIASES_TABLES_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet ; \
- _INCLUDE_ALIASES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet ; \
- _INCLUDE_CLASSES_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet ; \
- _INCLUDE_CACHE_MAP_ => $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet ; , \
-))
-
-# Processing of template depends on the snippets being generated first
-$(BUILD_CHARSET_STANDARD): \
- $(CHARSET_STANDARD_GENSRC_DIR)/aliases-tables.java.snippet \
- $(CHARSET_STANDARD_GENSRC_DIR)/aliases-map.java.snippet \
- $(CHARSET_STANDARD_GENSRC_DIR)/classes-map.java.snippet \
- $(CHARSET_STANDARD_GENSRC_DIR)/cache-map.java.snippet
-
-GENSRC_JAVA_BASE += $(BUILD_CHARSET_STANDARD)
diff --git a/jdk/make/launcher/Launcher-jdk.dev.gmk b/jdk/make/launcher/Launcher-jdk.dev.gmk
index 6008ffd3b6d..92b6d1bacb9 100644
--- a/jdk/make/launcher/Launcher-jdk.dev.gmk
+++ b/jdk/make/launcher/Launcher-jdk.dev.gmk
@@ -31,6 +31,12 @@ $(eval $(call SetupLauncher,jar, \
$(eval $(call SetupLauncher,jarsigner, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.jarsigner.Main"$(COMMA) }'))
+ifndef BUILD_HEADLESS_ONLY
+ $(eval $(call SetupLauncher,policytool, \
+ -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
+ $(XLIBS)))
+endif
+
$(eval $(call SetupLauncher,jdeps, \
-DEXPAND_CLASSPATH_WILDCARDS \
-DNEVER_ACT_AS_SERVER_CLASS_MACHINE \
diff --git a/jdk/make/launcher/Launcher-jdk.runtime.gmk b/jdk/make/launcher/Launcher-jdk.runtime.gmk
index 220c2ff40e8..366dc5cc9a2 100644
--- a/jdk/make/launcher/Launcher-jdk.runtime.gmk
+++ b/jdk/make/launcher/Launcher-jdk.runtime.gmk
@@ -25,12 +25,6 @@
include LauncherCommon.gmk
-ifndef BUILD_HEADLESS_ONLY
- $(eval $(call SetupLauncher,policytool, \
- -DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "sun.security.tools.policytool.PolicyTool"$(COMMA) }',, \
- $(XLIBS)))
-endif
-
$(eval $(call SetupLauncher,pack200, \
-DJAVA_ARGS='{ "-J-ms8m"$(COMMA) "com.sun.java.util.jar.pack.Driver"$(COMMA) }'))
@@ -66,19 +60,6 @@ UNPACKEXE_LANG := C
ifeq ($(OPENJDK_TARGET_OS), solaris)
UNPACKEXE_LANG := C++
endif
-UNPACKEXE_DEBUG_SYMBOLS := true
-# On windows, unpack200 is linked completely differently to all other
-# executables, using the compiler with the compiler arguments.
-# It's also linked incrementally, producing a .ilk file that needs to
-# be kept away.
-ifeq ($(OPENJDK_TARGET_OS), windows)
- BUILD_UNPACKEXE_LDEXE := $(CC)
- EXE_OUT_OPTION_save := $(EXE_OUT_OPTION)
- EXE_OUT_OPTION := -Fe
- # With the current way unpack200 is built, debug symbols aren't supported
- # anyway.
- UNPACKEXE_DEBUG_SYMBOLS := false
-endif
# The linker on older SuSE distros (e.g. on SLES 10) complains with:
# "Invalid version tag `SUNWprivate_1.1'. Only anonymous version tag is allowed in executable."
@@ -93,49 +74,36 @@ $(eval $(call SetupNativeCompilation,BUILD_UNPACKEXE, \
SRC := $(UNPACKEXE_SRC), \
LANG := $(UNPACKEXE_LANG), \
OPTIMIZATION := LOW, \
- CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) \
- -DFULL, \
+ CFLAGS := $(UNPACKEXE_CFLAGS) $(CXXFLAGS_JDKEXE) -DFULL, \
CFLAGS_release := -DPRODUCT, \
CFLAGS_linux := -fPIC, \
CFLAGS_solaris := -KPIC, \
CFLAGS_macosx := -fPIC, \
MAPFILE := $(UNPACK_MAPFILE),\
- LDFLAGS := $(UNPACKEXE_ZIPOBJS), \
- LDFLAGS_windows := $(CXXFLAGS_JDKEXE), \
- LDFLAGS_unix := $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
+ LDFLAGS := $(UNPACKEXE_ZIPOBJS) \
+ $(LDFLAGS_JDKEXE) $(LDFLAGS_CXX_JDK) \
$(call SET_SHARED_LIBRARY_NAME,$(LIBRARY_PREFIX)unpack$(SHARED_LIBRARY_SUFFIX)) \
$(call SET_SHARED_LIBRARY_ORIGIN), \
LDFLAGS_linux := -lc, \
LDFLAGS_solaris := $(UNPACKEXE_LDFLAGS_solaris) -lc, \
LDFLAGS_SUFFIX := $(LIBCXX), \
OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
- OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/unpackexe$(OUTPUT_SUBDIR), \
+ OUTPUT_DIR := $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE), \
PROGRAM := unpack200, \
VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
RC_FLAGS := $(RC_FLAGS) \
-D "JDK_FNAME=unpack200.exe" \
-D "JDK_INTERNAL_NAME=unpack200" \
-D "JDK_FTYPE=0x1L", \
- DEBUG_SYMBOLS := $(UNPACKEXE_DEBUG_SYMBOLS), \
+ DEBUG_SYMBOLS := true, \
MANIFEST := $(JDK_TOPDIR)/src/jdk.runtime/windows/native/unpack200/unpack200_proto.exe.manifest))
-ifeq ($(OPENJDK_TARGET_OS), windows)
- EXE_OUT_OPTION := $(EXE_OUT_OPTION_save)
-endif
-
ifneq ($(USE_EXTERNAL_LIBZ), true)
$(BUILD_UNPACKEXE): $(UNPACKEXE_ZIPOBJS)
endif
-# Build into object dir and copy executable afterwards to avoid .ilk file in
-# image. The real fix would be clean up linking of unpack200 using
-# -link -incremental:no
-# like all other launchers.
-$(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX): $(BUILD_UNPACKEXE)
- $(call install-file)
-
-TARGETS += $(SUPPORT_OUTPUTDIR)/modules_cmds/$(MODULE)/unpack200$(EXE_SUFFIX)
+TARGETS += $(BUILD_UNPACKEXE)
################################################################################
diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk
index fca33420271..d7e50779625 100644
--- a/jdk/make/lib/Awt2dLibraries.gmk
+++ b/jdk/make/lib/Awt2dLibraries.gmk
@@ -515,6 +515,77 @@ TARGETS += $(BUILD_LIBJAVAJPEG)
################################################################################
+ifeq ($(BUILD_HEADLESS), true)
+ # Mac and Windows only use the native AWT lib, do not build libawt_headless
+ ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
+
+ LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
+ $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
+ $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
+ $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
+ $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
+ $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
+ #
+
+ LIBAWT_HEADLESS_EXCLUDES := medialib
+ LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
+ $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
+ -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
+ -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
+ -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
+ -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
+ -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
+ -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
+ -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
+ -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
+ -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
+ -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
+ $(LIBJAVA_HEADER_FLAGS) \
+ #
+
+ LIBAWT_HEADLESS_REORDER :=
+ ifeq ($(OPENJDK_TARGET_OS), solaris)
+ ifneq ($(OPENJDK_TARGET_CPU), x86_64)
+ LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
+ endif
+ endif
+
+ $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
+ LIBRARY := awt_headless, \
+ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
+ SRC := $(LIBAWT_HEADLESS_DIRS), \
+ EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
+ LANG := C, \
+ OPTIMIZATION := LOW, \
+ CFLAGS := $(CFLAGS_JDKLIB) \
+ -DHEADLESS=true \
+ -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
+ $(CUPS_CFLAGS) \
+ $(X_CFLAGS) \
+ $(LIBAWT_HEADLESS_CFLAGS), \
+ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
+ LDFLAGS := $(LDFLAGS_JDKLIB) \
+ $(call SET_SHARED_LIBRARY_ORIGIN), \
+ LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
+ LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
+ LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
+ LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
+ REORDER := $(LIBAWT_HEADLESS_REORDER), \
+ LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
+ LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
+ LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
+ OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
+ DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
+
+ $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
+
+ TARGETS += $(BUILD_LIBAWT_HEADLESS)
+
+ endif
+endif
+
+################################################################################
+
LIBFONTMANAGER_SRC := $(JDK_TOPDIR)/src/java.desktop/share/native/libfontmanager \
$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libfontmanager
LIBFONTMANAGER_CFLAGS := \
@@ -562,10 +633,6 @@ ifeq ($(OPENJDK_TARGET_OS), linux)
BUILD_LIBFONTMANAGER_ExtensionSubtables.cpp_CXXFLAGS := -fno-strict-aliasing
endif
-# Libfontmanager doesn't actually need X_LIBS to link, but if building
-# on a Solaris machine without X installed, using a devkit, linking
-# to libawt_xawt will fail without the -L parameters from X_LIBS. Filter
-# out the -R parameters since they aren't needed.
$(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
LIBRARY := fontmanager, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@@ -583,9 +650,8 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
LDFLAGS_SUFFIX := $(BUILD_LIBFONTMANAGER_FONTLIB), \
LDFLAGS_SUFFIX_linux := -lawt $(LIBM) $(LIBCXX) -ljava -ljvm -lc, \
- LDFLAGS_SUFFIX_solaris := $(filter-out -R%, $(X_LIBS)) \
- -lawt -lawt_xawt -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
- LDFLAGS_SUFFIX_aix := -lawt -lawt_xawt $(LIBM) $(LIBCXX) -ljava -ljvm,\
+ LDFLAGS_SUFFIX_solaris := -lawt -lawt_headless -lc $(LIBM) $(LIBCXX) -ljava -ljvm, \
+ LDFLAGS_SUFFIX_aix := -lawt -lawt_headless $(LIBM) $(LIBCXX) -ljava -ljvm,\
LDFLAGS_SUFFIX_macosx := -lawt $(LIBM) $(LIBCXX) -undefined dynamic_lookup \
-ljava -ljvm, \
LDFLAGS_SUFFIX_windows := $(WIN_JAVA_LIB) advapi32.lib user32.lib gdi32.lib \
@@ -601,7 +667,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBFONTMANAGER, \
$(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT)
ifneq (, $(findstring $(OPENJDK_TARGET_OS), solaris aix))
- $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_XAWT)
+ $(BUILD_LIBFONTMANAGER): $(BUILD_LIBAWT_HEADLESS)
endif
TARGETS += $(BUILD_LIBFONTMANAGER)
@@ -723,77 +789,6 @@ TARGETS += $(BUILD_LIBJAWT)
################################################################################
-ifeq ($(BUILD_HEADLESS), true)
- # Mac and Windows only use the native AWT lib, do not build libawt_headless
- ifeq ($(findstring $(OPENJDK_TARGET_OS), windows macosx),)
-
- LIBAWT_HEADLESS_DIRS := $(JDK_TOPDIR)/src/java.desktop/unix/native/libawt_headless/awt \
- $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
- $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/opengl \
- $(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/java2d/x11 \
- $(JDK_TOPDIR)/src/java.desktop/share/native/common/java2d/opengl \
- $(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
- #
-
- LIBAWT_HEADLESS_EXCLUDES := medialib
- LIBAWT_HEADLESS_CFLAGS := -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop \
- $(addprefix -I, $(LIBAWT_HEADLESS_DIRS)) \
- -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d \
- -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/loops \
- -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image/cvutils \
- -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/java2d/pipe \
- -I$(JDK_TOPDIR)/src/java.desktop/share/native/libawt/awt/image \
- -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libawt/java2d \
- -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/font \
- -I$(JDK_TOPDIR)/src/java.desktop/share/native/common/awt/debug \
- -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/common/font \
- -I$(JDK_TOPDIR)/src/java.desktop/$(OPENJDK_TARGET_OS_TYPE)/native/libsunwjdga/ \
- $(LIBJAVA_HEADER_FLAGS) \
- #
-
- LIBAWT_HEADLESS_REORDER :=
- ifeq ($(OPENJDK_TARGET_OS), solaris)
- ifneq ($(OPENJDK_TARGET_CPU), x86_64)
- LIBAWT_HEADLESS_REORDER := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/reorder-$(OPENJDK_TARGET_CPU)
- endif
- endif
-
- $(eval $(call SetupNativeCompilation,BUILD_LIBAWT_HEADLESS, \
- LIBRARY := awt_headless, \
- OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
- SRC := $(LIBAWT_HEADLESS_DIRS), \
- EXCLUDES := $(LIBAWT_HEADLESS_EXCLUDES), \
- LANG := C, \
- OPTIMIZATION := LOW, \
- CFLAGS := $(CFLAGS_JDKLIB) \
- -DHEADLESS=true \
- -DPACKAGE_PATH=\"$(PACKAGE_PATH)\" \
- $(CUPS_CFLAGS) \
- $(X_CFLAGS) \
- $(LIBAWT_HEADLESS_CFLAGS), \
- MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libawt_headless/mapfile-vers, \
- LDFLAGS := $(LDFLAGS_JDKLIB) \
- $(call SET_SHARED_LIBRARY_ORIGIN), \
- LDFLAGS_unix := -L$(INSTALL_LIBRARIES_HERE), \
- LDFLAGS_linux := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
- LDFLAGS_solaris := $(call SET_SHARED_LIBRARY_ORIGIN,/..), \
- LDFLAGS_macosx := $(call SET_SHARED_LIBRARY_ORIGIN)., \
- REORDER := $(LIBAWT_HEADLESS_REORDER), \
- LDFLAGS_SUFFIX_linux := -ljvm -lawt -lm $(LIBDL) -ljava, \
- LDFLAGS_SUFFIX_aix := -ljvm -lawt -ljava,\
- LDFLAGS_SUFFIX_solaris := $(LIBDL) -ljvm -lawt -lm -ljava $(LIBCXX) -lc, \
- OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libawt_headless, \
- DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))
-
- $(BUILD_LIBAWT_HEADLESS): $(BUILD_LIBAWT)
-
- TARGETS += $(BUILD_LIBAWT_HEADLESS)
-
- endif
-endif
-
-################################################################################
-
ifndef BUILD_HEADLESS_ONLY
LIBSPLASHSCREEN_DIRS := \
diff --git a/jdk/make/lib/CoreLibraries.gmk b/jdk/make/lib/CoreLibraries.gmk
index 026a6876efb..7046e35b785 100644
--- a/jdk/make/lib/CoreLibraries.gmk
+++ b/jdk/make/lib/CoreLibraries.gmk
@@ -271,6 +271,11 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
# Staticically link with c runtime on windows.
LIBJLI_CFLAGS := $(filter-out -MD, $(LIBJLI_CFLAGS))
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)
+ # Supply the name of the C runtime lib.
+ LIBJLI_CFLAGS += -DMSVCR_DLL_NAME='"$(notdir $(MSVCR_DLL))"'
+ ifneq ($(MSVCP_DLL), )
+ LIBJLI_CFLAGS += -DMSVCP_DLL_NAME='"$(notdir $(MSVCP_DLL))"'
+ endif
else
LIBJLI_OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE)/jli
endif
diff --git a/jdk/make/lib/Lib-jdk.runtime.gmk b/jdk/make/lib/Lib-jdk.runtime.gmk
index 927db9bf334..4bf9b026cc1 100644
--- a/jdk/make/lib/Lib-jdk.runtime.gmk
+++ b/jdk/make/lib/Lib-jdk.runtime.gmk
@@ -59,37 +59,3 @@ $(BUILD_LIBUNPACK): $(call FindLib, java.base, java)
TARGETS += $(BUILD_LIBUNPACK)
################################################################################
-
-LIBJSDT_SRC := $(JDK_TOPDIR)/src/jdk.runtime/share/native/libjsdt \
- $(JDK_TOPDIR)/src/jdk.runtime/$(OPENJDK_TARGET_OS_TYPE)/native/libjsdt
-
-$(eval $(call SetupNativeCompilation,BUILD_LIBJSDT, \
- LIBRARY := jsdt, \
- OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
- SRC := $(LIBJSDT_SRC), \
- LANG := C, \
- OPTIMIZATION := LOW, \
- CFLAGS := $(CFLAGS_JDKLIB) $(CFLAGS_WARNINGS_ARE_ERRORS) \
- $(addprefix -I, $(LIBJSDT_SRC)) \
- $(LIBJAVA_HEADER_FLAGS) \
- -I$(SUPPORT_OUTPUTDIR)/headers/jdk.runtime, \
- MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libjsdt/mapfile-vers, \
- LDFLAGS := $(LDFLAGS_JDKLIB) \
- $(call SET_SHARED_LIBRARY_ORIGIN), \
- LDFLAGS_SUFFIX_linux := $(LIBDL), \
- LDFLAGS_SUFFIX_windows := $(LDFLAGS_JDKLIB_SUFFIX) $(LIBDL), \
- LDFLAGS_SUFFIX_macosx := $(LIBDL), \
- LDFLAGS_SUFFIX_solaris := -lc, \
- VERSIONINFO_RESOURCE := $(GLOBAL_VERSION_INFO_RESOURCE), \
- RC_FLAGS := $(RC_FLAGS) \
- -D "JDK_FNAME=jsdt.dll" \
- -D "JDK_INTERNAL_NAME=jsdt" \
- -D "JDK_FTYPE=0x2L", \
- OBJECT_DIR := $(SUPPORT_OUTPUTDIR)/native/$(MODULE)/libjsdt, \
- DEBUG_SYMBOLS := true))
-
-$(BUILD_LIBJSDT): $(call FindLib, java.base, java)
-
-TARGETS += $(BUILD_LIBJSDT)
-
-################################################################################
diff --git a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionName.java b/jdk/make/src/classes/build/tools/charsetmapping/Charset.java
similarity index 62%
rename from jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionName.java
rename to jdk/make/src/classes/build/tools/charsetmapping/Charset.java
index a1ad675e8c0..94d61c35f0d 100644
--- a/jdk/src/jdk.runtime/share/classes/com/sun/tracing/dtrace/FunctionName.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Charset.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 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
@@ -23,25 +23,20 @@
* questions.
*/
-package com.sun.tracing.dtrace;
+package build.tools.charsetmapping;
-import java.lang.annotation.Target;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.ElementType;
-
-/**
- * An annotation used to specify the {@code function} field for a DTrace probe.
- *
- * This annotation can be added to a method in a user-defined Provider
- * specification interface to set the {@code function} field that is used
- * for the generated DTrace probe associated with that method.
- *
- * @since 1.7
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.METHOD)
-public @interface FunctionName {
- String value();
+class Charset {
+ String pkgName;
+ String clzName;
+ String csName;
+ String hisName;
+ String type;
+ boolean isASCII;
+ int b1Min;
+ int b1Max;
+ int b2Min;
+ int b2Max;
+ String[] aliases;
+ boolean isGenSrc = false;
+ boolean isInternal = false;
}
-
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java b/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java
index d54d20582dc..bd4bd7140f6 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/DBCS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -24,71 +24,32 @@
*/
package build.tools.charsetmapping;
+
import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Formatter;
-import java.util.regex.*;
-import java.nio.charset.*;
+import java.util.regex.Pattern;
import static build.tools.charsetmapping.Utils.*;
public class DBCS {
// pattern used by this class to read in mapping table
static Pattern mPattern = Pattern.compile("(?:0x)?(\\p{XDigit}++)\\s++(?:0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
- public static void genClass(String args[]) throws Exception {
-
- Scanner s = new Scanner(new File(args[0], args[2]));
- while (s.hasNextLine()) {
- String line = s.nextLine();
- if (line.startsWith("#") || line.length() == 0)
- continue;
- String[] fields = line.split("\\s+");
- if (fields.length < 10) {
- System.err.println("Misconfiged sbcs line <" + line + ">?");
- continue;
- }
- String clzName = fields[0];
- String csName = fields[1];
- String hisName = ("null".equals(fields[2]))?null:fields[2];
- String type = fields[3].toUpperCase();
- if ("BASIC".equals(type))
- type = "";
- else
- type = "_" + type;
- String pkgName = fields[4];
- boolean isASCII = Boolean.valueOf(fields[5]);
- int b1Min = toInteger(fields[6]);
- int b1Max = toInteger(fields[7]);
- int b2Min = toInteger(fields[8]);
- int b2Max = toInteger(fields[9]);
- System.out.printf("%s,%s,%s,%b,%s%n", clzName, csName, hisName, isASCII, pkgName);
- genClass0(args[0], args[1], "DoubleByte-X.java.template",
- clzName, csName, hisName, pkgName,
- isASCII, type,
- b1Min, b1Max, b2Min, b2Max);
- }
- }
-
- static int toInteger(String s) {
- if (s.startsWith("0x") || s.startsWith("0X"))
- return Integer.valueOf(s.substring(2), 16);
- else
- return Integer.valueOf(s);
- }
-
- private static void genClass0(String srcDir, String dstDir, String template,
- String clzName,
- String csName,
- String hisName,
- String pkgName,
- boolean isASCII,
- String type,
- int b1Min, int b1Max,
- int b2Min, int b2Max)
+ public static void genClass(String type, Charset cs,
+ String srcDir, String dstDir, String template)
throws Exception
{
+ String clzName = cs.clzName;
+ String csName = cs.csName;
+ String hisName = cs.hisName;
+ String pkgName = cs.pkgName;
+ boolean isASCII = cs.isASCII;
+ int b1Min = cs.b1Min;
+ int b1Max = cs.b1Max;
+ int b2Min = cs.b2Min;
+ int b2Max = cs.b2Max;
StringBuilder b2cSB = new StringBuilder();
StringBuilder b2cNRSB = new StringBuilder();
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java b/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java
index b37b0e3fea5..18c0a24ad7b 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/HKSCS.java
@@ -42,38 +42,51 @@ public class HKSCS {
private static Pattern hkscs =
Pattern.compile("(?:0x)?+(\\p{XDigit}++)\\s++(?:0x|U\\+)?+(\\p{XDigit}++)?\\s*+(?:0x|U\\+)?(\\p{XDigit}++)?\\s*+.*");
- static void genClass(String args[]) throws Exception {
-
+ static void genClass2008(String srcDir, String dstDir, String pkgName)
+ throws Exception
+ {
// hkscs2008
- genClass0(new FileInputStream(new File(args[0], "HKSCS2008.map")),
- new FileInputStream(new File(args[0], "HKSCS2008.c2b")),
- new PrintStream(new File(args[1], "HKSCSMapping.java"),
+ genClass0(new FileInputStream(new File(srcDir, "HKSCS2008.map")),
+ new FileInputStream(new File(srcDir, "HKSCS2008.c2b")),
+ new PrintStream(new File(dstDir, "HKSCSMapping.java"),
"ISO-8859-1"),
+ pkgName,
"HKSCSMapping",
- getCopyright(new File(args[3])));
+ true,
+ "");
+ }
-
- // xp2001
- genClass0(new FileInputStream(new File(args[0], "HKSCS_XP.map")),
+ static void genClassXP(String srcDir, String dstDir, String pkgName)
+ throws Exception
+ {
+ genClass0(new FileInputStream(new File(srcDir, "HKSCS_XP.map")),
null,
- new PrintStream(new File(args[1], "HKSCS_XPMapping.java"),
+ new PrintStream(new File(dstDir, "HKSCS_XPMapping.java"),
"ISO-8859-1"),
+ pkgName,
"HKSCS_XPMapping",
- getCopyright(new File(args[3])));
+ false,
+ "");
+ }
+ static void genClass2001(String args[]) throws Exception {
// hkscs2001
genClass0(new FileInputStream(new File(args[0], "HKSCS2001.map")),
new FileInputStream(new File(args[0], "HKSCS2001.c2b")),
new PrintStream(new File(args[1], "HKSCS2001Mapping.java"),
"ISO-8859-1"),
+ "sun.nio.cs.ext",
"HKSCS2001Mapping",
+ false,
getCopyright(new File(args[3])));
}
static void genClass0(InputStream isB2C,
InputStream isC2B,
PrintStream ps,
+ String pkgName,
String clzName,
+ boolean isPublic,
String copyright)
throws Exception
{
@@ -132,8 +145,8 @@ public class HKSCS {
out.format(copyright);
out.format("%n// -- This file was mechanically generated: Do not edit! -- //%n");
- out.format("package sun.nio.cs.ext;%n%n");
- out.format("class %s {%n%n", clzName);
+ out.format("package %s;%n%n", pkgName);
+ out.format("%sclass %s {%n%n", isPublic ? "public " : "", clzName);
/* hardcoded in sun.nio.cs.ext.HKSCS.java
out.format(" final static int b1Min = 0x%x;%n", b1Min);
@@ -143,7 +156,8 @@ public class HKSCS {
*/
// bmp tables
- out.format("%n static final String[] b2cBmpStr = new String[] {%n");
+ out.format("%n %sstatic final String[] b2cBmpStr = new String[] {%n",
+ isPublic ? "public " : "");
for (int i = 0; i < 0x100; i++) {
if (b2cBmp[i])
out.format(bmp, i, b2Min, b2Max, ",");
@@ -153,7 +167,8 @@ public class HKSCS {
out.format(" };%n");
// supp tables
- out.format("%n static final String[] b2cSuppStr =");
+ out.format("%n %sstatic final String[] b2cSuppStr =",
+ isPublic ? "public " : "");
if (hasSupp) {
out.format(" new String[] {%n");
for (int i = 0; i < 0x100; i++) {
@@ -168,7 +183,8 @@ public class HKSCS {
}
// private area tables
- out.format("%n final static String pua =");
+ out.format("%n %sfinal static String pua =",
+ isPublic ? "public " : "");
if (hasPua) {
out.format("%n");
out.format(pua, 0, pua.length, ";");
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/Hasher.java b/jdk/make/src/classes/build/tools/charsetmapping/Hasher.java
new file mode 100644
index 00000000000..f935202a522
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Hasher.java
@@ -0,0 +1,265 @@
+/*
+ * Copyright (c) 2004, 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.
+ */
+
+package build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.*;
+
+
+/**
+ * Reads a map in the form of a sequence of key/value-expression pairs from the
+ * standard input, attempts to construct a hash map that fits within the given
+ * table-size and chain-depth constraints, and, if successful, writes source
+ * code to the standard output for a subclass of sun.util.PreHashedMap that
+ * implements the map.
+ *
+ * @see sun.util.PreHashedMap
+ *
+ * @author Mark Reinhold
+ */
+
+public class Hasher {
+
+ private PrintStream err = System.err;
+
+ boolean verbose = false;
+ List keys = new ArrayList<>(); // Key strings
+ List values = new ArrayList<>(); // Value expressions
+ String pkg = null; // Package prefix for generated class
+ String cln = null; // Name of generated class
+ String vtype = null; // Value type
+ int maxBits = 11; // lg table size
+ int maxDepth = 3; // Max chain depth
+ boolean inner = false; // Generating an inner class?
+ boolean empty = false; // Generating an empty table?
+
+ Object[] ht; // Hash table itself
+ int nb; // Number of bits (lg table size)
+ int md; // Maximum chain depth
+ int mask; // Hash-code mask
+ int shift; // Hash-code shift size
+
+ int hash(String w) {
+ return (w.hashCode() >> shift) & mask;
+ }
+
+ // Build a hash table of size 2^nb, shifting the hash code by s bits
+ //
+ void build(int nb, int s) {
+
+ this.nb = nb;
+ this.shift = s;
+ int n = 1 << nb;
+ this.mask = n - 1;
+ ht = new Object[n];
+ int nw = keys.size();
+
+ for (int i = 0; i < nw; i++) {
+ String w = keys.get(i);
+ String v = values.get(i);
+ int h = hash(w);
+ if (ht[h] == null)
+ ht[h] = new Object[] { w, v };
+ else
+ ht[h] = new Object[] { w, v, ht[h] };
+ }
+
+ this.md = 0;
+ for (int i = 0; i < n; i++) {
+ int d = 1;
+ for (Object[] a = (Object[])ht[i];
+ a != null && a.length > 2;
+ a = (Object[])a[2], d++);
+ this.md = Math.max(md, d);
+ }
+
+ }
+
+ Hasher build() {
+ // Iterate through acceptable table sizes
+ for (int nb = 2; nb < maxBits; nb++) {
+ // Iterate through possible shift sizes
+ for (int s = 0; s < (32 - nb); s++) {
+ build(nb, s);
+ if (verbose)
+ err.println("nb=" + nb + " s=" + s + " md=" + md);
+ if (md <= maxDepth) {
+ // Success
+ if (verbose) {
+ if (cln != null)
+ err.print(cln + ": ");
+ err.println("Table size " + (1 << nb) + " (" + nb + " bits)"
+ + ", shift " + shift
+ + ", max chain depth " + md);
+ }
+ return this;
+ }
+ }
+ }
+ throw new RuntimeException("Cannot find a suitable size"
+ + " within given constraints");
+ }
+
+ // Look for the given key in the hash table
+ //
+ String get(String k) {
+ int h = hash(k);
+ Object[] a = (Object[])ht[h];
+ for (;;) {
+ if (a[0].equals(k))
+ return (String)a[1];
+ if (a.length < 3)
+ return null;
+ a = (Object[])a[2];
+ }
+ }
+
+ // Test that all input keys can be found in the table
+ //
+ Hasher test() {
+ if (verbose)
+ err.println();
+ for (int i = 0, n = keys.size(); i < n; i++) {
+ String w = keys.get(i);
+ String v = get(w);
+ if (verbose)
+ err.println(hash(w) + "\t" + w);
+ if (!v.equals(values.get(i)))
+ throw new Error("Incorrect value: " + w + " --> "
+ + v + ", should be " + values.get(i));
+ }
+ return this;
+ }
+
+ String ind = ""; // Indent prefix
+
+ // Generate code for a single table entry
+ //
+ void genEntry(Object[] a, int depth, PrintStream out) {
+ Object v = empty ? null : a[1];
+ out.print("new Object[] { \"" + a[0] + "\", " + v);
+ if (a.length < 3) {
+ out.print(" }");
+ return;
+ }
+ out.println(",");
+ out.print(ind + " ");
+ for (int i = 0; i < depth; i++)
+ out.print(" ");
+ genEntry((Object[])a[2], depth + 1, out);
+ out.print(" }");
+ }
+
+ // Generate a PreHashedMap subclass from the computed hash table
+ //
+ Hasher generate(PrintStream out) throws IOException {
+ if (cln == null)
+ return this;
+
+ if (inner)
+ ind = " ";
+
+ if (!inner && pkg != null) {
+ out.println();
+ out.println("package " + pkg + ";");
+ out.println();
+ }
+
+ if (inner) {
+ out.println(ind + "private static final class " + cln);
+ } else {
+ out.println();
+ out.println("public final class " + cln);
+ }
+ out.println(ind + " extends sun.util.PreHashedMap<" + vtype +">");
+ out.println(ind + "{");
+
+ out.println();
+ out.println(ind + " private static final int ROWS = "
+ + ht.length + ";");
+ out.println(ind + " private static final int SIZE = "
+ + keys.size() + ";");
+ out.println(ind + " private static final int SHIFT = "
+ + shift + ";");
+ out.println(ind + " private static final int MASK = 0x"
+ + Integer.toHexString(mask) + ";");
+ out.println();
+
+ out.println(ind + " " + (inner ? "private " : "public ")
+ + cln + "() {");
+ out.println(ind + " super(ROWS, SIZE, SHIFT, MASK);");
+ out.println(ind + " }");
+ out.println();
+
+ out.println(ind + " protected void init(Object[] ht) {");
+ for (int i = 0; i < ht.length; i++) {
+ if (ht[i] == null)
+ continue;
+ Object[] a = (Object[])ht[i];
+ out.print(ind + " ht[" + i + "] = ");
+ genEntry(a, 0, out);
+ out.println(";");
+ }
+ out.println(ind + " }");
+ out.println();
+
+ out.println(ind + "}");
+ if (inner)
+ out.println();
+
+ return this;
+ }
+
+ private Hasher(List keys, List values,
+ String pkg, String cln, String vtype,
+ int maxBits, int maxDepth,
+ boolean inner, boolean empty,
+ boolean verbose) {
+ this.keys = keys;
+ this.values = values;
+ this.pkg = pkg;
+ this.cln = cln;
+ this.vtype = vtype;
+ this.maxBits = maxBits;
+ this.maxDepth = maxDepth;
+ this.inner = inner;
+ this.empty = empty;
+ this.verbose = verbose;
+ }
+
+ public static void genClass(PrintStream out,
+ List keys, List values,
+ String pkg, String cln, String vtype,
+ int maxBits, int maxDepth,
+ boolean inner, boolean empty, boolean verbose)
+ throws IOException {
+ new Hasher(keys, values, pkg, cln, vtype,
+ maxBits, maxDepth, inner, empty, verbose)
+ .build()
+ .test()
+ .generate(out);
+ }
+}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/Main.java b/jdk/make/src/classes/build/tools/charsetmapping/Main.java
index 0312cb646b4..b129288ea26 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/Main.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/Main.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, 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,25 +26,193 @@
package build.tools.charsetmapping;
import java.io.*;
+import java.util.ArrayList;
import java.util.Scanner;
+import java.util.LinkedHashMap;
+import java.util.Locale;
public class Main {
- public static void main(String args[]) throws Exception {
+ public static void main(String args[]) throws Throwable {
+ int SRC_DIR = 0;
+ int DST_DIR = 1;
+ int TYPE = 2;
+ int CHARSETS = 3;
+ int OS = 4;
+ int TEMPLATE = 5;
+ int EXT_SRC = 6;
+
if (args.length < 3 ) {
- System.out.println("Usage: java -jar charsetmapping.jar src dst mType [copyrightSrc]");
+ System.out.println("Usage: java -jar charsetmapping.jar src dst spiType charsets os [template]");
System.exit(1);
}
- if ("sbcs".equals(args[2]) || "extsbcs".equals(args[2])) {
- SBCS.genClass(args);
- } else if ("dbcs".equals(args[2])) {
- DBCS.genClass(args);
- } else if ("euctw".equals(args[2])) {
+ boolean isStandard = "stdcs".equals(args[TYPE]);
+ boolean isExtended = "extcs".equals(args[TYPE]);
+ if (isStandard || isExtended) {
+ LinkedHashMap charsets = getCharsets(
+ new File(args[SRC_DIR], args[CHARSETS]));
+ String[] osStdcs = getOSStdCSList(new File(args[SRC_DIR], args[OS]));
+ boolean hasBig5_HKSCS = false;
+ boolean hasMS950_HKSCS_XP = false;
+ for (String name : osStdcs) {
+ Charset cs = charsets.get(name);
+ if (cs != null) {
+ cs.pkgName = "sun.nio.cs";
+ }
+ if (name.equals("Big5_HKSCS")) {
+ hasBig5_HKSCS = true;
+ } else if (name.equals("MS950_HKSCS_XP")) {
+ hasMS950_HKSCS_XP = true;
+ }
+ }
+ for (Charset cs : charsets.values()) {
+ if (isStandard && cs.pkgName.equals("sun.nio.cs.ext") ||
+ isExtended && cs.pkgName.equals("sun.nio.cs")) {
+ continue;
+ }
+ verbose(cs);
+ switch (cs.type) {
+ case "template":
+ SRC.genClass(cs, args[EXT_SRC], args[DST_DIR]);
+ break;
+ case "sbcs":
+ SBCS.genClass(cs, args[SRC_DIR], args[DST_DIR],
+ "SingleByte-X.java.template");
+ break;
+ case "source":
+ break; // source file, do nothing
+ default: // dbcs
+ DBCS.genClass("dbcs".equals(cs.type) ?
+ "" : "_" + cs.type.toUpperCase(Locale.ENGLISH),
+ cs, args[SRC_DIR], args[DST_DIR],
+ "DoubleByte-X.java.template");
+ }
+ }
+ // provider StandardCharsets.java / ExtendedCharsets.java
+ SPI.genClass(args[TYPE], charsets, args[SRC_DIR], args[DST_DIR], args[TEMPLATE]);
+
+ // HKSCSMapping2008/XP.java goes together with Big5/MS950XP_HKSCS
+ if (isStandard && hasBig5_HKSCS || isExtended && !hasBig5_HKSCS) {
+ HKSCS.genClass2008(args[SRC_DIR], args[DST_DIR],
+ isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+ }
+ if (isStandard && hasMS950_HKSCS_XP || isExtended && !hasMS950_HKSCS_XP) {
+ HKSCS.genClassXP(args[SRC_DIR], args[DST_DIR],
+ isStandard ? "sun.nio.cs" : "sun.nio.cs.ext");
+ }
+ } else if ("euctw".equals(args[TYPE])) {
EUC_TW.genClass(args);
- } else if ("sjis0213".equals(args[2])) {
+ } else if ("sjis0213".equals(args[TYPE])) {
JIS0213.genClass(args);
- } else if ("hkscs".equals(args[2])) {
- HKSCS.genClass(args);
+ } else if ("hkscs".equals(args[TYPE])) {
+ HKSCS.genClass2001(args);
}
}
+
+ private static LinkedHashMap getCharsets(File cslist)
+ throws Throwable
+ {
+ LinkedHashMap charsets = new LinkedHashMap<>();
+ try (Scanner s = new Scanner(cslist)) {
+ Charset cs = null;
+ ArrayList names = new ArrayList<>();
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.startsWith("#") || line.length() == 0) {
+ continue;
+ }
+ String[] tokens = line.split("\\s+");
+ if (tokens.length < 2) {
+ continue;
+ }
+ if ("charset".equals(tokens[0])) {
+ if (cs != null) {
+ cs.aliases = names.toArray(new String[names.size()]);
+ charsets.put(cs.clzName, cs);
+ cs = null;
+ names.clear();
+ }
+ if (tokens.length < 3) {
+ throw new RuntimeException("Error: incorrect charset line [" + line + "]");
+ }
+ if ((cs = charsets.get(tokens[2])) != null) {
+ throw new RuntimeException("Error: deplicate charset line [" + line + "]");
+ }
+ cs = new Charset();
+ cs.csName = tokens[1];
+ cs.clzName = tokens[2];
+ } else {
+ String key = tokens[1]; // leading empty str
+ switch (key) {
+ case "alias":
+ if (tokens.length < 3) {
+ throw new RuntimeException("Error: incorrect alias line [" + line + "]");
+ } else if (names != null) {
+ names.add(tokens[2]); // ALIAS_NAME
+ }
+ break;
+ case "package":
+ cs.pkgName = tokens[2];
+ break;
+ case "type":
+ cs.type = tokens[2];
+ break;
+ case "hisname":
+ cs.hisName = tokens[2];
+ break;
+ case "ascii":
+ cs.isASCII = Boolean.parseBoolean(tokens[2]);
+ break;
+ case "minmax":
+ cs.b1Min = toInteger(tokens[2]);
+ cs.b1Max = toInteger(tokens[3]);
+ cs.b2Min = toInteger(tokens[4]);
+ cs.b2Max = toInteger(tokens[5]);
+ break;
+ case "internal":
+ cs.isInternal = Boolean.parseBoolean(tokens[2]);
+ break;
+ default: // ignore
+ }
+ }
+ }
+ if (cs != null) {
+ cs.aliases = names.toArray(new String[names.size()]);
+ charsets.put(cs.clzName, cs);
+ }
+ }
+ return charsets;
+ }
+
+ private static String[] getOSStdCSList(File stdcsos) throws Throwable
+ {
+ ArrayList names = new ArrayList<>();
+ if (stdcsos.exists()) {
+ try (Scanner s = new Scanner(stdcsos)) {
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ int i = line.indexOf('#');
+ if (i != -1) {
+ line = line.substring(0, i);
+ }
+ line = line.trim();
+ if (line.length() != 0) {
+ names.add(line);
+ }
+ }
+ }
+ }
+ return names.toArray(new String[names.size()]);
+ }
+
+ static void verbose(Charset cs) {
+ System.out.printf("%s, %s, %s, %s, %s %b%n",
+ cs.clzName, cs.csName, cs.hisName, cs.pkgName, cs.type, cs.isASCII);
+ }
+
+ static int toInteger(String s) {
+ return (s.startsWith("0x") || s.startsWith("0X"))
+ ? Integer.valueOf(s.substring(2), 16)
+ : Integer.valueOf(s);
+ }
}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java b/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java
index a7a136dad23..fa294f13b9b 100644
--- a/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SBCS.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2015, 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,93 +30,23 @@ import java.util.Arrays;
import java.util.ArrayList;
import java.util.Scanner;
import java.util.Formatter;
-import java.util.regex.*;
-import java.nio.charset.*;
+import java.util.regex.Pattern;
import static build.tools.charsetmapping.Utils.*;
public class SBCS {
- public static void genClass(String args[]) throws Exception {
-
- Scanner s = new Scanner(new File(args[0], args[2]));
- while (s.hasNextLine()) {
- String line = s.nextLine();
- if (line.startsWith("#") || line.length() == 0)
- continue;
- String[] fields = line.split("\\s+");
- if (fields.length < 5) {
- System.err.println("Misconfiged sbcs line <" + line + ">?");
- continue;
- }
- String clzName = fields[0];
- String csName = fields[1];
- String hisName = fields[2];
- boolean isASCII = Boolean.valueOf(fields[3]);
- String pkgName = fields[4];
- System.out.printf("%s,%s,%s,%b,%s%n", clzName, csName, hisName, isASCII, pkgName);
-
- genClass0(args[0], args[1], "SingleByte-X.java.template",
- clzName, csName, hisName, pkgName, isASCII);
- }
- }
-
- private static void toString(char[] sb, int off, int end,
- Formatter out, String closure,
- boolean comment) {
- while (off < end) {
- out.format(" \"");
- for (int j = 0; j < 8; j++) {
- if (off == end)
- break;
- char c = sb[off++];
- switch (c) {
- case '\b':
- out.format("\\b"); break;
- case '\t':
- out.format("\\t"); break;
- case '\n':
- out.format("\\n"); break;
- case '\f':
- out.format("\\f"); break;
- case '\r':
- out.format("\\r"); break;
- case '\"':
- out.format("\\\""); break;
- case '\'':
- out.format("\\'"); break;
- case '\\':
- out.format("\\\\"); break;
- default:
- out.format("\\u%04X", c & 0xffff);
- }
- }
- if (comment) {
- if (off == end)
- out.format("\" %s // 0x%02x - 0x%02x%n",
- closure, off-8, off-1);
- else
- out.format("\" + // 0x%02x - 0x%02x%n",
- off-8, off-1);
- } else {
- if (off == end)
- out.format("\"%s%n", closure);
- else
- out.format("\" +%n");
- }
- }
- }
-
static Pattern sbmap = Pattern.compile("0x(\\p{XDigit}++)\\s++(?:U\\+|0x)?(\\p{XDigit}++)(?:\\s++#.*)?");
- private static void genClass0(String srcDir, String dstDir,
- String template,
- String clzName,
- String csName,
- String hisName,
- String pkgName,
- boolean isASCII)
+ public static void genClass(Charset cs,
+ String srcDir, String dstDir, String template)
throws Exception
{
+ String clzName = cs.clzName;
+ String csName = cs.csName;
+ String hisName = cs.hisName;
+ String pkgName = cs.pkgName;
+ boolean isASCII = cs.isASCII;
+
StringBuilder b2cSB = new StringBuilder();
StringBuilder b2cNRSB = new StringBuilder();
StringBuilder c2bNRSB = new StringBuilder();
@@ -266,4 +196,50 @@ public class SBCS {
}
out.close();
}
+
+ private static void toString(char[] sb, int off, int end,
+ Formatter out, String closure, boolean comment)
+ {
+ while (off < end) {
+ out.format(" \"");
+ for (int j = 0; j < 8; j++) {
+ if (off == end)
+ break;
+ char c = sb[off++];
+ switch (c) {
+ case '\b':
+ out.format("\\b"); break;
+ case '\t':
+ out.format("\\t"); break;
+ case '\n':
+ out.format("\\n"); break;
+ case '\f':
+ out.format("\\f"); break;
+ case '\r':
+ out.format("\\r"); break;
+ case '\"':
+ out.format("\\\""); break;
+ case '\'':
+ out.format("\\'"); break;
+ case '\\':
+ out.format("\\\\"); break;
+ default:
+ out.format("\\u%04X", c & 0xffff);
+ }
+ }
+ if (comment) {
+ if (off == end)
+ out.format("\" %s // 0x%02x - 0x%02x%n",
+ closure, off-8, off-1);
+ else
+ out.format("\" + // 0x%02x - 0x%02x%n",
+ off-8, off-1);
+ } else {
+ if (off == end)
+ out.format("\"%s%n", closure);
+ else
+ out.format("\" +%n");
+ }
+ }
+ }
}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/SPI.java b/jdk/make/src/classes/build/tools/charsetmapping/SPI.java
new file mode 100644
index 00000000000..e0e2458bc40
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SPI.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright (c) 2015, 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 build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.Locale;
+import java.util.ArrayList;
+import java.util.LinkedHashMap;
+import java.util.Scanner;
+
+public class SPI {
+
+ public static void genClass(String type, LinkedHashMap charsets,
+ String srcDir, String dstDir, String template)
+ throws Exception
+ {
+ try (Scanner s = new Scanner(new File(template));
+ PrintStream out = new PrintStream(new FileOutputStream(
+ new File(dstDir, new File(
+ template.replace(".template", "")).getName()))); ) {
+ if (type.startsWith("extcs")) { // ExtendedCharsets.java
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.indexOf("_CHARSETS_DEF_LIST_") == -1) {
+ out.println(line);
+ } else {
+ charsets.values()
+ .stream()
+ .filter(cs -> cs.pkgName.equals("sun.nio.cs.ext") &&
+ !cs.isInternal)
+ .forEach( cs -> {
+ out.printf(" charset(\"%s\", \"%s\",%n", cs.csName, cs.clzName);
+ out.printf(" new String[] {%n");
+ for (String alias : cs.aliases) {
+ out.printf(" \"%s\",%n", alias);
+ }
+ out.printf(" });%n%n");
+ });
+ }
+ }
+ } else if (type.startsWith("stdcs")) { // StandardCharsets.java
+ ArrayList aliasKeys = new ArrayList<>();
+ ArrayList aliasValues = new ArrayList<>();
+ ArrayList clzKeys = new ArrayList<>();
+ ArrayList clzValues = new ArrayList<>();
+ charsets.values()
+ .stream()
+ .filter(cs -> cs.pkgName.equals("sun.nio.cs") &&
+ !cs.isInternal)
+ .forEach( cs -> {
+ String csname = cs.csName.toLowerCase(Locale.ENGLISH);
+ clzKeys.add(csname);
+ clzValues.add("\"" + cs.clzName + "\"");
+ if (cs.aliases != null) {
+ csname = "\"" + csname + "\"";
+ for (String alias : cs.aliases) {
+ aliasKeys.add(alias.toLowerCase(Locale.ENGLISH));
+ aliasValues.add(csname);
+ }
+ }
+ });
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.indexOf("_INCLUDE_ALIASES_TABLES_") != -1) {
+ charsets.values()
+ .stream()
+ .filter(cs -> cs.pkgName.equals("sun.nio.cs"))
+ .forEach( cs -> {
+ if (cs.aliases == null || cs.aliases.length == 0) {
+ out.printf(" static final String[] aliases_%s = null;%n%n",
+ cs.clzName);
+ } else {
+ // non-final for SJIS and MS932 to support sun.nio.cs.map
+ if (cs.clzName.equals("SJIS") || cs.clzName.equals("MS932")) {
+ out.printf(" static String[] aliases_%s = new String[] {%n",
+ cs.clzName);
+ } else {
+ out.printf(" static final String[] aliases_%s = new String[] {%n",
+ cs.clzName);
+ }
+ for (String alias : cs.aliases) {
+ out.printf(" \"%s\",%n", alias);
+ }
+ out.printf(" };%n%n");
+ }
+ });
+ Charset cs = charsets.get("SJIS");
+ if (cs == null || cs.pkgName.equals("sun.nio.cs.ext")) {
+ // StandardCharsets.java has explicit reference
+ // to aliases_SJIS/MS932. If we don't have these
+ // two in std, just put a pair of dummy fields to
+ // make the compiler happy.
+ out.printf(" static String[] aliases_SJIS = null;%n%n");
+ out.printf(" static String[] aliases_MS932 = null;%n%n");
+ }
+ } else if (line.indexOf("_INCLUDE_ALIASES_MAP_") != -1) {
+ Hasher.genClass(out, aliasKeys, aliasValues,
+ null, "Aliases", "String",
+ 11, 3, true, false, false);
+ } else if (line.indexOf("_INCLUDE_CLASSES_MAP_") != -1) {
+ Hasher.genClass(out, clzKeys, clzValues,
+ null, "Classes", "String",
+ 11, 3, true, false, false);
+ } else if (line.indexOf("_INCLUDE_CACHE_MAP_") != -1) {
+ Hasher.genClass(out, clzKeys, clzValues,
+ null, "Cache", "Charset",
+ 11, 3, true, true, false);
+ } else {
+ out.println(line);
+ }
+ }
+ } else {
+ throw new RuntimeException("Unknown type:" + type);
+ }
+ }
+
+ }
+}
diff --git a/jdk/make/src/classes/build/tools/charsetmapping/SRC.java b/jdk/make/src/classes/build/tools/charsetmapping/SRC.java
new file mode 100644
index 00000000000..326f3c181b8
--- /dev/null
+++ b/jdk/make/src/classes/build/tools/charsetmapping/SRC.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2015, 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 build.tools.charsetmapping;
+
+import java.io.*;
+import java.util.Scanner;
+
+public class SRC {
+
+ public static void genClass(Charset cs, String srcDir, String dstDir)
+ throws Exception
+ {
+ String clzName = cs.clzName;
+ String csName = cs.csName;
+ String pkgName = cs.pkgName;
+
+ try (Scanner s = new Scanner(new File(srcDir, clzName + ".java.template"));
+ PrintStream out = new PrintStream(new FileOutputStream(
+ new File(dstDir, clzName + ".java")));) {
+ while (s.hasNextLine()) {
+ String line = s.nextLine();
+ if (line.indexOf("$") < 0) {
+ out.println(line);
+ continue;
+ }
+ if (line.indexOf("$PACKAGE$") != -1) {
+ out.println(line.replace("$PACKAGE$", pkgName));
+ } else if (line.indexOf("$ALIASES$") != -1) {
+ if ("sun.nio.cs".equals(pkgName))
+ out.println(line.replace("$ALIASES$",
+ "StandardCharsets.aliases_" + clzName));
+ else
+ out.println(line.replace("$ALIASES$",
+ "ExtendedCharsets.aliasesFor(\"" + csName + "\")"));
+ } else {
+ out.println(line);
+ }
+ }
+ }
+ }
+}
diff --git a/jdk/make/src/classes/build/tools/module/boot.modules b/jdk/make/src/classes/build/tools/module/boot.modules
index 9763b9287d4..03b4b0eca90 100644
--- a/jdk/make/src/classes/build/tools/module/boot.modules
+++ b/jdk/make/src/classes/build/tools/module/boot.modules
@@ -1,9 +1,7 @@
java.base
-java.desktop
-java.activation
-java.annotations.common
java.compiler
-java.corba
+java.datatransfer
+java.desktop
java.instrument
java.logging
java.management
@@ -11,25 +9,21 @@ java.naming
java.prefs
java.rmi
java.scripting
-java.security.acl
java.security.jgss
java.security.sasl
java.smartcardio
java.sql
java.sql.rowset
-java.transaction
java.xml
-java.xml.bind
java.xml.crypto
-java.xml.ws
jdk.charsets
jdk.deploy
jdk.deploy.osx
jdk.hprof.agent
jdk.httpserver
+jdk.jfr
jdk.naming.rmi
jdk.sctp
jdk.security.auth
jdk.security.jgss
-jdk.jfr
jdk.snmp
diff --git a/jdk/make/src/classes/build/tools/module/ext.modules b/jdk/make/src/classes/build/tools/module/ext.modules
index ac6b6a2ac2f..934d4e9ba16 100644
--- a/jdk/make/src/classes/build/tools/module/ext.modules
+++ b/jdk/make/src/classes/build/tools/module/ext.modules
@@ -1,3 +1,10 @@
+java.activation
+java.annotations.common
+java.corba
+java.transaction
+java.xml.bind
+java.xml.ws
+jdk.accessbridge
jdk.crypto.ec
jdk.crypto.mscapi
jdk.crypto.pkcs11
@@ -6,4 +13,3 @@ jdk.localedata
jdk.naming.dns
jdk.scripting.nashorn
jdk.zipfs
-jdk.accessbridge
diff --git a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c
index 802d8742dee..eb432c12e08 100644
--- a/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c
+++ b/jdk/src/java.base/macosx/native/libjli/java_md_macosx.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -1059,6 +1059,7 @@ JVMInit(InvocationFunctions* ifn, jlong threadStackSize,
void PostJVMInit(JNIEnv *env, jstring mainClass, JavaVM *vm) {
jvmInstance = vm;
SetMainClassForAWT(env, mainClass);
+ CHECK_EXCEPTION_RETURN();
ShowSplashScreen();
}
diff --git a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java
index 8b0ba28e898..ee747c8e36c 100644
--- a/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java
+++ b/jdk/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015 Red Hat, Inc.
* 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,9 +29,7 @@
package com.sun.crypto.provider;
-import java.util.Arrays;
-import java.security.*;
-import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
+import java.security.ProviderException;
/**
* This class represents the GHASH function defined in NIST 800-38D
@@ -44,62 +43,90 @@ import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE;
*/
final class GHASH {
- private static final byte P128 = (byte) 0xe1; //reduction polynomial
-
- private static boolean getBit(byte[] b, int pos) {
- int p = pos / 8;
- pos %= 8;
- int i = (b[p] >>> (7 - pos)) & 1;
- return i != 0;
+ private static long getLong(byte[] buffer, int offset) {
+ long result = 0;
+ int end = offset + 8;
+ for (int i = offset; i < end; ++i) {
+ result = (result << 8) + (buffer[i] & 0xFF);
+ }
+ return result;
}
- private static void shift(byte[] b) {
- byte temp, temp2;
- temp2 = 0;
- for (int i = 0; i < b.length; i++) {
- temp = (byte) ((b[i] & 0x01) << 7);
- b[i] = (byte) ((b[i] & 0xff) >>> 1);
- b[i] = (byte) (b[i] | temp2);
- temp2 = temp;
+ private static void putLong(byte[] buffer, int offset, long value) {
+ int end = offset + 8;
+ for (int i = end - 1; i >= offset; --i) {
+ buffer[i] = (byte) value;
+ value >>= 8;
}
}
- // Given block X and Y, returns the muliplication of X * Y
- private static byte[] blockMult(byte[] x, byte[] y) {
- if (x.length != AES_BLOCK_SIZE || y.length != AES_BLOCK_SIZE) {
- throw new RuntimeException("illegal input sizes");
- }
- byte[] z = new byte[AES_BLOCK_SIZE];
- byte[] v = y.clone();
- // calculate Z1-Z127 and V1-V127
- for (int i = 0; i < 127; i++) {
+ private static final int AES_BLOCK_SIZE = 16;
+
+ // Multiplies state0, state1 by V0, V1.
+ private void blockMult(long V0, long V1) {
+ long Z0 = 0;
+ long Z1 = 0;
+ long X;
+
+ // Separate loops for processing state0 and state1.
+ X = state0;
+ for (int i = 0; i < 64; i++) {
// Zi+1 = Zi if bit i of x is 0
- if (getBit(x, i)) {
- for (int n = 0; n < z.length; n++) {
- z[n] ^= v[n];
- }
- }
- boolean lastBitOfV = getBit(v, 127);
- shift(v);
- if (lastBitOfV) v[0] ^= P128;
+ long mask = X >> 63;
+ Z0 ^= V0 & mask;
+ Z1 ^= V1 & mask;
+
+ // Save mask for conditional reduction below.
+ mask = (V1 << 63) >> 63;
+
+ // V = rightshift(V)
+ long carry = V0 & 1;
+ V0 = V0 >>> 1;
+ V1 = (V1 >>> 1) | (carry << 63);
+
+ // Conditional reduction modulo P128.
+ V0 ^= 0xe100000000000000L & mask;
+ X <<= 1;
}
+
+ X = state1;
+ for (int i = 64; i < 127; i++) {
+ // Zi+1 = Zi if bit i of x is 0
+ long mask = X >> 63;
+ Z0 ^= V0 & mask;
+ Z1 ^= V1 & mask;
+
+ // Save mask for conditional reduction below.
+ mask = (V1 << 63) >> 63;
+
+ // V = rightshift(V)
+ long carry = V0 & 1;
+ V0 = V0 >>> 1;
+ V1 = (V1 >>> 1) | (carry << 63);
+
+ // Conditional reduction.
+ V0 ^= 0xe100000000000000L & mask;
+ X <<= 1;
+ }
+
// calculate Z128
- if (getBit(x, 127)) {
- for (int n = 0; n < z.length; n++) {
- z[n] ^= v[n];
- }
- }
- return z;
+ long mask = X >> 63;
+ Z0 ^= V0 & mask;
+ Z1 ^= V1 & mask;
+
+ // Save result.
+ state0 = Z0;
+ state1 = Z1;
}
// hash subkey H; should not change after the object has been constructed
- private final byte[] subkeyH;
+ private final long subkeyH0, subkeyH1;
// buffer for storing hash
- private byte[] state;
+ private long state0, state1;
// variables for save/restore calls
- private byte[] stateSave = null;
+ private long stateSave0, stateSave1;
/**
* Initializes the cipher in the specified mode with the given key
@@ -114,8 +141,8 @@ final class GHASH {
if ((subkeyH == null) || subkeyH.length != AES_BLOCK_SIZE) {
throw new ProviderException("Internal error");
}
- this.subkeyH = subkeyH;
- this.state = new byte[AES_BLOCK_SIZE];
+ this.subkeyH0 = getLong(subkeyH, 0);
+ this.subkeyH1 = getLong(subkeyH, 8);
}
/**
@@ -124,31 +151,33 @@ final class GHASH {
* this object for different data w/ the same H.
*/
void reset() {
- Arrays.fill(state, (byte) 0);
+ state0 = 0;
+ state1 = 0;
}
/**
* Save the current snapshot of this GHASH object.
*/
void save() {
- stateSave = state.clone();
+ stateSave0 = state0;
+ stateSave1 = state1;
}
/**
* Restores this object using the saved snapshot.
*/
void restore() {
- state = stateSave;
+ state0 = stateSave0;
+ state1 = stateSave1;
}
private void processBlock(byte[] data, int ofs) {
if (data.length - ofs < AES_BLOCK_SIZE) {
throw new RuntimeException("need complete block");
}
- for (int n = 0; n < state.length; n++) {
- state[n] ^= data[ofs + n];
- }
- state = blockMult(state, subkeyH);
+ state0 ^= getLong(data, ofs);
+ state1 ^= getLong(data, ofs + 8);
+ blockMult(subkeyH0, subkeyH1);
}
void update(byte[] in) {
@@ -169,10 +198,10 @@ final class GHASH {
}
byte[] digest() {
- try {
- return state.clone();
- } finally {
- reset();
- }
+ byte[] result = new byte[AES_BLOCK_SIZE];
+ putLong(result, 0, state0);
+ putLong(result, 8, state1);
+ reset();
+ return result;
}
}
diff --git a/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java b/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java
index d70c73b19c9..fc5439e625b 100644
--- a/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java
+++ b/jdk/src/java.base/share/classes/java/io/PushbackInputStream.java
@@ -28,9 +28,10 @@ package java.io;
/**
* A PushbackInputStream
adds
* functionality to another input stream, namely
- * the ability to "push back" or "unread"
- * one byte. This is useful in situations where
- * it is convenient for a fragment of code
+ * the ability to "push back" or "unread" bytes,
+ * by storing pushed-back bytes in an internal buffer.
+ * This is useful in situations where
+ * it is convenient for a fragment of code
* to read an indefinite number of data bytes
* that are delimited by a particular byte
* value; after reading the terminating byte,
@@ -77,11 +78,9 @@ class PushbackInputStream extends FilterInputStream {
/**
* Creates a PushbackInputStream
* with a pushback buffer of the specified size
,
- * and saves its argument, the input stream
+ * and saves its argument, the input stream
* in
, for later use. Initially,
- * there is no pushed-back byte (the field
- * pushBack
is initialized to
- * -1
).
+ * the pushback buffer is empty.
*
* @param in the input stream from which bytes will be read.
* @param size the size of the pushback buffer.
@@ -99,11 +98,9 @@ class PushbackInputStream extends FilterInputStream {
/**
* Creates a PushbackInputStream
- * and saves its argument, the input stream
+ * with a 1-byte pushback buffer, and saves its argument, the input stream
* in
, for later use. Initially,
- * there is no pushed-back byte (the field
- * pushBack
is initialized to
- * -1
).
+ * the pushback buffer is empty.
*
* @param in the input stream from which bytes will be read.
*/
diff --git a/jdk/src/java.base/share/classes/java/lang/Number.java b/jdk/src/java.base/share/classes/java/lang/Number.java
index b89ed7190f0..019ed9c56c3 100644
--- a/jdk/src/java.base/share/classes/java/lang/Number.java
+++ b/jdk/src/java.base/share/classes/java/lang/Number.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1994, 2015, 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
@@ -37,7 +37,7 @@ package java.lang;
*
* For platform classes, the conversion is often analogous to a
* narrowing primitive conversion or a widening primitive conversion
- * as defining in The Java™ Language Specification
+ * as defined in The Java™ Language Specification
* 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
@@ -54,8 +54,7 @@ package java.lang;
*/
public abstract class Number implements java.io.Serializable {
/**
- * Returns the value of the specified number as an {@code int},
- * which may involve rounding or truncation.
+ * Returns the value of the specified number as an {@code int}.
*
* @return the numeric value represented by this object after conversion
* to type {@code int}.
@@ -63,8 +62,7 @@ public abstract class Number implements java.io.Serializable {
public abstract int intValue();
/**
- * Returns the value of the specified number as a {@code long},
- * which may involve rounding or truncation.
+ * Returns the value of the specified number as a {@code long}.
*
* @return the numeric value represented by this object after conversion
* to type {@code long}.
@@ -72,8 +70,7 @@ public abstract class Number implements java.io.Serializable {
public abstract long longValue();
/**
- * Returns the value of the specified number as a {@code float},
- * which may involve rounding.
+ * Returns the value of the specified number as a {@code float}.
*
* @return the numeric value represented by this object after conversion
* to type {@code float}.
@@ -81,8 +78,7 @@ public abstract class Number implements java.io.Serializable {
public abstract float floatValue();
/**
- * Returns the value of the specified number as a {@code double},
- * which may involve rounding.
+ * Returns the value of the specified number as a {@code double}.
*
* @return the numeric value represented by this object after conversion
* to type {@code double}.
@@ -90,8 +86,7 @@ public abstract class Number implements java.io.Serializable {
public abstract double doubleValue();
/**
- * Returns the value of the specified number as a {@code byte},
- * which may involve rounding or truncation.
+ * Returns the value of the specified number as a {@code byte}.
*
* This implementation returns the result of {@link #intValue} cast
* to a {@code byte}.
@@ -105,8 +100,7 @@ public abstract class Number implements java.io.Serializable {
}
/**
- * Returns the value of the specified number as a {@code short},
- * which may involve rounding or truncation.
+ * Returns the value of the specified number as a {@code short}.
*
*
This implementation returns the result of {@link #intValue} cast
* to a {@code short}.
diff --git a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
index 8d4576bd40c..72b260309d6 100644
--- a/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
+++ b/jdk/src/java.base/share/classes/java/lang/ProcessBuilder.java
@@ -964,6 +964,9 @@ public final class ProcessBuilder
* of the exception is system-dependent, but it will always be a
* subclass of {@link IOException}.
*
+ *
If the operating system does not support the creation of
+ * processes, an {@link UnsupportedOperationException} will be thrown.
+ *
*
Subsequent modifications to this process builder will not
* affect the returned {@link Process}.
*
@@ -998,6 +1001,9 @@ public final class ProcessBuilder
*
*
*
+ * @throws UnsupportedOperationException
+ * If the operating system does not support the creation of processes.
+ *
* @throws IOException if an I/O error occurs
*
* @see Runtime#exec(String[], String[], java.io.File)
diff --git a/jdk/src/java.base/share/classes/java/lang/Runtime.java b/jdk/src/java.base/share/classes/java/lang/Runtime.java
index 66c78537d39..114f6cb968f 100644
--- a/jdk/src/java.base/share/classes/java/lang/Runtime.java
+++ b/jdk/src/java.base/share/classes/java/lang/Runtime.java
@@ -576,6 +576,9 @@ public class Runtime {
* of the exception is system-dependent, but it will always be a
* subclass of {@link IOException}.
*
+ *
If the operating system does not support the creation of
+ * processes, an {@link UnsupportedOperationException} will be thrown.
+ *
*
* @param cmdarray array containing the command to call and
* its arguments.
@@ -597,6 +600,9 @@ public class Runtime {
* {@link SecurityManager#checkExec checkExec}
* method doesn't allow creation of the subprocess
*
+ * @throws UnsupportedOperationException
+ * If the operating system does not support the creation of processes.
+ *
* @throws IOException
* If an I/O error occurs
*
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java
index e9d2526cd8d..fe54fd21492 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java
@@ -31,7 +31,6 @@ import java.util.Arrays;
import sun.invoke.util.VerifyAccess;
import static java.lang.invoke.MethodHandleNatives.Constants.*;
import static java.lang.invoke.LambdaForm.*;
-import static java.lang.invoke.LambdaForm.BasicType.*;
import static java.lang.invoke.MethodTypeForm.*;
import static java.lang.invoke.MethodHandleStatics.*;
import java.lang.ref.WeakReference;
@@ -693,4 +692,10 @@ class DirectMethodHandle extends MethodHandle {
}
}
}
+
+ @Override
+ void customize() {
+ assert(form.customized == null);
+ // No need to customize DMHs.
+ }
}
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
index 9d8db4eef78..421db68b464 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InnerClassLambdaMetafactory.java
@@ -285,6 +285,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
// Forward the SAM method
MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, samMethodName,
samMethodType.toMethodDescriptorString(), null, null);
+ mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
new ForwardingMethodGenerator(mv).generate(samMethodType);
// Forward the bridges
@@ -292,6 +293,7 @@ import static jdk.internal.org.objectweb.asm.Opcodes.*;
for (MethodType mt : additionalBridges) {
mv = cw.visitMethod(ACC_PUBLIC|ACC_BRIDGE, samMethodName,
mt.toMethodDescriptorString(), null, null);
+ mv.visitAnnotation("Ljava/lang/invoke/LambdaForm$Hidden;", true);
new ForwardingMethodGenerator(mv).generate(mt);
}
}
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
index acb5aa91623..a29eed9417a 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java
@@ -56,9 +56,11 @@ class InvokerBytecodeGenerator {
private static final String OBJ = "java/lang/Object";
private static final String OBJARY = "[Ljava/lang/Object;";
+ private static final String MH_SIG = "L" + MH + ";";
private static final String LF_SIG = "L" + LF + ";";
private static final String LFN_SIG = "L" + LFN + ";";
private static final String LL_SIG = "(L" + OBJ + ";)L" + OBJ + ";";
+ private static final String LLV_SIG = "(L" + OBJ + ";L" + OBJ + ";)V";
private static final String CLL_SIG = "(L" + CLS + ";L" + OBJ + ";)L" + OBJ + ";";
/** Name of its super class*/
@@ -616,6 +618,15 @@ class InvokerBytecodeGenerator {
return g.loadMethod(g.generateCustomizedCodeBytes());
}
+ /** Generates code to check that actual receiver and LambdaForm matches */
+ private boolean checkActualReceiver() {
+ // Expects MethodHandle on the stack and actual receiver MethodHandle in slot #0
+ mv.visitInsn(Opcodes.DUP);
+ mv.visitVarInsn(Opcodes.ALOAD, localsMap[0]);
+ mv.visitMethodInsn(Opcodes.INVOKESTATIC, MHI, "assertSame", LLV_SIG, false);
+ return true;
+ }
+
/**
* Generate an invoker method for the passed {@link LambdaForm}.
*/
@@ -635,6 +646,16 @@ class InvokerBytecodeGenerator {
mv.visitAnnotation("Ljava/lang/invoke/DontInline;", true);
}
+ if (lambdaForm.customized != null) {
+ // Since LambdaForm is customized for a particular MethodHandle, it's safe to substitute
+ // receiver MethodHandle (at slot #0) with an embedded constant and use it instead.
+ // It enables more efficient code generation in some situations, since embedded constants
+ // are compile-time constants for JIT compiler.
+ mv.visitLdcInsn(constantPlaceholder(lambdaForm.customized));
+ mv.visitTypeInsn(Opcodes.CHECKCAST, MH);
+ assert(checkActualReceiver()); // expects MethodHandle on top of the stack
+ mv.visitVarInsn(Opcodes.ASTORE, localsMap[0]);
+ }
// iterate over the form's names, generating bytecode instructions for each
// start iterating at the first name following the arguments
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java
index 12a118a7576..43cf38f12bd 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/Invokers.java
@@ -247,6 +247,7 @@ class Invokers {
int nameCursor = OUTARG_LIMIT;
final int MTYPE_ARG = customized ? -1 : nameCursor++; // might be last in-argument
final int CHECK_TYPE = nameCursor++;
+ final int CHECK_CUSTOM = (CUSTOMIZE_THRESHOLD >= 0) ? nameCursor++ : -1;
final int LINKER_CALL = nameCursor++;
MethodType invokerFormType = mtype.invokerType();
if (isLinker) {
@@ -279,6 +280,9 @@ class Invokers {
// mh.invokeGeneric(a*):R => checkGenericType(mh, TYPEOF(a*:R)).invokeBasic(a*)
outArgs[0] = names[CHECK_TYPE];
}
+ if (CHECK_CUSTOM != -1) {
+ names[CHECK_CUSTOM] = new Name(NF_checkCustomized, names[CALL_MH]);
+ }
names[LINKER_CALL] = new Name(outCallType, outArgs);
lform = new LambdaForm(debugName, INARG_LIMIT, names);
if (isLinker)
@@ -386,11 +390,32 @@ class Invokers {
return ((CallSite)site).getTarget();
}
+ /*non-public*/ static
+ @ForceInline
+ void checkCustomized(Object o) {
+ MethodHandle mh = (MethodHandle)o;
+ if (mh.form.customized == null) {
+ maybeCustomize(mh);
+ }
+ }
+
+ /*non-public*/ static
+ @DontInline
+ void maybeCustomize(MethodHandle mh) {
+ byte count = mh.customizationCount;
+ if (count >= CUSTOMIZE_THRESHOLD) {
+ mh.customize();
+ } else {
+ mh.customizationCount = (byte)(count+1);
+ }
+ }
+
// Local constant functions:
private static final NamedFunction
NF_checkExactType,
NF_checkGenericType,
- NF_getCallSiteTarget;
+ NF_getCallSiteTarget,
+ NF_checkCustomized;
static {
try {
NamedFunction nfs[] = {
@@ -399,7 +424,9 @@ class Invokers {
NF_checkGenericType = new NamedFunction(Invokers.class
.getDeclaredMethod("checkGenericType", Object.class, Object.class)),
NF_getCallSiteTarget = new NamedFunction(Invokers.class
- .getDeclaredMethod("getCallSiteTarget", Object.class))
+ .getDeclaredMethod("getCallSiteTarget", Object.class)),
+ NF_checkCustomized = new NamedFunction(Invokers.class
+ .getDeclaredMethod("checkCustomized", Object.class))
};
for (NamedFunction nf : nfs) {
// Each nf must be statically invocable or we get tied up in our bootstraps.
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java
index 2129f8618bd..5c441071b92 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaForm.java
@@ -120,12 +120,14 @@ class LambdaForm {
final int arity;
final int result;
final boolean forceInline;
+ final MethodHandle customized;
@Stable final Name[] names;
final String debugName;
MemberName vmentry; // low-level behavior, or null if not yet prepared
private boolean isCompiled;
- volatile Object transformCache; // managed by LambdaFormEditor
+ // Either a LambdaForm cache (managed by LambdaFormEditor) or a link to uncustomized version (for customized LF)
+ volatile Object transformCache;
public static final int VOID_RESULT = -1, LAST_RESULT = -2;
@@ -244,16 +246,17 @@ class LambdaForm {
LambdaForm(String debugName,
int arity, Name[] names, int result) {
- this(debugName, arity, names, result, true);
+ this(debugName, arity, names, result, /*forceInline=*/true, /*customized=*/null);
}
LambdaForm(String debugName,
- int arity, Name[] names, int result, boolean forceInline) {
+ int arity, Name[] names, int result, boolean forceInline, MethodHandle customized) {
assert(namesOK(arity, names));
this.arity = arity;
this.result = fixResult(result, names);
this.names = names.clone();
this.debugName = fixDebugName(debugName);
this.forceInline = forceInline;
+ this.customized = customized;
int maxOutArity = normalize();
if (maxOutArity > MethodType.MAX_MH_INVOKER_ARITY) {
// Cannot use LF interpreter on very high arity expressions.
@@ -263,21 +266,21 @@ class LambdaForm {
}
LambdaForm(String debugName,
int arity, Name[] names) {
- this(debugName, arity, names, LAST_RESULT, true);
+ this(debugName, arity, names, LAST_RESULT, /*forceInline=*/true, /*customized=*/null);
}
LambdaForm(String debugName,
int arity, Name[] names, boolean forceInline) {
- this(debugName, arity, names, LAST_RESULT, forceInline);
+ this(debugName, arity, names, LAST_RESULT, forceInline, /*customized=*/null);
}
LambdaForm(String debugName,
Name[] formals, Name[] temps, Name result) {
this(debugName,
- formals.length, buildNames(formals, temps, result), LAST_RESULT, true);
+ formals.length, buildNames(formals, temps, result), LAST_RESULT, /*forceInline=*/true, /*customized=*/null);
}
LambdaForm(String debugName,
Name[] formals, Name[] temps, Name result, boolean forceInline) {
this(debugName,
- formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline);
+ formals.length, buildNames(formals, temps, result), LAST_RESULT, forceInline, /*customized=*/null);
}
private static Name[] buildNames(Name[] formals, Name[] temps, Name result) {
@@ -291,10 +294,6 @@ class LambdaForm {
}
private LambdaForm(String sig) {
- this(sig, true);
- }
-
- private LambdaForm(String sig, boolean forceInline) {
// Make a blank lambda form, which returns a constant zero or null.
// It is used as a template for managing the invocation of similar forms that are non-empty.
// Called only from getPreparedForm.
@@ -303,7 +302,8 @@ class LambdaForm {
this.result = (signatureReturn(sig) == V_TYPE ? -1 : arity);
this.names = buildEmptyNames(arity, sig);
this.debugName = "LF.zero";
- this.forceInline = forceInline;
+ this.forceInline = true;
+ this.customized = null;
assert(nameRefsAreLegal());
assert(isEmpty());
assert(sig.equals(basicTypeSignature())) : sig + " != " + basicTypeSignature();
@@ -375,6 +375,31 @@ class LambdaForm {
return true;
}
+ /** Customize LambdaForm for a particular MethodHandle */
+ LambdaForm customize(MethodHandle mh) {
+ LambdaForm customForm = new LambdaForm(debugName, arity, names, result, forceInline, mh);
+ if (COMPILE_THRESHOLD > 0 && isCompiled) {
+ // If shared LambdaForm has been compiled, compile customized version as well.
+ customForm.compileToBytecode();
+ }
+ customForm.transformCache = this; // LambdaFormEditor should always use uncustomized form.
+ return customForm;
+ }
+
+ /** Get uncustomized flavor of the LambdaForm */
+ LambdaForm uncustomize() {
+ if (customized == null) {
+ return this;
+ }
+ assert(transformCache != null); // Customized LambdaForm should always has a link to uncustomized version.
+ LambdaForm uncustomizedForm = (LambdaForm)transformCache;
+ if (COMPILE_THRESHOLD > 0 && isCompiled) {
+ // If customized LambdaForm has been compiled, compile uncustomized version as well.
+ uncustomizedForm.compileToBytecode();
+ }
+ return uncustomizedForm;
+ }
+
/** Renumber and/or replace params so that they are interned and canonically numbered.
* @return maximum argument list length among the names (since we have to pass over them anyway)
*/
@@ -417,8 +442,8 @@ class LambdaForm {
for (int i = arity; i < names.length; i++) {
names[i].internArguments();
}
- assert(nameRefsAreLegal());
}
+ assert(nameRefsAreLegal());
return maxOutArity;
}
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java
index 1c23e94995a..7bc2dfbebad 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java
@@ -51,7 +51,10 @@ class LambdaFormEditor {
static LambdaFormEditor lambdaFormEditor(LambdaForm lambdaForm) {
// TO DO: Consider placing intern logic here, to cut down on duplication.
// lambdaForm = findPreexistingEquivalent(lambdaForm)
- return new LambdaFormEditor(lambdaForm);
+
+ // Always use uncustomized version for editing.
+ // It helps caching and customized LambdaForms reuse transformCache field to keep a link to uncustomized version.
+ return new LambdaFormEditor(lambdaForm.uncustomize());
}
/** A description of a cached transform, possibly associated with the result of the transform.
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
index 0a45d2707e9..61c114e54b1 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandle.java
@@ -434,6 +434,8 @@ public abstract class MethodHandle {
// form is not private so that invokers can easily fetch it
/*private*/ MethodHandle asTypeCache;
// asTypeCache is not private so that invokers can easily fetch it
+ /*non-public*/ byte customizationCount;
+ // customizationCount should be accessible from invokers
/**
* Reports the type of this method handle.
@@ -454,9 +456,9 @@ public abstract class MethodHandle {
type.getClass(); // explicit NPE
form.getClass(); // explicit NPE
this.type = type;
- this.form = form;
+ this.form = form.uncustomize();
- form.prepare(); // TO DO: Try to delay this step until just before invocation.
+ this.form.prepare(); // TO DO: Try to delay this step until just before invocation.
}
/**
@@ -1425,12 +1427,24 @@ assertEquals("[three, thee, tee]", asListFix.invoke((Object)argv).toString());
*/
/*non-public*/
void updateForm(LambdaForm newForm) {
+ assert(newForm.customized == null || newForm.customized == this);
if (form == newForm) return;
newForm.prepare(); // as in MethodHandle.
UNSAFE.putObject(this, FORM_OFFSET, newForm);
UNSAFE.fullFence();
}
+ /** Craft a LambdaForm customized for this particular MethodHandle */
+ /*non-public*/
+ void customize() {
+ if (form.customized == null) {
+ LambdaForm newForm = form.customize(this);
+ updateForm(newForm);
+ } else {
+ assert(form.customized == this);
+ }
+ }
+
private static final long FORM_OFFSET;
static {
try {
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
index 7d8c63490d5..57568ece696 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleImpl.java
@@ -597,6 +597,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
static final NamedFunction NF_checkSpreadArgument;
static final NamedFunction NF_guardWithCatch;
static final NamedFunction NF_throwException;
+ static final NamedFunction NF_profileBoolean;
static final MethodHandle MH_castReference;
static final MethodHandle MH_selectAlternative;
@@ -614,10 +615,12 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
NF_guardWithCatch = new NamedFunction(MHI.getDeclaredMethod("guardWithCatch", MethodHandle.class, Class.class,
MethodHandle.class, Object[].class));
NF_throwException = new NamedFunction(MHI.getDeclaredMethod("throwException", Throwable.class));
+ NF_profileBoolean = new NamedFunction(MHI.getDeclaredMethod("profileBoolean", boolean.class, int[].class));
NF_checkSpreadArgument.resolve();
NF_guardWithCatch.resolve();
NF_throwException.resolve();
+ NF_profileBoolean.resolve();
MH_castReference = IMPL_LOOKUP.findStatic(MHI, "castReference",
MethodType.methodType(Object.class, Class.class, Object.class));
@@ -697,7 +700,26 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
@LambdaForm.Hidden
static
MethodHandle selectAlternative(boolean testResult, MethodHandle target, MethodHandle fallback) {
- return testResult ? target : fallback;
+ if (testResult) {
+ return target;
+ } else {
+ return fallback;
+ }
+ }
+
+ // Intrinsified by C2. Counters are used during parsing to calculate branch frequencies.
+ @LambdaForm.Hidden
+ static
+ boolean profileBoolean(boolean result, int[] counters) {
+ // Profile is int[2] where [0] and [1] correspond to false and true occurrences respectively.
+ int idx = result ? 1 : 0;
+ try {
+ counters[idx] = Math.addExact(counters[idx], 1);
+ } catch (ArithmeticException e) {
+ // Avoid continuous overflow by halving the problematic count.
+ counters[idx] = counters[idx] / 2;
+ }
+ return result;
}
static
@@ -708,13 +730,18 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
assert(test.type().equals(type.changeReturnType(boolean.class)) && fallback.type().equals(type));
MethodType basicType = type.basicType();
LambdaForm form = makeGuardWithTestForm(basicType);
- BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
BoundMethodHandle mh;
-
try {
- mh = (BoundMethodHandle)
- data.constructor().invokeBasic(type, form,
- (Object) test, (Object) profile(target), (Object) profile(fallback));
+ if (PROFILE_GWT) {
+ int[] counts = new int[2];
+ mh = (BoundMethodHandle)
+ BoundMethodHandle.speciesData_LLLL().constructor().invokeBasic(type, form,
+ (Object) test, (Object) profile(target), (Object) profile(fallback), counts);
+ } else {
+ mh = (BoundMethodHandle)
+ BoundMethodHandle.speciesData_LLL().constructor().invokeBasic(type, form,
+ (Object) test, (Object) profile(target), (Object) profile(fallback));
+ }
} catch (Throwable ex) {
throw uncaughtException(ex);
}
@@ -726,7 +753,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
static
MethodHandle profile(MethodHandle target) {
if (DONT_INLINE_THRESHOLD >= 0) {
- return makeBlockInlningWrapper(target);
+ return makeBlockInliningWrapper(target);
} else {
return target;
}
@@ -737,8 +764,13 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
* Corresponding LambdaForm has @DontInline when compiled into bytecode.
*/
static
- MethodHandle makeBlockInlningWrapper(MethodHandle target) {
- LambdaForm lform = PRODUCE_BLOCK_INLINING_FORM.apply(target);
+ MethodHandle makeBlockInliningWrapper(MethodHandle target) {
+ LambdaForm lform;
+ if (DONT_INLINE_THRESHOLD > 0) {
+ lform = PRODUCE_BLOCK_INLINING_FORM.apply(target);
+ } else {
+ lform = PRODUCE_REINVOKER_FORM.apply(target);
+ }
return new CountingWrapper(target, lform,
PRODUCE_BLOCK_INLINING_FORM, PRODUCE_REINVOKER_FORM,
DONT_INLINE_THRESHOLD);
@@ -800,7 +832,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
MethodHandle wrapper;
if (isCounting) {
LambdaForm lform;
- lform = countingFormProducer.apply(target);
+ lform = countingFormProducer.apply(newTarget);
wrapper = new CountingWrapper(newTarget, lform, countingFormProducer, nonCountingFormProducer, DONT_INLINE_THRESHOLD);
} else {
wrapper = newTarget; // no need for a counting wrapper anymore
@@ -809,7 +841,8 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
}
boolean countDown() {
- if (count <= 0) {
+ int c = count;
+ if (c <= 1) {
// Try to limit number of updates. MethodHandle.updateForm() doesn't guarantee LF update visibility.
if (isCounting) {
isCounting = false;
@@ -818,7 +851,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
return false;
}
} else {
- --count;
+ count = c - 1;
return false;
}
}
@@ -856,7 +889,10 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
final int GET_TEST = nameCursor++;
final int GET_TARGET = nameCursor++;
final int GET_FALLBACK = nameCursor++;
+ final int GET_COUNTERS = PROFILE_GWT ? nameCursor++ : -1;
final int CALL_TEST = nameCursor++;
+ final int PROFILE = (GET_COUNTERS != -1) ? nameCursor++ : -1;
+ final int TEST = nameCursor-1; // previous statement: either PROFILE or CALL_TEST
final int SELECT_ALT = nameCursor++;
final int CALL_TARGET = nameCursor++;
assert(CALL_TARGET == SELECT_ALT+1); // must be true to trigger IBG.emitSelectAlternative
@@ -864,12 +900,16 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
MethodType lambdaType = basicType.invokerType();
Name[] names = arguments(nameCursor - ARG_LIMIT, lambdaType);
- BoundMethodHandle.SpeciesData data = BoundMethodHandle.speciesData_LLL();
+ BoundMethodHandle.SpeciesData data =
+ (GET_COUNTERS != -1) ? BoundMethodHandle.speciesData_LLLL()
+ : BoundMethodHandle.speciesData_LLL();
names[THIS_MH] = names[THIS_MH].withConstraint(data);
names[GET_TEST] = new Name(data.getterFunction(0), names[THIS_MH]);
names[GET_TARGET] = new Name(data.getterFunction(1), names[THIS_MH]);
names[GET_FALLBACK] = new Name(data.getterFunction(2), names[THIS_MH]);
-
+ if (GET_COUNTERS != -1) {
+ names[GET_COUNTERS] = new Name(data.getterFunction(3), names[THIS_MH]);
+ }
Object[] invokeArgs = Arrays.copyOfRange(names, 0, ARG_LIMIT, Object[].class);
// call test
@@ -877,15 +917,18 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
invokeArgs[0] = names[GET_TEST];
names[CALL_TEST] = new Name(testType, invokeArgs);
+ // profile branch
+ if (PROFILE != -1) {
+ names[PROFILE] = new Name(Lazy.NF_profileBoolean, names[CALL_TEST], names[GET_COUNTERS]);
+ }
// call selectAlternative
- names[SELECT_ALT] = new Name(Lazy.MH_selectAlternative, names[CALL_TEST],
- names[GET_TARGET], names[GET_FALLBACK]);
+ names[SELECT_ALT] = new Name(Lazy.MH_selectAlternative, names[TEST], names[GET_TARGET], names[GET_FALLBACK]);
// call target or fallback
invokeArgs[0] = names[SELECT_ALT];
names[CALL_TARGET] = new Name(basicType, invokeArgs);
- lform = new LambdaForm("guard", lambdaType.parameterCount(), names);
+ lform = new LambdaForm("guard", lambdaType.parameterCount(), names, /*forceInline=*/true);
return basicType.form().setCachedLambdaForm(MethodTypeForm.LF_GWT, lform);
}
@@ -1629,4 +1672,13 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
assert(elemType.isPrimitive());
return Lazy.MH_copyAsPrimitiveArray.bindTo(Wrapper.forPrimitiveType(elemType));
}
+
+ /*non-public*/ static void assertSame(Object mh1, Object mh2) {
+ if (mh1 != mh2) {
+ String msg = String.format("mh1 != mh2: mh1 = %s (form: %s); mh2 = %s (form: %s)",
+ mh1, ((MethodHandle)mh1).form,
+ mh2, ((MethodHandle)mh2).form);
+ throw newInternalError(msg);
+ }
+ }
}
diff --git a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java
index 335a32289a7..144de11094f 100644
--- a/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java
+++ b/jdk/src/java.base/share/classes/java/lang/invoke/MethodHandleStatics.java
@@ -48,9 +48,11 @@ import sun.misc.Unsafe;
static final int COMPILE_THRESHOLD;
static final int DONT_INLINE_THRESHOLD;
static final int PROFILE_LEVEL;
+ static final boolean PROFILE_GWT;
+ static final int CUSTOMIZE_THRESHOLD;
static {
- final Object[] values = new Object[7];
+ final Object[] values = new Object[9];
AccessController.doPrivileged(new PrivilegedAction() {
public Void run() {
values[0] = Boolean.getBoolean("java.lang.invoke.MethodHandle.DEBUG_NAMES");
@@ -60,6 +62,8 @@ import sun.misc.Unsafe;
values[4] = Integer.getInteger("java.lang.invoke.MethodHandle.COMPILE_THRESHOLD", 0);
values[5] = Integer.getInteger("java.lang.invoke.MethodHandle.DONT_INLINE_THRESHOLD", 30);
values[6] = Integer.getInteger("java.lang.invoke.MethodHandle.PROFILE_LEVEL", 0);
+ values[7] = Boolean.parseBoolean(System.getProperty("java.lang.invoke.MethodHandle.PROFILE_GWT", "true"));
+ values[8] = Integer.getInteger("java.lang.invoke.MethodHandle.CUSTOMIZE_THRESHOLD", 127);
return null;
}
});
@@ -70,6 +74,12 @@ import sun.misc.Unsafe;
COMPILE_THRESHOLD = (Integer) values[4];
DONT_INLINE_THRESHOLD = (Integer) values[5];
PROFILE_LEVEL = (Integer) values[6];
+ PROFILE_GWT = (Boolean) values[7];
+ CUSTOMIZE_THRESHOLD = (Integer) values[8];
+
+ if (CUSTOMIZE_THRESHOLD < -1 || CUSTOMIZE_THRESHOLD > 127) {
+ throw newInternalError("CUSTOMIZE_THRESHOLD should be in [-1...127] range");
+ }
}
/** Tell if any of the debugging switches are turned on.
diff --git a/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java b/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java
index ee82de46946..45a2525ec0f 100644
--- a/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java
+++ b/jdk/src/java.base/share/classes/java/lang/reflect/Executable.java
@@ -662,7 +662,7 @@ public abstract class Executable extends AccessibleObject
*
* If this {@code Executable} object represents a static method or
* represents a constructor of a top level, static member, local, or
- * anoymous class, then the return value is null.
+ * anonymous class, then the return value is null.
*
* @return an object representing the receiver type of the method or
* constructor represented by this {@code Executable} or {@code null} if
diff --git a/jdk/src/java.base/share/classes/java/math/BigDecimal.java b/jdk/src/java.base/share/classes/java/math/BigDecimal.java
index 1ea1e8276c5..f4fffc871a4 100644
--- a/jdk/src/java.base/share/classes/java/math/BigDecimal.java
+++ b/jdk/src/java.base/share/classes/java/math/BigDecimal.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -4814,41 +4814,61 @@ public class BigDecimal extends Number implements Comparable {
if (dividendHi >= divisor) {
return null;
}
+
final int shift = Long.numberOfLeadingZeros(divisor);
divisor <<= shift;
final long v1 = divisor >>> 32;
final long v0 = divisor & LONG_MASK;
- long q1, q0;
- long r_tmp;
-
long tmp = dividendLo << shift;
long u1 = tmp >>> 32;
long u0 = tmp & LONG_MASK;
tmp = (dividendHi << shift) | (dividendLo >>> 64 - shift);
long u2 = tmp & LONG_MASK;
- tmp = divWord(tmp,v1);
- q1 = tmp & LONG_MASK;
- r_tmp = tmp >>> 32;
+ long q1, r_tmp;
+ if (v1 == 1) {
+ q1 = tmp;
+ r_tmp = 0;
+ } else if (tmp >= 0) {
+ q1 = tmp / v1;
+ r_tmp = tmp - q1 * v1;
+ } else {
+ long[] rq = divRemNegativeLong(tmp, v1);
+ q1 = rq[1];
+ r_tmp = rq[0];
+ }
+
while(q1 >= DIV_NUM_BASE || unsignedLongCompare(q1*v0, make64(r_tmp, u1))) {
q1--;
r_tmp += v1;
if (r_tmp >= DIV_NUM_BASE)
break;
}
+
tmp = mulsub(u2,u1,v1,v0,q1);
u1 = tmp & LONG_MASK;
- tmp = divWord(tmp,v1);
- q0 = tmp & LONG_MASK;
- r_tmp = tmp >>> 32;
+ long q0;
+ if (v1 == 1) {
+ q0 = tmp;
+ r_tmp = 0;
+ } else if (tmp >= 0) {
+ q0 = tmp / v1;
+ r_tmp = tmp - q0 * v1;
+ } else {
+ long[] rq = divRemNegativeLong(tmp, v1);
+ q0 = rq[1];
+ r_tmp = rq[0];
+ }
+
while(q0 >= DIV_NUM_BASE || unsignedLongCompare(q0*v0,make64(r_tmp,u0))) {
q0--;
r_tmp += v1;
if (r_tmp >= DIV_NUM_BASE)
break;
}
+
if((int)q1 < 0) {
// result (which is positive and unsigned here)
// can't fit into long due to sign bit is used for value
@@ -4871,10 +4891,13 @@ public class BigDecimal extends Number implements Comparable {
}
}
}
+
long q = make64(q1,q0);
q*=sign;
+
if (roundingMode == ROUND_DOWN && scale == preferredScale)
return valueOf(q, scale);
+
long r = mulsub(u1, u0, v1, v0, q0) >>> shift;
if (r != 0) {
boolean increment = needIncrement(divisor >>> shift, roundingMode, sign, q, r);
@@ -4917,28 +4940,35 @@ public class BigDecimal extends Number implements Comparable {
}
}
- private static long divWord(long n, long dLong) {
- long r;
- long q;
- if (dLong == 1) {
- q = (int)n;
- return (q & LONG_MASK);
- }
+ /**
+ * Calculate the quotient and remainder of dividing a negative long by
+ * another long.
+ *
+ * @param n the numerator; must be negative
+ * @param d the denominator; must not be unity
+ * @return a two-element {@long} array with the remainder and quotient in
+ * the initial and final elements, respectively
+ */
+ private static long[] divRemNegativeLong(long n, long d) {
+ assert n < 0 : "Non-negative numerator " + n;
+ assert d != 1 : "Unity denominator";
+
// Approximate the quotient and remainder
- q = (n >>> 1) / (dLong >>> 1);
- r = n - q*dLong;
+ long q = (n >>> 1) / (d >>> 1);
+ long r = n - q * d;
// Correct the approximation
while (r < 0) {
- r += dLong;
+ r += d;
q--;
}
- while (r >= dLong) {
- r -= dLong;
+ while (r >= d) {
+ r -= d;
q++;
}
- // n - q*dlong == r && 0 <= r The type of the socket option value
* @param name The socket option
* @param value The value of the socket option. A value of {@code null}
* may be valid for some options.
@@ -1342,6 +1343,7 @@ class DatagramSocket implements java.io.Closeable {
/**
* Returns the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return The value of the socket option.
diff --git a/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java b/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java
index 2abaaf9a237..0726dc4cce7 100644
--- a/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java
+++ b/jdk/src/java.base/share/classes/java/net/DatagramSocketImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -267,6 +267,7 @@ public abstract class DatagramSocketImpl implements SocketOptions {
/**
* Called to set a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @param value The value of the socket option. A value of {@code null}
@@ -276,7 +277,7 @@ public abstract class DatagramSocketImpl implements SocketOptions {
* support the option
*
* @throws NullPointerException if name is {@code null}
- *
+ * @throws IOException if an I/O problem occurs while attempting to set the option
* @since 1.9
*/
protected void setOption(SocketOption name, T value) throws IOException {
@@ -308,12 +309,15 @@ public abstract class DatagramSocketImpl implements SocketOptions {
/**
* Called to get a socket option.
*
+ * @return the socket option
+ * @param The type of the socket option value
* @param name The socket option
*
* @throws UnsupportedOperationException if the DatagramSocketImpl does not
* support the option
*
* @throws NullPointerException if name is {@code null}
+ * @throws IOException if an I/O problem occurs while attempting to set the option
*
* @since 1.9
*/
diff --git a/jdk/src/java.base/share/classes/java/net/ServerSocket.java b/jdk/src/java.base/share/classes/java/net/ServerSocket.java
index 32f1b907517..af0c5152d9a 100644
--- a/jdk/src/java.base/share/classes/java/net/ServerSocket.java
+++ b/jdk/src/java.base/share/classes/java/net/ServerSocket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -924,6 +924,7 @@ class ServerSocket implements java.io.Closeable {
/**
* Sets the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
* @param value The value of the socket option. A value of {@code null}
* may be valid for some options.
@@ -957,6 +958,7 @@ class ServerSocket implements java.io.Closeable {
/**
* Returns the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return The value of the socket option.
diff --git a/jdk/src/java.base/share/classes/java/net/Socket.java b/jdk/src/java.base/share/classes/java/net/Socket.java
index e637b32baa7..a0ca24e5224 100644
--- a/jdk/src/java.base/share/classes/java/net/Socket.java
+++ b/jdk/src/java.base/share/classes/java/net/Socket.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -1727,6 +1727,7 @@ class Socket implements java.io.Closeable {
/**
* Sets the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
* @param value The value of the socket option. A value of {@code null}
* may be valid for some options.
@@ -1758,6 +1759,7 @@ class Socket implements java.io.Closeable {
/**
* Returns the value of a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return The value of the socket option.
diff --git a/jdk/src/java.base/share/classes/java/net/SocketImpl.java b/jdk/src/java.base/share/classes/java/net/SocketImpl.java
index 962d20167de..600c68457af 100644
--- a/jdk/src/java.base/share/classes/java/net/SocketImpl.java
+++ b/jdk/src/java.base/share/classes/java/net/SocketImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -362,6 +362,7 @@ public abstract class SocketImpl implements SocketOptions {
/**
* Called to set a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @param value The value of the socket option. A value of {@code null}
@@ -397,6 +398,7 @@ public abstract class SocketImpl implements SocketOptions {
/**
* Called to get a socket option.
*
+ * @param The type of the socket option value
* @param name The socket option
*
* @return the value of the named option
diff --git a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java
index 156071c99e7..73e351126ca 100644
--- a/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java
+++ b/jdk/src/java.base/share/classes/java/nio/channels/FileLock.java
@@ -26,6 +26,7 @@
package java.nio.channels;
import java.io.IOException;
+import java.util.Objects;
/**
* A token representing a lock on a region of a file.
@@ -147,6 +148,7 @@ public abstract class FileLock implements AutoCloseable {
protected FileLock(FileChannel channel,
long position, long size, boolean shared)
{
+ Objects.requireNonNull(channel, "Null channel");
if (position < 0)
throw new IllegalArgumentException("Negative position");
if (size < 0)
@@ -185,6 +187,7 @@ public abstract class FileLock implements AutoCloseable {
protected FileLock(AsynchronousFileChannel channel,
long position, long size, boolean shared)
{
+ Objects.requireNonNull(channel, "Null channel");
if (position < 0)
throw new IllegalArgumentException("Negative position");
if (size < 0)
diff --git a/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java b/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java
index d7046808ffe..f707de5d79f 100644
--- a/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java
+++ b/jdk/src/java.base/share/classes/java/nio/channels/Pipe.java
@@ -35,7 +35,7 @@ import java.nio.channels.spi.*;
* A pipe consists of a pair of channels: A writable {@link
* Pipe.SinkChannel sink} channel and a readable {@link Pipe.SourceChannel source}
* channel. Once some bytes are written to the sink channel they can be read
- * from source channel in exactlyAthe order in which they were written.
+ * from the source channel in exactly the order in which they were written.
*
*
Whether or not a thread writing bytes to a pipe will block until another
* thread reads those bytes, or some previously-written bytes, from the pipe is
diff --git a/jdk/src/java.base/share/classes/java/security/AccessControlContext.java b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java
index 1805aafcccf..22cb1005ed7 100644
--- a/jdk/src/java.base/share/classes/java/security/AccessControlContext.java
+++ b/jdk/src/java.base/share/classes/java/security/AccessControlContext.java
@@ -172,9 +172,24 @@ public final class AccessControlContext {
public AccessControlContext(AccessControlContext acc,
DomainCombiner combiner) {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null) {
- sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
+ this(acc, combiner, false);
+ }
+
+ /**
+ * package private to allow calls from ProtectionDomain without performing
+ * the security check for {@linkplain SecurityConstants.CREATE_ACC_PERMISSION}
+ * permission
+ */
+ AccessControlContext(AccessControlContext acc,
+ DomainCombiner combiner,
+ boolean preauthorized) {
+ if (!preauthorized) {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null) {
+ sm.checkPermission(SecurityConstants.CREATE_ACC_PERMISSION);
+ this.isAuthorized = true;
+ }
+ } else {
this.isAuthorized = true;
}
diff --git a/jdk/src/java.base/share/classes/java/security/KeyStore.java b/jdk/src/java.base/share/classes/java/security/KeyStore.java
index 34c246f4b86..71df7dbd5a2 100644
--- a/jdk/src/java.base/share/classes/java/security/KeyStore.java
+++ b/jdk/src/java.base/share/classes/java/security/KeyStore.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -1618,11 +1618,13 @@ public class KeyStore {
* integrity check.
*
*
- * This method traverses the list of registered security {@link Providers},
- * starting with the most preferred Provider.
- * For each {@link KeyStoreSpi} implementation supported by a Provider,
- * it invokes the {@link engineProbe} method to determine if it supports
- * the specified keystore.
+ * This method traverses the list of registered security
+ * {@linkplain Provider providers}, starting with the most
+ * preferred Provider.
+ * For each {@link KeyStoreSpi} implementation supported by a
+ * Provider, it invokes the {@link
+ * KeyStoreSpi#engineProbe(InputStream) engineProbe} method to
+ * determine if it supports the specified keystore.
* A new KeyStore object is returned that encapsulates the KeyStoreSpi
* implementation from the first Provider that supports the specified file.
*
@@ -1672,11 +1674,12 @@ public class KeyStore {
* unlock the keystore data or perform an integrity check.
*
*
- * This method traverses the list of registered security {@link Providers},
- * starting with the most preferred Provider.
- * For each {@link KeyStoreSpi} implementation supported by a Provider,
- * it invokes the {@link engineProbe} method to determine if it supports
- * the specified keystore.
+ * This method traverses the list of registered security {@linkplain
+ * Provider providers}, starting with the most preferred Provider.
+ * For each {@link KeyStoreSpi} implementation supported by a
+ * Provider, it invokes the {@link
+ * KeyStoreSpi#engineProbe(InputStream) engineProbe} method to
+ * determine if it supports the specified keystore.
* A new KeyStore object is returned that encapsulates the KeyStoreSpi
* implementation from the first Provider that supports the specified file.
*
diff --git a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
index f11bf3e0f06..2e505d74554 100644
--- a/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
+++ b/jdk/src/java.base/share/classes/java/security/ProtectionDomain.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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,7 +27,6 @@ package java.security;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
@@ -60,35 +59,44 @@ import sun.misc.SharedSecrets;
*/
public class ProtectionDomain {
+ private static class JavaSecurityAccessImpl implements JavaSecurityAccess {
+
+ private JavaSecurityAccessImpl() {
+ }
+
+ @Override
+ public T doIntersectionPrivilege(
+ PrivilegedAction action,
+ final AccessControlContext stack,
+ final AccessControlContext context) {
+ if (action == null) {
+ throw new NullPointerException();
+ }
+
+ return AccessController.doPrivileged(
+ action,
+ getCombinedACC(context, stack)
+ );
+ }
+
+ @Override
+ public T doIntersectionPrivilege(
+ PrivilegedAction action,
+ AccessControlContext context) {
+ return doIntersectionPrivilege(action,
+ AccessController.getContext(), context);
+ }
+
+ private static AccessControlContext getCombinedACC(AccessControlContext context, AccessControlContext stack) {
+ AccessControlContext acc = new AccessControlContext(context, stack.getCombiner(), true);
+
+ return new AccessControlContext(stack.getContext(), acc).optimize();
+ }
+ }
static {
// Set up JavaSecurityAccess in SharedSecrets
- SharedSecrets.setJavaSecurityAccess(
- new JavaSecurityAccess() {
- public T doIntersectionPrivilege(
- PrivilegedAction action,
- final AccessControlContext stack,
- final AccessControlContext context)
- {
- if (action == null) {
- throw new NullPointerException();
- }
- return AccessController.doPrivileged(
- action,
- new AccessControlContext(
- stack.getContext(), context).optimize()
- );
- }
-
- public T doIntersectionPrivilege(
- PrivilegedAction action,
- AccessControlContext context)
- {
- return doIntersectionPrivilege(action,
- AccessController.getContext(), context);
- }
- }
- );
+ SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
}
/* CodeSource */
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/Acl.java b/jdk/src/java.base/share/classes/java/security/acl/Acl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/Acl.java
rename to jdk/src/java.base/share/classes/java/security/acl/Acl.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/AclEntry.java b/jdk/src/java.base/share/classes/java/security/acl/AclEntry.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/AclEntry.java
rename to jdk/src/java.base/share/classes/java/security/acl/AclEntry.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/AclNotFoundException.java b/jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/AclNotFoundException.java
rename to jdk/src/java.base/share/classes/java/security/acl/AclNotFoundException.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/Group.java b/jdk/src/java.base/share/classes/java/security/acl/Group.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/Group.java
rename to jdk/src/java.base/share/classes/java/security/acl/Group.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/LastOwnerException.java b/jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/LastOwnerException.java
rename to jdk/src/java.base/share/classes/java/security/acl/LastOwnerException.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/NotOwnerException.java b/jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/NotOwnerException.java
rename to jdk/src/java.base/share/classes/java/security/acl/NotOwnerException.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/Owner.java b/jdk/src/java.base/share/classes/java/security/acl/Owner.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/Owner.java
rename to jdk/src/java.base/share/classes/java/security/acl/Owner.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/Permission.java b/jdk/src/java.base/share/classes/java/security/acl/Permission.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/Permission.java
rename to jdk/src/java.base/share/classes/java/security/acl/Permission.java
diff --git a/jdk/src/java.security.acl/share/classes/java/security/acl/package-info.java b/jdk/src/java.base/share/classes/java/security/acl/package-info.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/java/security/acl/package-info.java
rename to jdk/src/java.base/share/classes/java/security/acl/package-info.java
diff --git a/jdk/src/java.base/share/classes/java/time/Clock.java b/jdk/src/java.base/share/classes/java/time/Clock.java
index b1127848bed..28dd55f9b8d 100644
--- a/jdk/src/java.base/share/classes/java/time/Clock.java
+++ b/jdk/src/java.base/share/classes/java/time/Clock.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -61,12 +61,15 @@
*/
package java.time;
+import java.io.IOException;
+import java.io.ObjectInputStream;
import static java.time.LocalTime.NANOS_PER_MINUTE;
import static java.time.LocalTime.NANOS_PER_SECOND;
import java.io.Serializable;
import java.util.Objects;
import java.util.TimeZone;
+import sun.misc.VM;
/**
* A clock providing access to the current instant, date and time using a time-zone.
@@ -446,10 +449,22 @@ public abstract class Clock {
*/
static final class SystemClock extends Clock implements Serializable {
private static final long serialVersionUID = 6740630888130243051L;
+ private static final long OFFSET_SEED =
+ System.currentTimeMillis()/1000 - 1024; // initial offest
private final ZoneId zone;
+ // We don't actually need a volatile here.
+ // We don't care if offset is set or read concurrently by multiple
+ // threads - we just need a value which is 'recent enough' - in other
+ // words something that has been updated at least once in the last
+ // 2^32 secs (~136 years). And even if we by chance see an invalid
+ // offset, the worst that can happen is that we will get a -1 value
+ // from getNanoTimeAdjustment, forcing us to update the offset
+ // once again.
+ private transient long offset;
SystemClock(ZoneId zone) {
this.zone = zone;
+ this.offset = OFFSET_SEED;
}
@Override
public ZoneId getZone() {
@@ -464,11 +479,50 @@ public abstract class Clock {
}
@Override
public long millis() {
+ // System.currentTimeMillis() and VM.getNanoTimeAdjustment(offset)
+ // use the same time source - System.currentTimeMillis() simply
+ // limits the resolution to milliseconds.
+ // So we take the faster path and call System.currentTimeMillis()
+ // directly - in order to avoid the performance penalty of
+ // VM.getNanoTimeAdjustment(offset) which is less efficient.
return System.currentTimeMillis();
}
@Override
public Instant instant() {
- return Instant.ofEpochMilli(millis());
+ // Take a local copy of offset. offset can be updated concurrently
+ // by other threads (even if we haven't made it volatile) so we will
+ // work with a local copy.
+ long localOffset = offset;
+ long adjustment = VM.getNanoTimeAdjustment(localOffset);
+
+ if (adjustment == -1) {
+ // -1 is a sentinel value returned by VM.getNanoTimeAdjustment
+ // when the offset it is given is too far off the current UTC
+ // time. In principle, this should not happen unless the
+ // JVM has run for more than ~136 years (not likely) or
+ // someone is fiddling with the system time, or the offset is
+ // by chance at 1ns in the future (very unlikely).
+ // We can easily recover from all these conditions by bringing
+ // back the offset in range and retry.
+
+ // bring back the offset in range. We use -1024 to make
+ // it more unlikely to hit the 1ns in the future condition.
+ localOffset = System.currentTimeMillis()/1000 - 1024;
+
+ // retry
+ adjustment = VM.getNanoTimeAdjustment(localOffset);
+
+ if (adjustment == -1) {
+ // Should not happen: we just recomputed a new offset.
+ // It should have fixed the issue.
+ throw new InternalError("Offset " + localOffset + " is not in range");
+ } else {
+ // OK - recovery succeeded. Update the offset for the
+ // next call...
+ offset = localOffset;
+ }
+ }
+ return Instant.ofEpochSecond(localOffset, adjustment);
}
@Override
public boolean equals(Object obj) {
@@ -485,6 +539,12 @@ public abstract class Clock {
public String toString() {
return "SystemClock[" + zone + "]";
}
+ private void readObject(ObjectInputStream is)
+ throws IOException, ClassNotFoundException {
+ // ensure that offset is initialized
+ is.defaultReadObject();
+ offset = OFFSET_SEED;
+ }
}
//-----------------------------------------------------------------------
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/Chronology.java b/jdk/src/java.base/share/classes/java/time/chrono/Chronology.java
index 7088af36f3c..fbcdcec3472 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/Chronology.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/Chronology.java
@@ -538,7 +538,14 @@ public interface Chronology extends Comparable {
*
* - a leap-year must imply a year-length longer than a non leap-year.
*
- a chronology that does not support the concept of a year must return false.
+ *
- the correct result must be returned for all years within the
+ * valid range of years for the chronology.
*
+ *
+ * Outside the range of valid years an implementation is free to return
+ * either a best guess or false.
+ * An implementation must not throw an exception, even if the year is
+ * outside the range of valid years.
*
* @param prolepticYear the proleptic-year to check, not validated for range
* @return true if the year is a leap year
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
index 5dfee287fd8..0e79b696db3 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/HijrahChronology.java
@@ -475,10 +475,10 @@ public final class HijrahChronology extends AbstractChronology implements Serial
@Override
public boolean isLeapYear(long prolepticYear) {
checkCalendarInit();
- int epochMonth = yearToEpochMonth((int) prolepticYear);
- if (epochMonth < 0 || epochMonth > maxEpochDay) {
- throw new DateTimeException("Hijrah date out of range");
+ if (prolepticYear < getMinimumYear() || prolepticYear > getMaximumYear()) {
+ return false;
}
+ int epochMonth = yearToEpochMonth((int) prolepticYear);
int len = getYearLength((int) prolepticYear);
return (len > 354);
}
diff --git a/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java b/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
index 0c9e3e81e1d..f289fdb1a93 100644
--- a/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
+++ b/jdk/src/java.base/share/classes/java/time/chrono/JapaneseEra.java
@@ -195,10 +195,11 @@ public final class JapaneseEra
* @throws DateTimeException if the value is invalid
*/
public static JapaneseEra of(int japaneseEra) {
- if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET > KNOWN_ERAS.length) {
+ int i = ordinal(japaneseEra);
+ if (i < 0 || i >= KNOWN_ERAS.length) {
throw new DateTimeException("Invalid era: " + japaneseEra);
}
- return KNOWN_ERAS[ordinal(japaneseEra)];
+ return KNOWN_ERAS[i];
}
/**
diff --git a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
index 02994ad5042..4a5a53cd83c 100644
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatter.java
@@ -117,8 +117,9 @@ import java.util.Set;
* {@code parse(CharSequence text, DateTimeFormatter formatter)}.
*
For example:
*
+ * LocalDate date = LocalDate.now();
* String text = date.format(formatter);
- * LocalDate date = LocalDate.parse(text, formatter);
+ * LocalDate parsedDate = LocalDate.parse(text, formatter);
*
*
* In addition to the format, formatters can be created with desired Locale,
@@ -265,9 +266,10 @@ import java.util.Set;
*
* For example:
*
+ * LocalDate date = LocalDate.now();
* DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy MM dd");
* String text = date.format(formatter);
- * LocalDate date = LocalDate.parse(text, formatter);
+ * LocalDate parsedDate = LocalDate.parse(text, formatter);
*
*
* All letters 'A' to 'Z' and 'a' to 'z' are reserved as pattern letters. The
diff --git a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
index 4616017c8e1..a8f70915012 100644
--- a/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
+++ b/jdk/src/java.base/share/classes/java/time/format/DateTimeFormatterBuilder.java
@@ -849,6 +849,7 @@ public final class DateTimeFormatterBuilder {
* @param fractionalDigits the number of fractional second digits to format with,
* from 0 to 9, or -1 to use as many digits as necessary
* @return this, for chaining, not null
+ * @throws IllegalArgumentException if the number of fractional digits is invalid
*/
public DateTimeFormatterBuilder appendInstant(int fractionalDigits) {
if (fractionalDigits < -1 || fractionalDigits > 9) {
@@ -909,6 +910,7 @@ public final class DateTimeFormatterBuilder {
* @param pattern the pattern to use, not null
* @param noOffsetText the text to use when the offset is zero, not null
* @return this, for chaining, not null
+ * @throws IllegalArgumentException if the pattern is invalid
*/
public DateTimeFormatterBuilder appendOffset(String pattern, String noOffsetText) {
appendInternal(new OffsetIdPrinterParser(pattern, noOffsetText));
diff --git a/jdk/src/java.base/share/classes/java/time/package-info.java b/jdk/src/java.base/share/classes/java/time/package-info.java
index b97a56b9c36..cea222126f1 100644
--- a/jdk/src/java.base/share/classes/java/time/package-info.java
+++ b/jdk/src/java.base/share/classes/java/time/package-info.java
@@ -65,7 +65,7 @@
* The main API for dates, times, instants, and durations.
*
*
- * The classes defined here represent the principal date-time concepts,
+ * The classes defined here represent the principle date-time concepts,
* including instants, durations, dates, times, time-zones and periods.
* They are based on the ISO calendar system, which is the de facto world
* calendar following the proleptic Gregorian rules.
@@ -247,8 +247,8 @@
*
*
* Multiple calendar systems is an awkward addition to the design challenges.
- * The first principal is that most users want the standard ISO calendar system.
- * As such, the main classes are ISO-only. The second principal is that most of those that want a
+ * The first principle is that most users want the standard ISO calendar system.
+ * As such, the main classes are ISO-only. The second principle is that most of those that want a
* non-ISO calendar system want it for user interaction, thus it is a UI localization issue.
* As such, date and time objects should be held as ISO objects in the data model and persistent
* storage, only being converted to and from a local calendar for display.
diff --git a/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java b/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
index e7c7ac020bd..36c8d90f0f2 100644
--- a/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
+++ b/jdk/src/java.base/share/classes/java/util/ComparableTimSort.java
@@ -144,10 +144,14 @@ class ComparableTimSort {
* large) stack lengths for smaller arrays. The "magic numbers" in the
* computation below must be changed if MIN_MERGE is decreased. See
* the MIN_MERGE declaration above for more information.
+ * The maximum value of 49 allows for an array up to length
+ * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+ * increasing scenario. More explanations are given in section 4 of:
+ * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
- len < 119151 ? 24 : 40);
+ len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
diff --git a/jdk/src/java.base/share/classes/java/util/Formattable.java b/jdk/src/java.base/share/classes/java/util/Formattable.java
index f7e1e509d12..fa87e9c7022 100644
--- a/jdk/src/java.base/share/classes/java/util/Formattable.java
+++ b/jdk/src/java.base/share/classes/java/util/Formattable.java
@@ -36,14 +36,14 @@ import java.io.IOException;
* For example, the following class prints out different representations of a
* stock's name depending on the flags and length constraints:
*
- * {@code
+ *
{@code
* import java.nio.CharBuffer;
* import java.util.Formatter;
* import java.util.Formattable;
* import java.util.Locale;
* import static java.util.FormattableFlags.*;
*
- * ...
+ * ...
*
* public class StockName implements Formattable {
* private String symbol, companyName, frenchCompanyName;
@@ -89,12 +89,12 @@ import java.io.IOException;
* return String.format("%s - %s", symbol, companyName);
* }
* }
- * }
+ * }
*
* When used in conjunction with the {@link java.util.Formatter}, the above
* class produces the following output for various format strings.
*
- * {@code
+ *
{@code
* Formatter fmt = new Formatter();
* StockName sn = new StockName("HUGE", "Huge Fruit, Inc.",
* "Fruit Titanesque, Inc.");
@@ -104,7 +104,7 @@ import java.io.IOException;
* fmt.format("%-10.8s", sn); // -> "HUGE "
* fmt.format("%.12s", sn); // -> "Huge Fruit,*"
* fmt.format(Locale.FRANCE, "%25s", sn); // -> " Fruit Titanesque, Inc."
- * }
+ * }
*
* Formattables are not necessarily safe for multithreaded access. Thread
* safety is optional and may be enforced by classes that extend and implement
diff --git a/jdk/src/java.base/share/classes/java/util/Formatter.java b/jdk/src/java.base/share/classes/java/util/Formatter.java
index ef07fcaef34..9344d15051f 100644
--- a/jdk/src/java.base/share/classes/java/util/Formatter.java
+++ b/jdk/src/java.base/share/classes/java/util/Formatter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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,6 +57,7 @@ import java.time.ZoneOffset;
import java.time.temporal.ChronoField;
import java.time.temporal.TemporalAccessor;
import java.time.temporal.TemporalQueries;
+import java.time.temporal.UnsupportedTemporalTypeException;
import sun.misc.DoubleConsts;
import sun.misc.FormattedFloatingDecimal;
@@ -4056,7 +4057,12 @@ public final class Formatter implements Closeable, Flushable {
break;
}
case DateTime.NANOSECOND: { // 'N' (000000000 - 999999999)
- int i = t.get(ChronoField.MILLI_OF_SECOND) * 1000000;
+ int i;
+ try {
+ i = t.get(ChronoField.NANO_OF_SECOND);
+ } catch (UnsupportedTemporalTypeException u) {
+ i = t.get(ChronoField.MILLI_OF_SECOND) * 1000000;
+ }
Flags flags = Flags.ZERO_PAD;
sb.append(localizedMagnitude(null, i, flags, 9, l));
break;
diff --git a/jdk/src/java.base/share/classes/java/util/Optional.java b/jdk/src/java.base/share/classes/java/util/Optional.java
index d471058ec16..21fef4c13e0 100644
--- a/jdk/src/java.base/share/classes/java/util/Optional.java
+++ b/jdk/src/java.base/share/classes/java/util/Optional.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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,6 +28,7 @@ import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
+import java.util.stream.Stream;
/**
* A container object which may or may not contain a non-null value.
@@ -37,8 +38,8 @@ import java.util.function.Supplier;
*
Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(java.lang.Object) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.Consumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -147,16 +148,36 @@ public final class Optional {
}
/**
- * If a value is present, invoke the specified consumer with the value,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if a value is present and {@code action} is
* null
*/
- public void ifPresent(Consumer super T> consumer) {
- if (value != null)
- consumer.accept(value);
+ public void ifPresent(Consumer super T> action) {
+ if (value != null) {
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(Consumer super T> action, Runnable emptyAction) {
+ if (value != null) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
+ }
}
/**
@@ -172,10 +193,11 @@ public final class Optional {
*/
public Optional filter(Predicate super T> predicate) {
Objects.requireNonNull(predicate);
- if (!isPresent())
+ if (!isPresent()) {
return this;
- else
+ } else {
return predicate.test(value) ? this : empty();
+ }
}
/**
@@ -209,9 +231,9 @@ public final class Optional {
*/
public Optional map(Function super T, ? extends U> mapper) {
Objects.requireNonNull(mapper);
- if (!isPresent())
+ if (!isPresent()) {
return empty();
- else {
+ } else {
return Optional.ofNullable(mapper.apply(value));
}
}
@@ -235,13 +257,36 @@ public final class Optional {
*/
public Optional flatMap(Function super T, Optional> mapper) {
Objects.requireNonNull(mapper);
- if (!isPresent())
+ if (!isPresent()) {
return empty();
- else {
+ } else {
return Objects.requireNonNull(mapper.apply(value));
}
}
+ /**
+ * If a value is present return a sequential {@link Stream} containing only
+ * that value, otherwise return an empty {@code Stream}.
+ *
+ * @apiNote This method can be used to transform a {@code Stream} of
+ * optional elements to a {@code Stream} of present value elements:
+ *
+ * {@code
+ * Stream> os = ..
+ * Stream s = os.flatMap(Optional::stream)
+ * }
+ *
+ * @return the optional value as a {@code Stream}
+ * @since 1.9
+ */
+ public Stream stream() {
+ if (!isPresent()) {
+ return Stream.empty();
+ } else {
+ return Stream.of(value);
+ }
+ }
+
/**
* Return the value if present, otherwise return {@code other}.
*
diff --git a/jdk/src/java.base/share/classes/java/util/OptionalDouble.java b/jdk/src/java.base/share/classes/java/util/OptionalDouble.java
index 0efc770fa03..3de841e80f4 100644
--- a/jdk/src/java.base/share/classes/java/util/OptionalDouble.java
+++ b/jdk/src/java.base/share/classes/java/util/OptionalDouble.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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,6 +27,7 @@ package java.util;
import java.util.function.DoubleConsumer;
import java.util.function.DoubleSupplier;
import java.util.function.Supplier;
+import java.util.stream.DoubleStream;
/**
* A container object which may or may not contain a {@code double} value.
@@ -36,8 +37,8 @@ import java.util.function.Supplier;
* Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(double) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.DoubleConsumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -130,16 +131,59 @@ public final class OptionalDouble {
}
/**
- * Have the specified consumer accept the value if a value is present,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if a value is present and {@code action} is
* null
*/
- public void ifPresent(DoubleConsumer consumer) {
- if (isPresent)
- consumer.accept(value);
+ public void ifPresent(DoubleConsumer action) {
+ if (isPresent) {
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(DoubleConsumer action, Runnable emptyAction) {
+ if (isPresent) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
+ }
+ }
+
+ /**
+ * If a value is present return a sequential {@link DoubleStream} containing
+ * only that value, otherwise return an empty {@code DoubleStream}.
+ *
+ * @apiNote This method can be used to transform a {@code Stream} of
+ * optional doubles to a {@code DoubleStream} of present doubles:
+ *
+ *
{@code
+ * Stream os = ..
+ * DoubleStream s = os.flatMapToDouble(OptionalDouble::stream)
+ * }
+ *
+ * @return the optional value as a {@code DoubleStream}
+ * @since 1.9
+ */
+ public DoubleStream stream() {
+ if (isPresent) {
+ return DoubleStream.of(value);
+ } else {
+ return DoubleStream.empty();
+ }
}
/**
@@ -182,7 +226,7 @@ public final class OptionalDouble {
* @throws NullPointerException if no value is present and
* {@code exceptionSupplier} is null
*/
- public double orElseThrow(Supplier exceptionSupplier) throws X {
+ public double orElseThrow(Supplier extends X> exceptionSupplier) throws X {
if (isPresent) {
return value;
} else {
diff --git a/jdk/src/java.base/share/classes/java/util/OptionalInt.java b/jdk/src/java.base/share/classes/java/util/OptionalInt.java
index 5cb9275242b..38b9bd0294c 100644
--- a/jdk/src/java.base/share/classes/java/util/OptionalInt.java
+++ b/jdk/src/java.base/share/classes/java/util/OptionalInt.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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,6 +27,7 @@ package java.util;
import java.util.function.IntConsumer;
import java.util.function.IntSupplier;
import java.util.function.Supplier;
+import java.util.stream.IntStream;
/**
* A container object which may or may not contain a {@code int} value.
@@ -36,8 +37,8 @@ import java.util.function.Supplier;
* Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(int) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.IntConsumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -130,16 +131,59 @@ public final class OptionalInt {
}
/**
- * Have the specified consumer accept the value if a value is present,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if value is present and {@code action} is
* null
*/
- public void ifPresent(IntConsumer consumer) {
- if (isPresent)
- consumer.accept(value);
+ public void ifPresent(IntConsumer action) {
+ if (isPresent) {
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(IntConsumer action, Runnable emptyAction) {
+ if (isPresent) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
+ }
+ }
+
+ /**
+ * If a value is present return a sequential {@link IntStream} containing
+ * only that value, otherwise return an empty {@code IntStream}.
+ *
+ * @apiNote This method can be used to transform a {@code Stream} of
+ * optional integers to an {@code IntStream} of present integers:
+ *
+ *
{@code
+ * Stream os = ..
+ * IntStream s = os.flatMapToInt(OptionalInt::stream)
+ * }
+ *
+ * @return the optional value as an {@code IntStream}
+ * @since 1.9
+ */
+ public IntStream stream() {
+ if (isPresent) {
+ return IntStream.of(value);
+ } else {
+ return IntStream.empty();
+ }
}
/**
@@ -182,7 +226,7 @@ public final class OptionalInt {
* @throws NullPointerException if no value is present and
* {@code exceptionSupplier} is null
*/
- public int orElseThrow(Supplier exceptionSupplier) throws X {
+ public int orElseThrow(Supplier extends X> exceptionSupplier) throws X {
if (isPresent) {
return value;
} else {
diff --git a/jdk/src/java.base/share/classes/java/util/OptionalLong.java b/jdk/src/java.base/share/classes/java/util/OptionalLong.java
index 589a59fd3ae..d6d56b9aee4 100644
--- a/jdk/src/java.base/share/classes/java/util/OptionalLong.java
+++ b/jdk/src/java.base/share/classes/java/util/OptionalLong.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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,6 +27,7 @@ package java.util;
import java.util.function.LongConsumer;
import java.util.function.LongSupplier;
import java.util.function.Supplier;
+import java.util.stream.LongStream;
/**
* A container object which may or may not contain a {@code long} value.
@@ -36,8 +37,8 @@ import java.util.function.Supplier;
* Additional methods that depend on the presence or absence of a contained
* value are provided, such as {@link #orElse(long) orElse()}
* (return a default value if value not present) and
- * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (execute a block
- * of code if the value is present).
+ * {@link #ifPresent(java.util.function.LongConsumer) ifPresent()} (perform an
+ * action if the value is present).
*
*
This is a value-based
* class; use of identity-sensitive operations (including reference equality
@@ -130,16 +131,59 @@ public final class OptionalLong {
}
/**
- * Have the specified consumer accept the value if a value is present,
+ * If a value is present, perform the given action with the value,
* otherwise do nothing.
*
- * @param consumer block to be executed if a value is present
- * @throws NullPointerException if value is present and {@code consumer} is
+ * @param action the action to be performed if a value is present
+ * @throws NullPointerException if a value is present and {@code action} is
* null
*/
- public void ifPresent(LongConsumer consumer) {
- if (isPresent)
- consumer.accept(value);
+ public void ifPresent(LongConsumer action) {
+ if (isPresent) {
+ action.accept(value);
+ }
+ }
+
+ /**
+ * If a value is present, perform the given action with the value,
+ * otherwise perform the given empty-based action.
+ *
+ * @param action the action to be performed if a value is present
+ * @param emptyAction the empty-based action to be performed if a value is
+ * not present
+ * @throws NullPointerException if a value is present and {@code action} is
+ * null, or a value is not present and {@code emptyAction} is null.
+ * @since 1.9
+ */
+ public void ifPresentOrElse(LongConsumer action, Runnable emptyAction) {
+ if (isPresent) {
+ action.accept(value);
+ } else {
+ emptyAction.run();
+ }
+ }
+
+ /**
+ * If a value is present return a sequential {@link LongStream} containing
+ * only that value, otherwise return an empty {@code LongStream}.
+ *
+ * @apiNote This method can be used to transform a {@code Stream} of
+ * optional longs to a {@code LongStream} of present longs:
+ *
+ *
{@code
+ * Stream os = ..
+ * LongStream s = os.flatMapToLong(OptionalLong::stream)
+ * }
+ *
+ * @return the optional value as a {@code LongStream}
+ * @since 1.9
+ */
+ public LongStream stream() {
+ if (isPresent) {
+ return LongStream.of(value);
+ } else {
+ return LongStream.empty();
+ }
}
/**
@@ -182,7 +226,7 @@ public final class OptionalLong {
* @throws NullPointerException if no value is present and
* {@code exceptionSupplier} is null
*/
- public long orElseThrow(Supplier exceptionSupplier) throws X {
+ public long orElseThrow(Supplier extends X> exceptionSupplier) throws X {
if (isPresent) {
return value;
} else {
diff --git a/jdk/src/java.base/share/classes/java/util/TimSort.java b/jdk/src/java.base/share/classes/java/util/TimSort.java
index 9966f74df37..ea0d58f5a85 100644
--- a/jdk/src/java.base/share/classes/java/util/TimSort.java
+++ b/jdk/src/java.base/share/classes/java/util/TimSort.java
@@ -174,10 +174,14 @@ class TimSort {
* large) stack lengths for smaller arrays. The "magic numbers" in the
* computation below must be changed if MIN_MERGE is decreased. See
* the MIN_MERGE declaration above for more information.
+ * The maximum value of 49 allows for an array up to length
+ * Integer.MAX_VALUE-4, if array is filled by the worst case stack size
+ * increasing scenario. More explanations are given in section 4 of:
+ * http://envisage-project.eu/wp-content/uploads/2015/02/sorting.pdf
*/
int stackLen = (len < 120 ? 5 :
len < 1542 ? 10 :
- len < 119151 ? 24 : 40);
+ len < 119151 ? 24 : 49);
runBase = new int[stackLen];
runLen = new int[stackLen];
}
diff --git a/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java b/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java
index e5c007d8c5f..7a8e40b9e43 100644
--- a/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java
+++ b/jdk/src/java.base/share/classes/java/util/concurrent/TimeUnit.java
@@ -131,6 +131,7 @@ public enum TimeUnit {
/**
* Time unit representing sixty seconds
+ * @since 1.6
*/
MINUTES {
public long toNanos(long d) { return x(d, C4/C0, MAX/(C4/C0)); }
@@ -146,6 +147,7 @@ public enum TimeUnit {
/**
* Time unit representing sixty minutes
+ * @since 1.6
*/
HOURS {
public long toNanos(long d) { return x(d, C5/C0, MAX/(C5/C0)); }
@@ -161,6 +163,7 @@ public enum TimeUnit {
/**
* Time unit representing twenty four hours
+ * @since 1.6
*/
DAYS {
public long toNanos(long d) { return x(d, C6/C0, MAX/(C6/C0)); }
diff --git a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
index c3bcfcc07c0..b22e9b936b4 100644
--- a/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
+++ b/jdk/src/java.base/share/classes/java/util/regex/Pattern.java
@@ -5819,6 +5819,10 @@ NEXT: while (i <= last) {
MatcherIterator() {
this.matcher = matcher(input);
+ // If the input is an empty string then the result can only be a
+ // stream of the input. Induce that by setting the empty
+ // element count to 1
+ this.emptyElementCount = input.length() == 0 ? 1 : 0;
}
public String next() {
diff --git a/jdk/src/java.base/share/classes/java/util/stream/BaseStream.java b/jdk/src/java.base/share/classes/java/util/stream/BaseStream.java
index 61e74867a19..0328b25cafd 100644
--- a/jdk/src/java.base/share/classes/java/util/stream/BaseStream.java
+++ b/jdk/src/java.base/share/classes/java/util/stream/BaseStream.java
@@ -79,6 +79,14 @@ public interface BaseStream>
* This is a terminal
* operation.
*
+ *
+ * The returned spliterator should report the set of characteristics derived
+ * from the stream pipeline (namely the characteristics derived from the
+ * stream source spliterator and the intermediate operations).
+ * Implementations may report a sub-set of those characteristics. For
+ * example, it may be too expensive to compute the entire set for some or
+ * all possible stream pipelines.
+ *
* @return the element spliterator for this stream
*/
Spliterator spliterator();
diff --git a/jdk/src/java.base/share/classes/java/util/stream/Stream.java b/jdk/src/java.base/share/classes/java/util/stream/Stream.java
index bd915796272..0070658b01f 100644
--- a/jdk/src/java.base/share/classes/java/util/stream/Stream.java
+++ b/jdk/src/java.base/share/classes/java/util/stream/Stream.java
@@ -987,6 +987,21 @@ public interface Stream extends BaseStream> {
return StreamSupport.stream(new Streams.StreamBuilderImpl<>(t), false);
}
+ /**
+ * Returns a sequential {@code Stream} containing a single element, if
+ * non-null, otherwise returns an empty {@code Stream}.
+ *
+ * @param t the single element
+ * @param the type of stream elements
+ * @return a stream with a single element if the specified element
+ * is non-null, otherwise an empty stream
+ * @since 1.9
+ */
+ public static Stream ofNullable(T t) {
+ return t == null ? Stream.empty()
+ : StreamSupport.stream(new Streams.StreamBuilderImpl<>(t), false);
+ }
+
/**
* Returns a sequential ordered stream whose elements are the specified values.
*
diff --git a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
index 46080c3bd22..15402d168cd 100644
--- a/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
+++ b/jdk/src/java.base/share/classes/sun/misc/Unsafe.java
@@ -25,8 +25,8 @@
package sun.misc;
-import java.security.*;
-import java.lang.reflect.*;
+import java.lang.reflect.Field;
+import java.security.ProtectionDomain;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
@@ -189,205 +189,39 @@ public final class Unsafe {
* If the reference o
is non-null, car marks or
* other store barriers for that object (if the VM requires them)
* are updated.
- * @see #putInt(Object, int, int)
+ * @see #putInt(Object, long, int)
*/
public native void putObject(Object o, long offset, Object x);
/** @see #getInt(Object, long) */
public native boolean getBoolean(Object o, long offset);
- /** @see #putInt(Object, int, int) */
+ /** @see #putInt(Object, long, int) */
public native void putBoolean(Object o, long offset, boolean x);
/** @see #getInt(Object, long) */
public native byte getByte(Object o, long offset);
- /** @see #putInt(Object, int, int) */
+ /** @see #putInt(Object, long, int) */
public native void putByte(Object o, long offset, byte x);
/** @see #getInt(Object, long) */
public native short getShort(Object o, long offset);
- /** @see #putInt(Object, int, int) */
+ /** @see #putInt(Object, long, int) */
public native void putShort(Object o, long offset, short x);
/** @see #getInt(Object, long) */
public native char getChar(Object o, long offset);
- /** @see #putInt(Object, int, int) */
+ /** @see #putInt(Object, long, int) */
public native void putChar(Object o, long offset, char x);
/** @see #getInt(Object, long) */
public native long getLong(Object o, long offset);
- /** @see #putInt(Object, int, int) */
+ /** @see #putInt(Object, long, int) */
public native void putLong(Object o, long offset, long x);
/** @see #getInt(Object, long) */
public native float getFloat(Object o, long offset);
- /** @see #putInt(Object, int, int) */
+ /** @see #putInt(Object, long, int) */
public native void putFloat(Object o, long offset, float x);
/** @see #getInt(Object, long) */
public native double getDouble(Object o, long offset);
- /** @see #putInt(Object, int, int) */
+ /** @see #putInt(Object, long, int) */
public native void putDouble(Object o, long offset, double x);
- /**
- * This method, like all others with 32-bit offsets, was native
- * in a previous release but is now a wrapper which simply casts
- * the offset to a long value. It provides backward compatibility
- * with bytecodes compiled against 1.4.
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public int getInt(Object o, int offset) {
- return getInt(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putInt(Object o, int offset, int x) {
- putInt(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public Object getObject(Object o, int offset) {
- return getObject(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putObject(Object o, int offset, Object x) {
- putObject(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public boolean getBoolean(Object o, int offset) {
- return getBoolean(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putBoolean(Object o, int offset, boolean x) {
- putBoolean(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public byte getByte(Object o, int offset) {
- return getByte(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putByte(Object o, int offset, byte x) {
- putByte(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public short getShort(Object o, int offset) {
- return getShort(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putShort(Object o, int offset, short x) {
- putShort(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public char getChar(Object o, int offset) {
- return getChar(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putChar(Object o, int offset, char x) {
- putChar(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public long getLong(Object o, int offset) {
- return getLong(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putLong(Object o, int offset, long x) {
- putLong(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public float getFloat(Object o, int offset) {
- return getFloat(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putFloat(Object o, int offset, float x) {
- putFloat(o, (long)offset, x);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public double getDouble(Object o, int offset) {
- return getDouble(o, (long)offset);
- }
-
- /**
- * @deprecated As of 1.4.1, cast the 32-bit offset argument to a long.
- * See {@link #staticFieldOffset}.
- */
- @Deprecated
- public void putDouble(Object o, int offset, double x) {
- putDouble(o, (long)offset, x);
- }
-
// These work on values in the C heap.
/**
@@ -578,58 +412,6 @@ public final class Unsafe {
*/
public static final int INVALID_FIELD_OFFSET = -1;
- /**
- * Returns the offset of a field, truncated to 32 bits.
- * This method is implemented as follows:
- *
- * public int fieldOffset(Field f) {
- * if (Modifier.isStatic(f.getModifiers()))
- * return (int) staticFieldOffset(f);
- * else
- * return (int) objectFieldOffset(f);
- * }
- *
- * @deprecated As of 1.4.1, use {@link #staticFieldOffset} for static
- * fields and {@link #objectFieldOffset} for non-static fields.
- */
- @Deprecated
- public int fieldOffset(Field f) {
- if (Modifier.isStatic(f.getModifiers()))
- return (int) staticFieldOffset(f);
- else
- return (int) objectFieldOffset(f);
- }
-
- /**
- * Returns the base address for accessing some static field
- * in the given class. This method is implemented as follows:
- *
- * public Object staticFieldBase(Class c) {
- * Field[] fields = c.getDeclaredFields();
- * for (int i = 0; i < fields.length; i++) {
- * if (Modifier.isStatic(fields[i].getModifiers())) {
- * return staticFieldBase(fields[i]);
- * }
- * }
- * return null;
- * }
- *
- * @deprecated As of 1.4.1, use {@link #staticFieldBase(Field)}
- * to obtain the base pertaining to a specific {@link Field}.
- * This method works only for JVMs which store all statics
- * for a given class in one place.
- */
- @Deprecated
- public Object staticFieldBase(Class> c) {
- Field[] fields = c.getDeclaredFields();
- for (int i = 0; i < fields.length; i++) {
- if (Modifier.isStatic(fields[i].getModifiers())) {
- return staticFieldBase(fields[i]);
- }
- }
- return null;
- }
-
/**
* Report the location of a given field in the storage allocation of its
* class. Do not expect to perform any sort of arithmetic on this offset;
@@ -648,7 +430,7 @@ public final class Unsafe {
* must preserve all bits of static field offsets.
* @see #getInt(Object, long)
*/
- public native long staticFieldOffset(Field f);
+ public native long objectFieldOffset(Field f);
/**
* Report the location of a given static field, in conjunction with {@link
@@ -667,7 +449,7 @@ public final class Unsafe {
* this method reports its result as a long value.
* @see #getInt(Object, long)
*/
- public native long objectFieldOffset(Field f);
+ public native long staticFieldOffset(Field f);
/**
* Report the location of a given static field, in conjunction with {@link
@@ -748,7 +530,7 @@ public final class Unsafe {
* Report the scale factor for addressing elements in the storage
* allocation of a given array class. However, arrays of "narrow" types
* will generally not work properly with accessors like {@link
- * #getByte(Object, int)}, so the scale factor for such classes is reported
+ * #getByte(Object, long)}, so the scale factor for such classes is reported
* as zero.
*
* @see #arrayBaseOffset
@@ -1136,11 +918,11 @@ public final class Unsafe {
public native void fullFence();
/**
- * Throws IllegalAccessError; for use by the VM.
+ * Throws IllegalAccessError; for use by the VM for access control
+ * error support.
* @since 1.8
*/
private static void throwIllegalAccessError() {
- throw new IllegalAccessError();
+ throw new IllegalAccessError();
}
-
}
diff --git a/jdk/src/java.base/share/classes/sun/misc/VM.java b/jdk/src/java.base/share/classes/sun/misc/VM.java
index c877e40446f..36bfb606495 100644
--- a/jdk/src/java.base/share/classes/sun/misc/VM.java
+++ b/jdk/src/java.base/share/classes/sun/misc/VM.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -402,6 +402,36 @@ public class VM {
*/
public static native long getegid();
+ /**
+ * Get a nanosecond time stamp adjustment in the form of a single long.
+ *
+ * This value can be used to create an instant using
+ * {@link java.time.Instant#ofEpochSecond(long, long)
+ * java.time.Instant.ofEpochSecond(offsetInSeconds,
+ * getNanoTimeAdjustment(offsetInSeconds))}.
+ *
+ * The value returned has the best resolution available to the JVM on
+ * the current system.
+ * This is usually down to microseconds - or tenth of microseconds -
+ * depending on the OS/Hardware and the JVM implementation.
+ *
+ * @param offsetInSeconds The offset in seconds from which the nanosecond
+ * time stamp should be computed.
+ *
+ * @apiNote The offset should be recent enough - so that
+ * {@code offsetInSeconds} is within {@code +/- 2^32} seconds of the
+ * current UTC time. If the offset is too far off, {@code -1} will be
+ * returned. As such, {@code -1} must not be considered as a valid
+ * nano time adjustment, but as an exception value indicating
+ * that an offset closer to the current time should be used.
+ *
+ * @return A nanosecond time stamp adjustment in the form of a single long.
+ * If the offset is too far off the current time, this method returns -1.
+ * In that case, the caller should call this method again, passing a
+ * more accurate offset.
+ */
+ public static native long getNanoTimeAdjustment(long offsetInSeconds);
+
static {
initialize();
}
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java b/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java
index dd0fd23fd15..e10a9400280 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/AbstractCharsetProvider.java
@@ -111,6 +111,12 @@ public class AbstractCharsetProvider
}
}
+ protected boolean hasCharset(String name) {
+ synchronized (this) {
+ return classMap.containsKey(name);
+ }
+ }
+
/* Late initialization hook, needed by some providers
*/
protected void init() { }
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java b/jdk/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java
similarity index 96%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java
rename to jdk/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java
index 13b49755a1c..efbaf687797 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DelegatableDecoder.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/DelegatableDecoder.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -34,7 +34,7 @@ import java.nio.charset.CoderResult;
* when normal inheritance cannot be used.
* Used by autodecting decoders.
*/
-interface DelegatableDecoder {
+public interface DelegatableDecoder {
CoderResult decodeLoop(ByteBuffer src, CharBuffer dst);
void implReset();
CoderResult implFlush(CharBuffer out);
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java b/jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java
similarity index 97%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java
rename to jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java
index ddc19044cf4..7b55339cab1 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/DoubleByte.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/DoubleByte.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -130,9 +130,9 @@ public class DoubleByte {
return CoderResult.unmappableForLength(2);
}
- Decoder(Charset cs, float avgcpb, float maxcpb,
- char[][] b2c, char[] b2cSB,
- int b2Min, int b2Max) {
+ public Decoder(Charset cs, float avgcpb, float maxcpb,
+ char[][] b2c, char[] b2cSB,
+ int b2Min, int b2Max) {
super(cs, avgcpb, maxcpb);
this.b2c = b2c;
this.b2cSB = b2cSB;
@@ -140,7 +140,7 @@ public class DoubleByte {
this.b2Max = b2Max;
}
- Decoder(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+ public Decoder(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
this(cs, 0.5f, 1.0f, b2c, b2cSB, b2Min, b2Max);
}
@@ -273,7 +273,7 @@ public class DoubleByte {
private static final int SI = 0x0f;
private int currentState;
- Decoder_EBCDIC(Charset cs,
+ public Decoder_EBCDIC(Charset cs,
char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, b2c, b2cSB, b2Min, b2Max);
}
@@ -451,7 +451,7 @@ public class DoubleByte {
b2cSB_UNMAPPABLE = new char[0x100];
Arrays.fill(b2cSB_UNMAPPABLE, UNMAPPABLE_DECODING);
}
- Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
+ public Decoder_DBCSONLY(Charset cs, char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, 0.5f, 1.0f, b2c, b2cSB_UNMAPPABLE, b2Min, b2Max);
}
}
@@ -463,7 +463,7 @@ public class DoubleByte {
private final int SS2 = 0x8E;
private final int SS3 = 0x8F;
- Decoder_EUC_SIM(Charset cs,
+ public Decoder_EUC_SIM(Charset cs,
char[][] b2c, char[] b2cSB, int b2Min, int b2Max) {
super(cs, b2c, b2cSB, b2Min, b2Max);
}
@@ -511,18 +511,18 @@ public class DoubleByte {
public static class Encoder extends CharsetEncoder
implements ArrayEncoder
{
- final int MAX_SINGLEBYTE = 0xff;
+ protected final int MAX_SINGLEBYTE = 0xff;
private final char[] c2b;
private final char[] c2bIndex;
- Surrogate.Parser sgp;
+ protected Surrogate.Parser sgp;
- protected Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, 2.0f, 2.0f);
this.c2b = c2b;
this.c2bIndex = c2bIndex;
}
- Encoder(Charset cs, float avg, float max, byte[] repl, char[] c2b, char[] c2bIndex) {
+ public Encoder(Charset cs, float avg, float max, byte[] repl, char[] c2b, char[] c2bIndex) {
super(cs, avg, max, repl);
this.c2b = c2b;
this.c2bIndex = c2bIndex;
@@ -532,7 +532,7 @@ public class DoubleByte {
return encodeChar(c) != UNMAPPABLE_ENCODING;
}
- Surrogate.Parser sgp() {
+ protected Surrogate.Parser sgp() {
if (sgp == null)
sgp = new Surrogate.Parser();
return sgp;
@@ -657,7 +657,7 @@ public class DoubleByte {
}
// init the c2b and c2bIndex tables from b2c.
- static void initC2B(String[] b2c, String b2cSB, String b2cNR, String c2bNR,
+ public static void initC2B(String[] b2c, String b2cSB, String b2cNR, String c2bNR,
int b2Min, int b2Max,
char[] c2b, char[] c2bIndex)
{
@@ -741,7 +741,7 @@ public class DoubleByte {
}
public static class Encoder_DBCSONLY extends Encoder {
- Encoder_DBCSONLY(Charset cs, byte[] repl,
+ public Encoder_DBCSONLY(Charset cs, byte[] repl,
char[] c2b, char[] c2bIndex) {
super(cs, 2.0f, 2.0f, repl, c2b, c2bIndex);
}
@@ -764,7 +764,7 @@ public class DoubleByte {
protected int currentState = SBCS;
- Encoder_EBCDIC(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder_EBCDIC(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, 4.0f, 5.0f, new byte[] {(byte)0x6f}, c2b, c2bIndex);
}
@@ -921,7 +921,7 @@ public class DoubleByte {
// EUC_SIMPLE
public static class Encoder_EUC_SIM extends Encoder {
- Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
+ public Encoder_EUC_SIM(Charset cs, char[] c2b, char[] c2bIndex) {
super(cs, c2b, c2bIndex);
}
}
diff --git a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java b/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java
similarity index 98%
rename from jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java
rename to jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java
index 07be74d9581..ba22341ae85 100644
--- a/jdk/src/jdk.charsets/share/classes/sun/nio/cs/ext/HKSCS.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/HKSCS.java
@@ -23,7 +23,7 @@
* questions.
*/
-package sun.nio.cs.ext;
+package sun.nio.cs;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
@@ -32,6 +32,7 @@ import java.nio.charset.CharsetDecoder;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CoderResult;
import java.util.Arrays;
+import sun.nio.cs.DoubleByte;
import sun.nio.cs.Surrogate;
import static sun.nio.cs.CharsetMapping.*;
@@ -216,7 +217,7 @@ public class HKSCS {
return decodeBufferLoop(src, dst);
}
- static void initb2c(char[][]b2c, String[] b2cStr)
+ public static void initb2c(char[][]b2c, String[] b2cStr)
{
for (int i = 0; i < b2cStr.length; i++) {
if (b2cStr[i] == null)
@@ -395,7 +396,7 @@ public class HKSCS {
Arrays.fill(C2B_UNMAPPABLE, (char)UNMAPPABLE_ENCODING);
}
- static void initc2b(char[][] c2b, String[] b2cStr, String pua) {
+ public static void initc2b(char[][] c2b, String[] b2cStr, String pua) {
// init c2b/c2bSupp from b2cStr and supp
int b2Min = 0x40;
Arrays.fill(c2b, C2B_UNMAPPABLE);
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java b/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java
index bf9146c40f7..093d1aaea3a 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/SingleByte.java
@@ -160,22 +160,18 @@ public class SingleByte
byte[] da = dst.array();
int dp = dst.arrayOffset() + dst.position();
int dl = dst.arrayOffset() + dst.limit();
+ int len = Math.min(dl - dp, sl - sp);
- CoderResult cr = CoderResult.UNDERFLOW;
- if ((dl - dp) < (sl - sp)) {
- sl = sp + (dl - dp);
- cr = CoderResult.OVERFLOW;
- }
-
- while (sp < sl) {
+ while (len-- > 0) {
char c = sa[sp];
int b = encode(c);
if (b == UNMAPPABLE_ENCODING) {
if (Character.isSurrogate(c)) {
if (sgp == null)
sgp = new Surrogate.Parser();
- if (sgp.parse(c, sa, sp, sl) < 0)
+ if (sgp.parse(c, sa, sp, sl) < 0) {
return withResult(sgp.error(), src, sp, dst, dp);
+ }
return withResult(sgp.unmappableResult(), src, sp, dst, dp);
}
return withResult(CoderResult.unmappableForLength(1),
@@ -184,7 +180,8 @@ public class SingleByte
da[dp++] = (byte)b;
sp++;
}
- return withResult(cr, src, sp, dst, dp);
+ return withResult(sp < sl ? CoderResult.OVERFLOW : CoderResult.UNDERFLOW,
+ src, sp, dst, dp);
}
private CoderResult encodeBufferLoop(CharBuffer src, ByteBuffer dst) {
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
index 468934b017a..63a5dc62139 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StandardCharsets.java.template
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@@ -29,20 +29,188 @@
package sun.nio.cs;
-import java.nio.charset.*;
+import java.nio.charset.Charset;
+import java.nio.charset.spi.CharsetProvider;
+import java.util.Iterator;
+import java.util.Locale;
+import java.util.Map;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
-
-public class StandardCharsets
- extends FastCharsetProvider
-{
+public class StandardCharsets extends CharsetProvider {
_INCLUDE_ALIASES_TABLES_
_INCLUDE_ALIASES_MAP_
_INCLUDE_CLASSES_MAP_
_INCLUDE_CACHE_MAP_
+ // Maps canonical names to class names
+ private Map classMap;
+ // Maps alias names to canonical names
+ private Map aliasMap;
+ // Maps canonical names to cached instances
+ private Map cache;
+
+ private String packagePrefix = "sun.nio.cs";
+
public StandardCharsets() {
- super("sun.nio.cs", new Aliases(), new Classes(), new Cache());
+ this.aliasMap = new Aliases();
+ this.classMap = new Classes();
+ this.cache = new Cache();
}
+ private String canonicalize(String csn) {
+ String acn = aliasMap.get(csn);
+ return (acn != null) ? acn : csn;
+ }
+
+ // Private ASCII-only version, optimized for interpretation during startup
+ //
+ private static String toLower(String s) {
+ int n = s.length();
+ boolean allLower = true;
+ for (int i = 0; i < n; i++) {
+ int c = s.charAt(i);
+ if (((c - 'A') | ('Z' - c)) >= 0) {
+ allLower = false;
+ break;
+ }
+ }
+ if (allLower)
+ return s;
+ char[] ca = new char[n];
+ for (int i = 0; i < n; i++) {
+ int c = s.charAt(i);
+ if (((c - 'A') | ('Z' - c)) >= 0)
+ ca[i] = (char)(c + 0x20);
+ else
+ ca[i] = (char)c;
+ }
+ return new String(ca);
+ }
+
+ private Charset lookup(String charsetName) {
+ init();
+ String csn = canonicalize(toLower(charsetName));
+
+ // Check cache first
+ Charset cs = cache.get(csn);
+ if (cs != null)
+ return cs;
+
+ // Do we even support this charset?
+ String cln = classMap.get(csn);
+ if (cln == null)
+ return null;
+
+ if (cln.equals("US_ASCII")) {
+ cs = new US_ASCII();
+ cache.put(csn, cs);
+ return cs;
+ }
+
+ // Instantiate the charset and cache it
+ try {
+ Class> c = Class.forName(packagePrefix + "." + cln,
+ true,
+ this.getClass().getClassLoader());
+ cs = (Charset)c.newInstance();
+ cache.put(csn, cs);
+ return cs;
+ } catch (ClassNotFoundException |
+ IllegalAccessException |
+ InstantiationException x) {
+ return null;
+ }
+ }
+
+ public final Charset charsetForName(String charsetName) {
+ synchronized (this) {
+ return lookup(canonicalize(charsetName));
+ }
+ }
+
+ public final Iterator charsets() {
+ synchronized (this) {
+ init();
+ }
+ return new Iterator() {
+
+ Iterator i = classMap.keySet().iterator();
+
+ public boolean hasNext() {
+ return i.hasNext();
+ }
+
+ public Charset next() {
+ String csn = i.next();
+ return lookup(csn);
+ }
+
+ public void remove() {
+ throw new UnsupportedOperationException();
+ }
+
+ };
+ }
+
+ private boolean initialized = false;
+
+ /* provider the sun.nio.cs.map property fir sjis/ms932 mapping hack
+ */
+ private void init() {
+ if (initialized)
+ return;
+ if (!sun.misc.VM.isBooted())
+ return;
+ initialized = true;
+
+ String map = getProperty("sun.nio.cs.map");
+ if (map != null) {
+ String[] maps = map.split(",");
+ for (int i = 0; i < maps.length; i++) {
+ if (maps[i].equalsIgnoreCase("Windows-31J/Shift_JIS")) {
+ // if we dont have both sjis and ms932, do nothing
+ if (classMap.get("shift_jis") == null ||
+ classMap.get("windows-31j") == null) {
+ break;
+ }
+ aliases_MS932 = new String[] {
+ "MS932", // JDK historical
+ "windows-932",
+ "csWindows31J",
+ "shift-jis",
+ "ms_kanji",
+ "x-sjis",
+ "csShiftJIS",
+ // This alias takes precedence over the actual
+ // Shift_JIS charset itself since aliases are always
+ // resolved first, before looking up canonical names.
+ "shift_jis"
+ };
+ aliases_SJIS = new String[] { "sjis" };
+
+ for (String alias : aliases_MS932) {
+ aliasMap.put(toLower(alias), "windows-31j");
+ }
+ cache.put("shift_jis", null);
+ break;
+ }
+ }
+ }
+ }
+
+ private static String getProperty(String key) {
+ // this method may be called during initialization of
+ // system class loader and thus not using lambda
+ return AccessController.doPrivileged(
+ new PrivilegedAction() {
+ @Override
+ public String run() {
+ return System.getProperty(key);
+ }
+ });
+ }
+
+
}
diff --git a/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java b/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java
index a3aaf3675d9..fd72238d89f 100644
--- a/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java
+++ b/jdk/src/java.base/share/classes/sun/nio/cs/StreamEncoder.java
@@ -243,8 +243,11 @@ public class StreamEncoder extends Writer
if (cr.isUnderflow()) {
if (lcb.hasRemaining()) {
leftoverChar = lcb.get();
- if (cb != null && cb.hasRemaining())
- flushLeftoverChar(cb, endOfInput);
+ if (cb != null && cb.hasRemaining()) {
+ lcb.clear();
+ lcb.put(leftoverChar).put(cb.get()).flip();
+ continue;
+ }
return;
}
break;
@@ -265,24 +268,24 @@ public class StreamEncoder extends Writer
CharBuffer cb = CharBuffer.wrap(cbuf, off, len);
if (haveLeftoverChar)
- flushLeftoverChar(cb, false);
+ flushLeftoverChar(cb, false);
while (cb.hasRemaining()) {
- CoderResult cr = encoder.encode(cb, bb, false);
- if (cr.isUnderflow()) {
- assert (cb.remaining() <= 1) : cb.remaining();
- if (cb.remaining() == 1) {
- haveLeftoverChar = true;
- leftoverChar = cb.get();
+ CoderResult cr = encoder.encode(cb, bb, false);
+ if (cr.isUnderflow()) {
+ assert (cb.remaining() <= 1) : cb.remaining();
+ if (cb.remaining() == 1) {
+ haveLeftoverChar = true;
+ leftoverChar = cb.get();
+ }
+ break;
}
- break;
- }
- if (cr.isOverflow()) {
- assert bb.position() > 0;
- writeBytes();
- continue;
- }
- cr.throwException();
+ if (cr.isOverflow()) {
+ assert bb.position() > 0;
+ writeBytes();
+ continue;
+ }
+ cr.throwException();
}
}
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/AclEntryImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/AclEntryImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/AclEntryImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/AclEntryImpl.java
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/AclImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/AclImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/AclImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/AclImpl.java
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/AllPermissionsImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/AllPermissionsImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/AllPermissionsImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/AllPermissionsImpl.java
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/GroupImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/GroupImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/GroupImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/GroupImpl.java
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/OwnerImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/OwnerImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/OwnerImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/OwnerImpl.java
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/PermissionImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/PermissionImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/PermissionImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/PermissionImpl.java
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/PrincipalImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/PrincipalImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/PrincipalImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/PrincipalImpl.java
diff --git a/jdk/src/java.security.acl/share/classes/sun/security/acl/WorldGroupImpl.java b/jdk/src/java.base/share/classes/sun/security/acl/WorldGroupImpl.java
similarity index 100%
rename from jdk/src/java.security.acl/share/classes/sun/security/acl/WorldGroupImpl.java
rename to jdk/src/java.base/share/classes/sun/security/acl/WorldGroupImpl.java
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/DSA.java b/jdk/src/java.base/share/classes/sun/security/provider/DSA.java
index 66b83ad83bc..6f8c27a38c0 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/DSA.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/DSA.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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,14 +33,11 @@ import java.nio.ByteBuffer;
import java.security.*;
import java.security.SecureRandom;
import java.security.interfaces.*;
-import java.security.spec.DSAParameterSpec;
-import java.security.spec.InvalidParameterSpecException;
import sun.security.util.Debug;
import sun.security.util.DerValue;
import sun.security.util.DerInputStream;
import sun.security.util.DerOutputStream;
-import sun.security.x509.AlgIdDSA;
import sun.security.jca.JCAUtil;
/**
@@ -85,13 +82,28 @@ abstract class DSA extends SignatureSpi {
/* The message digest object used */
private final MessageDigest md;
+ /* The format. true for the IEEE P1363 format. false (default) for ASN.1 */
+ private final boolean p1363Format;
+
/**
* Construct a blank DSA object. It must be
* initialized before being usable for signing or verifying.
*/
DSA(MessageDigest md) {
+ this(md, false);
+ }
+
+ /**
+ * Construct a blank DSA object that will use the specified
+ * signature format. {@code p1363Format} should be {@code true} to
+ * use the IEEE P1363 format. If {@code p1363Format} is {@code false},
+ * the DER-encoded ASN.1 format will used. The DSA object must be
+ * initialized before being usable for signing or verifying.
+ */
+ DSA(MessageDigest md, boolean p1363Format) {
super();
this.md = md;
+ this.p1363Format = p1363Format;
}
/**
@@ -178,12 +190,16 @@ abstract class DSA extends SignatureSpi {
/**
- * Sign all the data thus far updated. The signature is formatted
+ * Sign all the data thus far updated. The signature format is
+ * determined by {@code p1363Format}. If {@code p1363Format} is
+ * {@code false} (the default), then the signature is formatted
* according to the Canonical Encoding Rules, returned as a DER
- * sequence of Integer, r and s.
+ * sequence of Integers, r and s. If {@code p1363Format} is
+ * {@code false}, the signature is returned in the IEEE P1363
+ * format, which is the concatenation or r and s.
*
- * @return a signature block formatted according to the Canonical
- * Encoding Rules.
+ * @return a signature block formatted according to the format
+ * indicated by {@code p1363Format}
*
* @exception SignatureException if the signature object was not
* properly initialized, or if another exception occurs.
@@ -196,24 +212,48 @@ abstract class DSA extends SignatureSpi {
BigInteger r = generateR(presetP, presetQ, presetG, k);
BigInteger s = generateS(presetX, presetQ, r, k);
- try {
- DerOutputStream outseq = new DerOutputStream(100);
- outseq.putInteger(r);
- outseq.putInteger(s);
- DerValue result = new DerValue(DerValue.tag_Sequence,
- outseq.toByteArray());
+ if (p1363Format) {
+ // Return the concatenation of r and s
+ byte[] rBytes = r.toByteArray();
+ byte[] sBytes = s.toByteArray();
- return result.toByteArray();
+ int size = presetQ.bitLength() / 8;
+ byte[] outseq = new byte[size * 2];
- } catch (IOException e) {
- throw new SignatureException("error encoding signature");
+ int rLength = rBytes.length;
+ int sLength = sBytes.length;
+ int i;
+ for (i = rLength; i > 0 && rBytes[rLength - i] == 0; i--);
+
+ int j;
+ for (j = sLength;
+ j > 0 && sBytes[sLength - j] == 0; j--);
+
+ System.arraycopy(rBytes, rLength - i, outseq, size - i, i);
+ System.arraycopy(sBytes, sLength - j, outseq, size * 2 - j, j);
+
+ return outseq;
+ } else {
+ // Return the DER-encoded ASN.1 form
+ try {
+ DerOutputStream outseq = new DerOutputStream(100);
+ outseq.putInteger(r);
+ outseq.putInteger(s);
+ DerValue result = new DerValue(DerValue.tag_Sequence,
+ outseq.toByteArray());
+
+ return result.toByteArray();
+
+ } catch (IOException e) {
+ throw new SignatureException("error encoding signature");
+ }
}
}
/**
* Verify all the data thus far updated.
*
- * @param signature the alledged signature, encoded using the
+ * @param signature the alleged signature, encoded using the
* Canonical Encoding Rules, as a sequence of integers, r and s.
*
* @exception SignatureException if the signature object was not
@@ -230,8 +270,13 @@ abstract class DSA extends SignatureSpi {
/**
* Verify all the data thus far updated.
*
- * @param signature the alledged signature, encoded using the
- * Canonical Encoding Rules, as a sequence of integers, r and s.
+ * @param signature the alleged signature, encoded using the
+ * format indicated by {@code p1363Format}. If {@code p1363Format}
+ * is {@code false} (the default), then the signature is formatted
+ * according to the Canonical Encoding Rules, as a DER sequence of
+ * Integers, r and s. If {@code p1363Format} is {@code false},
+ * the signature is in the IEEE P1363 format, which is the
+ * concatenation or r and s.
*
* @param offset the offset to start from in the array of bytes.
*
@@ -248,16 +293,28 @@ abstract class DSA extends SignatureSpi {
BigInteger r = null;
BigInteger s = null;
- // first decode the signature.
- try {
- DerInputStream in = new DerInputStream(signature, offset, length);
- DerValue[] values = in.getSequence(2);
- r = values[0].getBigInteger();
- s = values[1].getBigInteger();
+ if (p1363Format) {
+ if ((length & 1) == 1) {
+ // length of signature byte array should be even
+ throw new SignatureException("invalid signature format");
+ }
+ int mid = length/2;
+ r = new BigInteger(Arrays.copyOfRange(signature, 0, mid));
+ s = new BigInteger(Arrays.copyOfRange(signature, mid, length));
+ } else {
+ // first decode the signature.
+ try {
+ DerInputStream in = new DerInputStream(signature, offset,
+ length);
+ DerValue[] values = in.getSequence(2);
- } catch (IOException e) {
- throw new SignatureException("invalid encoding for signature");
+ r = values[0].getBigInteger();
+ s = values[1].getBigInteger();
+
+ } catch (IOException e) {
+ throw new SignatureException("invalid encoding for signature");
+ }
}
// some implementations do not correctly encode values in the ASN.1
@@ -420,6 +477,15 @@ abstract class DSA extends SignatureSpi {
}
}
+ /**
+ * SHA224withDSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class SHA224withDSAinP1363Format extends DSA {
+ public SHA224withDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(MessageDigest.getInstance("SHA-224"), true);
+ }
+ }
+
/**
* Standard SHA256withDSA implementation as defined in FIPS186-3.
*/
@@ -429,6 +495,15 @@ abstract class DSA extends SignatureSpi {
}
}
+ /**
+ * SHA256withDSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class SHA256withDSAinP1363Format extends DSA {
+ public SHA256withDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(MessageDigest.getInstance("SHA-256"), true);
+ }
+ }
+
static class LegacyDSA extends DSA {
/* The random seed used to generate k */
private int[] kSeed;
@@ -441,7 +516,12 @@ abstract class DSA extends SignatureSpi {
private int[] kSeedLast;
public LegacyDSA(MessageDigest md) throws NoSuchAlgorithmException {
- super(md);
+ this(md, false);
+ }
+
+ private LegacyDSA(MessageDigest md, boolean p1363Format)
+ throws NoSuchAlgorithmException {
+ super(md, p1363Format);
}
@Deprecated
@@ -636,6 +716,9 @@ abstract class DSA extends SignatureSpi {
}
}
+ /**
+ * Standard SHA1withDSA implementation.
+ */
public static final class SHA1withDSA extends LegacyDSA {
public SHA1withDSA() throws NoSuchAlgorithmException {
super(MessageDigest.getInstance("SHA-1"));
@@ -643,13 +726,22 @@ abstract class DSA extends SignatureSpi {
}
/**
- * RawDSA implementation.
+ * SHA1withDSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class SHA1withDSAinP1363Format extends LegacyDSA {
+ public SHA1withDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(MessageDigest.getInstance("SHA-1"), true);
+ }
+ }
+
+ /**
+ * Raw DSA.
*
- * RawDSA requires the data to be exactly 20 bytes long. If it is
+ * Raw DSA requires the data to be exactly 20 bytes long. If it is
* not, a SignatureException is thrown when sign()/verify() is called
* per JCA spec.
*/
- public static final class RawDSA extends LegacyDSA {
+ static class Raw extends LegacyDSA {
// Internal special-purpose MessageDigest impl for RawDSA
// Only override whatever methods used
// NOTE: no clone support
@@ -719,8 +811,27 @@ abstract class DSA extends SignatureSpi {
}
}
+ private Raw(boolean p1363Format) throws NoSuchAlgorithmException {
+ super(new NullDigest20(), p1363Format);
+ }
+
+ }
+
+ /**
+ * Standard Raw DSA implementation.
+ */
+ public static final class RawDSA extends Raw {
public RawDSA() throws NoSuchAlgorithmException {
- super(new NullDigest20());
+ super(false);
+ }
+ }
+
+ /**
+ * Raw DSA implementation that uses the IEEE P1363 format.
+ */
+ public static final class RawDSAinP1363Format extends Raw {
+ public RawDSAinP1363Format() throws NoSuchAlgorithmException {
+ super(true);
}
}
}
diff --git a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
index 93e31a6faaf..c496910f7c9 100644
--- a/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
+++ b/jdk/src/java.base/share/classes/sun/security/provider/SunEntries.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -130,6 +130,15 @@ final class SunEntries {
map.put("Signature.SHA256withDSA",
"sun.security.provider.DSA$SHA256withDSA");
+ map.put("Signature.SHA1withDSAinP1363Format",
+ "sun.security.provider.DSA$SHA1withDSAinP1363Format");
+ map.put("Signature.NONEwithDSAinP1363Format",
+ "sun.security.provider.DSA$RawDSAinP1363Format");
+ map.put("Signature.SHA224withDSAinP1363Format",
+ "sun.security.provider.DSA$SHA224withDSAinP1363Format");
+ map.put("Signature.SHA256withDSAinP1363Format",
+ "sun.security.provider.DSA$SHA256withDSAinP1363Format");
+
String dsaKeyClasses = "java.security.interfaces.DSAPublicKey" +
"|java.security.interfaces.DSAPrivateKey";
map.put("Signature.SHA1withDSA SupportedKeyClasses", dsaKeyClasses);
diff --git a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
index 17b56974ea3..94df91fe7f9 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -171,8 +171,9 @@ public class DisabledAlgorithmConstraints implements AlgorithmConstraints {
// OAEPWithAndPadding
// with
// withand
+ // within
Pattern pattern =
- Pattern.compile("with|and", Pattern.CASE_INSENSITIVE);
+ Pattern.compile("with|and|in", Pattern.CASE_INSENSITIVE);
String[] tokens = pattern.split(transTocken);
for (String token : tokens) {
diff --git a/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java b/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java
index 1a6f3c2a446..88d98573951 100644
--- a/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java
+++ b/jdk/src/java.base/share/classes/sun/security/util/HostnameChecker.java
@@ -26,6 +26,8 @@
package sun.security.util;
import java.io.IOException;
+import java.net.InetAddress;
+import java.net.UnknownHostException;
import java.util.*;
import java.security.Principal;
@@ -148,6 +150,17 @@ public class HostnameChecker {
String ipAddress = (String)next.get(1);
if (expectedIP.equalsIgnoreCase(ipAddress)) {
return;
+ } else {
+ // compare InetAddress objects in order to ensure
+ // equality between a long IPv6 address and its
+ // abbreviated form.
+ try {
+ if (InetAddress.getByName(expectedIP).equals(
+ InetAddress.getByName(ipAddress))) {
+ return;
+ }
+ } catch (UnknownHostException e) {
+ } catch (SecurityException e) {}
}
}
}
diff --git a/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java b/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java
index 679a5c10033..75efc60e0db 100644
--- a/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java
+++ b/jdk/src/java.base/share/classes/sun/util/resources/TimeZoneNames.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -408,7 +408,7 @@ public final class TimeZoneNames extends TimeZoneNamesBundle {
{"America/Buenos_Aires", AGT},
{"America/Cambridge_Bay", MST},
{"America/Campo_Grande", AMT},
- {"America/Cancun", CST},
+ {"America/Cancun", EST},
{"America/Caracas", new String[] {"Venezuela Time", "VET",
"Venezuela Summer Time", "VEST",
"Venezuela Time", "VET"}},
diff --git a/jdk/src/java.base/share/conf/security/java.policy b/jdk/src/java.base/share/conf/security/java.policy
index 3cfcb22a1c0..b9485d80e97 100644
--- a/jdk/src/java.base/share/conf/security/java.policy
+++ b/jdk/src/java.base/share/conf/security/java.policy
@@ -1,4 +1,8 @@
// permissions required by each component
+grant codeBase "jrt:/java.corba" {
+ permission java.security.AllPermission;
+};
+
grant codeBase "jrt:/jdk.zipfs" {
permission java.io.FilePermission "<>", "read,write,delete";
permission java.lang.RuntimePermission "fileSystemProvider";
@@ -55,6 +59,29 @@ grant codeBase "jrt:/jdk.crypto.pkcs11" {
permission java.io.FilePermission "<>", "read";
};
+grant codeBase "jrt:/java.xml.ws" {
+ permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.*";
+ permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal";
+ permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal.*";
+ permission java.lang.RuntimePermission "accessClassInPackage.com.sun.org.apache.xerces.internal.*";
+ permission java.lang.RuntimePermission "accessDeclaredMembers";
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+ permission java.util.PropertyPermission "*", "read";
+};
+
+grant codeBase "jrt:/java.xml.bind" {
+ permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.*";
+ permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal";
+ permission java.lang.RuntimePermission "accessClassInPackage.com.sun.istack.internal.*";
+ permission java.lang.RuntimePermission "accessDeclaredMembers";
+ permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
+ permission java.util.PropertyPermission "*", "read";
+};
+
+grant codeBase "jrt:/java.activation" {
+ permission java.security.AllPermission;
+};
+
// default permissions granted to all domains
grant {
diff --git a/jdk/src/java.base/share/native/include/jvm.h b/jdk/src/java.base/share/native/include/jvm.h
index 514378df9b2..7177f2e1d1e 100644
--- a/jdk/src/java.base/share/native/include/jvm.h
+++ b/jdk/src/java.base/share/native/include/jvm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -104,6 +104,9 @@ JVM_CurrentTimeMillis(JNIEnv *env, jclass ignored);
JNIEXPORT jlong JNICALL
JVM_NanoTime(JNIEnv *env, jclass ignored);
+JNIEXPORT jlong JNICALL
+JVM_GetNanoTimeAdjustment(JNIEnv *env, jclass ignored, jlong offset_secs);
+
JNIEXPORT void JNICALL
JVM_ArrayCopy(JNIEnv *env, jclass ignored, jobject src, jint src_pos,
jobject dst, jint dst_pos, jint length);
diff --git a/jdk/src/java.base/share/native/libjava/VM.c b/jdk/src/java.base/share/native/libjava/VM.c
index 1968a06b01b..14fd1a63487 100644
--- a/jdk/src/java.base/share/native/libjava/VM.c
+++ b/jdk/src/java.base/share/native/libjava/VM.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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,6 +33,11 @@
#include "sun_misc_VM.h"
+/* Only register the performance-critical methods */
+static JNINativeMethod methods[] = {
+ {"getNanoTimeAdjustment", "(J)J", (void *)&JVM_GetNanoTimeAdjustment}
+};
+
JNIEXPORT jobject JNICALL
Java_sun_misc_VM_latestUserDefinedLoader(JNIEnv *env, jclass cls) {
return JVM_LatestUserDefinedLoader(env);
@@ -49,6 +54,14 @@ Java_sun_misc_VM_initialize(JNIEnv *env, jclass cls) {
return;
}
+ // Registers implementations of native methods described in methods[]
+ // above.
+ // In particular, registers JVM_GetNanoTimeAdjustment as the implementation
+ // of the native sun.misc.VM.getNanoTimeAdjustment - avoiding the cost of
+ // introducing a Java_sun_misc_VM_getNanoTimeAdjustment wrapper
+ (*env)->RegisterNatives(env, cls,
+ methods, sizeof(methods)/sizeof(methods[0]));
+
func_p = (GetJvmVersionInfo_fp) JDK_FindJvmEntry("JVM_GetVersionInfo");
if (func_p != NULL) {
jvm_version_info info;
diff --git a/jdk/src/java.base/share/native/libjli/java.c b/jdk/src/java.base/share/native/libjli/java.c
index 2f1e7e17971..d988ac3cec2 100644
--- a/jdk/src/java.base/share/native/libjli/java.c
+++ b/jdk/src/java.base/share/native/libjli/java.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -350,12 +350,6 @@ JLI_Launch(int argc, char ** argv, /* main argc, argc */
} \
} while (JNI_FALSE)
-#define CHECK_EXCEPTION_RETURN() \
- do { \
- if ((*env)->ExceptionOccurred(env)) { \
- return; \
- } \
- } while (JNI_FALSE)
int JNICALL
JavaMain(void * _args)
@@ -466,6 +460,7 @@ JavaMain(void * _args)
* of the application class.
*/
PostJVMInit(env, appClass, vm);
+ CHECK_EXCEPTION_LEAVE(1);
/*
* The LoadMainClass not only loads the main class, it will also ensure
* that the main method's signature is correct, therefore further checking
diff --git a/jdk/src/java.base/share/native/libjli/java.h b/jdk/src/java.base/share/native/libjli/java.h
index 615b16cd9c3..5cc7608b566 100644
--- a/jdk/src/java.base/share/native/libjli/java.h
+++ b/jdk/src/java.base/share/native/libjli/java.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -254,4 +254,11 @@ typedef struct {
#define NULL_CHECK(NC_check_pointer) \
NULL_CHECK_RETURN_VALUE(NC_check_pointer, )
+#define CHECK_EXCEPTION_RETURN() \
+ do { \
+ if ((*env)->ExceptionOccurred(env)) { \
+ return; \
+ } \
+ } while (JNI_FALSE)
+
#endif /* _JAVA_H_ */
diff --git a/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java b/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java
index afa24e40cf3..689564dc3bb 100644
--- a/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java
+++ b/jdk/src/java.base/windows/classes/sun/nio/fs/WindowsPath.java
@@ -391,6 +391,10 @@ class WindowsPath implements Path {
if (!this.root.equalsIgnoreCase(other.root))
throw new IllegalArgumentException("'other' has different root");
+ // this path is the empty path
+ if (this.isEmpty())
+ return other;
+
int bn = this.getNameCount();
int cn = other.getNameCount();
diff --git a/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c b/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c
index 51e24a01129..1bb5896be5f 100644
--- a/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c
+++ b/jdk/src/java.base/windows/native/libjava/ProcessImpl_md.c
@@ -30,6 +30,7 @@
#include "jvm.h"
#include "jni_util.h"
#include "io_util.h"
+#include "io_util_md.h"
#include
#include
@@ -467,26 +468,6 @@ Java_java_lang_ProcessImpl_closeHandle(JNIEnv *env, jclass ignored, jlong handle
return (jboolean) CloseHandle((HANDLE) handle);
}
-/**
- * Returns a copy of the Unicode characters of a string. Fow now this
- * function doesn't handle long path names and other issues.
- */
-static WCHAR* getPath(JNIEnv *env, jstring ps) {
- WCHAR *pathbuf = NULL;
- const jchar *chars = (*(env))->GetStringChars(env, ps, NULL);
- if (chars != NULL) {
- size_t pathlen = wcslen(chars);
- pathbuf = (WCHAR*)malloc((pathlen + 6) * sizeof(WCHAR));
- if (pathbuf == NULL) {
- JNU_ThrowOutOfMemoryError(env, NULL);
- } else {
- wcscpy(pathbuf, chars);
- }
- (*env)->ReleaseStringChars(env, ps, chars);
- }
- return pathbuf;
-}
-
JNIEXPORT jlong JNICALL
Java_java_lang_ProcessImpl_openForAtomicAppend(JNIEnv *env, jclass ignored, jstring path)
{
@@ -495,7 +476,7 @@ Java_java_lang_ProcessImpl_openForAtomicAppend(JNIEnv *env, jclass ignored, jstr
const DWORD disposition = OPEN_ALWAYS;
const DWORD flagsAndAttributes = FILE_ATTRIBUTE_NORMAL;
HANDLE h;
- WCHAR *pathbuf = getPath(env, path);
+ WCHAR *pathbuf = pathToNTPath(env, path, JNI_FALSE);
if (pathbuf == NULL) {
/* Exception already pending */
return -1;
diff --git a/jdk/src/java.base/windows/native/libjava/io_util_md.h b/jdk/src/java.base/windows/native/libjava/io_util_md.h
index cf925078e94..d85cdd3dead 100644
--- a/jdk/src/java.base/windows/native/libjava/io_util_md.h
+++ b/jdk/src/java.base/windows/native/libjava/io_util_md.h
@@ -33,7 +33,8 @@
/*
* Prototypes for functions in io_util_md.c called from io_util.c,
- * FileDescriptor.c, FileInputStream.c, FileOutputStream.c
+ * FileDescriptor.c, FileInputStream.c, FileOutputStream.c,
+ * ProcessImpl_md.c
*/
WCHAR* pathToNTPath(JNIEnv *env, jstring path, jboolean throwFNFE);
WCHAR* fileToNTPath(JNIEnv *env, jobject file, jfieldID id);
diff --git a/jdk/src/java.base/windows/native/libjli/java_md.c b/jdk/src/java.base/windows/native/libjli/java_md.c
index 81b1c263821..2bf50ea7fc3 100644
--- a/jdk/src/java.base/windows/native/libjli/java_md.c
+++ b/jdk/src/java.base/windows/native/libjli/java_md.c
@@ -265,26 +265,17 @@ LoadMSVCRT()
* assumed to be present in the "JRE path" directory. If it is not found
* there (or "JRE path" fails to resolve), skip the explicit load and let
* nature take its course, which is likely to be a failure to execute.
- * This is clearly completely specific to the exact compiler version
- * which isn't very nice, but its hardly the only place.
- * No attempt to look for compiler versions in between 2003 and 2010
- * as we aren't supporting building with those.
+ * The makefiles will provide the correct lib contained in quotes in the
+ * macro MSVCR_DLL_NAME.
*/
-#ifdef _MSC_VER
-#if _MSC_VER < 1400
-#define CRT_DLL "msvcr71.dll"
-#endif
-#if _MSC_VER >= 1600
-#define CRT_DLL "msvcr100.dll"
-#endif
-#ifdef CRT_DLL
+#ifdef MSVCR_DLL_NAME
if (GetJREPath(crtpath, MAXPATHLEN)) {
if (JLI_StrLen(crtpath) + JLI_StrLen("\\bin\\") +
- JLI_StrLen(CRT_DLL) >= MAXPATHLEN) {
+ JLI_StrLen(MSVCR_DLL_NAME) >= MAXPATHLEN) {
JLI_ReportErrorMessage(JRE_ERROR11);
return JNI_FALSE;
}
- (void)JLI_StrCat(crtpath, "\\bin\\" CRT_DLL); /* Add crt dll */
+ (void)JLI_StrCat(crtpath, "\\bin\\" MSVCR_DLL_NAME); /* Add crt dll */
JLI_TraceLauncher("CRT path is %s\n", crtpath);
if (_access(crtpath, 0) == 0) {
if (LoadLibrary(crtpath) == 0) {
@@ -293,8 +284,24 @@ LoadMSVCRT()
}
}
}
-#endif /* CRT_DLL */
-#endif /* _MSC_VER */
+#endif /* MSVCR_DLL_NAME */
+#ifdef MSVCP_DLL_NAME
+ if (GetJREPath(crtpath, MAXPATHLEN)) {
+ if (JLI_StrLen(crtpath) + JLI_StrLen("\\bin\\") +
+ JLI_StrLen(MSVCP_DLL_NAME) >= MAXPATHLEN) {
+ JLI_ReportErrorMessage(JRE_ERROR11);
+ return JNI_FALSE;
+ }
+ (void)JLI_StrCat(crtpath, "\\bin\\" MSVCP_DLL_NAME); /* Add prt dll */
+ JLI_TraceLauncher("PRT path is %s\n", crtpath);
+ if (_access(crtpath, 0) == 0) {
+ if (LoadLibrary(crtpath) == 0) {
+ JLI_ReportErrorMessage(DLL_ERROR4, crtpath);
+ return JNI_FALSE;
+ }
+ }
+ }
+#endif /* MSVCP_DLL_NAME */
loaded = 1;
}
return JNI_TRUE;
diff --git a/jdk/src/java.desktop/macosx/classes/sun/datatransfer/resources/flavormap.properties b/jdk/src/java.datatransfer/macosx/classes/sun/datatransfer/resources/flavormap.properties
similarity index 100%
rename from jdk/src/java.desktop/macosx/classes/sun/datatransfer/resources/flavormap.properties
rename to jdk/src/java.datatransfer/macosx/classes/sun/datatransfer/resources/flavormap.properties
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/Clipboard.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/Clipboard.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Clipboard.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/ClipboardOwner.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/ClipboardOwner.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/ClipboardOwner.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/DataFlavor.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
similarity index 99%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/DataFlavor.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
index 7d215445447..69c0cbc474d 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/DataFlavor.java
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/DataFlavor.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 2015, 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
@@ -46,8 +46,6 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.Objects;
-import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION;
-
/**
* A {@code DataFlavor} provides meta information about data. {@code DataFlavor}
* is typically used to access data on the clipboard, or during
@@ -137,7 +135,7 @@ public class DataFlavor implements Externalizable, Cloneable {
try {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
- sm.checkPermission(GET_CLASSLOADER_PERMISSION);
+ sm.checkPermission(new RuntimePermission("getClassLoader"));
}
ClassLoader loader = ClassLoader.getSystemClassLoader();
try {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorEvent.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorEvent.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorEvent.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorEvent.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorListener.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorListener.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorListener.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorListener.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorMap.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorMap.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorMap.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorMap.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorTable.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorTable.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/FlavorTable.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/FlavorTable.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeType.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeType.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeType.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeType.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParameterList.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeTypeParameterList.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParameterList.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeTypeParameterList.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParseException.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeTypeParseException.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/MimeTypeParseException.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/MimeTypeParseException.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/StringSelection.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/StringSelection.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/StringSelection.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/SystemFlavorMap.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java
similarity index 99%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/SystemFlavorMap.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java
index 3dc096d235a..e6462146274 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/SystemFlavorMap.java
+++ b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/SystemFlavorMap.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -215,7 +215,7 @@ public final class SystemFlavorMap implements FlavorMap, FlavorTable {
line = line.substring(0, line.length() - 1) + reader.readLine().trim();
}
int delimiterPosition = line.indexOf('=');
- String key = line.substring(0, delimiterPosition).replaceAll("\\ ", " ");
+ String key = line.substring(0, delimiterPosition).replace("\\ ", " ");
String[] values = line.substring(delimiterPosition + 1, line.length()).split(",");
for (String value : values) {
try {
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/Transferable.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/Transferable.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/Transferable.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/UnsupportedFlavorException.java
diff --git a/jdk/src/java.desktop/share/classes/java/awt/datatransfer/package.html b/jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package.html
similarity index 100%
rename from jdk/src/java.desktop/share/classes/java/awt/datatransfer/package.html
rename to jdk/src/java.datatransfer/share/classes/java/awt/datatransfer/package.html
diff --git a/jdk/src/java.desktop/share/classes/sun/datatransfer/DataFlavorUtil.java b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/sun/datatransfer/DataFlavorUtil.java
rename to jdk/src/java.datatransfer/share/classes/sun/datatransfer/DataFlavorUtil.java
diff --git a/jdk/src/java.desktop/share/classes/sun/datatransfer/DesktopDatatransferService.java b/jdk/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java
similarity index 100%
rename from jdk/src/java.desktop/share/classes/sun/datatransfer/DesktopDatatransferService.java
rename to jdk/src/java.datatransfer/share/classes/sun/datatransfer/DesktopDatatransferService.java
diff --git a/jdk/src/java.desktop/unix/classes/sun/datatransfer/resources/flavormap.properties b/jdk/src/java.datatransfer/unix/classes/sun/datatransfer/resources/flavormap.properties
similarity index 100%
rename from jdk/src/java.desktop/unix/classes/sun/datatransfer/resources/flavormap.properties
rename to jdk/src/java.datatransfer/unix/classes/sun/datatransfer/resources/flavormap.properties
diff --git a/jdk/src/java.desktop/windows/classes/sun/datatransfer/resources/flavormap.properties b/jdk/src/java.datatransfer/windows/classes/sun/datatransfer/resources/flavormap.properties
similarity index 100%
rename from jdk/src/java.desktop/windows/classes/sun/datatransfer/resources/flavormap.properties
rename to jdk/src/java.datatransfer/windows/classes/sun/datatransfer/resources/flavormap.properties
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java
index e9eda68094c..f9e099fd4d4 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaBorder.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -68,8 +68,9 @@ public abstract class AquaBorder implements Border, UIResource {
painter.state.set(size);
}
+ @Override
public Insets getBorderInsets(final Component c) {
- return sizeVariant.margins;
+ return (Insets) sizeVariant.margins.clone();
}
protected AquaBorder deriveBorderForSize(final Size size) {
@@ -130,8 +131,10 @@ public abstract class AquaBorder implements Border, UIResource {
return (focusable != null && focusable instanceof JComponent && ((JComponent)focusable).hasFocus());
}
+ @Override
public boolean isBorderOpaque() { return false; }
+ @Override
public void paintBorder(final Component c, final Graphics g, final int x, final int y, final int w, final int h) {
painter.paint(g, c, x, y, w, h);
}
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java
index 73d19025f53..131cc8c3f3e 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaComboBoxUI.java
@@ -275,7 +275,7 @@ public class AquaComboBoxUI extends BasicComboBoxUI implements Sizeable {
actionMap.put("aquaSelectNext", highlightNextAction);
actionMap.put("aquaSelectPrevious", highlightPreviousAction);
- actionMap.put("aquaEnterPressed", triggerSelectionAction);
+ actionMap.put("enterPressed", triggerSelectionAction);
actionMap.put("aquaSpacePressed", toggleSelectionAction);
actionMap.put("aquaSelectHome", highlightFirstAction);
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java
index 9a7ae4059cd..91e1e4e8c39 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaFileChooserUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -1098,8 +1098,15 @@ public class AquaFileChooserUI extends FileChooserUI {
super(f);
}
- public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
- super.getTableCellRendererComponent(list, value, isSelected, false, index, col); // No focus border, thanks
+ public Component getTableCellRendererComponent(final JTable list,
+ final Object value,
+ final boolean isSelected,
+ final boolean cellHasFocus,
+ final int index,
+ final int col) {
+ super.getTableCellRendererComponent(list, value, isSelected, false,
+ index,
+ col); // No focus border, thanks
final File file = (File)value;
final JFileChooser fc = getFileChooser();
setText(fc.getName(file));
@@ -1115,8 +1122,14 @@ public class AquaFileChooserUI extends FileChooserUI {
super(f);
}
- public Component getTableCellRendererComponent(final JTable list, final Object value, final boolean isSelected, final boolean cellHasFocus, final int index, final int col) {
- super.getTableCellRendererComponent(list, value, isSelected, false, index, col);
+ public Component getTableCellRendererComponent(final JTable list,
+ final Object value,
+ final boolean isSelected,
+ final boolean cellHasFocus,
+ final int index,
+ final int col) {
+ super.getTableCellRendererComponent(list, value, isSelected, false,
+ index, col);
final File file = (File)fFileList.getValueAt(index, 0);
setEnabled(isSelectableInList(file));
final DateFormat formatter = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.SHORT);
@@ -1132,14 +1145,17 @@ public class AquaFileChooserUI extends FileChooserUI {
}
}
+ @Override
public Dimension getPreferredSize(final JComponent c) {
- return PREF_SIZE;
+ return new Dimension(PREF_WIDTH, PREF_HEIGHT);
}
+ @Override
public Dimension getMinimumSize(final JComponent c) {
- return MIN_SIZE;
+ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
}
+ @Override
public Dimension getMaximumSize(final JComponent c) {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
@@ -1819,12 +1835,8 @@ public class AquaFileChooserUI extends FileChooserUI {
private static final int PREF_WIDTH = 550;
private static final int PREF_HEIGHT = 400;
- private static final Dimension PREF_SIZE = new Dimension(PREF_WIDTH, PREF_HEIGHT);
-
private static final int MIN_WIDTH = 400;
private static final int MIN_HEIGHT = 250;
- private static final Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
-
private static final int LIST_MIN_WIDTH = 400;
private static final int LIST_MIN_HEIGHT = 100;
private static final Dimension LIST_MIN_SIZE = new Dimension(LIST_MIN_WIDTH, LIST_MIN_HEIGHT);
diff --git a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
index 1b83b300027..83a6182ea03 100644
--- a/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
+++ b/jdk/src/java.desktop/macosx/classes/com/apple/laf/AquaKeyBindings.java
@@ -214,7 +214,7 @@ public class AquaKeyBindings {
"PAGE_DOWN", "aquaSelectPageDown",
"HOME", "aquaSelectHome",
"END", "aquaSelectEnd",
- "ENTER", "aquaEnterPressed",
+ "ENTER", "enterPressed",
"UP", "aquaSelectPrevious",
"KP_UP", "aquaSelectPrevious",
"DOWN", "aquaSelectNext",
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java b/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java
index 0173bfc9d23..c88e53c0663 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CFont.java
@@ -77,14 +77,72 @@ public final class CFont extends PhysicalFont {
}
private static native long createNativeFont(final String nativeFontName,
- final int style,
- final boolean isFakeItalic);
+ final int style);
private static native void disposeNativeFont(final long nativeFontPtr);
private boolean isFakeItalic;
private String nativeFontName;
private long nativeFontPtr;
+ private native float getWidthNative(final long nativeFontPtr);
+ private native float getWeightNative(final long nativeFontPtr);
+
+ private int fontWidth = -1;
+ private int fontWeight = -1;
+
+ @Override
+ public int getWidth() {
+ if (fontWidth == -1) {
+ // Apple use a range of -1 -> +1, where 0.0 is normal
+ // OpenType uses a % range from 50% -> 200% where 100% is normal
+ // and maps these onto the integer values 1->9.
+ // Since that is what Font2D.getWidth() expects, remap to that.
+ float fw = getWidthNative(getNativeFontPtr());
+ if (fw == 0.0) { // short cut the common case
+ fontWidth = Font2D.FWIDTH_NORMAL;
+ return fontWidth;
+ }
+ fw += 1.0; fw *= 100.0;
+ if (fw <= 50.0) {
+ fontWidth = 1;
+ } else if (fw <= 62.5) {
+ fontWidth = 2;
+ } else if (fw <= 75.0) {
+ fontWidth = 3;
+ } else if (fw <= 87.5) {
+ fontWidth = 4;
+ } else if (fw <= 100.0) {
+ fontWidth = 5;
+ } else if (fw <= 112.5) {
+ fontWidth = 6;
+ } else if (fw <= 125.0) {
+ fontWidth = 7;
+ } else if (fw <= 150.0) {
+ fontWidth = 8;
+ } else {
+ fontWidth = 9;
+ }
+ }
+ return fontWidth;
+ }
+
+ @Override
+ public int getWeight() {
+ if (fontWeight == -1) {
+ // Apple use a range of -1 -> +1, where 0 is medium/regular
+ // Map this on to the OpenType range of 100->900 where
+ // 500 is medium/regular.
+ // We'll actually map to 0->1000 but that's close enough.
+ float fw = getWeightNative(getNativeFontPtr());
+ if (fw == 0) {
+ return Font2D.FWEIGHT_NORMAL;
+ }
+ fw += 1.0; fw *= 500;
+ fontWeight = (int)fw;
+ }
+ return fontWeight;
+ }
+
// this constructor is called from CFontWrapper.m
public CFont(String name) {
this(name, name);
@@ -94,10 +152,11 @@ public final class CFont extends PhysicalFont {
handle = new Font2DHandle(this);
fullName = name;
familyName = inFamilyName;
- nativeFontName = inFamilyName;
+ nativeFontName = fullName;
setStyle();
}
+ /* Called from CFontManager too */
public CFont(CFont other, String logicalFamilyName) {
handle = new Font2DHandle(this);
fullName = logicalFamilyName;
@@ -109,6 +168,7 @@ public final class CFont extends PhysicalFont {
public CFont createItalicVariant() {
CFont font = new CFont(this, familyName);
+ font.nativeFontName = fullName;
font.fullName =
fullName + (style == Font.BOLD ? "" : "-") + "Italic-Derived";
font.style |= Font.ITALIC;
@@ -118,7 +178,7 @@ public final class CFont extends PhysicalFont {
protected synchronized long getNativeFontPtr() {
if (nativeFontPtr == 0L) {
- nativeFontPtr = createNativeFont(nativeFontName, style, isFakeItalic);
+ nativeFontPtr = createNativeFont(nativeFontName, style);
}
return nativeFontPtr;
}
diff --git a/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java b/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java
index 28c59712fe7..e37e9e449ea 100644
--- a/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java
+++ b/jdk/src/java.desktop/macosx/classes/sun/font/CFontManager.java
@@ -252,13 +252,42 @@ public final class CFontManager extends SunFontManager {
final CFont font = new CFont(fontName, fontFamilyName);
registerGenericFont(font);
+ }
- if ((font.getStyle() & Font.ITALIC) == 0) {
- registerGenericFont(font.createItalicVariant(), true);
+ void registerItalicDerived() {
+ FontFamily[] famArr = FontFamily.getAllFontFamilies();
+ for (int i=0; i() {
public Object run() {
- loadNativeFonts();
+ if (!loadedAllFonts) {
+ loadNativeFonts();
+ registerItalicDerived();
+ loadedAllFonts = true;
+ }
return null;
}
}
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
index a59ff1a51ae..34b997988b4 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/awt/AWTView.m
@@ -890,9 +890,9 @@ JNF_CLASS_CACHE(jc_CInputMethod, "sun/lwawt/macosx/CInputMethod");
// text, or 'text in progress'. We also need to send the event if we get an insert text out of the blue!
// (i.e., when the user uses the Character palette or Inkwell), or when the string to insert is a complex
// Unicode value.
- NSUInteger utf8Length = [aString lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
+ NSUInteger utf16Length = [aString lengthOfBytesUsingEncoding:NSUTF16StringEncoding];
- if ([self hasMarkedText] || !fProcessingKeystroke || (utf8Length > 1)) {
+ if ([self hasMarkedText] || !fProcessingKeystroke || (utf16Length > 2)) {
JNIEnv *env = [ThreadUtilities getJNIEnv];
static JNF_MEMBER_CACHE(jm_selectPreviousGlyph, jc_CInputMethod, "selectPreviousGlyph", "()V");
diff --git a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m
index 0adeff0de06..bfb90ec6a59 100644
--- a/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m
+++ b/jdk/src/java.desktop/macosx/native/libawt_lwawt/font/AWTFont.m
@@ -35,15 +35,11 @@
#import "AWTStrike.h"
#import "CoreTextSupport.h"
-
-#define DEBUG
-
@implementation AWTFont
-- (id) initWithFont:(NSFont *)font isFakeItalic:(BOOL)isFakeItalic {
+- (id) initWithFont:(NSFont *)font {
self = [super init];
if (self) {
- fIsFakeItalic = isFakeItalic;
fFont = [font retain];
fNativeCGFont = CTFontCopyGraphicsFont((CTFontRef)font, NULL);
}
@@ -72,7 +68,6 @@
+ (AWTFont *) awtFontForName:(NSString *)name
style:(int)style
- isFakeItalic:(BOOL)isFakeItalic
{
// create font with family & size
NSFont *nsFont = [NSFont fontWithName:name size:1.0];
@@ -95,7 +90,7 @@
nsFont = [[NSFontManager sharedFontManager] convertFont:nsFont toHaveTrait:NSBoldFontMask];
}
- return [[[AWTFont alloc] initWithFont:nsFont isFakeItalic:isFakeItalic] autorelease];
+ return [[[AWTFont alloc] initWithFont:nsFont] autorelease];
}
+ (NSFont *) nsFontForJavaFont:(jobject)javaFont env:(JNIEnv *)env {
@@ -354,7 +349,7 @@ JNF_COCOA_EXIT(env);
JNIEXPORT jlong JNICALL
Java_sun_font_CFont_createNativeFont
(JNIEnv *env, jclass clazz,
- jstring nativeFontName, jint style, jboolean isFakeItalic)
+ jstring nativeFontName, jint style)
{
AWTFont *awtFont = nil;
@@ -362,8 +357,7 @@ JNF_COCOA_ENTER(env);
awtFont =
[AWTFont awtFontForName:JNFJavaToNSString(env, nativeFontName)
- style:style
- isFakeItalic:isFakeItalic]; // autoreleased
+ style:style]; // autoreleased
if (awtFont) {
CFRetain(awtFont); // GC
@@ -374,6 +368,52 @@ JNF_COCOA_EXIT(env);
return ptr_to_jlong(awtFont);
}
+/*
+ * Class: sun_font_CFont
+ * Method: getWidthNative
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL
+Java_sun_font_CFont_getWidthNative
+ (JNIEnv *env, jobject cfont, jlong awtFontPtr)
+{
+ float widthVal;
+JNF_COCOA_ENTER(env);
+
+ AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
+ NSFont* nsFont = awtFont->fFont;
+ NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
+ NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
+ NSNumber *width = [fontTraits objectForKey : NSFontWidthTrait];
+ widthVal = (float)[width floatValue];
+
+JNF_COCOA_EXIT(env);
+ return (jfloat)widthVal;
+}
+
+/*
+ * Class: sun_font_CFont
+ * Method: getWeightNative
+ * Signature: (J)F
+ */
+JNIEXPORT jfloat JNICALL
+Java_sun_font_CFont_getWeightNative
+ (JNIEnv *env, jobject cfont, jlong awtFontPtr)
+{
+ float weightVal;
+JNF_COCOA_ENTER(env);
+
+ AWTFont *awtFont = (AWTFont *)jlong_to_ptr(awtFontPtr);
+ NSFont* nsFont = awtFont->fFont;
+ NSFontDescriptor *fontDescriptor = nsFont.fontDescriptor;
+ NSDictionary *fontTraits = [fontDescriptor objectForKey : NSFontTraitsAttribute];
+ NSNumber *weight = [fontTraits objectForKey : NSFontWeightTrait];
+ weightVal = (float)[weight floatValue];
+
+JNF_COCOA_EXIT(env);
+ return (jfloat)weightVal;
+}
+
/*
* Class: sun_font_CFont
* Method: disposeNativeFont
diff --git a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
index 477e6738b5f..0daa7d38b79 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/imageio/plugins/jpeg/JPEGImageWriter.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -43,8 +43,6 @@ import org.w3c.dom.Node;
import java.awt.image.Raster;
import java.awt.image.WritableRaster;
-import java.awt.image.SampleModel;
-import java.awt.image.DataBuffer;
import java.awt.image.DataBufferByte;
import java.awt.image.ColorModel;
import java.awt.image.IndexColorModel;
@@ -1048,7 +1046,13 @@ public class JPEGImageWriter extends ImageWriter {
// Call the writer, who will call back for every scanline
- processImageStarted(currentImage);
+ clearAbortRequest();
+ cbLock.lock();
+ try {
+ processImageStarted(currentImage);
+ } finally {
+ cbLock.unlock();
+ }
boolean aborted = false;
@@ -1225,6 +1229,23 @@ public class JPEGImageWriter extends ImageWriter {
}
}
+ @Override
+ protected synchronized void clearAbortRequest() {
+ setThreadLock();
+ try {
+ cbLock.check();
+ if (abortRequested()) {
+ super.clearAbortRequest();
+ // reset C structures
+ resetWriter(structPointer);
+ // reset the native destination
+ setDest(structPointer);
+ }
+ } finally {
+ clearThreadLock();
+ }
+ }
+
private void resetInternalState() {
// reset C structures
resetWriter(structPointer);
@@ -1652,7 +1673,7 @@ public class JPEGImageWriter extends ImageWriter {
int vsamp0 = specs[0].VsamplingFactor;
for (int i = 1; i < specs.length; i++) {
if ((specs[i].HsamplingFactor != hsamp0) ||
- (specs[i].HsamplingFactor != hsamp0))
+ (specs[i].VsamplingFactor != vsamp0))
return true;
}
return false;
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
index bcca1ad6784..8f9f261f07b 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java
@@ -100,7 +100,8 @@ class GTKFileChooserUI extends SynthFileChooserUI {
private static Dimension prefListSize = new Dimension(75, 150);
private static Dimension PREF_SIZE = new Dimension(435, 360);
- private static Dimension MIN_SIZE = new Dimension(200, 300);
+ private static final int MIN_WIDTH = 200;
+ private static final int MIN_HEIGHT = 300;
private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
@@ -1052,6 +1053,7 @@ class GTKFileChooserUI extends SynthFileChooserUI {
}
}
+ @Override
public Dimension getPreferredSize(JComponent c) {
Dimension prefSize = new Dimension(PREF_SIZE);
JComponent accessory = getFileChooser().getAccessory();
@@ -1067,10 +1069,12 @@ class GTKFileChooserUI extends SynthFileChooserUI {
}
}
- public Dimension getMinimumSize(JComponent x) {
- return new Dimension(MIN_SIZE);
+ @Override
+ public Dimension getMinimumSize(JComponent x) {
+ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
}
+ @Override
public Dimension getMaximumSize(JComponent x) {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java
index 4980b88f2d9..d00a6ec6767 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifFileChooserUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -65,8 +65,8 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
private static Dimension WITH_ACCELERATOR_PREF_SIZE = new Dimension(650, 450);
private static Dimension PREF_SIZE = new Dimension(350, 450);
- private static Dimension MIN_SIZE = new Dimension(200, 300);
-
+ private static final int MIN_WIDTH = 200;
+ private static final int MIN_HEIGHT = 300;
private static Dimension PREF_ACC_SIZE = new Dimension(10, 10);
private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
@@ -628,6 +628,7 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
return scrollpane;
}
+ @Override
public Dimension getPreferredSize(JComponent c) {
Dimension prefSize =
(getFileChooser().getAccessory() != null) ? WITH_ACCELERATOR_PREF_SIZE : PREF_SIZE;
@@ -640,10 +641,12 @@ public class MotifFileChooserUI extends BasicFileChooserUI {
}
}
- public Dimension getMinimumSize(JComponent x) {
- return MIN_SIZE;
+ @Override
+ public Dimension getMinimumSize(JComponent x) {
+ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
}
+ @Override
public Dimension getMaximumSize(JComponent x) {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
diff --git a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
index c5031732149..8e2e1489580 100644
--- a/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
+++ b/jdk/src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/WindowsFileChooserUI.java
@@ -93,7 +93,6 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
private static int MIN_WIDTH = 425;
private static int MIN_HEIGHT = 245;
- private static Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
private static int LIST_PREF_WIDTH = 444;
private static int LIST_PREF_HEIGHT = 138;
@@ -642,6 +641,7 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
* @return a Dimension
specifying the preferred
* width and height of the file chooser
*/
+ @Override
public Dimension getPreferredSize(JComponent c) {
int prefWidth = PREF_SIZE.width;
Dimension d = c.getLayout().preferredLayoutSize(c);
@@ -660,8 +660,9 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
* @return a Dimension
specifying the minimum
* width and height of the file chooser
*/
+ @Override
public Dimension getMinimumSize(JComponent c) {
- return MIN_SIZE;
+ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
}
/**
@@ -671,6 +672,7 @@ public class WindowsFileChooserUI extends BasicFileChooserUI {
* @return a Dimension
specifying the maximum
* width and height of the file chooser
*/
+ @Override
public Dimension getMaximumSize(JComponent c) {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Component.java b/jdk/src/java.desktop/share/classes/java/awt/Component.java
index 42288ce216f..a5e8dfee50c 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Component.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Component.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -1690,15 +1690,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
/* do nothing */
}
- /*
- * Delete references from LightweightDispatcher of a heavyweight parent
- */
- void clearLightweightDispatcherOnRemove(Component removedComponent) {
- if (parent != null) {
- parent.clearLightweightDispatcherOnRemove(removedComponent);
- }
- }
-
/**
* @deprecated As of JDK version 1.1,
* replaced by setVisible(boolean)
.
@@ -6242,7 +6233,7 @@ public abstract class Component implements ImageObserver, MenuContainer,
/**
* Indicates whether a class or its superclasses override coalesceEvents.
* Must be called with lock on coalesceMap and privileged.
- * @see checkCoalsecing
+ * @see checkCoalescing
*/
private static boolean isCoalesceEventsOverriden(Class> clazz) {
assert Thread.holdsLock(coalesceMap);
@@ -7083,8 +7074,6 @@ public abstract class Component implements ImageObserver, MenuContainer,
}
synchronized (getTreeLock()) {
- clearLightweightDispatcherOnRemove(this);
-
if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
transferFocus(true);
}
diff --git a/jdk/src/java.desktop/share/classes/java/awt/Container.java b/jdk/src/java.desktop/share/classes/java/awt/Container.java
index 9bef89ca095..86607534163 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/Container.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/Container.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -41,6 +41,7 @@ import java.io.ObjectStreamField;
import java.io.PrintStream;
import java.io.PrintWriter;
+import java.lang.ref.WeakReference;
import java.security.AccessController;
import java.util.EventListener;
@@ -3321,16 +3322,6 @@ public class Container extends Component {
}
}
- @Override
- void clearLightweightDispatcherOnRemove(Component removedComponent) {
- if (dispatcher != null) {
- dispatcher.removeReferences(removedComponent);
- } else {
- //It is a Lightweight Container, should clear parent`s Dispatcher
- super.clearLightweightDispatcherOnRemove(removedComponent);
- }
- }
-
final Container getTraversalRoot() {
if (isFocusCycleRoot()) {
return findTraversalRoot();
@@ -4431,7 +4422,9 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
LightweightDispatcher(Container nativeContainer) {
this.nativeContainer = nativeContainer;
- mouseEventTarget = null;
+ mouseEventTarget = new WeakReference<>(null);
+ targetLastEntered = new WeakReference<>(null);
+ targetLastEnteredDT = new WeakReference<>(null);
eventMask = 0;
}
@@ -4442,9 +4435,9 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
void dispose() {
//System.out.println("Disposing lw dispatcher");
stopListeningForOtherDrags();
- mouseEventTarget = null;
- targetLastEntered = null;
- targetLastEnteredDT = null;
+ mouseEventTarget.clear();
+ targetLastEntered.clear();
+ targetLastEnteredDT.clear();
}
/**
@@ -4531,65 +4524,62 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
trackMouseEnterExit(mouseOver, e);
- // 4508327 : MOUSE_CLICKED should only go to the recipient of
- // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
- // MOUSE_CLICKED.
- if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
- mouseEventTarget = (mouseOver != nativeContainer) ? mouseOver: null;
- isCleaned = false;
+ Component met = mouseEventTarget.get();
+ // 4508327 : MOUSE_CLICKED should only go to the recipient of
+ // the accompanying MOUSE_PRESSED, so don't reset mouseEventTarget on a
+ // MOUSE_CLICKED.
+ if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
+ met = (mouseOver != nativeContainer) ? mouseOver : null;
+ mouseEventTarget = new WeakReference<>(met);
}
- if (mouseEventTarget != null) {
+ if (met != null) {
switch (id) {
- case MouseEvent.MOUSE_ENTERED:
- case MouseEvent.MOUSE_EXITED:
- break;
- case MouseEvent.MOUSE_PRESSED:
- retargetMouseEvent(mouseEventTarget, id, e);
- break;
- case MouseEvent.MOUSE_RELEASED:
- retargetMouseEvent(mouseEventTarget, id, e);
- break;
- case MouseEvent.MOUSE_CLICKED:
- // 4508327: MOUSE_CLICKED should never be dispatched to a Component
- // other than that which received the MOUSE_PRESSED event. If the
- // mouse is now over a different Component, don't dispatch the event.
- // The previous fix for a similar problem was associated with bug
- // 4155217.
- if (mouseOver == mouseEventTarget) {
- retargetMouseEvent(mouseOver, id, e);
- }
- break;
- case MouseEvent.MOUSE_MOVED:
- retargetMouseEvent(mouseEventTarget, id, e);
- break;
- case MouseEvent.MOUSE_DRAGGED:
- if (isMouseGrab(e)) {
- retargetMouseEvent(mouseEventTarget, id, e);
- }
- break;
- case MouseEvent.MOUSE_WHEEL:
- // This may send it somewhere that doesn't have MouseWheelEvents
- // enabled. In this case, Component.dispatchEventImpl() will
- // retarget the event to a parent that DOES have the events enabled.
- if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
- eventLog.finest("retargeting mouse wheel to " +
+ case MouseEvent.MOUSE_ENTERED:
+ case MouseEvent.MOUSE_EXITED:
+ break;
+ case MouseEvent.MOUSE_PRESSED:
+ retargetMouseEvent(met, id, e);
+ break;
+ case MouseEvent.MOUSE_RELEASED:
+ retargetMouseEvent(met, id, e);
+ break;
+ case MouseEvent.MOUSE_CLICKED:
+ // 4508327: MOUSE_CLICKED should never be dispatched to a Component
+ // other than that which received the MOUSE_PRESSED event. If the
+ // mouse is now over a different Component, don't dispatch the event.
+ // The previous fix for a similar problem was associated with bug
+ // 4155217.
+ if (mouseOver == met) {
+ retargetMouseEvent(mouseOver, id, e);
+ }
+ break;
+ case MouseEvent.MOUSE_MOVED:
+ retargetMouseEvent(met, id, e);
+ break;
+ case MouseEvent.MOUSE_DRAGGED:
+ if (isMouseGrab(e)) {
+ retargetMouseEvent(met, id, e);
+ }
+ break;
+ case MouseEvent.MOUSE_WHEEL:
+ // This may send it somewhere that doesn't have MouseWheelEvents
+ // enabled. In this case, Component.dispatchEventImpl() will
+ // retarget the event to a parent that DOES have the events enabled.
+ if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
+ eventLog.finest("retargeting mouse wheel to " +
mouseOver.getName() + ", " +
mouseOver.getClass());
+ }
+ retargetMouseEvent(mouseOver, id, e);
+ break;
}
- retargetMouseEvent(mouseOver, id, e);
- break;
+ //Consuming of wheel events is implemented in "retargetMouseEvent".
+ if (id != MouseEvent.MOUSE_WHEEL) {
+ e.consume();
}
- //Consuming of wheel events is implemented in "retargetMouseEvent".
- if (id != MouseEvent.MOUSE_WHEEL) {
- e.consume();
}
- } else if (isCleaned && id != MouseEvent.MOUSE_WHEEL) {
- //After mouseEventTarget was removed and cleaned should consume all events
- //until new mouseEventTarget is found
- e.consume();
- }
- return e.isConsumed();
+ return e.isConsumed();
}
private boolean processDropTargetEvent(SunDropTargetEvent e) {
@@ -4646,15 +4636,16 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
// drag has an associated drop target. MOUSE_ENTERED comes when the
// mouse is in the native container already. To propagate this event
// properly we should null out targetLastEntered.
- targetLastEnteredDT = null;
+ targetLastEnteredDT.clear();
} else if (id == MouseEvent.MOUSE_ENTERED) {
isMouseDTInNativeContainer = true;
} else if (id == MouseEvent.MOUSE_EXITED) {
isMouseDTInNativeContainer = false;
}
- targetLastEnteredDT = retargetMouseEnterExit(targetOver, e,
- targetLastEnteredDT,
+ Component tle = retargetMouseEnterExit(targetOver, e,
+ targetLastEnteredDT.get(),
isMouseDTInNativeContainer);
+ targetLastEnteredDT = new WeakReference<>(tle);
}
/*
@@ -4680,9 +4671,10 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
isMouseInNativeContainer = false;
stopListeningForOtherDrags();
}
- targetLastEntered = retargetMouseEnterExit(targetOver, e,
- targetLastEntered,
+ Component tle = retargetMouseEnterExit(targetOver, e,
+ targetLastEntered.get(),
isMouseInNativeContainer);
+ targetLastEntered = new WeakReference<>(tle);
}
private Component retargetMouseEnterExit(Component targetOver, MouseEvent e,
@@ -4944,22 +4936,17 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
* is null, there are currently no events being forwarded to
* a subcomponent.
*/
- private transient Component mouseEventTarget;
+ private transient WeakReference mouseEventTarget;
/**
* The last component entered by the {@code MouseEvent}.
*/
- private transient Component targetLastEntered;
+ private transient WeakReference targetLastEntered;
/**
* The last component entered by the {@code SunDropTargetEvent}.
*/
- private transient Component targetLastEnteredDT;
-
- /**
- * Indicates whether {@code mouseEventTarget} was removed and nulled
- */
- private transient boolean isCleaned;
+ private transient WeakReference targetLastEnteredDT;
/**
* Is the mouse over the native container.
@@ -5000,17 +4987,4 @@ class LightweightDispatcher implements java.io.Serializable, AWTEventListener {
AWTEvent.MOUSE_EVENT_MASK |
AWTEvent.MOUSE_MOTION_EVENT_MASK |
AWTEvent.MOUSE_WHEEL_EVENT_MASK;
-
- void removeReferences(Component removedComponent) {
- if (mouseEventTarget == removedComponent) {
- isCleaned = true;
- mouseEventTarget = null;
- }
- if (targetLastEntered == removedComponent) {
- targetLastEntered = null;
- }
- if (targetLastEnteredDT == removedComponent) {
- targetLastEnteredDT = null;
- }
- }
}
diff --git a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java
index c398db77fdc..620c3c4ece8 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/EventQueue.java
@@ -182,7 +182,14 @@ public class EventQueue {
private FwDispatcher fwDispatcher;
- private static final PlatformLogger eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
+ private static volatile PlatformLogger eventLog;
+
+ private static final PlatformLogger getEventLog() {
+ if(eventLog == null) {
+ eventLog = PlatformLogger.getLogger("java.awt.event.EventQueue");
+ }
+ return eventLog;
+ }
static {
AWTAccessor.setEventQueueAccessor(
@@ -762,8 +769,8 @@ public class EventQueue {
dispatchThread.stopDispatching();
}
} else {
- if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
- eventLog.fine("Unable to dispatch event: " + event);
+ if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+ getEventLog().fine("Unable to dispatch event: " + event);
}
}
}
@@ -860,8 +867,8 @@ public class EventQueue {
* @since 1.2
*/
public void push(EventQueue newEventQueue) {
- if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
- eventLog.fine("EventQueue.push(" + newEventQueue + ")");
+ if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+ getEventLog().fine("EventQueue.push(" + newEventQueue + ")");
}
pushPopLock.lock();
@@ -886,8 +893,8 @@ public class EventQueue {
// Use getNextEventPrivate() as it doesn't call flushPendingEvents()
newEventQueue.postEventPrivate(topQueue.getNextEventPrivate());
} catch (InterruptedException ie) {
- if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
- eventLog.fine("Interrupted push", ie);
+ if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+ getEventLog().fine("Interrupted push", ie);
}
}
}
@@ -925,8 +932,8 @@ public class EventQueue {
* @since 1.2
*/
protected void pop() throws EmptyStackException {
- if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
- eventLog.fine("EventQueue.pop(" + this + ")");
+ if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+ getEventLog().fine("EventQueue.pop(" + this + ")");
}
pushPopLock.lock();
@@ -948,8 +955,8 @@ public class EventQueue {
try {
prevQueue.postEventPrivate(topQueue.getNextEventPrivate());
} catch (InterruptedException ie) {
- if (eventLog.isLoggable(PlatformLogger.Level.FINE)) {
- eventLog.fine("Interrupted pop", ie);
+ if (getEventLog().isLoggable(PlatformLogger.Level.FINE)) {
+ getEventLog().fine("Interrupted pop", ie);
}
}
}
diff --git a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
index 4fa4723c417..482a1c740f2 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/MenuBar.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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,7 +181,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible
* removed from the menu bar, and replaced with the specified menu.
* @param m the menu to be set as the help menu
*/
- public void setHelpMenu(Menu m) {
+ public void setHelpMenu(final Menu m) {
synchronized (getTreeLock()) {
if (helpMenu == m) {
return;
@@ -189,11 +189,11 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible
if (helpMenu != null) {
remove(helpMenu);
}
- if (m.parent != this) {
- add(m);
- }
helpMenu = m;
if (m != null) {
+ if (m.parent != this) {
+ add(m);
+ }
m.isHelpMenu = true;
m.parent = this;
MenuBarPeer peer = (MenuBarPeer)this.peer;
@@ -242,7 +242,7 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible
* @param index the position of the menu to be removed.
* @see java.awt.MenuBar#add(java.awt.Menu)
*/
- public void remove(int index) {
+ public void remove(final int index) {
synchronized (getTreeLock()) {
Menu m = getMenu(index);
menus.removeElementAt(index);
@@ -252,6 +252,10 @@ public class MenuBar extends MenuComponent implements MenuContainer, Accessible
m.parent = null;
peer.delMenu(index);
}
+ if (helpMenu == m) {
+ helpMenu = null;
+ m.isHelpMenu = false;
+ }
}
}
diff --git a/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java b/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java
index c73477b5b37..5aeef7c009b 100644
--- a/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java
+++ b/jdk/src/java.desktop/share/classes/java/awt/image/BufferedImage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -25,26 +25,23 @@
package java.awt.image;
-import java.awt.Transparency;
-import java.awt.color.ColorSpace;
import java.awt.Graphics2D;
-import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
-import java.awt.ImageCapabilities;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.Point2D;
import java.awt.Point;
import java.awt.Rectangle;
+import java.awt.Transparency;
+import java.awt.color.ColorSpace;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.Hashtable;
+import java.util.Set;
import java.util.Vector;
-import sun.awt.image.BytePackedRaster;
-import sun.awt.image.ShortComponentRaster;
import sun.awt.image.ByteComponentRaster;
+import sun.awt.image.BytePackedRaster;
import sun.awt.image.IntegerComponentRaster;
import sun.awt.image.OffScreenImageSource;
+import sun.awt.image.ShortComponentRaster;
/**
*
@@ -68,18 +65,14 @@ import sun.awt.image.OffScreenImageSource;
* @see Raster
* @see WritableRaster
*/
-
public class BufferedImage extends java.awt.Image
implements WritableRenderedImage, Transparency
{
- int imageType = TYPE_CUSTOM;
- ColorModel colorModel;
- WritableRaster raster;
- OffScreenImageSource osis;
- Hashtable, ?> properties;
-
- boolean isAlphaPremultiplied;// If true, alpha has been premultiplied in
- // color channels
+ private int imageType = TYPE_CUSTOM;
+ private ColorModel colorModel;
+ private final WritableRaster raster;
+ private OffScreenImageSource osis;
+ private Hashtable properties;
/**
* Image Type Constants
@@ -328,8 +321,8 @@ public class BufferedImage extends java.awt.Image
0x000000ff, // Blue
0x0 // Alpha
);
- raster = colorModel.createCompatibleWritableRaster(width,
- height);
+ raster = colorModel.createCompatibleWritableRaster(width,
+ height);
}
break;
@@ -355,9 +348,8 @@ public class BufferedImage extends java.awt.Image
true, // Alpha Premultiplied
DataBuffer.TYPE_INT
);
-
- raster = colorModel.createCompatibleWritableRaster(width,
- height);
+ raster = colorModel.createCompatibleWritableRaster(width,
+ height);
}
break;
@@ -368,8 +360,8 @@ public class BufferedImage extends java.awt.Image
0x0000ff00, // Green
0x00ff0000 // Blue
);
- raster = colorModel.createCompatibleWritableRaster(width,
- height);
+ raster = colorModel.createCompatibleWritableRaster(width,
+ height);
}
break;
@@ -642,7 +634,14 @@ public class BufferedImage extends java.awt.Image
colorModel = cm;
this.raster = raster;
- this.properties = properties;
+ if (properties != null && !properties.isEmpty()) {
+ this.properties = new Hashtable<>();
+ for (final Object key : properties.keySet()) {
+ if (key instanceof String) {
+ this.properties.put((String) key, properties.get(key));
+ }
+ }
+ }
int numBands = raster.getNumBands();
boolean isAlphaPre = cm.isAlphaPremultiplied();
final boolean isStandard = isStandard(cm, raster);
@@ -1272,7 +1271,11 @@ public class BufferedImage extends java.awt.Image
* or null
if no property names are recognized.
*/
public String[] getPropertyNames() {
- return null;
+ if (properties == null || properties.isEmpty()) {
+ return null;
+ }
+ final Set keys = properties.keySet();
+ return keys.toArray(new String[keys.size()]);
}
/**
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/AbstractButton.java b/jdk/src/java.desktop/share/classes/javax/swing/AbstractButton.java
index 0ef73c831cb..89da3cf30c9 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/AbstractButton.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/AbstractButton.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -2215,10 +2215,7 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl
*/
public boolean imageUpdate(Image img, int infoflags,
int x, int y, int w, int h) {
- Icon iconDisplayed = getIcon();
- if (iconDisplayed == null) {
- return false;
- }
+ Icon iconDisplayed = null;
if (!model.isEnabled()) {
if (model.isSelected()) {
@@ -2238,7 +2235,12 @@ public abstract class AbstractButton extends JComponent implements ItemSelectabl
iconDisplayed = getSelectedIcon();
}
- if (!SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) {
+ if (iconDisplayed == null) {
+ iconDisplayed = getIcon();
+ }
+
+ if (iconDisplayed == null
+ || !SwingUtilities.doesIconReferenceImage(iconDisplayed, img)) {
// We don't know about this image, disable the notification so
// we don't keep repainting.
return false;
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java
index 30763a3ebc2..e7f5a8a4162 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JComponent.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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,22 +27,15 @@ package javax.swing;
import java.util.HashSet;
import java.util.Hashtable;
-import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Locale;
import java.util.Vector;
import java.util.EventListener;
import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
import java.awt.*;
import java.awt.event.*;
-import java.awt.image.VolatileImage;
-import java.awt.Graphics2D;
import java.awt.peer.LightweightPeer;
-import java.awt.dnd.DropTarget;
-import java.awt.font.FontRenderContext;
import java.beans.PropertyChangeListener;
import java.beans.VetoableChangeListener;
import java.beans.VetoableChangeSupport;
@@ -1868,7 +1861,7 @@ public abstract class JComponent extends Container implements Serializable,
/**
* Overrides Container.getAlignmentY
to return
- * the horizontal alignment.
+ * the vertical alignment.
*
* @return the value of the alignmentY
property
* @see #setAlignmentY
@@ -1882,9 +1875,9 @@ public abstract class JComponent extends Container implements Serializable,
}
/**
- * Sets the horizontal alignment.
+ * Sets the vertical alignment.
*
- * @param alignmentY the new horizontal alignment
+ * @param alignmentY the new vertical alignment
* @see #getAlignmentY
* @beaninfo
* description: The preferred vertical alignment of the component.
@@ -1897,7 +1890,7 @@ public abstract class JComponent extends Container implements Serializable,
/**
* Overrides Container.getAlignmentX
to return
- * the vertical alignment.
+ * the horizontal alignment.
*
* @return the value of the alignmentX
property
* @see #setAlignmentX
@@ -1911,9 +1904,9 @@ public abstract class JComponent extends Container implements Serializable,
}
/**
- * Sets the vertical alignment.
+ * Sets the horizontal alignment.
*
- * @param alignmentX the new vertical alignment
+ * @param alignmentX the new horizontal alignment
* @see #getAlignmentX
* @beaninfo
* description: The preferred horizontal alignment of the component.
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java b/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java
index 5be75ff295a..3eedeb0a554 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JFormattedTextField.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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 @@ import java.awt.im.InputContext;
import java.io.*;
import java.text.*;
import java.util.*;
-import javax.swing.UIManager;
import javax.swing.event.*;
import javax.swing.plaf.UIResource;
import javax.swing.text.*;
@@ -151,7 +150,7 @@ import javax.swing.text.*;
* will be created to handle formatting of numbers:
*
* JFormattedTextField tf = new JFormattedTextField();
- * tf.setValue(new Number(100));
+ * tf.setValue(100);
*
*
* Warning: As the AbstractFormatter
will
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JSlider.java b/jdk/src/java.desktop/share/classes/javax/swing/JSlider.java
index 956c57a166c..5475d51ffc4 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JSlider.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JSlider.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -1287,10 +1287,10 @@ public class JSlider extends JComponent implements SwingConstants, Accessible {
return paintTrack;
}
-
/**
- * Determines whether the track is painted on the slider.
- * By default, this property is {@code true}.
+ * Determines whether the track is painted on the slider. By default, this
+ * property is {@code true}. It is up to the look and feel to honor this
+ * property, some may choose to ignore it.
*
* @param b whether or not to paint the slider track
* @see #getPaintTrack
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/JTextArea.java b/jdk/src/java.desktop/share/classes/javax/swing/JTextArea.java
index 96fb6b33e31..48b586e8ca0 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/JTextArea.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/JTextArea.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -493,7 +493,6 @@ public class JTextArea extends JTextComponent {
* @exception IllegalArgumentException if part of the range is an
* invalid position in the model
* @see #insert
- * @see #replaceRange
*/
public void replaceRange(String str, int start, int end) {
if (end < start) {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java
index fe71487bdea..c8a4d9d0a7a 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicDesktopPaneUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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,10 +36,9 @@ import java.awt.Insets;
import java.awt.Graphics;
import java.awt.KeyboardFocusManager;
import java.awt.*;
-import java.util.Vector;
+
import sun.swing.DefaultLookup;
import sun.swing.UIAction;
-import sun.awt.AppContext;
/**
* Basic L&F for a desktop.
@@ -49,9 +48,6 @@ import sun.awt.AppContext;
public class BasicDesktopPaneUI extends DesktopPaneUI {
// Old actions forward to an instance of this.
private static final Actions SHARED_ACTION = new Actions();
- private static Dimension minSize = new Dimension(0,0);
- private static Dimension maxSize = new Dimension(Integer.MAX_VALUE,
- Integer.MAX_VALUE);
private Handler handler;
private PropertyChangeListener pcl;
@@ -304,13 +300,19 @@ public class BasicDesktopPaneUI extends DesktopPaneUI {
public void paint(Graphics g, JComponent c) {}
- public Dimension getPreferredSize(JComponent c) {return null;}
+ @Override
+ public Dimension getPreferredSize(JComponent c) {
+ return null;
+ }
+ @Override
public Dimension getMinimumSize(JComponent c) {
- return minSize;
- }
- public Dimension getMaximumSize(JComponent c){
- return maxSize;
+ return new Dimension(0, 0);
+ }
+
+ @Override
+ public Dimension getMaximumSize(JComponent c) {
+ return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
/**
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
index e3c15f4e421..c35d96fe3d4 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalFileChooserUI.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -92,8 +92,6 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
private static int MIN_WIDTH = 500;
private static int MIN_HEIGHT = 326;
- private static Dimension MIN_SIZE = new Dimension(MIN_WIDTH, MIN_HEIGHT);
-
private static int LIST_PREF_WIDTH = 405;
private static int LIST_PREF_HEIGHT = 135;
private static Dimension LIST_PREF_SIZE = new Dimension(LIST_PREF_WIDTH, LIST_PREF_HEIGHT);
@@ -615,6 +613,7 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
* @return a Dimension
specifying the preferred
* width and height of the file chooser
*/
+ @Override
public Dimension getPreferredSize(JComponent c) {
int prefWidth = PREF_SIZE.width;
Dimension d = c.getLayout().preferredLayoutSize(c);
@@ -633,8 +632,9 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
* @return a Dimension
specifying the minimum
* width and height of the file chooser
*/
+ @Override
public Dimension getMinimumSize(JComponent c) {
- return MIN_SIZE;
+ return new Dimension(MIN_WIDTH, MIN_HEIGHT);
}
/**
@@ -644,6 +644,7 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
* @return a Dimension
specifying the maximum
* width and height of the file chooser
*/
+ @Override
public Dimension getMaximumSize(JComponent c) {
return new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE);
}
@@ -654,7 +655,8 @@ public class MetalFileChooserUI extends BasicFileChooserUI {
} else {
JFileChooser fc = getFileChooser();
if ((fc.isDirectorySelectionEnabled() && !fc.isFileSelectionEnabled()) ||
- (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled() && fc.getFileSystemView().isFileSystemRoot(file))) {
+ (fc.isDirectorySelectionEnabled() && fc.isFileSelectionEnabled()
+ && fc.getFileSystemView().isFileSystemRoot(file))) {
return file.getPath();
} else {
return file.getName();
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java b/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java
index 2baa06717fd..2a15b26af19 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/GapContent.java
@@ -710,8 +710,9 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S
* @param length the length >= 0
* @return the set of instances
*/
- protected Vector getPositionsInRange(Vector v,
- int offset, int length) {
+ @SuppressWarnings({"rawtypes", "unchecked"}) // UndoPosRef type cannot be exposed
+ protected Vector getPositionsInRange(Vector v,
+ int offset, int length) {
int endOffset = offset + length;
int startIndex;
int endIndex;
@@ -758,7 +759,8 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S
*
* @param positions the UndoPosRef instances to reset
*/
- protected void updateUndoPositions(Vector positions, int offset,
+ @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+ protected void updateUndoPositions(Vector positions, int offset,
int length) {
// Find the indexs of the end points.
int endOffset = offset + length;
@@ -775,7 +777,7 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S
// Reset the location of the refenences.
for(int counter = positions.size() - 1; counter >= 0; counter--) {
- UndoPosRef ref = positions.elementAt(counter);
+ UndoPosRef ref = (UndoPosRef) positions.elementAt(counter);
ref.resetLocation(endOffset, g1);
}
// We have to resort the marks in the range startIndex to endIndex.
@@ -902,7 +904,8 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S
protected String string;
/** An array of instances of UndoPosRef for the Positions in the
* range that was removed, valid after undo. */
- protected Vector posRefs;
+ @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+ protected Vector posRefs;
} // GapContent.InsertUndo
@@ -911,6 +914,7 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S
*/
@SuppressWarnings("serial") // JDK-implementation class
class RemoveUndo extends AbstractUndoableEdit {
+ @SuppressWarnings("unchecked")
protected RemoveUndo(int offset, String string) {
super();
this.offset = offset;
@@ -934,6 +938,7 @@ public class GapContent extends GapVector implements AbstractDocument.Content, S
}
}
+ @SuppressWarnings("unchecked")
public void redo() throws CannotRedoException {
super.redo();
try {
diff --git a/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java b/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java
index 3da8c41235b..d6b897fd93f 100644
--- a/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java
+++ b/jdk/src/java.desktop/share/classes/javax/swing/text/StringContent.java
@@ -271,11 +271,12 @@ public final class StringContent implements AbstractDocument.Content, Serializab
* @param length the length >= 0
* @return the set of instances
*/
- protected Vector getPositionsInRange(Vector v, int offset,
- int length) {
+ @SuppressWarnings({"rawtypes", "unchecked"}) // UndoPosRef type cannot be exposed
+ protected Vector getPositionsInRange(Vector v, int offset,
+ int length) {
int n = marks.size();
int end = offset + length;
- Vector placeIn = (v == null) ? new Vector<>() : v;
+ Vector placeIn = (v == null) ? new Vector() : v;
for (int i = 0; i < n; i++) {
PosRec mark = marks.elementAt(i);
if (mark.unused) {
@@ -298,9 +299,10 @@ public final class StringContent implements AbstractDocument.Content, Serializab
*
* @param positions the positions of the instances
*/
- protected void updateUndoPositions(Vector positions) {
+ @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+ protected void updateUndoPositions(Vector positions) {
for(int counter = positions.size() - 1; counter >= 0; counter--) {
- UndoPosRef ref = positions.elementAt(counter);
+ UndoPosRef ref = (UndoPosRef) positions.elementAt(counter);
// Check if the Position is still valid.
if(ref.rec.unused) {
positions.removeElementAt(counter);
@@ -437,7 +439,8 @@ public final class StringContent implements AbstractDocument.Content, Serializab
protected String string;
// An array of instances of UndoPosRef for the Positions in the
// range that was removed, valid after undo.
- protected Vector posRefs;
+ @SuppressWarnings("rawtypes") // UndoPosRef type cannot be exposed
+ protected Vector posRefs;
}
@@ -445,6 +448,7 @@ public final class StringContent implements AbstractDocument.Content, Serializab
* UndoableEdit created for removes.
*/
class RemoveUndo extends AbstractUndoableEdit {
+ @SuppressWarnings("unchecked")
protected RemoveUndo(int offset, String string) {
super();
this.offset = offset;
@@ -471,6 +475,7 @@ public final class StringContent implements AbstractDocument.Content, Serializab
}
}
+ @SuppressWarnings("unchecked")
public void redo() throws CannotRedoException {
super.redo();
try {
diff --git a/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java b/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java
index f29a0d010b0..f78e4160209 100644
--- a/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java
+++ b/jdk/src/java.desktop/share/classes/sun/applet/AppletProps.java
@@ -28,8 +28,6 @@ package sun.applet;
import java.awt.*;
import java.io.*;
import java.util.Properties;
-import sun.net.www.http.HttpClient;
-import sun.net.ftp.FtpClient;
import java.security.AccessController;
import java.security.PrivilegedAction;
import java.security.PrivilegedExceptionAction;
diff --git a/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java b/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java
index 08924208b78..f4b7662c39f 100644
--- a/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java
+++ b/jdk/src/java.desktop/share/classes/sun/awt/HKSCS.java
@@ -34,11 +34,21 @@ import java.nio.charset.CharsetDecoder;
ExtendedCharsets class, because if we want to have a public HKSCS,
it probably should be HKSCS_2001 not HKSCS.
*/
-public class HKSCS extends sun.nio.cs.ext.MS950_HKSCS_XP {
+public class HKSCS extends Charset {
+ private static Charset cs = Charset.forName("x-MS950-HKSCS-XP");
+
public HKSCS () {
- super();
+ super("HKSCS", null);
}
public boolean contains(Charset cs) {
return (cs instanceof HKSCS);
}
+
+ public CharsetDecoder newDecoder() {
+ return cs.newDecoder();
+ }
+
+ public CharsetEncoder newEncoder() {
+ return cs.newEncoder();
+ }
}
diff --git a/jdk/src/java.desktop/share/classes/sun/font/Font2D.java b/jdk/src/java.desktop/share/classes/sun/font/Font2D.java
index 6fa3ca45e92..e1c7c912e3d 100644
--- a/jdk/src/java.desktop/share/classes/sun/font/Font2D.java
+++ b/jdk/src/java.desktop/share/classes/sun/font/Font2D.java
@@ -157,6 +157,21 @@ public abstract class Font2D {
}
}
+ public static final int FWIDTH_NORMAL = 5; // OS/2 usWidthClass
+ public static final int FWEIGHT_NORMAL = 400; // OS/2 usWeightClass
+ public static final int FWEIGHT_BOLD = 700; // OS/2 usWeightClass
+
+ public int getWidth() {
+ return FWIDTH_NORMAL;
+ }
+
+ public int getWeight() {
+ if ((style & Font.BOLD) !=0) {
+ return FWEIGHT_BOLD;
+ } else {
+ return FWEIGHT_NORMAL;
+ }
+ }
int getRank() {
return fontRank;
diff --git a/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java b/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java
index 6a4cd2552f9..2b67e5122f6 100644
--- a/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java
+++ b/jdk/src/java.desktop/share/classes/sun/font/FontFamily.java
@@ -27,6 +27,7 @@ package sun.font;
import java.io.File;
import java.awt.Font;
+import java.util.Collection;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;
import java.util.Locale;
@@ -77,7 +78,7 @@ public class FontFamily {
family.bolditalic = null;
}
if (family.plain == null && family.bold == null &&
- family.plain == null && family.bold == null) {
+ family.italic == null && family.bolditalic == null) {
familyNameMap.remove(name);
}
}
@@ -134,7 +135,98 @@ public class FontFamily {
return java.util.Objects.equals(newDir, existDir);
}
+ /*
+ * We want a family to be of the same width and prefer medium/normal width.
+ * Once we find a particular width we accept more of the same width
+ * until we find one closer to normal when we 'evict' all existing fonts.
+ * So once we see a 'normal' width font we evict all members that are not
+ * normal width and then accept only new ones that are normal width.
+ *
+ * Once a font passes the width test we subject it to the weight test.
+ * For Plain we target the weight the closest that is <= NORMAL (400)
+ * For Bold we target the weight that is closest to BOLD (700).
+ *
+ * In the future, rather than discarding these fonts, we should
+ * extend the family to include these so lookups on these properties
+ * can locate them, as presently they will only be located by full name
+ * based lookup.
+ */
+
+ private int familyWidth = 0;
+ private boolean preferredWidth(Font2D font) {
+
+ int newWidth = font.getWidth();
+
+ if (familyWidth == 0) {
+ familyWidth = newWidth;
+ return true;
+ }
+
+ if (newWidth == familyWidth) {
+ return true;
+ }
+
+ if (Math.abs(Font2D.FWIDTH_NORMAL - newWidth) <
+ Math.abs(Font2D.FWIDTH_NORMAL - familyWidth))
+ {
+ if (FontUtilities.debugFonts()) {
+ FontUtilities.getLogger().info(
+ "Found more preferred width. New width = " + newWidth +
+ " Old width = " + familyWidth + " in font " + font +
+ " nulling out fonts plain: " + plain + " bold: " + bold +
+ " italic: " + italic + " bolditalic: " + bolditalic);
+ }
+ familyWidth = newWidth;
+ plain = bold = italic = bolditalic = null;
+ return true;
+ } else if (FontUtilities.debugFonts()) {
+ FontUtilities.getLogger().info(
+ "Family rejecting font " + font +
+ " of less preferred width " + newWidth);
+ }
+ return false;
+ }
+
+ private boolean closerWeight(Font2D currFont, Font2D font, int style) {
+ if (familyWidth != font.getWidth()) {
+ return false;
+ }
+
+ if (currFont == null) {
+ return true;
+ }
+
+ if (FontUtilities.debugFonts()) {
+ FontUtilities.getLogger().info(
+ "New weight for style " + style + ". Curr.font=" + currFont +
+ " New font="+font+" Curr.weight="+ + currFont.getWeight()+
+ " New weight="+font.getWeight());
+ }
+
+ int newWeight = font.getWeight();
+ switch (style) {
+ case Font.PLAIN:
+ case Font.ITALIC:
+ return (newWeight <= Font2D.FWEIGHT_NORMAL &&
+ newWeight > currFont.getWeight());
+
+ case Font.BOLD:
+ case Font.BOLD|Font.ITALIC:
+ return (Math.abs(newWeight - Font2D.FWEIGHT_BOLD) <
+ Math.abs(currFont.getWeight() - Font2D.FWEIGHT_BOLD));
+
+ default:
+ return false;
+ }
+ }
+
public void setFont(Font2D font, int style) {
+
+ if (FontUtilities.isLogging()) {
+ FontUtilities.getLogger().info(
+ "Request to add " + font + " with style " + style +
+ " to family " + this);
+ }
/* Allow a lower-rank font only if its a file font
* from the exact same source as any previous font.
*/
@@ -152,19 +244,27 @@ public class FontFamily {
switch (style) {
case Font.PLAIN:
- plain = font;
+ if (preferredWidth(font) && closerWeight(plain, font, style)) {
+ plain = font;
+ }
break;
case Font.BOLD:
- bold = font;
+ if (preferredWidth(font) && closerWeight(bold, font, style)) {
+ bold = font;
+ }
break;
case Font.ITALIC:
- italic = font;
+ if (preferredWidth(font) && closerWeight(italic, font, style)) {
+ italic = font;
+ }
break;
case Font.BOLD|Font.ITALIC:
- bolditalic = font;
+ if (preferredWidth(font) && closerWeight(bolditalic, font, style)) {
+ bolditalic = font;
+ }
break;
default:
@@ -316,6 +416,11 @@ public class FontFamily {
return allLocaleNames.get(name.toLowerCase());
}
+ public static FontFamily[] getAllFontFamilies() {
+ Collection families = familyNameMap.values();
+ return families.toArray(new FontFamily[0]);
+ }
+
public String toString() {
return
"Font family: " + familyName +
diff --git a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java
index 047a9309095..0e8647cc734 100644
--- a/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java
+++ b/jdk/src/java.desktop/share/classes/sun/font/TrueTypeFont.java
@@ -963,6 +963,18 @@ public class TrueTypeFont extends FileFont {
setStyle(getTableBuffer(os_2Tag));
}
+ private int fontWidth = 0;
+ @Override
+ public int getWidth() {
+ return (fontWidth > 0) ? fontWidth : super.getWidth();
+ }
+
+ private int fontWeight = 0;
+ @Override
+ public int getWeight() {
+ return (fontWeight > 0) ? fontWeight : super.getWeight();
+ }
+
/* TrueTypeFont can use the fsSelection fields of OS/2 table
* to determine the style. In the unlikely case that doesn't exist,
* can use macStyle in the 'head' table but simpler to
@@ -978,8 +990,15 @@ public class TrueTypeFont extends FileFont {
private static final int fsSelectionBoldBit = 0x00020;
private static final int fsSelectionRegularBit = 0x00040;
private void setStyle(ByteBuffer os_2Table) {
+ if (os_2Table == null) {
+ return;
+ }
+ if (os_2Table.capacity() >= 8) {
+ fontWeight = os_2Table.getChar(4) & 0xffff;
+ fontWidth = os_2Table.getChar(6) & 0xffff;
+ }
/* fsSelection is unsigned short at buffer offset 62 */
- if (os_2Table == null || os_2Table.capacity() < 64) {
+ if (os_2Table.capacity() < 64) {
super.setStyle();
return;
}
diff --git a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java
index dd99535251f..ece4f48ef97 100644
--- a/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java
+++ b/jdk/src/java.desktop/share/classes/sun/print/ServiceDialog.java
@@ -1564,7 +1564,7 @@ public class ServiceDialog extends JDialog implements ActionListener {
bmObj = bmTmpObj;
} else {
if (lmObj == null || rmObj == null ||
- tmObj == null || rmObj == null) {
+ tmObj == null || bmObj == null) {
return;
} else {
leftMargin.setValue(lmObj);
diff --git a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
index 10e4e3bfa7f..3953297184c 100644
--- a/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
+++ b/jdk/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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,6 +31,7 @@ import static java.awt.RenderingHints.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.print.PrinterGraphics;
+import java.text.BreakIterator;
import java.text.CharacterIterator;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
@@ -461,16 +462,15 @@ public class SwingUtilities2 {
}
}
if (needsTextLayout) {
- FontRenderContext frc = getFontRenderContext(c, fm);
AttributedString aString = new AttributedString(string);
if (c != null) {
aString.addAttribute(TextAttribute.NUMERIC_SHAPING,
c.getClientProperty(TextAttribute.NUMERIC_SHAPING));
}
- LineBreakMeasurer measurer =
- new LineBreakMeasurer(aString.getIterator(), frc);
- int nChars = measurer.nextOffset(availTextWidth);
- string = string.substring(0, nChars);
+ LineBreakMeasurer measurer = new LineBreakMeasurer(
+ aString.getIterator(), BreakIterator.getCharacterInstance(),
+ getFontRenderContext(c, fm));
+ string = string.substring(0, measurer.nextOffset(availTextWidth));
}
return string + clipString;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAWTFormatter.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAWTFormatter.java
deleted file mode 100644
index 198d7a79508..00000000000
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XAWTFormatter.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Copyright (c) 2003, 2014, 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.awt.X11;
-
-import java.util.logging.*;
-import java.text.*;
-import java.util.*;
-import java.io.*;
-
-/**
- * Formatter class providing ANSI output. Based on java.util.logging.SimpleFormatter sources.
- */
-
-public class XAWTFormatter extends java.util.logging.Formatter {
- Date dat = new Date();
- private final static String format = "{0,date} {0,time}";
- private MessageFormat formatter;
-
- private Object args[] = new Object[1];
-
- // Line separator string. This is the value of the line.separator
- // property at the moment that the SimpleFormatter was created.
- private String lineSeparator = System.lineSeparator();
-
- boolean displayFullRecord = false;
- boolean useANSI = false;
- boolean showDate = true;
- boolean showLevel = true;
- boolean swapMethodClass = false;
- public XAWTFormatter() {
- displayFullRecord = "true".equals(LogManager.getLogManager().getProperty("XAWTFormatter.displayFullRecord"));
- useANSI = "true".equals(LogManager.getLogManager().getProperty("XAWTFormatter.useANSI"));
- showDate = !"false".equals(LogManager.getLogManager().getProperty("XAWTFormatter.showDate"));
- showLevel = !"false".equals(LogManager.getLogManager().getProperty("XAWTFormatter.showLevel"));
- swapMethodClass = "true".equals(LogManager.getLogManager().getProperty("XAWTFormatter.swapMethodClass"));
- }
-
- /**
- * Format the given LogRecord.
- * @param record the log record to be formatted.
- * @return a formatted log record
- */
- public synchronized String format(LogRecord record) {
- StringBuffer sb = new StringBuffer();
- if (useANSI) {
- Level lev = record.getLevel();
- if (Level.FINEST.equals(lev)) {
- sb.append("[36m");
- } else if (Level.FINER.equals(lev)) {
- sb.append("[32m");
- } else if (Level.FINE.equals(lev)) {
- sb.append("[34m");
- }
- }
- if (displayFullRecord) {
- if (showDate) {
- // Minimize memory allocations here.
- dat.setTime(record.getMillis());
- args[0] = dat;
- StringBuffer text = new StringBuffer();
- if (formatter == null) {
- formatter = new MessageFormat(format);
- }
- formatter.format(args, text, null);
- sb.append(text);
- sb.append(" ");
- } else {
- sb.append(" ");
- }
- if (swapMethodClass) {
- if (record.getSourceMethodName() != null) {
- sb.append(" [35m");
- sb.append(record.getSourceMethodName());
- sb.append("[30m ");
- }
- if (record.getSourceClassName() != null) {
- sb.append(record.getSourceClassName());
- } else {
- sb.append(record.getLoggerName());
- }
- } else {
- if (record.getSourceClassName() != null) {
- sb.append(record.getSourceClassName());
- } else {
- sb.append(record.getLoggerName());
- }
- if (record.getSourceMethodName() != null) {
- sb.append(" [35m");
- sb.append(record.getSourceMethodName());
- sb.append("[30m");
- }
- }
- sb.append(lineSeparator);
- }
- if (useANSI) {
- Level lev = record.getLevel();
- if (Level.FINEST.equals(lev)) {
- sb.append("[36m");
- } else if (Level.FINER.equals(lev)) {
- sb.append("[32m");
- } else if (Level.FINE.equals(lev)) {
- sb.append("[34m");
- }
- }
- if (showLevel) {
- sb.append(record.getLevel().getLocalizedName());
- sb.append(": ");
- }
- String message = formatMessage(record);
- sb.append(message);
- sb.append(lineSeparator);
- if (record.getThrown() != null) {
- try {
- StringWriter sw = new StringWriter();
- PrintWriter pw = new PrintWriter(sw);
- record.getThrown().printStackTrace(pw);
- pw.close();
- sb.append(sw.toString());
- } catch (Exception ex) {
- }
- }
- if (useANSI) {
- sb.append("[30m");
- }
- return sb.toString();
- }
-}
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbeddedFrame.java b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbeddedFrame.java
index 489558b18bd..9b9431893cb 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbeddedFrame.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XEmbeddedFrame.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -25,15 +25,17 @@
package sun.awt.X11;
-import sun.awt.EmbeddedFrame;
-import java.awt.*;
import java.awt.AWTKeyStroke;
-import java.util.logging.Logger;
+import java.awt.Toolkit;
+
+import sun.awt.EmbeddedFrame;
+import sun.util.logging.PlatformLogger;
@SuppressWarnings("serial") // JDK-implementation class
public class XEmbeddedFrame extends EmbeddedFrame {
- private static final Logger log = Logger.getLogger(XEmbeddedFrame.class.getName());
+ private static final PlatformLogger log =
+ PlatformLogger.getLogger(XEmbeddedFrame.class.getName());
long handle;
public XEmbeddedFrame() {
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java
index fb0e17712dd..880ec9c8f43 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GB2312.java
@@ -28,6 +28,7 @@ package sun.awt.motif;
import java.nio.CharBuffer;
import java.nio.ByteBuffer;
import java.nio.charset.*;
+import sun.nio.cs.*;
import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java
index 5302638c535..e082c526dae 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11GBK.java
@@ -26,6 +26,7 @@
package sun.awt.motif;
import java.nio.charset.*;
+import sun.nio.cs.*;
import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java
index dbac41c5a50..84b6a081be7 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0201.java
@@ -29,7 +29,7 @@ import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.nio.charset.*;
import sun.nio.cs.*;
-import sun.nio.cs.ext.JIS_X_0201;
+import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
public class X11JIS0201 extends Charset {
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java
index 04ad2ed2899..b4dc5989323 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0208.java
@@ -28,7 +28,8 @@ package sun.awt.motif;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
-import sun.nio.cs.ext.JIS_X_0208;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
public class X11JIS0208 extends Charset {
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java
index 019ea19a910..94c02493d51 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11JIS0212.java
@@ -28,7 +28,8 @@ package sun.awt.motif;
import java.nio.charset.Charset;
import java.nio.charset.CharsetEncoder;
import java.nio.charset.CharsetDecoder;
-import sun.nio.cs.ext.JIS_X_0212;
+import sun.nio.cs.*;
+import sun.nio.cs.ext.*;
public class X11JIS0212 extends Charset {
private static Charset jis0212 = new JIS_X_0212();
diff --git a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java
index 8d9df5ca664..69591cfb062 100644
--- a/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/motif/X11KSC5601.java
@@ -28,6 +28,7 @@ package sun.awt.motif;
import java.nio.CharBuffer;
import java.nio.ByteBuffer;
import java.nio.charset.*;
+import sun.nio.cs.*;
import sun.nio.cs.ext.*;
import static sun.nio.cs.CharsetMapping.*;
diff --git a/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java b/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java
index 0f6190f730d..f5fd8cc996b 100644
--- a/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java
+++ b/jdk/src/java.desktop/unix/classes/sun/font/FcFontConfiguration.java
@@ -180,7 +180,7 @@ public class FcFontConfiguration extends FontConfiguration {
String[] componentFaceNames = cfi[idx].getComponentFaceNames();
FontDescriptor[] ret = new FontDescriptor[componentFaceNames.length];
for (int i = 0; i < componentFaceNames.length; i++) {
- ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.UTF_8.newEncoder(), new int[0]);
+ ret[i] = new FontDescriptor(componentFaceNames[i], StandardCharsets.ISO_8859_1.newEncoder(), new int[0]);
}
return ret;
diff --git a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp
index 828818bad4a..36b54670642 100644
--- a/jdk/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp
+++ b/jdk/src/java.desktop/windows/native/libawt/windows/awt_Desktop.cpp
@@ -52,6 +52,7 @@ JNIEXPORT jstring JNICALL Java_sun_awt_windows_WDesktopPeer_ShellExecute
// 6457572: ShellExecute possibly changes FPU control word - saving it here
unsigned oldcontrol87 = _control87(0, 0);
HINSTANCE retval = ::ShellExecute(NULL, verb_c, fileOrUri_c, NULL, NULL, SW_SHOWNORMAL);
+ DWORD error = ::GetLastError();
_control87(oldcontrol87, 0xffffffff);
JNU_ReleaseStringPlatformChars(env, fileOrUri_j, fileOrUri_c);
@@ -65,7 +66,7 @@ JNIEXPORT jstring JNICALL Java_sun_awt_windows_WDesktopPeer_ShellExecute
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
- (int)retval,
+ error,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
(LPTSTR)&buffer,
0,
diff --git a/jdk/src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider b/jdk/src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider
new file mode 100644
index 00000000000..a5611e80f23
--- /dev/null
+++ b/jdk/src/java.management/share/classes/META-INF/services/sun.management.spi.PlatformMBeanProvider
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2015, 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.
+#
+com.sun.management.internal.PlatformMBeanProviderImpl
diff --git a/jdk/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java b/jdk/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java
new file mode 100644
index 00000000000..42d41b65992
--- /dev/null
+++ b/jdk/src/java.management/share/classes/com/sun/management/internal/PlatformMBeanProviderImpl.java
@@ -0,0 +1,209 @@
+/*
+ * Copyright (c) 2015, 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 com.sun.management.internal;
+
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.management.DynamicMBean;
+import javax.management.ObjectName;
+import sun.management.ManagementFactoryHelper;
+import sun.management.spi.PlatformMBeanProvider;
+
+public final class PlatformMBeanProviderImpl extends PlatformMBeanProvider {
+ private final List> mxbeanList;
+
+ public PlatformMBeanProviderImpl() {
+ mxbeanList = Collections.unmodifiableList(init());
+ }
+
+ @Override
+ public List> getPlatformComponentList() {
+ return mxbeanList;
+ }
+
+ private List> init() {
+ ArrayList> initMBeanList = new ArrayList<>();
+ /**
+ * Garbage Collector in the Java virtual machine.
+ */
+ initMBeanList.add(new PlatformComponent() {
+ private final Set garbageCollectorMXBeanInterfaceNames
+ = Collections.unmodifiableSet(
+ Stream.of("java.lang.management.MemoryManagerMXBean",
+ "java.lang.management.GarbageCollectorMXBean",
+ "com.sun.management.GarbageCollectorMXBean")
+ .collect(Collectors.toSet()));
+
+ @Override
+ public Set> mbeanInterfaces() {
+ return Stream.of(java.lang.management.MemoryManagerMXBean.class,
+ java.lang.management.GarbageCollectorMXBean.class,
+ com.sun.management.GarbageCollectorMXBean.class)
+ .collect(Collectors.toSet());
+ }
+
+ @Override
+ public Set mbeanInterfaceNames() {
+ return garbageCollectorMXBeanInterfaceNames;
+ }
+
+ @Override
+ public String getObjectNamePattern() {
+ return ManagementFactory.GARBAGE_COLLECTOR_MXBEAN_DOMAIN_TYPE + ",name=*";
+ }
+
+ @Override
+ public boolean isSingleton() {
+ return false; // zero or more instances
+ }
+
+ @Override
+ public Map nameToMBeanMap() {
+ List list
+ = ManagementFactoryHelper.getGarbageCollectorMXBeans();;
+ Map map;
+ if (list.isEmpty()) {
+ map = Collections.emptyMap();
+ } else {
+ map = new HashMap<>(list.size());
+ for (java.lang.management.MemoryManagerMXBean gcm : list) {
+ map.put(gcm.getObjectName().getCanonicalName(),
+ gcm);
+ }
+ }
+ return map;
+ }
+ });
+
+ /**
+ * OperatingSystemMXBean
+ */
+ initMBeanList.add(new PlatformComponent() {
+ private final Set operatingSystemMXBeanInterfaceNames
+ = Collections.unmodifiableSet(
+ Stream.of("java.lang.management.OperatingSystemMXBean",
+ "com.sun.management.OperatingSystemMXBean",
+ "com.sun.management.UnixOperatingSystemMXBean")
+ .collect(Collectors.toSet()));
+
+ @Override
+ public Set> mbeanInterfaces() {
+ return Stream.of(java.lang.management.OperatingSystemMXBean.class,
+ com.sun.management.OperatingSystemMXBean.class,
+ com.sun.management.UnixOperatingSystemMXBean.class)
+ .collect(Collectors.toSet());
+ }
+
+ @Override
+ public Set mbeanInterfaceNames() {
+ return operatingSystemMXBeanInterfaceNames;
+ }
+
+ @Override
+ public String getObjectNamePattern() {
+ return ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME;
+ }
+
+ @Override
+ public Map nameToMBeanMap() {
+ return Collections.singletonMap(
+ ManagementFactory.OPERATING_SYSTEM_MXBEAN_NAME,
+ ManagementFactoryHelper.getOperatingSystemMXBean());
+ }
+ });
+
+ /**
+ * Diagnostic support for the HotSpot Virtual Machine.
+ */
+ initMBeanList.add(new PlatformComponent() {
+ private final Set hotSpotDiagnosticMXBeanInterfaceNames =
+ Collections.unmodifiableSet(Collections.singleton("com.sun.management.HotSpotDiagnosticMXBean"));
+
+ @Override
+ public Set> mbeanInterfaces() {
+ return Collections.singleton(com.sun.management.HotSpotDiagnosticMXBean.class);
+ }
+
+ @Override
+ public Set mbeanInterfaceNames() {
+ return hotSpotDiagnosticMXBeanInterfaceNames;
+ }
+
+ @Override
+ public String getObjectNamePattern() {
+ return "com.sun.management:type=HotSpotDiagnostic";
+ }
+
+ @Override
+ public Map nameToMBeanMap() {
+ return Collections.singletonMap(
+ "com.sun.management:type=HotSpotDiagnostic",
+ ManagementFactoryHelper.getDiagnosticMXBean());
+ }
+ });
+
+ /**
+ * DynamicMBean
+ */
+ HashMap