Merge
This commit is contained in:
commit
8eddf40f8b
3
.hgtags
3
.hgtags
@ -118,3 +118,6 @@ f4298bc3f4b6baa315643be06966f09684290068 jdk7-b140
|
||||
5d86d0c7692e8f4a58d430d68c03594e2d3403b3 jdk7-b141
|
||||
92bf0655022d4187e9b49c1400f98fb3392a4630 jdk7-b142
|
||||
4a05062d8c4dfa3edec3faf1052af28baba5adff jdk7-b143
|
||||
07a8728ad49ef6dfa469c3a8bf5ab1e9c80bed5c jdk7-b144
|
||||
8294c99e685a1f6d1d37c45cd97854cf74be771e jdk7-b145
|
||||
dca1e8a87e8f756f95b99bac8fe795750d42e1b0 jdk7-b146
|
||||
|
@ -118,3 +118,6 @@ dcfe74f1c6553c556e7d361c30b0b614eb5e40f6 jdk7-b140
|
||||
c6569c5585851dfd39b8de8e021c3c312f51af12 jdk7-b141
|
||||
cfbbdb77eac0397b03eb99ee2e07ea00e0a7b81e jdk7-b142
|
||||
14b8e7eee1058fd4ed5a2700a2ce14b3616278f1 jdk7-b143
|
||||
7203965666a4fe63bf82f5e4204f41ce6285e716 jdk7-b144
|
||||
55e9ebf032186c333e5964ed044419830ac02693 jdk7-b145
|
||||
2d38c2a79c144c30cd04d143d83ee7ec6af40771 jdk7-b146
|
||||
|
4707
THIRD_PARTY_README
4707
THIRD_PARTY_README
File diff suppressed because it is too large
Load Diff
@ -118,3 +118,6 @@ cdf5d19ec142424489549025e9c42e51f32cf688 jdk7-b140
|
||||
a58635cdd921bafef353f4864184a0481353197b jdk7-b141
|
||||
a2f340a048c88d10cbedc0504f5cf03d39925a40 jdk7-b142
|
||||
51ed32f6f4de56f16e910ac54ba6c6f6606f4f17 jdk7-b143
|
||||
7033a5756ad552d88114594d8e2d2e4dc2c05963 jdk7-b144
|
||||
77ec0541aa2aa4da27e9e385a118a2e51e7fca24 jdk7-b145
|
||||
770227a4087e4e401fe87ccd19738440111c3948 jdk7-b146
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -405,8 +405,7 @@ public class ObjectStreamClass implements java.io.Serializable {
|
||||
if (!serializable ||
|
||||
externalizable ||
|
||||
forProxyClass ||
|
||||
name.equals("java.lang.String") ||
|
||||
isEnum) {
|
||||
name.equals("java.lang.String")){
|
||||
fields = NO_FIELDS;
|
||||
} else if (serializable) {
|
||||
/* Ask for permission to override field access checks.
|
||||
|
@ -118,3 +118,6 @@ c8136fd161c83917f87e93b14fa2ba3483f9be83 jdk7-b140
|
||||
e1b5ef243445bf836d095fd44866e1771ef99374 jdk7-b141
|
||||
7d067af4b25e4b7e6b28bef48527d67f8650e6c5 jdk7-b142
|
||||
16b847e9bbd747f9d27785b2fc20d4d720cca893 jdk7-b143
|
||||
39bf6dcaab2336326b21743cef7042d0a2de9ba0 jdk7-b144
|
||||
10ca7570f47f2ae4132648f7e8da1a05f1a98a15 jdk7-b145
|
||||
bcd31fa1e3c6f51b4fdd427ef905188cdac57164 jdk7-b146
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -25,8 +25,8 @@
|
||||
|
||||
drops.master.copy.base=${drops.dir}
|
||||
|
||||
jaxp_src.bundle.name=jaxp-1_4_5.zip
|
||||
jaxp_src.bundle.md5.checksum=485e731f26f35d4efe05a63c57104374
|
||||
jaxp_src.bundle.name=jaxp145_01.zip
|
||||
jaxp_src.bundle.md5.checksum=32394c780c8fb5e29775f623525993c0
|
||||
jaxp_src.master.bundle.dir=${drops.master.copy.base}
|
||||
jaxp_src.master.bundle.url.base=http://download.java.net/jaxp/1.4.5
|
||||
|
||||
|
@ -118,3 +118,6 @@ c025078c8362076503bb83b8e4da14ba7b347940 jdk7-b139
|
||||
66826b0aec5a1834da3821c35cf85ac154e9b04d jdk7-b141
|
||||
0ef3ef823c39eee3d670e58027c3219cb66f0283 jdk7-b142
|
||||
569d1e7ea980d172046c4aba79d96b5c3afabbba jdk7-b143
|
||||
6bd683f2d527c9afd47beac1cbf614506929598d jdk7-b144
|
||||
42bfba80beb7d3260b7b135b9a39202b512eb8c2 jdk7-b145
|
||||
05469dd4c3662c454f8a019e492543add60795cc jdk7-b146
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -25,8 +25,8 @@
|
||||
|
||||
drops.master.copy.base=${drops.dir}
|
||||
|
||||
jaxws_src.bundle.name=jdk7-jaxws2_2_4-b02-2011_05_09.zip
|
||||
jaxws_src.bundle.md5.checksum=0972a58090e8b2735d91a2f5d1ae1964
|
||||
jaxws_src.bundle.name=jdk7-jaxws2_2_4-b03-2011_05_27.zip
|
||||
jaxws_src.bundle.md5.checksum=2f5b829ade70f67fe272d0b322e3e702
|
||||
jaxws_src.master.bundle.dir=${drops.master.copy.base}
|
||||
jaxws_src.master.bundle.url.base=http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7
|
||||
|
||||
|
@ -119,3 +119,6 @@ d80954a89b49fda47c0c5cace65a17f5a758b8bd jdk7-b139
|
||||
312612e89ece62633f4809706dec00bcd5fe7c2d jdk7-b142
|
||||
efbf75c24b0f31847c9c403f6dc07dc80551908d jdk7-b143
|
||||
23bdcede4e3945894574892e80b848bd9f15b5f3 jdk7-b144
|
||||
1e04b38b3824a4a1d197ef681a302e6813e53f8b jdk7-b145
|
||||
539e576793a8e64aaf160e0d6ab0b9723cd0bef0 jdk7-b146
|
||||
f097ca2434b1412b12ab4a5c2397ce271bf681e7 jdk7-b147
|
||||
|
@ -1 +1 @@
|
||||
project=jdk7
|
||||
project=jdk8
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -48,6 +48,9 @@ include Exportedfiles.gmk
|
||||
ifeq ($(PLATFORM), solaris)
|
||||
OTHER_LDLIBS += -ldoor
|
||||
endif
|
||||
ifeq ($(PLATFORM), windows)
|
||||
EXTRA_LIBS += psapi.lib
|
||||
endif
|
||||
|
||||
vpath %.c $(PLATFORM_SRC)/native/sun/tools/attach
|
||||
|
||||
|
@ -49,5 +49,21 @@ RUNTIME_NAME = $(PRODUCT_NAME) $(PRODUCT_SUFFIX)
|
||||
JRE_REDUCED_HEADLESS_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-headless-image
|
||||
JRE_REDUCED_IMAGE_DIR = $(ABS_OUTPUTDIR)/j2re-reduced-image
|
||||
|
||||
# Override on linux to further reduce binary/lib sizes in product build
|
||||
ifeq ($(PLATFORM), linux)
|
||||
ifeq ($(VARIANT), OPT)
|
||||
ifneq ($(NO_STRIP), true)
|
||||
ifneq ($(DEBUG_BINARIES), true)
|
||||
POST_STRIP_PROCESS = $(STRIP) --strip-unneeded
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# NIO Platform specific source file location
|
||||
ifdef CROSS_COMPILE_ARCH
|
||||
NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/
|
||||
endif
|
||||
|
||||
endif # JAVASE_EMBEDDED
|
||||
|
||||
|
@ -53,25 +53,30 @@ $(NOT_HEADLESS_RT_JAR_LIST): $(NOT_RT_JAR_LIST)
|
||||
$(RM) $(HEADLESS_CLASSLIST)
|
||||
$(RM) $(NOT_HEADLESS_RT_JAR_LIST)
|
||||
$(CP) $(NOT_RT_JAR_LIST) $(NOT_HEADLESS_RT_JAR_LIST)
|
||||
# List all the packages to be excluded
|
||||
$(ECHO) "sun/awt/motif/" >> $@
|
||||
$(ECHO) "sun/awt/X11/" >> $@
|
||||
$(ECHO) "sun/applet/" >> $@
|
||||
$(ECHO) "sun/java2d/opengl/" >> $@
|
||||
$(ECHO) "com/sun/java/swing/plaf/" >> $@
|
||||
$(ECHO) "sun/awt/motif/MFontConfiguration" >$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/applet/AppContextCreator" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/applet/AppletAudioClip" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXSurfaceData" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/OGLSurfaceData" >>$(HEADLESS_CLASSLIST)
|
||||
# List all the individual classes to be included
|
||||
$(ECHO) "sun/awt/motif/MFontConfiguration.class" >$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/applet/AppContextCreator.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/applet/AppletAudioClip.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXSurfaceData.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXSurfaceData"\$$"GLXOffScreenSurfaceData.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/GLXVolatileSurfaceManager.class" >>$(HEADLESS_CLASSLIST)
|
||||
$(ECHO) "sun/java2d/opengl/OGLSurfaceData.class" >>$(HEADLESS_CLASSLIST)
|
||||
|
||||
|
||||
$(TOTAL_HEADLESS_JAR_FILELIST): $(JARREORDER_JARFILE) $(NOT_HEADLESS_RT_JAR_LIST)
|
||||
$(prep-target)
|
||||
$(RM) $@.temp
|
||||
$(CD) $(CLASSBINDIR) ; \
|
||||
$(BOOT_JAVA_CMD) -jar $(JARREORDER_JARFILE) \
|
||||
-o $@.temp $(HEADLESS_CLASSLIST) $(NOT_HEADLESS_RT_JAR_LIST) .
|
||||
-o $@.temp - $(NOT_HEADLESS_RT_JAR_LIST) .
|
||||
# Add on the explicitly included class files from the otherwise excluded packages
|
||||
$(CAT) $(HEADLESS_CLASSLIST) >> $@.temp
|
||||
$(MV) $@.temp $@
|
||||
@$(CD) $(CLASSBINDIR); $(java-vm-cleanup)
|
||||
|
||||
@ -124,13 +129,9 @@ NOT_REDUCEDJRE_LIB = \
|
||||
$(LIBARCH)/libjavaplugin_nscp.so \
|
||||
$(LIBARCH)/libjavaplugin_oji.so
|
||||
|
||||
|
||||
ifeq ($(PLATFORM), linux)
|
||||
STRIP_OPTS = --strip-unneeded
|
||||
else
|
||||
STRIP_OPTS = -x
|
||||
endif
|
||||
|
||||
# JRE docs that don't get included in reduced jre image top directory
|
||||
NOT_REDUCEDJRE_DOC = \
|
||||
Welcome.html
|
||||
|
||||
reduced-image-jre::
|
||||
@$(ECHO) Starting to Produce Reduced JRE
|
||||
@ -142,12 +143,6 @@ reduced-image-jre::
|
||||
$(CD) $(JRE_IMAGE_DIR); \
|
||||
$(TAR) cf - . | ($(CD) $(JRE_REDUCED_IMAGE_DIR); $(TAR) xf - );
|
||||
|
||||
@# strip the main .so files
|
||||
$(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/client/libjvm.so
|
||||
ifndef BUILD_CLIENT_ONLY
|
||||
$(STRIP) $(STRIP_OPTS) $(JRE_REDUCED_IMAGE_DIR)/lib/$(LIBARCH)/server/libjvm.so
|
||||
endif
|
||||
|
||||
@#
|
||||
@# Remove all of the files that are not needed for the
|
||||
@# reduced JRE
|
||||
@ -158,6 +153,9 @@ endif
|
||||
for l in $(NOT_REDUCEDJRE_LIB) ; do \
|
||||
$(RM) $(JRE_REDUCED_IMAGE_DIR)/lib/$$l ; \
|
||||
done
|
||||
for l in $(NOT_REDUCEDJRE_DOC) ; do \
|
||||
$(RM) $(JRE_REDUCED_IMAGE_DIR)/$$l ; \
|
||||
done
|
||||
|
||||
@# Remove misc. other files
|
||||
$(RM) -r $(JRE_REDUCED_IMAGE_DIR)/man
|
||||
|
@ -900,8 +900,10 @@ initial-image-jdk-db: $(DB_ZIP_LIST)
|
||||
for d in $(DB_ZIP_LIST); do \
|
||||
($(CD) $(JDK_IMAGE_DIR)/db && $(UNZIP) -o $$d); \
|
||||
done
|
||||
$(CP) $(ABS_DB_PATH)/README-JDK.html $(JDK_IMAGE_DIR)/db
|
||||
$(RM) -rf $(DEMODIR)/db
|
||||
$(MV) $(JDK_IMAGE_DIR)/db/demo $(DEMODIR)/db
|
||||
$(CP) $(ABS_DB_PATH)/README-JDK-DEMOS.html $(DEMODIR)/db/
|
||||
$(RM) $(JDK_IMAGE_DIR)/db/index.html $(JDK_IMAGE_DIR)/db/register.html
|
||||
endif
|
||||
|
||||
|
@ -195,8 +195,8 @@ ifndef JDK_MAJOR_VERSION
|
||||
endif
|
||||
|
||||
ifndef JDK_MINOR_VERSION
|
||||
JDK_MINOR_VERSION = 7
|
||||
PREVIOUS_MINOR_VERSION = 6
|
||||
JDK_MINOR_VERSION = 8
|
||||
PREVIOUS_MINOR_VERSION = 7
|
||||
endif
|
||||
|
||||
ifndef JDK_MICRO_VERSION
|
||||
|
@ -223,6 +223,9 @@ endif
|
||||
ifeq ($(JDK_MINOR_VERSION),6)
|
||||
JDK_IS_FCS = true
|
||||
endif
|
||||
ifeq ($(JDK_MINOR_VERSION),7)
|
||||
JDK_IS_FCS = true
|
||||
endif
|
||||
ifeq ($(JDK_IS_FCS),false)
|
||||
ifneq ($(MILESTONE), fcs)
|
||||
DRAFT_HEADER = <br><strong>DRAFT $(MILESTONE)-$(BUILD_NUMBER)</strong>
|
||||
|
@ -255,7 +255,7 @@ FILES_export += \
|
||||
sun/nio/fs/LinuxWatchService.java \
|
||||
sun/nio/fs/UnixCopyFile.java \
|
||||
sun/nio/fs/UnixNativeDispatcher.java
|
||||
|
||||
|
||||
FILES_gen += \
|
||||
sun/nio/fs/UnixConstants.java
|
||||
endif # PLATFORM = linux
|
||||
@ -771,7 +771,7 @@ $(CS_GEN)/CharsetEncoder.java: $(CHARSET_X_CODER_TEMPLATE) $(GEN_CODER_SH)
|
||||
#
|
||||
|
||||
GEN_EX_SH = genExceptions.sh
|
||||
|
||||
|
||||
GEN_EX_CMD = NAWK="$(NAWK)" SH="$(SH)" $(SH) $(GEN_EX_SH)
|
||||
|
||||
$(CH_GEN)/%Exception.java: genExceptions.sh $(CH_SRC)/exceptions
|
||||
@ -820,14 +820,19 @@ $(TEMPDIR)/$(GENSOR_SRC) : $(GENSOR_SRC)
|
||||
|
||||
$(GENSOR_EXE) : $(TEMPDIR)/$(GENSOR_SRC)
|
||||
$(prep-target)
|
||||
($(CD) $(TEMPDIR); $(HOST_CC) $(CPPFLAGS) $(LDDFLAGS) \
|
||||
($(CD) $(TEMPDIR); $(CC) $(CPPFLAGS) $(LDDFLAGS) \
|
||||
-o genSocketOptionRegistry$(EXE_SUFFIX) $(GENSOR_SRC))
|
||||
|
||||
ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
|
||||
$(SCH_GEN)/SocketOptionRegistry.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/ch/SocketOptionRegistry-$(PLATFORM)-$(ARCH).java
|
||||
$(prep-target)
|
||||
$(CP) $< $@
|
||||
else
|
||||
$(SCH_GEN)/SocketOptionRegistry.java: $(GENSOR_EXE)
|
||||
$(prep-target)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(SOR_COPYRIGHT_YEARS)" > $@
|
||||
$(GENSOR_EXE) >> $@
|
||||
|
||||
endif
|
||||
#
|
||||
# Generated sun.nio.cs SingleByte classes
|
||||
#
|
||||
@ -851,12 +856,18 @@ GENUC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENUC_SRC) | \
|
||||
|
||||
$(GENUC_EXE) : $(GENUC_SRC)
|
||||
$(prep-target)
|
||||
$(HOST_CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
|
||||
$(CC) $(CPPFLAGS) -o $@ $(GENUC_SRC)
|
||||
|
||||
ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
|
||||
$(SFS_GEN)/UnixConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/UnixConstants-$(PLATFORM)-$(ARCH).java
|
||||
$(prep-target)
|
||||
$(CP) $< $@
|
||||
else
|
||||
$(SFS_GEN)/UnixConstants.java: $(GENUC_EXE)
|
||||
$(prep-target)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENUC_COPYRIGHT_YEARS)" > $@
|
||||
$(GENUC_EXE) >> $@
|
||||
endif
|
||||
|
||||
GENSC_SRC = $(PLATFORM_SRC)/native/sun/nio/fs/genSolarisConstants.c
|
||||
|
||||
@ -867,11 +878,17 @@ GENSC_COPYRIGHT_YEARS = $(shell $(CAT) $(GENSC_SRC) | \
|
||||
|
||||
$(GENSC_EXE) : $(GENSC_SRC)
|
||||
$(prep-target)
|
||||
$(HOST_CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
|
||||
$(CC) $(CPPFLAGS) -o $@ $(GENSC_SRC)
|
||||
|
||||
ifdef NIO_PLATFORM_CLASSES_ROOT_DIR
|
||||
$(SFS_GEN)/SolarisConstants.java: $(NIO_PLATFORM_CLASSES_ROOT_DIR)/sun/nio/fs/SolarisConstants-$(PLATFORM)-$(ARCH).java
|
||||
$(prep-target)
|
||||
$(CP) $< $@
|
||||
else
|
||||
$(SFS_GEN)/SolarisConstants.java: $(GENSC_EXE)
|
||||
$(prep-target)
|
||||
NAWK="$(NAWK)" SH="$(SH)" $(SH) -e addNotices.sh "$(GENSC_COPYRIGHT_YEARS)" > $@
|
||||
$(GENSC_EXE) >> $@
|
||||
endif
|
||||
|
||||
.PHONY: sources
|
||||
|
@ -370,8 +370,7 @@ $(SIGNED_POLICY_BUILDDIR)/limited/local_policy.jar: \
|
||||
|
||||
CLOSED_DIR = $(BUILDDIR)/closed/javax/crypto
|
||||
|
||||
release: $(SIGNED_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/COPYRIGHT.html \
|
||||
$(CLOSED_DIR)/doc/README.txt
|
||||
release: $(SIGNED_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/README.txt
|
||||
$(RM) -r \
|
||||
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy \
|
||||
$(JCE_BUILD_DIR)/release/jce.jar \
|
||||
@ -387,7 +386,6 @@ release: $(SIGNED_DIR)/jce.jar sign-policy $(CLOSED_DIR)/doc/COPYRIGHT.html \
|
||||
$(CP) \
|
||||
$(SIGNED_POLICY_BUILDDIR)/unlimited/US_export_policy.jar \
|
||||
$(SIGNED_POLICY_BUILDDIR)/unlimited/local_policy.jar \
|
||||
$(CLOSED_DIR)/doc/COPYRIGHT.html \
|
||||
$(CLOSED_DIR)/doc/README.txt \
|
||||
$(JCE_BUILD_DIR)/release/UnlimitedJCEPolicy
|
||||
cd $(JCE_BUILD_DIR)/release ; \
|
||||
|
@ -147,7 +147,7 @@ OTHER_INCLUDES += \
|
||||
# Rules
|
||||
#
|
||||
CLASSDESTDIR = $(TEMPDIR)/classes
|
||||
JAVAHFLAGS += -classpath $(CLASSDESTDIR)
|
||||
JAVAHFLAGS += -Xbootclasspath/p:$(CLASSDESTDIR)
|
||||
|
||||
include $(BUILDDIR)/common/Mapfile-vers.gmk
|
||||
|
||||
|
@ -174,8 +174,11 @@ class GTKFileChooserUI extends SynthFileChooserUI {
|
||||
|
||||
// construct the resulting string
|
||||
for (int i=0; i<len; i++) {
|
||||
if (i > 0) {
|
||||
buf.append(" ");
|
||||
}
|
||||
if (len > 1) {
|
||||
buf.append(" \"");
|
||||
buf.append("\"");
|
||||
}
|
||||
buf.append(result.get(i));
|
||||
if (len > 1) {
|
||||
|
@ -56,9 +56,9 @@ FileChooser.deleteFileButtonMnemonic=76
|
||||
FileChooser.renameFileButtonText=Rename File
|
||||
FileChooser.renameFileButtonMnemonic=82
|
||||
FileChooser.cancelButtonText=Cancel
|
||||
#FileChooser.cancelButtonMnemonic=67
|
||||
FileChooser.cancelButtonMnemonic=67
|
||||
FileChooser.saveButtonText=OK
|
||||
#FileChooser.saveButtonMnemonic=79
|
||||
FileChooser.saveButtonMnemonic=79
|
||||
FileChooser.openButtonText=OK
|
||||
FileChooser.openButtonMnemonic=79
|
||||
FileChooser.saveDialogTitleText=Save
|
||||
@ -79,5 +79,5 @@ FileChooser.renameFileDialogText=Rename file "{0}" to
|
||||
FileChooser.renameFileErrorTitle=Error
|
||||
FileChooser.renameFileErrorText=Error renaming file "{0}" to "{1}"
|
||||
|
||||
#OptionPane.okButtonMnemonic=79
|
||||
#OptionPane.cancelButtonMnemonic=67
|
||||
OptionPane.okButtonMnemonic=79
|
||||
OptionPane.cancelButtonMnemonic=67
|
||||
|
@ -1857,7 +1857,7 @@ public abstract class Toolkit {
|
||||
|
||||
/**
|
||||
* Adds the specified property change listener for the named desktop
|
||||
* property. When a {@link PropertyChangeListenerProxy} object is added,
|
||||
* property. When a {@link java.beans.PropertyChangeListenerProxy} object is added,
|
||||
* its property name is ignored, and the wrapped listener is added.
|
||||
* If {@code name} is {@code null} or {@code pcl} is {@code null},
|
||||
* no exception is thrown and no action is performed.
|
||||
@ -1874,7 +1874,7 @@ public abstract class Toolkit {
|
||||
|
||||
/**
|
||||
* Removes the specified property change listener for the named
|
||||
* desktop property. When a {@link PropertyChangeListenerProxy} object
|
||||
* desktop property. When a {@link java.beans.PropertyChangeListenerProxy} object
|
||||
* is removed, its property name is ignored, and
|
||||
* the wrapped listener is removed.
|
||||
* If {@code name} is {@code null} or {@code pcl} is {@code null},
|
||||
@ -1893,11 +1893,11 @@ public abstract class Toolkit {
|
||||
/**
|
||||
* Returns an array of all the property change listeners
|
||||
* registered on this toolkit. The returned array
|
||||
* contains {@code PropertyChangeListenerProxy} objects
|
||||
* contains {@link java.beans.PropertyChangeListenerProxy} objects
|
||||
* that associate listeners with the names of desktop properties.
|
||||
*
|
||||
* @return all of this toolkit's {@ code PropertyChangeListener}
|
||||
* objects wrapped in {@code PropertyChangeListenerProxy} objects
|
||||
* @return all of this toolkit's {@link PropertyChangeListener}
|
||||
* objects wrapped in {@code java.beans.PropertyChangeListenerProxy} objects
|
||||
* or an empty array if no listeners are added
|
||||
*
|
||||
* @see PropertyChangeSupport#getPropertyChangeListeners()
|
||||
|
@ -1382,13 +1382,19 @@ public class ICC_Profile implements Serializable {
|
||||
|
||||
/**
|
||||
* Sets a particular tagged data element in the profile from
|
||||
* a byte array. This method is useful
|
||||
* for advanced applets or applications which need to access
|
||||
* profile data directly.
|
||||
* a byte array. The array should contain data in a format, corresponded
|
||||
* to the {@code tagSignature} as defined in the ICC specification, section 10.
|
||||
* This method is useful for advanced applets or applications which need to
|
||||
* access profile data directly.
|
||||
*
|
||||
* @param tagSignature The ICC tag signature for the data element
|
||||
* you want to set.
|
||||
* @param tagData the data to set for the specified tag signature
|
||||
* @throws IllegalArgumentException if {@code tagSignature} is not a signature
|
||||
* as defined in the ICC specification.
|
||||
* @throws IllegalArgumentException if a content of the {@code tagData}
|
||||
* array can not be interpreted as valid tag data, corresponding
|
||||
* to the {@code tagSignature}.
|
||||
* @see #getData
|
||||
*/
|
||||
public void setData(int tagSignature, byte[] tagData) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -324,40 +324,45 @@ public final class Byte extends Number implements Comparable<Byte> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Byte} as a
|
||||
* {@code short}.
|
||||
* Returns the value of this {@code Byte} as a {@code short} after
|
||||
* a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public short shortValue() {
|
||||
return (short)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Byte} as an
|
||||
* {@code int}.
|
||||
* Returns the value of this {@code Byte} as an {@code int} after
|
||||
* a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public int intValue() {
|
||||
return (int)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Byte} as a
|
||||
* {@code long}.
|
||||
* Returns the value of this {@code Byte} as a {@code long} after
|
||||
* a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public long longValue() {
|
||||
return (long)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Byte} as a
|
||||
* {@code float}.
|
||||
* Returns the value of this {@code Byte} as a {@code float} after
|
||||
* a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public float floatValue() {
|
||||
return (float)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Byte} as a
|
||||
* {@code double}.
|
||||
* Returns the value of this {@code Byte} as a {@code double}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public double doubleValue() {
|
||||
return (double)value;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -634,11 +634,12 @@ public final class Double extends Number implements Comparable<Double> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Double} as a {@code byte} (by
|
||||
* casting to a {@code byte}).
|
||||
* Returns the value of this {@code Double} as a {@code byte}
|
||||
* after a narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code double} value represented by this object
|
||||
* converted to type {@code byte}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
* @since JDK1.1
|
||||
*/
|
||||
public byte byteValue() {
|
||||
@ -646,11 +647,12 @@ public final class Double extends Number implements Comparable<Double> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Double} as a
|
||||
* {@code short} (by casting to a {@code short}).
|
||||
* Returns the value of this {@code Double} as a {@code short}
|
||||
* after a narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code double} value represented by this object
|
||||
* converted to type {@code short}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
* @since JDK1.1
|
||||
*/
|
||||
public short shortValue() {
|
||||
@ -658,8 +660,9 @@ public final class Double extends Number implements Comparable<Double> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Double} as an
|
||||
* {@code int} (by casting to type {@code int}).
|
||||
* Returns the value of this {@code Double} as an {@code int}
|
||||
* after a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*
|
||||
* @return the {@code double} value represented by this object
|
||||
* converted to type {@code int}
|
||||
@ -669,22 +672,24 @@ public final class Double extends Number implements Comparable<Double> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Double} as a
|
||||
* {@code long} (by casting to type {@code long}).
|
||||
* Returns the value of this {@code Double} as a {@code long}
|
||||
* after a narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code double} value represented by this object
|
||||
* converted to type {@code long}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public long longValue() {
|
||||
return (long)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@code float} value of this
|
||||
* {@code Double} object.
|
||||
* Returns the value of this {@code Double} as a {@code float}
|
||||
* after a narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code double} value represented by this object
|
||||
* converted to type {@code float}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
* @since JDK1.0
|
||||
*/
|
||||
public float floatValue() {
|
||||
@ -692,8 +697,7 @@ public final class Double extends Number implements Comparable<Double> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@code double} value of this
|
||||
* {@code Double} object.
|
||||
* Returns the {@code double} value of this {@code Double} object.
|
||||
*
|
||||
* @return the {@code double} value represented by this object
|
||||
*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -556,22 +556,24 @@ public final class Float extends Number implements Comparable<Float> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Float} as a {@code byte} (by
|
||||
* casting to a {@code byte}).
|
||||
* Returns the value of this {@code Float} as a {@code byte} after
|
||||
* a narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code float} value represented by this object
|
||||
* converted to type {@code byte}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public byte byteValue() {
|
||||
return (byte)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Float} as a {@code short} (by
|
||||
* casting to a {@code short}).
|
||||
* Returns the value of this {@code Float} as a {@code short}
|
||||
* after a narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code float} value represented by this object
|
||||
* converted to type {@code short}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
* @since JDK1.1
|
||||
*/
|
||||
public short shortValue() {
|
||||
@ -579,22 +581,24 @@ public final class Float extends Number implements Comparable<Float> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Float} as an {@code int} (by
|
||||
* casting to type {@code int}).
|
||||
* Returns the value of this {@code Float} as an {@code int} after
|
||||
* a narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code float} value represented by this object
|
||||
* converted to type {@code int}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public int intValue() {
|
||||
return (int)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns value of this {@code Float} as a {@code long} (by
|
||||
* casting to type {@code long}).
|
||||
* Returns value of this {@code Float} as a {@code long} after a
|
||||
* narrowing primitive conversion.
|
||||
*
|
||||
* @return the {@code float} value represented by this object
|
||||
* converted to type {@code long}
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public long longValue() {
|
||||
return (long)value;
|
||||
@ -610,11 +614,12 @@ public final class Float extends Number implements Comparable<Float> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the {@code double} value of this {@code Float} object.
|
||||
* Returns the value of this {@code Float} as a {@code double}
|
||||
* after a widening primitive conversion.
|
||||
*
|
||||
* @return the {@code float} value represented by this
|
||||
* object is converted to type {@code double} and the
|
||||
* result of the conversion is returned.
|
||||
* object converted to type {@code double}
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public double doubleValue() {
|
||||
return (double)value;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -678,16 +678,18 @@ public final class Integer extends Number implements Comparable<Integer> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Integer} as a
|
||||
* {@code byte}.
|
||||
* Returns the value of this {@code Integer} as a {@code byte}
|
||||
* after a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public byte byteValue() {
|
||||
return (byte)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Integer} as a
|
||||
* {@code short}.
|
||||
* Returns the value of this {@code Integer} as a {@code short}
|
||||
* after a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public short shortValue() {
|
||||
return (short)value;
|
||||
@ -702,24 +704,27 @@ public final class Integer extends Number implements Comparable<Integer> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Integer} as a
|
||||
* {@code long}.
|
||||
* Returns the value of this {@code Integer} as a {@code long}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public long longValue() {
|
||||
return (long)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Integer} as a
|
||||
* {@code float}.
|
||||
* Returns the value of this {@code Integer} as a {@code float}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public float floatValue() {
|
||||
return (float)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Integer} as a
|
||||
* {@code double}.
|
||||
* Returns the value of this {@code Integer} as a {@code double}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public double doubleValue() {
|
||||
return (double)value;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -703,24 +703,27 @@ public final class Long extends Number implements Comparable<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Long} as a
|
||||
* {@code byte}.
|
||||
* Returns the value of this {@code Long} as a {@code byte} after
|
||||
* a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public byte byteValue() {
|
||||
return (byte)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Long} as a
|
||||
* {@code short}.
|
||||
* Returns the value of this {@code Long} as a {@code short} after
|
||||
* a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public short shortValue() {
|
||||
return (short)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Long} as an
|
||||
* {@code int}.
|
||||
* Returns the value of this {@code Long} as an {@code int} after
|
||||
* a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public int intValue() {
|
||||
return (int)value;
|
||||
@ -735,16 +738,18 @@ public final class Long extends Number implements Comparable<Long> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Long} as a
|
||||
* {@code float}.
|
||||
* Returns the value of this {@code Long} as a {@code float} after
|
||||
* a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public float floatValue() {
|
||||
return (float)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Long} as a
|
||||
* {@code double}.
|
||||
* Returns the value of this {@code Long} as a {@code double}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public double doubleValue() {
|
||||
return (double)value;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1994, 2001, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -26,69 +26,78 @@
|
||||
package java.lang;
|
||||
|
||||
/**
|
||||
* The abstract class <code>Number</code> is the superclass of classes
|
||||
* <code>BigDecimal</code>, <code>BigInteger</code>,
|
||||
* <code>Byte</code>, <code>Double</code>, <code>Float</code>,
|
||||
* <code>Integer</code>, <code>Long</code>, and <code>Short</code>.
|
||||
* <p>
|
||||
* Subclasses of <code>Number</code> must provide methods to convert
|
||||
* the represented numeric value to <code>byte</code>, <code>double</code>,
|
||||
* <code>float</code>, <code>int</code>, <code>long</code>, and
|
||||
* <code>short</code>.
|
||||
* The abstract class {@code Number} is the superclass of platform
|
||||
* classes representing numeric values that are convertible to the
|
||||
* primitive types {@code byte}, {@code double}, {@code float}, {@code
|
||||
* int}, {@code long}, and {@code short}.
|
||||
*
|
||||
* The specific semantics of the conversion from the numeric value of
|
||||
* a particular {@code Number} implementation to a given primitive
|
||||
* type is defined by the {@code Number} implementation in question.
|
||||
*
|
||||
* For platform classes, the conversion is often analogous to a
|
||||
* narrowing primitive conversion or a widening primitive conversion
|
||||
* as defining in <cite>The Java™ Language Specification</cite>
|
||||
* for converting between primitive types. Therefore, conversions may
|
||||
* lose information about the overall magnitude of a numeric value, may
|
||||
* lose precision, and may even return a result of a different sign
|
||||
* than the input.
|
||||
*
|
||||
* See the documentation of a given {@code Number} implementation for
|
||||
* conversion details.
|
||||
*
|
||||
* @author Lee Boynton
|
||||
* @author Arthur van Hoff
|
||||
* @see java.lang.Byte
|
||||
* @see java.lang.Double
|
||||
* @see java.lang.Float
|
||||
* @see java.lang.Integer
|
||||
* @see java.lang.Long
|
||||
* @see java.lang.Short
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
* @since JDK1.0
|
||||
*/
|
||||
public abstract class Number implements java.io.Serializable {
|
||||
/**
|
||||
* Returns the value of the specified number as an <code>int</code>.
|
||||
* This may involve rounding or truncation.
|
||||
* Returns the value of the specified number as an {@code int},
|
||||
* which may involve rounding or truncation.
|
||||
*
|
||||
* @return the numeric value represented by this object after conversion
|
||||
* to type <code>int</code>.
|
||||
* to type {@code int}.
|
||||
*/
|
||||
public abstract int intValue();
|
||||
|
||||
/**
|
||||
* Returns the value of the specified number as a <code>long</code>.
|
||||
* This may involve rounding or truncation.
|
||||
* Returns the value of the specified number as a {@code long},
|
||||
* which may involve rounding or truncation.
|
||||
*
|
||||
* @return the numeric value represented by this object after conversion
|
||||
* to type <code>long</code>.
|
||||
* to type {@code long}.
|
||||
*/
|
||||
public abstract long longValue();
|
||||
|
||||
/**
|
||||
* Returns the value of the specified number as a <code>float</code>.
|
||||
* This may involve rounding.
|
||||
* Returns the value of the specified number as a {@code float},
|
||||
* which may involve rounding.
|
||||
*
|
||||
* @return the numeric value represented by this object after conversion
|
||||
* to type <code>float</code>.
|
||||
* to type {@code float}.
|
||||
*/
|
||||
public abstract float floatValue();
|
||||
|
||||
/**
|
||||
* Returns the value of the specified number as a <code>double</code>.
|
||||
* This may involve rounding.
|
||||
* Returns the value of the specified number as a {@code double},
|
||||
* which may involve rounding.
|
||||
*
|
||||
* @return the numeric value represented by this object after conversion
|
||||
* to type <code>double</code>.
|
||||
* to type {@code double}.
|
||||
*/
|
||||
public abstract double doubleValue();
|
||||
|
||||
/**
|
||||
* Returns the value of the specified number as a <code>byte</code>.
|
||||
* This may involve rounding or truncation.
|
||||
* Returns the value of the specified number as a {@code byte},
|
||||
* which may involve rounding or truncation.
|
||||
*
|
||||
* <p>This implementation returns the result of {@link #intValue} cast
|
||||
* to a {@code byte}.
|
||||
*
|
||||
* @return the numeric value represented by this object after conversion
|
||||
* to type <code>byte</code>.
|
||||
* to type {@code byte}.
|
||||
* @since JDK1.1
|
||||
*/
|
||||
public byte byteValue() {
|
||||
@ -96,11 +105,14 @@ public abstract class Number implements java.io.Serializable {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of the specified number as a <code>short</code>.
|
||||
* This may involve rounding or truncation.
|
||||
* Returns the value of the specified number as a {@code short},
|
||||
* which may involve rounding or truncation.
|
||||
*
|
||||
* <p>This implementation returns the result of {@link #intValue} cast
|
||||
* to a {@code short}.
|
||||
*
|
||||
* @return the numeric value represented by this object after conversion
|
||||
* to type <code>short</code>.
|
||||
* to type {@code short}.
|
||||
* @since JDK1.1
|
||||
*/
|
||||
public short shortValue() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -321,8 +321,9 @@ public final class Short extends Number implements Comparable<Short> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Short} as a
|
||||
* {@code byte}.
|
||||
* Returns the value of this {@code Short} as a {@code byte} after
|
||||
* a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public byte byteValue() {
|
||||
return (byte)value;
|
||||
@ -337,32 +338,36 @@ public final class Short extends Number implements Comparable<Short> {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Short} as an
|
||||
* {@code int}.
|
||||
* Returns the value of this {@code Short} as an {@code int} after
|
||||
* a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public int intValue() {
|
||||
return (int)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Short} as a
|
||||
* {@code long}.
|
||||
* Returns the value of this {@code Short} as a {@code long} after
|
||||
* a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public long longValue() {
|
||||
return (long)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Short} as a
|
||||
* {@code float}.
|
||||
* Returns the value of this {@code Short} as a {@code float}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public float floatValue() {
|
||||
return (float)value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code Short} as a
|
||||
* {@code double}.
|
||||
* Returns the value of this {@code Short} as a {@code double}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public double doubleValue() {
|
||||
return (double)value;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -41,21 +41,23 @@ package java.lang.annotation;
|
||||
public class IncompleteAnnotationException extends RuntimeException {
|
||||
private static final long serialVersionUID = 8445097402741811912L;
|
||||
|
||||
private Class annotationType;
|
||||
private Class<? extends Annotation> annotationType;
|
||||
private String elementName;
|
||||
|
||||
|
||||
/**
|
||||
* Constructs an IncompleteAnnotationException to indicate that
|
||||
* the named element was missing from the specified annotation type.
|
||||
*
|
||||
* @param annotationType the Class object for the annotation type
|
||||
* @param elementName the name of the missing element
|
||||
* @throws NullPointerException if either parameter is {@code null}
|
||||
*/
|
||||
public IncompleteAnnotationException(
|
||||
Class<? extends Annotation> annotationType,
|
||||
String elementName) {
|
||||
super(annotationType.getName() + " missing element " + elementName);
|
||||
super(annotationType.getName().toString() +
|
||||
" missing element " +
|
||||
elementName.toString());
|
||||
|
||||
this.annotationType = annotationType;
|
||||
this.elementName = elementName;
|
||||
|
@ -405,13 +405,13 @@ class AdapterMethodHandle extends BoundMethodHandle {
|
||||
insertStackMove(stackMove)
|
||||
);
|
||||
}
|
||||
private static long makeSwapConv(int convOp, int srcArg, byte type, int destSlot) {
|
||||
private static long makeSwapConv(int convOp, int srcArg, byte srcType, int destSlot, byte destType) {
|
||||
// more complex argument motion, requiring two slots to specify
|
||||
assert(convOp == OP_SWAP_ARGS || convOp == OP_ROT_ARGS);
|
||||
return ((long) srcArg << 32 |
|
||||
(long) convOp << CONV_OP_SHIFT |
|
||||
(int) type << CONV_SRC_TYPE_SHIFT |
|
||||
(int) type << CONV_DEST_TYPE_SHIFT |
|
||||
(int) srcType << CONV_SRC_TYPE_SHIFT |
|
||||
(int) destType << CONV_DEST_TYPE_SHIFT |
|
||||
(int) destSlot << CONV_VMINFO_SHIFT
|
||||
);
|
||||
}
|
||||
@ -943,24 +943,27 @@ class AdapterMethodHandle extends BoundMethodHandle {
|
||||
if (type2size(newType.parameterType(swapArg1)) !=
|
||||
type2size(newType.parameterType(swapArg2))) {
|
||||
// turn a swap into a pair of rotates:
|
||||
// [x a b c y] => [a b c y x] => [y a b c x]
|
||||
// [x a b c y] rot2(-1,argc=5) => [a b c y x] rot1(+1,argc=4) => target[y a b c x]
|
||||
int argc = swapArg2 - swapArg1 + 1;
|
||||
final int ROT = 1;
|
||||
ArrayList<Class<?>> rot1Params = new ArrayList<Class<?>>(target.type().parameterList());
|
||||
Collections.rotate(rot1Params.subList(swapArg1, swapArg1 + argc), -ROT);
|
||||
MethodType rot1Type = MethodType.methodType(target.type().returnType(), rot1Params);
|
||||
MethodHandle rot1 = makeRotateArguments(rot1Type, target, swapArg1, argc, +ROT);
|
||||
assert(rot1 != null);
|
||||
if (argc == 2) return rot1;
|
||||
MethodHandle rot2 = makeRotateArguments(newType, rot1, swapArg1, argc-1, -ROT);
|
||||
assert(rot2 != null);
|
||||
return rot2;
|
||||
}
|
||||
if (!canSwapArguments(newType, target.type(), swapArg1, swapArg2))
|
||||
return null;
|
||||
Class<?> swapType = newType.parameterType(swapArg1);
|
||||
Class<?> type1 = newType.parameterType(swapArg1);
|
||||
Class<?> type2 = newType.parameterType(swapArg2);
|
||||
// in arglist: [0: ...keep1 | pos1: a1 | pos1+1: keep2... | pos2: a2 | pos2+1: keep3... ]
|
||||
// out arglist: [0: ...keep1 | pos1: a2 | pos1+1: keep2... | pos2: a1 | pos2+1: keep3... ]
|
||||
int swapSlot2 = newType.parameterSlotDepth(swapArg2 + 1);
|
||||
long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(swapType), swapSlot2);
|
||||
long conv = makeSwapConv(OP_SWAP_ARGS, swapArg1, basicType(type1), swapSlot2, basicType(type2));
|
||||
return new AdapterMethodHandle(target, newType, conv);
|
||||
}
|
||||
|
||||
@ -1029,16 +1032,16 @@ class AdapterMethodHandle extends BoundMethodHandle {
|
||||
assert(MAX_ARG_ROTATION == 1);
|
||||
int srcArg, dstArg;
|
||||
int dstSlot;
|
||||
byte basicType;
|
||||
if (chunk2Slots <= chunk1Slots) {
|
||||
int moveChunk;
|
||||
if (rotateBy == 1) {
|
||||
// Rotate right/down N (rotateBy = +N, N small, c2 small):
|
||||
// in arglist: [0: ...keep1 | arg1: c1... | limit-N: c2 | limit: keep2... ]
|
||||
// out arglist: [0: ...keep1 | arg1: c2 | arg1+N: c1... | limit: keep2... ]
|
||||
srcArg = limit-1;
|
||||
dstArg = firstArg;
|
||||
dstSlot = depth0 - chunk2Slots;
|
||||
basicType = basicType(newType.parameterType(srcArg));
|
||||
assert(chunk2Slots == type2size(basicType));
|
||||
//dstSlot = depth0 - chunk2Slots; //chunk2Slots is not relevant
|
||||
dstSlot = depth0 + MethodHandleNatives.OP_ROT_ARGS_DOWN_LIMIT_BIAS;
|
||||
moveChunk = chunk2Slots;
|
||||
} else {
|
||||
// Rotate left/up N (rotateBy = -N, N small, c1 small):
|
||||
// in arglist: [0: ...keep1 | arg1: c1 | arg1+N: c2... | limit: keep2... ]
|
||||
@ -1046,10 +1049,12 @@ class AdapterMethodHandle extends BoundMethodHandle {
|
||||
srcArg = firstArg;
|
||||
dstArg = limit-1;
|
||||
dstSlot = depth2;
|
||||
basicType = basicType(newType.parameterType(srcArg));
|
||||
assert(chunk1Slots == type2size(basicType));
|
||||
moveChunk = chunk1Slots;
|
||||
}
|
||||
long conv = makeSwapConv(OP_ROT_ARGS, srcArg, basicType, dstSlot);
|
||||
byte srcType = basicType(newType.parameterType(srcArg));
|
||||
byte dstType = basicType(newType.parameterType(dstArg));
|
||||
assert(moveChunk == type2size(srcType));
|
||||
long conv = makeSwapConv(OP_ROT_ARGS, srcArg, srcType, dstSlot, dstType);
|
||||
return new AdapterMethodHandle(target, newType, conv);
|
||||
}
|
||||
|
||||
|
@ -788,6 +788,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
.insertParameterTypes(keepPosArgs, arrayType);
|
||||
return spreadArguments(target, newType, keepPosArgs, arrayType, arrayLength);
|
||||
}
|
||||
// called internally only
|
||||
static MethodHandle spreadArgumentsFromPos(MethodHandle target, MethodType newType, int spreadArgPos) {
|
||||
int arrayLength = target.type().parameterCount() - spreadArgPos;
|
||||
return spreadArguments(target, newType, spreadArgPos, Object[].class, arrayLength);
|
||||
@ -849,6 +850,12 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
MethodType ttype = target.type();
|
||||
MethodType ftype = filter.type();
|
||||
assert(ftype.parameterCount() == 1);
|
||||
MethodHandle result = null;
|
||||
if (AdapterMethodHandle.canCollectArguments(ttype, ftype, pos, false)) {
|
||||
result = AdapterMethodHandle.makeCollectArguments(target, filter, pos, false);
|
||||
if (result != null) return result;
|
||||
}
|
||||
assert(MethodHandleNatives.workaroundWithoutRicochetFrames()); // this code is deprecated
|
||||
MethodType rtype = ttype.changeParameterType(pos, ftype.parameterType(0));
|
||||
MethodType gttype = ttype.generic();
|
||||
if (ttype != gttype) {
|
||||
@ -860,18 +867,11 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
filter = convertArguments(filter, gftype, ftype, 0);
|
||||
ftype = gftype;
|
||||
}
|
||||
MethodHandle result = null;
|
||||
if (AdapterMethodHandle.canCollectArguments(ttype, ftype, pos, false)) {
|
||||
result = AdapterMethodHandle.makeCollectArguments(target, filter, pos, false);
|
||||
}
|
||||
if (result == null) {
|
||||
assert(MethodHandleNatives.workaroundWithoutRicochetFrames()); // this code is deprecated
|
||||
if (ftype == ttype) {
|
||||
if (ftype == ttype) {
|
||||
// simple unary case
|
||||
result = FilterOneArgument.make(filter, target);
|
||||
} else {
|
||||
result = FilterGeneric.makeArgumentFilter(pos, filter, target);
|
||||
}
|
||||
result = FilterOneArgument.make(filter, target);
|
||||
} else {
|
||||
result = FilterGeneric.makeArgumentFilter(pos, filter, target);
|
||||
}
|
||||
if (result.type() != rtype)
|
||||
result = result.asType(rtype);
|
||||
@ -920,7 +920,7 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
this.fallback = fallback;
|
||||
}
|
||||
static boolean preferRicochetFrame(MethodType type) {
|
||||
return (type.parameterCount() >= INVOKES.length || type.hasPrimitives());
|
||||
return true; // always use RF if available
|
||||
}
|
||||
static MethodHandle make(MethodHandle test, MethodHandle target, MethodHandle fallback) {
|
||||
MethodType type = target.type();
|
||||
@ -931,12 +931,13 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
MethodHandle invoke = INVOKES[nargs];
|
||||
MethodType gtype = type.generic();
|
||||
assert(invoke.type().dropParameterTypes(0,1) == gtype);
|
||||
MethodHandle gtest = convertArguments(test, gtype.changeReturnType(boolean.class), test.type(), 0);
|
||||
MethodHandle gtarget = convertArguments(target, gtype, type, 0);
|
||||
MethodHandle gfallback = convertArguments(fallback, gtype, type, 0);
|
||||
// Note: convertArguments(...2) avoids interface casts present in convertArguments(...0)
|
||||
MethodHandle gtest = convertArguments(test, gtype.changeReturnType(boolean.class), test.type(), 2);
|
||||
MethodHandle gtarget = convertArguments(target, gtype, type, 2);
|
||||
MethodHandle gfallback = convertArguments(fallback, gtype, type, 2);
|
||||
if (gtest == null || gtarget == null || gfallback == null) return null;
|
||||
MethodHandle gguard = new GuardWithTest(invoke, gtest, gtarget, gfallback);
|
||||
return convertArguments(gguard, type, gtype, 0);
|
||||
return convertArguments(gguard, type, gtype, 2);
|
||||
} else {
|
||||
assert(MethodHandleNatives.workaroundWithoutRicochetFrames()); // this code is deprecated
|
||||
MethodHandle invoke = VARARGS_INVOKE;
|
||||
@ -1221,11 +1222,12 @@ import static java.lang.invoke.MethodHandles.Lookup.IMPL_LOOKUP;
|
||||
if (nargs < GuardWithCatch.INVOKES.length) {
|
||||
MethodType gtype = type.generic();
|
||||
MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
|
||||
MethodHandle gtarget = convertArguments(target, gtype, type, 0);
|
||||
MethodHandle gcatcher = convertArguments(catcher, gcatchType, ctype, 0);
|
||||
// Note: convertArguments(...2) avoids interface casts present in convertArguments(...0)
|
||||
MethodHandle gtarget = convertArguments(target, gtype, type, 2);
|
||||
MethodHandle gcatcher = convertArguments(catcher, gcatchType, ctype, 2);
|
||||
MethodHandle gguard = new GuardWithCatch(gtarget, exType, gcatcher);
|
||||
if (gtarget == null || gcatcher == null || gguard == null) return null;
|
||||
return convertArguments(gguard, type, gtype, 0);
|
||||
return convertArguments(gguard, type, gtype, 2);
|
||||
} else {
|
||||
MethodType gtype = MethodType.genericMethodType(0, true);
|
||||
MethodType gcatchType = gtype.insertParameterTypes(0, Throwable.class);
|
||||
|
@ -118,32 +118,20 @@ class MethodHandleNatives {
|
||||
/** Derived mode flag. Only false on some old JVM implementations. */
|
||||
static final boolean HAVE_RICOCHET_FRAMES;
|
||||
|
||||
static final int OP_ROT_ARGS_DOWN_LIMIT_BIAS;
|
||||
|
||||
private static native void registerNatives();
|
||||
static {
|
||||
int JVM_PUSH_LIMIT_;
|
||||
int JVM_STACK_MOVE_UNIT_;
|
||||
int CONV_OP_IMPLEMENTED_MASK_;
|
||||
try {
|
||||
registerNatives();
|
||||
JVM_PUSH_LIMIT_ = getConstant(Constants.GC_JVM_PUSH_LIMIT);
|
||||
JVM_STACK_MOVE_UNIT_ = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
|
||||
CONV_OP_IMPLEMENTED_MASK_ = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
|
||||
//sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
|
||||
} catch (UnsatisfiedLinkError ee) {
|
||||
// ignore; if we use init() methods later we'll see linkage errors
|
||||
JVM_PUSH_LIMIT_ = 3; // arbitrary
|
||||
JVM_STACK_MOVE_UNIT_ = -1; // arbitrary
|
||||
CONV_OP_IMPLEMENTED_MASK_ = 0;
|
||||
JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
|
||||
JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
|
||||
throw ee; // just die; hopeless to try to run with an older JVM
|
||||
}
|
||||
JVM_PUSH_LIMIT = JVM_PUSH_LIMIT_;
|
||||
JVM_STACK_MOVE_UNIT = JVM_STACK_MOVE_UNIT_;
|
||||
if (CONV_OP_IMPLEMENTED_MASK_ == 0)
|
||||
CONV_OP_IMPLEMENTED_MASK_ = DEFAULT_CONV_OP_IMPLEMENTED_MASK;
|
||||
CONV_OP_IMPLEMENTED_MASK = CONV_OP_IMPLEMENTED_MASK_;
|
||||
HAVE_RICOCHET_FRAMES = (CONV_OP_IMPLEMENTED_MASK & (1<<OP_COLLECT_ARGS)) != 0;
|
||||
registerNatives();
|
||||
int k;
|
||||
JVM_PUSH_LIMIT = getConstant(Constants.GC_JVM_PUSH_LIMIT);
|
||||
JVM_STACK_MOVE_UNIT = getConstant(Constants.GC_JVM_STACK_MOVE_UNIT);
|
||||
k = getConstant(Constants.GC_CONV_OP_IMPLEMENTED_MASK);
|
||||
CONV_OP_IMPLEMENTED_MASK = (k != 0) ? k : DEFAULT_CONV_OP_IMPLEMENTED_MASK;
|
||||
k = getConstant(Constants.GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS);
|
||||
OP_ROT_ARGS_DOWN_LIMIT_BIAS = (k != 0) ? (byte)k : -1;
|
||||
HAVE_RICOCHET_FRAMES = (CONV_OP_IMPLEMENTED_MASK & (1<<OP_COLLECT_ARGS)) != 0;
|
||||
//sun.reflect.Reflection.registerMethodsToFilter(MethodHandleImpl.class, "init");
|
||||
}
|
||||
|
||||
// All compile-time constants go here.
|
||||
@ -154,7 +142,8 @@ class MethodHandleNatives {
|
||||
static final int // for getConstant
|
||||
GC_JVM_PUSH_LIMIT = 0,
|
||||
GC_JVM_STACK_MOVE_UNIT = 1,
|
||||
GC_CONV_OP_IMPLEMENTED_MASK = 2;
|
||||
GC_CONV_OP_IMPLEMENTED_MASK = 2,
|
||||
GC_OP_ROT_ARGS_DOWN_LIMIT_BIAS = 3;
|
||||
static final int
|
||||
ETF_HANDLE_OR_METHOD_NAME = 0, // all available data (immediate MH or method)
|
||||
ETF_DIRECT_HANDLE = 1, // ultimate method handle (will be a DMH, may be self)
|
||||
|
@ -134,7 +134,7 @@ public class SwitchPoint {
|
||||
* to return true for {@code hasBeenInvalidated},
|
||||
* it will always do so in the future.
|
||||
* On the other hand, a valid switch point visible to other threads may
|
||||
* invalidated at any moment, due to a request by another thread.
|
||||
* be invalidated at any moment, due to a request by another thread.
|
||||
* <p style="font-size:smaller;">
|
||||
* Since invalidation is a global and immediate operation,
|
||||
* the execution of this query, on a valid switchpoint,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -35,4 +35,22 @@ package java.lang.reflect;
|
||||
*/
|
||||
public class GenericSignatureFormatError extends ClassFormatError {
|
||||
private static final long serialVersionUID = 6709919147137911034L;
|
||||
|
||||
/**
|
||||
* Constructs a new {@code GenericSignatureFormatError}.
|
||||
*
|
||||
*/
|
||||
public GenericSignatureFormatError() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a new {@code GenericSignatureFormatError} with the
|
||||
* specified message.
|
||||
*
|
||||
* @param message the detail message, may be {@code null}
|
||||
*/
|
||||
public GenericSignatureFormatError(String message) {
|
||||
super(message);
|
||||
}
|
||||
}
|
||||
|
@ -1013,6 +1013,12 @@ class InetAddress implements java.io.Serializable {
|
||||
return InetAddress.getAllByName(host)[0];
|
||||
}
|
||||
|
||||
// called from deployment cache manager
|
||||
private static InetAddress getByName(String host, InetAddress reqAddr)
|
||||
throws UnknownHostException {
|
||||
return InetAddress.getAllByName(host, reqAddr)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Given the name of a host, returns an array of its IP addresses,
|
||||
* based on the configured name service on the system.
|
||||
@ -1054,6 +1060,11 @@ class InetAddress implements java.io.Serializable {
|
||||
*/
|
||||
public static InetAddress[] getAllByName(String host)
|
||||
throws UnknownHostException {
|
||||
return getAllByName(host, null);
|
||||
}
|
||||
|
||||
private static InetAddress[] getAllByName(String host, InetAddress reqAddr)
|
||||
throws UnknownHostException {
|
||||
|
||||
if (host == null || host.length() == 0) {
|
||||
InetAddress[] ret = new InetAddress[1];
|
||||
@ -1113,7 +1124,7 @@ class InetAddress implements java.io.Serializable {
|
||||
// We were expecting an IPv6 Litteral, but got something else
|
||||
throw new UnknownHostException("["+host+"]");
|
||||
}
|
||||
return getAllByName0(host);
|
||||
return getAllByName0(host, reqAddr, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1174,6 +1185,12 @@ class InetAddress implements java.io.Serializable {
|
||||
*/
|
||||
static InetAddress[] getAllByName0 (String host, boolean check)
|
||||
throws UnknownHostException {
|
||||
return getAllByName0 (host, null, check);
|
||||
}
|
||||
|
||||
private static InetAddress[] getAllByName0 (String host, InetAddress reqAddr, boolean check)
|
||||
throws UnknownHostException {
|
||||
|
||||
/* If it gets here it is presumed to be a hostname */
|
||||
/* Cache.get can return: null, unknownAddress, or InetAddress[] */
|
||||
|
||||
@ -1191,7 +1208,7 @@ class InetAddress implements java.io.Serializable {
|
||||
|
||||
/* If no entry in cache, then do the host lookup */
|
||||
if (addresses == null) {
|
||||
addresses = getAddressesFromNameService(host);
|
||||
addresses = getAddressesFromNameService(host, reqAddr);
|
||||
}
|
||||
|
||||
if (addresses == unknown_array)
|
||||
@ -1200,7 +1217,7 @@ class InetAddress implements java.io.Serializable {
|
||||
return addresses.clone();
|
||||
}
|
||||
|
||||
private static InetAddress[] getAddressesFromNameService(String host)
|
||||
private static InetAddress[] getAddressesFromNameService(String host, InetAddress reqAddr)
|
||||
throws UnknownHostException
|
||||
{
|
||||
InetAddress[] addresses = null;
|
||||
@ -1256,10 +1273,32 @@ class InetAddress implements java.io.Serializable {
|
||||
}
|
||||
}
|
||||
|
||||
// Cache the addresses.
|
||||
// More to do?
|
||||
if (reqAddr != null && addresses.length > 1 && !addresses[0].equals(reqAddr)) {
|
||||
// Find it?
|
||||
int i = 1;
|
||||
for (; i < addresses.length; i++) {
|
||||
if (addresses[i].equals(reqAddr)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Rotate
|
||||
if (i < addresses.length) {
|
||||
InetAddress tmp, tmp2 = reqAddr;
|
||||
for (int j = 0; j < i; j++) {
|
||||
tmp = addresses[j];
|
||||
addresses[j] = tmp2;
|
||||
tmp2 = tmp;
|
||||
}
|
||||
addresses[i] = tmp2;
|
||||
}
|
||||
}
|
||||
// Cache the address.
|
||||
cacheAddresses(host, addresses, success);
|
||||
|
||||
if (!success && ex != null)
|
||||
throw ex;
|
||||
|
||||
} finally {
|
||||
// Delete host from the lookupTable and notify
|
||||
// all threads waiting on the lookupTable monitor.
|
||||
@ -1393,7 +1432,7 @@ class InetAddress implements java.io.Serializable {
|
||||
InetAddress[] localAddrs;
|
||||
try {
|
||||
localAddrs =
|
||||
InetAddress.getAddressesFromNameService(local);
|
||||
InetAddress.getAddressesFromNameService(local, null);
|
||||
} catch (UnknownHostException uhe) {
|
||||
// Rethrow with a more informative error message.
|
||||
UnknownHostException uhe2 =
|
||||
|
@ -547,13 +547,8 @@ public final class NetworkInterface {
|
||||
if (displayName != null) {
|
||||
result += " (" + displayName + ")";
|
||||
}
|
||||
result += " index: "+index+" addresses:\n";
|
||||
for (Enumeration e = getInetAddresses(); e.hasMoreElements(); ) {
|
||||
InetAddress addr = (InetAddress)e.nextElement();
|
||||
result += addr+";\n";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private static native void init();
|
||||
|
||||
private static native void init();
|
||||
}
|
||||
|
@ -127,11 +127,12 @@ class Socket implements java.io.Closeable {
|
||||
}
|
||||
if (security != null) {
|
||||
if (epoint.isUnresolved())
|
||||
security.checkConnect(epoint.getHostName(),
|
||||
epoint.getPort());
|
||||
epoint = new InetSocketAddress(epoint.getHostName(), epoint.getPort());
|
||||
if (epoint.isUnresolved())
|
||||
security.checkConnect(epoint.getHostName(), epoint.getPort());
|
||||
else
|
||||
security.checkConnect(epoint.getAddress().getHostAddress(),
|
||||
epoint.getPort());
|
||||
epoint.getPort());
|
||||
}
|
||||
impl = new SocksSocketImpl(p);
|
||||
impl.setSocket(this);
|
||||
|
@ -40,7 +40,9 @@ import java.io.ObjectOutputStream;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.IOException;
|
||||
import sun.net.util.IPAddressUtil;
|
||||
import sun.net.RegisteredDomain;
|
||||
import sun.security.util.SecurityConstants;
|
||||
import sun.security.util.Debug;
|
||||
|
||||
|
||||
/**
|
||||
@ -211,13 +213,32 @@ implements java.io.Serializable
|
||||
// port range on host
|
||||
private transient int[] portrange;
|
||||
|
||||
// true if the trustProxy system property is set
|
||||
private static boolean trustProxy;
|
||||
private transient boolean defaultDeny = false;
|
||||
|
||||
// true if this SocketPermission represents a hostname
|
||||
// that failed our reverse mapping heuristic test
|
||||
private transient boolean untrusted;
|
||||
private transient boolean trusted;
|
||||
|
||||
// true if the sun.net.trustNameService system property is set
|
||||
private static boolean trustNameService;
|
||||
|
||||
private static Debug debug = null;
|
||||
private static boolean debugInit = false;
|
||||
|
||||
static {
|
||||
Boolean tmp = java.security.AccessController.doPrivileged(
|
||||
new sun.security.action.GetBooleanAction("trustProxy"));
|
||||
trustProxy = tmp.booleanValue();
|
||||
new sun.security.action.GetBooleanAction("sun.net.trustNameService"));
|
||||
trustNameService = tmp.booleanValue();
|
||||
}
|
||||
|
||||
private static synchronized Debug getDebug()
|
||||
{
|
||||
if (!debugInit) {
|
||||
debug = Debug.getInstance("access");
|
||||
debugInit = true;
|
||||
}
|
||||
return debug;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -263,6 +284,10 @@ implements java.io.Serializable
|
||||
init(getName(), mask);
|
||||
}
|
||||
|
||||
private void setDeny() {
|
||||
defaultDeny = true;
|
||||
}
|
||||
|
||||
private static String getHost(String host)
|
||||
{
|
||||
if (host.equals("")) {
|
||||
@ -560,6 +585,37 @@ implements java.io.Serializable
|
||||
return mask;
|
||||
}
|
||||
|
||||
private boolean isUntrusted()
|
||||
throws UnknownHostException
|
||||
{
|
||||
if (trusted) return false;
|
||||
if (invalid || untrusted) return true;
|
||||
try {
|
||||
if (!trustNameService && (defaultDeny ||
|
||||
sun.net.www.URLConnection.isProxiedHost(hostname))) {
|
||||
if (this.cname == null) {
|
||||
this.getCanonName();
|
||||
}
|
||||
if (!match(cname, hostname)) {
|
||||
// Last chance
|
||||
if (!authorized(hostname, addresses[0].getAddress())) {
|
||||
untrusted = true;
|
||||
Debug debug = getDebug();
|
||||
if (debug != null && Debug.isOn("failure")) {
|
||||
debug.println("socket access restriction: proxied host " + "(" + addresses[0] + ")" + " does not match " + cname + " from reverse lookup");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
trusted = true;
|
||||
}
|
||||
} catch (UnknownHostException uhe) {
|
||||
invalid = true;
|
||||
throw uhe;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* attempt to get the fully qualified domain name
|
||||
*
|
||||
@ -567,7 +623,7 @@ implements java.io.Serializable
|
||||
void getCanonName()
|
||||
throws UnknownHostException
|
||||
{
|
||||
if (cname != null || invalid) return;
|
||||
if (cname != null || invalid || untrusted) return;
|
||||
|
||||
// attempt to get the canonical name
|
||||
|
||||
@ -593,6 +649,96 @@ implements java.io.Serializable
|
||||
}
|
||||
}
|
||||
|
||||
private transient String cdomain, hdomain;
|
||||
|
||||
private boolean match(String cname, String hname) {
|
||||
String a = cname.toLowerCase();
|
||||
String b = hname.toLowerCase();
|
||||
if (a.startsWith(b) &&
|
||||
((a.length() == b.length()) || (a.charAt(b.length()) == '.')))
|
||||
return true;
|
||||
if (cdomain == null) {
|
||||
cdomain = RegisteredDomain.getRegisteredDomain(a);
|
||||
}
|
||||
if (hdomain == null) {
|
||||
hdomain = RegisteredDomain.getRegisteredDomain(b);
|
||||
}
|
||||
|
||||
return cdomain.length() != 0 && hdomain.length() != 0
|
||||
&& cdomain.equals(hdomain);
|
||||
}
|
||||
|
||||
private boolean authorized(String cname, byte[] addr) {
|
||||
if (addr.length == 4)
|
||||
return authorizedIPv4(cname, addr);
|
||||
else if (addr.length == 16)
|
||||
return authorizedIPv6(cname, addr);
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean authorizedIPv4(String cname, byte[] addr) {
|
||||
String authHost = "";
|
||||
InetAddress auth;
|
||||
|
||||
try {
|
||||
authHost = "auth." +
|
||||
(addr[3] & 0xff) + "." + (addr[2] & 0xff) + "." +
|
||||
(addr[1] & 0xff) + "." + (addr[0] & 0xff) +
|
||||
".in-addr.arpa";
|
||||
// Following check seems unnecessary
|
||||
// auth = InetAddress.getAllByName0(authHost, false)[0];
|
||||
authHost = hostname + '.' + authHost;
|
||||
auth = InetAddress.getAllByName0(authHost, false)[0];
|
||||
if (auth.equals(InetAddress.getByAddress(addr))) {
|
||||
return true;
|
||||
}
|
||||
Debug debug = getDebug();
|
||||
if (debug != null && Debug.isOn("failure")) {
|
||||
debug.println("socket access restriction: IP address of " + auth + " != " + InetAddress.getByAddress(addr));
|
||||
}
|
||||
} catch (UnknownHostException uhe) {
|
||||
Debug debug = getDebug();
|
||||
if (debug != null && Debug.isOn("failure")) {
|
||||
debug.println("socket access restriction: forward lookup failed for " + authHost);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean authorizedIPv6(String cname, byte[] addr) {
|
||||
String authHost = "";
|
||||
InetAddress auth;
|
||||
|
||||
try {
|
||||
StringBuffer sb = new StringBuffer(39);
|
||||
|
||||
for (int i = 15; i >= 0; i--) {
|
||||
sb.append(Integer.toHexString(((addr[i]) & 0x0f)));
|
||||
sb.append('.');
|
||||
sb.append(Integer.toHexString(((addr[i] >> 4) & 0x0f)));
|
||||
sb.append('.');
|
||||
}
|
||||
authHost = "auth." + sb.toString() + "IP6.ARPA";
|
||||
//auth = InetAddress.getAllByName0(authHost, false)[0];
|
||||
authHost = hostname + '.' + authHost;
|
||||
auth = InetAddress.getAllByName0(authHost, false)[0];
|
||||
if (auth.equals(InetAddress.getByAddress(addr)))
|
||||
return true;
|
||||
Debug debug = getDebug();
|
||||
if (debug != null && Debug.isOn("failure")) {
|
||||
debug.println("socket access restriction: IP address of " + auth + " != " + InetAddress.getByAddress(addr));
|
||||
}
|
||||
} catch (UnknownHostException uhe) {
|
||||
Debug debug = getDebug();
|
||||
if (debug != null && Debug.isOn("failure")) {
|
||||
debug.println("socket access restriction: forward lookup failed for " + authHost);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* get IP addresses. Sets invalid to true if we can't get them.
|
||||
*
|
||||
@ -720,12 +866,7 @@ implements java.io.Serializable
|
||||
|
||||
// return if either one of these NetPerm objects are invalid...
|
||||
if (this.invalid || that.invalid) {
|
||||
return (trustProxy ? inProxyWeTrust(that) : false);
|
||||
}
|
||||
|
||||
|
||||
if (this.getName().equalsIgnoreCase(that.getName())) {
|
||||
return true;
|
||||
return compareHostnames(that);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -778,28 +919,29 @@ implements java.io.Serializable
|
||||
that.getIP();
|
||||
}
|
||||
|
||||
for (j = 0; j < this.addresses.length; j++) {
|
||||
for (i=0; i < that.addresses.length; i++) {
|
||||
if (this.addresses[j].equals(that.addresses[i]))
|
||||
return true;
|
||||
if (!(that.init_with_ip && this.isUntrusted())) {
|
||||
for (j = 0; j < this.addresses.length; j++) {
|
||||
for (i=0; i < that.addresses.length; i++) {
|
||||
if (this.addresses[j].equals(that.addresses[i]))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// XXX: if all else fails, compare hostnames?
|
||||
// Do we really want this?
|
||||
if (this.cname == null) {
|
||||
this.getCanonName();
|
||||
}
|
||||
// XXX: if all else fails, compare hostnames?
|
||||
// Do we really want this?
|
||||
if (this.cname == null) {
|
||||
this.getCanonName();
|
||||
}
|
||||
|
||||
if (that.cname == null) {
|
||||
that.getCanonName();
|
||||
}
|
||||
if (that.cname == null) {
|
||||
that.getCanonName();
|
||||
}
|
||||
|
||||
return (this.cname.equalsIgnoreCase(that.cname));
|
||||
return (this.cname.equalsIgnoreCase(that.cname));
|
||||
}
|
||||
|
||||
} catch (UnknownHostException uhe) {
|
||||
if (trustProxy)
|
||||
return inProxyWeTrust(that);
|
||||
return compareHostnames(that);
|
||||
}
|
||||
|
||||
// make sure the first thing that is done here is to return
|
||||
@ -808,9 +950,8 @@ implements java.io.Serializable
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean inProxyWeTrust(SocketPermission that) {
|
||||
// if we trust the proxy, we see if the original names/IPs passed
|
||||
// in were equal.
|
||||
private boolean compareHostnames(SocketPermission that) {
|
||||
// we see if the original names/IPs passed in were equal.
|
||||
|
||||
String thisHost = hostname;
|
||||
String thatHost = that.hostname;
|
||||
@ -819,8 +960,8 @@ implements java.io.Serializable
|
||||
return false;
|
||||
else
|
||||
return thisHost.equalsIgnoreCase(thatHost);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks two SocketPermission objects for equality.
|
||||
* <P>
|
||||
|
@ -460,15 +460,13 @@ public interface Path
|
||||
/**
|
||||
* Returns a URI to represent this path.
|
||||
*
|
||||
* <p> This method constructs a hierarchical {@link URI} that is absolute
|
||||
* with a non-empty path component. Its {@link URI#getScheme() scheme} is
|
||||
* equal to the URI scheme that identifies the provider. The exact form of
|
||||
* the other URI components is highly provider dependent. In particular, it
|
||||
* is implementation dependent if its query, fragment, and authority
|
||||
* components are defined or undefined.
|
||||
* <p> This method constructs an absolute {@link URI} with a {@link
|
||||
* URI#getScheme() scheme} equal to the URI scheme that identifies the
|
||||
* provider. The exact form of the scheme specific part is highly provider
|
||||
* dependent.
|
||||
*
|
||||
* <p> For the default provider the {@link URI#getPath() path} component
|
||||
* will represent the {@link #toAbsolutePath absolute} path; the query,
|
||||
* <p> In the case of the default provider, the URI is hierarchical with
|
||||
* a {@link URI#getPath() path} component that is absolute. The query and
|
||||
* fragment components are undefined. Whether the authority component is
|
||||
* defined or not is implementation dependent. There is no guarantee that
|
||||
* the {@code URI} may be used to construct a {@link java.io.File java.io.File}.
|
||||
@ -497,7 +495,7 @@ public interface Path
|
||||
* A format for compound URIs is not defined in this release; such a scheme
|
||||
* may be added in a future release.
|
||||
*
|
||||
* @return an absolute, hierarchical URI with a non-empty path component
|
||||
* @return the URI representing this path
|
||||
*
|
||||
* @throws java.io.IOError
|
||||
* if an I/O error occurs obtaining the absolute path, or where a
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -118,15 +118,17 @@ public final class UID implements Serializable {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
long now = System.currentTimeMillis();
|
||||
if (now <= lastTime) {
|
||||
if (now == lastTime) {
|
||||
// wait for time to change
|
||||
try {
|
||||
Thread.currentThread().sleep(1);
|
||||
Thread.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
interrupted = true;
|
||||
}
|
||||
} else {
|
||||
lastTime = now;
|
||||
// If system time has gone backwards increase
|
||||
// original by 1ms to maintain uniqueness
|
||||
lastTime = (now < lastTime) ? lastTime+1 : now;
|
||||
lastCount = Short.MIN_VALUE;
|
||||
done = true;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -249,10 +249,10 @@ public final class SignedObject implements Serializable {
|
||||
* a stream.
|
||||
*/
|
||||
private void readObject(java.io.ObjectInputStream s)
|
||||
throws java.io.IOException, ClassNotFoundException
|
||||
{
|
||||
s.defaultReadObject();
|
||||
content = content.clone();
|
||||
signature = signature.clone();
|
||||
throws java.io.IOException, ClassNotFoundException {
|
||||
java.io.ObjectInputStream.GetField fields = s.readFields();
|
||||
content = ((byte[])fields.get("content", null)).clone();
|
||||
signature = ((byte[])fields.get("signature", null)).clone();
|
||||
thealgorithm = (String)fields.get("thealgorithm", null);
|
||||
}
|
||||
}
|
||||
|
@ -79,7 +79,8 @@ public class BatchUpdateException extends SQLException {
|
||||
*/
|
||||
public BatchUpdateException( String reason, String SQLState, int vendorCode,
|
||||
int[] updateCounts ) {
|
||||
this(reason, SQLState, vendorCode, updateCounts, null);
|
||||
super(reason, SQLState, vendorCode);
|
||||
this.updateCounts = (updateCounts == null) ? null : Arrays.copyOf(updateCounts, updateCounts.length);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -106,7 +107,7 @@ public class BatchUpdateException extends SQLException {
|
||||
*/
|
||||
public BatchUpdateException(String reason, String SQLState,
|
||||
int[] updateCounts) {
|
||||
this(reason, SQLState, 0, updateCounts, null);
|
||||
this(reason, SQLState, 0, updateCounts);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -132,7 +133,7 @@ public class BatchUpdateException extends SQLException {
|
||||
* @since 1.2
|
||||
*/
|
||||
public BatchUpdateException(String reason, int[] updateCounts) {
|
||||
this(reason, null, 0, updateCounts, null);
|
||||
this(reason, null, 0, updateCounts);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -155,7 +156,7 @@ public class BatchUpdateException extends SQLException {
|
||||
* @since 1.2
|
||||
*/
|
||||
public BatchUpdateException(int[] updateCounts) {
|
||||
this(null, null, 0, updateCounts, null);
|
||||
this(null, null, 0, updateCounts);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -170,7 +171,7 @@ public class BatchUpdateException extends SQLException {
|
||||
* @since 1.2
|
||||
*/
|
||||
public BatchUpdateException() {
|
||||
this(null, null, 0, null, null);
|
||||
this(null, null, 0, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -118,7 +118,13 @@ class Random implements java.io.Serializable {
|
||||
* @see #setSeed(long)
|
||||
*/
|
||||
public Random(long seed) {
|
||||
this.seed = new AtomicLong(initialScramble(seed));
|
||||
if (getClass() == Random.class)
|
||||
this.seed = new AtomicLong(initialScramble(seed));
|
||||
else {
|
||||
// subclass might have overriden setSeed
|
||||
this.seed = new AtomicLong();
|
||||
setSeed(seed);
|
||||
}
|
||||
}
|
||||
|
||||
private static long initialScramble(long seed) {
|
||||
|
@ -246,18 +246,37 @@ public class AtomicInteger extends Number implements java.io.Serializable {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicInteger} as an
|
||||
* {@code int}.
|
||||
*/
|
||||
public int intValue() {
|
||||
return get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicInteger} as a {@code long}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public long longValue() {
|
||||
return (long)get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicInteger} as a {@code float}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public float floatValue() {
|
||||
return (float)get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicInteger} as a {@code double}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public double doubleValue() {
|
||||
return (double)get();
|
||||
}
|
||||
|
@ -260,18 +260,37 @@ public class AtomicLong extends Number implements java.io.Serializable {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicLong} as an {@code int}
|
||||
* after a narrowing primitive conversion.
|
||||
* @jls 5.1.3 Narrowing Primitive Conversions
|
||||
*/
|
||||
public int intValue() {
|
||||
return (int)get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicLong} as a {@code long}
|
||||
* value.
|
||||
*/
|
||||
public long longValue() {
|
||||
return get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicLong} as a {@code float}
|
||||
* after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public float floatValue() {
|
||||
return (float)get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the value of this {@code AtomicLong} as a {@code
|
||||
* double} after a widening primitive conversion.
|
||||
* @jls 5.1.2 Widening Primitive Conversions
|
||||
*/
|
||||
public double doubleValue() {
|
||||
return (double)get();
|
||||
}
|
||||
|
@ -251,7 +251,10 @@ public class Logger {
|
||||
protected Logger(String name, String resourceBundleName) {
|
||||
this.manager = LogManager.getLogManager();
|
||||
if (resourceBundleName != null) {
|
||||
// Note: we may get a MissingResourceException here.
|
||||
// MissingResourceException or IllegalArgumentException can
|
||||
// be thrown by setupResourceInfo(). Since this is the Logger
|
||||
// constructor, the resourceBundleName field is null so
|
||||
// IllegalArgumentException cannot happen here.
|
||||
setupResourceInfo(resourceBundleName);
|
||||
}
|
||||
this.name = name;
|
||||
@ -374,13 +377,10 @@ public class Logger {
|
||||
public static Logger getLogger(String name, String resourceBundleName) {
|
||||
LogManager manager = LogManager.getLogManager();
|
||||
Logger result = manager.demandLogger(name);
|
||||
if (result.resourceBundleName == null) {
|
||||
// Note: we may get a MissingResourceException here.
|
||||
result.setupResourceInfo(resourceBundleName);
|
||||
} else if (!result.resourceBundleName.equals(resourceBundleName)) {
|
||||
throw new IllegalArgumentException(result.resourceBundleName +
|
||||
" != " + resourceBundleName);
|
||||
}
|
||||
|
||||
// MissingResourceException or IllegalArgumentException can be
|
||||
// thrown by setupResourceInfo().
|
||||
result.setupResourceInfo(resourceBundleName);
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -1353,14 +1353,29 @@ public class Logger {
|
||||
}
|
||||
|
||||
// Private utility method to initialize our one entry
|
||||
// resource bundle cache.
|
||||
// resource bundle name cache.
|
||||
// Note: for consistency reasons, we are careful to check
|
||||
// that a suitable ResourceBundle exists before setting the
|
||||
// ResourceBundleName.
|
||||
// resourceBundleName field.
|
||||
// Synchronized to prevent races in setting the field.
|
||||
private synchronized void setupResourceInfo(String name) {
|
||||
if (name == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (resourceBundleName != null) {
|
||||
// this Logger already has a ResourceBundle
|
||||
|
||||
if (resourceBundleName.equals(name)) {
|
||||
// the names match so there is nothing more to do
|
||||
return;
|
||||
}
|
||||
|
||||
// cannot change ResourceBundles once they are set
|
||||
throw new IllegalArgumentException(
|
||||
resourceBundleName + " != " + name);
|
||||
}
|
||||
|
||||
ResourceBundle rb = findResourceBundle(name);
|
||||
if (rb == null) {
|
||||
// We've failed to find an expected ResourceBundle.
|
||||
|
@ -25,7 +25,7 @@
|
||||
|
||||
package javax.security.auth.kerberos;
|
||||
|
||||
import sun.misc.JavaxSecurityAuthKerberosAccess;
|
||||
import sun.security.krb5.JavaxSecurityAuthKerberosAccess;
|
||||
import sun.security.krb5.EncryptionKey;
|
||||
import sun.security.krb5.PrincipalName;
|
||||
|
||||
|
@ -27,8 +27,8 @@ package javax.security.auth.kerberos;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
import sun.misc.SharedSecrets;
|
||||
import sun.security.krb5.EncryptionKey;
|
||||
import sun.security.krb5.KerberosSecrets;
|
||||
import sun.security.krb5.PrincipalName;
|
||||
import sun.security.krb5.RealmException;
|
||||
|
||||
@ -74,9 +74,9 @@ public final class KeyTab {
|
||||
// is maintained in snapshot, this field is never "resolved".
|
||||
private final File file;
|
||||
|
||||
// Set up JavaxSecurityAuthKerberosAccess in SharedSecrets
|
||||
// Set up JavaxSecurityAuthKerberosAccess in KerberosSecrets
|
||||
static {
|
||||
SharedSecrets.setJavaxSecurityAuthKerberosAccess(
|
||||
KerberosSecrets.setJavaxSecurityAuthKerberosAccess(
|
||||
new JavaxSecurityAuthKerberosAccessImpl());
|
||||
}
|
||||
|
||||
|
@ -40,8 +40,7 @@ import javax.accessibility.*;
|
||||
|
||||
import sun.awt.AppContext;
|
||||
import java.lang.reflect.Field;
|
||||
import java.security.PrivilegedAction;
|
||||
import java.security.AccessController;
|
||||
import java.security.*;
|
||||
|
||||
/**
|
||||
* An implementation of the Icon interface that paints Icons
|
||||
@ -81,32 +80,51 @@ public class ImageIcon implements Icon, Serializable, Accessible {
|
||||
ImageObserver imageObserver;
|
||||
String description = null;
|
||||
|
||||
// Fields for twisted backward compatibility only. DO NOT USE.
|
||||
protected final static Component component;
|
||||
protected final static MediaTracker tracker;
|
||||
|
||||
static {
|
||||
component = new Component() {};
|
||||
AccessController.doPrivileged(new PrivilegedAction<Object>() {
|
||||
public Object run() {
|
||||
component = AccessController.doPrivileged(new PrivilegedAction<Component>() {
|
||||
public Component run() {
|
||||
try {
|
||||
final Component component = createNoPermsComponent();
|
||||
|
||||
// 6482575 - clear the appContext field so as not to leak it
|
||||
Field appContextField =
|
||||
Component.class.getDeclaredField("appContext");
|
||||
|
||||
Component.class.getDeclaredField("appContext");
|
||||
appContextField.setAccessible(true);
|
||||
appContextField.set(component, null);
|
||||
}
|
||||
catch (NoSuchFieldException e) {
|
||||
|
||||
return component;
|
||||
} catch (Throwable e) {
|
||||
// We don't care about component.
|
||||
// So don't prevent class initialisation.
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
tracker = new MediaTracker(component);
|
||||
}
|
||||
|
||||
private static Component createNoPermsComponent() {
|
||||
// 7020198 - set acc field to no permissions and no subject
|
||||
// Note, will have appContext set.
|
||||
return AccessController.doPrivileged(
|
||||
new PrivilegedAction<Component>() {
|
||||
public Component run() {
|
||||
return new Component() {
|
||||
};
|
||||
}
|
||||
},
|
||||
new AccessControlContext(new ProtectionDomain[]{
|
||||
new ProtectionDomain(null, null)
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Id used in loading images from MediaTracker.
|
||||
*/
|
||||
|
@ -588,6 +588,10 @@ public class NimbusLookAndFeel extends SynthLookAndFeel {
|
||||
}
|
||||
|
||||
private void addDefault(String key, Object value) {
|
||||
if (compiledDefaults == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String prefix = parsePrefix(key);
|
||||
if (prefix != null) {
|
||||
Map<String, Object> keys = compiledDefaults.get(prefix);
|
||||
|
@ -337,8 +337,7 @@ public class Utilities {
|
||||
// x before x0, return.
|
||||
return 0;
|
||||
}
|
||||
int currX = x0;
|
||||
int nextX = currX;
|
||||
int nextX = x0;
|
||||
// s may be a shared segment, so it is copied prior to calling
|
||||
// the tab expander
|
||||
char[] txt = s.array;
|
||||
@ -388,19 +387,45 @@ public class Utilities {
|
||||
} else {
|
||||
nextX += metrics.charWidth(txt[i]);
|
||||
}
|
||||
if ((x >= currX) && (x < nextX)) {
|
||||
if (x < nextX) {
|
||||
// found the hit position... return the appropriate side
|
||||
int offset = ((round == false) || ((x - currX) < (nextX - x))) ?
|
||||
(i - txtOffset) : (i + 1 - txtOffset);
|
||||
int offset;
|
||||
|
||||
// the length of the string measured as a whole may differ from
|
||||
// the sum of individual character lengths, for example if
|
||||
// fractional metrics are enabled; and we must guard from this.
|
||||
while (offset > 0 && metrics.charsWidth(txt, txtOffset, offset) > (x - x0)) {
|
||||
offset--;
|
||||
if (round) {
|
||||
offset = i + 1 - txtOffset;
|
||||
|
||||
int width = metrics.charsWidth(txt, txtOffset, offset);
|
||||
int span = x - x0;
|
||||
|
||||
if (span < width) {
|
||||
while (offset > 0) {
|
||||
int nextWidth = offset > 1 ? metrics.charsWidth(txt, txtOffset, offset - 1) : 0;
|
||||
|
||||
if (span >= nextWidth) {
|
||||
if (span - nextWidth < width - span) {
|
||||
offset--;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
width = nextWidth;
|
||||
offset--;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
offset = i - txtOffset;
|
||||
|
||||
while (offset > 0 && metrics.charsWidth(txt, txtOffset, offset) > (x - x0)) {
|
||||
offset--;
|
||||
}
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
currX = nextX;
|
||||
}
|
||||
|
||||
// didn't find, return end offset
|
||||
|
@ -180,7 +180,6 @@ public class FileFontStrike extends PhysicalStrike {
|
||||
pScalerContext = NullFontScaler.getNullScalerContext();
|
||||
} else {
|
||||
pScalerContext = fileFont.getScaler().createScalerContext(matrix,
|
||||
fileFont instanceof TrueTypeFont,
|
||||
desc.aaHint, desc.fmHint,
|
||||
boldness, italic, disableHinting);
|
||||
}
|
||||
|
@ -242,7 +242,6 @@ public abstract class FontScaler implements DisposerRecord {
|
||||
freed when corresponding strike is being released.
|
||||
*/
|
||||
abstract long createScalerContext(double[] matrix,
|
||||
boolean fontType,
|
||||
int aa, int fm,
|
||||
float boldness, float italic,
|
||||
boolean disableHinting);
|
||||
|
@ -210,12 +210,12 @@ class FreetypeFontScaler extends FontScaler {
|
||||
return getUnitsPerEMNative(nativeScaler);
|
||||
}
|
||||
|
||||
long createScalerContext(double[] matrix, boolean fontType,
|
||||
long createScalerContext(double[] matrix,
|
||||
int aa, int fm, float boldness, float italic,
|
||||
boolean disableHinting) {
|
||||
if (nativeScaler != 0L) {
|
||||
return createScalerContextNative(nativeScaler, matrix,
|
||||
fontType, aa, fm, boldness, italic);
|
||||
aa, fm, boldness, italic);
|
||||
}
|
||||
return NullFontScaler.getNullScalerContext();
|
||||
}
|
||||
@ -254,7 +254,7 @@ class FreetypeFontScaler extends FontScaler {
|
||||
private native long getUnitsPerEMNative(long pScaler);
|
||||
|
||||
native long createScalerContextNative(long pScaler, double[] matrix,
|
||||
boolean fontType, int aa, int fm, float boldness, float italic);
|
||||
int aa, int fm, float boldness, float italic);
|
||||
|
||||
/* Freetype scaler context does not contain any pointers that
|
||||
has to be invalidated if native scaler is bad */
|
||||
|
@ -66,7 +66,7 @@ class NullFontScaler extends FontScaler {
|
||||
|
||||
long getLayoutTableCache() {return 0L;}
|
||||
|
||||
long createScalerContext(double[] matrix, boolean fontType, int aa,
|
||||
long createScalerContext(double[] matrix, int aa,
|
||||
int fm, float boldness, float italic, boolean disableHinting) {
|
||||
return getNullScalerContext();
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ public class TrueTypeFont extends FileFont {
|
||||
|
||||
private static Map<String, Short> lcidMap;
|
||||
|
||||
class DirectoryEntry {
|
||||
static class DirectoryEntry {
|
||||
int tag;
|
||||
int offset;
|
||||
int length;
|
||||
|
@ -172,11 +172,11 @@ public class Blit extends GraphicsPrimitive
|
||||
while (si.nextSpan(span)) {
|
||||
int w = span[2] - span[0];
|
||||
int h = span[3] - span[1];
|
||||
srcRas = srcRas.createChild(srcx + span[0], srcy + span[1],
|
||||
w, h, 0, 0, null);
|
||||
dstRas = dstRas.createWritableChild(span[0], span[1],
|
||||
w, h, 0, 0, null);
|
||||
ctx.compose(srcRas, dstRas, dstRas);
|
||||
Raster tmpSrcRas = srcRas.createChild(srcx + span[0], srcy + span[1],
|
||||
w, h, 0, 0, null);
|
||||
WritableRaster tmpDstRas = dstRas.createWritableChild(span[0], span[1],
|
||||
w, h, 0, 0, null);
|
||||
ctx.compose(tmpSrcRas, tmpDstRas, tmpDstRas);
|
||||
}
|
||||
ctx.dispose();
|
||||
}
|
||||
|
@ -509,6 +509,9 @@ public class DrawImage implements DrawImagePipe
|
||||
* edges thus has to be h*2+2 in length
|
||||
*/
|
||||
int edges[] = new int[(dy2-dy1)*2+2];
|
||||
// It is important that edges[0]=edges[1]=0 when we call
|
||||
// Transform in case it must return early and we would
|
||||
// not want to render anything on an error condition.
|
||||
helper.Transform(tmpmaskblit, srcData, tmpData,
|
||||
AlphaComposite.Src, null,
|
||||
itx, interpType,
|
||||
|
@ -43,7 +43,7 @@ java.launcher.opt.footer =\ -cp <class search path of directories and zip
|
||||
\ and ZIP archives to search for class files.\n\
|
||||
\ -D<name>=<value>\n\
|
||||
\ set a system property\n\
|
||||
\ -verbose[:class|gc|jni]\n\
|
||||
\ -verbose:[class|gc|jni]\n\
|
||||
\ enable verbose output\n\
|
||||
\ -version print product version and exit\n\
|
||||
\ -version:<value>\n\
|
||||
|
@ -29,7 +29,6 @@ import java.util.jar.JarFile;
|
||||
import java.io.Console;
|
||||
import java.io.FileDescriptor;
|
||||
import java.security.ProtectionDomain;
|
||||
import javax.security.auth.kerberos.KeyTab;
|
||||
|
||||
import java.security.AccessController;
|
||||
|
||||
@ -52,7 +51,6 @@ public class SharedSecrets {
|
||||
private static JavaIOFileDescriptorAccess javaIOFileDescriptorAccess;
|
||||
private static JavaSecurityProtectionDomainAccess javaSecurityProtectionDomainAccess;
|
||||
private static JavaSecurityAccess javaSecurityAccess;
|
||||
private static JavaxSecurityAuthKerberosAccess javaxSecurityAuthKerberosAccess;
|
||||
|
||||
public static JavaUtilJarAccess javaUtilJarAccess() {
|
||||
if (javaUtilJarAccess == null) {
|
||||
@ -141,16 +139,4 @@ public class SharedSecrets {
|
||||
}
|
||||
return javaSecurityAccess;
|
||||
}
|
||||
|
||||
public static void setJavaxSecurityAuthKerberosAccess
|
||||
(JavaxSecurityAuthKerberosAccess jsaka) {
|
||||
javaxSecurityAuthKerberosAccess = jsaka;
|
||||
}
|
||||
|
||||
public static JavaxSecurityAuthKerberosAccess
|
||||
getJavaxSecurityAuthKerberosAccess() {
|
||||
if (javaxSecurityAuthKerberosAccess == null)
|
||||
unsafe.ensureClassInitialized(KeyTab.class);
|
||||
return javaxSecurityAuthKerberosAccess;
|
||||
}
|
||||
}
|
||||
|
@ -532,15 +532,11 @@ public class URLClassPath {
|
||||
uc = url.openConnection();
|
||||
InputStream in = uc.getInputStream();
|
||||
if (uc instanceof JarURLConnection) {
|
||||
/* JarURLConnection.getInputStream() returns a separate
|
||||
* instance on each call. So we have to close this here.
|
||||
* The jar file cache will keep the file open.
|
||||
* Also, need to remember the jar file so it can be closed
|
||||
/* Need to remember the jar file so it can be closed
|
||||
* in a hurry.
|
||||
*/
|
||||
JarURLConnection juc = (JarURLConnection)uc;
|
||||
jarfile = juc.getJarFile();
|
||||
in.close();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
|
879
jdk/src/share/classes/sun/net/RegisteredDomain.java
Normal file
879
jdk/src/share/classes/sun/net/RegisteredDomain.java
Normal file
@ -0,0 +1,879 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package sun.net;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/*
|
||||
* The naming tables listed below were gathered from publicly available data such as
|
||||
* the subdomain registration websites listed for each top-level domain by the Internet
|
||||
* Assigned Numbers Authority and the website of the Internet Corporation for Assigned Names
|
||||
* and Numbers as well as Wikipedia.
|
||||
*/
|
||||
|
||||
public class RegisteredDomain {
|
||||
|
||||
// XX.AA
|
||||
private static Set<String> top1Set = new HashSet<String>(Arrays.asList("asia", "biz", "cat", "coop",
|
||||
"edu", "info", "gov", "jobs", "travel", "am", "aq", "ax", "cc", "cf", "cg", "ch", "cv", "cz",
|
||||
"de", "dj", "dk", "fm", "fo", "ga", "gd", "gf", "gl", "gm", "gq", "gs", "gw", "hm",
|
||||
"li", "lu", "md", "mh", "mil", "mobi", "mq", "ms", "ms", "ne", "nl", "nu", "si",
|
||||
"sm", "sr", "su", "tc", "td", "tf", "tg", "tk", "tm", "tv", "va", "vg",
|
||||
/* ae */ "xn--mgbaam7a8h", /* cn s */ "xn--fiqs8s", /* cn t */ "xn--fiqz9s",
|
||||
/* eg */ "xn--wgbh1c", /* hk */ "xn--j6w193g", /* jo */ "xn--mgbayh7gpa",
|
||||
/* lk */ "xn--fzc2c9e2c", /* ps */ "xn--ygbi2ammx", /* ru */ "xn--p1ai",
|
||||
/* qa */ "xn--wgbl6a", /* sa */ "xn--mgberp4a5d4ar", /* sg */ "xn--yfro4i67o",
|
||||
/* th */ "xn--o3cw4h", /* tn */ "xn--pgbs0dh", /* tw s */ "xn--kpry57d",
|
||||
/* tw */ "xn--kprw13d", /* sg tamil */ "xn--clchc0ea0b2g2a9gcd"));
|
||||
|
||||
// common pattern: XX.AA or XX.GOV.AA
|
||||
private static Set<String> top2Set = new HashSet<String>(Arrays.asList("as", "bf", "cd", "cx",
|
||||
"ie", "lt", "mr", "tl"));
|
||||
|
||||
// common pattern: XX.AA or XX.COM.AA or XX.EDU.AA or XX.NET.AA or XX.ORG.AA or XX.GOV.AA
|
||||
private static Set<String> top4Set = new HashSet<String>(Arrays.asList("af", "bm", "bs", "bt",
|
||||
"bz", "dm", "ky", "lb", "lr", "mo", "sc", "sl", "ws"));
|
||||
|
||||
// AA or less than 3 other XX.BB.AA possible matches
|
||||
private static Set<String> top3Set = new HashSet<String>(Arrays.asList("ad", "aw", "be", "bw",
|
||||
"cl", "fi", "int", "io", "mc"));
|
||||
|
||||
// AA.UK exceptions
|
||||
private static Set<String> ukSet = new HashSet<String>(Arrays.asList( "bl", "british-library",
|
||||
"jet", "nhs", "nls", "parliament", "mod", "police"));
|
||||
|
||||
// AA.AR exceptions
|
||||
private static Set<String> arSet = new HashSet<String>(Arrays.asList( "argentina", "educ",
|
||||
"gobiernoelectronico", "nic", "promocion", "retina", "uba"));
|
||||
|
||||
// AA.OM exceptions
|
||||
private static Set<String> omSet = new HashSet<String>(Arrays.asList("mediaphone", "nawrastelecom",
|
||||
"nawras", "omanmobile", "omanpost", "omantel", "rakpetroleum", "siemens", "songfest",
|
||||
"statecouncil", "shura", "peie", "omran", "omnic", "omanet", "oman", "muriya", "kom"));
|
||||
|
||||
// any XX.BB.AA
|
||||
private static Set<String> top5Set = new HashSet<String>(Arrays.asList("au", "arpa", "bd", "bn", "ck",
|
||||
"cy", "er", "et", "fj", "fk", "gt", "gu", "il", "jm", "ke", "kh", "kw",
|
||||
"mm", "mt", "mz", "ni", "np", "nz", "pg", "sb", "sv", "tz", "uy", "ve", "ye",
|
||||
"za", "zm", "zw"));
|
||||
|
||||
// XX.CC.BB.JP
|
||||
private static Set<String> jpSet = new HashSet<String>(Arrays.asList("aichi", "akita", "aomori",
|
||||
"chiba", "ehime", "fukui", "fukuoka", "fukushima", "gifu", "gunma", "hiroshima", "hokkaido",
|
||||
"hyogo", "ibaraki", "ishikawa", "iwate", "kagawa", "kagoshima", "kanagawa", "kawasaki",
|
||||
"kitakyushu", "kobe", "kochi", "kumamoto", "kyoto", "mie", "miyagi", "miyazaki", "nagano",
|
||||
"nagasaki", "nagoya", "nara", "niigata", "oita", "okayama", "okinawa", "osaka", "saga",
|
||||
"saitama", "sapporo", "sendai", "shiga", "shimane", "shizuoka", "tochigi", "tokushima",
|
||||
"tokyo", "tottori", "toyama", "wakayama", "yamagata", "yamaguchi", "yamanashi", "yokohama"));
|
||||
|
||||
// CC.BB.JP exceptions
|
||||
private static Set<String> jp2Set = new HashSet<String>(Arrays.asList("metro.tokyo.jp",
|
||||
"pref.aichi.jp", "pref.akita.jp", "pref.aomori.jp", "pref.chiba.jp", "pref.ehime.jp",
|
||||
"pref.fukui.jp", "pref.fukuoka.jp", "pref.fukushima.jp", "pref.gifu.jp", "pref.gunma.jp",
|
||||
"pref.hiroshima.jp", "pref.hokkaido.jp", "pref.hyogo.jp", "pref.ibaraki.jp", "pref.ishikawa.jp",
|
||||
"pref.iwate.jp", "pref.kagawa.jp", "pref.kagoshima.jp", "pref.kanagawa.jp", "pref.kochi.jp",
|
||||
"pref.kumamoto.jp", "pref.kyoto.jp", "pref.mie.jp", "pref.miyagi.jp", "pref.miyazaki.jp",
|
||||
"pref.nagano.jp", "pref.nagasaki.jp", "pref.nara.jp", "pref.niigata.jp", "pref.oita.jp",
|
||||
"pref.okayama.jp", "pref.okinawa.jp", "pref.osaka.jp", "pref.saga.jp", "pref.saitama.jp",
|
||||
"pref.shiga.jp", "pref.shimane.jp", "pref.shizuoka.jp", "pref.tochigi.jp", "pref.tokushima.jp",
|
||||
"pref.tottori.jp", "pref.toyama.jp", "pref.wakayama.jp", "pref.yamagata.jp", "pref.yamaguchi.jp",
|
||||
"pref.yamanashi.jp", "city.chiba.jp", "city.fukuoka.jp", "city.hamamatsu.jp", "city.hiroshima.jp", "city.kawasaki.jp",
|
||||
"city.kitakyushu.jp", "city.kobe.jp", "city.kyoto.jp", "city.nagoya.jp", "city.niigata.jp",
|
||||
"city.okayama.jp", "city.osaka.jp", "city.sagamihara.jp", "city.saitama.jp", "city.sapporo.jp", "city.sendai.jp",
|
||||
"city.shizuoka.jp", "city.yokohama.jp"));
|
||||
|
||||
private static Set<String> usStateSet = new HashSet<String>(Arrays.asList("ak",
|
||||
"al", "ar", "as", "az", "ca", "co", "ct", "dc", "de", "fl", "ga", "gu", "hi", "ia",
|
||||
"id", "il", "in", "ks", "ky", "la", "ma", "md", "me", "mi", "mn", "mo", "ms", "mt",
|
||||
"nc", "nd", "ne", "nh", "nj", "nm", "nv", "ny", "oh", "ok", "or", "pa", "pr", "ri",
|
||||
"sc", "sd", "tn", "tx", "ut", "vi", "vt", "va", "wa", "wi", "wv", "wy"));
|
||||
|
||||
private static Set<String> usSubStateSet = new HashSet<String>(Arrays.asList("state",
|
||||
"lib", "k12", "cc", "tec", "gen", "cog", "mus", "dst"));
|
||||
|
||||
private static Map<String,Set> topMap = new HashMap<String,Set>();
|
||||
private static Map<String,Set> top3Map = new HashMap<String,Set>();
|
||||
|
||||
static {
|
||||
/*
|
||||
* XX.AA or XX.BB.AA
|
||||
*/
|
||||
topMap.put("ac", new HashSet<String>(Arrays.asList("com", "co", "edu", "gov", "net", "mil", "org")));
|
||||
topMap.put("ae", new HashSet<String>(Arrays.asList("co", "net", "org", "sch", "ac", "gov", "mil")));
|
||||
topMap.put("aero", new HashSet<String>(Arrays.asList("accident-investigation",
|
||||
"accident-prevention", "aerobatic", "aeroclub", "aerodrome", "agents", "aircraft",
|
||||
"airline", "airport", "air-surveillance", "airtraffic", "air-traffic-control",
|
||||
"ambulance", "amusement", "association", "author", "ballooning", "broker", "caa",
|
||||
"cargo", "catering", "certification", "championship", "charter", "civilaviation",
|
||||
"club", "conference", "consultant", "consulting", "control", "council", "crew",
|
||||
"design", "dgca", "educator", "emergency", "engine", "engineer", "entertainment",
|
||||
"equipment", "exchange", "express", "federation", "flight", "freight", "fuel",
|
||||
"gliding", "government", "groundhandling", "group", "hanggliding", "homebuilt",
|
||||
"insurance", "journal", "journalist", "leasing", "logistics", "magazine",
|
||||
"maintenance", "marketplace", "media", "microlight", "modelling", "navigation",
|
||||
"parachuting", "paragliding", "passenger-association", "pilot", "press", "production",
|
||||
"recreation", "repbody", "res", "research", "rotorcraft", "safety", "scientist",
|
||||
"services", "show", "skydiving", "software", "student", "taxi", "trader", "trading",
|
||||
"trainer", "union", "workinggroup", "works" )));
|
||||
topMap.put( "ag", new HashSet<String>(Arrays.asList("com", "org", "net", "co", "nom")));
|
||||
topMap.put( "ai", new HashSet<String>(Arrays.asList("off", "com", "net", "org")));
|
||||
topMap.put( "al", new HashSet<String>(Arrays.asList("com", "edu", "gov", "mil", "net", "org")));
|
||||
topMap.put( "an", new HashSet<String>(Arrays.asList("com")));
|
||||
topMap.put( "ao", new HashSet<String>(Arrays.asList("ed", "gv", "og", "co", "pb", "it")));
|
||||
topMap.put( "at", new HashSet<String>(Arrays.asList("ac", "co", "gv", "or", "biz", "info", "priv")));
|
||||
topMap.put( "az", new HashSet<String>(Arrays.asList("com", "net", "int", "gov", "org", "edu", "info",
|
||||
"pp", "mil", "name", "biz")));
|
||||
topMap.put( "ba", new HashSet<String>(Arrays.asList("org", "net", "edu", "gov", "mil", "unbi",
|
||||
"unmo", "unsa", "untz", "unze", "co", "com", "rs")));
|
||||
topMap.put( "bb", new HashSet<String>(Arrays.asList("biz", "com", "edu", "gov", "info", "net", "org",
|
||||
"store")));
|
||||
topMap.put( "bg", new HashSet<String>(Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
|
||||
"k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1",
|
||||
"2", "3", "4", "5", "6", "7", "8", "9")));
|
||||
topMap.put( "bh", new HashSet<String>(Arrays.asList("com", "info", "cc", "edu", "biz", "net",
|
||||
"org", "gov")));
|
||||
topMap.put( "bi", new HashSet<String>(Arrays.asList("co", "com", "edu", "gov", "info", "or", "org")));
|
||||
topMap.put( "bj", new HashSet<String>(Arrays.asList("asso", "barreau", "com", "edu", "gouv", "gov", "mil")));
|
||||
topMap.put( "bo", new HashSet<String>(Arrays.asList("com", "edu", "gov", "gob", "int", "org", "net",
|
||||
"mil", "tv")));
|
||||
topMap.put( "br", new HashSet<String>(Arrays.asList("adm", "adv", "agr", "am", "arq", "art", "ato",
|
||||
"b", "bio", "blog", "bmd", "cim", "cng", "cnt", "com", "coop", "ecn", "edu", "emp", "eng",
|
||||
"esp", "etc", "eti", "far", "flog", "fm", "fnd", "fot", "fst", "g12", "ggf", "gov",
|
||||
"imb", "ind", "inf", "jor", "jus", "lel", "mat", "med", "mil", "mus", "net", "nom",
|
||||
"not", "ntr", "odo", "org", "ppg", "pro", "psc", "psi", "qsl", "radio", "rec", "slg",
|
||||
"srv", "taxi", "teo", "tmp", "trd", "tur", "tv", "vet", "vlog", "wiki", "zlg")));
|
||||
topMap.put( "bw", new HashSet<String>(Arrays.asList("co", "gov", "org")));
|
||||
topMap.put( "by", new HashSet<String>(Arrays.asList("gov", "mil", "com", "of")));
|
||||
topMap.put( "ca", new HashSet<String>(Arrays.asList("ab", "bc", "mb", "nb", "nf",
|
||||
"nl", "ns", "nt", "nu", "on", "pe", "qc", "sk", "yk", "gc")));
|
||||
topMap.put( "ci", new HashSet<String>(Arrays.asList("org", "or", "com", "co", "edu",
|
||||
"ed", "ac", "net", "go", "asso", "xn--aroport-bya", "int",
|
||||
"presse", "md", "gouv")));
|
||||
topMap.put( "com", new HashSet<String>(Arrays.asList("ad", "ar", "br", "cn", "de", "eu", "gb",
|
||||
"gr", "hu", "jpn", "kr", "no", "qc", "ru", "sa", "se", "uk", "us", "uy", "za")));
|
||||
topMap.put( "cm", new HashSet<String>(Arrays.asList("co", "com", "gov", "net")));
|
||||
topMap.put( "cn", new HashSet<String>(Arrays.asList("ac", "com", "edu", "gov", "net",
|
||||
"org", "mil", "xn--55qx5d", "xn--io0a7i",
|
||||
"ah", "bj", "cq", "fj", "gd", "gs", "gz", "gx",
|
||||
"ha", "hb", "he", "hi", "hl", "hn", "jl", "js", "jx", "ln", "nm", "nx", "qh",
|
||||
"sc", "sd", "sh", "sn", "sx", "tj", "xj", "xz", "yn", "zj", "hk", "mo", "tw")));
|
||||
topMap.put( "co", new HashSet<String>(Arrays.asList("arts", "com", "edu", "firm", "gov", "info",
|
||||
"int", "mil", "net", "nom", "org", "rec", "web")));
|
||||
topMap.put( "cr", new HashSet<String>(Arrays.asList("ac", "co", "ed", "fi", "go", "or", "sa")));
|
||||
topMap.put( "cu", new HashSet<String>(Arrays.asList("com", "edu", "org", "net", "gov", "inf")));
|
||||
topMap.put( "do", new HashSet<String>(Arrays.asList("com", "edu", "org", "net", "gov", "gob",
|
||||
"web", "art", "sld", "mil")));
|
||||
topMap.put( "dz", new HashSet<String>(Arrays.asList("com", "org", "net", "gov", "edu", "asso",
|
||||
"pol", "art")));
|
||||
topMap.put( "ec", new HashSet<String>(Arrays.asList("com", "info", "net", "fin", "k12", "med",
|
||||
"pro", "org", "edu", "gov", "gob", "mil")));
|
||||
topMap.put( "ee", new HashSet<String>(Arrays.asList("edu", "gov", "riik", "lib", "med", "com",
|
||||
"pri", "aip", "org", "fie")));
|
||||
topMap.put( "eg", new HashSet<String>(Arrays.asList("com", "edu", "eun", "gov", "mil", "name",
|
||||
"net", "org", "sci")));
|
||||
topMap.put( "es", new HashSet<String>(Arrays.asList("com", "nom", "org", "gob", "edu")));
|
||||
topMap.put( "eu", new HashSet<String>(Arrays.asList("europa")));
|
||||
topMap.put( "fr", new HashSet<String>(Arrays.asList("com", "asso", "nom", "prd", "presse",
|
||||
"tm", "aeroport", "assedic", "avocat", "avoues", "cci", "chambagri",
|
||||
"chirurgiens-dentistes", "experts-comptables", "geometre-expert", "gouv", "greta",
|
||||
"huissier-justice", "medecin", "notaires", "pharmacien", "port", "veterinaire")));
|
||||
topMap.put( "ge", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "mil", "net", "pvt")));
|
||||
topMap.put( "gg", new HashSet<String>(Arrays.asList("co", "org", "net", "sch", "gov")));
|
||||
topMap.put( "gh", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "mil")));
|
||||
topMap.put( "gi", new HashSet<String>(Arrays.asList("com", "ltd", "gov", "mod", "edu", "org")));
|
||||
topMap.put( "gn", new HashSet<String>(Arrays.asList("ac", "com", "edu", "gov", "org", "net")));
|
||||
topMap.put( "gp", new HashSet<String>(Arrays.asList("com", "net", "mobi", "edu", "org", "asso")));
|
||||
topMap.put( "gr", new HashSet<String>(Arrays.asList("com", "co", "net", "edu", "org", "gov",
|
||||
"mil", "mod", "sch")));
|
||||
topMap.put( "gy", new HashSet<String>(Arrays.asList("co", "com", "net", "org", "edu", "gov")));
|
||||
topMap.put( "hk", new HashSet<String>(Arrays.asList("com", "edu", "gov", "idv", "net", "org",
|
||||
/* com */ "xn--55qx5d", /* edu */ "xn--wcvs22d", /* gov */"xn--mxtq1m",
|
||||
/* idv */ "xn--gmqw5a", /* net */ "xn--od0alg", /*org*/ "xn--uc0atv")));
|
||||
topMap.put( /* hk */ "xn--j6w193g", new HashSet<String>(Arrays.asList(
|
||||
/* com */ "xn--55qx5d", /* edu */ "xn--wcvs22d", /* gov */"xn--mxtq1m",
|
||||
/* idv */ "xn--gmqw5a", /* net */ "xn--od0alg", /*org*/ "xn--uc0atv")));
|
||||
topMap.put( "hn", new HashSet<String>(Arrays.asList("com", "edu", "org", "net", "mil", "gob")));
|
||||
topMap.put( "hr", new HashSet<String>(Arrays.asList("iz.hr", "from.hr", "name.hr", "com.hr")));
|
||||
topMap.put( "ht", new HashSet<String>(Arrays.asList("com", "shop", "firm", "info", "adult",
|
||||
"net", "pro", "org", "med", "art", "coop", "pol", "asso", "edu", "rel", "gouv", "perso")));
|
||||
topMap.put( "hu", new HashSet<String>(Arrays.asList("co", "info", "org", "priv", "sport", "tm",
|
||||
"2000", "agrar", "bolt", "casino", "city", "erotica", "erotika", "film", "forum",
|
||||
"games", "hotel", "ingatlan", "jogasz", "konyvelo", "lakas", "media", "news", "reklam",
|
||||
"sex", "shop", "suli", "szex", "tozsde", "utazas", "video")));
|
||||
topMap.put( "id", new HashSet<String>(Arrays.asList("ac", "co", "go", "mil", "net", "or", "sch",
|
||||
"web")));
|
||||
topMap.put( "im", new HashSet<String>(Arrays.asList("co.im", "com", "net.im", "gov.im", "org.im",
|
||||
"ac.im")));
|
||||
topMap.put( "in", new HashSet<String>(Arrays.asList("co", "firm", "ernet", "net", "org", "gen", "ind",
|
||||
"nic", "ac", "edu", "res", "gov", "mil")));
|
||||
topMap.put( "iq", new HashSet<String>(Arrays.asList("gov", "edu", "mil", "com", "org", "net" )));
|
||||
topMap.put( "ir", new HashSet<String>(Arrays.asList("ac", "co", "gov", "id", "net", "org", "sch"
|
||||
)));
|
||||
topMap.put( "is", new HashSet<String>(Arrays.asList("net", "com", "edu", "gov", "org", "int")));
|
||||
topMap.put( "it", new HashSet<String>(Arrays.asList("gov", "edu", "agrigento", "ag", "alessandria",
|
||||
"al", "ancona", "an", "aosta", "aoste", "ao", "arezzo", "ar", "ascoli-piceno",
|
||||
"ascolipiceno", "ap", "asti", "at", "avellino", "av", "bari", "ba",
|
||||
"andria-barletta-trani", "andriabarlettatrani", "trani-barletta-andria",
|
||||
"tranibarlettaandria", "barletta-trani-andria", "barlettatraniandria",
|
||||
"andria-trani-barletta", "andriatranibarletta", "trani-andria-barletta",
|
||||
"traniandriabarletta", "bt", "belluno", "bl", "benevento", "bn", "bergamo", "bg",
|
||||
"biella", "bi", "bologna", "bo", "bolzano", "bozen", "balsan", "alto-adige",
|
||||
"altoadige", "suedtirol", "bz", "brescia", "bs", "brindisi", "br", "cagliari",
|
||||
"ca", "caltanissetta", "cl", "campobasso", "cb", "carboniaiglesias", "carbonia-iglesias",
|
||||
"iglesias-carbonia", "iglesiascarbonia", "ci", "caserta", "ce", "catania", "ct",
|
||||
"catanzaro", "cz", "chieti", "ch", "como", "co", "cosenza", "cs", "cremona", "cr",
|
||||
"crotone", "kr", "cuneo", "cn", "dell-ogliastra", "dellogliastra", "ogliastra", "og",
|
||||
"enna", "en", "ferrara", "fe", "fermo", "fm", "firenze", "florence", "fi", "foggia",
|
||||
"fg", "forli-cesena", "forlicesena", "cesena-forli", "cesenaforli", "fc", "frosinone",
|
||||
"fr", "genova", "genoa", "ge", "gorizia", "go", "grosseto", "gr", "imperia", "im",
|
||||
"isernia", "is", "laquila", "aquila", "aq", "la-spezia", "laspezia", "sp", "latina",
|
||||
"lt", "lecce", "le", "lecco", "lc", "livorno", "li", "lodi", "lo", "lucca", "lu",
|
||||
"macerata", "mc", "mantova", "mn", "massa-carrara", "massacarrara", "carrara-massa",
|
||||
"carraramassa", "ms", "matera", "mt", "medio-campidano", "mediocampidano",
|
||||
"campidano-medio", "campidanomedio", "vs", "messina", "me", "milano", "milan",
|
||||
"mi", "modena", "mo", "monza", "monza-brianza", "monzabrianza", "monzaebrianza",
|
||||
"monzaedellabrianza", "monza-e-della-brianza", "mb", "napoli", "naples", "na",
|
||||
"novara", "no", "nuoro", "nu", "oristano", "or", "padova", "padua", "pd", "palermo",
|
||||
"pa", "parma", "pr", "pavia", "pv", "perugia", "pg", "pescara", "pe", "pesaro-urbino",
|
||||
"pesarourbino", "urbino-pesaro", "urbinopesaro", "pu", "piacenza", "pc", "pisa",
|
||||
"pi", "pistoia", "pt", "pordenone", "pn", "potenza", "pz", "prato", "po", "ragusa",
|
||||
"rg", "ravenna", "ra", "reggio-calabria", "reggiocalabria", "rc", "reggio-emilia",
|
||||
"reggioemilia", "re", "rieti", "ri", "rimini", "rn", "roma", "rome", "rm", "rovigo",
|
||||
"ro", "salerno", "sa", "sassari", "ss", "savona", "sv", "siena", "si", "siracusa",
|
||||
"sr", "sondrio", "so", "taranto", "ta", "tempio-olbia", "tempioolbia", "olbia-tempio",
|
||||
"olbiatempio", "ot", "teramo", "te", "terni", "tr", "torino", "turin", "to",
|
||||
"trapani", "tp", "trento", "trentino", "tn", "treviso", "tv", "trieste", "ts",
|
||||
"udine", "ud", "varese", "va", "venezia", "venice", "ve", "verbania", "vb",
|
||||
"vercelli", "vc", "verona", "vr", "vibo-valentia", "vibovalentia", "vv", "vicenza",
|
||||
"vi", "viterbo", "vt")));
|
||||
topMap.put( "je", new HashSet<String>(Arrays.asList("co", "org", "net", "sch", "gov")));
|
||||
topMap.put( "jo", new HashSet<String>(Arrays.asList("com", "org", "net", "edu", "sch",
|
||||
"gov", "mil", "name")));
|
||||
topMap.put( "jp", new HashSet<String>(Arrays.asList("ac", "ad", "co", "ed", "go", "gr", "lg",
|
||||
"ne", "or")));
|
||||
topMap.put( "kg", new HashSet<String>(Arrays.asList("org", "net", "com", "edu", "gov", "mil")));
|
||||
topMap.put( "ki", new HashSet<String>(Arrays.asList("edu", "biz", "net", "org", "gov",
|
||||
"info", "com")));
|
||||
topMap.put( "km", new HashSet<String>(Arrays.asList("org", "nom", "gov", "prd", "tm", "edu",
|
||||
"mil", "ass", "com", "coop", "asso", "presse", "medecin", "notaires", "pharmaciens",
|
||||
"veterinaire", "gouv")));
|
||||
topMap.put( "kn", new HashSet<String>(Arrays.asList("net", "org", "edu", "gov")));
|
||||
topMap.put( "kp", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "rep", "tra")));
|
||||
topMap.put( "kr", new HashSet<String>(Arrays.asList("ac", "co", "es", "go", "hs", "kg", "mil",
|
||||
"ms", "ne", "or", "pe", "re", "sc", "busan", "chungbuk", "chungnam", "daegu",
|
||||
"daejeon", "gangwon", "gwangju", "gyeongbuk", "gyeonggi", "gyeongnam", "incheon",
|
||||
"jeju", "jeonbuk", "jeonnam", "seoul", "ulsan")));
|
||||
topMap.put( "kz", new HashSet<String>(Arrays.asList("org", "edu", "net", "gov", "mil", "com")));
|
||||
topMap.put( "la", new HashSet<String>(Arrays.asList("int", "net", "info", "edu", "gov", "per",
|
||||
"com", "org", "c")));
|
||||
topMap.put( "lc", new HashSet<String>(Arrays.asList("com", "net", "co", "org", "edu", "gov",
|
||||
"l.lc", "p.lc")));
|
||||
topMap.put( "lk", new HashSet<String>(Arrays.asList("gov", "sch", "net", "int", "com", "org",
|
||||
"edu", "ngo", "soc", "web", "ltd", "assn", "grp", "hotel")));
|
||||
topMap.put( "ls", new HashSet<String>(Arrays.asList("co", "gov", "ac", "org")));
|
||||
topMap.put( "lv", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "mil",
|
||||
"id", "net", "asn", "conf")));
|
||||
topMap.put( "ly", new HashSet<String>(Arrays.asList("com", "net", "gov", "plc", "edu", "sch",
|
||||
"med", "org", "id")));
|
||||
topMap.put( "ma", new HashSet<String>(Arrays.asList("co", "net", "gov", "org", "ac", "press")));
|
||||
topMap.put( "me", new HashSet<String>(Arrays.asList("co", "net", "org", "edu", "ac", "gov",
|
||||
"its", "priv")));
|
||||
topMap.put( "mg", new HashSet<String>(Arrays.asList("org", "nom", "gov", "prd", "tm",
|
||||
"edu", "mil", "com")));
|
||||
topMap.put( "mk", new HashSet<String>(Arrays.asList("com", "org", "net", "edu", "gov", "inf",
|
||||
"name", "pro")));
|
||||
topMap.put( "ml", new HashSet<String>(Arrays.asList("com", "edu", "gouv", "gov", "net",
|
||||
"org", "presse")));
|
||||
topMap.put( "mn", new HashSet<String>(Arrays.asList("gov", "edu", "org")));
|
||||
topMap.put( "mp", new HashSet<String>(Arrays.asList("gov", "co", "org")));
|
||||
topMap.put( "mu", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "ac",
|
||||
"co", "or")));
|
||||
topMap.put( "museum", new HashSet<String>(Arrays.asList("academy", "agriculture", "air",
|
||||
"airguard", "alabama", "alaska", "amber", "ambulance", "american", "americana",
|
||||
"americanantiques", "americanart", "amsterdam", "and", "annefrank", "anthro",
|
||||
"anthropology", "antiques", "aquarium", "arboretum", "archaeological", "archaeology",
|
||||
"architecture", "art", "artanddesign", "artcenter", "artdeco", "arteducation",
|
||||
"artgallery", "arts", "artsandcrafts", "asmatart", "assassination", "assisi",
|
||||
"association", "astronomy", "atlanta", "austin", "australia", "automotive", "aviation",
|
||||
"axis", "badajoz", "baghdad", "bahn", "bale", "baltimore", "barcelona", "baseball",
|
||||
"basel", "baths", "bauern", "beauxarts", "beeldengeluid", "bellevue", "bergbau",
|
||||
"berkeley", "berlin", "bern", "bible", "bilbao", "bill", "birdart", "birthplace",
|
||||
"bonn", "boston", "botanical", "botanicalgarden", "botanicgarden", "botany",
|
||||
"brandywinevalley", "brasil", "bristol", "british", "britishcolumbia", "broadcast",
|
||||
"brunel", "brussel", "brussels", "bruxelles", "building", "burghof", "bus", "bushey",
|
||||
"cadaques", "california", "cambridge", "can", "canada", "capebreton", "carrier",
|
||||
"cartoonart", "casadelamoneda", "castle", "castres", "celtic", "center", "chattanooga",
|
||||
"cheltenham", "chesapeakebay", "chicago", "children", "childrens", "childrensgarden",
|
||||
"chiropractic", "chocolate", "christiansburg", "cincinnati", "cinema", "circus",
|
||||
"civilisation", "civilization", "civilwar", "clinton", "clock", "coal", "coastaldefence",
|
||||
"cody", "coldwar", "collection", "colonialwilliamsburg", "coloradoplateau", "columbia",
|
||||
"columbus", "communication", "communications", "community", "computer",
|
||||
"computerhistory", "xn--comunicaes-v6a2o", "contemporary", "contemporaryart",
|
||||
"convent", "copenhagen", "corporation", "xn--correios-e-telecomunicaes-ghc29a",
|
||||
"corvette", "costume", "countryestate", "county", "crafts", "cranbrook", "creation",
|
||||
"cultural", "culturalcenter", "culture", "cyber", "cymru", "dali", "dallas", "database",
|
||||
"ddr", "decorativearts", "delaware", "delmenhorst", "denmark", "depot", "design",
|
||||
"detroit", "dinosaur", "discovery", "dolls", "donostia", "durham", "eastafrica",
|
||||
"eastcoast", "education", "educational", "egyptian", "eisenbahn", "elburg",
|
||||
"elvendrell", "embroidery", "encyclopedic", "england", "entomology", "environment",
|
||||
"environmentalconservation", "epilepsy", "essex", "estate", "ethnology", "exeter",
|
||||
"exhibition", "family", "farm", "farmequipment", "farmers", "farmstead", "field",
|
||||
"figueres", "filatelia", "film", "fineart", "finearts", "finland", "flanders", "florida",
|
||||
"force", "fortmissoula", "fortworth", "foundation", "francaise", "frankfurt",
|
||||
"franziskaner", "freemasonry", "freiburg", "fribourg", "frog", "fundacio", "furniture",
|
||||
"gallery", "garden", "gateway", "geelvinck", "gemological", "geology", "georgia",
|
||||
"giessen", "glas", "glass", "gorge", "grandrapids", "graz", "guernsey", "halloffame",
|
||||
"hamburg", "handson", "harvestcelebration", "hawaii", "health", "heimatunduhren",
|
||||
"hellas", "helsinki", "hembygdsforbund", "heritage", "histoire", "historical",
|
||||
"historicalsociety", "historichouses", "historisch", "historisches", "history",
|
||||
"historyofscience", "horology", "house", "humanities", "illustration", "imageandsound",
|
||||
"indian", "indiana", "indianapolis", "indianmarket", "intelligence", "interactive",
|
||||
"iraq", "iron", "isleofman", "jamison", "jefferson", "jerusalem", "jewelry",
|
||||
"jewish", "jewishart", "jfk", "journalism", "judaica", "judygarland", "juedisches",
|
||||
"juif", "karate", "karikatur", "kids", "koebenhavn", "koeln", "kunst", "kunstsammlung",
|
||||
"kunstunddesign", "labor", "labour", "lajolla", "lancashire", "landes", "lans",
|
||||
"xn--lns-qla", "larsson", "lewismiller", "lincoln", "linz", "living", "livinghistory",
|
||||
"localhistory", "london", "losangeles", "louvre", "loyalist", "lucerne", "luxembourg",
|
||||
"luzern", "mad", "madrid", "mallorca", "manchester", "mansion", "mansions", "manx",
|
||||
"marburg", "maritime", "maritimo", "maryland", "marylhurst", "media", "medical",
|
||||
"medizinhistorisches", "meeres", "memorial", "mesaverde", "michigan", "midatlantic",
|
||||
"military", "mill", "miners", "mining", "minnesota", "missile", "missoula", "modern",
|
||||
"moma", "money", "monmouth", "monticello", "montreal", "moscow", "motorcycle", "muenchen",
|
||||
"muenster", "mulhouse", "muncie", "museet", "museumcenter", "museumvereniging", "music",
|
||||
"national", "nationalfirearms", "nationalheritage", "nativeamerican", "naturalhistory",
|
||||
"naturalhistorymuseum", "naturalsciences", "nature", "naturhistorisches",
|
||||
"natuurwetenschappen", "naumburg", "naval", "nebraska", "neues", "newhampshire",
|
||||
"newjersey", "newmexico", "newport", "newspaper", "newyork", "niepce", "norfolk",
|
||||
"north", "nrw", "nuernberg", "nuremberg", "nyc", "nyny", "oceanographic",
|
||||
"oceanographique", "omaha", "online", "ontario", "openair", "oregon", "oregontrail",
|
||||
"otago", "oxford", "pacific", "paderborn", "palace", "paleo", "palmsprings", "panama",
|
||||
"paris", "pasadena", "pharmacy", "philadelphia", "philadelphiaarea", "philately",
|
||||
"phoenix", "photography", "pilots", "pittsburgh", "planetarium", "plantation",
|
||||
"plants", "plaza", "portal", "portland", "portlligat", "posts-and-telecommunications",
|
||||
"preservation", "presidio", "press", "project", "public", "pubol", "quebec",
|
||||
"railroad", "railway", "research", "resistance", "riodejaneiro", "rochester", "rockart",
|
||||
"roma", "russia", "saintlouis", "salem", "salvadordali", "salzburg", "sandiego",
|
||||
"sanfrancisco", "santabarbara", "santacruz", "santafe", "saskatchewan", "satx",
|
||||
"savannahga", "schlesisches", "schoenbrunn", "schokoladen", "school", "schweiz",
|
||||
"science", "scienceandhistory", "scienceandindustry", "sciencecenter", "sciencecenters",
|
||||
"science-fiction", "sciencehistory", "sciences", "sciencesnaturelles", "scotland",
|
||||
"seaport", "settlement", "settlers", "shell", "sherbrooke", "sibenik", "silk", "ski",
|
||||
"skole", "society", "sologne", "soundandvision", "southcarolina", "southwest", "space",
|
||||
"spy", "square", "stadt", "stalbans", "starnberg", "state", "stateofdelaware",
|
||||
"station", "steam", "steiermark", "stjohn", "stockholm", "stpetersburg", "stuttgart",
|
||||
"suisse", "surgeonshall", "surrey", "svizzera", "sweden", "sydney", "tank", "tcm",
|
||||
"technology", "telekommunikation", "television", "texas", "textile", "theater",
|
||||
"time", "timekeeping", "topology", "torino", "touch", "town", "transport", "tree",
|
||||
"trolley", "trust", "trustee", "uhren", "ulm", "undersea", "university", "usa",
|
||||
"usantiques", "usarts", "uscountryestate", "usculture", "usdecorativearts", "usgarden",
|
||||
"ushistory", "ushuaia", "uslivinghistory", "utah", "uvic", "valley", "vantaa",
|
||||
"versailles", "viking", "village", "virginia", "virtual", "virtuel", "vlaanderen",
|
||||
"volkenkunde", "wales", "wallonie", "war", "washingtondc", "watchandclock",
|
||||
"watch-and-clock", "western", "westfalen", "whaling", "wildlife", "williamsburg",
|
||||
"windmill", "workshop", "york", "yorkshire", "yosemite", "youth", "zoological",
|
||||
"zoology", "xn--9dbhblg6di", "xn--h1aegh")));
|
||||
topMap.put( "mv", new HashSet<String>(Arrays.asList("aero", "biz", "com", "coop", "edu", "gov",
|
||||
"info", "int", "mil", "museum", "name", "net", "org", "pro")));
|
||||
topMap.put( "mw", new HashSet<String>(Arrays.asList("ac", "biz", "co", "com", "coop", "edu",
|
||||
"gov", "int", "museum", "net", "org")));
|
||||
topMap.put( "mx", new HashSet<String>(Arrays.asList("com", "org", "gob", "edu", "net")));
|
||||
topMap.put( "my", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu",
|
||||
"mil", "name", "sch")));
|
||||
topMap.put( "na", new HashSet<String>(Arrays.asList("co", "com", "org", "edu", "edunet", "net",
|
||||
"alt", "biz", "info")));
|
||||
topMap.put( "nc", new HashSet<String>(Arrays.asList("asso", "nom")));
|
||||
topMap.put( "net", new HashSet<String>(Arrays.asList("gb", "se", "uk", "za")));
|
||||
topMap.put( "ng", new HashSet<String>(Arrays.asList("name", "sch", "mil", "mobi", "com",
|
||||
"edu", "gov", "net", "org")));
|
||||
topMap.put( "nf", new HashSet<String>(Arrays.asList("com", "net", "per", "rec", "web",
|
||||
"arts", "firm", "info", "other", "store")));
|
||||
topMap.put( "no", new HashSet<String>(Arrays.asList("fhs", "vgs", "fylkesbibl", "folkebibl",
|
||||
"museum", "idrett", "priv", "mil", "stat", "dep", "kommune", "herad", "aa",
|
||||
"ah", "bu", "fm", "hl", "hm", "jan-mayen", "mr", "nl", "nt", "of", "ol", "oslo",
|
||||
"rl", "sf", "st", "svalbard", "tm", "tr", "va", "vf", "akrehamn",
|
||||
"xn--krehamn-dxa", "algard", "xn--lgrd-poac", "arna", "brumunddal",
|
||||
"bryne", "bronnoysund", "xn--brnnysund-m8ac", "drobak",
|
||||
"xn--drbak-wua", "egersund", "fetsund", "floro", "xn--flor-jra",
|
||||
"fredrikstad", "hokksund", "honefoss", "xn--hnefoss-q1a",
|
||||
"jessheim", "jorpeland", "xn--jrpeland-54a", "kirkenes", "kopervik",
|
||||
"krokstadelva", "langevag", "xn--langevg-jxa", "leirvik", "mjondalen",
|
||||
"xn--mjndalen-64a", "mo-i-rana", "mosjoen", "xn--mosjen-eya",
|
||||
"nesoddtangen", "orkanger", "osoyro", "xn--osyro-wua",
|
||||
"raholt", "xn--rholt-mra", "sandnessjoen", "xn--sandnessjen-ogb",
|
||||
"skedsmokorset", "slattum", "spjelkavik", "stathelle", "stavern", "stjordalshalsen",
|
||||
"xn--stjrdalshalsen-sqb", "tananger", "tranby", "vossevangen", "tranby",
|
||||
"vossevangen", "afjord", "xn--fjord-lra", "agdenes", "al",
|
||||
"xn--l-1fa", "alesund", "xn--lesund-hua",
|
||||
"alstahaug", "alta", "xn--lt-liac", "alaheadju",
|
||||
"xn--laheadju-7ya", "alvdal", "amli", "xn--mli-tla",
|
||||
"amot", "xn--mot-tla", "andebu", "andoy", "xn--andy-ira",
|
||||
"andasuolo", "ardal", "xn--rdal-poa", "aremark", "arendal",
|
||||
"xn--s-1fa", "aseral", "xn--seral-lra",
|
||||
"asker", "askim", "askvoll", "askoy", "xn--asky-ira",
|
||||
"asnes", "xn--snes-poa", "audnedaln", "aukra", "aure", "aurland",
|
||||
"aurskog-holand", "xn--aurskog-hland-jnb",
|
||||
"austevoll", "austrheim", "averoy", "xn--avery-yua",
|
||||
"balestrand", "ballangen", "balat", "xn--blt-elab",
|
||||
"balsfjord", "bahccavuotna", "xn--bhccavuotna-k7a",
|
||||
"bamble", "bardu", "beardu", "beiarn", "bajddar", "xn--bjddar-pta",
|
||||
"baidar", "xn--bidr-5nac", "berg", "bergen", "berlevag", "xn--berlevg-jxa",
|
||||
"bearalvahki", "xn--bearalvhki-y4a", "bindal", "birkenes", "bjarkoy",
|
||||
"xn--bjarky-fya", "bjerkreim", "bjugn", "bodo", "xn--bod-2na",
|
||||
"badaddja", "xn--bdddj-mrabd", "budejju", "bokn",
|
||||
"bremanger", "bronnoy", "xn--brnny-wuac", "bygland",
|
||||
"bykle", "barum", "xn--brum-voa", "bievat", "xn--bievt-0qa",
|
||||
"bomlo", "xn--bmlo-gra", "batsfjord", "xn--btsfjord-9za", "bahcavuotna",
|
||||
"xn--bhcavuotna-s4a", "dovre", "drammen", "drangedal", "dyroy",
|
||||
"xn--dyry-ira", "donna", "xn--dnna-gra",
|
||||
"eid", "eidfjord", "eidsberg", "eidskog", "eidsvoll", "eigersund", "elverum",
|
||||
"enebakk", "engerdal", "etne", "etnedal", "evenes", "evenassi",
|
||||
"xn--eveni-0qa01ga", "evje-og-hornnes", "farsund", "fauske",
|
||||
"fuossko", "fuoisku", "fedje", "fet", "finnoy", "xn--finny-yua",
|
||||
"fitjar", "fjaler", "fjell", "flakstad", "flatanger", "flekkefjord", "flesberg",
|
||||
"flora", "fla", "xn--fl-zia", "folldal", "forsand", "fosnes", "frei",
|
||||
"frogn", "froland", "frosta", "frana", "xn--frna-woa",
|
||||
"froya", "xn--frya-hra", "fusa", "fyresdal", "forde",
|
||||
"xn--frde-gra", "gamvik", "gangaviika", "xn--ggaviika-8ya47h",
|
||||
"gaular", "gausdal", "gildeskal", "xn--gildeskl-g0a",
|
||||
"giske", "gjemnes", "gjerdrum", "gjerstad", "gjesdal", "gjovik",
|
||||
"xn--gjvik-wua", "gloppen", "gol", "gran", "grane", "granvin",
|
||||
"gratangen", "grimstad", "grong", "kraanghke", "xn--kranghke-b0a",
|
||||
"grue", "gulen", "hadsel", "halden", "halsa", "hamar", "hamaroy", "habmer",
|
||||
"xn--hbmer-xqa", "hapmir", "xn--hpmir-xqa",
|
||||
"hammerfest", "hammarfeasta", "xn--hmmrfeasta-s4ac",
|
||||
"haram", "hareid", "harstad", "hasvik", "aknoluokta", "xn--koluokta-7ya57h",
|
||||
"hattfjelldal", "aarborte", "haugesund", "hemne", "hemnes", "hemsedal",
|
||||
"hitra", "hjartdal", "hjelmeland",
|
||||
"hobol", "xn--hobl-ira", "hof", "hol", "hole", "holmestrand", "holtalen",
|
||||
"xn--holtlen-hxa", "hornindal", "horten", "hurdal", "hurum", "hvaler",
|
||||
"hyllestad", "hagebostad", "xn--hgebostad-g3a", "hoyanger",
|
||||
"xn--hyanger-q1a", "hoylandet", "xn--hylandet-54a",
|
||||
"ha", "xn--h-2fa", "ibestad", "inderoy", "xn--indery-fya",
|
||||
"iveland", "jevnaker", "jondal", "jolster", "xn--jlster-bya",
|
||||
"karasjok", "karasjohka", "xn--krjohka-hwab49j",
|
||||
"karlsoy", "galsa", "xn--gls-elac", "karmoy",
|
||||
"xn--karmy-yua", "kautokeino", "guovdageaidnu", "klepp", "klabu",
|
||||
"xn--klbu-woa", "kongsberg", "kongsvinger", "kragero", "xn--krager-gya",
|
||||
"kristiansand", "kristiansund", "krodsherad", "xn--krdsherad-m8a",
|
||||
"kvalsund", "rahkkeravju", "xn--rhkkervju-01af",
|
||||
"kvam", "kvinesdal", "kvinnherad", "kviteseid", "kvitsoy", "xn--kvitsy-fya",
|
||||
"kvafjord", "xn--kvfjord-nxa", "giehtavuoatna", "kvanangen",
|
||||
"xn--kvnangen-k0a", "navuotna", "xn--nvuotna-hwa",
|
||||
"kafjord", "xn--kfjord-iua", "gaivuotna", "xn--givuotna-8ya",
|
||||
"larvik", "lavangen", "lavagis", "loabat", "xn--loabt-0qa",
|
||||
"lebesby", "davvesiida", "leikanger", "leirfjord", "leka", "leksvik", "lenvik",
|
||||
"leangaviika", "xn--leagaviika-52b", "lesja", "levanger", "lier", "lierne",
|
||||
"lillehammer", "lillesand", "lindesnes", "lindas", "xn--linds-pra",
|
||||
"lom", "loppa", "lahppi", "xn--lhppi-xqa", "lund", "lunner", "luroy",
|
||||
"xn--lury-ira", "luster", "lyngdal", "lyngen", "ivgu", "lardal", "lerdal",
|
||||
"xn--lrdal-sra", "lodingen", "xn--ldingen-q1a", "lorenskog",
|
||||
"xn--lrenskog-54a", "loten", "xn--lten-gra", "malvik",
|
||||
"masoy", "xn--msy-ula0h", "muosat", "xn--muost-0qa",
|
||||
"mandal", "marker", "marnardal", "masfjorden", "meland", "meldal", "melhus",
|
||||
"meloy", "xn--mely-ira", "meraker", "xn--merker-kua", "moareke",
|
||||
"xn--moreke-jua", "midsund", "midtre-gauldal", "modalen", "modum",
|
||||
"molde", "moskenes", "moss", "mosvik", "malselv", "xn--mlselv-iua",
|
||||
"malatvuopmi", "xn--mlatvuopmi-s4a", "namdalseid", "aejrie", "namsos",
|
||||
"namsskogan", "naamesjevuemie", "xn--nmesjevuemie-tcba",
|
||||
"laakesvuemie", "nannestad", "narvik", "narviika", "naustdal", "nedre-eiker",
|
||||
"nesna", "nesodden", "nesseby", "unjarga", "xn--unjrga-rta", "nesset",
|
||||
"nissedal", "nittedal", "nord-aurdal", "nord-fron", "nord-odal", "norddal",
|
||||
"nordkapp", "davvenjarga", "xn--davvenjrga-y4a", "nordre-land",
|
||||
"nordreisa", "raisa", "xn--risa-5na", "nore-og-uvdal", "notodden", "naroy",
|
||||
"xn--nry-yla5g", "notteroy", "xn--nttery-byae",
|
||||
"odda", "oksnes", "xn--ksnes-uua", "oppdal", "oppegard",
|
||||
"xn--oppegrd-ixa", "orkdal", "orland", "xn--rland-uua",
|
||||
"orskog", "xn--rskog-uua", "orsta", "xn--rsta-fra",
|
||||
"os.hedmark", "os.hordaland", "osen", "osteroy", "xn--ostery-fya",
|
||||
"ostre-toten", "xn--stre-toten-zcb", "overhalla", "ovre-eiker",
|
||||
"xn--vre-eiker-k8a", "oyer", "xn--yer-zna",
|
||||
"oygarden", "xn--ygarden-p1a", "oystre-slidre", "xn--ystre-slidre-ujb",
|
||||
"porsanger", "porsangu", "xn--porsgu-sta26f", "porsgrunn",
|
||||
"radoy", "xn--rady-ira", "rakkestad", "rana", "ruovat", "randaberg",
|
||||
"rauma", "rendalen", "rennebu", "rennesoy", "xn--rennesy-v1a",
|
||||
"rindal", "ringebu", "ringerike", "ringsaker", "rissa", "risor",
|
||||
"xn--risr-ira", "roan", "rollag", "rygge", "ralingen", "xn--rlingen-mxa",
|
||||
"rodoy", "xn--rdy-0nab", "romskog", "xn--rmskog-bya",
|
||||
"roros", "xn--rros-gra", "rost", "xn--rst-0na",
|
||||
"royken", "xn--ryken-vua", "royrvik", "xn--ryrvik-bya",
|
||||
"rade", "xn--rde-ula", "salangen", "siellak", "saltdal", "salat",
|
||||
"xn--slt-elab", "xn--slat-5na", "samnanger",
|
||||
"sandefjord", "sandnes", "sandoy", "xn--sandy-yua", "sarpsborg",
|
||||
"sauda", "sauherad", "sel", "selbu", "selje", "seljord", "sigdal", "siljan",
|
||||
"sirdal", "skaun", "skedsmo", "ski", "skien", "skiptvet", "skjervoy",
|
||||
"xn--skjervy-v1a", "skierva", "xn--skierv-uta",
|
||||
"skjak", "xn--skjk-soa", "skodje", "skanland", "xn--sknland-fxa",
|
||||
"skanit", "xn--sknit-yqa", "smola", "xn--smla-hra",
|
||||
"snillfjord", "snasa", "xn--snsa-roa", "snoasa", "snaase",
|
||||
"xn--snase-nra", "sogndal", "sokndal", "sola", "solund", "songdalen",
|
||||
"sortland", "spydeberg", "stange", "stavanger", "steigen", "steinkjer",
|
||||
"stjordal", "xn--stjrdal-s1a", "stokke", "stor-elvdal", "stord", "stordal",
|
||||
"storfjord", "omasvuotna", "strand", "stranda", "stryn", "sula", "suldal",
|
||||
"sund", "sunndal", "surnadal", "sveio", "svelvik", "sykkylven", "sogne",
|
||||
"xn--sgne-gra", "somna", "xn--smna-gra", "sondre-land",
|
||||
"xn--sndre-land-0cb", "sor-aurdal", "xn--sr-aurdal-l8a",
|
||||
"sor-fron", "xn--sr-fron-q1a", "sor-odal", "xn--sr-odal-q1a",
|
||||
"sor-varanger", "xn--sr-varanger-ggb", "matta-varjjat",
|
||||
"xn--mtta-vrjjat-k7af", "sorfold", "xn--srfold-bya",
|
||||
"sorreisa", "xn--srreisa-q1a", "sorum", "xn--srum-gra",
|
||||
"tana", "deatnu", "time", "tingvoll", "tinn", "tjeldsund", "dielddanuorri",
|
||||
"tjome", "xn--tjme-hra", "tokke", "tolga", "torsken", "tranoy",
|
||||
"xn--trany-yua", "tromso", "xn--troms-zua", "tromsa", "romsa",
|
||||
"trondheim", "troandin", "trysil", "trana", "xn--trna-woa",
|
||||
"trogstad", "xn--trgstad-r1a", "tvedestrand", "tydal", "tynset",
|
||||
"tysfjord", "divtasvuodna", "divttasvuotna", "tysnes", "tysvar",
|
||||
"xn--tysvr-vra", "tonsberg", "xn--tnsberg-q1a",
|
||||
"ullensaker", "ullensvang", "ulvik", "utsira", "vadso", "xn--vads-jra",
|
||||
"cahcesuolo", "xn--hcesuolo-7ya35b", "vaksdal", "valle", "vang",
|
||||
"vanylven", "vardo", "xn--vard-jra", "varggat", "xn--vrggt-xqad",
|
||||
"vefsn", "vaapste", "vega", "vegarshei", "xn--vegrshei-c0a", "vennesla",
|
||||
"verdal", "verran", "vestby", "vestnes", "vestre-slidre", "vestre-toten",
|
||||
"vestvagoy", "xn--vestvgy-ixa6o", "vevelstad", "vik", "vikna",
|
||||
"vindafjord", "volda", "voss", "varoy", "xn--vry-yla5g",
|
||||
"vagan", "xn--vgan-qoa", "voagat", "vagsoy", "xn--vgsy-qoa0j",
|
||||
"vaga", "xn--vg-yiab")));
|
||||
|
||||
topMap.put( "nr", new HashSet<String>(Arrays.asList("biz", "info", "gov", "edu", "org",
|
||||
"net", "com", "co")));
|
||||
topMap.put( "pa", new HashSet<String>(Arrays.asList("ac", "gob", "com", "org",
|
||||
"sld", "edu", "net", "ing", "abo", "med", "nom")));
|
||||
topMap.put( "pe", new HashSet<String>(Arrays.asList("edu", "gob", "nom", "mil", "org", "com",
|
||||
"net", "sld")));
|
||||
topMap.put( "pf", new HashSet<String>(Arrays.asList( "com")));
|
||||
topMap.put( "ph", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "ngo", "mil")));
|
||||
topMap.put( "pk", new HashSet<String>(Arrays.asList("com", "net", "edu", "org", "fam", "biz",
|
||||
"web", "gov", "gob", "gok", "gon", "gop", "gos", "gog", "gkp", "info")));
|
||||
topMap.put( "pl", new HashSet<String>(Arrays.asList("aid", "agro", "atm", "auto", "biz", "com",
|
||||
"edu", "gmina", "gsm", "info", "mail", "miasta", "media", "mil", "net", "nieruchomosci",
|
||||
"nom", "org", "pc", "powiat", "priv", "realestate", "rel", "sex", "shop", "sklep",
|
||||
"sos", "szkola", "targi", "tm", "tourism", "travel", "turystyka", "art",
|
||||
"gov", "ngo", "augustow", "babia-gora", "bedzin", "beskidy",
|
||||
"bialowieza", "bialystok", "bielawa", "bieszczady", "boleslawiec", "bydgoszcz",
|
||||
"bytom", "cieszyn", "czeladz", "czest", "dlugoleka", "elblag", "elk", "glogow",
|
||||
"gniezno", "gorlice", "grajewo", "ilawa", "jaworzno", "jelenia-gora", "jgora",
|
||||
"kalisz", "kazimierz-dolny", "karpacz", "kartuzy", "kaszuby", "katowice", "kepno",
|
||||
"ketrzyn", "klodzko", "kobierzyce", "kolobrzeg", "konin", "konskowola", "kutno",
|
||||
"lapy", "lebork", "legnica", "lezajsk", "limanowa", "lomza", "lowicz", "lubin",
|
||||
"lukow", "malbork", "malopolska", "mazowsze", "mazury", "mielec", "mielno", "mragowo",
|
||||
"naklo", "nowaruda", "nysa", "olawa", "olecko", "olkusz", "olsztyn", "opoczno",
|
||||
"opole", "ostroda", "ostroleka", "ostrowiec", "ostrowwlkp", "pila", "pisz", "podhale",
|
||||
"podlasie", "polkowice", "pomorze", "pomorskie", "prochowice", "pruszkow", "przeworsk",
|
||||
"pulawy", "radom", "rawa-maz", "rybnik", "rzeszow", "sanok", "sejny", "siedlce",
|
||||
"slask", "slupsk", "sosnowiec", "stalowa-wola", "skoczow", "starachowice", "stargard",
|
||||
"suwalki", "swidnica", "swiebodzin", "swinoujscie", "szczecin", "szczytno", "tarnobrzeg",
|
||||
"tgory", "turek", "tychy", "ustka", "walbrzych", "warmia", "warszawa", "waw",
|
||||
"wegrow", "wielun", "wlocl", "wloclawek", "wodzislaw", "wolomin", "wroclaw",
|
||||
"zachpomor", "zagan", "zarow", "zgora", "zgorzelec", "gda", "gdansk",
|
||||
"krakow", "poznan", "wroc", "co",
|
||||
"lodz", "lublin", "torun")));
|
||||
topMap.put( "pn", new HashSet<String>(Arrays.asList("gov", "co", "org", "edu", "net")));
|
||||
topMap.put( "pr", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "isla",
|
||||
"pro", "biz", "info", "name", "est", "prof", "ac", "gobierno")));
|
||||
topMap.put( "pro", new HashSet<String>(Arrays.asList("aca", "bar", "cpa", "jur", "law",
|
||||
"med", "eng")));
|
||||
topMap.put( "ps", new HashSet<String>(Arrays.asList("edu", "gov", "sec", "plo", "com", "org", "net")));
|
||||
topMap.put( "pt", new HashSet<String>(Arrays.asList("net", "gov", "org", "edu", "int", "publ",
|
||||
"com", "nome")));
|
||||
topMap.put( "pw", new HashSet<String>(Arrays.asList("co", "ne", "or", "ed", "go", "belau")));
|
||||
topMap.put( "qa", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "mil")));
|
||||
topMap.put( "re", new HashSet<String>(Arrays.asList("com", "asso", "nom")));
|
||||
topMap.put( "ro", new HashSet<String>(Arrays.asList("com", "org", "tm", "nt", "nom", "info",
|
||||
"rec", "arts", "firm", "store", "www")));
|
||||
topMap.put( "rs", new HashSet<String>(Arrays.asList("co", "org", "edu", "ac", "gov", "in")));
|
||||
topMap.put( "ru", new HashSet<String>(Arrays.asList("ac", "com", "edu", "int", "net", "org",
|
||||
"pp", "adygeya", "altai", "amur", "arkhangelsk", "astrakhan", "bashkiria",
|
||||
"belgorod", "bir", "bryansk", "buryatia", "cap", "cbg", "chel", "chelyabinsk", "chita",
|
||||
"chukotka", "dagestan", "e-burg", "grozny", "irkutsk",
|
||||
"ivanovo", "izhevsk", "jar", "joshkar-ola", "kalmykia", "kaluga", "kamchatka",
|
||||
"karelia", "kazan", "kchr", "kemerovo", "khabarovsk", "khakassia", "khv", "kirov",
|
||||
"koenig", "komi", "kostroma", "krasnoyarsk", "kuban", "kurgan", "kursk", "lipetsk",
|
||||
"magadan", "mari", "mari-el", "marine", "mordovia", "mosreg", "msk", "murmansk",
|
||||
"nalchik", "nnov", "nov", "novosibirsk", "nsk", "omsk", "orenburg", "oryol",
|
||||
"palana", "penza", "perm", "pskov", "ptz", "rnd", "ryazan", "sakhalin", "samara",
|
||||
"saratov", "simbirsk", "smolensk", "spb", "stavropol", "stv", "surgut", "tambov",
|
||||
"tatarstan", "tom", "tomsk", "tsaritsyn", "tsk", "tula", "tuva", "tver", "tyumen",
|
||||
"udm", "udmurtia", "ulan-ude", "vladikavkaz", "vladimir", "vladivostok", "volgograd",
|
||||
"vologda", "voronezh", "vrn", "vyatka", "yakutia", "yamal", "yaroslavl",
|
||||
"yekaterinburg", "yuzhno-sakhalinsk", "amursk", "baikal", "cmw", "fareast",
|
||||
"jamal", "kms", "k-uralsk", "kustanai", "kuzbass", "magnitka", "mytis",
|
||||
"nakhodka", "nkz", "norilsk", "oskol", "pyatigorsk", "rubtsovsk", "snz", "syzran",
|
||||
"vdonsk", "zgrad", "gov", "mil", "test")));
|
||||
topMap.put( "rw", new HashSet<String>(Arrays.asList("gov", "net", "edu", "ac", "com", "co",
|
||||
"int", "mil", "gouv")));
|
||||
topMap.put( "sa", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "med", "pub",
|
||||
"edu", "sch")));
|
||||
topMap.put( "sd", new HashSet<String>(Arrays.asList("com", "net", "org", "edu", "med", "gov",
|
||||
"info", "tv")));
|
||||
topMap.put( "se", new HashSet<String>(Arrays.asList("a", "ac", "b", "bd", "brand", "c", "d",
|
||||
"e", "f", "fh", "fhsk", "fhv", "g", "h", "i", "k", "komforb", "kommunalforbund",
|
||||
"komvux", "l", "lanarb", "lanbib", "m", "n", "naturbruksgymn", "o", "org", "p", "parti",
|
||||
"pp", "press", "r", "s", "sshn", "t", "tm", "u", "w", "x", "y", "z")));
|
||||
topMap.put( "sg", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "per")));
|
||||
topMap.put( "sh", new HashSet<String>(Arrays.asList("co", "com", "net", "org", "gov", "edu", "nom")));
|
||||
topMap.put( "sk", new HashSet<String>(Arrays.asList("gov", "edu")));
|
||||
topMap.put( "sn", new HashSet<String>(Arrays.asList("art", "com", "edu", "gouv", "org", "perso",
|
||||
"univ")));
|
||||
topMap.put( "so", new HashSet<String>(Arrays.asList("com", "net", "org")));
|
||||
topMap.put( "sr", new HashSet<String>(Arrays.asList("co", "com", "consulado", "edu", "embaixada",
|
||||
"gov", "mil", "net", "org", "principe", "saotome", "store")));
|
||||
topMap.put( "sy", new HashSet<String>(Arrays.asList("edu", "gov", "net", "mil", "com", "org", "news")));
|
||||
topMap.put( "sz", new HashSet<String>(Arrays.asList("co", "ac", "org")));
|
||||
topMap.put( "th", new HashSet<String>(Arrays.asList("ac", "co", "go", "in", "mi", "net", "or")));
|
||||
topMap.put( "tj", new HashSet<String>(Arrays.asList("ac", "biz", "co", "com", "edu", "go", "gov",
|
||||
"int", "mil", "name", "net", "nic", "org", "test", "web")));
|
||||
topMap.put( "tn", new HashSet<String>(Arrays.asList("com", "ens", "fin", "gov", "ind", "intl",
|
||||
"nat", "net", "org", "info", "perso", "tourism", "edunet", "rnrt", "rns", "rnu",
|
||||
"mincom", "agrinet", "defense", "turen")));
|
||||
topMap.put( "to", new HashSet<String>(Arrays.asList("gov")));
|
||||
topMap.put( "tt", new HashSet<String>(Arrays.asList("co", "com", "org", "net", "biz", "info",
|
||||
"pro", "int", "coop", "jobs", "mobi", "travel", "museum", "aero", "name", "gov",
|
||||
"edu", "cat", "tel", "mil")));
|
||||
topMap.put( "tw", new HashSet<String>(Arrays.asList("edu", "gov", "mil", "com", "net", "org",
|
||||
"idv", "game", "ebiz", "club", "xn--zf0ao64a", "xn--uc0atv", "xn--czrw28b")));
|
||||
topMap.put( "ua", new HashSet<String>(Arrays.asList("com", "edu", "gov", "in", "net", "org",
|
||||
"cherkassy", "chernigov", "chernovtsy", "ck", "cn", "crimea", "cv", "dn",
|
||||
"dnepropetrovsk", "donetsk", "dp", "if", "ivano-frankivsk", "kh", "kharkov",
|
||||
"kherson", "kiev", "kirovograd", "km", "kr", "ks", "lg",
|
||||
"lugansk", "lutsk", "lviv", "mk", "nikolaev", "od", "odessa", "pl", "poltava",
|
||||
"rovno", "rv", "sebastopol", "sumy", "te", "ternopil", "uzhgorod", "vinnica", "vn",
|
||||
"zaporizhzhe", "zp", "zhitomir", "zt", "cr", "lt", "lv", "sb", "sm", "tr",
|
||||
"co", "biz", "in", "ne", "pp", "uz", "dominic")));
|
||||
topMap.put( "ug", new HashSet<String>(Arrays.asList("co", "ac", "sc", "go", "ne", "or", "org", "com")));
|
||||
topMap.put( "us", new HashSet<String>(Arrays.asList("dni", "fed", "isa", "kids", "nsn", "kyschools")));
|
||||
topMap.put( "uz", new HashSet<String>(Arrays.asList("co", "com", "org", "gov", "ac", "edu", "int", "pp", "net")));
|
||||
topMap.put( "vc", new HashSet<String>(Arrays.asList("com", "net", "org", "gov")));
|
||||
topMap.put( "vi", new HashSet<String>(Arrays.asList("co", "com", "k12", "net", "org")));
|
||||
topMap.put( "vn", new HashSet<String>(Arrays.asList( "com", "net", "org", "edu", "gov", "int",
|
||||
"ac", "biz", "info", "name", "pro", "health")));
|
||||
topMap.put( "vu", new HashSet<String>(Arrays.asList("co", "com", "net", "org", "edu", "gov", "de")));
|
||||
topMap.put("org", new HashSet<String>(Arrays.asList("ae", "za")));
|
||||
topMap.put("pro", new HashSet<String>(Arrays.asList("aca", "bar", "cpa", "jur", "law", "med", "eng")));
|
||||
|
||||
top3Map.put("au", new HashSet<String>(Arrays.asList("act.edu.au", "eq.edu.au",
|
||||
"nsw.edu.au", "nt.edu.au", "qld.edu.au", "sa.edu.au", "tas.edu.au", "vic.edu.au",
|
||||
"wa.edu.au", "act.gov.au", "nsw.gov.au", "nt.gov.au", "qld.gov.au", "sa.gov.au",
|
||||
"tas.gov.au", "vic.gov.au", "wa.gov.au")));
|
||||
top3Map.put("im", new HashSet<String>(Arrays.asList("ltd.co.im", "plc.co.im")));
|
||||
top3Map.put("no", new HashSet<String>(Arrays.asList("gs.aa.no", "gs.ah.no", "gs.bu.no",
|
||||
"gs.fm.no", "gs.hl.no", "gs.hm.no", "gs.jan-mayen.no", "gs.mr.no", "gs.nl.no",
|
||||
"gs.nt.no", "gs.of.no", "gs.ol.no", "gs.oslo.no", "gs.rl.no", "gs.sf.no",
|
||||
"gs.st.no", "gs.svalbard.no", "gs.tm.no", "gs.tr.no", "gs.va.no", "gs.vf.no",
|
||||
"bo.telemark.no", "xn--b-5ga.telemark.no", "bo.nordland.no",
|
||||
"xn--b-5ga.nordland.no", "heroy.more-og-romsdal.no",
|
||||
"xn--hery-ira.xn--mre-og-romsdal-qqb.no", "heroy.nordland.no",
|
||||
"xn--hery-ira.nordland.no", "nes.akershus.no", "nes.buskerud.no",
|
||||
"os.hedmark.no", "os.hordaland.no",
|
||||
"sande.more-og-romsdal.no", "sande.xn--mre-og-romsdal-qqb.no",
|
||||
"sande.vestfold.no", "valer.ostfold.no", "xn--vler-qoa.xn--stfold-9xa.no",
|
||||
"valer.hedmark.no", "xn--vler-qoa.hedmark.no")));
|
||||
top3Map.put("tr", new HashSet<String>(Arrays.asList("gov.nc.tr")));
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Return the registered part of a qualified domain
|
||||
* name or the original if no match is found.
|
||||
*/
|
||||
public static String getRegisteredDomain(String cname) {
|
||||
int dot;
|
||||
|
||||
/*
|
||||
* If one dot or less than just return.
|
||||
*/
|
||||
dot = cname.lastIndexOf('.');
|
||||
if (dot == -1)
|
||||
return cname;
|
||||
if (dot == 0)
|
||||
return "";
|
||||
if (dot == cname.length() - 1) {
|
||||
cname = cname.substring(0, cname.length() -1);
|
||||
dot = cname.lastIndexOf('.');
|
||||
if (dot == -1)
|
||||
return cname;
|
||||
if (dot == 0)
|
||||
return "";
|
||||
}
|
||||
if (dot == cname.length() - 1)
|
||||
return "";
|
||||
|
||||
/*
|
||||
* Break it up into seperate labels.
|
||||
*/
|
||||
int second = cname.lastIndexOf('.', dot - 1);
|
||||
if (second == -1)
|
||||
return cname;
|
||||
if (second == 0)
|
||||
return "";
|
||||
int third = cname.lastIndexOf('.', second - 1);
|
||||
int fourth = -1;
|
||||
if (third > 0) {
|
||||
fourth = cname.lastIndexOf('.', third - 1);
|
||||
}
|
||||
int fifth = -1;
|
||||
if (fourth > 0) {
|
||||
fifth = cname.lastIndexOf('.', fourth - 1);
|
||||
}
|
||||
String s = cname.substring(dot + 1);
|
||||
String s2 = cname.substring(second + 1, dot);
|
||||
|
||||
/*
|
||||
* Look for longest matches first.
|
||||
* XX.PVT.K12.MA.US etc.
|
||||
*/
|
||||
if (fourth != -1 && s.equals("us") && usStateSet.contains(s2)) {
|
||||
String s3 = cname.substring(third + 1, second);
|
||||
String s4 = cname.substring(fourth + 1, third);
|
||||
if (s3.equals("k12")) {
|
||||
if (s2.equals("ma") && (s4.equals("chtr") || s4.equals("paroch"))) {
|
||||
return cname.substring(fifth + 1);
|
||||
} else if (s4.equals("pvt")) {
|
||||
return cname.substring(fifth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* XX.K12.MA.US.
|
||||
*/
|
||||
String str = cname.substring(third + 1);
|
||||
if (third != -1) {
|
||||
Set set = top3Map.get(s);
|
||||
if (set != null) {
|
||||
if (set.contains(str)) {
|
||||
return cname.substring(fourth + 1);
|
||||
}
|
||||
} else if (s.equals("us") && usStateSet.contains(s2)) {
|
||||
// check for known third level labels
|
||||
String s3 = cname.substring(third + 1, second);
|
||||
if (usSubStateSet.contains(s3)) {
|
||||
return fourth != -1? cname.substring(fourth + 1): cname;
|
||||
} else {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
} else if (s.equals("uk")) {
|
||||
if (s2.equals("sch")) {
|
||||
return cname.substring(fourth + 1);
|
||||
}
|
||||
} else if (s.equals("jp")) {
|
||||
if (jpSet.contains(s2)) {
|
||||
if (jp2Set.contains(str)) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(fourth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* PREF.AKITA.JP etc.
|
||||
*/
|
||||
if (jp2Set.contains(str)) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* XX.MA.US.
|
||||
*/
|
||||
Set topSet = topMap.get(s);
|
||||
if (topSet != null) {
|
||||
if (topSet.contains(s2)) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
if (!((s.equals("us") && usStateSet.contains(s2)) || (s.equals("jp") && jpSet.contains(s2)))) {
|
||||
return cname.substring(second + 1);
|
||||
}
|
||||
} else if (top2Set.contains(s)) {
|
||||
if (s2.equals("gov")) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(second + 1);
|
||||
} else if (top3Set.contains(s)) {
|
||||
if (s.equals("ad") && s2.equals("nom") ||
|
||||
s.equals("aw") && s2.equals("com") ||
|
||||
s.equals("be") && s2.equals("ac") ||
|
||||
s.equals("cl") && s2.equals("gov") ||
|
||||
s.equals("cl") && s2.equals("gob") ||
|
||||
s.equals("fi") && s2.equals("aland") ||
|
||||
s.equals("int") && s2.equals("eu") ||
|
||||
s.equals("io") && s2.equals("com") ||
|
||||
s.equals("mc") && s2.equals("tm") ||
|
||||
s.equals("mc") && s2.equals("asso") ||
|
||||
s.equals("vc") && s2.equals("com")) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(second + 1);
|
||||
} else if (top4Set.contains(s)) {
|
||||
if (s2.equals("com") || s2.equals("edu") || s2.equals("gov") ||
|
||||
s2.equals("net") || s2.equals("org")) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(second + 1);
|
||||
} else if (top5Set.contains(s)) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* BB.AA exception cases.
|
||||
*/
|
||||
if (s.equals("tr")) {
|
||||
if (!s2.equals("nic") && !s2.equals("tsk")) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(second + 1);
|
||||
} else if (s.equals("uk")) {
|
||||
if (!ukSet.contains(s2)) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(second + 1);
|
||||
} else if (s.equals("ar")) {
|
||||
if (!arSet.contains(s2)) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(second + 1);
|
||||
} else if (s.equals("om")) {
|
||||
if (!omSet.contains(s2)) {
|
||||
return cname.substring(third + 1);
|
||||
}
|
||||
return cname.substring(second + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* XX.AA
|
||||
*/
|
||||
if (top1Set.contains(s)) {
|
||||
return cname.substring(second + 1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Nothing matched so we can't shorten the string.
|
||||
*/
|
||||
return cname;
|
||||
}
|
||||
}
|
@ -238,4 +238,14 @@ abstract public class URLConnection extends java.net.URLConnection {
|
||||
public void close() {
|
||||
url = null;
|
||||
}
|
||||
|
||||
private static HashMap<String,Void> proxiedHosts = new HashMap<>();
|
||||
|
||||
public synchronized static void setProxiedHost(String host) {
|
||||
proxiedHosts.put(host.toLowerCase(), null);
|
||||
}
|
||||
|
||||
public synchronized static boolean isProxiedHost(String host) {
|
||||
return proxiedHosts.containsKey(host.toLowerCase());
|
||||
}
|
||||
}
|
||||
|
@ -301,7 +301,11 @@ public class HttpClient extends NetworkClient {
|
||||
} else {
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
if (security != null) {
|
||||
security.checkConnect(url.getHost(), url.getPort());
|
||||
if (ret.proxy == Proxy.NO_PROXY || ret.proxy == null) {
|
||||
security.checkConnect(InetAddress.getByName(url.getHost()).getHostAddress(), url.getPort());
|
||||
} else {
|
||||
security.checkConnect(url.getHost(), url.getPort());
|
||||
}
|
||||
}
|
||||
ret.url = url;
|
||||
}
|
||||
@ -457,6 +461,7 @@ public class HttpClient extends NetworkClient {
|
||||
protected synchronized void openServer() throws IOException {
|
||||
|
||||
SecurityManager security = System.getSecurityManager();
|
||||
|
||||
if (security != null) {
|
||||
security.checkConnect(host, port);
|
||||
}
|
||||
@ -469,6 +474,7 @@ public class HttpClient extends NetworkClient {
|
||||
url.getProtocol().equals("https") ) {
|
||||
|
||||
if ((proxy != null) && (proxy.type() == Proxy.Type.HTTP)) {
|
||||
sun.net.www.URLConnection.setProxiedHost(host);
|
||||
privilegedOpenServer((InetSocketAddress) proxy.address());
|
||||
usingProxy = true;
|
||||
return;
|
||||
@ -484,6 +490,7 @@ public class HttpClient extends NetworkClient {
|
||||
* ftp url.
|
||||
*/
|
||||
if ((proxy != null) && (proxy.type() == Proxy.Type.HTTP)) {
|
||||
sun.net.www.URLConnection.setProxiedHost(host);
|
||||
privilegedOpenServer((InetSocketAddress) proxy.address());
|
||||
usingProxy = true;
|
||||
return;
|
||||
|
@ -44,7 +44,7 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import sun.misc.SharedSecrets;
|
||||
import sun.security.krb5.KerberosSecrets;
|
||||
import sun.security.krb5.PrincipalName;
|
||||
/**
|
||||
* Utilities for obtaining and converting Kerberos tickets.
|
||||
@ -378,7 +378,7 @@ public class Krb5Util {
|
||||
*/
|
||||
public static EncryptionKey[] keysFromJavaxKeyTab(
|
||||
KeyTab ktab, PrincipalName cname) {
|
||||
return SharedSecrets.getJavaxSecurityAuthKerberosAccess().
|
||||
return KerberosSecrets.getJavaxSecurityAuthKerberosAccess().
|
||||
keyTabGetEncryptionKeys(ktab, cname);
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.misc;
|
||||
package sun.security.krb5;
|
||||
|
||||
import javax.security.auth.kerberos.KeyTab;
|
||||
import sun.security.krb5.EncryptionKey;
|
46
jdk/src/share/classes/sun/security/krb5/KerberosSecrets.java
Normal file
46
jdk/src/share/classes/sun/security/krb5/KerberosSecrets.java
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package sun.security.krb5;
|
||||
|
||||
import javax.security.auth.kerberos.KeyTab;
|
||||
import sun.misc.Unsafe;
|
||||
|
||||
public class KerberosSecrets {
|
||||
private static final Unsafe unsafe = Unsafe.getUnsafe();
|
||||
private static JavaxSecurityAuthKerberosAccess javaxSecurityAuthKerberosAccess;
|
||||
|
||||
public static void setJavaxSecurityAuthKerberosAccess
|
||||
(JavaxSecurityAuthKerberosAccess jsaka) {
|
||||
javaxSecurityAuthKerberosAccess = jsaka;
|
||||
}
|
||||
|
||||
public static JavaxSecurityAuthKerberosAccess
|
||||
getJavaxSecurityAuthKerberosAccess() {
|
||||
if (javaxSecurityAuthKerberosAccess == null)
|
||||
unsafe.ensureClassInitialized(KeyTab.class);
|
||||
return javaxSecurityAuthKerberosAccess;
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -653,6 +653,13 @@ final class Config {
|
||||
}
|
||||
}
|
||||
debug(keyword + ": " + lib);
|
||||
|
||||
// Check to see if full path is specified to prevent the DLL
|
||||
// preloading attack
|
||||
if (!(new File(lib)).isAbsolute()) {
|
||||
throw new ConfigurationException(
|
||||
"Absolute path required for library value: " + lib);
|
||||
}
|
||||
return lib;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -236,7 +236,8 @@ public final class Secmod {
|
||||
throw new IllegalStateException(e);
|
||||
}
|
||||
if (modules == null) {
|
||||
List<Module> modules = (List<Module>)nssGetModuleList(nssHandle);
|
||||
List<Module> modules = (List<Module>)nssGetModuleList(nssHandle,
|
||||
nssLibDir);
|
||||
this.modules = Collections.unmodifiableList(modules);
|
||||
}
|
||||
return modules;
|
||||
@ -358,7 +359,7 @@ public final class Secmod {
|
||||
* A representation of one PKCS#11 slot in a PKCS#11 module.
|
||||
*/
|
||||
public static final class Module {
|
||||
// name of the native library
|
||||
// path of the native library
|
||||
final String libraryName;
|
||||
// descriptive name used by NSS
|
||||
final String commonName;
|
||||
@ -371,8 +372,10 @@ public final class Secmod {
|
||||
// trust attributes. Used for the KEYSTORE and TRUSTANCHOR modules only
|
||||
private Map<Bytes,TrustAttributes> trust;
|
||||
|
||||
Module(String libraryName, String commonName, boolean fips, int slot) {
|
||||
Module(String libraryDir, String libraryName, String commonName,
|
||||
boolean fips, int slot) {
|
||||
ModuleType type;
|
||||
|
||||
if ((libraryName == null) || (libraryName.length() == 0)) {
|
||||
// must be softtoken
|
||||
libraryName = System.mapLibraryName(SOFTTOKEN_LIB_NAME);
|
||||
@ -397,7 +400,7 @@ public final class Secmod {
|
||||
+ "module: " + libraryName + ", " + commonName);
|
||||
}
|
||||
}
|
||||
this.libraryName = libraryName;
|
||||
this.libraryName = (new File(libraryDir, libraryName)).getPath();
|
||||
this.commonName = commonName;
|
||||
this.slot = slot;
|
||||
this.type = type;
|
||||
@ -752,6 +755,6 @@ public final class Secmod {
|
||||
|
||||
private static native boolean nssInit(String functionName, long handle, String configDir);
|
||||
|
||||
private static native Object nssGetModuleList(long handle);
|
||||
private static native Object nssGetModuleList(long handle, String libDir);
|
||||
|
||||
}
|
||||
|
@ -1790,15 +1790,30 @@ public class PolicyFile extends java.security.Policy {
|
||||
|
||||
CodeSource canonCs = cs;
|
||||
URL u = cs.getLocation();
|
||||
if (u != null && u.getProtocol().equals("file")) {
|
||||
boolean isLocalFile = false;
|
||||
String host = u.getHost();
|
||||
isLocalFile = (host == null || host.equals("") ||
|
||||
host.equals("~") || host.equalsIgnoreCase("localhost"));
|
||||
if (u != null) {
|
||||
if (u.getProtocol().equals("jar")) {
|
||||
// unwrap url embedded inside jar url
|
||||
String spec = u.getFile();
|
||||
int separator = spec.indexOf("!/");
|
||||
if (separator != -1) {
|
||||
try {
|
||||
u = new URL(spec.substring(0, separator));
|
||||
} catch (MalformedURLException e) {
|
||||
// Fail silently. In this case, url stays what
|
||||
// it was above
|
||||
}
|
||||
}
|
||||
}
|
||||
if (u.getProtocol().equals("file")) {
|
||||
boolean isLocalFile = false;
|
||||
String host = u.getHost();
|
||||
isLocalFile = (host == null || host.equals("") ||
|
||||
host.equals("~") || host.equalsIgnoreCase("localhost"));
|
||||
|
||||
if (isLocalFile) {
|
||||
path = u.getFile().replace('/', File.separatorChar);
|
||||
path = ParseUtil.decode(path);
|
||||
if (isLocalFile) {
|
||||
path = u.getFile().replace('/', File.separatorChar);
|
||||
path = ParseUtil.decode(path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4193,15 +4193,11 @@ class Pair<A, B> {
|
||||
return "Pair[" + fst + "," + snd + "]";
|
||||
}
|
||||
|
||||
private static boolean equals(Object x, Object y) {
|
||||
return (x == null && y == null) || (x != null && x.equals(y));
|
||||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
return
|
||||
other instanceof Pair &&
|
||||
equals(fst, ((Pair)other).fst) &&
|
||||
equals(snd, ((Pair)other).snd);
|
||||
Objects.equals(fst, ((Pair)other).fst) &&
|
||||
Objects.equals(snd, ((Pair)other).snd);
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2006, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -318,13 +318,6 @@ public class DistributionPoint {
|
||||
out.write(DerValue.tag_Sequence, tagged);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function for a.equals(b) where both a and b may be null.
|
||||
*/
|
||||
private static boolean equals(Object a, Object b) {
|
||||
return (a == null) ? (b == null) : a.equals(b);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare an object to this DistributionPoint for equality.
|
||||
*
|
||||
@ -340,9 +333,9 @@ public class DistributionPoint {
|
||||
}
|
||||
DistributionPoint other = (DistributionPoint)obj;
|
||||
|
||||
boolean equal = equals(this.fullName, other.fullName)
|
||||
&& equals(this.relativeName, other.relativeName)
|
||||
&& equals(this.crlIssuer, other.crlIssuer)
|
||||
boolean equal = Objects.equals(this.fullName, other.fullName)
|
||||
&& Objects.equals(this.relativeName, other.relativeName)
|
||||
&& Objects.equals(this.crlIssuer, other.crlIssuer)
|
||||
&& Arrays.equals(this.reasonFlags, other.reasonFlags);
|
||||
return equal;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -201,8 +201,8 @@ public class DistributionPointName {
|
||||
}
|
||||
DistributionPointName other = (DistributionPointName)obj;
|
||||
|
||||
return equals(this.fullName, other.fullName) &&
|
||||
equals(this.relativeName, other.relativeName);
|
||||
return Objects.equals(this.fullName, other.fullName) &&
|
||||
Objects.equals(this.relativeName, other.relativeName);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -239,11 +239,4 @@ public class DistributionPointName {
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* Utility function for a.equals(b) where both a and b may be null.
|
||||
*/
|
||||
private static boolean equals(Object a, Object b) {
|
||||
return (a == null) ? (b == null) : a.equals(b);
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "jni.h"
|
||||
#include "jvm.h"
|
||||
#include "jdk_util_md.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -1971,6 +1971,13 @@ Java_com_sun_imageio_plugins_jpeg_JPEGImageReader_readImage
|
||||
return data->abortFlag;
|
||||
}
|
||||
|
||||
if (cinfo->output_components <= 0 ||
|
||||
cinfo->image_width > (0xffffffffu / (unsigned int)cinfo->output_components))
|
||||
{
|
||||
JNU_ThrowByName(env, "javax/imageio/IIOException",
|
||||
"Invalid number of output components");
|
||||
return data->abortFlag;
|
||||
}
|
||||
|
||||
// Allocate a 1-scanline buffer
|
||||
scanLinePtr = (JSAMPROW)malloc(cinfo->image_width*cinfo->output_components);
|
||||
|
@ -367,7 +367,7 @@ static double euclidianDistance(double a, double b) {
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_sun_font_FreetypeFontScaler_createScalerContextNative(
|
||||
JNIEnv *env, jobject scaler, jlong pScaler, jdoubleArray matrix,
|
||||
jboolean ttFont, jint aa, jint fm, jfloat boldness, jfloat italic) {
|
||||
jint aa, jint fm, jfloat boldness, jfloat italic) {
|
||||
double dmat[4], ptsz;
|
||||
FTScalerContext *context =
|
||||
(FTScalerContext*) calloc(1, sizeof(FTScalerContext));
|
||||
|
@ -186,7 +186,11 @@ JNIEXPORT void JNICALL Java_sun_font_SunLayoutEngine_nativeLayout
|
||||
jchar buffer[256];
|
||||
jchar* chars = buffer;
|
||||
if (len > 256) {
|
||||
chars = (jchar*)malloc(len * sizeof(jchar));
|
||||
size_t size = len * sizeof(jchar);
|
||||
if (size / sizeof(jchar) != len) {
|
||||
return;
|
||||
}
|
||||
chars = (jchar*)malloc(size);
|
||||
if (chars == 0) {
|
||||
return;
|
||||
}
|
||||
|
@ -233,9 +233,19 @@ JNIEXPORT jlong JNICALL Java_sun_java2d_cmm_lcms_LCMS_loadProfile
|
||||
jint dataSize;
|
||||
storeID_t sProf;
|
||||
|
||||
if (JNU_IsNull(env, data)) {
|
||||
JNU_ThrowIllegalArgumentException(env, "Invalid profile data");
|
||||
return 0L;
|
||||
}
|
||||
|
||||
dataArray = (*env)->GetByteArrayElements (env, data, 0);
|
||||
dataSize = (*env)->GetArrayLength (env, data);
|
||||
|
||||
if (dataArray == NULL) {
|
||||
JNU_ThrowIllegalArgumentException(env, "Invalid profile data");
|
||||
return 0L;
|
||||
}
|
||||
|
||||
sProf.pf = cmsOpenProfileFromMem((const void *)dataArray,
|
||||
(cmsUInt32Number) dataSize);
|
||||
|
||||
@ -334,8 +344,9 @@ JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_getProfileData
|
||||
}
|
||||
|
||||
/* Get profile header info */
|
||||
cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize);
|
||||
cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize);
|
||||
static cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize);
|
||||
static cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize);
|
||||
static cmsBool _writeCookedTag(cmsHPROFILE pfTarget, cmsTagSignature sig, jbyte *pData, jint size);
|
||||
|
||||
/*
|
||||
* Class: sun_java2d_cmm_lcms_LCMS
|
||||
@ -356,7 +367,7 @@ JNIEXPORT jint JNICALL Java_sun_java2d_cmm_lcms_LCMS_getTagSize
|
||||
result = sizeof(cmsICCHeader);
|
||||
} else {
|
||||
if (cmsIsTag(sProf.pf, sig.cms)) {
|
||||
result = cmsReadRawTag(sProf.pf, sig.cms, NULL, 0);
|
||||
result = cmsReadRawTag(sProf.pf, sig.cms, NULL, 0);
|
||||
} else {
|
||||
JNU_ThrowByName(env, "java/awt/color/CMMException",
|
||||
"ICC profile tag not found");
|
||||
@ -468,22 +479,30 @@ JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_setTagData
|
||||
sProf.j = id;
|
||||
sig.j = tagSig;
|
||||
|
||||
if (JNU_IsNull(env, data)) {
|
||||
JNU_ThrowIllegalArgumentException(env, "Can not write tag data.");
|
||||
return;
|
||||
}
|
||||
|
||||
tagSize =(*env)->GetArrayLength(env, data);
|
||||
|
||||
dataArray = (*env)->GetByteArrayElements(env, data, 0);
|
||||
|
||||
if (dataArray == NULL) {
|
||||
JNU_ThrowIllegalArgumentException(env, "Can not write tag data.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (tagSig == SigHead) {
|
||||
status = _setHeaderInfo(sProf.pf, dataArray, tagSize);
|
||||
} else {
|
||||
status = cmsWriteRawTag(sProf.pf, sig.cms, dataArray, tagSize);
|
||||
status = _writeCookedTag(sProf.pf, sig.cms, dataArray, tagSize);
|
||||
}
|
||||
|
||||
(*env)->ReleaseByteArrayElements(env, data, dataArray, 0);
|
||||
|
||||
if (!status) {
|
||||
JNU_ThrowByName(env, "java/awt/color/CMMException",
|
||||
"Can not write tag data.");
|
||||
JNU_ThrowIllegalArgumentException(env, "Can not write tag data.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -645,7 +664,7 @@ JNIEXPORT void JNICALL Java_sun_java2d_cmm_lcms_LCMS_initLCMS
|
||||
PF_ID_fID = (*env)->GetFieldID (env, Pf, "ID", "J");
|
||||
}
|
||||
|
||||
cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
|
||||
static cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
|
||||
{
|
||||
cmsUInt32Number pfSize = 0;
|
||||
cmsUInt8Number* pfBuffer = NULL;
|
||||
@ -672,7 +691,7 @@ cmsBool _getHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
|
||||
return status;
|
||||
}
|
||||
|
||||
cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
|
||||
static cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
|
||||
{
|
||||
cmsICCHeader pfHeader = { 0 };
|
||||
|
||||
@ -696,3 +715,77 @@ cmsBool _setHeaderInfo(cmsHPROFILE pf, jbyte* pBuffer, jint bufferSize)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static cmsBool _writeCookedTag(cmsHPROFILE pfTarget,
|
||||
cmsTagSignature sig,
|
||||
jbyte *pData, jint size)
|
||||
{
|
||||
cmsBool status;
|
||||
cmsUInt32Number pfSize = 0;
|
||||
cmsUInt8Number* pfBuffer = NULL;
|
||||
|
||||
cmsHPROFILE p = cmsCreateProfilePlaceholder(NULL);
|
||||
if (NULL != p) {
|
||||
cmsICCHeader hdr = { 0 };
|
||||
|
||||
/* Populate the placeholder's header according to target profile */
|
||||
hdr.flags = cmsGetHeaderFlags(pfTarget);
|
||||
hdr.renderingIntent = cmsGetHeaderRenderingIntent(pfTarget);
|
||||
hdr.manufacturer = cmsGetHeaderManufacturer(pfTarget);
|
||||
hdr.model = cmsGetHeaderModel(pfTarget);
|
||||
hdr.pcs = cmsGetPCS(pfTarget);
|
||||
hdr.colorSpace = cmsGetColorSpace(pfTarget);
|
||||
hdr.deviceClass = cmsGetDeviceClass(pfTarget);
|
||||
hdr.version = cmsGetEncodedICCversion(pfTarget);
|
||||
cmsGetHeaderAttributes(pfTarget, &hdr.attributes);
|
||||
cmsGetHeaderProfileID(pfTarget, (cmsUInt8Number*)&hdr.profileID);
|
||||
|
||||
cmsSetHeaderFlags(p, hdr.flags);
|
||||
cmsSetHeaderManufacturer(p, hdr.manufacturer);
|
||||
cmsSetHeaderModel(p, hdr.model);
|
||||
cmsSetHeaderAttributes(p, hdr.attributes);
|
||||
cmsSetHeaderProfileID(p, (cmsUInt8Number*)&(hdr.profileID));
|
||||
cmsSetHeaderRenderingIntent(p, hdr.renderingIntent);
|
||||
cmsSetPCS(p, hdr.pcs);
|
||||
cmsSetColorSpace(p, hdr.colorSpace);
|
||||
cmsSetDeviceClass(p, hdr.deviceClass);
|
||||
cmsSetEncodedICCversion(p, hdr.version);
|
||||
|
||||
|
||||
if (cmsWriteRawTag(p, sig, pData, size)) {
|
||||
if (cmsSaveProfileToMem(p, NULL, &pfSize)) {
|
||||
pfBuffer = malloc(pfSize);
|
||||
if (pfBuffer != NULL) {
|
||||
/* load raw profile data into the buffer */
|
||||
if (!cmsSaveProfileToMem(p, pfBuffer, &pfSize)) {
|
||||
free(pfBuffer);
|
||||
pfBuffer = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
cmsCloseProfile(p);
|
||||
}
|
||||
|
||||
if (pfBuffer == NULL) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* re-open the placeholder profile */
|
||||
p = cmsOpenProfileFromMem(pfBuffer, pfSize);
|
||||
free(pfBuffer);
|
||||
status = FALSE;
|
||||
|
||||
if (p != NULL) {
|
||||
/* Note that pCookedTag points to internal structures of the placeholder,
|
||||
* so this data is valid only while the placeholder is open.
|
||||
*/
|
||||
void *pCookedTag = cmsReadTag(p, sig);
|
||||
if (pCookedTag != NULL) {
|
||||
status = cmsWriteTag(pfTarget, sig, pCookedTag);
|
||||
}
|
||||
pCookedTag = NULL;
|
||||
cmsCloseProfile(p);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
@ -1636,6 +1636,11 @@ cmsInt32Number CMSEXPORT cmsReadRawTag(cmsHPROFILE hProfile, cmsTagSignature sig
|
||||
TagDescriptor = _cmsGetTagDescriptor(sig);
|
||||
|
||||
// Serialize
|
||||
if (!_cmsWriteTypeBase(MemIO, TypeHandler ->Signature)) {
|
||||
cmsCloseIOhandler(MemIO);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!TypeHandler ->WritePtr(TypeHandler, MemIO, Object, TagDescriptor ->ElemCount)) return 0;
|
||||
|
||||
// Get Size and close
|
||||
|
@ -74,6 +74,94 @@ static TransformInterpFunc BicubicInterpStub;
|
||||
TransformInterpFunc *pBilinearFunc = BilinearInterp;
|
||||
TransformInterpFunc *pBicubicFunc = BicubicInterp;
|
||||
|
||||
/*
|
||||
* The dxydxy parameters of the inverse transform determine how
|
||||
* quickly we step through the source image. For tiny scale
|
||||
* factors (on the order of 1E-16 or so) the stepping distances
|
||||
* are huge. The image has been scaled so small that stepping
|
||||
* a single pixel in device space moves the sampling point by
|
||||
* billions (or more) pixels in the source image space. These
|
||||
* huge stepping values can overflow the whole part of the longs
|
||||
* we use for the fixed point stepping equations and so we need
|
||||
* a more robust solution. We could simply iterate over every
|
||||
* device pixel, use the inverse transform to transform it back
|
||||
* into the source image coordinate system and then test it for
|
||||
* being in range and sample pixel-by-pixel, but that is quite
|
||||
* a bit more expensive. Fortunately, if the scale factors are
|
||||
* so tiny that we overflow our long values then the number of
|
||||
* pixels we are planning to visit should be very tiny. The only
|
||||
* exception to that rule is if the scale factor along one
|
||||
* dimension is tiny (creating the huge stepping values), and
|
||||
* the scale factor along the other dimension is fairly regular
|
||||
* or an up-scale. In that case we have a lot of pixels along
|
||||
* the direction of the larger axis to sample, but few along the
|
||||
* smaller axis. Though, pessimally, with an added shear factor
|
||||
* such a linearly tiny image could have bounds that cover a large
|
||||
* number of pixels. Such odd transformations should be very
|
||||
* rare and the absolute limit on calculations would involve a
|
||||
* single reverse transform of every pixel in the output image
|
||||
* which is not fast, but it should not cause an undue stall
|
||||
* of the rendering software.
|
||||
*
|
||||
* The specific test we will use is to calculate the inverse
|
||||
* transformed values of every corner of the destination bounds
|
||||
* (in order to be user-clip independent) and if we can
|
||||
* perform a fixed-point-long inverse transform of all of
|
||||
* those points without overflowing we will use the fast
|
||||
* fixed point algorithm. Otherwise we will use the safe
|
||||
* per-pixel transform algorithm.
|
||||
* The 4 corners are 0,0, 0,dsth, dstw,0, dstw,dsth
|
||||
* Transformed they are:
|
||||
* tx, ty
|
||||
* tx +dxdy*H, ty +dydy*H
|
||||
* tx+dxdx*W, ty+dydx*W
|
||||
* tx+dxdx*W+dxdy*H, ty+dydx*W+dydy*H
|
||||
*/
|
||||
/* We reject coordinates not less than 1<<30 so that the distance between */
|
||||
/* any 2 of them is less than 1<<31 which would overflow into the sign */
|
||||
/* bit of a signed long value used to represent fixed point coordinates. */
|
||||
#define TX_FIXED_UNSAFE(v) (fabs(v) >= (1<<30))
|
||||
static jboolean
|
||||
checkOverflow(jint dxoff, jint dyoff,
|
||||
SurfaceDataBounds *pBounds,
|
||||
TransformInfo *pItxInfo,
|
||||
jdouble *retx, jdouble *rety)
|
||||
{
|
||||
jdouble x, y;
|
||||
|
||||
x = dxoff+pBounds->x1+0.5; /* Center of pixel x1 */
|
||||
y = dyoff+pBounds->y1+0.5; /* Center of pixel y1 */
|
||||
Transform_transform(pItxInfo, &x, &y);
|
||||
*retx = x;
|
||||
*rety = y;
|
||||
if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
x = dxoff+pBounds->x2-0.5; /* Center of pixel x2-1 */
|
||||
y = dyoff+pBounds->y1+0.5; /* Center of pixel y1 */
|
||||
Transform_transform(pItxInfo, &x, &y);
|
||||
if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
x = dxoff+pBounds->x1+0.5; /* Center of pixel x1 */
|
||||
y = dyoff+pBounds->y2-0.5; /* Center of pixel y2-1 */
|
||||
Transform_transform(pItxInfo, &x, &y);
|
||||
if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
x = dxoff+pBounds->x2-0.5; /* Center of pixel x2-1 */
|
||||
y = dyoff+pBounds->y2-0.5; /* Center of pixel y2-1 */
|
||||
Transform_transform(pItxInfo, &x, &y);
|
||||
if (TX_FIXED_UNSAFE(x) || TX_FIXED_UNSAFE(y)) {
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill the edge buffer with pairs of coordinates representing the maximum
|
||||
* left and right pixels of the destination surface that should be processed
|
||||
@ -82,21 +170,19 @@ TransformInterpFunc *pBicubicFunc = BicubicInterp;
|
||||
* Only pixels that map back through the specified (inverse) transform to a
|
||||
* source coordinate that falls within the (0, 0, sw, sh) bounds of the
|
||||
* source image should be processed.
|
||||
* pEdgeBuf points to an array of jints that holds MAXEDGES*2 values.
|
||||
* If more storage is needed, then this function allocates a new buffer.
|
||||
* In either case, a pointer to the buffer actually used to store the
|
||||
* results is returned.
|
||||
* The caller is responsible for freeing the buffer if the return value
|
||||
* is not the same as the original pEdgeBuf passed in.
|
||||
* pEdges points to an array of jints that holds 2 + numedges*2 values where
|
||||
* numedges should match (pBounds->y2 - pBounds->y1).
|
||||
* The first two jints in pEdges should be set to y1 and y2 and every pair
|
||||
* of jints after that represent the xmin,xmax of all pixels in range of
|
||||
* the transformed blit for the corresponding scanline.
|
||||
*/
|
||||
static jint *
|
||||
calculateEdges(jint *pEdgeBuf,
|
||||
static void
|
||||
calculateEdges(jint *pEdges,
|
||||
SurfaceDataBounds *pBounds,
|
||||
TransformInfo *pItxInfo,
|
||||
jlong xbase, jlong ybase,
|
||||
juint sw, juint sh)
|
||||
{
|
||||
jint *pEdges;
|
||||
jlong dxdxlong, dydxlong;
|
||||
jlong dxdylong, dydylong;
|
||||
jlong drowxlong, drowylong;
|
||||
@ -111,10 +197,8 @@ calculateEdges(jint *pEdgeBuf,
|
||||
dy1 = pBounds->y1;
|
||||
dx2 = pBounds->x2;
|
||||
dy2 = pBounds->y2;
|
||||
if ((dy2-dy1) > MAXEDGES) {
|
||||
pEdgeBuf = malloc(2 * (dy2-dy1) * sizeof (*pEdges));
|
||||
}
|
||||
pEdges = pEdgeBuf;
|
||||
*pEdges++ = dy1;
|
||||
*pEdges++ = dy2;
|
||||
|
||||
drowxlong = (dx2-dx1-1) * dxdxlong;
|
||||
drowylong = (dx2-dx1-1) * dydxlong;
|
||||
@ -155,10 +239,22 @@ calculateEdges(jint *pEdgeBuf,
|
||||
ybase += dydylong;
|
||||
dy1++;
|
||||
}
|
||||
|
||||
return pEdgeBuf;
|
||||
}
|
||||
|
||||
static void
|
||||
Transform_SafeHelper(JNIEnv *env,
|
||||
SurfaceDataOps *srcOps,
|
||||
SurfaceDataOps *dstOps,
|
||||
SurfaceDataRasInfo *pSrcInfo,
|
||||
SurfaceDataRasInfo *pDstInfo,
|
||||
NativePrimitive *pMaskBlitPrim,
|
||||
CompositeInfo *pCompInfo,
|
||||
TransformHelperFunc *pHelperFunc,
|
||||
TransformInterpFunc *pInterpFunc,
|
||||
RegionData *pClipInfo, TransformInfo *pItxInfo,
|
||||
jint *pData, jint *pEdges,
|
||||
jint dxoff, jint dyoff, jint sw, jint sh);
|
||||
|
||||
/*
|
||||
* Class: sun_java2d_loops_TransformHelper
|
||||
* Method: Transform
|
||||
@ -187,12 +283,14 @@ Java_sun_java2d_loops_TransformHelper_Transform
|
||||
jint maxlinepix;
|
||||
TransformHelperFunc *pHelperFunc;
|
||||
TransformInterpFunc *pInterpFunc;
|
||||
jint edgebuf[MAXEDGES * 2];
|
||||
jdouble xorig, yorig;
|
||||
jint numedges;
|
||||
jint *pEdges;
|
||||
jdouble x, y;
|
||||
jlong xbase, ybase;
|
||||
jlong dxdxlong, dydxlong;
|
||||
jlong dxdylong, dydylong;
|
||||
jint edgebuf[2 + MAXEDGES * 2];
|
||||
union {
|
||||
jlong align;
|
||||
jint data[LINE_SIZE];
|
||||
} rgb;
|
||||
|
||||
#ifdef MAKE_STUBS
|
||||
static int th_initialized;
|
||||
@ -269,39 +367,62 @@ Java_sun_java2d_loops_TransformHelper_Transform
|
||||
if (srcOps->Lock(env, srcOps, &srcInfo, pHelperPrim->srcflags)
|
||||
!= SD_SUCCESS)
|
||||
{
|
||||
/* edgeArray should already contain zeros for min/maxy */
|
||||
return;
|
||||
}
|
||||
if (dstOps->Lock(env, dstOps, &dstInfo, pMaskBlitPrim->dstflags)
|
||||
!= SD_SUCCESS)
|
||||
{
|
||||
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
|
||||
/* edgeArray should already contain zeros for min/maxy */
|
||||
return;
|
||||
}
|
||||
Region_IntersectBounds(&clipInfo, &dstInfo.bounds);
|
||||
|
||||
Transform_GetInfo(env, itxform, &itxInfo);
|
||||
dxdxlong = DblToLong(itxInfo.dxdx);
|
||||
dydxlong = DblToLong(itxInfo.dydx);
|
||||
dxdylong = DblToLong(itxInfo.dxdy);
|
||||
dydylong = DblToLong(itxInfo.dydy);
|
||||
x = dxoff+dstInfo.bounds.x1+0.5; /* Center of pixel x1 */
|
||||
y = dyoff+dstInfo.bounds.y1+0.5; /* Center of pixel y1 */
|
||||
Transform_transform(&itxInfo, &x, &y);
|
||||
xbase = DblToLong(x);
|
||||
ybase = DblToLong(y);
|
||||
numedges = (dstInfo.bounds.y2 - dstInfo.bounds.y1);
|
||||
if (numedges > MAXEDGES) {
|
||||
pEdges = malloc((2 + 2 * numedges) * sizeof (*pEdges));
|
||||
if (pEdges == NULL) {
|
||||
SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
|
||||
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
|
||||
/* edgeArray should already contain zeros for min/maxy */
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
pEdges = edgebuf;
|
||||
}
|
||||
|
||||
pEdges = calculateEdges(edgebuf, &dstInfo.bounds, &itxInfo,
|
||||
xbase, ybase, sx2-sx1, sy2-sy1);
|
||||
Transform_GetInfo(env, itxform, &itxInfo);
|
||||
|
||||
if (!Region_IsEmpty(&clipInfo)) {
|
||||
srcOps->GetRasInfo(env, srcOps, &srcInfo);
|
||||
dstOps->GetRasInfo(env, dstOps, &dstInfo);
|
||||
if (srcInfo.rasBase && dstInfo.rasBase) {
|
||||
union {
|
||||
jlong align;
|
||||
jint data[LINE_SIZE];
|
||||
} rgb;
|
||||
if (srcInfo.rasBase == NULL || dstInfo.rasBase == NULL) {
|
||||
pEdges[0] = pEdges[1] = 0;
|
||||
} else if (checkOverflow(dxoff, dyoff, &dstInfo.bounds,
|
||||
&itxInfo, &xorig, &yorig))
|
||||
{
|
||||
Transform_SafeHelper(env, srcOps, dstOps,
|
||||
&srcInfo, &dstInfo,
|
||||
pMaskBlitPrim, &compInfo,
|
||||
pHelperFunc, pInterpFunc,
|
||||
&clipInfo, &itxInfo, rgb.data, pEdges,
|
||||
dxoff, dyoff, sx2-sx1, sy2-sy1);
|
||||
} else {
|
||||
SurfaceDataBounds span;
|
||||
jlong dxdxlong, dydxlong;
|
||||
jlong dxdylong, dydylong;
|
||||
jlong xbase, ybase;
|
||||
|
||||
dxdxlong = DblToLong(itxInfo.dxdx);
|
||||
dydxlong = DblToLong(itxInfo.dydx);
|
||||
dxdylong = DblToLong(itxInfo.dxdy);
|
||||
dydylong = DblToLong(itxInfo.dydy);
|
||||
xbase = DblToLong(xorig);
|
||||
ybase = DblToLong(yorig);
|
||||
|
||||
calculateEdges(pEdges, &dstInfo.bounds, &itxInfo,
|
||||
xbase, ybase, sx2-sx1, sy2-sy1);
|
||||
|
||||
Region_StartIteration(env, &clipInfo);
|
||||
while (Region_NextIteration(&clipInfo, &span)) {
|
||||
@ -318,8 +439,8 @@ Java_sun_java2d_loops_TransformHelper_Transform
|
||||
|
||||
/* Note - process at most one scanline at a time. */
|
||||
|
||||
dx1 = pEdges[(dy1 - dstInfo.bounds.y1) * 2];
|
||||
dx2 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 1];
|
||||
dx1 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 2];
|
||||
dx2 = pEdges[(dy1 - dstInfo.bounds.y1) * 2 + 3];
|
||||
if (dx1 < span.x1) dx1 = span.x1;
|
||||
if (dx2 > span.x2) dx2 = span.x2;
|
||||
|
||||
@ -376,21 +497,124 @@ Java_sun_java2d_loops_TransformHelper_Transform
|
||||
}
|
||||
SurfaceData_InvokeRelease(env, dstOps, &dstInfo);
|
||||
SurfaceData_InvokeRelease(env, srcOps, &srcInfo);
|
||||
} else {
|
||||
pEdges[0] = pEdges[1] = 0;
|
||||
}
|
||||
SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
|
||||
SurfaceData_InvokeUnlock(env, srcOps, &srcInfo);
|
||||
if (!JNU_IsNull(env, edgeArray)) {
|
||||
(*env)->SetIntArrayRegion(env, edgeArray, 0, 1, &dstInfo.bounds.y1);
|
||||
(*env)->SetIntArrayRegion(env, edgeArray, 1, 1, &dstInfo.bounds.y2);
|
||||
(*env)->SetIntArrayRegion(env, edgeArray,
|
||||
2, (dstInfo.bounds.y2 - dstInfo.bounds.y1)*2,
|
||||
pEdges);
|
||||
(*env)->SetIntArrayRegion(env, edgeArray, 0, 2+numedges*2, pEdges);
|
||||
}
|
||||
if (pEdges != edgebuf) {
|
||||
free(pEdges);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
Transform_SafeHelper(JNIEnv *env,
|
||||
SurfaceDataOps *srcOps,
|
||||
SurfaceDataOps *dstOps,
|
||||
SurfaceDataRasInfo *pSrcInfo,
|
||||
SurfaceDataRasInfo *pDstInfo,
|
||||
NativePrimitive *pMaskBlitPrim,
|
||||
CompositeInfo *pCompInfo,
|
||||
TransformHelperFunc *pHelperFunc,
|
||||
TransformInterpFunc *pInterpFunc,
|
||||
RegionData *pClipInfo, TransformInfo *pItxInfo,
|
||||
jint *pData, jint *pEdges,
|
||||
jint dxoff, jint dyoff, jint sw, jint sh)
|
||||
{
|
||||
SurfaceDataBounds span;
|
||||
jint dx1, dx2;
|
||||
jint dy1, dy2;
|
||||
jint i, iy;
|
||||
|
||||
dy1 = pDstInfo->bounds.y1;
|
||||
dy2 = pDstInfo->bounds.y2;
|
||||
dx1 = pDstInfo->bounds.x1;
|
||||
dx2 = pDstInfo->bounds.x2;
|
||||
pEdges[0] = dy1;
|
||||
pEdges[1] = dy2;
|
||||
for (iy = dy1; iy < dy2; iy++) {
|
||||
jint i = (iy - dy1) * 2;
|
||||
/* row spans are set to max,min until we find a pixel in range below */
|
||||
pEdges[i + 2] = dx2;
|
||||
pEdges[i + 3] = dx1;
|
||||
}
|
||||
|
||||
Region_StartIteration(env, pClipInfo);
|
||||
while (Region_NextIteration(pClipInfo, &span)) {
|
||||
dy1 = span.y1;
|
||||
dy2 = span.y2;
|
||||
while (dy1 < dy2) {
|
||||
dx1 = span.x1;
|
||||
dx2 = span.x2;
|
||||
i = (dy1 - pDstInfo->bounds.y1) * 2;
|
||||
while (dx1 < dx2) {
|
||||
jdouble x, y;
|
||||
jlong xlong, ylong;
|
||||
|
||||
x = dxoff + dx1 + 0.5;
|
||||
y = dyoff + dy1 + 0.5;
|
||||
Transform_transform(pItxInfo, &x, &y);
|
||||
xlong = DblToLong(x);
|
||||
ylong = DblToLong(y);
|
||||
|
||||
/* Process only pixels with centers in bounds
|
||||
* Test double values to avoid overflow in conversion
|
||||
* to long values and then also test the long values
|
||||
* in case they rounded up and out of bounds during
|
||||
* the conversion.
|
||||
*/
|
||||
if (x >= 0 && y >= 0 && x < sw && y < sh &&
|
||||
WholeOfLong(xlong) < sw &&
|
||||
WholeOfLong(ylong) < sh)
|
||||
{
|
||||
void *pDst;
|
||||
|
||||
if (pEdges[i + 2] > dx1) {
|
||||
pEdges[i + 2] = dx1;
|
||||
}
|
||||
if (pEdges[i + 3] <= dx1) {
|
||||
pEdges[i + 3] = dx1 + 1;
|
||||
}
|
||||
|
||||
/* Get IntArgbPre pixel data from source */
|
||||
(*pHelperFunc)(pSrcInfo,
|
||||
pData, 1,
|
||||
xlong, 0,
|
||||
ylong, 0);
|
||||
|
||||
/* Interpolate result pixels if needed */
|
||||
if (pInterpFunc) {
|
||||
(*pInterpFunc)(pData, 1,
|
||||
FractOfLong(xlong-LongOneHalf), 0,
|
||||
FractOfLong(ylong-LongOneHalf), 0);
|
||||
}
|
||||
|
||||
/* Store/Composite interpolated pixels into dest */
|
||||
pDst = PtrCoord(pDstInfo->rasBase,
|
||||
dx1, pDstInfo->pixelStride,
|
||||
dy1, pDstInfo->scanStride);
|
||||
(*pMaskBlitPrim->funcs.maskblit)(pDst, pData,
|
||||
0, 0, 0,
|
||||
1, 1,
|
||||
pDstInfo, pSrcInfo,
|
||||
pMaskBlitPrim,
|
||||
pCompInfo);
|
||||
}
|
||||
|
||||
/* Increment to next input pixel */
|
||||
dx1++;
|
||||
}
|
||||
|
||||
/* Increment to next scanline */
|
||||
dy1++;
|
||||
}
|
||||
}
|
||||
Region_EndIteration(env, pClipInfo);
|
||||
}
|
||||
|
||||
#define BL_INTERP_V1_to_V2_by_F(v1, v2, f) \
|
||||
(((v1)<<8) + ((v2)-(v1))*(f))
|
||||
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Elliptic Curve Cryptography library.
|
||||
*
|
||||
@ -37,23 +34,7 @@
|
||||
* Dr Vipul Gupta <vipul.gupta@sun.com> and
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "mplogic.h"
|
||||
#include "ec.h"
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Elliptic Curve Cryptography library.
|
||||
*
|
||||
@ -36,23 +33,7 @@
|
||||
* Contributor(s):
|
||||
* Dr Vipul Gupta <vipul.gupta@sun.com>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef __ec_h_
|
||||
#define __ec_h_
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library for binary polynomial field curves.
|
||||
*
|
||||
@ -36,23 +33,7 @@
|
||||
* Contributor(s):
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _EC2_H
|
||||
#define _EC2_H
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library for binary polynomial field curves.
|
||||
*
|
||||
@ -38,23 +35,7 @@
|
||||
* Stephen Fung <fungstep@hotmail.com>, and
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "ec2.h"
|
||||
#include "mp_gf2m.h"
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library for binary polynomial field curves.
|
||||
*
|
||||
@ -38,23 +35,7 @@
|
||||
* Stephen Fung <fungstep@hotmail.com>, and
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "ec2.h"
|
||||
#include "mp_gf2m.h"
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library for binary polynomial field curves.
|
||||
*
|
||||
@ -38,23 +35,7 @@
|
||||
* Stephen Fung <fungstep@hotmail.com>, and
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "ec2.h"
|
||||
#include "mp_gf2m.h"
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library for binary polynomial field curves.
|
||||
*
|
||||
@ -36,23 +33,7 @@
|
||||
* Contributor(s):
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "ec2.h"
|
||||
#include "mplogic.h"
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library for binary polynomial field curves.
|
||||
*
|
||||
@ -38,23 +35,7 @@
|
||||
* Stephen Fung <fungstep@hotmail.com>, and
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories.
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "ec2.h"
|
||||
#include "mplogic.h"
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library.
|
||||
*
|
||||
@ -36,23 +33,7 @@
|
||||
* Contributor(s):
|
||||
* Stephen Fung <fungstep@hotmail.com>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include "ecl-priv.h"
|
||||
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Netscape security libraries.
|
||||
*
|
||||
@ -37,23 +34,7 @@
|
||||
* Dr Vipul Gupta <vipul.gupta@sun.com> and
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _ECC_IMPL_H
|
||||
#define _ECC_IMPL_H
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the Elliptic Curve Cryptography library.
|
||||
*
|
||||
@ -37,23 +34,7 @@
|
||||
* Dr Vipul Gupta <vipul.gupta@sun.com> and
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library.
|
||||
*
|
||||
@ -36,23 +33,7 @@
|
||||
* Contributor(s):
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _ECL_CURVE_H
|
||||
#define _ECL_CURVE_H
|
||||
|
@ -1,30 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with this library; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin Street, 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.
|
||||
*/
|
||||
|
||||
/* *********************************************************************
|
||||
*
|
||||
* Sun elects to have this file available under and governed by the
|
||||
* Mozilla Public License Version 1.1 ("MPL") (see
|
||||
* http://www.mozilla.org/MPL/ for full license text). For the avoidance
|
||||
* of doubt and subject to the following, Sun also elects to allow
|
||||
* licensees to use this file under the MPL, the GNU General Public
|
||||
* License version 2 only or the Lesser General Public License version
|
||||
* 2.1 only. Any references to the "GNU General Public License version 2
|
||||
* or later" or "GPL" in the following shall be construed to mean the
|
||||
* GNU General Public License version 2 only. Any references to the "GNU
|
||||
* Lesser General Public License version 2.1 or later" or "LGPL" in the
|
||||
* following shall be construed to mean the GNU Lesser General Public
|
||||
* License version 2.1 only. However, the following notice accompanied
|
||||
* the original version of this file:
|
||||
*
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla Public License Version
|
||||
* 1.1 (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* The Original Code is the elliptic curve math library.
|
||||
*
|
||||
@ -36,23 +33,7 @@
|
||||
* Contributor(s):
|
||||
* Douglas Stebila <douglas@stebila.ca>, Sun Microsystems Laboratories
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
*********************************************************************** */
|
||||
/*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Use is subject to license terms.
|
||||
*/
|
||||
|
||||
#ifndef _ECL_EXP_H
|
||||
#define _ECL_EXP_H
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user